blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
sequencelengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
131 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
32 values
content
stringlengths
3
9.45M
authors
sequencelengths
1
1
author_id
stringlengths
0
313
0bf96cb8e71f4dbf9e16d437dde9d3464309ae1b
c073aeb740b41b2d60287a5f0754a65cb1465933
/src/main/java/com/rabbit/design/patterns/example/builder/Burger.java
bfe39854a2af0a2d7f0ad8173481a12ff1d0955c
[]
no_license
liufeiit/design-patterns-example
90557d55c5f6d979108f699d0e6da3b934327cf7
855d8f7d70a688fe1798299b0c1e50491e093559
refs/heads/master
2021-06-04T12:53:23.780144
2016-07-12T10:13:05
2016-07-12T10:13:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
214
java
package com.rabbit.design.patterns.example.builder; public abstract class Burger implements Item { @Override public Packing packing() { return new Wrapper(); } @Override public abstract float price(); }
ca2c063a323b8df94bd780246b1201019e1770a7
c2bf0a1c9293c154486bf149bc9ce65d61a55903
/prototypes/trunk/serverdocument/src/ch/iserver/ace/collaboration/jupiter/server/document/GapTextStore.java
6ae2804ef8d25fa3f11320904a7519e7d514bfe2
[]
no_license
kyanha/ace
598eabc829179506307322312e8dde74179adcc1
bd7f1ff9eb1c1e790ceb44eea13321c139e33211
refs/heads/master
2022-12-04T16:58:32.602995
2022-11-26T10:48:58
2022-11-26T10:48:58
202,025,643
0
0
null
2022-11-26T10:48:59
2019-08-12T23:41:17
Java
UTF-8
Java
false
false
5,260
java
package ch.iserver.ace.collaboration.jupiter.server.document; public class GapTextStore implements TextStore { private int highWatermark; private int lowWatermark; private int gapStart = -1; private int gapEnd = -1; private char[] content = new char[0]; public GapTextStore() { this(30, 200); } public GapTextStore(int lowWatermark, int highWatermark) { if (!(lowWatermark < highWatermark)) { throw new IllegalArgumentException("lowWatermark must be smaller than highWatermark"); } this.lowWatermark = lowWatermark; this.highWatermark = highWatermark; } /** * Adjusts the gap so that is at the right offset and capable of handling * the addition of a specified number of characters without having to be * shifted. The <code>sizeHint</code> represents the range that will be * filled afterwards. If the gap is already at the right offset, it must * only be resized if it will be no longer between the low and high * watermark. However, on delete (sizeHint &lt; 0) at the edges of the gap, * the gap is only enlarged. * * @param offset * the offset at which the change happens * @param sizeHint * the number of character which will be inserted */ private void adjustGap(int offset, int sizeHint) { if (offset == gapStart) { int size = (gapEnd - gapStart) - sizeHint; if (lowWatermark <= size && size <= highWatermark) return; } moveAndResizeGap(offset, sizeHint); } /** * Moves the gap to the specified offset and adjust its size to the * anticipated change size. The given size represents the expected range of * the gap that will be filled after the gap has been moved. Thus the gap is * resized to actual size + the specified size and moved to the given * offset. * * @param offset * the offset where the gap is moved to * @param size * the anticipated size of the change */ private void moveAndResizeGap(int offset, int size) { char[] newContent = null; int oldSize = gapEnd - gapStart; int newSize = highWatermark + size; if (newSize < 0) { if (oldSize > 0) { newContent = new char[content.length - oldSize]; System.arraycopy(content, 0, newContent, 0, gapStart); System.arraycopy(content, gapEnd, newContent, gapStart, newContent.length - gapStart); content = newContent; } gapStart = gapEnd = offset; return; } newContent = new char[content.length + (newSize - oldSize)]; int newGapStart = offset; int newGapEnd = newGapStart + newSize; if (oldSize == 0) { System.arraycopy(content, 0, newContent, 0, newGapStart); System.arraycopy(content, newGapStart, newContent, newGapEnd, newContent.length - newGapEnd); } else if (newGapStart < gapStart) { int delta = gapStart - newGapStart; System.arraycopy(content, 0, newContent, 0, newGapStart); System.arraycopy(content, newGapStart, newContent, newGapEnd, delta); System.arraycopy(content, gapEnd, newContent, newGapEnd + delta, content.length - gapEnd); } else { int delta = newGapStart - gapStart; System.arraycopy(content, 0, newContent, 0, gapStart); System.arraycopy(content, gapEnd, newContent, gapStart, delta); System.arraycopy(content, gapEnd + delta, newContent, newGapEnd, newContent.length - newGapEnd); } content = newContent; gapStart = newGapStart; gapEnd = newGapEnd; } /* * @see ch.iserver.ace.text.ITextStore#getText(int, int) */ public String getText(int offset, int length) { int end = offset + length; if (content == null) return ""; //$NON-NLS-1$ if (end <= gapStart) return new String(content, offset, length); if (gapStart < offset) { int gapLength = gapEnd - gapStart; return new String(content, offset + gapLength, length); } StringBuffer buf = new StringBuffer(); buf.append(content, offset, gapStart - offset); buf.append(content, gapEnd, end - gapStart); return buf.toString(); } /* * @see org.eclipse.jface.text.ITextStore#getLength() */ public int getLength() { int length = gapEnd - gapStart; return (content.length - length); } /* * @see org.eclipse.jface.text.ITextStore#replace(int, int, * java.lang.String) */ public void replace(int offset, int length, String text) { int textLength = (text == null ? 0 : text.length()); // handle delete at the edges of the gap if (textLength == 0) { if (offset <= gapStart && offset + length >= gapStart && gapStart > -1 && gapEnd > -1) { length -= gapStart - offset; gapStart = offset; gapEnd += length; return; } } // move gap adjustGap(offset + length, textLength - length); // overwrite int min = Math.min(textLength, length); for (int i = offset, j = 0; i < offset + min; i++, j++) { content[i] = text.charAt(j); } if (length > textLength) { // enlarge the gap gapStart -= (length - textLength); } else if (textLength > length) { // shrink gap gapStart += (textLength - length); for (int i = length; i < textLength; i++) content[offset + i] = text.charAt(i); } } }
[ "sim@cc186578-7ef1-0310-b290-876586ca5d03" ]
sim@cc186578-7ef1-0310-b290-876586ca5d03
4f6df73afb52ce0dc9b2409be385cee577426df3
57e1ab00e7a3729d100879ec0ac08e0f80b831fc
/src/edu/westga/cs6241/babble/Babble.java
655a72fb04156ccf4f68c4343e3cdabbdd6058aa
[]
no_license
marinaushakova/Babble
4a7d011a161b2df627d55918f660907bad9a22b6
c5c450b60af809a5b154b3f65d6b53b70c846e09
refs/heads/master
2020-05-17T05:58:27.986508
2015-05-13T06:50:13
2015-05-13T06:50:13
35,531,877
0
0
null
null
null
null
UTF-8
Java
false
false
355
java
package edu.westga.cs6241.babble; import edu.westga.cs6241.babble.views.*; /** * Main class for starting a Babble game. * @author lewisb * */ public class Babble { public static void main(String[] args) throws Exception { javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { new BabbleGUI().run(); } }); } }
07fe9fb8c4b0fb5646c4af78584804dce018da9d
04a73af8a0255b924e16ac36001d67e42dea576a
/logger/src/main/java/com/gcssloop/logger/Logger.java
c91fadd210c5150209824b1c3ce64b664aa12b80
[ "Apache-2.0" ]
permissive
gejiushishuai/code-library
5490c8875cc05d39408bf8c44ad73fa0f1876fbc
8cf821c4055897720a09705d90b6928d122bb8da
refs/heads/master
2020-12-30T10:24:14.366170
2017-06-29T06:20:57
2017-06-29T06:20:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,204
java
/* * Copyright 2017 GcsSloop * * 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. * * Last modified 2017-06-29 13:58:49 * * GitHub: https://github.com/GcsSloop * WeiBo: http://weibo.com/GcsSloop * WebSite: http://www.gcssloop.com */ package com.gcssloop.logger; import android.support.annotation.NonNull; import android.util.Log; import java.util.ArrayList; import java.util.List; public class Logger { /** * 被屏蔽的TAG */ private static ArrayList<String> mMaskedTag = new ArrayList<>(); private static List<String> mMaskedClass = new ArrayList<>(); /** * 屏蔽当前类 * * @param isBlock 是否屏蔽 */ public static void maskThis(Boolean isBlock) { if (isBlock) { mMaskedClass.add(getClassName(2)); } else { mMaskedClass.remove(getClassName(2)); } } private static String DEFAULT_TAG = ""; private static Config mConfig; private Logger() { } public static Config init() { mConfig = new Config(DEFAULT_TAG); mMaskedTag.clear(); return mConfig; } public static Config init(@NonNull String tag) { mConfig = new Config(tag); mMaskedTag.clear(); return mConfig; } /** * 添加被屏蔽的 tag * * @param tag tag */ public static void addMaskedTag(String tag) { mMaskedTag.add(tag); } /** * 移除被屏蔽的 tag * * @param tag tag */ public static void removeMaskedTag(String tag) { mMaskedTag.remove(tag); } /** * 添加一堆需要屏蔽的 tag * * @param tags tags */ public static void addMaskedTags(List<String> tags) { mMaskedTag.addAll(tags); } /** * 移除一堆需要被屏蔽的 tag * * @param tags tags */ public static void removeMaskedTags(List<String> tags) { mMaskedTag.removeAll(tags); } public static void v(String message) { log(Config.LEVEL_VERBOSE, mConfig.getTag(), message); } public static void d(String message) { log(Config.LEVEL_DEBUG, mConfig.getTag(), message); } public static void i(String message) { log(Config.LEVEL_INFO, mConfig.getTag(), message); } public static void w(String message) { log(Config.LEVEL_WARN, mConfig.getTag(), message); } public static void e(String message) { log(Config.LEVEL_ERROR, mConfig.getTag(), message); } public static void v(String tag, String message) { log(Config.LEVEL_VERBOSE, tag, message); } public static void d(String tag, String message) { log(Config.LEVEL_DEBUG, tag, message); } public static void i(String tag, String message) { log(Config.LEVEL_INFO, tag, message); } public static void w(String tag, String message) { log(Config.LEVEL_WARN, tag, message); } public static void e(String tag, String message) { log(Config.LEVEL_ERROR, tag, message); } private static void log(int level, String tag, String message) { if (mConfig.getLevel() == Config.LEVEL_NONE) { return; } if (mMaskedTag.contains(tag)) { return; } String className = getClassName(3); if (mMaskedClass.contains(className)) { return; } int index = className.indexOf("$"); if (index >= 0) { String simpleName = className.substring(0, index); if (mMaskedClass.contains(simpleName)) { return; } } if (level < mConfig.getLevel()) { return; } switch (level) { case Config.LEVEL_VERBOSE: Log.v(tag, message); break; case Config.LEVEL_DEBUG: Log.d(tag, message); break; case Config.LEVEL_INFO: Log.i(tag, message); break; case Config.LEVEL_WARN: Log.w(tag, message); break; case Config.LEVEL_ERROR: Log.e(tag, message); break; } } /** * 获取类名 * * @param level 层级 * @return 调用者类名 */ private static String getClassName(int level) { StackTraceElement thisMethodStack = (new Exception()).getStackTrace()[level]; String result = thisMethodStack.getClassName(); int lastIndex = result.lastIndexOf("."); result = result.substring(lastIndex + 1, result.length()); return result; } }
955e0be7a45df3f625b813642dbfb2bbde4dc4a9
09bbc11639a3743abd274e0327bdad00ff56e08a
/app/src/main/java/com/tll/smartphonebook/receivers/SmsReceiver.java
9d94f33ad0b71fbcfec457f655408fc1f14c59b6
[]
no_license
tell10glu/SmartPhoneBook
abc05db119d8f190eba8482e0226075fe1dc1212
b0929f89620228bfbb71d3c35ffb021ca1f7e643
refs/heads/master
2021-01-10T02:58:52.539785
2016-01-06T18:12:19
2016-01-06T18:12:19
48,929,856
0
0
null
null
null
null
UTF-8
Java
false
false
1,903
java
package com.tll.smartphonebook.receivers; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.telephony.SmsMessage; import android.util.Log; import android.widget.Toast; import com.tll.smartphonebook.SmartPhoneApplication; import com.tll.smartphonebook.database.DatabaseHelper; import com.tll.smartphonebook.helpers.DateUtils; import com.tll.smartphonebook.models.Message; import java.util.Date; /** * Created by abdullahtellioglu on 29/12/15. */ public class SmsReceiver extends BroadcastReceiver { private static final String SMS_RECEIVED = "android.provider.Telephony.SMS_RECEIVED"; @Override public void onReceive(Context context, Intent intent) { Log.i("girdim","girdim"); if (intent.getAction().equals(SMS_RECEIVED)) { Bundle bundle = intent.getExtras(); if (bundle != null) { Object[] pdus = (Object[]) bundle.get("pdus"); SmsMessage[] messages = new SmsMessage[pdus.length]; for (int i = 0; i < pdus.length; i++) messages[i] = SmsMessage.createFromPdu((byte[]) pdus[i]); for (SmsMessage message : messages) { String msg = message.getMessageBody(); String from = message.getOriginatingAddress(); Toast.makeText(context,"Message"+msg +"num"+from,Toast.LENGTH_LONG).show(); SmartPhoneApplication application = (SmartPhoneApplication)context; try { new DatabaseHelper(context).addMessage(new Message(from,application.getMyPhoneNumber(),msg, DateUtils.getFullDate(new Date()))); }catch (Exception ex){ ex.printStackTrace(); } } } } } }
3249611a94cc291fea65f50c11e829ee63b5f161
f53779036cc49541e7d714d5157e648d5cb4dd02
/minhduc-master/src/main/java/org/itt/minhduc/service/InvoiceService.java
8ed9e12967c65d411f460970d3aa93b25a60f4d3
[]
no_license
haohotxn/SmartOrderBE
6566587d2206b8943ef0d6b7a6e561921bec94eb
af5efe639bb89c677eb388f4129ec608c4f20d81
refs/heads/dev
2021-06-20T17:27:28.889023
2020-12-15T03:30:37
2020-12-15T03:30:37
153,792,657
1
3
null
2018-11-17T10:10:08
2018-10-19T14:07:06
Java
UTF-8
Java
false
false
2,223
java
package org.itt.minhduc.service; import org.itt.minhduc.domain.Invoice; import org.itt.minhduc.repository.InvoiceRepository; import org.itt.minhduc.service.dto.InvoiceDTO; import org.itt.minhduc.service.mapper.InvoiceMapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; import java.util.Optional; /** * Service Implementation for managing Invoice. */ @Service public class InvoiceService { private final Logger log = LoggerFactory.getLogger(InvoiceService.class); private InvoiceRepository invoiceRepository; private InvoiceMapper invoiceMapper; public InvoiceService(InvoiceRepository invoiceRepository, InvoiceMapper invoiceMapper) { this.invoiceRepository = invoiceRepository; this.invoiceMapper = invoiceMapper; } /** * Save a invoice. * * @param invoiceDTO the entity to save * @return the persisted entity */ public InvoiceDTO save(InvoiceDTO invoiceDTO) { log.debug("Request to save Invoice : {}", invoiceDTO); Invoice invoice = invoiceMapper.toEntity(invoiceDTO); invoice = invoiceRepository.save(invoice); return invoiceMapper.toDto(invoice); } /** * Get all the invoices. * * @param pageable the pagination information * @return the list of entities */ public Page<InvoiceDTO> findAll(Pageable pageable) { log.debug("Request to get all Invoices"); return invoiceRepository.findAll(pageable) .map(invoiceMapper::toDto); } /** * Get one invoice by id. * * @param id the id of the entity * @return the entity */ public Optional<InvoiceDTO> findOne(String id) { log.debug("Request to get Invoice : {}", id); return invoiceRepository.findById(id) .map(invoiceMapper::toDto); } /** * Delete the invoice by id. * * @param id the id of the entity */ public void delete(String id) { log.debug("Request to delete Invoice : {}", id); invoiceRepository.deleteById(id); } }
12b4de3b0bace0002cc3e806f62f49a615cef27f
6f447228a4a1ba90d9729a1e46c006d082fad0d0
/src/main/java/dev/ginyai/itemcommand/EnumCommandSource.java
25434ed7ef05ff4fe2a284d42b49e9ce96e8cb3a
[]
no_license
ginyai/ItemCommand
e1d63153d9fa8ffde8df1c6179ae4a3e6c8d2e50
60f1367674f045e503f92dfdf74ed5021f06c0c4
refs/heads/master
2020-06-03T12:23:18.584159
2020-02-24T21:47:22
2020-02-24T21:47:22
191,566,274
0
0
null
null
null
null
UTF-8
Java
false
false
92
java
package dev.ginyai.itemcommand; public enum EnumCommandSource { CONSOLE, PLAYER, }
38964af1aebad731b4b31d8e65999244d9d8842d
e328333ce2a8437423ca3048b298da8b8a40ee64
/src/main/java/com/javalearning/interview/MaxSumSubarray.java
9de38d9344d43068426898709b90149b4d097e92
[]
no_license
pallavibhangre97/MasterInJava
a102d43940276e67fc06bb1f8a7ce36d27ec48d3
1ddeeef6e5beff28479171dc67948471c4500e58
refs/heads/master
2023-07-12T10:36:34.363440
2023-07-03T05:53:58
2023-07-03T05:53:58
271,466,434
0
0
null
2023-07-03T05:57:01
2020-06-11T06:12:12
Java
UTF-8
Java
false
false
1,337
java
/*Refer Maximum Sum Subarray Problem - Kadane's Algorithm from prepbytes channel*/ package com.javalearning.interview; import java.util.*; public class MaxSumSubarray { public static void maxSum(int arr[],int n){ /* time complexity O(n2) int maxSum=0; for(int i=0;i<n;i++){ int sum=0; for(int j=i;j<n;j++){ sum+=arr[j]; if(sum>maxSum) maxSum=sum; } }*/ //below code is of time complexity O(1) int max=arr[0],maxSum=arr[0]; for(int i=1;i<n;i++) { //maxSum=max(arr[i],maxSum+arr[i]) int res=maxSum+arr[i]; if(res>arr[i]) maxSum=res; else maxSum=arr[i]; if(maxSum>max) max=maxSum; } System.out.println(max); } public static void main(String args[]){ Scanner sc=new Scanner(System.in); System.out.println("size of Array:"); int n=sc.nextInt(); int[] arr=new int[n]; System.out.println("Enter Array Elements:"); for(int i=0;i<n;i++){ arr[i]=sc.nextInt(); } maxSum(arr,n); } }
791e82724b8392a6ce793e78cbf0e9e39f26e06a
1d928c3f90d4a0a9a3919a804597aa0a4aab19a3
/java/neo4j/2018/4/ListSnapshot.java
6236bc3120a32445492048c6d958ce73a8d6e250
[]
no_license
rosoareslv/SED99
d8b2ff5811e7f0ffc59be066a5a0349a92cbb845
a062c118f12b93172e31e8ca115ce3f871b64461
refs/heads/main
2023-02-22T21:59:02.703005
2021-01-28T19:40:51
2021-01-28T19:40:51
306,497,459
1
1
null
2020-11-24T20:56:18
2020-10-23T01:18:07
null
UTF-8
Java
false
false
1,525
java
/* * Copyright (c) 2002-2018 "Neo Technology," * Network Engine for Objects in Lund AB [http://neotechnology.com] * * This file is part of Neo4j. * * Neo4j is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package org.neo4j.server.security.auth; import java.util.List; public class ListSnapshot<T> { private final long timestamp; private final List<T> values; private final boolean fromPersisted; public ListSnapshot( long timestamp, List<T> values, boolean fromPersisted ) { this.timestamp = timestamp; this.values = values; this.fromPersisted = fromPersisted; } public long timestamp() { return timestamp; } public List<T> values() { return values; } public boolean fromPersisted() { return fromPersisted; } public static final boolean FROM_PERSISTED = true; public static final boolean FROM_MEMORY = false; }
1a4745262c2ec8d94ae5ffe3561b8d5fd6a637f1
d1d9d9e3aba02d1d1dc581a338a74e030675343a
/app/src/main/java/br/com/bulofarma/bulofarma/VerBulaActivity.java
e03c371fb96200cdabbc0708cd08c46017ad877b
[]
no_license
Draconick/BuloFarma
ae4f0a40407e2512583721c76aa782cc2ab83165
39fa5c7d32c6ee47c2d1e6eaaafc5afd25b8893a
refs/heads/master
2020-04-06T06:22:19.083958
2016-06-09T00:45:53
2016-06-09T00:45:53
55,970,466
0
0
null
null
null
null
UTF-8
Java
false
false
2,010
java
package br.com.bulofarma.bulofarma; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.text.Editable; import android.text.TextWatcher; import android.view.View; import android.widget.AdapterView; import android.widget.EditText; import android.widget.ListView; import java.util.List; import br.com.bulofarma.bulofarma.apresentacao.BulaAdapter; import br.com.bulofarma.bulofarma.dados.RepositorioBula; import br.com.bulofarma.bulofarma.modelo.Bula; /** * Created by Victor Hugo on 11/05/2016. */ public class VerBulaActivity extends Activity { private ListView lista; private List<Bula> bulaList; private RepositorioBula repositorioBula; private Bula bula; private BulaAdapter adapter; private EditText edtProcurar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.ver_bula_activity); repositorioBula = new RepositorioBula(this); lista = (ListView) findViewById(R.id.lista_bula_user); edtProcurar = (EditText) findViewById(R.id.search_leaflet); edtProcurar.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { VerBulaActivity.this.adapter.getFilter().filter(s); adapter.setBulaList(bulaList); } @Override public void afterTextChanged(Editable s) { } }); registerForContextMenu(lista); } @Override protected void onResume() { super.onResume(); carregarBulas(); } public void carregarBulas(){ bulaList = repositorioBula.listar(); adapter = new BulaAdapter(this, bulaList); lista.setAdapter(adapter); } }
fbbbbd0dbba291fa9f93ad1295c938be284ea547
aed0236a359c0a603566cf56ba7dca975eba2311
/dop/group-03/release-3/date-range-manage-category/src/reminder/daterangemanagecategory/br/unb/cic/reminders/ReminderMainActivity.java
deeb4930993c31b0661e1a423a515c3f0d7f406f
[]
no_license
Reminder-App/reminder-tests
e1fde7bbd262e1e6161b979a2a69f9af62cc06d7
8497ac2317f174eb229fb85ae66f1086ce0e0e4d
refs/heads/master
2020-03-21T05:43:08.928315
2018-07-01T20:16:09
2018-07-01T20:16:09
138,175,840
0
0
null
null
null
null
UTF-8
Java
false
false
1,906
java
package reminder.daterangemanagecategory.br.unb.cic.reminders; import android.app.Activity; import android.app.FragmentTransaction; import android.content.Intent; import android.os.Bundle; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import reminder.daterangemanagecategory.br.unb.cic.reminders.view.AddReminderActivity; import reminder.daterangemanagecategory.br.unb.cic.reminders.view.ReminderListFragment; import br.unb.cic.reminders2.R; import reminder.daterangemanagecategory.br.unb.cic.reminders.view.FilterListFragment; /*** added by dManageReminder* modified by dStaticCategory */ public class ReminderMainActivity extends Activity { private static String TAG = "Reminder"; private FragmentTransaction ft; private ReminderListFragment listReminderFragment; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.reminders_main_activity); createUI(); } @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.action_bar_menu, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { switch(item.getItemId()) { case R.id.menu_addReminder : Intent reminderIntent = new Intent(getApplicationContext(), AddReminderActivity.class); startActivity(reminderIntent); return true; default : return super.onOptionsItemSelected(item); } } /*** added by dStaticCategory */ private void createUI() { ft = getFragmentManager().beginTransaction(); listReminderFragment = new ReminderListFragment(); FilterListFragment listCategoryFragment = new FilterListFragment(); listCategoryFragment.addListener(listReminderFragment); ft.add(R.id.listReminders, listReminderFragment); ft.add(R.id.listCategories, listCategoryFragment); ft.commit(); } }
220f8de9f50fdcd930a2206e57608a273c6d8a54
166e7f84ecea44a04f3daa0b852b1bc87b044368
/src/main/java/frc/robot/commands/Turn.java
7b9aed46258c99cd8b2df84965cd436c8c735971
[ "MIT" ]
permissive
Atomic-Automatons/Kitbot-2019
9c3796876553ef1bafe8eb5d4f242415cb56ab6e
e5c74feda27134a34583b3780c35c13429f0b606
refs/heads/master
2020-04-16T06:13:15.352170
2019-02-25T21:52:33
2019-02-25T21:52:33
165,336,980
0
0
MIT
2019-02-25T21:52:34
2019-01-12T02:24:13
Java
UTF-8
Java
false
false
1,296
java
package frc.robot.commands; import edu.wpi.first.wpilibj.command.Command; import frc.robot.subsystems.DriveSystem; import frc.robot.subsystems.NavX; public class Turn extends Command { private double measuredAngle; private double targetAngle; private double speed = 0.5; // 0.55 private double tolerance = 0.1; public Turn(double angle) { this.targetAngle = angle; } @Override protected boolean isFinished() { return Math.abs(measuredAngle - targetAngle) < tolerance; } @Override protected void initialize() { NavX.getInstance().reset(); DriveSystem.getInstance().startAuto(); } @Override protected void execute() { measuredAngle = NavX.getInstance().getDegrees(); DriveSystem.getInstance().arcadeDrive(0, -clamp(speed * (measuredAngle - targetAngle) / measuredAngle)); } protected double clamp(double val) { double abs_val = Math.abs(val); double minSpeed = 0.45; //0.4 if (abs_val < minSpeed) { return minSpeed * Math.signum(val); } else if (abs_val > 0.5) { return 0.5 * Math.signum(val); } return val; } @Override protected void end() { DriveSystem.getInstance().stop(); } }
fe92a903c764acec0b7d4b4551c8f3af6f1252f8
aa935219a2cc2b738dc998386fbdda4c0942e6c5
/app/src/main/java/com/example/testdrivendevelopment/example10/networking/PingServerHttpEndpointSync.java
22233733b9fc5a35d04b7a370219fb7d07ddc62b
[]
no_license
KhinThiriSoe/TestDrivenDevelopment
eb5d421a1022188b5a0a468e88207968e749ab37
71357d498cf8e7e4d8c59fb8a33da5246ffc29a3
refs/heads/main
2023-01-08T14:51:48.144438
2020-11-02T12:04:40
2020-11-02T12:04:40
309,336,451
0
0
null
null
null
null
UTF-8
Java
false
false
264
java
package com.example.testdrivendevelopment.example10.networking; public interface PingServerHttpEndpointSync { enum EndpointResult { SUCCESS, GENERAL_ERROR, NETWORK_ERROR } EndpointResult pingServerSync(); }
b5ce3afd6e1e23426896634bd700ad3b09c252d5
ff0d2a5b8930d2074705c351d494fb1eb46a9d11
/v-care/app/src/main/java/com/example/android/vcare/model/CommonMethods.java
87ad4c36b02570cdd06630c81c4499664addf276
[]
no_license
galahad23/tracking-app
69b17682ff9b83d124ff724fb4e1eee57e8c8dfd
b22c4ee96dd984c2eaaf10e348fb3df62c911b7b
refs/heads/master
2020-04-07T16:43:10.027648
2018-05-02T05:08:39
2018-05-02T05:08:39
158,540,158
0
0
null
null
null
null
UTF-8
Java
false
false
759
java
package com.example.android.vcare.model; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; /** * Created by Mtoag on 10/21/2016. */ public class CommonMethods { private static DateFormat dateFormat = new SimpleDateFormat("d MMM yyyy"); // private static DateFormat timeFormat = new SimpleDateFormat("K:mma"); private static DateFormat timeFormat = new SimpleDateFormat("hh:mm aa"); public static String getCurrentTime() { Date today = Calendar.getInstance().getTime(); return timeFormat.format(today); } public static String getCurrentDate() { Date today = Calendar.getInstance().getTime(); return dateFormat.format(today); } }
0762ac2ea56a8524f08a82fa90ec5a2e861ab728
b34fbcaa9aca9268b702ffc54339c6a7716bb874
/Lesson_11/lesson11/backend/src/main/java/ru/itmo/wp/controller/UserController.java
03213eea696487a98fdf22316f22977c83835eb2
[]
no_license
mk17ru/Web-Course-ITMO
11f5aae67ecdb67aeb3ec1194875caba4fe5e8e5
9d72b561aea9bbb583ae4a294b1f4ee6a2175f1a
refs/heads/main
2023-03-26T20:32:55.959942
2021-03-22T17:44:40
2021-03-22T17:44:40
314,793,781
1
0
null
null
null
null
UTF-8
Java
false
false
1,348
java
package ru.itmo.wp.controller; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.*; import ru.itmo.wp.domain.User; import ru.itmo.wp.exception.ValidationException; import ru.itmo.wp.form.LoginForm; import ru.itmo.wp.form.UserCredentials; import ru.itmo.wp.service.JwtService; import ru.itmo.wp.service.UserService; import javax.validation.Valid; import java.util.List; @RestController public class UserController { private final JwtService jwtService; private final UserService userService; public UserController(JwtService jwtService, UserService userService) { this.jwtService = jwtService; this.userService = userService; } @GetMapping("/api/1/users/auth") public User findUserByJwt(@RequestParam String jwt) { return jwtService.find(jwt); } @GetMapping("/api/1/users") public List<User> findUsers() { return userService.findAll(); } @PostMapping("/api/1/users/register") public void registerUser(@RequestBody @Valid LoginForm userCredentials, BindingResult bindingResult) { if (bindingResult.hasErrors()) { throw new ValidationException(bindingResult); } userService.addUser(userCredentials.getLogin(), userCredentials.getName(), userCredentials.getPassword()); } }
a366bb1017f0cac87a5ed67bd511e8a9cdf204a3
f90a9c9486959a00ac2aa90972b764c645e6ab90
/src/test/java/com/adactin/pom/BookingHotelpage.java
9609a92c9ab53ef47864a9fbbb27607f1d102ae1
[]
no_license
aashiq-crazie/Adactin
33213371b594362dbceddc288832a0399c0a873a
4940178cfeca9ad9b80f2ca1f6a29726aa2fa388
refs/heads/master
2023-04-11T01:25:07.053543
2020-07-04T12:59:50
2020-07-04T12:59:50
271,716,926
0
0
null
null
null
null
UTF-8
Java
false
false
1,969
java
package com.adactin.pom; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.PageFactory; public class BookingHotelpage { public WebDriver driver; // firstname id=first_name // lastName id=last_name // address id=address // cardnumber id=cc_num // cardType id=cc_type // month id=cc_exp_month // expyear id=cc_exp_year // ccvnumber id=cc_cvv // booknow id=book_now @FindBy(id = "first_name") private WebElement firstName; @FindBy(id = "last_name") private WebElement lastName; @FindBy(id = "address") private WebElement address; @FindBy(id = "cc_num") private WebElement cardNumber; @FindBy(id = "cc_type") private WebElement cardType; /* * @FindBy(xpath = "//*[@id=\"cc_type\"]/option[2]") private WebElement * selectCardType; */ @FindBy(id = "cc_exp_month") private WebElement expMonth; /* * @FindBy(xpath = "//*[@id=\"cc_exp_month\"]/option[3]") private WebElement * selectExpMonth; */ @FindBy(id = "cc_exp_year") private WebElement expYear; /* * @FindBy(xpath = "//*[@id=\"cc_exp_year\"]/option[4]") private WebElement * selectExpyear; */ @FindBy(id = "cc_cvv") private WebElement cvvNumber; @FindBy(id = "book_now") private WebElement booknowButton; public BookingHotelpage(WebDriver ldriver) { this.driver = ldriver; PageFactory.initElements(driver, this); } public WebElement getFirstName() { return firstName; } public WebElement getLastName() { return lastName; } public WebElement getAddress() { return address; } public WebElement getCardNumber() { return cardNumber; } public WebElement getCardType() { return cardType; } public WebElement getExpMonth() { return expMonth; } public WebElement getExpYear() { return expYear; } public WebElement getCvvNumber() { return cvvNumber; } public WebElement getBooknowButton() { return booknowButton; } }
827ecd54c860ddc3961fa782e030343d684bf564
87c7af02600c34e7e3e2b094f005d41ba748251b
/client-module/src/main/java/com/uit/mobile/Demo/app/src/main/java/com/example/demo/FragmentMain.java
1d2621a9aa017399c8291733859ffad83d95032e
[]
no_license
AnhPmcl2015/do-an-chuyen-nganh
fc9cc36ced83a64009fb2304d5d1814da7e6c20d
0ae329f506e689f8a1d1e70e66f5c8fe71318f82
refs/heads/master
2023-01-10T10:33:29.392326
2019-08-10T09:14:26
2019-08-10T09:14:26
184,397,646
0
1
null
2023-01-04T15:15:09
2019-05-01T09:56:31
Java
UTF-8
Java
false
false
563
java
package com.example.demo; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; public class FragmentMain extends Fragment{ @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { return inflater.inflate(R.layout.fragment_main, container, false); } }
96dcd168c78f4efd9371629c48d07105df67ac46
9f4410b5d39841bc08f0e86840acd17ce9db6f93
/app/src/main/java/com/qboxus/musictok/Adapters/MyVideos_Adapter.java
23b46bbb5bb93e1880ad5c094d4431152638caeb
[]
no_license
Turbulence-Entertainment/Kinda
5368a9f8a5d0b6fce4c701e011e907bf3d68df78
edffb22257c96b2679d6e0b2064fb391c6eaa093
refs/heads/master
2023-03-23T05:59:21.971178
2021-03-20T09:56:27
2021-03-20T09:56:27
349,684,602
0
0
null
null
null
null
UTF-8
Java
false
false
4,050
java
package com.qboxus.musictok.Adapters; import android.content.Context; import androidx.recyclerview.widget.RecyclerView; import android.net.Uri; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import com.bumptech.glide.Glide; import com.bumptech.glide.RequestBuilder; import com.bumptech.glide.load.engine.DiskCacheStrategy; import com.bumptech.glide.request.RequestOptions; import com.qboxus.musictok.Models.Home_Get_Set; import com.qboxus.musictok.R; import com.qboxus.musictok.Interfaces.Adapter_Click_Listener; import com.qboxus.musictok.SimpleClasses.Functions; import com.qboxus.musictok.SimpleClasses.Variables; import java.util.ArrayList; import static com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions.withCrossFade; /** * Created by AQEEL on 3/20/2018. */ public class MyVideos_Adapter extends RecyclerView.Adapter<MyVideos_Adapter.CustomViewHolder > { public Context context; private ArrayList<Home_Get_Set> dataList; Adapter_Click_Listener adapter_click_listener; public MyVideos_Adapter(Context context, ArrayList<Home_Get_Set> dataList, Adapter_Click_Listener adapter_click_listener) { this.context = context; this.dataList = dataList; this.adapter_click_listener = adapter_click_listener; } @Override public MyVideos_Adapter.CustomViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewtype) { View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_myvideo_layout,null); view.setLayoutParams(new RecyclerView.LayoutParams(RecyclerView.LayoutParams.MATCH_PARENT, RecyclerView.LayoutParams.WRAP_CONTENT)); MyVideos_Adapter.CustomViewHolder viewHolder = new MyVideos_Adapter.CustomViewHolder(view); return viewHolder; } @Override public int getItemCount() { return dataList.size(); } class CustomViewHolder extends RecyclerView.ViewHolder { ImageView thumb_image; TextView view_txt; public CustomViewHolder(View view) { super(view); thumb_image=view.findViewById(R.id.thumb_image); view_txt=view.findViewById(R.id.view_txt); } public void bind(final int position,final Home_Get_Set item, final Adapter_Click_Listener listener) { itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { adapter_click_listener.onItemClick(v,position,item); } }); } } @Override public void onBindViewHolder(final MyVideos_Adapter.CustomViewHolder holder, final int i) { final Home_Get_Set item= dataList.get(i); holder.setIsRecyclable(false); try { if(Variables.is_show_gif) { Glide.with(context) .asGif() .load(item.gif) .skipMemoryCache(true) .thumbnail(new RequestBuilder[]{Glide .with(context) .load(item.thum)}) .apply(RequestOptions.diskCacheStrategyOf(DiskCacheStrategy.NONE) .placeholder(context.getResources().getDrawable(R.drawable.image_placeholder)).centerCrop()) .into(holder.thumb_image); } else { if(item.thum!=null && !item.thum.equals("")) { Uri uri = Uri.parse(item.thum); holder.thumb_image.setImageURI(uri); } } } catch (Exception e){ Log.d(Variables.tag,e.toString()); } holder.view_txt.setText(item.views); holder.view_txt.setText(Functions.GetSuffix(item.views)); holder.bind(i,item,adapter_click_listener); } }
c84cd2020fc13c36636ef34291dbb3b31cfd6692
13eb057462b94eb0974571cd718f6dfc43b9e208
/assignment_3_10_21/src/com/te/question14and15/TestPackage.java
fcff3441364ca42783575f517329b16eecd2e813
[]
no_license
TE-Devharajan-Rangarajan/TE_Chennai_Batch01_DevharajanR_Assignment_3-10-2021
ca8eb69389d931b1ff5d72b583ab7c917c275397
87a99346769ff867e01f6ed0086dbe7d3f45e15d
refs/heads/master
2023-08-21T09:32:13.354493
2021-10-04T05:14:37
2021-10-04T05:14:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
172
java
package com.te.question14and15; public class TestPackage { protected static int a = 5; protected void hello() { System.out.println("Hello from TestPackage"); } }
9c99257c65f8dd38d71434aa79d8ca71698ac18b
e1e78bd2b18f9f7bc826d7188d8de446b82a0efd
/petsitting/src/main/java/pet/controller/JobController.java
32bf92fdb811848b4d9b5a3634a2954df0987ba8
[]
no_license
enmccloud/Java-II-Final-Group-Project-
dfd57ae29816f3d7c3b57eec88813e4b968ae815
cd7338c01aecb37cce479d23ca488fd9c0b96bd3
refs/heads/main
2023-01-30T18:51:32.138778
2020-12-11T23:04:34
2020-12-11T23:04:34
309,382,277
0
11
null
2020-12-11T02:42:10
2020-11-02T13:43:26
HTML
UTF-8
Java
false
false
1,820
java
/*package pet.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import pet.beans.Job; import pet.beans.Sitter; import pet.repository.AddressRepository; import pet.repository.JobRepository; import pet.repository.OwnerRepository; import pet.repository.PetRepository; import pet.repository.SitterRepository; public class JobController { @Autowired JobRepository jobRepo; @Autowired OwnerRepository ownerRepo; @Autowired SitterRepository sitterRepo; @Autowired PetRepository petRepo; @Autowired AddressRepository addressRepo; @RequestMapping(value = "viewJobs") @GetMapping({ "/viewJobs" }) public String viewJobs(Model model) { if (jobRepo.findAll().isEmpty()) { return addNewJob(model); } model.addAttribute("owners", ownerRepo.findAll()); model.addAttribute("sitters", sitterRepo.findAll()); model.addAttribute("jobs", jobRepo.findAll()); return "viewJobs"; } @RequestMapping(value = "insertJob") @GetMapping("/insertJob") public String addNewJob(Model model) { Job job = new Job(); model.addAttribute("newJob", job); return "insertJob"; } @GetMapping("/edit/3/{jobId}") public String showUpdateJob(@PathVariable("jobId") Long id, Model model) { Job job = jobRepo.findById(id).orElse(null); System.out.println("JOB TO EDIT: " + job.toString()); model.addAttribute("newJob", job); return "insertJob"; } @PostMapping("/update/3/{jobId}") public String reviseJob(Job job, Model model) { jobRepo.save(job); return viewJobs(model); } } */
3ef4294d5df8121422c3bb527a440eb43440ab79
91af7f9f6545cfea1f2bdca9c10d7cb027e94d5e
/web2/src/controller/V2_UserLoginServelt.java
95efae667f2538919061e7d79c4b742e2d61d37c
[]
no_license
ruaehd/kte_test
68bf0f52515c5421426df35b37985e3753abbe32
4fc40888e754093f76c8927e25c3d5abe902185b
refs/heads/master
2018-07-07T22:15:31.526757
2018-02-02T00:35:04
2018-02-02T00:35:04
119,024,039
0
0
null
2018-01-30T13:20:50
2018-01-26T08:08:50
JavaScript
UTF-8
Java
false
false
2,940
java
package controller; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.apache.ibatis.session.SqlSession; import session.SqlMapClient; import vo.V2_CustomVO; /** * Servlet implementation class V2_UserLoginServelt */ @WebServlet("/v2_userlogin.do") public class V2_UserLoginServelt extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public V2_UserLoginServelt() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub request.getRequestDispatcher("/WEB-INF/v2_userlogin.jsp").forward(request, response); } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub try { request.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8"); String type = request.getParameter("type"); String id = request.getParameter("id"); String pw = request.getParameter("pw"); V2_CustomVO vo = new V2_CustomVO(); vo.setId(id); vo.setPw(pw); SqlSession sqlsession = SqlMapClient.getSession(); if(Integer.parseInt(type)==1) { V2_CustomVO rvo = sqlsession.selectOne("V2_Custom.selectUserLogin", vo); HttpSession httpsession = request.getSession(); if(rvo != null) { httpsession.setAttribute("_id", rvo.getId()); httpsession.setAttribute("_name", rvo.getName()); httpsession.setAttribute("_grade", rvo.getGrade()); response.sendRedirect("v2_shop.do"); } else { response.sendRedirect("v2_userlogin.do"); } } else if(Integer.parseInt(type)==2) { V2_CustomVO rvo = sqlsession.selectOne("V2_Custom.selectAdminLogin", vo); HttpSession httpsession = request.getSession(); if(rvo != null) { httpsession.setAttribute("_id", rvo.getId()); httpsession.setAttribute("_name", rvo.getName()); httpsession.setAttribute("_grade", rvo.getGrade()); response.sendRedirect("v2_iteminsert1.do"); } else { response.sendRedirect("v2_userlogin.do"); } } } catch(Exception e) { System.out.println(e.getMessage()); } } }
47b763652c21c67419bf4f7c3ec93c19e6bc1162
3fc7c3d4a697c418bad541b2ca0559b9fec03db7
/Decompile/javasource/com/google/android/gms/ads/internal/reward/client/zzc.java
047a41252c2d059b44d273a5f70a075d5acc1890
[]
no_license
songxingzai/APKAnalyserModules
59a6014350341c186b7788366de076b14b8f5a7d
47cf6538bc563e311de3acd3ea0deed8cdede87b
refs/heads/master
2021-12-15T02:43:05.265839
2017-07-19T14:44:59
2017-07-19T14:44:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,122
java
package com.google.android.gms.ads.internal.reward.client; import android.os.Binder; import android.os.IBinder; import android.os.IInterface; import android.os.Parcel; import android.os.RemoteException; import com.google.android.gms.dynamic.zzd; import com.google.android.gms.dynamic.zzd.zza; import com.google.android.gms.internal.zzeh; import com.google.android.gms.internal.zzeh.zza; public abstract interface zzc extends IInterface { public abstract IBinder zza(zzd paramZzd, zzeh paramZzeh, int paramInt) throws RemoteException; public static abstract class zza extends Binder implements zzc { public static zzc zzaa(IBinder paramIBinder) { if (paramIBinder == null) { return null; } IInterface localIInterface = paramIBinder.queryLocalInterface("com.google.android.gms.ads.internal.reward.client.IRewardedVideoAdCreator"); if ((localIInterface != null) && ((localIInterface instanceof zzc))) { return (zzc)localIInterface; } return new zza(paramIBinder); } public boolean onTransact(int paramInt1, Parcel paramParcel1, Parcel paramParcel2, int paramInt2) throws RemoteException { switch (paramInt1) { default: return super.onTransact(paramInt1, paramParcel1, paramParcel2, paramInt2); case 1598968902: paramParcel2.writeString("com.google.android.gms.ads.internal.reward.client.IRewardedVideoAdCreator"); return true; } paramParcel1.enforceInterface("com.google.android.gms.ads.internal.reward.client.IRewardedVideoAdCreator"); paramParcel1 = zza(zzd.zza.zzbk(paramParcel1.readStrongBinder()), zzeh.zza.zzE(paramParcel1.readStrongBinder()), paramParcel1.readInt()); paramParcel2.writeNoException(); paramParcel2.writeStrongBinder(paramParcel1); return true; } private static class zza implements zzc { private IBinder zznI; zza(IBinder paramIBinder) { zznI = paramIBinder; } public IBinder asBinder() { return zznI; } /* Error */ public IBinder zza(zzd paramZzd, zzeh paramZzeh, int paramInt) throws RemoteException { // Byte code: // 0: aconst_null // 1: astore 4 // 3: invokestatic 30 android/os/Parcel:obtain ()Landroid/os/Parcel; // 6: astore 5 // 8: invokestatic 30 android/os/Parcel:obtain ()Landroid/os/Parcel; // 11: astore 6 // 13: aload 5 // 15: ldc 32 // 17: invokevirtual 36 android/os/Parcel:writeInterfaceToken (Ljava/lang/String;)V // 20: aload_1 // 21: ifnull +81 -> 102 // 24: aload_1 // 25: invokeinterface 40 1 0 // 30: astore_1 // 31: aload 5 // 33: aload_1 // 34: invokevirtual 43 android/os/Parcel:writeStrongBinder (Landroid/os/IBinder;)V // 37: aload 4 // 39: astore_1 // 40: aload_2 // 41: ifnull +10 -> 51 // 44: aload_2 // 45: invokeinterface 46 1 0 // 50: astore_1 // 51: aload 5 // 53: aload_1 // 54: invokevirtual 43 android/os/Parcel:writeStrongBinder (Landroid/os/IBinder;)V // 57: aload 5 // 59: iload_3 // 60: invokevirtual 50 android/os/Parcel:writeInt (I)V // 63: aload_0 // 64: getfield 18 com/google/android/gms/ads/internal/reward/client/zzc$zza$zza:zznI Landroid/os/IBinder; // 67: iconst_1 // 68: aload 5 // 70: aload 6 // 72: iconst_0 // 73: invokeinterface 56 5 0 // 78: pop // 79: aload 6 // 81: invokevirtual 59 android/os/Parcel:readException ()V // 84: aload 6 // 86: invokevirtual 62 android/os/Parcel:readStrongBinder ()Landroid/os/IBinder; // 89: astore_1 // 90: aload 6 // 92: invokevirtual 65 android/os/Parcel:recycle ()V // 95: aload 5 // 97: invokevirtual 65 android/os/Parcel:recycle ()V // 100: aload_1 // 101: areturn // 102: aconst_null // 103: astore_1 // 104: goto -73 -> 31 // 107: astore_1 // 108: aload 6 // 110: invokevirtual 65 android/os/Parcel:recycle ()V // 113: aload 5 // 115: invokevirtual 65 android/os/Parcel:recycle ()V // 118: aload_1 // 119: athrow // Local variable table: // start length slot name signature // 0 120 0 this zza // 0 120 1 paramZzd zzd // 0 120 2 paramZzeh zzeh // 0 120 3 paramInt int // 1 37 4 localObject Object // 6 108 5 localParcel1 Parcel // 11 98 6 localParcel2 Parcel // Exception table: // from to target type // 13 20 107 finally // 24 31 107 finally // 31 37 107 finally // 44 51 107 finally // 51 90 107 finally } } } }
23a404d1821aaa0f52f68e03e8db8e2630577361
2027d5c5fee73ef5bb01aaf71914532da15ddbee
/src/java20200729/Exam2.java
4fc4467a4513dd66d358bee0c0dbf6f26547ae3c
[]
no_license
chacha86/gitTest
72601f0be380b3a69c9ce6bc828abd63e2d6c064
b309f68790768fd79b3c1670a533aa144d241f31
refs/heads/master
2022-11-25T04:05:53.244090
2020-08-03T09:05:19
2020-08-03T09:05:19
284,649,210
0
0
null
null
null
null
UTF-8
Java
false
false
586
java
package java20200729; public class Exam2 { public static void main(String[] args) { // 메서드를 올바르게 호출해서 아래처럼 출력되게 해주세요. // 안녕하세요!! // 저는 차태진입니다. // 자바를 통해 // 프로그램을 만들어보아요. } } class TestClass { void hi1() { System.out.println("저는 차태진입니다."); } void hi2() { System.out.println("안녕하세요."); } void hi3() { System.out.println("프로그램을 만들어보아요."); } void hi4() { System.out.println("자바를 통해"); } }
65fb8c39fe6b8d37cc127b86428e8bc4881da33a
2fda0a2f1f5f5d4e7d72ff15a73a4d3e1e93abeb
/proFL-plugin-2.0.3/org/codehaus/groovy/tools/GrapeMain$_run_closure2_closure7_closure8.java
e35035dc5d38624961ccbc66096cb24a3389e1c8
[ "MIT" ]
permissive
ycj123/Research-Project
d1a939d99d62dc4b02d9a8b7ecbf66210cceb345
08296e0075ba0c13204944b1bc1a96a7b8d2f023
refs/heads/main
2023-05-29T11:02:41.099975
2021-06-08T13:33:26
2021-06-08T13:33:26
374,899,147
0
0
null
null
null
null
UTF-8
Java
false
false
5,321
java
// // Decompiled by Procyon v0.5.36 // package org.codehaus.groovy.tools; import org.codehaus.groovy.runtime.callsite.CallSiteArray; import groovy.lang.MetaClass; import org.codehaus.groovy.runtime.callsite.CallSite; import org.codehaus.groovy.runtime.ScriptBytecodeAdapter; import groovy.lang.GroovyObject; import org.codehaus.groovy.runtime.GStringImpl; import java.util.List; import java.lang.ref.SoftReference; import org.codehaus.groovy.reflection.ClassInfo; import groovy.lang.Reference; import org.codehaus.groovy.runtime.GeneratedClosure; import groovy.lang.Closure; class GrapeMain$_run_closure2_closure7_closure8 extends Closure implements GeneratedClosure { private Reference<Object> groupName; private Reference<Object> versionCount; private Reference<Object> moduleCount; private static /* synthetic */ SoftReference $callSiteArray; private static /* synthetic */ Class $class$java$lang$Integer; private static /* synthetic */ Class $class$java$lang$String; public GrapeMain$_run_closure2_closure7_closure8(final Object _outerInstance, final Object _thisObject, final Reference<Object> groupName, final Reference<Object> versionCount, final Reference<Object> moduleCount) { final Reference versionCount2 = new Reference((T)versionCount); final Reference moduleCount2 = new Reference((T)moduleCount); $getCallSiteArray(); super(_outerInstance, _thisObject); this.groupName = groupName; this.versionCount = versionCount2.get(); this.moduleCount = moduleCount2.get(); } public Object doCall(final String moduleName, final List<String> versions) { final String moduleName2 = (String)new Reference(moduleName); final List versions2 = (List)new Reference(versions); final CallSite[] $getCallSiteArray = $getCallSiteArray(); $getCallSiteArray[0].callCurrent(this, new GStringImpl(new Object[] { this.groupName.get(), ((Reference<Object>)moduleName2).get(), ((Reference)versions2).get() }, new String[] { "", " ", " ", "" })); this.moduleCount.get(); this.moduleCount.set($getCallSiteArray[1].call(this.moduleCount.get())); final Object call = $getCallSiteArray[2].call(this.versionCount.get(), $getCallSiteArray[3].call(((Reference)versions2).get())); this.versionCount.set(ScriptBytecodeAdapter.castToType(call, $get$$class$java$lang$Integer())); return call; } public Object call(final String moduleName, final List<String> versions) { final String moduleName2 = (String)new Reference(moduleName); final List versions2 = (List)new Reference(versions); return $getCallSiteArray()[4].callCurrent(this, ((Reference<Object>)moduleName2).get(), ((Reference)versions2).get()); } public String getGroupName() { $getCallSiteArray(); return (String)ScriptBytecodeAdapter.castToType(this.groupName.get(), $get$$class$java$lang$String()); } public Integer getVersionCount() { $getCallSiteArray(); return (Integer)ScriptBytecodeAdapter.castToType(this.versionCount.get(), $get$$class$java$lang$Integer()); } public Integer getModuleCount() { $getCallSiteArray(); return (Integer)ScriptBytecodeAdapter.castToType(this.moduleCount.get(), $get$$class$java$lang$Integer()); } private static /* synthetic */ CallSiteArray $createCallSiteArray() { final String[] names = new String[5]; $createCallSiteArray_1(names); return new CallSiteArray($get$$class$org$codehaus$groovy$tools$GrapeMain$_run_closure2_closure7_closure8(), names); } private static /* synthetic */ CallSite[] $getCallSiteArray() { CallSiteArray $createCallSiteArray; if (GrapeMain$_run_closure2_closure7_closure8.$callSiteArray == null || ($createCallSiteArray = GrapeMain$_run_closure2_closure7_closure8.$callSiteArray.get()) == null) { $createCallSiteArray = $createCallSiteArray(); GrapeMain$_run_closure2_closure7_closure8.$callSiteArray = new SoftReference($createCallSiteArray); } return $createCallSiteArray.array; } private static /* synthetic */ Class $get$$class$java$lang$Integer() { Class $class$java$lang$Integer; if (($class$java$lang$Integer = GrapeMain$_run_closure2_closure7_closure8.$class$java$lang$Integer) == null) { $class$java$lang$Integer = (GrapeMain$_run_closure2_closure7_closure8.$class$java$lang$Integer = class$("java.lang.Integer")); } return $class$java$lang$Integer; } private static /* synthetic */ Class $get$$class$java$lang$String() { Class $class$java$lang$String; if (($class$java$lang$String = GrapeMain$_run_closure2_closure7_closure8.$class$java$lang$String) == null) { $class$java$lang$String = (GrapeMain$_run_closure2_closure7_closure8.$class$java$lang$String = class$("java.lang.String")); } return $class$java$lang$String; } static /* synthetic */ Class class$(final String className) { try { return Class.forName(className); } catch (ClassNotFoundException ex) { throw new NoClassDefFoundError(ex.getMessage()); } } }
d9bbb05053f9b768e9d2ddd0072ef0822d766ef7
2ac943b7a89efcfac41ea776f83d7f8bc311b8a1
/gulimall-seckill/src/main/java/com/atguigu/gulimall/seckill/config/ScheduleConfig.java
f6b1adf5906bfc4e5faab20b2118b8eb6f5ba9c5
[ "Apache-2.0" ]
permissive
chenranh/GuliStore
8306387f1d3c612f7c7ef0607d490f19dc9a7938
11238369f26ac0f2029360ec9bae950531eee678
refs/heads/master
2023-01-02T07:46:30.666626
2020-10-16T07:11:03
2020-10-16T07:11:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
392
java
package com.atguigu.gulimall.seckill.config; import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableScheduling; /** * @title: ScheduleConfig * @Author yuke * @Date: 2020-10-16 14:48 */ @EnableScheduling @EnableAsync @Configuration public class ScheduleConfig { }
1e4107f211d5ac32c941c60a0987fcb75f1e860d
84c3301dd799d1d0e7de58ed50f30719568760e6
/pu/puorder/src/client/nc/ui/pu/m21/view/OrderBillForm.java
6235b98ad63999f84cb932ac7ca89ad288f17c09
[]
no_license
hljlgj/YonyouNC
264d1f38b76fb3c9937603dd48753a9b2666c3ee
fec9955513594a3095be76c4d7f98b0927d721b6
refs/heads/master
2020-06-12T08:25:44.710709
2018-07-04T09:11:33
2018-07-04T09:11:33
null
0
0
null
null
null
null
GB18030
Java
false
false
3,665
java
package nc.ui.pu.m21.view; import nc.ui.ic.batchcode.ref.BatchRefPane; import nc.ui.pu.m21.editor.card.afteredit.body.TotalListener; import nc.ui.pu.pub.util.SupplierFreeCustInfoUtil; import nc.ui.pu.pub.view.PUBillForm; import nc.ui.pub.bill.BillCardPanel; import nc.ui.scmpub.util.BillCardPanelUtils; import nc.vo.pu.m21.entity.OrderHeaderVO; import nc.vo.pu.m21.entity.OrderItemVO; import nc.vo.pu.m21.entity.OrderVO; import nc.vo.pub.lang.UFBoolean; import org.apache.commons.lang.StringUtils; /** * 采购订单卡片 * * @since 6.0 * @version 2011-4-22 下午04:42:04 * @author wuxla */ public class OrderBillForm extends PUBillForm { private static final long serialVersionUID = -5412179538048902934L; @Override public void initUI() { super.initUI(); this.setBatchCodeRef(); this.getBillCardPanel().getBodyPanel().setTotalRowShow(true); // 初始化银行账户参照 SupplierFreeCustInfoUtil custBankUtil = new SupplierFreeCustInfoUtil(); custBankUtil.setBankaccbasname(OrderHeaderVO.PK_BANKDOC); custBankUtil.initCustBankRefPanel(this.getBillCardPanel(), UFBoolean.FALSE.booleanValue()); // this.getBillCardPanel().getBillModel() .addTotalListener(new TotalListener(this.getBillCardPanel())); } @Override public void setValue(Object object) { // 先初始化参照,再将VO设置到界面,再执行其它处理 String freecustid = ""; if (object != null) { freecustid = ((OrderHeaderVO) ((OrderVO) object).getParentVO()).getPk_freecust(); } boolean isFreeCust = StringUtils.isEmpty(freecustid) ? false : true; SupplierFreeCustInfoUtil custBankUtil = new SupplierFreeCustInfoUtil(); custBankUtil.setBankaccbasname(OrderHeaderVO.PK_BANKDOC); custBankUtil.initCustBankRefPanel(this.getBillCardPanel(), isFreeCust); super.setValue(object); custBankUtil.initCustBankValue(this.getBillCardPanel(), isFreeCust); } private void setBatchCodeRef() { BillCardPanel card = this.getBillCardPanel(); // 初始化表体批次参照 BatchRefPane pane = new BatchRefPane(); card.getBodyItem(OrderItemVO.VBATCHCODE).setComponent(pane); } @Override protected void enableFillableItems() { super.enableFillableItems(); // 税率、扣率; // 计划到货日期; // 需求库存组织、收货库存组织、结算财务组织、应付组织; // 项目; // 备注、自定义项 String[] enableItems = new String[] { OrderItemVO.NTAXRATE, OrderItemVO.NNOSUBTAXRATE, OrderItemVO.DPLANARRVDATE, OrderItemVO.PK_REQSTOORG_V, OrderItemVO.PK_ARRVSTOORG_V, OrderItemVO.PK_PSFINANCEORG_V, OrderItemVO.PK_APFINANCEORG_V, OrderItemVO.CPROJECTID, //合并通版补丁NCdp205396511 OrderItemVO.PK_RECVSTORDOC, //无税单价,含税单价支持批改 OrderItemVO.NQTORIGPRICE, OrderItemVO.NQTORIGTAXPRICE, // OrderItemVO.VBMEMO, OrderItemVO.VBDEF1, OrderItemVO.VBDEF2, OrderItemVO.VBDEF3, OrderItemVO.VBDEF4, OrderItemVO.VBDEF5, OrderItemVO.VBDEF6, OrderItemVO.VBDEF7, OrderItemVO.VBDEF8, OrderItemVO.VBDEF9, OrderItemVO.VBDEF10, OrderItemVO.VBDEF11, OrderItemVO.VBDEF12, OrderItemVO.VBDEF13, OrderItemVO.VBDEF14, OrderItemVO.VBDEF15, OrderItemVO.VBDEF16, OrderItemVO.VBDEF17, OrderItemVO.VBDEF18, OrderItemVO.VBDEF19, OrderItemVO.VBDEF20 }; BillCardPanelUtils cardUtils = new BillCardPanelUtils(this.getBillCardPanel()); // 放开字段的批改 cardUtils.enableItemsFill(enableItems); } }
0eab6edd5083f35e96af7aa1eead7dedb1b73cc1
4fb7679120b87273176822ffd3a334e843df04b7
/gallery-parrent/gallery-bl/src/main/java/lt/insoft/gallery/bl/dao/jpa/JpaCriteriaDaoImp.java
03ea8c19757d73d7faf479f86cdfbe40127f6763
[]
no_license
RomasPali/gallery
b1bdcc6b10caad7a88da69f341aff6ccda07ac65
12bee9b22a2500d2ec482194cc70570e675c0a90
refs/heads/master
2023-08-14T05:29:01.645834
2021-09-30T14:52:48
2021-09-30T14:52:48
412,105,909
0
0
null
null
null
null
UTF-8
Java
false
false
1,921
java
package lt.insoft.gallery.bl.dao.jpa; import javax.persistence.EntityManager; import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.Root; import org.springframework.stereotype.Repository; import lt.insoft.gallery.model.InsoftImageEntity; @Repository class JpaCriteriaDaoImp implements JpaCriteriaDao { private final EntityManager em; public JpaCriteriaDaoImp(EntityManager em) { this.em = em; } @Override public SearchResult findBy(String criteria, String category, Integer offset, Integer limit) { SearchResult result = new SearchResult(); CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery<InsoftImageEntity> cq = cb.createQuery(InsoftImageEntity.class); Root<InsoftImageEntity> e = cq.from(InsoftImageEntity.class); CriteriaQuery<Long> cqCout = cb.createQuery(Long.class); Root<InsoftImageEntity> eCount = cqCout.from(InsoftImageEntity.class); if (criteria != null && !category.contentEquals("all")) { cq.select(e).where(cb.equal(e.get(category), criteria)); cqCout.select(cb.count(eCount)).where(cb.equal(eCount.get(category), criteria)); } else if (category.contentEquals("all") && (criteria == null || criteria.isEmpty())) { cq.select(e); cqCout.select(cb.count(eCount)); } else { cq.select(e).where(cb.or(cb.equal(e.get("imageName"), criteria), cb.equal(e.get("category"), criteria))); cqCout.select(cb.count(eCount)).where(cb.or(cb.equal(eCount.get("imageName"), criteria), cb.equal(eCount.get("category"), criteria))); } result.setTotalSize(em.createQuery(cqCout).getSingleResult()); result.setResults(em.createQuery(cq).setFirstResult(offset).setMaxResults(limit).getResultList()); return result; } }
714877e0ebaa92b452c9cfd84c75d400e5218216
e6ce76cf47de00d9b69449d60903ec7e35447309
/mybatis-plus/src/test/java/com/baomidou/mybatisplus/test/pagination/Entity.java
9bc099726713ffa78eeed3d37cefabafc96536af
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
zouanchao/mybatis-plus
2a2ae2272268012d557c67fc5a455de7d04d37c7
ae64b0ac35bbbe7f19b9f701b3d38f3f819f426b
refs/heads/3.0
2021-06-22T15:20:57.084630
2020-12-31T03:55:23
2020-12-31T03:55:23
162,964,754
0
0
Apache-2.0
2020-12-31T03:55:24
2018-12-24T07:45:22
Java
UTF-8
Java
false
false
322
java
package com.baomidou.mybatisplus.test.pagination; import lombok.Data; import java.io.Serializable; /** * @author miemie * @since 2020-06-23 */ @Data public class Entity implements Serializable { private static final long serialVersionUID = 6962439201546719734L; private Long id; private String name; }
57951a6fa3eefa150985f3a4fb42b4eb4a1a1559
ca985c039f43c046ac63e8af20dad2573077c67f
/src/main/java/kostka/moviecatalog/exception/UserNotAllowedToBuyMovieException.java
a612d43b9b62a1e1ca1fbcd93aa91c8c787ed22f
[]
no_license
daweedek2/moviecatalog
4e76413d445889a82c49c44469d17f130cd11837
9872dcf77082ce07872fc261436c071d680a3731
refs/heads/master
2021-07-05T00:25:31.337500
2021-05-28T18:20:06
2021-05-28T18:20:06
243,085,829
1
0
null
2021-05-28T18:21:02
2020-02-25T19:36:20
Java
UTF-8
Java
false
false
262
java
package kostka.moviecatalog.exception; public class UserNotAllowedToBuyMovieException extends RuntimeException { public UserNotAllowedToBuyMovieException(final String message) { super("User is not allowed to buy movie, because " + message); } }
ae095764a3fadd236883a66eb51f24deb70b0b0e
e1630ae5e5f708509ae59bcbb926f5ac400471af
/sdk/src/com/socialize/ui/dialog/BaseDialogFactory.java
15ec4302a6edb4720183afe6d8dbeafba7f33943
[]
no_license
KhalidElSayed/socialize-sdk-android
b8e25cb2ce710aa7b02bfc9ddacb4aa881bc40b7
6df27d732654a87fae85e755cd571d3507a54977
refs/heads/master
2021-01-20T21:49:02.187220
2012-08-27T17:29:15
2012-08-27T17:29:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,216
java
/* * Copyright (c) 2012 Socialize Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package com.socialize.ui.dialog; import android.app.Dialog; import android.content.Context; import android.util.Log; import android.view.Window; import com.socialize.error.SocializeException; import com.socialize.log.SocializeLogger; import com.socialize.util.Drawables; /** * @author Jason Polites * */ public abstract class BaseDialogFactory { protected Drawables drawables; protected SocializeLogger logger; // So we can mock protected Dialog newDialog(Context context) { Dialog dialog = new Dialog(context, android.R.style.Theme_Dialog); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); // Register to prevent window leakage DialogRegistration.register(context, dialog); return dialog; } protected void handleError(String msg, SocializeException error) { if(logger != null) { logger.error(msg, error); } else { Log.e(SocializeLogger.LOG_TAG, error.getMessage(), error); } } public void setLogger(SocializeLogger logger) { this.logger = logger; } public void setDrawables(Drawables drawables) { this.drawables = drawables; } }
8be8f3e93e4e3a3cc84df3244ab092ff6f3f51c7
69ec2ce61fdb31b5f084bfbb13e378734c14c686
/org.osgi.test.cases.component/src/org/osgi/test/cases/component/types/EnumMember.java
568b4cfea6b1e890eb34f625c7d872cb79013266
[ "Apache-2.0" ]
permissive
henrykuijpers/osgi
f23750269f2817cb60e797bbafc29183e1bae272
063c29cb12eadaab59df75dfa967978c8052c4da
refs/heads/main
2023-02-02T08:51:39.266433
2020-12-23T12:57:12
2020-12-23T12:57:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
763
java
/* * Copyright (c) OSGi Alliance (2015). All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * 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.osgi.test.cases.component.types; public @interface EnumMember { TestEnum /**/ single(); TestEnum[] /**/ multiple(); }
fa3343d9522390bb20855faf19dfd717f48f612a
19261a998065c76cb62bcafd2f83fd481faddcb2
/src/main/java/ch/ehi/iox/objpool/impl/LongSerializer.java
f8a238134e2d37bbf8011ada65f15645fd4128a4
[ "MIT" ]
permissive
claeis/iox-ili
a1fdf6bdef1e0a184657e4697fa21d5f56359c89
ed8239302897a1afa97ecca59125c1fb5c9b7503
refs/heads/master
2023-04-30T14:17:18.385533
2023-04-24T12:23:58
2023-04-24T12:23:58
41,913,139
3
12
null
2023-09-12T14:13:28
2015-09-04T11:52:40
Java
UTF-8
Java
false
false
1,956
java
package ch.ehi.iox.objpool.impl; import java.io.IOException; public class LongSerializer implements Serializer<Long> { @Override public byte[] getBytes(Long value) throws IOException { byte[] b=new byte[8]; longToBytes(value,b); return b; } @Override public Long getObject(byte[] bytes) throws IOException, ClassNotFoundException { return bytesToLong(bytes); } public final static long bytesToLong( byte[] b ) { assert b.length >= 8; return ( ( b[0] & 0xFFL ) << 56 ) + ( ( b[1] & 0xFFL ) << 48 ) + ( ( b[2] & 0xFFL ) << 40 ) + ( ( b[3] & 0xFFL ) << 32 ) + ( ( b[4] & 0xFFL ) << 24 ) + ( ( b[5] & 0xFFL ) << 16 ) + ( ( b[6] & 0xFFL ) << 8 ) + ( ( b[7] & 0xFFL ) << 0 ); } public final static void longToBytes( long v, byte[] b ) { assert b.length >= 8; b[0] = (byte) ( ( v >>> 56 ) & 0xFF ); b[1] = (byte) ( ( v >>> 48 ) & 0xFF ); b[2] = (byte) ( ( v >>> 40 ) & 0xFF ); b[3] = (byte) ( ( v >>> 32 ) & 0xFF ); b[4] = (byte) ( ( v >>> 24 ) & 0xFF ); b[5] = (byte) ( ( v >>> 16 ) & 0xFF ); b[6] = (byte) ( ( v >>> 8 ) & 0xFF ); b[7] = (byte) ( ( v >>> 0 ) & 0xFF ); } public final static int bytesToInteger( byte[] b,int offset ) { assert b.length >= offset+4; return ( ( b[offset+0] & 0xFF ) << 24 ) + ( ( b[offset+1] & 0xFF ) << 16 ) + ( ( b[offset+2] & 0xFF ) << 8 ) + ( ( b[offset+3] & 0xFF ) << 0 ); } public final static void integerToBytes( int v, byte[] b,int offset ) { assert b.length >= offset+4; b[0+offset] = (byte) ( ( v >>> 24 ) & 0xFF ); b[1+offset] = (byte) ( ( v >>> 16 ) & 0xFF ); b[2+offset] = (byte) ( ( v >>> 8 ) & 0xFF ); b[3+offset] = (byte) ( ( v >>> 0 ) & 0xFF ); } public final static void doubleToBytes( double value, byte[] b ) { long v = Double.doubleToRawLongBits( (Double) value ); longToBytes(v, b); } public final static double bytesToDouble( byte[] b ) { long v=bytesToLong(b); return Double .longBitsToDouble( v ); } }
1dd15c476fe6c96e7465cc69067be90ca4b5e92b
9a4370da7e8b0702cfab896c2a4b708bd47c0b60
/ADNursing/app/src/main/java/softwaredesign/adnursing/ForumActivity.java
c9870b41aa6c7d134b11893185d0077d6782daac
[]
no_license
lianpx/ADNursing
251c4b3af71a6c93ae2ff60753e6c4c66dda8c68
44e4e63ad75ca4bd69226bea457a6abfbe612844
refs/heads/master
2021-01-19T00:55:04.124838
2016-08-04T05:07:43
2016-08-04T05:07:43
63,422,048
0
3
null
2016-08-04T05:07:43
2016-07-15T12:59:44
HTML
UTF-8
Java
false
false
9,802
java
package softwaredesign.adnursing; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; import android.os.Handler; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.KeyEvent; import android.view.View; import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputMethodManager; import android.widget.Button; import android.widget.EditText; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; import java.io.File; import java.util.ArrayList; import cn.qqtheme.framework.picker.FilePicker; public class ForumActivity extends AppCompatActivity implements View.OnClickListener { private ImageView top_bar_back_icon; private LinearLayout formu_background; private MyListView post_list; private int postId; private String userName; private String imageDir; private String userImage; private PostData postData; private Bitmap postBitmaps[] = new Bitmap[3]; private Bitmap reviewBitmaps[] = new Bitmap[3]; private Bitmap userSculpture; private ArrayList<String> imagePath = new ArrayList<>(); private ImageView main_sculpture; private TextView main_name; private TextView main_title; private TextView main_content; private TextView main_time; private TextView main_type; private TextView main_visitor_num; private ImageView[] imageViews = new ImageView[3]; private ArrayList<ReviewData> reviewDatas = new ArrayList<>(); private EditText review_text_upload_text; private Button review_image_upload_button; private Handler handler = new Handler() { public void handleMessage(android.os.Message msg) { switch (msg.what) { case 0x004: main_name.setText(postData.getUser().getName()); main_title.setText(postData.getTitle()); main_content.setText(postData.getContent()); main_time.setText(postData.getModifiedTime()); main_type.setText(postData.getType()); main_visitor_num.setText(postData.getVisitorNum()+""); break; case 0: imageViews[0].setImageBitmap(postBitmaps[0]); break; case 1: imageViews[1].setImageBitmap(postBitmaps[1]); break; case 2: imageViews[2].setImageBitmap(postBitmaps[2]); break; case 0x005: if (userSculpture != null) { main_sculpture.setImageBitmap(userSculpture); } break; case 0x006: setListView(); review_text_upload_text.setText(""); break; case 0x007: Toast.makeText(ForumActivity.this, "评论发表成功", Toast.LENGTH_SHORT).show(); review_text_upload_text.setText(""); break; } } }; @Override protected void onCreate(Bundle savedInstanceState) { ApplicationManager.getInstance().addActivity(this); super.onCreate(savedInstanceState); setContentView(R.layout.activity_forum); initView(); setPostMain(); setListView(); } private void initView() { top_bar_back_icon = (ImageView) findViewById(R.id.top_bar_back_icon); formu_background = (LinearLayout) findViewById(R.id.formu_background); main_sculpture = (ImageView) findViewById(R.id.main_sculpture); main_name = (TextView) findViewById(R.id.main_name); main_title = (TextView) findViewById(R.id.main_title); main_content = (TextView) findViewById(R.id.main_content); main_time = (TextView) findViewById(R.id.main_time); main_type = (TextView) findViewById(R.id.main_type); main_visitor_num = (TextView) findViewById(R.id.main_visitor_num); imageViews[0] = (ImageView) findViewById(R.id.main_image_1); imageViews[1] = (ImageView) findViewById(R.id.main_image_2); imageViews[2] = (ImageView) findViewById(R.id.main_image_3); review_text_upload_text = (EditText) findViewById(R.id.review_text_upload_text); review_image_upload_button = (Button) findViewById(R.id.review_image_upload_button); post_list = (MyListView) findViewById(R.id.post_list); top_bar_back_icon.setOnClickListener(this); formu_background.setOnClickListener(this); review_image_upload_button.setOnClickListener(this); review_text_upload_text.setOnEditorActionListener(new TextView.OnEditorActionListener() { @Override public boolean onEditorAction(TextView textView, int actionId, KeyEvent keyEvent) { boolean handled = false; switch (actionId) { case EditorInfo.IME_ACTION_DONE: final String content = review_text_upload_text.getText().toString(); final ArrayList<File> file = new ArrayList<File>(); for (int i = 0; i < imagePath.size(); i++) { file.add(new File(imagePath.get(i))); } if (content.equals("")) { return true; } new Thread() { public void run() { int reviewId = HttpUtils.uploadReviewText(HttpApplication.getUserId(), postId, content); if (reviewId != -1) { // Toast.makeText(ForumActivity.this, "评论发表成功", Toast.LENGTH_SHORT).show(); String result = HttpUtils.uploadReviewImage(file, reviewId); System.out.println(result); reviewDatas = HttpUtils.getReciewWithPostIdByGet(postId); handler.sendEmptyMessage(0x006); } else { Toast.makeText(ForumActivity.this, "评论发表失败", Toast.LENGTH_SHORT).show(); } }; }.start(); handled = true; break; } return false; } }); } public void setPostMain() { Intent intent = getIntent(); postId = intent.getIntExtra("postId", -1); userName = intent.getStringExtra("userName"); imageDir = intent.getStringExtra("imageDir"); userImage = intent.getStringExtra("userImage"); requestPost(postId); if (imageDir.equals("")) { ((LinearLayout) findViewById(R.id.main_image_set)).setVisibility(View.GONE); } else { ((LinearLayout) findViewById(R.id.main_image_set)).setVisibility(View.VISIBLE); } } private void requestPost(final int postId) { final int id = postId; final String postImageDir[] = imageDir.split("\\|"); new Thread() { public void run() { userSculpture = HttpUtils.getImageByGet(userImage); handler.sendEmptyMessage(0x005); postData = HttpUtils.getPostWithIdByGet(id); handler.sendEmptyMessage(0x004); for (int i = 0; i < postImageDir.length; i++) { postBitmaps[i] = HttpUtils.getImageByGet(postImageDir[i]); handler.sendEmptyMessage(i); } reviewDatas = HttpUtils.getReciewWithPostIdByGet(postId); handler.sendEmptyMessage(0x006); } }.start(); } @Override public void onClick(View view) { switch (view.getId()) { case R.id.top_bar_back_icon: finish(); break; case R.id.formu_background: InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); inputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), 0); break; case R.id.review_image_upload_button: FilePicker picker = new FilePicker(this, FilePicker.FILE); picker.setShowHideDir(false); picker.setAllowExtensions(new String[]{".png, .jpg, .bmp"}); picker.setOnFilePickListener(new FilePicker.OnFilePickListener() { @Override public void onFilePicked(String currentPath) { if (imagePath.size() >= 3) { Toast.makeText(ForumActivity.this, "最多只能上传三张图片", Toast.LENGTH_SHORT).show(); return; } Toast.makeText(ForumActivity.this, currentPath, Toast.LENGTH_SHORT).show(); imagePath.add(currentPath); review_image_upload_button.setText(String.valueOf(imagePath.size())); } }); picker.show(); break; } } private void setListView() { Context context = this; post_list = (MyListView) findViewById(R.id.post_list); ReviewAdapter reviewAdapter = new ReviewAdapter(context, reviewDatas); post_list.setAdapter(reviewAdapter); } }
34d3c078b04d4be4020ad52f99027c5664d63822
d0fcbb5b547721d83cf1e9e5dc314281951ab80e
/_9_reactive/src/main/java/code/_4_student_effort/TransformingInReactor.java
02828559e545090698bb72d0eb90de75ef9fd96d
[]
no_license
filimonadrian/java-training
94490be3e54da401cef60def9251d4788f45cc0a
3614030dcf2672109d7fa80c84affe368ed95be4
refs/heads/master
2022-11-16T07:20:45.114662
2020-07-18T14:18:33
2020-07-18T14:18:33
255,322,924
0
0
null
2020-04-13T12:40:40
2020-04-13T12:40:40
null
UTF-8
Java
false
false
1,344
java
package code._4_student_effort; import code._2_challenge._4_transformations.User; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public class TransformingInReactor { // Capitalize the user username, firstname and lastname static Mono<User> capitalizeOne(Mono<User> mono) { return mono.map(user -> new User(user.getFirstName().toUpperCase(), user.getLastName().toUpperCase(), user.getUsername().toUpperCase())); } // Capitalize the users username, firstName and lastName static Flux<User> capitalizeMany(Flux<User> flux) { return flux.map(user -> new User(user.getFirstName().toUpperCase(), user.getLastName().toUpperCase(), user.getUsername().toUpperCase())); } // Capitalize the users username, firstName and lastName using #asyncCapitalizeUser static Flux<User> asyncCapitalizeMany(Flux<User> flux) { return flux.flatMap(TransformingInReactor::asyncCapitalizeUser); } static Mono<User> asyncCapitalizeUser(User u) { return Mono.just( new User(u.getFirstName().toUpperCase(), u.getLastName().toUpperCase(), u.getUsername().toUpperCase())); } }
958c3e346f080854d166c1bc9d32d0937e75af82
912d9749f203d717ce53b289308f8dab66395745
/src/com/day1/bootcamp/Q9.java
a99ae6dae3417c7764fd57d950b37a28f896c002
[]
no_license
akhilTTN/coreJava
a832b2c8a6a99b6fb32c5b21f7c316612ec0d6a2
ee190acbc8437f215551a20d548f5dbf171a28f9
refs/heads/master
2021-01-22T19:18:01.675058
2017-03-16T11:36:03
2017-03-16T11:36:03
85,188,229
0
0
null
null
null
null
UTF-8
Java
false
false
758
java
package com.day1.bootcamp; import b.a.F; import b.a.S; import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; /** * Created by akhil on 16/3/17. */ //Write a program to read text file & print the content of file using String Builder. public class Q9 { public static void main(String[] args) { File f=new File("//home//akhil//Desktop//temp.txt"); StringBuilder sb=new StringBuilder(""); try{ Scanner sc=new Scanner(f); if(sc.hasNext()) sb.append(sc.nextLine()); } catch (FileNotFoundException ef){ ef.printStackTrace(); } System.out.println("contents of the file are"); System.out.println(sb); } }
4542e6ce0e3bcd1453f5e0de29ede95a05dbc621
05800e7432adda95c07f13a19642b0230ea83752
/maxkey-core/src/main/java/org/maxkey/constants/ldap/OrganizationalUnit.java
02a94ccbd3656de3506c2084d573bbb9ce83b42e
[ "Zlib", "EPL-1.0", "LZMA-exception", "bzip2-1.0.6", "CPL-1.0", "CDDL-1.0", "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
MaxKeyTop/MaxKey
180517ffa8ce7798c13a9c7cec710e0116107c89
e0b33ac419ec0c7ceec14ffdc86b97dae745efff
refs/heads/master
2023-08-14T13:48:40.742105
2023-01-07T10:39:52
2023-01-07T10:39:52
465,170,514
5
3
Apache-2.0
2022-03-02T05:33:44
2022-03-02T05:33:43
null
UTF-8
Java
false
false
4,047
java
/* * Copyright [2021] [MaxKey of copyright http://www.maxkey.top] * * 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.maxkey.constants.ldap; import java.util.ArrayList; import java.util.Arrays; /** * OrganizationalUnit objectclass attribute * top * @author shimingxy * */ public class OrganizationalUnit { public static ArrayList<String> OBJECTCLASS = new ArrayList<>(Arrays.asList("top", "OrganizationalUnit")); public static String objectClass = "OrganizationalUnit"; public static final String DISTINGUISHEDNAME = "distinguishedname"; /**OrganizationalUnit ou*/ public static final String OU = "ou"; /**OrganizationalUnit userPassword*/ public static final String USERPASSWORD = "userPassword"; /**OrganizationalUnit searchGuide*/ public static final String SEARCHGUIDE = "searchGuide"; /**OrganizationalUnit seeAlso*/ public static final String SEEALSO = "seeAlso"; /**OrganizationalUnit description*/ public static final String DESCRIPTION = "description"; /**OrganizationalUnit businessCategory*/ public static final String BUSINESSCATEGORY = "businessCategory"; /**OrganizationalUnit x121Address*/ public static final String X121ADDRESS = "x121Address"; /**OrganizationalUnit registeredAddress*/ public static final String REGISTEREDADDRESS = "registeredAddress"; /**OrganizationalUnit destinationIndicator*/ public static final String DESTINATIONINDICATOR = "destinationIndicator"; /**OrganizationalUnit preferredDeliveryMethod*/ public static final String PREFERREDDELIVERYMETHOD = "preferredDeliveryMethod"; /**OrganizationalUnit telexNumber*/ public static final String TELEXNUMBER = "telexNumber"; /**OrganizationalUnit teletexTerminalIdentifier*/ public static final String TELETEXTERMINALIDENTIFIER = "teletexTerminalIdentifier"; /**OrganizationalUnit telephoneNumber*/ public static final String TELEPHONENUMBER = "telephoneNumber"; /**OrganizationalUnit internationaliSDNNumber*/ public static final String INTERNATIONALISDNNUMBER = "internationaliSDNNumber"; /**OrganizationalUnit facsimileTelephoneNumber*/ public static final String FACSIMILETELEPHONENUMBER = "facsimileTelephoneNumber"; /**OrganizationalUnit street*/ public static final String STREET = "street"; /**OrganizationalUnit postOfficeBox*/ public static final String POSTOFFICEBOX = "postOfficeBox"; /**OrganizationalUnit postalCode*/ public static final String POSTALCODE = "postalCode"; /**OrganizationalUnit postalAddress*/ public static final String POSTALADDRESS = "postalAddress"; /**OrganizationalUnit physicalDeliveryOfficeName*/ public static final String PHYSICALDELIVERYOFFICENAME = "physicalDeliveryOfficeName"; /**OrganizationalUnit st*/ public static final String ST = "st";//省/州 /**OrganizationalUnit l*/ public static final String L = "l";//县市 public static final String CO = "co"; //中国 public static final String C = "c"; //CN public static final String COUNTRYCODE = "countryCode";//156 public static final String NAME = "name"; //for id public static final String CN = "cn"; }
d1fd724eab3179c8fe67e311a4823a08e4dd355d
71f4e63434743b19450e40ab4f1eee13f26d1eed
/src/main/java/com/wille/data/service/weather/model/ObservationLocation.java
820832981fca7f668d030a58c47e81262f006dbb
[]
no_license
pstephenwille/java.etl
ea128412874d783d164a52f9c80afdc9166d8247
85d38818eb8939fd1491bcf2fe28833257e98096
refs/heads/master
2021-01-23T06:28:50.775062
2015-10-04T21:24:44
2015-10-06T02:44:48
42,456,645
0
0
null
null
null
null
UTF-8
Java
false
false
931
java
package com.wille.data.service.weather.model; /** * Created by JacksonGenerator on 15/09/15. */ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; @Data @JsonIgnoreProperties(ignoreUnknown = true) public class ObservationLocation { @JsonProperty("city") private String city; @JsonProperty("country") private String country; @JsonProperty("country_iso3166") private String countryIso3166; @JsonProperty("elevation") private String elevation; @JsonProperty("full") private String full; @JsonProperty("latitude") private String latitude; @JsonProperty("longitude") private String longitude; @JsonProperty("state") private String state; public String getLongitude() { return longitude; } public String getLatitude() { return latitude; } }
7f0cfc4d6fc6769519d53aef79a12af0dded4558
3a7229f9eef902de767515a4297586128e78c7ed
/app/src/main/java/sairam/com/recipes/IngredientsFragment.java
69a2ef7aaee416e5dd5261a8a5fdda3ddf1bcf4d
[]
no_license
Sairam396/Recipe
f933af1510ee7e9be69c753eaeb02f42861932fc
3bc07de99913687bc72ead46d6885f1068c14d89
refs/heads/master
2021-04-27T09:06:19.551808
2018-02-24T00:09:41
2018-02-24T00:09:41
122,506,600
0
0
null
null
null
null
UTF-8
Java
false
false
211
java
package sairam.com.recipes; public class IngredientsFragment extends CheckBoxesFragment { @Override public String[] getContents(int index) { return Recipe.ingredients[index].split("`"); } }
a6517ff58dea5ae3148d9ce76be2e97b2b57dd8e
e8d11627db2d932562ce5f3cf55a25be44c62736
/exercise25/src/main/java/baseline/PasswordStrengthValueMeaning.java
2e30bedc34a86b24c9891d7eba481622bf63a6cf
[]
no_license
RadoMiami-UCF/guthre-a03
e8f53e483a910b73815c046e376939e61e176d3e
8a10bd94a14952aab54177087f96c1d7df1ac312
refs/heads/main
2023-08-23T03:41:57.330310
2021-10-04T00:36:38
2021-10-04T00:36:38
408,549,421
0
0
null
null
null
null
UTF-8
Java
false
false
464
java
/* * UCF COP3330 Fall 2021 Assignment 3 Solution * Copyright 2021 Kimari Guthre */ package baseline; final class PasswordStrengthValueMeaning { public static final int VERY_WEAK_PASS_NUM = 1; public static final int WEAK_PASS_NUM = 2; public static final int STRONG_PASS_NUM = 3; public static final int VERY_STRONG_PASS_NUM = 4; //0 = unknown, you should be able to figure out the rest private PasswordStrengthValueMeaning() {} }
2013d6011a24a8ee8788907728dbf8d03b75e925
2557489512c5e7c692b0c500cfa9afd3a170769f
/app/src/main/java/org/learn/contentaccessapplication/CalendarActivity.java
649b3f1ba329dfd04fdd5503ff21dbd54d37685d
[]
no_license
prashmittanay/ContentAccessApplication
fd95e109be98709e7dea92ffdad5bceeab644c5d
9b3078c9feb7c8ea2b31a9645410827e7117445d
refs/heads/master
2022-12-27T03:59:31.275833
2020-10-01T06:02:13
2020-10-01T06:02:13
298,798,081
0
0
null
null
null
null
UTF-8
Java
false
false
5,233
java
package org.learn.contentaccessapplication; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; import androidx.loader.app.LoaderManager; import androidx.loader.content.CursorLoader; import androidx.loader.content.Loader; import android.Manifest; import android.content.ContentUris; import android.content.DialogInterface; import android.content.pm.PackageManager; import android.database.Cursor; import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.provider.CalendarContract; import android.widget.ListView; import android.widget.TextView; import android.widget.Toast; import java.util.Calendar; public class CalendarActivity extends AppCompatActivity implements LoaderManager.LoaderCallbacks<Cursor>{ private ListView mListView; private TextView mTextView; public static final int PERMISSIONS_REQUEST_READ_CALENDAR = 1; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_calendar); mTextView = (TextView)findViewById(R.id.emptyElementCalendar); mListView = (ListView) findViewById(R.id.list_calendar_events); mListView.setEmptyView(mTextView); requestCalendarPermission(); } @NonNull @Override public Loader<Cursor> onCreateLoader(int id, @Nullable Bundle args) { Calendar beginTime = Calendar.getInstance(); beginTime.set(Calendar.getInstance().get(Calendar.YEAR), Calendar.getInstance().get(Calendar.MONTH), Calendar.getInstance().get(Calendar.DATE), 0, 0); long startMillis = beginTime.getTimeInMillis(); Calendar endTime = Calendar.getInstance(); endTime.set(Calendar.getInstance().get(Calendar.YEAR), Calendar.getInstance().get(Calendar.MONTH), Calendar.getInstance().get(Calendar.DATE), 23, 59); long endMillis = endTime.getTimeInMillis(); Uri.Builder builder = CalendarContract.Instances.CONTENT_URI.buildUpon(); ContentUris.appendId(builder, startMillis); ContentUris.appendId(builder, endMillis); String selection = CalendarContract.Events.DTSTART + " > ? AND " + CalendarContract.Events.DTEND + " < ?"; String[] selectionArgs = {String.valueOf(startMillis), String.valueOf(endMillis)}; CursorLoader cursorLoader = new CursorLoader(this, CalendarContract.Events.CONTENT_URI, null, selection, selectionArgs, null); return cursorLoader; } @Override public void onLoadFinished(@NonNull Loader<Cursor> loader, Cursor cursor) { cursor.moveToFirst(); CalendarCursorAdapter calendarCursorAdapter = new CalendarCursorAdapter(this, cursor, 0); mListView.setAdapter(calendarCursorAdapter); } @Override public void onLoaderReset(@NonNull Loader<Cursor> loader) { loader = null; } @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); switch (requestCode) { case PERMISSIONS_REQUEST_READ_CALENDAR: if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { getContacts(); } else { Toast.makeText(this, "Contact Permission Disabled!", Toast.LENGTH_SHORT).show(); } return; default: } } public void requestCalendarPermission() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_CALENDAR) != PackageManager.PERMISSION_GRANTED) { if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.READ_CALENDAR)) { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle("Read Calendar Permission"); builder.setPositiveButton(android.R.string.ok, null); builder.setMessage("Please enable access to Calendar"); builder.setOnDismissListener(new DialogInterface.OnDismissListener() { @Override public void onDismiss(DialogInterface dialogInterface) { requestPermissions(new String[]{Manifest.permission.READ_CALENDAR}, PERMISSIONS_REQUEST_READ_CALENDAR); } }); builder.show(); } else { ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_CALENDAR}, PERMISSIONS_REQUEST_READ_CALENDAR); } } else { getContacts(); } } else { getContacts(); } } public void getContacts() { LoaderManager.getInstance(this).initLoader(1, null, this); } }
d17b67f54e23b238547cba4009f84ed47379cb17
c22848965c8c8e3a319d3bd2b2bd873c07e41437
/jdkLearning/src/time/ZoneTest.java
173f4a4644baef23a6d282c7def7ce8a9bf08eb6
[]
no_license
JimmyLee0609/jdkLearning
fd4e041b54a54bb5da388e3cda60b05c5f2a0e99
7685363585775998a2566f90288252a6c480565f
refs/heads/master
2021-05-12T00:41:56.152483
2018-02-24T07:20:35
2018-02-24T07:20:35
117,540,914
0
0
null
null
null
null
GB18030
Java
false
false
6,498
java
package time; import java.time.Duration; import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; import java.time.ZoneOffset; import java.time.format.TextStyle; import java.time.temporal.ChronoField; import java.time.temporal.TemporalAccessor; import java.time.zone.ZoneOffsetTransition; import java.time.zone.ZoneOffsetTransitionRule; import java.time.zone.ZoneRules; import java.time.zone.ZoneRulesProvider; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.NavigableMap; import java.util.Set; public class ZoneTest { @SuppressWarnings("unused") public static void main(String[] args) { // zoneRulesProviderUsage(); // zoneId(); // zoneOffset(); zonerules(); int b = 0; } @SuppressWarnings("unused") private static void zonerules() { List<ZoneOffsetTransition> list = new ArrayList<ZoneOffsetTransition>(); List<ZoneOffsetTransitionRule> listr = new ArrayList<ZoneOffsetTransitionRule>(); // 类方法 // 获取ZoneRules实例的方法 ZoneRules of = ZoneRules.of(ZoneOffset.of("+08:00"));// 根据offset获取rules ZoneRules of2 = ZoneRules.of(ZoneOffset.of("+05:00"), ZoneOffset.of("+06:00"), list, list, listr); // 实例方法 ZoneOffsetTransition nextTransition = of.nextTransition(Instant.now()); ZoneOffsetTransition previousTransition = of.previousTransition(Instant.now()); Duration daylightSavings = of.getDaylightSavings(Instant.now());// 0 ZoneOffset offset = of.getOffset(Instant.now());// +08:00 ZoneOffset offset2 = of.getOffset(LocalDateTime.of(2017, 9, 10, 21, 43, 30));// +08:00 ZoneOffset standardOffset = of.getStandardOffset(Instant.now());// +08:00 ZoneOffsetTransition transition = of.getTransition(LocalDateTime.of(2017, 9, 10, 21, 43, 30)); List<ZoneOffsetTransition> transitions = of.getTransitions(); List<ZoneOffsetTransitionRule> transitionRules = of.getTransitionRules(); List<ZoneOffset> validOffsets = of.getValidOffsets(LocalDateTime.of(2017, 9, 10, 21, 43, 30));// +08:00 boolean daylightSavings2 = of.isDaylightSavings(Instant.now());// false boolean fixedOffset = of.isFixedOffset();// true boolean validOffset = of.isValidOffset(LocalDateTime.of(2017, 9, 10, 21, 43, 30), ZoneOffset.of("+08:00"));// true ZoneOffsetTransition previousTransition2 = of.previousTransition(Instant.now()); String string = of.toString();// ZoneRules[currentStandardOffset=+08:00] } @SuppressWarnings("unused") private static void zoneOffset() { // 获取实例 // 格式需要 - +h, +hh, +hhmm, +hh:mm, +hhmmss, +hh:mm:ss ZoneOffset of3 = ZoneOffset.of("+05:30:43");// 根据标签 id=+05:30:43 ZoneOffset ofHours = ZoneOffset.ofHours(5); // 根据值 id=+05:00 ZoneOffset ofHoursMinutes = ZoneOffset.ofHoursMinutes(13, 50);// id=+13:50 ZoneOffset ofHoursMinutesSeconds = ZoneOffset.ofHoursMinutesSeconds(5, 2, 30); // id=+05:02:30 ZoneOffset ofTotalSeconds = ZoneOffset.ofTotalSeconds(6523); // id=+01:48:43 // 根据一个Offset来创建一个Offset 结果+13:00 ZoneOffset from = ZoneOffset.from(ZoneOffset.ofHours(13)); // ZoneOffset of5 = ZoneOffset.of("GMT+8");// 不符合格式 // 获取可用id Map<String, String> shortIds = ZoneOffset.SHORT_IDS;// 获取简写对应的国家/地区id Set<String> availableZoneIds2 = ZoneOffset.getAvailableZoneIds();// 获取运行环境中可用的ZoneId // 用offset的方法后去ZoneId ZoneId systemDefault2 = ZoneOffset.systemDefault();// 获取系统默认的ZoneId // GMT+08:00 ZoneId of4 = ZoneOffset.of("ACT", shortIds);// 获取指定集合中的指定字符串的映射,根据映射的ID来创建offset ZoneId ofOffset2 = ZoneOffset.ofOffset("GMT", of3);// 将offset和前缀共同构成新的TimeZone // GMT+05:30:43 ZoneId normalized2 = of3.normalized();// 将Offset返回原来的配置 ZoneRules rules2 = of3.getRules();// 获取Offset对应的规则 String id2 = of3.getId();// 获取id String displayName2 = of3.getDisplayName(TextStyle.FULL_STANDALONE, Locale.CHINA);// 获取区域设置的指定格式的名字 int compareTo = of3.compareTo(ofHours);// 两个offset比较 结果就是差值 -1843 int totalSeconds = of3.getTotalSeconds();// 获取偏移量 以秒计算19843 boolean supported = of3.isSupported(ChronoField.AMPM_OF_DAY);// 是否支持某个单位false Instant now = Instant.now(); LocalDateTime now2 = LocalDateTime.now(); // int j = of3.get(ChronoField.HOUR_OF_DAY); // long long1 = of3.getLong(ChronoField.DAY_OF_WEEK); // ValueRange range = of3.range(ChronoField.SECOND_OF_MINUTE); 单位不对 // Temporal adjustInto = of3.adjustInto(now2); Object query = of3.query((TemporalAccessor o) -> { TemporalAccessor b = o;// Offset里面保存的 时间值 +05:30:43与of3一样 return null; }); } @SuppressWarnings("unused") private static void zoneId() { // 静态方法 // 获取可用的ZoneId 标签不一定能用,国家地区的还能用,ETC开头的用不了 Set<String> availableZoneIds = ZoneId.getAvailableZoneIds(); HashMap<String, String> aliasMap = new HashMap<String, String>(); // 根据标签名字获取ZoneId ZoneId of = ZoneId.of("Asia/Aden"); ZoneId of2 = ZoneId.of("GMT+08:00", aliasMap); // 获取系统配置的本地ZoneId ZoneId systemDefault = ZoneId.systemDefault(); // 根据偏移量 新建一个ZoneId ZoneId ofOffset = ZoneId.ofOffset("GMT", ZoneOffset.ofHoursMinutes(3, 10)); // 实例方法 // 获取id String id = of.getId(); // 获取rules ZoneRules rules = of.getRules(); // 将ZoneId返回这个标签的初始设定 ZoneId normalized = of.normalized(); // 根据传入的区域属性和字体风格显示这个标签的名字 String displayName = of.getDisplayName(TextStyle.FULL, Locale.CHINA); } @SuppressWarnings("unused") private static void zoneRulesProviderUsage() { // 获取配置所有可用的ZoneId Set<String> availableZoneIds = ZoneRulesProvider.getAvailableZoneIds(); for (String zoneId : availableZoneIds) { // 根据ZoneId获取rules ZoneRules rules = ZoneRulesProvider.getRules(zoneId, false); // 根据ZoneId获取版本信息 NavigableMap<String, ZoneRules> versions = ZoneRulesProvider.getVersions(zoneId); } } }
5aa53bdef2c2ece7cf93ea7b0d829c583909af25
48297cd618731bdadb991d1c3b5c9e1987d392d9
/PVM/src/Go.java
7cd6576b76e53ba9593c920165f36bcb9073b234
[]
no_license
eddygrandas/javaDarbai
59bdfb077161a7234cd5f5fb7ddf5511fcdf0e0e
6299038425c4bafea3f22a4dfc2fe957446fc372
refs/heads/master
2023-01-08T06:58:18.301107
2019-06-19T14:37:35
2019-06-19T14:37:35
167,589,188
0
0
null
2023-01-07T06:33:12
2019-01-25T17:51:17
Java
UTF-8
Java
false
false
1,753
java
import java.lang.reflect.Array; import java.util.ArrayList; import java.util.Scanner; public class Go { public static void main(String[] args) { //int[] skaiciuMasyvas = new int[9]; Scanner tikrinti = new Scanner(System.in); System.out.println("Iveskite 9 skaitnmenu skaiciu"); int skaicius = tikrinti.nextInt(); System.out.println(skaicius); boolean tikrintiPVMkoda (skaicius) { ArrayList < Integer > sarasas = new ArrayList<Integer>(); do { sarasas.add(0, skaicius % 10); skaicius /= 10; } while (skaicius > 0); int c1, c2, c3, c4, c5, c6, c7, c8, c9; int r1, r2; int a1, a2; c1 = sarasas.get(0); c2 = sarasas.get(1); c3 = sarasas.get(2); c4 = sarasas.get(3); c5 = sarasas.get(4); c6 = sarasas.get(5); c7 = sarasas.get(6); c8 = 1; c9 = sarasas.get(8); //System.out.println(sarasas); a1 = 1 * c1 + 2 * c2 + 3 * c3 + 4 * c4 + 5 * c5 + 6 * c6 + 7 * c7 + 8 * c8; //int a11 = 1 * 2 + 2 * 1 + 3 * 3 + 4 * 1 + 5 * 7 + 6 * 9 + 7 * 4 + 8 * 1; System.out.println(a1); //System.out.println(a11); r1 = a1 % 11; System.out.println(r1); if (r1 != 10) { c9 = r1; //System.out.println(c9); } else { a2 = 3 * c1 + 4 * c2 + 5 * c3 + 6 * c4 + 7 * c5 + 8 * c6 + 9 * c7 + 1 * c8; r2 = a2 % 11; //System.out.println(r2); if (r2 == 10) { c9 = 0; } else { c9 = r2; //System.out.println(c9); } } //System.out.println(c9); } }}
b1a6c9d8eca60befd58916d447fb384b73029863
b60034b516b718687552c0f31cfd6304405e196d
/AndEngine/src/main/java/org/andengine/util/texturepack/TexturePack.java
62f368c8dc1849846e818aa97afc8148f8cec93a
[]
no_license
zinkdaga/TOSCommunicator
364fb369ab6b49b913e65a27ea1b6f360896c19f
fba774af8ab94b9fad3d2264a73c16bfe6d1fabe
refs/heads/master
2021-01-10T01:47:43.319734
2015-12-21T20:12:18
2015-12-21T20:12:18
48,388,993
0
1
null
null
null
null
UTF-8
Java
false
false
2,065
java
package org.andengine.util.texturepack; import org.andengine.opengl.texture.ITexture; /** * (c) Zynga 2011 * * @author Nicolas Gramlich <[email protected]> * @since 23:23:47 - 30.07.2011 */ public class TexturePack { // =========================================================== // Constants // =========================================================== // =========================================================== // Fields // =========================================================== private final ITexture mTexture; private final TexturePackTextureRegionLibrary mTexturePackTextureRegionLibrary; // =========================================================== // Constructors // =========================================================== public TexturePack(final ITexture pTexture, final TexturePackTextureRegionLibrary pTexturePackTextureRegionLibrary) { this.mTexture = pTexture; this.mTexturePackTextureRegionLibrary = pTexturePackTextureRegionLibrary; } // =========================================================== // Getter & Setter // =========================================================== public ITexture getTexture() { return this.mTexture; } public TexturePackTextureRegionLibrary getTexturePackTextureRegionLibrary() { return this.mTexturePackTextureRegionLibrary; } // =========================================================== // Methods for/from SuperClass/Interfaces // =========================================================== public void loadTexture() { this.mTexture.load(); } public void unloadTexture() { this.mTexture.unload(); } // =========================================================== // Methods // =========================================================== // =========================================================== // Inner and Anonymous Classes // =========================================================== }
138a779bbb049b8636935ae56957642bcb867673
c3cd782ba5f9057bc27b679277083a6cfd228622
/gen/main/java/uif/domain/Da_def_create_obtener_lista_distr_initiateDomain.java
bf4703b3845d1c5ac748e1ee746561a1eabada38
[]
no_license
BCTS/gta
dcdf6bb4e112d20aca77656ba07017b659913ae1
4567e1187c00484cf1494d2084e95970fe743cd0
refs/heads/master
2020-05-21T01:02:22.113194
2013-10-23T19:57:35
2013-10-23T19:57:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
809
java
package uif.domain; import com.emc.xcp.services.task.annotation.ProcessVariables; import org.codehaus.jackson.annotate.JsonPropertyOrder; import uif.domain.Da_def_create_obtener_lista_distr_initiateProcessVariables; @JsonPropertyOrder(alphabetic = true) public class Da_def_create_obtener_lista_distr_initiateDomain extends com.emc.xcp.services.process.domain.InitiateProcessBaseDomain { @ProcessVariables private Da_def_create_obtener_lista_distr_initiateProcessVariables processVariables; public Da_def_create_obtener_lista_distr_initiateProcessVariables getProcessVariables(){ return processVariables; } public void setProcessVariables(Da_def_create_obtener_lista_distr_initiateProcessVariables processVariables){ this.processVariables = processVariables; } }
5d39ccbceb85b9e16d856bc69b9fe4d3d88a3ffa
9a7f624bb1953a578003db1a78e8acaf02fd58bd
/src/test/java/geco/LoginGeneratorTest.java
b6991f61f8fdb16bcb44b8a2e93a402e8072ebb1
[]
no_license
saralamhaourak/login-generator
f6b41f737fcd0cbc20d102107a76a4ad63f2508d
1a0730945bf30e8bc817f0a73841247d827a165b
refs/heads/master
2020-04-08T13:16:00.194291
2018-11-28T15:47:34
2018-11-28T15:47:34
158,362,116
0
0
null
2018-11-20T11:13:53
2018-11-20T09:17:09
Java
UTF-8
Java
false
false
1,074
java
package geco; import org.junit.Before; import org.junit.Test; import static org.junit.Assert.*; public class LoginGeneratorTest { LoginService log1,log2; LoginGenerator lg1,lg2; @Before public void setUp() { log1 = new LoginService(new String[] {"JROL","BPER","CGUR","JDU","JRAL","JRAL1"}); log2 = new LoginService(new String[] {}); lg1 = new LoginGenerator(log1); lg2 = new LoginGenerator(log2); } @Test public void cT1() { assertEquals(lg1.generateLoginForNomAndPrenom("Durant","Paul"),"PDUR"); } @Test public void ct() { assertEquals(lg1.generateLoginForNomAndPrenom("Ralling","John"),"JRAL2"); } @Test public void ct2() { assertEquals(lg1.generateLoginForNomAndPrenom("Rolling","Jean"),"JROL1"); } @Test public void ct3() { assertEquals(lg1.generateLoginForNomAndPrenom("Dùrand","Paul"),"PDUR"); } @Test public void ctx() { assertEquals(lg1.generateLoginForNomAndPrenom("Du","Paul"),"PDU"); } }
5760d655ba852253d5a1bf2de5419eae057beae9
37b97af2347fe93c92d02c4e671f0c8ae66e4ef1
/internationalization/src/main/java/com/pmagnaghi/InternationalizationApplication.java
56989119c64345127a73020d36887a21ef0040ed
[]
no_license
pablomagnaghi/spring-boot
9fc0075ee1a91309932a932018176ed94157c8b7
f5faa405af28b17571e817c043803867083412a0
refs/heads/master
2021-01-20T05:00:47.808700
2017-09-08T17:39:03
2017-09-08T17:39:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
333
java
package com.pmagnaghi; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class InternationalizationApplication { public static void main(String[] args) { SpringApplication.run(InternationalizationApplication.class, args); } }
122edca403a9c004b78ef402de0f951861cb6969
05efcd86c79253211708b4f8b80a8fa22b14c644
/ManejoExcepciones1/src/excepciones/OperacionExcepcion.java
81bfff469da6499f3a67821bc5d04cc588d55463
[]
no_license
EduardoGuerraSanchez/Curso-Java
8fc00f587deeea402fd19dd3a687bdb2e48121cc
a1814c90730689e1d6d4cf9829382207083ad062
refs/heads/master
2022-12-05T23:29:28.514944
2020-08-21T21:42:32
2020-08-21T21:42:32
288,213,751
0
0
null
null
null
null
UTF-8
Java
false
false
270
java
package excepciones; public class OperacionExcepcion extends RuntimeException {//Para que extienda de Exception / RuntimeException //Nuestra propia clase de excepcion public OperacionExcepcion(String mensaje){ super(mensaje);//De la clase padre } }
94d36304e44f8b021358276efdd71fd73a1b3d90
81b4f9f6250cee9d3a8dd2e4049eb38cfe8640df
/face-plus/src/main/java/demo/face/plus/faceplus/repository/UserFaceInfoRepository.java
b026f94b0ed34dea1c4af1282ef56ed8cb1e8ac9
[]
no_license
909446172/test
973a526b772833ea78fa52f6407545ffad67def7
4cacdbe690259b04ab8ee42e029e183511f8555c
refs/heads/master
2022-12-29T02:30:36.999881
2019-09-25T05:41:07
2019-09-25T05:41:07
204,091,120
0
0
null
2022-12-10T05:46:21
2019-08-24T01:09:18
Java
UTF-8
Java
false
false
778
java
package demo.face.plus.faceplus.repository; import com.mongodb.client.result.UpdateResult; import demo.face.plus.faceplus.entity.FaceInfo; import demo.face.plus.faceplus.entity.Location; import demo.face.plus.faceplus.entity.UserFaceInfo; import java.util.List; /** * @Author zyy * @Date 2019/9/24 16:02 * @Version 1.0 */ public interface UserFaceInfoRepository { UserFaceInfo findUserFaceInfoById(String id); UpdateResult updateFacesetInfoById(String id, String facesetInfoId); UpdateResult addFaceInfo(String id, List<FaceInfo> faceInfoList); UserFaceInfo insertUserFaceInfo(UserFaceInfo userFaceInfo); boolean updateLocation(UserFaceInfo userFaceInfo); List<UserFaceInfo> findGeoByLocationAndExtent(Location location , double extent); }
7f94003da175d641d5931321b2409a32a09c3983
4c506f0d4f8da52c0f24e92234ca5a6869e5f1cf
/src/main/java/pl/szotaa/spotifyfetcher/dto/RefreshTokenResponse.java
5d57a01550beb45b042c0e1fcd0809a351a53560
[ "MIT" ]
permissive
szotaa/spotify-fetcher
2f15e8be9841a1335309f8d716e91fe5bfb2678e
3054dd3fb78e7c9f2afce25ce742389cb7d90adb
refs/heads/master
2020-09-07T01:57:14.519742
2020-03-30T20:53:11
2020-03-30T20:53:11
220,622,177
0
0
null
null
null
null
UTF-8
Java
false
false
330
java
package pl.szotaa.spotifyfetcher.dto; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @Data @NoArgsConstructor @AllArgsConstructor public class RefreshTokenResponse { @JsonProperty("access_token") private String accessToken; }
101191b5622d7fb37f4e35821ca4afd6a64b802e
cc1b47db2b25d7f122d0fb48a4917fd01f129ff8
/domino-jnx-api/src/main/java/com/hcl/domino/json/DateRangeFormat.java
9a9644e0cf374bcbb2d94605645cfbb024a1a386
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
savlpavel/domino-jnx
666f7e12abdf5e36b471cdd7c99086db589f923f
2d94e42cdfa56de3b117231f4488685f8e084e83
refs/heads/main
2023-09-04T10:20:43.968949
2023-07-31T16:41:34
2023-07-31T16:41:34
392,598,440
0
1
Apache-2.0
2021-08-04T07:49:29
2021-08-04T07:49:29
null
UTF-8
Java
false
false
1,314
java
/* * ========================================================================== * Copyright (C) 2019-2022 HCL America, Inc. ( http://www.hcl.com/ ) * All rights reserved. * ========================================================================== * Licensed under the Apache License, Version 2.0 (the "License"). You may * not use this file except in compliance with the License. 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.hcl.domino.json; public enum DateRangeFormat { /** * Formats date/time ranges in ISO 8601 time interval format, with a {@code '/'} * character * between the start and end values. */ ISO, /** * Formats date/time ranges as a JSON object with * {@value JsonSerializer#PROP_RANGE_FROM} and * {@value JsonSerializer#PROP_RANGE_TO} keys. */ OBJECT }
781d05d43a12d1b5ccf003830b412e10f35d7267
d870a1f824ea47322d251d9814e9c1439cf5f5db
/randomchat/randomchat-common/src/main/java/org/randomchat/common/ws/WsServerEncoder.java
58f20cec89d5e4ef70fb35a78ca2bb87cc7e2894
[ "Apache-2.0" ]
permissive
leoyang0126/RandomChat
59dde2545c450de87f1d74e99c0d0374d0dd36fb
c1149cce52872fea6dd2fa8248cc64af3964178c
refs/heads/master
2020-03-21T12:44:04.672653
2018-07-31T02:53:49
2018-07-31T02:53:49
138,569,098
9
3
null
null
null
null
UTF-8
Java
false
false
2,401
java
package org.randomchat.common.ws; import java.nio.ByteBuffer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.tio.core.ChannelContext; import org.tio.core.GroupContext; import org.tio.core.utils.ByteBufferUtils; /** * 参考了baseio: https://git.oschina.net/generallycloud/baseio * com.generallycloud.nio.codec.http11.WebSocketProtocolEncoder * @author Leo Yang * */ public class WsServerEncoder { @SuppressWarnings("unused") private static Logger log = LoggerFactory.getLogger(WsServerEncoder.class); public static final int MAX_HEADER_LENGTH = 20480; private static void checkLength(byte[] bytes, int length, int offset) { if (bytes == null) { throw new IllegalArgumentException("null"); } if (offset < 0) { throw new IllegalArgumentException("invalidate offset " + offset); } if (bytes.length - offset < length) { throw new IllegalArgumentException("invalidate length " + bytes.length); } } public static ByteBuffer encode(WsResponsePacket wsResponsePacket, GroupContext groupContext, ChannelContext channelContext) { byte[] imBody = wsResponsePacket.getBody();//就是ws的body,不包括ws的头 int wsBodyLength = 0; if (imBody != null) { wsBodyLength += imBody.length; } byte header0 = (byte) (0x8f & (wsResponsePacket.getWsOpcode().getCode() | 0xf0)); ByteBuffer buf = null; if (wsBodyLength < 126) { buf = ByteBuffer.allocate(2 + wsBodyLength); buf.put(header0); buf.put((byte) wsBodyLength); } else if (wsBodyLength < (1 << 16) - 1) { buf = ByteBuffer.allocate(4 + wsBodyLength); buf.put(header0); buf.put((byte) 126); ByteBufferUtils.writeUB2WithBigEdian(buf, wsBodyLength); } else { buf = ByteBuffer.allocate(10 + wsBodyLength); buf.put(header0); buf.put((byte) 127); buf.put(new byte[] { 0, 0, 0, 0 }); ByteBufferUtils.writeUB4WithBigEdian(buf, wsBodyLength); } if (imBody != null && imBody.length > 0) { buf.put(imBody); } return buf; } public static void int2Byte(byte[] bytes, int value, int offset) { checkLength(bytes, 4, offset); bytes[offset + 3] = (byte) (value & 0xff); bytes[offset + 2] = (byte) (value >> 8 * 1 & 0xff); bytes[offset + 1] = (byte) (value >> 8 * 2 & 0xff); bytes[offset + 0] = (byte) (value >> 8 * 3); } /** * * @author Leo Yang * 2017年2月22日 下午4:06:42 * */ public WsServerEncoder() { } }
8fafdbec92c297f156e00f953dd5267c96dfb49a
ded619faa935a8b96e0bb1ac8a1eaeba3818660d
/Board2new/src/co/miu/common/BorderCommand.java
2e4c6e2485fc5e16ddda3c0aeae1f7cac2336501
[]
no_license
picmiu/Project12
8251619727fdc5c7c45e71dec9631aefa99972bb
aafd7302d81daffec9ae1453424e4e416c40b069
refs/heads/master
2023-01-31T23:21:55.175922
2020-12-18T08:42:20
2020-12-18T08:42:20
304,520,385
0
0
null
null
null
null
UTF-8
Java
false
false
342
java
package co.miu.common; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public interface BorderCommand { public String action(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException; }
[ "admin@YD02-15" ]
admin@YD02-15
84c5fd376e379576b6d5a79ba3968aa9daab15d5
e08a57885cb3a7f09b631e116ddb8dbbb9e454ff
/app/src/main/java/com/weique/overhaul/v2/mvp/model/api/service/KnowledgeService.java
95208d999277d0019a7b2c8b99e28afce07d82e8
[ "Apache-2.0" ]
permissive
coypanglei/zongzhi
b3fbdb3bb283778b49cba1e56b9955fd19dc17d4
bc31d496533a342f0b6804ad6f7dc81c7314690b
refs/heads/main
2023-02-28T07:20:18.249292
2021-02-07T07:04:17
2021-02-07T07:04:17
336,143,136
0
1
null
null
null
null
UTF-8
Java
false
false
2,234
java
package com.weique.overhaul.v2.mvp.model.api.service; import com.weique.overhaul.v2.mvp.model.entity.AreaDetailsListBean; import com.weique.overhaul.v2.mvp.model.entity.BaseBean; import com.weique.overhaul.v2.mvp.model.entity.KnowledgeBaseBean; import com.weique.overhaul.v2.mvp.model.entity.KnowledgeBean; import com.weique.overhaul.v2.mvp.model.entity.PieChartBean; import com.weique.overhaul.v2.mvp.model.entity.ScanResultBean; import java.util.List; import java.util.Map; import io.reactivex.Observable; import retrofit2.http.GET; import retrofit2.http.QueryMap; public interface KnowledgeService { /** * getKnowledgeBaseListData * * @param map map * @return KnowledgeBaseBean */ @GET("App/Knowledges/Search") Observable<BaseBean<KnowledgeBaseBean>> getKnowledgeBaseListData(@QueryMap Map<String, Object> map); /** * getLabelsListData * * @param map map * @return KnowledgeBean */ @GET("App/Knowledges/GetKnowledgeLabels") Observable<BaseBean<List<KnowledgeBean>>> getLabelsListData(@QueryMap Map<String, Object> map); /** * getTypeListData * * @param map map * @return KnowledgeBeano */ @GET("App/Knowledges/GetKnowledgeTypes") Observable<BaseBean<List<KnowledgeBean>>> getTypeListData(@QueryMap Map<String, Object> map); /** * @param paramSign * @return */ @GET("App/CommunityElement/GetElementsByStandardAddressId") Observable<BaseBean<ScanResultBean>> getScanResultListData(@QueryMap Map<String, Object> paramSign); /** * 统计 * * @param paramSign * @return */ @GET("App/CommunityElement/MixSummary") Observable<BaseBean<PieChartBean>> getPieChartData(@QueryMap Map<String, Object> paramSign); /** * @param paramSign * @return */ @GET("APP/DataReport/getDepartment") Observable<BaseBean<List<AreaDetailsListBean>>> getAreaDetailsListData(@QueryMap Map<String, Object> paramSign); /** * @param paramSign * @return */ @GET("APP/DataReport/GetDepartmentReport") Observable<BaseBean<List<AreaDetailsListBean>>> getAreaDetailsSecondListData(@QueryMap Map<String, Object> paramSign); }
f8e1a2402e51e10d8bd1ad6c888143697dc8e512
f6203ec84c7a6fe82a2a873662237137819054b1
/Assignment3_Inheritence_Polymorphism/Heirarichalinheritance.java
e32ef1a45271af144f977c8daeeb7953f93f3541
[]
no_license
me2codebrainhack/Java_Assignments
a8c39c2c4c5dcaf30a0b9e9d35bf42acd9620880
b0c56dff5a39381be8a7a4c3014b79444afd3e11
refs/heads/master
2022-09-19T21:52:06.950324
2020-05-27T17:17:28
2020-05-27T17:17:28
263,075,692
0
0
null
null
null
null
UTF-8
Java
false
false
462
java
class Car{ void start(){ System.out.println("Car is started"); } } class Audi extends Car{ void audiFeatures(){ System.out.println("Audi features are displayed on dash board"); } } class Bmw extends Car{ void bmwFeatures(){ System.out.println("Bmw features are displayed on dash board"); } } class Heirarichalinheritance{ public static void main(String args[]){ Audi x = new Audi(); x.start(); x.audiFeatures(); Bmw Y = new Bmw(); Y.start(); Y.bmwFeatures(); } }
327e04c502e86d860c4e6be53a2ab29c3acc4ad5
afc37ea94a48e65df6b128aebb9485b1d046f443
/src/main/java/com/geely/design/pattern/structural/adapter/classadapter/Adaptee.java
c7227ce6623723a980f861e372d4a482bcf2c85e
[]
no_license
wangzy0327/design_pattern
0b83a1bc3cbc5e2afed09eb30caab61b72022ca5
914fbc9ae19b548a1568e685f4d313626d74e93f
refs/heads/master
2022-12-23T01:40:13.540852
2019-09-19T14:35:39
2019-09-19T14:35:39
203,472,161
0
0
null
2022-12-16T03:47:23
2019-08-20T23:55:20
Java
UTF-8
Java
false
false
185
java
package com.geely.design.pattern.structural.adapter.classadapter; public class Adaptee { public void adapteeRequest(){ System.out.println("被适配者的方法"); } }
354f7a885dcc3701a648279c00fd51665be55169
628b8b588a87decc0c6f6b4ac8c989f6e12f5be3
/src/day63/WordFrequency.java
08a1d7686e3725f80cf6d2d9f48340f013a3debe
[]
no_license
cihatakv/JavaPractice
0184ab6370b85632201bead05fe708176d02afd0
8d94a48336947979fc1b46d058fd0c66e2072152
refs/heads/master
2020-09-24T14:29:22.739941
2020-04-06T04:19:43
2020-04-06T04:19:43
225,780,514
0
0
null
null
null
null
UTF-8
Java
false
false
730
java
package day63; import java.util.HashMap; import java.util.Map; public class WordFrequency { public static void main(String[] args) { String str = "Finding Words Frequency Sounds Fun Because Fun Comes in When you count Words" + " But How do I count the Words with what I already know previously " + "Do it and find out Words Words Words"; String[] arr = str.split(" "); Map<String, Integer> m = new HashMap<>(); for (String each : arr) { if (!m.containsKey(each)) { m.put(each, 1); } else { m.replace(each, m.get(each) + 1); } } System.out.println("m = " + m); } }
8c83895433e1b161125989fae46a2fae1b22837d
605dc9c30222306e971a80519bd1405ae513a381
/old_work/svn/gems/branches/dev_branch_sppa/ems/src/main/java/com/ems/mvc/controller/FacilitiesController.java
9ac03ce6137844459b5c0dbe43085ce0c4f7e51f
[]
no_license
rgabriana/Work
e54da03ff58ecac2e2cd2462e322d92eafd56921
9adb8cd1727fde513bc512426c1588aff195c2d0
refs/heads/master
2021-01-21T06:27:22.073100
2017-02-27T14:31:59
2017-02-27T14:31:59
83,231,847
2
0
null
null
null
null
UTF-8
Java
false
false
11,556
java
package com.ems.mvc.controller; import java.util.List; import java.util.Set; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.util.CookieGenerator; import com.ems.annotaion.InvalidateFacilityTreeCache; import com.ems.model.SystemConfiguration; import com.ems.model.Tenant; import com.ems.model.User; import com.ems.model.UserLocations; import com.ems.mvc.util.FacilityCookieHandler; import com.ems.mvc.util.JsTreeOptions; import com.ems.mvc.util.UserAuditLoggerUtil; import com.ems.security.EmsAuthenticationContext; import com.ems.service.FacilityTreeManager; import com.ems.service.GroupManager; import com.ems.service.SystemConfigurationManager; import com.ems.service.TenantManager; import com.ems.service.UserManager; import com.ems.types.AuthenticationType; import com.ems.types.FacilityType; import com.ems.types.RoleType; import com.ems.types.UserAuditActionType; import com.ems.util.tree.TreeNode; @Controller @RequestMapping("/facilities") public class FacilitiesController { @Resource UserAuditLoggerUtil userAuditLoggerUtil; @Resource FacilityTreeManager facilityTreeManager; @Resource(name = "systemConfigurationManager") private SystemConfigurationManager systemConfigurationManager; @Resource(name = "emsAuthContext") private EmsAuthenticationContext emsAuthContext; @Resource TenantManager tenantManager; @Resource GroupManager groupManager; @Resource UserManager userManager; @RequestMapping("/home.ems") public String getFacilities( Model model, @CookieValue(value = FacilityCookieHandler.selectedFacilityCookie, required = false) String cookie, HttpServletResponse httpResponse) { // To get facility tree populated model.addAttribute("facilityTreeHierarchy", getTreeHierarchy(model, cookie, httpResponse)); // To get profile tree populated model.addAttribute("profileTreeHierarchy", getProfileTreeHierarchy()); // To send current user tenant details to view page model.addAttribute("tenant", emsAuthContext.getCurrentTenant()); SystemConfiguration config = systemConfigurationManager .loadConfigByName("menu.bacnet.show"); model.addAttribute("showBacnet", config.getValue()); model.addAttribute("showOpenADR", systemConfigurationManager .loadConfigByName("menu.openADR.show").getValue()); //For hiding change password menu if a user is logging in using Ldap credentials. String ldapFlag = "true" ; AuthenticationType authType =AuthenticationType.valueOf(systemConfigurationManager.loadConfigByName("auth.auth_type").getValue()) ; if (authType == AuthenticationType.LDAP && (emsAuthContext.getCurrentUserRoleType() != RoleType.Admin)) { ldapFlag="false"; } model.addAttribute("ldapFlag", ldapFlag); SystemConfiguration sweepTimerEnableConfig = systemConfigurationManager.loadConfigByName("sweeptimer.enable"); if (sweepTimerEnableConfig != null && "true".equalsIgnoreCase(sweepTimerEnableConfig.getValue())) { model.addAttribute("enableSweepTimer", sweepTimerEnableConfig.getValue()); } SystemConfiguration motionBitsEnableConfig = systemConfigurationManager.loadConfigByName("motionbits.enable"); if (motionBitsEnableConfig != null && "true".equalsIgnoreCase(motionBitsEnableConfig.getValue())) { model.addAttribute("enableMotionBits", motionBitsEnableConfig.getValue()); } else { model.addAttribute("enableMotionBits", false); } RoleType role = emsAuthContext.getCurrentUserRoleType(); model.addAttribute("role", role.getName().toLowerCase()); return "facilities/home"; } @RequestMapping("/tree.ems") public String getTree( Model model, @CookieValue(FacilityCookieHandler.selectedFacilityCookie) String cookie, HttpServletResponse httpResponse) { model.addAttribute("facilityTreeHierarchy", getTreeHierarchy(model, cookie, httpResponse)); return "facilities/tree"; } @RequestMapping("/profiletree.ems") public String getProfileTree( Model model, @CookieValue(FacilityCookieHandler.selectedFacilityCookie) String cookie, HttpServletResponse httpResponse) { // To get profile tree populated model.addAttribute("profileTreeHierarchy", getProfileTreeHierarchy()); return "facilities/tree"; } private TreeNode<FacilityType> getTreeHierarchy(Model model, String cookie, HttpServletResponse httpResponse) { TreeNode<FacilityType> facilityTreeHierarchy = null; // switch (emsAuthContext.getCurrentUserRoleType()) { // case Admin: // case FacilitiesAdmin: // case Auditor: { // facilityTreeHierarchy = facilityTreeManager.loadCompanyHierarchy(); // break; // } // default: { // if (emsAuthContext.getCurrentTenant() != null) { // facilityTreeHierarchy = // facilityTreeManager.loadTenantFacilitiesHierarchy(emsAuthContext // .getCurrentTenant().getId()); // } else { // facilityTreeHierarchy = facilityTreeManager.loadCompanyHierarchy(); // } // break; // } // } if(emsAuthContext.getCurrentUserRoleType().equals(RoleType.Admin)) { facilityTreeHierarchy =facilityTreeManager.loadCompanyHierarchy(); } else { long currentUserId = emsAuthContext.getUserId(); facilityTreeHierarchy = facilityTreeManager .loadFacilityHierarchyForUser(currentUserId); } // check if cookie is not already set then find the default node in tree // and store in cookie for js-tree. if (cookie == null || "".equals(cookie)) { String nodeId = FacilityCookieHandler .getDefaultNodeIdToSelect(facilityTreeHierarchy); CookieGenerator generator = new CookieGenerator(); generator .setCookieName(FacilityCookieHandler.selectedFacilityCookie); generator.addCookie(httpResponse, nodeId); } return facilityTreeHierarchy; } @RequestMapping("/tenant_tree_assignment.ems") public String getTenantAssignmentTree(Model model) { long currentUserId = emsAuthContext.getUserId(); TreeNode<FacilityType> facilityTreeHierarchy = facilityTreeManager .loadFacilityHierarchyForUser(currentUserId); model.addAttribute("facilityTreeHierarchy", facilityTreeHierarchy); List<Tenant> tenantsList = tenantManager.getAllTenants(); model.addAttribute("tenantsList", tenantsList); return "facilities/tenant/treeAssignment"; } @RequestMapping("/{tenantId}/get_tenant_tree.ems") public String getTenantTree(Model model, @PathVariable("tenantId") Long tenantId) { TreeNode<FacilityType> facilityTreeHierarchy = facilityTreeManager .loadTenantFacilitiesHierarchy(tenantId); model.addAttribute("facilityTreeHierarchy", facilityTreeHierarchy); model.addAttribute("tenantId", tenantId); JsTreeOptions jsTreeOptions = new JsTreeOptions(); jsTreeOptions.setCheckBoxes(false); model.addAttribute("jsTreeOptions", jsTreeOptions); return "facilities/tenant/treeAssignment"; } @InvalidateFacilityTreeCache @RequestMapping(value = "/save_tenant_locations.ems", method = RequestMethod.POST) public String saveTenantLocationsAssignment(Model model, @RequestParam("selectedFacilities") String selectedFacilities) { String[] assignedFacilities = selectedFacilities.split(","); facilityTreeManager.setTenantFacilities(assignedFacilities); userAuditLoggerUtil.log("Changed tenant assignments", UserAuditActionType.Tenant_Facility.getName()); return "redirect:/tenants/list.ems?facilityAssignmentStatus=success"; } // --------------------------------------------------------------- // Added by Nitin // Following is to get profile tree view details // --------------------------------------------------------------- private TreeNode<FacilityType> getProfileTreeHierarchy() { TreeNode<FacilityType> ProfileTreeHierarchy = null; // If visibility check is applied, tree will load all profiles which are in visible state boolean visibilityCheck =true; if(emsAuthContext.getCurrentUserRoleType().equals(RoleType.Admin)) { ProfileTreeHierarchy = groupManager.loadProfileHierarchy(visibilityCheck); } else { long currentUserId = emsAuthContext.getUserId(); ProfileTreeHierarchy = groupManager.loadProfileHierarchyForUser(currentUserId,visibilityCheck); } return ProfileTreeHierarchy; } // --------------------------------------------------------------- // Added by Nitin // Following is to get facilities assigned to user // --------------------------------------------------------------- @RequestMapping("/{userId}/assignFacilityUser.ems") public String getUserTree(Model model, @PathVariable("userId") Long userId) { Long tenantId = 0L; TreeNode<FacilityType> facilityTreeHierarchy = null; long currentUserId = emsAuthContext.getUserId(); if (emsAuthContext.getCurrentUserRoleType() != RoleType.Admin) { facilityTreeHierarchy = facilityTreeManager .loadFacilityHierarchyForUser(currentUserId); } else { //If user belongs to any tenant than load tenant's assigned tree else // whole company tree. Tenant tenant = userManager.loadUserById(userId).getTenant(); if(tenant != null) { tenantId = tenant.getId(); facilityTreeHierarchy = facilityTreeManager.loadTenantFacilitiesHierarchy(tenantId); } else { facilityTreeHierarchy = facilityTreeManager.loadCompanyHierarchy(); } } model.addAttribute("facilityTreeHierarchy", facilityTreeHierarchy); model.addAttribute("userId", userId); // Let's get the selected nodes User user = userManager.loadUserById(userId); Set<UserLocations> userLocations = user.getUserLocations(); model.addAttribute("userLocations", userLocations); JsTreeOptions jsTreeOptions = new JsTreeOptions(); jsTreeOptions.setCheckBoxes(true); model.addAttribute("jsTreeOptions", jsTreeOptions); return "facilities/user/treeAssignment"; } // --------------------------------------------------------------- // Added by Nitin // Following is to save facilities assigned to user // --------------------------------------------------------------- @InvalidateFacilityTreeCache @RequestMapping(value = "/save_user_locations.ems", method = RequestMethod.POST) public String saveUserLocationsAssignment(Model model, @RequestParam("selectedFacilities") String selectedFacilities, @RequestParam("userId") Long userId) { String[] assignedFacilities = selectedFacilities.split(","); facilityTreeManager.setUserFacilities(assignedFacilities, userId); userAuditLoggerUtil.log("Changed user assignments", UserAuditActionType.Tenant_Facility.getName()); Tenant tenant = userManager.loadUserById(userId).getTenant(); if (tenant != null) { return "redirect:/users/list.ems?tenantId=" + tenant.getId()+"&facilityAssignmentStatus=success"; } else { return "redirect:/users/list.ems?facilityAssignmentStatus=success"; } } }
eb0e226726be5cb1f99c727a7e43d2ad6cc879a1
d39f34d2e4105f4c43d005b824255fcce12cf3c5
/monitor-datapicker/src/main/java/com/vrv/monitor/datapicker/controller/JettySpringMVCStart.java
718ccd7bf5c8f5d7a98dfde2d5445b964f0cfdcb
[]
no_license
honglang1992/monitor
4c96c2efc118e944cf371e927961e3795ebbfc90
8b6b001ee7c0d8295f111aad22631e3ffa1b6129
refs/heads/master
2022-12-23T12:11:47.492801
2021-12-03T09:36:07
2021-12-03T09:36:07
131,235,371
0
1
null
2022-12-16T05:36:23
2018-04-27T02:33:43
Java
UTF-8
Java
false
false
1,661
java
package com.vrv.monitor.datapicker.controller; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.nio.SelectChannelConnector; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.eclipse.jetty.webapp.WebAppContext; /** * Created by Dendi on 2017/10/20. */ public class JettySpringMVCStart { // web访问的根路径http://ip:port/,相当于项目名,/即忽略项目名 public static final String CONTEXT = "/"; private static final String DEFAULT_WEBAPP_PATH = "webapp"; public static Server createServerIn(int port) { // 创建Server Server server = new Server(); // 添加ThreadPool QueuedThreadPool queuedThreadPool = new QueuedThreadPool(); queuedThreadPool.setName("queuedTreadPool"); queuedThreadPool.setMinThreads(10); queuedThreadPool.setMaxThreads(200); server.setThreadPool(queuedThreadPool); // 添加Connector SelectChannelConnector connector = new SelectChannelConnector(); connector.setPort(port); connector.setAcceptors(4);// 同时监听read事件的线程数 connector.setMaxBuffers(2048); connector.setMaxIdleTime(10000); server.addConnector(connector); WebAppContext webContext = new WebAppContext(DEFAULT_WEBAPP_PATH, CONTEXT); webContext.setDescriptor(DEFAULT_WEBAPP_PATH+"/WEB-INF/web.xml"); webContext.setResourceBase(DEFAULT_WEBAPP_PATH); webContext.setClassLoader(Thread.currentThread().getContextClassLoader()); server.setHandler(webContext); return server; } }
3df448c426d08440c55786e492388afc82ff6714
7f704ddac8b989b1fdc5a7c4f3585dece0aa2e3e
/BitMap/src/bitmap/Toggle.java
2c5dd7864ec3ac357ec8e088e095f5048533685f
[]
no_license
gupta-saransh/JavaDsAlgoCode
12f123a529a77853dea41dc7cc6d821cc9f688eb
543471dd0393ee377db6bdc6487c931192b8f370
refs/heads/master
2020-04-24T19:12:38.151194
2019-06-10T14:10:37
2019-06-10T14:10:37
172,204,730
0
0
null
null
null
null
UTF-8
Java
false
false
845
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package bitmap; import java.util.Scanner; /** * * @author test */ public class Toggle { public static void main(String[] args) { // TODO code application logic here Scanner scn= new Scanner(System.in); System.out.println("Enter Number"); int num=scn.nextInt(); System.out.println("Enter Bit to Check"); int k=scn.nextInt(); int bm=1<<k-1; if((num&bm)==0) { num=num|bm; }else num=num&(~bm); // use may use ^ (xor) for the same. System.out.println(num); } }
3f6d501475481d5fb9c3f9bec3d0cd8e60b2d15a
d1a6d1e511df6db8d8dd0912526e3875c7e1797d
/genny_JavaWithoutLambdasApi21_ReducedClassCount/applicationModule/src/test/java/applicationModulepackageJava0/Foo269Test.java
fd659f21c742344ef708d61fd7013bd725c2ab00
[]
no_license
NikitaKozlov/generated-project-for-desugaring
0bc1443ab3ddc84cd289331c726761585766aea7
81506b3711004185070ca4bb9a93482b70011d36
refs/heads/master
2020-03-20T00:35:06.996525
2018-06-12T09:30:37
2018-06-12T09:30:37
137,049,317
0
0
null
null
null
null
UTF-8
Java
false
false
741
java
package applicationModulepackageJava0; import org.junit.Test; public class Foo269Test { @Test public void testFoo0() { new Foo269().foo0(); } @Test public void testFoo1() { new Foo269().foo1(); } @Test public void testFoo2() { new Foo269().foo2(); } @Test public void testFoo3() { new Foo269().foo3(); } @Test public void testFoo4() { new Foo269().foo4(); } @Test public void testFoo5() { new Foo269().foo5(); } @Test public void testFoo6() { new Foo269().foo6(); } @Test public void testFoo7() { new Foo269().foo7(); } @Test public void testFoo8() { new Foo269().foo8(); } @Test public void testFoo9() { new Foo269().foo9(); } }
45921874b39d6ccd134bca100184aa33795401d2
160ce98820e45350fbecd640f66f7a2ecede1d7c
/iot-data/src/main/java/com/hackathon/iot/data/DataPointRepository.java
1fa6bf725c8e5bed599a136beb52c41cc950a224
[]
no_license
jae226/TrafficControl
8388206dbe9e053055284f5fa55d0448cddd49b6
915fc38e31e839f16e7792b9801bb09a82e6767b
refs/heads/master
2021-01-22T15:35:14.126973
2016-09-17T22:24:23
2016-09-17T22:24:23
68,447,801
0
2
null
2016-09-17T21:20:47
2016-09-17T11:17:50
HTML
UTF-8
Java
false
false
242
java
package com.hackathon.iot.data; import com.hackathon.iot.commons.DataPoint; import org.springframework.data.repository.CrudRepository; import java.util.Date; public interface DataPointRepository extends CrudRepository<DataPoint, Date> { }
95f1aaaba6cb9d6780b7e00c1bc8312245a53fe5
6fb042fa8d3df4ce9a6a80974bd278a334b4174d
/RestServer/src/main/java/ua/org/amicablesoft/ts/rest/responce/TransactionSaveResponse.java
4485392d4d4c98da35d09b69f0afec6183603595
[]
no_license
BogdanTymoshenko/transaction.service
97353018aa98e76bf417d884511c17986d3367dc
cfdb9f092e2fb3eae4f29d55b1cc00ac8db7bd24
refs/heads/master
2016-09-01T05:31:39.181288
2015-10-19T08:27:07
2015-10-19T08:27:07
44,305,538
0
0
null
2015-10-27T15:30:26
2015-10-15T08:57:36
Java
UTF-8
Java
false
false
308
java
package ua.org.amicablesoft.ts.rest.responce; /** * Created by bogdan on 10/15/15. */ public class TransactionSaveResponse { private Status status; public TransactionSaveResponse(Status status) { this.status = status; } public Status getStatus() { return status; } }
8a4e20ce15ec3f3ec2ed69115c70a6928311c8e7
cfb37b8bd2c9e9cc16b50881bbb4dfb345eae656
/bundles/edu.tamu.tcat.trc.refman/src/edu/tamu/tcat/trc/refman/RefManagerException.java
9b0ea50ea6f93451517a267ccfbf69f7bf82561d
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
tcat-tamu/trc
c80c3be5c893727ee7e0ab19bc9150740a88bacb
f7713ea2aeb8f27cb8854a9bcb5192b9f32f10a4
refs/heads/master
2021-01-23T00:15:00.931742
2017-04-10T16:03:43
2017-04-10T16:03:43
85,700,009
1
1
null
null
null
null
UTF-8
Java
false
false
591
java
package edu.tamu.tcat.trc.refman; public class RefManagerException extends Exception { public RefManagerException() { } public RefManagerException(String message) { super(message); } public RefManagerException(Throwable cause) { super(cause); } public RefManagerException(String message, Throwable cause) { super(message, cause); } public RefManagerException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { super(message, cause, enableSuppression, writableStackTrace); } }
6bbd26f014639f8f454dbf3178284dc01eb35e85
22ae2eff1647df337a18a870f73c697f6729ac4d
/learn-note-springboot2-datesource/learn-note-springboot2-mysql-jdbctemplate-hikari-page-multi/src/main/java/cn/center/config/JdbcTemplateConfig.java
30024b37121061415075e1adb38796befaa244c5
[]
no_license
Steve133/learn-note-springboot2
9a3c6635196ba14246ff395299e376884fc75633
3dd52dde26080e9e828470531c22f9f6b193eb95
refs/heads/master
2022-12-10T18:58:56.346348
2019-12-12T14:30:20
2019-12-12T14:30:20
226,075,619
0
0
null
2022-12-06T00:44:43
2019-12-05T10:26:57
Java
UTF-8
Java
false
false
1,544
java
package cn.center.config; import javax.sql.DataSource; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.jdbc.DataSourceBuilder; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Primary; import org.springframework.jdbc.core.JdbcTemplate; import com.zaxxer.hikari.HikariDataSource; @Configuration public class JdbcTemplateConfig { @Bean(name = "primaryDataSource") @Qualifier("primaryDataSource") @ConfigurationProperties(prefix="spring.datasource.primary") public DataSource primaryDataSource() { return DataSourceBuilder.create().type(HikariDataSource.class).build(); } @Bean(name = "secondaryDataSource") @Qualifier("secondaryDataSource") @Primary @ConfigurationProperties(prefix="spring.datasource.secondary") public DataSource secondaryDataSource() { return DataSourceBuilder.create().type(HikariDataSource.class).build(); } @Bean(name = "primaryJdbcTemplate") public JdbcTemplate primaryJdbcTemplate( @Qualifier("primaryDataSource") DataSource dataSource) { return new JdbcTemplate(dataSource); } @Bean(name = "secondaryJdbcTemplate") public JdbcTemplate secondaryJdbcTemplate( @Qualifier("secondaryDataSource") DataSource dataSource) { return new JdbcTemplate(dataSource); } }
495dd80faa804e52b23b2c38dc825bd5df0a3b6b
4ba41dcd2832541af1787c6f6c3373439bf0624b
/onScreenJoystickExample/src/main/java/com/salamientertainment/onscreenjoystickexample/GameOne.java
e150ed41d30ff9d0ab0c26e2a276167b6962ad26
[]
no_license
davidzhou9/Starfighter-Reborn
4d4dfdf4e775c77ad60031fcf8a42ee1691772e2
9bc12bea9a875aed3e04191e6ea424a73ff5fc32
refs/heads/master
2021-05-07T00:05:47.583208
2017-11-09T02:13:01
2017-11-09T02:13:01
110,052,014
0
0
null
null
null
null
UTF-8
Java
false
false
1,224
java
package com.salamientertainment.onscreenjoystickexample; import android.graphics.Canvas; import android.util.Log; import android.graphics.Bitmap; import java.util.ArrayList; import java.util.List; /** * Created by S600253 on 9/23/2015. */ public class GameOne implements GameLevel{ private AlienHorde a; public Bitmap b; private ArrayList<Ammo> ammo; public GameOne(Bitmap b){ this.b = b; createAliens(); } public void createAliens(){ a = new AlienHorde(); a.add(new Alien(100,50,150,150,3)); a.add(new Alien(100,250,150,150,3)); a.add(new Alien(500,50,150,150,3)); a.add(new Alien(500,250,150,150,3)); a.add(new Alien(900,50,150,150,3)); a.add(new Alien(900,250,150,150,3)); a.add(new Alien(1400,50,150,150,3)); a.add(new Alien(1400, 250, 150, 150, 3)); } @Override public void doDraw(final Canvas pCanvas) { a.moveEmAll(); a.removeDeadOnes(ammo); Log.d("WINDOW_ONE", "CALLED FOR ALIEN PAINT"); //pCanvas.drawBitmap(b, 10, 10, null); a.drawEmAll(pCanvas, b); } public void setBullets(ArrayList<Ammo> ammo){ this.ammo = ammo; } }
3b409dd7fb373b519e10397e870d5c926b30c6ec
4ca1596cffb0c220bccf833880ea537b9724be67
/Maximum height with unlimited given cubes.java
12e2530e515e0892e9a4cb57ae8b679d07f476ed
[ "MIT" ]
permissive
baliramakrishna/Dynamic-Programming
10f737f59a278ac692b0569b3821a7554a68f08b
52bdcf9652a0163568eb1a389d87fcfe28f02da5
refs/heads/master
2020-05-24T01:15:48.390464
2019-08-07T03:19:30
2019-08-07T03:19:30
187,031,533
2
2
null
null
null
null
UTF-8
Java
false
false
1,721
java
/*package whatever //do not write package name here */ import java.util.*; class Box implements Comparable<Box>{ int l,w,h,area; Box(int l,int w,int h){ this.l=l; this.w=w; this.h=h; } @Override public int compareTo(Box b){ return b.area-this.area; } static int maxHeight(Box a[],int n){ Box[] box=new Box[3*n]; for(int i=0;i<n;i++){ Box temp=a[i]; box[3*i]=new Box(Math.max(temp.l,temp.w),Math.min(temp.l,temp.w),temp.h); box[3*i+1]=new Box(Math.max(temp.l,temp.h),Math.min(temp.l,temp.h),temp.w); box[3*i+2]=new Box(Math.max(temp.h,temp.w),Math.min(temp.h,temp.w),temp.l); } for(int i=0;i<box.length;i++) box[i].area=box[i].l*box[i].w; Arrays.sort(box); int mhv[]=new int[box.length]; int result[]=new int[box.length]; for(int i=0;i<box.length;i++){ mhv[i]=box[i].h; result[i]=i; } for(int i=1;i<box.length;i++){ Box first=box[i]; for(int j=0;j<box.length;j++ ){ Box sec=box[j]; if(sec.l>first.l && sec.w>first.w){ mhv[i]=Math.max(mhv[i],mhv[j]+box[i].h); result[i]=j; } } } int max=-1; for(int k:mhv){ if(k>max) max=k; } return max; } public static void main (String[] args) { Box[] a=new Box[2]; a[0]=new Box(3,2,5); a[1]=new Box(1,2,4); System.out.println("Max Height "+maxHeight(a,a.length)); } }
64ffc17352fb614ef74451f9c859288fb68f7106
c95ab066f51f39270385694b93b5e52e7b8d85e2
/lib-mvparms/src/main/java/com/jess/arms/base/BaseApplication.java
4b86020cb93f01299dc3097ecebd9eeae35b5df3
[]
no_license
smarthane/smartframework-android-atlas
ba043d368af1c8758e2dd226d971d1a826b3f854
bdb60169520ba8ed4539c4706bf0843b455b361a
refs/heads/master
2021-08-23T20:09:36.339694
2017-12-06T10:24:56
2017-12-06T10:24:56
112,701,754
11
1
null
null
null
null
UTF-8
Java
false
false
1,646
java
package com.jess.arms.base; import android.app.Application; import android.content.Context; import com.jess.arms.base.delegate.AppDelegate; import com.jess.arms.base.delegate.AppLifecycles; import com.jess.arms.di.component.AppComponent; /** * 本项目由 * mvp * +dagger2 * +retrofit * +rxjava * +androideventbus * +butterknife组成 * 请配合官方wiki文档https://github.com/JessYanCoding/MVPArms/wiki,学习本框架 */ public class BaseApplication extends Application implements App { private AppLifecycles mAppDelegate; /** * 这里会在 {@link BaseApplication#onCreate} 之前被调用,可以做一些较早的初始化 * 常用于 MultiDex 以及插件化框架的初始化 * * @param base */ @Override protected void attachBaseContext(Context base) { super.attachBaseContext(base); this.mAppDelegate = new AppDelegate(base); this.mAppDelegate.attachBaseContext(base); } @Override public void onCreate() { super.onCreate(); this.mAppDelegate.onCreate(this); } /** * 在模拟环境中程序终止时会被调用 */ @Override public void onTerminate() { super.onTerminate(); if (mAppDelegate != null) this.mAppDelegate.onTerminate(this); } /** * 将AppComponent返回出去,供其它地方使用, AppComponent接口中声明的方法返回的实例,在getAppComponent()拿到对象后都可以直接使用 * * @return */ @Override public AppComponent getAppComponent() { return ((App) mAppDelegate).getAppComponent(); } }
8a2e76cd15dd910b1fe003452bb11b527f230671
525d458ca06b35ceea7786d176acbf8c6c3c29fb
/src/main/java/org/datanucleus/store/hbase/HBaseSchemaHandler.java
c87fab508075342689b8957bc09d16d22d326b2a
[ "Apache-2.0" ]
permissive
lgscofield/datanucleus-hbase
77dc9f82ed382871cbc92801e88b5c6f42a9c5a8
8906ab79376a4cf2e02d8b8c1ec7fbcc88955d92
refs/heads/master
2021-01-18T11:45:07.197022
2015-09-02T08:28:14
2015-09-02T08:28:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
14,864
java
/********************************************************************** Copyright (c) 2014 Andy Jefferson and others. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. 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. Contributors: ... **********************************************************************/ package org.datanucleus.store.hbase; import java.security.AccessController; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Properties; import java.util.Set; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.TableNotFoundException; import org.apache.hadoop.hbase.client.HBaseAdmin; import org.datanucleus.ClassLoaderResolver; import org.datanucleus.exceptions.NucleusDataStoreException; import org.datanucleus.metadata.AbstractClassMetaData; import org.datanucleus.store.StoreData; import org.datanucleus.store.StoreManager; import org.datanucleus.store.hbase.metadata.MetaDataExtensionParser; import org.datanucleus.store.schema.AbstractStoreSchemaHandler; import org.datanucleus.store.schema.table.Column; import org.datanucleus.store.schema.table.CompleteClassTable; import org.datanucleus.store.schema.table.Table; import org.datanucleus.util.Localiser; import org.datanucleus.util.NucleusLogger; /** * Handler for schema management with HBase. */ public class HBaseSchemaHandler extends AbstractStoreSchemaHandler { public HBaseSchemaHandler(StoreManager storeMgr) { super(storeMgr); } /* (non-Javadoc) * @see org.datanucleus.store.schema.AbstractStoreSchemaHandler#createSchemaForClasses(java.util.Set, java.util.Properties, java.lang.Object) */ @Override public void createSchemaForClasses(Set<String> classNames, Properties props, Object connection) { if (isAutoCreateTables() || isAutoCreateColumns()) { Iterator<String> classIter = classNames.iterator(); ClassLoaderResolver clr = storeMgr.getNucleusContext().getClassLoaderResolver(null); while (classIter.hasNext()) { String className = classIter.next(); AbstractClassMetaData cmd = storeMgr.getMetaDataManager().getMetaDataForClass(className, clr); if (cmd != null) { createSchemaForClass((HBaseStoreManager) storeMgr, cmd, false); } } } } /** * Create a schema in HBase. Do not make this method public, since it uses privileged actions. * @param storeMgr HBase StoreManager * @param cmd Metadata for the class * @param validateOnly Whether to only validate for existence and flag missing schema in the log */ public void createSchemaForClass(final HBaseStoreManager storeMgr, final AbstractClassMetaData cmd, final boolean validateOnly) { if (cmd.isEmbeddedOnly()) { // No schema required since only ever embedded return; } StoreData storeData = storeMgr.getStoreDataForClass(cmd.getFullClassName()); Table table = null; if (storeData != null) { table = storeData.getTable(); } else { table = new CompleteClassTable(storeMgr, cmd, null); } final String tableName = table.getName(); final Configuration config = storeMgr.getHbaseConfig(); try { final HBaseAdmin hBaseAdmin = (HBaseAdmin) AccessController.doPrivileged(new PrivilegedExceptionAction() { public Object run() throws Exception { return new HBaseAdmin(config); } }); // Find table descriptor, if not existing, create it final HTableDescriptor hTable = (HTableDescriptor) AccessController.doPrivileged(new PrivilegedExceptionAction() { public Object run() throws Exception { HTableDescriptor hTable = null; try { hTable = hBaseAdmin.getTableDescriptor(tableName.getBytes()); } catch (TableNotFoundException ex) { if (validateOnly) { NucleusLogger.DATASTORE_SCHEMA.info(Localiser.msg("HBase.SchemaValidate.Class", cmd.getFullClassName(), tableName)); } else if (storeMgr.getSchemaHandler().isAutoCreateTables()) { NucleusLogger.DATASTORE_SCHEMA.debug(Localiser.msg("HBase.SchemaCreate.Class", cmd.getFullClassName(), tableName)); hTable = new HTableDescriptor(tableName); hBaseAdmin.createTable(hTable); } } return hTable; } }); // No such table & no auto-create -> exit if (hTable == null) { return; } boolean modified = false; if (!hTable.hasFamily(tableName.getBytes())) { if (validateOnly) { NucleusLogger.DATASTORE_SCHEMA.info(Localiser.msg("HBase.SchemaValidate.Class.Family", tableName, tableName)); } else if (storeMgr.getSchemaHandler().isAutoCreateColumns()) { NucleusLogger.DATASTORE_SCHEMA.debug(Localiser.msg("HBase.SchemaCreate.Class.Family", tableName, tableName)); // Not sure this is good. This creates a default family even if the family is actually defined in the @Column(name="family:fieldname") annotation. // i.e it is possible to get a family with no fields. HColumnDescriptor hColumn = new HColumnDescriptor(tableName); hTable.addFamily(hColumn); modified = true; } } List<Column> cols = table.getColumns(); Set<String> familyNames = new HashSet<String>(); for (Column col : cols) { boolean changed = addColumnFamilyForColumn(col, hTable, tableName, familyNames, validateOnly); if (changed) { modified = true; } } if (table.getDatastoreIdColumn() != null) { boolean changed = addColumnFamilyForColumn(table.getDatastoreIdColumn(), hTable, tableName, familyNames, validateOnly); if (changed) { modified = true; } } if (table.getVersionColumn() != null) { boolean changed = addColumnFamilyForColumn(table.getVersionColumn(), hTable, tableName, familyNames, validateOnly); if (changed) { modified = true; } } if (table.getDiscriminatorColumn() != null) { boolean changed = addColumnFamilyForColumn(table.getDiscriminatorColumn(), hTable, tableName, familyNames, validateOnly); if (changed) { modified = true; } } if (table.getMultitenancyColumn() != null) { boolean changed = addColumnFamilyForColumn(table.getMultitenancyColumn(), hTable, tableName, familyNames, validateOnly); if (changed) { modified = true; } } // Process any extensions MetaDataExtensionParser ep = new MetaDataExtensionParser(cmd); if (!validateOnly && ep.hasExtensions()) { for (String familyName : familyNames) { modified |= ep.applyExtensions(hTable, familyName); } } if (modified) { AccessController.doPrivileged(new PrivilegedExceptionAction() { public Object run() throws Exception { hBaseAdmin.disableTable(hTable.getName()); hBaseAdmin.modifyTable(hTable.getName(), hTable); hBaseAdmin.enableTable(hTable.getName()); return null; } }); } } catch (PrivilegedActionException e) { throw new NucleusDataStoreException(e.getMessage(), e.getCause()); } } protected boolean addColumnFamilyForColumn(Column col, HTableDescriptor htable, String tableName, Set<String> familyNames, boolean validateOnly) { boolean modified = false; String familyName = HBaseUtils.getFamilyNameForColumn(col); if (!familyNames.contains(familyName)) { familyNames.add(familyName); if (!htable.hasFamily(familyName.getBytes())) { if (validateOnly) { NucleusLogger.DATASTORE_SCHEMA.debug(Localiser.msg("HBase.SchemaValidate.Class.Family", tableName, familyName)); } else if (storeMgr.getSchemaHandler().isAutoCreateColumns()) { NucleusLogger.DATASTORE_SCHEMA.debug(Localiser.msg("HBase.SchemaCreate.Class.Family", tableName, familyName)); HColumnDescriptor hColumn = new HColumnDescriptor(familyName); htable.addFamily(hColumn); modified = true; } } } return modified; } /* (non-Javadoc) * @see org.datanucleus.store.schema.AbstractStoreSchemaHandler#deleteSchemaForClasses(java.util.Set, java.util.Properties, java.lang.Object) */ @Override public void deleteSchemaForClasses(Set<String> classNames, Properties props, Object connection) { Iterator<String> classIter = classNames.iterator(); ClassLoaderResolver clr = storeMgr.getNucleusContext().getClassLoaderResolver(null); while (classIter.hasNext()) { String className = classIter.next(); AbstractClassMetaData cmd = storeMgr.getMetaDataManager().getMetaDataForClass(className, clr); if (cmd != null) { deleteSchemaForClass(cmd); } } } /** * Delete the schema for the specified class from HBase. * @param storeMgr HBase StoreManager * @param cmd Metadata for the class */ void deleteSchemaForClass(final AbstractClassMetaData cmd) { if (cmd.isEmbeddedOnly()) { // No schema present since only ever embedded return; } StoreData storeData = storeMgr.getStoreDataForClass(cmd.getFullClassName()); Table table = null; if (storeData != null) { table = storeData.getTable(); } else { table = new CompleteClassTable(storeMgr, cmd, null); } final String tableName = table.getName(); final Configuration config = ((HBaseStoreManager)storeMgr).getHbaseConfig(); try { final HBaseAdmin hBaseAdmin = (HBaseAdmin) AccessController.doPrivileged(new PrivilegedExceptionAction() { public Object run() throws Exception { return new HBaseAdmin(config); } }); // Find table descriptor, if not existing, create it final HTableDescriptor hTable = (HTableDescriptor) AccessController.doPrivileged(new PrivilegedExceptionAction() { public Object run() throws Exception { HTableDescriptor hTable; try { hTable = hBaseAdmin.getTableDescriptor(tableName.getBytes()); } catch (TableNotFoundException ex) { // TODO Why create it if we are trying to delete it???? hTable = new HTableDescriptor(tableName); hBaseAdmin.createTable(hTable); } return hTable; } }); AccessController.doPrivileged(new PrivilegedExceptionAction() { public Object run() throws Exception { NucleusLogger.DATASTORE_SCHEMA.debug(Localiser.msg("HBase.SchemaDelete.Class", cmd.getFullClassName(), hTable.getNameAsString())); hBaseAdmin.disableTable(hTable.getName()); hBaseAdmin.deleteTable(hTable.getName()); return null; } }); } catch (PrivilegedActionException e) { throw new NucleusDataStoreException(e.getMessage(), e.getCause()); } } /* (non-Javadoc) * @see org.datanucleus.store.schema.AbstractStoreSchemaHandler#validateSchema(java.util.Set, java.util.Properties, java.lang.Object) */ @Override public void validateSchema(Set<String> classNames, Properties props, Object connection) { if (isValidateTables() || isValidateColumns()) { Iterator<String> classIter = classNames.iterator(); ClassLoaderResolver clr = storeMgr.getNucleusContext().getClassLoaderResolver(null); while (classIter.hasNext()) { String className = classIter.next(); AbstractClassMetaData cmd = storeMgr.getMetaDataManager().getMetaDataForClass(className, clr); if (cmd != null) { createSchemaForClass((HBaseStoreManager) storeMgr, cmd, true); } } } } }
4bafba9b300c0a0d81e423fa048e82a22ea407c8
b703225f630814c36b052b76bb0ccd46a611cdcd
/Jobsheet2/src/jobsheet2/TestMahasiswa.java
f10a32ab7fb9b948a1c03b1f2c3d2b6ec398ee66
[]
no_license
dilaprastiwi5948/TI2B_DilaPrastiwi_1941720176
b8073ff75b9f20376dab3f88f176ba7dfbc401ff
afc77cf859220f174b08e0e8c63d827697013275
refs/heads/master
2022-12-13T06:26:38.929694
2020-09-15T14:28:33
2020-09-15T14:28:33
295,763,172
0
0
null
null
null
null
UTF-8
Java
false
false
629
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package jobsheet2; /** * * @author WINDOWS 10 */ public class TestMahasiswa { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here Mahasiswa mhs1 = new Mahasiswa(); mhs1.nim = 101; mhs1.nama = "Lestari"; mhs1.alamat = "Jl. Vinolia No 1A"; mhs1.kelas = "1A"; mhs1.tampilBiodata(); } }
ba40ecba5df0c12c7abb32819a68610966928f29
239f50757ad75768217e7b6c6b58968fadeae1e2
/src/main/controller/ControladorJuego.java
71304cef416a16e7cc66d137f0f219e8914fcf00
[]
no_license
CristianAlfaro/ProyectoPOOversion2.0
ffe92dde37d2258246046cc58b65c7c332ea1453
8f9ea5bba499720925073710d816e4dd55f9cbb7
refs/heads/master
2020-03-22T15:11:45.816273
2018-07-11T17:27:19
2018-07-11T17:27:19
140,234,839
0
0
null
null
null
null
UTF-8
Java
false
false
1,320
java
package main.controller; import javafx.event.Event; import javafx.fxml.FXML; import javafx.fxml.Initializable; import javafx.scene.Node; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyEvent; import javafx.scene.input.MouseEvent; import javafx.scene.layout.AnchorPane; import javafx.stage.Stage; import main.Jugadores.Jugador1; import main.Jugadores.Jugador2; import main.Jugadores.Jugadores; import main.mainApp; import main.scenes.FactoryScene; import main.scenes.TypeScene; import java.net.URL; import java.util.ResourceBundle; public class ControladorJuego implements Initializable { double x = 0; double y = 0; @FXML private ImageView player1; @FXML private ImageView player2; @FXML private ImageView link; @FXML private AnchorPane fondojuego; @FXML void dragged (MouseEvent event){ Node node = (Node) event.getSource(); Stage stage = (Stage) node.getScene().getWindow(); stage.setX(event.getScreenX() - x); stage.setY(event.getScreenY() - y); } @FXML void pressed (MouseEvent event) { x = event.getSceneX(); y = event.getSceneY(); } @Override public void initialize(URL location, ResourceBundle resources) { } }
558341f7fd252d85a8b9de9169a84d2c37784c2e
e4415a611b551e57058cc1056ad5888b7e38c7d2
/jboss-javaee-app-ejb/src/main/java/br/com/redhat/mapper/MappedProductOrder.java
601f4a3c3b8b1e43f5e1349e1f4ee047c6f4bc13
[]
no_license
aelkz/redhat-integration-eap-app
787a20cd4ae76dcecc1c9331424fb943a9061d98
8c541d8af4cceaaeb84b8958a1d52e6c157a19ab
refs/heads/master
2022-12-08T11:59:05.402615
2020-03-17T14:27:46
2020-03-17T14:27:46
247,146,313
0
0
null
2022-11-16T12:15:26
2020-03-13T19:21:46
Java
UTF-8
Java
false
false
579
java
package br.com.redhat.mapper; import java.util.ArrayList; import java.util.List; import java.util.Map; import br.com.redhat.model.Product; import br.com.redhat.model.ProducutOrder; public class MappedProductOrder { public List<ProducutOrder> map(final Map<Integer, Product> products) { List<ProducutOrder> arrayPO = new ArrayList<ProducutOrder>(); for(Map.Entry<Integer, Product> m : products.entrySet()) { ProducutOrder po = new ProducutOrder(); po.setQuantity(m.getKey()); po.setProduct(m.getValue()); arrayPO.add(po); } return arrayPO; } }
6d99506a65d4f5041145db7ef113dd2367c684ea
84e064c973c0cc0d23ce7d491d5b047314fa53e5
/latest9.3/hej/net/sf/saxon/trans/LicenseException.java
aeddad5f7d171ac6eb4511a54c20d855fb1a71cd
[]
no_license
orbeon/saxon-he
83fedc08151405b5226839115df609375a183446
250c5839e31eec97c90c5c942ee2753117d5aa02
refs/heads/master
2022-12-30T03:30:31.383330
2020-10-16T15:21:05
2020-10-16T15:21:05
304,712,257
1
1
null
null
null
null
UTF-8
Java
false
false
1,543
java
package net.sf.saxon.trans; /** * Exception thrown when there are problems with the license file */ public class LicenseException extends RuntimeException { private int reason; public static final int EXPIRED = 1; public static final int INVALID = 2; public static final int NOT_FOUND = 3; public static final int WRONG_FEATURES = 4; public static final int CANNOT_READ = 5; public LicenseException(String message, int reason) { super(message); this.reason = reason; } public void setReason(int reason) { this.reason = reason; } public int getReason() { return reason; } } // // The contents of this file are subject to the Mozilla Public License Version 1.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.mozilla.org/MPL/ // // Software distributed under the License is distributed on an "AS IS" basis, // WITHOUT WARRANTY OF ANY KIND, either express or implied. // See the License for the specific language governing rights and limitations under the License. // // The Original Code is: all this file. // // The Initial Developer of the Original Code is Michael H. Kay. // // Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved. // // Contributor(s): changes to allow source and/or stylesheet from stdin contributed by // Gunther Schadow [[email protected]] //
b6eee6f642fac6c20675df1d29f61e7086cfe936
81e58950646e66b0accd6e6df391b4503918d605
/test/src/main/java/com/test/service/mcqservice/MCQService.java
af21bb418966a4e30590c51d7c2c52e53661083f
[]
no_license
saurabh-automator/Nana-Contribution
da8122f1d8a44d91140f5ff8125b99bb1b5781f8
76ee001783432cb61ae7809db281ac64d9e92a12
refs/heads/master
2021-10-25T00:38:07.823083
2018-08-11T14:48:57
2018-08-11T14:48:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
531
java
package com.test.service.mcqservice; import java.util.ArrayList; import java.util.List; import org.springframework.stereotype.Component; import org.springframework.stereotype.Service; import com.test.model.mcqmodel.MCQModel; @Service public interface MCQService { public MCQModel saveQuestion(MCQModel mcqModel); public MCQModel getQuestion(long qid); public ArrayList<MCQModel> getAllQuestions(); public MCQModel updateQuestion(MCQModel mcqModel); public void deleteQuestion(long qid); }
c0a17b44773f9410e5fa20461005f8f68a525715
df271affb32bfb0486a01b4e71155a46ba254850
/consumer-hello/src/main/java/org/consumer/hello/api/HelloController.java
c9b3dde776a8e317dfbd3fe49797d0dcc6692a62
[]
no_license
ffyyhh995511/boot-tech-cloud
1228d43b3d47b6acadaf034836a2b5d00f5a8ef4
328b873e87b916eda817714f26582971f1902bc4
refs/heads/master
2021-08-19T20:12:43.026576
2017-11-27T10:06:18
2017-11-27T10:06:18
111,796,282
0
0
null
null
null
null
UTF-8
Java
false
false
657
java
package org.consumer.hello.api; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.client.RestTemplate; @RestController public class HelloController { @Autowired private RestTemplate restTemplate; @RequestMapping(value = "/hello", method = RequestMethod.GET) public String hello() { return restTemplate.getForEntity("http://SERVICE-HELLO/hello", String.class).getBody(); } }
c2c6b4db238df70dbdb5b46c070310e5a730b9d3
8e6dcaf667137b9ee73550f7856a3294cd342970
/org.abchip.mimo.database/src/org/abchip/mimo/database/definition/impl/IndexColumnDefImpl.java
5590adedeeeab35202730441807550119578668b
[]
no_license
abchip/mimo
98f3db3fad26d2dd8e0196d4a17fba8d7b8fbda0
b9713ecacac883261d5ff04ac0dd6c98fbbba49d
refs/heads/master
2022-12-18T10:19:11.707294
2021-03-18T20:35:21
2021-03-18T20:35:21
114,753,824
0
0
null
2022-12-14T00:59:04
2017-12-19T10:51:40
Grammatical Framework
UTF-8
Java
false
false
7,417
java
/** * Copyright (c) 2017, 2021 ABChip and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http:/** * Copyright (c) 2017, 2021 ABChip and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * */ package org.abchip.mimo.database.definition.impl; import org.abchip.mimo.database.definition.DatabaseDefinitionPackage; import org.abchip.mimo.database.definition.IndexColumnDef; import org.abchip.mimo.database.definition.OrderingType; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.impl.ENotificationImpl; /** * <!-- begin-user-doc --> An implementation of the model object ' * <em><b>Index Field</b></em>'. <!-- end-user-doc --> * <p> * The following features are implemented: * </p> * <ul> * <li>{@link org.abchip.mimo.database.definition.impl.IndexColumnDefImpl#getName <em>Name</em>}</li> * <li>{@link org.abchip.mimo.database.definition.impl.IndexColumnDefImpl#getOrdering <em>Ordering</em>}</li> * <li>{@link org.abchip.mimo.database.definition.impl.IndexColumnDefImpl#getSequence <em>Sequence</em>}</li> * </ul> * * @generated */ public class IndexColumnDefImpl extends DatabaseObjectDefImpl implements IndexColumnDef { /** * The default value of the '{@link #getName() <em>Name</em>}' attribute. * <!-- begin-user-doc --> <!-- end-user-doc --> * @see #getName() * @generated * @ordered */ protected static final String NAME_EDEFAULT = null; /** * The cached value of the '{@link #getName() <em>Name</em>}' attribute. * <!-- begin-user-doc --> <!-- end-user-doc --> * @see #getName() * @generated * @ordered */ protected String name = NAME_EDEFAULT; /** * The default value of the '{@link #getOrdering() <em>Ordering</em>}' attribute. * <!-- begin-user-doc --> <!-- end-user-doc --> * @see #getOrdering() * @generated * @ordered */ protected static final OrderingType ORDERING_EDEFAULT = OrderingType.ASCEND; /** * The cached value of the '{@link #getOrdering() <em>Ordering</em>}' attribute. * <!-- begin-user-doc --> <!-- end-user-doc --> * @see #getOrdering() * @generated * @ordered */ protected OrderingType ordering = ORDERING_EDEFAULT; /** * The default value of the '{@link #getSequence() <em>Sequence</em>}' attribute. * <!-- begin-user-doc --> <!-- end-user-doc --> * @see #getSequence() * @generated * @ordered */ protected static final int SEQUENCE_EDEFAULT = 0; /** * The cached value of the '{@link #getSequence() <em>Sequence</em>}' attribute. * <!-- begin-user-doc --> <!-- end-user-doc --> * @see #getSequence() * @generated * @ordered */ protected int sequence = SEQUENCE_EDEFAULT; /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ protected IndexColumnDefImpl() { super(); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return DatabaseDefinitionPackage.Literals.INDEX_COLUMN_DEF; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ @Override public String getName() { return name; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ @Override public void setName(String newName) { String oldName = name; name = newName; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DatabaseDefinitionPackage.INDEX_COLUMN_DEF__NAME, oldName, name)); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ @Override public OrderingType getOrdering() { return ordering; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void setOrdering(OrderingType newOrdering) { OrderingType oldOrdering = ordering; ordering = newOrdering == null ? ORDERING_EDEFAULT : newOrdering; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DatabaseDefinitionPackage.INDEX_COLUMN_DEF__ORDERING, oldOrdering, ordering)); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ @Override public int getSequence() { return sequence; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ @Override public void setSequence(int newSequence) { int oldSequence = sequence; sequence = newSequence; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DatabaseDefinitionPackage.INDEX_COLUMN_DEF__SEQUENCE, oldSequence, sequence)); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case DatabaseDefinitionPackage.INDEX_COLUMN_DEF__NAME: return getName(); case DatabaseDefinitionPackage.INDEX_COLUMN_DEF__ORDERING: return getOrdering(); case DatabaseDefinitionPackage.INDEX_COLUMN_DEF__SEQUENCE: return getSequence(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case DatabaseDefinitionPackage.INDEX_COLUMN_DEF__NAME: setName((String)newValue); return; case DatabaseDefinitionPackage.INDEX_COLUMN_DEF__ORDERING: setOrdering((OrderingType)newValue); return; case DatabaseDefinitionPackage.INDEX_COLUMN_DEF__SEQUENCE: setSequence((Integer)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case DatabaseDefinitionPackage.INDEX_COLUMN_DEF__NAME: setName(NAME_EDEFAULT); return; case DatabaseDefinitionPackage.INDEX_COLUMN_DEF__ORDERING: setOrdering(ORDERING_EDEFAULT); return; case DatabaseDefinitionPackage.INDEX_COLUMN_DEF__SEQUENCE: setSequence(SEQUENCE_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case DatabaseDefinitionPackage.INDEX_COLUMN_DEF__NAME: return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); case DatabaseDefinitionPackage.INDEX_COLUMN_DEF__ORDERING: return ordering != ORDERING_EDEFAULT; case DatabaseDefinitionPackage.INDEX_COLUMN_DEF__SEQUENCE: return sequence != SEQUENCE_EDEFAULT; } return super.eIsSet(featureID); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuilder result = new StringBuilder(super.toString()); result.append(" (name: "); result.append(name); result.append(", ordering: "); result.append(ordering); result.append(", sequence: "); result.append(sequence); result.append(')'); return result.toString(); } } // IndexFieldImpl
2951e5e3fccffb8c07d32ddb8299ac6d29692a8c
3f9e14725321611b275ec78a5bd0e02403e42b10
/ot-server/src/main/java/com/sprintgether/otserver/model/dto/AuthorDto.java
d2b4ac603ff074a670ab6864b35eba8fdc18802b
[]
no_license
sprintgether/original-think
3f64f59abea7db466e543f1395bc58eeeff109d9
60dffbb4c28d7c11c67d67e7d156d23907593757
refs/heads/main
2023-08-13T10:08:38.626484
2021-08-14T16:50:06
2021-08-14T16:50:06
384,259,587
0
0
null
2021-07-15T08:04:43
2021-07-08T22:10:25
Java
UTF-8
Java
false
false
1,251
java
package com.sprintgether.otserver.model.dto; import com.sprintgether.otserver.model.entity.Author; import lombok.Builder; import lombok.Data; @Builder @Data public class AuthorDto { private String firstName; private String lastName; private String title; private String email; private String institution; public static AuthorDto fromEntity(Author author){ if(author == null){ return null; } return AuthorDto.builder() .firstName(author.getFirstName()) .lastName(author.getLastName()) .title(author.getTitle()) .email(author.getEmail()) .institution(author.getInstitution()) .build(); } public static Author toEntity(AuthorDto authorDto){ if(authorDto == null){ return null; } Author author = new Author(); author.setFirstName(authorDto.getFirstName()); author.setLastName(authorDto.getLastName()); author.setTitle(authorDto.getTitle()); author.setEmail(authorDto.getEmail()); author.setInstitution(authorDto.getInstitution()); return author; } }
31cfc8ae977ec87405200e4e290091a8e5f468cd
7c33b4b8d8e97093c4d7379bb2b639831e3369e4
/ConnectionUtil.java
9e12226ee3bc32426775b0c05614d1ddab56ef5d
[]
no_license
1807-mehrab/project-1-dcheung5386
8610161373950021783421e9d1337617da68dda1
17fa73dcbc5fa144bb8cd50c4e949f5290db0fef
refs/heads/master
2020-03-25T05:52:56.192504
2018-08-03T21:28:23
2018-08-03T21:28:23
143,470,571
0
0
null
null
null
null
UTF-8
Java
false
false
460
java
package com.revature; import java.io.*; import java.sql.*; //import java.util.Properties; import java.sql.DriverManager; public class ConnectionUtil { public static Connection getConnection() throws SQLException, IOException { DriverManager.registerDriver(new oracle.jdbc.OracleDriver()); return DriverManager.getConnection( "jdbc:oracle:thin:@hotelapp.cgn5sd7fgfd0.us-east-2.rds.amazonaws.com:1521:ORCL" , "dcheung5386" , "Password"); } }
4a7074cba93e4946ef2e2d71e02dfeb4e621d891
dba6f33ec43f3a0c4ea81e0e4728f68a58d3f891
/src/tn/enis/dao/ProduitDao.java
9f0a86958644a750db1ad3af83df6982723cb6b0
[]
no_license
imen93/GestionProduit
f036312b0e9f29033b9dee154ad2d9531aee1caa
205e1648dc5f1ad2e98718243affabaa9894142c
refs/heads/master
2021-05-01T22:28:47.037409
2016-12-25T21:43:11
2016-12-25T21:43:11
77,333,407
0
0
null
null
null
null
UTF-8
Java
false
false
155
java
package tn.enis.dao; import java.math.BigDecimal; import tn.enis.model.Produit; public interface ProduitDao extends GenericDao<Produit,BigDecimal> { }
[ "imen jmal" ]
imen jmal
f05ce650013ca1ea52915f548a40744e1124dfc9
aaf83486b5f341cafd4985d29273ccf403c1be1e
/android/app/src/main/java/com/the_last_survivor_18117/MainActivity.java
917bf5aa958100c055e48ccb60d10f924a162f89
[]
no_license
crowdbotics-apps/the-last-survivor-18117
a087533d8c6ed7dc74fe95646233066adce0dec8
e6c9873c1c14fe3a39dae6119a36930ae0d57f4c
refs/heads/master
2022-10-29T10:13:22.448202
2020-06-15T15:43:52
2020-06-15T15:43:52
272,477,918
0
0
null
null
null
null
UTF-8
Java
false
false
391
java
package com.the_last_survivor_18117; import com.facebook.react.ReactActivity; public class MainActivity extends ReactActivity { /** * Returns the name of the main component registered from JavaScript. * This is used to schedule rendering of the component. */ @Override protected String getMainComponentName() { return "the_last_survivor_18117"; } }
fb273b7c6a5c169fbb02d183fee69436bd62ac9d
2a33ffa454a6df0ebdd66e87ff4eb70923949a9a
/src/main/java/kr/jyes/megapaas/service/BoardService.java
6fef9bb6a9a8607df2eac2a9c0f17a8836991bb7
[]
no_license
haejunj/megapaas
deb63766ab9db4e2631cdb0e8f1939a19d252fbf
b082a11edea19983613acab4b0c000d048b0542e
refs/heads/master
2020-12-29T00:01:13.347892
2014-11-17T05:10:35
2014-11-17T05:10:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,019
java
package kr.jyes.megapaas.service; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import kr.jyes.megapaas.model.Board; import kr.jyes.megapaas.repository.BoardRepository; /* * Copyright jyes.co.kr. * All rights reserved * This software is the confidential and proprietary information * of jyes.co.kr. ("Confidential Information") */ @Service public class BoardService implements IBoardService { private Logger logger = LoggerFactory.getLogger(getClass()); @Autowired private BoardRepository boardRepo; public BoardService() { } @Override public List<Board> getAllNotice(int code) { return boardRepo.findAllByBoardCd(code); } @Override public List<Board> getAllNotice(int code, int count) { return boardRepo.findAllByBoardCd(code, count); } @Override public int totalCntByBoardCd(int code) { return boardRepo.totalCntByBoardCd(code); } }
87349baa005bf92674782202a7aa62844e07b9b4
d296a87459c032dd63d77ea95d6711a8f82f82a9
/portal-android/src/main/java/org/code2bytes/portal/android/menu/NavbarAdapter.java
a0dbc37cb49be9ab8f2ef4163802e26a1f8fa44a
[]
no_license
discmuc/portal-android
497378a6e5ba3fea92d71b8d2a7dbcee7bd251a7
9232ad112d2299244b1e65cf7db9589125dc1d8c
refs/heads/master
2020-04-05T15:56:48.835781
2014-04-29T20:53:39
2014-04-29T20:53:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,809
java
package org.code2bytes.portal.android.menu; import org.code2bytes.portal.android.R; import android.app.Activity; import android.content.Context; import android.graphics.Typeface; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.TextView; public class NavbarAdapter extends ArrayAdapter<String> { private Context context; private String[] items; public NavbarAdapter(Context context, int resource, String[] items) { super(context, resource, items); this.context = context; this.items = items; } @Override public View getView(int position, View convertView, ViewGroup parent) { LayoutInflater inflater = ((Activity) context).getLayoutInflater(); View row = inflater.inflate(R.layout.navbar_normal, parent, false); TextView label = (TextView) row.findViewById(R.id.label_navbar_normal); String labelText = items[position]; label.setText(labelText); if (position == 0) { label.setTextSize(18); label.setTypeface(Typeface.DEFAULT_BOLD); } if (position == 1) { label.setTextSize(18); label.setTypeface(Typeface.DEFAULT_BOLD); } if (position == 7) { label.setTextSize(12); label.setCompoundDrawablesWithIntrinsicBounds( R.drawable.ic_action_settings, 0, 0, 0); label.setBackgroundResource(R.drawable.textlines_first); } if (position == 8) { label.setTextSize(12); label.setCompoundDrawablesWithIntrinsicBounds( R.drawable.ic_action_web_site, 0, 0, 0); label.setBackgroundResource(R.drawable.textlines); } if (position == 9) { label.setTextSize(12); label.setCompoundDrawablesWithIntrinsicBounds( R.drawable.ic_action_about, 0, 0, 0); label.setBackgroundResource(R.drawable.textlines); } return row; } }
7e7fb9788354698a9ee2782ab4dd47c7b9c7c2f9
c5197a44f6e04546d71b11c519e5cd87b29a1e54
/PlaceHolderView-2.x/app/src/main/java/com/example/biabe/DatabaseFunctionsGenerator/RetrofitInstance.java
4ed71a6fa7fdde5c2a7edd7940894f8c69338ffa
[ "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
Lon19/team-1
1fec709bfe78730e14d226ca09ec4451315c8ee4
35d8a042c1b40b318d65fe34884a151deb4e0315
refs/heads/master
2022-04-14T04:42:47.925827
2020-02-28T14:16:30
2020-02-28T14:16:30
218,851,791
0
0
null
null
null
null
UTF-8
Java
false
false
755
java
package com.example.biabe.DatabaseFunctionsGenerator; import retrofit2.Retrofit; import retrofit2.converter.gson.GsonConverterFactory; import com.google.gson.Gson; import com.google.gson.GsonBuilder; public class RetrofitInstance { public static Retrofit GetRetrofitInstance() { Retrofit retrofit; Retrofit.Builder builder; Gson gson; gson = new GsonBuilder() .setDateFormat("yyyy-MM-dd HH:mm:ss") .create(); builder = new Retrofit.Builder() .baseUrl("http://biabeniamin.go.ro/techsylvania19/") .addConverterFactory(GsonConverterFactory.create(gson)); retrofit = builder.build(); return retrofit; } }
770510525cdc0f1955f9189a6a8b26618e2b96d6
40f5611a252ea238546dc995bdb6a86b695687c8
/Aliengenas.java
0b9d57f310acd4874747f6c0b37a3bab7419c8be
[]
no_license
JDgomez2002/Proyecto-Greenfoot
f0bab0269a96e5d6ff86c2b1316025720d320e75
aa5700deb9fd7dbef75074a9a60c429677e06a35
refs/heads/main
2023-06-29T08:01:16.638103
2021-08-02T02:49:17
2021-08-02T02:49:17
388,961,962
0
0
null
null
null
null
UTF-8
Java
false
false
1,098
java
import greenfoot.*; public class Aliengenas extends Actor { private int vx=0; private boolean toRemove = false; //25.50 public Aliengenas() { } public Aliengenas(int v){ vx=v; } public void addedToWorld(World MiUniverso){ setRotation(0); } public void move(){ setLocation(getX()+vx,getY()); Actor actor=getOneIntersectingObject(MiCohete.class); if (actor!=null) { ((MiCohete)actor).Hancur(); Hancur(); } if(getX()<-200)toRemove=true;//-200 } public void Hancur() { for(int i=0;i<10;i++) { int px = -20+Greenfoot.getRandomNumber(40);//-20.40 int py = -20+Greenfoot.getRandomNumber(40); getWorld().addObject(new MiEfecto1(getImage()),getX()+px,getY()+py); } getWorld().addObject(new MiEfecto2(),getX(),getY()); toRemove = true; } public void act() { if(!toRemove)move(); else getWorld().removeObject(this); } }
5df77315b84a1652931d0ffd41d62accc442ce25
936ee2816b7aee88c21e13ea23d10d25ed1309be
/APAP_Individu1/src/main/java/com/example/model/StudentModel.java
23659c6f6588f536867033bc9b6ecaf52beedbd9
[]
no_license
apap-ekstensi-2018/tugas1_1706106633
200320afe000f81c9b1a8ae868d9deaf5262b9e3
f634929ba97f6623dd78522156cf2c02811f69fa
refs/heads/master
2020-03-08T07:54:23.480295
2018-04-04T16:49:55
2018-04-04T16:49:55
128,006,820
0
0
null
null
null
null
UTF-8
Java
false
false
443
java
package com.example.model; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @Data @AllArgsConstructor @NoArgsConstructor public class StudentModel { private String npm, nama, tempat_lahir, tanggal_lahir, agama, golongan_darah, status, tahun_masuk, jalur_masuk, id, jenis_kelamin, id_prodi, nama_prodi, nama_fakultas, nama_univ, kode_prodi, kode_fakultas, kode_univ; }
7b5563eb0ff1906d36dcb690ca0d0e9f70e14038
42b6f2af40113c457f4462258a63968db2993487
/virtdata-lang/src/main/java/io/virtdata/ast/Expression.java
786d160e7e31e8d6f0bd49a56b39cfe5484880db
[ "Apache-2.0" ]
permissive
weideng1/virtdata-java
9c71d625072b601c0662e94bada43ad752382a2c
7476d9f05f8fc0709d87939f7bf28467f232824d
refs/heads/master
2020-09-16T12:55:39.365228
2019-11-22T20:55:19
2019-11-22T20:55:19
223,776,695
0
0
Apache-2.0
2019-11-24T16:44:09
2019-11-24T16:44:09
null
UTF-8
Java
false
false
602
java
package io.virtdata.ast; public class Expression { private Assignment assignment; private FunctionCall call; public Expression() {} public Expression(Assignment assignment, FunctionCall call) { this.assignment = assignment; this.call = call; } public Assignment getAssignment() { return assignment; } public void setAssignment(Assignment assignment) { this.assignment = assignment; } public FunctionCall getCall() { return call; } public void setCall(FunctionCall call) { this.call = call; } }
319f8f106bf004b3c779e545e54f2a9eb0831896
c33e4d4142512b6ecabcd11c864cda7ad97b7598
/src/main/java/com/webfluxWithMongo/service/PlaylistServiceImpl.java
7a7374ffac6ef00634bdbbeb06b5412230ab57ae
[]
no_license
rafabart/webfluxWithMongo
c8fe953b584fe2002a4164b9fb2c8c970a030e50
daac578d7116f7eb3f74db3824e1c31da45ce55d
refs/heads/master
2022-12-09T23:17:04.502400
2020-08-27T00:06:38
2020-08-27T00:06:38
287,400,996
0
0
null
null
null
null
UTF-8
Java
false
false
875
java
package com.webfluxWithMongo.service; import com.webfluxWithMongo.document.PlaylistDocument; import com.webfluxWithMongo.repository.PlaylistRepository; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @Service @RequiredArgsConstructor public class PlaylistServiceImpl implements PlaylistService { final private PlaylistRepository playlistRepository; @Override public Flux<PlaylistDocument> findAll() { return playlistRepository.findAll(); } @Override public Mono<PlaylistDocument> findById(final String id) { return playlistRepository.findById(id); } @Override public Mono<PlaylistDocument> save(final PlaylistDocument playlistDocument) { return playlistRepository.save(playlistDocument); } }
0e536b0b9bd94945e3e96f91ab863a95f04aa5e4
311090d312171ba2c1a8202d10509cae932bce1c
/app/src/main/java/com/endive/eventplanner/util/ImageLoadingUtils.java
d182b92352ae4bb48cbafae00883493555fb5530
[]
no_license
yogesh-duriya/EventTicketApp
41c998daf1b3e874f542efc753eb919be7e61055
012f39d191dd32d942a7b264b3f1545ccfffeeaf
refs/heads/master
2020-03-26T05:28:36.432039
2018-08-12T21:49:21
2018-08-12T21:49:21
144,559,022
0
0
null
null
null
null
UTF-8
Java
false
false
2,043
java
package com.endive.eventplanner.util; import android.content.Context; import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.util.TypedValue; import com.endive.eventplanner.R; public class ImageLoadingUtils { private Context context; public Bitmap icon; public ImageLoadingUtils(Context context){ this.context = context; icon = BitmapFactory.decodeResource(context.getResources(), R.mipmap.logo); } public int convertDipToPixels(float dips){ Resources r = context.getResources(); return (int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dips, r.getDisplayMetrics()); } public int calculateInSampleSize(BitmapFactory.Options options, int reqWidth, int reqHeight) { final int height = options.outHeight; final int width = options.outWidth; int inSampleSize = 1; if (height > reqHeight || width > reqWidth) { final int heightRatio = Math.round((float) height / (float) reqHeight); final int widthRatio = Math.round((float) width / (float) reqWidth); inSampleSize = heightRatio < widthRatio ? heightRatio : widthRatio; } final float totalPixels = width * height; final float totalReqPixelsCap = reqWidth * reqHeight * 2; while (totalPixels / (inSampleSize * inSampleSize) > totalReqPixelsCap) { inSampleSize++; } return inSampleSize; } public Bitmap decodeBitmapFromPath(String filePath){ Bitmap scaledBitmap = null; BitmapFactory.Options options = new BitmapFactory.Options(); options.inJustDecodeBounds = true; scaledBitmap = BitmapFactory.decodeFile(filePath,options); options.inSampleSize = calculateInSampleSize(options, convertDipToPixels(150), convertDipToPixels(200)); options.inDither = false; // options.inPurgeable = true; // options.inInputShareable = true; options.inJustDecodeBounds = false; scaledBitmap = BitmapFactory.decodeFile(filePath, options); return scaledBitmap; } }
817851fd828e1c49cf2ff2f8c530542eec6dd5b8
0ab9b096276583a795ea962b14278da34f8997c4
/src/main/java/org/dependencytrack/parser/nvd/NvdParser.java
4d16160a3abfdb307294ddccda2840c8117302da
[ "Apache-2.0" ]
permissive
Ramos-dev/dependency-track
e048b7006dad526b4f6832a307ef3e083721ffb9
01b86792fa03aae76cc800b8249b72c751b4c8ae
refs/heads/master
2022-10-05T18:04:51.530566
2019-01-05T03:28:45
2019-01-05T03:28:45
164,811,876
0
1
Apache-2.0
2022-09-15T09:03:07
2019-01-09T07:30:21
Java
UTF-8
Java
false
false
8,777
java
/* * This file is part of Dependency-Track. * * 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. * * Copyright (c) Steve Springett. All Rights Reserved. */ package org.dependencytrack.parser.nvd; import alpine.event.framework.Event; import alpine.logging.Logger; import org.apache.commons.lang.StringUtils; import org.dependencytrack.event.IndexEvent; import org.dependencytrack.model.Cwe; import org.dependencytrack.model.Vulnerability; import org.dependencytrack.persistence.QueryManager; import us.springett.cvss.Cvss; import javax.json.Json; import javax.json.JsonArray; import javax.json.JsonObject; import javax.json.JsonReader; import javax.json.JsonString; import java.io.File; import java.io.FileInputStream; import java.io.InputStream; import java.sql.Date; import java.time.OffsetDateTime; import java.time.format.DateTimeParseException; /** * Parser and processor of NVD data feeds. * * @author Steve Springett * @since 3.0.0 */ public final class NvdParser { private static final Logger LOGGER = Logger.getLogger(NvdParser.class); public void parse(File file) { if (!file.getName().endsWith(".json")) { return; } LOGGER.info("Parsing " + file.getName()); try (QueryManager qm = new QueryManager(); InputStream in = new FileInputStream(file)) { final JsonReader reader = Json.createReader(in); final JsonObject root = reader.readObject(); final JsonArray cveItems = root.getJsonArray("CVE_Items"); for (int i = 0; i < cveItems.size(); i++) { final Vulnerability vulnerability = new Vulnerability(); vulnerability.setSource(Vulnerability.Source.NVD); final JsonObject cveItem = cveItems.getJsonObject(i); // CVE ID final JsonObject cve = cveItem.getJsonObject("cve"); final JsonObject meta0 = cve.getJsonObject("CVE_data_meta"); final JsonString meta1 = meta0.getJsonString("ID"); vulnerability.setVulnId(meta1.getString()); // CVE Published and Modified dates final String publishedDateString = cveItem.getString("publishedDate"); final String lastModifiedDateString = cveItem.getString("lastModifiedDate"); try { if (StringUtils.isNotBlank(publishedDateString)) { vulnerability.setPublished(Date.from(OffsetDateTime.parse(publishedDateString).toInstant())); } if (StringUtils.isNotBlank(lastModifiedDateString)) { vulnerability.setUpdated(Date.from(OffsetDateTime.parse(lastModifiedDateString).toInstant())); } } catch (DateTimeParseException | NullPointerException | IllegalArgumentException e) { LOGGER.error("Unable to parse dates from NVD data feed", e); } // CVE Description final JsonObject descO = cve.getJsonObject("description"); final JsonArray desc1 = descO.getJsonArray("description_data"); final StringBuilder descriptionBuilder = new StringBuilder(); for (int j = 0; j < desc1.size(); j++) { final JsonObject desc2 = desc1.getJsonObject(j); if ("en".equals(desc2.getString("lang"))) { descriptionBuilder.append(desc2.getString("value")); if (j < desc1.size() - 1) { descriptionBuilder.append("\n\n"); } } } vulnerability.setDescription(descriptionBuilder.toString()); // CVE Impact parseCveImpact(cveItem, vulnerability); // CWE final JsonObject prob0 = cve.getJsonObject("problemtype"); final JsonArray prob1 = prob0.getJsonArray("problemtype_data"); for (int j = 0; j < prob1.size(); j++) { final JsonObject prob2 = prob1.getJsonObject(j); final JsonArray prob3 = prob2.getJsonArray("description"); for (int k = 0; k < prob3.size(); k++) { final JsonObject prob4 = prob3.getJsonObject(k); if ("en".equals(prob4.getString("lang"))) { //vulnerability.setCwe(prob4.getString("value")); final String cweString = prob4.getString("value"); if (cweString != null && cweString.startsWith("CWE-")) { try { final int cweId = Integer.parseInt(cweString.substring(4, cweString.length()).trim()); final Cwe cwe = qm.getCweById(cweId); vulnerability.setCwe(cwe); } catch (NumberFormatException e) { // throw it away } } } } } // References final JsonObject ref0 = cve.getJsonObject("references"); final JsonArray ref1 = ref0.getJsonArray("reference_data"); final StringBuilder sb = new StringBuilder(); for (int l = 0; l < ref1.size(); l++) { final JsonObject ref2 = ref1.getJsonObject(l); for (String s : ref2.keySet()) { if ("url".equals(s)) { // Convert reference to Markdown format final String url = ref2.getString("url"); sb.append("* [").append(url).append("](").append(url).append(")\n"); } } } final String references = sb.toString(); if (references.length() > 0) { vulnerability.setReferences(references.substring(0, references.lastIndexOf("\n"))); } // Update the vulnerability LOGGER.debug("Synchronizing: " + vulnerability.getVulnId()); qm.synchronizeVulnerability(vulnerability, false); } } catch (Exception e) { LOGGER.error("Error parsing NVD JSON data"); LOGGER.error(e.getMessage()); } Event.dispatch(new IndexEvent(IndexEvent.Action.COMMIT, Vulnerability.class)); } private void parseCveImpact(JsonObject cveItem, Vulnerability vuln) { final JsonObject imp0 = cveItem.getJsonObject("impact"); final JsonObject imp1 = imp0.getJsonObject("baseMetricV2"); if (imp1 != null) { final JsonObject imp2 = imp1.getJsonObject("cvssV2"); if (imp2 != null) { final Cvss cvss = Cvss.fromVector(imp2.getJsonString("vectorString").getString()); vuln.setCvssV2Vector(cvss.getVector()); // normalize the vector but use the scores from the feed vuln.setCvssV2BaseScore(imp2.getJsonNumber("baseScore").bigDecimalValue()); } vuln.setCvssV2ExploitabilitySubScore(imp1.getJsonNumber("exploitabilityScore").bigDecimalValue()); vuln.setCvssV2ImpactSubScore(imp1.getJsonNumber("impactScore").bigDecimalValue()); } final JsonObject imp3 = imp0.getJsonObject("baseMetricV3"); if (imp3 != null) { final JsonObject imp4 = imp3.getJsonObject("cvssV3"); if (imp4 != null) { final Cvss cvss = Cvss.fromVector(imp4.getJsonString("vectorString").getString()); vuln.setCvssV3Vector(cvss.getVector()); // normalize the vector but use the scores from the feed vuln.setCvssV3BaseScore(imp4.getJsonNumber("baseScore").bigDecimalValue()); } vuln.setCvssV3ExploitabilitySubScore(imp3.getJsonNumber("exploitabilityScore").bigDecimalValue()); vuln.setCvssV3ImpactSubScore(imp3.getJsonNumber("impactScore").bigDecimalValue()); } } }
f9d6a55ef5fefab2b27224a166abf794f37d56b0
005115c50b0e387c8a006bfc0af294117ab234f5
/src/222.java
835b36fdd60eaad3de2009df767940adee7ef846
[]
no_license
henrysun18/leetcode
304c6b7f85f81e5360c2a03a00c9e470f90215af
f52c6b6423e6acc12e5ea8483f40ddb8ee255cd1
refs/heads/master
2021-06-15T17:33:55.635890
2019-06-02T23:05:55
2019-06-02T23:05:55
133,430,046
0
0
null
null
null
null
UTF-8
Java
false
false
3,100
java
class CountCompleteTreeNodes { public int countNodes(TreeNode root) { //if i want to avoid global variables, and at the same time improve time complexity in the worst case, need another approach //compare left depth and right depth // if same, return 2^(depth+1)-1 // if diff, return 1 + countNodes(root.left) + countNodes(root.right) //runtime is O(lgn * lgn) since each countNodes pass is lgn time due to checking left/right depths //and we'll make lgn calls to countNodes, since eventually left/right depth will be the same, and it'll capture a LOT of nodes if (root == null) return 0; int leftDepth = getLeftDepth(root.left); int rightDepth = getRightDepth(root.right); if (leftDepth == rightDepth) { return (1 << leftDepth+1) - 1; } return 1 + countNodes(root.left) + countNodes(root.right); } private int getLeftDepth(TreeNode node) { if (node == null) return 0; return 1 + getLeftDepth(node.left); } private int getRightDepth(TreeNode node) { if (node == null) return 0; return 1 + getRightDepth(node.right); } /* old solution which was still O(n) worst case time, and uses global vars private int rightHeight = 0; private int missingLeaves = 0; private boolean done = false; public int countNodes(TreeNode root) { //assume that we're GIVEN a complete binary tree. //are there any cases where we can't simply count the total number of nodes in the tree? //root is complete iff left is complete && right is complete //literally just bfs and count the total number of nodes? //ok i kinda get the catch now //it's complete, so we just need to do a backwards inorder traversal to break early. i.e. don't need to always run in O(n) //for the example case we'll know as soon as we see 1-3-null-6-null in the backwards traversal that the solution is 2*(height+1)-1 - missing(which is 1) //worst case is O(n) still tho //but the best case is O(h), i.e. O(lgn) //so we can do a simple backwards inorder traversal using dfs (recursion), taking note the number of missing leaves. //count the missing leaves until we see a leaf, then break early if (root == null) return 0; if (root.left == null && root.right == null) return 1; TreeNode curr = root; while (curr.right != null) { curr = curr.right; rightHeight++; } dfs(root, 0); return (1 << rightHeight+2)-1 - missingLeaves; //i.e. 2^(rightHeight+1) - 1 + the leaves } private void dfs(TreeNode node, int height) { if (done || node == null) return; if (node.right == null) { //increment missingLeaves if needed now //note that with this flow, a perfect tree will not have missingLeaves if (height == rightHeight) { missingLeaves++; } else { done = true; } } if (node.left == null) { if (height == rightHeight) { missingLeaves++; } } dfs(node.right, height+1); dfs(node.left, height+1); } */ public int countNodesDFSNaive(TreeNode root) { if (root == null) return 0; if (root.left == null && root.right == null) return 1; return 1 + countNodes(root.left) + countNodes(root.right); } }
ad95875890b0216e6b115348edd72b1a63b03b30
f2c3be79638c8a36e9aa7630b117f0ebb13fae30
/src/main/java/br/com/donus/account/data/dto/account/AccountRequest.java
59cfb15bf6875b9569527a7502f8676a3a9e6516
[]
no_license
renatohaber/donus-code-challenge
d8e7bf9b4583400834657d5e2b24da07fc841afd
b8b3cb2c4811050189a9ecc5e51a0978558145f9
refs/heads/main
2023-01-24T10:59:34.980950
2020-11-30T22:43:34
2020-11-30T22:43:34
315,790,464
0
0
null
null
null
null
UTF-8
Java
false
false
1,021
java
package br.com.donus.account.data.dto.account; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; import com.sun.istack.NotNull; import lombok.*; import javax.validation.constraints.Size; import java.math.BigDecimal; @Getter @ToString @EqualsAndHashCode @AllArgsConstructor(access = AccessLevel.PRIVATE) @Builder(builderClassName = "AccountRequestBuilder", toBuilder = true) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonDeserialize(builder = AccountRequest.AccountRequestBuilder.class) public class AccountRequest { @NotNull @Size(min = 3, max = 255) private final String name; @NotNull private final String taxId; private final BigDecimal balance; @JsonPOJOBuilder(withPrefix = "") @JsonIgnoreProperties(ignoreUnknown = true) public static class AccountRequestBuilder { } }
70fc7392f76a249ec7de6f978d7cacc1ddc41894
34d9d1dbd41b2781f5d1839367942728ee199c2c
/LTSA-Jeff/src/lts/ltl/Formula.java
1c8f1e460fcbaf31f16d7919db11a0463f95d126
[]
no_license
Intrinsarc/intrinsarc-evolve
4808c0698776252ac07bfb5ed2afddbc087d5e21
4492433668893500ebc78045b6be24f8b3725feb
refs/heads/master
2020-05-23T08:14:14.532184
2015-09-08T23:07:35
2015-09-08T23:07:35
70,294,516
1
1
null
null
null
null
UTF-8
Java
false
false
6,369
java
package lts.ltl; import java.util.*; import lts.*; /* * abstract syntax tree for LTL formlae */ abstract public class Formula implements Comparable { private int id = -1; public void setId(int i) { id = i; } public int getId() { return id; } private int untilsIndex = -1; private BitSet rightOfWhichUntil; private boolean _visited = false; boolean visited() { return _visited; } void setVisited() { _visited = true; } int getUI() { return untilsIndex; } void setUI(int i) { untilsIndex = i; } void setRofUI(int i) { if (rightOfWhichUntil == null) rightOfWhichUntil = new BitSet(); rightOfWhichUntil.set(i); } BitSet getRofWU() { return rightOfWhichUntil; } boolean isRightOfUntil() { return rightOfWhichUntil != null; } public int compareTo(Object obj) { return id - ((Formula) obj).id; } abstract Formula accept(Visitor v); boolean isLiteral() { return false; } Formula getSub1() { return accept(Sub1.get()); } Formula getSub2() { return accept(Sub2.get()); } } /* * visitor interface to Formula */ interface Visitor { Formula visit(True t); Formula visit(False f); Formula visit(Proposition p); Formula visit(Not n); Formula visit(And a); Formula visit(Or o); Formula visit(Until u); Formula visit(Release r); Formula visit(Next n); } /* * get left sub formula or right for R */ class Sub1 implements Visitor { private static Sub1 inst; private Sub1() { } public static Sub1 get() { if (inst == null) inst = new Sub1(); return inst; } public Formula visit(True t) { return null; } public Formula visit(False f) { return null; } public Formula visit(Proposition p) { return null; } public Formula visit(Not n) { return n.getNext(); } public Formula visit(Next n) { return n.getNext(); } public Formula visit(And a) { return a.getLeft(); } public Formula visit(Or o) { return o.getLeft(); } public Formula visit(Until u) { return u.getLeft(); } public Formula visit(Release r) { return r.getRight(); } } /* * get right sub formula or left for R */ class Sub2 implements Visitor { private static Sub2 inst; private Sub2() { } public static Sub2 get() { if (inst == null) inst = new Sub2(); return inst; } public Formula visit(True t) { return null; } public Formula visit(False f) { return null; } public Formula visit(Proposition p) { return null; } public Formula visit(Not n) { return null; } public Formula visit(Next n) { return null; } public Formula visit(And a) { return a.getRight(); } public Formula visit(Or o) { return o.getRight(); } public Formula visit(Until u) { return u.getRight(); } public Formula visit(Release r) { return r.getLeft(); } } /* * represent constant True */ class True extends Formula { private static True t; private True() { } public static True make() { if (t == null) { t = new True(); t.setId(1); } return t; } public String toString() { return "true"; } Formula accept(Visitor v) { return v.visit(this); } boolean isLiteral() { return true; } } /* * represent constant False */ class False extends Formula { private static False f; private False() { } public static False make() { if (f == null) { f = new False(); f.setId(0); } return f; } public String toString() { return "false"; } Formula accept(Visitor v) { return v.visit(this); } boolean isLiteral() { return true; } } /* * represent proposition */ class Proposition extends Formula { Symbol sym; Proposition(Symbol s) { sym = s; } public String toString() { return sym.toString(); } Formula accept(Visitor v) { return v.visit(this); } boolean isLiteral() { return true; } } /* * represent not ! */ class Not extends Formula { Formula next; Formula getNext() { return next; } Not(Formula f) { next = f; } public String toString() { return "!" + next.toString(); } Formula accept(Visitor v) { return v.visit(this); } boolean isLiteral() { return next.isLiteral(); } } /* * represent next X */ class Next extends Formula { Formula next; Formula getNext() { return next; } Next(Formula f) { next = f; } public String toString() { return "X " + next.toString(); } Formula accept(Visitor v) { return v.visit(this); } } /* * represent or \/ | */ class Or extends Formula { Formula left, right; Formula getLeft() { return left; } Formula getRight() { return right; } Or(Formula l, Formula r) { left = l; right = r; } public String toString() { return "(" + left.toString() + " | " + right.toString() + ")"; } Formula accept(Visitor v) { return v.visit(this); } } /* * represent and /\ & */ class And extends Formula { Formula left, right; Formula getLeft() { return left; } Formula getRight() { return right; } And(Formula l, Formula r) { left = l; right = r; } public String toString() { return "(" + left.toString() + " & " + right.toString() + ")"; } Formula accept(Visitor v) { return v.visit(this); } } /* * represent until U */ class Until extends Formula { Formula left, right; Formula getLeft() { return left; } Formula getRight() { return right; } Until(Formula l, Formula r) { left = l; right = r; } public String toString() { return "(" + left.toString() + " U " + right.toString() + ")"; } Formula accept(Visitor v) { return v.visit(this); } } /* * represent release R */ class Release extends Formula { Formula left, right; Formula getLeft() { return left; } Formula getRight() { return right; } Release(Formula l, Formula r) { left = l; right = r; } public String toString() { return "(" + left.toString() + " R " + right.toString() + ")"; } Formula accept(Visitor v) { return v.visit(this); } }
[ "devnull@localhost" ]
devnull@localhost
95dece5440f2441a10fc1aa487ab6fa4b3f23ca9
7688b2d3ab726decf63c1dccda4a0b20a54e6487
/src/test/java/com/example/demo/test/mt/TestMain1.java
0ae60e49797d156c38460bd9ccc91893a4884dc7
[]
no_license
iProcess/demo
f70988191a63db534a8960c042386ed4a7dee6ee
0e22f8ab6675d3ba0f2e497b10e518f750442dae
refs/heads/master
2023-06-22T13:39:34.278190
2021-06-15T15:26:07
2021-06-15T15:26:07
240,826,857
0
1
null
2023-06-14T16:39:11
2020-02-16T03:45:15
Java
UTF-8
Java
false
false
1,753
java
package com.example.demo.test.mt; import java.util.concurrent.TimeUnit; /** * A、B、C三个线程,分别打印A、B、C,要求打印出ABC,打印100次 * 另一个例子: * com.example.demo.test.ali.aly.ThreadPrint */ public class TestMain1 { private int count = 10; /** * volatile保证了内存可见性,当a值变更时,其它线程能立即获取到最新值。 * 注:即使是静态变量也不能保证值发生变化后,其它线程能立即获取到最新值。 */ private volatile int sign = 0; Thread threadA = new Thread(() -> { while (true){ if(sign == 0){ System.out.print("A"); sign++; } sleep(); } } ); Thread threadB = new Thread(() -> { while (true){ if(sign == 1){ System.out.print("B"); sign++; } sleep(); } }); Thread threadC = new Thread(() -> { while (true){ if(sign == 2){ System.out.println("C"); count--; if(count == 0){ System.exit(0); } sign = 0; } sleep(); } }); public void run(){ threadA.start(); threadB.start(); threadC.start(); } public void sleep(){ try { TimeUnit.SECONDS.sleep(1); } catch (InterruptedException e) { e.printStackTrace(); } } public static void main(String[] args) { TestMain1 main = new TestMain1(); main.run(); } }
[ "“[email protected]”" ]
7f30859d7a84ef9abda8684f696ebcc6e53375b5
71753d1c7f6a621d1eec3bccb77cb3eb7643ef74
/CRVUnidad3/src/dao/PersonajeDAO.java
51281afc5b07a93824750416a8ebc47f618f8ab3
[]
no_license
carolina2905/DesarrllodeAplicaciones2
c0fa236d7be6b90a815af3a1d8e89d87b42d357f
d512921f45ceef3703c1e3a3969f2dce0bd7fd13
refs/heads/master
2021-08-22T08:25:10.161270
2017-11-29T18:41:18
2017-11-29T18:41:18
104,520,539
0
0
null
null
null
null
UTF-8
Java
false
false
303
java
package dao; import java.util.List; import model.Personaje; public interface PersonajeDAO { void createPersonaje(Personaje personaje); Personaje readPersonaje(Long id); List<Personaje> readAllPersonajes(); void updatePersonaje(Personaje personaje); void deletePersonaje(Long id); }
57c4c15c065370695b6ebd49adf53de6cbc0ea19
df461701b4b9304914af7c8b20e313f7e614b623
/java/HAP/onlineLearning/core/src/main/java/csz/mdm/controllers/MdmClassStudentController.java
079a88da242fac7de8ceb221c0d75dad7ba5ea3a
[]
no_license
dom9596/GraduationProject
5780e8a1e7d81a4d447f0222fef35d637d725bb4
fdcc8d14a10b7c67e821d8dea0f0f89cda7a8b59
refs/heads/master
2020-03-30T03:09:01.804794
2019-03-03T04:45:18
2019-03-03T04:45:18
150,671,807
0
0
null
2019-01-10T16:34:52
2018-09-28T02:02:17
null
UTF-8
Java
false
false
3,609
java
package csz.mdm.controllers; import csz.mdm.dto.MdmClass; import csz.mdm.dto.MdmUser; import csz.mdm.mapper.MdmUserMapper; import csz.mdm.service.IMdmUserService; import org.springframework.stereotype.Controller; import com.hand.hap.system.controllers.BaseController; import com.hand.hap.core.IRequest; import com.hand.hap.system.dto.ResponseData; import csz.mdm.dto.MdmClassStudent; import csz.mdm.service.IMdmClassStudentService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import javax.servlet.http.HttpServletRequest; import org.springframework.validation.BindingResult; import java.util.List; @Controller public class MdmClassStudentController extends BaseController { @Autowired private IMdmClassStudentService service; @Autowired private MdmUserMapper mdmUserMapper; @RequestMapping(value = "/xx/mdm/class/student/insertClassStudent") @ResponseBody public ResponseData insertClassStudent( Long classId, String userCode, HttpServletRequest request) { IRequest requestCtx = createRequestContext(request); System.out.println("classId"+classId+"userCode"+userCode); MdmUser user = new MdmUser(); user.setUserCode(userCode); MdmUser mdmUser = mdmUserMapper.selectOne(user); MdmClassStudent mdmClassStudent = new MdmClassStudent(); mdmClassStudent.setClassId(classId); mdmClassStudent.setUserId(mdmUser.getUserId()); service.insertSelective(requestCtx, mdmClassStudent); return new ResponseData(); } @RequestMapping(value = "/xx/mdm/class/student/queryClassStudent") @ResponseBody public ResponseData queryClassStudent(MdmClassStudent dto, @RequestParam(defaultValue = DEFAULT_PAGE) int page, @RequestParam(defaultValue = DEFAULT_PAGE_SIZE) int pageSize, HttpServletRequest request) { IRequest requestContext = createRequestContext(request); return new ResponseData(service.queryClassStudent(requestContext, dto, page, pageSize)); } @RequestMapping(value = "/xx/mdm/class/student/query") @ResponseBody public ResponseData query(MdmClassStudent dto, @RequestParam(defaultValue = DEFAULT_PAGE) int page, @RequestParam(defaultValue = DEFAULT_PAGE_SIZE) int pageSize, HttpServletRequest request) { IRequest requestContext = createRequestContext(request); return new ResponseData(service.select(requestContext, dto, page, pageSize)); } @RequestMapping(value = "/xx/mdm/class/student/submit") @ResponseBody public ResponseData update(@RequestBody List<MdmClassStudent> dto, BindingResult result, HttpServletRequest request) { getValidator().validate(dto, result); if (result.hasErrors()) { ResponseData responseData = new ResponseData(false); responseData.setMessage(getErrorMessage(result, request)); return responseData; } IRequest requestCtx = createRequestContext(request); return new ResponseData(service.batchUpdate(requestCtx, dto)); } @RequestMapping(value = "/xx/mdm/class/student/remove") @ResponseBody public ResponseData delete(HttpServletRequest request, @RequestBody List<MdmClassStudent> dto) { service.batchDelete(dto); return new ResponseData(); } }
da7302ee8822455091b4a481d22e776241fca608
91fcdbda3537bb6e820a4f35a57c627f4d602e4e
/app/src/main/java/com/example/music_player/MainActivity.java
3fd26622d946c7434c2882d4f5692a2389659d09
[]
no_license
mohamedEssam2/MusicPlayer
5bc2910fe759e15059e9e66ff289a876a1c96a0e
c9f359afc49979515ad6273443fc12c7902e03f0
refs/heads/master
2022-11-26T19:38:20.915757
2020-08-12T05:00:23
2020-08-12T05:00:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,905
java
package com.example.music_player; import android.app.ActivityManager; import android.content.Intent; import android.content.pm.PackageManager; import android.os.Bundle; import com.example.music_player.songs.Model.Song; import com.example.music_player.songs.Presenter.SongPresenter; import androidx.annotation.NonNull; import androidx.core.app.ActivityCompat; import androidx.core.view.GravityCompat; import androidx.appcompat.app.ActionBarDrawerToggle; import android.view.KeyEvent; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.MotionEvent; import android.view.View; import android.widget.SearchView; import android.widget.Toast; import com.example.music_player.songs.UI.EnternalsongCallBack; import com.example.music_player.songs.UI.SongListRecycleViewAdaptor; import com.example.music_player.songs.di.DaggerSongListRecycleViewAdaptorComponent; //import com.example.music_player.songs.di.DaggerSongPresenterComponent; import com.example.music_player.songs.di.DaggerSongPresenterComponent; import com.google.android.material.navigation.NavigationView; import androidx.core.view.MenuItemCompat; import androidx.drawerlayout.widget.DrawerLayout; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import java.util.ArrayList; import static android.Manifest.permission.READ_EXTERNAL_STORAGE; public class MainActivity extends AppCompatActivity implements EnternalsongCallBack { private ArrayList<Song> list; private SongPresenter presenter; private RecyclerView songlist ; private SongListRecycleViewAdaptor adaptor ; private SearchView searchview; private LinearLayoutManager linearLayoutManager= new LinearLayoutManager(this); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); ActivityCompat.requestPermissions(this,new String[]{READ_EXTERNAL_STORAGE},100); } @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); if(requestCode==100) { if(grantResults[0]== PackageManager.PERMISSION_GRANTED) { show(); } } } @Override protected void onSaveInstanceState(@NonNull Bundle outState) { super.onSaveInstanceState(outState); outState.putParcelable("currentitem",this.linearLayoutManager.onSaveInstanceState()); } @Override protected void onRestoreInstanceState(@NonNull Bundle savedInstanceState) { super.onRestoreInstanceState(savedInstanceState); this.linearLayoutManager.onRestoreInstanceState(savedInstanceState.getParcelable("currentitem")); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.main,menu); this.searchview = (SearchView) MenuItemCompat.getActionView(menu.findItem(R.id.app_bar_search)); search(); return super.onCreateOptionsMenu(menu); } @Override public boolean onOptionsItemSelected(@NonNull MenuItem item) { if(item.getItemId()==R.id.exit) { exit(); } return super.onOptionsItemSelected(item); } public void show() { this.list= new ArrayList<>(); this.presenter= DaggerSongPresenterComponent.builder().getContext(this).getArrayList(this.list).finish().getSongPresenter(); this.list = this.presenter.getSongs(); initRecycleView(); } public void initRecycleView () { this.songlist = (RecyclerView) findViewById(R.id.songList); this.adaptor = DaggerSongListRecycleViewAdaptorComponent.builder().getArrayList(this.list).getContext(this).getEnternalsongCallBack(this).finish().getAdaptor(); this.songlist.setAdapter(this.adaptor); this.songlist.setLayoutManager(this.linearLayoutManager); } public void search() { this.searchview.setOnQueryTextListener(new SearchView.OnQueryTextListener() { @Override public boolean onQueryTextSubmit(String query) { return false; } @Override public boolean onQueryTextChange(String newText) { adaptor.Filter(newText); return false; } }); } public void exit() { System.exit(0); finish(); } @Override public void go(Intent inent) { startActivity(inent); } }
f5731623da53769c1b18b36312f80f9121f3aa31
8764e7092b79625a88e8a825be71a06f84d9e22a
/methodOverloading/src/DortIslem.java
7682642cb97c90e651e099f0d254d637cc6ef582
[]
no_license
FehmiCitiloglu/kodlamaIOYoutubeAssignments
aa1601ab7fee73726e5168283cda9d541ec64b53
576e2d32715241a5ef44377eb8ac79f19d833f4f
refs/heads/main
2023-04-24T02:21:15.592430
2021-05-12T21:19:42
2021-05-12T21:19:42
361,931,856
0
0
null
null
null
null
UTF-8
Java
false
false
202
java
public class DortIslem { public int topla(int sayi1, int sayi2) { return sayi1 + sayi2; } public int topla(int sayi1, int sayi2, int sayi3) { return sayi1 + sayi2 ; } }
f790533e8ac82338d4b16facc6ff67a0238b3518
f33b997ca2043cf0b4d5599794d178a6693eb857
/app/src/androidTest/java/fr/ligol/portfolio/ApplicationTest.java
462d379fe2ed99d6466d1327226e60a42840fe18
[]
no_license
ligol/Android-Nanodegree-Portfolio
ce0d1c02d20db001d763ffc9c667ee981d97e4d5
97a61ab54c9437e1b0902bd8bc93d2de5034e788
refs/heads/master
2021-01-10T08:42:34.287686
2015-06-02T20:12:55
2015-06-02T20:12:55
36,757,401
0
0
null
null
null
null
UTF-8
Java
false
false
349
java
package fr.ligol.portfolio; import android.app.Application; import android.test.ApplicationTestCase; /** * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */ public class ApplicationTest extends ApplicationTestCase<Application> { public ApplicationTest() { super(Application.class); } }
ab0349562dd72969cdf24e94d137dd963e61ca00
edba60bb2b081bef0dde2141d4273a8ec5b85b59
/src/zeus/generator/code/AgentModel.java
071b49110746a24423cd97e4fc367deb5401a3bf
[]
no_license
sgt101/zeus
6a087bc6438ff82b456b67f193dd554954cd0599
1f48ff24ffaa55128fbe0b9b67b2465e1d1e46ce
refs/heads/master
2020-05-30T11:02:22.819112
2015-02-26T15:25:23
2015-02-26T15:25:23
31,373,027
1
1
null
null
null
null
UTF-8
Java
false
false
5,063
java
/* * The contents of this file are subject to the BT "ZEUS" Open Source * Licence (L77741), Version 1.0 (the "Licence"); you may not use this file * except in compliance with the Licence. You may obtain a copy of the Licence * from $ZEUS_INSTALL/licence.html or alternatively from * http://www.labs.bt.com/projects/agents/zeus/licence.htm * * Except as stated in Clause 7 of the Licence, software distributed under the * Licence is distributed WITHOUT WARRANTY OF ANY KIND, either express or * implied. See the Licence for the specific language governing rights and * limitations under the Licence. * * The Original Code is within the package zeus.*. * The Initial Developer of the Original Code is British Telecommunications * public limited company, whose registered office is at 81 Newgate Street, * London, EC1A 7AJ, England. Portions created by British Telecommunications * public limited company are Copyright 1996-9. All Rights Reserved. * * THIS NOTICE MUST BE INCLUDED ON ANY COPY OF THIS FILE */ /***************************************************************************** * AgentModel.java * * The underlying model for the Agent Table *****************************************************************************/ package zeus.generator.code; import java.util.*; import javax.swing.table.*; import javax.swing.event.*; import zeus.util.*; public class AgentModel extends UtilityModel { static final int GENERATE = 0; static final int STATUS = 1; static final int NAME = 2; static final int HOST = 3; static final int DATABASE = 4; static final int SERVER_FILE = 5; static final int HAS_GUI = 6; static final int EXTERNAL = 7; static final int ICON = 8; protected static final String[] columnNames = { "Generate", "Status", "Name", "Host", "Database Extension", "DNS file", "Create GUI?", "External Program", "Icon" }; protected Vector data = new Vector(); protected GenerationPlan genplan; public AgentModel(GenerationPlan genplan) { this.genplan = genplan; genplan.addChangeListener(this); refresh(); } public void addNewRow() { } public void removeRows(int[] rows) { } protected void refresh() { data.removeAllElements(); AgentInfo[] info = genplan.getAgents(); for(int i = 0; i < info.length; i++ ) data.addElement(info[i]); fireTableDataChanged(); } public int getColumnCount() { return columnNames.length; } public int getRowCount() { return data.size(); } public String getColumnName(int col) { return columnNames[col]; } public boolean isCellEditable(int row, int col) { switch(col) { case GENERATE: case HOST: case DATABASE: case SERVER_FILE: case HAS_GUI: case EXTERNAL: case ICON: return true; case NAME: case STATUS: return false; } return false; } public Object getValueAt(int row, int column) { AgentInfo info = (AgentInfo)data.elementAt(row); switch(column) { case GENERATE: return new Boolean(info.generate); case STATUS: return info.status; case NAME: return info.name; case HOST: return info.host; case DATABASE: return info.database; case SERVER_FILE: return info.dns_file; case HAS_GUI: return new Boolean(info.has_gui); case EXTERNAL: return info.zeus_external; case ICON: return info.icon_file; } return null; } public void setValueAt(Object aValue, int row, int column) { AgentInfo info = (AgentInfo)data.elementAt(row); switch(column) { case GENERATE: info.generate = updateBoolean(info.generate,aValue); if ( changed ) genplan.setAgent(info); break; case STATUS: Core.ERROR(null,1,this); break; case NAME: Core.ERROR(null,2,this); break; case HOST: info.host = updateString(info.host,aValue); if ( changed ) genplan.setAgent(info); break; case DATABASE: info.database = updateString(info.database,aValue); if ( changed ) genplan.setAgent(info); break; case SERVER_FILE: info.dns_file = updateString(info.dns_file,aValue); if ( changed ) genplan.setAgent(info); break; case HAS_GUI: info.has_gui = updateBoolean(info.has_gui,aValue); if ( changed ) genplan.setAgent(info); break; case EXTERNAL: info.zeus_external = updateString(info.zeus_external,aValue); if ( changed ) genplan.setAgent(info); break; case ICON: info.icon_file = updateString(info.icon_file,aValue); genplan.setAgentIcon(info); break; } } }
4e4ca3bba1d1cf6883272e758d670997e4445cc1
385154f53248082dc00e9997cfdde53e3e7e3746
/aula08/src/main/java/poo/Pessoa.java
07514b238ce875a1f0bb42159b04cf595f684106
[]
no_license
Gabrieldm9/aulasPOO
ed2bdc396212a1a61a8f3255a4f5e15a544c75ae
c719a0fe8aea66ee548a3c325b5aceb50e6f1626
refs/heads/master
2020-03-26T11:29:43.317181
2018-10-10T12:12:59
2018-10-10T12:12:59
144,845,593
0
0
null
null
null
null
UTF-8
Java
false
false
421
java
package poo; public class Pessoa { private String nome, cpf; private int anoNasc; // método construtor padrão public Pessoa(){ nome = ""; cpf = ""; anoNasc = 0; } public Pessoa(String no){ nome = no; cpf = ""; anoNasc = 0; } public Pessoa(String a, String b, int an){ nome = a; cpf = b; anoNasc = an; } }
05a8c94a1420b9560bb6df05b2a5af8a2a407b78
3d3e048d151618bd05d2df94b4d6d06918b6ab76
/task1306/Solution.java
4d984a945934eb3a814b449d456a37834ddfc973
[]
no_license
machukhinktato/javarush
64b3f3673b03d6b2d31513f69fbb67ebf54aa932
1bb78451e6faf300ccf3483586026f002827b6ae
refs/heads/main
2023-04-25T17:18:11.429965
2021-06-03T06:39:25
2021-06-03T06:39:25
358,849,244
0
0
null
null
null
null
UTF-8
Java
false
false
1,431
java
package com.javarush.task.pro.task13.task1306; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; /* Изучаем методы класса Collections, часть 1 */ public class Solution { // public ArrayList<Integer> list = new ArrayList<>(); public static void copy(ArrayList<String> destination, ArrayList<String> source) { if(destination.size() < source.size()) { throw new IndexOutOfBoundsException("Source does not fit in dest"); } // for (int i = 0; i < source.size(); i++) { // destination.set(i, source.get(i)); // } Collections.copy(destination, source); } public static void addAll(ArrayList<String> list, String... strings) { Collections.addAll(list, strings); // System.out.println(Collections.addAll(Arrays.asList(strings))); // ArrayList<String> listCopy = new ArrayList<>(); // listCopy.addAll(listCopy, strings.toString()); // for (String string : strings) { // list.addAll(list, strings); // } } public static void replaceAll(ArrayList<String> list, String oldValue, String newValue) { // for (int i = 0; i < list.size(); i++) { // String string = list.get(i); // if(string.equals(oldValue)) { Collections.replaceAll(list, oldValue, newValue); // } // } } }