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
222277959cb84d8671eedba160cae5525ab615d8
58264542a9dffd5127d0c2bc1765364f47c96d76
/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Pantherbot6219Lib/FTCChoiceMenu.java
5e7d5c1c922b498befe700dbd20c0bdafe42ab58
[ "MIT" ]
permissive
Pantherbot6219/FTC6219TeamCode
fc1cc7a8f42962fab4ca3fa78db9e65d0e801823
0476de6c0520db65399752118e004b5f710869c8
refs/heads/master
2020-03-27T00:37:38.108110
2018-11-09T03:02:20
2018-11-09T03:02:20
145,639,353
0
0
null
null
null
null
UTF-8
Java
false
false
10,834
java
package org.firstinspires.ftc.teamcode.Pantherbot6219Lib; import java.util.ArrayList; import org.firstinspires.ftc.teamcode.Hallib.HalDashboard; import org.firstinspires.ftc.teamcode.Hallib.HalUtil; /** * This class implements a choice menu where a number of choices are presented to the user. * The user can press the UP and DOWN button to navigate the different choices and press the * ENTER button to select the choice. The user can also press the BACK button to cancel the * menu and go back to the parent menu. */ public class FTCChoiceMenu extends FTCMenu { /** * This class defines a choice item in a choice menu. */ private class ChoiceItem { private String choiceText; private Object choiceObject; private FTCMenu childMenu; /** * Constructor: Creates an instance of the object. * * @param choiceText specifies the text to be displayed in the choice menu. * @param choiceObject specifies the object to be returned if the choice is selected. * @param childMenu specifies the next menu to go to if the choice is selected. It can * be null if this is the end (i.e. leaf node of the menu tree). */ public ChoiceItem(String choiceText, Object choiceObject, FTCMenu childMenu) { this.choiceText = choiceText; this.choiceObject = choiceObject; this.childMenu = childMenu; } //ChoiceItem /** * This method returns the choice text. * * @return choice text. */ public String getText() { return choiceText; } //getText; /** * This method returns the choice object. * * @return choice object. */ public Object getObject() { return choiceObject; } //getObject /** * This method returns the child menu. * * @return child menu. */ public FTCMenu getChildMenu() { return childMenu; } //getChildMenu } //class ChoiceItem private ArrayList<ChoiceItem> choiceItems = new ArrayList<ChoiceItem>(); private int currChoice = -1; private int firstDisplayedChoice = 0; /** * Constructor: Creates an instance of the object. * * @param menuTitle specifies the title of the menu. The title will be displayed * as the first line in the menu. * @param parent specifies the parent menu to go back to if the BACK button * is pressed. If this is the root menu, it can be set to null. * @param menuButtons specifies the object that implements the MenuButtons interface. */ public FTCChoiceMenu(String menuTitle, FTCMenu parent, FTCMenu.MenuButtons menuButtons) { super(menuTitle, parent, menuButtons); } //FtcMenu /** * This method adds a choice to the menu. The choices will be displayed in the * order of them being added. * * @param choiceText specifies the choice text that will be displayed on the dashboard. * @param choiceObject specifies the object to be returned if the choice is selected. * @param childMenu specifies the next menu to go to when this choice is selected. * If this is the last menu (a leaf node in the tree), it can be set * to null. */ public void addChoice(String choiceText, Object choiceObject, FTCMenu childMenu) { final String funcName = "addChoice"; choiceItems.add(new ChoiceItem(choiceText, choiceObject, childMenu)); if (currChoice == -1) { // // This is the first added choice in the menu. // Make it the default choice by highlighting it. // currChoice = 0; } } //addChoice /** * This method adds a choice to the menu. The choices will be displayed in the * order of them being added. * * @param choiceText specifies the choice text that will be displayed on the dashboard. * @param choiceObj specifies the object to be returned if the choice is selected. */ public void addChoice(String choiceText, Object choiceObj) { addChoice(choiceText, choiceObj, null); } //addChoice /** * This method returns the choice text of the given choice index. * * @param choice specifies the choice index in the menu. * @return text of the choice if choice index is valid, null otherwise. */ public String getChoiceText(int choice) { final String funcName = "getChoiceText"; String text = null; int tableSize = choiceItems.size(); if (tableSize > 0 && choice >= 0 && choice < tableSize) { text = choiceItems.get(choice).getText(); } return text; } //getChoiceText /** * This method returns the choice object of the given choice index. * * @param choice specifies the choice index in the menu. * @return object of the given choice if choice index is valid, null otherwise. */ public Object getChoiceObject(int choice) { final String funcName = "getChoiceObject"; Object obj = null; int tableSize = choiceItems.size(); if (tableSize > 0 && choice >= 0 && choice < tableSize) { obj = choiceItems.get(choice).getObject(); } return obj; } //getChoiceObject /** * This method returns the index of the current choice. Every menu has a * current choice even if the menu hasn't been displayed and the user * hasn't picked a choice. In that case, the current choice is the * highlighted selection of the menu which is the first choice in the menu. * If the menu is empty, the current choice index is -1. * * @return current choice index, -1 if menu is empty. */ public int getCurrentChoice() { final String funcName = "getCurrentChoice"; return currChoice; } //getCurrentChoice /** * This method returns the text of the current choice. Every menu has a * current choice even if the menu hasn't been displayed and the user * hasn't picked a choice. In that case, the current choice is the * highlighted selection of the menu which is the first choice in the menu. * If the menu is empty, the current choice index is -1. * * @return current choice text, null if menu is empty. */ public String getCurrentChoiceText() { return getChoiceText(currChoice); } //getCurrentChoiceText /** * This method returns the object of the current choice. Every menu has a * current choice even if the menu hasn't been displayed and the user * hasn't picked a choice. In that case, the current choice is the * highlighted selection of the menu which is the first choice in the menu. * If the menu is empty, the current choice index is -1. * * @return current choice object, null if menu is empty. */ public Object getCurrentChoiceObject() { return getChoiceObject(currChoice); } //getCurrentChoiceObject // // Implements FtcMenu abstract methods. // /** * This method moves the current selection to the previous choice in the menu. * If it is already the first choice, it will wraparound back to the last choice. */ public void menuUp() { final String funcName = "menuUp"; if (choiceItems.size() == 0) { currChoice = -1; } else { currChoice--; if (currChoice < 0) { currChoice = choiceItems.size() - 1; } if (currChoice < firstDisplayedChoice) { // // Scroll up. // firstDisplayedChoice = currChoice; } } } //menuUp /** * This method moves the current selection to the next choice in the menu. * If it is already the last choice, it will wraparound back to the first choice. */ public void menuDown() { final String funcName = "menuDown"; if (choiceItems.size() == 0) { currChoice = -1; } else { currChoice++; if (currChoice >= choiceItems.size()) { currChoice = 0; } int lastDisplayedChoice = Math.min(firstDisplayedChoice + HalDashboard.MAX_NUM_TEXTLINES - 2, choiceItems.size() - 1); if (currChoice > lastDisplayedChoice) { // // Scroll down. // firstDisplayedChoice = currChoice - (HalDashboard.MAX_NUM_TEXTLINES - 2); } } } //menuDown /** * This method returns the child menu of the current choice. * * @return child menu of the current choice. */ public FTCMenu getChildMenu() { final String funcName = "getChildMenu"; FTCMenu childMenu = choiceItems.get(currChoice).childMenu; return childMenu; } //getChildMenu /** * This method displays the menu on the dashboard with the current * selection highlighted. The number of choices in the menu may * exceed the total number of lines on the dashboard. In that case, * it will only display all the choices that will fit on the * dashboard. If the user navigates to a choice outside of the * dashboard display, the choices will scroll up or down to bring * the new selection into the dashboard. */ public void displayMenu() { final String funcName = "displayMenu"; // // Determine the choice of the last display line on the dashboard. // int lastDisplayedChoice = Math.min(firstDisplayedChoice + HalDashboard.MAX_NUM_TEXTLINES - 2, choiceItems.size() - 1); dashboard.clearDisplay(); dashboard.displayPrintf(0, getTitle()); // // Display all the choices that will fit on the dashboard. // for (int i = firstDisplayedChoice; i <= lastDisplayedChoice; i++) { ChoiceItem item = choiceItems.get(i); dashboard.displayPrintf( i - firstDisplayedChoice + 1, i == currChoice? ">>\t%s%s": "%s%s", item.getText(), item.getChildMenu() != null? " ...": ""); } } //displayMenu } //class FtcChoiceMenu
[ "30453425+KusakabeMirai@users.noreply.github.com" ]
30453425+KusakabeMirai@users.noreply.github.com
e310978cd971d6ba12024d105d7dd48835b15838
6817f8b7b5685bbc10fd441e718669a3624bf603
/src/main/java/org/jitsi/xmpp/extensions/jingle/Reason.java
7ff5110adaaaaeb92ee20a6ffac4644caf8ac90c
[ "Apache-2.0" ]
permissive
jitsi/jitsi-xmpp-extensions
8ade37b914e05a478d6796e469e32dc7f101dc83
fc073fbaef2ab8fd59238164db5cab91f06b5a22
refs/heads/master
2023-09-02T02:14:46.691174
2023-08-02T13:02:35
2023-08-02T13:02:35
178,438,272
15
54
Apache-2.0
2023-09-13T20:50:55
2019-03-29T16:13:39
Java
UTF-8
Java
false
false
5,299
java
/* * Copyright @ 2018 - present 8x8, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.jitsi.xmpp.extensions.jingle; /** * This enumeration contains the reason values that provide machine readable * information about the condition that prompted the corresponding jingle * action. * * @author Emil Ivov */ public enum Reason { /** * A reason indicating that the party prefers to use an existing session * with the peer rather than initiate a new session; the Jingle session ID * of the alternative session SHOULD be provided as the XML character data * of the <sid/> child. */ ALTERNATIVE_SESSION("alternative-session"), /** * A reason indicating that the party is busy and cannot accept a session. */ BUSY("busy"), /** * A reason indicating that the initiator wishes to formally cancel the * session initiation request. */ CANCEL("cancel"), /** * A reason indicating that the action is related to connectivity problems. */ CONNECTIVITY_ERROR("connectivity-error"), /** * A reason indicating that the party wishes to formally decline the * session. */ DECLINE("decline"), /** * A reason indicating that the session length has exceeded a pre-defined * time limit (e.g., a meeting hosted at a conference service). */ EXPIRED("expired"), /** * A reason indicating that the party has been unable to initialize * processing related to the application type. */ FAILED_APPLICATION("failed-application"), /** * A reason indicating that the party has been unable to establish * connectivity for the transport method. */ FAILED_TRANSPORT("failed-transport"), /** * A reason indicating that the action is related to a non-specific * application error. */ GENERAL_ERROR("general-error"), /** * A reason indicating that the entity is going offline or is no longer * available. */ GONE("gone"), /** * A reason indicating that the party supports the offered application type * but does not support the offered or negotiated parameters. */ INCOMPATIBLE_PARAMETERS("incompatible-parameters"), /** * A reason indicating that the action is related to media processing * problems. */ MEDIA_ERROR("media-error"), /** * A reason indicating that the action is related to a violation of local * security policies. */ SECURITY_ERROR("security-error"), /** * A reason indicating that the action is generated during the normal * course of state management and does not reflect any error. */ SUCCESS("success"), /** * A reason indicating that a request has not been answered so the sender * is timing out the request. */ TIMEOUT("timeout"), /** * A reason indicating that the party supports none of the offered * application types. */ UNSUPPORTED_APPLICATIONS("unsupported-applications"), /** * A reason indicating that the party supports none of the offered * transport methods. */ UNSUPPORTED_TRANSPORTS("unsupported-transports"), /** * A reason created for unsupported reasons(not defined in this enum). */ UNDEFINED("undefined"); /** * The name of this direction. */ private final String reasonValue; /** * Creates a <tt>JingleAction</tt> instance with the specified name. * * @param reasonValue the name of the <tt>JingleAction</tt> we'd like * to create. */ private Reason(String reasonValue) { this.reasonValue = reasonValue; } /** * Returns the name of this reason (e.g. "success" or "timeout"). The name * returned by this method is meant for use directly in the XMPP XML string. * * @return the name of this reason (e.g. "success" or "timeout"). */ @Override public String toString() { return reasonValue; } /** * Returns a <tt>Reason</tt> value corresponding to the specified * <tt>reasonValueStr</tt> or in other words {@link #SUCCESS} for * "success" or {@link #TIMEOUT} for "timeout"). * * @param reasonValueStr the action <tt>String</tt> that we'd like to * parse. * @return a <tt>JingleAction</tt> value corresponding to the specified * <tt>jingleValueStr</tt>. Returns {@link #UNDEFINED} for invalid * <tt>jingleValueStr</tt> values. * */ public static Reason parseString(String reasonValueStr) { for (Reason value : values()) if (value.toString().equals(reasonValueStr)) return value; return UNDEFINED; } }
[ "damencho@jitsi.org" ]
damencho@jitsi.org
47bacd144454f969b999f0552ec1fa45f5db8c4f
b829b674062561d59216f8f6497dd8a2e6658a4f
/xycode/src/main/java/com/billz/xycode/service/user/UserAccountTransService.java
c88e3d7dfc7088e34ce5c2f0f323bb0d32f001d8
[]
no_license
gzbillz/syscode
29f50d5fecdefa3e229d526d7b8e67acbd3f47f5
318f8db5b20b6c7957259085c3585b60f28fda25
refs/heads/master
2021-07-25T12:42:46.725688
2017-11-05T06:52:53
2017-11-05T06:52:53
109,558,074
0
0
null
null
null
null
UTF-8
Java
false
false
597
java
package com.billz.xycode.service.user; import com.billz.util.Prb; import com.billz.util.Psb; import com.billz.xycode.model.user.UserAccountTrans; /** * @class UserAccountTransService.java * @author billz * @date 2017-10-07 */ public interface UserAccountTransService { /** * 分页查询 * * @param psb * @return */ Prb<UserAccountTrans> findPageList(Psb<UserAccountTrans> psb); int updateByTid(UserAccountTrans userAccountTrans); int insert(UserAccountTrans userAccountTrans); int delByTid(Long tid); UserAccountTrans findByTid(Long tid); }
[ "billz@billz-PC" ]
billz@billz-PC
b02b1e1fe2e36d70a182a65e2aea964922bc2ded
f7350fc6920e44e363b58962d78ab57b6004422b
/src/Controleur/ControleurLigneSelectione.java
1c23357e825f187fcaacbdd13f8ece45add64199
[]
no_license
gilles971/Projet-S2
1f31f7167a04494aeab03471b300c8a0c3155c01
fb7561d59cca18c2efba673a8c8aa2a3662ff620
refs/heads/master
2021-07-04T03:12:51.507252
2017-09-26T22:34:53
2017-09-26T22:34:53
104,897,647
0
0
null
null
null
null
UTF-8
Java
false
false
853
java
package Controleur; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import IHM.MainWindows; public class ControleurLigneSelectione implements MouseListener { private int ligne; public void mouseClicked(MouseEvent e) { // MainWindows.setLigne(MainWindows.getListeequipe().getSelectedRow()); // System.out.println(MainWindows.getLigne()); } public void mouseEntered(MouseEvent e) { } public void mouseExited(MouseEvent e) { // MainWindows.setLigne(MainWindows.getListeequipe().getSelectedRow()); // System.out.println(MainWindows.getLigne()); } public void mousePressed(MouseEvent e) { MainWindows.setLigne(MainWindows.getListeequipe().getSelectedRow()); System.out.println(MainWindows.getLigne()); } public void mouseReleased(MouseEvent arg0) { // TODO Auto-generated method stub } }
[ "gilles-lacemon@orange.fr" ]
gilles-lacemon@orange.fr
8ddef8c3b258ba3567d345f817bdc41f2b23d8d4
da69a9aca1bedd0fddf71e829a1336c6ee398e2b
/WhereAmI/src/com/suny/ocr/network/ImageUpload.java
6512a26c647d6e527202a5dea0d09c6d2aabfba9
[]
no_license
rayvo/whereami-suny
b8760d7ebf5f96561a8c672871860e518ee31372
ca8dfdfb778de7460851ef81661a877add5b96b4
refs/heads/master
2016-09-06T04:26:41.050798
2014-05-23T13:00:54
2014-05-23T13:00:54
33,710,676
0
0
null
null
null
null
UTF-8
Java
false
false
3,596
java
package com.suny.ocr.network; import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.apache.http.client.ClientProtocolException; import android.app.Activity; import android.app.ProgressDialog; import android.content.Intent; import android.database.Cursor; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; import android.provider.MediaStore; import android.widget.Button; import android.widget.EditText; import android.widget.ImageView; public class ImageUpload extends Activity { private static final int PICK_IMAGE = 1; private ImageView imgView; private Button upload; private EditText caption; private Bitmap bitmap; private ProgressDialog dialog; private String[] filePaths; private List<String> fileNames; String lat, lon; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Intent intent = getIntent(); lat = intent.getStringExtra("LAT"); lon = intent.getStringExtra("LON"); String names = intent.getStringExtra("FILENAMES"); filePaths = names.split("&"); fileNames = new ArrayList<String>(); String folder = "/sdcard/"; for (int i = 0; i< filePaths.length; i++) { String path = filePaths[i]; fileNames.add(path.substring(path.lastIndexOf("/"))); } new ImageUploadTask().execute(); } class ImageUploadTask extends AsyncTask<Void, Void, String> { @Override protected String doInBackground(Void... unsued) { try { CommClient client = new CommClient(); client.procUploadFile(lat, lon, fileNames, filePaths, 0); return "SUCCESS"; } catch (ClientProtocolException e) { return e.toString(); } catch (IOException e) { return e.toString(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); return e.toString(); } } @Override protected void onProgressUpdate(Void... unsued) { } @Override protected void onPostExecute(String sResponse) { } } public String getPath(Uri uri) { String[] projection = { MediaStore.Images.Media.DATA }; Cursor cursor = managedQuery(uri, projection, null, null, null); if (cursor != null) { // HERE YOU WILL GET A NULLPOINTER IF CURSOR IS NULL // THIS CAN BE, IF YOU USED OI FILE MANAGER FOR PICKING THE MEDIA int column_index = cursor .getColumnIndexOrThrow(MediaStore.Images.Media.DATA); cursor.moveToFirst(); return cursor.getString(column_index); } else return null; } public void decodeFile(String filePath) { // Decode image size BitmapFactory.Options o = new BitmapFactory.Options(); o.inJustDecodeBounds = true; BitmapFactory.decodeFile(filePath, o); // The new size we want to scale to final int REQUIRED_SIZE = 1024; // Find the correct scale value. It should be the power of 2. int width_tmp = o.outWidth, height_tmp = o.outHeight; int scale = 1; while (true) { if (width_tmp < REQUIRED_SIZE && height_tmp < REQUIRED_SIZE) break; width_tmp /= 2; height_tmp /= 2; scale *= 2; } // Decode with inSampleSize BitmapFactory.Options o2 = new BitmapFactory.Options(); o2.inSampleSize = scale; bitmap = BitmapFactory.decodeFile(filePath, o2); imgView.setImageBitmap(bitmap); } }
[ "quocduy.vo@stonybrook.edu@c1c51718-bdb0-b164-7fb2-df2349e07390" ]
quocduy.vo@stonybrook.edu@c1c51718-bdb0-b164-7fb2-df2349e07390
3b1bf95f955e48716050ea8df2749d16a9e24236
241c42244d40aab48a20d46c1c60b18b06aee42d
/src/main/java/ua/lviv/iot/zoo/shop/models/BirdsSoundsType.java
695abbd1c29f0ac39020cf29ed0e2a733bf27922
[]
no_license
VladTvardovskyi/Lab5-6
19be4eb4e675df297340c9e56942185448fbc4e4
5b218f55cd4f8e1053bf8adde4ddd58f3a3345f6
refs/heads/master
2020-05-21T06:01:35.632204
2019-06-08T09:55:41
2019-06-08T09:55:41
185,932,556
0
0
null
2019-06-08T10:06:15
2019-05-10T06:37:11
Java
UTF-8
Java
false
false
104
java
package ua.lviv.iot.zoo.shop.models; public enum BirdsSoundsType { SOUNDS, VOICE, SILENT; }
[ "noreply@github.com" ]
noreply@github.com
d0f7bf8f1cf7c815670a5de6cd54eaa8615f2414
7cc1acab6e42aae3d0cec1c99cbfdb175e83f638
/main/java/com/dacin21/survivalmod/reactor/producion/ContainerElectrolyzer.java
859463bb2d718365e9924667d6a254770ef8e4fe
[]
no_license
dacin21/Minecraftmod
f0ee703f8aad129194b96d2f49f0763ab3847e4d
09b1005eeb4a4d2105574d236369ab34db5b9894
refs/heads/master
2020-03-30T12:06:20.315604
2015-01-28T19:10:35
2015-01-28T19:10:35
27,506,430
1
1
null
null
null
null
UTF-8
Java
false
false
3,216
java
package com.dacin21.survivalmod.reactor.producion; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class ContainerElectrolyzer extends Container { private TileElectrolyzer tileElectrolyzer; public ContainerElectrolyzer(InventoryPlayer p_i1812_1_, TileElectrolyzer p_i1812_2_) { this.tileElectrolyzer = p_i1812_2_; int i; for (i = 0; i < 3; ++i) { for (int j = 0; j < 9; ++j) { this.addSlotToContainer(new Slot(p_i1812_1_, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); } } for (i = 0; i < 9; ++i) { this.addSlotToContainer(new Slot(p_i1812_1_, i, 8 + i * 18, 142)); } } @Override public void addCraftingToCrafters(ICrafting p_75132_1_) { super.addCraftingToCrafters(p_75132_1_); } /** * Looks for changes made in the container, sends them to every listener. */ @Override public void detectAndSendChanges() { super.detectAndSendChanges(); } @SideOnly(Side.CLIENT) @Override public void updateProgressBar(int p_75137_1_, int p_75137_2_) { } @Override public boolean canInteractWith(EntityPlayer p_75145_1_) { return this.tileElectrolyzer.isUseableByPlayer(p_75145_1_); } /** * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. */ @Override public ItemStack transferStackInSlot(EntityPlayer par1Player, int par2Slot) { ItemStack itemstack = null; Slot slot = (Slot)this.inventorySlots.get(par2Slot); if (slot != null && slot.getHasStack()) { ItemStack itemstack1 = slot.getStack(); itemstack = itemstack1.copy(); if (par2Slot >= 0 && par2Slot < 27) { if (!this.mergeItemStack(itemstack1, 27, 36, false)) { return null; } } else if (par2Slot >= 27 && par2Slot < 36) { if (!this.mergeItemStack(itemstack1, 0, 27, false)) { return null; } } else if (!this.mergeItemStack(itemstack1, 0, 36, false)) { return null; } if (itemstack1.stackSize == 0) { slot.putStack((ItemStack)null); } else { slot.onSlotChanged(); } if (itemstack1.stackSize == itemstack.stackSize) { return null; } slot.onPickupFromSlot(par1Player, itemstack1); } return itemstack; } }
[ "daniel.rutschmann@stud.ksimlee.ch" ]
daniel.rutschmann@stud.ksimlee.ch
da948c34b6a4774d098cf166e4c07fd7573dba2f
586b994b8f478d38d44f6a06e317a2b52403f80d
/app/src/main/java/com/raymond/randomexercise/activities/MainActivity.java
55da25b3bf747251d220baa795965010f0a44fb9
[]
no_license
am5a03/random-android-exercise
fd04c733e1b11becfeb7a98598c482f1a1a05231
4a03735ff37ed080231af306e33dd7674b0fcdb9
refs/heads/master
2021-01-17T06:50:08.084975
2016-06-19T07:33:15
2016-06-19T07:33:15
53,334,417
0
0
null
null
null
null
UTF-8
Java
false
false
2,996
java
package com.raymond.randomexercise.activities; import android.os.Build; import android.provider.Settings; import android.support.design.widget.CoordinatorLayout; import android.support.design.widget.TabLayout; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentStatePagerAdapter; import android.support.v4.view.ViewPager; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import com.raymond.randomexercise.R; import com.raymond.randomexercise.fragments.ScrollingImageFragment; import com.raymond.robo.Metrics; public class MainActivity extends AppCompatActivity { private static final String TAG = "MainActivity"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_simple); TabLayout tabLayout = (TabLayout) findViewById(R.id.tabLayout); ViewPager viewPager = (ViewPager) findViewById(R.id.viewPager); MyFragmentPagerAdapter adapter = new MyFragmentPagerAdapter(getSupportFragmentManager()); viewPager.setAdapter(adapter); tabLayout.setupWithViewPager(viewPager); for (int i = 0; i < tabLayout.getTabCount(); i++) { tabLayout.getTabAt(i).setIcon(R.drawable.ic_child_care_black); } tabLayout.setOnTabSelectedListener(new TabLayout.OnTabSelectedListener() { @Override public void onTabSelected(TabLayout.Tab tab) { } @Override public void onTabUnselected(TabLayout.Tab tab) { } @Override public void onTabReselected(TabLayout.Tab tab) { } }); } static class MyFragmentPagerAdapter extends FragmentStatePagerAdapter { public static final int TAB_1 = 0; public static final int TAB_2 = 1; public static final int TAB_3 = 2; public MyFragmentPagerAdapter(FragmentManager fm) { super(fm); } @Override public Fragment getItem(int position) { switch (position) { case TAB_1: return new ScrollingImageFragment(); case TAB_2: return new Fragment(); case TAB_3: return new Fragment(); } return null; } @Override public CharSequence getPageTitle(int position) { switch (position) { case TAB_1: return "Home"; case TAB_2: return "WTF"; case TAB_3: return "HAHA"; } return null; } @Override public int getCount() { return 3; } } }
[ "am5a03@gmial.com" ]
am5a03@gmial.com
33042ae3ad08e13be7a583eff3526413dc5856e4
35d7c9928f159bd064887335626999e817d4999d
/GithubTest/src/api/io/single/Test01.java
42ba0575ef6fe56e958fa17b72c7a5f7609b68f0
[]
no_license
whehtk22/hyunsung1
e1a25f669b612fd74f42c927cbcc8da77f336861
7bf06d9e34052b2677daa1104418e39b1cae6021
refs/heads/master
2020-03-26T15:52:58.003346
2018-08-22T06:06:53
2018-08-22T06:06:53
145,069,746
0
0
null
null
null
null
UHC
Java
false
false
867
java
package api.io.single; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; public class Test01 { public static void main(String[] args) throws IOException { // 싱글 바이트 출력 // 준비물 : 파일 인스턴스, 출력용 통로 File target = new File("files","single.txt"); // target.createNewFile(); FileOutputStream out = new FileOutputStream(target); // [프로그램]->out->target->[single.txt] out.write(65);//A out.write(97); out.write(30000);//48(손실이 발생, byte의 범위를 초과하였기 때문에) out.write(9); out.write(104);//h out.write(101);//e out.write(108);//l out.write(108);//l out.write(111);//o out.write(10);//\n // 통로는 무조건 폐기해야 한다. out.close(); } }
[ "Administrator@203-07" ]
Administrator@203-07
4fa69e7afd57a36c4c0453300840b6cefc8fb79b
d6d918a6a530f536f8dd9127ea8a468ee13c9bf1
/java/squeek/applecore/example/HealthRegenModifier.java
03398e435867f5cb9f9cbf41e7a86f9dc252fe32
[ "Unlicense" ]
permissive
AnodeCathode/AppleCore
ff7c24c0b856eb5d55d8b538767d2beda82e9e44
f01220c9aaa06e7941f5f59b8d3ac9d0b1756035
refs/heads/master
2021-01-16T21:19:29.409799
2014-08-19T14:17:40
2014-08-19T14:17:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
610
java
package squeek.applecore.example; import squeek.applecore.api.hunger.HealthRegenEvent; import cpw.mods.fml.common.eventhandler.Event.Result; import cpw.mods.fml.common.eventhandler.SubscribeEvent; public class HealthRegenModifier { @SubscribeEvent public void allowHealthRegen(HealthRegenEvent.AllowRegen event) { event.setResult(Result.ALLOW); } @SubscribeEvent public void onRegenTick(HealthRegenEvent.GetRegenTickPeriod event) { event.regenTickPeriod = 6; } @SubscribeEvent public void onRegen(HealthRegenEvent.Regen event) { event.deltaHealth = 2; event.deltaExhaustion = 5f; } }
[ "squeek502@hotmail.com" ]
squeek502@hotmail.com
9fa1c9628683abfb359fab344f2d11871e4ef4ce
7d8ed1104966982c90d5b8b35ea92491286836f6
/src/test/java/com/cts/test/ribbondemo/RibbonDemoApplicationTests.java
bb6e98ad24f2a5d71ab31dd7bf4dec41c1d04bac
[]
no_license
PrasanthMohanCognizant/ribbon-example
e05b1d1f9eddecbdf427e6d8cf0698f88a069a81
4f26b41ad4ae225da1316d26e9cfacbba850c6a2
refs/heads/master
2021-04-03T01:28:35.690534
2018-03-13T14:51:38
2018-03-13T14:51:38
125,062,492
1
0
null
null
null
null
UTF-8
Java
false
false
344
java
package com.cts.test.ribbondemo; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class RibbonDemoApplicationTests { @Test public void contextLoads() { } }
[ "prasanth.mohan@cognizant.com" ]
prasanth.mohan@cognizant.com
ef88f5c92464daa66206531dad89be194b4d1d9e
820c58c50c51af6238ac5c1b0fa12504dfd95133
/app/src/main/java/com/yoyiyi/soleil/module/home/ChaseBangumiFragment.java
0d5d70eb9b29e5797e223897dda0f3e8cafae0b4
[ "Apache-2.0" ]
permissive
Calo-missile/bilisoleil
f07ef30d0121585d515bcafdedb4ec96fa675973
0a9f3370a864852bad88c7463237d189a954b445
refs/heads/master
2020-06-26T09:26:22.781985
2017-07-12T10:16:57
2017-07-12T10:16:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,415
java
package com.yoyiyi.soleil.module.home; import android.support.v7.widget.LinearLayoutManager; import com.yoyiyi.soleil.R; import com.yoyiyi.soleil.adapter.home.section.chase.ChaseAdSection; import com.yoyiyi.soleil.adapter.home.section.chase.ChaseFollowSection; import com.yoyiyi.soleil.adapter.home.section.chase.ChaseIndexSection; import com.yoyiyi.soleil.adapter.home.section.chase.ChaseRecommendCNSection; import com.yoyiyi.soleil.adapter.home.section.chase.ChaseRecommendJPSection; import com.yoyiyi.soleil.base.BaseRefreshFragment; import com.yoyiyi.soleil.bean.chase.ChaseBangumi; import com.yoyiyi.soleil.bean.chase.RecommendBangumi; import com.yoyiyi.soleil.mvp.contract.home.ChaseBangumiContract; import com.yoyiyi.soleil.mvp.presenter.home.ChaseBangumiPresenter; import com.yoyiyi.soleil.utils.EmptyUtils; import com.yoyiyi.soleil.widget.section.SectionedRVAdapter; /** * @author zzq 作者 E-mail: soleilyoyiyi@gmail.com * @date 创建时间:2017/5/23 14:23 * 描述:首页追番 */ public class ChaseBangumiFragment extends BaseRefreshFragment<ChaseBangumiPresenter, ChaseBangumi.FollowsBean> implements ChaseBangumiContract.View { private SectionedRVAdapter mSectionedAdapter; private volatile ChaseBangumi mChaseBangumi; private RecommendBangumi.RecommendCnBean mRecommendCnBean; private RecommendBangumi.RecommendJpBean mRecommendJpBean; private RecommendBangumi mRecommendBangumi; public static ChaseBangumiFragment newInstance() { return new ChaseBangumiFragment(); } @Override public int getLayoutId() { return R.layout.fragment_home_chase_bangumi; } @Override protected void clear() { mSectionedAdapter.removeAllSections(); } @Override protected void lazyLoadData() { mPresenter.getChaseBangumiData(); } @Override protected void initInject() { getFragmentComponent().inject(this); } @Override protected void initRecyclerView() { mSectionedAdapter = new SectionedRVAdapter(); mRecycler.setHasFixedSize(true); LinearLayoutManager mLayoutManager = new LinearLayoutManager(getActivity()); mRecycler.setLayoutManager(mLayoutManager); mRecycler.setAdapter(mSectionedAdapter); } @Override public void showChaseBangumi(ChaseBangumi chaseBangumi) { mChaseBangumi = chaseBangumi; } @Override public void showRecommendBangumi(RecommendBangumi recommendBangumi) { mList.addAll(mChaseBangumi.follows); mRecommendBangumi = recommendBangumi; mRecommendCnBean = recommendBangumi.recommend_cn; mRecommendJpBean = recommendBangumi.recommend_jp; finishTask(); } @Override protected void finishTask() { mSectionedAdapter.addSection(new ChaseIndexSection()); mSectionedAdapter.addSection(new ChaseFollowSection(mChaseBangumi.update_count + "", mList)); if (EmptyUtils.isNotEmpty(mRecommendBangumi.ad)) { mSectionedAdapter.addSection(new ChaseAdSection(mRecommendBangumi.ad.get(0))); } mSectionedAdapter.addSection(new ChaseRecommendJPSection(mRecommendJpBean.recommend, mRecommendJpBean.foot.get(0))); mSectionedAdapter.addSection(new ChaseRecommendCNSection(mRecommendCnBean.recommend, mRecommendCnBean.foot.get(0))); mSectionedAdapter.notifyDataSetChanged(); } }
[ "2455676683@qq.com" ]
2455676683@qq.com
42c3d9b07ca52cef4c6231646978b2de7baebe01
34e1e85201730a797f14825f2bfa45cceae24866
/app/src/main/java/com/tesseractumstudios/warhammer_artofwar/util/font/roboto/RobotoFont.java
799f11adbea930fc6690b338347658d8dbcdd3a7
[]
no_license
EvgenyKravtsov/freelance_art_of_war
68ebf9ace4c70c89ff92cd35133b530fdf759d01
1ae77b7caf6a636ca9cb7dd39a27ae4743f8349c
refs/heads/master
2021-01-23T04:58:44.944438
2017-04-03T20:30:08
2017-04-03T20:30:08
86,260,289
0
0
null
null
null
null
UTF-8
Java
false
false
494
java
package com.tesseractumstudios.warhammer_artofwar.util.font.roboto; import android.content.Context; import android.graphics.Typeface; final class RobotoFont { private static Typeface typefaceRegular; //// RobotoFont(Context context) { if (typefaceRegular == null) { typefaceRegular = Typeface.createFromAsset(context.getAssets(), "Roboto-Regular.ttf"); } } //// Typeface getTypefaceRegular() { return typefaceRegular; } }
[ "SleeK89SpraG" ]
SleeK89SpraG
bca7e258d8550dd299825f72aed2a793aad80ee9
6d331ef0308d6d731f61305a427c485adb8ef548
/src/Ventana/VentanaLetraDNI.java
9e22b8becc67f9b3904e1c623e9cb36f8f70b720
[]
no_license
David5002WL/examenEn
273a078c3769dc5f755d850c91fe3119549f5ff8
4a79e9f10db805a8fe9a73f784a659fae5f6b68c
refs/heads/master
2021-01-21T15:27:06.261607
2017-05-19T21:12:26
2017-05-19T21:12:26
91,842,531
0
0
null
null
null
null
ISO-8859-1
Java
false
false
1,741
java
package Ventana; import java.awt.BorderLayout; import java.awt.EventQueue; import java.awt.event.ActionEvent; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.border.EmptyBorder; import Logica.CalcularLetra; import javax.swing.BoxLayout; import javax.swing.JLabel; import javax.swing.JTextField; import javax.swing.JButton; /* * By Paco Gomez * Esta ventana tendrá dos JTextFields * El primero recojerá el DNI * El segundo calculará la letra al apretar el botón * * */ public class VentanaLetraDNI extends JFrame { private JPanel contentPane; private JTextField textField; private JTextField textField_1; /** * Create the frame. */ public VentanaLetraDNI() { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 450, 300); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.Y_AXIS)); JLabel lblIntroduceDni = new JLabel("Introduce DNI"); contentPane.add(lblIntroduceDni); textField = new JTextField(); contentPane.add(textField); textField.setColumns(10); JLabel lblNewLabel = new JLabel("Letra DNI Calculada"); contentPane.add(lblNewLabel); textField_1 = new JTextField(); textField_1.setEditable(false); contentPane.add(textField_1); textField_1.setColumns(10); JButton btnNewButton = new JButton("Calcular"); contentPane.add(btnNewButton); } public void actionPerformed(ActionEvent e) { switch(e.getActionCommand()){ case "Calcular": CalcularLetra c = new CalcularLetra(textField.getText()); char letra = c.dLetra(); textField_1.setText(textField.getText()+letra); } } }
[ "daviidwl@gmail.com" ]
daviidwl@gmail.com
ee7611759172a61961285acbdf5bbafc8d07eb17
2181375512ff7fb467c4327c67120d67b03b8901
/src/main/java/com/puppet/pcore/impl/serialization/json/JsonUnpacker.java
93cd166d8f1d5d101e46a0d5f747b34ce20f1471
[ "Apache-2.0" ]
permissive
puppetlabs/pcore-java
e35d1abaf67e3ed1788451076136aaed02620df5
d7a06dff11a9966c236db092ea6ab1179bf4da93
refs/heads/main
2023-09-02T23:33:58.507913
2022-02-18T19:13:42
2022-02-18T19:13:42
75,075,652
1
6
Apache-2.0
2022-11-16T02:42:24
2016-11-29T11:38:47
Java
UTF-8
Java
false
false
2,988
java
package com.puppet.pcore.impl.serialization.json; import com.puppet.pcore.impl.serialization.ExtensionAwareUnpacker; import com.puppet.pcore.impl.serialization.PayloadReaderFunction; import com.puppet.pcore.serialization.SerializationException; import java.io.BufferedInputStream; import java.io.IOException; import java.io.InputStream; import java.util.*; import static com.puppet.pcore.impl.serialization.json.JsonSerializationFactory.mapper; import static java.lang.String.format; public class JsonUnpacker implements ExtensionAwareUnpacker { private final Stack<Iterator<?>> etorStack = new Stack<>(); private final Map<Byte,PayloadReaderFunction<?>> extensionMap = new HashMap<>(); JsonUnpacker(InputStream in) throws IOException { this(mapper.readValue(new BufferedInputStream(in), List.class)); } JsonUnpacker(List<?> values) { initialize(values); } public void initialize(List<?> values) { etorStack.push(values.iterator()); } @Override public Object read() throws IOException { Object obj; for(; ; ) { Iterator<?> etor = etorStack.lastElement(); if(etor.hasNext()) { obj = etor.next(); if(obj instanceof Integer) obj = ((Integer)obj).longValue(); else if(obj instanceof Float) obj = ((Float)obj).doubleValue(); break; } etorStack.pop(); } if(obj instanceof List<?>) { Iterator<?> extensionEtor = ((List<?>)obj).iterator(); if(!extensionEtor.hasNext()) throw new SerializationException("Unexpected EOF while reading extended data"); etorStack.push(extensionEtor); byte extNo = (byte)readInt(); PayloadReaderFunction<?> payloadReaderFunction = extensionMap.get(extNo); if(payloadReaderFunction == null) throw new SerializationException(format("Invalid input. %d is not a valid extension number", extNo)); obj = payloadReaderFunction.apply(null); } return obj; } @Override public byte[] readBytes() throws IOException { throw new UnsupportedOperationException("readBytes()"); } @Override public int readInt() throws IOException { Object v = read(); if(v instanceof Number) return ((Number)v).intValue(); throw new SerializationException(format("Invalid input. Expected integer, got '%s'", v == null ? "null" : v.getClass().getName())); } @Override public long readLong() throws IOException { Object v = read(); if(v instanceof Number) return ((Number)v).longValue(); throw new SerializationException(format("Invalid input. Expected integer, got '%s'", v == null ? "null" : v.getClass().getName())); } @Override public String readString() throws IOException { Object v = read(); if(v instanceof String) return (String)v; throw new SerializationException(format("Invalid input. Expected string, got '%s'", v == null ? "null" : v.getClass().getName())); } @Override public void registerType(byte extensionNumber, PayloadReaderFunction<?> payloadReaderFunction) { extensionMap.put(extensionNumber, payloadReaderFunction); } }
[ "thomas@tada.se" ]
thomas@tada.se
3dc5d009125e8c5e4d0a3c9c6c11b531c9a45a50
c04f1a489798b44106dda3370323e95ec26b5819
/src/com/bignerdranch/android/criminalintent/SingleFragmentActivity.java
28f8d922574332e9903dfe48043f672dd81c6009
[]
no_license
o4wcoder/CriminalIntent
dafbc36cf54db991e97eb5a73fbe33d451d0ed4c
8b2dde87db2126aa88a3383bfd5a38dbc311c9ff
refs/heads/master
2021-01-20T00:57:07.295595
2015-07-11T19:54:56
2015-07-11T19:54:56
38,938,347
0
0
null
null
null
null
UTF-8
Java
false
false
1,311
java
package com.bignerdranch.android.criminalintent; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentManager; public abstract class SingleFragmentActivity extends FragmentActivity { /*******************************************************/ /* Local Data */ /*******************************************************/ protected abstract Fragment createFragment(); /*******************************************************/ /* Override Methods */ /*******************************************************/ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_fragment); FragmentManager fm = getSupportFragmentManager(); Fragment fragment = fm.findFragmentById(R.id.fragmentContainer); //No Fragment yet, create it and add it to the fragment to the list if(fragment == null) { fragment = createFragment(); //Create a new fragment transaction, include one add operation in it, //and then commit it. Add fragment to fragment list fm.beginTransaction().add(R.id.fragmentContainer, fragment).commit(); } } }
[ "chris.hare@arrisi.com" ]
chris.hare@arrisi.com
65b8f295bb0959ff67234ad99acd2f17063dd24e
0c34881fe4ff727fbd32f007697d95b2d8d2c807
/src/test/java/org/quantum/usa/core/TestBase.java
18a9c87a66639ce6d1fe28d68d2b3f7fca3d4b81
[]
no_license
sarkershantonu/QuantumUSA
a46d1386983f988f5446d7afed1ab0bf01ff2a14
a12824ff4c3740195a5390f50b95d568a36bd129
refs/heads/master
2022-11-26T05:07:38.776763
2019-09-15T17:12:20
2019-09-15T17:12:20
167,896,195
1
2
null
2022-11-16T11:32:53
2019-01-28T03:58:30
Java
UTF-8
Java
false
false
1,984
java
package org.quantum.usa.core; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Rule; import org.junit.rules.TestWatcher; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import ru.yandex.qatools.allure.events.StepFinishedEvent; import ru.yandex.qatools.allure.events.StepStartedEvent; import ru.yandex.qatools.allure.experimental.LifecycleListener; import java.io.IOException; import java.util.Deque; import java.util.LinkedList; public class TestBase extends LifecycleListener { private Deque<String> names = new LinkedList<>(); @Override public void fire(StepStartedEvent event) { names.push(event.getName()); logger.info(getOffset() + "@Step:" + names.getFirst()); } @Override public void fire(StepFinishedEvent event) { logger.info(getOffset() + "@Step done " + names.poll()); } private String getOffset() { return new String(new char[names.size() == 0 ? 0 : names.size() - 1]).replaceAll("\0", " "); } protected Logger logger = LoggerFactory.getLogger(this.getClass()); @Rule public TestWatcher testLogs = new LoggingRule(logger); protected static WebDriver browser; protected static String baseUrl; @BeforeClass public static void initForAllClasses() throws IOException { PropertyLoader.loadProperties(); browser = Browser.getInstance(); baseUrl = System.getProperty("app.url"); } @AfterClass public static void cleanupClass() { Browser.close(); } public static void print(WebElement element) { System.out.println("TAG " + element.getTagName()); System.out.println("TXT " + element.getText()); System.out.println("VAL " + element.getAttribute("value")); System.out.println("SIZE " + element.getSize().toString()); System.out.println(element.toString()); } }
[ "shantonu_oxford@yahoo.com" ]
shantonu_oxford@yahoo.com
2eb944b60c3ea5f7e7b5a078aff506f0a149bd3f
48641458a6dae5db620c38195d545e3b51d2cd29
/study/src/main/java/com/study/day15/Employee.java
d50fbaa6db094a36f637011f0a475ae5a5abf008
[]
no_license
austin779/Java20210726
a62b915bb056103b84c5dc243ad478342820edee
ab06ea2ab5219fcb0343f34314ffae549eb73ef9
refs/heads/main
2023-07-09T10:32:21.399622
2021-08-09T03:12:27
2021-08-09T03:12:27
389,515,936
0
0
null
null
null
null
UTF-8
Java
false
false
70
java
package com.study.day15; public class Employee { int salary; }
[ "awk19690730@gmail.com" ]
awk19690730@gmail.com
b37647d194944fe19cb46e6f6c1167c4777f8b84
9f5b170216271d68097c021472e32d6929b3f73d
/core/src/com/mygdx/game/Ball.java
d8b9f6d4aa4b768bccf86a4980af56003e608f3e
[]
no_license
Stas125/PingPongStas
3dbe4ba7a10b00d5a72cb62ecb8f105a6d136815
0e6a0c3e96add9360a73020cfb587dd4f2070ea7
refs/heads/master
2020-04-11T09:22:24.805035
2018-12-27T15:09:29
2018-12-27T15:09:29
161,675,411
0
0
null
null
null
null
UTF-8
Java
false
false
1,523
java
package com.mygdx.game; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.SpriteBatch; public class Ball { int x, y; Texture texture; int velocityX = 6, velocityY = 6; int ballStartFrameCounter, flyFrameCounter; final int FRAMES_TO_WAIT_BEFORE_BALL_START = 60; void loadTexture(){ texture = new Texture("ball_small.png"); } void draw(SpriteBatch batch){ batch.draw(texture, x, y); } void dispose(){ texture.dispose(); } void move(Paddle paddle){ if(ballStartFrameCounter > FRAMES_TO_WAIT_BEFORE_BALL_START){ y += velocityY; x += velocityX; flyFrameCounter++; if(flyFrameCounter > 100){ if(velocityX > 0){ velocityX += 1; }else{ velocityX -= 1; } if(velocityY > 0){ velocityY += 1; }else{ velocityY -= 1; } flyFrameCounter = 0; } } if (ballStartFrameCounter < FRAMES_TO_WAIT_BEFORE_BALL_START){ x = paddle.x + paddle.texture.getWidth() / 2 - texture.getWidth() / 2; } } void reset(Paddle paddle){ y = paddle.y + paddle.texture.getHeight(); x = paddle.x + paddle.texture.getWidth() / 2 - texture.getWidth() / 2; ballStartFrameCounter = 0; velocityY = Math.abs(velocityY); } }
[ "andrewwajnapresents@gmail.com" ]
andrewwajnapresents@gmail.com
a4fd944cc040b0a795f325061762ccb5e0ccb70f
dd80a584130ef1a0333429ba76c1cee0eb40df73
/packages/inputmethods/LatinIME/tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateTestsBase.java
3ffd0a96a539de992e024e981f45ed1208c4e5da
[ "MIT" ]
permissive
karunmatharu/Android-4.4-Pay-by-Data
466f4e169ede13c5835424c78e8c30ce58f885c1
fcb778e92d4aad525ef7a995660580f948d40bc9
refs/heads/master
2021-03-24T13:33:01.721868
2017-02-18T17:48:49
2017-02-18T17:48:49
81,847,777
0
2
MIT
2020-03-09T00:02:12
2017-02-13T16:47:00
null
UTF-8
Java
false
false
9,359
java
/* * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.inputmethod.keyboard.internal; import android.test.AndroidTestCase; import com.android.inputmethod.latin.Constants; public class KeyboardStateTestsBase extends AndroidTestCase implements MockKeyboardSwitcher.MockConstants { protected MockKeyboardSwitcher mSwitcher; @Override protected void setUp() throws Exception { super.setUp(); mSwitcher = new MockKeyboardSwitcher(); mSwitcher.setAutoCapsMode(CAP_MODE_OFF); loadKeyboard(ALPHABET_UNSHIFTED); } /** * Set auto caps mode. * * @param autoCaps the auto cap mode. */ public void setAutoCapsMode(final int autoCaps) { mSwitcher.setAutoCapsMode(autoCaps); } private static void assertLayout(final String message, final int expected, final int actual) { assertTrue(message + ": expected=" + MockKeyboardSwitcher.getLayoutName(expected) + " actual=" + MockKeyboardSwitcher.getLayoutName(actual), expected == actual); } /** * Emulate update keyboard shift state. * * @param afterUpdate the keyboard state after updating the keyboard shift state. */ public void updateShiftState(final int afterUpdate) { mSwitcher.updateShiftState(); assertLayout("afterUpdate", afterUpdate, mSwitcher.getLayoutId()); } /** * Emulate load default keyboard. * * @param afterLoad the keyboard state after loading default keyboard. */ public void loadKeyboard(final int afterLoad) { mSwitcher.loadKeyboard(); mSwitcher.updateShiftState(); assertLayout("afterLoad", afterLoad, mSwitcher.getLayoutId()); } /** * Emulate rotate device. * * @param afterRotate the keyboard state after rotating device. */ public void rotateDevice(final int afterRotate) { mSwitcher.saveKeyboardState(); mSwitcher.loadKeyboard(); assertLayout("afterRotate", afterRotate, mSwitcher.getLayoutId()); } private void pressKeyWithoutTimerExpire(final int code, final boolean isSinglePointer, final int afterPress) { mSwitcher.onPressKey(code, isSinglePointer); assertLayout("afterPress", afterPress, mSwitcher.getLayoutId()); } /** * Emulate key press. * * @param code the key code to press. * @param afterPress the keyboard state after pressing the key. */ public void pressKey(final int code, final int afterPress) { mSwitcher.expireDoubleTapTimeout(); pressKeyWithoutTimerExpire(code, true, afterPress); } /** * Emulate key release and register. * * @param code the key code to release and register * @param afterRelease the keyboard state after releasing the key. */ public void releaseKey(final int code, final int afterRelease) { mSwitcher.onCodeInput(code); mSwitcher.onReleaseKey(code, NOT_SLIDING); assertLayout("afterRelease", afterRelease, mSwitcher.getLayoutId()); } /** * Emulate key press and release. * * @param code the key code to press and release. * @param afterPress the keyboard state after pressing the key. * @param afterRelease the keyboard state after releasing the key. */ public void pressAndReleaseKey(final int code, final int afterPress, final int afterRelease) { pressKey(code, afterPress); releaseKey(code, afterRelease); } /** * Emulate chording key press. * * @param code the chording key code. * @param afterPress the keyboard state after pressing chording key. */ public void chordingPressKey(final int code, final int afterPress) { mSwitcher.expireDoubleTapTimeout(); pressKeyWithoutTimerExpire(code, false, afterPress); } /** * Emulate chording key release. * * @param code the cording key code. * @param afterRelease the keyboard state after releasing chording key. */ public void chordingReleaseKey(final int code, final int afterRelease) { mSwitcher.onCodeInput(code); mSwitcher.onReleaseKey(code, NOT_SLIDING); assertLayout("afterRelease", afterRelease, mSwitcher.getLayoutId()); } /** * Emulate chording key press and release. * * @param code the chording key code. * @param afterPress the keyboard state after pressing chording key. * @param afterRelease the keyboard state after releasing chording key. */ public void chordingPressAndReleaseKey(final int code, final int afterPress, final int afterRelease) { chordingPressKey(code, afterPress); chordingReleaseKey(code, afterRelease); } /** * Emulate start of the sliding key input. * * @param code the key code to start sliding. * @param afterPress the keyboard state after pressing the key. * @param afterSlide the keyboard state after releasing the key with sliding input. */ public void pressAndSlideFromKey(final int code, final int afterPress, final int afterSlide) { pressKey(code, afterPress); mSwitcher.onReleaseKey(code, SLIDING); assertLayout("afterSlide", afterSlide, mSwitcher.getLayoutId()); } /** * Emulate end of the sliding key input. * * @param code the key code to stop sliding. * @param afterPress the keyboard state after pressing the key. * @param afterSlide the keyboard state after releasing the key and stop sliding. */ public void stopSlidingOnKey(final int code, final int afterPress, final int afterSlide) { pressKey(code, afterPress); mSwitcher.onCodeInput(code); mSwitcher.onReleaseKey(code, NOT_SLIDING); mSwitcher.onFinishSlidingInput(); assertLayout("afterSlide", afterSlide, mSwitcher.getLayoutId()); } /** * Emulate cancel the sliding key input. * * @param afterCancelSliding the keyboard state after canceling sliding input. */ public void stopSlidingAndCancel(final int afterCancelSliding) { mSwitcher.onFinishSlidingInput(); assertLayout("afterCancelSliding", afterCancelSliding, mSwitcher.getLayoutId()); } /** * Emulate long press shift key. * * @param afterPress the keyboard state after pressing shift key. * @param afterLongPress the keyboard state after long press fired. */ public void longPressShiftKey(final int afterPress, final int afterLongPress) { // Long press shift key will register {@link Constants#CODE_CAPS_LOCK}. See // {@link R.xml#key_styles_common} and its baseForShiftKeyStyle. We thus emulate the // behavior that is implemented in {@link MainKeyboardView#onLongPress(PointerTracker)}. pressKey(Constants.CODE_SHIFT, afterPress); mSwitcher.onPressKey(Constants.CODE_CAPSLOCK, true /* isSinglePointer */); mSwitcher.onCodeInput(Constants.CODE_CAPSLOCK); assertLayout("afterLongPress", afterLongPress, mSwitcher.getLayoutId()); } /** * Emulate long press shift key and release. * * @param afterPress the keyboard state after pressing shift key. * @param afterLongPress the keyboard state after long press fired. * @param afterRelease the keyboard state after shift key is released. */ public void longPressAndReleaseShiftKey(final int afterPress, final int afterLongPress, final int afterRelease) { // Long press shift key will register {@link Constants#CODE_CAPS_LOCK}. See // {@link R.xml#key_styles_common} and its baseForShiftKeyStyle. We thus emulate the // behavior that is implemented in {@link MainKeyboardView#onLongPress(PointerTracker)}. longPressShiftKey(afterPress, afterLongPress); releaseKey(Constants.CODE_CAPSLOCK, afterRelease); } /** * Emulate the second press of the double tap. * * @param code the key code to double tap. * @param afterPress the keyboard state after pressing the second tap. */ public void secondPressKey(final int code, final int afterPress) { pressKeyWithoutTimerExpire(code, true, afterPress); } /** * Emulate the second tap of the double tap. * * @param code the key code to double tap. * @param afterPress the keyboard state after pressing the second tap. * @param afterRelease the keyboard state after releasing the second tap. */ public void secondPressAndReleaseKey(final int code, final int afterPress, final int afterRelease) { secondPressKey(code, afterPress); releaseKey(code, afterRelease); } }
[ "karun.matharu@gmail.com" ]
karun.matharu@gmail.com
0b766fb8af7f552967bb89d6973873d3619b65bc
168abd17c463883dd132585910287ab8084d2907
/src/io/github/at/events/CooldownManager.java
cfe40c90a6dcd318ff22bd8abcd28d43f129e3e2
[]
no_license
siaynoq/AT-Rewritten
e1aeb59c6068b456ea2438df469198019bcb60de
fd7eda6801b2590597645010ad25b7799f16a5bb
refs/heads/master
2020-12-03T00:49:42.758940
2019-12-24T16:58:39
2019-12-24T16:58:39
231,163,342
0
0
null
2020-01-01T01:24:50
2020-01-01T01:24:49
null
UTF-8
Java
false
false
346
java
package io.github.at.events; import org.bukkit.entity.Player; import org.bukkit.scheduler.BukkitRunnable; import java.util.HashMap; public class CooldownManager { private static HashMap<Player, BukkitRunnable> cooldown = new HashMap<>(); public static HashMap<Player, BukkitRunnable> getCooldown() { return cooldown; } }
[ "niestrat99@gmail.com" ]
niestrat99@gmail.com
971bf5f614869cf3568178b20806015f1e325125
7c82aab529c3904c783dc206c8af343eb631cd70
/src/uteis/ComparadorCpf.java
ac5178da017f4db05c1a712357f91c85f6dd98c0
[]
no_license
raonicmoreira/aula_13
d86b864cb03bcd79fc9c2a4a86961d09ebef7b6b
e20b382ee6f8e47a7d3249515a3c269e0f4d47ed
refs/heads/master
2023-09-04T11:18:02.387776
2021-10-15T00:01:44
2021-10-15T00:01:44
414,791,545
0
0
null
null
null
null
UTF-8
Java
false
false
273
java
package uteis; import java.util.Comparator; import modelo.Pessoa; public class ComparadorCpf implements Comparator<Pessoa>{ @Override public int compare(Pessoa pessoa1, Pessoa pessoa2) { return pessoa1.getCpf().compareTo(pessoa2.getCpf()); } }
[ "=" ]
=
3e839b01c9fe0e6ab012333df01ee8fcc415cb90
38805bacddfe5b1761f42efe91b11b70aa5006ce
/app/src/main/java/saim/com/autisticapp/Game2/GameRotate2.java
96fdc69e167f541e12882cdfff67b013511815f4
[]
no_license
saikat200/Autistic
6bb35acc4e973eb17de491d906fd6cad602a638c
848b972658d1d9ffef6001dfa55731b2462b94ad
refs/heads/main
2023-07-20T04:07:59.707595
2023-07-06T21:07:56
2023-07-06T21:07:56
321,125,614
0
0
null
null
null
null
UTF-8
Java
false
false
10,485
java
package saim.com.autisticapp.Game2; import android.content.Context; import android.content.DialogInterface; import android.content.res.AssetFileDescriptor; import android.media.MediaPlayer; import android.os.Bundle; import android.speech.tts.TextToSpeech; import android.view.ContextThemeWrapper; import android.view.View; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.TextView; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; import java.io.IOException; import java.util.ArrayList; import saim.com.autisticapp.Model.ModelFamily; import saim.com.autisticapp.R; import saim.com.autisticapp.Util.DBHelperRashed; import saim.com.autisticapp.Util.SharedPrefDatabase; public class GameRotate2 extends AppCompatActivity { int GAME_TYPE, COUNTER = 0, a; TextView txtQuestion, txtTitle; ImageView imgGameRoateimg, qusImgSound; ImageButton imgRotateLeft, imgRotateOk, imgRotateRight; DBHelperRashed dbHelper; ArrayList<ModelFamily> modelFamilies = new ArrayList<>(); ArrayList<Integer> aCounter = new ArrayList<>(); private TextToSpeech textToSpeech; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setTheme(R.style.AppThemeFull); setContentView(R.layout.activity_game_rotate2); init(); } private void init() { GAME_TYPE = getIntent().getExtras().getInt("GAME_TYPE"); dbHelper = new DBHelperRashed(this); modelFamilies = dbHelper.getAllFamilyMembersNew(); txtQuestion = (TextView) findViewById(R.id.txtQuestion); qusImgSound = (ImageView) findViewById(R.id.qusImgSound); imgGameRoateimg = (ImageView) findViewById(R.id.imgGameRoateimg); imgRotateLeft = (ImageButton) findViewById(R.id.imgRotateLeft); imgRotateOk = (ImageButton) findViewById(R.id.imgRotateOk); imgRotateRight = (ImageButton) findViewById(R.id.imgRotateRight); txtTitle = findViewById(R.id.txtTitle); if (new SharedPrefDatabase(getApplicationContext()).RetriveLanguage().equals("BN")) { txtTitle.setText(R.string.games_bn_5); } else if (new SharedPrefDatabase(getApplicationContext()).RetriveLanguage().equals("EN")) { txtTitle.setText(R.string.games_en_5); } qusImgSound.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { PlaySound(); } }); actionEvent(); } private void actionEvent() { a = getRandomNumber(modelFamilies); if (new SharedPrefDatabase(getApplicationContext()).RetriveLanguage().equals("BN")) { txtQuestion.setText(R.string.games_fix_bn); } else if (new SharedPrefDatabase(getApplicationContext()).RetriveLanguage().equals("EN")) { txtQuestion.setText(R.string.games_fix_en); } PlaySound(); int imgResource = getResources().getIdentifier(modelFamilies.get(a).image, "drawable", getPackageName()); imgGameRoateimg.setImageResource(imgResource); imgGameRoateimg.setRotation(135); imgRotateLeft.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { imgGameRoateimg.setRotation(imgGameRoateimg.getRotation() + 45); } }); imgRotateRight.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { imgGameRoateimg.setRotation(imgGameRoateimg.getRotation() - 45); } }); imgRotateOk.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (imgGameRoateimg.getRotation() == 0 || (imgGameRoateimg.getRotation() % 360) == 0) { playRightAnswerSound(); } else { playWrongAnswerSound(); } } }); } public void playRightAnswerSound() { if (new SharedPrefDatabase(getApplicationContext()).RetriveLanguage().equals("BN")) { actionEventSound(getApplicationContext(), "right_ans_bn.mp3"); showDialogSuccess(getApplicationContext(), getResources().getString(R.string.ans_comments_bn),getResources().getString(R.string.ans_right_bn)); } else if (new SharedPrefDatabase(getApplicationContext()).RetriveLanguage().equals("EN")) { actionEventSound(getApplicationContext(), "right_ans_en.mp3"); showDialogSuccess(getApplicationContext(), getResources().getString(R.string.ans_comments_en),getResources().getString(R.string.ans_right_en)); } } public void playWrongAnswerSound() { if (new SharedPrefDatabase(getApplicationContext()).RetriveLanguage().equals("BN")) { actionEventSound(getApplicationContext(), "wrong_ans_bn.mp3"); showDialogFail(getApplicationContext(), getResources().getString(R.string.ans_comments_bn),getResources().getString(R.string.ans_wrong_bn)); } else if (new SharedPrefDatabase(getApplicationContext()).RetriveLanguage().equals("EN")) { actionEventSound(getApplicationContext(), "wrong_ans_en.mp3"); showDialogFail(getApplicationContext(), getResources().getString(R.string.ans_comments_en),getResources().getString(R.string.ans_wrong_en)); } } public void PlaySound() { MediaPlayer mediaPlayer = new MediaPlayer(); try { AssetFileDescriptor descriptor = getAssets().openFd("a_who_is_en_2.mpeg"); if (new SharedPrefDatabase(getApplicationContext()).RetriveLanguage().equals("BN")) { descriptor = getAssets().openFd("a_fix_bn.mpeg"); } else if (new SharedPrefDatabase(getApplicationContext()).RetriveLanguage().equals("EN")) { descriptor = getAssets().openFd("a_fix_en.mpeg"); } mediaPlayer.setDataSource(descriptor.getFileDescriptor(), descriptor.getStartOffset(), descriptor.getLength()); descriptor.close(); mediaPlayer.prepare(); mediaPlayer.start(); } catch (IOException e) { e.printStackTrace(); } mediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() { @Override public void onCompletion(MediaPlayer mp) { mp.stop(); mp.release(); } }); } private void actionEventSound(Context context, final String Sound_s ) { MediaPlayer mediaPlayer = new MediaPlayer(); try { AssetFileDescriptor descriptor = context.getAssets().openFd(Sound_s); mediaPlayer.setDataSource(descriptor.getFileDescriptor(), descriptor.getStartOffset(), descriptor.getLength()); descriptor.close(); mediaPlayer.prepare(); mediaPlayer.start(); } catch (IOException e) { e.printStackTrace(); } mediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() { @Override public void onCompletion(MediaPlayer mp) { mp.stop(); mp.release(); } }); } public void showDialogSuccess(final Context context, final String title, String message) { new AlertDialog.Builder(new ContextThemeWrapper(this, R.style.Theme_AppCompat)) .setTitle(title) .setMessage(message) .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { a++; COUNTER++; aCounter.add(a); if (COUNTER >= modelFamilies.size()) { COUNTER = 0; dialog.dismiss(); if (new SharedPrefDatabase(getApplicationContext()).RetriveLanguage().equals("BN")) { showDialogComplete(context, title, getResources().getString(R.string.game_complete_bn)); } else if (new SharedPrefDatabase(getApplicationContext()).RetriveLanguage().equals("EN")) { showDialogComplete(context, title, getResources().getString(R.string.game_complete_en)); } } else { dialog.dismiss(); actionEvent(); } } }) .setIcon(android.R.drawable.btn_star_big_on) .show(); } public void showDialogFail(Context context, String title, String message) { new AlertDialog.Builder(new ContextThemeWrapper(this, R.style.Theme_AppCompat)) .setTitle(title) .setMessage(message) .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }) .setIcon(android.R.drawable.ic_notification_clear_all) .show(); } public void showDialogComplete(Context context, String title, String message) { new AlertDialog.Builder(new ContextThemeWrapper(this, R.style.Theme_AppCompat)) .setTitle(title) .setMessage(message) .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); finish(); } }) .setIcon(android.R.drawable.star_on) .show(); } public int getRandomNumber(ArrayList<ModelFamily> list) { double randomDouble = Math.random(); randomDouble = randomDouble * list.size(); int randomInt = (int) randomDouble; /*if (aCounter.contains(randomInt)) { getRandomNumber(list); } else { return randomInt; }*/ return randomInt; } }
[ "adilhossain227@gmail.com" ]
adilhossain227@gmail.com
27e3f9a7c78d57e2f4cefe74e1891c0afec192f9
51b639450db30cafc699c02068b3054ac67863ad
/src/wirtualny_swiat/organizmy/KontenerOrganizmow.java
f0886b43cb693c32a6e27715af1f0e09f76c9771
[]
no_license
OskarKow/JavaProjectVirtualWorld
24375259fb1bd2f4516345b1eec38edd5e8a2a46
df7bf8e30899f20b1f5e5227725de51727adb722
refs/heads/master
2021-01-20T02:25:59.261453
2017-04-25T21:15:01
2017-04-25T21:15:01
89,407,041
0
0
null
null
null
null
UTF-8
Java
false
false
2,388
java
package wirtualny_swiat.organizmy; import java.io.Serializable; public class KontenerOrganizmow { private int iloscOrganizmow; private Organizm[] organizmy; public KontenerOrganizmow() { iloscOrganizmow = 0; organizmy = null; } public int getIloscOrganizmow() { return iloscOrganizmow; } public Organizm getOrganizm(int index) { return organizmy[index]; } //zwraca true gdy A jest wiekszy lub rowny B, false w przeciwnym wypadku private boolean porownajOrganizmy(Organizm organizmA, Organizm organizmB) { if (organizmA.getInicjatywa() > organizmB.getInicjatywa()) return true; if (organizmA.getInicjatywa() < organizmB.getInicjatywa()) return false; if (organizmA.getInicjatywa() == organizmB.getInicjatywa()) { if (organizmA.getWiek() >= organizmB.getWiek()) return true; if (organizmA.getWiek() < organizmB.getWiek()) return false; } return true; } private void posortujOrganizmy() { Organizm tmp = null; for (int i = 0; i < iloscOrganizmow - 1; i++) { for (int j = 0; j < iloscOrganizmow - 1; j++) { if (!porownajOrganizmy(organizmy[j], organizmy[j + 1])) { tmp = organizmy[j + 1]; organizmy[j + 1] = organizmy[j]; organizmy[j] = tmp; } } } } public void dodajOrganizm(Organizm nowy) { iloscOrganizmow++; Organizm[] nowa = new Organizm[iloscOrganizmow]; for (int i = 0; i < iloscOrganizmow - 1; i++) { nowa[i] = organizmy[i]; } nowa[iloscOrganizmow - 1] = nowy; this.organizmy = nowa; posortujOrganizmy(); } public void usunOrganizm(Organizm doUsuniecia) { if (iloscOrganizmow > 0) { iloscOrganizmow--; Organizm[] nowa = new Organizm[iloscOrganizmow]; int iloscPrzepisanych = 0; for (int i = 0; i < iloscOrganizmow + 1; i++) { if (organizmy[i] != doUsuniecia) { nowa[iloscPrzepisanych] = organizmy[i]; iloscPrzepisanych++; } } this.organizmy = nowa; posortujOrganizmy(); } } public void wyczysc() { iloscOrganizmow = 0; organizmy = null; } public boolean czyZawiera(Organizm szukany) { for (int i = 0; i < iloscOrganizmow; i++) { if (organizmy[i].equals(szukany)) return true; } return false; } public String toString() { String wynik; wynik = "" + iloscOrganizmow + "\r\n"; for (int i = 0; i < iloscOrganizmow; i++) { wynik += organizmy[i].toString(); } return wynik; } }
[ "oskar.kow123@gmail.com" ]
oskar.kow123@gmail.com
11bdf527e29898a026ee2665c2f14cf361311a03
1098359647d5d1a7427cc0d9f89cf340cc2b0541
/kalturaScheduler/src/main/java/com/kaltura/client/types/KalturaAssetParams.java
8a532f74fb365338d96a561e1e035edc7bf355d4
[]
no_license
edcgamer/KalturaScheduler2.0
e799b107ec79755bca28f67b8692b44a40188810
15dec08a4c4b0ac640d8cfc29ae93d7f39a4c700
refs/heads/master
2021-01-01T18:23:25.938375
2014-10-01T17:07:53
2014-10-01T17:07:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,664
java
// =================================================================================================== // _ __ _ _ // | |/ /__ _| | |_ _ _ _ _ __ _ // | ' </ _` | | _| || | '_/ _` | // |_|\_\__,_|_|\__|\_,_|_| \__,_| // // This file is part of the Kaltura Collaborative Media Suite which allows users // to do with audio, video, and animation what Wiki platfroms allow them to do with // text. // // Copyright (C) 2006-2011 Kaltura Inc. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as // published by the Free Software Foundation, either version 3 of the // License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. // // @ignore // =================================================================================================== package com.kaltura.client.types; import org.w3c.dom.Element; import com.kaltura.client.KalturaParams; import com.kaltura.client.KalturaApiException; import com.kaltura.client.KalturaObjectBase; import com.kaltura.client.enums.KalturaNullableBoolean; import com.kaltura.client.enums.KalturaMediaParserType; import java.util.ArrayList; import com.kaltura.client.utils.ParseUtils; import org.w3c.dom.Node; import org.w3c.dom.NodeList; /** * This class was generated using generate.php * against an XML schema provided by Kaltura. * @date Tue, 20 Aug 13 03:11:34 -0400 * * MANUAL CHANGES TO THIS CLASS WILL BE OVERWRITTEN. */ public class KalturaAssetParams extends KalturaObjectBase { /** The id of the Flavor Params */ public int id = Integer.MIN_VALUE; public int partnerId = Integer.MIN_VALUE; /** The name of the Flavor Params */ public String name; /** System name of the Flavor Params */ public String systemName; /** The description of the Flavor Params */ public String description; /** Creation date as Unix timestamp (In seconds) */ public int createdAt = Integer.MIN_VALUE; /** True if those Flavor Params are part of system defaults */ public KalturaNullableBoolean isSystemDefault; /** The Flavor Params tags are used to identify the flavor for different usage (e.g. web, hd, mobile) */ public String tags; /** Array of partner permisison names that required for using this asset params */ public ArrayList<KalturaString> requiredPermissions; /** Id of remote storage profile that used to get the source, zero indicates Kaltura data center */ public int sourceRemoteStorageProfileId = Integer.MIN_VALUE; /** Comma seperated ids of remote storage profiles that the flavor distributed to, the distribution done by the conversion engine */ public int remoteStorageProfileIds = Integer.MIN_VALUE; /** Media parser type to be used for post-conversion validation */ public KalturaMediaParserType mediaParserType; /** Comma seperated ids of source flavor params this flavor is created from */ public String sourceAssetParamsIds; public KalturaAssetParams() { } public KalturaAssetParams(Element node) throws KalturaApiException { NodeList childNodes = node.getChildNodes(); for (int i = 0; i < childNodes.getLength(); i++) { Node aNode = childNodes.item(i); String nodeName = aNode.getNodeName(); String txt = aNode.getTextContent(); if (nodeName.equals("id")) { this.id = ParseUtils.parseInt(txt); continue; } else if (nodeName.equals("partnerId")) { this.partnerId = ParseUtils.parseInt(txt); continue; } else if (nodeName.equals("name")) { this.name = ParseUtils.parseString(txt); continue; } else if (nodeName.equals("systemName")) { this.systemName = ParseUtils.parseString(txt); continue; } else if (nodeName.equals("description")) { this.description = ParseUtils.parseString(txt); continue; } else if (nodeName.equals("createdAt")) { this.createdAt = ParseUtils.parseInt(txt); continue; } else if (nodeName.equals("isSystemDefault")) { this.isSystemDefault = KalturaNullableBoolean.get(ParseUtils.parseInt(txt)); continue; } else if (nodeName.equals("tags")) { this.tags = ParseUtils.parseString(txt); continue; } else if (nodeName.equals("requiredPermissions")) { this.requiredPermissions = ParseUtils.parseArray(KalturaString.class, aNode); continue; } else if (nodeName.equals("sourceRemoteStorageProfileId")) { this.sourceRemoteStorageProfileId = ParseUtils.parseInt(txt); continue; } else if (nodeName.equals("remoteStorageProfileIds")) { this.remoteStorageProfileIds = ParseUtils.parseInt(txt); continue; } else if (nodeName.equals("mediaParserType")) { this.mediaParserType = KalturaMediaParserType.get(ParseUtils.parseString(txt)); continue; } else if (nodeName.equals("sourceAssetParamsIds")) { this.sourceAssetParamsIds = ParseUtils.parseString(txt); continue; } } } public KalturaParams toParams() { KalturaParams kparams = super.toParams(); kparams.add("objectType", "KalturaAssetParams"); kparams.add("name", this.name); kparams.add("systemName", this.systemName); kparams.add("description", this.description); kparams.add("tags", this.tags); kparams.add("requiredPermissions", this.requiredPermissions); kparams.add("sourceRemoteStorageProfileId", this.sourceRemoteStorageProfileId); kparams.add("remoteStorageProfileIds", this.remoteStorageProfileIds); kparams.add("mediaParserType", this.mediaParserType); kparams.add("sourceAssetParamsIds", this.sourceAssetParamsIds); return kparams; } }
[ "edcgamer@hotmail.com" ]
edcgamer@hotmail.com
72844202ee613f5853d6df2e0be9f6551d732a7f
f7b5da99ed62313d307aae946bad385bc1d4a91a
/shared/assertions/src/main/java/org/nzbhydra/historystats/stats/CountPerDayOfWeekAssert.java
3ba205ff9ffe5a14d13ebfca3251fa1ee11a103a
[ "Apache-2.0" ]
permissive
theotherp/nzbhydra2
bbe5cd99b05abf1517aeccb72f1e2c17c1bb9ce5
a7492195c640dfcef5e60a3eb279ac82fd6552e3
refs/heads/master
2023-09-02T13:39:36.497946
2023-07-22T12:17:40
2023-07-22T12:17:40
103,616,209
1,161
105
NOASSERTION
2023-08-04T09:31:48
2017-09-15T05:08:08
JavaScript
UTF-8
Java
false
false
1,443
java
package org.nzbhydra.historystats.stats; /** * {@link CountPerDayOfWeek} specific assertions - Generated by CustomAssertionGenerator. * <p> * Although this class is not final to allow Soft assertions proxy, if you wish to extend it, * extend {@link AbstractCountPerDayOfWeekAssert} instead. */ @jakarta.annotation.Generated(value = "assertj-assertions-generator") public class CountPerDayOfWeekAssert extends AbstractCountPerDayOfWeekAssert<CountPerDayOfWeekAssert, CountPerDayOfWeek> { /** * Creates a new <code>{@link CountPerDayOfWeekAssert}</code> to make assertions on actual CountPerDayOfWeek. * * @param actual the CountPerDayOfWeek we want to make assertions on. */ public CountPerDayOfWeekAssert(CountPerDayOfWeek actual) { super(actual, CountPerDayOfWeekAssert.class); } /** * An entry point for CountPerDayOfWeekAssert to follow AssertJ standard <code>assertThat()</code> statements.<br> * With a static import, one can write directly: <code>assertThat(myCountPerDayOfWeek)</code> and get specific assertion with code completion. * * @param actual the CountPerDayOfWeek we want to make assertions on. * @return a new <code>{@link CountPerDayOfWeekAssert}</code> */ @org.assertj.core.util.CheckReturnValue public static CountPerDayOfWeekAssert assertThat(CountPerDayOfWeek actual) { return new CountPerDayOfWeekAssert(actual); } }
[ "noreply@github.com" ]
noreply@github.com
ba33401297f6d4432116a3f29696b415e28b11d6
c856c1773b8b4f7abc8088e6400b76558ed11e71
/(27)RemoveElement.java
00600e9f813c550e36fc54a4cb107725046690a1
[]
no_license
atulbansal4444/leetCode_allSolutions
8ce3635976ffa1630c0c9bf64b77037823951dfc
197245cc2d4030dc7ca5ffb1f6a162a61eb4776e
refs/heads/master
2020-09-13T11:40:07.511208
2019-12-13T13:07:48
2019-12-13T13:07:48
222,765,247
1
1
null
null
null
null
UTF-8
Java
false
false
298
java
//27. Remove Element class Solution { public int removeElement(int[] nums, int val) { int j=0; for(int i=0;i<nums.length;i++) { if(nums[i]!=val) { nums[j++]=nums[i]; } } return j; } }
[ "noreply@github.com" ]
noreply@github.com
c8be3079e80a9cfe197fbe808160128c96d3b1ad
c49051ecc8b4e399be02ad5e9f0896e29c459c87
/src/main/java/mvc/ContactView.java
251fd3c35b704768636eba9a2a833c8b9cce3ad8
[]
no_license
Galec0l1/GangFourPatterns
72fd04f582b94da9c8ff95c6bb3931d397a3cb22
4a26e034a34396d62ceae0b0c0901cfcaebbf8ba
refs/heads/master
2021-05-14T23:11:48.328385
2017-04-18T07:58:16
2017-04-18T07:58:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
164
java
package mvc; public interface ContactView{ public void refreshContactView(String firstName, String lastName, String title, String organization); }
[ "vlbo0514@WSMSA-044.netcracker.com" ]
vlbo0514@WSMSA-044.netcracker.com
fe81bd88b89f8c1cf75980fc1c4c5812fb39c4b3
4d6906551f0652e88ecaa239adc04548fd61e164
/anser-common/anser-common-resource/src/main/java/com/jimy/common/resource/config/AuthIgnoreConfig.java
ba46920fa24829f820effee1f46fe032fb8e1751
[]
no_license
552301/anser-cloud
1356970d68a88c4a890a7439eccbaa4de55e223e
c15a25867fb2f531dfa9ae49547526fab7d70d62
refs/heads/master
2022-06-28T05:17:04.034650
2020-07-06T06:41:14
2020-07-06T06:41:14
250,757,097
0
0
null
2022-06-21T03:05:11
2020-03-28T09:32:30
Java
UTF-8
Java
false
false
2,723
java
package com.jimy.common.resource.config; import cn.hutool.core.util.ReUtil; import com.jimy.common.resource.annotation.AuthIgnore; import lombok.Getter; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Configurable; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.core.annotation.AnnotationUtils; import org.springframework.web.context.WebApplicationContext; import org.springframework.web.method.HandlerMethod; import org.springframework.web.servlet.mvc.method.RequestMappingInfo; import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.regex.Pattern; /** * @Description //TODO $忽略认证URL配置 * @Date 2019/7/24 19:26 * @Author czx **/ @Slf4j @Configurable @ConfigurationProperties(prefix = "security.oauth2.client") public class AuthIgnoreConfig implements InitializingBean { @Autowired private WebApplicationContext applicationContext; private static final Pattern PATTERN = Pattern.compile("\\{(.*?)\\}"); private static final String ASTERISK = "*"; @Getter @Setter private List<String> ignoreUrls = new ArrayList<>(); @Override public void afterPropertiesSet(){ log.info("===============AuthIgnoreConfig=============="); RequestMappingHandlerMapping mapping = applicationContext.getBean(RequestMappingHandlerMapping.class); Map<RequestMappingInfo, HandlerMethod> map = mapping.getHandlerMethods(); map.keySet().forEach(mappingInfo -> { HandlerMethod handlerMethod = map.get(mappingInfo); AuthIgnore method = AnnotationUtils.findAnnotation(handlerMethod.getMethod(), AuthIgnore.class); Optional.ofNullable(method) .ifPresent(authIgnore -> mappingInfo .getPatternsCondition() .getPatterns() .forEach(url -> ignoreUrls.add(ReUtil.replaceAll(url, PATTERN, ASTERISK)))); AuthIgnore controller = AnnotationUtils.findAnnotation(handlerMethod.getBeanType(), AuthIgnore.class); Optional.ofNullable(controller) .ifPresent(authIgnore -> mappingInfo .getPatternsCondition() .getPatterns() .forEach(url -> ignoreUrls.add(ReUtil.replaceAll(url, PATTERN, ASTERISK)))); }); } }
[ "545631327@qq.com" ]
545631327@qq.com
753a8099795e776727a1e86712a41a43931257a0
dd6abe461743e1d054e6187ef924cd607f6d50e2
/src/com/mu/bookstore/book/domian/Book.java
bc69ebdc4a00ff05889e6192806592e7f917a94c
[]
no_license
kangbinlin/MyBookStore
8b18fda53441aff1c533353884d59c7ecc37217d
c56e345422226d5fa96ead48ecf1ee91f8579997
refs/heads/master
2023-04-03T04:07:42.242499
2021-04-11T05:08:03
2021-04-11T05:08:03
356,771,726
0
0
null
null
null
null
UTF-8
Java
false
false
1,589
java
package com.mu.bookstore.book.domian; import com.mu.bookstore.category.domian.Category; public class Book { private String bid; private String bname; private double price; private String author; private String image; private String cid; private Category category; public Book() { super(); } public Book(String bid, String bname, double price, String author, String image, String cid, Category category) { super(); this.bid = bid; this.bname = bname; this.price = price; this.author = author; this.image = image; this.cid = cid; this.category = category; } @Override public String toString() { return "Book [bid=" + bid + ", bname=" + bname + ", price=" + price + ", author=" + author + ", image=" + image + ", cid=" + cid + ", category=" + category + "]"; } public String getBid() { return bid; } public void setBid(String bid) { this.bid = bid; } public String getBname() { return bname; } public void setBname(String bname) { this.bname = bname; } public double getPrice() { return price; } public void setPrice(double price) { this.price = price; } public String getAuthor() { return author; } public void setAuthor(String author) { this.author = author; } public String getImage() { return image; } public void setImage(String image) { this.image = image; } public String getCid() { return cid; } public void setCid(String cid) { this.cid = cid; } public Category getCategory() { return category; } public void setCategory(Category category) { this.category = category; } }
[ "kbl130991@hotmail.com" ]
kbl130991@hotmail.com
ca1176b1c666a91a6fd30800dec32d954f6c3693
a59d024d9635c3a4a04409cb2fa7eb764bc6198b
/epl-builder/src/main/java/com/deepnighttwo/eplbuilder/common/JoinPart.java
57cbf93c199dc31b36001f2d84e05c11356c45f0
[]
no_license
deepnighttwo/epl-builder
5cfcf3c520892d6e27d7875c99dbdde9eb3678ed
0ca5228f7679e6795bc18bb8a5320cb1cf02b163
refs/heads/master
2021-01-15T13:11:09.905717
2015-02-13T07:35:56
2015-02-13T07:35:56
28,588,099
0
1
null
null
null
null
UTF-8
Java
false
false
317
java
package com.deepnighttwo.eplbuilder.common; import com.deepnighttwo.eplbuilder.context.Context; /** * User: mzang * Date: 2014-12-30 * Time: 15:53 */ public class JoinPart implements Part { private String join; @Override public String getPartString(Context context) { return join; } }
[ "mzang@ctrip.com" ]
mzang@ctrip.com
f1ddbbf74920cb41b6f5df257275b6d6e75c519b
7a9e5a6056f6ca11d5483404669e810bb0abd503
/src/message_related/SeeMessagePresenter.java
265a542cdac9752da8eb423bab13ec43fd56b483
[]
no_license
yunling-zhang/Eventful
4b35d5578e266f4efda1c7ee1f25fe6b194a22e0
6e763dc7afab3fb747660c93118c8d5819314057
refs/heads/main
2023-03-15T13:03:59.311207
2020-12-22T15:33:16
2020-12-22T15:33:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,932
java
package message_related; public class SeeMessagePresenter extends MessagePresenter { /** * Prints out options of different lists of messages to check. */ public void printSeeMessage() { System.out.println("\n" + "What would you check:\n" + "1. general inbox\n" + "2. unread messages\n" + "3. archived messages\n" + "4. sent messages\n" + "Option:"); } /** * Prints out options under a chosen message. */ public void printMessageOption() { System.out.println("" + "1. Mark as unread\n" + "2. Archive\n" + "3. Delete\n" + "4. Reply to messages"); } /** * Prints out when a message is successfully marked as unread. */ public void printMarked() { System.out.println("\nMessage Marked."); } /** * Prints out when a message is successfully archived. */ public void printArchived() { System.out.println("\nMessage Archived."); } /** * Prints out to confirm if the chosen message is to be removed from the current box. */ public void printConfirmRemove() { System.out.println("\n" + "This message will be removed from this box\n" + "1. Confirm\n" + "2. Decline"); } /** * Prints out to confirm if the chosen message is to be deleted from all inboxes. */ public void printConfirmDelete() { System.out.println("\n" + "This message will be deleted from all inboxes\n" + "1. Confirm\n" + "2. Decline"); } /** * Prints out when a message is successfully removed or deleted */ public void printMessageDeleted() { System.out.println("\nMessage successfully deleted."); } }
[ "wendyyy.zhang@mail.utoronto.ca" ]
wendyyy.zhang@mail.utoronto.ca
1c2e61a057e417ebbfe15f47ac9d8acffc7c2870
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Chart/22/org/jfree/chart/plot/XYPlot_setRangeAxis_1087.java
9c14f6cadd7ae35c3180c0687cf4c887321de5ff
[]
no_license
hvdthong/NetML
dca6cf4d34c5799b400d718e0a6cd2e0b167297d
9bb103da21327912e5a29cbf9be9ff4d058731a5
refs/heads/master
2021-06-30T15:03:52.618255
2020-10-07T01:58:48
2020-10-07T01:58:48
150,383,588
1
1
null
2018-09-26T07:08:45
2018-09-26T07:08:44
null
UTF-8
Java
false
false
5,553
java
org jfree chart plot gener plot data form pair plot data link dataset xydataset code plot xyplot code make link item render xyitemrender draw point plot render chart type produc link org jfree chart chart factori chartfactori method creat pre configur chart plot xyplot plot axi plot valueaxisplot set rang axi request send link plot chang event plotchangeev regist listen param index axi index param axi axi code code permit param notifi notifi listen rang axi getrangeaxi set rang axi setrangeaxi index axi valueaxi axi notifi axi valueaxi exist rang axi getrangeaxi index exist exist remov chang listen removechangelisten axi axi set plot setplot rang ax rangeax set index axi axi axi configur axi add chang listen addchangelisten notifi notifi listen notifylisten plot chang event plotchangeev
[ "hvdthong@gmail.com" ]
hvdthong@gmail.com
f400f6c84a9d9014aa923c52bfc7d6bc2170c50c
b518781441547657aba4a601b735e8e0b4e26cff
/src/utils/Match.java
13143453ea69d5ed024376cb9d1699b4ec255a14
[]
no_license
ollien1/comparative-genomics
e3ab7240f4078591e990f904a65b968578b988de
9c532400d41f15dd26c270ef7576a25c155d4f78
refs/heads/master
2021-01-23T11:34:29.523820
2017-09-06T17:02:10
2017-09-06T17:02:10
102,630,360
0
0
null
null
null
null
UTF-8
Java
false
false
1,411
java
package utils; public class Match { private String queryId; private String subjectId; private double sequenceIdentity; private int alignmentLength; private int queryStart; private int queryEnd; private int subjectStart; private int subjectEnd; private double eValue; private String bitScore; public Match(String[] blastLine) { queryId = blastLine[0]; subjectId = blastLine[1]; sequenceIdentity = Double.parseDouble(blastLine[2]); alignmentLength = Integer.parseInt(blastLine[3]); queryStart = Integer.parseInt(blastLine[6]); queryEnd = Integer.parseInt(blastLine[7]); subjectStart = Integer.parseInt(blastLine[8]); subjectEnd = Integer.parseInt(blastLine[9]); eValue = Double.parseDouble(blastLine[10]); bitScore = blastLine[11]; } public String getQueryId() { return queryId; } public String getSubjectId() { return subjectId; } public double getSequenceIdentity() { return sequenceIdentity; } public int getLength() { return alignmentLength; } public int getQueryStart() { return queryStart; } public int getQueryEnd() { return queryEnd; } public int getSubjectStart() { return subjectStart; } public int getSubjectEnd() { return subjectEnd; } public double getEValue() { return eValue; } public String getBitScore() { return bitScore; } }
[ "Ollie@Ollie-PC" ]
Ollie@Ollie-PC
de63d3676c822261adeddfb07121135582dd59b9
71ef4477c680e841666f3a20529e40c19bb899db
/App1.13.5/app/src/androidTest/java/com/blikoon/app1135/ExampleInstrumentedTest.java
0b4dfc519918523c04b358aadc09f875e4d8e090
[]
no_license
blikoon/Ubufundi
a18b1e5a5e0b206e9f65a1fe722c252d67d4d15c
761054c7747a56a7cbf97493a624e19b83899a7e
refs/heads/master
2021-08-08T20:11:34.185932
2017-11-11T03:50:39
2017-11-11T03:50:39
83,015,263
16
15
null
null
null
null
UTF-8
Java
false
false
742
java
package com.blikoon.app1135; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumentation test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.blikoon.app1135", appContext.getPackageName()); } }
[ "wayadn88@gmail.com" ]
wayadn88@gmail.com
b914a2ce57908938c7e8a6375700894f5f4010d5
a2dd5b84130fb693a447dcd8fe59df55f6f53326
/datax/core/src/main/java/com/alibaba/datax/core/job/JobControllerPanel.java
27741911e5ef26db46229d2be62c2eae08cd7895
[]
no_license
fucora/SPeed
60093e9aeed88845b200ce59ecfd881c61551ad8
fe8a18149c13d083082826d88b543add88af204a
refs/heads/master
2022-12-26T20:46:25.721089
2020-09-16T09:44:02
2020-09-16T09:44:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
376
java
package com.alibaba.datax.core.job; import com.alibaba.datax.core.statistics.communication.LocalJobCommunicationManager; import com.alibaba.datax.dataxservice.face.domain.enums.State; public class JobControllerPanel { public static void killJob(long jobId) { LocalJobCommunicationManager.getInstance().getJobCommunication(jobId).setState(State.KILLING); } }
[ "c0yuhang@gmail.com" ]
c0yuhang@gmail.com
9292970d857628b49ccdfb656af22894afc0d194
9773b54c88c7f6b2981bae84c3fc33bd1339a49b
/media/src/main/java/io/wcm/handler/media/format/impl/MediaFormatVisitor.java
014af5407efa0bbece9155fc6549c5a852489e11
[ "Apache-2.0" ]
permissive
danielamaul/wcm-io-handler
be9e3e370fd561eb794f14ed6570d405a408ea55
c6210b0209991d659797e8f0c5d411e6a27f9482
refs/heads/master
2022-12-11T07:50:47.571980
2020-08-26T14:46:33
2020-08-26T14:46:33
295,938,466
0
0
Apache-2.0
2020-09-16T06:04:24
2020-09-16T06:04:24
null
UTF-8
Java
false
false
1,172
java
/* * #%L * wcm.io * %% * Copyright (C) 2014 wcm.io * %% * 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. * #L% */ package io.wcm.handler.media.format.impl; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import io.wcm.handler.media.format.MediaFormat; /** * Interface for iterating over all valid media formats. * @param <T> Return type */ public interface MediaFormatVisitor<T> { /** * Visit media format * @param mediaFormat Media format * @return Return value - if not null the visit process is finished and the return value returned */ @Nullable T visit(@NotNull MediaFormat mediaFormat); }
[ "sseifert@pro-vision.de" ]
sseifert@pro-vision.de
8204ec3e098a5422a31cfb876b8b23f9e651bbc6
cbe425a938e5bbe10216d06e39af96bb02ebfd80
/Assignment 2/SortArray.java
50e2bc51169cbd5c648fc7812d39467acc3657df
[]
no_license
KingShark1/java-assignments
e01edc9d8dc70e27cd1496b7e761f19ec3bafa76
2300546b2e3023d22a81547fcd4f4b85250613c7
refs/heads/master
2023-01-23T18:02:20.873707
2020-11-26T08:48:13
2020-11-26T08:48:13
313,887,695
0
0
null
2020-11-18T09:42:23
2020-11-18T09:42:22
null
UTF-8
Java
false
false
1,002
java
import java.util.Scanner; import java.util.Array; public class SortArray { public static void main(String args[]) { int a[] = {13, 16, 19, 20, 25, 1}; System.out.print("Array before sorting is: "); for(int i = 0; i < 6; i++) System.out.print( "\n" + a[i]); System.out.print("\nArray after sorting is: "); for(int j = 0; j < 6; j++){ int b = a[j]; for(int k = j; k < 6;k++){ if(a[k] < b){ a[j] = a[k]; a[k] = b; } } } for(int i = 0; i < 6; i++) System.out.print( "\n" + a[i]); String s[] = {"Zimbabwe", "South-Africa", "India", "America", "Yugpslavia"}; System.out.print("\nArray before sorting is: "); for(int i = 0; i < 5; i++) System.out.print( "\n" + s[i]); System.out.print("\nArray after sorting is: "); for(int j = 0; j < 5; j++){ int b = a[j]; for(int k = j + 1; k < 5;k++){ if( s[j].compareTo(s.[k] > 0) ){ String temp = s[j]; s[j] = s[k]; s[k] = temp; } } } for(int i = 0; i < 5; i++) System.out.print( "\n" + s[i]); } }
[ "adarsh.hodadakatti@gmail.com" ]
adarsh.hodadakatti@gmail.com
11cac2ae0adf7b2772983829e60d5f61a7c9a036
6df2a2c887d3fb4deff5a68222d4f4db687b53de
/src/main/java/pl/sda/twitter/servlets/LoginServlet.java
0e6dc1fee6557b44599e2407497cea7efea4912b
[]
no_license
jscott2006/sda-twitter
e1b6381c28194569bbeea6e940528ac962883f6d
54223c936d245012d2614faa8a86fd8a45e10773
refs/heads/master
2022-06-22T10:15:02.425010
2019-09-08T13:59:56
2019-09-08T13:59:56
208,407,199
0
0
null
2022-06-21T01:51:58
2019-09-14T07:47:58
Java
UTF-8
Java
false
false
1,468
java
package pl.sda.twitter.servlets; import pl.sda.twitter.model.TbUser; import pl.sda.twitter.model.TbUser; import pl.sda.twitter.services.UserService; import pl.sda.twitter.services.UserServiceImpl; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import java.io.IOException; import static java.nio.charset.StandardCharsets.UTF_8; @WebServlet(name = "LoginServlet", urlPatterns = {"/login"}) public class LoginServlet extends HttpServlet { private UserService userService; @Override public void init() { userService = new UserServiceImpl(); } @Override public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException { String userName = request.getParameter("userName"); String password = request.getParameter("password"); HttpSession session = request.getSession(); TbUser tbUser = userService.getUserByUserName(userName); if (tbUser == null || !tbUser.getPassword().equals(password)) { response.setCharacterEncoding(UTF_8.toString()); response.sendRedirect("sign-in.jsp"); } else { session.setAttribute("user", tbUser); response.setCharacterEncoding(UTF_8.toString()); response.sendRedirect("index.jsp"); } } }
[ "lukasz.res@gmail.com" ]
lukasz.res@gmail.com
9c73433ffad61e622c60b289acb7eefd5dcfc5fc
5cc149194727afa76b0081fe2339268fd8e21c56
/uneeds/src/main/java/com/movie/service/TimetableServiceImpl.java
c6a6cb3c232d66b5f59f3ad4fce61435c6cb179b
[]
no_license
monsoonp/uneeds
416691c4a668d70967e57901959957419bf4b23a
ace0b6ec6d2d43c83ce9e1ca2887ef136423b945
refs/heads/master
2022-12-27T12:33:53.566083
2019-07-19T12:23:08
2019-07-19T12:23:08
140,778,858
0
1
null
2022-12-16T11:52:13
2018-07-13T00:54:41
CSS
UTF-8
Java
false
false
1,013
java
package com.movie.service; import javax.inject.Inject; import org.springframework.stereotype.Service; import com.movie.domain.TimetableVO; import com.movie.persistence.TimetableDAO; @Service public class TimetableServiceImpl implements TimetableService{ @Inject private TimetableDAO dao; @Override public void insert_timetable(TimetableVO ttvo) throws Exception { dao.insertTimetable(ttvo); } @Override public void delete_timetable(TimetableVO ttvo) throws Exception { dao.deleteTimetable(ttvo); } @Override public int count_rtimecd(TimetableVO ttvo) throws Exception { return dao.countrtime(ttvo); } @Override public int theatercd_count(TimetableVO ttvo) throws Exception { return dao.theatercd_count(ttvo); } @Override public int tnumcd_count(TimetableVO ttvo) throws Exception { return dao.tnumcd_count(ttvo); } @Override public int allcd_count(TimetableVO ttvo) throws Exception { return dao.allcd_count(ttvo); } }
[ "USER@USER-PC" ]
USER@USER-PC
7e8d30e4ce9193aab80425ce95e50fdf8baacad6
25baed098f88fc0fa22d051ccc8027aa1834a52b
/src/main/java/com/ljh/controller/base/ViewMrmsFee1Controller.java
8b57fd7e5f1d52d1cb2af9a76276df77f224b52a
[]
no_license
woai555/ljh
a5015444082f2f39d58fb3e38260a6d61a89af9f
17cf8f4415c9ae7d9fedae46cd9e9d0d3ce536f9
refs/heads/master
2022-07-11T06:52:07.620091
2022-01-05T06:51:27
2022-01-05T06:51:27
132,585,637
0
0
null
2022-06-17T03:29:19
2018-05-08T09:25:32
Java
UTF-8
Java
false
false
319
java
package com.ljh.controller.base; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.stereotype.Controller; /** * <p> * 前端控制器 * </p> * * @author ljh * @since 2020-10-26 */ @Controller @RequestMapping("/viewMrmsFee1") public class ViewMrmsFee1Controller { }
[ "37681193+woai555@users.noreply.github.com" ]
37681193+woai555@users.noreply.github.com
1236f1db94808021782d0b09c99be62010654ee2
8fdf833118e376ff5ffc089cbae50053a25c136f
/src/car.java
169a564c88d95e9f237544ca0cb264b1e076bfa6
[]
no_license
MOJelil/CarRental
205d6da25bef68d3f890dcb637dbebdeeacfbaa9
51baec600ae672e21a97e667ee3bc2c385ab8588
refs/heads/master
2022-11-16T23:59:18.857944
2020-07-15T16:41:35
2020-07-15T16:41:35
279,200,962
0
0
null
null
null
null
UTF-8
Java
false
false
1,880
java
public class car extends vehicle { /** * Initialize the constructor without parameters */ public car() { Initialize("", 0, 0); } /** * Initialize the constructor with parameters */ public car(String strName) { Initialize(strName, 0, 0); } /** * Initialize the constructor with parameters */ public car(String strName, int intNumberOfWheels) { Initialize(strName, intNumberOfWheels, 0); } /** * Initialize the constructor with parameters */ public car(String strName, int intNumberOfWheels, int intNumberOfMPG) { Initialize(strName, intNumberOfWheels, intNumberOfMPG); } // Properties/variables protected static String m_strType = ""; /** * SetType */ public static void SetType(String strNewType) { if (strNewType.equalsIgnoreCase("")) { strNewType = "Regular"; } else { m_strType = strNewType; } } /** * GetType */ public String GetType() { return m_strType; } /** * How is this vehicle driven */ public void HowToDrive() { System.out.println("\t This Vehicle is driven by steering wheels"); } /** * MPG */ public void MPG() { GetNumberOfMPG(); if (GetType().equalsIgnoreCase("Regular")) { System.out.println("\t The average gas consumption for this car is 28 MPG\n"); } else { System.out.println("\t Tthe average gas consumption for this car is 32 MPG\n"); } } /** * Initialize the class properties */ public void Initialize(String strName, int intNumberOfWheels, int intNumberOfMPG) { SetName(strName); SetNoOfWheels(intNumberOfWheels); SetNumberOfMPG(intNumberOfMPG); } public void Print() { System.out.println("\t Vehicle Name :" + GetName()); System.out.println("\t Number of vehicle wheels :" + GetNoOfWheels()); System.out.println(" \t Vehicle Type :" + GetType()); HowToDrive(); MPG(); } }
[ "majelil1178@gmail.com" ]
majelil1178@gmail.com
1e5fc42f33146dce68c596b05645c41fb1c4c6f2
cd29b7711bb2f2341d0e8a2329085acc316c3cbf
/atomix/cluster/src/main/java/io/atomix/raft/RaftException.java
ed441bdcd069c7cca974b5797c67fb9c5a8439fa
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
sberdachuk-epam/zeebe
8feba4ddf0312ef11722443e419c533a8dba9309
c2a372aa16d43ff6be25f485f28853516e26459f
refs/heads/master
2023-05-16T12:16:23.254484
2021-05-10T11:33:24
2021-05-10T11:33:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,700
java
/* * Copyright 2015-present Open Networking Foundation * Copyright © 2020 camunda services GmbH (info@camunda.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.atomix.raft; /** * Base Raft protocol exception. * * <p>This is the base exception type for all Raft protocol exceptions. Protocol exceptions must be * associated with a {@link RaftError.Type} which is used for more efficient serialization. */ public abstract class RaftException extends RuntimeException { private final RaftError.Type type; protected RaftException(final RaftError.Type type, final String message, final Object... args) { super(message != null ? String.format(message, args) : null); if (type == null) { throw new NullPointerException("type cannot be null"); } this.type = type; } protected RaftException( final RaftError.Type type, final Throwable cause, final String message, final Object... args) { super(String.format(message, args), cause); if (type == null) { throw new NullPointerException("type cannot be null"); } this.type = type; } protected RaftException(final RaftError.Type type, final Throwable cause) { super(cause); if (type == null) { throw new NullPointerException("type cannot be null"); } this.type = type; } /** * Returns the exception type. * * @return The exception type. */ public RaftError.Type getType() { return type; } public static class NoLeader extends RaftException { public NoLeader(final String message, final Object... args) { super(RaftError.Type.NO_LEADER, message, args); } } public static class IllegalMemberState extends RaftException { public IllegalMemberState(final String message, final Object... args) { super(RaftError.Type.ILLEGAL_MEMBER_STATE, message, args); } } public static class ApplicationException extends RaftException { public ApplicationException(final String message, final Object... args) { super(RaftError.Type.APPLICATION_ERROR, message, args); } public ApplicationException(final Throwable cause) { super(RaftError.Type.APPLICATION_ERROR, cause); } } public abstract static class OperationFailure extends RaftException { public OperationFailure(final RaftError.Type type, final String message, final Object... args) { super(type, message, args); } } public static class CommandFailure extends OperationFailure { public CommandFailure(final String message, final Object... args) { super(RaftError.Type.COMMAND_FAILURE, message, args); } } public static class QueryFailure extends OperationFailure { public QueryFailure(final String message, final Object... args) { super(RaftError.Type.QUERY_FAILURE, message, args); } } public static class UnknownClient extends RaftException { public UnknownClient(final String message, final Object... args) { super(RaftError.Type.UNKNOWN_CLIENT, message, args); } } public static class UnknownService extends RaftException { public UnknownService(final String message, final Object... args) { super(RaftError.Type.UNKNOWN_SERVICE, message, args); } } public static class ProtocolException extends RaftException { public ProtocolException(final String message, final Object... args) { super(RaftError.Type.PROTOCOL_ERROR, message, args); } } public static class ConfigurationException extends RaftException { public ConfigurationException(final String message, final Object... args) { super(RaftError.Type.CONFIGURATION_ERROR, message, args); } public ConfigurationException( final Throwable throwable, final String message, final Object... args) { super(RaftError.Type.CONFIGURATION_ERROR, throwable, message, args); } } public static class Unavailable extends RaftException { public Unavailable(final String message, final Object... args) { super(RaftError.Type.UNAVAILABLE, message, args); } public Unavailable(final Throwable cause) { super(RaftError.Type.UNAVAILABLE, cause); } } }
[ "zelldon91@googlemail.com" ]
zelldon91@googlemail.com
9b1c34b5736e3383d7816b067ae8abecf79aba50
340d7a3b694bd4367acc70e69c7a6708fd68d0bb
/span-normalizer/span-normalizer/src/main/java/org/hypertrace/core/spannormalizer/jaeger/JaegerSpanToLogRecordsTransformer.java
75557f4c63c4a18787d66d7a2f018654d200f222
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
findingrish/hypertrace-ingester
f45825682e5e3e1f379b0211aaa2992aa8f7e752
76ecd76be3d7e672c500a931d64b672252c31d1a
refs/heads/main
2023-06-11T18:59:31.585314
2021-06-16T11:30:51
2021-06-16T11:30:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,639
java
package org.hypertrace.core.spannormalizer.jaeger; import com.google.common.annotations.VisibleForTesting; import com.google.protobuf.util.Timestamps; import io.jaegertracing.api_v2.JaegerSpanInternalModel; import io.jaegertracing.api_v2.JaegerSpanInternalModel.Span; import io.micrometer.core.instrument.Counter; import java.nio.ByteBuffer; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.stream.Collectors; import org.apache.kafka.streams.KeyValue; import org.apache.kafka.streams.kstream.Transformer; import org.apache.kafka.streams.processor.ProcessorContext; import org.hypertrace.core.datamodel.Attributes; import org.hypertrace.core.datamodel.LogEvent; import org.hypertrace.core.datamodel.LogEvents; import org.hypertrace.core.serviceframework.metrics.PlatformMetricsRegistry; import org.hypertrace.core.spannormalizer.util.AttributeValueCreator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class JaegerSpanToLogRecordsTransformer implements Transformer<byte[], PreProcessedSpan, KeyValue<String, LogEvents>> { private static final Logger LOG = LoggerFactory.getLogger(JaegerSpanToLogRecordsTransformer.class); private static final String VALID_SPAN_WITH_LOGS_RECEIVED_COUNT = "hypertrace.reported.span.with.logs.processed"; private static final ConcurrentMap<String, Counter> tenantToSpanWithLogsReceivedCount = new ConcurrentHashMap<>(); @Override public void init(ProcessorContext context) { // no-op } @Override public KeyValue<String, LogEvents> transform(byte[] key, PreProcessedSpan preProcessedSpan) { try { Span value = preProcessedSpan.getSpan(); String tenantId = preProcessedSpan.getTenantId(); if (value.getLogsCount() == 0) { return null; } tenantToSpanWithLogsReceivedCount .computeIfAbsent( tenantId, tenant -> PlatformMetricsRegistry.registerCounter( VALID_SPAN_WITH_LOGS_RECEIVED_COUNT, Map.of("tenantId", tenantId))) .increment(); return new KeyValue<>(null, buildLogEventRecords(value, tenantId)); } catch (Exception e) { LOG.error("Exception processing log records", e); return null; } } @VisibleForTesting LogEvents buildLogEventRecords(Span value, String tenantId) { ByteBuffer spanId = value.getSpanId().asReadOnlyByteBuffer(); ByteBuffer traceId = value.getTraceId().asReadOnlyByteBuffer(); return LogEvents.newBuilder() .setLogEvents( value.getLogsList().stream() .map( log -> LogEvent.newBuilder() .setTenantId(tenantId) .setSpanId(spanId) .setTraceId(traceId) .setTimestampNanos(Timestamps.toNanos(log.getTimestamp())) .setAttributes(buildAttributes(log.getFieldsList())) .build()) .collect(Collectors.toList())) .build(); } private Attributes buildAttributes(List<JaegerSpanInternalModel.KeyValue> keyValues) { return Attributes.newBuilder() .setAttributeMap( keyValues.stream() .collect( Collectors.toMap( k -> k.getKey().toLowerCase(), AttributeValueCreator::createFromJaegerKeyValue))) .build(); } @Override public void close() { // no-op } }
[ "noreply@github.com" ]
noreply@github.com
82bd8103f598f33490ad8e873056552952b16669
c6f145685b7d5de6b4d9b9460edc9e52d54b9f81
/test_cases/CWE259/CWE259_Hard_Coded_Password__basicAuthenticatorCheckCredentials/CWE259_Hard_Coded_Password__basicAuthenticatorCheckCredentials_53a.java
36aa962c52b931deadcb48c11f7cf40157c6ccbc
[]
no_license
Johndoetheone/new-test-repair
531ca91dab608abd52eb474c740c0a211ba8eb9f
7fa0e221093a60c340049e80ce008e233482269c
refs/heads/master
2022-04-26T03:44:51.807603
2020-04-25T01:10:47
2020-04-25T01:10:47
258,659,310
0
0
null
null
null
null
UTF-8
Java
false
false
4,691
java
/* * TEMPLATE GENERATED TESTCASE FILE * @description * CWE: 259 Hard Coded Password * BadSource: hardcodedPassword Set data to a hardcoded string * Flow Variant: 53 Data flow: data passed as an argument from one method through two others to a fourth; all four functions are in different classes in the same package * */ package test_cases.CWE259.CWE259_Hard_Coded_Password__basicAuthenticatorCheckCredentials; import testcasesupport.*; import java.util.Arrays; import java.util.Properties; import java.util.logging.Level; import java.io.*; import com.sun.net.httpserver.BasicAuthenticator; public class CWE259_Hard_Coded_Password__basicAuthenticatorCheckCredentials_53a extends AbstractTestCase { public void bad() throws Throwable { String data; /* FLAW: Set data to a hardcoded string */ data = "7e5tc4s3"; (new CWE259_Hard_Coded_Password__basicAuthenticatorCheckCredentials_53b()).badSink(data); } /* goodG2B() - use goodsource and badsink */ private void goodG2B() throws Throwable { String data; data = ""; /* init data */ /* FIX */ try { InputStreamReader readerInputStream = new InputStreamReader(System.in, "UTF-8"); BufferedReader readerBuffered = new BufferedReader(readerInputStream); /* POTENTIAL FLAW: Read data from the console using readLine */ data = readerBuffered.readLine(); } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error with stream reading", exceptIO); } (new CWE259_Hard_Coded_Password__basicAuthenticatorCheckCredentials_53b()).goodG2BSink(data); } /* goodChar() - uses the expected Properties file and a char[] data variable*/ private void goodChar() throws Throwable { char[] data = null; Properties properties = new Properties(); FileInputStream streamFileInput = null; try { streamFileInput = new FileInputStream("src/juliet_test/resources/config.properties"); properties.load(streamFileInput); data = properties.getProperty("password").toCharArray(); } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error with stream reading", exceptIO); } finally { /* clean up stream reading objects */ try { if (streamFileInput != null) { streamFileInput.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing FileInputStream", exceptIO); } } (new CWE259_Hard_Coded_Password__basicAuthenticatorCheckCredentials_53b()).goodCharSink(data); } /* goodExpected() - uses the expected Properties file and uses the password directly from it*/ private void goodExpected() throws Throwable { Properties properties = new Properties(); FileInputStream streamFileInput = null; try { streamFileInput = new FileInputStream("src/juliet_test/resources/config.properties"); properties.load(streamFileInput); } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error with stream reading", exceptIO); } finally { /* clean up stream reading objects */ try { if (streamFileInput != null) { streamFileInput.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing FileInputStream", exceptIO); } } (new CWE259_Hard_Coded_Password__basicAuthenticatorCheckCredentials_53b()).goodExpectedSink(properties); } public void good() throws Throwable { goodG2B(); goodChar(); goodExpected(); } /* Below is the main(). It is only used when building this testcase on * its own for testing or for building a binary to use in testing binary * analysis tools. It is not used when compiling all the testcases as one * application, which is how source code analysis tools are tested. */ public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException { mainFromParent(args); } }
[ "root@Delta.localdomain" ]
root@Delta.localdomain
2789470ae5dda956614e6f0969d7d1a591949149
28fc3fd2889b6a0425d2285c44f7227c58bf8bfc
/full-stack-with-angular-and-spring-boot/jpa/jpain10steps/src/main/java/com/in28minutes/learning/jpa/jpain10steps/entity/User.java
eb4ce71c566c13a1701e5c6f6d7308e451e6f1f5
[]
no_license
Chichonix/Angular7Udemi
86a5a5e28bd47107630c9611269ac9626105e905
e93730cb147572fa0ed89577dcf4a1d69333ff92
refs/heads/master
2020-04-09T19:21:16.028992
2019-01-10T09:09:43
2019-01-10T09:09:43
160,541,394
0
0
null
null
null
null
UTF-8
Java
false
false
467
java
package com.in28minutes.learning.jpa.jpain10steps.entity; import lombok.Data; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; // Table - User @Entity @Data public class User { @Id @GeneratedValue private long id; private String name; private String role; public User() { } public User(String name, String role) { this.name = name; this.role = role; } }
[ "chicho.dan45@gmail.com" ]
chicho.dan45@gmail.com
9de1b009486de8601dadafb4161db837057918c0
5a5fa32f17d36e4d983f8c5fdf085780592bf7bd
/src/who/Question.java
1c21000c16ae4524fb97882e1647fc153b5c06b9
[]
no_license
Skovich/who-Wins
9ee0b6899875d1f514ecb121d40801b7e38e70ca
878ded6660dac9952ff3625ed9574876e5d65f5e
refs/heads/master
2023-03-05T00:08:58.597684
2021-02-16T21:48:39
2021-02-16T21:48:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,899
java
package who; import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Question { private final String Question; private List<Answer> Answer; public Question(String Question, Answer Answer1, Answer Answer2, Answer Answer3, Answer Answer4) throws Exception { this.Question = Question; Answer = new ArrayList<>(); Answer.add(Answer1); Answer.add(Answer2); Answer.add(Answer3); Answer.add(Answer4); int i = 0; for (Answer a : Answer) { if (a.isTrueAnswer()) i++; } if (i > 1) throw new Exception("there is more then one true Answer"); } public String getQuestion() { return Question; } public List<Answer> getAnswer() { return Answer; } public int getTrueAnswerNum() { for(int i=0 ; i<4 ; i++) { Answer tmp = Answer.get(i); if(tmp.isTrueAnswer()) { return i ; } } return 0 ; } public Answer getTrueAnswer() throws Exception { for (Answer a : Answer) { if (a.isTrueAnswer()) return a; } throw new Exception("no Valid Answer"); } @Override public String toString() { String AnswerOnString = "" ; for (int i=1 ; i<5 ; i++) { AnswerOnString+="Answer"+i+" is :" + Answer.get(i-1).getAnswer()+System.lineSeparator() ; } return "Question is :" + Question + System.lineSeparator() +AnswerOnString ; } public static void main(String[] args) throws Exception { Answer Answer1 = new Answer("2000", true); Answer Answer2 = new Answer("2001", false); Answer Answer3 = new Answer("2002", false); Answer Answer4 = new Answer("2003", false); Question question= new Question("Waktech touled Skander" , Answer1, Answer2, Answer3, Answer4); System.out.println(question.getTrueAnswerNum()); } }
[ "MSI@192.168.0.3" ]
MSI@192.168.0.3
f4962cf374eed594ed3f038030838e687d180c0b
120ced6ca22d7bd69dfc1176d1dc6a722de67dde
/app/src/main/java/cn/edu/s07150819gdmec/work1/MainActivity.java
e38e3123d83c9ca86409f6723f2cae6308569e32
[]
no_license
gdmec07150819/Work1
9164350c7215d7a5881db8fc5fb76a8047448ed2
984f89491f1c512e90bf3518d4082c7bd87b2d9c
refs/heads/master
2020-09-22T14:55:50.247356
2016-09-12T03:09:42
2016-09-12T03:09:42
67,971,253
0
0
null
null
null
null
UTF-8
Java
false
false
340
java
package cn.edu.s07150819gdmec.work1; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } }
[ "844298721@qq.com" ]
844298721@qq.com
414d4dad0cd245dde2ed135d5fe08dd9aa18acf9
696aa05ec959063d58807051902d8e2c48a989b9
/ole-app/olefs/src/main/java/org/kuali/ole/select/document/validation/impl/OleRequisitionRule.java
a329920cafc3654794a1a99ff9b0d053a86775bf
[]
no_license
sheiksalahudeen/ole-30-sprint-14-intermediate
3e8bcd647241eeb741d7a15ff9aef72f8ad34b33
2aef659b37628bd577e37077f42684e0977e1d43
refs/heads/master
2023-01-09T00:59:02.123787
2017-01-26T06:09:02
2017-01-26T06:09:02
80,089,548
0
0
null
2023-01-02T22:05:38
2017-01-26T05:47:58
PLSQL
UTF-8
Java
false
false
1,125
java
/* * Copyright 2011 The Kuali Foundation. * * Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php * * 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.kuali.ole.select.document.validation.impl; import org.kuali.ole.select.businessobject.OleRequisitionItem; import org.kuali.rice.krad.document.Document; import org.kuali.rice.krad.rules.rule.BusinessRule; public interface OleRequisitionRule extends BusinessRule { public boolean processCustomAddDiscountBusinessRules(Document document, OleRequisitionItem reqItem); public boolean processCustomForeignCurrencyRequisitionBusinessRules(Document document, OleRequisitionItem reqItem); }
[ "sheiksalahudeen.m@kuali.org" ]
sheiksalahudeen.m@kuali.org
8e897d1d81150635fd8199ff0079a64c424391ec
d7e730064bcd56d3ede8ba9993b4297ed61b1562
/src/main/java/ru/luvas/dk/server/module/modules/More.java
bef2d3dae2f8c0d6032f9e4cd6a7803ab9c0fc59
[]
no_license
RinesThaix/DarlingKateServer
8a9d69f552d35db27fa0879508fa16be42005eba
0b2ff577d83513fa30ef1bbf3f4ca1c716ec7893
refs/heads/master
2020-08-04T21:31:20.096189
2016-12-19T15:36:03
2016-12-19T15:36:03
73,527,774
3
0
null
null
null
null
UTF-8
Java
false
false
976
java
package ru.luvas.dk.server.module.modules; import com.google.common.collect.Lists; import ru.luvas.dk.server.custom.RequestResult; import ru.luvas.dk.server.custom.RequestResultNotify; import ru.luvas.dk.server.module.IterableModule; import ru.luvas.dk.server.module.Module; import ru.luvas.dk.server.user.Session; /** * * @author 0xC0deBabe <iam@kostya.sexy> */ public class More extends Module { public final static String KEY_ITERABLE_MODULE = "iterable_module"; public More() { super(Lists.newArrayList("еще", "следующий", "следующая", "следующее", "далее", "дальше")); } @Override public RequestResult handle(Session session, String msg) { if(!session.has(KEY_ITERABLE_MODULE)) return new RequestResultNotify("Не поняла тебя."); IterableModule module = (IterableModule) session.get(KEY_ITERABLE_MODULE); return module.next(session); } }
[ "iam@kostya.sexy" ]
iam@kostya.sexy
b316331dbd32135a82c031c4b5ca42acf3a04c03
d7c5121237c705b5847e374974b39f47fae13e10
/airspan.netspan/src/main/java/Netspan/NBI_17_5/Backhaul/IBridge2QosProfileUpdateResponse.java
f0c11698661f7aa20c6ebd592cf461d62bcd07ce
[]
no_license
AirspanNetworks/SWITModules
8ae768e0b864fa57dcb17168d015f6585d4455aa
7089a4b6456621a3abd601cc4592d4b52a948b57
refs/heads/master
2022-11-24T11:20:29.041478
2020-08-09T07:20:03
2020-08-09T07:20:03
184,545,627
1
0
null
2022-11-16T12:35:12
2019-05-02T08:21:55
Java
UTF-8
Java
false
false
1,895
java
package Netspan.NBI_17_5.Backhaul; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="IBridge2QosProfileUpdateResult" type="{http://Airspan.Netspan.WebServices}ProfileResponse" minOccurs="0"/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "iBridge2QosProfileUpdateResult" }) @XmlRootElement(name = "IBridge2QosProfileUpdateResponse") public class IBridge2QosProfileUpdateResponse { @XmlElement(name = "IBridge2QosProfileUpdateResult") protected ProfileResponse iBridge2QosProfileUpdateResult; /** * Gets the value of the iBridge2QosProfileUpdateResult property. * * @return * possible object is * {@link ProfileResponse } * */ public ProfileResponse getIBridge2QosProfileUpdateResult() { return iBridge2QosProfileUpdateResult; } /** * Sets the value of the iBridge2QosProfileUpdateResult property. * * @param value * allowed object is * {@link ProfileResponse } * */ public void setIBridge2QosProfileUpdateResult(ProfileResponse value) { this.iBridge2QosProfileUpdateResult = value; } }
[ "ggrunwald@airspan.com" ]
ggrunwald@airspan.com
4ef4fce12a1a403ef2f144e08f4ff72bc92d1b01
9cd6196c2a59d7fe949a67b144584dffb45a6bbe
/src/Framework/ObjectId.java
5f2acfba670cdf5e074b8917079cad857ad2641d
[]
no_license
QueueUpX/Game
65c2401a2570210381ef89826c43e0a45bd0e3ab
74f838540a6ca528f2592728f792ec7f072f2225
refs/heads/main
2023-03-27T00:29:41.525419
2021-03-29T10:25:05
2021-03-29T10:25:05
352,594,208
0
0
null
null
null
null
UTF-8
Java
false
false
177
java
package Framework; public enum ObjectId { Player(), Block(), Bullet(), PlatformHorizontal(), PlatformVertical(), PlatformHorVer(), Enemy(), EnemyBullet(), EndGame(); }
[ "noreply@github.com" ]
noreply@github.com
8838765525a15c86b14ae04e53bb63949e92fbe4
1ffdbd20244b209e872bcc0c621de0a5c9727dfa
/src/main/java/storm/boilerplate/SquareStormTopology.java
decf14a6e8d50a1fdff863015c6b6d43edcab074
[]
no_license
MaximCastornyi/Java-Eclipse-Storm-Boilerplate
bb21b58b3e9a04242142d137a2415a247e07b0fc
bdf560944769b5306ef44be554defd050f8fcb9b
refs/heads/master
2023-01-23T02:11:39.748649
2020-12-09T12:19:40
2020-12-09T12:19:40
319,947,118
0
0
null
null
null
null
UTF-8
Java
false
false
1,457
java
package storm.boilerplate; import java.util.logging.Level; import java.util.logging.Logger; import org.apache.storm.Config; import org.apache.storm.LocalCluster; import org.apache.storm.StormSubmitter; import org.apache.storm.topology.TopologyBuilder; public class SquareStormTopology { public static void main(String[] args) throws InterruptedException, Exception{ //Build Topology TopologyBuilder builder = new TopologyBuilder(); //Loading Spout builder.setSpout("Number-Spout", new NumberSpout()); // Spout emitting number ----> Bolt where number is squared builder.setBolt("Square-Bolt", new SquareBolt()).shuffleGrouping("Number-Spout"); // Bolt sq number ---> PrintBolt printing num and sq builder.setBolt("Print-Bolt", new PrintBolt()).shuffleGrouping("Square-Bolt"); //Configuration Config config = new Config(); //Submit Topology to cluster //LocalCluster cluster = new LocalCluster(); // cluster.submitTopology("square-storm-topology", config, builder.createTopology()); StormSubmitter cluster = new StormSubmitter(); cluster.submitTopology("square-storm-topology", config, builder.createTopology()); /* try { Thread.sleep(45000); } catch (InterruptedException e) { } */ //System.exit(0); } }
[ "nets.devs@gmail.com" ]
nets.devs@gmail.com
589fd0c0df65409a4df6e1ee329fc22de52e0cf1
4e4d8d34625c1c285ef33bb45c58d0f7159974ff
/src/main/java/com/example/task1/Task1Application.java
64d06d09bbed93ac7a60b2ddf1dcb5bb6c85aa51
[]
no_license
RUstam163/Simbirsoft-task1
1f32920924cc987c1206ad24d10ac9a9f81e6be0
f73cd3550eb8c41d9c0bf03e74f35de38858eb81
refs/heads/master
2020-08-07T20:15:46.113806
2019-10-28T12:28:50
2019-10-28T12:28:50
213,575,393
0
0
null
null
null
null
UTF-8
Java
false
false
310
java
package com.example.task1; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class Task1Application { public static void main(String[] args) { SpringApplication.run(Task1Application.class, args); } }
[ "minibaev-rustam163@yandex.ru" ]
minibaev-rustam163@yandex.ru
7c37de23227d4ea5c910c640893f9fd2ec802608
079e9fb49d9045fbb6e4b3a1292f605dc29bece7
/源码/car/src/main/java/com/yanshang/car/controller/AccountController.java
950fa2efd20f143544a060d4c30d41d6e6c3e5ea
[]
no_license
chenylwork/yanshang-car
14b5c0cf503e61b0d72dfb1258b0416434fa2d6e
0b5ccb57ded42d4167c7520fed339c49905d2a00
refs/heads/master
2020-04-16T22:01:23.834850
2019-03-03T15:00:40
2019-03-03T15:00:40
164,087,165
0
0
null
null
null
null
UTF-8
Java
false
false
2,497
java
package com.yanshang.car.controller; import com.yanshang.car.bean.Account; import com.yanshang.car.commons.NetMessage; import com.yanshang.car.services.AccountService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /* * @ClassName AccountController * @Description 账号请求处理 * @Author 陈彦磊 * @Date 2019/1/4- 16:29 * @Version 1.0 **/ @RestController public class AccountController { @Autowired private AccountService accountService; /** * 用户登录 * @param phone 登录手机号 * @param password 登录密码 * @return */ @RequestMapping("/login") public NetMessage login(String phone,String password) { return accountService.login(phone,password); } /** * 用户注册 * @param account 注册账户:需要phone注册手机,注册密码参数 * @param code 手机验证码(如果有验证码就验证没有就不验证) * @return */ @RequestMapping("/register") public NetMessage register(Account account, String code) { return accountService.register(account,code); } /** * 修改登录密码 * @param phone 修改用户的手机号 * @param password 修改的新密码 * @return */ @RequestMapping("/change") public NetMessage change(String phone,String password) { return accountService.changePass(phone,password); } /** * 录入用户推荐人信息 * @param phone 用户账户(电话) * @param name 推荐人姓名 * @param name 推荐人电话 * @return */ @Deprecated @RequestMapping("/referrer") public NetMessage initReferrer(String phone,String name,String referrerPhone) { return accountService.referrer(phone, name, referrerPhone); } /** * 验证码检验 * @param phone 手机号 * @param code 验证码 * @return */ @RequestMapping("/check") public NetMessage checkCode(String phone,String code) { return accountService.checkCode(phone, code); } /** * 发送验证码 * @param phone 发送验证码手机号 * 需要手机号检验:1、检验是否是手机号 * @return */ @RequestMapping("/send") public NetMessage sendCode(String phone) { return accountService.sendCode(phone); } }
[ "chenylemail@163.com" ]
chenylemail@163.com
8d883372d0703aaaf0b8b3a3f40819e8f40e883e
fe62f5225094a68eb2b81ba6d499ad73d77ea546
/supportDesign-app/src/main/java/com/ben/androiddemo/fragment/base/BaseFragment.java
b4e392624b0d76d49791e4f515e3667908a0f916
[]
no_license
bennnnnnnnn/AndroidDemo
b9ae1d89c0919045cb3472fb7464924d875679ab
7e2da186b6ea8e30db735678e3536b0e3e3ffb3e
refs/heads/master
2021-01-19T10:46:11.531263
2017-07-04T07:29:15
2017-07-04T07:29:15
87,897,065
0
0
null
null
null
null
UTF-8
Java
false
false
183
java
package com.ben.androiddemo.fragment.base; import android.support.v4.app.Fragment; /** * Created on 17/4/11. * * @author Ben */ public class BaseFragment extends Fragment { }
[ "zhoubangquan1992@gmail.com" ]
zhoubangquan1992@gmail.com
4c58d37547bd70751f9e539a3201cfcd37b51a81
f19f176194c587252d57bc997c55189623e41348
/src/main/java/thaumicenergistics/tileentities/TileEssentiaCellWorkbench.java
12291385650bbd2b49bec580ccff26f6dfc71c29
[ "MIT" ]
permissive
Aquahatsche/ThaumicEnergistics
83e1eb13ad6842a096f478ce4e34686b6f633ae6
bafb097aabc5516ea42e5a810dd219a522c3e285
refs/heads/master
2021-01-21T05:36:29.161918
2015-12-29T10:01:40
2015-12-29T10:01:40
47,465,665
1
0
null
2015-12-05T17:33:58
2015-12-05T17:33:58
null
UTF-8
Java
false
false
8,082
java
package thaumicenergistics.tileentities; import java.util.ArrayList; import java.util.List; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import thaumcraft.api.aspects.Aspect; import thaumicenergistics.ThaumicEnergistics; import thaumicenergistics.container.ContainerEssentiaCellWorkbench; import thaumicenergistics.inventory.HandlerItemEssentiaCell; import thaumicenergistics.items.ItemEssentiaCell; import thaumicenergistics.network.packet.client.Packet_C_AspectSlot; import thaumicenergistics.util.EffectiveSide; import appeng.api.storage.IMEInventory; import appeng.api.storage.ISaveProvider; public class TileEssentiaCellWorkbench extends TileEntity implements IInventory, ISaveProvider { private static String NBT_KEY_CELL = "EssentiaCell"; /** * The stored essentia cell. */ private ItemStack eCell = null; /** * Cell handler */ private HandlerItemEssentiaCell eCellHandler = null; /** * List of containers that are open. */ private final List<ContainerEssentiaCellWorkbench> openContainers = new ArrayList<ContainerEssentiaCellWorkbench>(); public TileEssentiaCellWorkbench() { } /** * Forces all containers to sync the cell itemstack */ private void forceContainerSyncCell() { for( ContainerEssentiaCellWorkbench container : this.openContainers ) { container.onForceSyncCell(); } } /** * Notifies the open containers that the cell changed. */ private void onCellChanged() { for( ContainerEssentiaCellWorkbench container : this.openContainers ) { container.onCellChanged(); } } /** * Workbench does not need ticks. */ @Override public boolean canUpdate() { return false; } @Override public void closeInventory() { // Ignored } /** * Gets and removes the cell. */ @Override public ItemStack decrStackSize( final int slotIndex, final int amount ) { ItemStack rtn = null; if( this.hasEssentiaCell() ) { // Get the cell rtn = this.eCell; // Null the cell this.setInventorySlotContents( slotIndex, null ); } return rtn; } @Override public String getInventoryName() { return ThaumicEnergistics.MOD_ID + ".essentia.cell.workbench.inventory"; } @Override public int getInventoryStackLimit() { return 1; } @Override public int getSizeInventory() { return 1; } /** * Gets the cell. */ @Override public ItemStack getStackInSlot( final int slotIndex ) { return this.eCell; } /** * Gets the cell. */ @Override public ItemStack getStackInSlotOnClosing( final int slotIndex ) { return this.eCell; } @Override public boolean hasCustomInventoryName() { return true; } /** * Checks if the workbench has a cell. * * @return */ public boolean hasEssentiaCell() { return( this.eCell != null ); } /** * Ensures the stack is an essentia cell. */ @Override public boolean isItemValidForSlot( final int slotIndex, final ItemStack stack ) { return( ( stack == null ) || ( stack.getItem() instanceof ItemEssentiaCell ) ); } @Override public boolean isUseableByPlayer( final EntityPlayer player ) { return true; } /** * A client requests to add an aspect to the partition list. * * @param aspect */ public boolean onClientRequestAddAspectToPartitionList( final EntityPlayer player, final Aspect aspect ) { if( ( this.eCellHandler != null ) ) { if( this.eCellHandler.addAspectToPartitionList( aspect ) ) { // Re-send the list this.onClientRequestPartitionList( player ); return true; } } return false; } /** * A client requests all partition data be removed. * * @param player */ public void onClientRequestClearPartitioning( final EntityPlayer player ) { if( this.eCellHandler != null ) { this.eCellHandler.clearPartitioning(); // Re-send the list this.onClientRequestPartitionList( player ); // Force containers to update the cell item. this.forceContainerSyncCell(); } } /** * A client requests the partition list. * * @param player */ public void onClientRequestPartitionList( final EntityPlayer player ) { List<Aspect> partitionList; if( ( this.eCellHandler != null ) ) { partitionList = this.eCellHandler.getPartitionAspects(); } else { partitionList = new ArrayList<Aspect>(); } // Send to client Packet_C_AspectSlot.setFilterList( partitionList, player ); } /** * A client requests the cell partition list be set to match * the contents of the cell. * * @param player */ public void onClientRequestPartitionToContents( final EntityPlayer player ) { if( this.eCellHandler != null ) { this.eCellHandler.partitionToCellContents(); // Re-send the list this.onClientRequestPartitionList( player ); } } /** * A client requests to remove an aspect from the partition list. * * @param aspect */ public void onClientRequestRemoveAspectFromPartitionList( final EntityPlayer player, final Aspect aspect ) { if( ( this.eCellHandler != null ) ) { if( this.eCellHandler.removeAspectFromPartitionList( aspect ) ) { // Re-send the list this.onClientRequestPartitionList( player ); } } } /** * A client requests to replace an aspect from the partition list. * * @param aspect */ public void onClientRequestReplaceAspectFromPartitionList( final EntityPlayer player, final Aspect fromAspect, final Aspect toAspect ) { if( this.eCellHandler != null ) { if( this.eCellHandler.replaceAspectInPartitionList( fromAspect, toAspect ) ) { // Re-send the list this.onClientRequestPartitionList( player ); } } } @Override public void openInventory() { // Ignored } /** * Loads the workbench. */ @Override public void readFromNBT( final NBTTagCompound data ) { // Call super super.readFromNBT( data ); // Is there a cell to read? if( data.hasKey( TileEssentiaCellWorkbench.NBT_KEY_CELL ) ) { // Read the cell this.setInventorySlotContents( 0, ItemStack.loadItemStackFromNBT( data.getCompoundTag( TileEssentiaCellWorkbench.NBT_KEY_CELL ) ) ); } } /** * Registers a container. * The container will be notified when the cell changes. * * @param container */ public void registerContainer( final ContainerEssentiaCellWorkbench container ) { if( !this.openContainers.contains( container ) ) { this.openContainers.add( container ); } } /** * Removes a container. * It will no longer receive notifications when the cell changes. * * @param container */ public void removeContainer( final ContainerEssentiaCellWorkbench container ) { this.openContainers.remove( container ); } /** * Called when the cell changes */ @Override public void saveChanges( final IMEInventory cellInventory ) { // Mark the chunk as needing to be saved.( less invasive than this.markDirty() ) this.worldObj.markTileEntityChunkModified( this.xCoord, this.yCoord, this.zCoord, this ); } /** * Sets the stored cell * * @param cell */ @Override public void setInventorySlotContents( final int slotIndex, final ItemStack stack ) { if( this.isItemValidForSlot( slotIndex, stack ) ) { // Set the cell this.eCell = stack; if( EffectiveSide.isServerSide() ) { if( stack == null ) { // Null the handler this.eCellHandler = null; } else { // Get the handler this.eCellHandler = new HandlerItemEssentiaCell( stack, this ); } // Update containers this.onCellChanged(); } } } /** * Saves the workbench. */ @Override public void writeToNBT( final NBTTagCompound data ) { // Call super super.writeToNBT( data ); // Is there a cell? if( this.hasEssentiaCell() ) { // Write the cell data NBTTagCompound cellData = this.eCell.writeToNBT( new NBTTagCompound() ); // Add the cell data data.setTag( TileEssentiaCellWorkbench.NBT_KEY_CELL, cellData ); } } }
[ "Nividica@gmail.com" ]
Nividica@gmail.com
46afc46c4e627b52149dd4d77989572497396eec
53636440de8efdbd21fe0db2162b0614b4bed9fb
/plugin-core/src/main/java/com/rodrigo/pluginsample/SampleServiceFactory.java
b45ec6e50e0d33e2dbb8e6395dcd96e2454b2f3a
[]
no_license
rcalencar/pluginsample
9d3ef575e1e2de3372c5b84f3da0f8c3e10b0bc9
c68d4a7fc4e6cc3e80ea3ee301959e0d35977723
refs/heads/master
2021-01-17T07:46:17.448412
2016-05-25T19:16:58
2016-05-25T19:16:58
30,098,012
0
0
null
null
null
null
UTF-8
Java
false
false
2,008
java
package com.rodrigo.pluginsample; import java.util.HashMap; import java.util.Map; import org.apache.log4j.Logger; public class SampleServiceFactory { // http://duckranger.com/2011/06/jaxb-without-a-schema/ // https://code.google.com/p/json-simple/wiki/DecodingExamples // http://www.thomas-bayer.com/sqlrest/INVOICE/,com.rodrigo.plugin.SqlRest // http://httpbin.org/get?value=15.00&id=,com.rodrigo.plugin.HttpBin private static final Logger logger = Logger.getLogger(SampleServiceFactory.class); private static final String URL = "url"; private static SampleServiceFactory INSTANCE; private Map<String, SampleService> services_ = new HashMap<String, SampleService>(); private SampleServiceFactory() { } public static SampleService getService(String serviceName) { if (INSTANCE == null) { INSTANCE = new SampleServiceFactory(); INSTANCE.init(); } return INSTANCE.services_.get(serviceName); } private void init() { String url_properties_ = System.getProperty(URL); loadConfig(url_properties_, services_); logger.info("services: " + services_); } private void loadConfig(String url_properties, Map<String, SampleService> urls) { String[] urla = url_properties.split(","); for (String urlname : urla) { String urlpar = System.getProperty(urlname); String[] pars = urlpar.split(","); String name = pars[0]; String url = pars[1]; String clazzname = pars[2]; try { @SuppressWarnings("rawtypes") Class clazz = Class.forName(clazzname); ServiceHandlerInterface inst = (ServiceHandlerInterface) clazz.newInstance(); SampleService p = new SampleService(name, url, inst); urls.put(name, p); } catch (Exception e) { logger.error("Error: ", e); } } } }
[ "rcalencar@gmail.com" ]
rcalencar@gmail.com
245c79e3451c28527a9d67f7660bfc346caef75a
4a56b399251d0ce90947558f6f1f4bb331aff61e
/src/prj05Sort/SearchTime.java
2fe070a00b42023e4c2551b5375e0b2a158d8fbe
[]
no_license
RenatMukhametshin/JavaArraysCollections
a1f788a6265436904cb50d050aadb1eca08e4628
a34f55598aacda6c894ed0e6edce1e0048795a6e
refs/heads/master
2023-06-20T23:24:36.629442
2021-07-28T18:05:19
2021-07-28T18:05:19
389,053,268
0
0
null
null
null
null
UTF-8
Java
false
false
4,207
java
package prj05Sort; import java.util.*; public class SearchTime { private static final ArrayList<String> numberList = new ArrayList<>(); private static final HashSet<String> numberHashSet = new HashSet<>(); private static final TreeSet<String> numberTreeSet = new TreeSet<>(); public static void main(String[] args) { long startNano = System.nanoTime(); long startMilli = System.currentTimeMillis(); numbersGenerator(); numberHashSet.addAll(numberList); numberTreeSet.addAll(numberList); long endNano = System.nanoTime(); long endMilli = System.currentTimeMillis(); System.out.println("Collections created in:"); System.out.println("nano time : " + (endNano - startNano) * 1.0 / 1000000000); System.out.println("milli time : " + (endMilli - startMilli) * 1.0 / 1000); System.out.println("\n\n\n"); Scanner scanner = new Scanner(System.in); // for(int i = 0; i < 10; i++){ // System.out.println(numberList.get(i)); // } while(true){ System.out.print("Input the number [xYYYbbCCC] : "); String number = scanner.nextLine().trim(); if(number.compareToIgnoreCase("exit") == 0){ break; } listSearch(number); listBinarSearch(number); listHashSetSearch(number); listTreeSetSearch(number); } } private static void listTreeSetSearch(String number) { long start = System.nanoTime(); boolean result = numberTreeSet.contains(number); long end = System.nanoTime(); double searchTime = (end - start) * 1.0 / 1000000000; System.out.println("TreeSet Search : " + ((result)?" number found ":" number is not found ") + ", search time " + searchTime + " nanoSecs"); } private static void listHashSetSearch(String number) { long start = System.nanoTime(); boolean result = numberHashSet.contains(number); long end = System.nanoTime(); double searchTime = (end - start) * 1.0 / 1000000000; System.out.println("HashSet Search : " + ((result)?" number found ":" number is not found ") + ", search time " + searchTime + " nanoSecs"); } private static void listBinarSearch(String number) { long start = System.nanoTime(); int result = Collections.binarySearch(numberList, number); long end = System.nanoTime(); double searchTime = (end - start) * 1.0 / 1000000000; System.out.println("Binar Search : " + ((result >= 0)?" number found ":" number is not found ") + ", search time " + searchTime + " nanoSecs"); } private static void listSearch(String number){ long start = System.nanoTime(); boolean isExists = numberList.contains(number); long end = System.nanoTime(); double searchTime = (end - start) * 1.0 / 1000000000; System.out.println("List Search : " + ((isExists)?" number found ":" number is not found ") + ", search time " + searchTime + " nanoSecs"); } private static void numbersGenerator() { /*XYZ — letters, N — numbers , R — regin (от 001 до 199); XNNNYZR — пример, A111BB197, Y777HC66, * */ int count = 0; StringBuilder regionStr = new StringBuilder(); for (int i = 111; i <= 999; i += 111) { for (char letter1 = 'A'; letter1 <= 'Z'; letter1++) { for (char letter2 = 'A'; letter2 <= 'Z'; letter2++) { // for (char letter3 = 'A'; letter3 <= 'Z'; letter3++) { for (int region = 1; region <= 199; region++) { regionStr.append("00" + region); numberList.add((" " + letter1 + i + letter2 + letter2 + regionStr.substring(regionStr.length() - 3)).trim()); count++; regionStr.setLength(0); // } } } } } Collections.sort(numberList); System.out.println(count + " numbers generated"); } }
[ "myemail@mydomain2.ru" ]
myemail@mydomain2.ru
563c94e7342913b848e3438c8d748e162e05957e
9723df4db6c8a4030e13cc2bce8b5e64ab0a955d
/eaton.core/src/main/java/com/eaton/platform/core/models/FullPageDrawerLinkListModel.java
627ed2e1a5807e9603839968852bc33d3e61ffc6
[]
no_license
danyhv2/eaton
d47786db789cb9261284fa4aea040129940c13c5
850e9fc7ff095ccd2f480f0003ee891b5e9bdd6b
refs/heads/master
2021-07-04T06:46:29.485846
2017-09-22T21:36:45
2017-09-22T21:36:45
104,939,213
0
0
null
null
null
null
UTF-8
Java
false
false
1,626
java
package com.eaton.platform.core.models; import javax.annotation.PostConstruct; import javax.inject.Inject; import org.apache.sling.api.resource.Resource; import org.apache.sling.models.annotations.Model; import org.apache.sling.models.annotations.Optional; import com.eaton.platform.core.util.CommonUtil; /** * The Class FullPageDrawerLinkListModel. */ @Model(adaptables = Resource.class) public class FullPageDrawerLinkListModel { /** The link path. */ @Inject @Optional private String linkPath; /** The trans link title. */ @Inject @Optional private String transLinkTitle; /** The icons. */ @Inject @Optional private String icons; /** The new window. */ @Inject @Optional private String newWindow; /** * Gets the link path. * * @return the link path */ public String getLinkPath() { return linkPath; } /** * Sets the link path. * * @param linkPath the new link path */ public void setLinkPath(String linkPath) { this.linkPath = linkPath; } /** * Gets the trans link title. * * @return the trans link title */ public String getTransLinkTitle() { return transLinkTitle; } /** * Gets the icons. * * @return the icons */ public String getIcons() { return icons; } /** * Gets the new window. * * @return the new window */ public String getNewWindow() { return newWindow; } /** * Inits the. */ @PostConstruct protected void init() { if (getLinkPath() != null) { setLinkPath(CommonUtil.dotHtmlLink(getLinkPath())); } } }
[ "delunamarie@gmail.com" ]
delunamarie@gmail.com
9053537b6a3f360b0fc55a3eaea4e336ab59c522
461d64515631c9f6c1074043e2315d5791c736db
/aproject-portal/src/main/java/com/aproject/portal/controller/ItemController.java
5ddcd5006dc7153ae509707a13d006b071cdb551
[]
no_license
zywd4220/-
c2542f97a68988a838281a5add075c3bf49b72e9
ed439258c2efd7cd25cd14e24f19f499c3308ce6
refs/heads/master
2020-03-18T01:35:55.579071
2018-05-20T12:44:54
2018-05-20T12:44:54
134,149,771
0
0
null
null
null
null
UTF-8
Java
false
false
1,535
java
package com.aproject.portal.controller; import java.util.List; import javax.servlet.http.HttpServletRequest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import com.aproject.common.pojo.EasyUIDataGridResult; import com.aproject.common.pojo.TaotaoResult; import com.aproject.pojo.TbItem; import com.aproject.pojo.TbSeller; import com.aproject.portal.service.ItemService; //展示商品详情 @Controller public class ItemController { @Autowired private ItemService itemService; @RequestMapping("/item/{itemId}") public String showItemInfo(@PathVariable Long itemId,Model model) { TbItem item = itemService.getItemById(itemId); model.addAttribute("item",item); return "item"; } @RequestMapping(value="/item/desc/{itemId}", produces=MediaType.TEXT_HTML_VALUE+";charset=utf-8") @ResponseBody public String getItemDesc(@PathVariable Long itemId) { String desc = itemService.getItemDescById(itemId); return desc; } @RequestMapping(value="/item/param/{itemId}", produces=MediaType.TEXT_HTML_VALUE+";charset=utf-8") @ResponseBody public String getItemParam(@PathVariable Long itemId) { String paramHtml = itemService.getItemParamById(itemId); return paramHtml; } }
[ "605256336@qq.com" ]
605256336@qq.com
c8dc7cde5728b4f5ffc4fe57300cc5fb2b243211
198addbd8aaa47a81432a9368d352d598879b2a4
/xmlspy/src/com/altova/types/SchemaTypeNumber.java
73c99e55f9a9912635c94c93bd46555b66633873
[]
no_license
NishantChhattani/ColumnStore
3af45bc8243b27a686534b43620fed17fa0d786d
35c80b4f425fafc0c250b86669d801b2cf8d07a8
refs/heads/main
2023-03-22T11:57:39.657907
2021-03-15T20:33:02
2021-03-15T20:33:02
348,109,117
0
0
null
2021-03-15T20:12:06
2021-03-15T20:12:05
null
UTF-8
Java
false
false
1,274
java
/** * SchemaTypeNumber.java * * This file was generated by XMLSpy 2006r3sp1 Enterprise Edition. * * YOU SHOULD NOT MODIFY THIS FILE, BECAUSE IT WILL BE * OVERWRITTEN WHEN YOU RE-RUN CODE GENERATION. * * Refer to the XMLSpy Documentation for further details. * http://www.altova.com/xmlspy */ package com.altova.types; import java.math.BigInteger; import java.math.BigDecimal; public interface SchemaTypeNumber extends SchemaType { // constants for declaration of types which have an numeric value public final int NUMERIC_VALUE_INT = 1; // short, byte are not considered because Java treats everything as int and numbers are casted only at the end. // unsigned types are not considered, because these simple-types are not supported by Java public final int NUMERIC_VALUE_LONG = 2; public final int NUMERIC_VALUE_BIGINTEGER = 3; public final int NUMERIC_VALUE_FLOAT = 4; public final int NUMERIC_VALUE_DOUBLE = 5; public final int NUMERIC_VALUE_BIGDECIMAL = 6; public int numericType(); // returns if the value is nummeric and up to which degree. public int intValue(); public long longValue(); public BigInteger bigIntegerValue(); public float floatValue(); public double doubleValue(); public BigDecimal bigDecimalValue(); }
[ "63929895+khandya1@users.noreply.github.com" ]
63929895+khandya1@users.noreply.github.com
97a35275dab713ca4ee1107265b24103dfbf3aa7
5153e62ddebbedf6a1b08ccb0d281cb01a0dd29b
/proto-google-cloud-video-intelligence-v1p3beta1/src/main/java/com/google/cloud/videointelligence/v1p3beta1/DetectedLandmark.java
1f97cd3ff3c7f4248d32f841c95446d05067d7cd
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
suraj-qlogic/java-video-intelligence
4cc666f746554a1c541943e787523284ec1fee9e
edf68beb1ad0f3de5740604e83681fe55a8349be
refs/heads/master
2020-09-23T02:34:45.970236
2020-05-20T05:15:44
2020-05-20T05:15:44
225,380,107
0
0
NOASSERTION
2020-06-25T12:18:05
2019-12-02T13:21:06
Java
UTF-8
Java
false
false
32,762
java
/* * Copyright 2020 Google LLC * * 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 * * https://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. */ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/cloud/videointelligence/v1p3beta1/video_intelligence.proto package com.google.cloud.videointelligence.v1p3beta1; /** * * * <pre> * A generic detected landmark represented by name in string format and a 2D * location. * </pre> * * Protobuf type {@code google.cloud.videointelligence.v1p3beta1.DetectedLandmark} */ public final class DetectedLandmark extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.cloud.videointelligence.v1p3beta1.DetectedLandmark) DetectedLandmarkOrBuilder { private static final long serialVersionUID = 0L; // Use DetectedLandmark.newBuilder() to construct. private DetectedLandmark(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private DetectedLandmark() { name_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new DetectedLandmark(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private DetectedLandmark( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 10: { java.lang.String s = input.readStringRequireUtf8(); name_ = s; break; } case 18: { com.google.cloud.videointelligence.v1p3beta1.NormalizedVertex.Builder subBuilder = null; if (point_ != null) { subBuilder = point_.toBuilder(); } point_ = input.readMessage( com.google.cloud.videointelligence.v1p3beta1.NormalizedVertex.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(point_); point_ = subBuilder.buildPartial(); } break; } case 29: { confidence_ = input.readFloat(); break; } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.videointelligence.v1p3beta1.VideoIntelligenceServiceProto .internal_static_google_cloud_videointelligence_v1p3beta1_DetectedLandmark_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.videointelligence.v1p3beta1.VideoIntelligenceServiceProto .internal_static_google_cloud_videointelligence_v1p3beta1_DetectedLandmark_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.videointelligence.v1p3beta1.DetectedLandmark.class, com.google.cloud.videointelligence.v1p3beta1.DetectedLandmark.Builder.class); } public static final int NAME_FIELD_NUMBER = 1; private volatile java.lang.Object name_; /** * * * <pre> * The name of this landmark, i.e. left_hand, right_shoulder. * </pre> * * <code>string name = 1;</code> * * @return The name. */ public java.lang.String getName() { java.lang.Object ref = name_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); name_ = s; return s; } } /** * * * <pre> * The name of this landmark, i.e. left_hand, right_shoulder. * </pre> * * <code>string name = 1;</code> * * @return The bytes for name. */ public com.google.protobuf.ByteString getNameBytes() { java.lang.Object ref = name_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); name_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int POINT_FIELD_NUMBER = 2; private com.google.cloud.videointelligence.v1p3beta1.NormalizedVertex point_; /** * * * <pre> * The 2D point of the detected landmark using the normalized image * coordindate system. The normalized coordinates have the range from 0 to 1. * </pre> * * <code>.google.cloud.videointelligence.v1p3beta1.NormalizedVertex point = 2;</code> * * @return Whether the point field is set. */ public boolean hasPoint() { return point_ != null; } /** * * * <pre> * The 2D point of the detected landmark using the normalized image * coordindate system. The normalized coordinates have the range from 0 to 1. * </pre> * * <code>.google.cloud.videointelligence.v1p3beta1.NormalizedVertex point = 2;</code> * * @return The point. */ public com.google.cloud.videointelligence.v1p3beta1.NormalizedVertex getPoint() { return point_ == null ? com.google.cloud.videointelligence.v1p3beta1.NormalizedVertex.getDefaultInstance() : point_; } /** * * * <pre> * The 2D point of the detected landmark using the normalized image * coordindate system. The normalized coordinates have the range from 0 to 1. * </pre> * * <code>.google.cloud.videointelligence.v1p3beta1.NormalizedVertex point = 2;</code> */ public com.google.cloud.videointelligence.v1p3beta1.NormalizedVertexOrBuilder getPointOrBuilder() { return getPoint(); } public static final int CONFIDENCE_FIELD_NUMBER = 3; private float confidence_; /** * * * <pre> * The confidence score of the detected landmark. Range [0, 1]. * </pre> * * <code>float confidence = 3;</code> * * @return The confidence. */ public float getConfidence() { return confidence_; } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); } if (point_ != null) { output.writeMessage(2, getPoint()); } if (confidence_ != 0F) { output.writeFloat(3, confidence_); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); } if (point_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getPoint()); } if (confidence_ != 0F) { size += com.google.protobuf.CodedOutputStream.computeFloatSize(3, confidence_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.cloud.videointelligence.v1p3beta1.DetectedLandmark)) { return super.equals(obj); } com.google.cloud.videointelligence.v1p3beta1.DetectedLandmark other = (com.google.cloud.videointelligence.v1p3beta1.DetectedLandmark) obj; if (!getName().equals(other.getName())) return false; if (hasPoint() != other.hasPoint()) return false; if (hasPoint()) { if (!getPoint().equals(other.getPoint())) return false; } if (java.lang.Float.floatToIntBits(getConfidence()) != java.lang.Float.floatToIntBits(other.getConfidence())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); if (hasPoint()) { hash = (37 * hash) + POINT_FIELD_NUMBER; hash = (53 * hash) + getPoint().hashCode(); } hash = (37 * hash) + CONFIDENCE_FIELD_NUMBER; hash = (53 * hash) + java.lang.Float.floatToIntBits(getConfidence()); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.google.cloud.videointelligence.v1p3beta1.DetectedLandmark parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.videointelligence.v1p3beta1.DetectedLandmark parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloud.videointelligence.v1p3beta1.DetectedLandmark parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.videointelligence.v1p3beta1.DetectedLandmark parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloud.videointelligence.v1p3beta1.DetectedLandmark parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.videointelligence.v1p3beta1.DetectedLandmark parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloud.videointelligence.v1p3beta1.DetectedLandmark parseFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.cloud.videointelligence.v1p3beta1.DetectedLandmark parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.videointelligence.v1p3beta1.DetectedLandmark parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } public static com.google.cloud.videointelligence.v1p3beta1.DetectedLandmark parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.videointelligence.v1p3beta1.DetectedLandmark parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.cloud.videointelligence.v1p3beta1.DetectedLandmark parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException( PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder( com.google.cloud.videointelligence.v1p3beta1.DetectedLandmark prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * * * <pre> * A generic detected landmark represented by name in string format and a 2D * location. * </pre> * * Protobuf type {@code google.cloud.videointelligence.v1p3beta1.DetectedLandmark} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:google.cloud.videointelligence.v1p3beta1.DetectedLandmark) com.google.cloud.videointelligence.v1p3beta1.DetectedLandmarkOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.videointelligence.v1p3beta1.VideoIntelligenceServiceProto .internal_static_google_cloud_videointelligence_v1p3beta1_DetectedLandmark_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.videointelligence.v1p3beta1.VideoIntelligenceServiceProto .internal_static_google_cloud_videointelligence_v1p3beta1_DetectedLandmark_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.videointelligence.v1p3beta1.DetectedLandmark.class, com.google.cloud.videointelligence.v1p3beta1.DetectedLandmark.Builder.class); } // Construct using com.google.cloud.videointelligence.v1p3beta1.DetectedLandmark.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override public Builder clear() { super.clear(); name_ = ""; if (pointBuilder_ == null) { point_ = null; } else { point_ = null; pointBuilder_ = null; } confidence_ = 0F; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.cloud.videointelligence.v1p3beta1.VideoIntelligenceServiceProto .internal_static_google_cloud_videointelligence_v1p3beta1_DetectedLandmark_descriptor; } @java.lang.Override public com.google.cloud.videointelligence.v1p3beta1.DetectedLandmark getDefaultInstanceForType() { return com.google.cloud.videointelligence.v1p3beta1.DetectedLandmark.getDefaultInstance(); } @java.lang.Override public com.google.cloud.videointelligence.v1p3beta1.DetectedLandmark build() { com.google.cloud.videointelligence.v1p3beta1.DetectedLandmark result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.google.cloud.videointelligence.v1p3beta1.DetectedLandmark buildPartial() { com.google.cloud.videointelligence.v1p3beta1.DetectedLandmark result = new com.google.cloud.videointelligence.v1p3beta1.DetectedLandmark(this); result.name_ = name_; if (pointBuilder_ == null) { result.point_ = point_; } else { result.point_ = pointBuilder_.build(); } result.confidence_ = confidence_; onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.google.cloud.videointelligence.v1p3beta1.DetectedLandmark) { return mergeFrom((com.google.cloud.videointelligence.v1p3beta1.DetectedLandmark) other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.google.cloud.videointelligence.v1p3beta1.DetectedLandmark other) { if (other == com.google.cloud.videointelligence.v1p3beta1.DetectedLandmark.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } if (other.hasPoint()) { mergePoint(other.getPoint()); } if (other.getConfidence() != 0F) { setConfidence(other.getConfidence()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.google.cloud.videointelligence.v1p3beta1.DetectedLandmark parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.google.cloud.videointelligence.v1p3beta1.DetectedLandmark) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private java.lang.Object name_ = ""; /** * * * <pre> * The name of this landmark, i.e. left_hand, right_shoulder. * </pre> * * <code>string name = 1;</code> * * @return The name. */ public java.lang.String getName() { java.lang.Object ref = name_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); name_ = s; return s; } else { return (java.lang.String) ref; } } /** * * * <pre> * The name of this landmark, i.e. left_hand, right_shoulder. * </pre> * * <code>string name = 1;</code> * * @return The bytes for name. */ public com.google.protobuf.ByteString getNameBytes() { java.lang.Object ref = name_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); name_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * * * <pre> * The name of this landmark, i.e. left_hand, right_shoulder. * </pre> * * <code>string name = 1;</code> * * @param value The name to set. * @return This builder for chaining. */ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } name_ = value; onChanged(); return this; } /** * * * <pre> * The name of this landmark, i.e. left_hand, right_shoulder. * </pre> * * <code>string name = 1;</code> * * @return This builder for chaining. */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /** * * * <pre> * The name of this landmark, i.e. left_hand, right_shoulder. * </pre> * * <code>string name = 1;</code> * * @param value The bytes for name to set. * @return This builder for chaining. */ public Builder setNameBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); name_ = value; onChanged(); return this; } private com.google.cloud.videointelligence.v1p3beta1.NormalizedVertex point_; private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.videointelligence.v1p3beta1.NormalizedVertex, com.google.cloud.videointelligence.v1p3beta1.NormalizedVertex.Builder, com.google.cloud.videointelligence.v1p3beta1.NormalizedVertexOrBuilder> pointBuilder_; /** * * * <pre> * The 2D point of the detected landmark using the normalized image * coordindate system. The normalized coordinates have the range from 0 to 1. * </pre> * * <code>.google.cloud.videointelligence.v1p3beta1.NormalizedVertex point = 2;</code> * * @return Whether the point field is set. */ public boolean hasPoint() { return pointBuilder_ != null || point_ != null; } /** * * * <pre> * The 2D point of the detected landmark using the normalized image * coordindate system. The normalized coordinates have the range from 0 to 1. * </pre> * * <code>.google.cloud.videointelligence.v1p3beta1.NormalizedVertex point = 2;</code> * * @return The point. */ public com.google.cloud.videointelligence.v1p3beta1.NormalizedVertex getPoint() { if (pointBuilder_ == null) { return point_ == null ? com.google.cloud.videointelligence.v1p3beta1.NormalizedVertex.getDefaultInstance() : point_; } else { return pointBuilder_.getMessage(); } } /** * * * <pre> * The 2D point of the detected landmark using the normalized image * coordindate system. The normalized coordinates have the range from 0 to 1. * </pre> * * <code>.google.cloud.videointelligence.v1p3beta1.NormalizedVertex point = 2;</code> */ public Builder setPoint(com.google.cloud.videointelligence.v1p3beta1.NormalizedVertex value) { if (pointBuilder_ == null) { if (value == null) { throw new NullPointerException(); } point_ = value; onChanged(); } else { pointBuilder_.setMessage(value); } return this; } /** * * * <pre> * The 2D point of the detected landmark using the normalized image * coordindate system. The normalized coordinates have the range from 0 to 1. * </pre> * * <code>.google.cloud.videointelligence.v1p3beta1.NormalizedVertex point = 2;</code> */ public Builder setPoint( com.google.cloud.videointelligence.v1p3beta1.NormalizedVertex.Builder builderForValue) { if (pointBuilder_ == null) { point_ = builderForValue.build(); onChanged(); } else { pointBuilder_.setMessage(builderForValue.build()); } return this; } /** * * * <pre> * The 2D point of the detected landmark using the normalized image * coordindate system. The normalized coordinates have the range from 0 to 1. * </pre> * * <code>.google.cloud.videointelligence.v1p3beta1.NormalizedVertex point = 2;</code> */ public Builder mergePoint(com.google.cloud.videointelligence.v1p3beta1.NormalizedVertex value) { if (pointBuilder_ == null) { if (point_ != null) { point_ = com.google.cloud.videointelligence.v1p3beta1.NormalizedVertex.newBuilder(point_) .mergeFrom(value) .buildPartial(); } else { point_ = value; } onChanged(); } else { pointBuilder_.mergeFrom(value); } return this; } /** * * * <pre> * The 2D point of the detected landmark using the normalized image * coordindate system. The normalized coordinates have the range from 0 to 1. * </pre> * * <code>.google.cloud.videointelligence.v1p3beta1.NormalizedVertex point = 2;</code> */ public Builder clearPoint() { if (pointBuilder_ == null) { point_ = null; onChanged(); } else { point_ = null; pointBuilder_ = null; } return this; } /** * * * <pre> * The 2D point of the detected landmark using the normalized image * coordindate system. The normalized coordinates have the range from 0 to 1. * </pre> * * <code>.google.cloud.videointelligence.v1p3beta1.NormalizedVertex point = 2;</code> */ public com.google.cloud.videointelligence.v1p3beta1.NormalizedVertex.Builder getPointBuilder() { onChanged(); return getPointFieldBuilder().getBuilder(); } /** * * * <pre> * The 2D point of the detected landmark using the normalized image * coordindate system. The normalized coordinates have the range from 0 to 1. * </pre> * * <code>.google.cloud.videointelligence.v1p3beta1.NormalizedVertex point = 2;</code> */ public com.google.cloud.videointelligence.v1p3beta1.NormalizedVertexOrBuilder getPointOrBuilder() { if (pointBuilder_ != null) { return pointBuilder_.getMessageOrBuilder(); } else { return point_ == null ? com.google.cloud.videointelligence.v1p3beta1.NormalizedVertex.getDefaultInstance() : point_; } } /** * * * <pre> * The 2D point of the detected landmark using the normalized image * coordindate system. The normalized coordinates have the range from 0 to 1. * </pre> * * <code>.google.cloud.videointelligence.v1p3beta1.NormalizedVertex point = 2;</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.videointelligence.v1p3beta1.NormalizedVertex, com.google.cloud.videointelligence.v1p3beta1.NormalizedVertex.Builder, com.google.cloud.videointelligence.v1p3beta1.NormalizedVertexOrBuilder> getPointFieldBuilder() { if (pointBuilder_ == null) { pointBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.videointelligence.v1p3beta1.NormalizedVertex, com.google.cloud.videointelligence.v1p3beta1.NormalizedVertex.Builder, com.google.cloud.videointelligence.v1p3beta1.NormalizedVertexOrBuilder>( getPoint(), getParentForChildren(), isClean()); point_ = null; } return pointBuilder_; } private float confidence_; /** * * * <pre> * The confidence score of the detected landmark. Range [0, 1]. * </pre> * * <code>float confidence = 3;</code> * * @return The confidence. */ public float getConfidence() { return confidence_; } /** * * * <pre> * The confidence score of the detected landmark. Range [0, 1]. * </pre> * * <code>float confidence = 3;</code> * * @param value The confidence to set. * @return This builder for chaining. */ public Builder setConfidence(float value) { confidence_ = value; onChanged(); return this; } /** * * * <pre> * The confidence score of the detected landmark. Range [0, 1]. * </pre> * * <code>float confidence = 3;</code> * * @return This builder for chaining. */ public Builder clearConfidence() { confidence_ = 0F; onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:google.cloud.videointelligence.v1p3beta1.DetectedLandmark) } // @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.DetectedLandmark) private static final com.google.cloud.videointelligence.v1p3beta1.DetectedLandmark DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.cloud.videointelligence.v1p3beta1.DetectedLandmark(); } public static com.google.cloud.videointelligence.v1p3beta1.DetectedLandmark getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<DetectedLandmark> PARSER = new com.google.protobuf.AbstractParser<DetectedLandmark>() { @java.lang.Override public DetectedLandmark parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new DetectedLandmark(input, extensionRegistry); } }; public static com.google.protobuf.Parser<DetectedLandmark> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<DetectedLandmark> getParserForType() { return PARSER; } @java.lang.Override public com.google.cloud.videointelligence.v1p3beta1.DetectedLandmark getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }
[ "noreply@github.com" ]
noreply@github.com
6e141b656aa49011dfc2e15357851033d8c202b6
f6b90fae50ea0cd37c457994efadbd5560a5d663
/android/nut-dex2jar.src/com/amap/api/services/district/b.java
662d4a629bbcaa35efd0cd172eb6e0868da4d00e
[]
no_license
dykdykdyk/decompileTools
5925ae91f588fefa7c703925e4629c782174cd68
4de5c1a23f931008fa82b85046f733c1439f06cf
refs/heads/master
2020-01-27T09:56:48.099821
2016-09-14T02:47:11
2016-09-14T02:47:11
66,894,502
1
0
null
null
null
null
UTF-8
Java
false
false
583
java
package com.amap.api.services.district; import android.os.Parcel; import android.os.Parcelable.Creator; class b implements Parcelable.Creator<DistrictResult> { b(DistrictResult paramDistrictResult) { } public DistrictResult a(Parcel paramParcel) { return new DistrictResult(paramParcel); } public DistrictResult[] a(int paramInt) { return new DistrictResult[paramInt]; } } /* Location: C:\crazyd\work\ustone\odm2016031702\baidu\android\nut-dex2jar.jar * Qualified Name: com.amap.api.services.district.b * JD-Core Version: 0.6.2 */
[ "819468107@qq.com" ]
819468107@qq.com
3bc50c2c7077e0347c48f9a12e9f14eadaabf1fe
794033b00bbf35040762f8d1a7d7abc5b2b2186d
/android/app/src/main/java/com/madhav/calculator_app/MainActivity.java
41920bdeb50fa3572c194c54da6a2bd80719abe9
[]
no_license
maddydixit800788/calculator_app_using_flutter
9d2304b76a640fc7511c82228bd7054430ee242f
4c50b4045832b5aada1f48768d7f2c38101bbab3
refs/heads/master
2020-06-25T11:39:19.966032
2019-07-28T16:00:16
2019-07-28T16:00:16
199,298,173
0
0
null
null
null
null
UTF-8
Java
false
false
370
java
package com.madhav.calculator_app; import android.os.Bundle; import io.flutter.app.FlutterActivity; import io.flutter.plugins.GeneratedPluginRegistrant; public class MainActivity extends FlutterActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); GeneratedPluginRegistrant.registerWith(this); } }
[ "maddydixit3210@gmail.com" ]
maddydixit3210@gmail.com
f1931f55aa53a4069ec60aac2c6722a01da75c8b
b7c0a4cd36272e2951a8aaf6e94d7f6fd191b3c1
/ListCountries/app/src/main/java/com/example/listcountries/Country.java
70cec268a7a5362efbe8843491ef8088ae4b8d5d
[]
no_license
xuanthu9x/BaiTapUngDungDiDong
096f6dc293e01f36cfa4d9180fe1537f8bfc6819
bbef33e6bfb76ec77e281d7958a557f66ffc94f3
refs/heads/master
2022-10-17T04:40:52.436363
2020-06-21T11:44:16
2020-06-21T11:44:16
273,041,902
0
0
null
null
null
null
UTF-8
Java
false
false
1,131
java
package com.example.listcountries; public class Country { private String name,image,countryCode,population, area; public Country() {} public Country(String name, String countryCode, String population,String area) { this.name = name; //this.image = image; this.countryCode = countryCode; this.population = population; this.area=area; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getImage() { return image; } public void setImage(String image) { this.image = image; } public String getCountryCode() { return countryCode; } public void setCountryCode(String countryCode) { this.countryCode = countryCode; } public String getPopulation() { return population; } public void setPopulation(String population) { this.population = population; } public String getArea() { return area; } public void setArea(String area) { this.area = area; } }
[ "=" ]
=
5ccdf17932c74d47d0e5134ab91bf62d243b9b54
2260fb68dd6568d23981717cca394181b4382ead
/app/src/main/java/com/example/gdei/park/MainActivity.java
4364b91f21d1bd8f314843d66240ae57ce9eb1e2
[]
no_license
liangjiegao/Park
e48d4580c321feb05eb99b7e1ec269b12bdbd2ec
c12f53d0f228aa44fcdab7ec46b9228f237bb767
refs/heads/master
2020-03-21T05:48:54.767005
2018-06-23T15:18:10
2018-06-23T15:18:10
138,182,592
0
0
null
null
null
null
UTF-8
Java
false
false
354
java
package com.example.gdei.park; import android.app.Activity; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } }
[ "1445808283@qq.com" ]
1445808283@qq.com
03974d7c45a69c90589f7288045536e0691c97e4
5488ac0fb5bbed07e1922090bdc42453d7070e6e
/epoxy-adapter/src/main/java/com/airbnb/epoxy/EpoxyVisibilityTracker.java
5609549d3c7ccd166a387326b2876eb9a68dd410
[ "Apache-2.0" ]
permissive
borysstach/epoxy
4852a5af9979bfdc9a9d866e9103c8baf2a2fc9f
77871bca7da903f68d1d504f4001758d64347a44
refs/heads/master
2020-04-12T09:59:33.647510
2019-01-07T10:34:19
2019-01-07T10:34:19
162,415,299
0
0
NOASSERTION
2018-12-19T09:36:43
2018-12-19T09:36:43
null
UTF-8
Java
false
false
13,312
java
package com.airbnb.epoxy; import android.util.Log; import android.util.SparseArray; import android.view.View; import android.view.View.OnLayoutChangeListener; import java.util.ArrayList; import java.util.List; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView.Adapter; import androidx.recyclerview.widget.RecyclerView.AdapterDataObserver; import androidx.recyclerview.widget.RecyclerView.OnChildAttachStateChangeListener; import androidx.recyclerview.widget.RecyclerView.OnScrollListener; import androidx.recyclerview.widget.RecyclerView.ViewHolder; /** * A simple way to track visibility events on {@link com.airbnb.epoxy.EpoxyModel} within a {@link * androidx.recyclerview.widget.RecyclerView}. * <p> * {@link EpoxyVisibilityTracker} works with any {@link androidx.recyclerview.widget.RecyclerView} * backed by an Epoxy controller. Once attached the events will be forwarded to the Epoxy model (or * to the Epoxy view when using annotations). * <p> * Note regarding nested lists: The visibility event tracking is not properly handled yet. This is * on the todo. * <p> * * @see OnVisibilityChanged * @see OnVisibilityStateChanged * @see OnModelVisibilityChangedListener * @see OnModelVisibilityStateChangedListener */ public class EpoxyVisibilityTracker { private static final String TAG = "EpoxyVisibilityTracker"; // Not actionable at runtime. It is only useful for internal test-troubleshooting. static final boolean DEBUG_LOG = false; /** Maintain visibility item indexed by view id (identity hashcode) */ private final SparseArray<EpoxyVisibilityItem> visibilityIdToItemMap = new SparseArray<>(); private final List<EpoxyVisibilityItem> visibilityIdToItems = new ArrayList<>(); /** listener used to process scroll, layout and attach events */ private final Listener listener = new Listener(); /** listener used to process data events */ private final DataObserver observer = new DataObserver(); @Nullable private RecyclerView attachedRecyclerView = null; @Nullable private Adapter lastAdapterSeen = null; private boolean onChangedEnabled = true; /** This flag is for optimizing the process on detach. If detach is from data changed then it * need to re-process all views, else no need (ex: scroll). */ private boolean visibleDataChanged = false; /** * Enable or disable visibility changed event. Default is `true`, disable it if you don't need * (triggered by every pixel scrolled). * * @see OnVisibilityChanged * @see OnModelVisibilityChangedListener */ public void setOnChangedEnabled(boolean enabled) { onChangedEnabled = enabled; } /** * Attach the tracker. * * @param recyclerView The recyclerview that the EpoxyController has its adapter added to. */ public void attach(@NonNull RecyclerView recyclerView) { attachedRecyclerView = recyclerView; recyclerView.addOnScrollListener(this.listener); recyclerView.addOnLayoutChangeListener(this.listener); recyclerView.addOnChildAttachStateChangeListener(this.listener); } /** * Detach the tracker * * @param recyclerView The recycler view that the EpoxyController has its adapter added to. */ public void detach(@NonNull RecyclerView recyclerView) { recyclerView.removeOnScrollListener(this.listener); recyclerView.removeOnLayoutChangeListener(this.listener); recyclerView.removeOnChildAttachStateChangeListener(this.listener); attachedRecyclerView = null; } /** * The tracker is storing visibility states internally and is using if to send events, only the * difference is sent. Use this method to clear the states and thus regenerate the visibility * events. This may be useful when you change the adapter on the {@link * androidx.recyclerview.widget.RecyclerView} */ public void clearVisibilityStates() { // Clear our visibility items visibilityIdToItemMap.clear(); visibilityIdToItems.clear(); } private void processChangeEvent(String debug) { processChangeEventWithDetachedView(null, debug); } private void processChangeEventWithDetachedView(@Nullable View detachedView, String debug) { final RecyclerView recyclerView = attachedRecyclerView; if (recyclerView != null) { // On every every events lookup for a new adapter processNewAdapterIfNecessary(); // Process the detached child if any if (detachedView != null) { processChild(detachedView, true, debug); } // Process all attached children for (int i = 0; i < recyclerView.getChildCount(); i++) { final View child = recyclerView.getChildAt(i); if (child != null && child != detachedView) { // Is some case the detached child is still in the recycler view. Don't process it as it // was already processed. processChild(child, false, debug); } } } } /** * If there is a new adapter on the attached RecyclerView it will resister the data observer and * clear the current visibility states */ private void processNewAdapterIfNecessary() { if (attachedRecyclerView != null && attachedRecyclerView.getAdapter() != null) { if (lastAdapterSeen != attachedRecyclerView.getAdapter()) { if (lastAdapterSeen != null) { // Unregister the old adapter lastAdapterSeen.unregisterAdapterDataObserver(this.observer); } // Register the new adapter attachedRecyclerView.getAdapter().registerAdapterDataObserver(this.observer); lastAdapterSeen = attachedRecyclerView.getAdapter(); } } } /** * Don't call this method directly, it is called from * {@link EpoxyVisibilityTracker#processVisibilityEvents} * * @param child the view to process for visibility event * @param detachEvent true if the child was just detached * @param eventOriginForDebug a debug strings used for logs */ private void processChild(@NonNull View child, boolean detachEvent, String eventOriginForDebug) { final RecyclerView recyclerView = attachedRecyclerView; if (recyclerView != null) { final ViewHolder holder = recyclerView.getChildViewHolder(child); if (holder instanceof EpoxyViewHolder) { processVisibilityEvents( recyclerView, (EpoxyViewHolder) holder, detachEvent, eventOriginForDebug ); } else { throw new IllegalEpoxyUsage( "`EpoxyVisibilityTracker` cannot be used with non-epoxy view holders." ); } } } /** * Call this methods every time something related to ui (scroll, layout, ...) or something related * to data changed. * * @param recyclerView the recycler view * @param epoxyHolder the {@link RecyclerView} * @param detachEvent true if the event originated from a view detached from the * recycler view * @param eventOriginForDebug a debug strings used for logs */ private void processVisibilityEvents( @NonNull RecyclerView recyclerView, @NonNull EpoxyViewHolder epoxyHolder, boolean detachEvent, String eventOriginForDebug ) { if (DEBUG_LOG) { Log.d(TAG, String.format("%s.processVisibilityEvents %s, %s, %s", eventOriginForDebug, System.identityHashCode(epoxyHolder), detachEvent, epoxyHolder.getAdapterPosition() )); } final View itemView = epoxyHolder.itemView; final int id = System.identityHashCode(itemView); EpoxyVisibilityItem vi = visibilityIdToItemMap.get(id); if (vi == null) { // New view discovered, assign an EpoxyVisibilityItem vi = new EpoxyVisibilityItem(epoxyHolder.getAdapterPosition()); visibilityIdToItemMap.put(id, vi); visibilityIdToItems.add(vi); } else if (epoxyHolder.getAdapterPosition() != RecyclerView.NO_POSITION && vi.getAdapterPosition() != epoxyHolder.getAdapterPosition()) { // EpoxyVisibilityItem being re-used for a different adapter position vi.reset(epoxyHolder.getAdapterPosition()); } if (vi.update(itemView, recyclerView, detachEvent)) { // View is measured, process events vi.handleVisible(epoxyHolder, detachEvent); vi.handleFocus(epoxyHolder, detachEvent); vi.handleFullImpressionVisible(epoxyHolder, detachEvent); if (onChangedEnabled) { vi.handleChanged(epoxyHolder); } } } /** * Helper class that host the {@link androidx.recyclerview.widget.RecyclerView} listener * implementations */ private class Listener extends OnScrollListener implements OnLayoutChangeListener, OnChildAttachStateChangeListener { @Override public void onLayoutChange( @NonNull View recyclerView, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom ) { processChangeEvent("onLayoutChange"); } @Override public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) { processChangeEvent("onScrolled"); } @Override public void onChildViewAttachedToWindow(View child) { processChild(child, false, "onChildViewAttachedToWindow"); } @Override public void onChildViewDetachedFromWindow(View child) { if (visibleDataChanged) { // On detach event caused by data set changed we need to re-process all children because // the removal caused the others views to changes. processChangeEventWithDetachedView(child, "onChildViewDetachedFromWindow"); visibleDataChanged = false; } else { processChild(child, true, "onChildViewDetachedFromWindow"); } } } /** * The layout/scroll events are not enough to detect all sort of visibility changes. We also * need to look at the data events from the adapter. */ class DataObserver extends AdapterDataObserver { /** * Clear the current visibility statues */ @Override public void onChanged() { if (DEBUG_LOG) { Log.d(TAG, "onChanged()"); } visibilityIdToItemMap.clear(); visibilityIdToItems.clear(); visibleDataChanged = true; } /** * For all items after the inserted range shift each {@link EpoxyVisibilityTracker} adapter * position by inserted item count. */ @Override public void onItemRangeInserted(int positionStart, int itemCount) { if (DEBUG_LOG) { Log.d(TAG, String.format("onItemRangeInserted(%d, %d)", positionStart, itemCount)); } for (EpoxyVisibilityItem item : visibilityIdToItems) { if (item.getAdapterPosition() >= positionStart) { visibleDataChanged = true; item.shiftBy(itemCount); } } } /** * For all items after the removed range reverse-shift each {@link EpoxyVisibilityTracker} * adapter position by removed item count */ @Override public void onItemRangeRemoved(int positionStart, int itemCount) { if (DEBUG_LOG) { Log.d(TAG, String.format("onItemRangeRemoved(%d, %d)", positionStart, itemCount)); } for (EpoxyVisibilityItem item : visibilityIdToItems) { if (item.getAdapterPosition() >= positionStart) { visibleDataChanged = true; item.shiftBy(-itemCount); } } } /** * This is a bit more complex, for move we need to first swap the moved position then shift the * items between the swap. To simplify we split any range passed to individual item moved. * * ps: anyway {@link androidx.recyclerview.widget.AdapterListUpdateCallback} * does not seem to use range for moved items. */ @Override public void onItemRangeMoved(int fromPosition, int toPosition, int itemCount) { for (int i = 0; i < itemCount; i++) { onItemMoved(fromPosition + i, toPosition + i); } } private void onItemMoved(int fromPosition, int toPosition) { if (DEBUG_LOG) { Log.d(TAG, String.format("onItemRangeMoved(%d, %d, %d)", fromPosition, toPosition, 1)); } for (EpoxyVisibilityItem item : visibilityIdToItems) { int position = item.getAdapterPosition(); if (position == fromPosition) { // We found the item to be moved, just swap the position. item.shiftBy(toPosition - fromPosition); visibleDataChanged = true; } else if (fromPosition < toPosition) { // Item will be moved down in the list if (position > fromPosition && position <= toPosition) { // Item is between the moved from and to indexes, it should move up item.shiftBy(-1); visibleDataChanged = true; } } else if (fromPosition > toPosition) { // Item will be moved up in the list if (position >= toPosition && position < fromPosition) { // Item is between the moved to and from indexes, it should move down item.shiftBy(1); visibleDataChanged = true; } } } } } }
[ "konakid@gmail.com" ]
konakid@gmail.com
bce4eba47a5e91c29d702c298f12912557ebfa8f
d17997fea98e49a05132b7c37e276297a0fec411
/JavaOOPBasic/src/JavaOOPBasicsExam12March2017/cars/ShowCar.java
67ef58ba3f361c83e47e2e50c0273c45acf79c80
[]
no_license
Invincible9/JavaCore
cb99186da3ad59dd4c7ecd623c4e3700a6cb5897
4e005ac85ccde3038f57efbe592494d0b0afbf90
refs/heads/master
2021-01-20T02:08:53.404216
2019-04-18T12:39:01
2019-04-18T12:39:01
89,379,476
3
0
null
null
null
null
UTF-8
Java
false
false
1,188
java
package JavaOOPBasicsExam12March2017.cars; import JavaOOPBasicsExam12March2017.abstraction.Car; /** * Created by Mihail on 3/12/2017. */ public class ShowCar extends Car { private static final String CAR_TYPE = "Show"; private int stars; public ShowCar(String carBrand, String carModel, int carYearOfProduction, int carHorsePower, int carAcceleration, int carSuspension, int carDurability) { super(CAR_TYPE, carBrand, carModel, carYearOfProduction, carHorsePower, carAcceleration, carSuspension, carDurability); this.stars = 0; } public int getStars() { return this.stars; } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(String.format("%s %s %d%n", super.getCarBrand(), super.getCarModel(), super.getCarYearOfProduction())); sb.append(String.format("%d HP, 100 m/h in %d s%n", super.getCarHorsePower(), super.getCarAcceleration())); sb.append(String.format("%d Suspension force, %d Durability%n", super.getCarSuspension(), super.getCarDurability())); sb.append(String.format("%d *%n", this.getStars())); return sb.toString(); } }
[ "Invulnerable89@abv.bg" ]
Invulnerable89@abv.bg
f64ec7a0e25e19ced08d40a9039078a26667ea74
3c56829eab83a7a9152b1ccb72695816bd8b640b
/src/main/java/lab1/dShare/D_Share/Controllers/AppErrorController.java
5e349bd3622e5c61b3f239493dd7a987485ae9be
[]
no_license
LautaroCarrozza/3dShare
dd4c6457779f81c3ee03e5cfd0c93579ffa3da6e
184dce78fc6500272c0a69041c2462a0266062d7
refs/heads/master
2020-05-02T09:34:41.454631
2019-07-17T12:33:58
2019-07-17T12:33:58
177,875,302
0
0
null
null
null
null
UTF-8
Java
false
false
483
java
package lab1.dShare.D_Share.Controllers; import org.springframework.boot.web.servlet.error.ErrorController; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @Controller public class AppErrorController implements ErrorController { private final static String ERROR_PATH = "/error"; @Override @RequestMapping(ERROR_PATH) public String getErrorPath() { return "redirect:/login.html"; } }
[ "lautaro.carrozza@ing.austral.edu.ar" ]
lautaro.carrozza@ing.austral.edu.ar
886492d87e614823640de196455bb129896c2280
752e90af91e7cf2bd32effa0ff83d202c6cbc5d2
/app/src/test/java/com/karman/fingerprintdialog/ExampleUnitTest.java
427fef512c084d88fbb2bafbd70e7e1f9ba4483c
[]
no_license
kammy92/FingerprintDialog-Custom
d4169fd8412a705bc2a985ced81cfac32142db66
28542fdaaad3b1ffcbf391fdadacfc1d84567d72
refs/heads/master
2021-01-01T18:18:46.015210
2017-08-08T13:11:26
2017-08-08T13:11:26
98,297,059
0
0
null
null
null
null
UTF-8
Java
false
false
419
java
package com.karman.fingerprintdialog; import org.junit.Test; import static org.junit.Assert.assertEquals; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect () throws Exception { assertEquals (4, 2 + 2); } }
[ "karman.singhh@gmail.com" ]
karman.singhh@gmail.com
5780fc89408715c472cf814ba53b76341a430142
308270f357a35dd4fd45679d0938e49d225fb299
/piotr/org.uva.sc.piotr.ql/src/ast/visitors/collectors/CollectReferencesVisitor.java
afae9cf783765826805670a918bfc4e2c0610f3f
[]
no_license
njtromp/endless-ql
47f0c98e802b398b0d220de9018c8df11a7c7f6f
7ad1cd65b52488044f9cbfb64c9b494b899df3a7
refs/heads/master
2021-04-06T01:36:31.836117
2018-03-11T17:01:25
2018-03-11T17:01:25
124,737,498
0
0
null
2018-03-11T08:31:05
2018-03-11T08:31:05
null
UTF-8
Java
false
false
585
java
package ast.visitors.collectors; import ast.model.expressions.values.VariableReference; import ast.visitors.AbstractASTTraverse; import java.util.ArrayList; public class CollectReferencesVisitor extends AbstractASTTraverse<Void> { private ArrayList<VariableReference> variableReferences = new ArrayList<>(); public ArrayList<VariableReference> getVariableReferences() { return variableReferences; } @Override public Void visit(VariableReference variableReference) { this.variableReferences.add(variableReference); return null; } }
[ "piotr.kosytorz@gmail.com" ]
piotr.kosytorz@gmail.com
dca28a1d95f107ae2876b9187291cb968fe9f77a
bea297244d811f150b6c2b794e69c7688d583feb
/src/com/sainsburys/ripefruits/app/facade/ProductFacade.java
5528c55e3fe337e79c78a974c280c49fecd49a19
[]
no_license
viveksk1857/SainsburysRipeFruitsApp
670269e0a71e3ecc73567b85881aa05b2c7f4cdf
ae587321254845ba947b2bc2600d72dafd207d7b
refs/heads/master
2021-01-10T01:30:33.482837
2015-11-18T13:16:38
2015-11-18T13:16:38
46,416,637
0
0
null
null
null
null
UTF-8
Java
false
false
309
java
package com.sainsburys.ripefruits.app.facade; import com.sainsburys.ripefruits.app.dto.Result; /** * The Interface ProductFacade. */ public interface ProductFacade { /** * Gets the all product for the page. * * @return the all product for the page */ public Result getAllProductForThePage(); }
[ "madhur.gupta@theaa.com" ]
madhur.gupta@theaa.com
b78b12005878a1142fccfa34211f1a6423bbe6e0
4cbaab5234e059148f6c36be1dcb7c3916ea39ca
/lib_image/src/main/java/client/bluerhino/cn/lib_image/imageshow/gallerywidget/GalleryViewPager.java
795f9b0ca28bc3dc708483ad29525106faf959cb
[ "Apache-2.0" ]
permissive
ruizhang81/MyLibaryStorehouse
e6786f4ba65c5167677fc22c980c894706c9d615
45911ca3fda90f21209ee46fe6ebf67944d5e5b8
refs/heads/master
2021-01-13T03:55:15.368326
2017-07-16T03:12:28
2017-07-16T03:12:28
78,201,201
0
0
null
null
null
null
UTF-8
Java
false
false
6,390
java
/* Copyright (c) 2012 Roman Truba 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 client.bluerhino.cn.lib_image.imageshow.gallerywidget; import android.annotation.TargetApi; import android.content.Context; import android.graphics.PointF; import android.os.Build; import android.support.v4.view.ViewPager; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; import client.bluerhino.cn.lib_image.imageshow.touchview.TouchImageView; /** * This class implements method to help <b>TouchImageView</b> fling, draggin and scaling. */ public class GalleryViewPager extends ViewPager { private final static int CLICK_ACTION_THRESHHOLD = 5; public TouchImageView mCurrentView; /** * @Fabio add OnItemClickListener interface */ protected OnItemClickListener mOnItemClickListener; PointF last; private float startX; private float startY; public GalleryViewPager(Context context) { super(context); } public GalleryViewPager(Context context, AttributeSet attrs) { super(context, attrs); } @TargetApi(Build.VERSION_CODES.ECLAIR) private float[] handleMotionEvent(MotionEvent event) { switch (event.getAction() & MotionEvent.ACTION_MASK) { case MotionEvent.ACTION_DOWN: last = new PointF(event.getX(0), event.getY(0)); break; case MotionEvent.ACTION_MOVE: case MotionEvent.ACTION_UP: PointF curr = new PointF(event.getX(0), event.getY(0)); return new float[]{curr.x - last.x, curr.y - last.y}; } return null; } @Override public boolean onTouchEvent(MotionEvent event) { if ((event.getAction() & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_UP) { //super.onInterceptTouchEvent(event); float endX = event.getX(); float endY = event.getY(); if (isAClick(startX, endX, startY, endY)) { if (mOnItemClickListener != null) { mOnItemClickListener.onItemClicked(mCurrentView, getCurrentItem()); } //launchFullPhotoActivity(imageUrls);// WE HAVE A CLICK!! } else { super.onTouchEvent(event); } } if ((event.getAction() & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_DOWN) { startX = event.getX(); startY = event.getY(); } /*if ((event.getAction() & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_UP) { super.onTouchEvent(event); }*/ float[] difference = handleMotionEvent(event); if (mCurrentView.pagerCanScroll()) { return super.onTouchEvent(event); } else { if (difference != null && mCurrentView.onRightSide && difference[0] < 0) //move right { return super.onTouchEvent(event); } if (difference != null && mCurrentView.onLeftSide && difference[0] > 0) //move left { return super.onTouchEvent(event); } if (difference == null && (mCurrentView.onLeftSide || mCurrentView.onRightSide)) { return super.onTouchEvent(event); } } return false; } @Override public boolean onInterceptTouchEvent(MotionEvent event) { if ((event.getAction() & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_UP) { //super.onInterceptTouchEvent(event); float endX = event.getX(); float endY = event.getY(); if (isAClick(startX, endX, startY, endY)) { if (mOnItemClickListener != null) { mOnItemClickListener.onItemClicked(mCurrentView, getCurrentItem()); } } else { super.onInterceptTouchEvent(event); } } if ((event.getAction() & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_DOWN) { startX = event.getX(); startY = event.getY(); } float[] difference = handleMotionEvent(event); if (mCurrentView.pagerCanScroll()) { return super.onInterceptTouchEvent(event); } else { if (difference != null && mCurrentView.onRightSide && difference[0] < 0) //move right { return super.onInterceptTouchEvent(event); } if (difference != null && mCurrentView.onLeftSide && difference[0] > 0) //move left { return super.onInterceptTouchEvent(event); } if (difference == null && (mCurrentView.onLeftSide || mCurrentView.onRightSide)) { return super.onInterceptTouchEvent(event); } } return false; } private boolean isAClick(float startX, float endX, float startY, float endY) { float differenceX = Math.abs(startX - endX); float differenceY = Math.abs(startY - endY); return !(differenceX > CLICK_ACTION_THRESHHOLD/* =5 */ || differenceY > CLICK_ACTION_THRESHHOLD); } public void setOnItemClickListener(OnItemClickListener listener) { mOnItemClickListener = listener; } public interface OnItemClickListener { void onItemClicked(View view, int position); } }
[ "ruizhang81@gmail.com" ]
ruizhang81@gmail.com
49b033e5a7de8e67445c774e9688c53536a79026
cca87c4ade972a682c9bf0663ffdf21232c9b857
/com/tencent/mm/plugin/clean/b/h.java
abc5d4849ab4c2e3d74506687969f8e08f4a97c9
[]
no_license
ZoranLi/wechat_reversing
b246d43f7c2d7beb00a339e2f825fcb127e0d1a1
36b10ef49d2c75d69e3c8fdd5b1ea3baa2bba49a
refs/heads/master
2021-07-05T01:17:20.533427
2017-09-25T09:07:33
2017-09-25T09:07:33
104,726,592
12
1
null
null
null
null
UTF-8
Java
false
false
860
java
package com.tencent.mm.plugin.clean.b; import com.tencent.mm.bj.g.c; import com.tencent.mm.sdk.platformtools.w; import com.tencent.mm.u.am; import java.util.HashMap; public final class h implements am { private boolean hLL = false; private boolean hLM = true; public final HashMap<Integer, c> uh() { return null; } public final void eD(int i) { d.ajN(); } public final void aM(boolean z) { w.i("MicroMsg.SubCoreClean", "summerclean onAccountPostReset updated[%b]", new Object[]{Boolean.valueOf(z)}); } public final void aN(boolean z) { w.i("MicroMsg.SubCoreClean", "summerclean onSdcardMount mounted[%b]", new Object[]{Boolean.valueOf(z)}); } public final void onAccountRelease() { w.i("MicroMsg.SubCoreClean", "summerclean onAccountRelease"); d.ajN(); } }
[ "lizhangliao@xiaohongchun.com" ]
lizhangliao@xiaohongchun.com
2b63468aad69c094e5d69574ac90173808c1d183
f155ef948f6ce79ba6498e4b2e5b0720bfa13d73
/app/src/main/java/pl/javastart/ap/webclient/WebclientActivity.java
37712ce2f8272ac28b31590247010a72af1b6c26
[]
no_license
javastartpl/android-podstawy-lekcje
6171daaf3a6c0134762026f17c24b469225878b6
ac9cd29f161ba77bbd6d23a43ee8fc1199929f12
refs/heads/master
2021-08-08T11:11:58.083024
2021-05-27T19:15:56
2021-05-27T19:15:56
38,199,870
0
4
null
null
null
null
UTF-8
Java
false
false
4,670
java
package pl.javastart.ap.webclient; import android.os.Bundle; import androidx.appcompat.app.AppCompatActivity; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.ArrayAdapter; import android.widget.Spinner; import android.widget.TextView; import java.util.List; import pl.javastart.ap.R; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; import retrofit2.Retrofit; import retrofit2.converter.gson.GsonConverterFactory; public class WebclientActivity extends AppCompatActivity implements NewCategoryCallback, FinishedDownloadingCatetegoriesCallback { private Spinner categorySpinner; private ArrayAdapter<Category> categoryAdapter; private TextView log; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_webclient); log = findViewById(R.id.log); categorySpinner = findViewById(R.id.category_spinner); categoryAdapter = new ArrayAdapter<>(WebclientActivity.this, android.R.layout.simple_dropdown_item_1line); categorySpinner.setAdapter(categoryAdapter); refreshCategories(); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_webclient, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == R.id.add) { addNewCategoryPressed(); return true; } if (item.getItemId() == R.id.refresh) { refreshCategories(); return true; } return super.onOptionsItemSelected(item); } private void refreshCategoriesRetrofit() { Util.appendToLog(log, "Pobieranie danych za pomocą Retrofit"); Retrofit restAdapter = new Retrofit.Builder() .baseUrl(WebServiceConstants.WEB_SERVICE_URL) .addConverterFactory(GsonConverterFactory.create()) .build(); CategoryRetrofitService categoryService = restAdapter.create(CategoryRetrofitService.class); Call<List<Category>> call = categoryService.getAll(); call.enqueue(new Callback<List<Category>>() { @Override public void onResponse(Call<List<Category>> call, Response<List<Category>> response) { Util.appendToLog(log, "Pobrano. Odświeżanie spinnera..."); onFinishedDownloadingCategories(response.body()); } @Override public void onFailure(Call<List<Category>> call, Throwable t) { // ignore } }); } private void refreshCategories() { refreshCategoriesRetrofit(); // old fasion way // new DownloadCategoriesAsyncTask(this, log).execute(); } private void addNewCategoryPressed() { NewCategoryFragment fragment = new NewCategoryFragment(); fragment.show(getFragmentManager(), "newCategoryFragment"); } @Override public void newCategoryAddButtonPressed(String name) { Category category = new Category(name); new NewCategoryAsyncTask(WebclientActivity.this, log).execute(category); } @Override public void onFinishedDownloadingCategories(List<Category> categories) { categoryAdapter.clear(); categoryAdapter.addAll(categories); categorySpinner.invalidate(); Util.appendToLog(log, "Spinner odźwieżony."); } public void categoryDeleteButtonPressed(View view) { if (categorySpinner.getSelectedItem() == null) { return; } Category category = (Category) categorySpinner.getSelectedItem(); Util.appendToLog(log, "Usuwanie kategorii " + category.getName()); Retrofit retrofit = new Retrofit.Builder() .baseUrl(WebServiceConstants.WEB_SERVICE_URL) .addConverterFactory(GsonConverterFactory.create()) .build(); CategoryRetrofitService categoryService = retrofit.create(CategoryRetrofitService.class); Call<Void> call = categoryService.delete(categorySpinner.getSelectedItemId()); call.enqueue(new Callback<Void>() { @Override public void onResponse(Call<Void> call, Response<Void> response) { Util.appendToLog(log, "Usunięto."); } @Override public void onFailure(Call<Void> call, Throwable t) { Util.appendToLog(log, "Coś poszło nie tak podczas usuwania."); } }); } }
[ "the.martines@gmail.com" ]
the.martines@gmail.com
d221acc37f3a484b3546f8768bbc40f1167165ab
92f10c41bad09bee05acbcb952095c31ba41c57b
/app/src/main/java/io/github/alula/ohmygod/MainActivity9395.java
41f5dfc484aa095445a5053001b19beedca22f0d
[]
no_license
alula/10000-activities
bb25be9aead3d3d2ea9f9ef8d1da4c8dff1a7c62
f7e8de658c3684035e566788693726f250170d98
refs/heads/master
2022-07-30T05:54:54.783531
2022-01-29T19:53:04
2022-01-29T19:53:04
453,501,018
16
0
null
null
null
null
UTF-8
Java
false
false
339
java
package io.github.alula.ohmygod; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; public class MainActivity9395 extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } }
[ "6276139+alula@users.noreply.github.com" ]
6276139+alula@users.noreply.github.com
f538f7dc73f48b83f769e39bc8f046f48e3f7085
6d194081e2e6d6432246f62fe89525c84a493395
/MPChartExample/app/src/main/java/com/zhuanghongji/mpchartexample/fragments/SimpleChartDemo.java
dc060b1872b0cfe34bf6f98d7de514e59b1ee984
[]
no_license
SuDaming/MPAndroidChart
5a3d77bce99bec1cd4b935fc6070b95054043749
7e1a3faa4c6edd28cfb987a12cbb0b099c2bedf1
refs/heads/master
2020-01-23T21:59:17.515935
2016-11-13T16:41:02
2016-11-13T16:41:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,618
java
package com.zhuanghongji.mpchartexample.fragments; import android.app.AlertDialog; import android.content.DialogInterface; import android.content.DialogInterface.OnClickListener; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import android.support.v4.view.ViewPager; import android.view.WindowManager; import com.zhuanghongji.mpchartexample.R; import com.zhuanghongji.mpchartexample.notimportant.DemoBase; /** * Demonstrates how to keep your charts straight forward, simple and beautiful with the MPAndroidChart library. * * @author Philipp Jahoda */ public class SimpleChartDemo extends DemoBase { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ViewPager pager = (ViewPager) findViewById(R.id.pager); pager.setOffscreenPageLimit(3); PageAdapter a = new PageAdapter(getSupportFragmentManager()); pager.setAdapter(a); AlertDialog.Builder b = new AlertDialog.Builder(this); b.setTitle("This is a ViewPager."); b.setMessage("Swipe left and right for more awesome design examples!"); b.setPositiveButton("OK", new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); b.show(); } @Override protected int getLayoutResID() { return R.layout.activity_awesomedesign; } @Override protected void initViews() { } @Override protected void initEvents() { } private class PageAdapter extends FragmentPagerAdapter { public PageAdapter(FragmentManager fm) { super(fm); } @Override public Fragment getItem(int pos) { Fragment f = null; switch(pos) { case 0: f = SineCosineFragment.newInstance(); break; case 1: f = ComplexityFragment.newInstance(); break; case 2: f = BarChartFrag.newInstance(); break; case 3: f = ScatterChartFrag.newInstance(); break; case 4: f = PieChartFrag.newInstance(); break; } return f; } @Override public int getCount() { return 5; } } }
[ "zhuanghongjichina@gmail.com" ]
zhuanghongjichina@gmail.com
0d6c12eda7e1f8e316c1055e7d58e9984920d102
e3028ed1c9f69d93bae8b647f4f2bfa7373cefce
/base_library/src/main/java/com/androidapp/banner/BannerConfig.java
b80bcfa452de8e90c4bea56e32a2e22fd258835e
[ "Apache-2.0" ]
permissive
houjianping/my_base
a12e7aca5feaae8f121d5b695e8ab067131d06db
7f8e5b0296c3de71fee5aaab99b52f22dae4b859
refs/heads/master
2020-03-20T14:06:42.932133
2019-04-10T08:45:40
2019-04-10T08:45:40
137,475,872
3
0
null
null
null
null
UTF-8
Java
false
false
1,077
java
package com.androidapp.banner; public class BannerConfig { /** * indicator style */ public static final int NOT_INDICATOR = 0; public static final int CIRCLE_INDICATOR = 1; public static final int NUM_INDICATOR = 2; public static final int NUM_INDICATOR_TITLE = 3; public static final int CIRCLE_INDICATOR_TITLE = 4; public static final int CIRCLE_INDICATOR_TITLE_INSIDE = 5; /** * indicator gravity */ public static final int LEFT = 5; public static final int CENTER = 6; public static final int RIGHT = 7; /** * banner */ public static final int PADDING_SIZE = 5; public static final int TIME = 2000; public static final int DURATION = 800; public static final boolean IS_AUTO_PLAY = true; public static final boolean IS_SCROLL = true; /** * title style */ public static final int TITLE_BACKGROUND = -1; public static final int TITLE_HEIGHT = -1; public static final int TITLE_TEXT_COLOR = -1; public static final int TITLE_TEXT_SIZE = -1; }
[ "houjianping@iyuedan.com" ]
houjianping@iyuedan.com
f4ffb8ac043c29b4acf4089ce583cd9252ad6ec5
7fa0f2b8d1ab591590cc3a78514fae5ec5fedc60
/Profile_Bean.java
72075b0a71fab544845b08c25ec8915269f652e4
[]
no_license
aashirbad/LoginServlet
029b06097ff8498529f2d0d6e95a94073c72c50e
008a5bfe324e57f2d1fb8dace2cce38087784c3b
refs/heads/master
2020-06-25T09:21:10.632450
2019-07-28T10:06:48
2019-07-28T10:06:48
199,270,347
0
0
null
null
null
null
UTF-8
Java
false
false
591
java
public class Profile_Bean { String id = null; String name = null; String mail = null; String mob = null; public String getId() { return id; } public void setId(String id) { this.id = id; System.out.append(id); } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getMail() { return mail; } public void setMail(String mail) { this.mail = mail; } public String getMob() { return mob; } public void setMob(String string) { this.mob = string; } }
[ "noreply@github.com" ]
noreply@github.com
4f6201b0d86deecf574860704684a566cbe5922d
8df9e34ed693359ec28019431964099d2429cd59
/Spavanac.java
a64e820ed34fb815b35efba3dff03d1689b5ad93
[]
no_license
yapdianhao/Kattis-Solutions
ad97df63a93065abc0dc2c2665eb0c1bbcd7733c
84fb44d21e284fb166c9424fee5ff1704250179a
refs/heads/master
2021-07-11T10:47:54.289656
2021-02-15T18:49:07
2021-02-15T18:49:07
230,966,729
0
0
null
null
null
null
UTF-8
Java
false
false
589
java
class Spavanac { public static void main(String[] args) { Kattio io = new Kattio(System.in); int hr = io.getInt(); int min = io.getInt(); if (hr >= 1) { if (min >= 45) { min -= 45; } else { min += 60 - 45; hr -= 1; } } else if (hr == 0) { if (min >= 45) { min -= 45; } else { min += 60 - 45; hr = 23; } } io.println(hr + " " + min); io.close(); } }
[ "yapdhao@gmail.com" ]
yapdhao@gmail.com
8d383b48f3e5780c2361f1f3b0b1c9470828b2f7
38d501a8f940c3dd0c8d13a75a3cc391c29637e5
/app/src/main/java/ir/payebash/data/database/AppDatabase.java
0e9410700cf78c89133cbe879e84b0a5ab39bde5
[]
no_license
amirit67/test
34df9cf36d780863275df39783a73eaaa87606ef
4691702c68ddcf269c3ddd08a9eee1060e165456
refs/heads/master
2020-08-06T07:57:54.900422
2020-04-17T20:18:21
2020-04-17T20:18:21
212,898,361
0
0
null
null
null
null
UTF-8
Java
false
false
1,230
java
package ir.payebash.data.database; import android.content.Context; import androidx.room.Database; import androidx.room.Room; import androidx.room.RoomDatabase; import ir.payebash.data.RecentVisits; import ir.payebash.data.User; /** * Created by Alireza Eskandarpour Shoferi on 11/10/2017. */ @Database(entities = {User.class, RecentVisits.class/*, Product.class*/}, version = 3) public abstract class AppDatabase extends RoomDatabase { public abstract UserDao userDao(); public abstract ContactDao contactDao(); public abstract ProductDao productDao(); private static AppDatabase INSTANCE; public static AppDatabase getAppDatabase(Context context) { if (INSTANCE == null) { INSTANCE = Room.databaseBuilder(context.getApplicationContext(), AppDatabase.class, "payebash-database") // allow queries on the main thread. // Don't do this on a real app! See PersistenceBasicSample for an example. .allowMainThreadQueries() .build(); } return INSTANCE; } public static void destroyInstance() { INSTANCE = null; } }
[ "amir.it67@yahoo.com" ]
amir.it67@yahoo.com
a5e0bb740f3c9e438d05835e84fe3d29d731b7f5
93f25305422c52d81252a94ec91d4517782cd12d
/355GroupProject/app/src/main/java/edu/vcu/cmsc/data/UserData.java
03407103cb45ae98a48332edbcddb78012742918
[]
no_license
ngokl/355_group_project
410e166c4e55f5764f0c8cca897d1819d56738ee
51d78cd3a6976e340848cb6640b2703ca4f303b5
refs/heads/master
2020-03-11T06:17:25.114673
2018-04-03T00:13:52
2018-04-03T00:13:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
213
java
package edu.vcu.cmsc.data; import edu.vcu.cmsc.App; public class UserData { public int permissions; public String username; public String firstName; public String lastName; public App.Role role; }
[ "simonbj@vcu.edu" ]
simonbj@vcu.edu
4bb93ba3c319ce70b5ad95537053ca84c0099561
1bc0a83fba25c33f7620d73e999def8ce61bb36e
/src/main/java/com/orangetalents/desafio/dto/veiculo/VeiculoUsuarioDTO.java
450b0097657e265924d3dd7d1bd6a9477b95b3b1
[]
no_license
higonunes/desafio-orange-talents
ee80ecb2632f58fe76ac8bcb334fef342a9e4c2f
010223271adc2f538ed8071290c77f65ad1c7b87
refs/heads/master
2023-06-18T06:29:15.250768
2021-07-17T17:07:40
2021-07-17T17:07:40
376,885,194
0
1
null
null
null
null
UTF-8
Java
false
false
1,094
java
package com.orangetalents.desafio.dto.veiculo; import com.orangetalents.desafio.domain.Veiculo; import com.orangetalents.desafio.service.RodizioService; public class VeiculoUsuarioDTO { private String marca, modelo; private Integer anoModelo; public VeiculoUsuarioDTO(Veiculo veiculo) { this.marca = veiculo.getMarca(); this.modelo = veiculo.getModelo(); this.anoModelo = veiculo.getAnoModelo(); } public String getDiaRodizio() { return RodizioService.nomeDiaRodizio(this.anoModelo); } public boolean isRodizioAtivo() { return RodizioService.isDiaRodizio(this.anoModelo); } public String getMarca() { return marca; } public void setMarca(String marca) { this.marca = marca; } public String getModelo() { return modelo; } public void setModelo(String modelo) { this.modelo = modelo; } public Integer getAnoModelo() { return anoModelo; } public void setAnoModelo(Integer anoModelo) { this.anoModelo = anoModelo; } }
[ "higo.sousaa@gmail.com" ]
higo.sousaa@gmail.com
7abef97b0819447c48d858c9c9d87fa6f8bfcb0e
1241c675989f7f913578581878a65e697561c400
/src/test/java/com/mick/mchat/handlers/avatar/AvatarHandlerTest.java
b402e8119f98e4775dd251f8d1956884039a216c
[]
no_license
mickoallen/mchat
0c7bb21808c9b880c33e69064618a2c66caf1042
a42cd8884f8eab877b8864a0be49dd009f20e81a
refs/heads/master
2023-08-03T16:30:47.424990
2019-09-18T01:40:04
2019-09-18T01:40:04
198,539,151
2
0
null
2023-07-22T11:44:45
2019-07-24T02:00:14
Java
UTF-8
Java
false
false
1,136
java
package com.mick.mchat.handlers.avatar; import com.talanlabs.avatargenerator.AvatarException; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; public class AvatarHandlerTest { private static AvatarHandler avatarHandler; @BeforeAll public static void init() { avatarHandler = new AvatarHandler(); } @Test public void testMaleAvatarGeneration() { String path = "/avatar/12345-male.png"; byte[] avatarFromPath = avatarHandler.getAvatarFromPath(path); assertEquals(13964, avatarFromPath.length); } @Test public void testFemaleAvatarGeneration() { String path = "/avatar/12345-female.png"; byte[] avatarFromPath = avatarHandler.getAvatarFromPath(path); assertEquals(14752, avatarFromPath.length); } @Test public void testInvalidPath() { String path = "avatar/asd-female.png"; assertThrows(AvatarException.class, () -> avatarHandler.getAvatarFromPath(path)); } }
[ "mick@viafoura.com" ]
mick@viafoura.com
036fbffc4e7553b8f6c03861bd4cd5cea381ac91
4aa751a6e9f8b22c7d3c948e9975b625a97e9f9a
/sim/ClockListener.java
3fe64b68d39e823cd2ce90dc2bc534c9cdd5294d
[]
no_license
durgadas311/cosmac-elf
8918625a13324d245de25bdc552d7ecbd971f850
95c2cd01b8616c8dffffb8eba5af06d03821b9ac
refs/heads/master
2023-09-06T05:30:15.868382
2021-10-25T22:51:22
2021-10-25T22:56:04
413,081,515
1
0
null
null
null
null
UTF-8
Java
false
false
134
java
// Copyright (c) 2016 Douglas Miller <durgadas311@gmail.com> public interface ClockListener { void addTicks(int ticks, long clk); }
[ "durgadas311@gmail.com" ]
durgadas311@gmail.com
f4710bf70d9a841444c036b0386a9c255ca63c64
bc794d54ef1311d95d0c479962eb506180873375
/achats/achat-rest/src/main/java/com/teratech/achat/jaxrs/ifaces/comptabilite/AcompteRS.java
a00f0e769b41b00d19281e41a1b3289ccb928a00
[]
no_license
Teratech2018/Teratech
d1abb0f71a797181630d581cf5600c50e40c9663
612f1baf9636034cfa5d33a91e44bbf3a3f0a0cb
refs/heads/master
2021-04-28T05:31:38.081955
2019-04-01T08:35:34
2019-04-01T08:35:34
122,177,253
0
0
null
null
null
null
UTF-8
Java
false
false
362
java
package com.teratech.achat.jaxrs.ifaces.comptabilite; import com.megatimgroup.generic.jax.rs.layer.ifaces.GenericService; import com.teratech.achat.model.comptabilite.Acompte; /** * Interface du service JAX-RS * @since Mon Mar 05 23:39:42 GMT+01:00 2018 * */ public interface AcompteRS extends GenericService<Acompte, Long> { }
[ "bekondo_dieu@yahoo.fr" ]
bekondo_dieu@yahoo.fr
46d4afad908e963b2dc257b46b79a2d07285f7f8
afd3acc5c6251195c5249df48f75757984245518
/app/src/main/java/com/runer/toumai/ui/fragment/PocketFragment.java
e9954be9371cae0b5efe697d922e32a41695c3ae
[ "Apache-2.0" ]
permissive
uscliufei/TouMai-Net
f5373f3af0d205c0d551edba233b0933b3af8bbf
0a521f3aba7ed5e3365c914e5b596f9280e9a7aa
refs/heads/master
2020-04-15T21:19:30.153572
2019-01-10T08:37:45
2019-01-10T08:37:45
165,028,641
0
0
null
null
null
null
UTF-8
Java
false
false
3,955
java
package com.runer.toumai.ui.fragment; import android.content.Context; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.widget.RecyclerView; import android.text.TextUtils; import android.view.View; import android.widget.TextView; import com.chad.library.adapter.base.BaseQuickAdapter; import com.runer.liabary.recyclerviewUtil.ItemDecorations; import com.runer.net.RequestCode; import com.runer.toumai.R; import com.runer.toumai.adapter.PocketAdapter; import com.runer.toumai.adapter.WalletAdapter; import com.runer.toumai.base.BaseLoadMoreFragment; import com.runer.toumai.bean.AccountFlowBean; import com.runer.toumai.dao.AccountListsDao; import com.runer.toumai.dao.AccoutDao; import com.runer.toumai.ui.activity.ProInfoActivity; import com.runer.toumai.util.AppUtil; import java.util.List; /** * Created by szhua on 2017/7/19/019. * github:https://github.com/szhua * TouMaiNetApp * PocketFragment * 我的口袋 */ public class PocketFragment extends BaseLoadMoreFragment<WalletAdapter>{ private View headerView ; private List<AccountFlowBean> datas ; private AccountListsDao accountListsDao ; private AccoutDao accoutDao ; private TextView balanceTv ; @Override public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { headerView =View.inflate(getContext(), R.layout.header_pocket_layout,null); balanceTv = (TextView) headerView.findViewById(R.id.balance); super.onViewCreated(view, savedInstanceState); baseQuickAdapter.addHeaderView(headerView); accountListsDao =new AccountListsDao(getContext(),this); accountListsDao.getAccountList(AppUtil.getUserId(getContext()),"1","0"); accoutDao =new AccoutDao(getContext(),this); accoutDao.getBalance(AppUtil.getUserId(getContext()),"1"); showProgress(true); baseQuickAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() { @Override public void onItemClick(BaseQuickAdapter adapter, View view, int position) { if("0".equals(baseQuickAdapter.getData().get(position).getGoods_id())|| TextUtils.isEmpty(baseQuickAdapter.getData().get(position).getGoods_id())){ }else{ Bundle bundle =new Bundle() ; bundle.putString("id",baseQuickAdapter.getItem(position).getGoods_id()); transUi(ProInfoActivity.class,bundle); } } }); } @Override public WalletAdapter getAdater(){ return new WalletAdapter(datas); } @Override public void onRequestSuccess(int requestCode) { super.onRequestSuccess(requestCode); if(requestCode== RequestCode.LOADMORE){ datas =accountListsDao.getDatas() ; baseQuickAdapter.setNewData(datas); if(datas==null||datas.isEmpty()){ baseQuickAdapter.setHeaderAndEmpty(true); baseQuickAdapter.setEmptyView(getEmptyViewFixedHeight("暂无钱包明细")); } }else if(requestCode==RequestCode.CODE_4){ balanceTv.setText("¥"+accoutDao.getBalance()); } } @Override public RecyclerView.ItemDecoration getDecoration(Context context) { return ItemDecorations.vertical(context) .type(0, R.drawable.decoration_divider_6dp).create(); } @Override public void loadMore() { if(accountListsDao.hasMore()){ accountListsDao.loadMore(); }else{ recyclerView.postDelayed(new Runnable() { @Override public void run() { baseQuickAdapter.loadMoreEnd(); } }, 1000); } } @Override public void refresh() { accountListsDao.refresh(); accoutDao.getBalance(AppUtil.getUserId(getContext()),"1"); } }
[ "liu558@usc.edu" ]
liu558@usc.edu
3395e89e69e9125175fd3be08544c70a19d97930
f0a92681ae4a3b122b952a47e80ab73999e023ce
/app/src/main/java/com/example/pagebook/models/SearchFriends.java
995ddbeaa195a5a261569e01990f20745a42d5ca
[]
no_license
adzeo/pagebook-android
fe2e44d8c8844d6fecf55541668a884f8faa38d9
516f67b9fe4a5750b36ce91ee67899637c9fe99a
refs/heads/main
2023-02-25T01:21:55.062039
2021-02-01T08:22:19
2021-02-01T08:22:19
331,970,732
0
0
null
null
null
null
UTF-8
Java
false
false
407
java
package com.example.pagebook.models; import com.google.gson.annotations.SerializedName; public class SearchFriends{ @SerializedName("imageUrl") private String imageUrl; @SerializedName("name") private String name; @SerializedName("id") private String id; public String getImageUrl(){ return imageUrl; } public String getName(){ return name; } public String getId(){ return id; } }
[ "aditigoyal1504@gmail.com" ]
aditigoyal1504@gmail.com
09028ba02849610c8d9afcf1878ca30fdc2e9d52
c865e9a5238df3c5c90bd29c6bc9755055044fd7
/src/main/java/task/TaskWork.java
03ca7a91f3eb4033576d3095037f9602b9620200
[]
no_license
IceNiro/ProductConsumer
0cf505edaf8d2c5fd89601066600d20a72aacdfa
dbe74df977be1c62be3db340a0c72adc1d87e7d4
refs/heads/master
2020-08-30T02:47:16.598655
2019-10-29T08:32:57
2019-10-29T08:32:57
218,239,123
1
0
null
2019-10-29T08:34:30
2019-10-29T08:31:26
Java
UTF-8
Java
false
false
3,466
java
package task; import com.sun.corba.se.impl.oa.poa.AOMEntry; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.LockSupport; import java.util.concurrent.locks.ReentrantLock; public class TaskWork { private static Lock lock = new ReentrantLock(); private static int queueSize = 256; private static Long writeIndex = 0l; private static Long readIndex = 0l; private static final AtomicInteger sendPeriod = new AtomicInteger(0); private static final AtomicInteger ai = new AtomicInteger(0); private static TaskEvent[] queue = new TaskEvent[queueSize]; private static Long getIndex(Long value) { if (value.intValue() + 1 == queueSize) { return 0l; } return value + 1; } public static void main(String[] args) { //beginWork(); beginWork(); beginWork(); beginWork(); //sendTask(new TaskEvent("" + 1)); sendTask(); sendTask(); final int runtime = 10; ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(1); scheduledExecutorService.schedule(new Runnable() { @Override public void run() { System.out.println(ai.get()); System.out.println(ai.get() / runtime); System.exit(-1); } }, runtime, TimeUnit.SECONDS); } public static void sendTask() { new Thread(new Runnable() { @Override public void run() { while (true) { try { if (queue[(writeIndex = getIndex(writeIndex)).intValue()] != null) { LockSupport.parkNanos(5l); } queue[writeIndex.intValue()] = new TaskEvent(sendPeriod.incrementAndGet()); } catch (Exception e) { e.printStackTrace(); } finally { } } } }).start(); } public static void beginWork() { Thread t = new Thread(new Runnable() { @Override public void run() { while (true) { try { TaskEvent e; e = queue[(readIndex = getIndex(readIndex)).intValue()]; while (e == null) { //System.out.println("sender work lazy, wi :" + writeIndex + "-ri:" + readIndex); LockSupport.parkNanos(5l); e = queue[readIndex.intValue()]; } queue[readIndex.intValue()] = null; ai.set(e.getData()); System.out.println(writeIndex + "-" + readIndex + "-" + (e == null ? "null" : e.getData())); //Thread.sleep(200); } catch (Exception e) { e.printStackTrace(); } finally { } } } }); t.setName("work"); t.start(); } }
[ "ganjiangwei@wdai.com" ]
ganjiangwei@wdai.com
a530ef56ed30d903edf030f18d562f709ed2f57d
026105bb2a5bc64e4c5987a0a5ac0ac2d8baa7bb
/src/main/java/ecplugins/EC_WebAccess/client/RestRequestParameterPanel.java
6bca78d2a4b8ef3c3a914f559c7e4aa3f028bbd7
[ "Apache-2.0" ]
permissive
electric-cloud-community/EC-WebAccess
904c7c4474317559079bc1ecddc64e426f0fa438
bb590c503db25435f72734c6b7dbcf7f8dcf6f11
refs/heads/master
2023-01-10T08:57:05.860308
2020-11-09T17:13:03
2020-11-09T17:13:03
311,410,073
0
0
null
null
null
null
UTF-8
Java
false
false
11,175
java
// RestRequestParameterPanel.java -- // // RestRequestParameterPanel.java is part of ElectricCommander. // // Copyright (c) 2005-2012 Electric Cloud, Inc. // All rights reserved. // package ecplugins.EC_WebAccess.client; import java.util.Collection; import java.util.HashMap; import java.util.Map; import com.google.gwt.core.client.GWT; import com.google.gwt.event.logical.shared.ValueChangeEvent; import com.google.gwt.event.logical.shared.ValueChangeHandler; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiFactory; import com.google.gwt.uibinder.client.UiField; import com.google.gwt.user.client.ui.PasswordTextBox; import com.google.gwt.user.client.ui.TextArea; import com.google.gwt.user.client.ui.TextBox; import com.google.gwt.user.client.ui.Widget; import com.electriccloud.commander.client.domain.ActualParameter; import com.electriccloud.commander.client.domain.FormalParameter; import com.electriccloud.commander.client.util.StringUtil; import com.electriccloud.commander.gwt.client.ComponentBase; import com.electriccloud.commander.gwt.client.ui.FormBuilder; import com.electriccloud.commander.gwt.client.ui.ParameterPanel; import com.electriccloud.commander.gwt.client.ui.ParameterPanelProvider; import com.electriccloud.commander.gwt.client.ui.ValuedListBox; /** * Basic component that is meant to be cloned and then customized to perform a * real function. */ public class RestRequestParameterPanel extends ComponentBase implements ParameterPanel, ParameterPanelProvider { //~ Static fields/initializers --------------------------------------------- // ~ Static fields/initializers---------------------------- private static UiBinder<Widget, RestRequestParameterPanel> s_binder = GWT .create(Binder.class); // These are all the formalParameters on the Procedure static final String BASEURL = "baseUrl"; static final String PATHURL = "pathUrl"; static final String PORT = "port"; static final String CONTENTTYPE = "contentType"; static final String FORMCONTENT = "formContent"; static final String HEADERS = "headers"; static final String USERNAME = "username"; static final String PASSWORD = "password"; static final String REQUESTTYPE = "requestType"; static final String AUTHENTICATION = "authentication"; static final String RESPONSE_OUTPP = "response_outpp"; //~ Instance fields -------------------------------------------------------- // ~ Instance fields // -------------------------------------------------------- @UiField FormBuilder restParameterForm; //~ Methods ---------------------------------------------------------------- /** * This function is called by SDK infrastructure to initialize the UI parts * of this component. * * @return A widget that the infrastructure should place in the UI; usually * a panel. */ @Override public Widget doInit() { Widget base = s_binder.createAndBindUi(this); final ValuedListBox requestType = getUIFactory().createValuedListBox(); // Add items to listbox requestType.addItem("GET", "GET"); requestType.addItem("POST", "POST"); requestType.addItem("PUT", "PUT"); requestType.addItem("DELETE", "DELETE"); final ValuedListBox authentication = getUIFactory() .createValuedListBox(); authentication.addItem("No Authentication", "none"); authentication.addItem("Basic", "basic"); restParameterForm.addRow(true, "URL Base:", "Provide the base URL required for the request.", BASEURL, "", new TextBox()); restParameterForm.addRow(false, "Port:", "Defines the port number at the host.", PORT, "", new TextBox()); restParameterForm.addRow(true, "Path URL:", "Provide the rest of the URL required to perform the HTTP request.", PATHURL, "", new TextBox()); restParameterForm.addRow(false, "Content Type:", "Specifies the nature of the linked resource.", CONTENTTYPE, "", new TextBox()); restParameterForm.addRow(false, "Headers:", "Provide the HTTP header fields required for the request. Remember to write 'Key' whitespace and then 'Value', If more than one header, write each header in separate lines.", HEADERS, "", new TextArea()); restParameterForm.addRow(false, "Content:", "Provide the body required for the request.", FORMCONTENT, "", new TextArea()); restParameterForm.addRow(true, "Authentication:", "Select the type of authentication.", AUTHENTICATION, "none", authentication); restParameterForm.addRow(false, "Username:", "Provide a valid user name.", USERNAME, "", new TextBox()); restParameterForm.addRow(false, "Password:", "Provide the valid password for your user name.", PASSWORD, "", new PasswordTextBox()); restParameterForm.addRow(true, "Request Type:", "Select the request type from the given options.", REQUESTTYPE, "GET", requestType); restParameterForm.addRow(false, "Response (output property path):", "Provide a name to create an Electric Commander property, to store the server's response.", RESPONSE_OUTPP, "", new TextBox()); authentication.addValueChangeHandler(new ValueChangeHandler<String>() { @Override public void onValueChange( ValueChangeEvent<String> event) { updateRowVisibility(); } }); updateRowVisibility(); return base; } /** * Performs validation of user supplied data before submitting the form. * * <p>This function is called after the user hits submit.</p> * * @return true if checks succeed, false otherwise */ @Override public boolean validate() { boolean validationStatus = restParameterForm.validate(); String auth = restParameterForm.getValue(AUTHENTICATION); if ("basic".equals(auth)) { if (StringUtil.isEmpty(restParameterForm.getValue(USERNAME))) { restParameterForm.setErrorMessage(USERNAME, "This Field is required."); validationStatus = false; } if (StringUtil.isEmpty( restParameterForm.getValue(PASSWORD) .trim())) { restParameterForm.setErrorMessage(PASSWORD, "This Field is required."); validationStatus = false; } } return validationStatus; } /** * This method is used by UIBinder to embed FormBuilder's in the UI. * * @return a new FormBuilder. */ @UiFactory FormBuilder createFormBuilder() { return getUIFactory().createFormBuilder(); } private void updateRowVisibility() { String auth = restParameterForm.getValue(AUTHENTICATION); restParameterForm.setRowVisible(USERNAME, "basic".equals(auth)); restParameterForm.setRowVisible(PASSWORD, "basic".equals(auth)); } /** * Straight forward function usually just return this; * * @return straight forward function usually just return this; */ @Override public ParameterPanel getParameterPanel() { return this; } /** * Gets the values of the parameters that should map 1-to-1 to the formal * parameters on the object being called. Transform user input into a map of * parameter names and values. * * <p>This function is called after the user hits submit and validation has * succeeded.</p> * * @return The values of the parameters that should map 1-to-1 to the * formal parameters on the object being called. */ @Override public Map<String, String> getValues() { Map<String, String> actualParams = new HashMap<String, String>(); Map<String, String> searchFormValues = restParameterForm.getValues(); actualParams.put(BASEURL, searchFormValues.get(BASEURL)); actualParams.put(PATHURL, searchFormValues.get(PATHURL)); actualParams.put(PORT, searchFormValues.get(PORT)); actualParams.put(CONTENTTYPE, searchFormValues.get(CONTENTTYPE)); actualParams.put(FORMCONTENT, searchFormValues.get(FORMCONTENT)); actualParams.put(HEADERS, searchFormValues.get(HEADERS)); actualParams.put(USERNAME, searchFormValues.get(USERNAME)); actualParams.put(PASSWORD, searchFormValues.get(PASSWORD)); actualParams.put(REQUESTTYPE, searchFormValues.get(REQUESTTYPE)); actualParams.put(AUTHENTICATION, searchFormValues.get(AUTHENTICATION)); actualParams.put(RESPONSE_OUTPP, searchFormValues.get(RESPONSE_OUTPP)); return actualParams; } /** * Push actual parameters into the panel implementation. * * <p>This is used when editing an existing object to show existing content. * </p> * * @param actualParameters Actual parameters assigned to this list of * parameters. */ @Override public void setActualParameters( Collection<ActualParameter> actualParameters) { // Store actual params into a hash for easy retrieval later if (actualParameters == null) { return; } // First load the parameters into a map. Makes it easier to // update the form by querying for various params randomly. Map<String, String> params = new HashMap<String, String>(); for (ActualParameter p : actualParameters) { params.put(p.getName(), p.getValue()); } // Do the easy form elements first. for (String key : new String[] { BASEURL, PATHURL, PORT, CONTENTTYPE, FORMCONTENT, HEADERS, USERNAME, PASSWORD, REQUESTTYPE, AUTHENTICATION, RESPONSE_OUTPP }) { restParameterForm.setValue(key, StringUtil.nullToEmpty(params.get(key))); } updateRowVisibility(); } /** * Push form parameters into the panel implementation. * * <p>This is used when creating a new object and showing default values. * </p> * * @param formalParameters Formal parameters on the target object. */ @Override public void setFormalParameters( Collection<FormalParameter> formalParameters) { } //~ Inner Interfaces ------------------------------------------------------- interface Binder extends UiBinder<Widget, RestRequestParameterPanel> { } }
[ "justnoxx@gmail.com" ]
justnoxx@gmail.com
5b0556e3c3c180c70dc8cc4aa80a97d5e68ebc0f
bded4532ba99186ec01d223292ce5590a21103ae
/MyBatis-Book/Chapter 4/src/main/java/com/mybatis3/mappers/StudentMapper.java
a46a9e4caac64d8f6c9ca2abcfcad281174be48c
[]
no_license
NemchinovSergey/MyBatis-Studies
001e4174ab3855f5ab114e30e91006cf21a2cf75
c18373151843e7ef3bcb3466354023288f3fcba4
refs/heads/master
2022-06-29T16:12:12.637634
2021-08-24T07:45:39
2021-08-24T07:45:39
101,835,064
0
0
null
2022-06-21T00:14:38
2017-08-30T03:48:14
Java
UTF-8
Java
false
false
2,296
java
package com.mybatis3.mappers; import java.util.List; import java.util.Map; import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.Options; import org.apache.ibatis.annotations.Result; import org.apache.ibatis.annotations.ResultMap; import org.apache.ibatis.annotations.Results; import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Update; import com.mybatis3.domain.Student; /** * @author Siva * */ public interface StudentMapper { @Select("select * from students") @Results({ @Result(id=true, column="stud_id", property="studId"), @Result(column="name", property="name"), @Result(column="email", property="email"), @Result(column="addr_id", property="address.addrId") }) List<Student> findAllStudents(); @Select("select stud_id as studId, name, email, addr_id as 'address.addrId', phone from students") List<Map<String,Object>> findAllStudentsMap(); @Select("select stud_id as studId, name, email, addr_id as 'address.addrId', phone from students where stud_id=#{id}") Student findStudentById(Integer id); @Select("select stud_id as studId, name, email, addr_id as 'address.addrId', phone from students where stud_id=#{id}") Map<String,Object> findStudentMapById(Integer id); @Select("select stud_id, name, email, a.addr_id, street, city, state, zip, country"+ " FROM students s left outer join addresses a on s.addr_id=a.addr_id"+ " where stud_id=#{studId} ") @ResultMap("com.mybatis3.mappers.StudentMapper.StudentWithAddressResult") Student selectStudentWithAddress(int studId); @Insert("insert into students(name,email,addr_id, phone) values(#{name},#{email},#{address.addrId},#{phone})") @Options(useGeneratedKeys=true, keyProperty="studId") void insertStudent(Student student); @Insert("insert into students(name,email,addr_id, phone) values(#{name},#{email},#{address.addrId},#{phone})") @Options(useGeneratedKeys=true, keyProperty="studId") void insertStudentWithMap(Map<String, Object> map); @Update("update students set name=#{name}, email=#{email}, phone=#{phone} where stud_id=#{studId}") void updateStudent(Student student); @Delete("delete from students where stud_id=#{studId}") int deleteStudent(int studId); }
[ "googoodemon@gmail.com" ]
googoodemon@gmail.com
ccd696707de5a0336f428f721a19465140a5658b
8d0ad4bc2b854c5703fc3348ac5d963158241bef
/Excercises/OOP/src/main/java/camera2/AbstractCamera.java
3ba921e3b07e807b02af95679baede4dad274acd
[]
no_license
Eric05/CC_Logbook
982a5e39fb7da5945d7c938d3f9dbc9f1e1c7de8
f9f01ac408f6c841246b1b2dafa65d5076dd7cbd
refs/heads/master
2023-05-07T08:15:58.199282
2021-05-29T07:01:16
2021-05-29T07:01:16
299,659,512
1
0
null
null
null
null
UTF-8
Java
false
false
1,547
java
package camera2; import java.util.ArrayList; import java.util.List; import camera2.Picture.GenericPicture; import camera2.Picture.TakePictureLogic; import lombok.*; @Getter @AllArgsConstructor @NoArgsConstructor public abstract class AbstractCamera { private String model; private int year; private double displaySize; @Setter(AccessLevel.PUBLIC) private boolean hasMemoryCard; @Setter(AccessLevel.PUBLIC) private List<GenericPicture> pictures = new ArrayList<>(); @Setter(AccessLevel.PUBLIC) protected TakePictureLogic takePictureLogic; public abstract GenericPicture executeTakePictureLogic(); public GenericPicture takePicture() { GenericPicture picture = executeTakePictureLogic(); this.addPicture(picture); return picture; } public AbstractCamera(String model, int year, int displaySize, boolean hasMemoryCard) { this.model = model; this.year = year; this.displaySize = displaySize; this.hasMemoryCard = hasMemoryCard; } public void addPicture(GenericPicture pic) { pictures.add(pic); } public List<GenericPicture> getAllPictures() { return pictures; } @Override public String toString() { return "AbstractCamera{" + "model='" + model + '\'' + ", year=" + year + ", displaySize=" + displaySize + ", hasMemoryCard=" + hasMemoryCard + ", pictures=" + pictures + '}'; } }
[ "eboesch@hotmail.com" ]
eboesch@hotmail.com
c42c0e3320b16f0fc2ee689ca70299544151419b
5ec303db84d4a30d5debaf1fc5b3a420fab7494c
/sinotopia-fundamental/sinotopia-fundamental-database-parent/sinotopia-fundamental-mybatis-spring/src/main/java/com/sinotopia/mybatis/spring/service/impl/CountryServiceImpl.java
207fa4a7bf69b1abf123528fbe5c69ae56b0c078
[ "MIT" ]
permissive
sinotopia/sinotopia
f02ace41b7d45638f5226d0a21f45d5d9ab2433a
5a3e3d09db5e71707698f70acd8c2c035611b2da
refs/heads/master
2020-12-30T12:23:07.245134
2017-09-26T16:09:15
2017-09-26T16:09:15
91,426,873
0
0
null
null
null
null
UTF-8
Java
false
false
1,308
java
package com.sinotopia.mybatis.spring.service.impl; import com.sinotopia.mybatis.pagehelper.PageHelper; import com.sinotopia.mybatis.spring.model.Country; import com.sinotopia.mybatis.spring.service.CountryService; import org.springframework.stereotype.Service; import com.sinotopia.mybatis.mapper.entity.Example; import com.sinotopia.mybatis.mapper.util.StringUtil; import java.util.List; /** * @author cacotopia * @since 2015-09-19 17:17 */ @Service("countryService") public class CountryServiceImpl extends BaseService<Country> implements CountryService { @Override public List<Country> selectByCountry(Country country, int page, int rows) { Example example = new Example(Country.class); Example.Criteria criteria = example.createCriteria(); if (StringUtil.isNotEmpty(country.getCountryName())) { criteria.andLike("countryname", "%" + country.getCountryName() + "%"); } if (StringUtil.isNotEmpty(country.getCountryCode())) { criteria.andLike("countrycode", "%" + country.getCountryCode() + "%"); } if (country.getId() != null) { criteria.andEqualTo("id", country.getId()); } //分页查询 PageHelper.startPage(page, rows); return selectByExample(example); } }
[ "sinosie7en@gmail.com" ]
sinosie7en@gmail.com
04185e9abe08d3ac8f9084eb1bdfc596d97ef976
2be54ed6c8eb39a4882652d0773e2fc5d6f9ba0d
/app/src/main/java/com/sustech/se/scoree/audioProcesser/Detector.java
bf4c785086bf1e19fdea8252b0b60fa3feec308e
[]
no_license
EvaFlower/Scoree
692e6d4026a06838dbbd69a55beb9fb9c97d269a
54c8426b29dbd9d063d10c655669820e8905947f
refs/heads/master
2021-01-20T07:40:31.625463
2017-06-01T07:17:25
2017-06-01T07:17:25
88,608,651
0
0
null
2017-04-18T09:44:18
2017-04-18T09:44:18
null
UTF-8
Java
false
false
1,955
java
package com.sustech.se.scoree.audioProcesser; import android.provider.Settings; import android.util.Log; import com.sustech.se.scoree.fftpack.RealDoubleFFT; /** * Created by David GAO on 2017/4/20. */ public class Detector implements DetectorInterface{ private RealDoubleFFT fftTrans; private int blockSize; private double[] freq_vct; private int[] det = new int[3];//This is an int array to record recent average value for comparision. private int loop_cun = 0; private int counter = 0;//This counter is used to count the number of short[] got from listener. public Detector(int blockSize){ this.blockSize = blockSize; fftTrans = new RealDoubleFFT(blockSize); freq_vct = new double[blockSize]; } @Override public double[] detect(short[] audioData){ int ret = audioData.length; if (ret > blockSize) return null; int ave = average(audioData); //average data det[loop_cun % 3] = ave; loop_cun++; //System.out.println("ave is :" + String.valueOf(ave));// print ave if((ave > 1.3 * det[(loop_cun + 1)%3 ]) && (ave > 1.6 * det[loop_cun%3]) && ave >1400){// 至少比上个信号均值强1.5倍,并且比上上个信号均值强1.8倍 if(counter >5){ //与上一个按键至少间隔3个采样周期 for (int i = 0; i < blockSize && i < ret; i++) { freq_vct[i] = (double) audioData[i] / Short.MAX_VALUE; } fftTrans.ft(freq_vct); counter = 0; return freq_vct; } }else counter++; return null; } private int average(short[] d) { long tmp = 0; for (int i = 0; i < d.length; i++) { if (d[i] > 0) { tmp += d[i]; } else { tmp -= d[i]; } } tmp /= d.length; return (int) tmp; } }
[ "liaowd@sustc.edu.cn" ]
liaowd@sustc.edu.cn
10130fcaab00c0e1cbf051bb5b37197ac5bf82e1
61265b9b76d17fd56fca75f09dda2ce681384854
/CarHome_Api/src/main/java/com/autohome/api/service/CarLevelService.java
072a4b7d811166e1c4d221dfc21f6cd0ecfbe13e
[]
no_license
janycode/Car_Home
7e0f1883ff247ff605bf3ae1cef103329b2f78d9
ec61119b86b508301ed38ec050058a94d135cf37
refs/heads/master
2022-11-28T08:20:34.684252
2020-08-15T06:15:06
2020-08-15T06:15:06
284,990,982
0
0
null
2020-08-15T01:12:04
2020-08-04T13:39:46
Java
UTF-8
Java
false
false
410
java
package com.autohome.api.service; import com.autohome.common.vo.R; import com.autohome.entity.MainLevel; /** * @Interface: CarLevelService * @Description: * @Author: Jerry(姜源) * @Create: 2020/08/07 15:00 */ public interface CarLevelService { R addLevel(String name); R delLevel(Integer id); R updateLevel(MainLevel mainLevel); R getAllLevels(); R getLevelById(Integer id); }
[ "1761651740@qq.com" ]
1761651740@qq.com
b66567bed2c4040f145f69891d95e1e02799f9a3
aa9c80409324abb3c9f5bdb024d048c0de9e590d
/src/test/java/com/obsidiandynamics/indigo/TestException.java
a3e778512a48d0a2e1fced37a59103337732440d
[ "BSD-3-Clause", "LicenseRef-scancode-unknown-license-reference" ]
permissive
obsidiandynamics/indigo
510e24437a44ec320568291f03c982eff52e108b
10b4e3a3ff0b4f87b48ab5c27d9729227a4de17d
refs/heads/master
2022-07-27T03:14:17.279658
2022-07-25T02:01:00
2022-07-25T02:01:00
89,676,913
39
7
null
null
null
null
UTF-8
Java
false
false
409
java
package com.obsidiandynamics.indigo; import java.util.function.*; final class TestException extends RuntimeException { static final BiConsumer<ActorSystem, Throwable> BYPASS_DRAIN_HANDLER = (sys, t) -> { if (! (t instanceof TestException)) { sys.addError(t); t.printStackTrace(); } }; private static final long serialVersionUID = 1L; TestException(String m) { super(m); } }
[ "ekoutanov@gmail.com" ]
ekoutanov@gmail.com
fff5d15669dd878a5aa5664ab474178f10770b7d
fa32414cd8cb03a7dc3ef7d85242ee7914a2f45f
/app/src/main/java/android/support/v7/internal/VersionUtils.java
427deba48c346fad02eb6d2b544d55f944811345
[]
no_license
SeniorZhai/Mob
75c594488c4ce815a1f432eb4deacb8e6f697afe
cac498f0b95d7ec6b8da1275b49728578b64ef01
refs/heads/master
2016-08-12T12:49:57.527237
2016-03-10T06:57:09
2016-03-10T06:57:09
53,562,752
4
2
null
null
null
null
UTF-8
Java
false
false
223
java
package android.support.v7.internal; import android.os.Build.VERSION; public class VersionUtils { private VersionUtils() { } public static boolean isAtLeastL() { return VERSION.SDK_INT >= 21; } }
[ "370985116@qq.com" ]
370985116@qq.com
4a1463e90fcec81bf86e9786957b918b866daeaa
11c78b787716f8409bd2ce64a7ea2956bb564bb2
/app/src/test/java/com/example/edittextrecyclerview/ExampleUnitTest.java
af0ed180f0699d443602d5b408cb6385be88ddae
[]
no_license
ritesh6271/DataFetchRecyclerview_Android
6223fab243052283b2b347c2390cba9851792f0f
d07b5a40376afdb4672471dccbbc9d47fce29536
refs/heads/master
2023-01-13T19:22:34.347449
2020-11-12T09:24:01
2020-11-12T09:24:01
312,227,405
0
0
null
null
null
null
UTF-8
Java
false
false
393
java
package com.example.edittextrecyclerview; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } }
[ "riteshyadav839@gmail.com" ]
riteshyadav839@gmail.com
17071dd6c99b164cfc08bf31ec95318cce760d05
41cda7f30cb70197b2e7be9c1cdde5ad02d4de50
/src/main/java/com/pc/abstractfactory/example/listfactory/ListFactory.java
c4809fc73f8001e973821548309cfcf4f7e78ff5
[]
no_license
mishin/DesignPatternStudy
6f1280a00514efe95f0098576f267c4fd7e49dec
27d253c6c9304b8131df258a933945bbadf22931
refs/heads/master
2021-06-17T19:07:59.706496
2017-05-02T14:16:57
2017-05-02T14:16:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
702
java
package com.pc.abstractfactory.example.listfactory; import com.pc.abstractfactory.example.factory.Factory; import com.pc.abstractfactory.example.factory.Link; import com.pc.abstractfactory.example.factory.Page; import com.pc.abstractfactory.example.factory.Tray; /** * Created by Switch on 2017-02-17. */ public class ListFactory extends Factory { @Override public Link createLink(String caption, String url) { return new ListLink(caption, url); } @Override public Tray createTray(String caption) { return new ListTray(caption); } @Override public Page createPage(String title, String author) { return new ListPage(title, author); } }
[ "616645657@qq.com" ]
616645657@qq.com