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
a34557e2dc4d6fabdfbac5adb1cac6c0b6f7d16c
d177e4268b05d3c97f172fb848a98026adca4e1c
/Core/src/tourvn/core/contact/entities/ContactMechTypePurposePK.java
757a8a4a5e1d8c6c546d8fdadc1972c3f4f35084
[]
no_license
nguyennnhancm/TourVN
30860df46a619d1ebcbe90251a45bb9cbc133aa6
5bfba1268fc1e92b820fec52a44f38578c13fd5e
refs/heads/master
2016-09-05T23:51:23.353861
2015-09-17T09:11:11
2015-09-17T09:11:11
42,085,082
0
0
null
null
null
null
UTF-8
Java
false
false
2,013
java
package tourvn.core.contact.entities; import javax.persistence.Column; import javax.persistence.Id; import java.io.Serializable; /** * Created with IntelliJ IDEA. * User: NGUYEN VAN NHAN * Date: 5/31/2015 * Time: 10:19 PM * Media Group * To change this template use File | Settings | File Templates. */ public class ContactMechTypePurposePK implements Serializable { private String contactMechTypeId; private String contactMechPurposeTypeId; @Column(name = "CONTACT_MECH_TYPE_ID", nullable = false, insertable = true, updatable = true, length = 20) @Id public String getContactMechTypeId() { return contactMechTypeId; } public void setContactMechTypeId(String contactMechTypeId) { this.contactMechTypeId = contactMechTypeId; } @Column(name = "CONTACT_MECH_PURPOSE_TYPE_ID", nullable = false, insertable = true, updatable = true, length = 20) @Id public String getContactMechPurposeTypeId() { return contactMechPurposeTypeId; } public void setContactMechPurposeTypeId(String contactMechPurposeTypeId) { this.contactMechPurposeTypeId = contactMechPurposeTypeId; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ContactMechTypePurposePK that = (ContactMechTypePurposePK) o; if (contactMechPurposeTypeId != null ? !contactMechPurposeTypeId.equals(that.contactMechPurposeTypeId) : that.contactMechPurposeTypeId != null) return false; if (contactMechTypeId != null ? !contactMechTypeId.equals(that.contactMechTypeId) : that.contactMechTypeId != null) return false; return true; } @Override public int hashCode() { int result = contactMechTypeId != null ? contactMechTypeId.hashCode() : 0; result = 31 * result + (contactMechPurposeTypeId != null ? contactMechPurposeTypeId.hashCode() : 0); return result; } }
[ "nguyenvannhan@lvsolution.vn" ]
nguyenvannhan@lvsolution.vn
4f9542bb284f6c36d19a1e8475ecf1bb04753e16
0a36d324dd595a4a67cd5162e44b2086ddf6c458
/src/main/java/com/kotakotik/chaoscraft/chaos_events/temp/TEventSpeedRace.java
304cfa0136c00127b6cd576f311dcfb2d25a46ed
[]
no_license
kotakotik22/chaoscraft
616acb87adecacdface0670375530eea8274fc36
84642a2ae16055537aaba64d3b29981783c05cda
refs/heads/master
2023-03-25T05:13:17.668260
2021-03-10T05:32:04
2021-03-10T05:32:04
325,974,573
0
0
null
null
null
null
UTF-8
Java
false
false
6,832
java
package com.kotakotik.chaoscraft.chaos_events.temp; import com.kotakotik.chaoscraft.TranslationKeys; import com.kotakotik.chaoscraft.chaos_handlers.*; import com.kotakotik.chaoscraft.config.Config; import com.kotakotik.chaoscraft.config.ExtraEventConfig; import com.kotakotik.chaoscraft.networking.ModPacket; import com.mojang.blaze3d.systems.RenderSystem; import net.minecraft.client.MainWindow; import net.minecraft.client.Minecraft; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.server.MinecraftServer; import net.minecraft.util.math.BlockPos; import net.minecraft.util.text.TranslationTextComponent; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.client.event.RenderGameOverlayEvent; import net.minecraftforge.event.TickEvent; import net.minecraftforge.event.entity.living.LivingEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.network.NetworkEvent; import org.lwjgl.opengl.GL11; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.function.Supplier; @Mod.EventBusSubscriber //@ChaosEventRegister // event no finished, so dont register it public class TEventSpeedRace extends ChaosEventTemp { @Override public String getEnglish() { return "Speed race"; } @Override public String getEnglishDescription() { return "You must run 100 blocks in 30 seconds or you **die**"; } @Override public String getId() { return "speed_race"; } @Override public int getDuration() { return 30; } public ExtraEventConfig blocksToRun = new ExtraEventConfig(this, "blocksToRun", "How many blocks each player has to run not to die", 100); @Override public List<ExtraEventConfig> getExtraConfig() { return Collections.singletonList(blocksToRun); } @Override public List<Credit> getCredits() { return Collections.singletonList(Credits.HUSKER.credit); } @Override public HashMap<String, String> getExtraTranslations() { HashMap<String, String> map = new HashMap<>(); map.put("chaoscraft.speed_race_text", "You have %s seconds to run %d blocks"); return map; } @Override public void reset() { super.reset(); ticks = 0; } @Override public void start(MinecraftServer server) { super.start(server); new Started().sendToAllClients(); } @Override public void end(MinecraftServer server) { super.end(server); new Ended().sendToAllClients(); } @Override public void tick(MinecraftServer server) { super.tick(server); ticks++; } int ticks = 0; private static HashMap<PlayerEntity, BlockPos> posHashMap = new HashMap<>(); private static HashMap<PlayerEntity, Double> playerDistances = new HashMap<>(); @SubscribeEvent public static void playerMove(LivingEvent.LivingUpdateEvent event) { if(!(event.getEntity() instanceof PlayerEntity)) return; PlayerEntity playerEntity = (PlayerEntity) event.getEntity(); if(playerEntity.world.isRemote) { if(Minecraft.getInstance().player.equals(playerEntity)) { return; } } posHashMap.putIfAbsent(playerEntity, playerEntity.getPosition()); double distance = Math.sqrt( (Math.pow(playerEntity.getPosX() - posHashMap.get(playerEntity).getX(), 2)) + Math.pow(playerEntity.getPosZ() - posHashMap.get(playerEntity).getZ(), 2)); if(!playerEntity.world.isRemote) { playerDistances.putIfAbsent(playerEntity, 0.0); playerDistances.put(playerEntity, playerDistances.get(playerEntity) + distance); } else { ClientHandler.myDistance = ClientHandler.myDistance + distance; } } @OnlyIn(Dist.CLIENT) @Mod.EventBusSubscriber public static class ClientHandler { public static boolean hasEventStarted = false; public static double myDistance = 0; public static int ticksSinceStart = 0; private static int prevTick = -1; @SubscribeEvent public static void tick(TickEvent.ClientTickEvent event) { // i really dont want to do the things i had to do with the timer so ill just use this // weird way of copying it if(ChaosEventHandler.ticksClient != prevTick && hasEventStarted) { prevTick = ChaosEventHandler.ticksClient; ticksSinceStart++; } } @SubscribeEvent public static void render(RenderGameOverlayEvent event) { MainWindow window = event.getWindow(); if (event.getType() == RenderGameOverlayEvent.ElementType.TEXT && hasEventStarted) { TEventSpeedRace instance = (TEventSpeedRace) ChaosEvents.getAsMap().get("speed_race"); GL11.glPushMatrix(); int size = 2; GL11.glScaled(size, size, size); Minecraft MC = Minecraft.getInstance(); RenderSystem.enableBlend(); String text = new TranslationTextComponent("chaoscraft.speed_race_text", instance.getDuration() - ticksSinceStart, instance.blocksToRun.getIntConfigValue().get() - myDistance).getString(); // int gui_position_x = window.getWidth() / 2 /* - MC.fontRenderer.getStringWidth(text) / 2 */; // System.out.println(gui_position_x); int gui_position_x = 50; int gui_position_y = 3; System.out.println(text); MC.fontRenderer.drawString(event.getMatrixStack(), text, gui_position_x, gui_position_y, 0x454545); GL11.glPopMatrix(); } } } public static class Started extends ModPacket { @Override public boolean onReceived(Supplier<NetworkEvent.Context> ctx) { ClientHandler.hasEventStarted = true; ClientHandler.ticksSinceStart = 0; ClientHandler.myDistance = 0; return true; } @Override public boolean canBeReceivedOnServer() { return false; } } public static class Ended extends ModPacket { @Override public boolean onReceived(Supplier<NetworkEvent.Context> ctx) { ClientHandler.hasEventStarted = false; return true; } @Override public boolean canBeReceivedOnServer() { return false; } } }
[ "61428759+kotakotik22@users.noreply.github.com" ]
61428759+kotakotik22@users.noreply.github.com
88e2ca250bc03d72cf94f87561e172d4228feea8
6191d50e472d0649b4af1b4fba631884fb8c3a4b
/src/Main56.java
4308f1a35da94f3838d39485c34f75e2d4c255c5
[]
no_license
LXBOB/Coding
4c28607b44160e8a61861cd1efdca618446a3634
abc2e88a5a85ae9fe4d966c5dc128a244ad86e2b
refs/heads/master
2022-04-06T13:04:11.497377
2020-03-03T12:33:40
2020-03-03T12:33:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,498
java
public class Main56 { private ListNode change(ListNode x) { int temp = x.val; while (x != null && x.val == temp) { x = x.next; } return x; } public ListNode deleteDuplication(ListNode pHead) { ListNode ans = pHead; // 最终链表的头节点 // 确定最终链表的头节点 while (ans != null) { if (ans.next != null && ans.val == ans.next.val) { // 当前ans所指的节点是重复节点 ans = change(ans); } else { // 当前ans所指的节点就是我们最终链表的头节点 break; } } if (ans == null) { return null; } // 判断从ans到链表的尾部,判断每一个节点是否为重复节点。 ListNode lastNode = ans; // 最终链表的尾部节点 ListNode removeNode = lastNode.next; // 遍历剩余的节点的变量 while (removeNode != null) { if (removeNode.next != null && removeNode.val == removeNode.next.val) { // 当前removeNode所指的节点是重复节点 removeNode = change(removeNode); } else { lastNode.next = removeNode; lastNode = removeNode; removeNode = removeNode.next; } } lastNode.next = null; // 1 -> 2 -> 3 -> 4 -> 4 return ans; } } // 1 -> 2 -> 3 -> 4 -> 4
[ "1583724941@qq.com" ]
1583724941@qq.com
6ddb6bc3f2b25a0fdf91a3a3868adad3cbb11ac7
fa0e727a24c0da9be1050d09a1298a7d8d182f5b
/OpenClose/src/Race.java
1b5b8a72c925c04a6b0a42c5f10c3fa416ad8d1f
[]
no_license
KhondokerTanvirHossain/Solid-Principle
66c89ea7cbe5178cc0b379ab799e40238a43131a
9e9ac9e70f66df7c917fb51949734769669d713b
refs/heads/master
2021-03-14T19:23:23.567098
2020-03-12T13:07:56
2020-03-12T13:07:56
246,788,274
0
0
null
null
null
null
UTF-8
Java
false
false
191
java
public class Race extends Car { public Race(String name, int wheel, String company) { super(name, wheel, company); } public int raceRating(){ return 12; } }
[ "k.tanvir.hossain@gmail.com" ]
k.tanvir.hossain@gmail.com
0b9a9e85a7147f47fa56aede7bf9c3392a0f89ac
92d8dff8f0321239b1813f92fb23f9f2204921e2
/snakeyaml/src/test/java/org/yaml/snakeyaml/issues/issue73/TreeSetTest.java
464c7a0e50b6b9187752af1c9f8fb4ba67de0f12
[ "Apache-2.0" ]
permissive
trisrael/ubc_viscog
74d36e25900e22d9d8f3108914fa28559892b5f9
405f1f51659f4e94b330c8c8b9337ea95ffdff1d
refs/heads/master
2021-01-23T06:34:08.917178
2011-11-15T06:45:17
2011-11-15T06:45:17
1,970,653
0
0
null
null
null
null
UTF-8
Java
false
false
2,021
java
/** * Copyright (c) 2008-2011, http://www.snakeyaml.org * * 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.yaml.snakeyaml.issues.issue73; import java.util.TreeSet; import junit.framework.TestCase; import org.yaml.snakeyaml.Yaml; /** * Test bean when the implementation is defined: TreeSet instead of just the * interface Set */ public class TreeSetTest extends TestCase { public void testSetImplementation() { Bean1 bean = new Bean1(); bean.setId("ID123"); TreeSet<String> list = new TreeSet<String>(); list.add("zzz"); list.add("xxx"); list.add("ccc"); bean.setSet(list); Yaml yaml = new Yaml(); String doc = yaml.dump(bean); // System.out.println(doc); // Bean1 loaded = (Bean1) yaml.load(doc); assertEquals(3, loaded.getSet().size()); assertEquals(TreeSet.class, loaded.getSet().getClass()); assertTrue(loaded.getSet().contains("zzz")); assertTrue(loaded.getSet().contains("xxx")); assertTrue(loaded.getSet().contains("ccc")); } public static class Bean1 { private TreeSet<String> set; private String id; public TreeSet<String> getSet() { return set; } public void setSet(TreeSet<String> set) { this.set = set; } public String getId() { return id; } public void setId(String id) { this.id = id; } } }
[ "tgoffman@gmail.com" ]
tgoffman@gmail.com
64ee8fedc82d577ebd245f084ce8db2ea07fae56
e0fb6267f93100ddab09c3cfbd2365858f2f4e7c
/src/main/java/com/cn/three/sms/SmsWebApiKit.java
5a316f9ae26fa16eff9abcfc255af7bc3f086075
[]
no_license
erbaocui/ecapi
22fb56f8d294b51303ccb6f651a727629f61ca9d
0b5a1c0a08ef9f60d696de75bc0e5ee5c40de631
refs/heads/master
2021-09-01T05:20:25.860811
2017-12-25T02:44:36
2017-12-25T02:44:36
108,109,764
0
0
null
null
null
null
UTF-8
Java
false
false
1,666
java
package com.cn.three.sms; /** * 服务端发起验证请求验证移动端(手机)发送的短信 * @author Administrator * */ public class SmsWebApiKit { private String appkey; public SmsWebApiKit(String appkey) { super(); this.appkey = appkey; } /** * 服务端发起发送短信请求 * @return * @throws Exception */ public String sendMsg(String phone,String zone) throws Exception{ String address = "https://xxxx"; MobClient client = null; try { client = new MobClient(address); client.addParam("appkey", appkey).addParam("phone", phone) .addParam("zone", zone); client.addRequestProperty("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8"); client.addRequestProperty("Accept", "application/json"); String result = client.post(); return result; } finally { client.release(); } } /** * 服务端发验证服务端发送的短信 * @return * @throws Exception */ public String checkcode(String phone,String zone,String code) throws Exception{ String address = "https://webapi.sms.mob.com/sms/verify"; MobClient client = null; try { client = new MobClient(address); client.addParam("appkey", appkey).addParam("phone", phone) .addParam("zone", zone).addParam("code", code); client.addRequestProperty("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8"); client.addRequestProperty("Accept", "application/json"); String result = client.post(); return result; } finally { client.release(); } } public static void main(String[] args) throws Exception { new SmsWebApiKit("xx").sendMsg("", "xx"); } }
[ "cuijiapeng@gmail.com" ]
cuijiapeng@gmail.com
1d415973018f4fa9a294375402945ac2fce1612d
90836d5ae10dc492beb312406865083d86548950
/T508AC_DEMO_AS/app/src/main/java/com/POS/apis/BuzzerController/BuzzerControllerActivity.java
3e42b19a5b4ef57b0965175450dac5472d555bcb
[]
no_license
joshphur/T508AC_DEMO_AS
8cdb85047016307bea4fae5464560bee2288b13d
90c7d9b00053591c2b5e8ab7893da5e3f2954631
refs/heads/master
2022-12-09T14:10:52.437149
2020-09-23T10:05:18
2020-09-23T10:05:18
297,925,914
0
1
null
null
null
null
UTF-8
Java
false
false
2,032
java
package com.POS.apis.BuzzerController; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.Toast; import android_jb.com.POSD.controllers.BuzzerController; import jepower.com.t508ac_demo.R; public class BuzzerControllerActivity extends Activity implements OnClickListener { private Button btn_open = null; private Button btn_close = null; private BuzzerController buzzerController = null; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.buzzer_controller_layout); btn_open = (Button) findViewById(R.id.btn_open); btn_close = (Button) findViewById(R.id.btn_close); btn_open.setOnClickListener(this); btn_close.setOnClickListener(this); buzzerController = BuzzerController.getInstance(); } @Override public void onClick(View arg0) { // TODO Auto-generated method stub switch (arg0.getId()) { case R.id.btn_open: Open(); break; case R.id.btn_close: Close(); break; default: break; } } @Override protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); buzzerController.BuzzerController_Close(); } private void Close() { // TODO Auto-generated method stub int flag = buzzerController.BuzzerController_Close(); if (flag == 0) { Toast.makeText(this, "Buzzer_Close_Success", Toast.LENGTH_SHORT) .show(); } else if (flag == -1) { Toast.makeText(this, "Buzzer_Close_Failure", Toast.LENGTH_SHORT) .show(); } } private void Open() { // TODO Auto-generated method stub int flag = buzzerController.BuzzerController_Open(); System.out.println("flag === " + flag); if (flag == 0) { Toast.makeText(this, "Buzzer_Open_Success", Toast.LENGTH_SHORT) .show(); } else if (flag == -1) { Toast.makeText(this, "Buzzer_Open_Failure", Toast.LENGTH_SHORT) .show(); } } }
[ "j4matt@gmail.com" ]
j4matt@gmail.com
79b1839c1d00124076f5c80c7a3093647e60fb2c
74ef6a48adea4c350c3b48b834220d213cc084ad
/src/main/java/cn/mldn/demo/SelfDefinedObjSaveViaArrayList.java
6a32940e107a0fd742477f3ba141fc3117ad5ce9
[]
no_license
zhankun12345/JavaLearning
93ebfd2cf116ff5dc4e28c202c23805d64164750
3fa546795097e40c16e4a116222041ea7d024e20
refs/heads/master
2023-01-06T22:20:21.387892
2020-11-04T07:54:17
2020-11-04T07:54:17
null
0
0
null
null
null
null
GB18030
Java
false
false
2,025
java
package cn.mldn.demo; import java.util.ArrayList; import java.util.List; class Person4SelfDefinedObjSaveViaArrayList { private String name; private int age; public Person4SelfDefinedObjSaveViaArrayList(String name, int age) { super(); this.name = name; this.age = age; } @Override public boolean equals(Object obj) { if(this == obj) { return true; } if(null == obj) { return false; } if(!(obj instanceof Person4SelfDefinedObjSaveViaArrayList)) { return false; } Person4SelfDefinedObjSaveViaArrayList per = (Person4SelfDefinedObjSaveViaArrayList)obj; return ((this.name.equals(per.name)) && (this.age == per.age)); } @Override public String toString() { return "Person4SelfDefinedObjSaveViaArrayList [name=" + name + ", age=" + age + "]"; } } public class SelfDefinedObjSaveViaArrayList { public static void main(String[] args) { System.out.println("Lesson 6.127 自定义类对象保存:"); List<Person4SelfDefinedObjSaveViaArrayList> all = new ArrayList<Person4SelfDefinedObjSaveViaArrayList>(); all.add(new Person4SelfDefinedObjSaveViaArrayList("张三", 11)); all.add(new Person4SelfDefinedObjSaveViaArrayList("李四", 22)); all.add(new Person4SelfDefinedObjSaveViaArrayList("小强", 33)); System.out.println("使用List保存自定义类对象,如果需要用到contains、remove方法进行查询、删除处理时,一定要保证类中覆写equals方法:"); System.out.println(all.contains(new Person4SelfDefinedObjSaveViaArrayList("小强", 33))); all.remove(new Person4SelfDefinedObjSaveViaArrayList("小强", 33)); all.forEach(System.out::println);//方法引用代替消费型接口 } }
[ "jian.sun.ms@faw-vw.com" ]
jian.sun.ms@faw-vw.com
3738adb7c6fe856c5a990f27f902ca44826b6f3d
532960b369d1364e7ed58e6a3650f3f43c6d7dac
/src/main/java/com/openkm/servlet/MimeIconServlet.java
240f7e082274c0b5ccf88e20cdf4bf9dd60e2602
[]
no_license
okelah/openkm-code
f0c02062d909b2d5e185b9784b33a9b8753be948
d9e0687e0c6dab385cac0ce8b975cb92c8867743
refs/heads/master
2021-01-13T15:53:59.286016
2016-08-18T22:06:25
2016-08-18T22:06:25
76,772,981
1
1
null
null
null
null
UTF-8
Java
false
false
2,363
java
/** * OpenKM, Open Document Management System (http://www.openkm.com) * Copyright (c) 2006-2015 Paco Avila & Josep Llort * * No bytes were intentionally harmed during the development of this application. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ package com.openkm.servlet; import java.io.IOException; import java.io.OutputStream; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons.io.IOUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.openkm.core.DatabaseException; import com.openkm.dao.MimeTypeDAO; import com.openkm.dao.bean.MimeType; import com.openkm.util.SecureStore; /** * Mime Icon Servlet */ public class MimeIconServlet extends HttpServlet { private static Logger log = LoggerFactory.getLogger(MimeIconServlet.class); private static final long serialVersionUID = 1L; /** * */ public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { String mime = request.getPathInfo(); OutputStream os = null; try { if (mime.length() > 1) { MimeType mt = MimeTypeDAO.findByName(mime.substring(1)); if (mt != null) { byte[] img = SecureStore.b64Decode(new String(mt.getImageContent())); response.setContentType(mt.getImageMime()); response.setContentLength(img.length); os = response.getOutputStream(); os.write(img); os.flush(); } } } catch (DatabaseException e) { log.error(e.getMessage(), e); } finally { IOUtils.closeQuietly(os); } } }
[ "github@sven-joerns.de" ]
github@sven-joerns.de
875448ce72882ced67fa8ec09a0146fcfe250828
2a51b44fbe392c57e04cedab353a142ce98b23ca
/app/src/main/java/com/example/opilane/myapplication/MainActivity.java
20736797b596c1800c8de69071dda6d0dbd6202a
[]
no_license
KadiT17/MyApplication2
149fa8751779ddcc5d6845e154df170a50ce4dfa
3d990578a50d55eb179abbfb62f247ef077b97e7
refs/heads/master
2021-08-12T01:52:53.609504
2017-11-14T09:20:13
2017-11-14T09:20:13
110,668,735
0
0
null
null
null
null
UTF-8
Java
false
false
1,080
java
package com.example.opilane.myapplication; import android.annotation.SuppressLint; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; public class MainActivity extends AppCompatActivity { public static final String EXTRA_MESSAGE = "com.example.myfirstapp.MESSAGE"; EditText tekst; Button send; @SuppressLint("WrongViewCast") @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); tekst= (EditText) findViewById(R.id.test); send=(Button) findViewById(R.id.btnSend); } public void saada (View view){ Intent intent = new Intent(this, DisplayMessageActivity.class); EditText editText = (EditText) findViewById(R.id.test); String message = editText.getText().toString(); intent.putExtra(EXTRA_MESSAGE, message); startActivity(intent); } }
[ "opilane@tthk.ee" ]
opilane@tthk.ee
d979d7b2ba99dfc4b31dff1ae6f11c11d4fefe65
1c7e004833789d6a1dbf0e3fe13cf171bae5b01a
/src/main/java/com/meerkat/easymon/service/MonitLogService.java
98049cfa55f7cb01be786cf1b61089342eb75423
[ "Apache-2.0" ]
permissive
Ivan4412/easymon
70d8960006cc246ee72b5a67d9c14f9ea82bf442
f3724ece68c50b8c07aa0b298bf2849fbe86dcd2
refs/heads/main
2023-03-12T18:54:21.764533
2021-03-02T08:54:47
2021-03-02T08:54:47
343,358,663
2
0
null
null
null
null
UTF-8
Java
false
false
2,034
java
package com.meerkat.easymon.service; import com.meerkat.easymon.data.gen.model.TMonitLog; import org.springframework.stereotype.Service; import java.util.List; /** * author : yjs * createTime : 2018/6/5 * description : 监控信息日志服务类 * version : 1.0 */ @Service public interface MonitLogService { /** * 记录监控信息日志 */ boolean insert(TMonitLog monitLog); /** * 根据ruled_id查询日志信息 */ List<TMonitLog> findMonitLogByRuleId(String ruleId); /** * 根据ruled_id查询最新一条日志信息 */ TMonitLog findMonitLogByRuleIdLastOne(String ruleId, String receiverId); /** * 根据ruled_id查询最新一条日志信息 */ TMonitLog findMonitLogByRuleIdLastOneToday(String ruleId); /** * 根据ruled_id和receiver_id查询在noticeInterval时间内最新一条成功发送邮件日志信息 */ TMonitLog findMonitLogByRuleIdLastOneMail(String ruleId, String receiverId, long noticeInterval); /** * 根据ruled_id查询在noticeInterval时间内最新一条成功发送微信日志信息 */ TMonitLog findMonitLogByRuleIdLastOneWeChat(String ruleId, long noticeInterval); /** * 根据ruled_id查询在当天内最新一条成功发送微信日志信息 */ TMonitLog findMonitLogByRuleIdTodayWeChat(String ruleId); /** * 根据ruled_id和receiver_id查询在noticeInterval时间内最新一条成功发送短信日志信息 */ TMonitLog findMonitLogByRuleIdLastOneTelephone(String ruleId, String receiverId, long noticeInterval); /** * 根据ruled_id和receiver_id查询在当天内最新一条成功发送短信日志信息 */ TMonitLog findMonitLogByRuleIdTodayTelephone(String ruleId, String receiverId); /** * 根据ruled_id查询在noticeInterval时间段的日志信息(查询receiver_id为null的那条) */ List<TMonitLog> findMonitLogListByRuleIdAndInterval(String ruleId, long noticeInterval); }
[ "yangjingsong@utrust.cn" ]
yangjingsong@utrust.cn
d8516a4be7dfac51d2bde236bc62d6129678d9f1
b65e4e1cc951149093de1fb674908b7bcecce1db
/A8/Assignment/AssignmentB.java
eea856e2734cad64f800d8f74db243a153437c31
[]
no_license
ameniawy/Advanced-Data-Structures-And-Algorithms
d6a0063148f7a52bcc097e9f143cc01f244f3505
0ca5ae3646016553ae22d890e019225d88900e93
refs/heads/master
2020-04-23T02:38:58.959244
2019-05-05T09:27:44
2019-05-05T09:27:44
170,852,838
0
0
null
null
null
null
UTF-8
Java
false
false
4,864
java
import java.io.*; import java.util.ArrayList; import java.util.StringTokenizer; import java.util.Collections; public class AssignmentB { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out); int q = sc.nextInt(); while (q-- > 0) { } out.flush(); out.close(); } public static class TrieNode { int count; TrieNode left; TrieNode right; public TrieNode() { } public TrieNode(int count) { this.count = count; } } public static class BitTrie { TNode head; int bitComp; int bitCompp; public BitTrie(int numBits) { this.bitComp = 1 << (numBits - 1); this.bitCompp = this.bitComp << 1; this.head = new TrieNode(); } public void insert(int value) { this.insert(value, this.bitComp, head); } private TNode insert(int value, int comparator, TNode node) { if (node == null) node = new TNode(); node.count += 1; if (comparator == 0) return node; if (value >= comparator) node.oneChild = insert(value - comparator, comparator >> 1, node.oneChild); else node.zeroChild = insert(value, comparator >> 1, node.zeroChild); return node; } public long query(int value, int limit) { return query(value, limit, this.head.zeroChild, this.bitComp, 0) + query(value, limit, this.head.oneChild, this.bitComp, 1); } private long query(int value, int limit, TNode currentNode, int comparator, int enteringVal) { if (currentNode == null || currentNode.count == 0) return 0; int xorBit = value >= comparator ? 1 : 0; int limitCurrentBit = limit >= comparator ? 1 : 0; int currentBit = xorBit ^ enteringVal; int nextValue = xorBit == 1 ? value - comparator : value; int nextLimit = limitCurrentBit == 1 ? limit - comparator : limit; if (limitCurrentBit == 1) { if (currentBit == 0) return currentNode.count; else return query(nextValue, nextLimit, currentNode.oneChild, comparator >> 1, 1) + query(nextValue, nextLimit, currentNode.zeroChild, comparator >> 1, 0); } else { if (currentBit == 0) return query(nextValue, nextLimit, currentNode.oneChild, comparator >> 1, 1) + query(nextValue, nextLimit, currentNode.zeroChild, comparator >> 1, 0); else return 0; } } } static class Scanner { StringTokenizer st; BufferedReader br; public Scanner(InputStream s) { br = new BufferedReader(new InputStreamReader(s)); } public String next() throws IOException { while (st == null || !st.hasMoreTokens()) st = new StringTokenizer(br.readLine()); return st.nextToken(); } public int nextInt() throws IOException { return Integer.parseInt(next()); } public long nextLong() throws IOException { return Long.parseLong(next()); } public String nextLine() throws IOException { return br.readLine(); } public double nextDouble() throws IOException { String x = next(); StringBuilder sb = new StringBuilder("0"); double res = 0, f = 1; boolean dec = false, neg = false; int start = 0; if (x.charAt(0) == '-') { neg = true; start++; } for (int i = start; i < x.length(); i++) if (x.charAt(i) == '.') { res = Long.parseLong(sb.toString()); sb = new StringBuilder("0"); dec = true; } else { sb.append(x.charAt(i)); if (dec) f *= 10; } res += Long.parseLong(sb.toString()) / f; return res * (neg ? -1 : 1); } public boolean ready() throws IOException { return br.ready(); } public boolean nextEmpty() throws IOException { String s = nextLine(); st = new StringTokenizer(s); return s.isEmpty(); } } }
[ "ameniawy18@gmail.com" ]
ameniawy18@gmail.com
b980593dd21558b17951b02c66ae71108edc101a
207314421e45b9c93f6859d61c6eedf1e5a4d207
/springcloud-consumer-dept-80/src/main/java/com/jun/springcloud/config/ConfigBean.java
875dc2afbd948a07339d2e6d43e3895a5ea91862
[]
no_license
15626862046/springcloud-test
2feca458a2cf9cf7239fb56e13a827827e158088
97aef355c75980601aeeeefeb04f24cc4acbf25d
refs/heads/master
2022-09-17T10:04:52.435364
2020-05-07T06:43:57
2020-05-07T06:44:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
805
java
package com.jun.springcloud.config; import com.netflix.loadbalancer.IRule; import com.netflix.loadbalancer.RandomRule; import org.springframework.cloud.client.loadbalancer.LoadBalanced; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.client.RestTemplate; @Configuration public class ConfigBean { /** * //配置负载均衡实现RestTemplate ,Ribbon * IRule * AvailabilityFilteringRule:会先过滤掉 ,跳闸,访问故障的服务,对盛下的进行轮询 * RandomRule:随机 * RetryRule:先按照轮询,失败后再重试 * * @return */ @Bean @LoadBalanced public RestTemplate getRestTemplate() { return new RestTemplate(); } }
[ "731177205@qq.com" ]
731177205@qq.com
5465444dc368f3cdb3b327b77024af6aeba2d012
461571745b8f64c8c3a4691ddd534e9b18cf74cb
/HelloEurakaClient/src/main/java/com/karl/pre/web/ClientController.java
3546edade364ef132e13f7a61b9fcfeb3b47d24c
[]
no_license
ssmellon/spring-boot
92c8e5452fbe49f491d7f0e722cdec23d235f7b9
c3757f61950b95f0608c23cf5e9804525d9a15a2
refs/heads/master
2020-04-20T23:57:16.620060
2019-03-18T13:39:30
2019-03-18T13:39:30
169,182,066
0
0
null
null
null
null
UTF-8
Java
false
false
1,467
java
package com.karl.pre.web; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import java.util.HashMap; import java.util.Map; @RestController @RequestMapping("/client") public class ClientController { @GetMapping("/hello") public ResponseEntity<String> hello() { System.out.println("get hello ~ "); return new ResponseEntity<>("get hello ~ ", HttpStatus.OK); } @PostMapping("/hello") public ResponseEntity<String> hello1() { System.out.println("post hello ~ "); return new ResponseEntity<>("post hello", HttpStatus.OK); } @PostMapping("/world/{path}") public ResponseEntity<Map<String, String>> world(@PathVariable("path") String path, @RequestParam("wor") String wor, @RequestBody String hello) { Map<String, String> ret = new HashMap<>(); ret.put("path", path); ret.put("wor", wor); ret.put("hello", hello); return new ResponseEntity<>(ret, HttpStatus.OK); } /** test the canary */ @GetMapping("/v1") public ResponseEntity<String> v1() { return new ResponseEntity<>("get v1", HttpStatus.OK); } @GetMapping("/v2") public ResponseEntity<String> v2() { return new ResponseEntity<>("get v2", HttpStatus.OK); } }
[ "1549145229@qq.com" ]
1549145229@qq.com
7dfd6f0837f7dad952e101f433fdb048b74f35e7
a636258c60406f8db850d695b064836eaf75338b
/src-gen/org/openbravo/model/common/invoice/InvoiceTax.java
9ce232505f7b59bf24f3aa21fb09defa567729a3
[]
no_license
Afford-Solutions/openbravo-payroll
ed08af5a581fa41455f4e9b233cb182d787d5064
026fee4fe79b1f621959670fdd9ae6dec33d263e
refs/heads/master
2022-03-10T20:43:13.162216
2019-11-07T18:31:05
2019-11-07T18:31:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,531
java
/* ************************************************************************* * The contents of this file are subject to the Openbravo Public License * Version 1.1 (the "License"), being the Mozilla Public License * Version 1.1 with a permitted attribution clause; you may not use this * file except in compliance with the License. You may obtain a copy of * the License at http://www.openbravo.com/legal/license.html * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * The Original Code is Openbravo ERP. * The Initial Developer of the Original Code is Openbravo SLU * All portions are Copyright (C) 2008-2011 Openbravo SLU * All Rights Reserved. * Contributor(s): ______________________________________. ************************************************************************ */ package org.openbravo.model.common.invoice; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Date; import java.util.List; import org.openbravo.base.structure.ActiveEnabled; import org.openbravo.base.structure.BaseOBObject; import org.openbravo.base.structure.ClientEnabled; import org.openbravo.base.structure.OrganizationEnabled; import org.openbravo.base.structure.Traceable; import org.openbravo.model.ad.access.User; import org.openbravo.model.ad.system.Client; import org.openbravo.model.common.enterprise.Organization; import org.openbravo.model.financialmgmt.tax.TaxRate; import org.openbravo.model.financialmgmt.tax.TaxRegisterline; /** * Entity class for entity InvoiceTax (stored in table C_InvoiceTax). * * NOTE: This class should not be instantiated directly. To instantiate this * class the {@link org.openbravo.base.provider.OBProvider} should be used. */ public class InvoiceTax extends BaseOBObject implements Traceable, ClientEnabled, OrganizationEnabled, ActiveEnabled { private static final long serialVersionUID = 1L; public static final String TABLE_NAME = "C_InvoiceTax"; public static final String ENTITY_NAME = "InvoiceTax"; public static final String PROPERTY_TAX = "tax"; public static final String PROPERTY_INVOICE = "invoice"; public static final String PROPERTY_CLIENT = "client"; public static final String PROPERTY_ORGANIZATION = "organization"; public static final String PROPERTY_ACTIVE = "active"; public static final String PROPERTY_CREATIONDATE = "creationDate"; public static final String PROPERTY_CREATEDBY = "createdBy"; public static final String PROPERTY_UPDATED = "updated"; public static final String PROPERTY_UPDATEDBY = "updatedBy"; public static final String PROPERTY_TAXABLEAMOUNT = "taxableAmount"; public static final String PROPERTY_TAXAMOUNT = "taxAmount"; public static final String PROPERTY_LINENO = "lineNo"; public static final String PROPERTY_ID = "id"; public static final String PROPERTY_RECALCULATE = "recalculate"; public static final String PROPERTY_FINANCIALMGMTTAXREGISTERLINELIST = "financialMgmtTaxRegisterlineList"; public InvoiceTax() { setDefaultValue(PROPERTY_ACTIVE, true); setDefaultValue(PROPERTY_RECALCULATE, false); setDefaultValue(PROPERTY_FINANCIALMGMTTAXREGISTERLINELIST, new ArrayList<Object>()); } @Override public String getEntityName() { return ENTITY_NAME; } public TaxRate getTax() { return (TaxRate) get(PROPERTY_TAX); } public void setTax(TaxRate tax) { set(PROPERTY_TAX, tax); } public Invoice getInvoice() { return (Invoice) get(PROPERTY_INVOICE); } public void setInvoice(Invoice invoice) { set(PROPERTY_INVOICE, invoice); } public Client getClient() { return (Client) get(PROPERTY_CLIENT); } public void setClient(Client client) { set(PROPERTY_CLIENT, client); } public Organization getOrganization() { return (Organization) get(PROPERTY_ORGANIZATION); } public void setOrganization(Organization organization) { set(PROPERTY_ORGANIZATION, organization); } public Boolean isActive() { return (Boolean) get(PROPERTY_ACTIVE); } public void setActive(Boolean active) { set(PROPERTY_ACTIVE, active); } public Date getCreationDate() { return (Date) get(PROPERTY_CREATIONDATE); } public void setCreationDate(Date creationDate) { set(PROPERTY_CREATIONDATE, creationDate); } public User getCreatedBy() { return (User) get(PROPERTY_CREATEDBY); } public void setCreatedBy(User createdBy) { set(PROPERTY_CREATEDBY, createdBy); } public Date getUpdated() { return (Date) get(PROPERTY_UPDATED); } public void setUpdated(Date updated) { set(PROPERTY_UPDATED, updated); } public User getUpdatedBy() { return (User) get(PROPERTY_UPDATEDBY); } public void setUpdatedBy(User updatedBy) { set(PROPERTY_UPDATEDBY, updatedBy); } public BigDecimal getTaxableAmount() { return (BigDecimal) get(PROPERTY_TAXABLEAMOUNT); } public void setTaxableAmount(BigDecimal taxableAmount) { set(PROPERTY_TAXABLEAMOUNT, taxableAmount); } public BigDecimal getTaxAmount() { return (BigDecimal) get(PROPERTY_TAXAMOUNT); } public void setTaxAmount(BigDecimal taxAmount) { set(PROPERTY_TAXAMOUNT, taxAmount); } public Long getLineNo() { return (Long) get(PROPERTY_LINENO); } public void setLineNo(Long lineNo) { set(PROPERTY_LINENO, lineNo); } public String getId() { return (String) get(PROPERTY_ID); } public void setId(String id) { set(PROPERTY_ID, id); } public Boolean isRecalculate() { return (Boolean) get(PROPERTY_RECALCULATE); } public void setRecalculate(Boolean recalculate) { set(PROPERTY_RECALCULATE, recalculate); } @SuppressWarnings("unchecked") public List<TaxRegisterline> getFinancialMgmtTaxRegisterlineList() { return (List<TaxRegisterline>) get(PROPERTY_FINANCIALMGMTTAXREGISTERLINELIST); } public void setFinancialMgmtTaxRegisterlineList(List<TaxRegisterline> financialMgmtTaxRegisterlineList) { set(PROPERTY_FINANCIALMGMTTAXREGISTERLINELIST, financialMgmtTaxRegisterlineList); } }
[ "rcss@ubuntu-server.administrator" ]
rcss@ubuntu-server.administrator
773781f9238eb25eb5d798ab7fc4c9a539d3e80d
ab0596541cc22ac93282990b6f44285479817d81
/src/main/java/com/martint/cinemaapi/api/v1/mapper/MovieMapper.java
11059adecbbc0dbbbcea8f99e232801a869f22fb
[]
no_license
mrtntdr/cineapi
e35fcdb51ac0a77d1171858ba983d46473067abe
5a52e4e44be8fa2f197d0592e0347cf5a1b30c48
refs/heads/master
2020-04-01T17:40:20.005083
2018-10-17T11:36:55
2018-10-17T11:36:55
153,443,260
0
0
null
null
null
null
UTF-8
Java
false
false
523
java
package com.martint.cinemaapi.api.v1.mapper; import com.martint.cinemaapi.api.v1.model.MovieDTO; import com.martint.cinemaapi.domain.Movie; import org.mapstruct.Mapper; import org.mapstruct.Mapping; import org.mapstruct.factory.Mappers; @Mapper(componentModel = "spring") public interface MovieMapper { MovieMapper INSTANCE = Mappers.getMapper(MovieMapper.class); @Mapping(source = "id", target = "id") MovieDTO movieToMovieDTO(Movie movie); Movie movieDTOToMovie(MovieDTO movieDTO); }
[ "mrtntdr@gmail.com" ]
mrtntdr@gmail.com
7ba6de788e8b1564ab440746704a85802c5b7ddf
77e61fc666a85d50c526d09a6455f39c2aeb05d0
/app/src/main/java/cn/edu/gdmec/android/mobileguard/m5virusscan/adapter/ScanVirusAdapter.java
b97b54b05c362f6b55f22d1c0cae96f859c53018
[]
no_license
fungray/MobileGuard
964289c36418ddb1d26b1f92a18659e83d5f5b92
9e1b683962b5f5e619e3b0a93bcab9a8b86167ce
refs/heads/master
2021-05-16T18:04:08.048618
2017-12-24T14:44:47
2017-12-24T14:44:47
102,920,633
0
0
null
null
null
null
UTF-8
Java
false
false
2,348
java
package cn.edu.gdmec.android.mobileguard.m5virusscan.adapter; import android.content.Context; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.TextView; import java.util.List; import cn.edu.gdmec.android.mobileguard.R; import cn.edu.gdmec.android.mobileguard.m5virusscan.entity.ScanAppInfo; /** * Created by 84506 on 2017/11/19. */ public class ScanVirusAdapter extends BaseAdapter { private List<ScanAppInfo> mScanAppInfos; private Context context; public ScanVirusAdapter(List<ScanAppInfo> scanAppInfo,Context context){ super(); mScanAppInfos = scanAppInfo; this.context = context; } static class ViewHolder{ ImageView mAppIconImgv; TextView mAppNameTV; ImageView mScanIconImgv; } @Override public int getCount() { return mScanAppInfos.size(); } @Override public Object getItem(int i) { return mScanAppInfos.get(i); } @Override public long getItemId(int i) { return i; } @Override public View getView(int i, View view, ViewGroup viewGroup) { ViewHolder holder; if(view == null){ view = View.inflate(context, R.layout.item_list_applock,null); holder = new ViewHolder(); holder.mAppIconImgv = (ImageView) view.findViewById(R.id.imgv_appicon); holder.mAppNameTV = (TextView) view.findViewById(R.id.tv_appname); holder.mScanIconImgv = (ImageView) view.findViewById(R.id.imgv_lock); view.setTag(holder); }else{ holder = (ViewHolder) view.getTag(); } ScanAppInfo scanAppInfo = mScanAppInfos.get(i); if (!scanAppInfo.isVirus){ holder.mScanIconImgv.setBackgroundResource(R.drawable.blue_right_icon); holder.mAppNameTV.setTextColor(context.getResources().getColor(R.color.black)); holder.mAppNameTV.setText(scanAppInfo.appName); }else{ holder.mAppNameTV.setTextColor(context.getResources().getColor(R.color.bright_red)); holder.mAppNameTV.setText(scanAppInfo.appName+"("+scanAppInfo.description+")"); } holder.mAppIconImgv.setImageDrawable(scanAppInfo.appicon); return view; } }
[ "845060398@qq.com" ]
845060398@qq.com
3e489efe4fcfa1c43e122e2d52d7ee9667d266de
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/13/13_f194b944282a7118178113771ed15e056d9b3f63/PatternFacet/13_f194b944282a7118178113771ed15e056d9b3f63_PatternFacet_t.java
42a73116212cd1ef1df874f7b263bdb7a59a3905
[]
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
3,182
java
/* * @(#)$Id$ * * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved. * * This software is the proprietary information of Sun Microsystems, Inc. * Use is subject to license terms. * */ package com.sun.msv.datatype.xsd; import org.apache.xerces.utils.regex.RegularExpression; import org.apache.xerces.utils.regex.ParseException; import java.util.Vector; import org.relaxng.datatype.ValidationContext; import org.relaxng.datatype.DatatypeException; /** * "pattern" facet validator * * "pattern" is a constraint facet which is applied against lexical space. * See http://www.w3.org/TR/xmlschema-2/#dt-pattern for the spec * * @author <a href="mailto:kohsuke.kawaguchi@eng.sun.com">Kohsuke KAWAGUCHI</a> */ public final class PatternFacet extends DataTypeWithLexicalConstraintFacet { /** * actual object that performs regular expression validation. * one of the item has to match */ final public RegularExpression[] exps; /** * string representations of the above RegularExpressions. * this representation is usually human friendly than * the one generated by RegularExpression.toString method. */ final public String[] patterns; /** * @param regularExpressions * Vector of XMLSchema-compiliant regular expression * (see http://www.w3.org/TR/xmlschema-2/#dt-regex ) * There patterns are considered as an 'OR' set. */ public PatternFacet( String nsUri, String typeName, XSDatatypeImpl baseType, TypeIncubator facets ) throws DatatypeException { super( nsUri, typeName, baseType, FACET_PATTERN, facets ); // TODO : am I supposed to implement my own regexp validator? // at this time, I use Xerces' one. Vector regExps = facets.getVector(FACET_PATTERN); exps = new RegularExpression[regExps.size()]; patterns = new String[regExps.size()]; try { for(int i=0;i<regExps.size();i++) { exps[i] = new RegularExpression((String)regExps.elementAt(i),"X"); patterns[i] = (String)regExps.elementAt(i); } } catch( ParseException pe ) { // in case regularExpression is not a correct pattern throw new DatatypeException( localize( ERR_PARSE_ERROR, pe.getMessage() ) ); } // loosened facet check is almost impossible for pattern facet. // ignore it for now. } protected void diagnoseByFacet(String content, ValidationContext context) throws DatatypeException { if( checkLexicalConstraint(content) ) return; if( exps.length==1 ) throw new DatatypeException( DatatypeException.UNKNOWN, localize(ERR_PATTERN_1,patterns[0]) ); else throw new DatatypeException( DatatypeException.UNKNOWN, localize(ERR_PATTERN_MANY) ); } protected final boolean checkLexicalConstraint( String literal ) { // makes sure that at least one of the patterns is satisfied. // regexp can be not thread-safe. Make sure only one thread uses it // at any given time. synchronized(this) { for( int i=0; i<exps.length; i++ ) if(exps[i].matches(literal)) return true; } // otherwise fail return false; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
dd0571d27eaed6d9408df34466c5f2bad1fd6b6a
a33aac97878b2cb15677be26e308cbc46e2862d2
/data/libgdx/InputProcessorQueue_getProcessor.java
391707aedc2f8fe1be66212e9685972214720b7d
[]
no_license
GabeOchieng/ggnn.tensorflow
f5d7d0bca52258336fc12c9de6ae38223f28f786
7c62c0e8427bea6c8bec2cebf157b6f1ea70a213
refs/heads/master
2022-05-30T11:17:42.278048
2020-05-02T11:33:31
2020-05-02T11:33:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
63
java
public InputProcessor getProcessor() { return processor; }
[ "bdqnghi@gmail.com" ]
bdqnghi@gmail.com
7d7507ee5be26b2ed0519b88f58daac41fd8252b
9d6ae4b6bc7376775601bacde666654bd7bc7dc9
/app/src/main/java/com/xygj/app/jinrirong/activity/user/view/MyMessageView.java
2e1d701051fffe297d81adbeb82a56fba1b614af
[]
no_license
MikasanZhou/xygj_android
1e5cae76298aa66d04907aed39f616e8a440291c
9598ca9dfe76df5252d456c741196025f176a3eb
refs/heads/master
2020-04-25T10:50:53.010013
2019-06-23T02:15:18
2019-06-23T02:15:18
172,724,175
1
1
null
null
null
null
UTF-8
Java
false
false
432
java
package com.xygj.app.jinrirong.activity.user.view; import java.util.List; import com.xygj.app.common.base.BaseView; import com.xygj.app.jinrirong.model.HttpRespond; import com.xygj.app.jinrirong.model.MessageBean; /** * Created by Yangli on 2018/4/18. */ public interface MyMessageView extends BaseView { void showMessageTypes(HttpRespond<List<List<MessageBean>>> respond); void onMarkMessages(HttpRespond respond); }
[ "879863325@qq.com" ]
879863325@qq.com
8c2552196e5f2fc16b6f1c0694c6c7e47715a1be
81cccf127c412984d5c054a9b8d57a71c5f28342
/src/main/java/com/hello/core/discount/FixedDiscount.java
7fb269f9f886bf59baf6458b8bb56e7e053f5fdb
[]
no_license
Imseungbae/springCore
fc41bba8a4874ffc1f4440e0dd85463bb3059e2a
1f3789226ca4945315bc5621b5b64c4a91a19dce
refs/heads/main
2023-07-20T15:05:27.066657
2021-08-22T09:06:02
2021-08-22T09:06:02
398,757,066
0
0
null
null
null
null
UTF-8
Java
false
false
454
java
package com.hello.core.discount; import com.hello.core.domain.Grade; import com.hello.core.domain.Member; public class FixedDiscount implements DiscountPolicy{ // 1000원 정률할인 private final int discount = 1000; @Override public int discount(Member member, int price) { Grade grade = member.getGrade(); if(Grade.VIP.equals(grade)){ return price - discount; } return price; } }
[ "tmdqo2013@naver.com" ]
tmdqo2013@naver.com
ce822e0025213a504cfe324df6759ee413625976
e23e9564defbf2a333eaa2c27e5c3469f32d26ef
/dynamodb-spring-data/src/main/java/net/shyshkin/study/dynamodbspringdata/DynamodbSpringDataApplication.java
6c806a2430ef7b1baa44c49dd1f74172084120bf
[]
no_license
Krishnamurtyp/aws-certified-developer-associate
ea4da4a51443b49a5d70f6d889e7518f88aaa244
71b11d1dc212cdf85ccec53a5ce4fc03261dc749
refs/heads/main
2023-02-23T03:40:57.311783
2021-01-27T15:45:55
2021-01-27T15:45:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
366
java
package net.shyshkin.study.dynamodbspringdata; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class DynamodbSpringDataApplication { public static void main(String[] args) { SpringApplication.run(DynamodbSpringDataApplication.class, args); } }
[ "d.art.shishkin@gmail.com" ]
d.art.shishkin@gmail.com
8b7ee4c5e4051e063995f516df3e5b0941959157
01ca881ce86202551152ea397a9a6e9028a88125
/src/main/java/com/initialize/one/list/Node1.java
4d8a78d0ca18ac12c4dbe459a2c1085ffa435fa9
[]
no_license
initializeliu/algorithm
a49c7e1ecfc2bd4eb70c1a265e922be53588efed
81d6e542b1a7a9732d354e5e8a7086f54b6e5687
refs/heads/master
2023-08-25T03:24:25.225351
2021-11-02T08:37:39
2021-11-02T08:37:39
421,707,818
0
0
null
null
null
null
UTF-8
Java
false
false
401
java
package com.initialize.one.list; /** * @author initialize liu * @date 2021/10/15 * @apiNote */ public class Node1 { public Integer value; public Node1 next; public Node1 rand; public Node1(){} public Node1(Integer value){ this.value = value; } @Override public String toString() { return " " + value + (next == null? "" : "," + next); } }
[ "liuyuanshuai1@163.com" ]
liuyuanshuai1@163.com
c79c0eb3a56e4bc4abc61a1e02ecf04f438f36ca
7124af5dd3f93c4014613c4264057e1b2562c916
/src/www/day4/stack/MyLinkedStack.java
2480d2c92de0497e07902ce3bd3fea4fd33d9bd2
[]
no_license
LED-SKY/JavaWork
3d86627185c928ff33e4a2087c204cbea2d4927f
28494b412cc7bde7aa5ce72d3a6c8a5fbb5aad48
refs/heads/master
2023-06-23T07:17:14.822753
2021-07-12T12:29:10
2021-07-12T12:29:10
381,563,704
0
0
null
null
null
null
UTF-8
Java
false
false
1,540
java
package www.day4.stack; /** * 实现集合类 * 模拟的数据结构是栈 * 底层结构是链表: 单链表 */ public class MyLinkedStack<T> { private Node top;// 保存栈的栈顶 private int size;// 这个栈中保存了多少个元素 // 对于栈我们应该提供的三个方法: 入栈, 出栈, 查看栈顶元素 // push pop peek /** * 给栈实现一个添加方法 * @param value : 要添加的元素 * @return : 添加是否成功 */ public boolean push(T value){ top = new Node(value, top); size++; return true; } /** * 栈的删除操作 * @return : 被删除的栈顶元素 */ public T pop(){ // 判断链表为空 if (isEmpty()) throw new RuntimeException("stack is empty"); T value = top.value;// 保存原本栈顶值 top = top.next; // 栈顶向栈底移动一个元素 size--; return value; } /** * 栈的查看栈顶元素的方法 * @return: 栈顶元素 */ public T peek(){ // 判断链表为空 if (isEmpty()) throw new RuntimeException("stack is empty"); return top.value; } public boolean isEmpty(){ return size == 0; } public int size(){ return size; } class Node{ T value; Node next; public Node(T value, Node next) { this.value = value; this.next = next; } } }
[ "1475974262@qq.com" ]
1475974262@qq.com
ae4c5021da6016f17842413fa0e86f4b45075611
1132cef0ea0246b0ef505ee8daa3cdb342499fbc
/DesignPatterns/src/Creational_Pattern/simple_factory/ConcreteProduct1.java
08f4deca31a7851aeb583f8452c77d8c7c1c6531
[]
no_license
zhhaochen/Algorithm
fd92a748fd727700abba8ad92db0d72663058666
509a8f29f00ed665182c8314c11c5a67b023701f
refs/heads/master
2023-07-02T08:14:13.918245
2021-08-05T16:31:08
2021-08-05T16:31:08
288,951,652
0
0
null
null
null
null
UTF-8
Java
false
false
97
java
package Creational_Pattern.simple_factory; public class ConcreteProduct1 implements Product { }
[ "zhhaochen@gmail.com" ]
zhhaochen@gmail.com
f11756184f8c0f00751ab4fde4121116fd91bba7
b826cfadd42171b7c23679c0ae66533ff742a643
/src/main/java/com/rps/pool/impl/GamePoolImpl.java
10d2336e8825e77563d721b614599b7378c41e16
[ "Apache-2.0", "MIT" ]
permissive
srfunksensei/Rock-Paper-Scissors
ba3c521f7dbdc9c3b950ba87debac3b72b46dd86
79f80a38c34f1ee725afc2cf65f3d2ee99690263
refs/heads/master
2021-06-08T04:22:31.766670
2021-05-27T05:28:46
2021-05-27T05:28:46
141,018,275
0
0
null
null
null
null
UTF-8
Java
false
false
1,078
java
package com.rps.pool.impl; import java.util.concurrent.ConcurrentHashMap; import org.springframework.stereotype.Service; import com.rps.dto.Game; import com.rps.exception.GameDoesNotExistException; import com.rps.pool.GamePool; @Service public class GamePoolImpl implements GamePool<String, Game> { private final ConcurrentHashMap<String, Game> games = new ConcurrentHashMap<>(); /* * (non-Javadoc) * @see com.rps.pool.GamePool#get(java.lang.String) */ @Override public Game get(final String id) throws GameDoesNotExistException { if(!games.containsKey(id)) { throw new GameDoesNotExistException(id); } return games.get(id); } /* * (non-Javadoc) * @see com.rps.pool.GamePool#add(com.rps.dto.Game) */ @Override public Game add(final Game game) { if (game == null) { throw new IllegalArgumentException("Game needs to be present"); } return games.put(game.getId(), game); } /* * (non-Javadoc) * @see com.rps.pool.GamePool#remove(java.lang.String) */ @Override public void remove(final String id) { games.remove(id); } }
[ "sr.funk.sensei@gmail.com" ]
sr.funk.sensei@gmail.com
ddbd0a887bb1e4eb8d1a035d683255b3aada77c4
a7b3f9ad716011b0c597eadfd6e94cdac730b826
/src/ru/mirea/Prac1/TestDog.java
18b38e0a360d0e16a738ab929f8b7a0313542dd4
[]
no_license
tranthuhoan99/JavaOOP
a780cb37219d326744a03ea79643ff93f8299f68
3850dcff437122dafb4ddcbe2cd1f6910edccae8
refs/heads/master
2023-01-07T21:05:06.996618
2020-11-16T15:12:09
2020-11-16T15:12:09
309,790,869
0
0
null
null
null
null
UTF-8
Java
false
false
363
java
package ru.mirea.Prac1; public class TestDog { public static void main(String[] args) { Dog d1 = new Dog("Tom", 5); Dog d2 = new Dog("Bob"); Dog d3 = new Dog(2); Dog d4 = new Dog(); d1.getInformationOfDog(); d2.getInformationOfDog(); d3.getInformationOfDog(); d4.getInformationOfDog(); } }
[ "tranthuhoan@gmail.com" ]
tranthuhoan@gmail.com
16f94937776db0f325a5ad4b325b79af26efeb37
b0af6a53cbc53e94eb3a1543706aaf0656e212f7
/src/main/java/org/springblade/modules/customer/controller/CustomerController.java
449bc548f21512ebdb272ca24b013d35bc21b534
[]
no_license
cloudgoon/BladeX-Boot
e16476ea94e3ba9f1cb8864e525373e0422ffd4f
e5f4434543f750152bd7c1eafb1950fb76916856
refs/heads/master
2023-05-06T13:56:41.504782
2021-05-18T13:27:18
2021-05-18T13:27:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,978
java
package org.springblade.modules.customer.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import lombok.AllArgsConstructor; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.Func; import org.springblade.modules.customer.entity.CustomerEntity; import org.springblade.modules.customer.service.ICustomerService; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; /** * 客户信息表 控制器 * * @author Chill */ @RestController @AllArgsConstructor @RequestMapping("/blade-blade-develop/customer") @Api(value = "客户信息表", tags = "客户信息表") public class CustomerController extends BladeController { private final ICustomerService customerService; /** * 详情 */ @GetMapping("/detail") @ApiOperationSupport(order = 1) @ApiOperation(value = "详情", notes = "传入customer") public R<CustomerEntity> detail(CustomerEntity customer) { CustomerEntity detail = customerService.getOne(Condition.getQueryWrapper(customer)); return R.data(detail); } /** * 分页 代码自定义代号 */ @GetMapping("/list") @ApiOperationSupport(order = 2) @ApiOperation(value = "分页", notes = "传入customer") public R<IPage<CustomerEntity>> list(CustomerEntity customer, Query query) { IPage<CustomerEntity> pages = customerService.page(Condition.getPage(query), Condition.getQueryWrapper(customer)); return R.data(pages); } /** * 新增 代码自定义代号 */ @PostMapping("/save") @ApiOperationSupport(order = 4) @ApiOperation(value = "新增", notes = "传入customer") public R save(@Valid @RequestBody CustomerEntity customer) { return R.status(customerService.save(customer)); } /** * 修改 代码自定义代号 */ @PostMapping("/update") @ApiOperationSupport(order = 5) @ApiOperation(value = "修改", notes = "传入customer") public R update(@Valid @RequestBody CustomerEntity customer) { return R.status(customerService.updateById(customer)); } /** * 新增或修改 代码自定义代号 */ @PostMapping("/submit") @ApiOperationSupport(order = 6) @ApiOperation(value = "新增或修改", notes = "传入customer") public R submit(@Valid @RequestBody CustomerEntity customer) { return R.status(customerService.saveOrUpdate(customer)); } /** * 删除 代码自定义代号 */ @PostMapping("/remove") @ApiOperationSupport(order = 7) @ApiOperation(value = "逻辑删除", notes = "传入ids") public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { return R.status(customerService.deleteLogic(Func.toLongList(ids))); } }
[ "freepipi@icloud.com" ]
freepipi@icloud.com
d3c62dddd431a364a2e2108707668937e898829a
1391e6a58754a97fc64fd4b93a37cb47a13b4102
/selenium_Test/src/main/java/com/blazedemo/examples/pages/blazedemo.java
f1f0819e62cc109da7be956380dbf8a68b30b7e0
[ "Apache-2.0" ]
permissive
maheshrc25/TestDemo
a2ebbacb98a7f1884105e2a1bf94156a8593c63a
88eab7db61baa6d9292c7596d9e63a518b688c23
refs/heads/main
2023-04-12T15:50:04.327881
2021-05-22T10:04:15
2021-05-22T10:04:15
369,772,555
0
0
null
null
null
null
UTF-8
Java
false
false
353
java
package com.blazedemo.examples.pages; import org.openqa.selenium.WebDriver; public class blazedemo { private static ThreadLocal<HomePage> LoginPage = new ThreadLocal<>(); public blazedemo(WebDriver driver) { LoginPage.set(new HomePage(driver)); } public HomePage getSitePage() { return this.LoginPage.get(); } }
[ "noreply@github.com" ]
noreply@github.com
7dd8863bfa0966a271c993decbece4b317c8db93
33715912152e06dc2984b16f8996e83216829d28
/atcoder.jp/abc049/abc049_a/Main.java
da8a41037e258697ddbbbf3fbe91468f7696480b
[]
no_license
nemurinda/procon-archive
9b2646d3caebd8dfad2e986a6285fd9ffca72c51
853a271646c574365c7e79d2ff1760a51a82ab0c
refs/heads/master
2023-01-15T14:57:45.325233
2020-11-25T12:53:47
2020-11-25T12:53:47
315,925,726
1
0
null
null
null
null
UTF-8
Java
false
false
506
java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String[] vow = {"a","e","i","o","u"}; String str = in.readLine(); boolean vowFlg = false; for(int i=0; i<5; i++) { if(str.equals(vow[i])) vowFlg = true; } System.out.println(vowFlg==true?"vowel":"consonant"); } }
[ "nemurinda0212@gmail.com" ]
nemurinda0212@gmail.com
1b835d1d39bebc73605d0042b5dceb733c46c83f
21db6228323ac1ff8dca9a2888f65483df35cb95
/SPring_Cloud_Group/spring_cloud_microser_subserver/src/main/java/com/rjpa/config/WebMvcConfiguration.java
2d55cc6a6b562565016b74c41462166ce8cab7b2
[]
no_license
drouis/RJPA
d805d5dc9b69e7069c6b1f6fc9eae4dd91cd1605
04ef2d03e29f8af19fa1f9f6e3c4d24d36dd2932
refs/heads/master
2022-12-27T12:54:25.907080
2019-06-15T14:50:13
2019-06-15T14:50:13
176,635,513
2
0
null
2022-12-10T05:31:19
2019-03-20T02:22:00
Java
UTF-8
Java
false
false
876
java
package com.rjpa.config; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; @Configuration public class WebMvcConfiguration extends WebMvcConfigurerAdapter { /** * ftl视图 * * @param registry */ @Override public void addViewControllers(ViewControllerRegistry registry) { } /** * 静态资源 * * @param registry */ @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { registry.addResourceHandler("/assets/**").addResourceLocations("classpath:/statics/assets/"); super.addResourceHandlers(registry); } }
[ "shiou_fujisaki@hotmail.com" ]
shiou_fujisaki@hotmail.com
8de49e60024d8ed18d07414f419b852a9d267b41
ff53c819f7721881a466da517d771df680a1ee02
/core/src/test/java/com/ax9k/util/EqualsSpecification.java
98409b894175f233181a8bc470d4a8e35455a568
[]
no_license
ssh352/ax9000
355d0a6eaf8e88447c2b0d9ad55e5de49449c27f
327f68b178e322f0c90e8243a4dbda40dfce6615
refs/heads/master
2022-02-08T13:58:33.625674
2019-08-10T09:34:04
2019-08-10T09:34:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,377
java
package com.ax9k.util; import org.junit.jupiter.api.Test; import java.util.Objects; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotEquals; public interface EqualsSpecification<T> extends ContractSpecification<T> { @Test default void shouldReturnTrueForEqualValues() { assertEquals(getValue(), getEqualValue()); } @Test default void shouldReturnFalseForUnequalValues() { assertNotEquals(getValue(), getUnequalValue()); } @Test default void shouldBeReflexive() { assertEquals(getValue(), getValue()); } @Test default void shouldBeSymmetric() { assertEquals(getValue(), getEqualValue()); assertEquals(getEqualValue(), getValue()); } @Test default void shouldBeTransitive() { assertEquals(getValue(), getEqualValue()); assertEquals(getEqualValue(), getSecondEqualValue()); assertEquals(getValue(), getSecondEqualValue()); } T getSecondEqualValue(); @Test default void shouldBeConsistent() { assertEquals(getValue(), getEqualValue()); assertEquals(getValue(), getEqualValue()); } @Test default void shouldNotBeEqualToNull() { assertNotEquals(null, getValue()); } }
[ "laurence_hook@hotmail.com" ]
laurence_hook@hotmail.com
74225aed1df2711f38b6c294f2cd047c56a41eb2
9409fe80addddb40789985fa252e426ea8e00bca
/blog-data/src/main/java/org/yanlz/blog/db/tables/Account.java
444ccedf3b7225520f804867cd74c6b7cf1cb8d7
[]
no_license
Yanlz/blog
34b1f072a86ef656540009ef3bd6e3d038671b1e
47ba2d44b8eea785cfb2809a43294c7b76bbeaeb
refs/heads/master
2016-09-15T02:24:29.282941
2015-12-28T14:00:21
2015-12-28T14:00:21
48,637,102
0
0
null
null
null
null
UTF-8
Java
false
false
4,856
java
/** * This class is generated by jOOQ */ package org.yanlz.blog.db.tables; import java.sql.Timestamp; import java.util.Arrays; import java.util.List; import javax.annotation.Generated; import org.jooq.Field; import org.jooq.Identity; import org.jooq.Table; import org.jooq.TableField; import org.jooq.UniqueKey; import org.jooq.impl.TableImpl; import org.jooq.types.ULong; import org.yanlz.blog.db.Blog; import org.yanlz.blog.db.Keys; import org.yanlz.blog.db.tables.records.AccountRecord; /** * 用户账户表 */ @Generated( value = { "http://www.jooq.org", "jOOQ version:3.7.1" }, comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Account extends TableImpl<AccountRecord> { private static final long serialVersionUID = -1748468579; /** * The reference instance of <code>blog.tb_account</code> */ public static final Account TB_ACCOUNT = new Account(); /** * The class holding records for this type */ @Override public Class<AccountRecord> getRecordType() { return AccountRecord.class; } /** * The column <code>blog.tb_account.id</code>. 主键 */ public final TableField<AccountRecord, ULong> ID = createField("id", org.jooq.impl.SQLDataType.BIGINTUNSIGNED.nullable(false), this, "主键"); /** * The column <code>blog.tb_account.user_id</code>. 用户id */ public final TableField<AccountRecord, Long> USER_ID = createField("user_id", org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, "用户id"); /** * The column <code>blog.tb_account.account_name</code>. 登录帐号 */ public final TableField<AccountRecord, String> ACCOUNT_NAME = createField("account_name", org.jooq.impl.SQLDataType.VARCHAR.length(30).nullable(false).defaulted(true), this, "登录帐号"); /** * The column <code>blog.tb_account.telephone</code>. 电话 */ public final TableField<AccountRecord, String> TELEPHONE = createField("telephone", org.jooq.impl.SQLDataType.VARCHAR.length(15).nullable(false).defaulted(true), this, "电话"); /** * The column <code>blog.tb_account.email</code>. 点子邮箱 */ public final TableField<AccountRecord, String> EMAIL = createField("email", org.jooq.impl.SQLDataType.VARCHAR.length(20).nullable(false).defaulted(true), this, "点子邮箱"); /** * The column <code>blog.tb_account.password</code>. 密码 */ public final TableField<AccountRecord, String> PASSWORD = createField("password", org.jooq.impl.SQLDataType.VARCHAR.length(20).nullable(false).defaulted(true), this, "密码"); /** * The column <code>blog.tb_account.type</code>. 账户类型,0:普通用户,1:管理员 */ public final TableField<AccountRecord, Byte> TYPE = createField("type", org.jooq.impl.SQLDataType.TINYINT.nullable(false).defaulted(true), this, "账户类型,0:普通用户,1:管理员"); /** * The column <code>blog.tb_account.created_time</code>. */ public final TableField<AccountRecord, Timestamp> CREATED_TIME = createField("created_time", org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaulted(true), this, ""); /** * The column <code>blog.tb_account.updated_time</code>. */ public final TableField<AccountRecord, Timestamp> UPDATED_TIME = createField("updated_time", org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaulted(true), this, ""); /** * The column <code>blog.tb_account.status</code>. 账户状态,枚举类型,0:无效,1:有效,默认为1 */ public final TableField<AccountRecord, Byte> STATUS = createField("status", org.jooq.impl.SQLDataType.TINYINT.nullable(false).defaulted(true), this, "账户状态,枚举类型,0:无效,1:有效,默认为1"); /** * Create a <code>blog.tb_account</code> table reference */ public Account() { this("tb_account", null); } /** * Create an aliased <code>blog.tb_account</code> table reference */ public Account(String alias) { this(alias, TB_ACCOUNT); } private Account(String alias, Table<AccountRecord> aliased) { this(alias, aliased, null); } private Account(String alias, Table<AccountRecord> aliased, Field<?>[] parameters) { super(alias, Blog.BLOG, aliased, parameters, "用户账户表"); } /** * {@inheritDoc} */ @Override public Identity<AccountRecord, ULong> getIdentity() { return Keys.IDENTITY_TB_ACCOUNT; } /** * {@inheritDoc} */ @Override public UniqueKey<AccountRecord> getPrimaryKey() { return Keys.KEY_TB_ACCOUNT_PRIMARY; } /** * {@inheritDoc} */ @Override public List<UniqueKey<AccountRecord>> getKeys() { return Arrays.<UniqueKey<AccountRecord>>asList(Keys.KEY_TB_ACCOUNT_PRIMARY); } /** * {@inheritDoc} */ @Override public Account as(String alias) { return new Account(alias, this); } /** * Rename this table */ public Account rename(String name) { return new Account(name, null); } }
[ "584598008@qq.com" ]
584598008@qq.com
c5975233a3a8569f4b19a71a9bdba3e5d6cc96ca
45f0bc9e5aa8d7810f059735aab776c7ee8ef817
/application/src/main/java/com/wego/App.java
f3d2a1f6131c0755ceff1c288ea0a4c7131ed47b
[]
no_license
sivaiitroracle9/wego_carpark
5f359b61f8c9c1a6759fb531a2fd5e9b1bb9ad42
7f1a72e8eba42b158e2613b752fcf697f804cf55
refs/heads/master
2022-11-25T16:01:54.158914
2019-12-13T11:23:17
2019-12-13T11:23:17
226,472,289
0
0
null
2022-11-16T10:57:40
2019-12-07T07:22:08
Java
UTF-8
Java
false
false
482
java
package com.wego; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Import; @SpringBootApplication @Import(value = { ApplicationConfig.class}) @EnableAutoConfiguration public class App { public static void main(String[] args) throws Exception { SpringApplication.run(App.class, args); } }
[ "sivaiitroracle9@gmail.com" ]
sivaiitroracle9@gmail.com
4e24e82338d39b3fcb12d50347f40a7930e067ed
5061eb0d867fdf71598895d5b87ef630506de0b2
/src/main/java/frc/lib/PIDControllerArm.java
117c3655a38227ce9f4c57ee33eeefde51b4b22e
[]
no_license
Paradox2102/Final2019
bc905a526b1eb13c598d26d64740aa8a37602c1e
e0a92f39a04002d84795a2f0394c5af0ca960e49
refs/heads/master
2020-07-09T03:11:35.169844
2019-08-22T19:30:26
2019-08-22T19:30:26
203,859,000
1
0
null
null
null
null
UTF-8
Java
false
false
505
java
package frc.lib; import edu.wpi.first.wpilibj.PIDOutput; import edu.wpi.first.wpilibj.PIDSource; import frc.robot.subsystems.ArmSubsystem; public class PIDControllerArm extends PIDController{ public PIDControllerArm(double Kp, double Ki, double Kd, double Kf, PIDSource source, PIDOutput output){ super(Kp, Ki, Kd, Kf, source, output); } public double calculateFeedForward(){ return -getF() * Math.cos(Math.toRadians(ArmSubsystem.ticksToDeg(getSetpoint()))); } }
[ "blakelieber@gmail.com" ]
blakelieber@gmail.com
880d19c24fb37b339dc71f6ae36565fe21d6183c
62bac3fafd89937fc5129fff2fb59c209d9f7ddf
/src/ui/DrawingPredictionPanel.java
26b60df92ddcc441e54d2796a486bf4d49eb8ef5
[]
no_license
austinapatel/Handwritten-Recognition
f0ac497cc60bbda0932d04ff603d96b735c699dd
5fa8f78044fa13cfb315ad99b18b23146e46d690
refs/heads/master
2021-04-28T21:36:12.196585
2017-06-15T00:16:57
2017-06-15T00:16:57
77,766,705
1
1
null
null
null
null
UTF-8
Java
false
false
2,078
java
/** * Author: Austin Patel * Project: Handwritten Recognition * File Name: DrawingPredictionPanel.java * Created: 01/04/17 */ package ui; import java.awt.Color; import javax.swing.JPanel; import data.Constants; import neural_network.NeuralNetwork; /** * Combines a "DrawingGrid" a "DrawingControlPane"* and a "PredictionPane into a * single JPanel." */ @SuppressWarnings("serial") public class DrawingPredictionPanel extends JPanel { private int PREDICTION_PANEL_WIDTH = 90; private DrawingGrid drawingGrid; private ColorGrid predictionColorGrid; private DrawingControlPane drawingControlPane; private PredictionPane predictionPane; private NeuralNetwork drawingNetwork; public DrawingPredictionPanel(NeuralNetwork drawingNetwork) { setLayout(null); this.drawingNetwork = drawingNetwork; predictionColorGrid = new ColorGrid(Constants.GRID_WIDTH, Constants.GRID_HEIGHT); predictionPane = new PredictionPane(predictionColorGrid); addDrawingGrid(); addPredictionGrid(); addPredictionPane(); setSize(predictionPane.getX() + predictionPane.getWidth(), drawingGrid.getHeight()); } private void addDrawingGrid() { drawingGrid = new DrawingGrid(Constants.GRID_WIDTH, Constants.GRID_HEIGHT, Color.BLACK); drawingGrid.setLocation(0, 0); drawingControlPane = new DrawingControlPane(drawingGrid, drawingNetwork, predictionPane); drawingControlPane.setLocation( (int) (drawingGrid.getLocation().getX() + drawingGrid.getSize().getWidth()), (int) drawingGrid.getLocation().getY()); add(drawingControlPane); add(drawingGrid); } private void addPredictionGrid() { predictionColorGrid .setLocation((int) (drawingControlPane.getLocation().getX() + drawingControlPane.getWidth()), 0); add(predictionColorGrid); } private void addPredictionPane() { predictionPane.setSize(PREDICTION_PANEL_WIDTH, predictionColorGrid.getHeight()); predictionPane.setLocation((int) (predictionColorGrid.getLocation().getX() + predictionColorGrid.getWidth()) + 20, 0); add(predictionPane); } }
[ "austinapatel@gmail.com" ]
austinapatel@gmail.com
809b5af013ac35c533d80a2420a75ad273e56798
3b16f5921c615d58b15597ac90c453d6f8bf5f81
/src/main/java/ua/taras/kushmyruk/service/LoginService.java
860ead65ddca52512fe869926cd059629733e9a9
[]
no_license
tkushmiruk/toolsProject
8d189674980a2b31400552089f179d36a3c52ff1
03614bb14d7b52045acab31a19bbeb517ad7c55b
refs/heads/master
2022-12-28T23:12:56.788032
2020-10-17T12:35:23
2020-10-17T12:35:23
304,871,646
0
0
null
null
null
null
UTF-8
Java
false
false
124
java
package ua.taras.kushmyruk.service; public interface LoginService { boolean login(String username, String password); }
[ "tkushmyruk@gmail.com" ]
tkushmyruk@gmail.com
71b4840092ac98c106d5de0e0af3a7f2ea211a6c
c1a14e752d3826fc4288ac1169a4031af0b744f0
/chapter23-client/src/main/java/com/learn/chapter23/client/ClientAuthenticationFilter.java
af0ea6de1e8e0b2d425f1a61e280c5b8e02f7bad
[]
no_license
JeeLearner/learning-shiro
b1377afaf0ce53bacde82f5a7b9ea1f405cf000b
a1a73481465ea002aa7e166c1ba12255ea2308c8
refs/heads/master
2021-05-12T18:25:54.905541
2018-03-02T03:08:04
2018-03-02T03:09:17
117,065,806
1
0
null
null
null
null
UTF-8
Java
false
false
2,376
java
package com.learn.chapter23.client; import com.learn.chapter23.core.ClientSavedRequest; import org.apache.shiro.SecurityUtils; import org.apache.shiro.session.Session; import org.apache.shiro.subject.Subject; import org.apache.shiro.web.filter.authc.AuthenticationFilter; import org.apache.shiro.web.util.SavedRequest; import org.apache.shiro.web.util.WebUtils; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; public class ClientAuthenticationFilter extends AuthenticationFilter { @Override protected boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue) { Subject subject = getSubject(request, response); return subject.isAuthenticated(); } @Override protected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws Exception { String backUrl = request.getParameter("backUrl"); saveRequest(request, backUrl, getDefaultBackUrl(WebUtils.toHttp(request))); redirectToLogin(request, response); return false; } protected void saveRequest(ServletRequest request, String backUrl, String fallbackUrl) { Subject subject = SecurityUtils.getSubject(); Session session = subject.getSession(); HttpServletRequest httpRequest = WebUtils.toHttp(request); session.setAttribute("authc.fallbackUrl", fallbackUrl); SavedRequest savedRequest = new ClientSavedRequest(httpRequest, backUrl); session.setAttribute(WebUtils.SAVED_REQUEST_KEY, savedRequest); } private String getDefaultBackUrl(HttpServletRequest request) { String scheme = request.getScheme(); String domain = request.getServerName(); int port = request.getServerPort(); String contextPath = request.getContextPath(); StringBuilder backUrl = new StringBuilder(scheme); backUrl.append("://"); backUrl.append(domain); if("http".equalsIgnoreCase(scheme) && port != 80) { backUrl.append(":").append(String.valueOf(port)); } else if("https".equalsIgnoreCase(scheme) && port != 443) { backUrl.append(":").append(String.valueOf(port)); } backUrl.append(contextPath); backUrl.append(getSuccessUrl()); return backUrl.toString(); } }
[ "15501112566@163.com" ]
15501112566@163.com
8cd1c260355fd12ec99c83780f02bede54e4d931
6f5a1f7d654172b150931f5cdede8098d34a761d
/src/main/java/com/zyd/common/quartz/QuartzController.java
475167ff30d289985e127359dcc07cfb09a7712f
[]
no_license
dannyhz/zouyidan_auth
b0cbea68bd7ff1720de81a6fea90da8dda318d42
c5060c3ac3ac5c7848bcfd7b0e4cd9d831f6d373
refs/heads/master
2020-03-21T15:38:28.976468
2018-07-08T07:30:26
2018-07-08T07:30:26
138,724,359
0
0
null
null
null
null
UTF-8
Java
false
false
215
java
package com.zyd.common.quartz; public class QuartzController { //根据application 表里的 数据的状态 ,来新增task给指定的人或组, 频率每分钟一次 public void dispatchTask(){ } }
[ "xiang_zhu@sunrun99.com" ]
xiang_zhu@sunrun99.com
83043b2c9a98f4871d8aaef51fa08336eb7a5201
09976b77fda4e2e11d68654700337a9d399db794
/src/main/java/com/api/models/Employee.java
12ea505ea92f3f124e8637e69588cedc57bf65d1
[]
no_license
ywel/RestChallenge
7bb5f79849daa95452d722d7c1438fab079e7821
c2de31ffb70eb36c7bdd3e592d5b2581b75e2f87
refs/heads/master
2021-01-21T06:19:16.030114
2020-11-13T12:00:51
2020-11-13T12:00:51
83,213,055
1
1
null
null
null
null
UTF-8
Java
false
false
1,510
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.api.models; /** * * @author adtel */ //import org.codehaus.jackson.annotate.JsonProperty; public class Employee { String Employee_id; String Emplyee_name; String Employee_level; double Employee_salary; public Employee(){ } public Employee(String id,String Name, String Level,double salary){ this.Employee_id=id; this.Employee_level=Level; this.Employee_salary=salary; this.Emplyee_name=Name; } public String getEmployee_id() { return Employee_id; } public void setEmployee_id(String Employee_id) { this.Employee_id = Employee_id; } public String getEmplyee_name() { return Emplyee_name; } public void setEmplyee_name(String Emplyee_name) { this.Emplyee_name = Emplyee_name; } public String getEmployee_level() { return Employee_level; } public void setEmployee_level(String Employee_level) { this.Employee_level = Employee_level; } public double getEmployee_salary() { return Employee_salary; } public void setEmployee_salary(double Employee_salary) { this.Employee_salary = Employee_salary; } }
[ "munenelewis77@gmail.com" ]
munenelewis77@gmail.com
ad9c015a323c028be4ea28a8f8f410c44d93042f
5e22c8c923ae58a2059fe17c64cf1750549ac3b7
/src/main/java/com/lgq/pojo/Books.java
81338624fbbc38e328825b9f18cfe09572152194
[]
no_license
lgq1997/ssmproject
bfc4e64d36272e129c7fbe2296f17eba95304aa5
0312ddeb5ba0fc9e1d230219a8cc0245f7fbe885
refs/heads/master
2023-02-11T12:15:04.324432
2021-01-12T10:03:22
2021-01-12T10:03:22
328,944,178
0
0
null
null
null
null
UTF-8
Java
false
false
427
java
package com.lgq.pojo; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import java.math.BigDecimal; /** * @author lgq * @create 2021-01-06-15:19 */ @Data @AllArgsConstructor @NoArgsConstructor public class Books { private int bookID; private String bookName; private String author; private BigDecimal price; private int bookCounts; private String detail; }
[ "1511077945@qq.com" ]
1511077945@qq.com
c967f6fb1562108312f2438f2bb9ec3b2a5e0be6
b516086a1ef0b5c0482b2d3597dad732deeac711
/src/main/java/com/johannesbrodwall/infrastructure/AppConfiguration.java
9059458af60f00bb59f11cc3355636c4e7affeda
[]
no_license
jhannes-playpen/events-fun
2cd0f08b8b099c8e17d158b97530aca8d67eb275
1070d2cf7ba0f9e5a2aaa67491afdf91723fc828
refs/heads/master
2021-05-28T00:43:17.295621
2014-09-24T01:20:35
2014-09-24T01:20:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,500
java
package com.johannesbrodwall.infrastructure; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.util.Properties; import lombok.extern.slf4j.Slf4j; @Slf4j public class AppConfiguration { private long nextCheckTime = 0; private long lastLoadTime = 0; private Properties properties = new Properties(); private Properties defaultProperties = new Properties(); private final File configFile; public AppConfiguration(String filename) { this.configFile = new File(filename); } public void setDefault(String key, String value) { defaultProperties.setProperty(key, value); } public String getProperty(String propertyName, String defaultValue) { String result = getProperty(propertyName); if (result == null) { log.debug("Missing property {} in {}", propertyName, properties.keySet()); return defaultValue; } return result; } public String getRequiredProperty(String propertyName) { String result = getProperty(propertyName); if (result == null) { throw new RuntimeException("Missing property " + propertyName); } return result; } private String getProperty(String propertyName) { if (System.getenv(propertyName.replace('.', '_')) != null) { return System.getenv(propertyName.replace('.', '_')); } ensureConfigurationIsFresh(); return properties.getProperty(propertyName, defaultProperties.getProperty(propertyName)); } private synchronized void ensureConfigurationIsFresh() { if (System.currentTimeMillis() < nextCheckTime) return; nextCheckTime = System.currentTimeMillis() + 10000; log.trace("Rechecking {}", configFile); if (lastLoadTime >= configFile.lastModified()) return; lastLoadTime = configFile.lastModified(); log.debug("Reloading {}", configFile); try (FileInputStream inputStream = new FileInputStream(configFile)) { properties.clear(); properties.load(inputStream); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
[ "johannes@brandmaster.com" ]
johannes@brandmaster.com
e2853c9bfed6b223bf671829b2dc7d6cf6ff5b6a
6ba376c63cbe77bca4d3cbc8eb454939fa0849b7
/codingbat-app/src/main/java/ecma/ai/codingbatapp/repository/UserRepository.java
30530ed77af3cfa41bcf02f6a662a5878ef8705a
[]
no_license
kilichov-94/coding_bat
22924cd7d817993cedb343f0c7cd694623d248f3
beac172ba8de4beef0455638a79d544cb91ad533
refs/heads/master
2023-05-02T22:30:05.900169
2021-05-11T12:01:56
2021-05-11T12:01:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
369
java
package ecma.ai.codingbatapp.repository; import ecma.ai.codingbatapp.entity.User; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; @Repository public interface UserRepository extends JpaRepository<User, Integer> { boolean existsByEmail(String email); boolean existsByPassword(String password); }
[ "kilichov190394@gmail.com" ]
kilichov190394@gmail.com
abb223ab0135a1d1bbbccc7c4a009be9116e6b2f
80363f460fe99fe1f11be17d53da9000d06c2fdb
/AppMaker/src/main/java/com/eventorama/AppRequestException.java
6c839f38ed27705949bf3db1eeb84526a381a820
[]
no_license
larsrottmann/event-o-rama
57bc254607c94af0aa4e951f01f501bbf63eb60a
be9e50908dad16b02f02919c0c9c91b57dcabd18
refs/heads/master
2021-01-10T01:19:06.238444
2011-08-15T15:53:17
2011-08-15T15:53:17
1,820,592
2
0
null
null
null
null
UTF-8
Java
false
false
587
java
package com.eventorama; /** * Contains HTTP Status code which gets passed to client * @author renard * */ public class AppRequestException extends Exception { /** * */ private static final long serialVersionUID = -1611888691916079260L; private final int httpResponseCode; public AppRequestException(int code) { this.httpResponseCode = code; } public AppRequestException(int code, Exception parentException) { super(parentException); this.httpResponseCode = code; } public int getHttpResponseCode(){ return httpResponseCode; } }
[ "renard.wellnitz@googlemail.com" ]
renard.wellnitz@googlemail.com
e54174c27d4b2bd5638e62d0cf04eb9b6fda4bfe
cc37e7caf3f52ed5c5d5d63b24a8812270354ef3
/jwat-gzip/src/test/java/org/jwat/gzip/TestGzipWriter.java
2a05a907302fa1c2f75044cc9e193d58d8add595
[ "Apache-2.0" ]
permissive
jessesherlock/jwat
dfb5215da2a774369a646c82944b88ef26c77436
2fa91be1004c06b50fc310fc9507a777b05dbe60
refs/heads/master
2021-05-26T15:15:27.227618
2014-08-12T11:44:22
2014-08-12T11:44:22
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,986
java
/** * Java Web Archive Toolkit - Software to read and validate ARC, WARC * and GZip files. (http://jwat.org/) * Copyright 2011-2012 Netarkivet.dk (http://netarkivet.dk/) * * 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.jwat.gzip; import java.io.ByteArrayOutputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.security.SecureRandom; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @RunWith(JUnit4.class) public class TestGzipWriter { @Test public void test_gzipwriter_file_compress() { String in_file = "IAH-20080430204825-00000-blackbook.warc"; SecureRandom random = new SecureRandom(); //RandomAccessFile raf; //RandomAccessFileOutputStream out; InputStream in; ByteArrayOutputStream out = new ByteArrayOutputStream(); OutputStream cout; byte[] tmpBuf; int read; int mod; GzipWriter writer; GzipEntry entry = new GzipEntry(); entry.magic = GzipConstants.GZIP_MAGIC; entry.cm = GzipConstants.CM_DEFLATE; entry.flg = 0; entry.mtime = System.currentTimeMillis() / 1000; entry.xfl = 0; entry.os = GzipConstants.OS_AMIGA; try { entry.getOutputStream(); Assert.fail("Exception expected!"); } catch (IllegalStateException e) { } try { entry.getInputStream(); Assert.fail("Exception expected!"); } catch (IllegalStateException e) { } try { /* * writeFrom(). */ //File out_file1 = File.createTempFile("jwat-testwrite1-", ".gz"); //out_file1.deleteOnExit(); /* raf = new RandomAccessFile(out_file1, "rw"); raf.seek(0); raf.setLength(0); out = new RandomAccessFileOutputStream(raf); */ out.reset(); writer = new GzipWriter(out); writer.writeEntryHeader(entry); try { entry.getInputStream(); Assert.fail("Exception expected!"); } catch (IllegalStateException e) { } in = this.getClass().getClassLoader().getResourceAsStream(in_file); entry.writeFrom(in); in.close(); Assert.assertFalse(entry.diagnostics.hasErrors()); Assert.assertFalse(entry.diagnostics.hasWarnings()); Assert.assertTrue(entry.isCompliant()); Assert.assertEquals(entry.bIsCompliant, entry.isCompliant()); Assert.assertTrue(writer.isCompliant()); Assert.assertEquals(writer.bIsCompliant, writer.isCompliant()); writer.close(); writer.close(); Assert.assertTrue(entry.isCompliant()); Assert.assertEquals(entry.bIsCompliant, entry.isCompliant()); Assert.assertTrue(writer.isCompliant()); Assert.assertEquals(writer.bIsCompliant, writer.isCompliant()); out.flush(); out.close(); //raf.close(); byte[] out1 = out.toByteArray(); //System.out.println(out_file1.length()); /* * GzipEntryOutputStream. write(b, off, len). */ //File out_file2 = File.createTempFile("jwat-testwrite2-", ".gz"); //out_file2.deleteOnExit(); /* raf = new RandomAccessFile(out_file2, "rw"); raf.seek(0); raf.setLength(0); out = new RandomAccessFileOutputStream(raf); */ out.reset(); writer = new GzipWriter(out); writer.writeEntryHeader(entry); cout = entry.getOutputStream(); try { entry.getInputStream(); Assert.fail("Exception expected!"); } catch (IllegalStateException e) { } in = this.getClass().getClassLoader().getResourceAsStream(in_file); tmpBuf = new byte[16384]; read = 0; while ((read = in.read(tmpBuf, 0, 16384)) != -1) { cout.write(tmpBuf, 0, read); } cout.flush(); cout.close(); in.close(); Assert.assertFalse(entry.diagnostics.hasErrors()); Assert.assertFalse(entry.diagnostics.hasWarnings()); Assert.assertTrue(entry.isCompliant()); Assert.assertEquals(entry.bIsCompliant, entry.isCompliant()); Assert.assertTrue(writer.isCompliant()); Assert.assertEquals(writer.bIsCompliant, writer.isCompliant()); writer.close(); writer.close(); Assert.assertTrue(entry.isCompliant()); Assert.assertEquals(entry.bIsCompliant, entry.isCompliant()); Assert.assertTrue(writer.isCompliant()); Assert.assertEquals(writer.bIsCompliant, writer.isCompliant()); out.flush(); out.close(); //raf.close(); byte[] out2 = out.toByteArray(); //System.out.println(out_file2.length()); /* * GzipEntryOutputStream. all write methods. */ //File out_file2 = File.createTempFile("jwat-testwrite2-", ".gz"); //out_file2.deleteOnExit(); /* raf = new RandomAccessFile(out_file2, "rw"); raf.seek(0); raf.setLength(0); out = new RandomAccessFileOutputStream(raf); */ out.reset(); writer = new GzipWriter(out); writer.writeEntryHeader(entry); cout = entry.getOutputStream(); try { entry.getInputStream(); Assert.fail("Exception expected!"); } catch (IllegalStateException e) { } in = this.getClass().getClassLoader().getResourceAsStream(in_file); tmpBuf = new byte[1024]; read = 0; mod = 2; while ( read != -1 ) { switch ( mod ) { case 0: cout.write( read ); break; case 1: case 2: if (read == tmpBuf.length) { cout.write( tmpBuf ); } else { cout.write( tmpBuf, 0, read ); } break; } mod = (mod + 1) % 3; switch ( mod ) { case 0: read = in.read(); break; case 1: read = in.read( tmpBuf ); break; case 2: read = random.nextInt( 1023 ) + 1; read = in.read( tmpBuf, 0, read ); break; } } cout.flush(); cout.close(); in.close(); Assert.assertFalse(entry.diagnostics.hasErrors()); Assert.assertFalse(entry.diagnostics.hasWarnings()); Assert.assertTrue(entry.isCompliant()); Assert.assertEquals(entry.bIsCompliant, entry.isCompliant()); Assert.assertTrue(writer.isCompliant()); Assert.assertEquals(writer.bIsCompliant, writer.isCompliant()); writer.close(); writer.close(); Assert.assertTrue(entry.isCompliant()); Assert.assertEquals(entry.bIsCompliant, entry.isCompliant()); Assert.assertTrue(writer.isCompliant()); Assert.assertEquals(writer.bIsCompliant, writer.isCompliant()); out.flush(); out.close(); //raf.close(); byte[] out3 = out.toByteArray(); //System.out.println(out_file2.length()); /* * Compare. */ Assert.assertArrayEquals(out1, out2); Assert.assertArrayEquals(out2, out3); } catch (FileNotFoundException e) { e.printStackTrace(); Assert.fail("Unexpected exception!"); } catch (IOException e) { e.printStackTrace(); Assert.fail("Unexpected exception!"); } } }
[ "kris.sigur@gmail.com" ]
kris.sigur@gmail.com
e7ed297b7a2789e5fd6ce4919601be656111b02a
09cbaa0138aa9b63a75a01c5562ca02689d03133
/yoyo-provider-gwt/src/test/java/com/francetelecom/yoyo/presentation/client/mvp/presenter/HomeASideBarPresenterImplTest.java
757a29615044ace3d6741409297caa60f4616f4e
[]
no_license
yoyo-cluster01-team/yoyo
917b4b93685a396d1037f90a9d02de8a7ed101d2
a576a64bbca5ecaf0b4246295ca90e8b086fce7e
refs/heads/master
2021-01-20T21:29:18.611237
2013-02-06T16:01:32
2013-02-06T16:01:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,138
java
package com.francetelecom.yoyo.presentation.client.mvp.presenter; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; import com.francetelecom.yoyo.presentation.client.mvp.presenter.impl.HomeASideBarPresenterImpl; import com.francetelecom.yoyo.presentation.client.mvp.view.HomeASideBarView; import com.google.gwt.event.shared.EventBus; import com.google.gwt.user.client.ui.AcceptsOneWidget; @RunWith(MockitoJUnitRunner.class) public class HomeASideBarPresenterImplTest { @Mock private HomeASideBarView view; @Mock private AcceptsOneWidget parent; private HomeASideBarPresenterImpl presenter; @Before public void setUp() { presenter = new HomeASideBarPresenterImpl(view); } @Test public void testStartActivity() { // run operation to be tested presenter.start(parent, mock(EventBus.class)); // ensure operation has been called with required args verify(parent).setWidget(eq(view)); } }
[ "seb_bortolussi@yahoo.fr" ]
seb_bortolussi@yahoo.fr
1e8b45e6bbcb5ca0d17908b3f08d1a414880fb7d
d89db62d08447653cef19bf0b23eb52b8a60a58d
/com.io7m.jspatial.tests/src/test/java/com/io7m/jspatial/tests/implementation/OctantsITest.java
f0f04500288bce8457b6a9cdfb548b136337b889
[ "ISC" ]
permissive
herike/jspatial
06c7067a2c0c62a50cfc5975735c5530fcc02b0c
51109c5e1f0606740af4e6ccdcfb54312217f81b
refs/heads/master
2021-06-16T18:03:55.643180
2017-05-19T12:06:37
2017-05-19T12:06:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,524
java
/* * Copyright © 2017 <code@io7m.com> http://io7m.com * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ package com.io7m.jspatial.tests.implementation; import com.io7m.jregions.core.unparameterized.volumes.VolumeI; import com.io7m.jregions.core.unparameterized.volumes.VolumeXYZSplitI; import com.io7m.jregions.core.unparameterized.volumes.VolumesI; import com.io7m.jregions.generators.VolumeIGenerator; import com.io7m.jspatial.implementation.OctantsI; import com.io7m.jspatial.tests.TestUtilities; import com.io7m.jspatial.tests.rules.PercentagePassRule; import com.io7m.jspatial.tests.rules.PercentagePassing; import net.java.quickcheck.generator.support.IntegerGenerator; import net.java.quickcheck.generator.support.LongGenerator; import org.junit.Assert; import org.junit.Rule; import org.junit.Test; import java.util.ArrayList; import java.util.List; import java.util.Optional; import static com.io7m.jfunctional.Unit.unit; public final class OctantsITest { @Rule public PercentagePassRule percent = new PercentagePassRule(TestUtilities.TEST_ITERATIONS); @Test @PercentagePassing public void testExhaustive() { final VolumeIGenerator generator = new VolumeIGenerator(new IntegerGenerator(-10000, 10000)); final VolumeI volume = generator.next(); final Optional<VolumeXYZSplitI<VolumeI>> o_opt = OctantsI.subdivide(volume); Assert.assertTrue(o_opt.isPresent()); o_opt.map(octs -> { final List<VolumeI> all = new ArrayList<>(8); all.add(octs.x0y0z0()); all.add(octs.x1y0z0()); all.add(octs.x0y1z0()); all.add(octs.x1y1z0()); all.add(octs.x0y0z1()); all.add(octs.x1y0z1()); all.add(octs.x0y1z1()); all.add(octs.x1y1z1()); for (int i = 0; i < all.size(); ++i) { final VolumeI v0 = all.get(i); System.out.printf("contains: %s %s\n", volume, v0); Assert.assertTrue(VolumesI.contains(volume, v0)); Assert.assertTrue(VolumesI.overlaps(v0, volume)); for (int j = 0; j < all.size(); ++j) { if (i == j) { continue; } final VolumeI a = v0; final VolumeI b = all.get(j); Assert.assertFalse(VolumesI.overlaps(a, b)); Assert.assertFalse(VolumesI.overlaps(b, a)); } } return unit(); }); } @Test public void testTooSmallHeight() { Assert.assertEquals( Optional.empty(), OctantsI.subdivide( VolumeI.of(0, 2, 0, 1, 0, 2))); } @Test public void testTooSmallWidth() { Assert.assertEquals( Optional.empty(), OctantsI.subdivide( VolumeI.of(0, 1, 0, 2, 0, 2))); } @Test public void testTooSmallDepth() { Assert.assertEquals( Optional.empty(), OctantsI.subdivide( VolumeI.of(0, 2, 0, 2, 0, 1))); } }
[ "code@io7m.com" ]
code@io7m.com
9806e4eed4324aa2607e1543287cc5c0bdd1481f
76dd374a5ebe93b6bbeaa61ea2e600ac7f23cf1d
/3rdParty/V8/V8-5.0.71.39/test/mozilla/data/src/com/netscape/javascript/qa/liveconnect/datatypes/DataTypes_016.java
111ad3d7112e388305ac9c9bda51f43c96ff8dfc
[ "Apache-2.0", "BSD-3-Clause", "Zlib", "ISC", "LicenseRef-scancode-proprietary-license", "MIT", "BSL-1.0", "LicenseRef-scancode-unknown-license-reference", "Unlicense", "ICU", "LGPL-2.1-only", "GPL-2.0-only", "MPL-1.1", "bzip2-1.0.6" ]
permissive
mikestaub/arangodb
5064eaab8b4587dccc7ea9982e3fea4c926eb620
1bdf414de29b31bcaf80769a095933f66f8256ce
refs/heads/devel
2021-08-10T15:44:03.423137
2016-09-23T13:23:03
2016-09-23T13:23:03
69,112,437
1
0
Apache-2.0
2021-01-21T15:29:30
2016-09-24T16:02:10
C++
UTF-8
Java
false
false
9,079
java
package com.netscape.javascript.qa.liveconnect.datatypes; import com.netscape.javascript.qa.liveconnect.*; import netscape.javascript.*; /** * From JavaScript, call a static Java method that takes arguments. The * argument should be correctly cast to the type expected by the Java * method. * * <p> * * This test calls a setter method. The test is verified by calling the * getter method, and verifying that the value is the setter worked * correctly. * * <p> * * This tests passing JavaScript values as arguments of the following types: * double, byte, short, long, float, int. * * If JavaScript passes a value that is larger than th MAX_VALUE of that type, * expect a JSException. * * <p> * Still need tests for the following types: String, Object, char, JSObject * * @see com.netscape.javascript.qa.liveconnect.DataTypesClass * @see netscape.javascript.JSObject * * @author christine m begle */ public class DataTypes_016 extends LiveConnectTest { public DataTypes_016() { super(); } public static void main( String[] args ) { DataTypes_016 test = new DataTypes_016(); test.start(); } public void setupTestEnvironment() { super.setupTestEnvironment(); global.eval( "var DT = "+ "Packages.com.netscape.javascript.qa.liveconnect.DataTypeClass"); global.eval( "var dt = new DT();" ); } //XXX need to add special cases: NaN, Infinity, -Infinity, but won't // work in this framework String jsVals[] = { "0.0", "3.14159", "-1.159", "-0.01", "0.1", "4294967295", "4294967296", "-4294967296", "2147483647", "2147483648", "-2147483648" }; public boolean checkByte( String v ) { double max = new Double( Byte.MAX_VALUE ).doubleValue(); double min = new Double( Byte.MIN_VALUE ).doubleValue(); double value = new Double(v).doubleValue(); if ( value >= min && value <= max ) return true; return false; } public boolean checkInteger( String v ) { double max = new Double(Integer.MAX_VALUE ).doubleValue(); double min = new Double( Integer.MIN_VALUE ).doubleValue(); double value = new Double(v).doubleValue(); if ( value >= min && value <= max ) return true; return false; } public boolean checkShort( String v ) { double max = new Double( Short.MAX_VALUE ).doubleValue(); double min = new Double( Short.MIN_VALUE ).doubleValue(); double value = new Double(v).doubleValue(); if ( value >= min && value <= max ) return true; return false; } public boolean checkFloat( String v ) { double max = new Double( Float.MAX_VALUE ).doubleValue(); double min = new Double( Float.MIN_VALUE ).doubleValue(); double value = new Double(v).doubleValue(); if ( value >= min && value <= max ) return true; return false; } public boolean checkLong( String v ) { double max = new Double( Long.MAX_VALUE ).doubleValue(); double min = new Double( Long.MIN_VALUE ).doubleValue(); double value = new Double(v).doubleValue(); if ( value >= min && value <= max ) return true; return false; } public boolean checkDouble( String v ) { double max = new Double( Double.MAX_VALUE ).doubleValue(); double min = new Double( Double.MIN_VALUE ).doubleValue(); double value = new Double(v).doubleValue(); if ( value >= min && value <= max ) return true; return false; } public void executeTest() { for ( int i = 0; i < jsVals.length; i++ ) { doSetterTest( "DT.staticSetDouble", jsVals[i], "DT.staticGetDouble", "DT.PUB_STATIC_DOUBLE", (Number) new Double(jsVals[i]), (Number) new Double(DataTypeClass.PUB_STATIC_DOUBLE), true ); doSetterTest( "DT.staticSetByte", jsVals[i], "DT.staticGetByte", "DT.PUB_STATIC_BYTE", (Number) new Byte(new Double(jsVals[i]).byteValue()), (Number) new Byte(DataTypeClass.PUB_STATIC_BYTE), checkByte( jsVals[i]) ); doSetterTest( "DT.staticSetShort", jsVals[i], "DT.staticGetShort", "DT.PUB_STATIC_SHORT", (Number) new Short(new Double(jsVals[i]).shortValue()), (Number) new Short(DataTypeClass.PUB_STATIC_SHORT), checkShort( jsVals[i]) ); doSetterTest( "DT.staticSetInteger", jsVals[i], "DT.staticGetInteger", "DT.PUB_STATIC_INT", (Number) new Integer(new Double(jsVals[i]).intValue()), (Number) new Integer(DataTypeClass.PUB_STATIC_INT), checkInteger( jsVals[i]) ); doSetterTest( "DT.staticSetFloat", jsVals[i], "DT.staticGetFloat", "DT.PUB_STATIC_FLOAT", (Number) new Float(new Double(jsVals[i]).floatValue()), (Number) new Float(DataTypeClass.PUB_STATIC_FLOAT), true ); doSetterTest( "DT.staticSetLong", jsVals[i], "DT.staticGetLong", "DT.PUB_STATIC_LONG", (Number) new Long(new Double(jsVals[i]).longValue()), (Number) new Long(DataTypeClass.PUB_STATIC_LONG), checkLong( jsVals[i]) ); } } /** * This tests calls a Java setter method from JavaScript. It verifies * that the setter was called properly in two ways: by checking the * return value of the getter method, and by checking the value of the * public field that was set. * * @param setter java method that takes an argument, and sets a value * @param jsValue JavaScript value that is passed to the setter * @param getter java method that returns the value set by setter * @param field java field that setter changed * @param eResult expected result, which should be of some Number type * @param inRange whether or not the value is in range for the particular * type. if not, expect a JSExcedeption */ public void doSetterTest( String setter, String jsValue, String getter, String field, Number eResult, Number fieldValue, boolean inRange ) { String setMethod = setter +"(" + jsValue +");"; String getMethod = getter + "();"; Double expectedResult = (inRange) ? new Double( eResult.doubleValue() ) : new Double(fieldValue.doubleValue()); Double getterResult=null; Object fieldResult=null; String setResult = "no exception"; String expectedSetResult = setResult; try { expectedSetResult = (inRange) ? "no exception" : Class.forName("netscape.javascript.JSException").getName(); // From JavaScript, call the setter. will throw exception if // ! inRange global.eval( setMethod ); } catch ( Exception e ) { setResult = e.getClass().getName(); file.exception = e.toString(); } finally { addTestCase( setMethod, expectedSetResult, setResult, file.exception ); } try { // From JavaScript, call the getter getterResult = (Double) global.eval( getMethod ); // From JavaSript, access the field fieldResult = (Double) global.eval( field ); } catch ( Exception e ) { e.printStackTrace(); file.exception = e.toString(); fieldResult = e.getClass().getName(); } finally { addTestCase( "[value: " + getterResult +"; expected: " + expectedResult +"] "+ setMethod + "( " + expectedResult +").equals(" + getterResult +")", "true", expectedResult.equals(getterResult) +"", file.exception ); addTestCase( "[value: " + fieldResult +"; expected: " + expectedResult +"] "+ setMethod + "(" + expectedResult +").equals(" + fieldResult +")", "true", expectedResult.equals(fieldResult) +"", file.exception ); } } }
[ "frank@arangodb.com" ]
frank@arangodb.com
0c85be2ca90e5fe972802035cb70f12991266c24
4e3eed18b660c68ed09c80299f666f3996debf64
/webstart-maven-plugin/src/main/java/org/codehaus/mojo/webstart/JnlpFile.java
70bcd8e512e3660d3547b7206745c1a07a49d34b
[ "MIT" ]
permissive
amoschov/webstart-maven-plugin
07af933ece4fa2283127fd8453e8b4fe60bee55e
3d9a9c0b2c1c7d908fc4728906dfba572b6d8f93
refs/heads/master
2021-01-13T09:50:48.441471
2008-09-23T12:54:06
2008-09-23T12:54:06
69,895,727
1
0
null
2016-10-03T17:53:46
2016-10-03T17:53:46
null
UTF-8
Java
false
false
2,821
java
/* * Copyright 2001-2005 The Apache Software Foundation. * * 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.codehaus.mojo.webstart; import java.util.List; /** * This class represents a &lt;jnlpFile&gt; configuration element from the * pom.xml file. It contains the configuration elements that are specific * to a single JNLP that will be generated by the webstart plugin. * * @author Kevin Stembridge * @since 1.0-alpha-2 * @version $Revision$ * */ public class JnlpFile { private String outputFilename; private String templateFilename; private List jarResources; private String mainClass; /** * Creates a new uninitialized {@code JnlpFile}. * */ public JnlpFile() { // do nothing } /** * Returns the name to be used for the generated JNLP file. * @return Returns the value of the outputFilename field. */ protected String getOutputFilename() { return this.outputFilename; } /** * Returns the name of the Velocity template file used to generate the * JNLP file. * * @return Returns the name of the JNLP template file. */ protected String getTemplateFilename() { return this.templateFilename; } /** * Returns the collection of <code>JarResource</code> elements for this JNLP file. * @return Returns the value of the jarResources field. */ protected List getJarResources() { return this.jarResources; } /** * Returns the fully qualified classname of the class to be specified as * the <code>main-class</code> in the generated JNLP file. * @return Returns the value of the mainClass field. */ protected String getMainClass() { return this.mainClass; } /** * Sets the outputFileName. * @param outputFilename */ protected void setOutputFilename( String outputFilename ) { this.outputFilename = outputFilename; } /** * Sets the fully qualified classname of the class to be specified as * the <code>main-class</code> in the generated JNLP file. * @param mainClass */ protected void setMainClass( String mainClass ) { this.mainClass = mainClass; } }
[ "lacostej@52ab4f32-60fc-0310-b215-8acea882cd1b" ]
lacostej@52ab4f32-60fc-0310-b215-8acea882cd1b
8f98c706a208dd4826d5a56368da88d6ea1ec8e4
021911e7dc609ae9e0f1940edbef26b9c55c1042
/displayresult.java
e909874adf1ee506b367683f305c49f63662142a
[]
no_license
rizu1023/Grading_System
15c941dda93c763bf36c85f8c6327708c709c66c
1a4e3e65a949fea4acdad6a5b37f027773f255d5
refs/heads/master
2022-04-20T08:28:37.156100
2020-04-21T12:36:10
2020-04-21T12:36:10
256,751,037
0
0
null
2020-04-18T12:55:13
2020-04-18T12:42:44
null
UTF-8
Java
false
false
23,197
java
package login; import javax.swing.*; import java.awt.*; import java.sql.*; import javax.swing.JOptionPane; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import java.awt.event.WindowEvent; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; public class displayresult extends javax.swing.JFrame { public displayresult() { initComponents(); } @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jPanel1 = new javax.swing.JPanel(); hd_name = new javax.swing.JLabel(); jPanel2 = new javax.swing.JPanel(); reg_num_label = new javax.swing.JLabel(); reg_num_field = new javax.swing.JTextField(); wt_label = new javax.swing.JLabel(); wt_field = new javax.swing.JTextField(); ca_label = new javax.swing.JLabel(); ca_field = new javax.swing.JTextField(); se_label = new javax.swing.JLabel(); se_field = new javax.swing.JTextField(); os_label = new javax.swing.JLabel(); os_field = new javax.swing.JTextField(); algo_label = new javax.swing.JLabel(); algo_field = new javax.swing.JTextField(); maths_label = new javax.swing.JLabel(); maths_field = new javax.swing.JTextField(); ok_button = new javax.swing.JButton(); jButton1 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jPanel1.setBackground(new java.awt.Color(153, 153, 153)); hd_name.setFont(new java.awt.Font("Algerian", 1, 48)); // NOI18N hd_name.setText("RESULT"); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(hd_name) .addGap(661, 661, 661)) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(25, 25, 25) .addComponent(hd_name) .addContainerGap(26, Short.MAX_VALUE)) ); reg_num_label.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N reg_num_label.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); reg_num_label.setText("Register number"); wt_label.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N wt_label.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); wt_label.setText("Web Tech"); ca_label.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N ca_label.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); ca_label.setText("CA"); se_label.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N se_label.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); se_label.setText("SE"); os_label.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N os_label.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); os_label.setText("OS"); algo_label.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N algo_label.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); algo_label.setText("Algorithms"); maths_label.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N maths_label.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); maths_label.setText("Maths"); ok_button.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N ok_button.setText("OK"); ok_button.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { ok_buttonActionPerformed(evt); } }); jButton1.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N jButton1.setText("homepage"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addGap(96, 96, 96) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(maths_label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(algo_label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(os_label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(se_label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(ca_label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(wt_label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(reg_num_label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(193, 193, 193) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(reg_num_field) .addComponent(wt_field) .addComponent(ca_field) .addComponent(se_field) .addComponent(os_field) .addComponent(algo_field) .addComponent(maths_field, javax.swing.GroupLayout.DEFAULT_SIZE, 165, Short.MAX_VALUE)) .addContainerGap(94, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() .addComponent(ok_button) .addGap(312, 312, 312)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() .addComponent(jButton1) .addGap(268, 268, 268)))) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addGap(81, 81, 81) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(reg_num_label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(reg_num_field, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addComponent(ok_button, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 21, Short.MAX_VALUE) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(wt_label, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(wt_field, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(30, 30, 30) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(ca_label, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(ca_field, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(30, 30, 30) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(se_label, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(se_field, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(27, 27, 27) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(os_label, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(os_field, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(27, 27, 27) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(algo_label, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(algo_field, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(28, 28, 28) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(maths_label, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(maths_field, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(16, 16, 16) .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap(443, Short.MAX_VALUE) .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(379, 379, 379)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(34, 34, 34) .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(93, Short.MAX_VALUE)) ); pack(); setLocationRelativeTo(null); }// </editor-fold>//GEN-END:initComponents private static final String USERNAME="root"; private static final String PASSWORD=""; private static final String CONN_STRING="jdbc:mysql://localhost:3306/stu_signup"; private void ok_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ok_buttonActionPerformed Connection conn = null; try { conn = DriverManager.getConnection(CONN_STRING,USERNAME,PASSWORD); System.out.println("connected"); String sql = " select * from addmarks inner join payment on addmarks.register_no=payment.register_no where addmarks.register_no=?";//SELECT SE,CASE WHEN SE > 90 THEN \"O\" WHEN SE > 80 THEN \"A+\" WHEN SE > 70 THEN \"A\" WHEN SE > 60 THEN \"B+\" WHEN SE > 50 THEN \"B\" ELSE \"RA\" END as GRADE FROM addmarks where register_no=?"; PreparedStatement st = conn.prepareStatement(sql); st.setInt(1,Integer.parseInt(reg_num_field.getText())); ResultSet rs = st.executeQuery(); if(rs.next()) { ResultSet rs1 = st.getResultSet(); if(!rs1.getString("fees").equals("1200")) { JOptionPane.showMessageDialog(null,"Please pay the sem fees.","Permission denied", JOptionPane.ERROR_MESSAGE); this.dispose(); fees_payment fp1 = new fees_payment(); fp1.setVisible(true); } else { String sql1 = "select avg(SE),avg(WebTech),avg(OS),avg(CA),avg(Algo),avg(Maths) from addmarks"; PreparedStatement st1 = conn.prepareStatement(sql1); ResultSet rs2 = st1.executeQuery(); if(rs2.next()) { ResultSet rs3 = st1.getResultSet(); int a = Integer.parseInt(rs.getString("SE")); int a1 = rs3.getInt("avg(SE)"); if(a>=a1) { se_field.setText("O"); } else if(a>=a1-10 && a<a1 && a>=50) { se_field.setText("A+"); } else if(a>=a1-20 && a<a1-10 && a>=50) { se_field.setText("A"); } else if(a>=a1-30 && a<a1-20 && a>=50) { se_field.setText("B+"); } else if(a>=a1-40 && a<a1-30 && a>=50) { se_field.setText("B"); } else { se_field.setText("RA"); } int b = Integer.parseInt(rs.getString("WebTech")); int b1 = rs3.getInt("avg(WebTech)"); if(b>=b1) { wt_field.setText("O"); } else if(b>=b1-10 && b<b1 && b>=50) { wt_field.setText("A+"); } else if(b>=b1-20 && b<b1-10 && b>=50) { wt_field.setText("A"); } else if(b>=b1-30 && b<b1-20 && b>=50) { wt_field.setText("B+"); } else if(b>=b1-40 && b<b1-30 && b>=50) { wt_field.setText("B"); } else { wt_field.setText("RA"); } int c = Integer.parseInt(rs.getString("OS")); int c1 = rs3.getInt("avg(OS)"); if(c>=c1) { os_field.setText("O"); } else if(c>=c1-10 && c<c1 && c>=50) { os_field.setText("A+"); } else if(c>=c1-20 && c<c1-10 && c>=50) { os_field.setText("A"); } else if(c>=c1-30 && c<c1-20 && c>=50) { os_field.setText("B+"); } else if(c>=c1-40 && c<c1-30 && c>=50) { os_field.setText("B"); } else { os_field.setText("RA"); } int d = Integer.parseInt(rs.getString("Algo")); int d1 = rs3.getInt("avg(Algo)"); if(d>=d1) { algo_field.setText("O"); } else if(d>=d1-10 && d<d1 && d>=50) { algo_field.setText("A+"); } else if(d>=d1-20 && d<d1-10 && d>=50) { algo_field.setText("A"); } else if(d>=d1-30 && d<d1-20 && d>=50) { algo_field.setText("B+"); } else if(d>=d1-40 && d<d1-30 && d>=50) { algo_field.setText("B"); } else { algo_field.setText("RA"); } int e = Integer.parseInt(rs.getString("CA")); int e1 = rs3.getInt("avg(CA)"); if(e>=e1) { ca_field.setText("O"); } else if(e>=e1-10 && e<e1 && e>=50) { ca_field.setText("A+"); } else if(e>=e1-20 && e<e1-10 && e>=50) { ca_field.setText("A"); } else if(e>=e1-30 && e<e1-20 && e>=50) { ca_field.setText("B+"); } else if(e>=e1-40 && e<e1-30 && e>=50) { ca_field.setText("B"); } else { ca_field.setText("RA"); } int f = Integer.parseInt(rs.getString("Maths")); int f1 = rs3.getInt("avg(Maths)"); if(f>=f1) { maths_field.setText("O"); } else if(f>=f1-10 && f<f1 && f>=50) { maths_field.setText("A+"); } else if(f>=f1-20 && f<f1-10 && f>=50) { maths_field.setText("A"); } else if(f>=f1-30 && f<f1-20 && f>=50) { maths_field.setText("B+"); } else if(f>=f1-40 && f<f1-30 && f>=50) { maths_field.setText("B"); } else { ca_field.setText("RA"); } } } } else { JOptionPane.showMessageDialog(null,"No such entry!!!","Permission denied", JOptionPane.ERROR_MESSAGE); //uname.setText(null); //password.setText(null); } conn.close(); } catch(SQLException e) { JOptionPane.showMessageDialog(null,e); } }//GEN-LAST:event_ok_buttonActionPerformed private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed homepage h2 =new homepage(); this.dispose(); h2.setVisible(true); }//GEN-LAST:event_jButton1ActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables public javax.swing.JTextField algo_field; private javax.swing.JLabel algo_label; public javax.swing.JTextField ca_field; private javax.swing.JLabel ca_label; private javax.swing.JLabel hd_name; private javax.swing.JButton jButton1; private javax.swing.JPanel jPanel1; public javax.swing.JPanel jPanel2; public javax.swing.JTextField maths_field; private javax.swing.JLabel maths_label; private javax.swing.JButton ok_button; public javax.swing.JTextField os_field; private javax.swing.JLabel os_label; public static javax.swing.JTextField reg_num_field; private javax.swing.JLabel reg_num_label; public javax.swing.JTextField se_field; private javax.swing.JLabel se_label; public javax.swing.JTextField wt_field; private javax.swing.JLabel wt_label; // End of variables declaration//GEN-END:variables }
[ "noreply@github.com" ]
noreply@github.com
10415885753f7d9e0a536bfc95073fc5cb937b0e
bc342b3a64841d79bbe7894beadb9b3921af429b
/app/src/main/java/me/jessyan/mvparms/demo/di/component/LogisticsComponent.java
86e88bddd902e9ec1acb9d77d1ce6a14d9739be7
[]
no_license
enjoyDevepter/enjoy_client
1518c3c4fb63e13634aeac4b12d54a48688d222a
d2da28c2ac5a7f77410bf28f034505167a9efa59
refs/heads/master
2020-03-24T22:39:28.596044
2018-11-08T04:00:54
2018-11-08T04:00:54
143,096,453
0
0
null
null
null
null
UTF-8
Java
false
false
469
java
package me.jessyan.mvparms.demo.di.component; import com.jess.arms.di.component.AppComponent; import com.jess.arms.di.scope.ActivityScope; import dagger.Component; import me.jessyan.mvparms.demo.di.module.LogisticsModule; import me.jessyan.mvparms.demo.mvp.ui.activity.LogisticsActivity; @ActivityScope @Component(modules = LogisticsModule.class, dependencies = AppComponent.class) public interface LogisticsComponent { void inject(LogisticsActivity activity); }
[ "guomin@mapbar.com" ]
guomin@mapbar.com
cf8c7ef42ce80e751c60ab3c5dff41ed8fa3ff2b
9049eabb2562cd3e854781dea6bd0a5e395812d3
/sources/com/google/android/gms/wallet/buyflow/CheckoutChimeraActivity.java
52f3695c7a7b75c14e492dea605e46f215a7a31e
[]
no_license
Romern/gms_decompiled
4c75449feab97321da23ecbaac054c2303150076
a9c245404f65b8af456b7b3440f48d49313600ba
refs/heads/master
2022-07-17T23:22:00.441901
2020-05-17T18:26:16
2020-05-17T18:26:16
264,227,100
2
5
null
null
null
null
UTF-8
Java
false
false
20,243
java
package com.google.android.gms.wallet.buyflow; import android.content.Context; import android.content.Intent; import android.content.res.TypedArray; import android.graphics.drawable.Drawable; import android.os.Build; import android.os.Bundle; import android.os.Parcelable; import android.support.p002v7.widget.Toolbar; import android.text.TextUtils; import android.util.Log; import android.view.View; import com.felicanetworks.mfc.C0126R; import com.google.android.chimera.Activity; import com.google.android.chimera.Fragment; import com.google.android.gms.wallet.analytics.events.OrchestrationClosedEvent; import com.google.android.gms.wallet.common.p079ui.BottomSheetView; import com.google.android.gms.wallet.common.p079ui.PopoverView; import com.google.android.gms.wallet.firstparty.WalletCustomTheme; import com.google.android.gms.wallet.intentoperation.AnalyticsIntentOperation; import com.google.android.gms.wallet.shared.ApplicationParameters; import com.google.android.gms.wallet.shared.BuyFlowConfig; import com.google.android.material.bottomsheet.BottomSheetBehavior; import com.google.autofill.detection.p098ml.AndroidInputTypeSignal; import java.util.Arrays; /* compiled from: :com.google.android.gms@201515033@20.15.15 (120300-306758586) */ public class CheckoutChimeraActivity extends awce implements awhd, bkcy, awgr, aweo { /* renamed from: i */ int f110023i; /* renamed from: j */ bkcz f110024j; /* renamed from: k */ PopoverView f110025k; /* renamed from: l */ BottomSheetView f110026l; /* renamed from: m */ Toolbar f110027m; /* renamed from: n */ private boolean f110028n; /* renamed from: A */ private final boolean m93848A() { return mo51881h().f110418b.f110415j == 1; } /* renamed from: a */ static int m93849a(Context context, BuyFlowConfig buyFlowConfig) { boolean z; boolean z2; WalletCustomTheme walletCustomTheme = buyFlowConfig.f110418b.f110411f; if (walletCustomTheme == null || walletCustomTheme.f110169b.getInt("windowTransitionsStyle", -1) != 4) { z = false; } else { z = true; } if (!awia.m79986a(context.getResources()) || !((Boolean) awih.f94442c.mo58455c()).booleanValue()) { z2 = false; } else { z2 = true; } boolean a = chfw.f188574a.mo6606a().mo85204a(); if (z && z2) { return 2; } if (z) { return 3; } if (!z2) { return !a ? 0 : 4; } return 1; } /* JADX DEBUG: Failed to find minimal casts for resolve overloaded methods, cast all args instead method: com.google.android.gms.wallet.buyflow.CheckoutChimeraActivity.a(int, int, int, boolean):android.content.Intent arg types: [int, int, int, int] candidates: awce.a(android.os.Bundle, bdyx, int, bpis):void com.google.android.gms.wallet.buyflow.CheckoutChimeraActivity.a(int, int, int, boolean):android.content.Intent */ /* renamed from: f */ private final void m93852f(int i) { Intent a = m93850a(5, i, 9, false); a.putExtra("com.google.android.gms.wallet.firstparty.EXTRA_ERROR_CODE", i); setResult(1, a); StringBuilder sb = new StringBuilder(40); sb.append("sendErrorAndFinish errorCode="); sb.append(i); sb.toString(); finish(); } /* JADX DEBUG: Failed to find minimal casts for resolve overloaded methods, cast all args instead method: com.google.android.gms.wallet.buyflow.CheckoutChimeraActivity.a(int, int, int, boolean):android.content.Intent arg types: [int, int, int, int] candidates: awce.a(android.os.Bundle, bdyx, int, bpis):void com.google.android.gms.wallet.buyflow.CheckoutChimeraActivity.a(int, int, int, boolean):android.content.Intent */ /* renamed from: g */ private final void m93853g(int i) { setResult(0, m93850a(4, 0, i, false)); finish(); } /* renamed from: z */ private final void m93854z() { awer awer; if (!awyf.m81495a(this)) { if (this.f110024j != null) { getSupportFragmentManager().beginTransaction().remove(this.f110024j).commit(); } bkcz a = bkcz.m105336a(); this.f110024j = a; a.f124032a = this; a.show(getSupportFragmentManager(), "CheckoutChimeraActivity.NETWORK_ERROR_DIALOG"); return; } if (!this.f110028n) { this.f110028n = true; getSupportFragmentManager().beginTransaction().add(awhf.m79933a(mo51878cn(), awyd.m81489a(mo51881h().f110418b)), "RetrieveAuthTokensFragment").commit(); } Intent intent = getIntent(); if (intent.getExtras().containsKey("com.google.android.gms.wallet.firstparty.EXTRA_INITIALIZE_TOKEN")) { awer = awer.m79720a(intent.getByteArrayExtra("com.google.android.gms.wallet.firstparty.EXTRA_INITIALIZE_TOKEN"), null, mo51881h(), this.f94163b, null, this.f94164c); } else if (intent.getExtras().containsKey("com.google.android.gms.wallet.firstparty.EXTRA_PARAMS")) { awer = awer.m79733b(intent.getByteArrayExtra("com.google.android.gms.wallet.firstparty.EXTRA_PARAMS"), intent.getByteArrayExtra("com.google.android.gms.wallet.firstparty.EXTRA_UNENCRYPTED_PARAMS"), mo51881h(), this.f94163b, null, this.f94164c); } else { throw new IllegalArgumentException("CheckoutChimeraActivity requires either buyflow params or InitializeResponse token"); } mo51866a(awer, (int) C0126R.C0129id.popover_content_holder); } /* renamed from: c */ public final void mo51874c(int i) { if (this.f110025k != null) { if (awia.m79986a(getResources())) { m93853g(i); } else { this.f110025k.mo59875b(i); } } else if (this.f110026l != null) { mo59823y(); findViewById(C0126R.C0129id.bottom_sticky_button_container).setVisibility(8); BottomSheetView bottomSheetView = this.f110026l; bottomSheetView.f110056l = i; bottomSheetView.f110048d = true; BottomSheetBehavior bottomSheetBehavior = bottomSheetView.f110053i; bottomSheetBehavior.f151097k = true; bottomSheetBehavior.mo71035b(true); awgr awgr = bottomSheetView.f110055k; if (awgr != null) { awgr.mo52133e(i); } } else { m93853g(i); } } /* renamed from: d */ public final void mo52162d(int i) { m93852f(-1); } /* renamed from: e */ public final void mo52133e(int i) { m93853g(i); } public final void finish() { super.finish(); if (this.f110023i == 3) { overridePendingTransition(0, awia.m79965a(mo51881h())); } } /* JADX DEBUG: Failed to find minimal casts for resolve overloaded methods, cast all args instead method: awia.a(com.google.android.chimera.Activity, com.google.android.gms.wallet.shared.BuyFlowConfig, awhz, boolean):void arg types: [com.google.android.gms.wallet.buyflow.CheckoutChimeraActivity, com.google.android.gms.wallet.shared.BuyFlowConfig, awhz, int] candidates: awia.a(bwiv, android.content.Intent, android.content.Context, com.google.android.gms.wallet.shared.BuyFlowConfig):android.content.Intent awia.a(com.google.android.chimera.Activity, com.google.android.gms.wallet.shared.BuyFlowConfig, awhz, boolean):void */ /* access modifiers changed from: protected */ public final void onCreate(Bundle bundle) { BuyFlowConfig h = mo51881h(); if (!mo51890q()) { int a = m93849a(this, h); this.f110023i = a; awia.m79981a((Activity) this, h, (a == 1 || a == 2 || a == 3) ? awia.f94383e : a != 4 ? awia.f94380b : awia.f94381c, true); } mo51862a(bundle, awij.f94453a, 1, bpis.FLOW_TYPE_BUYFLOW); super.onCreate(bundle); if (!mo51890q()) { int i = this.f110023i; if (i == 1 || i == 2 || i == 3) { setContentView((int) C0126R.C0128layout.wallet_activity_checkout_fullscreen); Toolbar toolbar = (Toolbar) findViewById(C0126R.C0129id.buyflow_toolbar); this.f110027m = toolbar; mo8626a(toolbar); } else if (i != 4) { setContentView((int) C0126R.C0128layout.wallet_activity_checkout); TypedArray obtainStyledAttributes = obtainStyledAttributes(new int[]{C0126R.attr.colorWalletActionBarForeground}); int color = obtainStyledAttributes.getColor(0, 0); obtainStyledAttributes.recycle(); Drawable a2 = C1163lk.m19268a(getResources(), (int) C0126R.C0127drawable.quantum_ic_clear_white_24, getTheme()); if (!(color == 0 || a2 == null)) { C1173lt.m19599a(a2, color); mo8628aW().mo15856c(a2); mo8628aW().mo15865f((int) C0126R.string.close_button_label); } } else { setContentView((int) C0126R.C0128layout.wallet_activity_checkout_bottom_sheet); Toolbar toolbar2 = (Toolbar) findViewById(C0126R.C0129id.buyflow_toolbar); this.f110027m = toolbar2; mo8626a(toolbar2); mo59823y(); } mo8628aW().mo15853b(true); BottomSheetView bottomSheetView = (BottomSheetView) findViewById(C0126R.C0129id.bottom_sheet); this.f110026l = bottomSheetView; if (bottomSheetView != null) { boolean A = m93848A(); double d = h.f110418b.f110413h; if (A) { bottomSheetView.setVisibility(8); } bottomSheetView.f110050f = d; bottomSheetView.f110053i = new BottomSheetBehavior(); ((aip) bottomSheetView.getLayoutParams()).mo787a(bottomSheetView.f110053i); bottomSheetView.f110053i.mo71029a(new awgn(bottomSheetView)); bottomSheetView.f110053i.mo71037c(4); bottomSheetView.f110053i.mo71035b(false); this.f110026l.f110055k = this; } PopoverView popoverView = (PopoverView) findViewById(C0126R.C0129id.popover); this.f110025k = popoverView; if (popoverView != null) { if (m93848A()) { this.f110025k.setVisibility(8); } PopoverView.m93901a(this); PopoverView popoverView2 = this.f110025k; popoverView2.f110100f = this; ApplicationParameters applicationParameters = h.f110418b; popoverView2.mo59869a(applicationParameters.f110413h, applicationParameters.f110414i); } if (bundle != null) { this.f110028n = bundle.getBoolean("hasAuthTokens"); if (bundle.getBoolean("initializeProgressSpinnerVisible")) { mo52026a(true); } } else { m93854z(); } awia.m79978a(findViewById(C0126R.C0129id.wallet_root)); } } /* access modifiers changed from: protected */ public final void onNewIntent(Intent intent) { if (mo51879e() != null) { ((awer) mo51879e()).mo52058b(intent); } } /* access modifiers changed from: protected */ public final void onResume() { super.onResume(); bkcz bkcz = (bkcz) getSupportFragmentManager().findFragmentByTag("CheckoutChimeraActivity.NETWORK_ERROR_DIALOG"); this.f110024j = bkcz; if (bkcz != null) { bkcz.f124032a = this; } } /* access modifiers changed from: protected */ public final void onSaveInstanceState(Bundle bundle) { boolean z; super.onSaveInstanceState(bundle); bundle.putBoolean("hasAuthTokens", this.f110028n); View findViewById = findViewById(C0126R.C0129id.initialize_progress_spinner); if (findViewById != null) { if (findViewById.getVisibility() == 0) { z = true; } else { z = false; } bundle.putBoolean("initializeProgressSpinnerVisible", z); } } /* access modifiers changed from: protected */ /* renamed from: q */ public final boolean mo51890q() { BuyFlowConfig h = mo51881h(); return h != null && chfd.f188555a.mo85191b().mo85192a().f165797a.contains(h.f110419c) && getIntent().getExtras().containsKey("com.google.android.gms.wallet.firstparty.EXTRA_PARAMS"); } /* access modifiers changed from: protected */ /* renamed from: r */ public final Intent mo51891r() { byte[] byteArrayExtra = getIntent().getByteArrayExtra("com.google.android.gms.wallet.firstparty.EXTRA_PARAMS"); Intent a = awef.m79686a(this, 1, mo51881h(), getIntent().getLongExtra("com.google.android.gms.wallet.intentBuildTimeMs", 0)); a.putExtra("encryptedParams", byteArrayExtra); return a; } /* renamed from: t */ public final void mo52134t() { mo51870b(4); } /* renamed from: u */ public final void mo52135u() { if (mo51879e() != null) { ((awer) mo51879e()).mo52030B(); } } /* renamed from: v */ public final void mo52136v() { if (this.f110026l != null) { mo8628aW().mo15859d(); int[] iArr = {16842801, C0126R.attr.colorPrimaryDark}; Arrays.sort(iArr); TypedArray obtainStyledAttributes = obtainStyledAttributes(iArr); int color = obtainStyledAttributes.getColor(Arrays.binarySearch(iArr, 16842801), -1); int color2 = obtainStyledAttributes.getColor(Arrays.binarySearch(iArr, (int) C0126R.attr.colorPrimaryDark), -16777216); obtainStyledAttributes.recycle(); getWindow().getDecorView().setBackgroundColor(color); int i = Build.VERSION.SDK_INT; getWindow().setStatusBarColor(color2); } } /* renamed from: w */ public final void mo52163w() { Fragment findFragmentByTag = getSupportFragmentManager().findFragmentByTag("RetrieveAuthTokensFragment"); if (findFragmentByTag != null) { getSupportFragmentManager().beginTransaction().remove(findFragmentByTag).commit(); } } /* renamed from: x */ public final void mo52164x() { m93853g(8); } /* access modifiers changed from: package-private */ /* renamed from: y */ public final void mo59823y() { this.f110027m.setVisibility(4); getWindow().getDecorView().setBackgroundColor(0); int i = Build.VERSION.SDK_INT; getWindow().setStatusBarColor(0); } /* renamed from: a */ private final Intent m93850a(int i, int i2, int i3, boolean z) { Intent d = awce.m79602d(z); bpil a = AnalyticsIntentOperation.m94032a(this, new OrchestrationClosedEvent(i, i2, i3, mo51878cn() != null ? mo51878cn().name : "", this.f94163b)); if (a != null) { bxwc bxwc = a.f137779a; int size = bxwc.size(); for (int i4 = 0; i4 < size; i4++) { bpik bpik = (bpik) bxwc.get(i4); bphe bphe = bpik.f137766h; if (bphe == null) { bphe = bphe.f137630n; } if (bphe.f137635d.size() != 0) { bphe bphe2 = bpik.f137766h; if (bphe2 == null) { bphe2 = bphe.f137630n; } bxwc bxwc2 = bphe2.f137635d; int size2 = bxwc2.size(); for (int i5 = 0; i5 < size2; i5++) { bphh bphh = (bphh) bxwc2.get(i5); bxvd bxvd = (bxvd) bphh.mo74142c(5); bxvd.mo73625a((GeneratedMessageLite) bphh); if (bxvd.f164950c) { bxvd.mo74035c(); bxvd.f164950c = false; } bphh bphh2 = (bphh) bxvd.f164949b; bphh bphh3 = bphh.f137646f; bphh2.f137648a &= -9; bphh2.f137652e = bphh.f137646f.f137652e; bphh bphh4 = (bphh) bxvd.mo74062i(); } } } } bjvp.m104735a(d, "com.google.android.gms.wallet.firstparty.EXTRA_ANALYTICS_PROTO", a); byte[] bArr = this.f94165d; if (bArr != null && bArr.length > 0) { d.putExtra("com.google.android.gms.wallet.firstparty.EXTRA_SERVER_ANALYTICS_TOKEN", bArr); } bjst.m104518a(this.f94164c, awga.m79886a(i), i2); return d; } /* renamed from: a */ public static Intent m93851a(Context context, Intent intent, BuyFlowConfig buyFlowConfig) { sdo.m34959a(buyFlowConfig); sdo.m34959a(buyFlowConfig.f110418b); sdo.m34974b(!buyFlowConfig.f110418b.f110409d); if (!((Boolean) awig.f94436b.mo58455c()).booleanValue()) { return axdg.m82385a(context, intent, buyFlowConfig); } Intent intent2 = new Intent(); intent2.setClassName(context, "com.google.android.gms.wallet.buyflow.CheckoutActivity"); intent2.putExtras(intent.getExtras()); intent2.setAction("com.google.android.gms.wallet.ACTION_CHECKOUT"); intent2.putExtra("com.google.android.gms.wallet.buyFlowConfig", buyFlowConfig); int a = m93849a(context, buyFlowConfig); if (a == 2 || a == 3 || a == 4) { return intent2; } intent2.addFlags(AndroidInputTypeSignal.TYPE_TEXT_FLAG_AUTO_COMPLETE); return intent2; } /* renamed from: a */ public final void mo51858a(int i) { m93852f(i); } /* renamed from: a */ public final void mo52044a(int i, int i2) { if (i2 != 1000) { StringBuilder sb = new StringBuilder(44); sb.append("Unknown error dialog error code: "); sb.append(i2); Log.e("CheckoutChimeraActivity", sb.toString()); m93852f(-1); } else if (i != 1) { m93853g(7); } else { m93854z(); } } /* renamed from: a */ public final /* bridge */ /* synthetic */ void mo51864a(Parcelable parcelable, boolean z) { BuyFlowResult buyFlowResult = (BuyFlowResult) parcelable; Intent a = m93850a(2, 0, 2, z); if (buyFlowResult != null) { byte[] bArr = buyFlowResult.f110019d; if (bArr != null) { a.putExtra("com.google.android.gms.wallet.firstparty.EXTRA_INTEGRATOR_CALLBACK_DATA_TOKEN", bArr); } if (!TextUtils.isEmpty(buyFlowResult.f110017b)) { a.putExtra("com.google.android.gms.wallet.firstparty.EXTRA_ORDER_ID", buyFlowResult.f110017b); } if (!TextUtils.isEmpty(buyFlowResult.f110018c)) { a.putExtra("com.google.android.gms.wallet.firstparty.EXTRA_DISPLAY_MESSAGE", buyFlowResult.f110018c); } byte[] bArr2 = buyFlowResult.f110022g; if (bArr2 != null) { a.putExtra("com.google.android.gms.wallet.firstparty.EXTRA_CLIENT_CALLBACK_DATA_TOKEN", bArr2); } Object[] objArr = {buyFlowResult.f110017b, buyFlowResult.f110018c}; } setResult(-1, a); finish(); } /* renamed from: a */ public final void mo52026a(boolean z) { View findViewById; int i; if (m93848A() && (findViewById = findViewById(C0126R.C0129id.initialize_progress_spinner)) != null) { if (!z) { i = 8; } else { i = 0; } findViewById.setVisibility(i); } } }
[ "roman.karwacik@rwth-aachen.de" ]
roman.karwacik@rwth-aachen.de
eb5459de203fc2e0ea4190887ac38dc3b9d87f74
7e3c027dfdd5e487d47fc5bd52a1c537f35645da
/DraftLayout.java
cffc7b83c6d809d7f25a85a4aec1b7884497b342
[]
no_license
bukaiqiaode/hello-world
107b3b81a6445ca43c4f2c1f66d58cfef5db4191
07160eac14e552cc457f49d63e8ccda75dd42a57
refs/heads/master
2021-09-05T18:07:21.136689
2018-01-30T05:10:16
2018-01-30T05:10:16
103,142,301
0
0
null
2017-12-02T14:53:19
2017-09-11T13:54:49
Python
UTF-8
Java
false
false
3,614
java
package com.apress.gerber.reddot; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.PointF; import android.graphics.Rect; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.util.AttributeSet; import android.util.Log; import android.view.MotionEvent; import android.view.View; import android.widget.FrameLayout; /** * Created by kunwang on 12/14/2017. */ public class DraftLayout extends FrameLayout { private static final String TAG = "DraftLayout"; MyButton mbtn = null; private int statusBarHeight; PointF mFixCanterPoint = new PointF(450, 450); PointF mDragCanterPoint = new PointF(250, 450); private Paint mPaint; float mFixRadius = 20; float mDragRadius = 20; private boolean working = false; public DraftLayout(@NonNull Context context) { super(context); mPaint = new Paint(); mPaint.setColor(Color.RED); mPaint.setAntiAlias(true); } public DraftLayout(@NonNull Context context, @Nullable AttributeSet attrs) { super(context, attrs); mPaint = new Paint(); mPaint.setColor(Color.RED); mPaint.setAntiAlias(true); } @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); canvas.save(); canvas.translate(0, -statusBarHeight); if(working == true) { canvas.drawCircle(mFixCanterPoint.x, mFixCanterPoint.y, mFixRadius, mPaint); canvas.drawCircle(mDragCanterPoint.x, mDragCanterPoint.y, mDragRadius, mPaint); } canvas.restore(); } @Override public boolean onTouchEvent(MotionEvent event) { float theX = 0f; float theY = 0f; boolean onIt = false; if(getChildCount() > 0) { mbtn = (MyButton)getChildAt(0); theX = mbtn.getX(); theY = mbtn.getY() - statusBarHeight; onIt = mbtn.isOnIt(); mbtn.setVisibility(INVISIBLE); } switch (event.getAction()) { case MotionEvent.ACTION_DOWN: if(onIt == true) { working = true; //we know the point now mFixCanterPoint.set(new PointF(theX, theY)); //draw the cycle invalidate(); Log.e(TAG, "ACTION_DOWN" + theX + ", " + theY + ", on = " + onIt); } break; case MotionEvent.ACTION_MOVE: PointF temp = new PointF(event.getRawX(), event.getRawY()); mDragCanterPoint.set(temp); invalidate(); Log.e(TAG, "ACTION_MOVE" + theX + ", " + theY); break; case MotionEvent.ACTION_UP: working = false; if(mbtn != null){ mbtn.setVisibility(VISIBLE); } Log.e(TAG, "ACTION_UP" + theX + ", " + theY); break; } return true; } @Override protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(w, h, oldw, oldh); statusBarHeight=getStatusBarHeight(this); } public static int getStatusBarHeight(View v) { if (v == null) { return 0; } Rect frame = new Rect(); v.getWindowVisibleDisplayFrame(frame); return frame.top; } }
[ "noreply@github.com" ]
noreply@github.com
4787dbef7cd0229180417ee2b0ff434b29610629
706fd9f9a658897303cccf50df2bf0662486692e
/src/com/hs/service/LoginService.java
0ac202859686b804d0c173e6807c1a1e8c2f69c3
[]
no_license
hsit17/exam
ce46354ab05027d912247820975ced5f61265d52
f7ece4943cd631e12343b2bf49733173b0157aba
refs/heads/master
2022-05-23T05:39:00.272991
2020-04-22T07:32:21
2020-04-22T07:32:21
257,821,945
0
0
null
null
null
null
UTF-8
Java
false
false
267
java
package com.hs.service; import javax.servlet.http.HttpServletRequest; public interface LoginService { public String login(Integer roleId,String username,String password,HttpServletRequest request); public String updatePassword(HttpServletRequest request); }
[ "358370054@qq.com" ]
358370054@qq.com
d4c7e5e80f49960e23bffd0cd8b9590eec72b4c8
9371ae6ec24ad4b9914a43e64befb915d71e34f2
/out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/src/java/util/prefs/PreferenceChangeListener.java
8629ac945a17cf4c4c936f4577db5281a9c1a66b
[]
no_license
kanaida/LG-Esteem-Homeless-Kernel
9fac4c52993798eaf3021d9abb72a5e697464398
a5780f82bef7631fdb43b079e6f9ea6dbd187ac7
refs/heads/master
2020-06-09T06:14:50.214296
2012-02-24T04:23:01
2012-02-24T04:23:01
3,532,548
1
2
null
null
null
null
UTF-8
Java
false
false
188
java
package java.util.prefs; public interface PreferenceChangeListener extends java.util.EventListener { public abstract void preferenceChange(java.util.prefs.PreferenceChangeEvent pce); }
[ "kanaida.bat@gmail.com" ]
kanaida.bat@gmail.com
daa9a58287f389987df3ff2fe8043612d0e461d1
7b3da69368f1b04b46f8b238a9a7a19efa4cdf79
/aerospike/aerospike-client-java-2.1.14/client/src/com/aerospike/client/Info.java
ed6ff55fe8663e28106566ff79715086b6f875ff
[ "Apache-2.0" ]
permissive
Tomting/YCSB
99ba0f616d4a9efcb116f50ca6c1810dbe052afd
a34bb831114e536e7eee232434b0081144484f2d
refs/heads/master
2021-01-16T22:58:11.335009
2014-11-22T17:15:40
2014-11-22T17:15:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
12,795
java
/* * Aerospike Client - Java Library * * Copyright 2012 by Aerospike, Inc. All rights reserved. * * Availability of this source code to partners and customers includes * redistribution rights covered by individual contract. Please check your * contract for exact rights and responsibilities. */ package com.aerospike.client; import java.io.EOFException; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.InetSocketAddress; import java.util.HashMap; import com.aerospike.client.cluster.Connection; import com.aerospike.client.command.Buffer; import com.aerospike.client.util.ThreadLocalData; /** * Access Citrusleaf's monitoring protocol - the "Info" protocol. * <p> * The info protocol is a name/value pair based system, where an individual * database server node is queried to determine its configuration and status. * The list of supported names can be found on the Citrusleaf Wiki under the TCP * wire protocol specification. */ public final class Info { //------------------------------------------------------- // Static variables. //------------------------------------------------------- private static final int DEFAULT_TIMEOUT = 2000; //------------------------------------------------------- // Member variables. //------------------------------------------------------- private byte[] buffer; private int length; private int offset; //------------------------------------------------------- // Constructor //------------------------------------------------------- /** * Send single command to server and store results. * This constructor is used internally. * The static request methods should be used instead. * * @param conn connection to server node * @param command command sent to server */ public Info(Connection conn, String command) throws AerospikeException { buffer = ThreadLocalData.getSendBuffer(); offset = 8; // Skip size field. // The command format is: <name1>\n<name2>\n... offset += Buffer.stringToUtf8(command, buffer, offset); buffer[offset++] = '\n'; sendCommand(conn); } /** * Send multiple commands to server and store results. * This constructor is used internally. * The static request methods should be used instead. * * @param conn connection to server node * @param commands commands sent to server */ public Info(Connection conn, String... commands) throws AerospikeException { buffer = ThreadLocalData.getSendBuffer(); offset = 8; // Skip size field. // The command format is: <name1>\n<name2>\n... for (String command : commands) { offset += Buffer.stringToUtf8(command, buffer, offset); buffer[offset++] = '\n'; } sendCommand(conn); } /** * Send default empty command to server and store results. * This constructor is used internally. * The static request methods should be used instead. * * @param conn connection to server node */ public Info(Connection conn) throws AerospikeException { buffer = ThreadLocalData.getSendBuffer(); offset = 8; // Skip size field. sendCommand(conn); } /** * Parse response in name/value pair format: * <p> * <command>\t<name1>=<value1>;<name2>=<value2>;...\n * * @return parser for name/value pairs */ public NameValueParser getNameValueParser() { // Skip past command. while (offset < length) { byte b = buffer[offset]; if (b == '\t') { offset++; break; } if (b == '\n') { break; } offset++; } return new NameValueParser(); } //------------------------------------------------------- // Get Info via Host Name and Port //------------------------------------------------------- /** * Get one info value by name from the specified database server node, using * host name and port. * * @param hostname host name * @param port host port * @param name name of value to retrieve * @return info value */ public static String request(String hostname, int port, String name) throws AerospikeException { return request(new InetSocketAddress(hostname, port), name); } /** * Get many info values by name from the specified database server node, * using host name and port. * * @param hostname host name * @param port host port * @param names names of values to retrieve * @return info name/value pairs */ public static HashMap<String,String> request(String hostname, int port, String... names) throws AerospikeException { return request(new InetSocketAddress(hostname, port), names); } /** * Get default info from the specified database server node, using host name and port. * * @param hostname host name * @param port host port * @return info name/value pairs */ public static HashMap<String,String> request(String hostname, int port) throws AerospikeException { return request(new InetSocketAddress(hostname, port)); } //------------------------------------------------------- // Get Info via Socket Address //------------------------------------------------------- /** * Get one info value by name from the specified database server node. * * @param socketAddress <code>InetSocketAddress</code> of server node * @param name name of value to retrieve * @return info value */ public static String request(InetSocketAddress socketAddress, String name) throws AerospikeException { Connection conn = new Connection(socketAddress, DEFAULT_TIMEOUT); try { return request(conn, name); } finally { conn.close(); } } /** * Get many info values by name from the specified database server node. * * @param socketAddress <code>InetSocketAddress</code> of server node * @param names names of values to retrieve * @return info name/value pairs */ public static HashMap<String,String> request(InetSocketAddress socketAddress, String... names) throws AerospikeException { Connection conn = new Connection(socketAddress, DEFAULT_TIMEOUT); try { return request(conn, names); } finally { conn.close(); } } /** * Get all the default info from the specified database server node. * * @param socketAddress <code>InetSocketAddress</code> of server node * @return info name/value pairs */ public static HashMap<String,String> request(InetSocketAddress socketAddress) throws AerospikeException { Connection conn = new Connection(socketAddress, DEFAULT_TIMEOUT); try { return request(conn); } finally { conn.close(); } } //------------------------------------------------------- // Get Info via Socket Address //------------------------------------------------------- /** * Get one info value by name from the specified database server node. * * @param conn socket connection to server node * @param name name of value to retrieve * @return info value */ public static String request(Connection conn, String name) throws AerospikeException { Info info = new Info(conn, name); return info.parseSingleResponse(name); } /** * Get many info values by name from the specified database server node. * * @param conn socket connection to server node * @param names names of values to retrieve * @return info name/value pairs */ public static HashMap<String,String> request(Connection conn, String... names) throws AerospikeException { Info info = new Info(conn, names); return info.parseMultiResponse(); } /** * Get all the default info from the specified database server node. * * @param conn socket connection to server node * @return info name/value pairs */ public static HashMap<String,String> request(Connection conn) throws AerospikeException { Info info = new Info(conn); return info.parseMultiResponse(); } /** * Get response buffer. For internal use only. */ public byte[] getBuffer() { return buffer; } /** * Get response length. For internal use only. */ public int getLength() { return length; } //------------------------------------------------------- // Private methods. //------------------------------------------------------- /** * Issue request and set results buffer. This method is used internally. * The static request methods should be used instead. * * @param conn socket connection to server node * @throws IOException if socket send or receive fails */ private void sendCommand(Connection conn) throws AerospikeException { try { // Write size field. long size = ((long)offset - 8L) | (2L << 56) | (1L << 48); Buffer.longToBytes(size, buffer, 0); // Write. OutputStream out = conn.getOutputStream(); out.write(buffer, 0, offset); // Read - reuse input buffer. InputStream in = conn.getInputStream(); readFully(in, buffer, 8); size = Buffer.bytesToLong(buffer, 0); length = (int)(size & 0xFFFFFFFFFFFFL); if (length > buffer.length) { buffer = ThreadLocalData.resizeSendBuffer(length); } readFully(in, buffer, length); offset = 0; } catch (IOException ioe) { throw new AerospikeException(ioe); } } private static void readFully(InputStream in, byte[] buffer, int length) throws IOException { int pos = 0; while (pos < length) { int count = in.read(buffer, pos, length - pos); if (count < 0) throw new EOFException(); pos += count; } } private String parseSingleResponse(String name) throws AerospikeException { // Convert the UTF8 byte array into a string. String response = Buffer.utf8ToString(buffer, 0, length); if (response.startsWith(name)) { if (response.length() > name.length() + 1) { // Remove field name, tab and trailing newline from response. // This is faster than calling parseMultiResponse() return response.substring(name.length() + 1, response.length() - 1); } else { return null; } } else { throw new AerospikeException.Parse("Info response does not include: " + name); } } private HashMap<String,String> parseMultiResponse() throws AerospikeException { HashMap<String, String> responses = new HashMap<String,String>(); int offset = 0; int begin = 0; // Create reusable StringBuilder for performance. StringBuilder sb = new StringBuilder(length); while (offset < length) { byte b = buffer[offset]; if (b == '\t') { String name = Buffer.utf8ToString(buffer, begin, offset - begin, sb); begin = ++offset; // Parse field value. while (offset < length) { if (buffer[offset] == '\n') { break; } offset++; } if (offset > begin) { String value = Buffer.utf8ToString(buffer, begin, offset - begin, sb); responses.put(name, value); } else { responses.put(name, null); } begin = ++offset; } else if (b == '\n') { if (offset > begin) { String name = Buffer.utf8ToString(buffer, begin, offset - begin, sb); responses.put(name, null); } begin = ++offset; } else { offset++; } } if (offset > begin) { String name = Buffer.utf8ToString(buffer, begin, offset - begin, sb); responses.put(name, null); } return responses; } /** * Parser for responses in name/value pair format: * <p> * <command>\t<name1>=<value1>;<name2>=<value2>;...\n */ public class NameValueParser { private int nameBegin; private int nameEnd; private int valueBegin; private int valueEnd; /** * Set pointers to next name/value pair. * * @return true if next name/value pair exists; false if at end */ public boolean next() { nameBegin = offset; while (offset < length) { byte b = buffer[offset]; if (b == '=') { if (offset <= nameBegin) { return false; } nameEnd = offset; parseValue(); return true; } if (b == '\n') { break; } offset++; } nameEnd = offset; valueBegin = offset; valueEnd = offset; return offset > nameBegin; } private void parseValue() { valueBegin = ++offset; while (offset < length) { byte b = buffer[offset]; if (b == ';') { valueEnd = offset++; return; } if (b == '\n') { break; } offset++; } valueEnd = offset; } /** * Get name. */ public String getName() { int len = nameEnd - nameBegin; return Buffer.utf8ToString(buffer, nameBegin, len); } /** * Get value. */ public String getValue() { int len = valueEnd - valueBegin; if (len <= 0) { return null; } return Buffer.utf8ToString(buffer, valueBegin, len); } } }
[ "giuseppe@giuseppe.(none)" ]
giuseppe@giuseppe.(none)
f774c48a2d9f5848bc554b7ccdb92bc160771fe5
68ac9afe85384cc30efb42a3a9971938fed9e836
/src/main/java/chc/tfm/udt/Controller/JugadoresController.java
ae0e9f2c7e68b9dd950bd6e9c84620d5be87ed1a
[]
no_license
hdzdesign/udt
19f84532f61e160acf753faf44db913eec45ceee
52a1517de107cd58653b0c31bdec19c70fb7b750
refs/heads/master
2020-04-18T00:18:38.280991
2019-01-29T22:07:12
2019-01-29T22:07:12
155,469,217
0
1
null
2018-12-27T09:53:06
2018-10-30T23:20:26
JavaScript
UTF-8
Java
false
false
4,258
java
package chc.tfm.udt.Controller; import chc.tfm.udt.DTO.Donacion; import chc.tfm.udt.DTO.Jugador; import chc.tfm.udt.servicio.JugadoresService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import java.util.ArrayList; import java.util.List; /** * Clase REST-FULL que controla el End-Point de jugadores y el End-Point de las donaciones respecto al jugador. * */ @RestController(value = "JugadoresController") public class JugadoresController implements CrudController<Jugador> { private final Logger LOG = LoggerFactory.getLogger(getClass()); private JugadoresService service; /** * Constructor que Inyecta el servicio de la clase Jugador, y inicializa. * @param service */ @Autowired public JugadoresController(@Qualifier(value = "JugadoresService") JugadoresService service){ this.service = service; } /** * End-Point que recupera todos los jugadores de la base de datos llamando al servicio y devolviendo en JSON. * @return */ @Override @GetMapping(value = "/jugadores") public ResponseEntity<List<Jugador>> getAll() { List<Jugador> jugadoresList = service.findAll(); return new ResponseEntity<>(jugadoresList, HttpStatus.OK); } /** * End-Point que Inserta un jugador de la base de datos llamando al servicio y devolviendo una respeusta OK * @param jugador * @return */ @Override @PostMapping(value = "/jugadores") public ResponseEntity<Jugador> createOne(@RequestBody Jugador jugador) { Jugador resultado = service.createOne(jugador); LOG.info("Introducir datos correctos"); return new ResponseEntity<>(resultado, HttpStatus.OK); } /** * End-Point que recupera un jugador de la base de datos llamando al servicio y devolviendo en JSON. * @param id * @return */ @Override @GetMapping(value = "/jugadores/{id}") public ResponseEntity<Jugador> getOne(@PathVariable Long id) { if (id != null){ Jugador resultado = service.findOne(id); return new ResponseEntity<>(resultado,HttpStatus.OK); } else return new ResponseEntity<>(HttpStatus.BAD_REQUEST); } /** * End-Point para recuperar las donaciones de un jugador de la base de datos, llamando al servicio. * Jugadores. * @param id * @return */ @GetMapping(value = "/jugadores/{id}/donaciones") public ResponseEntity<List<Donacion>> getJugadorDonations(@PathVariable Long id){ List<Donacion> resultados = new ArrayList<>(); if(id != null){ resultados = service.findJugadorDonations(id); return new ResponseEntity<>(resultados, HttpStatus.OK); } else return new ResponseEntity<>(resultados, HttpStatus.BAD_REQUEST); } /** * End-Point que Actualiza un jugador de la base de datos llamando al servicio y devolviendo en JSON. * @param id * @param jugador * @return */ @Override @PutMapping(value = "/jugadores/{id}") public ResponseEntity<Jugador> updateOne(@PathVariable Long id, @RequestBody Jugador jugador) { if(id != null && jugador !=null){ Jugador resultado = service.updateOne(id,jugador); return new ResponseEntity<>(resultado, HttpStatus.OK); } else return new ResponseEntity<>(HttpStatus.BAD_REQUEST); } /** * End-Point que borra un jugador de la base de datos llamando al servicio Jugadores * @param id * @return */ @Override @DeleteMapping(value = "/jugadores/{id}") public ResponseEntity<HttpStatus> deleteOne(@PathVariable Long id) { if(id != null){ Boolean resultado = service.deleteOne(id); if (resultado) return new ResponseEntity<>(HttpStatus.OK); else return new ResponseEntity<>(HttpStatus.NOT_FOUND); } else return new ResponseEntity<>(HttpStatus.BAD_REQUEST); } }
[ "chcandroistudio@gmail.com" ]
chcandroistudio@gmail.com
b1c82eb57b1fc25fc71df9331995ca40ca0fc384
56c7bee116d52800ecae52b38ef2fb8386c77119
/src/main/java/Dubstep.java
cfd11562e55674a91874e091ab7f9037ed6f3f1f
[]
no_license
IMBABOT1/Codewars
00a6a1af22f8ceb76dce9d8e23422d380e68486a
29ac52eca145e4ade40cb27e5c2ff251c6d3bdd8
refs/heads/master
2023-02-28T00:10:44.053337
2021-02-04T09:21:15
2021-02-04T09:21:15
326,025,778
0
0
null
null
null
null
UTF-8
Java
false
false
517
java
import java.util.Arrays; public class Dubstep { public static String SongDecoder (String song) { String temp = song.replaceAll("WUB", "1"); String[] arr = temp.split("1"); StringBuilder sb = new StringBuilder(); String s = ""; for (int i = 0; i < arr.length ; i++) { if (!arr[i].equals(" ")){ sb.append(arr[i] + " "); } } s = sb.toString(); s = s.trim().replaceAll(" +", " "); return s; } }
[ "zlovred12@gmail.com" ]
zlovred12@gmail.com
b018cbc598362864da59e0ae85fa87da5c9ae339
830bbb72f0009ac7f184fb70cfb190aea6fd0836
/web/src/main/java/com/ireald/wp/domain/UserAssoDept.java
e11bc660b555b4fa50399cd99e35d8a4b0eed027
[]
no_license
bigshuai/irealdweb
4858166202fe1097b3959f5f09df2c592c2c34d7
a2e30f88a82b6e06f65d86d600019437ceee28c5
refs/heads/master
2021-01-15T16:14:30.460927
2014-06-11T15:23:18
2014-06-11T15:23:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,405
java
package com.ireald.wp.domain; public class UserAssoDept { /** * This field was generated by MyBatis Generator. * This field corresponds to the database column user_dept.user_dept_id * * @mbggenerated Sat May 17 15:14:35 CST 2014 */ private String user_dept_id; /** * This field was generated by MyBatis Generator. * This field corresponds to the database column user_dept.user_id * * @mbggenerated Sat May 17 15:14:35 CST 2014 */ private String user_id; /** * This field was generated by MyBatis Generator. * This field corresponds to the database column user_dept.dept_id * * @mbggenerated Sat May 17 15:14:35 CST 2014 */ private String dept_id; /** * This method was generated by MyBatis Generator. * This method returns the value of the database column user_dept.user_dept_id * * @return the value of user_dept.user_dept_id * * @mbggenerated Sat May 17 15:14:35 CST 2014 */ public String getUser_dept_id() { return user_dept_id; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column user_dept.user_dept_id * * @param user_dept_id the value for user_dept.user_dept_id * * @mbggenerated Sat May 17 15:14:35 CST 2014 */ public void setUser_dept_id(String user_dept_id) { this.user_dept_id = user_dept_id == null ? null : user_dept_id.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column user_dept.user_id * * @return the value of user_dept.user_id * * @mbggenerated Sat May 17 15:14:35 CST 2014 */ public String getUser_id() { return user_id; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column user_dept.user_id * * @param user_id the value for user_dept.user_id * * @mbggenerated Sat May 17 15:14:35 CST 2014 */ public void setUser_id(String user_id) { this.user_id = user_id == null ? null : user_id.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column user_dept.dept_id * * @return the value of user_dept.dept_id * * @mbggenerated Sat May 17 15:14:35 CST 2014 */ public String getDept_id() { return dept_id; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column user_dept.dept_id * * @param dept_id the value for user_dept.dept_id * * @mbggenerated Sat May 17 15:14:35 CST 2014 */ public void setDept_id(String dept_id) { this.dept_id = dept_id == null ? null : dept_id.trim(); } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table user_dept * * @mbggenerated Sat May 17 15:14:35 CST 2014 */ @Override public boolean equals(Object that) { if (this == that) { return true; } if (that == null) { return false; } if (getClass() != that.getClass()) { return false; } UserAssoDept other = (UserAssoDept) that; return (this.getUser_dept_id() == null ? other.getUser_dept_id() == null : this.getUser_dept_id().equals(other.getUser_dept_id())) && (this.getUser_id() == null ? other.getUser_id() == null : this.getUser_id().equals(other.getUser_id())) && (this.getDept_id() == null ? other.getDept_id() == null : this.getDept_id().equals(other.getDept_id())); } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table user_dept * * @mbggenerated Sat May 17 15:14:35 CST 2014 */ @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((getUser_dept_id() == null) ? 0 : getUser_dept_id().hashCode()); result = prime * result + ((getUser_id() == null) ? 0 : getUser_id().hashCode()); result = prime * result + ((getDept_id() == null) ? 0 : getDept_id().hashCode()); return result; } }
[ "timo.li.icon@gmail.com" ]
timo.li.icon@gmail.com
ec06017e486cdaa35fabfe3d0e0929d65cd273e0
3cccfa9d264040e89c7e09e911ff0a96cb8ae1e2
/src/main/java/com/nasir/App.java
4804c40ace65a1eb6111475ca0c9f873891e5adb
[]
no_license
Nasruddin/strategypattern
5234bfafbaa59236877764973b5e6f6cae23fe2a
ecd018e34eb61a6f59fae28f9f4579d8179f94c8
refs/heads/master
2021-01-17T08:44:27.103798
2017-03-05T06:50:22
2017-03-05T06:50:22
83,951,110
1
0
null
null
null
null
UTF-8
Java
false
false
515
java
package com.nasir; /** * Hello world! * */ public class App { public static void main( String[] args ) { Context context = new Context(new OperationAdd()); System.out.println("10 + 5 = " + context.executeStrategy(5,10)); context = new Context(new OperationSubtract()); System.out.println("10 - 5 = " + context.executeStrategy(5,10)); context = new Context(new OperationMultiply()); System.out.println("10 * 5 = " + context.executeStrategy(5, 10)); } }
[ "nasruddin.java@gmail.com" ]
nasruddin.java@gmail.com
21f1a57840218433caf4ea29bbaf04241dd28cc0
899c5da601f1ab2c4df5f403cefb92687a5d43c3
/src/main/java/refactor/PayContext.java
8b9ad6752506ec107454f3cdb5791301984e0c51
[]
no_license
miserycat/study
520b2f4e6e709992a82afdc4889e11959cf283ba
c1cd66cd8dd2fcbe5fbb33594435de80501ece5f
refs/heads/master
2022-12-25T12:54:42.301232
2020-10-25T03:45:01
2020-10-25T03:45:01
129,375,934
2
1
null
2022-12-16T04:34:31
2018-04-13T08:54:57
Java
UTF-8
Java
false
false
561
java
package refactor; public class PayContext { private double cents; private String name; private String msg; public PayContext(double cents, String name) { this.cents = cents; this.name = name; } public double getCents() { return cents; } public void setCents(double cents) { this.cents = cents; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getMsg() { return msg; } public void setMsg(String msg) { this.msg = msg; } }
[ "shengchao wu@lombardrisk.com" ]
shengchao wu@lombardrisk.com
842b5256d7af2e6026f05e69ad59e6e6b48cdb15
ce03de32c3d7861aa79b6ef47787c4d32b78936d
/SampleCodingExercises/src/NumberInWord.java
dd041c5a61cda1368a88b188d477c9ca27e9f8dc
[]
no_license
akrun1/javafolder
4ea35deeb76284b7fcc316294a354f985eaadcf7
6e33d0562736ad325de9571641fd1088797dfb34
refs/heads/master
2021-10-10T22:26:22.435501
2019-01-18T10:25:00
2019-01-18T10:25:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,482
java
public class NumberInWord { public static void main(String[] args) { printNumberInWord(0); printNumberInWord(1); printNumberInWord(2); printNumberInWord(3); printNumberInWord(4); printNumberInWord(5); printNumberInWord(6); printNumberInWord(7); printNumberInWord(8); printNumberInWord(9); printNumberInWord(11); } public static void printNumberInWord(int number) { switch(number) { case 0: System.out.println("ZERO"); break; case 1: System.out.println("ONE"); break; case 2: System.out.println("TWO"); break; case 3: System.out.println("THREE"); break; case 4: System.out.println("FOUR"); break; case 5: System.out.println("FIVE"); break; case 6: System.out.println("SIX"); break; case 7: System.out.println("SEVEN"); break; case 8: System.out.println("EIGHT"); break; case 9: System.out.println("NINE"); break; default: System.out.println("OTHER"); break; } } }
[ "AeraTechnology@Aruns-MacBook-Pro.local" ]
AeraTechnology@Aruns-MacBook-Pro.local
6f788d236fe7e046060023ba20d6dc9b6e8e7564
0afd48de67cf5752f798e67973e1aed6f3eb4a9b
/análisis vectorial/graficadora-servidor/src/java/repositories/repositoryConsole.java
0bfcc809d9b08eee6e392418956c1b5d0cd322d3
[ "MIT" ]
permissive
luisjimenez6245/escom
15ece95812617277d81402bc4ff3450ec8d9c0b6
a1ae1f988d02f88844f5d29fba75e7cee04998db
refs/heads/master
2021-08-18T14:02:05.197073
2020-10-29T18:12:24
2020-10-29T18:12:24
201,153,959
0
1
null
null
null
null
UTF-8
Java
false
false
524
java
package repositories; import objects.Parametrics; /** * * @author luis */ public interface repositoryConsole { public String test(String exec); public String get3d(Parametrics param, String name); public String get2d(Parametrics param, String name); public String getSurface(Parametrics param, String name); public void get3dAsync(Parametrics param, String name); public void get2dAsync(Parametrics param, String name); public void getSurfaceAsync(Parametrics param, String name); }
[ "luisjimenez6245@hotmail.com" ]
luisjimenez6245@hotmail.com
f20d1cc4081b094876c7fe8b3804338986536228
7b4477b618f04a30c264891b152eb6d24e723263
/src/ru/metaer/javasudokusolver/Constants.java
f2f7f8877fd26c3da484d6cbe4df72110ac60ba3
[]
no_license
metaer/JavaSudokuSolver
9997085b28fc480b58ac6b1b5fb8c2df11218333
b2070e66608d8cd04aaccde10a3f612046a24d49
refs/heads/master
2015-08-11T19:08:57
2014-09-28T19:44:01
2014-09-28T19:44:01
20,163,883
1
0
null
null
null
null
UTF-8
Java
false
false
365
java
package ru.metaer.javasudokusolver; class Constants { public static final String ALLOWED_CHARS = "123456789."; public static final String ALLOWED_CHARS_IN_QUOTES = "\"1\";\"2\";\"3\";\"4\";\"5\";\"6\";\"7\";\"8\";\"9\";\".\""; public static final String BUG_REPORT_ADDRESS = "http://sudoku24.ru/feedback"; public static final int FIELD_SIZE = 9; }
[ "popovp2012@gmail.com" ]
popovp2012@gmail.com
6b39c18e7061aef20ef9253ca002d888934951da
0de4b523c2ae04fa7ab52334cb3c5f0dcf0a124e
/src/com/poo/objet/DriverFour.java
3b38cf1ef289522799d98551f0dbdd6304694063
[]
no_license
gache/homeShop
4f5910620f18cad6b29ac9345a29263d9890d27b
0d10a307d87a0bce12de7ba0e90a882343ecaa16
refs/heads/main
2023-01-02T12:05:14.744908
2020-10-21T12:49:09
2020-10-21T12:49:09
305,728,526
0
0
null
null
null
null
UTF-8
Java
false
false
629
java
package com.poo.objet; public class DriverFour { public static void main(String[] args) { // Four four = new Four(); // four.capacite = 30; // four.puissance =180; // four.getFour(); // System.out.println(); // Four four2 = new Four(); four2.capacite = 55; four2.puissance =260; // four2.getFour(); Aliment aliment = new Aliment(); aliment.nom = "Steck"; aliment.estCuit = false; aliment.manger(); System.out.println(); four2.getFour(aliment); System.out.println(); aliment.manger(); } }
[ "erickfrancodelgado@hotmail.com" ]
erickfrancodelgado@hotmail.com
5b3757257610d6b4609732543e2723ce370de893
9a6b2ad4f0dd3cc4b9b932c869f339666b28ad64
/maihama-common/src/main/java/org/docksidestage/dbflute/allcommon/DBFluteConfig.java
7468df069437418c3841a23f32563798b06c1939
[ "Apache-2.0" ]
permissive
yu1ro/lastaflute-example-maihama
b92554a4addb92ab406bb2436de5ad5eaf7e500d
3c4726ac09db6b1871811ee42a2921252d4d126c
refs/heads/master
2020-12-11T05:53:54.785167
2016-12-10T12:20:55
2016-12-10T12:20:55
49,993,807
0
0
null
2016-01-20T00:49:26
2016-01-20T00:49:24
null
UTF-8
Java
false
false
38,855
java
/* * Copyright 2015-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package org.docksidestage.dbflute.allcommon; import java.lang.reflect.Field; import java.sql.Connection; import java.sql.SQLException; import java.sql.Timestamp; import javax.sql.DataSource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.dbflute.bhv.core.context.mapping.MappingDateTimeZoneProvider; import org.dbflute.bhv.core.supplement.SequenceCacheKeyGenerator; import org.dbflute.cbean.cipher.GearedCipherManager; import org.dbflute.cbean.sqlclause.SqlClauseCreator; import org.dbflute.dbmeta.name.SqlNameFilter; import org.dbflute.dbway.DBDef; import org.dbflute.exception.IllegalDBFluteConfigAccessException; import org.dbflute.jdbc.DataSourceHandler; import org.dbflute.jdbc.NotClosingConnectionWrapper; import org.dbflute.jdbc.PhysicalConnectionDigger; import org.dbflute.jdbc.SQLExceptionDigger; import org.dbflute.jdbc.StatementConfig; import org.dbflute.jdbc.ValueType; import org.dbflute.outsidesql.factory.OutsideSqlExecutorFactory; import org.dbflute.s2dao.valuetype.TnValueTypes; import org.dbflute.system.QLog; import org.dbflute.system.XLog; import org.dbflute.twowaysql.DisplaySqlBuilder; import org.dbflute.twowaysql.style.BoundDateDisplayTimeZoneProvider; import org.dbflute.util.DfReflectionUtil; import org.lastaflute.jta.dbcp.ConnectionWrapper; import org.lastaflute.di.exception.SQLRuntimeException; /** * @author DBFlute(AutoGenerator) */ public class DBFluteConfig { // =================================================================================== // Definition // ========== /** The logger instance for this class. (NotNull) */ private static final Logger _log = LoggerFactory.getLogger(DBFluteConfig.class); /** Singleton instance. */ private static final DBFluteConfig _instance = new DBFluteConfig(); // =================================================================================== // Attribute // ========= // ----------------------------------------------------- // Configuration // ------------- // condition-bean or parameter-bean protected boolean _pagingCountLater = true; protected boolean _pagingCountLeastJoin = true; protected boolean _innerJoinAutoDetect = true; protected boolean _thatsBadTimingDetect = true; protected boolean _nullOrEmptyQueryAllowed = false; protected boolean _emptyStringQueryAllowed = false; protected boolean _emptyStringParameterAllowed = false; protected boolean _overridingQueryAllowed = false; protected boolean _nonSpecifiedColumnAccessAllowed = false; protected boolean _columnNullObjectAllowed = false; protected boolean _columnNullObjectGearedToSpecify = false; protected boolean _disableSelectIndex; protected boolean _queryUpdateCountPreCheck = false; // logging protected boolean _queryLogLevelInfo; protected boolean _executeStatusLogLevelInfo; protected String _logDatePattern; protected String _logTimestampPattern; protected String _logTimePattern; protected BoundDateDisplayTimeZoneProvider _logTimeZoneProvider; // environment protected StatementConfig _defaultStatementConfig; protected Integer _cursorSelectFetchSize = Integer.MIN_VALUE; protected Integer _entitySelectFetchSize = Integer.MIN_VALUE; protected boolean _usePagingByCursorSkipSynchronizedFetchSize = true; protected Integer _fixedPagingByCursorSkipSynchronizedFetchSize = Integer.MIN_VALUE; protected DataSourceHandler _dataSourceHandler; protected PhysicalConnectionDigger _physicalConnectionDigger; protected SQLExceptionDigger _sqlExceptionDigger; protected String _outsideSqlPackage = null; protected MappingDateTimeZoneProvider _mappingDateTimeZoneProvider; // extension protected SequenceCacheKeyGenerator _sequenceCacheKeyGenerator; protected SqlClauseCreator _sqlClauseCreator; protected SqlNameFilter _tableSqlNameFilter; protected OutsideSqlExecutorFactory _outsideSqlExecutorFactory; protected GearedCipherManager _gearedCipherManager; // internal protected boolean _internalDebug; // ----------------------------------------------------- // Database Dependency // ------------------- // ----------------------------------------------------- // Lock // ---- protected boolean _locked = true; // at first locked // =================================================================================== // Constructor // =========== /** * Constructor. */ private DBFluteConfig() { // adjusts default settings _physicalConnectionDigger = new ImplementedPhysicalConnectionDigger(); _sqlExceptionDigger = new ImplementedSQLExceptionDigger(); } // =================================================================================== // Singleton // ========= /** * Get singleton instance. * @return Singleton instance. (NotNull) */ public static DBFluteConfig getInstance() { return _instance; } // =================================================================================== // Paging Select // ============= public boolean isPagingCountLater() { return _pagingCountLater; } public void setPagingCountLater(boolean pagingCountLater) { assertUnlocked(); if (_log.isInfoEnabled()) { _log.info("...Setting pagingCountLater: " + pagingCountLater); } _pagingCountLater = pagingCountLater; } public boolean isPagingCountLeastJoin() { return _pagingCountLeastJoin; } public void setPagingCountLeastJoin(boolean pagingCountLeastJoin) { assertUnlocked(); if (_log.isInfoEnabled()) { _log.info("...Setting pagingCountLeastJoin: " + pagingCountLeastJoin); } _pagingCountLeastJoin = pagingCountLeastJoin; } // =================================================================================== // Inner Join Auto Detect // ====================== public boolean isInnerJoinAutoDetect() { return _innerJoinAutoDetect; } public void setInnerJoinAutoDetect(boolean innerJoinAutoDetect) { assertUnlocked(); if (_log.isInfoEnabled()) { _log.info("...Setting innerJoinAutoDetect: " + innerJoinAutoDetect); } _innerJoinAutoDetect = innerJoinAutoDetect; } // =================================================================================== // That's-Bad-Timing Detect // ======================== public boolean isThatsBadTimingDetect() { return _thatsBadTimingDetect; } public void setThatsBadTimingDetect(boolean thatsBadTimingDetect) { assertUnlocked(); if (_log.isInfoEnabled()) { _log.info("...Setting thatsBadTimingDetect: " + thatsBadTimingDetect); } _thatsBadTimingDetect = thatsBadTimingDetect; } // =================================================================================== // Invalid Query // ============= public boolean isNullOrEmptyQueryAllowed() { return _nullOrEmptyQueryAllowed; } /** * Set whether null-or-empty query is allowed or not. <br> * This configuration is only for ConditionBean. * @param nullOrEmptyQueryAllowed The determination, true or false. */ public void setNullOrEmptyQueryAllowed(boolean nullOrEmptyQueryAllowed) { assertUnlocked(); if (_log.isInfoEnabled()) { _log.info("...Setting nullOrEmptyQueryAllowed: " + nullOrEmptyQueryAllowed); } _nullOrEmptyQueryAllowed = nullOrEmptyQueryAllowed; } public boolean isEmptyStringQueryAllowed() { return _emptyStringQueryAllowed; } /** * Set whether an empty string for query is allowed or not. <br> * This configuration is only for ConditionBean. * @param emptyStringQueryAllowed The determination, true or false. */ public void setEmptyStringQueryAllowed(boolean emptyStringQueryAllowed) { assertUnlocked(); if (_log.isInfoEnabled()) { _log.info("...Setting emptyStringQueryAllowed: " + emptyStringQueryAllowed); } _emptyStringQueryAllowed = emptyStringQueryAllowed; } public boolean isEmptyStringParameterAllowed() { return _emptyStringParameterAllowed; } /** * Set whether an empty string for parameter is allowed or not. <br> * This configuration is only for ParameterBean. * @param emptyStringParameterAllowed The determination, true or false. */ public void setEmptyStringParameterAllowed(boolean emptyStringParameterAllowed) { assertUnlocked(); if (_log.isInfoEnabled()) { _log.info("...Setting emptyStringParameterAllowed: " + emptyStringParameterAllowed); } _emptyStringParameterAllowed = emptyStringParameterAllowed; } public boolean isOverridingQueryAllowed() { return _overridingQueryAllowed; } /** * Set whether overriding query is allowed or not. <br> * This configuration is only for ConditionBean. * @param overridingQueryAllowed The determination, true or false. */ public void setOverridingQueryAllowed(boolean overridingQueryAllowed) { assertUnlocked(); if (_log.isInfoEnabled()) { _log.info("...Setting overridingQueryAllowed: " + overridingQueryAllowed); } _overridingQueryAllowed = overridingQueryAllowed; } // =================================================================================== // Non-Specified Access // ==================== public boolean isNonSpecifiedColumnAccessAllowed() { return _nonSpecifiedColumnAccessAllowed; } /** * Set whether non-specified column access is allowed or not. <br> * This configuration is only for ConditionBean. * @param nonSpecifiedColumnAccessAllowed The determination, true or false. */ public void setNonSpecifiedColumnAccessAllowed(boolean nonSpecifiedColumnAccessAllowed) { assertUnlocked(); if (_log.isInfoEnabled()) { _log.info("...Setting nonSpecifiedColumnAccessAllowed: " + nonSpecifiedColumnAccessAllowed); } _nonSpecifiedColumnAccessAllowed = nonSpecifiedColumnAccessAllowed; } // =================================================================================== // Column Null Object // ================== public boolean isColumnNullObjectAllowed() { return _columnNullObjectAllowed; } /** * Set whether column null object is allowed or not. <br> * This configuration is only for ConditionBean. * @param columnNullObjectAllowed The determination, true or false. */ public void setColumnNullObjectAllowed(boolean columnNullObjectAllowed) { assertUnlocked(); if (_log.isInfoEnabled()) { _log.info("...Setting columnNullObjectAllowed: " + columnNullObjectAllowed); } _columnNullObjectAllowed = columnNullObjectAllowed; } public boolean isColumnNullObjectGearedToSpecify() { return _columnNullObjectGearedToSpecify; } /** * Set whether column null object is geared to specify or not. <br> * This configuration is only for ConditionBean. * @param columnNullObjectGearedToSpecify The determination, true or false. */ public void setColumnNullObjectGearedToSpecify(boolean columnNullObjectGearedToSpecify) { assertUnlocked(); if (_log.isInfoEnabled()) { _log.info("...Setting columnNullObjectGearedToSpecify: " + columnNullObjectGearedToSpecify); } _columnNullObjectGearedToSpecify = columnNullObjectGearedToSpecify; } // =================================================================================== // Select Index // ============ public boolean isDisableSelectIndex() { return _disableSelectIndex; } public void setDisableSelectIndex(boolean disableSelectIndex) { assertUnlocked(); if (_log.isInfoEnabled()) { _log.info("...Setting disableSelectIndex: " + disableSelectIndex); } _disableSelectIndex = disableSelectIndex; } // =================================================================================== // Query Update // ============ public boolean isQueryUpdateCountPreCheck() { return _queryUpdateCountPreCheck; } public void setQueryUpdateCountPreCheck(boolean queryUpdateCountPreCheck) { assertUnlocked(); if (_log.isInfoEnabled()) { _log.info("...Setting queryUpdateCountPreCheck: " + queryUpdateCountPreCheck); } _queryUpdateCountPreCheck = queryUpdateCountPreCheck; } // =================================================================================== // Query Log Level Info // ==================== public void setQueryLogLevelInfo(boolean queryLogLevelInfo) { assertUnlocked(); if (_log.isInfoEnabled()) { _log.info("...Setting queryLogLevelInfo: " + queryLogLevelInfo); } QLog.unlock(); QLog.setQueryLogLevelInfo(queryLogLevelInfo); QLog.lock(); } // =================================================================================== // Execute Status Log Level Info // ============================= public void setExecuteStatusLogLevelInfo(boolean executeStatusLogLevelInfo) { assertUnlocked(); if (_log.isInfoEnabled()) { _log.info("...Setting executeStatusLogLevelInfo: " + executeStatusLogLevelInfo); } XLog.unlock(); XLog.setExecuteStatusLogLevelInfo(executeStatusLogLevelInfo); XLog.lock(); } // =================================================================================== // Log Format // ========== public String getLogDatePattern() { return _logDatePattern; } public void setLogDatePattern(String logDatePattern) { assertUnlocked(); if (_log.isInfoEnabled()) { _log.info("...Setting logDatePattern: " + logDatePattern); } _logDatePattern = logDatePattern; } public String getLogTimestampPattern() { return _logTimestampPattern; } public void setLogTimestampPattern(String logTimestampPattern) { assertUnlocked(); if (_log.isInfoEnabled()) { _log.info("...Setting logTimestampPattern: " + logTimestampPattern); } _logTimestampPattern = logTimestampPattern; } public String getLogTimePattern() { return _logTimePattern; } public void setLogTimePattern(String logTimePattern) { assertUnlocked(); if (_log.isInfoEnabled()) { _log.info("...Setting logTimePattern: " + logTimePattern); } _logTimePattern = logTimePattern; } public BoundDateDisplayTimeZoneProvider getLogTimeZoneProvider() { return _logTimeZoneProvider; } public void setLogTimeZoneProvider(BoundDateDisplayTimeZoneProvider logTimeZoneProvider) { assertUnlocked(); if (_log.isInfoEnabled()) { _log.info("...Setting logTimeZoneProvider: " + logTimeZoneProvider); } _logTimeZoneProvider = logTimeZoneProvider; } // =================================================================================== // Default StatementConfig // ======================= public StatementConfig getDefaultStatementConfig() { return _defaultStatementConfig; } public void setDefaultStatementConfig(StatementConfig defaultStatementConfig) { assertUnlocked(); if (_log.isInfoEnabled()) { _log.info("...Setting defaultStatementConfig: " + defaultStatementConfig); } _defaultStatementConfig = defaultStatementConfig; } // =================================================================================== // CursorSelect FetchSize // ====================== public Integer getCursorSelectFetchSize() { return _cursorSelectFetchSize; } public void setCursorSelectFetchSize(Integer cursorSelectFetchSize) { assertUnlocked(); if (_log.isInfoEnabled()) { _log.info("...Setting cursorSelectFetchSize: " + cursorSelectFetchSize); } _cursorSelectFetchSize = cursorSelectFetchSize; } // =================================================================================== // EntitySelect FetchSize // ====================== public Integer getEntitySelectFetchSize() { return _entitySelectFetchSize; } public void setEntitySelectFetchSize(Integer entitySelectFetchSize) { assertUnlocked(); if (_log.isInfoEnabled()) { _log.info("...Setting entitySelectFetchSize: " + entitySelectFetchSize); } _entitySelectFetchSize = entitySelectFetchSize; } // =================================================================================== // PagingSelect FetchSize // ====================== public boolean isUsePagingByCursorSkipSynchronizedFetchSize() { return _usePagingByCursorSkipSynchronizedFetchSize; } public void setUsePagingByCursorSkipSynchronizedFetchSize(boolean usePagingByCursorSkipSynchronizedFetchSize) { assertUnlocked(); if (_log.isInfoEnabled()) { _log.info("...Setting usePagingByCursorSkipSynchronizedFetchSize: " + usePagingByCursorSkipSynchronizedFetchSize); } _usePagingByCursorSkipSynchronizedFetchSize = usePagingByCursorSkipSynchronizedFetchSize; } public Integer getFixedPagingByCursorSkipSynchronizedFetchSize() { return _fixedPagingByCursorSkipSynchronizedFetchSize; } public void setFixedPagingByCursorSkipSynchronizedFetchSize(Integer fixedPagingByCursorSkipSynchronizedFetchSize) { assertUnlocked(); if (_log.isInfoEnabled()) { _log.info("...Setting fixedPagingByCursorSkipSynchronizedFetchSize: " + fixedPagingByCursorSkipSynchronizedFetchSize); } _fixedPagingByCursorSkipSynchronizedFetchSize = fixedPagingByCursorSkipSynchronizedFetchSize; } // [DBFlute-0.9.0] // =================================================================================== // DataSource Handler // ================== /** * @return The handler of data source. (NullAllowed) */ public DataSourceHandler getDataSourceHandler() { return _dataSourceHandler; } /** * @param dataSourceHandler The handler of data source. (NullAllowed) */ public void setDataSourceHandler(DataSourceHandler dataSourceHandler) { assertUnlocked(); if (_log.isInfoEnabled()) { _log.info("...Setting dataSourceHandler: " + dataSourceHandler); } _dataSourceHandler = dataSourceHandler; } // [DBFlute-0.9.7.6] // =================================================================================== // PhysicalConnection Digger // ========================= /** * @return The digger of physical connection. (NotNull: has a default instance) */ public PhysicalConnectionDigger getPhysicalConnectionDigger() { return _physicalConnectionDigger; } /** * @param physicalConnectionDigger The digger of physical connection. (NotNull) */ public void setPhysicalConnectionDigger(PhysicalConnectionDigger physicalConnectionDigger) { assertUnlocked(); if (_log.isInfoEnabled()) { _log.info("...Setting physicalConnectionDigger: " + physicalConnectionDigger); } if (physicalConnectionDigger == null) { throw new IllegalArgumentException("The argument 'physicalConnectionDigger' should not be null."); } _physicalConnectionDigger = physicalConnectionDigger; } // [DBFlute-0.9.7.8] // =================================================================================== // SQLException Digger // =================== /** * @return The digger of SQLException. (NotNull: has a default instance) */ public SQLExceptionDigger getSQLExceptionDigger() { return _sqlExceptionDigger; } /** * @param sqlExceptionDigger The digger of SQLException. (NotNull) */ public void setSQLExceptionDigger(SQLExceptionDigger sqlExceptionDigger) { assertUnlocked(); if (_log.isInfoEnabled()) { _log.info("...Setting sqlExceptionDigger: " + sqlExceptionDigger); } if (sqlExceptionDigger == null) { throw new IllegalArgumentException("The argument 'sqlExceptionDigger' should not be null."); } _sqlExceptionDigger = sqlExceptionDigger; } // =================================================================================== // OutsideSql Package // ================== /** * @return The package of outside SQL. (NullAllowed) */ public String getOutsideSqlPackage() { return _outsideSqlPackage; } /** * @param outsideSqlPackage The package of outside SQL. (NullAllowed) */ public void setOutsideSqlPackage(String outsideSqlPackage) { assertUnlocked(); if (_log.isInfoEnabled()) { _log.info("...Setting outsideSqlPackage: " + outsideSqlPackage); } _outsideSqlPackage = outsideSqlPackage; } // [DBFlute-1.1.0] // =================================================================================== // Mapping Date TimeZone // ===================== public MappingDateTimeZoneProvider getMappingDateTimeZoneProvider() { return _mappingDateTimeZoneProvider; } public void setMappingDateTimeZoneProvider(MappingDateTimeZoneProvider mappingDateTimeZoneProvider) { assertUnlocked(); if (_log.isInfoEnabled()) { _log.info("...Setting mappingDateTimeZoneProvider: " + mappingDateTimeZoneProvider); } _mappingDateTimeZoneProvider = mappingDateTimeZoneProvider; } // [DBFlute-0.9.6.4] // =================================================================================== // Sequence Cache // ============== /** * @return The key generator of sequence cache. (NullAllowed) */ public SequenceCacheKeyGenerator getSequenceCacheKeyGenerator() { return _sequenceCacheKeyGenerator; } /** * @param sequenceCacheKeyGenerator The key generator of sequence cache. (NullAllowed) */ public void setSequenceCacheKeyGenerator(SequenceCacheKeyGenerator sequenceCacheKeyGenerator) { assertUnlocked(); if (_log.isInfoEnabled()) { _log.info("...Setting sequenceCacheKeyGenerator: " + sequenceCacheKeyGenerator); } _sequenceCacheKeyGenerator = sequenceCacheKeyGenerator; } // [DBFlute-0.9.6.9] // =================================================================================== // SqlClause Creator // ================= /** * @return The creator of SQL clause. (NullAllowed) */ public SqlClauseCreator getSqlClauseCreator() { return _sqlClauseCreator; } /** * @param sqlClauseCreator The creator of SQL clause. (NullAllowed) */ public void setSqlClauseCreator(SqlClauseCreator sqlClauseCreator) { assertUnlocked(); if (_log.isInfoEnabled()) { _log.info("...Setting sqlClauseCreator: " + sqlClauseCreator); } _sqlClauseCreator = sqlClauseCreator; } // [DBFlute-0.9.7.6] // =================================================================================== // TableSqlName Filter // =================== /** * @return The SQL name filter for table. (NullAllowed) */ public SqlNameFilter getTableSqlNameFilter() { return _tableSqlNameFilter; } /** * Set the SQL name filter for table. <br> * This setting should be called before container's initialization. * (its exact meaning is: before class loading of DBMeta for table) * @param tableSqlNameFilter The SQL name filter for table. (NullAllowed) */ public void setTableSqlNameFilter(SqlNameFilter tableSqlNameFilter) { assertUnlocked(); if (_log.isInfoEnabled()) { _log.info("...Setting tableSqlNameFilter: " + tableSqlNameFilter); } _tableSqlNameFilter = tableSqlNameFilter; } // [DBFlute-0.9.7.0] // =================================================================================== // OutsideSql Executor // =================== public OutsideSqlExecutorFactory getOutsideSqlExecutorFactory() { return _outsideSqlExecutorFactory; } public void setOutsideSqlExecutorFactory(OutsideSqlExecutorFactory outsideSqlExecutorFactory) { assertUnlocked(); if (_log.isInfoEnabled()) { _log.info("...Setting outsideSqlExecutorFactory: " + outsideSqlExecutorFactory); } _outsideSqlExecutorFactory = outsideSqlExecutorFactory; } // [DBFlute-0.9.7.0] // =================================================================================== // Geared Cipher Manager // ===================== public GearedCipherManager getGearedCipherManager() { return _gearedCipherManager; } public void setGearedCipherManager(GearedCipherManager gearedCipherManager) { assertUnlocked(); if (_log.isInfoEnabled()) { _log.info("...Setting gearedCipherManager: " + gearedCipherManager); } _gearedCipherManager = gearedCipherManager; } // =================================================================================== // Database Dependency // =================== // =================================================================================== // Internal Debug // ============== public boolean isInternalDebug() { return _internalDebug; } public void setInternalDebug(boolean internalDebug) { assertUnlocked(); if (_log.isInfoEnabled()) { _log.info("...Setting internalDebug: " + internalDebug); } _internalDebug = internalDebug; } // =================================================================================== // Value Type // ========== /** * Register the basic value type. <br> * This setting is shared per DBMS in the same class loader. * @param keyType The type as key. (NotNull) * @param valueType The basic value type. (NotNull) */ public void registerBasicValueType(Class<?> keyType, ValueType valueType) { assertUnlocked(); if (_log.isInfoEnabled()) { _log.info("...Registering basic valueType: " + keyType + " = " + valueType); } TnValueTypes.registerBasicValueType(currentDBDef(), keyType, valueType); } public void removeBasicValueType(Class<?> keyType) { assertUnlocked(); if (_log.isInfoEnabled()) { _log.info("...Removing basic valueType: " + keyType); } TnValueTypes.removeBasicValueType(currentDBDef(), keyType); } /** * Register the plug-in value type. <br> * This setting is shared per DBMS in the same class loader. * @param keyName The name as key. (NotNull) * @param valueType The plug-in value type. (NotNull) */ public void registerPluginValueType(String keyName, ValueType valueType) { assertUnlocked(); if (_log.isInfoEnabled()) { _log.info("...Registering plug-in valueType: " + keyName + " = " + valueType); } TnValueTypes.registerPluginValueType(currentDBDef(), keyName, valueType); } public void removePluginValueType(String keyName) { assertUnlocked(); if (_log.isInfoEnabled()) { _log.info("...Removing plug-in valueType: keyName=" + keyName); } TnValueTypes.removePluginValueType(currentDBDef(), keyName); } // =================================================================================== // Configuration Lock // ================== public void lock() { if (_locked) { return; } if (_log.isInfoEnabled()) { _log.info("...Locking the configuration of DBFlute"); } _locked = true; } public void unlock() { if (!_locked) { return; } if (_log.isInfoEnabled()) { _log.info("...Unlocking the configuration of DBFlute"); } _locked = false; } public boolean isLocked() { return _locked; } protected void assertUnlocked() { if (!isLocked()) { return; } throw new IllegalDBFluteConfigAccessException("The configuration of DBFlute is locked."); } // =================================================================================== // Assist Helper // ============= protected DBDef currentDBDef() { return DBCurrent.getInstance().currentDBDef(); } protected boolean isCurrentDBDef(DBDef currentDBDef) { return DBCurrent.getInstance().isCurrentDBDef(currentDBDef); } // =================================================================================== // Implemented Class // ================= // ----------------------------------------------------- // Physical Connection // ------------------- public static class ImplementedPhysicalConnectionDigger implements PhysicalConnectionDigger { public Connection digUp(Connection conn) throws SQLException { Connection digged = unwrap(conn); digged = resolveLaDBCP(digged); digged = resolveCommonsDBCP(digged); return digged; } protected Connection unwrap(Connection conn) { if (conn instanceof NotClosingConnectionWrapper) { return ((NotClosingConnectionWrapper)conn).getActualConnection(); } return conn; } protected Connection resolveLaDBCP(Connection conn) { if (conn instanceof ConnectionWrapper) { return ((ConnectionWrapper)conn).getPhysicalConnection(); } return conn; } protected Connection resolveCommonsDBCP(Connection conn) { Connection resolved = conn; if ("org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper".equals(resolved.getClass().getName())) { resolved = getFieldConnection(resolved, "delegate"); } if ("org.apache.commons.dbcp.PoolableConnection".equals(resolved.getClass().getName())) { resolved = getFieldConnection(resolved, "_conn"); } return resolved; } protected Connection getFieldConnection(Connection conn, String fieldName) { Field field = DfReflectionUtil.getWholeField(conn.getClass(), fieldName); return (Connection)DfReflectionUtil.getValueForcedly(field, conn); } } // ----------------------------------------------------- // SQLException // ------------ public static class ImplementedSQLExceptionDigger implements SQLExceptionDigger { public SQLException digUp(Throwable cause) { SQLException s2found = resolveLaDBCP(cause); if (s2found != null) { return s2found; } SQLException defaultFound = resolveDefault(cause); if (defaultFound != null) { return defaultFound; } return null; } protected SQLException resolveLaDBCP(Throwable cause) { if (cause instanceof SQLRuntimeException) { Throwable nestedCause = ((SQLRuntimeException)cause).getCause(); if (nestedCause instanceof SQLException) { return (SQLException)nestedCause; } } return null; } protected SQLException resolveDefault(Throwable cause) { Throwable nestedCause = cause.getCause(); if (nestedCause instanceof SQLException) { return (SQLException)nestedCause; } return null; } } // =================================================================================== // Very Internal // ============= // very internal (for suppressing warn about 'Not Use Import') protected String xTms() { return Timestamp.class.getName(); } protected String xDSc() { return DataSource.class.getName(); } protected String xSQLEx() { return SQLException.class.getName(); } protected String xDSqB() { return DisplaySqlBuilder.class.getName(); } }
[ "dbflute@gmail.com" ]
dbflute@gmail.com
3a1cc603e3b4b1807b4e664504d8782f43ebed43
1e646a520fdb012bd9340271cc5ef1d565bc5ba7
/app/src/main/java/com/anooc/android/md/ui/listener/ImageJavascriptInterface.java
6e81156bbd91a4ac04dc67e58a4e17a759fd9063
[ "Apache-2.0" ]
permissive
zouhuigang/anooc-android
22822f9a0587a6dc726deba7147819fbbf1d1741
9904cf61ee11fafac93ac3b6c1879e0de8242970
refs/heads/master
2021-01-13T14:50:08.556119
2016-12-22T09:29:06
2016-12-22T09:29:06
76,520,567
0
0
null
null
null
null
UTF-8
Java
false
false
1,045
java
package com.anooc.android.md.ui.listener; import android.content.Context; import android.support.annotation.NonNull; import android.webkit.JavascriptInterface; import com.anooc.android.md.ui.activity.ImagePreviewActivity; public final class ImageJavascriptInterface { private volatile static ImageJavascriptInterface singleton; public static ImageJavascriptInterface with(@NonNull Context context) { if (singleton == null) { synchronized (ImageJavascriptInterface.class) { if (singleton == null) { singleton = new ImageJavascriptInterface(context); } } } return singleton; } public static final String NAME = "imageBridge"; private final Context context; private ImageJavascriptInterface(@NonNull Context context) { this.context = context.getApplicationContext(); } @JavascriptInterface public void openImage(String imageUrl) { ImagePreviewActivity.start(context, imageUrl); } }
[ "952750120@qq.com" ]
952750120@qq.com
17adec7ab01c5edcf841e74fb3c5792b544ce3b7
36bcdf3f723b43e057c08543758c1d1179ba5442
/app/src/androidTest/java/com/example/felix/palindromechecker/ExampleInstrumentedTest.java
e419216e69303f4a52763336ad98609c770bc2b2
[]
no_license
felixgaggl/PalindromeChecker
f95359e938ea66faa1129ad96b470d50caacdb33
22f06294894ec97223a25e13b26b0581940b82ff
refs/heads/master
2021-04-03T01:04:37.336375
2018-03-07T15:49:10
2018-03-07T15:49:10
124,733,002
0
0
null
null
null
null
UTF-8
Java
false
false
771
java
package com.example.felix.palindromechecker; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.example.felix.palindromechecker", appContext.getPackageName()); } }
[ "felix.g10@hotmail.com" ]
felix.g10@hotmail.com
616bd9746f9afe9a32fc2b59ba692d351fd40c17
16d7592b82a5b090b23211258a3c508b663cdd83
/eWeb/小组分工/共同成果/Coding编码/tours/src/DAO/EmergencyDAO.java
3b6ea7597d3a52cb974d30c40895202e05834160
[ "Apache-2.0" ]
permissive
Heathledger1019/eWeb
b7f16d1aaac82e554ecb86922eae91f34257a843
5ac745b3a61126fa96e2e7a9e67c52dc7478a90e
refs/heads/master
2020-03-22T03:15:12.958195
2018-09-07T03:01:51
2018-09-07T03:01:51
139,421,403
0
1
Apache-2.0
2018-08-21T08:32:19
2018-07-02T09:29:52
HTML
UTF-8
Java
false
false
4,904
java
package DAO; import java.sql.Timestamp; import java.util.List; import org.hibernate.LockOptions; import org.hibernate.Query; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.criterion.Example; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.ApplicationContext; import org.springframework.transaction.annotation.Transactional; import Entity.Emergency; /** * A data access object (DAO) providing persistence and search support for * Emergency entities. Transaction control of the save(), update() and delete() * operations can directly support Spring container-managed transactions or they * can be augmented to handle user-managed Spring transactions. Each of these * methods provides additional information for how to configure it for the * desired type of transaction control. * * @see Session.Emergency * @author MyEclipse Persistence Tools */ @Transactional public class EmergencyDAO { private static final Logger log = LoggerFactory.getLogger(EmergencyDAO.class); // property constants public static final String CONTENT = "content"; public static final String PHOTO = "photo"; public static final String TITLE = "title"; private SessionFactory sessionFactory; public void setSessionFactory(SessionFactory sessionFactory) { this.sessionFactory = sessionFactory; } private Session getCurrentSession() { return sessionFactory.getCurrentSession(); } protected void initDao() { // do nothing } public void save(Emergency transientInstance) { log.debug("saving Emergency instance"); try { getCurrentSession().save(transientInstance); log.debug("save successful"); } catch (RuntimeException re) { log.error("save failed", re); throw re; } } public void delete(Emergency persistentInstance) { log.debug("deleting Emergency instance"); try { getCurrentSession().delete(persistentInstance); log.debug("delete successful"); } catch (RuntimeException re) { log.error("delete failed", re); throw re; } } public Emergency findById(java.lang.String id) { log.debug("getting Emergency instance with id: " + id); try { Emergency instance = (Emergency) getCurrentSession().get("Entity.Emergency", id); return instance; } catch (RuntimeException re) { log.error("get failed", re); throw re; } } public List findByExample(Emergency instance) { log.debug("finding Emergency instance by example"); try { List results = getCurrentSession().createCriteria("Entity.Emergency").add(Example.create(instance)).list(); log.debug("find by example successful, result size: " + results.size()); return results; } catch (RuntimeException re) { log.error("find by example failed", re); throw re; } } public List findByProperty(String propertyName, Object value) { log.debug("finding Emergency instance with property: " + propertyName + ", value: " + value); try { String queryString = "from Emergency as model where model." + propertyName + "= ?"; Query queryObject = getCurrentSession().createQuery(queryString); queryObject.setParameter(0, value); return queryObject.list(); } catch (RuntimeException re) { log.error("find by property name failed", re); throw re; } } public List findByContent(Object content) { return findByProperty(CONTENT, content); } public List findByPhoto(Object photo) { return findByProperty(PHOTO, photo); } public List findByTitle(Object title) { return findByProperty(TITLE, title); } public List findAll() { log.debug("finding all Emergency instances"); try { String queryString = "from Emergency"; Query queryObject = getCurrentSession().createQuery(queryString); return queryObject.list(); } catch (RuntimeException re) { log.error("find all failed", re); throw re; } } public Emergency merge(Emergency detachedInstance) { log.debug("merging Emergency instance"); try { Emergency result = (Emergency) getCurrentSession().merge(detachedInstance); log.debug("merge successful"); return result; } catch (RuntimeException re) { log.error("merge failed", re); throw re; } } public void attachDirty(Emergency instance) { log.debug("attaching dirty Emergency instance"); try { getCurrentSession().saveOrUpdate(instance); log.debug("attach successful"); } catch (RuntimeException re) { log.error("attach failed", re); throw re; } } public void attachClean(Emergency instance) { log.debug("attaching clean Emergency instance"); try { getCurrentSession().buildLockRequest(LockOptions.NONE).lock(instance); log.debug("attach successful"); } catch (RuntimeException re) { log.error("attach failed", re); throw re; } } public static EmergencyDAO getFromApplicationContext(ApplicationContext ctx) { return (EmergencyDAO) ctx.getBean("EmergencyDAO"); } }
[ "932872496@qq.com" ]
932872496@qq.com
bc561b51d64ece34f1e6429f148f2fc1145cce96
1b8cdc9cab6ffeb65364921bc70447ec1fdff5b3
/kafka-producer/src/test/java/com/devoteam/kafka/kafkaproducer/KafkaProducerApplicationTests.java
61500ca4f374faae3ca4b4ad843af319e898850d
[]
no_license
MileMiljanovic/DataCaching
971f908018d37c61dd274e3ef5a2a304b2378b11
43fbc4999619f7f0da4c727229a776e1bf5d3bf0
refs/heads/master
2020-07-20T05:57:51.743392
2019-12-27T13:44:24
2019-12-27T13:44:24
206,585,487
0
0
null
2019-12-27T13:45:00
2019-09-05T14:35:49
Java
UTF-8
Java
false
false
356
java
package com.devoteam.kafka.kafkaproducer; 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 KafkaProducerApplicationTests { @Test public void contextLoads() { } }
[ "mile.miljanovic@devoteam.com" ]
mile.miljanovic@devoteam.com
a6477ba672df5cbac987a4408573878f23344411
5daa1dd08e68645a1615c99a47a0b8b50d6c8eec
/src/main/java/DriveQuickstart.java
8b85fb01540b1480559d75feb62711fcf4330768
[]
no_license
andersaucy/GoogleDriveUploader
971784e6d44ffc5c07cc1a5f11830170a22ce63b
fe8002c386e03081ffec09adb02257fac141582e
refs/heads/master
2020-04-04T13:05:37.333218
2018-12-21T06:54:19
2018-12-21T06:54:19
155,948,615
0
0
null
2018-12-21T06:54:20
2018-11-03T04:05:44
Java
UTF-8
Java
false
false
11,340
java
import com.google.api.client.auth.oauth2.Credential; import com.google.api.client.extensions.java6.auth.oauth2.AuthorizationCodeInstalledApp; import com.google.api.client.extensions.jetty.auth.oauth2.LocalServerReceiver; import com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeFlow; import com.google.api.client.googleapis.auth.oauth2.GoogleClientSecrets; import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport; import com.google.api.client.http.javanet.NetHttpTransport; import com.google.api.client.json.JsonFactory; import com.google.api.client.json.jackson2.JacksonFactory; import com.google.api.client.util.store.FileDataStoreFactory; import com.google.api.services.drive.Drive; import com.google.api.services.drive.DriveScopes; import com.google.api.services.drive.model.File; import com.google.api.services.drive.model.Permission; import com.google.api.client.http.FileContent; import java.awt.Toolkit; import java.awt.datatransfer.Clipboard; import java.awt.datatransfer.StringSelection; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.security.GeneralSecurityException; import java.util.*; public class DriveQuickstart { private static final String APPLICATION_NAME = "Google Drive API Java Quickstart"; private static final JsonFactory JSON_FACTORY = JacksonFactory.getDefaultInstance(); private static final String TOKENS_DIRECTORY_PATH = "tokens"; private static final String REHEARSAL_PATH = CONSTANTS.DIRECTORY; private static final Scanner in = new Scanner(System.in); //The current parent folder is for Winter Training 2018 private static final String SEASON_FOLDER_ID = CONSTANTS.GoogleDriveFolder_Unclepie; private static String rehearsalDate; /** * Global instance of the scopes required by this quick-start. * If modifying these scopes, delete your previously saved tokens/ folder. */ private static final List<String> SCOPES = Collections.singletonList(DriveScopes.DRIVE); private static final String CREDENTIALS_FILE_PATH = "/credentials.json"; /** * Creates an authorized Credential object. * @param HTTP_TRANSPORT The network HTTP Transport. * @return An authorized Credential object. * @throws IOException If the credentials.json file cannot be found. */ private static Credential getCredentials(final NetHttpTransport HTTP_TRANSPORT) throws IOException { // Load client secrets. InputStream in = DriveQuickstart.class.getResourceAsStream(CREDENTIALS_FILE_PATH); GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY, new InputStreamReader(in)); // Build flow and trigger user authorization request. GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder( HTTP_TRANSPORT, JSON_FACTORY, clientSecrets, SCOPES) .setDataStoreFactory(new FileDataStoreFactory(new java.io.File(TOKENS_DIRECTORY_PATH))) .setAccessType("offline") .build(); LocalServerReceiver receiver = new LocalServerReceiver.Builder().setPort(8888).build(); return new AuthorizationCodeInstalledApp(flow, receiver).authorize("user"); } public static void main(String... args) throws IOException, GeneralSecurityException { // Build a new authorized API client service. final NetHttpTransport HTTP_TRANSPORT = GoogleNetHttpTransport.newTrustedTransport(); Drive service = new Drive.Builder(HTTP_TRANSPORT, JSON_FACTORY, getCredentials(HTTP_TRANSPORT)) .setApplicationName(APPLICATION_NAME) .build(); List<java.io.File> uploadReady = setUp(); System.out.println("Confirm (This will begin the upload)? (Yes/No)"); String confirm = in.nextLine().toUpperCase(); if (confirm.charAt(0) == 'N') { System.out.println("You responded \'No.\' Thank you, program terminated."); in.close(); System.exit(0); } //Upload folder with date insertPermission(service, SEASON_FOLDER_ID); File folderMetadata = new File(); folderMetadata.setName(rehearsalDate); folderMetadata.setParents(Collections.singletonList(SEASON_FOLDER_ID)); folderMetadata.setMimeType("application/vnd.google-apps.folder"); File folder = service.files().create(folderMetadata) .setFields("id, webViewLink") .execute(); insertPermission(service, folder.getId()); System.out.println(String.format("Folder ID for %s: %s", rehearsalDate, folder.getId())); //Upload files within the newly created folder for (java.io.File vid : uploadReady) { File fileMetadata = new File(); fileMetadata.setName(vid.getName()); fileMetadata.setParents(Collections.singletonList(folder.getId())); FileContent mediaContent = new FileContent("video/mp4", vid.getAbsoluteFile()); File file = service.files().create(fileMetadata, mediaContent) .setFields("id") .execute(); insertPermission(service, file.getId()); System.out.println(String.format("File ID for %s: %s", fileMetadata.getName(), file.getId())); } Toolkit toolkit = Toolkit.getDefaultToolkit(); Clipboard clipboard = toolkit.getSystemClipboard(); StringSelection strSel = new StringSelection(folder.getWebViewLink()); clipboard.setContents(strSel, null); System.out.println(String.format("The following sharable link is copied to the clipboard:\n%s", folder.getWebViewLink())); in.close(); return; } /** * Prompts user to provide rehearsal dates and song order and prepares a list of upload-ready files. * * @return List of File objects that are ready to be uploaded onto Google Drive */ private static List<java.io.File> setUp() { OsCheck.OSType osType= OsCheck.getOperatingSystemType(); java.io.File rehearsalFolder = new java.io.File(REHEARSAL_PATH); System.out.println("What is the date of the rehearsal? Format: [Day-MonthDate]"); rehearsalDate = in.nextLine(); java.io.File[] rehearsalArray = rehearsalFolder.listFiles(new java.io.FilenameFilter() { public boolean accept(java.io.File dir, String name) { return name.toLowerCase().endsWith(".mp4"); } }); assert rehearsalArray != null; //This sort is effective because the phone saves files by time stamp, or filename Arrays.sort(rehearsalArray); String[] pieces = null; Set<String> titleSet = new HashSet<String>(); while (true) { System.out.println(String.format( "There are %d files. What is the order of pieces [separated by commas]", rehearsalArray.length)); pieces = in.nextLine().split("\\s*,\\s*"); //Check if appropriate number of files if (pieces.length != rehearsalArray.length) { System.out.println(String.format( "Error. Not %d files listed. Try Again.", rehearsalArray.length)); continue; } //Check for duplicates to avoid file override for (String p : pieces) { if (titleSet.add(p.toUpperCase()) == false) { System.out.println(String.format( "Error. There are duplicate filenames: %s\nTry Again." ,p.toUpperCase())); titleSet.clear(); continue; } } if (titleSet.size() == rehearsalArray.length) { break; } } //Determine format of absolute paths based on Operating System String DASH = ""; switch (osType) { case Windows: DASH = "\\"; break; case MacOS: DASH = "/"; break; case Linux: break; case Other: break; } HashMap<java.io.File, java.io.File> oldToNew = new HashMap<java.io.File,java.io.File>(); for (int i = 0; i < rehearsalArray.length; i++) { String ext = rehearsalArray[i].getName().substring(rehearsalArray[i].getName().indexOf(".") + 1); if(rehearsalArray[i].isFile() && ext.equalsIgnoreCase("mp4")){ //Retrieve Old Filename java.io.File oldFile = new java.io.File(rehearsalFolder + DASH + rehearsalArray[i].getName()); String oldFileName = rehearsalArray[i].getName(); //Retrieve New Filename String newFileName = String.format("%s-%s", rehearsalDate, pieces[i]); java.io.File newFile = new java.io.File(rehearsalFolder + DASH + newFileName + ".mp4"); System.out.println(String.format("Renaming %s to %s", oldFileName, newFileName)); //Load for Renaming process oldToNew.put(oldFile, newFile); } } //Confirmation Prompt System.out.println("Confirm (This will rename the files)? (Yes/No)"); String confirm = in.nextLine().toUpperCase(); List<java.io.File> uploadReady = null; switch (confirm.charAt(0)){ case 'Y': uploadReady = Rename(oldToNew); break; case 'N': System.out.println("You responded \'No.\' Program terminated."); in.close(); System.exit(0); break; } return uploadReady; } public static List<java.io.File> Rename(HashMap<java.io.File, java.io.File> oldToNew){ List<java.io.File> renamedFileList = new ArrayList<java.io.File>(); for (Map.Entry<java.io.File, java.io.File> entry : oldToNew.entrySet()){ entry.getKey().renameTo(entry.getValue()); renamedFileList.add(entry.getValue()); } System.out.println("RENAMING SUCCESSFUL"); return renamedFileList; } private static Permission insertPermission(Drive service, String fileId) { Permission newPermission = new Permission(); newPermission.setType("anyone"); newPermission.setRole("reader"); try { return service.permissions().create(fileId, newPermission) .execute(); } catch (IOException e) { System.out.println("An error occurred: " + e); } return null; } public static final class OsCheck { /** * types of Operating Systems */ public enum OSType { Windows, MacOS, Linux, Other }; // cached result of OS detection static OSType detectedOS; /** * detect the operating system from the os.name System property and cache * the result * * @returns - the operating system detected */ static OSType getOperatingSystemType() { if (detectedOS == null) { String OS = System.getProperty("os.name", "generic").toLowerCase(Locale.ENGLISH); if ((OS.indexOf("mac") >= 0) || (OS.indexOf("darwin") >= 0)) { detectedOS = OSType.MacOS; } else if (OS.indexOf("win") >= 0) { detectedOS = OSType.Windows; } else if (OS.indexOf("nux") >= 0) { detectedOS = OSType.Linux; } else { detectedOS = OSType.Other; } } return detectedOS; } } }
[ "atw293@nyu.edu" ]
atw293@nyu.edu
69454c4d1c97bc05a9aef556acc4afc7d87b17b9
1f5a067ecd712f5df77dc98dc2c7fc75d1ae2e42
/EmailApplication-server/src/Commands/ViewAllCommand.java
07d9dbded7df2284ebc9a1b7c25592c4f73dd409
[]
no_license
Mayesamomo/EmailApplication
27f28688cba10836bc93d24e7be3356fadd18622
85d97336227a30e8a67b64d181696cad7f481244
refs/heads/master
2023-03-25T17:48:59.465404
2021-03-28T23:02:11
2021-03-28T23:02:11
352,433,315
0
0
null
null
null
null
UTF-8
Java
false
false
1,135
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 Commands; import Business.Email; import Business.EmailManager; import Business.UserManager; import Services.Service; import java.util.List; /** * * @author micha */ public class ViewAllCommand implements Command{ @Override public String generateResponse(String[] components, UserManager usermanager) { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } @Override public String generateResponse(String[] components, EmailManager emailmanager) { String response = null; if(components.length ==2){ String sender = components[1]; List<Email> mails = emailmanager.getReceivedEmails(sender); response = Service.flattenEmailList(mails); if(response ==null){ response =Service.VIEW_COMMAND; } } return response; } }
[ "mayesamomo1997@gmail.com" ]
mayesamomo1997@gmail.com
63084571fd83d92e26c590e0a1224f466c1795b1
3cbf9e14b96cfec7a37e2afeefb01b02409c8e61
/seckill-core/src/main/java/com/mockuai/seckillcenter/core/util/DateUtils.java
8a4d48efb74dc75b4b89948ec87a5f4c9832549c
[]
no_license
kevinkerry/seckillcenter
a0fc9e27dda296f277b55454ccb37fa28d2e5326
ec93f435dc1f22cf9fe40df5c8117ed437f61bd4
refs/heads/master
2021-01-25T12:52:56.651334
2017-05-18T09:44:17
2017-05-18T09:44:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
14,677
java
package com.mockuai.seckillcenter.core.util; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; public abstract class DateUtils { public static final ThreadLocal<Calendar> defaultCalender = new ThreadLocal() { protected Calendar initialValue() { return Calendar.getInstance(); } }; public static final String DATETIME_FORMAT = "yyyy-MM-dd HH:mm:ss"; public static final String DATETIME_FORMAT2 = "yyyyMMddHHmmss"; public static final String DATE_ZEROTIME_FORMAT = "yyyy-MM-dd 00:00:00"; public static final String DATE_ZEROTIME_FORMAT2 = "yyyyMMdd000000"; public static final String DATE_FULLTIME_FORMAT = "yyyy-MM-dd 23:59:59"; public static final String DATE_FULLTIME_FORMAT2 = "yyyyMMdd235959"; public static final String DATETIME12_FORMAT = "yyyy-MM-dd hh:mm:ss"; public static final String DATETIME12_FORMAT2 = "yyyyMMddhhmmss"; public static final String DATE_FORMAT_CS = "yyyy-MM-dd"; public static final String DATE_FORMAT_SHORT = "yyyyMMdd"; public static final String DATE_FORMAT_UNDER_LINE = "yyyy_MM_dd_hhmmss"; public static final String YEAR_MONTH_FORMAT = "yyyy-MM"; public static final String YEAR_MONTH_FORMAT2 = "yyyyMM"; public static final String YEAR_MONTH_FIRSTDAY = "yyyy-MM-01"; public static final String YEAR_FORMAT = "yyyy"; public static final String MONTH_FORMAT = "MM"; public static final String DAY_FORMAT = "dd"; public static final String TIME_FORMAT = "HH:mm:ss"; public static final String TIME_FORMAT2 = "HHmmss"; public static final String DATETIME_SLASH_FORMAT = "yyyy/MM/dd HH:mm:ss"; public static final String DATE_SLASH_FORMAT = "yyyy/MM/dd"; public static final String DATE_DOT_FORMAT_1 = "yyyy.MM.dd"; public static final String DATE_DOT_FORMAT_2 = "dd.MM.yyyy"; private static final Log logger = LogFactory.getLog(DateUtils.class); private static final long MS_IN_DAY = 86400000L; private static final long MS_IN_HOUR = 3600000L; private static final long MS_IN_MINUTE = 60000L; private static final long MS_IN_SECOND = 1000L; private static final int DAYS_OF_YEAR = 365; public static Date getCurrentDate() { return new Date(); } public static long currentTimeMillis() { return System.currentTimeMillis(); } public static int monthsBetween(int paramInt1, int paramInt2) { return paramInt2 / 100 * 12 + paramInt2 % 100 - (paramInt1 / 100 * 12 + paramInt1 % 100); } public static int monthsBetween(Date paramDate1, Date paramDate2) { return monthsBetween(getYM(paramDate1).intValue(), getYM(paramDate2).intValue()); } private static Integer getYM(Date paramDate) { if (paramDate == null) { return null; } Calendar localCalendar = Calendar.getInstance(); localCalendar.setTime(paramDate); int i = localCalendar.get(1); int j = localCalendar.get(2) + 1; return Integer.valueOf(i * 100 + j); } public static long daysBetween(Date date1, Date date2) { return (date2.getTime() - date1.getTime()) / 86400000L; } public static long daysBetweenForAis(Date date1, Date date2) { date1 = startOfDay(date1); date2 = startOfDay(date2); return daysBetween(date1, date2) + 1L; } public static Date addDays(Date aDate, long days) { long timeInMs = aDate.getTime() + days * 86400000L; return new Date(timeInMs); } public static Date addMonths(Date aDate, int delta) { Date newDate = org.apache.commons.lang.time.DateUtils.addMonths(aDate, delta); return new Date(newDate.getTime()); } public static Date addYears(Date aDate, int delta) { Date newDate = org.apache.commons.lang.time.DateUtils.addYears(aDate, delta); return new Date(newDate.getTime()); } public static Date startOfDay(Date aDate) { return org.apache.commons.lang.time.DateUtils.truncate(aDate, 5); } public static Date endOfDay(Date aDate) { Date newDate = org.apache.commons.lang.time.DateUtils.truncate(aDate, 5); long timeImMs = newDate.getTime() + 86400000L - 1L; return new Date(timeImMs); } public static Date endOfMonth(Date ts) { Calendar c = Calendar.getInstance(); c.setTimeInMillis(ts.getTime()); c.add(2, 1); c.set(5, 1); c.add(5, -1); c.set(11, 23); c.set(12, 59); c.set(13, 59); c.set(14, 0); return new Date(c.getTimeInMillis()); } public static Date startOfMonth(Date ts) { Calendar c = Calendar.getInstance(); c.setTimeInMillis(ts.getTime()); c.set(5, 1); c.set(11, 0); c.set(12, 0); c.set(13, 0); c.set(14, 0); return new Date(c.getTimeInMillis()); } public static Date startOfYear(Date ts) { Calendar c = Calendar.getInstance(); c.setTimeInMillis(ts.getTime()); c.set(2, 0); c.set(5, 1); c.set(11, 0); c.set(12, 0); c.set(13, 0); c.set(14, 0); return new Date(c.getTimeInMillis()); } public static Date endOfYear(Date ts) { Calendar c = Calendar.getInstance(); c.setTimeInMillis(ts.getTime()); c.set(2, 11); c.set(5, 31); c.set(11, 23); c.set(12, 59); c.set(13, 59); c.set(14, 0); return new Date(c.getTimeInMillis()); } public static Date getLastYearDate() { Calendar c = Calendar.getInstance(); c.setTimeInMillis(getCurrentDate().getTime()); c.set(1, c.get(1) - 1); return new Date(c.getTimeInMillis()); } public static short stringToShort(String data) { short ret = 0; try { ret = Short.parseShort(data); } catch (NumberFormatException ex) { if ((null != data) && (!"".equals(data.trim()))) { logger.info("DataFormat.stringToShort方法错误提示:该关键字[" + data + "]不是短整数类型!"); } } return ret; } public static int stringToInt(String data) { int keyId = 0; try { keyId = Integer.parseInt(data); } catch (NumberFormatException ex) { if ((null != data) && (!"".equals(data.trim()))) { logger.info("DataFormat.stringToInt方法错误提示:该关键字[" + data + "]不是整数类型!"); } } return keyId; } public static long stringToLong(String data) { long keyId = 0L; try { keyId = Long.parseLong(data); } catch (NumberFormatException ex) { if ((null != data) && (!"".equals(data.trim()))) { logger.info("DataFormat.stringToLong方法错误提示:该关键字[" + data + "]不是长整数类型!"); } } return keyId; } public static double stringToDouble(String data) { double ret = 0.0D; try { ret = Double.parseDouble(data); } catch (NumberFormatException ex) { String errMsg = "该字段不是double类型!" + ex.getMessage(); logger.error(errMsg); } return ret; } public static float stringToFloat(String data) { float ret = 0.0F; try { ret = Float.parseFloat(data); } catch (NumberFormatException ex) { String errMsg = "该字段不是float类型!" + ex.getMessage(); logger.error(errMsg); } return ret; } public static Date addDateTime(Date original, int field, int amount) { Calendar calOriginal = Calendar.getInstance(); calOriginal.setTime(original); GregorianCalendar calendar = new GregorianCalendar(calOriginal.get(1), calOriginal.get(2), calOriginal.get(5), calOriginal.get(11), calOriginal.get(12), calOriginal.get(13)); calendar.add(field, amount); return new Date(calendar.getTime().getTime()); } public static Date endOfAMonth(Date ts) { Calendar c = Calendar.getInstance(); c.setTimeInMillis(ts.getTime()); c.add(2, 1); c.set(5, 1); c.add(5, -1); c.set(11, 23); c.set(12, 59); c.set(13, 59); c.set(14, 0); return new Date(c.getTimeInMillis()); } public static Date startOfAmonth(Date ts) { Calendar c = Calendar.getInstance(); c.setTimeInMillis(ts.getTime()); c.set(5, 1); c.set(11, 0); c.set(12, 0); c.set(13, 0); c.set(14, 0); return new Date(c.getTimeInMillis()); } public static boolean isValidDate(String dateStr, String pattern) { SimpleDateFormat df = new SimpleDateFormat(pattern); try { df.setLenient(false); df.parse(dateStr); return true; } catch (ParseException e) { } return false; } /** * 判断两个时间段是否存在交集 * * @param startA * @param endA * @param startB * @param endB * @return */ public static boolean isOverlappingDates(Date startA, Date endA, Date startB, Date endB) { if (startA == null || startB == null || endA == null || endB == null) { return false; } return (startA.before(startB) || startA.equals(startB)) && startB.before(endA) || (startB.before(startA) || startB.equals(startA)) && startA.before(endB); } public static Date getNextDay(int periodType, int periodUnit, int offerDay, Date validDate, Date expireDate) { Date targetDate = null; Date today = getCurrentDate(); if ((validDate != null) && (today.before(validDate))) { today = validDate; } offerDay--; if (periodType == 1) { if (offerDay + 1 >= 365) { offerDay = 364; } targetDate = org.apache.commons.lang.time.DateUtils.addDays(org.apache.commons.lang.time.DateUtils.truncate(today, 1), offerDay); if (targetDate.before(today)) { targetDate = org.apache.commons.lang.time.DateUtils.addDays(org.apache.commons.lang.time.DateUtils.truncate(org.apache.commons.lang.time.DateUtils.addYears(today, periodUnit), 1), offerDay); } } else if (periodType == 2) { int dayOfMonth = 28; if (dayOfMonth - 1 <= offerDay) { offerDay = dayOfMonth - 1; } targetDate = org.apache.commons.lang.time.DateUtils.addDays(org.apache.commons.lang.time.DateUtils.truncate(today, 2), offerDay); if (targetDate.before(today)) { targetDate = org.apache.commons.lang.time.DateUtils.addDays(org.apache.commons.lang.time.DateUtils.truncate(org.apache.commons.lang.time.DateUtils.addMonths(today, periodUnit), 2), offerDay); } } else if (periodType == 3) { Calendar calendar = Calendar.getInstance(); if (offerDay >= 7) { offerDay = 6; } calendar.setFirstDayOfWeek(1); calendar.setTime(today); calendar.add(5, 1 - calendar.get(7)); targetDate = org.apache.commons.lang.time.DateUtils.addDays(org.apache.commons.lang.time.DateUtils.truncate(calendar.getTime(), 5), offerDay); if (targetDate.before(today)) { targetDate = org.apache.commons.lang.time.DateUtils.addDays(org.apache.commons.lang.time.DateUtils.addWeeks(org.apache.commons.lang.time.DateUtils.truncate(calendar.getTime(), 5), periodUnit), offerDay); } } else if (periodType == 4) { Calendar calendar = Calendar.getInstance(); targetDate = org.apache.commons.lang.time.DateUtils.addDays(org.apache.commons.lang.time.DateUtils.truncate(calendar.getTime(), 5), ++offerDay); } return (expireDate != null) && (targetDate.after(expireDate)) ? null : targetDate; } public static Date secToDate(long second) { Calendar c = Calendar.getInstance(); c.setTimeInMillis(second * 1000L); return c.getTime(); } public static String msToDuration(long mss) { StringBuffer str = new StringBuffer(); long days = mss / 86400000L; if (days != 0L) { str.append(days); } long hours = mss % 86400000L / 3600000L; if (str.length() == 0) { if (hours != 0L) str.append(hours); } else { str.append(" days ").append(hours); } long minutes = mss % 3600000L / 60000L; if (str.length() == 0) { if (minutes != 0L) str.append(minutes); } else { str.append(" hours ").append(minutes); } long seconds = mss % 60000L / 1000L; if (str.length() == 0) { if (seconds != 0L) str.append(seconds); } else { str.append(" minutes ").append(seconds); } long millseconds = mss % 1000L; if (str.length() == 0) str.append(millseconds); else { str.append(" seconds ").append(millseconds); } str.append(" millseconds"); return str.toString(); } public static long getDaySub(Date beginDate, Date endDate) { long day = 0L; day = (endDate.getTime() - beginDate.getTime()) / 86400000L; return day; } public static String getFormatMonth(int i, String formatMonth) { Calendar c = Calendar.getInstance(); c.add(2, i); SimpleDateFormat format = new SimpleDateFormat(formatMonth); return format.format(c.getTime()); } public static String cvtUTCDate(Date date, String format) { SimpleDateFormat sdf = new SimpleDateFormat(format, Locale.ENGLISH); sdf.setTimeZone(TimeZone.getTimeZone("UTC")); return sdf.format(date); } public static Date addSecond(Date date, int second) { Calendar calendar = Calendar.getInstance(); calendar.setTime(date); calendar.add(13, second); return calendar.getTime(); } }
[ "1040123547@qq.com" ]
1040123547@qq.com
de8d0b22c66e1d442be91f1a0fb9ac3d5a419814
030bf809b71548522d8324980798b4ab4f98910e
/src/main/java/com/adapter/cppadapter/service/DataTransformer.java
0376fe1fc3259cd8589d4bb1e6ff2bef20eb47d1
[]
no_license
AyushGoel20/cpp-adapter
4f2bb2259ac1a2c634a85eae828f1dfdb8732f30
cb0fac93187019679a9663dd2106847773a6bbf5
refs/heads/master
2022-04-18T18:48:08.884838
2020-04-12T13:46:55
2020-04-12T13:46:55
255,436,612
0
0
null
2020-04-13T20:38:09
2020-04-13T20:38:08
null
UTF-8
Java
false
false
499
java
package com.adapter.cppadapter.service; import org.springframework.stereotype.Service; import com.adapter.cppadapter.model.DataObject; import com.adapter.cppadapter.model.Payload; import com.omxgroup.xstream.amp.AmpTradeRep; @Service public class DataTransformer { public Payload createPayloadFromResponse(AmpTradeRep data) { Payload payload = new Payload(); payload.setTradeDate(data.getTradeId().getTradeDate().toString()); data.getStatics().getTime().getDate(); return payload; } }
[ "vikhyat.kaushik@gmail.com" ]
vikhyat.kaushik@gmail.com
4909b0bb8129433f0ae6ac1ccc89e17e0b73300e
8f810e0e599d8d79e814b747c805e010b37c12f6
/src/main/java/com/lg/microservice/domain/DeliveryStatus.java
e3a428475dd8848a0442dbf550d11aa6ebbc9727
[]
no_license
gkm2019/study-spring-utilize1
8412fe55fc3cbe318644e57e75ef2f318cfaf869
7de2ccd69f05cb872495116b33d446739359ebfd
refs/heads/master
2023-01-07T01:05:36.027540
2020-11-09T14:20:19
2020-11-09T14:20:19
311,361,982
0
0
null
null
null
null
UTF-8
Java
false
false
84
java
package com.lg.microservice.domain; public enum DeliveryStatus { READY, COMP }
[ "popo2019@naver.com" ]
popo2019@naver.com
edd9b0c5161c85d463ddf9d4305b9d8fac1c9834
01cada62633c0bcc956920c8abf864f71690ee6e
/src/main/java/org/cer/web/TaxeController.java
ac7589fbc341f26adf6cce681f85d8cd3c0e5d3e
[]
no_license
celghandour/Taxes
7e6a357c73e4e0b159c2b7ddd2fd79b3573ee982
2b0bef807a28ed5cbe0b897330dccba5d91e3045
refs/heads/master
2021-01-21T16:09:54.098534
2017-05-20T13:09:12
2017-05-20T13:09:12
91,877,447
0
0
null
null
null
null
UTF-8
Java
false
false
841
java
package org.cer.web; import org.cer.dao.EntrepriseRepository; import org.cer.entities.Entreprise; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import java.util.List; /** * Created by celghandour on 20/05/17. */ @Controller public class TaxeController { @Autowired private EntrepriseRepository entrepriseRepository ; @RequestMapping(value="/entreprises",method= RequestMethod.GET) public String index (Model model){ List<Entreprise> entreprises = entrepriseRepository.findAll(); model.addAttribute("listEntreprises",entreprises); return "entreprises"; } }
[ "elghandour.chafik@gmail.com" ]
elghandour.chafik@gmail.com
da7051c474ebc95911a9afd550bb78377e61ceb3
28d8a8caecb3f8977948de282824c85e0ef93ac6
/src/program/teste.java
81a5bd0744626642971540b5340d58dea41d6d7c
[]
no_license
carlos-alexandrebp/objtos-figuras
b592ba7d275996a2b01ecc5e65506d4f9aae9823
7ee62a44e9f91718044efa5d5d3bdc3bff601070
refs/heads/master
2020-04-25T08:39:39.343879
2019-02-26T06:57:15
2019-02-26T06:57:15
172,654,345
0
0
null
null
null
null
UTF-8
Java
false
false
3,168
java
package program; import objetos2d.*; import objetos3d.*; //Visao geral do programa public class teste { public static void main(String[] args) { System.out.println("-------------------Objetos 2d -------------------------"); System.out.println(""); System.out.printf("Calcular area e perimetros dos Triangulos %n%n"); Double[] valuesTri = {3.0,4.0,5.0}; Triangulo tri = new Triangulo(); tri.setLado(valuesTri); tri.calcularArea(); tri.calcularPerimetro(); System.out.println("Triangulo lados 3.0,4.0,5.0 : <A> "+tri.getArea()+" <P> "+tri.getPerimetro()); Double[] valuesTriEquilatero = {3.0,3.0,3.0}; Triangulo triEq = new Triangulo(); triEq.setLado(valuesTriEquilatero); triEq.calcularArea(); triEq.calcularPerimetro(); System.out.printf("Triangulo lados 3.0,3.0,3.0 : <A> %.4f <P> %.4f%n%n%n%n%n",triEq.getArea(),triEq.getPerimetro()); System.out.printf("Calcular area e perimetro do Quadrado %n%n"); Double ladoQua = 5.0; Quadrado qua = new Quadrado(); qua.setLado(ladoQua); qua.calcularArea(); qua.calcularPerimetro(); System.out.printf("Quadrado com lado 5.0 : <A> %.4f <P> %.4f%n%n%n%n%n",qua.getArea(),qua.getPerimetro()); System.out.printf("Calcular area e perimetro do Circulo %n%n"); Double raioCir = 3.0; Circulo cir = new Circulo(); cir.setRaio(raioCir); cir.calcularArea(); cir.calcularPerimetro(); System.out.printf("Circulo com raio 3.0 : <A> %.4f <P ou C> %.4f%n%n%n",cir.getArea(),cir.getPerimetro()); System.out.println("-------------------Objetos 3d -------------------------"); System.out.println(""); System.out.printf("Calcular volume do Cilindro %n%n"); Double altCil = 5.0; Double raioCil = 3.0; Cilindro cil = new Cilindro(); cil.setRaio(raioCil); cil.setAltura(altCil); cil.calcularVolume(); System.out.printf("Cilindro com raio 3.0 e altura de 5.0 : <V> %.4f %n%n%n%n%n",cil.getVolume()); System.out.printf("Calcular volume do Cubo %n%n"); Double aresta = 5.0; Cubo cub = new Cubo(); cub.setAresta(aresta); cub.calcularVolume(); System.out.printf("Cubo com com aresta de 5.0 : <V> %.4f %n%n%n%n%n",cub.getVolume()); System.out.printf("Calcular volume da Piramede %n%n"); Double[] medDaBaseQua = {5.0,5.0}; Double altura = 6.0; //Double[] medDaBaseTri = {3.0,4.0,5.0}; Piramede pir = new Piramede(); pir.setAltura(altura); pir.setLadosOuAreaDaBase(medDaBaseQua); pir.calcularVolume(); System.out.println("Piramede com base quadrada de 5.0 e altura de 6.0: <V> "+pir.getVolume()); System.out.println(""); Double[] medDaBaseTri = {3.0,4.0,5.0}; Piramede pirBaseTri = new Piramede(); pirBaseTri.setAltura(altura); pirBaseTri.setLadosOuAreaDaBase(medDaBaseTri); pirBaseTri.calcularVolume(); System.out.printf("Piramde com base triangular de 5.0 e altura de 6.0: <V> %.4f %n%n%n%n%n",pirBaseTri.getVolume()); } }
[ "java-util@hotmail.com" ]
java-util@hotmail.com
e006613a08b52ab69fcaca47b0dec055b596bdd1
2e6fe57863096e28e49906f3aa4a34a4f0f40e99
/src/main/java/Server.java
10adebf3aa20de714bc1cedf72c444f00f7dfc95
[]
no_license
raghavddps23/socket-stream
e8f421e08ff1546db53e73ff4e6e711321c54279
6449a285db4042336bfb994c339e7bee21cf55b6
refs/heads/master
2023-01-04T13:46:25.636175
2020-11-01T13:50:02
2020-11-01T13:50:02
309,106,064
0
0
null
null
null
null
UTF-8
Java
false
false
873
java
// Server2 class that // receives data and sends data import java.io.File; import java.io.FileInputStream; import java.io.OutputStream; import java.net.ServerSocket; import java.net.Socket; class Server{ public static void main(String args[]) throws Exception { File soundFile = AudioUtil.getSoundFile("/home/learner/Mp3/src/main/java/ans.wav"); try (ServerSocket serverSocker = new ServerSocket(8888); FileInputStream in = new FileInputStream(soundFile)) { if (serverSocker.isBound()) { Socket client = serverSocker.accept(); OutputStream out = client.getOutputStream(); byte buffer[] = new byte[1000000]; int count; while ((count = in.read(buffer)) != -1) out.write(buffer, 0, count); } } } }
[ "raghav.ddps2@gmail.com" ]
raghav.ddps2@gmail.com
841de505ab3b1587ea78739a6b34d6fde9f90912
efd99c45fb1e6fac311fe7e1dd7741b21fe53609
/com/planet_ink/coffee_mud/Common/interfaces/Tattoo.java
56c1b4e55811415a8832204c6f925033235fc1c4
[ "Apache-2.0" ]
permissive
yohanesgultom/CoffeeMud
ddd68d01349b4e7c4c9f49b410e6e87e9855a5b4
87177f933a4cc6143b3602f896e0cedb6f6582d6
refs/heads/master
2021-01-18T12:57:04.639702
2016-07-22T07:29:16
2016-07-22T07:29:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,090
java
package com.planet_ink.coffee_mud.Common.interfaces; import com.planet_ink.coffee_mud.core.interfaces.*; import com.planet_ink.coffee_mud.core.*; import com.planet_ink.coffee_mud.core.collections.*; import com.planet_ink.coffee_mud.Abilities.interfaces.*; import com.planet_ink.coffee_mud.Areas.interfaces.*; import com.planet_ink.coffee_mud.Behaviors.interfaces.*; import com.planet_ink.coffee_mud.CharClasses.interfaces.*; import com.planet_ink.coffee_mud.Commands.interfaces.*; import com.planet_ink.coffee_mud.Common.interfaces.*; import com.planet_ink.coffee_mud.Exits.interfaces.*; import com.planet_ink.coffee_mud.Items.interfaces.*; import com.planet_ink.coffee_mud.Libraries.interfaces.*; import com.planet_ink.coffee_mud.Locales.interfaces.*; import com.planet_ink.coffee_mud.MOBS.interfaces.*; import com.planet_ink.coffee_mud.Races.interfaces.*; import java.util.List; import java.util.Vector; /** * Tattoos are arbitrary markers or flags. They server no other * purpose other than to be checked by other things for their existence. * They can automatically expire by setting a tick down, or a number of * ticks to live. */ public interface Tattoo extends Cloneable, CMObject, CMCommon { /** * Set the tattoo name * @param name the tattoo name * @return this */ public Tattoo set(String name); /** * Set the tatoo name and tick-down * @param name the tatoo name * @param down the tick down life span * @return this */ public Tattoo set(String name, int down); /** * Returns the current tick-down * @return the tickDown */ public int getTickDown(); /** * Reduces the tick down by one and returns the new value * @return the new tick down */ public int tickDown(); /** * @return the tattooName */ public String getTattooName(); /** * Parse a new tattoo object from the * coded data, of the form: * TATOONAME * or * [NUMBER] TATTOONAME * @param tattoo coded data * @return this tattoo */ public Tattoo parse(String tattooCode); }
[ "bo@zimmers.net" ]
bo@zimmers.net
67892b04743896179eb9b8c91b923ad7cf6d25f0
5d4dc549626b52d6450803a45934da8e18a7799b
/HelloWorldMVC/model/src/main/java/helloworldmvc/model/IModel.java
e2e0c9dd9a078fdae7676d22593639b30aba38e3
[]
no_license
Kiroas/HelloWorldMVC
3bcf81a7c953f6db5a45e23d24901822c1668aa9
241082dbe6a2e4c262f8731e09ec9c908172516b
refs/heads/master
2021-04-06T07:14:38.200451
2018-03-19T14:15:08
2018-03-19T14:15:08
124,900,077
0
0
null
null
null
null
UTF-8
Java
false
false
97
java
package helloworldmvc.model; public interface IModel { public String getMessage(); }
[ "raph5@169.254.235.14" ]
raph5@169.254.235.14
884d778f8a403b5007b2039825651f12cd2554b3
798d4bfec7baf9030ea17788668712b47be761ff
/src/test/java/Utils/ConfigReader.java
d27609677533933b72a1b6bce0b823bb3864d8eb
[]
no_license
aylacansu/DarkSky.Net
2072f0a253cfc26658477b9583fc1439021881cf
b3a81e5c9dc804009b41af35ca5d533475509fc9
refs/heads/master
2022-11-30T09:58:50.831241
2020-08-10T07:20:08
2020-08-10T07:20:08
286,405,693
0
0
null
null
null
null
UTF-8
Java
false
false
605
java
package Utils; import java.io.FileInputStream; import java.io.IOException; import java.util.Properties; public class ConfigReader { private static Properties configFile; static { try { FileInputStream fileInputStream = new FileInputStream("config.properties"); configFile = new Properties(); configFile.load(fileInputStream); fileInputStream.close(); } catch (IOException e) { e.printStackTrace(); } } public static String getProperty(String key) { return configFile.getProperty(key); } }
[ "cansusa81@gmail.com" ]
cansusa81@gmail.com
88d3c2393556eb65eaee05f0d02534558f8264b7
f49db05c3e344f4273322f4e2e37de212ba98fa8
/Example2/src/ReflectionDemo1.java
3ca7aa5f7b78fb95601a6ffbb40c07d26bb16ba6
[]
no_license
wooyuk/JMP
5e969df3be0910c9d581c095297f54cc7ca6fcdc
a851754a2c290feb1ba48208e15b9d8ddf11d34c
refs/heads/master
2021-01-10T18:49:10.504874
2011-09-22T06:48:52
2011-09-22T06:48:52
810,435
0
0
null
null
null
null
UTF-8
Java
false
false
878
java
/** * Just for fun * */ // Demonstrate reflection. import java.lang.reflect.*; public class ReflectionDemo1 { public static void main(String args[]) { try { Class c = Class.forName("java.awt.Dimension"); System.out.println("Constructors:"); Constructor constructors[] = c.getConstructors(); for(int i = 0; i < constructors.length; i++) { System.out.println(" " + constructors[i]); } System.out.println("Fields:"); Field fields[] = c.getFields(); for(int i = 0; i < fields.length; i++) { System.out.println(" " + fields[i]); } System.out.println("Methods:"); Method methods[] = c.getMethods(); for(int i = 0; i < methods.length; i++) { System.out.println(" " + methods[i]); } } catch(Exception e) { System.out.println("Exception: " + e); } } }
[ "clannadm001@gmail.com" ]
clannadm001@gmail.com
b4b23e8a9442f9713c1163eb59d852f421914d1e
760e5b9a244db7815535981300e6eb6edac33730
/src/com/mingda/dao/Payview01DAO.java
5b35245c8387a3d821072a19f323e8250f46158c
[]
no_license
jilinsheng/mas
e97f99c1dbd3ad27fca93ffa55bd494c1006c6aa
fd055b10c1492d589657bd1d618bd972dac28a9d
refs/heads/master
2021-01-10T22:05:38.697489
2015-12-04T12:29:43
2015-12-04T12:29:43
27,760,948
3
4
null
null
null
null
UTF-8
Java
false
false
1,844
java
package com.mingda.dao; import com.mingda.model.Payview01; import com.mingda.model.Payview01Example; import java.util.List; public interface Payview01DAO { /** * This method was generated by Apache iBATIS ibator. This method corresponds to the database table MEDICAL.PAYVIEW01 * @ibatorgenerated Tue Jul 02 09:53:20 CST 2013 */ int countByExample(Payview01Example example); /** * This method was generated by Apache iBATIS ibator. This method corresponds to the database table MEDICAL.PAYVIEW01 * @ibatorgenerated Tue Jul 02 09:53:20 CST 2013 */ int deleteByExample(Payview01Example example); /** * This method was generated by Apache iBATIS ibator. This method corresponds to the database table MEDICAL.PAYVIEW01 * @ibatorgenerated Tue Jul 02 09:53:20 CST 2013 */ void insert(Payview01 record); /** * This method was generated by Apache iBATIS ibator. This method corresponds to the database table MEDICAL.PAYVIEW01 * @ibatorgenerated Tue Jul 02 09:53:20 CST 2013 */ void insertSelective(Payview01 record); /** * This method was generated by Apache iBATIS ibator. This method corresponds to the database table MEDICAL.PAYVIEW01 * @ibatorgenerated Tue Jul 02 09:53:20 CST 2013 */ List<Payview01> selectByExample(Payview01Example example); /** * This method was generated by Apache iBATIS ibator. This method corresponds to the database table MEDICAL.PAYVIEW01 * @ibatorgenerated Tue Jul 02 09:53:20 CST 2013 */ int updateByExampleSelective(Payview01 record, Payview01Example example); /** * This method was generated by Apache iBATIS ibator. This method corresponds to the database table MEDICAL.PAYVIEW01 * @ibatorgenerated Tue Jul 02 09:53:20 CST 2013 */ int updateByExample(Payview01 record, Payview01Example example); }
[ "geogle_jia@126.com" ]
geogle_jia@126.com
92867b5e1810e7a99150211484e5af6fddabc5ad
19c4457cecc93b9fe66a0526346f2e8dec320286
/src/main/java/com/xxy/tree/PrintBTree.java
d1bd3295d85355826af91523a89eebdeb550d2bf
[]
no_license
StaticWalk/algorithmset
d5d6d0f39107a12094eaaa5b939945a1669fe1a1
90cfe62fb529bb6c1a0e4b14c56e264edd322d6c
refs/heads/master
2021-06-28T12:24:31.175504
2020-07-10T07:28:00
2020-07-10T07:28:00
156,492,471
1
0
null
2020-10-13T10:46:14
2018-11-07T04:58:35
Java
UTF-8
Java
false
false
1,030
java
package com.xxy.tree; import java.util.ArrayList; import java.util.LinkedList; import java.util.Queue; /** * Created by xiongxiaoyu * Data:2018/11/20 * Time:19:00 * 从上往下打印出二叉树的每个节点,同层节点从左至右打印。 * 1、将第一个元素加入队列 * 2、队列不为空时取队首元素 * 3、将下一层元素加入队尾 * 4、调到第二步,直到队列为空 */ public class PrintBTree { public ArrayList<Integer> PrintFromTopToBottom(TreeNode root) { ArrayList<Integer> list=new ArrayList(); Queue<TreeNode> queue=new LinkedList<>(); if (root == null ){ return list; } queue.add(root); while (queue.size()>0){ TreeNode node = queue.poll(); list.add(node.val); if (node.left!=null){ queue.add(node.left); } if (node.right!=null){ queue.add(node.right); } } return list; } public class TreeNode { int val = 0; TreeNode left = null; TreeNode right = null; public TreeNode(int val) { this.val = val; } } }
[ "957400829@qq.com" ]
957400829@qq.com
95ed38d4dce1dce1d7da80aee24233ccd202a7c3
23a1dd06f5fa54878e13a0bad1865984235e95d9
/NCSpringTask2/src/main/java/com/podval/services/PurchaseService.java
a8656227960c5ffabe61f1b9d8c7b1bba6e2f82a
[]
no_license
panzer2344/JavaTasks
9a688050085acc3825a801734cafec53d87470c6
ecb4006cfa00d2a794825f9c763a26c9237e32c7
refs/heads/master
2020-04-03T07:56:30.910991
2019-01-13T20:06:23
2019-01-13T20:06:23
155,118,499
0
0
null
null
null
null
UTF-8
Java
false
false
12,496
java
package com.podval.services; import com.podval.dao.BookDao; import com.podval.dao.PurchaseDao; import com.podval.dao.PurchaserDao; import com.podval.dao.ShopDao; import com.podval.models.*; import org.javatuples.Pair; import org.javatuples.Quintet; import org.javatuples.Triplet; import java.sql.Timestamp; import java.time.Month; import java.time.format.TextStyle; import java.util.*; public class PurchaseService extends ServiceImpl implements IPurchaseService { protected PurchaserDao purchaserDao = new PurchaserDao(); protected ShopDao shopDao = new ShopDao(); protected BookDao bookDao = new BookDao(); public PurchaseService() { super(new PurchaseDao()); } @Override @SuppressWarnings("unchecked") public List<Purchase> findAll() { return (List<Purchase>) super.findAll(); } @Override @SuppressWarnings("unchecked") public List<String> getDifferentMonth() { List<Timestamp> dates = getDifferent("date", Timestamp.class); List<String> months = new LinkedList<>(); for (Timestamp date : dates) { Month month = Month.of(date.getMonth() + 1); Locale loc = Locale.forLanguageTag("ru"); String curStringMonth = month.getDisplayName(TextStyle.FULL_STANDALONE, loc); if (!months.contains(curStringMonth)) months.add(curStringMonth); } return months; } @Override public Purchaser getPurchaserByPurchaseId(int id) { return (Purchaser) purchaserDao.findById( ((Purchase) find(id)) .getPurchaserId() ); } @Override public Purchaser getPurchaserByPurchase(Purchase purchase) { return getPurchaserByPurchaseId(purchase.getId()); } @Override public String getPurchaserLastNameByPurchaseId(int id) { return getPurchaserByPurchaseId(id).getLastName(); } @Override public String getPurchaserLastNameByPurchase(Purchase purchase) { return getPurchaserByPurchase(purchase).getLastName(); } @Override public Shop getShopByPurchaseId(int id) { return (Shop) shopDao.findById( ((Purchase) find(id)) .getSellerId() ); } @Override public Shop getShopByPurhcase(Purchase purchase) { return getShopByPurchaseId(purchase.getId()); } @Override public String getShopNameByPurchaseId(int id) { return getShopByPurchaseId(id).getName(); } @Override public String getShopNameByPurchase(Purchase purchase) { return getShopByPurhcase(purchase).getName(); } @Override public Pair<String, String> getPurchaserLastNameAndShopNameByPurchaseId(int id) { return new Pair<>(getPurchaserLastNameByPurchaseId(id), getShopNameByPurchaseId(id)); } @Override public Pair<String, String> getPurchaserLastNameAndShopNameByPurchase(Purchase purchase) { return new Pair<>(getPurchaserLastNameByPurchase(purchase), getShopNameByPurchase(purchase)); } @Override public Integer getPurchaserDiscountByPurchaseId(int id) { return getPurchaserByPurchaseId(id).getDiscount(); } @Override public Integer getPurchaserDiscountByPurchase(Purchase purchase) { return getPurchaserByPurchase(purchase).getDiscount(); } @Override public Book getBookByPurchaseId(int id) { return (Book) bookDao.findById( ((Purchase) find(id)) .getBookId() ); } @Override public Book getBookByPurchase(Purchase purchase) { return getBookByPurchaseId(purchase.getId()); } @Override public String getBookNameByPuchaseId(int id) { return getBookByPurchaseId(id).getName(); } @Override public String getBookNameByPurchase(Purchase purchase) { return getBookByPurchase(purchase).getName(); } @Override @SuppressWarnings("unchecked") public Quintet getDatePurchaserLastNameDiscountBookNameAndBooksCountByPurchaseId(int id) { return new Quintet( ((Purchase) find(id)).getDate(), getPurchaserLastNameByPurchaseId(id), getPurchaserDiscountByPurchaseId(id), getBookNameByPuchaseId(id), (((Purchase) find(id)).getCount()) ); } @Override public Quintet getDatePurchaserLastNameDiscountBookNameAndBooksCountByPurchase(Purchase purchase) { return getDatePurchaserLastNameDiscountBookNameAndBooksCountByPurchaseId(purchase.getId()); } @Override public List<Pair> getPurchaserLastNameAndShopNameOfAllPurchases() { List<Pair> pairList = new LinkedList<>(); for (Integer id : (List<Integer>) findAllId()) { pairList.add(getPurchaserLastNameAndShopNameByPurchaseId(id)); } return pairList; } @Override public List<Quintet> getDatePurchaserLastNameDiscountBookNameAndBooksCountOfAllPurchases() { List<Quintet> pairList = new LinkedList<>(); for (Integer id : (List<Integer>) findAllId()) { pairList.add(getDatePurchaserLastNameDiscountBookNameAndBooksCountByPurchaseId(id)); } return pairList; } @Override @SuppressWarnings("unchecked") public List<Purchase> getPurchasesWithSumLessThan(Integer conditionSum) { return (List<Purchase>) getModelsWithRestrictions("summa < " + conditionSum); } @Override @SuppressWarnings("unchecked") public List<Purchase> getPurchasesWithSumLessOrEqualThan(Integer conditionSum) { return (List<Purchase>) getModelsWithRestrictions("summa <= " + conditionSum); } @Override @SuppressWarnings("unchecked") public List<Purchase> getPurchasesWithSumGreaterThan(Integer conditionSum) { return (List<Purchase>) getModelsWithRestrictions("summa > " + conditionSum); } @Override @SuppressWarnings("unchecked") public List<Purchase> getPurchasesWithSumGreaterOrEqualThan(Integer conditionSum) { return (List<Purchase>) getModelsWithRestrictions("summa >= " + conditionSum); } @SuppressWarnings("unchecked") private List<Purchase> filterPurchasesListByBuingInPurchasersOwnArea(List<Purchase> purchaseList) { List<Purchase> filteredPurchaseList = new LinkedList<>(); for (Purchase purchase : purchaseList) { if (getPurchaserByPurchase(purchase).getResidenceArea().equals( getShopByPurhcase(purchase).getArea() )) { filteredPurchaseList.add(purchase); } } return filteredPurchaseList; } @Override @SuppressWarnings("unchecked") public List<Purchase> getPurchasesByPurchasersInOwnAreaWithMonthLessThen(Month month) { List<Purchase> purchaseList = (List<Purchase>) getModelsWithRestrictions("month(date) < " + month.getValue()); return filterPurchasesListByBuingInPurchasersOwnArea(purchaseList); } @Override @SuppressWarnings("unchecked") public List<Purchase> getPurchasesByPurchasersInOwnAreaWithMonthLessOrEqualThen(Month month) { List<Purchase> purchaseList = (List<Purchase>) getModelsWithRestrictions("month(date) <= " + month.getValue()); return filterPurchasesListByBuingInPurchasersOwnArea(purchaseList); } @Override @SuppressWarnings("unchecked") public List<Purchase> getPurchasesByPurchasersInOwnAreaWithMonthGreaterThen(Month month) { List<Purchase> purchaseList = (List<Purchase>) getModelsWithRestrictions("month(date) > " + month.getValue()); return filterPurchasesListByBuingInPurchasersOwnArea(purchaseList); } @Override @SuppressWarnings("unchecked") public List<Purchase> getPurchasesByPurchasersInOwnAreaWithMonthGreaterOrEqualThen(Month month) { List<Purchase> purchaseList = (List<Purchase>) getModelsWithRestrictions("month(date) >= " + month.getValue()); return filterPurchasesListByBuingInPurchasersOwnArea(purchaseList); } @SuppressWarnings("unchecked") public List<Triplet> getInfoAboutPurchaseWithSumGraterOrEqualThan(Integer sum) { List<Triplet> purchasesInfoList = new LinkedList<>();//getPurchasesWithSumGreaterOrEqualThan(sum); for (Purchase purchase : getPurchasesWithSumGreaterOrEqualThan(sum)) {//purchasesList){ purchasesInfoList.add( new Triplet( purchase.getId(), getPurchaserLastNameByPurchase(purchase), purchase.getDate() )); } return purchasesInfoList; } @Override @SuppressWarnings("unchecked") public List<Triplet> getPurchaseInfoByPurchasersInOwnAreaWithMonthLessThen(Month month) { List<Triplet> infoList = new LinkedList<>(); for (Purchase purchase : filterPurchasesListByBuingInPurchasersOwnArea( (List<Purchase>) getModelsWithRestrictions("month(date) < " + month.getValue()) ) ) { Purchaser purchaser = (Purchaser) purchaserDao.findById(purchase.getPurchaserId()); infoList.add(new Triplet( purchaser.getLastName(), purchaser.getResidenceArea(), purchase.getDate() )); } return infoList; } @Override @SuppressWarnings("unchecked") public List<Triplet> getPurchaseInfoByPurchasersInOwnAreaWithMonthLessOrEqualThen(Month month) { List<Triplet> infoList = new LinkedList<>(); for (Purchase purchase : filterPurchasesListByBuingInPurchasersOwnArea( (List<Purchase>) getModelsWithRestrictions("month(date) <= " + month.getValue()) ) ) { Purchaser purchaser = (Purchaser) purchaserDao.findById(purchase.getPurchaserId()); infoList.add(new Triplet( purchaser.getLastName(), purchaser.getResidenceArea(), purchase.getDate() )); } return infoList; } @Override @SuppressWarnings("unchecked") public List<Triplet> getPurchaseInfoByPurchasersInOwnAreaWithMonthGreaterThen(Month month) { List<Triplet> infoList = new LinkedList<>(); for (Purchase purchase : filterPurchasesListByBuingInPurchasersOwnArea( (List<Purchase>) getModelsWithRestrictions("month(date) > " + month.getValue()) ) ) { Purchaser purchaser = (Purchaser) purchaserDao.findById(purchase.getPurchaserId()); infoList.add(new Triplet( purchaser.getLastName(), purchaser.getResidenceArea(), purchase.getDate() )); } return infoList; } @Override @SuppressWarnings("unchecked") public List<Triplet> getPurchaseInfoByPurchasersInOwnAreaWithMonthGreaterOrEqualThen(Month month) { List<Triplet> infoList = new LinkedList<>(); for (Purchase purchase : filterPurchasesListByBuingInPurchasersOwnArea( (List<Purchase>) getModelsWithRestrictions("month(date) >= " + month.getValue()) ) ) { Purchaser purchaser = (Purchaser) purchaserDao.findById(purchase.getPurchaserId()); infoList.add(new Triplet( purchaser.getLastName(), purchaser.getResidenceArea(), purchase.getDate() )); } return infoList; } @Override public List<Quintet> getDatePurchaserLastNameDiscountBookNameAndBooksCountByPurchase() { List<Quintet> quintetList = new LinkedList<>(); for (Integer id : (List<Integer>) findAllId()) { quintetList.add(getDatePurchaserLastNameDiscountBookNameAndBooksCountByPurchaseId(id)); } return quintetList; } }
[ "lexathebest23@gmail.com" ]
lexathebest23@gmail.com
92a4afc4097ce06977fb56fe5d42249901525a84
61997911cecf12b4623e5b2c09af6edc5dbe61d6
/src/main/java/tatun/repository/AdRepository.java
f8dbfc57538074fdea04bc74212ec81d84517178
[]
no_license
iceman2112/spring-prj
94978ab4df04f25edb45de366331dd6011ff9609
79c201bffe8a311c6c69aeea32617e0cf85bab24
refs/heads/master
2020-04-10T04:00:02.944130
2018-12-13T11:34:45
2018-12-13T11:34:45
160,784,953
0
0
null
null
null
null
UTF-8
Java
false
false
244
java
package tatun.repository; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; import tatun.model.Ad; @Repository public interface AdRepository extends JpaRepository<Ad, Integer>{ }
[ "tatun.slava@gmail.com" ]
tatun.slava@gmail.com
20564e7d4c6c37e69cd10e939b1e87d8597cf7ac
89e39f38cec571ab2f7284ca06dfa2759aa1ec96
/service-order/src/main/java/com/stayrascal/cloud/order/domain/entity/Order.java
14f455616728c57833da2b39e02bd550efb3917c
[]
no_license
stayrascal/rascal-microservice
7d49c886043a84eb5c35e2b2e7c0f98776ccd46b
869d80ff7f730de0cf2f7a89c25bb39eaf20fdcb
refs/heads/master
2021-01-01T06:42:51.184067
2017-09-25T15:08:49
2017-09-25T15:08:49
97,491,945
0
0
null
null
null
null
UTF-8
Java
false
false
7,000
java
package com.stayrascal.cloud.order.domain.entity; import com.stayrascal.cloud.common.constant.ErrorCode; import com.stayrascal.cloud.common.jersey.exception.BadRequestException; import com.stayrascal.cloud.common.jersey.exception.InternalErrorException; import com.stayrascal.cloud.order.constant.DefaultValues; import com.stayrascal.cloud.order.contract.enumeration.DeliveryMethod; import com.stayrascal.cloud.order.contract.enumeration.OrderStatus; import com.stayrascal.cloud.order.service.PickupCodeGeneratorService; import com.google.common.base.Strings; import org.joda.time.DateTime; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.math.BigDecimal; import java.util.Date; import java.util.List; public class Order { public static final Logger LOGGER = LoggerFactory.getLogger(Order.class); private String id; private String userId; private String storeId; private String note; private String pickupCode; private String transactionId; private DeliveryMethod deliveryMethod; private OrderStatus status; private List<OrderItem> items; private Date timeCreated; private Date placedTime; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId; } public String getStoreId() { return storeId; } public void setStoreId(String storeId) { this.storeId = storeId; } public String getNote() { return note; } public void setNote(String note) { this.note = note; } public String getPickupCode() { return pickupCode; } public void setPickupCode(String pickupCode) { this.pickupCode = pickupCode; } public String getTransactionId() { return transactionId; } public void setTransactionId(String transactionId) { this.transactionId = transactionId; } public DeliveryMethod getDeliveryMethod() { return deliveryMethod; } public void setDeliveryMethod(DeliveryMethod deliveryMethod) { this.deliveryMethod = deliveryMethod; } public OrderStatus getStatus() { return status; } public void setStatus(OrderStatus status) { this.status = status; } public List<OrderItem> getItems() { return items; } public void setItems(List<OrderItem> items) { this.items = items; } public Date getTimeCreated() { return timeCreated; } public void setTimeCreated(Date timeCreated) { this.timeCreated = timeCreated; } public Date getPlacedTime() { return placedTime; } public void setPlacedTime(Date placedTime) { this.placedTime = placedTime; } public void updateNote(String newNote) { if (newNote != null && newNote.length() > DefaultValues.NOTE_LENGTH_LIMIT) { throw new BadRequestException(ErrorCode.INTERNAL_ERROR, "Note length is limited to {}, but length of note to add is {}", DefaultValues.NOTE_LENGTH_LIMIT, newNote.length()); } if (getStatus() != OrderStatus.OPEN) { throw new BadRequestException(ErrorCode.INTERNAL_ERROR, "Can only set note on OPEN orders"); } setNote(newNote); } public void transactionFinished(String transactionId, PickupCodeGeneratorService pickupCodeGeneratorService) { if (Strings.isNullOrEmpty(transactionId)) { throw new BadRequestException(ErrorCode.INTERNAL_ERROR, "Transaction ID is empty when finishing on order {}", getId()); } if (getStatus() != OrderStatus.OPEN) { throw new BadRequestException(ErrorCode.INTERNAL_ERROR, "Transaction {} finished on non-open order {}", transactionId, getId()); } if (getTransactionId() != null) { throw new BadRequestException(ErrorCode.INTERNAL_ERROR, "order {} transaction already finished", getId()); } // TODO: lock the stock for the purchased store items placeOrder(); setTransactionId(transactionId); if (getDeliveryMethod() == DeliveryMethod.STORE_PICKUP) { setPickupCode(pickupCodeGeneratorService.generateFetchCode(getStoreId())); } } private void placeOrder() { if (getStatus() != OrderStatus.OPEN) { throw new BadRequestException(ErrorCode.INTERNAL_ERROR, "Can only place on OPEN orders, but order {} is on status {}", getId(), getStatus()); } setStatus(OrderStatus.PROCESSING); setPlacedTime(DateTime.now().toDate()); } public void updateStatus(OrderStatus newStatus) { switch (newStatus) { case CLOSED: { close(); break; } case CANCELLED: { cancel(); break; } case FULFILLED: { fullfill(); break; } case PROCESSING: case OPEN: default: LOGGER.error("New order status {} not allowed", newStatus); break; } } private void fullfill() { if (getStatus() != OrderStatus.PROCESSING) { throw new BadRequestException(ErrorCode.INTERNAL_ERROR, "Can only fullfill processing orders, but order {} is in status {}", getId(), getStatus()); } setStatus(OrderStatus.FULFILLED); } private void cancel() { if (getStatus() != OrderStatus.OPEN) { throw new BadRequestException(ErrorCode.INTERNAL_ERROR, "Cannot cancel non-open order {}", getId()); } if (getTransactionId() == null) { throw new BadRequestException(ErrorCode.INTERNAL_ERROR, "Cannot cancel order {} without transaction finished", getId()); } setStatus(OrderStatus.CANCELLED); } private void close() { if (getStatus() != OrderStatus.OPEN) { throw new BadRequestException(ErrorCode.INTERNAL_ERROR, "Cannot close non-open order {}", getId()); } if (getTransactionId() != null) { throw new BadRequestException(ErrorCode.INTERNAL_ERROR, "Cannot close order {}, which already has transaction finished", getId()); } setStatus(OrderStatus.CLOSED); } public BigDecimal getTotalAmount() { return items.stream().map(item -> item.getPrice().multiply(new BigDecimal(item.getQuantity()))) .reduce(BigDecimal::add).orElseThrow(() -> new InternalErrorException(ErrorCode.INTERNAL_ERROR, "Failed to calculate order total amount on order {}, no order item?", getId())); } }
[ "zpwu@thoughtworks.com" ]
zpwu@thoughtworks.com
e267d930a53c8fb1bd52ae554c2afb44fc7186a6
c22a4a5fc711a429728837fc1730dfd7450819da
/final-framework-testng/src/com/training/pom/RemoveCartPOM.java
f8213ba8657d138fd80fb47a8c7ca10048b5758e
[]
no_license
HARSHA3214/Project
81b6cbc695a4f5fc0599f399ea3a47c85cdc1cd1
ab89bf795c43701629d6a450447c07d75a762f5a
refs/heads/master
2022-07-15T11:00:44.928756
2019-06-18T12:05:25
2019-06-18T12:05:25
191,509,573
0
0
null
2022-06-29T17:26:04
2019-06-12T06:18:10
Java
UTF-8
Java
false
false
557
java
package com.training.pom; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.PageFactory; public class RemoveCartPOM { private WebDriver driver; public RemoveCartPOM(WebDriver driver) { this.driver = driver; PageFactory.initElements(driver, this); } @FindBy(xpath="(//button[@data-toggle='tooltip'])[2]") private WebElement RemoveCart; public void clickToRemoveFromCart() { this.RemoveCart.click(); } }
[ "SriharshaRegulavalas@DESKTOP-T68S7MQ.in.ibm.com" ]
SriharshaRegulavalas@DESKTOP-T68S7MQ.in.ibm.com
b7e3cbf0dbb6bc5908ab83fe953f568e67f62acd
776be3db962ecdbdcf2d0f5a439a47f4b0d7e8f4
/app/src/main/java/com/example/deltager/pointlessclicker/Save.java
a377c5de019f7194b9642cac5520fa78bf1319d9
[]
no_license
UNFDanmark/SDC2017-PointlessButton
9d6fe3ac0dc17696fd020de7a1c394f3e7b326c7
276efd2c1c41087353dd4e77cb1a10351a0c9251
refs/heads/master
2020-12-02T17:45:51.436183
2017-07-14T16:24:58
2017-07-14T16:24:58
96,421,841
0
1
null
null
null
null
UTF-8
Java
false
false
2,818
java
package com.example.deltager.pointlessclicker; import android.content.Context; import android.content.SharedPreferences; import java.io.*; import java.util.ArrayList; public class Save { //static ArrayList newAdjectiveList = new ArrayList<String>(); public static void save (long currentScore, Context context) { // Handle to Shared Preferences SharedPreferences sharedPref = context.getSharedPreferences( String.valueOf(R.string.preference_file_key), Context.MODE_PRIVATE); //Write to shared Preferences SharedPreferences.Editor editor = sharedPref.edit(); editor.putLong("score", currentScore); editor.commit(); } public static long load (Context context) { // Read from shared Preferences SharedPreferences sharedPref = context.getSharedPreferences( String.valueOf(R.string.preference_file_key), Context.MODE_PRIVATE); return sharedPref.getLong("score", 0); } public static void saveFiles(ArrayList<String> oldAdjectives, String newAdjective, Context context) throws IOException { oldAdjectives.add(newAdjective); // New Adjective er variable FileOutputStream saveFile = new FileOutputStream(context.getFilesDir() + "/saveFile.sav"); ObjectOutputStream save = new ObjectOutputStream(saveFile); save.writeObject(oldAdjectives); save.close(); } public static ArrayList<String> returnSavedFiles(Context context) { try { FileInputStream saveFile = new FileInputStream(context.getFilesDir() + "/saveFile.sav"); ObjectInputStream restore = new ObjectInputStream(saveFile); ArrayList<String> savedAdjectives = (ArrayList<String>) restore.readObject(); restore.close(); return savedAdjectives; } catch (Exception e) { return new ArrayList<String>(); } } public static void saveFilesSub(ArrayList<String> oldSub, String newSub, Context context) throws IOException { oldSub.add(newSub); FileOutputStream saveFile = new FileOutputStream(context.getFilesDir() + "/saveFile2.sav"); ObjectOutputStream save = new ObjectOutputStream(saveFile); save.writeObject(oldSub); save.close(); } public static ArrayList<String> returnSavedFilesSub(Context context) { try { FileInputStream saveFile = new FileInputStream(context.getFilesDir() + "/saveFile2.sav"); ObjectInputStream restore = new ObjectInputStream(saveFile); ArrayList<String> savedSub = (ArrayList<String>) restore.readObject(); restore.close(); return savedSub; } catch (Exception e) { return new ArrayList<String>(); } } }
[ "github@software.unf.dk" ]
github@software.unf.dk
bb9fd07a5bab753998a3d9c300e276b3df728aba
ae5eb1a38b4d22c82dfd67c86db73592094edc4b
/project226/src/main/java/org/gradle/test/performance/largejavamultiproject/project226/p1134/Production22690.java
c7c8960df7dc57de11247a67a7849834fe5682c7
[]
no_license
big-guy/largeJavaMultiProject
405cc7f55301e1fd87cee5878a165ec5d4a071aa
1cd6a3f9c59e9b13dffa35ad27d911114f253c33
refs/heads/main
2023-03-17T10:59:53.226128
2021-03-04T01:01:39
2021-03-04T01:01:39
344,307,977
0
0
null
null
null
null
UTF-8
Java
false
false
1,890
java
package org.gradle.test.performance.largejavamultiproject.project226.p1134; public class Production22690 { private String property0; public String getProperty0() { return property0; } public void setProperty0(String value) { property0 = value; } private String property1; public String getProperty1() { return property1; } public void setProperty1(String value) { property1 = value; } private String property2; public String getProperty2() { return property2; } public void setProperty2(String value) { property2 = value; } private String property3; public String getProperty3() { return property3; } public void setProperty3(String value) { property3 = value; } private String property4; public String getProperty4() { return property4; } public void setProperty4(String value) { property4 = value; } private String property5; public String getProperty5() { return property5; } public void setProperty5(String value) { property5 = value; } private String property6; public String getProperty6() { return property6; } public void setProperty6(String value) { property6 = value; } private String property7; public String getProperty7() { return property7; } public void setProperty7(String value) { property7 = value; } private String property8; public String getProperty8() { return property8; } public void setProperty8(String value) { property8 = value; } private String property9; public String getProperty9() { return property9; } public void setProperty9(String value) { property9 = value; } }
[ "sterling.greene@gmail.com" ]
sterling.greene@gmail.com
e6e432c53a2619b95bc40d4599806a62b86e4fde
6afcdc1611a312a0097ab4b60f9fe0e226e163a0
/Coldet/src/main/java/foundation/icon/icx/transport/jsonrpc/RpcArray.java
a3914fde9a8095712b43adbddf86c0489c07a65f
[]
no_license
alterkim/Coldet
b3bfde9afb5cfb476351c9551ad1312011670622
7dc2d9fe772656cb5fca5fe2dba82f2ade7df01f
refs/heads/master
2023-01-23T22:50:10.183150
2020-12-04T14:21:33
2020-12-04T14:21:33
313,055,726
0
0
null
null
null
null
UTF-8
Java
false
false
1,935
java
/* * Copyright 2018 ICON Foundation * * 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 foundation.icon.icx.transport.jsonrpc; import java.io.Serializable; import java.util.ArrayList; import java.util.Iterator; import java.util.List; /** * A read-only data class of RpcArray */ public class RpcArray implements RpcItem, Iterable<RpcItem>, Serializable { private final List<RpcItem> items; private RpcArray(List<RpcItem> items) { this.items = items; } public Iterator<RpcItem> iterator() { return items.iterator(); } public RpcItem get(int index) { return items.get(index); } public int size() { return items.size(); } public List<RpcItem> asList() { return new ArrayList<>(items); } @Override public String toString() { return "RpcArray(" + "items=" + items + ')'; } @Override public boolean isEmpty() { return items == null || items.isEmpty(); } /** * Builder for RpcArray */ public static class Builder { private final List<RpcItem> items; public Builder() { items = new ArrayList<>(); } public Builder add(RpcItem item) { items.add(item); return this; } public RpcArray build() { return new RpcArray(items); } } }
[ "alter@kakao.com" ]
alter@kakao.com
df88ee1410f18ae550d04f8694d92a83fe276cb4
45e1bc1d57f6b9771f6c5bd30d7a6904a733e0df
/src/lk/Asiri/asirisupermarket/controller/ManageBatchController.java
1899f32c35621b7c8731333cb1e2726a40fbfd05
[]
no_license
harsard7/AsiriSMS
65322f24cab927e15b0a65b55801459567251211
2bbe1bca1f354a4415d6cf348c45f8b3764d2755
refs/heads/master
2020-03-12T20:02:32.427375
2018-04-24T05:44:39
2018-04-24T05:44:39
130,796,871
0
0
null
null
null
null
UTF-8
Java
false
false
4,119
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 lk.ijse.asirisupermarket.controller; import java.sql.Connection; import java.util.ArrayList; import lk.ijse.asirisupermarket.core.dto.BatchDTO; import lk.ijse.asirisupermarket.core.dto.GrnDTO; import lk.ijse.asirisupermarket.core.dto.SupplierDTO; import lk.ijse.asirisupermarket.dao.DAOFactory; import lk.ijse.asirisupermarket.dao.custom.BatchDAO; import lk.ijse.asirisupermarket.dao.custom.GrnDAO; import lk.ijse.asirisupermarket.dao.custom.SupplierDAO; import lk.ijse.asirisupermarket.dao.db.DBConnection; /** * * @author Hafees */ public class ManageBatchController { //Connection connection=DBConnection.getInstance().getConnection(); public static BatchDAO batchDAO=(BatchDAO)DAOFactory.getInstance().getDAO(DAOFactory.DAOTypes.BATCH); public static SupplierDAO supplierDAO=(SupplierDAO) DAOFactory.getInstance().getDAO(DAOFactory.DAOTypes.SUPPLIER); public static GrnDAO grnDAO=(GrnDAO) DAOFactory.getInstance().getDAO(DAOFactory.DAOTypes.GRN); public static boolean add(SupplierDTO supplier,GrnDTO grn,BatchDTO batch) throws Exception { Connection connection=DBConnection.getInstance().getConnection(); try{ connection.setAutoCommit(false); boolean isAddedSupplier=supplierDAO.add(supplier); if(isAddedSupplier){ boolean isAddedgrn=grnDAO.add(grn); if(isAddedgrn){ boolean isAddedBatch=batchDAO.add(batch); if (isAddedBatch){ connection.commit(); return true; } connection.rollback(); return false; } connection.rollback(); return false; } connection.rollback(); return false; }finally{ connection.setAutoCommit(true); } } public static boolean add(ArrayList<BatchDTO> dtoList) throws Exception { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } public static boolean update(BatchDTO dto) throws Exception { return batchDAO.update(dto); } public static boolean update(ArrayList<BatchDTO> dtoList) throws Exception { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } public static boolean delete(BatchDTO id) throws Exception { return batchDAO.delete(id); } public static BatchDTO search(String key) throws Exception { return batchDAO.search(key); } public static ArrayList<BatchDTO> getAll() throws Exception { return batchDAO.getAll(); } public static ArrayList<String> getNames() throws Exception { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } public static BatchDTO getAllByNames(String name) throws Exception { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } public static BatchDTO getIDFromName(String name) throws Exception { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } public static BatchDTO getNameFromID(String id) throws Exception { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } public static String getIDByName(String name) throws Exception { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } public static boolean delete(String id) throws Exception { return batchDAO.delete(id); } }
[ "harsard@ymail.com" ]
harsard@ymail.com
ceb3131a9babf97e394772283ed974da54cb2448
d17c617779c8fbdca28e7a823f528483ff0caf12
/Marmalade/MarmaladeODK/source/android/DebugInput.java
a945c0890fda4a32f25f959066180297db38667a
[ "Apache-2.0" ]
permissive
MasashiWada/ouya-sdk-examples
1d2665749bc58396ff7d017d1f8fb7ce41237e1d
854422922fa2c8700d13c9c4b6ecfed756b56355
refs/heads/master
2020-06-08T22:00:56.703540
2016-09-19T20:57:12
2016-09-19T20:57:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
11,153
java
/* * Copyright (C) 2012-2015 OUYA, Inc. * * 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 tv.ouya.sdk.marmalade; import tv.ouya.console.api.OuyaController; import android.util.Log; import android.util.SparseArray; import android.view.KeyEvent; import android.view.MotionEvent; public class DebugInput { private static final String TAG = DebugInput.class.getSimpleName(); public static String debugGetAxisName(int axis) { SparseArray<String> names = new SparseArray<String>(); names.append(MotionEvent.AXIS_X, "AXIS_X"); names.append(MotionEvent.AXIS_Y, "AXIS_Y"); names.append(MotionEvent.AXIS_PRESSURE, "AXIS_PRESSURE"); names.append(MotionEvent.AXIS_SIZE, "AXIS_SIZE"); names.append(MotionEvent.AXIS_TOUCH_MAJOR, "AXIS_TOUCH_MAJOR"); names.append(MotionEvent.AXIS_TOUCH_MINOR, "AXIS_TOUCH_MINOR"); names.append(MotionEvent.AXIS_TOOL_MAJOR, "AXIS_TOOL_MAJOR"); names.append(MotionEvent.AXIS_TOOL_MINOR, "AXIS_TOOL_MINOR"); names.append(MotionEvent.AXIS_ORIENTATION, "AXIS_ORIENTATION"); names.append(MotionEvent.AXIS_VSCROLL, "AXIS_VSCROLL"); names.append(MotionEvent.AXIS_HSCROLL, "AXIS_HSCROLL"); names.append(MotionEvent.AXIS_Z, "AXIS_Z"); names.append(MotionEvent.AXIS_RX, "AXIS_RX"); names.append(MotionEvent.AXIS_RY, "AXIS_RY"); names.append(MotionEvent.AXIS_RZ, "AXIS_RZ"); names.append(MotionEvent.AXIS_HAT_X, "AXIS_HAT_X"); names.append(MotionEvent.AXIS_HAT_Y, "AXIS_HAT_Y"); names.append(MotionEvent.AXIS_LTRIGGER, "AXIS_LTRIGGER"); names.append(MotionEvent.AXIS_RTRIGGER, "AXIS_RTRIGGER"); names.append(MotionEvent.AXIS_THROTTLE, "AXIS_THROTTLE"); names.append(MotionEvent.AXIS_RUDDER, "AXIS_RUDDER"); names.append(MotionEvent.AXIS_WHEEL, "AXIS_WHEEL"); names.append(MotionEvent.AXIS_GAS, "AXIS_GAS"); names.append(MotionEvent.AXIS_BRAKE, "AXIS_BRAKE"); names.append(MotionEvent.AXIS_GENERIC_1, "AXIS_GENERIC_1"); names.append(MotionEvent.AXIS_GENERIC_2, "AXIS_GENERIC_2"); names.append(MotionEvent.AXIS_GENERIC_3, "AXIS_GENERIC_3"); names.append(MotionEvent.AXIS_GENERIC_4, "AXIS_GENERIC_4"); names.append(MotionEvent.AXIS_GENERIC_5, "AXIS_GENERIC_5"); names.append(MotionEvent.AXIS_GENERIC_6, "AXIS_GENERIC_6"); names.append(MotionEvent.AXIS_GENERIC_7, "AXIS_GENERIC_7"); names.append(MotionEvent.AXIS_GENERIC_8, "AXIS_GENERIC_8"); names.append(MotionEvent.AXIS_GENERIC_9, "AXIS_GENERIC_9"); names.append(MotionEvent.AXIS_GENERIC_10, "AXIS_GENERIC_10"); names.append(MotionEvent.AXIS_GENERIC_11, "AXIS_GENERIC_11"); names.append(MotionEvent.AXIS_GENERIC_12, "AXIS_GENERIC_12"); names.append(MotionEvent.AXIS_GENERIC_13, "AXIS_GENERIC_13"); names.append(MotionEvent.AXIS_GENERIC_14, "AXIS_GENERIC_14"); names.append(MotionEvent.AXIS_GENERIC_15, "AXIS_GENERIC_15"); names.append(MotionEvent.AXIS_GENERIC_16, "AXIS_GENERIC_16"); String axisName = names.get(axis); if (null == axisName) { return ""; } else { return axisName; } } public int debugGetKeyCode(String name) { if (name.equals("BUTTON_O")) { return OuyaController.BUTTON_O; } else if (name.equals("BUTTON_U")) { return OuyaController.BUTTON_U; } else if (name.equals("BUTTON_Y")) { return OuyaController.BUTTON_Y; } else if (name.equals("BUTTON_A")) { return OuyaController.BUTTON_A; } else if (name.equals("BUTTON_L1")) { return OuyaController.BUTTON_L1; } else if (name.equals("BUTTON_R1")) { return OuyaController.BUTTON_R1; } else if (name.equals("BUTTON_L3")) { return OuyaController.BUTTON_L3; } else if (name.equals("BUTTON_R3")) { return OuyaController.BUTTON_R3; } else if (name.equals("BUTTON_DPAD_UP")) { return OuyaController.BUTTON_DPAD_UP; } else if (name.equals("BUTTON_DPAD_DOWN")) { return OuyaController.BUTTON_DPAD_DOWN; } else if (name.equals("BUTTON_DPAD_RIGHT")) { return OuyaController.BUTTON_DPAD_RIGHT; } else if (name.equals("BUTTON_DPAD_LEFT")) { return OuyaController.BUTTON_DPAD_LEFT; } else if (name.equals("BUTTON_MENU")) { return OuyaController.BUTTON_MENU; } else { return 0; } } public static String debugGetKeyEvent(KeyEvent keyEvent) { int keyCode = keyEvent.getKeyCode(); switch (keyCode) { case OuyaController.BUTTON_O: return "OuyaController.BUTTON_O"; case OuyaController.BUTTON_U: return "OuyaController.BUTTON_U"; case OuyaController.BUTTON_Y: return "OuyaController.BUTTON_Y"; case OuyaController.BUTTON_A: return "OuyaController.BUTTON_A"; case OuyaController.BUTTON_L1: return "OuyaController.BUTTON_L1"; case OuyaController.BUTTON_R1: return "OuyaController.BUTTON_R1"; case OuyaController.BUTTON_L2: return "OuyaController.BUTTON_L2"; case OuyaController.BUTTON_R2: return "OuyaController.BUTTON_R2"; case OuyaController.BUTTON_L3: return "OuyaController.BUTTON_L3"; case OuyaController.BUTTON_R3: return "OuyaController.BUTTON_R3"; case OuyaController.BUTTON_DPAD_UP: return "OuyaController.BUTTON_DPAD_UP"; case OuyaController.BUTTON_DPAD_DOWN: return "OuyaController.BUTTON_DPAD_DOWN"; case OuyaController.BUTTON_DPAD_RIGHT: return "OuyaController.BUTTON_DPAD_RIGHT"; case OuyaController.BUTTON_DPAD_LEFT: return "OuyaController.BUTTON_DPAD_LEFT"; case OuyaController.BUTTON_MENU: return "OuyaController.BUTTON_MENU"; } return "UNKNOWN"; } public static String debugGetButtonName(int button) { SparseArray<String> names = new SparseArray<String>(); names.append(OuyaController.BUTTON_O, "BUTTON_O"); names.append(OuyaController.BUTTON_U, "BUTTON_U"); names.append(OuyaController.BUTTON_Y, "BUTTON_Y"); names.append(OuyaController.BUTTON_A, "BUTTON_A"); names.append(OuyaController.BUTTON_L1, "BUTTON_L1"); names.append(OuyaController.BUTTON_R1, "BUTTON_R1"); names.append(OuyaController.BUTTON_L3, "BUTTON_L3"); names.append(OuyaController.BUTTON_R3, "BUTTON_R3"); names.append(OuyaController.BUTTON_DPAD_UP, "BUTTON_DPAD_UP"); names.append(OuyaController.BUTTON_DPAD_DOWN, "BUTTON_DPAD_DOWN"); names.append(OuyaController.BUTTON_DPAD_RIGHT, "BUTTON_DPAD_RIGHT"); names.append(OuyaController.BUTTON_DPAD_LEFT, "BUTTON_DPAD_LEFT"); names.append(OuyaController.BUTTON_MENU, "BUTTON_MENU"); String buttonName = names.get(button); if (null == buttonName) { return ""; } else { return buttonName; } } public static void debugOuyaMotionEvent(MotionEvent motionEvent) { Log.i(TAG, "("+OuyaController.AXIS_LS_X + ") OuyaController.AXIS_LS_X value="+motionEvent.getAxisValue(OuyaController.AXIS_LS_X)); Log.i(TAG, "("+OuyaController.AXIS_LS_Y + ") OuyaController.AXIS_LS_Y value="+motionEvent.getAxisValue(OuyaController.AXIS_LS_Y)); Log.i(TAG, "("+OuyaController.AXIS_RS_X + ") OuyaController.AXIS_RS_X value="+motionEvent.getAxisValue(OuyaController.AXIS_RS_X)); Log.i(TAG, "("+OuyaController.AXIS_RS_Y + ") OuyaController.AXIS_RS_Y value="+motionEvent.getAxisValue(OuyaController.AXIS_RS_Y)); Log.i(TAG, "("+OuyaController.AXIS_L2 + ") OuyaController.AXIS_L2 value="+motionEvent.getAxisValue(OuyaController.AXIS_L2)); Log.i(TAG, "("+OuyaController.AXIS_R2 + ") OuyaController.AXIS_R2 value="+motionEvent.getAxisValue(OuyaController.AXIS_R2)); } public static void debugMotionEvent(MotionEvent motionEvent) { SparseArray<String> names = new SparseArray<String>(); names.append(MotionEvent.AXIS_X, "AXIS_X"); names.append(MotionEvent.AXIS_Y, "AXIS_Y"); names.append(MotionEvent.AXIS_PRESSURE, "AXIS_PRESSURE"); names.append(MotionEvent.AXIS_SIZE, "AXIS_SIZE"); names.append(MotionEvent.AXIS_TOUCH_MAJOR, "AXIS_TOUCH_MAJOR"); names.append(MotionEvent.AXIS_TOUCH_MINOR, "AXIS_TOUCH_MINOR"); names.append(MotionEvent.AXIS_TOOL_MAJOR, "AXIS_TOOL_MAJOR"); names.append(MotionEvent.AXIS_TOOL_MINOR, "AXIS_TOOL_MINOR"); names.append(MotionEvent.AXIS_ORIENTATION, "AXIS_ORIENTATION"); names.append(MotionEvent.AXIS_VSCROLL, "AXIS_VSCROLL"); names.append(MotionEvent.AXIS_HSCROLL, "AXIS_HSCROLL"); names.append(MotionEvent.AXIS_Z, "AXIS_Z"); names.append(MotionEvent.AXIS_RX, "AXIS_RX"); names.append(MotionEvent.AXIS_RY, "AXIS_RY"); names.append(MotionEvent.AXIS_RZ, "AXIS_RZ"); names.append(MotionEvent.AXIS_HAT_X, "AXIS_HAT_X"); names.append(MotionEvent.AXIS_HAT_Y, "AXIS_HAT_Y"); names.append(MotionEvent.AXIS_LTRIGGER, "AXIS_LTRIGGER"); names.append(MotionEvent.AXIS_RTRIGGER, "AXIS_RTRIGGER"); names.append(MotionEvent.AXIS_THROTTLE, "AXIS_THROTTLE"); names.append(MotionEvent.AXIS_RUDDER, "AXIS_RUDDER"); names.append(MotionEvent.AXIS_WHEEL, "AXIS_WHEEL"); names.append(MotionEvent.AXIS_GAS, "AXIS_GAS"); names.append(MotionEvent.AXIS_BRAKE, "AXIS_BRAKE"); names.append(MotionEvent.AXIS_GENERIC_1, "AXIS_GENERIC_1"); names.append(MotionEvent.AXIS_GENERIC_2, "AXIS_GENERIC_2"); names.append(MotionEvent.AXIS_GENERIC_3, "AXIS_GENERIC_3"); names.append(MotionEvent.AXIS_GENERIC_4, "AXIS_GENERIC_4"); names.append(MotionEvent.AXIS_GENERIC_5, "AXIS_GENERIC_5"); names.append(MotionEvent.AXIS_GENERIC_6, "AXIS_GENERIC_6"); names.append(MotionEvent.AXIS_GENERIC_7, "AXIS_GENERIC_7"); names.append(MotionEvent.AXIS_GENERIC_8, "AXIS_GENERIC_8"); names.append(MotionEvent.AXIS_GENERIC_9, "AXIS_GENERIC_9"); names.append(MotionEvent.AXIS_GENERIC_10, "AXIS_GENERIC_10"); names.append(MotionEvent.AXIS_GENERIC_11, "AXIS_GENERIC_11"); names.append(MotionEvent.AXIS_GENERIC_12, "AXIS_GENERIC_12"); names.append(MotionEvent.AXIS_GENERIC_13, "AXIS_GENERIC_13"); names.append(MotionEvent.AXIS_GENERIC_14, "AXIS_GENERIC_14"); names.append(MotionEvent.AXIS_GENERIC_15, "AXIS_GENERIC_15"); names.append(MotionEvent.AXIS_GENERIC_16, "AXIS_GENERIC_16"); int source = motionEvent.getSource(); final int count = names.size(); for (int i = 0; i < count; i++) { float val = motionEvent.getAxisValue(names.keyAt(i)); Log.i(TAG, "(" + names.keyAt(i) + ") "+ names.valueAt(i) + "=" + val + " source="+source); } } }
[ "tgraupmann@gmail.com" ]
tgraupmann@gmail.com
e7f87d0d4217f1b3c6653dec94b7ec7f75631368
50d059771aa03e3d9d35457b40d84f1900a1df23
/src/main/java/com/company/shop/controller/BookController.java
ec3e21016cced6565fb5c4b904dd067551281f20
[]
no_license
ilya-as/BookShop
1508b9d167c93aa53a16361aedec874e9e7b9302
f4bf6b09968aa3a7401f165321a72ae3cd3b253c
refs/heads/main
2022-12-26T05:57:34.794883
2020-10-12T07:46:50
2020-10-12T07:46:50
303,304,749
0
0
null
null
null
null
UTF-8
Java
false
false
2,857
java
package com.company.shop.controller; import com.company.shop.dto.BookDTO; import com.company.shop.dto.BookMapper; import com.company.shop.model.Book; import com.company.shop.service.IBookService; import com.company.shop.util.Filter; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Sort; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import java.util.List; import java.util.stream.Collectors; import java.util.stream.StreamSupport; @RestController @RequestMapping(value = "/book") public class BookController { private IBookService bookService; private BookMapper bookMapper; public BookController(IBookService bookService, BookMapper bookMapper) { this.bookService = bookService; this.bookMapper = bookMapper; } @GetMapping("/all") public ResponseEntity<List<BookDTO>> getAllBooks() { Iterable<Book> books = bookService.getAllBooks(); List<BookDTO> bookDTOList =StreamSupport.stream(books.spliterator(), false) .map(bookMapper::mapModelToDto) .collect(Collectors.toList()); return ResponseEntity.ok(bookDTOList); } @PostMapping("/add") public ResponseEntity<BookDTO> addBook(@RequestBody BookDTO bookDTO) { BookDTO createdBook = bookMapper.mapModelToDto(bookService.saveBook(bookMapper.mapDtoToModel(bookDTO))); return new ResponseEntity<>(createdBook, HttpStatus.CREATED); } @PutMapping("/update/{id}") public ResponseEntity<BookDTO> updateBook(@PathVariable(name = "id") Long bookId, @RequestBody BookDTO bookDTO) { BookDTO updatedBook = bookMapper.mapModelToDto(bookService.updateBook(bookId, bookMapper.mapDtoToModel(bookDTO))); return ResponseEntity.ok(updatedBook); } @DeleteMapping("/delete/{id}") public ResponseEntity<String> deleteBook(@PathVariable(name = "id") Long bookId) { String message = bookService.deleteBook(bookId); return new ResponseEntity<>(message, HttpStatus.OK); } @GetMapping("/filter") public ResponseEntity<List<BookDTO>> getByFilter(@RequestBody Filter filter, @RequestParam(defaultValue = "0") int page, @RequestParam(defaultValue = "3") int size) { Pageable paging = PageRequest.of(page, size, Sort.by("title")); Iterable<Book> books = bookService.getByFilter(filter, paging); List<BookDTO> bookDTOList =StreamSupport.stream(books.spliterator(), false) .map(bookMapper::mapModelToDto) .collect(Collectors.toList()); return ResponseEntity.ok(bookDTOList); } }
[ "aslamovi@gmail.com" ]
aslamovi@gmail.com
5508c751716842760608e6a8bdf21bfd63dde940
4a29bfe62aac3dc712faca2526f85cbd570238fb
/src/main/java/com/group3/group3/repository/RoleRepository.java
65b237a380fb9d182f2220d7f33a7a0945239c8f
[]
no_license
puck-ini/group3
c8ea175cde2d21057baf344f67b1bff5236a87ac
da5a0366291a292135ba49f1dea9979c620546bc
refs/heads/master
2020-08-26T13:13:04.653259
2019-11-03T16:01:19
2019-11-03T16:01:19
217,022,015
0
0
null
null
null
null
UTF-8
Java
false
false
216
java
package com.group3.group3.repository; import com.group3.group3.entity.user.Role; import org.springframework.data.jpa.repository.JpaRepository; public interface RoleRepository extends JpaRepository<Role,Integer>{ }
[ "825597202@qq.com" ]
825597202@qq.com
5384cf8644ddcd754e7a298d47e9fd8491073faa
866db9fce24e643c4798ad30a9d815e6cf1d7974
/day15_集合框架/src/itcast_01/CollectionDemo2.java
6afee555e018efe5bc11f69f78e4b781aa46810d
[]
no_license
huangjianhehehe/java
4cad36069ecf240309a45031ab8b2717897dd6e2
70f92561d0346a8de3c7547ab3d854ace32da5a1
refs/heads/master
2020-03-28T05:33:10.139290
2018-10-23T07:18:56
2018-10-23T07:18:56
147,783,390
0
0
null
null
null
null
UTF-8
Java
false
false
453
java
package itcast_01; import java.util.ArrayList; import java.util.Collection; public class CollectionDemo2 { public static void main(String[] args) { Collection c1 = new ArrayList(); c1.add("abc1"); c1.add("abc2"); c1.add("abc3"); c1.add("abc4"); Collection c2= new ArrayList(); c2.add("abc4"); c2.add("abc5"); System.out.println("retainAll:"+c1.retainAll(c2)); System.out.println("c1:"+c1); System.out.println("c2:"+c2); } }
[ "786762595@qq.com" ]
786762595@qq.com
440a6a68d0f27977543bbc260e9ab32330fe920a
ff7115e76b285a08e0126ddb5e3156f122b03537
/scr/main/java/compactedDesign/invitedMeetingScheduler/controllers/popup/CreateSchedulesPopUpViewController.java
735920fb99bdfe777ee06bbcfe3e2c369062cc1f
[]
no_license
Compacted-Design/Invited-Meeting-Scheduler
5df1cf32f2423f1694efcdf92992440f0b722f9d
f0d11b6ec4fd038990e26545241f796de5cd48c0
refs/heads/master
2022-11-04T17:26:06.569003
2020-06-13T20:47:19
2020-06-13T20:47:19
261,092,424
1
0
null
null
null
null
UTF-8
Java
false
false
3,680
java
package compactedDesign.invitedMeetingScheduler.controllers.popup; import java.io.IOException; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import com.google.zxing.WriterException; import compactedDesign.invitedMeetingScheduler.IMSLauncher; import javafx.fxml.FXML; import javafx.scene.canvas.Canvas; import javafx.scene.canvas.GraphicsContext; import javafx.scene.control.Label; import javafx.scene.layout.Pane; import javafx.scene.paint.Paint; import javafx.scene.text.Font; import javafx.scene.text.TextAlignment; public class CreateSchedulesPopUpViewController { @FXML private Label informationLabel; @FXML private Pane root; @FXML private Canvas loadingBar; private GraphicsContext gc; @FXML private void initialize() { gc = loadingBar.getGraphicsContext2D(); Thread threadULB = new Thread(new UpdateLoadingBar()); threadULB.start(); Thread threadCS = new Thread(new CreateSchedulesThread()); threadCS.start(); } private class UpdateLoadingBar implements Runnable { private final double UPDATE_CAP = 1.0/59.95; //this caps updates and rendering to 60 times a second private int cap = -1; public void init() { cap = IMSLauncher.getDl().getStudents().size(); } @Override public void run() { init(); boolean render = false; double currentTime = 0 , previousTime = System.nanoTime() / Math.pow(10,9); //nano to seconds double elapsedTime = 0 , unprocessedTime = 0; //counting frames and frame rate double frameTime = 0; gc.setFill(Paint.valueOf("Green")); while(IMSLauncher.getDl().getSchedulesCompleted() < cap) { render = false; //resets render | change this to true to see effect when the fps isn't locked //Time between processes currentTime = System.nanoTime() / Math.pow(10,9); elapsedTime = currentTime - previousTime; previousTime = currentTime; unprocessedTime += elapsedTime; frameTime += elapsedTime; while(unprocessedTime >= UPDATE_CAP) { unprocessedTime -= UPDATE_CAP; //resents unprocessedTime render = true; if(frameTime >= 1.0) { //resets frames after 60 frameTime = 0; } } if(render) { gc.clearRect(0, 0, loadingBar.getWidth(), loadingBar.getHeight()); gc.setFill(Paint.valueOf("Cyan")); gc.fillRect(0, 0, loadingBar.getWidth()*(IMSLauncher.getDl().getSchedulesCompleted()), loadingBar.getHeight()); gc.setFill(Paint.valueOf("Green")); gc.fillRect(0, 0, loadingBar.getWidth()*(IMSLauncher.getDl().getSchedulesCompleted()*1.0/cap), loadingBar.getHeight()); }else { try {Thread.sleep(1); } catch (InterruptedException e) {e.printStackTrace();} //puts the thread to sleep for 1 millisecond to free up the processor a bit. This is because there is nothing to do, nothing is being rendered. } } informationLabel.setVisible(false); informationLabel.setDisable(true); gc.clearRect(0, 0, loadingBar.getWidth(), loadingBar.getHeight()); gc.setFill(Paint.valueOf("Black")); gc.setFont(new Font(14)); gc.setTextAlign(TextAlignment.CENTER); gc.fillText("Schedules have been Created", 100, 10); } } private class CreateSchedulesThread implements Runnable{ @Override public void run() { try { IMSLauncher.getDl().createSchedules(); } catch (InvalidFormatException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (WriterException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } }
[ "43833907+MechaDL7@users.noreply.github.com" ]
43833907+MechaDL7@users.noreply.github.com
95d5664238cc6a6cfb358ec610cb7a4b3872fb96
3cd8ad76778ddabfd62414b2bf044def955d0d88
/pw-new/ylb-ticket-service/src/main/java/com/ectrip/ticket/provider/service/impl/EsbticketWinService.java
dccaf39d852e221c4754449be89ee1ca890dc0bc
[]
no_license
dbc1024/demos
65f640eb6bbc5b6476645eeb7c42c28e7218f6cb
ebbe48de090af138f55e8a1923768328452f1d69
refs/heads/master
2020-03-30T19:08:35.871801
2019-05-08T03:14:59
2019-05-08T03:14:59
151,530,128
1
3
null
null
null
null
UTF-8
Java
false
false
6,487
java
package com.ectrip.ticket.provider.service.impl; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Isolation; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import com.ectrip.base.service.GenericService; import com.ectrip.base.util.PaginationSupport; import com.ectrip.sys.model.syspar.Syslog; import com.ectrip.ticket.model.provider.Esbticketwintab; import com.ectrip.ticket.model.salesmanager.Ospticketwinlimitstab; import com.ectrip.ticket.provider.dao.IEsbticketWinDAO; import com.ectrip.ticket.provider.service.IEsbticketWinService; /** * @author lizd * */ /** * @author lizd * */ /** * @author lizd * */ @Service @Transactional(propagation=Propagation.SUPPORTS,readOnly=true) public class EsbticketWinService extends GenericService implements IEsbticketWinService{ private IEsbticketWinDAO esbwinDao; /** * * * Describe:显示所有的售票窗口信息 根据窗口名称查询 * @see com.ectrip.system.provider.service.iservice.IEsbticketWinService#getlistTicketWin(java.lang.String, int, int, java.lang.String) * @param szticketwinname * @param pageSize * @param startIndex * @param url * @return * @author lijingrui * Date:2011-10-4 */ public PaginationSupport getlistTicketWin(String szticketwinname,String scenics, int pageSize, int startIndex, String url) { return esbwinDao.getlistTicketWin(szticketwinname,scenics, pageSize, startIndex, url); } /** * * * Describe:添加售票窗口 * @see com.ectrip.system.provider.dao.idao.IEsbticketWinDAO#insertTicketWin(com.ectrip.model.provider.Esbticketwintab, com.ectrip.model.syspar.Syslog) * @param ticketwin * @param syslog * @author lijingrui * Date:2011-10-4 */ @Transactional(propagation=Propagation.REQUIRED,readOnly=false,isolation = Isolation.READ_COMMITTED,rollbackFor=Exception.class) public void insertTicketWin(Esbticketwintab ticketwin, Syslog syslog) { esbwinDao.insertTicketWin(ticketwin, syslog); } /** * * * Describe:修改售票窗口 * @see com.ectrip.system.provider.dao.idao.IEsbticketWinDAO#updateTicketWin(com.ectrip.model.provider.Esbticketwintab, com.ectrip.model.syspar.Syslog) * @param ticketwin * @param syslog * @author lijingrui * Date:2011-10-4 */ @Transactional(propagation=Propagation.REQUIRED,readOnly=false,isolation = Isolation.READ_COMMITTED,rollbackFor=Exception.class) public void updateTicketWin(Esbticketwintab ticketwin, Syslog syslog) { esbwinDao.updateTicketWin(ticketwin, syslog); } /** * * * Describe:删除售票窗口 * @see com.ectrip.system.provider.dao.idao.IEsbticketWinDAO#deleteTicketWin(com.ectrip.model.provider.Esbticketwintab, com.ectrip.model.syspar.Syslog) * @param ticketwin * @param syslog * @author lijingrui * Date:2011-10-4 */ @Transactional(propagation=Propagation.REQUIRED,readOnly=false,isolation = Isolation.READ_COMMITTED,rollbackFor=Exception.class) public void deleteTicketWin(Esbticketwintab ticketwin, Syslog syslog) { esbwinDao.deleteTicketWin(ticketwin, syslog); } /** * * * Describe:根据ID查看售票窗口信息 * @see com.ectrip.system.provider.dao.idao.IEsbticketWinDAO#getviewEsbticketWin(java.lang.Long) * @param iticketwinid * @return * @author lijingrui * Date:2011-10-4 */ public Esbticketwintab getviewEsbticketWin(Long iticketwinid) throws Exception{ return esbwinDao.getviewEsbticketWin(iticketwinid); } /** * * * Describe:根据服务商id查看所有售票窗口信息 * @see com.ectrip.system.provider.dao.idao.IEsbticketWinDAO#reviters() * @return * @author lijingrui * Date:2011-10-4 */ public List<Esbticketwintab> findListesbticket(String scenics) { return esbwinDao.findListesbticket(scenics); } /** * * * Describe:根据售票ID查询 * @see com.ectrip.system.provider.service.iservice.IEsbticketWinService#getiiticketID(java.lang.Long) * @param iticketwinid * @return * @author lijingrui * Date:2011-10-5 */ public Esbticketwintab getszIpassword(String szipaddress) { return esbwinDao.getszIpassword(szipaddress); } /** * 获取销售权限列表 根据窗口Id查询权限 */ public PaginationSupport getWinPermissionByIticketWinId(Long iticketWinId,int page,int pageSize) { return esbwinDao.getWinPermissionByIticketWinId(iticketWinId,page,pageSize); } /** * 添加窗口售票权限 */ @Transactional(propagation=Propagation.REQUIRED, readOnly=false,isolation = Isolation.READ_COMMITTED,rollbackFor=Exception.class) public void addWinPermission(Long Iticketwinid,String Icrowdkindpriceids,Syslog syslog) { esbwinDao.addWinPermission(Iticketwinid,Icrowdkindpriceids,syslog); } /** * 修改窗口售票权限 */ @Transactional(propagation=Propagation.REQUIRED, readOnly=false,isolation = Isolation.READ_COMMITTED,rollbackFor=Exception.class) public void updateTicketWinLimits(Long Iticketwinid,String Icrowdkindpriceids,Syslog syslog) { esbwinDao.updateTicketWinLimits(Iticketwinid,Icrowdkindpriceids,syslog); } /** * 删除窗口售票权限 */ @Transactional(propagation=Propagation.REQUIRED, readOnly=false,isolation = Isolation.READ_COMMITTED,rollbackFor=Exception.class) public void deleteTicketWinLimits(Long iticketwinlimitsId, Syslog syslog) { esbwinDao.deleteTicketWinLimits(iticketwinlimitsId,syslog); } /** * 查看有效的窗口 * Describe: * @auth:huangyuqi * @param employeeId后台登录人id * @return * return:List * Date:2011-10-6 */ public List getAllTicketWinList(Long employeeId){ return esbwinDao.getAllTicketWinList(employeeId); } /** * * * Describe:判断此售票窗口下是否有窗口设置 * @see com.ectrip.system.permitenter.service.iservice.IOpwwicketSetService#getlistEsbticketequied(java.lang.Long) * @param iticketwinid * @return * @author lijingrui * Date:2011-10-14 */ public boolean getlistEsbticketequied(Long iticketwinid) { return esbwinDao.getlistEsbticketequied(iticketwinid); } public IEsbticketWinDAO getEsbwinDao() { return esbwinDao; } @Autowired public void setEsbwinDao(IEsbticketWinDAO esbwinDao) { this.esbwinDao = esbwinDao; setGenericDao(esbwinDao); } @Override public void getTicketWinLimitsList(Long Iticketwinid) { // TODO Auto-generated method stub } }
[ "cy991587100@163.com" ]
cy991587100@163.com
14e299353c88ab1c9b9436d70df6c6fba2555539
3cf0d527b95bbb9599d5855ea042994a269d7b4a
/src/main/java/cn/EdocManagement/pojo/edoc_category.java
62c7ecb3882b237a8e6969b37802b3f2451366f9
[]
no_license
wuzhubin222/EdocManagement
3c9bceb1507de93e0587736a5a1caeb679d2e608
ee9ab0e95089da7cf2ede2b597fae220c7610d9f
refs/heads/master
2020-05-24T06:29:26.746221
2019-05-17T07:41:52
2019-05-17T07:41:52
187,138,818
0
0
null
null
null
null
UTF-8
Java
false
false
365
java
package cn.EdocManagement.pojo; public class edoc_category { private Integer id; private String name; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } }
[ "zhubinwu@aliyun.com" ]
zhubinwu@aliyun.com
442deb3c7fcc216869a66c0bc528d303a0ab5fcb
ddb23d1354710ec32f6137275729bca4d8257b60
/Basic Java/Podstawowe wejscie wyjscie/src/Zadanie_Do_While.java
608d5dfa980e0a344af3c0c43bb5e3ff2ef0f231
[]
no_license
Mluszczewski/Java
562da15e395c9ee6f7d739bbc7dc5f6dbad58d2b
d9c4fa7c76f7722888b5f36970d5731e42aad291
refs/heads/master
2021-04-29T17:40:41.091183
2018-08-14T08:22:49
2018-08-14T08:22:49
121,676,216
0
0
null
null
null
null
UTF-8
Java
false
false
376
java
import java.util.Scanner; public class Zadanie_Do_While { public static void main(String[] args) { Scanner scan = new Scanner(System.in); System.out.print("Set the bomb timer: "); int x = scan.nextInt(); do { System.out.println("Bomb will detonate in: "+x+"!"); x--; } while(x>0); System.out.println("Bomb detonaded!"); } }
[ "noreply@github.com" ]
noreply@github.com