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
0ca1b303ec383e340cbfea752765436496374d92
eff7691f69f594fcda02b1ee96de30b57a45ff2e
/src/main/java/two/davincing/renderer/PieceRenderer.java
69df646e86fc63c81b4323ce2f1b9f2aa163592e
[ "MIT" ]
permissive
baipgej222/DaVincing
df446db4f16e63194b547a42afd3b0fab945af19
a4f43852106b82935530f756a660a3a1d7f62ae7
refs/heads/master
2021-01-16T22:10:03.819406
2016-01-06T20:59:48
2016-01-06T20:59:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,477
java
package two.davincing.renderer; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.client.IItemRenderer; import org.lwjgl.opengl.GL11; import two.davincing.DaVincing; import two.davincing.ProxyBase; import two.davincing.item.PieceItem; import two.davincing.sculpture.SculptureBlock; import two.davincing.utils.Utils; @SideOnly(Side.CLIENT) public class PieceRenderer implements IItemRenderer { protected static final Minecraft mc = Minecraft.getMinecraft(); protected final RenderItem renderItem = new RenderItem(); protected ItemStack is; @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { return type == ItemRenderType.INVENTORY || type == ItemRenderType.ENTITY || type == ItemRenderType.EQUIPPED || type == ItemRenderType.EQUIPPED_FIRST_PERSON; } @Override public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { return type == ItemRenderType.ENTITY || type == ItemRenderType.EQUIPPED_FIRST_PERSON; } @Override public void renderItem(ItemRenderType type, ItemStack itemStack, Object... data) { if (is == null) { is = new ItemStack(ProxyBase.blockSculpture.getBlock()); } SculptureBlock sculpture = ProxyBase.blockSculpture.getBlock(); final Item item = itemStack.getItem(); if (item instanceof PieceItem) { final PieceItem piece = (PieceItem) item; sculpture.setCurrentBlock(piece.getEditBlock(itemStack), piece.getEditMeta(itemStack)); setBounds(sculpture); if (type == ItemRenderType.INVENTORY) { RenderHelper.enableGUIStandardItemLighting(); renderItem.renderItemIntoGUI( Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().renderEngine, is, 0, 0); } else if (type == ItemRenderType.ENTITY) { // EntityItem eis = (EntityItem) data[1]; GL11.glScalef(.5f, .5f, .5f); mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture); RenderBlocks rb = (RenderBlocks) (data[0]); rb.renderBlockAsItem(sculpture, 0, 1f); } else { Minecraft.getMinecraft().entityRenderer.itemRenderer.renderItem((EntityLivingBase) data[1], is, 0, type); } sculpture.setCurrentBlock(null, 0); sculpture.setBlockBounds(0, 0, 0, 1, 1, 1); } else { DaVincing.log.warn("[PieceRenderer.renderItem] failed: expected PieceItem, but got %s", Utils.getClassName(item)); } } protected void setBounds(SculptureBlock sculpture) { sculpture.setBlockBounds(0.3f, 0.3f, 0.3f, 0.7f, 0.7f, 0.7f); } public static class Bar extends PieceRenderer { @Override protected void setBounds(SculptureBlock sculpture) { sculpture.setBlockBounds(0.3f, 0.0f, 0.3f, 0.7f, 1.0f, 0.7f); } } public static class Cover extends PieceRenderer { @Override protected void setBounds(SculptureBlock sculpture) { sculpture.setBlockBounds(0.3f, 0.0f, 0.0f, 0.7f, 1.0f, 1.0f); } } }
[ "sfeldbin@googlemail.com" ]
sfeldbin@googlemail.com
d55be3e53954cc125bdf71889fe061fb31ab8981
cfcc139eb128d402ba786181bc31384411f79a9e
/java8/src/main/java/com/haojg/java8/test05/Car.java
13f84de470a3f93b85ff71a520e351d6a4a3838c
[]
no_license
zhaofeng555/InterviewSample
0c07af40aff5e9746340822f42eb575afa7de35c
329a33348e0c73b199894401cf00dc4af1039029
refs/heads/master
2022-07-02T01:42:43.373752
2019-09-21T10:23:38
2019-09-21T10:23:38
139,321,604
0
0
null
2022-06-29T19:31:18
2018-07-01T10:59:19
Java
UTF-8
Java
false
false
536
java
package com.haojg.java8.test05; class Car { //Supplier是jdk1.8的接口,这里和lamda一起使用了 public static Car create(final Supplier<Car> supplier) { return supplier.get(); } public static void collide(final Car car) { System.out.println("Collided " + car.toString()); } public void follow(final Car another) { System.out.println("Following the " + another.toString()); } public void repair() { System.out.println("Repaired " + this.toString()); } }
[ "haojianguo@aibank.com" ]
haojianguo@aibank.com
806d4552c01b22d711418ac46d4a4eac0eb45cdc
b8c3a00e14b49664c2e39a69edd32f002540c685
/Strings/StringRipper.java
0d7877a97bf6949bfdd5d83c2466331df4e13a2f
[]
no_license
annapeterson816/APCS
32171929f1e53e212abc1d9c458fb5b266c5c7d5
7e9c714c2a214ece7740f4482a4dc5b54438efd9
refs/heads/master
2020-08-04T13:15:48.403069
2019-10-08T17:07:31
2019-10-08T17:07:31
212,148,896
1
0
null
null
null
null
UTF-8
Java
false
false
379
java
package Strings; import static java.lang.System.*; public class StringRipper { private String word; public StringRipper() { } public StringRipper(String s) { word=s; } public void setString(String s) { word=s; } public String ripString(int x, int y) { return word.substring(x, y); } public String toString() { return word +"\n\n"; } }
[ "annapeterson816@gmail.com" ]
annapeterson816@gmail.com
b015da966c03d6a5123cfb21fb80656a78b48686
3d3f658f1a8cfeb040df4a407ed80f59959c1fda
/src/gui/Draw.java
c315246b991698640802896a6566bd52ae2cd12b
[]
no_license
errorsHurt/Snake
36e14f6d68cfc5167d2ce7339ffb36b653aba6d1
7c1004e4b81066eb3dc24da0f21bf09748feb822
refs/heads/master
2023-05-27T00:51:56.726592
2021-06-12T18:30:25
2021-06-12T18:30:25
285,028,787
0
0
null
null
null
null
UTF-8
Java
false
false
4,583
java
package gui; import clocks.GameClock; import database.DataAccess; import game.Snake; import javax.swing.*; import java.awt.*; public class Draw extends JLabel { Point p; double firstFrame; int frames; double currentFrame; int fps; /* public float fpsCap = 60; public float timePerFrameInSeconds = 1 / fpsCap; //time per frame in seconds public float timePerFrameInNanos = timePerFrameInSeconds * 1000000000; public double nowTime = 0; public double preTime = 0; public double timeDif = 0; */ @Override protected void paintComponent(Graphics g) { super.paintComponent(g); //init Graphics initG2D(g); //Draw Background drawBackground(g); //Draw snaktails drawSnakeTails(g); //Draw Snake Head drawSnakeHead(g); //Draw PickUp drawPickUp(g); drawMultiplicator(g); //Draw Grid drawGrid(g); //Draw Border drawBorder(g); //nun in paint() / update() bzw. paintComponent() ... calculateFramesPerSecond(); //Draw other information drawGameInformations(g); drawScoreBoard(g); //setFrameCapture(); repaint(); } private void initG2D(Graphics g) { Graphics2D g2d = (Graphics2D) g; g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); } private void drawBackground(Graphics g) { g.setColor(Color.lightGray); g.fillRect(0, 0, Gui.width, Gui.height); } private void drawSnakeTails(Graphics g) { g.setColor(new Color(51, 204, 51)); for (int i = 0; i < Snake.tails.size(); i++) { p = Snake.ptc(Snake.tails.get(i).getX(), Snake.tails.get(i).getY()); g.fillRect(p.x, p.y, 32, 32); } } private void drawSnakeHead(Graphics g) { g.setColor(new Color(0, 153, 0)); p = Snake.ptc(Snake.head.getX(), Snake.head.getY()); g.fillRect(p.x, p.y, 32, 32); } private void drawPickUp(Graphics g) { g.setColor(new Color(204, 51, 0)); p = Snake.ptc(Snake.pickup.getX(), Snake.pickup.getY()); g.fillRect(p.x, p.y, 32, 32); } private void drawMultiplicator(Graphics g) { if (Snake.score % 5 == 0) { //Draw Mulitplikator g.setColor(new Color(239, 216, 12)); p = Snake.ptc(Snake.multiplier.getX(), Snake.multiplier.getY()); g.fillRect(p.x, p.y, 32, 32); } } private void drawGrid(Graphics g) { g.setColor(Color.gray); for (int i = 0; i < 16; i++) { for (int j = 0; j < 16; j++) { g.drawRect(i * 32 + Gui.xoff, j * 32 + Gui.yoff, 32, 32); } } } private void drawBorder(Graphics g) { g.setColor(Color.black); g.drawRect(Gui.xoff, Gui.yoff, 512, 512); } private void calculateFramesPerSecond() { frames++; currentFrame = System.currentTimeMillis(); if (currentFrame > firstFrame + 1000) { firstFrame = currentFrame; fps = frames; frames = 0; } } private void drawGameInformations(Graphics g) { g.setFont(new Font("Arial", Font.BOLD, 20)); g.drawString("Player: " + Login.playerName, 5, 25); g.drawString("Score: " + Snake.score, 5, 50); g.drawString("Velocity: " + GameClock.velocity, 5, 75); g.drawString("FPS: " + fps, 5, 100); } public void drawScoreBoard(Graphics g) { for (int i = 0; i < DataAccess.getPlayerCount(); i++) { g.drawString((i + 1) + "st: " + DataAccess.getLeaderboard()[i], 730, 25 + i * 25); } } /* private void setFrameCapture() { do{ preTime = nowTime; nowTime = System.nanoTime(); timeDif = nowTime - preTime; //time difference in nanos System.out.println("PreTime: " + preTime + " ns"); System.out.println("NowTime: " + nowTime + " ns"); System.out.println("Time allready over: " + (timePerFrameInNanos - timeDif) + " ns"); System.out.println("Time to wait from here: " + timeDif + " ns"); System.out.println("timePerFrameInSeconds: " + timePerFrameInSeconds + " s"); System.out.println("timePerFrameInNanos: " + timePerFrameInNanos + " ns"); System.out.println(); }while(timeDif < (timePerFrameInNanos - timeDif)); } */ }
[ "maximilianeias.meier@web.de" ]
maximilianeias.meier@web.de
8d9cd88e7fb159bb43f6d3af890964dd2ef2a17e
6a5f0cee7d978d7a321950c95cb28f32edc72cf2
/Android/src/com/neo/infocommunicate/task/GetReceiverListTask.java
8dfd0363c01c73cbe44eff70555977b0c3cce04a
[]
no_license
theoneneo/InfoCommunicate
3ba200c1e6b163bfc70ef6f8357b9ede97ba6a4d
24e22320ae219cb4b5fb9c0e446c597e93cbfb7c
refs/heads/master
2020-04-01T22:18:27.909267
2014-06-11T06:41:26
2014-06-11T06:41:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,530
java
package com.neo.infocommunicate.task; import org.json.JSONException; import com.neo.infocommunicate.controller.ServiceManager; import com.neo.infocommunicate.event.ServiceEvent; import com.neo.infocommunicate.protocol.ProtocolDataInput; import com.neo.tools.DHttpClient; import de.greenrobot.event.EventBus; import android.os.AsyncTask; /** * @author LiuBing * @version 2014-4-2 下午2:27:16 */ public class GetReceiverListTask extends AsyncTask<String, Integer, String> { // onPreExecute方法用于在执行后台任务前做一些UI操作 @Override protected void onPreExecute() { } // doInBackground方法内部执行后台任务,不可在此方法内修改UI @Override protected String doInBackground(String... params) { DHttpClient client = new DHttpClient(); String msg = client.post(params[0], params[1]); String result = null; try { result = ProtocolDataInput.parseReceiverListFromJSON(msg); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } return result; } // onProgressUpdate方法用于更新进度信息 @Override protected void onProgressUpdate(Integer... progresses) { } // onPostExecute方法用于在执行完后台任务后更新UI,显示结果 @Override protected void onPostExecute(String result) { EventBus.getDefault() .post(new ServiceEvent(ServiceEvent.SERVICE_GET_USERID_EVENT, result)); } // onCancelled方法用于在取消执行中的任务时更改UI @Override protected void onCancelled() { } }
[ "bing.liu@liubing-pc.autonavi.com" ]
bing.liu@liubing-pc.autonavi.com
e56c93a24a4d2ebb1ef5b9bc286795334c1812d6
38c5836e5128b073d1e81737b924b92ba40b0d96
/src/main/java/universidad/personal/Estudiante.java
6ad04932330cb84dd6e1a9d0a95ea8ab58cc8d80
[]
no_license
sanrinconr/intellij
a28dd51be8221eebe5d614515d745903cba30a9f
f7ed527486318b609a2a1116dc7719475706cef5
refs/heads/master
2023-04-25T20:40:22.951484
2021-05-29T03:27:18
2021-05-29T03:27:18
371,870,737
0
0
null
null
null
null
UTF-8
Java
false
false
445
java
package universidad.personal; import universidad.infraestructura.Universidad; public class Estudiante extends Persona implements Saludo { Universidad universidad; public Estudiante(String nombre, String ID, Universidad universidad){ super(nombre, ID); this.universidad = universidad; } @Override public String saludar() { return "Hola soy un estudiante de la u: "+universidad.getNombre(); } }
[ "santiagorincon2001@gmail.com" ]
santiagorincon2001@gmail.com
13888dd6c28b59e81d122419a3ef8fd222864796
c6992ce8db7e5aab6fd959c0c448659ab91b16ce
/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/samples/java/com/azure/resourcemanager/hybridnetwork/VendorSkusGetSamples.java
5fc89a57a7382a0c6aef3dfc8664c6b0dbd916a4
[ "MIT", "LicenseRef-scancode-generic-cla", "LicenseRef-scancode-warranty-disclaimer", "BSD-3-Clause", "CC0-1.0", "Apache-2.0", "LicenseRef-scancode-public-domain", "BSD-2-Clause", "LicenseRef-scancode-unknown-license-reference", "LGPL-2.1-or-later" ]
permissive
g2vinay/azure-sdk-for-java
ae6d94d583cc2983a5088ec8f6146744ee82cb55
b88918a2ba0c3b3e88a36c985e6f83fc2bae2af2
refs/heads/master
2023-09-01T17:46:08.256214
2021-09-23T22:20:20
2021-09-23T22:20:20
161,234,198
3
1
MIT
2020-01-16T20:22:43
2018-12-10T20:44:41
Java
UTF-8
Java
false
false
669
java
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.hybridnetwork; import com.azure.core.util.Context; /** Samples for VendorSkus Get. */ public final class VendorSkusGetSamples { /** * Sample code: Get the sku of vendor resource. * * @param manager Entry point to HybridNetworkManager. */ public static void getTheSkuOfVendorResource(com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager) { manager.vendorSkus().getWithResponse("TestVendor", "TestSku", Context.NONE); } }
[ "noreply@github.com" ]
noreply@github.com
d89f64623396968ae9ccb029565e5938d70a74a4
d0dabbabababe08f0fe042eb43f8dc3309dd5943
/newbasemodule/src/main/java/com/ottapp/android/basemodule/dao/task/categoryassosiation/DeleteAssosiationTask.java
ff5267c792e81b0eadaa235be276428c3002a26e
[]
no_license
AnjuJohnson/24-NEWS-APP
43f62ad5bf1dd63c60bb238a64d055ab5c248ace
3e26b1b524cd3722be5bd64090a785b7852454c7
refs/heads/master
2023-01-14T06:21:43.465360
2020-11-05T14:56:53
2020-11-05T14:56:53
269,237,224
0
0
null
null
null
null
UTF-8
Java
false
false
852
java
package com.ottapp.android.basemodule.dao.task.categoryassosiation; import android.os.AsyncTask; import com.ottapp.android.basemodule.dao.CategoryAssosiationDataDao; import com.ottapp.android.basemodule.models.CategoryAssosiationDataModel; public class DeleteAssosiationTask extends AsyncTask<CategoryAssosiationDataModel, Void, Boolean> { private CategoryAssosiationDataDao assosiationDataDao; public DeleteAssosiationTask(CategoryAssosiationDataDao assosiationDataDao) { this.assosiationDataDao = assosiationDataDao; } @Override protected Boolean doInBackground(CategoryAssosiationDataModel... models) { try { assosiationDataDao.delete(models[0]); return true; } catch (Exception ignored) { ignored.printStackTrace(); return false; } } }
[ "vishnuraj.pr@bitryt.com" ]
vishnuraj.pr@bitryt.com
a49766e7987c5d90e1d026342233727c795e1ff2
63113df25e2b34e8c72cc3cb1558370eda372c51
/app/src/main/java/com/lzy/mywheels/ijkplayer/text1/RecyclerNormalAdapter.java
8fa718e67678357d1968b8271ce36ba9bd6ff9e4
[]
no_license
zidanpiaoguo/MyWheelsOne
4d0465a8a97baeaed2a6bac7bb39f421fd0fd302
4d9d7c31a663728141707145fe1e3757d70ae240
refs/heads/master
2021-09-08T09:05:42.907586
2018-03-09T01:25:29
2018-03-09T01:25:29
115,782,418
0
0
null
null
null
null
UTF-8
Java
false
false
1,754
java
package com.lzy.mywheels.ijkplayer.text1; import android.content.Context; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.lzy.mywheels.R; import com.lzy.mywheels.ijkplayer.VideoModel; import java.util.List; /** * Created by guoshuyu on 2017/1/9. */ public class RecyclerNormalAdapter extends RecyclerView.Adapter { private final static String TAG = "RecyclerBaseAdapter"; private List<VideoModel> itemDataList = null; private Context context = null; public RecyclerNormalAdapter(Context context, List<VideoModel> itemDataList) { this.itemDataList = itemDataList; this.context = context; } @Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View v = LayoutInflater.from(context).inflate(R.layout.list_video_item_normal, parent, false); final RecyclerView.ViewHolder holder = new RecyclerItemNormalHolder(context, v); return holder; } @Override public void onBindViewHolder(final RecyclerView.ViewHolder holder, int position) { RecyclerItemNormalHolder recyclerItemViewHolder = (RecyclerItemNormalHolder) holder; recyclerItemViewHolder.setRecyclerBaseAdapter(this); recyclerItemViewHolder.onBind(position, itemDataList.get(position)); } @Override public int getItemCount() { return itemDataList.size(); } @Override public int getItemViewType(int position) { return 1; } public void setListData(List<VideoModel> data) { itemDataList = data; notifyDataSetChanged(); } }
[ "zidanpiaoguo@163.com" ]
zidanpiaoguo@163.com
67e45c833e691c619328ee019c056bea57681bcc
a1826c2ed9c12cfc395fb1a14c1a2e1f097155cb
/cloudphone-20201230/src/main/java/com/aliyun/cloudphone20201230/models/ImportKeyPairResponse.java
388b1633243cc4d89973302444ea8ed4af2a8efc
[ "Apache-2.0" ]
permissive
aliyun/alibabacloud-java-sdk
83a6036a33c7278bca6f1bafccb0180940d58b0b
008923f156adf2e4f4785a0419f60640273854ec
refs/heads/master
2023-09-01T04:10:33.640756
2023-09-01T02:40:45
2023-09-01T02:40:45
288,968,318
40
45
null
2023-06-13T02:47:13
2020-08-20T09:51:08
Java
UTF-8
Java
false
false
1,354
java
// This file is auto-generated, don't edit it. Thanks. package com.aliyun.cloudphone20201230.models; import com.aliyun.tea.*; public class ImportKeyPairResponse extends TeaModel { @NameInMap("headers") @Validation(required = true) public java.util.Map<String, String> headers; @NameInMap("statusCode") @Validation(required = true) public Integer statusCode; @NameInMap("body") @Validation(required = true) public ImportKeyPairResponseBody body; public static ImportKeyPairResponse build(java.util.Map<String, ?> map) throws Exception { ImportKeyPairResponse self = new ImportKeyPairResponse(); return TeaModel.build(map, self); } public ImportKeyPairResponse setHeaders(java.util.Map<String, String> headers) { this.headers = headers; return this; } public java.util.Map<String, String> getHeaders() { return this.headers; } public ImportKeyPairResponse setStatusCode(Integer statusCode) { this.statusCode = statusCode; return this; } public Integer getStatusCode() { return this.statusCode; } public ImportKeyPairResponse setBody(ImportKeyPairResponseBody body) { this.body = body; return this; } public ImportKeyPairResponseBody getBody() { return this.body; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
443719b0b890649fe80879fde22646c2c4269b8c
f69a8fa22d28e3f078c98c4a737516cf8bc172a4
/src/shalom/bible/hymn/cion/favorite/cropper/HandleHelper.java
88f84dbb62ce3bfd702d5aa373f1331fddd86ced
[]
no_license
cion49235/BibleHymn_cion
b91d82a6e8f45971d2799ddb7f09215295290950
b4e173f1d2a4aa6b8ef904f922a15fcd5e7c7d96
refs/heads/master
2021-05-06T11:43:52.100147
2018-06-25T08:38:45
2018-06-25T08:38:45
113,341,737
0
0
null
null
null
null
UTF-8
Java
false
false
6,353
java
//This is source code of favorite. Copyrightⓒ. Tarks. All Rights Reserved. /* * Copyright 2013, Edmodo, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. * You may obtain a copy of the License in the LICENSE file, or 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 shalom.bible.hymn.cion.favorite.cropper; import android.graphics.Rect; /** * Abstract helper class to handle operations on a crop window Handle. */ abstract class HandleHelper { // Member Variables //////////////////////////////////////////////////////// private static final float UNFIXED_ASPECT_RATIO_CONSTANT = 1; private Edge mHorizontalEdge; private Edge mVerticalEdge; // Save the Pair object as a member variable to avoid having to instantiate // a new Object every time getActiveEdges() is called. private EdgePair mActiveEdges; // Constructor ///////////////////////////////////////////////////////////// /** * Constructor. * * @param horizontalEdge the horizontal edge associated with this handle; * may be null * @param verticalEdge the vertical edge associated with this handle; may be * null */ HandleHelper(Edge horizontalEdge, Edge verticalEdge) { mHorizontalEdge = horizontalEdge; mVerticalEdge = verticalEdge; mActiveEdges = new EdgePair(mHorizontalEdge, mVerticalEdge); } // Package-Private Methods ///////////////////////////////////////////////// /** * Updates the crop window by directly setting the Edge coordinates. * * @param x the new x-coordinate of this handle * @param y the new y-coordinate of this handle * @param imageRect the bounding rectangle of the image * @param parentView the parent View containing the image * @param snapRadius the maximum distance (in pixels) at which the crop * window should snap to the image */ void updateCropWindow(float x, float y, Rect imageRect, float snapRadius) { final EdgePair activeEdges = getActiveEdges(); final Edge primaryEdge = activeEdges.primary; final Edge secondaryEdge = activeEdges.secondary; if (primaryEdge != null) primaryEdge.adjustCoordinate(x, y, imageRect, snapRadius, UNFIXED_ASPECT_RATIO_CONSTANT); if (secondaryEdge != null) secondaryEdge.adjustCoordinate(x, y, imageRect, snapRadius, UNFIXED_ASPECT_RATIO_CONSTANT); } /** * Updates the crop window by directly setting the Edge coordinates; this * method maintains a given aspect ratio. * * @param x the new x-coordinate of this handle * @param y the new y-coordinate of this handle * @param targetAspectRatio the aspect ratio to maintain * @param imageRect the bounding rectangle of the image * @param parentView the parent View containing the image * @param snapRadius the maximum distance (in pixels) at which the crop * window should snap to the image */ abstract void updateCropWindow(float x, float y, float targetAspectRatio, Rect imageRect, float snapRadius); /** * Gets the Edges associated with this handle (i.e. the Edges that should be * moved when this handle is dragged). This is used when we are not * maintaining the aspect ratio. * * @return the active edge as a pair (the pair may contain null values for * the <code>primary</code>, <code>secondary</code> or both fields) */ EdgePair getActiveEdges() { return mActiveEdges; } /** * Gets the Edges associated with this handle as an ordered Pair. The * <code>primary</code> Edge in the pair is the determining side. This * method is used when we need to maintain the aspect ratio. * * @param x the x-coordinate of the touch point * @param y the y-coordinate of the touch point * @param targetAspectRatio the aspect ratio that we are maintaining * @return the active edges as an ordered pair */ EdgePair getActiveEdges(float x, float y, float targetAspectRatio) { // Calculate the aspect ratio if this handle were dragged to the given // x-y coordinate. final float potentialAspectRatio = getAspectRatio(x, y); // If the touched point is wider than the aspect ratio, then x // is the determining side. Else, y is the determining side. if (potentialAspectRatio > targetAspectRatio) { mActiveEdges.primary = mVerticalEdge; mActiveEdges.secondary = mHorizontalEdge; } else { mActiveEdges.primary = mHorizontalEdge; mActiveEdges.secondary = mVerticalEdge; } return mActiveEdges; } // Private Methods ///////////////////////////////////////////////////////// /** * Gets the aspect ratio of the resulting crop window if this handle were * dragged to the given point. * * @param x the x-coordinate * @param y the y-coordinate * @return the aspect ratio */ private float getAspectRatio(float x, float y) { // Replace the active edge coordinate with the given touch coordinate. final float left = (mVerticalEdge == Edge.LEFT) ? x : Edge.LEFT.getCoordinate(); final float top = (mHorizontalEdge == Edge.TOP) ? y : Edge.TOP.getCoordinate(); final float right = (mVerticalEdge == Edge.RIGHT) ? x : Edge.RIGHT.getCoordinate(); final float bottom = (mHorizontalEdge == Edge.BOTTOM) ? y : Edge.BOTTOM.getCoordinate(); final float aspectRatio = AspectRatioUtil.calculateAspectRatio(left, top, right, bottom); return aspectRatio; } }
[ "cion49235@nate.com" ]
cion49235@nate.com
34b8c3cb44a4b0d54b659f9967558df7e622682b
6cda251c0293da553890275dd8f9903604c5f538
/onlineshop/src/java/paronlineapi/entity/Producto.java
e5294bb847b16acc9f82f9f2d4fac1cfa686c6db
[]
no_license
miguelomendoza/electivaIII-onlineShot
febf6de69c76b757f4282feb635ef74c39c18058
5a359d3025e22ade03eca74de2da6d96bfec94b4
refs/heads/main
2023-05-27T03:20:56.277918
2021-06-11T00:16:00
2021-06-11T00:16:00
375,855,910
0
0
null
null
null
null
UTF-8
Java
false
false
4,803
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 paronlineapi.entity; import java.io.Serializable; import java.math.BigDecimal; import java.util.Collection; import javax.persistence.Basic; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; import javax.persistence.OneToMany; import javax.persistence.Table; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlTransient; /** * * @author mmendoza */ @Entity @Table(name = "producto") @XmlRootElement @NamedQueries({ @NamedQuery(name = "Producto.findAll", query = "SELECT p FROM Producto p") , @NamedQuery(name = "Producto.findByIdProducto", query = "SELECT p FROM Producto p WHERE p.idProducto = :idProducto") , @NamedQuery(name = "Producto.findByDescripcion", query = "SELECT p FROM Producto p WHERE p.descripcion = :descripcion") , @NamedQuery(name = "Producto.findByPrecioUnit", query = "SELECT p FROM Producto p WHERE p.precioUnit = :precioUnit") , @NamedQuery(name = "Producto.findByCantidad", query = "SELECT p FROM Producto p WHERE p.cantidad = :cantidad")}) public class Producto implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Basic(optional = false) @Column(name = "id_producto") private Integer idProducto; @Basic(optional = false) @Column(name = "descripcion") private String descripcion; // @Max(value=?) @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation @Basic(optional = false) @Column(name = "precio_unit") private BigDecimal precioUnit; @Basic(optional = false) @Column(name = "cantidad") private int cantidad; @JoinColumn(name = "id_categoria", referencedColumnName = "id_categoria") @ManyToOne(optional = false) private Categoria idCategoria; @OneToMany(cascade = CascadeType.ALL, mappedBy = "idProducto") private Collection<TransaccionesDet> transaccionesDetCollection; public Producto() { } public Producto(Integer idProducto) { this.idProducto = idProducto; } public Producto(Integer idProducto, String descripcion, BigDecimal precioUnit, int cantidad) { this.idProducto = idProducto; this.descripcion = descripcion; this.precioUnit = precioUnit; this.cantidad = cantidad; } public Integer getIdProducto() { return idProducto; } public void setIdProducto(Integer idProducto) { this.idProducto = idProducto; } public String getDescripcion() { return descripcion; } public void setDescripcion(String descripcion) { this.descripcion = descripcion; } public BigDecimal getPrecioUnit() { return precioUnit; } public void setPrecioUnit(BigDecimal precioUnit) { this.precioUnit = precioUnit; } public int getCantidad() { return cantidad; } public void setCantidad(int cantidad) { this.cantidad = cantidad; } public Categoria getIdCategoria() { return idCategoria; } public void setIdCategoria(Categoria idCategoria) { this.idCategoria = idCategoria; } @XmlTransient public Collection<TransaccionesDet> getTransaccionesDetCollection() { return transaccionesDetCollection; } public void setTransaccionesDetCollection(Collection<TransaccionesDet> transaccionesDetCollection) { this.transaccionesDetCollection = transaccionesDetCollection; } @Override public int hashCode() { int hash = 0; hash += (idProducto != null ? idProducto.hashCode() : 0); return hash; } @Override public boolean equals(Object object) { // TODO: Warning - this method won't work in the case the id fields are not set if (!(object instanceof Producto)) { return false; } Producto other = (Producto) object; if ((this.idProducto == null && other.idProducto != null) || (this.idProducto != null && !this.idProducto.equals(other.idProducto))) { return false; } return true; } @Override public String toString() { return "paronlineapi.entity.Producto[ idProducto=" + idProducto + " ]"; } }
[ "miguelomendoza12345@gmail.com" ]
miguelomendoza12345@gmail.com
3bd24245e2ca3d216ac0601eb667e5c1dbd04ec9
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/15/15_428956e840327ba158a9f8c81404f2cb0d88e0d5/ToDoListDialog/15_428956e840327ba158a9f8c81404f2cb0d88e0d5_ToDoListDialog_t.java
fdca140d812f96496c10154420dc1d8ea2fc210c
[]
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
6,202
java
package optitask.ui; import java.awt.Image; import java.awt.Toolkit; import java.util.LinkedList; import javax.swing.JOptionPane; import javax.swing.table.AbstractTableModel; import optitask.AppController; import optitask.store.AppPersistence; import optitask.util.Task; /** * ToDoListDialog.java <br /> * Purpose: Displays a dialog for the user to manage the tasks. * @author Jerome Rodrigo * @since 0.8 */ public class ToDoListDialog extends TaskManager { /** * */ private static final long serialVersionUID = 2408587468175238769L; /** * The data model for the to do list table. * @author Jerome * @since 0.8 */ private class TasksDataModel extends AbstractTableModel { /** * The serial version UID. */ private static final long serialVersionUID = -2642740868251152662L; /** * The names for each column. */ private final String[] columnNames = { "Task", "Description", "Current", "Assigned", "Done" }; /** * The limit where assigned pomodoros is considered as 'too many'. */ private static final int TOO_MANY_POMS = 6; /** * The list of tasks. */ private final LinkedList<Task> tasks; /** * Constructor for the TasksDataModel. * @param tsks the list of tasks */ public TasksDataModel(final LinkedList<Task> tsks) { tasks = tsks; } @Override public int getColumnCount() { return columnNames.length; } @Override public String getColumnName(final int col) { return columnNames[col]; } @Override public int getRowCount() { return tasks.size(); } @Override public Class<?> getColumnClass(final int c) { return getValueAt(0, c).getClass(); } @Override public boolean isCellEditable(final int row, final int col) { // If the task is done, the disable changing the assigned pomodoros if (tasks.get(row).isDone() && (col == 3 || col == 2 || col == 1)) { return false; } return col > 0 && col < columnNames.length && col != 2; } @Override public Object getValueAt(final int row, final int col) { switch (col) { case 0: return row + 1; case 1: return tasks.get(row).getTaskDesc(); case 4: return tasks.get(row).isDone(); case 2: return tasks.get(row).getCurrentPomodoro(); case 3: return tasks.get(row).getAssignedPomodoros(); default: return null; } } @Override public void setValueAt(final Object value, final int row, final int col) { assert (col > 0 && col < columnNames.length); Task task = tasks.get(row); switch (col) { case 1: task.setTaskDesc((String) value); break; case 4: task.setIsDone((Boolean) value); // If a task is 'undone' then reset the current pomodoros if (!(Boolean) value) { task.setCurrentPomodoro(0); } break; case 3: task.setAssignedPomodoros((Integer) value); if ((Integer) value > TOO_MANY_POMS) { JOptionPane.showMessageDialog(getParent(), "Too many pomodoros assigned.\n" + "Consider breaking down your tasks!", "Warning", JOptionPane.WARNING_MESSAGE); } break; default: return; } tasks.set(row, task); fireTableCellUpdated(row, col); } }; /** * Title of the window. */ private static final String WINDOW_TITLE = "To Do List"; /** * The column which holds the pomodoro editor in the JTable. */ private static final int POM_EDITOR_COLUMN = 3; /** * Creates the dialog. * <B>Not used</B>. */ public ToDoListDialog() { } /** * Creates and initialises the dialog. * @param mdl the persistence module * @param cntrller the application controller */ public ToDoListDialog(final AppPersistence mdl, final AppController cntrller) { super(mdl, cntrller); } @Override public final AbstractTableModel getTableModel() { return new TasksDataModel(getTasks()); } @Override protected final String getWindowTitle() { return WINDOW_TITLE; } @Override protected final Image getIconImage() { return Toolkit.getDefaultToolkit().getImage( ToDoListDialog.class. getResource("/optitask/assests/pencil.gif")); } @Override protected final String getMoveUpMessage() { return "Move Up To Do List"; } @Override protected final String getMoveDownMessage() { return "Move Down To Do List"; } @Override protected final String getAddMessage() { return "Add Task To Do List"; } @Override protected final String getDeleteMessage() { return "Delete Task To Do List"; } @Override protected final LinkedList<Task> getTasksModel() { return getModel().getToDoList(); } @Override protected final int getPomNumberEditorColumn() { return POM_EDITOR_COLUMN; } @Override protected final String getMoveToMessage() { return "Move To Task Inventory"; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
d38d843adabf706f75a6898bd8858baced0aebde
5e2de260abe7214f1e4a837dacc6affe5f091ea0
/IdeaProjects/Model/BankServer.java
78c0b91a38d6a92f0972c0ed22811724f1a9792d
[]
no_license
lll-phill-lll/voop
15632f1b4ee197cfbba919359c25fc17543be636
d5a0b23b56c04aafe5815f0c97ba534d92adec4c
refs/heads/master
2020-08-06T00:44:21.003350
2019-10-04T09:06:06
2019-10-04T09:06:06
212,774,840
0
0
null
null
null
null
UTF-8
Java
false
false
1,186
java
import java.util.*; /** * */ public class BankServer { /** * Default constructor */ public BankServer() { } /** * */ private HashMap Accounts; /** * @param account * @return */ public Integer AddNewAccount(Account account) { // TODO implement here return null; } /** * @param AccountId * @param amount * @return */ public Integer ChangeBalance(string AccountId, Integer amount) { // TODO implement here return null; } /** * @param money * @param AccountIdFrom * @param AccountIdTo */ public void ProcessTransaction(Integer money, Integer AccountIdFrom, Integer AccountIdTo) { // TODO implement here } /** * @param AccountID * @return */ public Integer GetBalance(Integer AccountID) { // TODO implement here return null; } /** * */ public void BankServer() { // TODO implement here } /** * @param accountId */ public void GetFullAccountInfo(Integer accountId) { // TODO implement here } }
[ "mfilitov@ozon.ru" ]
mfilitov@ozon.ru
07c4519f46f7c5c12edf41c759c9731b147ea811
c08f45491771cc687418727869f72fcc6a51862b
/ChineseChess.java
074c52bd5868d4f54d6e416ba9499ed7cf460309
[]
no_license
janejl/COMP3270-Artificial-Intelligence
4873ebcde70bdb9cbf99662b23d9872465a7c1f2
ed26832d5be46c187ac1d1293ec60340081022e9
refs/heads/master
2021-01-10T10:32:57.264896
2015-11-30T15:56:46
2015-11-30T15:56:46
46,111,186
0
0
null
null
null
null
UTF-8
Java
false
false
10,780
java
import java.util.ArrayList; import java.util.HashMap; import java.util.Scanner; public class ChineseChess { private static char[][] chess_board; private static int[][] chess_board_key; // correspond to chess_board private static ArrayList<ChessNode> history; private static boolean isMyTurn; // Machine's turn private static HashMap<Integer, Chessman> piece_list; private final static int DEPTH = 4; /* * Human will take the first turn in default. */ public ChineseChess(){ initChessBoard(); isMyTurn = false; history = new ArrayList<ChessNode>(); initChessBoard(); } public static void main(String[] args) { System.out.println("=========================== Game Start ==========================="); Scanner scanner = new Scanner(System.in); ChineseChess game = new ChineseChess(); int x, y, nx, ny; String[] digit; char result; ChessNode my_node = null; ChessNode ur_node = null; while(true){ printChessBoard(); System.out.println("You are red. Please enter (from.x from.y dest.x dest.y) (e.g.: 4 9 4 8):"); digit = scanner.nextLine().split(" "); x = Integer.parseInt(digit[0]); y = Integer.parseInt(digit[1]); nx = Integer.parseInt(digit[2]); ny = Integer.parseInt(digit[3]); int[] from = {x,y}; int[] dest = {nx,ny}; // 1. check if current move is legal or not ChessRule rule = new ChessRule(); if(rule.moveRule(x, y, nx, ny, chess_board) == 'f'){ System.out.println("Fail the move."); isMyTurn = false; continue; // illegal -> require user to re-enter } // 2. check if current legal move will win/lose/play. ur_node = new ChessNode(chess_board_key[y][x], from, dest, isMyTurn, my_node); result = ur_node.checkStatus(piece_list); if(result == 'w'){ System.out.println("You win!"); break; }else if(result == 'l'){ System.out.println("You lose!"); break; }else{ // Continue playing -> Real Move ur_node.move(chess_board, chess_board_key, piece_list); history.add(ur_node); //System.out.println("Your movement is saved to history: ur_node: "+ur_node); // 3. response to user's action isMyTurn = true; System.out.println("Machine is thinking ... "); my_node = searchBestMove(ur_node); result = my_node.checkStatus(piece_list); if(result == 'w'){ System.out.println("You lose!"); break; }else if(result == 'l'){ System.out.println("You win!"); break; }else{ // Continue playing -> Real Move my_node.move(chess_board, chess_board_key, piece_list); history.add(my_node); } isMyTurn = false; } } System.out.println("=========================== Game End ==========================="); } // 1. check for state - done. // 2. generate next step for selected piece (iterate through all available pieces) with evaluation value // 3. push into openset, alpha beta pruning // 3. choose best one and go, put into closedset (? may not useful, no need to print path) // 4. clean all value in tree and wait for user's step to trigger new decision tree. // return: f - illegal move, w - win game, l - lose game, p - continue playing public static ChessNode searchBestMove(ChessNode current){ double time_start = System.nanoTime(); ArrayList<ChessNode> successors; ChessNode best_node = null; ChessSuccessor childGenerator = new ChessSuccessor(); successors = childGenerator.getSuccessor(chess_board, chess_board_key, piece_list, current); for(ChessNode node : successors){ // try the move of this node node.move(chess_board, chess_board_key, piece_list); //System.out.println("searchBestMove: try the move: " + node); //printChessBoard(); node.setValue(alphabeta(node, DEPTH, Integer.MIN_VALUE, Integer.MAX_VALUE, false)); //System.out.println("Finish for node: "+ node + "... best_node: "+best_node); if(best_node == null || node.getValue() >= best_node.getValue()){ best_node = node; } // roll back for next successor node.revert(chess_board, chess_board_key, piece_list); } double time_spent = (System.nanoTime() - time_start)/1000000000.0; System.out.println("Time: " + time_spent); return best_node; } private static int alphabeta(ChessNode node, int depth, int alpha, int beta, boolean isMachine){ char node_state = node.checkStatus(piece_list); if(node_state != 'p' || depth == 0){ ChessEvaluate eva = new ChessEvaluate(); int value = eva.giveEvaluation(chess_board, piece_list, node); //System.out.println(">>> return αβ value: " + value + " for node: " + node); return value; } // Machine is max-player, user is min-player int value; ChessSuccessor childGenerator = new ChessSuccessor(); ArrayList<ChessNode> sub_successors; if(isMachine){ //System.out.println("alphabeta: maxplayer..."); value = Integer.MIN_VALUE; sub_successors = childGenerator.getSuccessor(chess_board, chess_board_key, piece_list, node); for(ChessNode sub_node : sub_successors){ sub_node.move(chess_board, chess_board_key, piece_list); value = Math.max(value, alphabeta(sub_node, depth-1, alpha, beta, false)); sub_node.revert(chess_board, chess_board_key, piece_list); alpha = Math.max(alpha, value); if(beta <= alpha){ System.out.println("β cut-off"); break; // β cut-off } } }else{ //System.out.println("alphabeta: minplayer..."); value = Integer.MAX_VALUE; sub_successors = childGenerator.getSuccessor(chess_board, chess_board_key, piece_list, node); for(ChessNode sub_node : sub_successors){ sub_node.move(chess_board, chess_board_key, piece_list); value = Math.min(value, alphabeta(sub_node, depth-1, alpha, beta, false)); sub_node.revert(chess_board, chess_board_key, piece_list); alpha = Math.min(alpha, value); if(beta <= alpha){ System.out.println("α cut-off"); break; // α cut-off } } } return value; } // Set up a chess board private void initChessBoard(){ piece_list = new HashMap<Integer, Chessman>(); piece_list = new HashMap<Integer, Chessman>(); Chessman piece; chess_board = new char[][]{{'r','h','e','a','g','a','e','h','r'}, {'n','n','n','n','n','n','n','n','n'}, {'n','c','n','n','n','n','n','c','n'}, {'s','n','s','n','s','n','s','n','s'}, {'n','n','n','n','n','n','n','n','n'}, {'n','n','n','n','n','n','n','n','n'}, {'S','n','S','n','S','n','S','n','S'}, {'n','C','n','n','n','n','n','C','n'}, {'n','n','n','n','n','n','n','n','n'}, {'R','H','E','A','G','A','E','H','R'}}; chess_board_key = new int[][]{ {8,6,4,2,1,3,5,7,9}, {0,0,0,0,0,0,0,0,0}, {0,10,0,0,0,0,0,11,0}, {12,0,13,0,14,0,15,0,16}, {0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0}, {32,0,33,0,34,0,35,0,36}, {0,30,0,0,0,0,0,31,0}, {0,0,0,0,0,0,0,0,0}, {28,26,24,22,21,23,25,27,29}}; // set General: piece = new Chessman('g', 4, 0); piece_list.put(1,piece); piece = new Chessman('G', 4, 9); piece_list.put(21,piece); // set Advisor: piece = new Chessman('a', 3, 0); piece_list.put(2,piece); piece = new Chessman('a', 5, 0); piece_list.put(3,piece); piece = new Chessman('A', 3, 9); piece_list.put(22,piece); piece = new Chessman('A', 5, 9); piece_list.put(23,piece); // set Elephant: piece = new Chessman('e', 2, 0); piece_list.put(4,piece); piece = new Chessman('e', 6, 0); piece_list.put(5,piece); piece = new Chessman('E', 2, 9); piece_list.put(24,piece); piece = new Chessman('E', 6, 9); piece_list.put(25,piece); // set Horse: piece = new Chessman('h', 1, 0); piece_list.put(6,piece); piece = new Chessman('h', 7, 0); piece_list.put(7,piece); piece = new Chessman('H', 1, 9); piece_list.put(26,piece); piece = new Chessman('H', 7, 9); piece_list.put(27,piece); // set Chariot: piece = new Chessman('r', 0, 0); piece_list.put(8,piece); piece = new Chessman('r', 8, 0); piece_list.put(9,piece); piece = new Chessman('R', 0, 9); piece_list.put(28,piece); piece = new Chessman('R', 8, 9); piece_list.put(29,piece); // set Cannon: piece = new Chessman('c', 1, 2); piece_list.put(10,piece); piece = new Chessman('c', 7, 2); piece_list.put(11,piece); piece = new Chessman('C', 1, 7); piece_list.put(30,piece); piece = new Chessman('C', 7, 7); piece_list.put(31,piece); // set Soldier: piece = new Chessman('s', 0, 3); piece_list.put(12,piece); piece = new Chessman('s', 2, 3); piece_list.put(13,piece); piece = new Chessman('s', 4, 3); piece_list.put(14,piece); piece = new Chessman('s', 6, 3); piece_list.put(15,piece); piece = new Chessman('s', 8, 3); piece_list.put(16,piece); piece = new Chessman('S', 0, 6); piece_list.put(32,piece); piece = new Chessman('S', 2, 6); piece_list.put(33,piece); piece = new Chessman('S', 4, 6); piece_list.put(34,piece); piece = new Chessman('S', 6, 6); piece_list.put(35,piece); piece = new Chessman('S', 8, 6); piece_list.put(36,piece); } public static void printChessBoard(){ System.out.println(" 0 1 2 3 4 5 6 7 8"); for(int j=0; j<10; ++j){ System.out.print("\033[0m"+j); for(int i=0; i<9; ++i){ switch(chess_board[j][i]){ case 'n': System.out.print("\033[34m口"); break; case 'g': System.out.print("\033[32m將"); break; case 'G': System.out.print("\033[31m帥"); break; case 'a': System.out.print("\033[32m士"); break; case 'A': System.out.print("\033[31m仕"); break; case 'e': System.out.print("\033[32m象"); break; case 'E': System.out.print("\033[31m相"); break; case 'h': System.out.print("\033[32m馬"); break; case 'H': System.out.print("\033[31m傌"); break; case 'r': System.out.print("\033[32m車"); break; case 'R': System.out.print("\033[31m俥"); break; case 'c': System.out.print("\033[32m砲"); break; case 'C': System.out.print("\033[31m炮"); break; case 's': System.out.print("\033[32m卒"); break; case 'S': System.out.print("\033[31m兵"); break; case 'b': System.out.print("\033[32m卒"); break; case 'B': System.out.print("\033[31m兵"); } } System.out.println("\033[0m"); } } }
[ "jane.hkucs@gmail.com" ]
jane.hkucs@gmail.com
870649d38dc7de79be743c38837233492612bdd9
6d9d95a7752b60ef157b23920b52178f09cd225e
/src/main/java/org/jails/property/ReflectionUtil.java
ca5c7f5a867e8a284b4eeed7c77c03f06e995fe0
[]
no_license
kansasSamurai/java-in-jails
5bb581eba54b00c2a85fedff102d2000c25f1a43
c17b953d17f9828bf7a012c177679d471e976013
refs/heads/master
2023-03-18T14:32:49.228835
2012-02-23T00:50:20
2012-02-23T00:50:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,414
java
package org.jails.property; import org.apache.commons.beanutils.PropertyUtils; import org.jails.property.parser.PropertyParser; import org.jails.property.parser.SimplePropertyParser; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.lang.annotation.Annotation; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.math.BigDecimal; import java.math.BigInteger; import java.util.Collection; public class ReflectionUtil { private static Logger logger = LoggerFactory.getLogger(ReflectionUtil.class); private static PropertyParser propertyParser = new SimplePropertyParser(); public static <A extends Annotation> A getMethodAnnotation(Class<A> annotationType, Class classType, String propertyName, Class[] parameterTypes) { Method method; try { method = classType.getMethod(propertyName, parameterTypes); logger.info("AnnotatedMethod: " + method.getName() + ": " + propertyName); Annotation a = method.getAnnotation(annotationType); logger.info("Annotation: " + a); return (A) a; } catch (NoSuchMethodException e) { logger.warn(e.getMessage()); } return null; } public static <A extends Annotation> A getClassAnnotation(Class<A> annotationType, Class classType) { logger.info("AnnotatedClass: " + classType.getSimpleName()); Annotation a = (A) classType.getAnnotation(annotationType); logger.info("Annotation: " + a); return (A) a; } public static <A extends Annotation> A getFieldAnnotation(Class<A> annotationType, Class classType, String fieldName) { Field field; try { field = classType.getDeclaredField(fieldName); logger.info("AnnotatedField: " + field.getName() + ": " + field); Annotation a = field.getAnnotation(annotationType); logger.info("Annotation: " + a); return (A) a; } catch (NoSuchFieldException e) { logger.warn(e.getMessage()); } return null; } public static IdentifyBy[] getIdentifiers(Object object, String property, String nestedProperty) { try { Class nestedType = PropertyUtils.getPropertyType(object, property); } catch (Exception e) { e.printStackTrace(); return new IdentifyBy[0]; } IdentifyBy.List idList = ReflectionUtil .getClassAnnotation(IdentifyBy.List.class, object.getClass()); IdentifyBy[] ids = null; if (idList != null) { ids = idList.value(); } else { IdentifyBy id = ReflectionUtil.getClassAnnotation(IdentifyBy.class, object.getClass()); if (id != null) { ids = new IdentifyBy[]{id}; } } return ids; } public static boolean isDecimal(Class<?> type) { logger.trace("isDecimal type: " + type.getName()); boolean isDecimal = type.equals(Float.class) || type.equals(float.class) || type.equals(Double.class) || type.equals(double.class) || type.equals(BigDecimal.class) //perhaps a custom subclass?? || Collection.class.isAssignableFrom(Number.class); return isDecimal; } public static boolean isInteger(Class<?> type) { logger.trace("isInteger type: " + type.getName()); boolean isInteger = type.equals(Integer.class) || type.equals(int.class) || type.equals(Short.class) || type.equals(short.class) || type.equals(Long.class) || type.equals(long.class) || type.equals(Byte.class) || type.equals(byte.class) || type.equals(BigInteger.class); return isInteger; } }
[ "peter@petercowan.com" ]
peter@petercowan.com
b900bf4265c8db52e6524954c4a141040cc01c93
aa67b441dc43957af688983af54a04c2e552c860
/search_engine/search_engine/src/search_engine/task1.java
7f33c48bcc91bd0ae225218d383b014b9636039d
[]
no_license
dhruv-modi/WebSearchEngine
fba8f22abe168a8ebfeb61545e26a39372a06c6a
dbe49c73a9a4d5d88d6a69ecdb29635ac7753846
refs/heads/master
2022-05-28T03:09:02.366807
2020-04-28T02:50:42
2020-04-28T02:50:42
259,403,965
0
0
null
null
null
null
UTF-8
Java
false
false
3,338
java
package search_engine; import search_engine.*; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; public class task1 { public static String fileread(String s) { File file = new File(s); String st=""; String ss=""; try { BufferedReader br = new BufferedReader(new FileReader(file)); while ((st = br.readLine()) != null) ss=ss+st; br.close(); } catch (IOException e) { e.printStackTrace(); } return ss; } int KMPSearch(String pat, String txt) { int M = pat.length(); int N = txt.length(); // create lps[] that will hold the longest // prefix suffix values for pattern int lps[] = new int[M]; int j = 0; // index for pat[] // Preprocess the pattern (calculate lps[] // array) computeLPSArray(pat,M,lps); int i = 0; // index for txt[] int res = 0; int next_i = 0; while (i < N) { if (pat.charAt(j) == txt.charAt(i)) { j++; i++; } if (j == M) { // When we find pattern first time, // we iterate again to check if there // exists more pattern j = lps[j-1]; res++; // We start i to check for more than once // appearance of pattern, we will reset i // to previous start+1 if (lps[j]!=0) i = ++next_i; j = 0; } // mismatch after j matches else if (i < N && pat.charAt(j) != txt.charAt(i)) { // Do not match lps[0..lps[j-1]] characters, // they will match anyway if (j != 0) j = lps[j-1]; else i = i+1; } } return res; } void computeLPSArray(String pat, int M, int lps[]) { // length of the previous longest prefix suffix int len = 0; int i = 1; lps[0] = 0; // lps[0] is always 0 // the loop calculates lps[i] for i = 1 to M-1 while (i < M) { if (pat.charAt(i) == pat.charAt(len)) { len++; lps[i] = len; i++; } else // (pat[i] != pat[len]) { // This is tricky. Consider the example. // AAACAAAA and i = 7. The idea is similar // to search step. if (len != 0) { len = lps[len-1]; // Also, note that we do not increment // i here } else // if (len == 0) { lps[i] = len; i++; } } } } public static int freqin(String a,String b) { String s=fileread(a); //System.out.println(s.contains(b)); int ans = new task1().KMPSearch(b,s); return ans; } }
[ "56563531+dhruv-modi@users.noreply.github.com" ]
56563531+dhruv-modi@users.noreply.github.com
a61eac7f7ab67bbed2cf09ded92bc736b2e84d48
9db17f36590af94e9a932c6f8a791ab0b716b3a8
/Renaming.java
f3c9e7274f729c2327d429fbfddc92130674d701
[]
no_license
Chetan031093/File_Handling
f3b0bb7956840f18971df3aff4e64f2715fcb78b
f5df18b8dcdc973a89cb8ec2aba7e01797998564
refs/heads/master
2022-12-26T05:38:19.742585
2020-09-14T11:57:01
2020-09-14T11:57:01
278,115,645
0
0
null
null
null
null
UTF-8
Java
false
false
395
java
package practice; import java.io.File; public class Renaming { public static void main(String[] args) { File f1 = new File("E:\\f drive\\Practice"); File f2 = new File("E:\\f drive\\Prroo"); if(f1.exists()) { f1.renameTo(f2); System.out.println("folder renamed successfully"); } else { System.out.println("folder already exist"); } } }
[ "noreply@github.com" ]
noreply@github.com
e578517a2b2285c75c6fccede32dfe1e470eadfa
0bb9aea413fd8a8f5f54fbf387fe1705638f2708
/20200727/src/com/steven/abstractfactory/Engine.java
5dfb8930c667dd9e61f2f57e59e1a3024b6f60db
[]
no_license
CXQ123943/com-javase-260
c15861e5df96b42789f3045b25b804e137ca0777
5203d576681923919d5ac824062e634843b0dd7a
refs/heads/master
2023-01-23T13:34:04.254796
2020-11-29T09:38:14
2020-11-29T09:38:14
284,842,284
0
0
null
null
null
null
UTF-8
Java
false
false
152
java
package com.steven.abstractfactory; /** * @author StevenChen * @version 1.0 */ public interface Engine { /**发动机信息*/ void info(); }
[ "1249560518@qq.com" ]
1249560518@qq.com
2c40fc0846e7a87f86c421b0fe0c90d4eed3bbbe
0329d3034562ebc82864fe650eecd65b09fecc53
/app/src/main/java/com/bingo/bean/User.java
edeb342c8e6a764136565738cb73fbda9fe2a9cd
[]
no_license
woogoy/base
76e07d243be6545d52a6b618e02151a0ad13bd9b
66a5bc3315e21b296b7065b536f67d2bd04223ec
refs/heads/master
2020-05-02T19:52:27.278189
2019-02-01T09:51:18
2019-02-01T09:51:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,953
java
package com.bingo.bean; import java.util.List; /** * Created by bingo on 2018/12/28. * Time:2018/12/28 */ public class User { /** * code : 200 * msg : 数据访问成功 * data : [{"id":1,"name":"bingo1","age":20,"address":"安徽合肥"},{"id":2,"name":"bingo2","age":20,"address":"安徽安庆"},{"id":3,"name":"bingo3","age":20,"address":"四川成都"}] */ private int code; private String msg; private List<DataBean> data; public int getCode() { return code; } public void setCode(int code) { this.code = code; } public String getMsg() { return msg; } public void setMsg(String msg) { this.msg = msg; } public List<DataBean> getData() { return data; } public void setData(List<DataBean> data) { this.data = data; } public static class DataBean { /** * id : 1 * name : bingo1 * age : 20 * address : 安徽合肥 */ private int id; private String name; private int age; private String address; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } } @Override public String toString() { return "User{" + "code=" + code + ", msg='" + msg + '\'' + ", data=" + data + '}'; } }
[ "657952166@qq.com" ]
657952166@qq.com
23675ce8228233b72e8c51e3b677877618c6dfa6
2d6b64d8cfd7c09fd4664cb81c66f004fc66518c
/app/src/main/java/com/example/quickchat/MessageAdapterGroup.java
38194178aaeeda31c823ffcb9202657a1b9eebd9
[]
no_license
nunogomes44/QuickChat
e70277d09b68a0932adacc0f1ad6ce9505279f5b
94283a23ac9d074a550ff3eececf674ba3da6e1e
refs/heads/master
2020-05-27T16:54:46.110351
2019-05-26T18:09:00
2019-05-26T18:09:00
188,711,764
0
0
null
null
null
null
UTF-8
Java
false
false
5,516
java
package com.example.quickchat; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.database.DataSnapshot; import com.google.firebase.database.DatabaseError; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import com.google.firebase.database.ValueEventListener; import com.squareup.picasso.Picasso; import java.util.List; import de.hdodenhof.circleimageview.CircleImageView; public class MessageAdapterGroup extends RecyclerView.Adapter<MessageAdapterGroup.MyViewHolder> { private List<MessagesGroup> userMessagesList; private FirebaseAuth mAuth; private DatabaseReference UsersRef; public MessageAdapterGroup(List<MessagesGroup> userMessagesList){ this.userMessagesList = userMessagesList; } @NonNull @Override public MyViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int viewType) { View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.custom_messages_layout_group, viewGroup, false); MyViewHolder viewHolder = new MyViewHolder(view); mAuth = FirebaseAuth.getInstance(); return viewHolder; } @Override public void onBindViewHolder(@NonNull final MyViewHolder holder, int position) { final String messageSenderID = mAuth.getCurrentUser().getUid(); MessagesGroup messages = userMessagesList.get(position); String fromUserID = messages.getFrom(); UsersRef = FirebaseDatabase.getInstance().getReference().child("Users").child(fromUserID); UsersRef.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot dataSnapshot) { if(dataSnapshot.hasChild("image")){ String receiverImage = dataSnapshot.child("image").getValue().toString(); Picasso.get().load(receiverImage).placeholder(R.drawable.padrao).into(holder.receiverProfileImage); } } @Override public void onCancelled(@NonNull DatabaseError databaseError) { } }); holder.receiverMessageText.setVisibility(View.GONE); holder.receiverProfileImage.setVisibility(View.GONE); holder.receiverMessageName.setVisibility(View.GONE); holder.receiverMessageTime.setVisibility(View.GONE); holder.senderMessageText.setVisibility(View.GONE); holder.senderMessageTime.setVisibility(View.GONE); holder.senderMessageDisappear.setVisibility(View.GONE); holder.receiverMessageDisappear.setVisibility(View.GONE); if(fromUserID.equals(messageSenderID)){ holder.senderMessageDisappear.setVisibility(View.VISIBLE); holder.senderMessageText.setVisibility(View.VISIBLE); holder.senderMessageTime.setVisibility(View.VISIBLE); //holder.senderMessageText.setBackgroundResource(R.drawable.sender_messages_layout); holder.senderMessageText.setText(messages.getMessage()); holder.senderMessageTime.setText(messages.getTime()); } else{ holder.receiverMessageDisappear.setVisibility(View.VISIBLE); holder.receiverProfileImage.setVisibility(View.VISIBLE); holder.receiverMessageText.setVisibility(View.VISIBLE); holder.receiverMessageName.setVisibility(View.VISIBLE); holder.receiverMessageTime.setVisibility(View.VISIBLE); //holder.receiverMessageText.setBackgroundResource(R.drawable.receiver_messages_layout); holder.receiverMessageName.setText(messages.getName()); holder.receiverMessageText.setText(messages.getMessage()); holder.receiverMessageTime.setText(messages.getTime()); } } @Override public int getItemCount() { return userMessagesList.size(); } public static class MyViewHolder extends RecyclerView.ViewHolder{ public TextView senderMessageText, senderMessageTime, receiverMessageText, receiverMessageName, receiverMessageTime; public CircleImageView receiverProfileImage; public LinearLayout senderMessageDisappear, receiverMessageDisappear; public MyViewHolder(@NonNull View itemView) { super(itemView); senderMessageText = (TextView) itemView.findViewById(R.id.sender_message_text_group); senderMessageTime = (TextView) itemView.findViewById(R.id.sender_message_time_group); receiverProfileImage = (CircleImageView) itemView.findViewById(R.id.message_profile_image_group); receiverMessageName = (TextView) itemView.findViewById(R.id.receiver_message_name_group); receiverMessageText = (TextView) itemView.findViewById(R.id.receiver_message_text_group); receiverMessageTime = (TextView) itemView.findViewById(R.id.receiver_message_time_group); senderMessageDisappear = (LinearLayout) itemView.findViewById(R.id.disappear_receiver_layout); receiverMessageDisappear = (LinearLayout) itemView.findViewById(R.id.disappear_send_layout); } } }
[ "skygomes09@icloud.com" ]
skygomes09@icloud.com
21cef071173bcd1defd7100b9b773b6d0e338789
293f4661ca35eabec5230d5377c0ef6900ab7a54
/src/main/java/com/khidmasoft/keurkhaleyi/web/rest/vm/package-info.java
2b270841add165efa092ef088fe1a406a3e55722
[]
no_license
BulkSecurityGeneratorProject/keurkhaleyi
064352ef08920f741ff9fda49edb112c3b6ba972
42697f55e96ae2965597ca4504538b0ed0f4b77a
refs/heads/master
2022-12-15T19:46:01.817028
2019-07-05T18:53:17
2019-07-05T18:53:17
296,574,030
0
0
null
2020-09-18T09:20:48
2020-09-18T09:20:47
null
UTF-8
Java
false
false
108
java
/** * View Models used by Spring MVC REST controllers. */ package com.khidmasoft.keurkhaleyi.web.rest.vm;
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
001cd7bbb88ce7a97f1379870911a73b83ea395b
8deb3335fd241cdff59f09d9efb4b6df26df43d7
/photo/src/main/java/photopicker/photoview/scrollerproxy/ScrollerProxy.java
e619cec455ea0aa3b46034ea189115fe99005bf5
[]
no_license
ZhouYangGaoGao/Lib
cc0b95f84de10f079f631e1e1ad98c564cc76a6c
ba2d1bcf11402c461e2a6948f1ec3879c8bec05d
refs/heads/master
2022-12-08T03:35:48.834582
2020-09-01T10:09:01
2020-09-01T10:09:01
274,603,433
2
0
null
null
null
null
UTF-8
Java
false
false
1,728
java
/******************************************************************************* * Copyright 2011, 2012 Chris Banes. * * 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 photopicker.photoview.scrollerproxy; import android.content.Context; import android.os.Build.VERSION; import android.os.Build.VERSION_CODES; public abstract class ScrollerProxy { public static ScrollerProxy getScroller(Context context) { if (VERSION.SDK_INT < VERSION_CODES.GINGERBREAD) { return new PreGingerScroller(context); } else if (VERSION.SDK_INT < VERSION_CODES.ICE_CREAM_SANDWICH) { return new GingerScroller(context); } else { return new IcsScroller(context); } } public abstract boolean computeScrollOffset(); public abstract void fling(int startX, int startY, int velocityX, int velocityY, int minX, int maxX, int minY, int maxY, int overX, int overY); public abstract void forceFinished(boolean finished); public abstract boolean isFinished(); public abstract int getCurrX(); public abstract int getCurrY(); }
[ "ZhouYangGaoGao@163.com" ]
ZhouYangGaoGao@163.com
4b8fb965d0710dcf8abd4f0c4a56a1517408b900
9edf79b4d2e0c324b16f6b860cbfa13d8289ba4f
/src/test/java/br/unibh/loja/negocio/TesteServicoCliente.java
66b4edf0d5a487df5f47cfca290c6b10e6ca31da
[]
no_license
RicardoDuarte75/arqs
569d2df3fc98c935e0e3700960be163aca066729
4eaed77c83741d944e6a467add8894c67ba9dc88
refs/heads/master
2020-03-21T08:38:59.355670
2018-06-23T00:09:19
2018-06-23T00:09:19
138,356,241
0
0
null
null
null
null
UTF-8
Java
false
false
4,017
java
package br.unibh.loja.negocio; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import java.io.File; import java.util.Date; import java.util.logging.Logger; import javax.inject.Inject; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.Archive; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.jboss.shrinkwrap.resolver.api.maven.Maven; import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.MethodSorters; import br.unibh.loja.entidades.Categoria; import br.unibh.loja.entidades.Cliente; import br.unibh.loja.entidades.Produto; import br.unibh.loja.util.Resources; @RunWith(Arquillian.class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class TesteServicoCliente { @Deployment public static Archive<?> createTestArchive() { File[] files = Maven.resolver().loadPomFromFile("pom.xml").importRuntimeDependencies().resolve() .withTransitivity().asFile(); // Cria o pacote que vai ser instalado no Wildfly para realizacao dos testes return ShrinkWrap.create(WebArchive.class, "testeloja.war") .addClasses(Cliente.class, Produto.class, Categoria.class, Resources.class, DAO.class, ServicoCliente.class) .addAsLibraries(files) .addAsResource("META-INF/persistence.xml", "META-INF/persistence.xml") .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); } // Realiza as injecoes com CDI @Inject private Logger log; @Inject private ServicoCliente sc; @Test public void teste01_inserirSemErro() throws Exception { log.info("============> Iniciando o teste " + Thread.currentThread().getStackTrace()[1].getMethodName()); Cliente o = new Cliente(null, "wesley", "wesleysls", "12345", "Standard", "10352390603", "(99)9999-9999", "wesley.sls21@gmail.com", new Date(), new Date()); sc.insert(o); Cliente aux = (Cliente) sc.findByName("wesley").get(0); assertNotNull(aux); log.info("============> Finalizando o teste " + Thread.currentThread().getStackTrace()[1].getMethodName()); } @Test public void teste02_inserirComErro() throws Exception { log.info("============> Iniciando o teste " + Thread.currentThread().getStackTrace()[1].getMethodName()); try { Cliente o = new Cliente(null, "wesley", "wesleysls", "12345", "perfil", "103.523.906-03@", "(99)9999-9999", "wesley.sls21@gmail.com", new Date(), new Date()); sc.insert(o); } catch (Exception e) { System.out.println(e.getMessage()); assertTrue(checkString(e, "o cliente precisa ser criado com o perfil Standard")); } log.info("============> Finalizando o teste " + Thread.currentThread().getStackTrace()[1].getMethodName()); } @Test public void teste03_atualizar() throws Exception { log.info("============> Iniciando o teste " + Thread.currentThread().getStackTrace()[1].getMethodName()); Cliente o = (Cliente) sc.findByName("wesley").get(0); o.setNome("wesley modificado"); sc.update(o); Cliente aux = (Cliente) sc.findByName("wesley modificado").get(0); assertNotNull(aux); log.info("============> Finalizando o teste " + Thread.currentThread().getStackTrace()[1].getMethodName()); } @Test public void teste04_excluir() throws Exception { log.info("============> Iniciando o teste " + Thread.currentThread().getStackTrace()[1].getMethodName()); Cliente o = (Cliente) sc.findByName("wesley").get(0); sc.delete(o); assertEquals(0, sc.findByName("wesley modificado").size()); log.info("============> Finalizando o teste " + Thread.currentThread().getStackTrace()[1].getMethodName()); } private boolean checkString(Throwable e, String str) { if (e.getMessage().contains(str)) { return true; } else if (e.getCause() != null) { return checkString(e.getCause(), str); } return false; } }
[ "11615933@animaedu.intranet" ]
11615933@animaedu.intranet
621405a2ea546b235b807eadf8d0b5325db7702e
349eefb6ef49e509e9cb40fe960f2c5a67f48752
/cas-server-webapp_35/src/main/java/org/gonetbar/ssa/controller/LoginInitAction.java
5fa7c0c4e3dc905e327f95b67bf1fa3b9ea2b790
[]
no_license
spancer/wsdutil
4b3dc12fcedd21ffc25850fc30188b7e61c12407
c0c5451c319038f837e0ecc7eb0ae3dea8716704
refs/heads/master
2021-01-24T15:44:10.998643
2015-06-12T03:25:08
2015-06-12T03:25:08
46,708,401
0
2
null
2015-11-23T08:59:57
2015-11-23T08:59:57
null
UTF-8
Java
false
false
2,536
java
package org.gonetbar.ssa.controller; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.validation.constraints.NotNull; import org.gonetbar.ssa.oauth.InitOpenLoginConfig; import org.gonetbar.ssa.util.OauthLoginMustParam; import org.jasig.cas.support.oauth.OAuthConfiguration; import org.jasig.cas.support.oauth.OAuthUtils; import org.scribe.up.provider.OAuthProvider; import org.scribe.up.session.HttpUserSession; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import com.godtips.common.UtilString; /** * 初始化第三方登录 * * @author Administrator * */ @Controller public final class LoginInitAction { @RequestMapping(value = "/oauth20/{providerKey}/initlogin.do") public String initlogin(@PathVariable("providerKey") String providerKey, HttpServletRequest request, ModelMap model) { String nextUrl = null; try { String providerType = initOpenLoginConfig.getProviderTypeByKey(providerKey); if (!UtilString.isEmptyOrNullByTrim(providerType)) { final OAuthProvider provider = OAuthUtils.getProviderByType(this.providersDefinition.getProviders(), providerType); logger.debug("provider : {}", provider); if (null != provider) { HttpUserSession userSession = new HttpUserSession(request); OauthLoginMustParam.getMd5State(request, provider.getType(),true); nextUrl = provider.getAuthorizationUrl(userSession); } } else { logger.error("无效的登录操作!!![" + providerKey + "]信息异常"); } } catch (Exception e) { logger.error("初始化登录[" + providerKey + "]信息异常", e); } if (UtilString.isEmptyOrNullByTrim(nextUrl)) { return "/showerror/index.do"; } else { return "redirect:" + nextUrl; } } private static final Logger logger = LoggerFactory.getLogger(LoginInitAction.class); @NotNull private OAuthConfiguration providersDefinition; @NotNull private InitOpenLoginConfig initOpenLoginConfig; @Resource(name = "initOpenLoginConfig") public final void setInitOpenLoginConfig(InitOpenLoginConfig initOpenLoginConfig) { this.initOpenLoginConfig = initOpenLoginConfig; } @Resource(name = "providersDefinition") public final void setProvidersDefinition(OAuthConfiguration providersDefinition) { this.providersDefinition = providersDefinition; } }
[ "xiyangdewuse@163.com@2a8ee3b2-8dd8-4655-914c-8c2eb951bf61" ]
xiyangdewuse@163.com@2a8ee3b2-8dd8-4655-914c-8c2eb951bf61
7795e8c4454d44b6c77ceab84258c7f81f1e8fb6
004f0852399c720c38b531076c27208ccddd21e7
/src/main/java/com/tcs/product/web/rest/errors/ErrorConstants.java
de7cd78c0c6513e04cad0b82b221219927ee3805
[]
no_license
agamgupta6/TR-Micro
97d6f3c7834c2f509225cbc7b6d657b9da0daaba
a87b9456b0793726f38c15740c8c0441c3cba273
refs/heads/master
2022-12-20T20:51:44.572585
2019-11-02T15:13:39
2019-11-02T15:13:39
202,436,241
0
0
null
2022-12-16T05:02:58
2019-08-14T22:43:18
Java
UTF-8
Java
false
false
696
java
package com.tcs.product.web.rest.errors; import java.net.URI; public final class ErrorConstants { public static final String ERR_CONCURRENCY_FAILURE = "error.concurrencyFailure"; public static final String ERR_VALIDATION = "error.validation"; public static final String PROBLEM_BASE_URL = "https://www.jhipster.tech/problem"; public static final URI DEFAULT_TYPE = URI.create(PROBLEM_BASE_URL + "/problem-with-message"); public static final URI CONSTRAINT_VIOLATION_TYPE = URI.create(PROBLEM_BASE_URL + "/constraint-violation"); public static final URI ENTITY_NOT_FOUND_TYPE = URI.create(PROBLEM_BASE_URL + "/entity-not-found"); private ErrorConstants() { } }
[ "Administrador@BT346508.uio.bpichincha.com" ]
Administrador@BT346508.uio.bpichincha.com
b477f8781d6694b0c1d0210fe2f37b7ecdc6eef6
31d04f0c755ca4efa4123f195dd4477f9dd8d3e7
/app/src/main/java/com/example/rakib/myapplication/DialogFragment/DialogMainActivity.java
6b2e3faaef71fb9b76c0fd22d96e57f93f1fa78d
[]
no_license
mbiplobe/Weather
a0a0795052819fa38518eb4d5538bfbb05617dd0
932d3acfb5b810c1e3693b71b1f808e2f1a01b10
refs/heads/master
2016-09-10T18:50:27.724233
2015-08-31T06:09:55
2015-08-31T06:09:55
40,353,572
0
0
null
null
null
null
UTF-8
Java
false
false
1,890
java
package com.example.rakib.myapplication.DialogFragment; import android.app.FragmentManager; import android.os.Bundle; import android.support.v7.app.ActionBarActivity; import android.widget.ArrayAdapter; import android.widget.TextView; import com.androidweather.mbiplobe.weatherproject.R; import com.example.rakib.myapplication.DialogFragment.Location; import com.example.rakib.myapplication.DialogFragment.MyDialogFragment; import java.util.ArrayList; public class DialogMainActivity extends ActionBarActivity { private Location location; private TextView name,city; ArrayAdapter<String> adapter; // private Test test; // public DialogMainActivity(Test test) { // this(); // this.test=test; // } // // public DialogMainActivity() { // } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_dialog_main); FragmentManager fragmentManager=getFragmentManager(); MyDialogFragment myDialogFragment=new MyDialogFragment(); myDialogFragment.show(fragmentManager,"Simple Fragment"); name= (TextView) findViewById(R.id.name); city= (TextView) findViewById(R.id.email); // name.setText(test.getName()); // email.setText(test.getEmail()); } public void setObject(Location location){ this.location=location; // TextView name1= (TextView) findViewById(R.id.name); name.setText(location.getCountryName()); // TextView city= (TextView) findViewById(R.id.email); //TextView city= (TextView) findViewById(R.id.email); city.setText(location.getCountryCity()); } // public void setCountryName(View view){ // TextView name= (TextView) findViewById(R.id.name); // name.setText(test.getName().toString()); // } }
[ "mbiplobe@gmail.com" ]
mbiplobe@gmail.com
0b13cbed1355822eeba8ba56e9025b850d8f912d
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/alibaba--dubbo/67fb63d6ca428e4c08934f52f867a3c49edde51a/before/MergeServiceImpl.java
58e7c78ba6dfe80034017575d954bf9dc63beb00
[]
no_license
fracz/refactor-extractor
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
dd5e82bfcc376e74a99e18c2bf54c95676914272
refs/heads/master
2021-01-19T06:50:08.211003
2018-11-30T13:00:57
2018-11-30T13:00:57
87,353,478
0
0
null
null
null
null
UTF-8
Java
false
false
1,064
java
/* * Copyright 1999-2012 Alibaba Group. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.alibaba.dubbo.examples.merge.impl; import java.util.ArrayList; import java.util.List; import com.alibaba.dubbo.examples.merge.api.MergeService; /** * MenuServiceImpl * * @author william.liangf */ public class MergeServiceImpl implements MergeService { public List<String> mergeResult() { List<String> menus = new ArrayList<String>(); menus.add("group-1.1"); menus.add("group-1.2"); return menus; } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
947fb4eab947874739532a5db3a962a6a1465220
adc7cf954bc75cd159208073d2ce606a4e2e17ca
/tx-transport/src/main/java/cn/skadoosh/tx/transport/handler/ChannelHandlerAdapter.java
cd885b3fb93d321d86833b38cc0d4a27962335ff
[]
no_license
weaponready/tx-transport
58ca5802e4e48cf999b91f060a40413f11e834d1
a543b6dd0f3da56c97d9a91d0befcb8e373e0ec7
refs/heads/master
2021-06-20T07:52:10.184340
2018-11-17T02:48:46
2018-11-17T02:48:46
157,948,567
4
1
null
2021-01-05T06:58:35
2018-11-17T03:53:19
Java
UTF-8
Java
false
false
334
java
package cn.skadoosh.tx.transport.handler; import cn.skadoosh.tx.transport.TxChannel; /** * create by jimmy * 11/16/2018 3:17 PM */ public class ChannelHandlerAdapter implements ChannelHandler { @Override public void onConnect(TxChannel ctx) { } @Override public void onDisconnect(TxChannel ctx) { } }
[ "jimmy@xlet.org" ]
jimmy@xlet.org
4700ccf17cd11e340ba59984bc8e6635e7ae43a7
c0262a32b5afbf43420b41548169dd00cb4d004c
/app/src/main/java/com/example/banking_system/CustomeAdapterHistory.java
d7be248579d5e35ff29938660da958ec7d824e05
[]
no_license
smondal1174/Basic-Banking-System
e410414ca4760cf25fef4a4b01e88b11fee28885
53f63555f832314abe840ddff6e14c725b84cffc
refs/heads/master
2023-02-11T00:36:39.110826
2021-01-12T04:39:53
2021-01-12T04:39:53
328,871,341
0
0
null
null
null
null
UTF-8
Java
false
false
2,129
java
package com.example.banking_system; import android.content.Context; import android.graphics.Color; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; import java.util.List; public class CustomeAdapterHistory extends RecyclerView.Adapter<ViewHolder> { com.example.banking_system.HistoryList HistoryList; List<Model> modelList; Context context; TextView mTransc_status; public CustomeAdapterHistory(com.example.banking_system.HistoryList historyList, List<Model> modelList) { this.HistoryList = historyList; this.modelList = modelList; } @NonNull @Override public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.transfer_history_list, parent, false); mTransc_status = itemView.findViewById(R.id.transaction_status); ViewHolder viewHolder = new ViewHolder(itemView); viewHolder.setOnClickListener(new ViewHolder.ClickListener() { @Override public void onItemClick(View view, int position) { } }); return viewHolder; } @Override public void onBindViewHolder(@NonNull ViewHolder holder, int position) { holder.mName1.setText(modelList.get(position).getName1()); holder.mName2.setText(modelList.get(position).getName2()); holder.mBalance.setText(modelList.get(position).getBalance()); holder.mDate.setText(modelList.get(position).getDate()); holder.mTransc_status.setText(modelList.get(position).getTransaction_status()); if(modelList.get(position).getTransaction_status().equals("Failed")){ holder.mTransc_status.setTextColor(Color.parseColor("#f40404")); }else{ holder.mTransc_status.setTextColor(Color.parseColor("#4BB543")); } } @Override public int getItemCount() { return modelList.size(); } }
[ "subhadeep.mondal2001@gmail.com" ]
subhadeep.mondal2001@gmail.com
9026da4198bb008f8cfc7456f99fe4320f3910ae
f0e5f80404c41f388e73c86269ac527c4c9c3c22
/src/main/java/com/turing/system/mapper/SysUserRoleMapper.java
24bcf7f2e7134856fa074337540d4e0b3c3f409c
[]
no_license
kl578480894/test
f56916d55fa6ec754cf2555c6eceb47aa0c5400d
0e3206961cb76f7a3f8ec413319bb8d17c0edc09
refs/heads/master
2020-03-10T07:21:37.783016
2018-04-12T13:15:40
2018-04-12T13:15:40
129,261,317
0
0
null
2018-04-12T23:17:36
2018-04-12T14:08:52
JavaScript
UTF-8
Java
false
false
456
java
package com.turing.system.mapper; import com.turing.system.entity.SysUserRole; public interface SysUserRoleMapper { int deleteByPrimaryKey(String urId); int insert(SysUserRole record); int insertSelective(SysUserRole record); SysUserRole selectByPrimaryKey(String urId); int updateByPrimaryKeySelective(SysUserRole record); int updateByPrimaryKey(SysUserRole record); void deleteByUserId(String userId); }
[ "LGF@DESKTOP-H0E09A2.mshome.net" ]
LGF@DESKTOP-H0E09A2.mshome.net
46a2fe38545e1a7090ef2a39dac1a4061934af1e
50d14615a246ef1c3dff30d37bfcdbfb2255447f
/ASCH_Practice/src/main/java/Lesson7.java
9df52cb7360cc5d114e7cd0016c0a2bb9a9162b9
[]
no_license
PYeremeyev/ASCH-2019
7070226fbe170fb572cbe0bc6dab379c0b7daf89
62cda59eaa299e9033854042dddc32124e41971c
refs/heads/master
2022-12-02T02:57:32.650507
2019-09-05T15:12:14
2019-09-05T15:12:14
200,244,556
0
0
null
2022-11-16T12:40:24
2019-08-02T14:01:46
Java
UTF-8
Java
false
false
223
java
public class Lesson7 { public static String checkPositiveNegativeZero(int a){ if(a>0){ return "+"; } else if(a<0){ return "-"; }else return "zero"; } }
[ "Pavel_Yeremeev@rcomext.com" ]
Pavel_Yeremeev@rcomext.com
191af6c72dca15f7a9bff4784909941c6db5834c
3312b12b2106d36694beb7263bd44da70e4bbaae
/athena-xqjs/src/main/java/com/athena/xqjs/module/utils/xls/yaohlgl/SheetHandleryaohlzz.java
b0ee76851e1b92c9f631b1e79e55dde302a3e1d6
[]
no_license
liyq1406/athena
bff7110b4c8a16e47203b550979b42707b14f9a5
d83c9ef1c7548a52ab6c269183d5a016444f388e
refs/heads/master
2020-12-14T09:48:43.717312
2017-06-05T06:41:48
2017-06-05T06:41:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,928
java
package com.athena.xqjs.module.utils.xls.yaohlgl; import java.io.IOException; import java.sql.Connection; import java.text.ParseException; import java.util.Map; import jxl.Workbook; import jxl.read.biff.BiffException; import org.dom4j.Document; import com.toft.core2.dao.database.DbUtils; import com.toft.core3.ibatis.support.AbstractIBatisDao; /** * sheet处理器虚拟类 * @author chenlei * @vesion 1.0 * @date 2012-5-17 */ public abstract class SheetHandleryaohlzz { protected Workbook workbook; protected Document document; protected String sheet; protected String table; protected String clazz; protected String keys; protected String dateColumns; protected String dateFormats; protected Connection conn; public SheetHandleryaohlzz(Workbook workbook, String sheet, String table, String datasourceId, String clazz,String keys,String dateColumns,String dateFormats) { super(); this.workbook = workbook; this.sheet = sheet; this.table = table; this.conn = DbUtils.getConnection(datasourceId); this.clazz = clazz; this.keys = keys; this.dateColumns = dateColumns; this.dateFormats = dateFormats; } /** * 为了作为xml文件处理 * @param document * @param sheet * @param table * @param datasourceId * @param clazz * @param keys * @param dateColumns * @param dateFormats */ public SheetHandleryaohlzz(Document document, String sheet, String table, String datasourceId, String clazz,String keys,String dateColumns,String dateFormats) { super(); this.document = document; this.sheet = sheet; this.table = table; this.conn = DbUtils.getConnection(datasourceId); this.clazz = clazz; this.keys = keys; this.dateColumns = dateColumns; this.dateFormats = dateFormats; } /** * /处理sheet内容 * @return 返回错误信息 * @throws ParseException * @throws IOException * @throws BiffException */ public abstract String doSheetHandler(String editor,Map<String,String> map,AbstractIBatisDao baseDao) throws BiffException, IOException, ParseException; public Workbook getWorkbook() { return workbook; } public void setWorkbook(Workbook workbook) { this.workbook = workbook; } public String getSheet() { return sheet; } public void setSheet(String sheet) { this.sheet = sheet; } public String getTable() { return table; } public void setTable(String table) { this.table = table; } public String getClazz() { return clazz; } public void setClazz(String clazz) { this.clazz = clazz; } public String getKeys() { return keys; } public void setKeys(String keys) { this.keys = keys; } public String getDateColumns() { return dateColumns; } public void setDateColumns(String dateColumns) { this.dateColumns = dateColumns; } public String getDateFormats() { return dateFormats; } public void setDateFormats(String dateFormats) { this.dateFormats = dateFormats; } }
[ "Administrator@ISS110302000330.isoftstone.com" ]
Administrator@ISS110302000330.isoftstone.com
cda76dfab3329869f8c8cb8a4c302be9cc4c12b6
099b16ccd190f927c1d328bb5059a49f059bcd80
/src/main/java/cn/shiyun/cache/RedisCache.java
fb8c27b59ed318f37bfebb0eff319b8e7bb59739
[]
no_license
TaoPengFei/Infomanager
211f5cca6eeb608947324855cddfb86187c7cdb0
7772c6decf1b6c4b955ad328235213e021b77955
refs/heads/master
2021-01-01T16:15:08.937675
2018-01-29T09:24:54
2018-01-29T09:24:54
97,795,688
0
0
null
null
null
null
UTF-8
Java
false
false
4,432
java
package cn.shiyun.cache; import org.apache.ibatis.cache.Cache; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.data.redis.connection.jedis.JedisConnection; import org.springframework.data.redis.connection.jedis.JedisConnectionFactory; import org.springframework.data.redis.serializer.JdkSerializationRedisSerializer; import org.springframework.data.redis.serializer.RedisSerializer; import redis.clients.jedis.exceptions.JedisConnectionException; import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock; /** * Created by 陶鹏飞 on 2017/7/26. */ /* * 使用第三方缓存服务器,处理二级缓存 */ public class RedisCache implements Cache { private static final Logger logger = LoggerFactory.getLogger(RedisCache.class); private static JedisConnectionFactory jedisConnectionFactory; private final String id; /** * The {@code ReadWriteLock}. */ private final ReadWriteLock readWriteLock = new ReentrantReadWriteLock(); public RedisCache(final String id) { if (id == null) { throw new IllegalArgumentException("Cache instances require an ID"); } logger.debug("MybatisRedisCache:id=" + id); this.id = id; } @Override public void clear() { JedisConnection connection = null; try { connection = (JedisConnection) jedisConnectionFactory.getConnection(); connection.flushDb(); connection.flushAll(); } catch (JedisConnectionException e){ e.printStackTrace(); } finally { if (connection != null) { connection.close(); } } } @Override public String getId() { return this.id; } @Override public Object getObject(Object key) { Object result = null; JedisConnection connection = null; try { connection = (JedisConnection) jedisConnectionFactory.getConnection(); RedisSerializer<Object> serializer = new JdkSerializationRedisSerializer(); result = serializer.deserialize(connection.get(serializer.serialize(key))); } catch (JedisConnectionException e) { e.printStackTrace(); } finally { if (connection != null) { connection.close(); } } return result; } @Override public ReadWriteLock getReadWriteLock() { return this.readWriteLock; } @Override public int getSize() { int result = 0; JedisConnection connection = null; try { connection = (JedisConnection) jedisConnectionFactory.getConnection(); result = Integer.valueOf(connection.dbSize().toString()); } catch (JedisConnectionException e) { e.printStackTrace(); } finally { if (connection != null) { connection.close(); } } return result; } @Override public void putObject(Object key, Object value) { JedisConnection connection = null; try { connection = (JedisConnection) jedisConnectionFactory.getConnection(); RedisSerializer<Object> serializer = new JdkSerializationRedisSerializer(); connection.set(serializer.serialize(key), serializer.serialize(value)); } catch (JedisConnectionException e) { e.printStackTrace(); } finally { if (connection != null) { connection.close(); } } } @Override public Object removeObject(Object key) { JedisConnection connection = null; Object result = null; try { connection = (JedisConnection) jedisConnectionFactory.getConnection(); RedisSerializer<Object> serializer = new JdkSerializationRedisSerializer(); result =connection.expire(serializer.serialize(key), 0); } catch (JedisConnectionException e) { e.printStackTrace(); } finally { if (connection != null) { connection.close(); } } return result; } public static void setJedisConnectionFactory(JedisConnectionFactory jedisConnectionFactory) { RedisCache.jedisConnectionFactory = jedisConnectionFactory; } }
[ "302665611@qq.com" ]
302665611@qq.com
a6f242379a1dc3d4f7a8db7e30b5e6c99e69cacf
ad85a87c5a1241901df561823cb30ecba2d0ac69
/src/empguadalupe/Menu/Evaluacion/planos/PlanoS1evaPE.java
607640d24c2c9b2209ef1487239224543a175f9b
[]
no_license
alejandrozambrano28/Guadalupe
f25eaaec99adc24bdd58a65d4d0fb3d772ec8fb3
ed9fceba95d193cb84f734237838c861aeb7c2a0
refs/heads/master
2021-01-19T05:39:31.611560
2017-07-04T16:32:09
2017-07-04T16:32:09
87,439,320
0
0
null
null
null
null
UTF-8
Java
false
false
38,614
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 empguadalupe.Menu.Evaluacion.planos; import com.sun.glass.ui.Cursor; import empguadalupe.Menu.Evaluacion.Secuencias.ParoEmergenciaEVA; import java.awt.Image; import java.awt.Point; import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.JOptionPane; /** * * @author lzambrs */ public class PlanoS1evaPE extends javax.swing.JFrame implements ActionListener { int contErrores; int conPreguntas; boolean bande1 = false; boolean bande2 = false; boolean bande3 = false; boolean bande4 = false; boolean bande5 = false; boolean bande6 = false; boolean bande7 = false; boolean bande8 = false; boolean bande9 = false; boolean bande10 = false; boolean bande11 = false; boolean bande12 = false; boolean bande13 = false; boolean bande14 = false; boolean bande15 = false; boolean bande16 = false; boolean bande17 = false; boolean bande18 = false; int nument=0; /** * Creates new form PlanoBomba */ public PlanoS1evaPE(int numeroboton,int numentrada) { initComponents(); this.setResizable(false); nument=numentrada; switch (numeroboton) { case 1: bande1 = true; break; case 2: bande2 = true; break; case 3: bande3 = true; bande9 = true; bande10 = true; break; case 4: bande4 = true; bande11 = true; bande12 = true; break; case 5: bande5 = true; bande13 = true; bande14 = true; break; case 6: bande6 = true; bande17 = true; bande18 = true; break; case 7: bande7 = true; bande15 = true; bande16 = true; break; case 8: bande8 = true; break; } } private PlanoS1evaPE() { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } public PlanoS1evaPE(int i) { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel1 = new javax.swing.JLabel(); btn1 = new javax.swing.JButton(); btn2 = new javax.swing.JButton(); btn3 = new javax.swing.JButton(); btn4 = new javax.swing.JButton(); btn5 = new javax.swing.JButton(); btn6 = new javax.swing.JButton(); btn7 = new javax.swing.JButton(); btn8 = new javax.swing.JButton(); btn9 = new javax.swing.JButton(); btn10 = new javax.swing.JButton(); btn11 = new javax.swing.JButton(); btn12 = new javax.swing.JButton(); btn13 = new javax.swing.JButton(); btn14 = new javax.swing.JButton(); btn15 = new javax.swing.JButton(); btn16 = new javax.swing.JButton(); btn17 = new javax.swing.JButton(); btn18 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setUndecorated(true); setResizable(false); addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { formMousePressed(evt); } }); getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imgmaquina/plano S1_1.png"))); // NOI18N jLabel1.setOpaque(true); getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 1090, 460)); btn1.setText("jButton1"); btn1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); btn1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn1ActionPerformed(evt); } }); getContentPane().add(btn1, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 260, 90, 140)); btn2.setText("jButton2"); btn2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn2ActionPerformed(evt); } }); getContentPane().add(btn2, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 20, 140, 120)); btn3.setText("jButton3"); btn3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn3ActionPerformed(evt); } }); getContentPane().add(btn3, new org.netbeans.lib.awtextra.AbsoluteConstraints(340, 330, 50, 40)); btn4.setText("jButton4"); btn4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn4ActionPerformed(evt); } }); getContentPane().add(btn4, new org.netbeans.lib.awtextra.AbsoluteConstraints(340, 210, 60, 50)); btn5.setText("jButton5"); btn5.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn5ActionPerformed(evt); } }); getContentPane().add(btn5, new org.netbeans.lib.awtextra.AbsoluteConstraints(380, 310, 40, 40)); btn6.setText("jButton6"); btn6.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn6ActionPerformed(evt); } }); getContentPane().add(btn6, new org.netbeans.lib.awtextra.AbsoluteConstraints(500, 370, -1, 30)); btn7.setText("jButton7"); btn7.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn7ActionPerformed(evt); } }); getContentPane().add(btn7, new org.netbeans.lib.awtextra.AbsoluteConstraints(550, 100, 90, 70)); btn8.setText("jButton8"); btn8.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn8ActionPerformed(evt); } }); getContentPane().add(btn8, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 353, 40, 30)); btn9.setText("jButton3"); btn9.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn9ActionPerformed(evt); } }); getContentPane().add(btn9, new org.netbeans.lib.awtextra.AbsoluteConstraints(550, 330, 50, 40)); btn10.setText("jButton3"); btn10.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn10ActionPerformed(evt); } }); getContentPane().add(btn10, new org.netbeans.lib.awtextra.AbsoluteConstraints(760, 323, 50, 40)); btn11.setText("jButton4"); btn11.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn11ActionPerformed(evt); } }); getContentPane().add(btn11, new org.netbeans.lib.awtextra.AbsoluteConstraints(550, 200, 60, 50)); btn12.setText("jButton4"); btn12.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn12ActionPerformed(evt); } }); getContentPane().add(btn12, new org.netbeans.lib.awtextra.AbsoluteConstraints(750, 200, 60, 50)); btn13.setText("jButton5"); btn13.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn13ActionPerformed(evt); } }); getContentPane().add(btn13, new org.netbeans.lib.awtextra.AbsoluteConstraints(590, 310, 40, 40)); btn14.setText("jButton5"); btn14.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn14ActionPerformed(evt); } }); getContentPane().add(btn14, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 310, 40, 40)); btn15.setText("jButton7"); btn15.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn15ActionPerformed(evt); } }); getContentPane().add(btn15, new org.netbeans.lib.awtextra.AbsoluteConstraints(740, 100, 90, 70)); btn16.setText("jButton7"); btn16.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn16ActionPerformed(evt); } }); getContentPane().add(btn16, new org.netbeans.lib.awtextra.AbsoluteConstraints(333, 100, 90, 70)); btn17.setText("jButton6"); btn17.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn17ActionPerformed(evt); } }); getContentPane().add(btn17, new org.netbeans.lib.awtextra.AbsoluteConstraints(700, 370, -1, 30)); btn18.setText("jButton6"); btn18.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn18ActionPerformed(evt); } }); getContentPane().add(btn18, new org.netbeans.lib.awtextra.AbsoluteConstraints(280, 373, -1, 30)); pack(); }// </editor-fold>//GEN-END:initComponents private void btn1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn1ActionPerformed if (bande1 == true) { ParoEmergenciaEVA arra = new ParoEmergenciaEVA(); arra.pu2[18] = contErrores; arra.preguntas[18] = 1; JOptionPane.showMessageDialog(rootPane, "correcto"); dispose(); } else { Image im = Toolkit.getDefaultToolkit().createImage("src\\imgfondo\\error.png"); java.awt.Cursor cur = Toolkit.getDefaultToolkit().createCustomCursor(im, new Point(10, 10), "WILL"); setCursor(cur); try { Thread.sleep(300); // 1000 milisegundos (10 segundos) } catch (InterruptedException ex) { Logger.getLogger(ParoEmergenciaEVA.class.getName()).log(Level.SEVERE, null, ex); } this.setCursor(new java.awt.Cursor(Cursor.CURSOR_CUSTOM)); } }//GEN-LAST:event_btn1ActionPerformed private void formMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMousePressed contErrores = contErrores + 1; Image im = Toolkit.getDefaultToolkit().createImage("src\\imgfondo\\error.png"); java.awt.Cursor cur = Toolkit.getDefaultToolkit().createCustomCursor(im, new Point(10, 10), "WILL"); setCursor(cur); try { Thread.sleep(300); // 1000 milisegundos (10 segundos) } catch (InterruptedException ex) { Logger.getLogger(ParoEmergenciaEVA.class.getName()).log(Level.SEVERE, null, ex); } this.setCursor(new java.awt.Cursor(Cursor.CURSOR_CUSTOM)); }//GEN-LAST:event_formMousePressed private void btn2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn2ActionPerformed if (bande2 == true) { } else { Image im = Toolkit.getDefaultToolkit().createImage("src\\imgfondo\\error.png"); java.awt.Cursor cur = Toolkit.getDefaultToolkit().createCustomCursor(im, new Point(10, 10), "WILL"); setCursor(cur); try { Thread.sleep(300); // 1000 milisegundos (10 segundos) } catch (InterruptedException ex) { Logger.getLogger(ParoEmergenciaEVA.class.getName()).log(Level.SEVERE, null, ex); } this.setCursor(new java.awt.Cursor(Cursor.CURSOR_CUSTOM)); }// TODO add your handling code here: }//GEN-LAST:event_btn2ActionPerformed private void btn14ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn14ActionPerformed if (bande14 == true) { ParoEmergenciaEVA arra = new ParoEmergenciaEVA(); arra.pu2[20] = contErrores; arra.preguntas[20] = 1; JOptionPane.showMessageDialog(rootPane, "correcto"); dispose(); } else { Image im = Toolkit.getDefaultToolkit().createImage("src\\imgfondo\\error.png"); java.awt.Cursor cur = Toolkit.getDefaultToolkit().createCustomCursor(im, new Point(10, 10), "WILL"); setCursor(cur); try { Thread.sleep(300); // 1000 milisegundos (10 segundos) } catch (InterruptedException ex) { Logger.getLogger(ParoEmergenciaEVA.class.getName()).log(Level.SEVERE, null, ex); } this.setCursor(new java.awt.Cursor(Cursor.CURSOR_CUSTOM)); }// TODO add your handling code here: }//GEN-LAST:event_btn14ActionPerformed private void btn18ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn18ActionPerformed if (bande18 == true) { ParoEmergenciaEVA arra = new ParoEmergenciaEVA(); arra.pu2[21+nument] = contErrores; arra.preguntas[21+nument] = 1; JOptionPane.showMessageDialog(rootPane, "correcto"); dispose(); } else { Image im = Toolkit.getDefaultToolkit().createImage("src\\imgfondo\\error.png"); java.awt.Cursor cur = Toolkit.getDefaultToolkit().createCustomCursor(im, new Point(10, 10), "WILL"); setCursor(cur); try { Thread.sleep(300); // 1000 milisegundos (10 segundos) } catch (InterruptedException ex) { Logger.getLogger(ParoEmergenciaEVA.class.getName()).log(Level.SEVERE, null, ex); } this.setCursor(new java.awt.Cursor(Cursor.CURSOR_CUSTOM)); } // TODO add your handling code here: }//GEN-LAST:event_btn18ActionPerformed private void btn3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn3ActionPerformed if (bande3 == true) { ParoEmergenciaEVA arra = new ParoEmergenciaEVA(); arra.pu2[19] = contErrores; arra.preguntas[19] = 1; JOptionPane.showMessageDialog(rootPane, "correcto"); dispose(); } else { Image im = Toolkit.getDefaultToolkit().createImage("src\\imgfondo\\error.png"); java.awt.Cursor cur = Toolkit.getDefaultToolkit().createCustomCursor(im, new Point(10, 10), "WILL"); setCursor(cur); try { Thread.sleep(300); // 1000 milisegundos (10 segundos) } catch (InterruptedException ex) { Logger.getLogger(ParoEmergenciaEVA.class.getName()).log(Level.SEVERE, null, ex); } this.setCursor(new java.awt.Cursor(Cursor.CURSOR_CUSTOM)); } // TODO add your handling code here: }//GEN-LAST:event_btn3ActionPerformed private void btn4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn4ActionPerformed if (bande4 == true) { } else { Image im = Toolkit.getDefaultToolkit().createImage("src\\imgfondo\\error.png"); java.awt.Cursor cur = Toolkit.getDefaultToolkit().createCustomCursor(im, new Point(10, 10), "WILL"); setCursor(cur); try { Thread.sleep(300); // 1000 milisegundos (10 segundos) } catch (InterruptedException ex) { Logger.getLogger(ParoEmergenciaEVA.class.getName()).log(Level.SEVERE, null, ex); } this.setCursor(new java.awt.Cursor(Cursor.CURSOR_CUSTOM)); } // TODO add your handling code here: }//GEN-LAST:event_btn4ActionPerformed private void btn16ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn16ActionPerformed if (bande16 == true) { ParoEmergenciaEVA arra = new ParoEmergenciaEVA(); arra.pu2[28] = contErrores; arra.preguntas[28] = 1; JOptionPane.showMessageDialog(rootPane, "correcto"); dispose(); } else { Image im = Toolkit.getDefaultToolkit().createImage("src\\imgfondo\\error.png"); java.awt.Cursor cur = Toolkit.getDefaultToolkit().createCustomCursor(im, new Point(10, 10), "WILL"); setCursor(cur); try { Thread.sleep(300); // 1000 milisegundos (10 segundos) } catch (InterruptedException ex) { Logger.getLogger(ParoEmergenciaEVA.class.getName()).log(Level.SEVERE, null, ex); } this.setCursor(new java.awt.Cursor(Cursor.CURSOR_CUSTOM)); } // TODO add your handling code here: }//GEN-LAST:event_btn16ActionPerformed private void btn8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn8ActionPerformed if (bande8 == true) { ParoEmergenciaEVA arra = new ParoEmergenciaEVA(); arra.pu2[29+nument] = contErrores; arra.preguntas[29+nument] = 1; JOptionPane.showMessageDialog(rootPane, "correcto"); dispose(); } else { Image im = Toolkit.getDefaultToolkit().createImage("src\\imgfondo\\error.png"); java.awt.Cursor cur = Toolkit.getDefaultToolkit().createCustomCursor(im, new Point(10, 10), "WILL"); setCursor(cur); try { Thread.sleep(300); // 1000 milisegundos (10 segundos) } catch (InterruptedException ex) { Logger.getLogger(ParoEmergenciaEVA.class.getName()).log(Level.SEVERE, null, ex); } this.setCursor(new java.awt.Cursor(Cursor.CURSOR_CUSTOM)); } }//GEN-LAST:event_btn8ActionPerformed private void btn5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn5ActionPerformed if (bande5 == true) { ParoEmergenciaEVA arra = new ParoEmergenciaEVA(); arra.pu2[20] = contErrores; arra.preguntas[20] = 1; JOptionPane.showMessageDialog(rootPane, "correcto"); dispose(); } else { Image im = Toolkit.getDefaultToolkit().createImage("src\\imgfondo\\error.png"); java.awt.Cursor cur = Toolkit.getDefaultToolkit().createCustomCursor(im, new Point(10, 10), "WILL"); setCursor(cur); try { Thread.sleep(300); // 1000 milisegundos (10 segundos) } catch (InterruptedException ex) { Logger.getLogger(ParoEmergenciaEVA.class.getName()).log(Level.SEVERE, null, ex); } this.setCursor(new java.awt.Cursor(Cursor.CURSOR_CUSTOM)); }// TODO add your handling code here: }//GEN-LAST:event_btn5ActionPerformed private void btn6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn6ActionPerformed if (bande6 == true) { ParoEmergenciaEVA arra = new ParoEmergenciaEVA(); arra.pu2[21+nument] = contErrores; arra.preguntas[21+nument] = 1; JOptionPane.showMessageDialog(rootPane, "correcto"); dispose(); } else { Image im = Toolkit.getDefaultToolkit().createImage("src\\imgfondo\\error.png"); java.awt.Cursor cur = Toolkit.getDefaultToolkit().createCustomCursor(im, new Point(10, 10), "WILL"); setCursor(cur); try { Thread.sleep(300); // 1000 milisegundos (10 segundos) } catch (InterruptedException ex) { Logger.getLogger(ParoEmergenciaEVA.class.getName()).log(Level.SEVERE, null, ex); } this.setCursor(new java.awt.Cursor(Cursor.CURSOR_CUSTOM)); }// TODO add your handling code here: }//GEN-LAST:event_btn6ActionPerformed private void btn9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn9ActionPerformed if (bande9 == true) { ParoEmergenciaEVA arra = new ParoEmergenciaEVA(); arra.pu2[19] = contErrores; arra.preguntas[19] = 1; JOptionPane.showMessageDialog(rootPane, "correcto"); dispose(); } else { Image im = Toolkit.getDefaultToolkit().createImage("src\\imgfondo\\error.png"); java.awt.Cursor cur = Toolkit.getDefaultToolkit().createCustomCursor(im, new Point(10, 10), "WILL"); setCursor(cur); try { Thread.sleep(300); // 1000 milisegundos (10 segundos) } catch (InterruptedException ex) { Logger.getLogger(ParoEmergenciaEVA.class.getName()).log(Level.SEVERE, null, ex); } this.setCursor(new java.awt.Cursor(Cursor.CURSOR_CUSTOM)); }// TODO add your handling code here: }//GEN-LAST:event_btn9ActionPerformed private void btn13ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn13ActionPerformed if (bande13 == true) { ParoEmergenciaEVA arra = new ParoEmergenciaEVA(); arra.pu2[20] = contErrores; arra.preguntas[20] = 1; JOptionPane.showMessageDialog(rootPane, "correcto"); dispose(); } else { Image im = Toolkit.getDefaultToolkit().createImage("src\\imgfondo\\error.png"); java.awt.Cursor cur = Toolkit.getDefaultToolkit().createCustomCursor(im, new Point(10, 10), "WILL"); setCursor(cur); try { Thread.sleep(300); // 1000 milisegundos (10 segundos) } catch (InterruptedException ex) { Logger.getLogger(ParoEmergenciaEVA.class.getName()).log(Level.SEVERE, null, ex); } this.setCursor(new java.awt.Cursor(Cursor.CURSOR_CUSTOM)); }// TODO add your handling code here: }//GEN-LAST:event_btn13ActionPerformed private void btn11ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn11ActionPerformed if (bande11 == true) { } else { Image im = Toolkit.getDefaultToolkit().createImage("src\\imgfondo\\error.png"); java.awt.Cursor cur = Toolkit.getDefaultToolkit().createCustomCursor(im, new Point(10, 10), "WILL"); setCursor(cur); try { Thread.sleep(300); // 1000 milisegundos (10 segundos) } catch (InterruptedException ex) { Logger.getLogger(ParoEmergenciaEVA.class.getName()).log(Level.SEVERE, null, ex); } this.setCursor(new java.awt.Cursor(Cursor.CURSOR_CUSTOM)); }// TODO add your handling code here: }//GEN-LAST:event_btn11ActionPerformed private void btn7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn7ActionPerformed if (bande7 == true) { ParoEmergenciaEVA arra = new ParoEmergenciaEVA(); arra.pu2[28] = contErrores; arra.preguntas[28] = 1; JOptionPane.showMessageDialog(rootPane, "correcto"); dispose(); } else { Image im = Toolkit.getDefaultToolkit().createImage("src\\imgfondo\\error.png"); java.awt.Cursor cur = Toolkit.getDefaultToolkit().createCustomCursor(im, new Point(10, 10), "WILL"); setCursor(cur); try { Thread.sleep(300); // 1000 milisegundos (10 segundos) } catch (InterruptedException ex) { Logger.getLogger(ParoEmergenciaEVA.class.getName()).log(Level.SEVERE, null, ex); } this.setCursor(new java.awt.Cursor(Cursor.CURSOR_CUSTOM)); }// TODO add your handling code here: }//GEN-LAST:event_btn7ActionPerformed private void btn17ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn17ActionPerformed if (bande17 == true) { ParoEmergenciaEVA arra = new ParoEmergenciaEVA(); arra.pu2[21+nument] = contErrores; arra.preguntas[21+nument] = 1; JOptionPane.showMessageDialog(rootPane, "correcto"); dispose(); } else { Image im = Toolkit.getDefaultToolkit().createImage("src\\imgfondo\\error.png"); java.awt.Cursor cur = Toolkit.getDefaultToolkit().createCustomCursor(im, new Point(10, 10), "WILL"); setCursor(cur); try { Thread.sleep(300); // 1000 milisegundos (10 segundos) } catch (InterruptedException ex) { Logger.getLogger(ParoEmergenciaEVA.class.getName()).log(Level.SEVERE, null, ex); } this.setCursor(new java.awt.Cursor(Cursor.CURSOR_CUSTOM)); }// TODO add your handling code here: }//GEN-LAST:event_btn17ActionPerformed private void btn10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn10ActionPerformed if (bande10 == true) { ParoEmergenciaEVA arra = new ParoEmergenciaEVA(); arra.pu2[19] = contErrores; arra.preguntas[19] = 1; JOptionPane.showMessageDialog(rootPane, "correcto"); dispose(); } else { Image im = Toolkit.getDefaultToolkit().createImage("src\\imgfondo\\error.png"); java.awt.Cursor cur = Toolkit.getDefaultToolkit().createCustomCursor(im, new Point(10, 10), "WILL"); setCursor(cur); try { Thread.sleep(300); // 1000 milisegundos (10 segundos) } catch (InterruptedException ex) { Logger.getLogger(ParoEmergenciaEVA.class.getName()).log(Level.SEVERE, null, ex); } this.setCursor(new java.awt.Cursor(Cursor.CURSOR_CUSTOM)); }// TODO add your handling code here: }//GEN-LAST:event_btn10ActionPerformed private void btn12ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn12ActionPerformed if (bande12 == true) { } else { Image im = Toolkit.getDefaultToolkit().createImage("src\\imgfondo\\error.png"); java.awt.Cursor cur = Toolkit.getDefaultToolkit().createCustomCursor(im, new Point(10, 10), "WILL"); setCursor(cur); try { Thread.sleep(300); // 1000 milisegundos (10 segundos) } catch (InterruptedException ex) { Logger.getLogger(ParoEmergenciaEVA.class.getName()).log(Level.SEVERE, null, ex); } this.setCursor(new java.awt.Cursor(Cursor.CURSOR_CUSTOM)); }// TODO add your handling code here: }//GEN-LAST:event_btn12ActionPerformed private void btn15ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn15ActionPerformed if (bande15 == true) { ParoEmergenciaEVA arra = new ParoEmergenciaEVA(); arra.pu2[28] = contErrores; arra.preguntas[28] = 1; JOptionPane.showMessageDialog(rootPane, "correcto"); dispose(); } else { Image im = Toolkit.getDefaultToolkit().createImage("src\\imgfondo\\error.png"); java.awt.Cursor cur = Toolkit.getDefaultToolkit().createCustomCursor(im, new Point(10, 10), "WILL"); setCursor(cur); try { Thread.sleep(300); // 1000 milisegundos (10 segundos) } catch (InterruptedException ex) { Logger.getLogger(ParoEmergenciaEVA.class.getName()).log(Level.SEVERE, null, ex); } this.setCursor(new java.awt.Cursor(Cursor.CURSOR_CUSTOM)); }// TODO add your handling code here: }//GEN-LAST:event_btn15ActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(PlanoS1evaPE.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(PlanoS1evaPE.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(PlanoS1evaPE.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(PlanoS1evaPE.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new PlanoS1evaPE().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btn1; private javax.swing.JButton btn10; private javax.swing.JButton btn11; private javax.swing.JButton btn12; private javax.swing.JButton btn13; private javax.swing.JButton btn14; private javax.swing.JButton btn15; private javax.swing.JButton btn16; private javax.swing.JButton btn17; private javax.swing.JButton btn18; private javax.swing.JButton btn2; private javax.swing.JButton btn3; private javax.swing.JButton btn4; private javax.swing.JButton btn5; private javax.swing.JButton btn6; private javax.swing.JButton btn7; private javax.swing.JButton btn8; private javax.swing.JButton btn9; private javax.swing.JLabel jLabel1; // End of variables declaration//GEN-END:variables @Override public void actionPerformed(ActionEvent e) { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } }
[ "lzambrs@CMONTOYE5.corp.epm.com.co" ]
lzambrs@CMONTOYE5.corp.epm.com.co
3c58e008511a6c866d40e4c5f7edbf9cbbf657d3
2eba2872e5ed674e2414b2927a97c7bbbc7f895e
/src/exam/Overriden.java
ee44958ed68eb2d9f5ae624a1e8b943a67dd8cc8
[]
no_license
julbarg/OCA
fefebb3d188eae9218fc34b3c20c98d2d66f4d93
3c6411626accd6fc36e794e8513dc992066997ca
refs/heads/master
2021-01-12T10:45:49.875143
2016-12-07T22:03:15
2016-12-07T22:03:15
72,682,570
0
0
null
null
null
null
UTF-8
Java
false
false
283
java
package exam; public class Overriden { } class WrapperPadre { } class WrapperHijo extends WrapperPadre{ } class PadreO { public WrapperHijo getP(){ return new WrapperHijo(); } } class HijoO extends Padre{ public WrapperPadre getP() { return new WrapperPadre(); } }
[ "julbarra@cobogpgp1381.global.publicisgroupe.net" ]
julbarra@cobogpgp1381.global.publicisgroupe.net
f847c08d6594f2cbf626f128097a27dedb8de86d
7b13ae51d28fcd8f28917756d96425baf227aeb4
/modules/metadata/datadictionaryImpl/src/main/java/org/youi/metadata/dictionary/service/impl/DataResourceManagerImpl.java
529f51c0e8f22c027ac1c0dcf7705dcb28983409
[]
no_license
zhyi12/youi-product
ee38b95a39bf3436fbf257e16dd992fe488336bf
1cc6ccee3b6c341024a94c04db0bd440264aa71d
refs/heads/master
2022-12-20T14:04:31.613283
2020-07-31T02:50:38
2020-07-31T02:50:38
203,384,105
2
3
null
2022-12-15T23:38:49
2019-08-20T13:39:39
Java
UTF-8
Java
false
false
3,734
java
/* * YOUI框架 * Copyright 2018 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.youi.metadata.dictionary.service.impl; import java.util.List; import java.util.Collection; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.youi.framework.core.orm.Condition; import org.youi.framework.core.orm.Order; import org.youi.framework.core.orm.Pager; import org.youi.framework.core.orm.PagerRecords; import org.youi.framework.esb.annotation.*; import org.youi.framework.util.StringUtils; import org.youi.metadata.dictionary.entity.DataResource; import org.youi.metadata.dictionary.mongo.DataResourceDao; import org.youi.metadata.dictionary.service.DataResourceManager; /** * <p>系统描述: </p> * <p>功能描述 :</p> * @author 代码生成器 * @since 1.0.0 */ @Service("dataResourceManager") public class DataResourceManagerImpl implements DataResourceManager{ @Autowired(required = false) private DataResourceDao dataResourceDao; /** * setter * @param dataResourceDao */ public void setDataResourceDao(DataResourceDao dataResourceDao) { this.dataResourceDao = dataResourceDao; } /** * 条件查询列表 */ @EsbServiceMapping(trancode="8001030201",caption="列表数据资源") @Override public List<DataResource> getDataResources( @ConditionCollection(domainClazz=DataResource.class) Collection<Condition> conditions, @OrderCollection Collection<Order> orders){ return dataResourceDao.commonQuery(conditions, orders); } /** * 根据主键查询 */ @EsbServiceMapping(trancode="8001030202",caption="主键查询数据资源") @Override public DataResource getDataResource(@ServiceParam(name="id") String id) { return dataResourceDao.get(id); } @EsbServiceMapping(trancode="8001030203",caption="分页查询数据资源", dataAccesses = {@DataAccess(name = "datasource",property = "catalog")}) @Override public PagerRecords getPagerDataResources(Pager pager,//分页条件 @ConditionCollection(domainClazz=DataResource.class) Collection<Condition> conditions,//查询条件 @OrderCollection Collection<Order> orders) { PagerRecords pagerRecords = dataResourceDao.complexFindByPager(pager, conditions, orders); return pagerRecords; } /** * 保存对象 */ @EsbServiceMapping(trancode="8001030204",caption="保存数据资源") @Override public DataResource saveDataResource(DataResource o){ String dataResourceId = o.getId(); boolean isUpdate = StringUtils.isNotEmpty(dataResourceId); if(isUpdate){//修改 }else{//新增 o = o.buildKey(); } return dataResourceDao.save(o); } /** * 删除对象 */ @EsbServiceMapping(trancode="8001030205",caption="主键删除数据资源") @Override public void removeDataResource(@ServiceParam(name="id") String id){ dataResourceDao.remove(id); } public List<DataResource> findByDataResourceIdIn(String[] dataResourceIds){ return dataResourceDao.findByIdIn(dataResourceIds); } }
[ "zhouyi@gwssi.com.cn" ]
zhouyi@gwssi.com.cn
cf19a065bdbae24a7824e6e25e96cae936bc58b6
9e8145e54bc1589d89f232d5a97720be1c8da2c4
/src/damoim/controller/CreateMain.java
1d00507b355b6f8a928b03df9fa5ebdd4dabfcf5
[]
no_license
leejuwon92/Damoim2
fabf9902a575db09f04ff1d45c318f15bbf9a244
c7396aaa559421db7d2a50a923b83747bd212aeb
refs/heads/master
2023-08-08T16:19:01.604157
2020-11-11T07:48:36
2020-11-11T07:48:36
310,196,642
0
0
null
null
null
null
UTF-8
Java
false
false
1,289
java
package damoim.controller; import java.io.IOException; import java.io.PrintWriter; import java.util.List; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import damoim.dto.PostDTO; import damoim.service.ClientService; import net.sf.json.JSON; import net.sf.json.JSONArray; /** * Servlet implementation class MyPageMain */ @WebServlet("/createMain") public class CreateMain extends HttpServlet { private static final long serialVersionUID = 1L; protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); HttpSession session = request.getSession(); int userNo = (int)session.getAttribute("session_userNo"); List<PostDTO>createMoim = null; try { createMoim = ClientService.hostSelectMoimByMe(userNo); }catch(Exception e ) { e.printStackTrace(); } if(createMoim!=null) { JSONArray arr = JSONArray.fromObject(createMoim); PrintWriter out = response.getWriter(); out.println(arr); } } }
[ "KOSTA@192.168.0.194" ]
KOSTA@192.168.0.194
9602aa07b5522737c469001996d4fc636d416120
6606c6d0ded15b501d54197bfe1e27c0ce8c0cb2
/src/sample/BikeOrder.java
0b14e6311b42a80bfe06cbecc19545e87397459c
[]
no_license
alexeypant/JavaFXBicicleStore
f69f02315f1882394b6164220782478f4d795da9
f972232fff1f2b1f02991d89f835708c2ba3b188
refs/heads/master
2021-04-24T23:43:49.627485
2017-12-29T06:55:05
2017-12-29T06:55:05
115,696,046
0
0
null
null
null
null
UTF-8
Java
false
false
543
java
package sample; /** * Created by A63556 on 2017-12-29. */ public class BikeOrder { static void validateOrder(String bikeModel, int quantity) throws TooManyBikesException{ if ("UKRAINA".equals(bikeModel)&&(quantity > 3)){ throw new TooManyBikesException("Can not ship " + quantity + " bikes of the model " + bikeModel); } if ("ORLENOK".equals(bikeModel)&&(quantity > 5)){ throw new TooManyBikesException("Can not ship " + quantity + " bikes of the model " + bikeModel); } } }
[ "alexeypant@gmail.com" ]
alexeypant@gmail.com
fbdbae26d9d090e6105a3eb619a3e774d2420465
094e66aff18fd3a93ea24e4f23f5bc4efa5d71d6
/yit-education-user/yit-education-user-common/src/main/java/com/yuu/yit/education/user/common/bean/qo/SendSmsLogQO.java
f486c762bdb34c2d5e7960443d41e1a62726e0c3
[ "MIT", "Apache-2.0" ]
permissive
71yuu/YIT
55b76dbec855b8e67f42a7eb00e9fa8e919ec4cb
53bb7ba8b8e686b2857c1e2812a0f38bd32f57e3
refs/heads/master
2022-09-08T06:51:30.819760
2019-11-29T06:24:19
2019-11-29T06:24:19
216,706,258
0
0
Apache-2.0
2022-09-01T23:14:33
2019-10-22T02:27:22
Java
UTF-8
Java
false
false
911
java
package com.yuu.yit.education.user.common.bean.qo; import java.io.Serializable; import java.util.Date; import lombok.Data; import lombok.experimental.Accessors; /** * 用户发送短信日志 * * @author YZJ */ @Data @Accessors(chain = true) public class SendSmsLogQO implements Serializable { private static final long serialVersionUID = 1L; /** * 当前页 */ private int pageCurrent; /** * 每页记录数 */ private int pageSize; /** * 主键 */ private Long id; /** * 创建时间 */ private Date gmtCreate; /** * 短信模板 */ private String template; /** * 手机号码 */ private String mobile; /** * 验证码 */ private String smsCode; /** * 是否发送成功(1发送成功,0:发送失败) */ private Integer isSuccess; /** * 开始时间 */ private String beginGmtCreate; /** * 结束时间 */ private String endGmtCreate; }
[ "1225459207@qq.com" ]
1225459207@qq.com
1c57fdc5f4262b81ff81605d90cfee33f8b60dcd
7d1f337fd3f61b7fbfae2eaaaa25d8688b6d9c36
/src/main/java/com/elecnor/ecosystem/helper/ApplicationInvoiceHelper.java
e4b06fd574f0e6b0c746b97687ed7401ccbe883e
[]
no_license
rishuzproject/ES
9108fa75f2686b49e4b401c33fc0697759db9f96
d0a59ac648173cced063bba0f4449cd733f07319
refs/heads/master
2016-09-12T14:23:12.162906
2016-05-04T08:28:36
2016-05-04T08:28:36
58,035,298
0
0
null
null
null
null
UTF-8
Java
false
false
531
java
package com.elecnor.ecosystem.helper; import javax.servlet.http.HttpServletRequest; public class ApplicationInvoiceHelper { public Long setInvoiceIdToDelete(HttpServletRequest request) throws Exception{ Long invoiceId = 0L; try { if (request.getParameter("invoiceIdToDel") != null && request.getParameter("invoiceIdToDel") != "") { invoiceId = Long.parseLong(request.getParameter("invoiceIdToDel").trim()); } } catch (NumberFormatException e) { e.printStackTrace(); throw e; } return invoiceId; } }
[ "rishabh.prashar@cerridsolutions.com" ]
rishabh.prashar@cerridsolutions.com
7711264d44e67cc0717294dc6d452a09ecbf42ed
11939a669c95122f499009fc5836283a74b6b45c
/app/src/main/java/com/example/mvvm_1/getNumber/DataGenrater.java
be048402c6ffad995b66ee75269323028ef0f7f1
[]
no_license
kpatil392/kpmvvm
f4521da4b78d8cbcd8d3a32eac172876aa015109
e7977a2efee6d71e9b3400f5021bb60953111982
refs/heads/master
2022-04-19T11:43:43.450741
2020-04-12T12:35:04
2020-04-12T12:35:04
255,087,044
0
0
null
null
null
null
UTF-8
Java
false
false
851
java
package com.example.mvvm_1.getNumber; import androidx.lifecycle.MutableLiveData; import androidx.lifecycle.ViewModel; import java.util.Random; public class DataGenrater extends ViewModel { public static final String TAG="DataGenrater"; //private String mRandomGenrater; private MutableLiveData<String> mRandomGenrater; public MutableLiveData<String> grtNumber() { if(mRandomGenrater==null) { mRandomGenrater=new MutableLiveData<>(); createNumber(); } return mRandomGenrater; } public void createNumber() { Random random=new Random(); // mRandomGenrater="Number = "+random.nextInt(10-1)+1; mRandomGenrater.setValue("Number = "+random.nextInt(10-1)+1); } @Override protected void onCleared() { super.onCleared(); } }
[ "kkbrothers0392@gmail.com" ]
kkbrothers0392@gmail.com
12549cbada90b6bc2052b0be77587d07f59961d8
9b162d6bf4803a054462cfb04705f09ee4913919
/src/java/com/noble/admin/action/AdminCategoryAction.java
bc5cda5750240a7edbf037024f1cdba746ac6dd3
[]
no_license
experttag/DeployAppNoble
afb465144027e4a91eb3f1090bcedae89ea444d0
a3bd9239ad920cbfd44c6814b0a611253f906e2c
refs/heads/master
2016-08-03T04:43:51.405811
2010-07-29T17:12:38
2010-07-29T17:12:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,069
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.noble.admin.action; import com.noble.admin.dao.CategoryDAO; import com.noble.admin.database.DBConnection; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; import org.apache.struts.actions.DispatchAction; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionForward; /** * * @author home */ public class AdminCategoryAction extends DispatchAction { private DBConnection database = null; private static Logger log = Logger.getLogger(AdminCategoryAction.class); public ActionForward addcategory(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { log.info("addcategory"); database = new DBConnection(); String categoryname = request.getParameter("categoryname"); CategoryDAO.addCategory(database, categoryname); request.getSession().setAttribute("categories", CategoryDAO.getAllCategory(database)); request.getSession().setAttribute("message","category has been added successfully") ; database.close(); return mapping.findForward("admincategory"); } public ActionForward deletecategory(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { log.info("deletecategory"); database = new DBConnection(); String categoryId = request.getParameter("categoryId"); CategoryDAO.removeCategory(database, categoryId); request.getSession().setAttribute("categories", CategoryDAO.getAllCategory(database)); request.getSession().setAttribute("message","category has been deleted successfully") ; database.close(); return mapping.findForward("admincategory"); } }
[ "nidhi.nandu@gmail.com" ]
nidhi.nandu@gmail.com
ba0c82401794d1308b5d87eabf5d92c4f3084da8
77a89c522ae46dce974607c3c6afa0bea424aaf9
/microservice-forex/src/main/java/com/ivan/mf/controller/ResourceServerConfig.java
4faee6206c2564d77a773ed7248af4ea32ef2f63
[ "MIT" ]
permissive
IvanStankov/spring-boot-examples
64ee7c2676737ba00ae0638a16e30c4e6d0e034a
7a05280c0fc768520656482abf58efd489d3ea7e
refs/heads/master
2020-03-22T03:37:07.152060
2018-09-11T22:00:13
2018-09-11T22:00:13
139,442,042
0
0
null
null
null
null
UTF-8
Java
false
false
2,028
java
package com.ivan.mf.controller; import org.springframework.boot.autoconfigure.security.oauth2.resource.JwtAccessTokenConverterConfigurer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer; import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter; import org.springframework.security.oauth2.config.annotation.web.configurers.ResourceServerSecurityConfigurer; import org.springframework.security.oauth2.provider.OAuth2Authentication; import org.springframework.security.oauth2.provider.token.AccessTokenConverter; import org.springframework.security.oauth2.provider.token.DefaultAccessTokenConverter; import java.util.Map; @Configuration @EnableResourceServer public class ResourceServerConfig extends ResourceServerConfigurerAdapter { @Override public void configure(ResourceServerSecurityConfigurer resources) throws Exception { resources.resourceId("mf"); } @Override public void configure(final HttpSecurity http) throws Exception { http.authorizeRequests() .antMatchers("/actuator/**").permitAll() .antMatchers("/**").authenticated(); } @Bean public JwtAccessTokenConverterConfigurer jwtAccessTokenConverterConfigurer() { return converter -> converter.setAccessTokenConverter(this.customAccessTokenConverter()); } @Bean public AccessTokenConverter customAccessTokenConverter() { return new DefaultAccessTokenConverter() { @Override public OAuth2Authentication extractAuthentication(Map<String, ?> map) { final OAuth2Authentication auth = super.extractAuthentication(map); auth.setDetails(map); return auth; } }; } }
[ "ivan.stankov1992@gmail.com" ]
ivan.stankov1992@gmail.com
acc7d43786524bc2f29cf09d3238876a1568fd73
86251f0a1a6d9599200d0920ad8f538314cc5d69
/xjob-util/xjob-util-log/log-util/src/main/java/org/shoper/log/util/annotation/LogModel.java
44ecbe949f79f8e9f8c187db13887d65930a7afb
[ "Apache-2.0" ]
permissive
ShawnShoper/x-job
50458e32d54e9e7de95d7d57db59acab1730577e
094defcc2c0159b853f43dd2a4b0ac229d6c6c8e
refs/heads/master
2021-09-06T20:15:22.368144
2018-02-11T00:00:34
2018-02-11T00:00:34
108,412,324
7
8
null
null
null
null
UTF-8
Java
false
false
309
java
package org.shoper.log.util.annotation; import java.lang.annotation.*; /** * Created by ShawnShoper on 2017/4/18. */ @Target({ElementType.METHOD, ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) @Documented /** * 日志业务模块 */ public @interface LogModel { String value() default ""; }
[ "xieh@daqsoft.com" ]
xieh@daqsoft.com
abbbba4e44340396700c8512cc6b71441a1eb805
8737b1690fab6dfd98a233218c519b68dd23bd2a
/app/src/androidTest/java/com/example/purcell7/getsmarta/ApplicationTest.java
12d276cba00a81dabcc44d0df4cff4b0cf5b9183
[]
no_license
DavidPurcell/Get_sMARTA
a78de17873aa2772132ce6555a65c69337b948f6
7f08a98f8e62a788837d390c34902628f45b709c
refs/heads/master
2021-01-17T16:42:13.523880
2017-02-25T20:05:42
2017-02-25T20:05:42
83,141,390
1
0
null
null
null
null
UTF-8
Java
false
false
361
java
package com.example.purcell7.getsmarta; import android.app.Application; import android.test.ApplicationTestCase; /** * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */ public class ApplicationTest extends ApplicationTestCase<Application> { public ApplicationTest() { super(Application.class); } }
[ "d.purcell222@gmail.com" ]
d.purcell222@gmail.com
245c10e0ea1c32fb98e2c23fe9da84815f847c35
6f1e0d9909828d7b9baa7f6bb666f0b82928866a
/Version1.java
f3ba8093f2354da437fcd3bdc332d075e1fe2d47
[]
no_license
huangtt9610/OOP-HW5
076aa99a22d263dc66837cb36b6b23ffb06d2521
cc9f79aad32a136ec90768272f89748982230b76
refs/heads/master
2021-04-26T22:52:09.941175
2019-04-04T18:14:01
2019-04-04T18:14:01
124,158,390
0
0
null
null
null
null
UTF-8
Java
false
false
677
java
import java.util.concurrent.ThreadLocalRandom; /** * * @author huangtt * */ public class Version1{ public static void main(String[] args) { long before = System.currentTimeMillis(); long run=4000000000L; double x,y; long outCircle=0; ThreadLocalRandom random = ThreadLocalRandom.current(); //https://www.concretepage.com/java/jdk7/threadlocalrandom-java-example for(long l=0; l<run; l++) { x=random.nextDouble(); y=random.nextDouble(); if((x*x+y*y)>1.0) outCircle++; } System.out.println((double)(run-outCircle)/run*4); System.out.println("Time: "+(System.currentTimeMillis()-before)+" ms"); } }
[ "noreply@github.com" ]
noreply@github.com
6f7e1663fb2082752e74eeb857b7502c74a17835
7f19b76e297921b74e597ea5d3e966176c038fd3
/src/main/java/com/example/infs3605_group_project/activities/InvestmentStrategy.java
ea88310fa66a53fe048d78544ca320c4ecf484b3
[]
no_license
Franklin-he/INFS3605-group-project
2e849332a68906a64d6b7392f9a6a488812fbf05
1f10d9b67a942e9b6238f4be862639d7dcb86762
refs/heads/master
2021-03-10T15:22:35.604487
2020-04-24T06:46:14
2020-04-24T06:46:14
246,464,048
0
1
null
2020-04-23T13:06:42
2020-03-11T03:19:19
Java
UTF-8
Java
false
false
426
java
package com.example.infs3605_group_project.activities; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import com.example.infs3605_group_project.R; public class InvestmentStrategy extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_investment_strategy); } }
[ "noreply@github.com" ]
noreply@github.com
e74c61a78e4ac1ae11e720d75a834ff230cf7d01
bcc19cd64f7dfa87d44840a7e4e7300de37e6da4
/Solid/src/Liskovsubstitution/Studio.java
504ba1e399e690fa10e09cc161e41dabc018eaf3
[]
no_license
SarahDowning/SOLIDPrinciples
4cbecd8fa387738ca9e8f1e49d89b48618e3a16e
6d096e1816719c9c880e89acfb1f39eb7ffffe79
refs/heads/main
2023-09-04T15:35:16.419780
2021-11-16T16:27:12
2021-11-16T16:27:12
428,634,899
0
0
null
2021-11-16T16:27:13
2021-11-16T11:51:12
null
UTF-8
Java
false
false
533
java
package Liskovsubstitution; // child class public class Studio { private int squareFootage; private int numberOfBedrooms; public Studio() { this.setNumberOfBedrooms(0); } // Getters and Setters public int getNumberOfBedrooms() { return numberOfBedrooms; } public void setNumberOfBedrooms(int numberOfBedrooms) { this.numberOfBedrooms = numberOfBedrooms; } public int getSquareFootage() { return squareFootage; } public void setSquareFootage(int squareFootage) { this.squareFootage = squareFootage; } }
[ "sarahdowningx@gmail.com" ]
sarahdowningx@gmail.com
92e74f95f2adf091c7edcb578fdf4add1bde9111
ec53870853c545fd8c7171a0ef445f5692ffff23
/src/main/java/com/centraprise/hrmodule/service/EmployeeService.java
d3598a2c21d16e87752bb27f5b3a6d95deccec70
[]
no_license
avinash4107/Centraprise2.0
e79d21035875f431a87c7a6a376bc16adda1053d
d2c2e08b81ce063140a65f995c9e42e27cfb9b9e
refs/heads/master
2020-04-30T21:21:30.074280
2019-03-22T07:21:20
2019-03-22T07:21:20
177,091,130
0
0
null
null
null
null
UTF-8
Java
false
false
432
java
package com.centraprise.hrmodule.service; import java.util.List; import com.centraprise.hrmodule.model.EmployeeCommand; import com.centraprise.hrmodule.model.EmployeeInfoListDTO; import com.centraprise.hrmodule.model.EmployeeListDTO; public interface EmployeeService { List<EmployeeListDTO> getEmployeesList(); void saveEmployee(EmployeeCommand employeeDetails); EmployeeInfoListDTO getEmployeeById(int employeenumber); }
[ "tech.avinash1995@gmail.com" ]
tech.avinash1995@gmail.com
a6e3c2e634d13bb5ab66d7b6242ead32735015af
126e8323dda50df0e26f799d7b66afd7b18f5ec6
/src/main/java/be/cloudway/gramba/test/lambda/GrambaHandler.java
aa210af2c438f287036fd1fd8d9c29c4f56197b1
[]
no_license
SirMomster/gramba-example-lambda
fd3617ea61d93698ae2831095faf9496c0301b79
0cba87e3bfae6bebd89e29d3268d837f4456002f
refs/heads/master
2021-01-26T00:20:39.873141
2020-03-19T09:14:39
2020-03-19T09:15:45
243,238,973
0
1
null
null
null
null
UTF-8
Java
false
false
1,467
java
package be.cloudway.gramba.test.lambda; import be.cloudway.gramba.runtime.dev.addons.helpers.TestingRunner; import be.cloudway.gramba.runtime.handler.GrambaLambdaHandler; import be.cloudway.gramba.runtime.GrambaRuntime; import be.cloudway.gramba.runtime.model.ApiResponse; import be.cloudway.gramba.runtime.aws.runtime.implementation.ContextImpl; import be.cloudway.gramba.runtime.helpers.JacksonHelper; import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyRequestEvent; import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyResponseEvent; import java.util.List; import java.util.Map; public class GrambaHandler implements GrambaLambdaHandler<APIGatewayProxyResponseEvent, ContextImpl> { private static final Handler handler = new Handler(); private static final GrambaRuntime gramba = new GrambaRuntime(new GrambaHandler()); public APIGatewayProxyResponseEvent customHandler(ApiResponse body, Map<String, List<String>> headers, JacksonHelper jacksonHelper) { APIGatewayProxyRequestEvent awsApiRequest = jacksonHelper.toObject(body.getResponse(), APIGatewayProxyRequestEvent.class); return handler.handleRequest(awsApiRequest, getContext()); } public ContextImpl getContext() { return new ContextImpl(); } public static void main (String... args) { if (TestingRunner.doRunTests(new GrambaHandler(), args)) return; gramba.runEventRunner(); } }
[ "mitchoost@gmail.com" ]
mitchoost@gmail.com
d39434a010366b62f9ec5a942fc6f0d021fb0f67
ff543953847cecd5c9c6b5ddeb9367feda54a609
/zjmzxfzhl/zjmzxfzhl-demo/src/main/java/com/zjmzxfzhl/modules/demo/permission/provider/DemoDataPermissionProvider.java
fde5477d3bb80709d3a36c079cb5d93fe00eaaf2
[ "Apache-2.0" ]
permissive
adulmyll/zjmzxfzhl
6eafd564715d8838cb865e53e8e5b430980a076c
d11e750060e34138611bcb234aea72fa4ecead45
refs/heads/master
2022-12-13T15:24:43.792026
2020-09-11T09:46:16
2020-09-11T09:46:16
295,737,304
1
0
Apache-2.0
2020-09-15T13:29:40
2020-09-15T13:29:40
null
UTF-8
Java
false
false
1,286
java
package com.zjmzxfzhl.modules.demo.permission.provider; import com.zjmzxfzhl.common.core.permission.provider.AbstractDataPermissionProvider; import com.zjmzxfzhl.common.core.permission.wrapper.PermissionWrapper; import lombok.Getter; import lombok.Setter; /** * 测试数据库后台返回provider * * @author */ @Getter @Setter public class DemoDataPermissionProvider extends AbstractDataPermissionProvider { /** * 数据库配置参数,特别注意,如果数据库传入的参数有作为查询条件,应使用SQLFilter.sqlInject(param)防止sql注入 */ private String alias; private String columnName; private String dbParam1; private int dbParam2; @Override public PermissionWrapper wrap(PermissionWrapper permissionWrapper) { // 测试请打开注释 /// log.info(this.alias); /// log.info(this.columnName); /// log.info(this.dbParam1); /// log.info(String.valueOf(this.dbParam2)); /// String alias = CommonUtil.isEmptyDefault(this.alias, "o"); /// log.info(alias); /// String columnName = CommonUtil.isEmptyDefault(this.columnName, "columnName"); /// log.info(columnName); return permissionWrapper; } }
[ "zjm16@163.com" ]
zjm16@163.com
a5f2fe68f14a5bc2b5bb47fad5e824d4e30a9673
7867212779fba845f04c2049bcdf535675a38db4
/pCrs/javaBDLConnector/src/com/photel/webserviceClient/BDL244/vo/ProductFeatureDistanceRequiredTime.java
25284c8dabb0870acaf07755969a2d447f75f7a0
[]
no_license
online4you/java-source
1b0f6727a7afb6df261d12b6f787f9a9a85136f4
ddaae964fcea6da11d811883cf4a93f61213c699
refs/heads/master
2020-04-02T03:52:55.226676
2018-10-21T16:03:06
2018-10-21T16:03:06
153,989,430
0
0
null
null
null
null
UTF-8
Java
false
false
3,369
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1-b02-fcs // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2011.02.08 at 09:26:37 AM CET // package com.photel.webserviceClient.BDL244.vo; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlValue; /** * Time to cover the distance using the specified mean of transport. * * <p>Java class for ProductFeatureDistanceRequiredTime complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="ProductFeatureDistanceRequiredTime"> * &lt;simpleContent> * &lt;extension base="&lt;http://www.hotelbeds.com/schemas/2005/06/messages>Number1To999999999"> * &lt;attribute name="mean" use="required"> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;minLength value="1"/> * &lt;maxLength value="50"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/attribute> * &lt;attribute name="unit" default="minutes"> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;minLength value="1"/> * &lt;maxLength value="25"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/attribute> * &lt;/extension> * &lt;/simpleContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ProductFeatureDistanceRequiredTime", propOrder = { "value" }) public class ProductFeatureDistanceRequiredTime { @XmlValue protected int value; @XmlAttribute(required = true) protected String mean; @XmlAttribute protected String unit; /** * Used for a number from 1 to 999999999. * */ public int getValue() { return value; } /** * Used for a number from 1 to 999999999. * */ public void setValue(int value) { this.value = value; } /** * Gets the value of the mean property. * * @return * possible object is * {@link String } * */ public String getMean() { return mean; } /** * Sets the value of the mean property. * * @param value * allowed object is * {@link String } * */ public void setMean(String value) { this.mean = value; } /** * Gets the value of the unit property. * * @return * possible object is * {@link String } * */ public String getUnit() { if (unit == null) { return "minutes"; } else { return unit; } } /** * Sets the value of the unit property. * * @param value * allowed object is * {@link String } * */ public void setUnit(String value) { this.unit = value; } }
[ "jceular.atwork@gmail.com" ]
jceular.atwork@gmail.com
21dc2e3de87682cecfe91c977959e293d583410a
7dfee241fc357550aab1f613c7f5350185e2c7d0
/src/test/java/services/SponsorServiceTest.java
97db6aabbe79334395de0db5b91ba1ad7388687a
[]
no_license
DP1819/D07-code
9319a5818259d79ad4361766379474137dfa7e06
925feaadbbed5707320785b0f05311e50958127a
refs/heads/master
2020-04-17T03:53:21.116106
2019-02-09T10:59:09
2019-02-09T10:59:09
166,204,669
0
1
null
null
null
null
UTF-8
Java
false
false
2,130
java
package services; import java.util.Collection; import javax.transaction.Transactional; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.util.Assert; import utilities.AbstractTest; import domain.Sponsor; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = { "classpath:spring/datasource.xml", "classpath:spring/config/packages.xml" }) @Transactional public class SponsorServiceTest extends AbstractTest { //Service under test ------------------------------------------ @Autowired private SponsorService sponsorService; @Test public void testCreate() { Sponsor sponsor; sponsor = this.sponsorService.create(); Assert.notNull(sponsor); } @Test public void testFindOne() { Sponsor sponsor; sponsor = this.sponsorService.findOne(super.getEntityId("sponsor1")); Assert.notNull(sponsor); } @Test(expected = IllegalArgumentException.class) public void testFindOneError() { Sponsor sponsor; sponsor = this.sponsorService.findOne(super.getEntityId("ssponsor1")); Assert.notNull(sponsor); } @Test public void testFindAll() { final Collection<Sponsor> sponsors = this.sponsorService.findAll(); Assert.notNull(sponsors); } @Test public void testSave() { Sponsor sponsor; sponsor = this.sponsorService.findOne(super.getEntityId("sponsor1")); Assert.notNull(sponsor); } @Test(expected = IllegalArgumentException.class) public void testSaveError() { Sponsor sponsor; sponsor = this.sponsorService.findOne(super.getEntityId("ssponsor1")); Assert.notNull(sponsor); } @Test public void testDelete() { Sponsor sponsor; sponsor = this.sponsorService.findOne(super.getEntityId("sponsor1")); //final int id = sponsor.getId(); this.sponsorService.delete(sponsor); Assert.isTrue(!(sponsor.getUserAccount().isEnabled())); } }
[ "pabpinjim@alum.us.es" ]
pabpinjim@alum.us.es
68bfed238955b39c8159d4dc0517daa48c6423c8
4bb89deb9ac7f3fca112349deb461aa1ac7ed919
/EmployeeController.java
a10a3c2a0f56876bb08677d60e26b0380ea7d638
[]
no_license
Helink123/gui-med-jacobs
31dcca66cea561c54709b48fd144aaf3b191bd09
4331f0a0d609cae5d5493ba7fed3371887fd1942
refs/heads/main
2023-04-28T19:27:10.533835
2021-05-24T12:41:20
2021-05-24T12:41:20
370,347,519
0
1
null
null
null
null
UTF-8
Java
false
false
3,958
java
package sample; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.scene.Node; import javafx.scene.control.*; import javafx.scene.layout.GridPane; public class EmployeeController { //public GridPane grid; public Label postalCodeLabel; public TextField postalCodeText; public TextField firstNameText; public TextArea employeeListTextArea; public TextField lastNameText; public Button buttonSearch; public Button buttonClearAll; @FXML private GridPane grid; private void clearTextFields(GridPane grid) { // Simple method to clear the text fields in a grid for (Node node : grid.getChildren()) { if (node instanceof TextField ) { // clear ((TextField)node).setText(""); node.setStyle(null); } else if (node instanceof TextArea) { ((TextArea) node).setText(""); node.setStyle(null); } } } private void resetTextFields(GridPane grid) { // Simple method to reset the style on text fields in a grid which have a style set // and don't touch the other fields // We use it to clear the fields we turned yellow for (Node node : grid.getChildren()) { if (node instanceof TextField) { System.out.println(node.getStyle()); // clear if (node.getStyle() != null && !node.getStyle().equals("")) { ((TextField) node).setText(""); node.setStyle(null); } } } } public static String capitalize(String str) { // Method to make names appear with capital first letter // also turn uppercase letters not in first position into lowercase // sorry McDonald! if(str == null || str.isEmpty()) { return str; } return str.substring(0, 1).toUpperCase() + str.substring(1).toLowerCase(); } public void onAddEmployee(ActionEvent actionEvent) { String firstNameInput= capitalize(firstNameText.getText()); String lastNameInput= capitalize(lastNameText.getText()); String empNumberInput = capitalize(postalCodeLabel.getText()); boolean validInput= true; // validate the user input if (firstNameInput.isEmpty() || ! DataValidator.isValidName(firstNameInput)){ // We need a valid first name firstNameText.setStyle("-fx-background-color: yellow"); validInput = false; } if (lastNameInput.isEmpty() || ! DataValidator.isValidName(lastNameInput)){ // We need a valid last name lastNameText.setStyle("-fx-background-color: yellow"); validInput = false; } if (empNumberInput.isEmpty()){ // We need a valid last employee number postalCodeText.setStyle("-fx-background-color: yellow"); validInput = false; } // Now register the employee // not finished! if (validInput) { Employee e = new Employee(firstNameInput,lastNameInput,empNumberInput); employeeListTextArea.setText(e.getFirstName()+" "+e.getLastName()+" "+e.getEmployeeId()); } else { // Something is wrong in one or more input fields // Tell the user to correct input Alert alert = new Alert(Alert.AlertType.ERROR); //alert.setTitle("Error Dialog"); alert.setHeaderText("Registration problem"); alert.setContentText("Correct highlighted fields"); alert.showAndWait(); resetTextFields(grid); } } public void onClearAll(ActionEvent actionEvent) { clearTextFields(grid); } }
[ "noreply@github.com" ]
noreply@github.com
94cb2c151a9a80af8a2b4755d666ec3db55aa68e
a96ed7e78c2280423984ef975211a75a05405956
/Animal.java
5fc4adf0a0c2c2cf5fdf014f9d92597843da33a5
[]
no_license
bbk-pij-2012-67/day11
6484afbd75f1a79a8db3d97e2988b25e6bc1a09e
ee1b43a4809f176f40d71be6220d2ec3bf9bc91e
refs/heads/master
2021-01-02T08:39:56.519768
2012-12-10T20:26:55
2012-12-10T20:26:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
301
java
public abstract class Animal{ private String name; public Animal(String name){ this.name = name; } public void call(){ System.out.println(getName() + " is coming."); } public abstract void reproduce(); public abstract void makeSound(); public String getName(){ return name; } }
[ "edmund.white_at_hotmaildotcom" ]
edmund.white_at_hotmaildotcom
b0fb77ff988dcd26899cdfcbd0dea5f1256c82e2
2865ec2bd24ba18a53232ed968a43f3b28f46566
/spring-rest-client/src/main/java/com/pritamprasad/spring_rest_client/SpringRestConfiguration.java
88884687dcef9531598fc2c9351201e862fd0fa4
[]
no_license
pritamprasd/SpringConcepts
df000d1bc3c312b75f7b06a5b9e215e31137b750
9f88a19a2fcffb651c7aef44df3ca51703de42ab
refs/heads/master
2021-01-01T15:43:03.633290
2017-08-28T07:27:08
2017-08-28T07:27:08
97,681,273
1
0
null
null
null
null
UTF-8
Java
false
false
776
java
package com.pritamprasad.spring_rest_client; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.support.SpringBootServletInitializer; /** * Configuration and Start class * */ @SpringBootApplication public class SpringRestConfiguration extends SpringBootServletInitializer{ @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(SpringRestConfiguration.class); } public static void main(String[] args) { SpringApplication.run(SpringRestConfiguration.class, args); } }
[ "pritam.prasd@gmail.com" ]
pritam.prasd@gmail.com
774c8326cc3bb10202caedd374be8f1348475140
18e339b0664d12a19cee8f01d2143fd8468c1da4
/src/main/java/com/siwieg/intelligentattendance/api/entities/Lancamento.java
797ccaf4504f7b29fed7d80abae84d18d9298c0e
[ "MIT" ]
permissive
thiago87SL/intelligent-attendance-api
c02b089754b1d17570a429e8d48458c9f3570b5c
fd700b04194238ff0e77e499b26e2683af04d864
refs/heads/master
2020-03-29T11:55:51.612007
2019-02-18T19:42:40
2019-02-18T19:42:40
149,877,300
0
0
null
null
null
null
UTF-8
Java
false
false
3,095
java
package com.siwieg.intelligentattendance.api.entities; import java.io.Serializable; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.EnumType; import javax.persistence.Enumerated; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.ManyToOne; import javax.persistence.PrePersist; import javax.persistence.PreUpdate; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; import com.siwieg.intelligentattendance.api.enums.TipoEnum; @Entity @Table(name="lancamento") public class Lancamento implements Serializable{ /** * */ private static final long serialVersionUID = -6482716326354223598L; private Long id; private Date data; private String descricao; private String localizacao; private Date dataCriacao; private Date dataAtualizacao; private TipoEnum tipo; private Funcionario funcionario; public Lancamento() { // TODO Auto-generated constructor stub } @Id @GeneratedValue(strategy=GenerationType.AUTO) public Long getId() { return id; } public void setId(Long id) { this.id = id; } @Temporal(TemporalType.TIMESTAMP) @Column(name="data", nullable=false) public Date getData() { return data; } public void setData(Date data) { this.data = data; } @Column(name="descricao", nullable=true) public String getDescricao() { return descricao; } public void setDescricao(String descricao) { this.descricao = descricao; } @Column(name="localizacao", nullable=true) public String getLocalizacao() { return localizacao; } public void setLocalizacao(String localizacao) { this.localizacao = localizacao; } @Column(name="data_criacao", nullable=false) public Date getDataCriacao() { return dataCriacao; } public void setDataCriacao(Date dataCriacao) { this.dataCriacao = dataCriacao; } @Column(name="data_atualizacao", nullable=false) public Date getDataAtualizacao() { return dataAtualizacao; } public void setDataAtualizacao(Date dataAtualizacao) { this.dataAtualizacao = dataAtualizacao; } @Enumerated(EnumType.STRING) @Column(name="tipo", nullable=false) public TipoEnum getTipo() { return tipo; } public void setTipo(TipoEnum tipo) { this.tipo = tipo; } @ManyToOne(fetch=FetchType.EAGER) public Funcionario getFuncionario() { return funcionario; } public void setFuncionario(Funcionario funcionario) { this.funcionario = funcionario; } @PreUpdate public void preUpdate() { dataAtualizacao = new Date(); } @PrePersist public void prePersist() { final Date atual = new Date(); dataCriacao = atual; dataAtualizacao = atual; } @Override public String toString() { return "Lancamento [id=" + id + ", data=" + data + ", descricao=" + descricao + ", localizacao=" + localizacao + ", dataCriacao=" + dataCriacao + ", dataAtualizacao=" + dataAtualizacao + ", tipo=" + tipo + ", funcionario=" + funcionario + "]"; } }
[ "thiagoleite.ep@gmail.com" ]
thiagoleite.ep@gmail.com
c0f11df19d8eab401eac61fc287f84d4440bfbe4
dccdff5067d048abdf8d3be2b9dd819f0d0aac50
/projetojava/src/Controller/GenericaController.java
3f692a36ac08555fdee676302900c00c06a888c0
[]
no_license
khensanepaulo/projetojava-1
c68d5901070a41b2f93e8882c48d7f781696c08e
53b084e829659a9d01894f83a452c3db5c6d3268
refs/heads/master
2023-09-03T11:24:57.965612
2021-11-11T02:18:15
2021-11-11T02:18:15
426,459,514
0
0
null
2021-11-10T02:36:21
2021-11-10T02:33:45
null
UTF-8
Java
false
false
1,133
java
package Controller; import Business.GenericaBusiness; import Business.ItemBusiness; import Models.Generica; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.List; public class GenericaController { static BufferedReader obj = new BufferedReader(new InputStreamReader(System.in)); static GenericaBusiness generica = new GenericaBusiness(); public static void listCategorias() { System.out.println("-----------------------------------------------"); List<Generica> categorias = generica.listarCategoria(); for(Generica categoria: categorias) { printarCategorias(categoria); } } public static void printarCategorias(Generica categoria) { System.out.println("ID Categoria: "+ categoria.getIdRegistro()); System.out.println("Nome: " + categoria.getNmRegistro()); System.out.println("Data do registro: " + categoria.getDtRegistro()); System.out.println("-----------------------------------------------"); System.out.println("\n"); } }
[ "noreply@github.com" ]
noreply@github.com
6eb2a48bccf05903426d7b80a3fa49422f7000d0
a9a2a7808f3e735b85e98ef1a76957561b295fb2
/src/test/java/io/github/classgraph/issues/issue255/Issue255Test.java
4552b86bbb675455f2e412346b33e216a03111e7
[ "MIT" ]
permissive
zhouruicn/classgraph
b461dfac91cc4ba696bd4b66d9ffe45e57a6d870
2aa1506aef4e499afcd1c30c2794c4a2ed82b04a
refs/heads/master
2020-04-18T05:53:00.062981
2019-01-22T19:41:06
2019-01-22T19:41:06
167,295,634
1
0
MIT
2019-01-24T03:22:18
2019-01-24T03:22:17
null
UTF-8
Java
false
false
2,371
java
/* * This file is part of ClassGraph. * * Author: Luke Hutchison * * Hosted at: https://github.com/classgraph/classgraph * * -- * * The MIT License (MIT) * * Copyright (c) 2018 Luke Hutchison * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without * limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * the Software, and to permit persons to whom the Software is furnished to do so, subject to the following * conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO * EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE * OR OTHER DEALINGS IN THE SOFTWARE. */ package io.github.classgraph.issues.issue255; import static org.assertj.core.api.Assertions.assertThat; import org.junit.Test; import io.github.classgraph.ClassGraph; import io.github.classgraph.Resource; import io.github.classgraph.ResourceList; import io.github.classgraph.ResourceList.ByteArrayConsumer; import io.github.classgraph.ScanResult; public class Issue255Test { @Test public void issue255Test() { final String dirPath = Issue255Test.class.getClassLoader().getResource("issue255").getPath() + "/test%20percent%20encoding"; try (ScanResult scanResult = new ClassGraph().overrideClasspath(dirPath).scan()) { final ResourceList resources = scanResult.getAllResources(); assertThat(resources.size()).isEqualTo(1); resources.forEachByteArray(new ByteArrayConsumer() { @Override public void accept(final Resource resource, final byte[] byteArray) { assertThat(new String(byteArray)).isEqualTo("Issue 255"); } }); } } }
[ "luke.hutch@gmail.com" ]
luke.hutch@gmail.com
451aa8f0e570bf5b1aee51620b55fad8612164c5
7a1e7fb08a6123884e3740ceac5a84474fa8a1b0
/src/main/java/com/spider/fetcher/impl/HttpClientFetcherImpl.java
7cfe99f86664e28eba9ffa2f130301c20d651b70
[]
no_license
kingerpku/spider-robot
b5d7c36e1ba6890c20f92ff0e9f81f367abde68f
652f1a848d83f0c6578eea3d20a86b985a24b983
refs/heads/master
2021-01-21T17:14:01.313019
2016-02-01T03:38:18
2016-02-01T03:38:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
12,050
java
package com.spider.fetcher.impl; import java.net.URL; import java.util.HashMap; import java.util.Map; import java.util.Random; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; import org.apache.http.*; import org.apache.http.client.config.CookieSpecs; import org.apache.http.client.config.RequestConfig; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpUriRequest; import org.apache.http.client.methods.RequestBuilder; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.util.EntityUtils; import org.apache.log4j.Logger; import com.spider.fetcher.Fetcher; import com.spider.fetcher.FetcherContent; import com.spider.fetcher.HttpConfig; import com.spider.utils.LogHelper; import com.spider.utils.UrlUtils; public class HttpClientFetcherImpl implements Fetcher { private String className = getClass().getName(); private static Logger infoLogger = LogHelper.getInfoLogger(); private static Logger messLogger = LogHelper.getMessLogger(); private static Logger errorLogger = LogHelper.getErrorLogger(); // CloseableHttpClient 内置对Cookie和SSL的处理 private Map<String, CloseableHttpClient> httpClients = new HashMap<>(); private HttpClientGenerator httpClientGenerator = new HttpClientGenerator(); private Random random = new Random(); private CloseableHttpClient getHttpClient(HttpConfig httpConfig, HttpHost proxy) { if (httpConfig == null) { return httpClientGenerator.getClient(null, proxy); } String domain = httpConfig.getDomain(); CloseableHttpClient httpClient = httpClients.get(domain); if (httpClient == null) { synchronized (this) { httpClient = httpClients.get(domain); if (httpClient == null) { httpClient = httpClientGenerator.getClient(httpConfig, proxy); httpClients.put(domain, httpClient); } } } return httpClient; } @Override public FetcherContent wgetHtml(String url, HttpConfig httpConfig, HttpHost proxy) { LogHelper.infoLog(infoLogger, null, "get url:[{0}] start...", url); if (httpConfig == null) { httpConfig = new HttpConfig(); } FetcherContent fetcherContent = new FetcherContent(); fetcherContent.setUrl(url); CloseableHttpResponse httpResponse = null; try { HttpUriRequest httpUriRequest = buildRequest(url, httpConfig); httpResponse = getHttpClient(httpConfig, proxy).execute(httpUriRequest); int statusCode = httpResponse.getStatusLine().getStatusCode(); fetcherContent.setStatusCode(statusCode); LogHelper.infoLog(messLogger, null, "class:{0},method:{1},statusCode:{2},url:{3}", className, "gethtml", statusCode, url); if (statusCode == HttpStatus.SC_OK || isSkipStatusCode(httpConfig.getSkipStatusCode(), statusCode + "")) { String value = httpResponse.getEntity().getContentType().getValue(); String charset = UrlUtils.getCharset(value); if (StringUtils.isEmpty(charset)) { charset = httpConfig.getCharSet(); } fetcherContent.setHtml(IOUtils.toString(httpResponse.getEntity().getContent(), charset)); } else if (statusCode == HttpStatus.SC_MOVED_PERMANENTLY || statusCode == HttpStatus.SC_MOVED_TEMPORARILY) { // get方法http有自动重定向功能post put方法没有 boolean b; if ("GET".equals(httpConfig.getMethod().toUpperCase())) { b = !httpConfig.getFollowRedirect(); } else { b = httpConfig.getFollowRedirect(); } if (b) { Header[] headers = httpResponse.getHeaders("Location"); if (headers != null && headers.length > 0) { fetcherContent.setRedirectUrl(headers[0].getValue()); fetcherContent.setRedirect(true); } } } } catch (Exception e) { LogHelper.errorLog(errorLogger, e, "exception class:{0},method:{1},url:{2} request html error", className, "gethtml", url); fetcherContent.setStatusCode(HttpStatus.SC_INTERNAL_SERVER_ERROR); } finally { try { if (httpResponse != null) { EntityUtils.consume(httpResponse.getEntity()); } } catch (Exception e) { LogHelper.errorLog(errorLogger, e, "exception class:{0},method:{1},url:{2} close io error", className, "gethtml", url); } } return fetcherContent; } public FetcherContent wgetStatusCode(String url, HttpConfig httpConfig, HttpHost proxy) { LogHelper.infoLog(infoLogger, null, "class:{0},method:{1},url:{2} start...", className, "wgetStatusCode", url); if (httpConfig == null) { httpConfig = new HttpConfig(); } FetcherContent fetcherContent = new FetcherContent(); fetcherContent.setUrl(url); CloseableHttpResponse httpResponse = null; HttpUriRequest httpUriRequest; try { httpUriRequest = buildRequest(url, httpConfig); httpResponse = getHttpClient(httpConfig, proxy).execute(httpUriRequest); int statusCode = httpResponse.getStatusLine().getStatusCode(); fetcherContent.setStatusCode(statusCode); LogHelper.infoLog(messLogger, null, "class:{0},method:{1},statusCode:{2},url:{3}", className, "wgetStatusCode", statusCode, url); if (statusCode == HttpStatus.SC_OK || isSkipStatusCode(httpConfig.getSkipStatusCode(), statusCode + "")) { } else if (statusCode == HttpStatus.SC_MOVED_PERMANENTLY || statusCode == HttpStatus.SC_MOVED_TEMPORARILY) { // get方法http有自动重定向功能 post put方法没有 boolean b; if ("GET".equals(httpConfig.getMethod().toUpperCase())) { b = !httpConfig.getFollowRedirect(); } else { b = httpConfig.getFollowRedirect(); } if (b) { Header[] headers; headers = httpResponse.getHeaders("Location"); if (headers != null && headers.length > 0) { fetcherContent.setRedirectUrl(headers[0].getValue()); fetcherContent.setRedirect(true); } } } } catch (Exception e) { LogHelper.errorLog(errorLogger, e, "exception class:{0},method:{1},url:{2} request html error", className, "wgetStatusCode", url); fetcherContent.setStatusCode(HttpStatus.SC_INTERNAL_SERVER_ERROR); } finally { try { if (httpResponse != null) { EntityUtils.consume(httpResponse.getEntity()); } } catch (Exception e) { LogHelper.errorLog(errorLogger, e, "exception class:{0},method:{1},url:{2} close io error", className, "wgetStatusCode", url); } } return fetcherContent; } ; // 获取文件的扩展名 public String getFileExtType(HttpResponse response) { Header contentHeader = response.getFirstHeader("Content-Disposition"); String extType = null; if (contentHeader != null) { HeaderElement[] values = contentHeader.getElements(); if (values.length == 1) { NameValuePair param = values[0].getParameterByName("filename"); if (param != null) { try { String filename = param.getValue(); if (StringUtils.isNotEmpty(filename) && filename.contains(".")) { extType = filename.substring(filename.lastIndexOf(".")); } } catch (Exception e) { LogHelper.errorLog(errorLogger, e, "get file ext type error", ""); } } } } return extType; } private boolean isSkipStatusCode(String skipStatusCode, String currentCode) { boolean b = false; if (StringUtils.isNotEmpty(skipStatusCode)) { for (String str : skipStatusCode.split(",")) { if (currentCode.matches(str)) { b = true; break; } } } return b; } private String escapeNormalizedUrl(String normalizedUrl) { try { URL url = new URL(normalizedUrl); String host = url.getHost(); String protocol = url.getProtocol(); String domain = protocol + "://" + host; normalizedUrl = normalizedUrl.replace(domain, ""); normalizedUrl = normalizedUrl.replaceAll("'", "%27"); normalizedUrl = normalizedUrl.replaceAll("]", "%5D"); normalizedUrl = normalizedUrl.replaceAll("\\[", "%5B"); normalizedUrl = normalizedUrl.replaceAll(" ", "%20"); normalizedUrl = normalizedUrl.replaceAll("\"", "%22"); normalizedUrl = normalizedUrl.replaceAll("\\|", "%7c"); normalizedUrl = normalizedUrl.replaceAll("`", "%60"); normalizedUrl = normalizedUrl.replaceAll("\\{", "%7B"); normalizedUrl = normalizedUrl.replaceAll("\\}", "%7D"); normalizedUrl = normalizedUrl.replaceAll("%26apos%3B", "'"); normalizedUrl = normalizedUrl.replaceAll(" ", "%20"); // normalizedUrl=normalizedUrl.replaceAll("-","4%2d"); normalizedUrl = domain + normalizedUrl; } catch (Exception e) { LogHelper.errorLog(errorLogger, e, "exception escapeNormalizedUrl url:{0}", normalizedUrl); } return normalizedUrl; } private HttpUriRequest buildRequest(String url, HttpConfig httpConfig) { RequestBuilder requestBuilder = null; if (StringUtils.isEmpty(httpConfig.getMethod()) || "GET".equals(httpConfig.getMethod().toUpperCase())) { requestBuilder = RequestBuilder.get().setUri(escapeNormalizedUrl(url)); } else { requestBuilder = RequestBuilder.post().setUri(escapeNormalizedUrl(url)); } for (Map.Entry<String, String> headerEntry : httpConfig.getHeaders().entrySet()) { requestBuilder.addHeader(headerEntry.getKey(), headerEntry.getValue()); } if (httpConfig.getParams() != null) { for (Map.Entry<String, String> paramEntry : httpConfig.getParams().entrySet()) { requestBuilder.addParameter(paramEntry.getKey(), paramEntry.getValue()); } } RequestConfig.Builder requestConfigBuilder = RequestConfig.custom() .setConnectionRequestTimeout(httpConfig.getTimeOut()) .setSocketTimeout(httpConfig.getSocketTimeOut()) .setConnectTimeout(httpConfig.getTimeOut()) .setConnectionRequestTimeout(httpConfig.getTimeOut()) .setCookieSpec(CookieSpecs.BEST_MATCH); if (CollectionUtils.isNotEmpty(httpConfig.getProxyHosts())) { HttpHost httphost; if ((httphost = httpConfig.getProxyHost(random.nextInt(httpConfig.getProxyHosts().size()))) != null) { LogHelper.infoLog(infoLogger, null, "use proxy-->ip:{0},port:{1}", httphost.getHostName(), httphost.getPort()); requestConfigBuilder.setProxy(httphost); } } requestBuilder.setConfig(requestConfigBuilder.build()); return requestBuilder.build(); } }
[ "wangshengyu@caiex.com" ]
wangshengyu@caiex.com
642a7ecbca2bcc544f7aaa58ebd57a7802da1bcb
602bdd16a299ccaec136b78f6493863d616d1ac7
/src/RacerGame/PlayerCar.java
fd35541165b9110972dd9eb66f3590fda309146b
[]
no_license
LeBoroda/RacerConsoleGame
a0f2c6524031bcdceb06109939b885cfb655ac2d
11e4eb72554b4821173f72f2e6afc072f935ef02
refs/heads/master
2023-02-20T21:37:16.631668
2020-05-11T18:40:42
2020-05-11T18:40:42
263,115,934
1
0
null
null
null
null
UTF-8
Java
false
false
980
java
package RacerGame; import RacerGame.road.RoadManager; public class PlayerCar extends GameObject { private static int playerCarHeight = ShapeMatrix.PLAYER.length; public int speed = 1; private Direction direction; public PlayerCar() { super(RacerGame.WIDTH / 2 + 2, RacerGame.HEIGHT - playerCarHeight - 1, ShapeMatrix.PLAYER); } public Direction getDirection() { return direction; } public void setDirection(Direction direction) { this.direction = direction; } public void move() { if(direction == Direction.LEFT) { x -=1; } else if(direction == Direction.RIGHT) { x += 1; } if( x < RoadManager.LEFT_BORDER) { x = RoadManager.LEFT_BORDER; } if(x > RoadManager.RIGHT_BORDER-width) { x = RoadManager.RIGHT_BORDER-width; } } public void stop() { this.matrix = ShapeMatrix.PLAYER_DEAD; } }
[ "stalevs@gmail.com" ]
stalevs@gmail.com
14fa2bf27b8280f5e3a1f5a9f83fdcf05b2123da
4de13695f56eca3c8b25b284f3d0eba9e3efc4d4
/api-pay/src/main/java/com/pay/common/dict/PayStatus.java
621b3f9a40ae1e37ca5af096c5cc806e4763b669
[]
no_license
guomuye1991/java-bits
6525c3a0e34c04736cc17b05487b204c71cd2816
3e76374b35c629a30da7a3221b913957e5a6fc22
refs/heads/master
2020-03-21T19:57:32.391615
2018-07-04T05:15:54
2018-07-04T05:15:54
138,979,849
0
0
null
null
null
null
UTF-8
Java
false
false
335
java
package com.pay.common.dict; public class PayStatus { //处理中 public static final Integer PROCESS = 0; //支付成功 public static final Integer SUCCESS = 1; //支付失败 public static final Integer FAIL = 2; //交易关闭 交易退款或交易取消 public static final Integer CLOSE = 3; }
[ "guomuye1991@gmail.com" ]
guomuye1991@gmail.com
2dc6aa38d1f52919c7a8582ff843eaa008df7be2
cfa119c37e00a1afffac23def89c9864799395bc
/MyApplication/app/src/main/java/com/example/administrator/myapplication/act/CollapsingToolbarActivity.java
524205ec5e72762dc469d5105aa0eef8b55580ef
[]
no_license
Hemumu/HeMuMu
3c9edee18e57bedc2e6638a03fe10bfee3cac2f2
e6f6425ee7bd4f46f6809613b3ac0c536373731e
refs/heads/master
2021-01-17T15:40:07.926363
2016-10-24T14:47:19
2016-10-24T14:47:19
58,119,820
0
0
null
null
null
null
UTF-8
Java
false
false
2,546
java
package com.example.administrator.myapplication.act; import android.graphics.Color; import android.os.Bundle; import android.support.design.widget.CollapsingToolbarLayout; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.DefaultItemAnimator; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.StaggeredGridLayoutManager; import android.support.v7.widget.Toolbar; import android.view.View; import android.widget.ListView; import android.widget.SimpleAdapter; import com.example.administrator.myapplication.R; import com.example.administrator.myapplication.adapter.MyRecyclerViewAdapter; import java.util.ArrayList; import java.util.List; public class CollapsingToolbarActivity extends AppCompatActivity { private RecyclerView mRecyclerView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_collapsing_toolbar); intiView(); } private void intiView() { Toolbar mToolbar = (Toolbar) findViewById(R.id.toolbar); initDate(); setSupportActionBar(mToolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); mToolbar.setNavigationOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { onBackPressed(); } }); //使用CollapsingToolbarLayout必须把title设置到CollapsingToolbarLayout上,设置到Toolbar上则不会显示 CollapsingToolbarLayout mCollapsingToolbarLayout = (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar_layout); mCollapsingToolbarLayout.setTitle("CollapsingToolbarLayout"); //通过CollapsingToolbarLayout修改字体颜色 mCollapsingToolbarLayout.setExpandedTitleColor(Color.WHITE);//设置还没收缩时状态下字体颜色 mCollapsingToolbarLayout.setCollapsedTitleTextColor(Color.YELLOW);//设置收缩后Toolbar上字体的颜色 } private void initDate(){ mRecyclerView = (RecyclerView) this.findViewById(R.id.recyclerView); mRecyclerView.setLayoutManager(new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL)); mRecyclerView.setItemAnimator(new DefaultItemAnimator()); List<Integer> datas = new ArrayList<>(); for (int i = 0; i < 100; i++) { datas.add(i); } mRecyclerView.setAdapter(new MyRecyclerViewAdapter(this, datas)); } }
[ "991293917@qq.com" ]
991293917@qq.com
61806d37d1af21d850c302762c4aae8e241fd190
eb5a3ddd39709049a3f257e640193d131e723f3f
/src/movietimejpa/User.java
9ba8ba208a3ebdfa1448c4d6f7e8fe8e6f2ff70e
[]
no_license
aleschiavo94/LSMDB-Task1
9be49ebac57a8e4b82d3cadafdd7320e76a9f16a
30d4ca46ed17fce151e08419fefc735f1bde703b
refs/heads/master
2023-01-06T18:32:12.153121
2020-11-08T22:15:45
2020-11-08T22:15:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,981
java
package movietimejpa; import javax.persistence.*; import java.util.HashSet; import java.util.Set; /* * 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. */ /** * * @author Utente */ @Entity @Table(name = "user") public class User { @Id @Column(name="id_user") @GeneratedValue(strategy = GenerationType.IDENTITY) private final int idUser; @Column(name="username") private final String username; @Column(name="password") private String password; @Column(name="name") private String name; @Column(name="surname") private String surname; @Column(name="email") private String email; @Column(name="credit") private int credit; @OneToMany(mappedBy = "user", fetch = FetchType.EAGER, cascade = CascadeType.REMOVE) private Set<Rental> rentals; @OneToMany(mappedBy = "user", fetch = FetchType.EAGER, cascade = CascadeType.REMOVE) private Set<Rating> ratings; public User(int idUser, String username, String psw, String name, String surn, String email, int credit) { this.idUser = idUser; this.username = username; this.password = psw; this.name = name; this.surname = surn; this.email = email; this.credit = credit; } public User() { this.idUser = 0; this.username = ""; } //used to gather data when user want to register public User(String username, String psw, String name, String surn, String email, int credit) { this.idUser = 0; // dummy value, not used this.username = username; this.password = psw; this.name = name; this.surname = surn; this.email = email; this.credit = credit; } public User(User u) { this.idUser = u.getIdUser(); this.username = (u.getUsername()); this.password = (u.getPassword()); this.name = (u.getName()); this.surname = (u.getSurname()); this.email = (u.getEmail()); this.credit = (u.getCredit()); this.rentals = new HashSet<Rental>(); rentals = u.getRentals(); } public int getIdUser(){ return this.idUser; } public String getUsername(){ return this.username; } public String getPassword(){ return this.password; } public String getName() { return this.name; } public String getSurname() { return this.surname; } public String getEmail() { return this.email; } public int getCredit() { return this.credit; } public void setPassword(String psw){ this.password = psw; } public void setEmail(String email) { this.email = (email); } public void setCredit(int credit) { this.credit= (credit); } public Set<Rental> getRentals(){ return this.rentals; } }
[ "43828256+elenaveltroni@users.noreply.github.com" ]
43828256+elenaveltroni@users.noreply.github.com
a114851913be4cc2472a4bdadf6e449832eca89e
febc20f42188e534faff83536be814c869fb315d
/src/day41/Student.java
328d9e99faa1405ee740dd93032e4aeb171128c8
[]
no_license
Abdullah-Sinan/JavaPractice
a42c75d0f5929a4e0d4d111338d9333bf9247f36
b44197aab832285dd9e35b4e79fc1d7e5291f77b
refs/heads/master
2020-06-07T10:22:41.510870
2019-06-20T23:21:29
2019-06-20T23:21:29
192,998,157
0
0
null
null
null
null
UTF-8
Java
false
false
702
java
package day41; public class Student { // access modifiers /* * public / protected / default / private * * we can use it for any methods * we can use it for fields * */ //public String name; //public int age; //public long ssn; String name; int age; long ssn; public void displayName() { System.out.println("name is : " + name); } // it is only accesible within same class // which means Student class only private void displayNameandAge() { System.out.println("name is : " + name + "| age is " + age ); } // it is only accesible within same class // which means Student class only private void showSSN() { System.out.println("SSN is : " + ssn); } }
[ "a.sinanoduncu@gmail.com" ]
a.sinanoduncu@gmail.com
12f4adf9f3073fae2d7fde60d2c53527172a73c2
1c0f3938c01e171d94598e7644d49f3acac06fc2
/app/src/main/java/com/example/flattemp/Official.java
2b1617358a0882798d32b5bec1c4a9349b285718
[]
no_license
ManranjanRoy/FlatTemp
1159b46bd3ecf5a134fe815bae2a54b9957b1735
8914b92b9d06eb6f668803e31694749f24154c2b
refs/heads/master
2020-05-16T03:21:57.932289
2019-04-22T08:57:52
2019-04-22T08:57:52
182,689,735
0
0
null
null
null
null
UTF-8
Java
false
false
1,659
java
package com.example.flattemp; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.CardView; import android.view.View; import android.widget.Toast; public class Official extends AppCompatActivity { CardView complain,notice,meetings,poll; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_official); complain=findViewById(R.id.complain) ; notice=findViewById(R.id.notice); meetings=findViewById(R.id.meetings); poll=findViewById(R.id.poll); notice.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startActivity(new Intent(Official.this,Notice.class)); } }); complain.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startActivity(new Intent(Official.this,Viewcomplain.class)); } }); meetings.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startActivity(new Intent(Official.this,Meetings.class)); } }); poll.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startActivity(new Intent(Official.this,Polls.class)); } }); } }
[ "mannu13896@gmail.com" ]
mannu13896@gmail.com
52e9019585aa97f7aabe5988a01a67c1cfd17822
f611012abad8782d8cf53e3985aea9a113e3ca89
/E2EProjectTwo/src/test/java/Automation/E2EProjectTwo/ValidateTitle.java
f212d3ff474f5323a488903d06d56785d6a41546
[]
no_license
stephenmcnicholas/javaExercises
71ed0a0240cd3de971323c44ea73fce3c0ad6ff4
2a73a995128407e5ab0b439eab12846fba6ece53
refs/heads/main
2023-08-30T23:16:10.823081
2021-10-06T16:37:30
2021-10-06T16:37:30
413,390,612
0
0
null
null
null
null
UTF-8
Java
false
false
1,535
java
package Automation.E2EProjectTwo; import java.io.IOException; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.openqa.selenium.WebDriver; import org.testng.Assert; import org.testng.annotations.AfterTest; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; import pageObjects.LandingPage; import resources.Base; public class ValidateTitle extends Base { public WebDriver driver; public static Logger log = LogManager.getLogger(ValidateTitle.class.getName()); @BeforeTest public void initialise() throws IOException { driver = initialiseDriver(); // call base method to initialise correct driver for chosen browser in prop file log.info("1 Driver initialised"); driver.get(prop.getProperty("url")); // go to URL provided log.info("2 Navigated to homepage"); } LandingPage l; @Test public void validatePageText() throws IOException { l = new LandingPage(driver); // create landingpage obj Assert.assertTrue(l.getTitle().getText().equalsIgnoreCase("Featured Horses")); log.info("3. Validated Text on Home Page"); } @Test public void validateHeader() throws IOException { l = new LandingPage(driver); // create landingpage obj Assert.assertTrue(l.getHeader().getText().contains("ACADEMY TO LEARN EVERYTHING ABOUT TESTING")); log.info("4. Validated Header Text on Home Page"); } @AfterTest public void teardown() { driver.close(); log.info("5. Closed Browser window"); } }
[ "stephenmcnicholas@hotmail.com" ]
stephenmcnicholas@hotmail.com
83859a69d2e4fad78e1db10c1cd0997cadaa24b4
387889ccad31710fb5387d083ba7ab4f86ef18c7
/Test.java
031a3ebecfd579adbb5f2aadf6f2cedf855a8390
[]
no_license
latter-yu/200617
0897731b87bd40f3d0f63ba069b897e01a54edb5
c29e3eca02e508eae73dc7f392f0b469e448539c
refs/heads/master
2022-11-05T04:24:39.988733
2020-06-17T10:21:01
2020-06-17T10:21:01
272,942,716
0
0
null
null
null
null
UTF-8
Java
false
false
4,237
java
import java.util.Arrays; import java.util.Scanner; public class Test { public static void main1(String[] args) { String s1 = "abc" + "edf"; String s2 = new String(s1); if (s1.equals(s2)) { System.out.println("equals"); // equals } if (s1 == s2) { System.out.println("=="); // 不运行 } } public static void main2(String[] args) { System.out.println("value: " + switchit(4)); } public static int switchit(int x) { int j = 1; switch (x) { case 0: j++; case 1: j++; case 2: j++; case 3: j++; case 4: j++; case 5: j++; default: j++; } return j + x; } } class Main { public static void main1(String[] args) { /* 组个最小数: * 题目描述 * 给定数字 0 - 9 各若干个。你可以以任意顺序排列这些数字,但必须全部使用。 * 目标是使得最后得到的数尽可能小(注意0不能做首位)。 * 例如:给定两个0,两个1,三个5,一个8(输入为: 210030010),我们得到的最小的数就是 10015558。 * 现给定数字,请编写程序输出能够组成的最小的数。 * 输入描述: * 每个输入包含 1 个测试用例。 * 每个测试用例在一行中给出 10 个非负整数,顺序表示我们拥有数字 0、数字 1、…… 数字 9 的个数 * 整数间用一个空格分隔。10个数字的总个数不超过50,且至少拥有1个非0的数字。 * 输出描述: * 在一行中输出能够组成的最小的数。 * 输入例子: * 2 2 0 0 0 3 0 0 1 0 * (输入为: 00115558) * 输出例子: * 10015558 * */ Scanner sc = new Scanner(System.in); int[] arr = new int[10]; int sum = 0; int ch = 0; int count = 0; int t = 0; for (int i = 0; i < arr.length; i++) { // 将输入的十个整数放进 arr 数组 arr[i] = sc.nextInt(); sum += arr[i]; // sum 为输入的整数翻译后的长度 } int[] array = new int[sum]; for (int i = 0; i < arr.length; i++) { // 翻译输入的整数, 放进 array 数组. count = arr[i]; while (count != 0) { array[ch] = t; ch++; count--; } t++; } int sh = 1; while (array[0] == 0) { // 如果翻译出的数列首位为 0, 则需将其与后面的数字调换位置 // 直至首位不为 0 为止. int tmp = array[0]; array[0] = array[sh]; array[sh] = tmp; sh++; } for (int i = 0; i < array.length; i++) { System.out.print(array[i]); } } public static void main(String[] args) { /* 验证尼科彻斯定理,即:任何一个整数 m 的立方都可以写成 m 个连续奇数之和。 例如: 1^3=1 2^3=3+5 3^3=7+9+11 4^3=13+15+17+19 要求: 输入一个 int 整数 输出分解后的 String 例如: 输入: 6 输出: 31+33+35+37+39+41 */ Scanner sc = new Scanner(System.in); while (sc.hasNext()) { int n = sc.nextInt(); long num = n * n * n; int sum = 0; int tmp = n * n - n + 1; // 由题推出: 首位为 n * n - n + 1; StringBuffer s = new StringBuffer() ; // 将输出设为 String 类型 for (int i = 1; i < n; i++) { // 将(n - 1)个元素放入 s 内. // 这样不会多输出一个 "+". sum += tmp; s.append(tmp + "+"); tmp += 2; } s.append(tmp); System.out.println(s); } } }
[ "1447394437@qq.com" ]
1447394437@qq.com
9af26b44b2fff0fb5f7b0a8ec32624a9d82a9450
d271a7d5996edac7ff490a77d17656c4ac83aea9
/src/test/java/fr/ippon/jhipster/application/repository/timezone/DateTimeWrapperRepository.java
e7323fa58419b1ea1e703798887205619bc86743
[]
no_license
sfoubert/jhipster-online-application
f948147dd6e3d350a3cba6669ce19a68601d2e4c
62872a353b5fdf8e237d614b51b8d00589909e07
refs/heads/master
2020-04-11T21:34:14.938484
2018-12-17T15:17:34
2018-12-17T15:17:34
162,110,118
0
0
null
2018-12-17T10:34:53
2018-12-17T09:59:09
Java
UTF-8
Java
false
false
348
java
package fr.ippon.jhipster.application.repository.timezone; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; /** * Spring Data JPA repository for the DateTimeWrapper entity. */ @Repository public interface DateTimeWrapperRepository extends JpaRepository<DateTimeWrapper, Long> { }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
728d815dc1b740f58706ce8ff44fdd21d0571fcc
560470d0fd60a17e6d80a52952fb08b42b9af2b9
/app/src/main/java/me/sparker0i/wallpaperpicker/ToggleOnTapCallback.java
a210dc5721d8e07af0516a7e083174dcc1f3121c
[ "LicenseRef-scancode-free-unknown", "LicenseRef-scancode-proprietary-license", "Apache-2.0" ]
permissive
Sparker0i/LockLaunch
01e20f2547ebc6b6aac0665367efa0e2a0a8ba4e
920debb0978e4f6b6704c4f9e5e0753a260a45ce
refs/heads/master
2021-01-22T01:21:41.407420
2017-11-12T19:37:03
2017-11-12T19:37:03
102,217,081
4
3
Apache-2.0
2020-06-14T20:07:39
2017-09-02T18:53:06
Java
UTF-8
Java
false
false
1,776
java
package me.sparker0i.wallpaperpicker; import android.view.View; import android.view.ViewPropertyAnimator; import android.view.animation.AccelerateInterpolator; import android.view.animation.DecelerateInterpolator; /** * Callback that toggles the visibility of the target view when crop view is tapped. */ public class ToggleOnTapCallback implements CropView.TouchCallback { private final View mViewtoToggle; private ViewPropertyAnimator mAnim; private boolean mIgnoreNextTap; public ToggleOnTapCallback(View viewtoHide) { mViewtoToggle = viewtoHide; } @Override public void onTouchDown() { if (mAnim != null) { mAnim.cancel(); } if (mViewtoToggle.getAlpha() == 1f) { mIgnoreNextTap = true; } mAnim = mViewtoToggle.animate(); mAnim.alpha(0f) .setDuration(150) .withEndAction(new Runnable() { public void run() { mViewtoToggle.setVisibility(View.INVISIBLE); } }); mAnim.setInterpolator(new AccelerateInterpolator(0.75f)); mAnim.start(); } @Override public void onTouchUp() { mIgnoreNextTap = false; } @Override public void onTap() { boolean ignoreTap = mIgnoreNextTap; mIgnoreNextTap = false; if (!ignoreTap) { if (mAnim != null) { mAnim.cancel(); } mViewtoToggle.setVisibility(View.VISIBLE); mAnim = mViewtoToggle.animate(); mAnim.alpha(1f) .setDuration(150) .setInterpolator(new DecelerateInterpolator(0.75f)); mAnim.start(); } } }
[ "aadityamenon007@gmail.com" ]
aadityamenon007@gmail.com
d44ddb600edf9d769ee1201a3b5c26458bd0c47e
effe91fd55dbd554bc20ca97e2d6364a7765fc6a
/src/main/java/com/prokabadii/kabadigame/model/Team.java
d763b2fb74832ddaf54618bcb4cb9a9a655d221e
[]
no_license
mathivanansoft/prokabadi
715bbd52b6fb641b2dae6ad68fb5168b03544e8c
add9e3d6c510eb28549d56ca14b0f33050b43c5c
refs/heads/master
2021-01-15T13:19:18.993823
2017-08-08T12:09:46
2017-08-08T12:09:46
99,660,724
0
0
null
null
null
null
UTF-8
Java
false
false
888
java
package com.prokabadii.kabadigame.model; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name="Team") public class Team { @Id @GeneratedValue(strategy= GenerationType.AUTO) @Column(name="team_id") private Long teamId; @Column(name="team_name") private String teamName; @Column(name="team_zone") private Character teamZone; public Long getTeamId() { return teamId; } public void setTeamId(Long teamId) { this.teamId = teamId; } public String getTeamName() { return teamName; } public void setTeamName(String teamName) { this.teamName = teamName; } public Character getTeamZone() { return teamZone; } public void setTeamZone(Character teamZone) { this.teamZone = teamZone; } }
[ "mathivanansoft@gmail.com" ]
mathivanansoft@gmail.com
9ab11efaf8412578f5bcf59df7d34a1a721b17a5
fe0a1a3bef7da19fa6d6ce75f707b75eec2b3578
/src/main/java/gui/main_frame/model/PatientTableModel.java
5990aadcfb2721e2e060fda96f33e0b84f429911
[]
no_license
marjola3/aplikacja_medyczna
10deaf25b5259bf237b23195052ba58456436dce
227fa8d27324b3fbd99dd971a45620f37ba7b2a9
refs/heads/master
2016-09-06T13:08:48.688149
2013-12-15T19:14:12
2013-12-15T19:14:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,998
java
package gui.main_frame.model; import model.Patient; import javax.swing.table.AbstractTableModel; import java.util.ArrayList; import java.util.List; /** * User: Mariola * Date: 26.11.13 */ public class PatientTableModel extends AbstractTableModel { String[] naglowki = {"Imię i nazwisko", "Płeć", "Ubezpieczony", "Zawód"}; List<Patient> patientList; public PatientTableModel() { patientList = new ArrayList<Patient>(); } public PatientTableModel(List<Patient> patientList) { if (patientList != null) { this.patientList = patientList; } else { this.patientList = new ArrayList<Patient>(); } } public void addPatient(Patient patient) { patientList.add(patient); fireTableDataChanged(); // odświażanie widoku tabeli } public void removePatient(int rowIndex) { if (rowIndex >= 0 && rowIndex < patientList.size()) { patientList.remove(rowIndex); fireTableDataChanged(); } } @Override public int getRowCount() { return patientList.size(); } @Override public String getColumnName(int column) { return naglowki[column]; } @Override public int getColumnCount() { return naglowki.length; } @Override public Object getValueAt(int rowIndex, int columnIndex) { switch (columnIndex) { case 0: String imie = patientList.get(rowIndex).getImie(); String nazwisko = patientList.get(rowIndex).getNazwisko(); return imie + " " + nazwisko; case 1: return patientList.get(rowIndex).getPlec(); case 2: return patientList.get(rowIndex).isUbezpieczony(); case 3: return patientList.get(rowIndex).getWorkerType(); } return null; } public List<Patient> getPatientList() { return patientList; } }
[ "marjola3@poczta.onet.pl" ]
marjola3@poczta.onet.pl
f05ff5eef1a34c8513de6e83e2e18142149e1122
6bf742dbf99949536caca9623172f8b6b0d26098
/cloudsecuritylibrary/src/main/java/at/scch/securitylibary/config/httpclient/OAuth2ConfigServerConfiguration.java
980fb5232440884b4dbf0bea0936ab571aac0abe
[]
no_license
designreuse/securityexamples
0311c26a9c68f4b88adc6be2ba1def16d212a856
9fb0bb60ca06aa78232f2b49adb785b699b7f879
refs/heads/master
2020-04-11T17:57:08.599314
2018-12-16T08:39:44
2018-12-16T08:39:44
161,980,637
0
0
null
2018-12-16T08:09:07
2018-12-16T08:09:06
null
UTF-8
Java
false
false
1,959
java
package at.scch.securitylibary.config.httpclient; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass; import org.springframework.cloud.config.client.ConfigClientProperties; import org.springframework.cloud.config.client.ConfigServicePropertySourceLocator; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Primary; import org.springframework.core.Ordered; import org.springframework.core.annotation.Order; import org.springframework.core.env.ConfigurableEnvironment; import org.springframework.security.oauth2.client.OAuth2RestTemplate; @Configuration @Order(Ordered.LOWEST_PRECEDENCE) @ConditionalOnMissingClass("org.springframework.cloud.config.server.ConfigServerApplication") public class OAuth2ConfigServerConfiguration { @Autowired private ConfigurableEnvironment environment; @Autowired @Qualifier("serviceRestTemplate") OAuth2RestTemplate restTemplate; @Bean @Primary @ConditionalOnMissingClass("org.springframework.cloud.config.server.ConfigServerApplication") public ConfigServicePropertySourceLocator configServicePropertySourceLocator() { ConfigClientProperties clientProperties = configClientProperties(); ConfigServicePropertySourceLocator configServicePropertySourceLocator = new ConfigServicePropertySourceLocator( clientProperties); configServicePropertySourceLocator.setRestTemplate(restTemplate); return configServicePropertySourceLocator; } @Bean @ConditionalOnMissingClass("org.springframework.cloud.config.server.ConfigServerApplication") public ConfigClientProperties configClientProperties() { ConfigClientProperties client = new ConfigClientProperties(this.environment); client.setEnabled(false); return client; } }
[ "benjamin.mayer@jku.at" ]
benjamin.mayer@jku.at
f342a85bb40dd6cf14001efd87857b984d387a89
70f274f6f03bd2ab83c3a38512d8e86faf5fd959
/src/main/java/com/gt/wide/background/bean/Directory.java
8febd932a5087b27805c5bccd2dbc509b957bbde
[]
no_license
DarkHorse001/widebackground
f9eda6e86bddbe373407d6288f29151cd1cbd0d3
36cea8298cf498d9cadcbad049f62c5a5cc0d868
refs/heads/master
2020-03-28T12:44:04.890198
2018-09-27T14:57:44
2018-09-27T14:57:44
148,328,588
0
1
null
null
null
null
UTF-8
Java
false
false
4,093
java
package com.gt.wide.background.bean; import java.io.Serializable; import java.util.Date; public class Directory implements Serializable { private static final long serialVersionUID = -1527479640429724123L; private Integer directoryId; //目录id private Integer pid; //父级目录id private String dname; //目录名称 private String ddescription;//目录描述 private Date createTime; //建立时间 private Date updateTime; //修改时间 private String updatePerson; //修改人员姓名 public Directory() { super(); } public Directory(Integer directoryId, Integer pid, String dname, String ddescription, Date createTime, Date updateTime, String updatePerson) { super(); setDirectoryId(directoryId); setPid(pid); setDname(dname); setDdescription(ddescription); setCreateTime(createTime); setUpdateTime(updateTime); } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((createTime == null) ? 0 : createTime.hashCode()); result = prime * result + ((ddescription == null) ? 0 : ddescription.hashCode()); result = prime * result + ((directoryId == null) ? 0 : directoryId.hashCode()); result = prime * result + ((dname == null) ? 0 : dname.hashCode()); result = prime * result + ((pid == null) ? 0 : pid.hashCode()); result = prime * result + ((updatePerson == null) ? 0 : updatePerson.hashCode()); result = prime * result + ((updateTime == null) ? 0 : updateTime.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Directory other = (Directory) obj; if (createTime == null) { if (other.createTime != null) return false; } else if (!createTime.equals(other.createTime)) return false; if (ddescription == null) { if (other.ddescription != null) return false; } else if (!ddescription.equals(other.ddescription)) return false; if (directoryId == null) { if (other.directoryId != null) return false; } else if (!directoryId.equals(other.directoryId)) return false; if (dname == null) { if (other.dname != null) return false; } else if (!dname.equals(other.dname)) return false; if (pid == null) { if (other.pid != null) return false; } else if (!pid.equals(other.pid)) return false; if (updatePerson == null) { if (other.updatePerson != null) return false; } else if (!updatePerson.equals(other.updatePerson)) return false; if (updateTime == null) { if (other.updateTime != null) return false; } else if (!updateTime.equals(other.updateTime)) return false; return true; } @Override public String toString() { return "Directory [directoryId=" + directoryId + ", pid=" + pid + ", dname=" + dname + ", ddescription=" + ddescription + ", createTime=" + createTime + ", updateTime=" + updateTime + ", updatePerson=" + updatePerson + "]"; } public Integer getDirectoryId() { return directoryId; } public void setDirectoryId(Integer directoryId) { this.directoryId = directoryId; } public Integer getPid() { return pid; } public void setPid(Integer pid) { this.pid = pid; } public String getDname() { return dname; } public void setDname(String dname) { this.dname = dname; } public String getDdescription() { return ddescription; } public void setDdescription(String ddescription) { this.ddescription = ddescription; } public Date getCreateTime() { return createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } public Date getUpdateTime() { return updateTime; } public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; } public String getUpdatePerson() { return updatePerson; } public void setUpdatePerson(String updatePerson) { this.updatePerson = updatePerson; } }
[ "952651360@qq.com" ]
952651360@qq.com
67d3ad80038ce163b32db9582331e21981fe1cb8
8a3a85c42f175ef380446d453587c8474895c303
/HTML Parser/src/FeedReader/FeedReader.java
8ca1c82a9273fc70c544ae90954e93065c48da2c
[]
no_license
razask/stock-app
608edcb8329ed75390f4850272532ce2e87a2f08
4dbb2f5220d1d5a8ad9ffade2fb797512de4d442
refs/heads/master
2021-01-19T09:44:44.772903
2013-03-25T22:51:28
2013-03-25T22:51:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,051
java
package FeedReader; import java.net.URL; import java.util.Iterator; import parser.Handler; import com.sun.syndication.feed.synd.SyndEntry; import com.sun.syndication.feed.synd.SyndFeed; import com.sun.syndication.io.SyndFeedInput; import com.sun.syndication.io.XmlReader; public class FeedReader { public static final String Yahoo = "http://feeds.finance.yahoo.com/rss/2.0/headline?s=intc&region=US&lang=en-US"; public static void main(String[] args) throws Exception { int urlAmount = 1; URL[] feedUrl; feedUrl = new URL[urlAmount]; feedUrl[0] = new URL(Yahoo); XmlReader xmlReader = null; for(int i=0; i < urlAmount; i++){ try { xmlReader = new XmlReader(feedUrl[0]); SyndFeed feeder = new SyndFeedInput().build(xmlReader); for (Iterator iterator = feeder.getEntries().iterator(); iterator.hasNext();) { SyndEntry syndEntry = (SyndEntry) iterator.next(); Handler.main(syndEntry); } } finally { if (xmlReader != null) xmlReader.close(); } } } }
[ "johnnityjohn@hotmail.com" ]
johnnityjohn@hotmail.com
515a2f298534e7f976530ee3157bcec78e815809
7b10d2c538507bf932c99e09b775b019b8626b03
/MyRunLogger_Web_tools/src/main/java/edu/neu/myapp/controller/HomeController.java
b6efe31f49881280a97ec6b48359ab688bfe21dd
[]
no_license
ankurbag/JavaWeb_Desktop_Projects
589ea5e10213391b788480713cb75ecec113c9dd
2e0f01b67567f6ecc2a8817720aa4cc0f47bca26
refs/heads/master
2021-01-15T11:12:49.320528
2016-04-27T06:44:09
2016-04-27T06:44:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,121
java
package edu.neu.myapp.controller; import java.text.DateFormat; import java.util.Date; import java.util.Locale; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; /** * Handles requests for the application home page. */ /** * @author Ankur * */ @Controller public class HomeController { private static final Logger logger = LoggerFactory.getLogger(HomeController.class); /** * Simply selects the home view to render by returning its name. */ @RequestMapping(value = "/xxx", method = RequestMethod.GET) public String home(Locale locale, Model model) { logger.info("Welcome home! The client locale is {}.", locale); Date date = new Date(); DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, locale); String formattedDate = dateFormat.format(date); model.addAttribute("serverTime", formattedDate ); return "home"; } }
[ "bag.a@husky.neu.edu" ]
bag.a@husky.neu.edu
6b108f0a7cac128549acab53f436fe6350b1ddd8
ffc8ede44d62366678b3a029720f246830c061c1
/pom-explorer/src/main/java/fr/lteconsulting/pomexplorer/changes/processor/ReopenerProcessor.java
bef86a1e5fbc05cdf2cd78618cf8daf77975a8d6
[ "MIT" ]
permissive
yokeshsharma/pom-explorer
11a9e4a909ecb97bbade5732d3c067a4086ffc2f
c17f5ad0e902cfb8c0a9e9eaef506478981c2f56
refs/heads/master
2021-01-17T08:46:43.369931
2016-01-07T13:16:49
2016-01-07T13:16:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,518
java
package fr.lteconsulting.pomexplorer.changes.processor; import fr.lteconsulting.pomexplorer.Gav; import fr.lteconsulting.pomexplorer.ILogger; import fr.lteconsulting.pomexplorer.PomSection; import fr.lteconsulting.pomexplorer.Tools; import fr.lteconsulting.pomexplorer.WorkingSession; import fr.lteconsulting.pomexplorer.changes.GavChange; import fr.lteconsulting.pomexplorer.changes.IChangeSet; import fr.lteconsulting.pomexplorer.depanalyze.GavLocation; /** * When a change is made to a pom file, it should be ensured that this pom is in * a snapshot version. If not, the pom version should be incremented and * suffixed with -SNAPSHOT * */ public class ReopenerProcessor extends AbstractGavChangeProcessor { @Override protected void processChange( WorkingSession session, ILogger log, GavChange change, IChangeSet changeSet ) { if( change.getLocation().getProject() == null ) return; Gav gav = change.getLocation().getProject().getGav(); // maybe the change is itself opening a pom if( change.getLocation().getSection() == PomSection.PROJECT && !Tools.isReleased( change.getNewGav() ) ) return; if( !Tools.isReleased( gav ) ) return; log.html( Tools.warningMessage( "modifying a released gav (" + gav + "), reopening it" ) ); // find the opened version Gav newGav = Tools.openGavVersion( gav ); // add the change to the changeset changeSet.addChange( new GavChange( new GavLocation( change.getLocation().getProject(), PomSection.PROJECT, gav ), newGav ), change ); } }
[ "ltearno@gmail.com" ]
ltearno@gmail.com
0f0778c5006fa6bcd4cf1c1888daad6ded562068
82fb25329360b432532b9192894dca6e7c80c14d
/src/Sendable/KeySendable.java
8cfd9c2ca8f65e694490d1524a047b395fe966c7
[]
no_license
ennoente/FileSync-Server
742e3facd0e147af3d0dab14ab6d04aa2d855d9c
ad6badf744a0473a7fbab9bddcf73ad0882b8b5c
refs/heads/master
2020-04-21T09:31:59.212551
2019-02-06T18:09:53
2019-02-06T18:09:53
169,452,488
0
0
null
null
null
null
UTF-8
Java
false
false
309
java
package Sendable; import java.io.Serializable; public class KeySendable implements Serializable { /** * */ private static final long serialVersionUID = 735401437969386916L; byte[] bytes; public KeySendable(byte[] bytes) { this.bytes = bytes; } public byte[] getBytes() { return bytes; } }
[ "enno.thoma@googlemail.com" ]
enno.thoma@googlemail.com
d9b6d850e52b523d6a393d0085539136b932ec47
491669f7ae12d5916b4896e0550551b467c780c6
/service/src/main/java/uk/gov/hmcts/reform/fpl/model/ReturnApplication.java
f0fff748d112ce4d048b2f789d318e2112d12386
[ "MIT" ]
permissive
imran-hmcts/fpl-ccd-configuration
9a56ae4a9f9da6c59645766721756092b971a187
d691432e94dd038bfbbed7b06c76a6f45e98dd9b
refs/heads/master
2023-02-28T05:53:19.856180
2021-02-04T14:53:08
2021-02-04T14:53:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,049
java
package uk.gov.hmcts.reform.fpl.model; import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import uk.gov.hmcts.reform.fpl.enums.ReturnedApplicationReasons; import uk.gov.hmcts.reform.fpl.model.common.DocumentReference; import java.util.List; import java.util.stream.Collectors; import static org.apache.commons.lang3.StringUtils.capitalize; @Data @Builder @AllArgsConstructor public class ReturnApplication { private final List<ReturnedApplicationReasons> reason; private final String note; private String submittedDate; private String returnedDate; private DocumentReference document; @JsonIgnore public String getFormattedReturnReasons() { if (reason != null) { String formattedReasons = reason.stream() .map(ReturnedApplicationReasons::getLabel) .collect(Collectors.joining(", ")); return capitalize(formattedReasons.toLowerCase()); } return ""; } }
[ "noreply@github.com" ]
noreply@github.com
da084a3226bbf6a89110cc3435bb85d631988b0c
f22b3796aa31a1ca2a5de18ac805a9cf0b36adc8
/src/main/java/com/infy/devdemo/domain/Customer.java
30c91ace65777f53684b1552f82d916880ebe26d
[]
no_license
knive35/devdemo
905c77d07d70f04701f3a37c5e8811e2673a393e
c3d5a8f3a63bb5ffe38fb0ea125e48cd9729c10a
refs/heads/master
2020-05-29T16:04:19.016741
2019-05-29T14:14:14
2019-05-29T14:14:14
189,239,144
0
0
null
2019-11-02T16:55:56
2019-05-29T14:14:13
Java
UTF-8
Java
false
false
2,636
java
package com.infy.devdemo.domain; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import javax.persistence.*; import java.io.Serializable; import java.util.Objects; /** * A Customer. */ @Entity @Table(name = "customer") @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) public class Customer implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator") @SequenceGenerator(name = "sequenceGenerator") private Long id; @Column(name = "name") private String name; @Column(name = "addr") private String addr; @Column(name = "contact_number") private Integer contactNumber; // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public Customer name(String name) { this.name = name; return this; } public void setName(String name) { this.name = name; } public String getAddr() { return addr; } public Customer addr(String addr) { this.addr = addr; return this; } public void setAddr(String addr) { this.addr = addr; } public Integer getContactNumber() { return contactNumber; } public Customer contactNumber(Integer contactNumber) { this.contactNumber = contactNumber; return this; } public void setContactNumber(Integer contactNumber) { this.contactNumber = contactNumber; } // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Customer customer = (Customer) o; if (customer.getId() == null || getId() == null) { return false; } return Objects.equals(getId(), customer.getId()); } @Override public int hashCode() { return Objects.hashCode(getId()); } @Override public String toString() { return "Customer{" + "id=" + getId() + ", name='" + getName() + "'" + ", addr='" + getAddr() + "'" + ", contactNumber=" + getContactNumber() + "}"; } }
[ "default" ]
default
d6576ef82a383a87b40472c0d1f1cb7de7235366
17e8a27fd3a03c64788e304ea8b98ba375b3596f
/com/rim/samples/device/ui/tableandlistdemo/TableAndListDemo.java
219051a817036d489d43d6c048b22859203ae0c2
[ "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
timwr/JDE-Samples
cc26ccc05d396519ee59a36f1876c14b7ad7f190
24c160e6cc6db9d8004b2434de9f1dd21019f418
refs/heads/master
2021-01-24T20:42:30.311731
2014-11-22T12:10:38
2014-11-22T12:10:38
null
0
0
null
null
null
null
WINDOWS-1252
Java
false
false
9,667
java
/* * TableAndListDemo.java * * Copyright © 1998-2011 Research In Motion Limited * * 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. * * Note: For the sake of simplicity, this sample application may not leverage * resource bundles and resource strings. However, it is STRONGLY recommended * that application developers make use of the localization features available * within the BlackBerry development platform to ensure a seamless application * experience across a variety of languages and geographies. For more information * on localizing your application, please refer to the BlackBerry Java Development * Environment Development Guide associated with this release. */ package com.rim.samples.device.ui.tableandlistdemo; import java.io.EOFException; import java.io.IOException; import java.io.InputStream; import net.rim.device.api.command.Command; import net.rim.device.api.command.CommandHandler; import net.rim.device.api.command.ReadOnlyCommandMetadata; import net.rim.device.api.io.LineReader; import net.rim.device.api.ui.MenuItem; import net.rim.device.api.ui.UiApplication; import net.rim.device.api.ui.component.Dialog; import net.rim.device.api.ui.component.LabelField; import net.rim.device.api.ui.container.MainScreen; import net.rim.device.api.util.StringProvider; /* * This application demonstrates the use of the Table and List APIs. There * are five screens accessible via the menu. The TableScreen is an example * of the use of a table, including layout management and the application * of styles. The ListScreen demonstrates the use of lists to display sequential * information. The RichListScreen is an example of displaying sequential * information with rich formatting and images. The TreeScreen demonstrates * the use of a SortedTableModel to nest data beneath headers. * The TableAdapterScreen demonstrates the use of a TableAdapter to display * data stored in another structure in a table. */ public final class TableAndListDemo extends UiApplication { /** * Entry point for application * * @param args * Command line arguments (not used) */ public static void main(final String[] args) { // Create a new instance of the application and make the currently // running thread the application's event dispatch thread. final UiApplication app = new TableAndListDemo(); app.enterEventDispatcher(); } /** * Retrieves data from resource text file and stores contents in a string * tokenizer * * @return A string tokenizer containing data from file */ private DemoStringTokenizer getStringTokenizer() { final InputStream stream = getClass().getResourceAsStream("/resources/blackberry.txt"); final LineReader lineReader = new LineReader(stream); final StringBuffer buffer = new StringBuffer(); while (true) { try { buffer.append(new String(lineReader.readLine())); buffer.append("\n"); } catch (final EOFException eof) { // We've reached the end of the file break; } catch (final IOException ioe) { UiApplication.getUiApplication().invokeLater(new Runnable() { public void run() { Dialog.alert("LineReader#readLine() threw " + ioe.toString()); } }); } } String data = buffer.toString(); data = data.replace('\r', ','); data = data.replace('\n', ','); return new DemoStringTokenizer(data); } /** * Creates a new TableAndListDemo object */ public TableAndListDemo() { // Push the main screen pushScreen(new TableAndListDemoScreen()); } /** * Main screen for the application. Menu contains items to launch each of * the included demo screens. */ private class TableAndListDemoScreen extends MainScreen { /** * Creates a new TableAndListDemoScreen object */ public TableAndListDemoScreen() { add(new LabelField("Please select an item from the menu")); addMenuItem(new ListScreenMenuItem()); addMenuItem(new RichListScreenMenuItem()); addMenuItem(new TableScreenMenuItem()); addMenuItem(new TableAdapterScreenMenuItem()); addMenuItem(new TreeScreenMenuItem()); } /** * A menu item to display a TableScreen */ private class TableScreenMenuItem extends MenuItem { /** * Creates a new TableScreenMenuItem object */ public TableScreenMenuItem() { super(new StringProvider("Table Screen"), 0x230010, 0); this.setCommand(new Command(new CommandHandler() { /** * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata, * Object) */ public void execute(final ReadOnlyCommandMetadata metadata, final Object context) { pushScreen(new TableScreen(getStringTokenizer())); } })); } } /** * A menu item to display a ListScreen */ private class ListScreenMenuItem extends MenuItem { /** * Creates a new ListScreenMenuItem object */ public ListScreenMenuItem() { super(new StringProvider("List Screen"), 0x230020, 1); this.setCommand(new Command(new CommandHandler() { /** * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata, * Object) */ public void execute(final ReadOnlyCommandMetadata metadata, final Object context) { pushScreen(new SimpleListScreen(getStringTokenizer())); } })); } } /** * A menu item to display a RichListScreen */ private class RichListScreenMenuItem extends MenuItem { /** * Creates a new RichListScreenMenuItem object */ public RichListScreenMenuItem() { super(new StringProvider("Rich List Screen"), 0x230030, 2); this.setCommand(new Command(new CommandHandler() { /** * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata, * Object) */ public void execute(final ReadOnlyCommandMetadata metadata, final Object context) { pushScreen(new RichListScreen(getStringTokenizer())); } })); } } /** * A menu item to display a TreeScreen */ private class TreeScreenMenuItem extends MenuItem { /** * Creates a TreeScreenMenuItem object */ public TreeScreenMenuItem() { super(new StringProvider("Tree Screen"), 0x230040, 3); this.setCommand(new Command(new CommandHandler() { /** * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata, * Object) */ public void execute(final ReadOnlyCommandMetadata metadata, final Object context) { pushScreen(new TreeScreen(getStringTokenizer())); } })); } } /** * A menu item to display a TableAdapterScreen */ private class TableAdapterScreenMenuItem extends MenuItem { /** * Create a TableAdapterScreenMenuItem object */ public TableAdapterScreenMenuItem() { super(new StringProvider("Table Adapter Screen"), 0x230050, 4); this.setCommand(new Command(new CommandHandler() { /** * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata, * Object) */ public void execute(final ReadOnlyCommandMetadata metadata, final Object context) { pushScreen(new TableAdapterScreen(getStringTokenizer())); } })); } } } }
[ "slegge@rim.com" ]
slegge@rim.com
d8d2df9d0f3eac33dfc382a1ab24763e98c71873
82d56ee06e2c9227c85de2e1f48e1aca255e16c3
/src/com/zys/juc/c016/T01_ReentrantLock1.java
8a3c47f71a2a04d3c80f49feb09d85c28fda2765
[]
no_license
yaoshenzh/ThreadHack
5cdf001045d22945f8a9b0f819d592579f8973b8
e0e10022f7b606b7f0eb3cc29b8ae3b42610f15b
refs/heads/master
2022-11-22T04:50:38.233935
2020-07-27T04:13:24
2020-07-27T04:13:24
282,357,741
0
0
null
null
null
null
UTF-8
Java
false
false
829
java
package com.zys.juc.c016; import java.util.concurrent.TimeUnit; /** * reentrant可用于替代synchronized * 本例中由于m1锁定this,只有m1执行完毕的时候,m2才能执行 * 这里是复习synchronized最原始的语义 */ public class T01_ReentrantLock1 { public static void main(String[] args) { T01_ReentrantLock1 rl = new T01_ReentrantLock1(); new Thread(rl::m1).start(); try { TimeUnit.SECONDS.sleep(1); } catch (InterruptedException e) { e.printStackTrace(); } new Thread(rl::m2).start(); } private synchronized void m1() { for (int i = 0; i < 10; i++) { try { TimeUnit.SECONDS.sleep(1); } catch (InterruptedException e) { e.printStackTrace(); } System.out.println(i); } } private synchronized void m2() { System.out.println("m2 finished."); } }
[ "yaoshenzh@gmail.com" ]
yaoshenzh@gmail.com
79a8cee31a7c4955a49b64d02645dc00906e6d2e
ec4d98a48525933e4385daa3baef48b4e35d0cf8
/jing/src/main/java/com/thaiopensource/relaxng/pattern/SingleDataDerivType.java
512c077d04e03bad5ac2143b7c2bfe48858f0718
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference", "BSD-3-Clause" ]
permissive
dashorst/wicket-stuff-markup-validator
a7118d7e1e94fb7ccd7d79b2e5a990bc5ec00a47
693c8a5bc9b1ed4e577e0e6900a18ac22f69e937
refs/heads/master
2023-09-05T09:02:13.505696
2020-09-15T14:51:40
2020-09-15T14:51:40
131,122
9
7
Apache-2.0
2022-07-07T23:09:15
2009-02-17T21:38:21
Java
UTF-8
Java
false
false
745
java
package com.thaiopensource.relaxng.pattern; import org.relaxng.datatype.ValidationContext; import java.util.List; /** * DerivType for a Pattern whose derivative wrt any data is always the same. */ class SingleDataDerivType extends DataDerivType { private PatternMemo memo; SingleDataDerivType() { } PatternMemo dataDeriv(ValidatorPatternBuilder builder, Pattern p, String str, ValidationContext vc, List<DataDerivFailure> fail) { if (memo == null) // this type never adds any failures memo = super.dataDeriv(builder, p, str, vc, null); return memo; } DataDerivType copy() { return new SingleDataDerivType(); } DataDerivType combine(DataDerivType ddt) { return ddt; } }
[ "martijn.dashorst@gmail.com" ]
martijn.dashorst@gmail.com
87f999394a65a04281441e136e9cd9f385cbc375
a44af4692c227b37eb7360a46f0cc310dff47556
/src/main/java/com/jnelsonjava/codefellowship/models/user/ApplicationUser.java
f9db3da55bd94534ca046f670891997490473d1d
[]
no_license
jnelsonjava/codefellowship
e16c9b1b79df2ef0a3d4cc17e8b498a2f72a6faf
7bfe4a15944a0a6e26cd9381461267b2b03408c7
refs/heads/main
2022-12-29T22:35:36.304858
2020-10-09T07:00:36
2020-10-09T07:00:36
301,488,887
0
1
null
2020-10-09T07:00:37
2020-10-05T17:33:25
Java
UTF-8
Java
false
false
4,417
java
package com.jnelsonjava.codefellowship.models.user; import com.jnelsonjava.codefellowship.models.post.Post; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; import javax.persistence.*; import java.sql.Date; import java.util.*; @Entity public class ApplicationUser implements UserDetails { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) long id; @Column(unique = true) String username; private String password; @OneToMany(mappedBy = "applicationUser", cascade = CascadeType.ALL) List<Post> posts = new ArrayList<>(); @ManyToMany(cascade = CascadeType.ALL) @JoinTable( name = "follows", joinColumns = { @JoinColumn(name = "follower")}, inverseJoinColumns = {@JoinColumn(name = "following")} ) Set<ApplicationUser> following = new HashSet<>(); @ManyToMany(mappedBy = "following") Set<ApplicationUser> followers = new HashSet<>(); String firstName = null; String lastName = null; Date dateOfBirth = null; String bio = null; @Column(unique = true) String email = null; // Using https://placeholder.com/ for temporary profile image String profileImgUrl = "https://via.placeholder.com/150"; public ApplicationUser() {} public ApplicationUser(String username, String password, String email) { this.username = username; this.password = password; this.email = email; } @Override public String toString() { return "ApplicationUser{" + "id=" + id + ", username='" + username + '\'' + ", email='" + email + '\'' + '}'; } public long getId() { return id; } public void setUsername(String username) { this.username = username; } public void setPassword(String password) { this.password = password; } public void setEmail(String email) { this.email = email; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public String getFullName() { return firstName + " " + lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public Date getDateOfBirth() { return dateOfBirth; } public void setDateOfBirth(Date dateOfBirth) { this.dateOfBirth = dateOfBirth; } public String getBio() { return bio; } public void setBio(String bio) { this.bio = bio; } public String getEmail() { return email; } public String getProfileImgUrl() { return profileImgUrl; } public void setProfileImgUrl(String profileImgUrl) { this.profileImgUrl = profileImgUrl; } public List<Post> getPosts() { return posts; } public Set<ApplicationUser> getFollowing() { return following; } public Set<ApplicationUser> getFollowers() { return followers; } public void follow(ApplicationUser userToFollow) { following.add(userToFollow); } public void getFollower(ApplicationUser follower) { followers.add(follower); } public void removeFollower(ApplicationUser follower) { followers.remove(follower); } public void removeFollow(ApplicationUser userToUnfollow) { following.remove(userToUnfollow); } @Override public Collection<? extends GrantedAuthority> getAuthorities() { return null; } @Override public String getPassword() { return password; } @Override public String getUsername() { return username; } @Override public boolean isAccountNonExpired() { return true; } @Override public boolean isAccountNonLocked() { return true; } @Override public boolean isCredentialsNonExpired() { return true; } @Override public boolean isEnabled() { return true; } }
[ "jnelson.java@gmail.com" ]
jnelson.java@gmail.com
43bc4178a5a5fded450a51bfa0c08d919d16d298
78f7c4065c5dd9749b1d2e6e247bcd49a633b853
/build/preprocessed/com/nokia/example/ammstuner/FrequencyBarItem.java
9725c23405060f1c274ed4bfad431b265656dd0c
[ "LicenseRef-scancode-warranty-disclaimer" ]
no_license
skalogir/fm-tuner
b58a95c01d65b055d34c00cf7e1b7edd29831f79
db227ba49d098c827a1c8a1cb3194f1291ca07fe
refs/heads/master
2020-06-01T14:49:21.044927
2013-10-31T07:11:21
2013-10-31T07:11:21
14,748,638
0
1
null
null
null
null
UTF-8
Java
false
false
4,642
java
/** * Copyright (c) 2013 Nokia Corporation. All rights reserved. * Nokia and Nokia Connecting People are registered trademarks of Nokia Corporation. * Oracle and Java are trademarks or registered trademarks of Oracle and/or its * affiliates. Other product and company names mentioned herein may be trademarks * or trade names of their respective owners. */ package com.nokia.example.ammstuner; import java.io.IOException; import javax.microedition.lcdui.CustomItem; import javax.microedition.lcdui.Font; import javax.microedition.lcdui.Graphics; import javax.microedition.lcdui.Image; /** * A custom item for displaying the current frequency. */ public class FrequencyBarItem extends CustomItem { // Constants private static final int ITEM_WIDTH = 240; private static final int ITEM_HEIGHT = 50; private static final int GREY_COLOR = 0xf4f4f4; // 244, 244, 244 // Members private FMRadio midlet; private Image greyBar; private Image blueBar; private Image frequencyBar; private Font font; private String frequencyString; private int imageHeight; private int frequencyStringLength; /** * Constructor. * @param ammsTuner The MIDlet instance. */ public FrequencyBarItem(FMRadio midlet) { super(null); this.midlet = midlet; try { greyBar = Image.createImage("/greybar.png"); blueBar = Image.createImage("/bluebar.png"); } catch (IOException ioe) { ioe.printStackTrace(); } imageHeight = blueBar.getHeight(); font = Font.getFont(Font.FACE_SYSTEM, Font.STYLE_BOLD, Font.SIZE_MEDIUM); updateFrequency(midlet.minFrequency); } /** * @see javax.microedition.lcdui.CustomItem#paint(Graphics, int, int) */ public void paint(Graphics graphics, int width, int height) { graphics.setColor(0x000000); graphics.drawImage(greyBar, 0, height / 2 - imageHeight / 2, Graphics.TOP | Graphics.LEFT); if (frequencyBar != null) { graphics.drawImage(frequencyBar, 0, height / 2 - imageHeight / 2, Graphics.TOP | Graphics.LEFT); } graphics.setFont(font); graphics.setColor(0xffffff); graphics.drawString(frequencyString, width / 2 - frequencyStringLength / 2 + 1, (height - graphics.getFont().getHeight()) / 2 - 2, Graphics.TOP | Graphics.LEFT); graphics.setColor(0x000000); graphics.drawString(frequencyString, width / 2 - frequencyStringLength / 2, (height - graphics.getFont().getHeight()) / 2 - 3, Graphics.TOP | Graphics.LEFT); } /** * @see javax.microedition.lcdui.CustomItem#getMinContentWidth() */ protected int getMinContentWidth() { return ITEM_WIDTH; } /** * @see javax.microedition.lcdui.CustomItem#getMinContentHeight() */ protected int getMinContentHeight() { return ITEM_HEIGHT; } /** * @see javax.microedition.lcdui.CustomItem#getPrefContentWidth(int) */ protected int getPrefContentWidth(int arg0) { return ITEM_WIDTH; } /** * @see javax.microedition.lcdui.CustomItem#getPrefContentHeight(int) */ protected int getPrefContentHeight(int arg0) { return ITEM_HEIGHT; } /** * Updates the current frequency. * @param frequency The current frequency. */ public final void updateFrequency(final double frequency) { createFrequencyBar(frequency); frequencyString = (frequency / 10000) + " MHz"; frequencyStringLength = font.stringWidth(frequencyString); repaint(); } /** * Creates the image for displaying the relative frequency in bar form. * @param frequency The current frequency. * @return The newly created Image instance. */ private Image createFrequencyBar(final double frequency) { final int width = 205 - (1080000 - (int)frequency) / 1000 + 12; frequencyBar = Image.createImage(width, 44); int rgbData[] = new int[width * 44]; try { blueBar.getRGB(rgbData, 0, width, 0, 0, width, 44); } catch (IllegalArgumentException iae) { iae.printStackTrace(); } frequencyBar = Image.createRGBImage(rgbData, width, 44, true); return frequencyBar; } }
[ "jarmo.lahtinen@nokia.com" ]
jarmo.lahtinen@nokia.com
fc95aee2a638248f950d78b9794d2e2586397bf5
2ee595dce5c345c34f5908f3c29f3146257be902
/StudentRecordsTest.java
34b1255838b9d1b34d68d424f7ffc852729338e8
[]
no_license
BrankoFurnadjiski/StudentRecords
13274f260060c18a3720ded420e549e14ee3b7b0
35e8a26de0e8d2f437965de944d71dd374268e71
refs/heads/master
2020-04-11T04:49:25.797470
2018-12-12T18:16:26
2018-12-12T18:16:26
161,527,463
0
0
null
null
null
null
UTF-8
Java
false
false
558
java
package StudentRecords; public class StudentRecordsTest { public static void main(String[] args) { System.out.println("=== READING RECORDS ==="); StudentRecords studentRecords = new StudentRecords(); int total = studentRecords.readRecords(System.in); System.out.printf("Total records: %d\n", total); System.out.println("=== WRITING TABLE ==="); studentRecords.writeTable(System.out); System.out.println("=== WRITING DISTRIBUTION ==="); studentRecords.writeDistribution(System.out); } }
[ "branko.berovomk@outlook.com" ]
branko.berovomk@outlook.com
0d7c11298d735da30ce2e347ec9f52f77d2d7e59
fc781b21e1ea3fa4924f6c335180fd261d53ddc6
/app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r/androidx/customview/R.java
afc288c8bd62c5f5e91b0ac4387ef8caa621796f
[]
no_license
KevenPrad/Sound_Localizer
28deb8ab2797d624af84d39aacef29e879807c3a
8f49202ec033d967d514ff810d3f9b19987be720
refs/heads/master
2020-06-30T13:49:18.635520
2019-09-02T17:01:57
2019-09-02T17:01:57
200,845,908
0
0
null
null
null
null
UTF-8
Java
false
false
10,450
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * gradle plugin from the resource data it found. It * should not be modified by hand. */ package androidx.customview; public final class R { private R() {} public static final class attr { private attr() {} public static final int alpha = 0x7f020027; public static final int font = 0x7f02007a; public static final int fontProviderAuthority = 0x7f02007c; public static final int fontProviderCerts = 0x7f02007d; public static final int fontProviderFetchStrategy = 0x7f02007e; public static final int fontProviderFetchTimeout = 0x7f02007f; public static final int fontProviderPackage = 0x7f020080; public static final int fontProviderQuery = 0x7f020081; public static final int fontStyle = 0x7f020082; public static final int fontVariationSettings = 0x7f020083; public static final int fontWeight = 0x7f020084; public static final int ttcIndex = 0x7f020140; } public static final class color { private color() {} public static final int notification_action_color_filter = 0x7f04003f; public static final int notification_icon_bg_color = 0x7f040040; public static final int ripple_material_light = 0x7f04004b; public static final int secondary_text_default_material_light = 0x7f04004d; } public static final class dimen { private dimen() {} public static final int compat_button_inset_horizontal_material = 0x7f05004b; public static final int compat_button_inset_vertical_material = 0x7f05004c; public static final int compat_button_padding_horizontal_material = 0x7f05004d; public static final int compat_button_padding_vertical_material = 0x7f05004e; public static final int compat_control_corner_material = 0x7f05004f; public static final int compat_notification_large_icon_max_height = 0x7f050050; public static final int compat_notification_large_icon_max_width = 0x7f050051; public static final int notification_action_icon_size = 0x7f05005b; public static final int notification_action_text_size = 0x7f05005c; public static final int notification_big_circle_margin = 0x7f05005d; public static final int notification_content_margin_start = 0x7f05005e; public static final int notification_large_icon_height = 0x7f05005f; public static final int notification_large_icon_width = 0x7f050060; public static final int notification_main_column_padding_top = 0x7f050061; public static final int notification_media_narrow_margin = 0x7f050062; public static final int notification_right_icon_size = 0x7f050063; public static final int notification_right_side_padding_top = 0x7f050064; public static final int notification_small_icon_background_padding = 0x7f050065; public static final int notification_small_icon_size_as_large = 0x7f050066; public static final int notification_subtext_size = 0x7f050067; public static final int notification_top_pad = 0x7f050068; public static final int notification_top_pad_large_text = 0x7f050069; } public static final class drawable { private drawable() {} public static final int notification_action_background = 0x7f060057; public static final int notification_bg = 0x7f060058; public static final int notification_bg_low = 0x7f060059; public static final int notification_bg_low_normal = 0x7f06005a; public static final int notification_bg_low_pressed = 0x7f06005b; public static final int notification_bg_normal = 0x7f06005c; public static final int notification_bg_normal_pressed = 0x7f06005d; public static final int notification_icon_background = 0x7f06005e; public static final int notification_template_icon_bg = 0x7f06005f; public static final int notification_template_icon_low_bg = 0x7f060060; public static final int notification_tile_bg = 0x7f060061; public static final int notify_panel_notification_icon_bg = 0x7f060062; } public static final class id { private id() {} public static final int action_container = 0x7f07000e; public static final int action_divider = 0x7f070010; public static final int action_image = 0x7f070011; public static final int action_text = 0x7f070017; public static final int actions = 0x7f070018; public static final int async = 0x7f07001e; public static final int blocking = 0x7f070021; public static final int chronometer = 0x7f07002a; public static final int forever = 0x7f070040; public static final int icon = 0x7f070047; public static final int icon_group = 0x7f070048; public static final int info = 0x7f07004b; public static final int italic = 0x7f07004d; public static final int line1 = 0x7f07004f; public static final int line3 = 0x7f070050; public static final int normal = 0x7f070059; public static final int notification_background = 0x7f07005a; public static final int notification_main_column = 0x7f07005b; public static final int notification_main_column_container = 0x7f07005c; public static final int right_icon = 0x7f070067; public static final int right_side = 0x7f070068; public static final int tag_transition_group = 0x7f070089; public static final int tag_unhandled_key_event_manager = 0x7f07008a; public static final int tag_unhandled_key_listeners = 0x7f07008b; public static final int text = 0x7f07008c; public static final int text2 = 0x7f07008d; public static final int time = 0x7f070090; public static final int title = 0x7f070091; } public static final class integer { private integer() {} public static final int status_bar_notification_info_maxnum = 0x7f080004; } public static final class layout { private layout() {} public static final int notification_action = 0x7f09001d; public static final int notification_action_tombstone = 0x7f09001e; public static final int notification_template_custom_big = 0x7f090025; public static final int notification_template_icon_group = 0x7f090026; public static final int notification_template_part_chronometer = 0x7f09002a; public static final int notification_template_part_time = 0x7f09002b; } public static final class string { private string() {} public static final int status_bar_notification_info_overflow = 0x7f0c002d; } public static final class style { private style() {} public static final int TextAppearance_Compat_Notification = 0x7f0d00ec; public static final int TextAppearance_Compat_Notification_Info = 0x7f0d00ed; public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0d00ef; public static final int TextAppearance_Compat_Notification_Time = 0x7f0d00f2; public static final int TextAppearance_Compat_Notification_Title = 0x7f0d00f4; public static final int Widget_Compat_NotificationActionContainer = 0x7f0d015d; public static final int Widget_Compat_NotificationActionText = 0x7f0d015e; } public static final class styleable { private styleable() {} public static final int[] ColorStateListItem = { 0x10101a5, 0x101031f, 0x7f020027 }; public static final int ColorStateListItem_android_color = 0; public static final int ColorStateListItem_android_alpha = 1; public static final int ColorStateListItem_alpha = 2; public static final int[] FontFamily = { 0x7f02007c, 0x7f02007d, 0x7f02007e, 0x7f02007f, 0x7f020080, 0x7f020081 }; public static final int FontFamily_fontProviderAuthority = 0; public static final int FontFamily_fontProviderCerts = 1; public static final int FontFamily_fontProviderFetchStrategy = 2; public static final int FontFamily_fontProviderFetchTimeout = 3; public static final int FontFamily_fontProviderPackage = 4; public static final int FontFamily_fontProviderQuery = 5; public static final int[] FontFamilyFont = { 0x1010532, 0x1010533, 0x101053f, 0x101056f, 0x1010570, 0x7f02007a, 0x7f020082, 0x7f020083, 0x7f020084, 0x7f020140 }; public static final int FontFamilyFont_android_font = 0; public static final int FontFamilyFont_android_fontWeight = 1; public static final int FontFamilyFont_android_fontStyle = 2; public static final int FontFamilyFont_android_ttcIndex = 3; public static final int FontFamilyFont_android_fontVariationSettings = 4; public static final int FontFamilyFont_font = 5; public static final int FontFamilyFont_fontStyle = 6; public static final int FontFamilyFont_fontVariationSettings = 7; public static final int FontFamilyFont_fontWeight = 8; public static final int FontFamilyFont_ttcIndex = 9; public static final int[] GradientColor = { 0x101019d, 0x101019e, 0x10101a1, 0x10101a2, 0x10101a3, 0x10101a4, 0x1010201, 0x101020b, 0x1010510, 0x1010511, 0x1010512, 0x1010513 }; public static final int GradientColor_android_startColor = 0; public static final int GradientColor_android_endColor = 1; public static final int GradientColor_android_type = 2; public static final int GradientColor_android_centerX = 3; public static final int GradientColor_android_centerY = 4; public static final int GradientColor_android_gradientRadius = 5; public static final int GradientColor_android_tileMode = 6; public static final int GradientColor_android_centerColor = 7; public static final int GradientColor_android_startX = 8; public static final int GradientColor_android_startY = 9; public static final int GradientColor_android_endX = 10; public static final int GradientColor_android_endY = 11; public static final int[] GradientColorItem = { 0x10101a5, 0x1010514 }; public static final int GradientColorItem_android_color = 0; public static final int GradientColorItem_android_offset = 1; } }
[ "keven.pradeilles@gmail.com" ]
keven.pradeilles@gmail.com
d4561628a0adf544e06992df5f7a89341f104429
85997bc7bc997622ec56e03c5ff791acc157fd17
/Zhuowen_Web_warehouse/src/main/java/com/flyfox/modules/dict/controller/DictController.java
3549f22f9ad6679a7946f1553695d1b1842b05f7
[ "Apache-2.0" ]
permissive
ZhuowenNie/Zhuowen_Academic_Projects
70d09a46f0ebb5ba164523f3ba55ed697633f241
a585bfc579cc7a44b04124deeb32772992708501
refs/heads/master
2021-01-10T14:43:03.674507
2016-04-07T04:42:37
2016-04-07T04:42:37
55,664,194
0
0
null
null
null
null
UTF-8
Java
false
false
4,472
java
package com.flyfox.modules.dict.controller; import java.util.List; import java.util.Map; import javax.annotation.Resource; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; import com.flyfox.component.hibernate.sql.Page; import com.flyfox.component.hibernate.sql.SQLType; import com.flyfox.component.spring.controller.BaseController; import com.flyfox.modules.common.form.CommonForm; import com.flyfox.modules.dict.model.SysDict; import com.flyfox.modules.dict.model.SysDictDetail; import com.flyfox.modules.dict.service.DictService; import com.flyfox.util.StrUtils; import com.flyfox.util.extend.BeanUtils; /** * 数据字典 * */ @Controller @RequestMapping("dict") public class DictController extends BaseController { private static final String path = "/dict/"; @Resource private DictService svc; @RequestMapping("list") public ModelAndView list(CommonForm form) throws Exception { ModelAndView modelAndView = new ModelAndView(); StringBuffer sql = new StringBuffer(" from sys_dict_detail t,sys_dict d where t.dict_type = d.dict_type "); String attrVal = form.get("dict_type"); if (StrUtils.isNotEmpty(attrVal)) { sql.append(" AND t.dict_type = '").append(attrVal).append("'"); } Page<List<Map<String, Object>>> page = svc.paginate(form.getPaginator(), "select t.*,d.dict_name ", sql.toString(), SQLType.SQL); // 下拉框 modelAndView.addObject("optionList", svc.selectDictType(form.get("dict_type"))); modelAndView.setViewName(path + "list"); modelAndView.addObject("attr", form.getAttr()); modelAndView.addObject("page", page); return modelAndView; } @RequestMapping("add") public ModelAndView add(String dictType) throws Exception { return new ModelAndView(path + "add", "optionList", svc.selectDictType(dictType)); } @RequestMapping("view") public ModelAndView view(Integer id) throws Exception { ModelAndView modelAndView = new ModelAndView(); SysDictDetail item = svc.findFirst(SysDictDetail.class, id); modelAndView.addObject("optionList", svc.selectDictType(item.getDictType())); modelAndView.addObject("item", item); modelAndView.setViewName(path + "view"); return modelAndView; } @RequestMapping("delete") public ModelAndView delete(Integer id, CommonForm form) throws Exception { svc.deleteDetail(id); return list(form); } @RequestMapping("edit") public ModelAndView edit(Integer id) throws Exception { ModelAndView modelAndView = new ModelAndView(); SysDictDetail item = svc.findFirst(SysDictDetail.class, id); modelAndView.addObject("optionList", svc.selectDictType(item.getDictType())); modelAndView.addObject("item", item); modelAndView.setViewName(path + "edit"); return modelAndView; } @RequestMapping("save") public ModelAndView save(SysDictDetail model) throws Exception { if (model != null && model.getDetailId() > 0) { // 更新 SysDictDetail detail = svc.findFirst(SysDictDetail.class, model.getDetailId()); BeanUtils.copy(model, detail); svc.updateDetail(detail); } else { // 新增 model.setCreateId(1); model.setCreateTime(getNow()); svc.saveDetail(model); } ModelAndView modelAndView = new ModelAndView(); renderMessage(modelAndView, "保存成功"); return modelAndView; } @RequestMapping("edit_dict") public ModelAndView edit_dict(String dict_type) throws Exception { SysDict item = svc.queryFirst(" from SysDict where dictType = ? ", SQLType.HQL, dict_type); return new ModelAndView(path + "edit_dict", "item", item); } @RequestMapping("save_dict") public ModelAndView save_dict(SysDict model) throws Exception { if (model != null && model.getDictId() > 0) { // 更新 SysDict dict = svc.findFirst(SysDict.class, model.getDictId()); BeanUtils.copy(model, dict); svc.update(dict); } else { // 新增 svc.save(model); } ModelAndView modelAndView = new ModelAndView(); renderMessage(modelAndView, "保存成功"); return modelAndView; } @RequestMapping("delete_dict") public ModelAndView delete_dict(Integer id) throws Exception { SysDict dict = svc.findFirst(SysDict.class, id); svc.delete(dict); ModelAndView modelAndView = new ModelAndView(); renderMessage(modelAndView, "删除成功"); return modelAndView; } }
[ "niezhuowenus@163.com" ]
niezhuowenus@163.com
80f08bac291b778d8a5fafac506d70560e02cfb5
3580ec14d98c2d540942a6efd477b12cd35dca07
/src/frontend/tasks/blackboard/AbstractBBTask.java
137e08702fd1215b2682e454ff174649deda6677
[]
no_license
jeraman/unnamed-02
4d5ea56c3028c3a5e154acc27bc6204c21f60151
88cccc5e8c0996900be615c061081e0284bda997
refs/heads/master
2020-03-17T10:34:27.821726
2018-09-14T13:53:21
2018-09-14T13:53:21
133,516,917
0
0
null
null
null
null
UTF-8
Java
false
false
2,188
java
package frontend.tasks.blackboard; import controlP5.ControlP5; import frontend.Main; import frontend.ZenStates; import frontend.core.Blackboard; import frontend.core.Status; import frontend.tasks.Task; import frontend.ui.TextfieldUi; import frontend.ui.ToggleUi; import processing.core.PApplet; import soundengine.SoundEngine; import soundengine.util.Util; abstract class AbstractBBTask extends Task { protected TextfieldUi variableName; protected TextfieldUi value; protected ToggleUi shouldRepeat; float timer; float timerMilestone; public AbstractBBTask(PApplet p, ControlP5 cp5, String taskname, SoundEngine eng) { super(p, cp5, taskname, eng); this.variableName = new TextfieldUi(taskname); this.shouldRepeat = new ToggleUi(); this.timerMilestone = 0; this.timer = 0; } protected abstract boolean isFirstCycle(); protected boolean debug() { return ZenStates.debug; } public void start() { // this.status = Status.RUNNING; if(debug()) System.out.println("starting the following AbstractBBTask: " + this); } public void stop() { // this.status = Status.DONE; if(debug()) System.out.println("stopping the following AbstractBBTask: " + this); } private void processNameChange() { variableName.update(); } private void processValueChange() { value.update(); } protected void processAllParameters() { processNameChange(); processValueChange(); } public void run() { boolean isFirstCycle = this.isFirstCycle(); if (first_time) reset_timer(); super.run(); if (shouldRepeat.getValue() || isFirstCycle) { updateTimer(); updateVariable(); } } void updateTimer() { this.timer = ((float) Util.millis() / 1000f) - timerMilestone; } void reset_timer() { this.timerMilestone = (float) Util.millis() / 1000f; this.timer = 0; } public void updateVariable() { Blackboard board = ZenStates.board(); board.put(variableName.getValue(), value.evaluateAsFloat()); } @Override protected String[] getDefaultParameters() { // TODO Auto-generated method stub return null; } @Override public void reset_gui_fields() { // TODO Auto-generated method stub } }
[ "magodasmontanhascaminhantesdosul@hotmail.com" ]
magodasmontanhascaminhantesdosul@hotmail.com
4fde36eda827bff8ade099830db2d8ef0d103b6e
2ec45b8c828ab66b0dc45a000a97c39fd5609d92
/src/main/java/com/alipay/api/request/AlipayEbppCommunityRelationshipModifyRequest.java
ec729a547240f67ebbf64ba17570797ed5f3577b
[ "Apache-2.0" ]
permissive
aceb985/alipay-sdk-java-all
5c0c8b1b91505c47689c45dbc42e629e73f487a8
e87bc8e7f6750e168a5f9d37221124c085d1e3c1
refs/heads/master
2023-08-20T17:42:44.662840
2021-10-18T13:03:06
2021-10-18T13:03:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,205
java
package com.alipay.api.request; import com.alipay.api.domain.AlipayEbppCommunityRelationshipModifyModel; import java.util.Map; import com.alipay.api.AlipayRequest; import com.alipay.api.internal.util.AlipayHashMap; import com.alipay.api.response.AlipayEbppCommunityRelationshipModifyResponse; import com.alipay.api.AlipayObject; /** * ALIPAY API: alipay.ebpp.community.relationship.modify request * * @author auto create * @since 1.0, 2021-07-29 14:46:26 */ public class AlipayEbppCommunityRelationshipModifyRequest implements AlipayRequest<AlipayEbppCommunityRelationshipModifyResponse> { private AlipayHashMap udfParams; // add user-defined text parameters private String apiVersion="1.0"; /** * 物业小区绑定关系修改 */ private String bizContent; public void setBizContent(String bizContent) { this.bizContent = bizContent; } public String getBizContent() { return this.bizContent; } private String terminalType; private String terminalInfo; private String prodCode; private String notifyUrl; private String returnUrl; private boolean needEncrypt=false; private AlipayObject bizModel=null; public String getNotifyUrl() { return this.notifyUrl; } public void setNotifyUrl(String notifyUrl) { this.notifyUrl = notifyUrl; } public String getReturnUrl() { return this.returnUrl; } public void setReturnUrl(String returnUrl) { this.returnUrl = returnUrl; } public String getApiVersion() { return this.apiVersion; } public void setApiVersion(String apiVersion) { this.apiVersion = apiVersion; } public void setTerminalType(String terminalType){ this.terminalType=terminalType; } public String getTerminalType(){ return this.terminalType; } public void setTerminalInfo(String terminalInfo){ this.terminalInfo=terminalInfo; } public String getTerminalInfo(){ return this.terminalInfo; } public void setProdCode(String prodCode) { this.prodCode=prodCode; } public String getProdCode() { return this.prodCode; } public String getApiMethodName() { return "alipay.ebpp.community.relationship.modify"; } public Map<String, String> getTextParams() { AlipayHashMap txtParams = new AlipayHashMap(); txtParams.put("biz_content", this.bizContent); if(udfParams != null) { txtParams.putAll(this.udfParams); } return txtParams; } public void putOtherTextParam(String key, String value) { if(this.udfParams == null) { this.udfParams = new AlipayHashMap(); } this.udfParams.put(key, value); } public Class<AlipayEbppCommunityRelationshipModifyResponse> getResponseClass() { return AlipayEbppCommunityRelationshipModifyResponse.class; } public boolean isNeedEncrypt() { return this.needEncrypt; } public void setNeedEncrypt(boolean needEncrypt) { this.needEncrypt=needEncrypt; } public AlipayObject getBizModel() { return this.bizModel; } public void setBizModel(AlipayObject bizModel) { this.bizModel=bizModel; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
f7222ae68649b4e1aa4e481c7e47ffa60098c668
4db779cdf9a0724fd005ce97dbc53ff54cd2aefc
/Diagnostic6_API/src/fr/afcepf/ai93/diag6/api/business/autres/IBusinessPublic.java
982b2bb5eaae6f9646f21ffff1d83e6e43efe137
[]
no_license
dumii/Diagnostic6
2d8ce175898dce56caaccd8b22736712c5f4766b
097502f27334cf8a5a0f0f057e77d4f22813ff42
refs/heads/master
2021-01-18T14:13:58.876074
2015-04-30T09:16:32
2015-04-30T09:16:32
34,688,265
0
1
null
null
null
null
UTF-8
Java
false
false
564
java
package fr.afcepf.ai93.diag6.api.business.autres; import java.util.List; import fr.afcepf.ai93.diag6.entity.diagnostic.Diagnostic; import fr.afcepf.ai93.diag6.entity.erp.Erp; public interface IBusinessPublic { public List<Erp> afficherErpAuxNormes(); public List<Erp> moyenneErpAuxNormes(); public List<Erp> calculGraphiquePatrimoine(); public List<Erp> calculErpParTypeDiagnostic(Diagnostic idTypeDiagnostic); public List<Erp> calculErpParTraite(Diagnostic traite); public void localisationErpGoogleMap(); }
[ "romaindotblanco@gmail.com" ]
romaindotblanco@gmail.com
c50e6edeeacf2bc22eb397883e4f2553f8f5ec17
2666a024886a870fbc26a2f75301845b19afe1dd
/src/main/java/fr/team0w/transmission/Transmission.java
95db0c0f4714e1e930e5824b0f6c9b8a77df1e0c
[]
no_license
Nic0w/TransmissionInterface
f80d339e8e84f8935185a8c33d7f9ab71fba3c12
1b2a17dc7f0bc3f0cc94db417681959546c1a956
refs/heads/master
2021-01-22T18:22:57.377077
2013-06-22T22:36:39
2013-06-22T22:36:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,063
java
/** * */ package fr.team0w.transmission; import java.net.URI; import java.net.URISyntaxException; import java.net.URL; import org.apache.http.HttpHost; import org.apache.http.client.HttpClient; import org.apache.http.client.utils.URIBuilder; import org.apache.http.impl.client.HttpClientBuilder; import fr.team0w.transmission.iface.TransmissionClient; import fr.team0w.transmission.impl.TransmissionClientImpl; /** * @author nic0w * */ public class Transmission { private static final HttpClientBuilder httpClientBuilder = HttpClientBuilder.create().disableAutomaticRetries(); /** * */ private Transmission() { // TODO Auto-generated constructor stub } public static TransmissionClient connect(String host, int port, String path) throws URISyntaxException { HttpClient httpClient = httpClientBuilder.build(); URIBuilder uriBuilder = new URIBuilder(); URI rpcURI = uriBuilder. setHost(host). setPort(port). setPath(path). build(); return new TransmissionClientImpl(httpClient, rpcURI); } }
[ "nico.broquet@gmail.com" ]
nico.broquet@gmail.com
7e072a48bd91db301357ee012cd1f47f1306024c
f77df031ae0bd585932ddd382d1ffd7119371fc8
/src/main/java/com/example/cinema/repository/MovieRepository.java
7731c56e2d325eae384e0efe063d612e3a1c1b29
[]
no_license
MaciejDebskiLd/CinemaSpringDataJpa
494931cdb8af887c8c29eb9a9a9c3626f0c9e9da
903c96638d7487257b504aaee6d1e3537b6ada23
refs/heads/master
2020-08-21T15:52:39.485435
2019-10-20T14:00:32
2019-10-20T14:00:32
216,192,712
0
0
null
null
null
null
UTF-8
Java
false
false
534
java
package com.example.cinema.repository; import com.example.cinema.domain.EMovieCategory; import com.example.cinema.domain.Movie; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.repository.PagingAndSortingRepository; public interface MovieRepository extends PagingAndSortingRepository<Movie, Long> { Page<Movie> findByCategory(EMovieCategory category, Pageable pageable); Page<Movie> findByTitleContaining(String partOfTitle, Pageable pageable); }
[ "igras.patryk@gmail.com" ]
igras.patryk@gmail.com
5161680774664d4fc6feceac7154c7e28a4b0498
d6ddc134fc72874d0a9b72b9d90738ee8ede0ffd
/app/src/main/java/com/defineview/bill/mydefineview/ui/RoundCornerImageActivity.java
1530992f017c8b3c428744888fa55bef50dedab1
[]
no_license
BillZhaoZ/VariousDefineView
1477da1ac7efd556c9c03d0056e33cc6b639b67e
66ce2b799c1b38ea84d5d6047bfeafd83bb1f60f
refs/heads/master
2021-01-23T03:03:51.362484
2017-04-05T10:25:10
2017-04-05T10:25:10
86,041,696
0
0
null
null
null
null
UTF-8
Java
false
false
1,654
java
package com.defineview.bill.mydefineview.ui; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import com.defineview.bill.mydefineview.R; import com.defineview.bill.mydefineview.view.RoundImageView; import java.util.Random; /** * 圆角图片 */ public class RoundCornerImageActivity extends AppCompatActivity { private RoundImageView mQiQiu; private RoundImageView mMeiNv; private int type; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_round_corner_image); setTitle("自定义view实现--圆角图片"); mQiQiu = (RoundImageView) findViewById(R.id.id_qiqiu); mMeiNv = (RoundImageView) findViewById(R.id.id_meinv); mQiQiu.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // 圆形和圆角切换 if (type == RoundImageView.TYPE_CIRCLE) { mQiQiu.setType(RoundImageView.TYPE_ROUND); type = 1; } else { mQiQiu.setType(RoundImageView.TYPE_CIRCLE); type = 0; } } }); mMeiNv.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // 随即改变圆角值 Random random = new Random(); int i = random.nextInt(10) * 10; mMeiNv.setBorderRadius(i); } }); } }
[ "zzbillcumt@126.com" ]
zzbillcumt@126.com
c83bb3e0fc2bb06e17208413f134caa8ded6709a
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/34/34_0da85ccadf3d6e3407b21c67e082c34ac241cf53/AbstractObjectGraphTest/34_0da85ccadf3d6e3407b21c67e082c34ac241cf53_AbstractObjectGraphTest_t.java
10a94efc2158c270c8d470cd17faaa0bb44517a8
[]
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
15,297
java
/** * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.xbean.recipe; import java.util.List; import java.util.Set; import java.util.HashSet; import java.util.Map; import java.util.Arrays; import java.util.ArrayList; import java.util.Collections; import junit.framework.TestCase; public abstract class AbstractObjectGraphTest extends TestCase { public void testCreateSingle() { Repository repository = createNewRepository(); ObjectGraph graph = new ObjectGraph(repository); Object actual = graph.create("Radiohead"); assertNotNull("actual is null", actual); assertTrue("actual should be an instance of Artist", actual instanceof Artist); Artist radiohead = (Artist)actual; assertEquals(new Artist("Radiohead"), radiohead); // multiple calls should result in same object assertSame(radiohead, graph.create("Radiohead")); } public void testCreateNested() { Album expectedBends = createBends(); Repository repository = createNewRepository(); ObjectGraph graph = new ObjectGraph(repository); Object actual = graph.create("Bends"); assertNotNull("actual is null", actual); assertTrue("actual should be an instance of Album", actual instanceof Album); Album actualBends = (Album)actual; assertEquals(expectedBends, actualBends); // we should get the same values out of the graph assertSame(actualBends, graph.create("Bends")); assertSame(actualBends.getArtist(), graph.create("Radiohead")); assertSame(actualBends.getSongs().get(0), graph.create("High and Dry")); assertSame(actualBends.getSongs().get(1), graph.create("Fake Plastic Trees")); } public void testCreateAll() { Album expectedBends = createBends(); Repository repository = createNewRepository(); ObjectGraph graph = new ObjectGraph(repository); Map<String,Object> created = graph.createAll("Bends"); assertNotNull("created is null", created); assertEquals(4, created.size()); Object actual = created.get("Bends"); assertNotNull("actual is null", actual); assertTrue("actual should be an instance of Album", actual instanceof Album); Album actualBends = (Album)actual; assertEquals(expectedBends, actualBends); // we should get the same values out of the graph assertSame(actualBends, graph.create("Bends")); assertSame(created.get("Radiohead"), graph.create("Radiohead")); assertSame(created.get("High and Dry"), graph.create("High and Dry")); assertSame(created.get("Fake Plastic Trees"), graph.create("Fake Plastic Trees")); // verify nested objects in actualBends are the same objects in the created map assertSame(actualBends.getArtist(), created.get("Radiohead")); assertSame(actualBends.getSongs().get(0), created.get("High and Dry")); assertSame(actualBends.getSongs().get(1), created.get("Fake Plastic Trees")); } public void testCreateAllGroupings() { ObjectGraph graph = new ObjectGraph(createNewRepository()); Map<String,Object> created = graph.createAll("Radiohead"); assertEquals(Arrays.asList("Radiohead"), new ArrayList<String>(created.keySet())); graph = new ObjectGraph(createNewRepository()); created = graph.createAll("Fake Plastic Trees"); assertEquals(Arrays.asList("Radiohead", "Fake Plastic Trees"), new ArrayList<String>(created.keySet())); graph = new ObjectGraph(createNewRepository()); created = graph.createAll("Fake Plastic Trees", "Fake Plastic Trees", "Fake Plastic Trees"); assertEquals(Arrays.asList("Radiohead", "Fake Plastic Trees"), new ArrayList<String>(created.keySet())); graph = new ObjectGraph(createNewRepository()); created = graph.createAll("Fake Plastic Trees", "Radiohead"); assertEquals(Arrays.asList("Radiohead", "Fake Plastic Trees"), new ArrayList<String>(created.keySet())); graph = new ObjectGraph(createNewRepository()); created = graph.createAll("Bends"); assertEquals(Arrays.asList("Radiohead", "High and Dry", "Fake Plastic Trees", "Bends"), new ArrayList<String>(created.keySet())); graph = new ObjectGraph(createNewRepository()); created = graph.createAll("Radiohead"); assertEquals(Arrays.asList("Radiohead"), new ArrayList<String>(created.keySet())); created = graph.createAll("Bends"); assertEquals(Arrays.asList("High and Dry", "Fake Plastic Trees", "Bends"), new ArrayList<String>(created.keySet())); } public void testCreateUnknown() { ObjectGraph graph = new ObjectGraph(createNewRepository()); try { graph.create("Unknown"); fail("Expected NoSuchObjectException"); } catch (NoSuchObjectException expected) { assertEquals(expected.getName(), "Unknown"); } try { graph.createAll("Unknown"); fail("Expected NoSuchObjectException"); } catch (NoSuchObjectException expected) { assertEquals(expected.getName(), "Unknown"); } try { graph.createAll("Radiohead", "Unknown"); fail("Expected NoSuchObjectException"); } catch (NoSuchObjectException expected) { assertEquals(expected.getName(), "Unknown"); } try { graph.createAll("Unknown", "Radiohead"); fail("Expected NoSuchObjectException"); } catch (NoSuchObjectException expected) { assertEquals(expected.getName(), "Unknown"); } } public void testCircularDependency() { // Add a constructor dependency Repository repository = createNewRepository(); ObjectRecipe recipe = (ObjectRecipe) repository.get("Radiohead"); recipe.setConstructorArgNames(new String[] {"name", "albums"}); recipe.setProperty("albums", new CollectionRecipe(Arrays.asList(new ReferenceRecipe("Bends")))); ObjectGraph graph = new ObjectGraph(repository); try { graph.create("Bends"); fail("Expected CircularDependencyException"); } catch (CircularDependencyException expected) { assertCircularity(Arrays.asList(repository.get("Bends"), repository.get("Radiohead"), repository.get("Bends")), expected.getCircularDependency()); } // Add a non constructor dependency // This will fail too, unless Option.LAZY_ASSIGNMENT is set repository = createNewRepository(); recipe = (ObjectRecipe) repository.get("Radiohead"); recipe.setConstructorArgNames(new String[] {"name"}); recipe.setProperty("albums", new CollectionRecipe(Arrays.asList(repository.get("Bends")))); graph = new ObjectGraph(repository); try { graph.create("Bends"); fail("Expected CircularDependencyException"); } catch (CircularDependencyException expected) { assertCircularity(Arrays.asList(repository.get("Bends"), repository.get("Radiohead"), repository.get("Bends")), expected.getCircularDependency()); } } public void testInvalidGraph() { Repository repository = createNewRepository(); ObjectRecipe bends = (ObjectRecipe) repository.get("Bends"); bends.setName("Other"); ObjectGraph graph = new ObjectGraph(repository); try { // graph.create("Bends"); // fail("Expected ConstructionException"); } catch (ConstructionException expected) { } // // Multiple recipies with the same name // repository = createNewRepository(); ObjectRecipe radiohead = new ObjectRecipe(Artist.class, new String[]{"name"}); radiohead.setName("Radiohead"); radiohead.setProperty("name", "Radiohead"); repository.add("Radiohead", radiohead); bends = (ObjectRecipe) repository.get("Bends"); bends.setProperty("artist", radiohead); radiohead = new ObjectRecipe(Artist.class, new String[]{"name"}); radiohead.setName("Radiohead"); radiohead.setProperty("name", "Radiohead"); repository.add("Radiohead", radiohead); ObjectRecipe highAndDry = (ObjectRecipe) repository.get("High and Dry"); highAndDry.setProperty("composer", radiohead); graph = new ObjectGraph(repository); try { graph.create("Bends"); fail("Expected ConstructionException"); } catch (ConstructionException expected) { } } protected abstract Repository createNewRepository(); private Album createBends() { Artist radiohead = new Artist("Radiohead"); Album bends = new Album("Bends", radiohead); Song highAndDry = new Song("High and Dry", radiohead); Song fakePlasticTrees = new Song("Fake Plastic Trees", radiohead); bends.setSongs(Arrays.asList(highAndDry, fakePlasticTrees)); return bends; } public static void assertCircularity(List<?> expected, List<?> actual) { // if (expected.size() != actual.size()) { // // this will fail, with nice message // assertEquals(expected, actual); // } List<Object> newActual = new ArrayList<Object>(actual.subList(0, actual.size() -1)); Object start = expected.get(0); int index = actual.indexOf(start); if (index > 0) Collections.rotate(newActual, index); newActual.add(start); assertEquals(expected, newActual); // // // if (index < 1) { // // acutal list already starts at the same object as the expected list // assertEquals(expected, actual); // } else { // // create a new actual list rotated at the //// List<Object> newActual = new ArrayList<Object>(actual.size()); //// newActual.addAll(actual.subList(index, actual.size())); //// newActual.addAll(actual.subList(1, index)); //// newActual.add(start); //// assertEquals(expected, newActual); // } } public static class Album { private final String name; private final Artist artist; private List<Song> songs; public Album(String name, Artist artist) { if (name == null) throw new NullPointerException("name is null"); if (artist == null) throw new NullPointerException("artist is null"); this.name = name; this.artist = artist; } public String getName() { return name; } public Artist getArtist() { return artist; } public List<Song> getSongs() { return songs; } public void setSongs(List<Song> songs) { this.songs = songs; } public String toString() { return "[Album: " + name + " - " + artist.getName() + "]"; } public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Album album = (Album) o; return name.equals(album.name) && artist.equals(album.artist) && !(songs != null ? !songs.equals(album.songs) : album.songs != null); } public int hashCode() { int result; result = name.hashCode(); result = 31 * result + artist.hashCode(); result = 31 * result + (songs != null ? songs.hashCode() : 0); return result; } } public static class Song { private final String name; private final Artist composer; public Song(String name, Artist composer) { if (name == null) throw new NullPointerException("name is null"); if (composer == null) throw new NullPointerException("composer is null"); this.name = name; this.composer = composer; } public String getName() { return name; } public Artist getComposer() { return composer; } public String toString() { return "[Song: " + name + " - " + composer.name + "]"; } public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Song song = (Song) o; return name.equals(song.name) && composer.equals(song.composer); } public int hashCode() { int result; result = name.hashCode(); result = 31 * result + composer.hashCode(); return result; } } public static class Artist { private final String name; private final Set<Album> albums = new HashSet<Album>(); public Artist(String name) { if (name == null) throw new NullPointerException("name is null"); this.name = name; } public Artist(String name, Set<Album> albums) { if (name == null) throw new NullPointerException("name is null"); this.name = name; this.albums.addAll(albums); } public String getName() { return name; } public Set<Album> getAlbums() { return albums; } public void setAlbums(Set<Album> albums) { this.albums.clear(); this.albums.addAll(albums); } public String toString() { return "[Artist: " + name + "]"; } public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Artist artist = (Artist) o; return name.equals(artist.name); } public int hashCode() { return name.hashCode(); } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
55e637daf947537b4b4a58d6e80b72a2a1c1b26e
f4c7154cc86cb56fac0d251e7616d8d3378a5a2b
/app/src/androidTest/java/com/mayank/healthcare/ApplicationTest.java
a91dc97a0a2a8a0bc207eb1d0f0c9080cf25d405
[]
no_license
Mayankdeepsingh/Health
36cb1dd6b29fc75e54517a50e6471666e69ef363
ac91899eee8d5febefd38392f8d00efb2de4cbc5
refs/heads/master
2021-01-19T13:04:18.612055
2017-03-26T14:19:00
2017-03-26T14:19:00
82,363,545
0
1
null
null
null
null
UTF-8
Java
false
false
352
java
package com.mayank.healthcare; import android.app.Application; import android.test.ApplicationTestCase; /** * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */ public class ApplicationTest extends ApplicationTestCase<Application> { public ApplicationTest() { super(Application.class); } }
[ "mail2mayanksingh@gmail.com" ]
mail2mayanksingh@gmail.com
5a0741041526168ff2a3657561d08fd83f66f6fe
9a6ca7566bae4e0d7fc6365fa4259463dcdaef13
/chapter_001/src/main/java/ru/job4j/condition/Triangle.java
7cd50bf8647a20970e496c96b94967842183f2c8
[]
no_license
fedorovse/job4j
3a38b3e6973b3390dbd0650b9fa03afb56cea22b
de752593a82a7e83bf8c6cc243b1481ecf85e7ce
refs/heads/master
2020-12-03T11:51:34.336835
2020-05-12T16:00:48
2020-05-12T16:00:48
231,304,747
0
0
null
2020-10-13T18:34:32
2020-01-02T04:01:54
Java
UTF-8
Java
false
false
2,238
java
package ru.job4j.condition; /** * */ public class Triangle { /** * поля first, second, third - это объекты Point с координатами в декартовой системе координат */ private Point first; private Point second; private Point third; public Triangle(Point ap, Point bp, Point cp) { this.first = ap; this.second = bp; this.third = cp; } /** * Расчитывает площадь треугольника если это возможно * @return double - площадь треугольника, если невозможно рассчитать, то -1 */ public double area() { double result = -1; double a = first.distance(second); double b = first.distance(third); double c = second.distance(third); if (this.exist(a, b, c)) { double halfP = this.period(a, b, c); result = Math.sqrt(halfP * (halfP - a) * (halfP - b) * (halfP - c)); } return result; } /** * method period - вычисляет полупериметр треугольнико образованного сторонами a, b, c. * @param a - расстояние между точками ab * @param b - расстояние между точками ac * @param c - расстояние между точками bc * @return */ public double period(double a, double b, double c) { if (exist(a, b, c)) { return (a + b + c) / 2; } else { return -1; } } /** * method exist - проверяет возможно ли построить треугольник с такими сторонами * @param a - расстояние между точками ab * @param b - расстояние между точками ac * @param c - расстояние между точками bc * @return true - если треугольник построить возможно и false - если нет. */ private boolean exist(double a, double b, double c) { return a + b > c && a + c > b && b + c > a; } }
[ "ingor-ru@mail.ru" ]
ingor-ru@mail.ru
3f7dd27af889a4a0c5820fefed98bc533dca52b0
2b8e15f4179f2a2cc7d113f0ac6539247ac38b85
/app/src/main/java/tresna/mobile/movieapps/movietoprated/presenter/TopPresenter.java
e9424a5b2f32285a99c73009ae57c16f59e25412
[]
no_license
TresnaNurziyan/MovieApp
129c6d9eabe5d37e61d35512bd0a4e583798ee92
010317e3e2e9ed4fc764ce3706a7b2f1d1aacc13
refs/heads/main
2023-06-06T09:50:47.153015
2021-06-30T03:24:34
2021-06-30T03:24:34
378,983,829
0
0
null
null
null
null
UTF-8
Java
false
false
1,667
java
package tresna.mobile.movieapps.movietoprated.presenter; import android.app.Activity; import android.content.Intent; import tresna.mobile.movieapps.DetailActivity; import tresna.mobile.movieapps.apirepository.NetworkCallback; import tresna.mobile.movieapps.base.ui.BasePresenter; import tresna.mobile.movieapps.movietoprated.model.ResultsItem; import tresna.mobile.movieapps.movietoprated.model.TopRatedResponse; import tresna.mobile.movieapps.movietoprated.view.TopView; public class TopPresenter extends BasePresenter<TopView> { public TopPresenter(TopView topView){ super.attachView(topView); } public void loadData(){ view.showLoading(); addSubscribe(apiServices.getToprated(), new NetworkCallback<TopRatedResponse>() { @Override public void onSuccess(TopRatedResponse model) { view.getDataSuccess(model); } @Override public void onFailure(String message) { view.getDataFail(message); } @Override public void onFinish() { view.hideLoading(); } }); } public void getItem(ResultsItem item, Activity activity){ Intent intent = new Intent(activity, DetailActivity.class); intent.putExtra("id", item.getId()); intent.putExtra("title", item.getTitle()); intent.putExtra("date", item.getReleaseDate()); intent.putExtra("overview", item.getOverview()); intent.putExtra("poster", item.getPosterPath()); intent.putExtra("banner", item.getBackdropPath()); view.moveToDetail(intent); } }
[ "tresna.nurziyan@gmail.com" ]
tresna.nurziyan@gmail.com
eee3cbacfb1f4b18414338c83c3deffb4329e08b
b57c37d26f811fdc8c284db969ae3abee5976efb
/office-quartz/src/main/java/com/office/quartz/controller/SysJobController.java
ac25bca5d47545a89b00a2aeba45226b1be0545f
[ "MIT" ]
permissive
zhangxbs/office2.0
ac754e325a9b5ff322ad9aa9427dceb14eb7a817
564818750ace6be134daa4d1d7043cb2f7d7a028
refs/heads/master
2023-08-09T08:35:26.328682
2021-09-11T03:43:54
2021-09-11T03:43:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,812
java
package com.office.quartz.controller; import java.util.List; import com.office.quartz.domain.SysJob; import com.office.quartz.service.ISysJobService; import com.office.quartz.util.CronUtils; import org.quartz.SchedulerException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.office.common.annotation.Log; import com.office.common.core.controller.BaseController; import com.office.common.core.domain.AjaxResult; import com.office.common.core.page.TableDataInfo; import com.office.common.enums.BusinessType; import com.office.common.exception.job.TaskException; import com.office.common.utils.SecurityUtils; import com.office.common.utils.poi.ExcelUtil; /** * 调度任务信息操作处理 * * @author ruoyi */ @RestController @RequestMapping("/monitor/job") public class SysJobController extends BaseController { @Autowired private ISysJobService jobService; /** * 查询定时任务列表 */ @PreAuthorize("@ss.hasPermi('monitor:job:list')") @GetMapping("/list") public TableDataInfo list(SysJob sysJob) { startPage(); List<SysJob> list = jobService.selectJobList(sysJob); return getDataTable(list); } /** * 导出定时任务列表 */ @PreAuthorize("@ss.hasPermi('monitor:job:export')") @Log(title = "定时任务", businessType = BusinessType.EXPORT) @GetMapping("/export") public AjaxResult export(SysJob sysJob) { List<SysJob> list = jobService.selectJobList(sysJob); ExcelUtil<SysJob> util = new ExcelUtil<SysJob>(SysJob.class); return util.exportExcel(list, "定时任务"); } /** * 获取定时任务详细信息 */ @PreAuthorize("@ss.hasPermi('monitor:job:query')") @GetMapping(value = "/{jobId}") public AjaxResult getInfo(@PathVariable("jobId") Long jobId) { return AjaxResult.success(jobService.selectJobById(jobId)); } /** * 新增定时任务 */ @PreAuthorize("@ss.hasPermi('monitor:job:add')") @Log(title = "定时任务", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody SysJob sysJob) throws SchedulerException, TaskException { if (!CronUtils.isValid(sysJob.getCronExpression())) { return AjaxResult.error("cron表达式不正确"); } sysJob.setCreateBy(SecurityUtils.getUsername()); return toAjax(jobService.insertJob(sysJob)); } /** * 修改定时任务 */ @PreAuthorize("@ss.hasPermi('monitor:job:edit')") @Log(title = "定时任务", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody SysJob sysJob) throws SchedulerException, TaskException { if (!CronUtils.isValid(sysJob.getCronExpression())) { return AjaxResult.error("cron表达式不正确"); } sysJob.setUpdateBy(SecurityUtils.getUsername()); return toAjax(jobService.updateJob(sysJob)); } /** * 定时任务状态修改 */ @PreAuthorize("@ss.hasPermi('monitor:job:changeStatus')") @Log(title = "定时任务", businessType = BusinessType.UPDATE) @PutMapping("/changeStatus") public AjaxResult changeStatus(@RequestBody SysJob job) throws SchedulerException { SysJob newJob = jobService.selectJobById(job.getJobId()); newJob.setStatus(job.getStatus()); return toAjax(jobService.changeStatus(newJob)); } /** * 定时任务立即执行一次 */ @PreAuthorize("@ss.hasPermi('monitor:job:changeStatus')") @Log(title = "定时任务", businessType = BusinessType.UPDATE) @PutMapping("/run") public AjaxResult run(@RequestBody SysJob job) throws SchedulerException { jobService.run(job); return AjaxResult.success(); } /** * 删除定时任务 */ @PreAuthorize("@ss.hasPermi('monitor:job:remove')") @Log(title = "定时任务", businessType = BusinessType.DELETE) @DeleteMapping("/{jobIds}") public AjaxResult remove(@PathVariable Long[] jobIds) throws SchedulerException, TaskException { jobService.deleteJobByIds(jobIds); return AjaxResult.success(); } }
[ "798007212@qq.com" ]
798007212@qq.com