blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 4 410 | content_id stringlengths 40 40 | detected_licenses listlengths 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 listlengths 1 1 | author_id stringlengths 0 313 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b1c09a4e3249b00c89be0934b8d5e0c6ad4ce632 | fea4f48db505bb0bed945acd042088aefd3336e3 | /src/main/java/main/data/DataWriter.java | fa0dc688bfe6aefcd6193fbf25159e0e5a317194 | [] | no_license | zhang-jian-19400/Crawlfoooooot | f95a9c66eb544746dffc74e0a1671486af8be678 | 55e9c8a78ed908c7924aa4f313210105a3014beb | refs/heads/master | 2020-04-07T07:02:05.316487 | 2018-03-07T06:39:10 | 2018-03-07T06:39:10 | 124,190,869 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 842 | java | package main.data;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class DataWriter {
public boolean writeToFile(String filename,String content){
File fileobj = new File(filename);
if(!fileobj.exists())return false;
try {
BufferedWriter writer = new BufferedWriter(
new OutputStreamWriter(
new FileOutputStream(fileobj),"UTF-8"));
writer.write(content);
writer.flush();
writer.close();
} catch (IOException e) {
e.printStackTrace();
return false;
}
return true;
}
}
| [
"1148214126@qq.com"
] | 1148214126@qq.com |
f98a6cb5c50049b45730fb3b5ed54fe9118d25f4 | 9d864f5a053b29d931b4c2b4f773e13291189d27 | /src/jsf/jsf-widgets/src/java/org/sakaiproject/jsf/renderer/ToolBarItemRenderer.java | 95a39de137570a0dd11c9a7e91e885b112ea898d | [] | no_license | kyeddlapalli/sakai-cle | b1bd1e4431d8d96b6b650bfe9454eacd3e7042b2 | 1f06c7ac69c7cbe731c8d175d557313d0fb34900 | refs/heads/master | 2021-01-18T10:57:25.449065 | 2014-01-12T21:18:15 | 2014-01-12T21:18:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,069 | java | /**********************************************************************************
* $URL: https://source.sakaiproject.org/svn/jsf/trunk/jsf-widgets/src/java/org/sakaiproject/jsf/renderer/ToolBarItemRenderer.java $
* $Id: ToolBarItemRenderer.java 126577 2013-07-02 12:11:17Z azeckoski@unicon.net $
***********************************************************************************
*
* Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008 The Sakai Foundation
*
* Licensed under the Educational Community License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.opensource.org/licenses/ECL-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.sakaiproject.jsf.renderer;
import java.io.IOException;
import javax.faces.component.UICommand;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import org.sakaiproject.jsf.util.JSFDepends;
import org.sakaiproject.jsf.util.RendererUtil;
public class ToolBarItemRenderer extends JSFDepends.CommandLinkRenderer
{
public boolean supportsComponentType(UIComponent component)
{
return (component instanceof org.sakaiproject.jsf.component.ToolBarItemComponent);
}
public void encodeBegin(FacesContext context, UIComponent component) throws IOException
{
if (!component.isRendered()) return;
if (!isDisabled(context, component))
{
// use default link rendering, after closing open span tag
ResponseWriter writer = context.getResponseWriter();
writer.write(""); // normaly just close the span
super.encodeBegin(context, component);
}
else
{
// setup to render the disabled link ourselves - close open span tag after adding inactive attributes
ResponseWriter writer = context.getResponseWriter();
writer.write(""); //normally, add aria and class attributes and close the span
}
}
public void encodeChildren(FacesContext context, UIComponent component) throws IOException
{
if (!component.isRendered()) return;
if (!isDisabled(context, component))
{
// use default rendering
super.encodeChildren(context, component);
}
else
{
// render the text of the disabled link ourselves
String label = "";
Object value = ((UICommand) component).getValue();
if (value != null)
{
label = value.toString();
}
ResponseWriter writer = context.getResponseWriter();
writer.write(label);
}
}
public void encodeEnd(FacesContext context, UIComponent component) throws IOException
{
if (!component.isRendered()) return;
if (!isDisabled(context, component))
{
// use default link rendering
super.encodeEnd(context, component);
}
else
{
// rendering of end of disabled link taken care of already
}
}
/**
* Check if the component is disabled.
* @param component
* @return true if the component has a boolean "disabled" attribute set, false if not
*/
protected boolean isDisabled(FacesContext context, UIComponent component)
{
boolean disabled = false;
Object value = RendererUtil.getAttribute(context, component, "disabled");
if (value != null)
{
if (value instanceof Boolean)
{
disabled = ((Boolean) value).booleanValue();
}
else
{
if (!(value instanceof String))
{
value = value.toString();
}
disabled = (new Boolean((String) value)).booleanValue();
}
}
return disabled;
}
}
| [
"noah@botimer.net"
] | noah@botimer.net |
5a2f03829d3b525800396cbca4a0d7cbf4ad5de5 | 2ae00c4669dc1c493b564548c7a021ef64a1adc5 | /designpatterns/iterator/dinermergercafe/CafeMenu.java | 3c4625018be42430852521f3987e70446ee65fde | [
"Apache-2.0"
] | permissive | chrishyc/learning-model | 10c4596a9cfd74b662ec4d7ba655fc84c5dd3620 | 3d51c9841b6483044dacb979eb14d3795f6ff738 | refs/heads/master | 2020-06-23T00:34:00.605363 | 2019-08-02T03:41:55 | 2019-08-02T03:41:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,135 | java | package designpatterns.iterator.dinermergercafe;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
public class CafeMenu implements Menu {
HashMap<String, MenuItem> menuItems = new HashMap<String, MenuItem>();
public CafeMenu() {
addItem("Veggie Burger and Air Fries",
"Veggie burger on a whole wheat bun, lettuce, tomato, and fries",
true, 3.99);
addItem("Soup of the day",
"A cup of the soup of the day, with a side salad",
false, 3.69);
addItem("Burrito",
"A large burrito, with whole pinto beans, salsa, guacamole",
true, 4.29);
}
public void addItem(String name, String description,
boolean vegetarian, double price) {
MenuItem menuItem = new MenuItem(name, description, vegetarian, price);
menuItems.put(menuItem.getName(), menuItem);
}
public Map<String, MenuItem> getItems() {
return menuItems;
}
public Iterator<MenuItem> createIterator() {
return menuItems.values().iterator();
}
}
| [
"chrishuhyc@gmail.com"
] | chrishuhyc@gmail.com |
8c4e033d24b66b98032151db71aba968e35894f1 | 129f58086770fc74c171e9c1edfd63b4257210f3 | /src/testcases/CWE369_Divide_by_Zero/CWE369_Divide_by_Zero__int_random_divide_07.java | 6a9193e2cf688b65c5eed27b46f334960fbb7caf | [] | no_license | glopezGitHub/Android23 | 1bd0b6a6c7ce3c7439a74f1e4dcef2c4c0fac4ba | 6215d0684c4fbdc7217ccfbedfccfca69824cc5e | refs/heads/master | 2023-03-07T15:14:59.447795 | 2023-02-06T13:59:49 | 2023-02-06T13:59:49 | 6,856,387 | 0 | 3 | null | 2023-02-06T18:38:17 | 2012-11-25T22:04:23 | Java | UTF-8 | Java | false | false | 8,729 | java | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE369_Divide_by_Zero__int_random_divide_07.java
Label Definition File: CWE369_Divide_by_Zero__int.label.xml
Template File: sources-sinks-07.tmpl.java
*/
/*
* @description
* CWE: 369 Divide by zero
* BadSource: random Set data to a random value
* GoodSource: A hardcoded non-zero, non-min, non-max, even number
* Sinks: divide
* GoodSink: Check for zero before dividing
* BadSink : Dividing by a value that may be zero
* Flow Variant: 07 Control flow: if(private_five==5) and if(private_five!=5)
*
* */
package testcases.CWE369_Divide_by_Zero;
import testcasesupport.*;
import java.sql.*;
import javax.servlet.http.*;
import java.security.SecureRandom;
import java.security.SecureRandom;
public class CWE369_Divide_by_Zero__int_random_divide_07 extends AbstractTestCase
{
/* The variable below is not declared "final", but is never assigned
any other value so a tool should be able to identify that reads of
this will always give its initialized value. */
private int private_five = 5;
public void bad() throws Throwable
{
int data;
/* INCIDENTAL: CWE 571 Statement is Always True */
if(private_five==5)
{
/* POTENTIAL FLAW: Set data to a random value */
SecureRandom r = new SecureRandom();
data = r.nextInt();
}
else {
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
/* FIX: Use a hardcoded number that won't cause underflow, overflow, divide by zero, or loss-of-precision issues */
data = 2;
}
/* INCIDENTAL: CWE 571 Statement is Always True */
if(private_five==5)
{
/* POTENTIAL FLAW: Zero denominator will cause an issue. An integer division will
result in an exception. */
IO.writeLine("bad: 100/" + String.valueOf(data) + " = " + (100 / data) + "\n");
}
else {
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
/* FIX: test for a zero denominator */
if( data != 0 )
{
IO.writeLine("100/" + String.valueOf(data) + " = " + (100 / data) + "\n");
}
else
{
IO.writeLine("This would result in a divide by zero");
}
}
}
/* goodG2B1() - use goodsource and badsink by changing first private_five==5 to private_five!=5 */
private void goodG2B1() throws Throwable
{
int data;
/* INCIDENTAL: CWE 570 Statement is Always False */
if(private_five!=5)
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
/* POTENTIAL FLAW: Set data to a random value */
SecureRandom r = new SecureRandom();
data = r.nextInt();
}
else {
/* FIX: Use a hardcoded number that won't cause underflow, overflow, divide by zero, or loss-of-precision issues */
data = 2;
}
/* INCIDENTAL: CWE 571 Statement is Always True */
if(private_five==5)
{
/* POTENTIAL FLAW: Zero denominator will cause an issue. An integer division will
result in an exception. */
IO.writeLine("bad: 100/" + String.valueOf(data) + " = " + (100 / data) + "\n");
}
else {
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
/* FIX: test for a zero denominator */
if( data != 0 )
{
IO.writeLine("100/" + String.valueOf(data) + " = " + (100 / data) + "\n");
}
else
{
IO.writeLine("This would result in a divide by zero");
}
}
}
/* goodG2B2() - use goodsource and badsink by reversing statements in first if */
private void goodG2B2() throws Throwable
{
int data;
/* INCIDENTAL: CWE 571 Statement is Always True */
if(private_five==5)
{
/* FIX: Use a hardcoded number that won't cause underflow, overflow, divide by zero, or loss-of-precision issues */
data = 2;
}
else {
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
/* POTENTIAL FLAW: Set data to a random value */
SecureRandom r = new SecureRandom();
data = r.nextInt();
}
/* INCIDENTAL: CWE 571 Statement is Always True */
if(private_five==5)
{
/* POTENTIAL FLAW: Zero denominator will cause an issue. An integer division will
result in an exception. */
IO.writeLine("bad: 100/" + String.valueOf(data) + " = " + (100 / data) + "\n");
}
else {
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
/* FIX: test for a zero denominator */
if( data != 0 )
{
IO.writeLine("100/" + String.valueOf(data) + " = " + (100 / data) + "\n");
}
else
{
IO.writeLine("This would result in a divide by zero");
}
}
}
/* goodB2G1() - use badsource and goodsink by changing second private_five==5 to private_five!=5 */
private void goodB2G1() throws Throwable
{
int data;
/* INCIDENTAL: CWE 571 Statement is Always True */
if(private_five==5)
{
/* POTENTIAL FLAW: Set data to a random value */
SecureRandom r = new SecureRandom();
data = r.nextInt();
}
else {
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
/* FIX: Use a hardcoded number that won't cause underflow, overflow, divide by zero, or loss-of-precision issues */
data = 2;
}
/* INCIDENTAL: CWE 570 Statement is Always False */
if(private_five!=5)
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
/* POTENTIAL FLAW: Zero denominator will cause an issue. An integer division will
result in an exception. */
IO.writeLine("bad: 100/" + String.valueOf(data) + " = " + (100 / data) + "\n");
}
else {
/* FIX: test for a zero denominator */
if( data != 0 )
{
IO.writeLine("100/" + String.valueOf(data) + " = " + (100 / data) + "\n");
}
else
{
IO.writeLine("This would result in a divide by zero");
}
}
}
/* goodB2G2() - use badsource and goodsink by reversing statements in second if */
private void goodB2G2() throws Throwable
{
int data;
/* INCIDENTAL: CWE 571 Statement is Always True */
if(private_five==5)
{
/* POTENTIAL FLAW: Set data to a random value */
SecureRandom r = new SecureRandom();
data = r.nextInt();
}
else {
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
/* FIX: Use a hardcoded number that won't cause underflow, overflow, divide by zero, or loss-of-precision issues */
data = 2;
}
/* INCIDENTAL: CWE 571 Statement is Always True */
if(private_five==5)
{
/* FIX: test for a zero denominator */
if( data != 0 )
{
IO.writeLine("100/" + String.valueOf(data) + " = " + (100 / data) + "\n");
}
else
{
IO.writeLine("This would result in a divide by zero");
}
}
else {
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
/* POTENTIAL FLAW: Zero denominator will cause an issue. An integer division will
result in an exception. */
IO.writeLine("bad: 100/" + String.valueOf(data) + " = " + (100 / data) + "\n");
}
}
public void good() throws Throwable
{
goodG2B1();
goodG2B2();
goodB2G1();
goodB2G2();
}
/* Below is the main(). It is only used when building this testcase on
its own for testing or for building a binary to use in testing binary
analysis tools. It is not used when compiling all the testcases as one
application, which is how source code analysis tools are tested. */
public static void main(String[] args) throws ClassNotFoundException,
InstantiationException, IllegalAccessException
{
mainFromParent(args);
}
}
| [
"guillermo.pando@gmail.com"
] | guillermo.pando@gmail.com |
7672f0b2681bebca6694088f2d808228de2e2391 | 54c1dcb9a6fb9e257c6ebe7745d5008d29b0d6b6 | /app/src/main/java/com/p118pd/sdk/C7560o0o00Oo.java | 1d4df9f889f51f04c5bb23625dfdb859cd7ce25a | [] | no_license | rcoolboy/guilvN | 3817397da465c34fcee82c0ca8c39f7292bcc7e1 | c779a8e2e5fd458d62503dc1344aa2185101f0f0 | refs/heads/master | 2023-05-31T10:04:41.992499 | 2021-07-07T09:58:05 | 2021-07-07T09:58:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 558 | java | package com.p118pd.sdk;
import android.content.Context;
/* renamed from: com.pd.sdk.o0o00Oo reason: case insensitive filesystem */
public final class C7560o0o00Oo {
public static C7560o0o00Oo OooO00o = new C7560o0o00Oo();
public static C7560o0o00Oo OooO00o() {
return OooO00o;
}
public static String OooO00o(Context context) {
try {
return context.getPackageManager().getPackageInfo(context.getPackageName(), 16).versionName;
} catch (Exception unused) {
return "0.0.0";
}
}
}
| [
"593746220@qq.com"
] | 593746220@qq.com |
96d70a0f2ee76a11f2f7d79af60bb2bef55c0f5d | c0c8e2b81bae6f92cd26e061e757e2baa76d4bc2 | /branch_kyle/lib/andengine/org/anddev/andengine/entity/scene/menu/item/TextMenuItem.java | 0fa888f369c4a66cd573bca9e69eb8c4ef06a418 | [] | no_license | Fritzendugan/rocket-science | 87f22dbcf1fc91718284dd5087c6c0ae67bf56eb | 82145989130b01bbd694538e902723b17a409c0c | refs/heads/master | 2020-12-25T18:20:12.701833 | 2011-05-06T21:03:34 | 2011-05-06T21:03:34 | 32,224,164 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,842 | java | package org.anddev.andengine.entity.scene.menu.item;
import org.anddev.andengine.entity.text.Text;
import org.anddev.andengine.opengl.font.Font;
/**
* @author Nicolas Gramlich
* @since 20:15:20 - 01.04.2010
*/
public class TextMenuItem extends Text implements IMenuItem{
// ===========================================================
// Constants
// ===========================================================
// ===========================================================
// Fields
// ===========================================================
private final int mID;
// ===========================================================
// Constructors
// ===========================================================
public TextMenuItem(final int pID, final Font pFont, final String pText) {
super(0, 0, pFont, pText);
this.mID = pID;
}
// ===========================================================
// Getter & Setter
// ===========================================================
public int getID() {
return this.mID;
}
// ===========================================================
// Getter & Setter
// ===========================================================
// ===========================================================
// Methods for/from SuperClass/Interfaces
// ===========================================================
public void onSelected() {
/* Nothing. */
}
public void onUnselected() {
/* Nothing. */
}
// ===========================================================
// Methods
// ===========================================================
// ===========================================================
// Inner and Anonymous Classes
// ===========================================================
}
| [
"Fritzendugan@gmail.com@5b162289-0c3d-0828-5410-29faef4b17c3"
] | Fritzendugan@gmail.com@5b162289-0c3d-0828-5410-29faef4b17c3 |
16a379bcac05065a30fc730b71201e48bf9ef264 | a2ea7f5bdc6a100df1e5da091325d6b2a97214e0 | /app/src/main/java/com/iot_projects/taas/SkippedMedicineReceiver.java | 3a9d2b3573c511ce060276d561fbc4f3779156d7 | [] | no_license | kartikk/TaaS-Android | a578fd86ad1c29dc81218a494f497f50ab318ac3 | 352333fa96a49c9b2e1ce273dd2e58d69374d72a | refs/heads/master | 2021-03-27T20:10:53.892762 | 2017-04-12T03:37:17 | 2017-04-12T03:37:17 | 95,715,217 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,382 | java | package com.iot_projects.taas;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.util.Log;
import android.widget.Toast;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.iot_projects.taas.models.Subscription;
import java.io.IOException;
public class SkippedMedicineReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
String medicine = intent.getStringExtra("medicine");
String time = intent.getStringExtra("time");
String s = "";
SharedPreferences settings = context.getSharedPreferences("myPref", 0);
if (settings.contains("subscription"))
s = settings.getString("subscription", "hi");
if(!s.equals("hi")) {
ObjectMapper objectMapper = new ObjectMapper();
try {
Subscription subscription = objectMapper.readValue(s,Subscription.class);
Log.d("Debug", subscription.toString());
int flag = 0;
int skippedMedicine = 0;
if(subscription.getSkippedMedicine().containsKey(medicine))
skippedMedicine = subscription.getSkippedMedicine().get(medicine);
subscription.getSkippedMedicine().put(medicine,skippedMedicine+1);
ObjectMapper objMapper = new ObjectMapper();
String subsStr = objMapper.writeValueAsString(subscription);
SharedPreferences.Editor editor = settings.edit();
editor.putString("subscription", subsStr);
Log.d("Debug", subsStr);
editor.commit();
if((skippedMedicine+1)>=5) {
//TODO Report to doctor (Post request to baseUrl/medicineSkip with subscription id and medicine name as payload
Toast.makeText(context, "Medicine " + medicine + " is skipped more than 5 times!", Toast.LENGTH_SHORT).show();
}
} catch (IOException e) {
e.printStackTrace();
}
}
Log.d("Debug", "Final alarm for medicine "+medicine + " " + time + " is fired!");
Toast.makeText(context, "Final alarm for " + medicine + " " + time + " is fired!", Toast.LENGTH_SHORT).show();
}
}
| [
"adhithya.bala@gmail.com"
] | adhithya.bala@gmail.com |
de9e171920df328897689768d122fb4783f4f514 | cc7006ca9db0de29aa10241cc404937c0474349e | /plugins/org.yakindu.sct.model.sgen/src/org/yakindu/sct/model/sgen/util/SGenSwitch.java | 1f1350bc75d0982e30e452da382e671e0d2b6afe | [] | no_license | ankurtibrewal/statecharts | 0e8e8b1595088111783b3a5e518593fac6118d27 | af20fa5911cd619a51531f21d4a56b432ce4bfae | refs/heads/master | 2020-05-29T12:29:29.756767 | 2019-07-31T15:26:52 | 2019-07-31T15:26:52 | 52,989,534 | 0 | 0 | null | 2016-03-02T19:20:34 | 2016-03-02T19:20:34 | null | UTF-8 | Java | false | false | 15,585 | java | /**
* Copyright (c) 2015 committers of YAKINDU 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
* Contributors:
* committers of YAKINDU - initial API and implementation
*
*/
package org.yakindu.sct.model.sgen.util;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.util.Switch;
import org.yakindu.base.base.NamedElement;
import org.yakindu.sct.model.sgen.*;
import org.yakindu.sct.model.sgen.FeatureConfiguration;
import org.yakindu.sct.model.sgen.FeatureParameter;
import org.yakindu.sct.model.sgen.FeatureParameterValue;
import org.yakindu.sct.model.sgen.FeatureType;
import org.yakindu.sct.model.sgen.FeatureTypeLibrary;
import org.yakindu.sct.model.sgen.GeneratorConfiguration;
import org.yakindu.sct.model.sgen.GeneratorEntry;
import org.yakindu.sct.model.sgen.GeneratorModel;
import org.yakindu.sct.model.sgen.SGenPackage;
/**
* <!-- begin-user-doc -->
* The <b>Switch</b> for the model's inheritance hierarchy.
* It supports the call {@link #doSwitch(EObject) doSwitch(object)}
* to invoke the <code>caseXXX</code> method for each class of the model,
* starting with the actual class of the object
* and proceeding up the inheritance hierarchy
* until a non-null result is returned,
* which is the result of the switch.
* <!-- end-user-doc -->
* @see org.yakindu.sct.model.sgen.SGenPackage
* @generated
*/
public class SGenSwitch<T> extends Switch<T> {
/**
* The cached model package
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected static SGenPackage modelPackage;
/**
* Creates an instance of the switch.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public SGenSwitch() {
if (modelPackage == null) {
modelPackage = SGenPackage.eINSTANCE;
}
}
/**
* Checks whether this is a switch for the given package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @parameter ePackage the package in question.
* @return whether this is a switch for the given package.
* @generated
*/
@Override
protected boolean isSwitchFor(EPackage ePackage) {
return ePackage == modelPackage;
}
/**
* Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the first non-null result returned by a <code>caseXXX</code> call.
* @generated
*/
@Override
protected T doSwitch(int classifierID, EObject theEObject) {
switch (classifierID) {
case SGenPackage.GENERATOR_MODEL: {
GeneratorModel generatorModel = (GeneratorModel)theEObject;
T result = caseGeneratorModel(generatorModel);
if (result == null) result = defaultCase(theEObject);
return result;
}
case SGenPackage.GENERATOR_CONFIGURATION: {
GeneratorConfiguration generatorConfiguration = (GeneratorConfiguration)theEObject;
T result = caseGeneratorConfiguration(generatorConfiguration);
if (result == null) result = defaultCase(theEObject);
return result;
}
case SGenPackage.FEATURE_TYPE: {
FeatureType featureType = (FeatureType)theEObject;
T result = caseFeatureType(featureType);
if (result == null) result = caseNamedElement(featureType);
if (result == null) result = caseDeprecatableElement(featureType);
if (result == null) result = defaultCase(theEObject);
return result;
}
case SGenPackage.FEATURE_PARAMETER: {
FeatureParameter featureParameter = (FeatureParameter)theEObject;
T result = caseFeatureParameter(featureParameter);
if (result == null) result = caseNamedElement(featureParameter);
if (result == null) result = caseDeprecatableElement(featureParameter);
if (result == null) result = defaultCase(theEObject);
return result;
}
case SGenPackage.FEATURE_CONFIGURATION: {
FeatureConfiguration featureConfiguration = (FeatureConfiguration)theEObject;
T result = caseFeatureConfiguration(featureConfiguration);
if (result == null) result = defaultCase(theEObject);
return result;
}
case SGenPackage.GENERATOR_ENTRY: {
GeneratorEntry generatorEntry = (GeneratorEntry)theEObject;
T result = caseGeneratorEntry(generatorEntry);
if (result == null) result = defaultCase(theEObject);
return result;
}
case SGenPackage.FEATURE_PARAMETER_VALUE: {
FeatureParameterValue featureParameterValue = (FeatureParameterValue)theEObject;
T result = caseFeatureParameterValue(featureParameterValue);
if (result == null) result = defaultCase(theEObject);
return result;
}
case SGenPackage.FEATURE_TYPE_LIBRARY: {
FeatureTypeLibrary featureTypeLibrary = (FeatureTypeLibrary)theEObject;
T result = caseFeatureTypeLibrary(featureTypeLibrary);
if (result == null) result = defaultCase(theEObject);
return result;
}
case SGenPackage.LITERAL: {
Literal literal = (Literal)theEObject;
T result = caseLiteral(literal);
if (result == null) result = defaultCase(theEObject);
return result;
}
case SGenPackage.BOOL_LITERAL: {
BoolLiteral boolLiteral = (BoolLiteral)theEObject;
T result = caseBoolLiteral(boolLiteral);
if (result == null) result = caseLiteral(boolLiteral);
if (result == null) result = defaultCase(theEObject);
return result;
}
case SGenPackage.INT_LITERAL: {
IntLiteral intLiteral = (IntLiteral)theEObject;
T result = caseIntLiteral(intLiteral);
if (result == null) result = caseLiteral(intLiteral);
if (result == null) result = defaultCase(theEObject);
return result;
}
case SGenPackage.REAL_LITERAL: {
RealLiteral realLiteral = (RealLiteral)theEObject;
T result = caseRealLiteral(realLiteral);
if (result == null) result = caseLiteral(realLiteral);
if (result == null) result = defaultCase(theEObject);
return result;
}
case SGenPackage.STRING_LITERAL: {
StringLiteral stringLiteral = (StringLiteral)theEObject;
T result = caseStringLiteral(stringLiteral);
if (result == null) result = caseLiteral(stringLiteral);
if (result == null) result = defaultCase(theEObject);
return result;
}
case SGenPackage.DEPRECATABLE_ELEMENT: {
DeprecatableElement deprecatableElement = (DeprecatableElement)theEObject;
T result = caseDeprecatableElement(deprecatableElement);
if (result == null) result = defaultCase(theEObject);
return result;
}
default: return defaultCase(theEObject);
}
}
/**
* Returns the result of interpreting the object as an instance of '<em>Generator Model</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Generator Model</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseGeneratorModel(GeneratorModel object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Generator Configuration</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Generator Configuration</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseGeneratorConfiguration(GeneratorConfiguration object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Feature Type</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Feature Type</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseFeatureType(FeatureType object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Feature Parameter</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Feature Parameter</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseFeatureParameter(FeatureParameter object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Feature Configuration</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Feature Configuration</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseFeatureConfiguration(FeatureConfiguration object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Generator Entry</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Generator Entry</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseGeneratorEntry(GeneratorEntry object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Feature Parameter Value</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Feature Parameter Value</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseFeatureParameterValue(FeatureParameterValue object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Feature Type Library</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Feature Type Library</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseFeatureTypeLibrary(FeatureTypeLibrary object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Literal</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Literal</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseLiteral(Literal object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Bool Literal</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Bool Literal</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseBoolLiteral(BoolLiteral object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Int Literal</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Int Literal</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseIntLiteral(IntLiteral object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Real Literal</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Real Literal</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseRealLiteral(RealLiteral object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>String Literal</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>String Literal</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseStringLiteral(StringLiteral object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Deprecatable Element</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Deprecatable Element</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseDeprecatableElement(DeprecatableElement object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Named Element</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Named Element</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseNamedElement(NamedElement object) {
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch, but this is the last case anyway.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>EObject</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject)
* @generated
*/
@Override
public T defaultCase(EObject object) {
return null;
}
} //SGenSwitch
| [
"tesch@itemis.de"
] | tesch@itemis.de |
f2c7601620eb304f111c560d5a05f525a644a0ca | 936d0fac16aa0355c148dfa086c78973009124b2 | /web/gui/src/main/java/org/onosproject/ui/impl/topo/model/ModelCache.java | 6a76eb59a97d337d1cd6d8a322495a93c67f29a0 | [
"Apache-2.0"
] | permissive | thunderleo/onos | 0d09a9325c7df25f8998695bd62353a6ff161bb7 | 3d09f4f46d3b74c3b875ee0c9ba7b701e5e43244 | refs/heads/master | 2021-01-22T16:48:49.409415 | 2016-04-13T22:43:22 | 2016-04-13T22:43:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,827 | java | /*
* Copyright 2016 Open Networking Laboratory
*
* 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.onosproject.ui.impl.topo.model;
import org.onosproject.cluster.ControllerNode;
import org.onosproject.cluster.RoleInfo;
import org.onosproject.event.EventDispatcher;
import org.onosproject.net.Device;
import org.onosproject.net.DeviceId;
import org.onosproject.net.Host;
import org.onosproject.net.Link;
import org.onosproject.net.region.Region;
import org.onosproject.ui.model.topo.UiDevice;
import org.onosproject.ui.model.topo.UiTopology;
import static org.onosproject.ui.impl.topo.model.UiModelEvent.Type.DEVICE_ADDED;
import static org.onosproject.ui.impl.topo.model.UiModelEvent.Type.DEVICE_REMOVED;
/**
* UI Topology Model cache.
*/
class ModelCache {
private final EventDispatcher dispatcher;
private final UiTopology uiTopology = new UiTopology();
ModelCache(EventDispatcher eventDispatcher) {
this.dispatcher = eventDispatcher;
}
/**
* Clear our model.
*/
void clear() {
uiTopology.clear();
}
/**
* Create our internal model of the global topology.
*/
void load() {
// loadClusterMembers();
// loadRegions();
// loadDevices();
// loadHosts();
// loadLinks();
}
void addOrUpdateDevice(Device device) {
// TODO: find or create device assoc. with parameter
// FIXME
UiDevice uiDevice = new UiDevice();
// TODO: post the (correct) event
dispatcher.post(new UiModelEvent(DEVICE_ADDED, uiDevice));
}
void removeDevice(Device device) {
// TODO: get UiDevice associated with the given parameter; remove from model
// FIXME
UiDevice uiDevice = new UiDevice();
// TODO: post the (correct) event
dispatcher.post(new UiModelEvent(DEVICE_REMOVED, uiDevice));
}
void addOrUpdateClusterMember(ControllerNode cnode) {
// TODO: find or create cluster member assoc. with parameter
// TODO: post event
}
void removeClusterMember(ControllerNode cnode) {
// TODO: find cluster member assoc. with parameter; remove from model
// TODO: post event
}
void updateMasterships(DeviceId deviceId, RoleInfo roleInfo) {
// TODO: store the updated mastership information
// TODO: post event
}
void addOrUpdateRegion(Region region) {
// TODO: find or create region assoc. with parameter
// TODO: post event
}
void removeRegion(Region region) {
// TODO: find region assoc. with parameter; remove from model
// TODO: post event
}
void addOrUpdateLink(Link link) {
// TODO: find ui-link assoc. with parameter; create or update.
// TODO: post event
}
void removeLink(Link link) {
// TODO: find ui-link assoc. with parameter; update or remove.
// TODO: post event
}
void addOrUpdateHost(Host host) {
// TODO: find or create host assoc. with parameter
// TODO: post event
}
void moveHost(Host host, Host prevHost) {
// TODO: process host-move
// TODO: post event
}
void removeHost(Host host) {
// TODO: find host assoc. with parameter; remove from model
}
}
| [
"simon@onlab.us"
] | simon@onlab.us |
1c21c5ee3f097334e9d64deadb59b22ec2634e84 | a655649b925a18684be03aed0c3a056a697a55cb | /src/main/java/com/dnd/jachwirus/user/config/JwtAuthenticationFilter.java | 96a92bc6ca6ac52b8cf593894b10ca81090bbdce | [] | no_license | dv-zinke/dnd_backend_user | ce2ab933ef92bda291de13743a61fde82823eabc | 813bd2d755e34111011c6b89073af073ac471678 | refs/heads/master | 2022-12-15T11:57:12.002101 | 2020-09-11T17:01:49 | 2020-09-11T17:01:49 | 291,731,927 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,433 | java | package com.dnd.jachwirus.user.config;
import lombok.RequiredArgsConstructor;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.filter.GenericFilterBean;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
@RequiredArgsConstructor
public class JwtAuthenticationFilter extends GenericFilterBean {
private final JwtTokenProvider jwtTokenProvider;
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
// 헤더에서 JWT 를 받아옵니다.
String token = jwtTokenProvider.resolveToken((HttpServletRequest) request);
// 유효한 토큰인지 확인합니다.
if (token != null && jwtTokenProvider.validateToken(token)) {
// 토큰이 유효하면 토큰으로부터 유저 정보를 받아옵니다.
Authentication authentication = jwtTokenProvider.getAuthentication(token);
// SecurityContext 에 Authentication 객체를 저장합니다.
SecurityContextHolder.getContext().setAuthentication(authentication);
}
chain.doFilter(request, response);
}
}
| [
"dv.zinke@gmail.com"
] | dv.zinke@gmail.com |
e7361573f0e2710c6c4b068bcdea98ba41b78774 | 76972cdc0eadcccb0f8ab761f4d14d104a7cf022 | /src/main/java/com/mq/demo/config/CodeGenerator.java | f1336945827cd7c3606986743936b5a58f28838f | [] | no_license | xybc1122/mp_flowable | 37bd4563bc9d4700d275b00f2c2950f3cd8806da | 9fd89706c7c00b73ac237b7a1ddab6ac56396b52 | refs/heads/master | 2021-06-16T13:04:07.014534 | 2019-06-10T08:57:41 | 2019-06-10T08:57:41 | 190,987,944 | 0 | 0 | null | 2021-04-26T19:12:59 | 2019-06-09T09:32:55 | Java | UTF-8 | Java | false | false | 5,149 | java | package com.mq.demo.config;
import com.baomidou.mybatisplus.core.exceptions.MybatisPlusException;
import com.baomidou.mybatisplus.core.toolkit.StringPool;
import com.baomidou.mybatisplus.generator.AutoGenerator;
import com.baomidou.mybatisplus.generator.InjectionConfig;
import com.baomidou.mybatisplus.generator.config.*;
import com.baomidou.mybatisplus.generator.config.po.TableInfo;
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
import org.apache.commons.lang3.StringUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
/**
* @ClassName CodeGenerator
* Description TODO
* @Author 陈恩惠
* @Date 2019/6/10 9:05
**/
public class CodeGenerator {
/**
* <p>
* 读取控制台内容
* </p>
*/
public static String scanner(String tip) {
Scanner scanner = new Scanner(System.in);
StringBuilder help = new StringBuilder();
help.append("请输入" + tip + ":");
System.out.println(help.toString());
if (scanner.hasNext()) {
String ipt = scanner.next();
if (StringUtils.isNotEmpty(ipt)) {
return ipt;
}
}
throw new MybatisPlusException("请输入正确的" + tip + "!");
}
public static void main(String[] args) {
// 代码生成器
AutoGenerator mpg = new AutoGenerator();
// 全局配置
GlobalConfig gc = new GlobalConfig();
String projectPath = System.getProperty("user.dir");
gc.setOutputDir(projectPath + "/src/main/java");
gc.setAuthor("陈恩惠");
gc.setOpen(false);
// gc.setSwagger2(true); 实体属性 Swagger2 注解
mpg.setGlobalConfig(gc);
// 数据源配置
DataSourceConfig dsc = new DataSourceConfig();
dsc.setUrl("jdbc:mysql://192.168.1.230:3306/mydb?useUnicode=true&characterEncoding=utf-8&useSSL=false");
// dsc.setSchemaName("public");
dsc.setDriverName("com.mysql.cj.jdbc.Driver");
dsc.setUsername("root");
dsc.setPassword("wawzj7788");
mpg.setDataSource(dsc);
// 包配置
PackageConfig pc = new PackageConfig();
pc.setModuleName(scanner("模块名"));
pc.setParent("com.mq.demo");
mpg.setPackageInfo(pc);
// 自定义配置
InjectionConfig cfg = new InjectionConfig() {
@Override
public void initMap() {
// to do nothing
}
};
// 如果模板引擎是 freemarker
String templatePath = "/templates/mapper.xml.ftl";
// 如果模板引擎是 velocity
// String templatePath = "/templates/mapper.xml.vm";
// 自定义输出配置
List<FileOutConfig> focList = new ArrayList<>();
// 自定义配置会被优先输出
focList.add(new FileOutConfig(templatePath) {
@Override
public String outputFile(TableInfo tableInfo) {
// 自定义输出文件名 , 如果你 Entity 设置了前后缀、此处注意 xml 的名称会跟着发生变化!!
return projectPath + "/src/main/resources/mapper/" + pc.getModuleName()
+ "/" + tableInfo.getEntityName() + "Mapper" + StringPool.DOT_XML;
}
});
/*
cfg.setFileCreate(new IFileCreate() {
@Override
public boolean isCreate(ConfigBuilder configBuilder, FileType fileType, String filePath) {
// 判断自定义文件夹是否需要创建
checkDir("调用默认方法创建的目录");
return false;
}
});
*/
cfg.setFileOutConfigList(focList);
mpg.setCfg(cfg);
// 配置模板
TemplateConfig templateConfig = new TemplateConfig();
// 配置自定义输出模板
//指定自定义模板路径,注意不要带上.ftl/.vm, 会根据使用的模板引擎自动识别
// templateConfig.setEntity("templates/entity2.java");
// templateConfig.setService();
// templateConfig.setController();
templateConfig.setXml(null);
mpg.setTemplate(templateConfig);
// 策略配置
StrategyConfig strategy = new StrategyConfig();
strategy.setNaming(NamingStrategy.underline_to_camel);
strategy.setColumnNaming(NamingStrategy.underline_to_camel);
//strategy.setSuperEntityClass("com.mq.demo.BaseEntity");
strategy.setEntityLombokModel(true);
strategy.setRestControllerStyle(true);
// strategy.setSuperControllerClass("com.mq.demo.BaseController");
strategy.setInclude(scanner("表名,多个英文逗号分割").split(","));
strategy.setSuperEntityColumns("id");
strategy.setControllerMappingHyphenStyle(true);
strategy.setTablePrefix(pc.getModuleName() + "_");
mpg.setStrategy(strategy);
mpg.setTemplateEngine(new FreemarkerTemplateEngine());
mpg.execute();
}
}
| [
"451597529@qq.com"
] | 451597529@qq.com |
9659cfdf5eb0ddc9a938c660da2c342183c8b52a | 236712b5468f07e5b2e72f64431899589b2de42b | /Ajedrez2/modelo/Torre.java | 314b745cd2ae1dcc8eeaa7bbe1d9a6f48234e2e7 | [] | no_license | alejandroat/ajedrez | 8021e60fdf7c4dc8aa14597bc5ce948cc6347f7b | 7f2130ea122c1a05e253f413e0f410ea3751fbbc | refs/heads/master | 2020-05-24T10:32:33.115263 | 2019-05-17T14:21:33 | 2019-05-17T14:21:33 | 187,229,359 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,071 | 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 co.edu.utp.isc.pro4.ajedrez.modelo;
import java.awt.GradientPaint;
import java.awt.Graphics2D;
import java.awt.geom.GeneralPath;
/**
*
* @author utp
*/
public class Torre extends Ficha {
public Torre(Color color) {
super(color);
}
@Override
public void mover(Tablero tablero,Casilla casillaI, Casilla casillaF) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void comer() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void draw(Graphics2D g, float x, float y) {
GeneralPath polyline = new GeneralPath(GeneralPath.WIND_EVEN_ODD, 17);
polyline.moveTo(x + 5, y + 5);
polyline.lineTo(x + 5, y + 15);
polyline.lineTo(x + 10, y + 15);
polyline.lineTo(x + 10, y + 45);
polyline.lineTo(x + 40, y + 45);
polyline.lineTo(x + 40, y + 15);
polyline.lineTo(x + 45, y + 15);
polyline.lineTo(x + 45, y + 5);
polyline.lineTo(x + 37, y + 5);
polyline.lineTo(x + 37, y + 10);
polyline.lineTo(x + 29, y + 10);
polyline.lineTo(x + 29, y + 5);
polyline.lineTo(x + 21, y + 5);
polyline.lineTo(x + 21, y + 10);
polyline.lineTo(x + 13, y + 10);
polyline.lineTo(x + 13, y + 5);
polyline.lineTo(x + 5, y + 5);
g.setPaint(new GradientPaint(x, y,
getColor() == Color.BLANCO ? java.awt.Color.CYAN : java.awt.Color.BLACK,
x + 100, y + 50,
java.awt.Color.WHITE));
g.fill(polyline);
g.setColor(java.awt.Color.BLACK);
g.draw(polyline);
}
}
| [
"noreply@github.com"
] | alejandroat.noreply@github.com |
7ee2b3dadbf383e0439c1203ef3e97cf4a4dad70 | d65319fd5afdc0204ae58db24ab2ee6f89d9584b | /domain/src/main/java/com/lserj/bigserj/domain/entity/Original.java | b68c18e462c905f08c9b2d62c6aae93c6e9419aa | [] | no_license | BigSerj/GetGifs | 1cfeda40fc82a8a2c8b4719da944b4bef47a51fe | 2c4bbb0afccc94d9448ca24f48ff52a51226555d | refs/heads/master | 2021-07-25T22:29:55.922415 | 2017-11-09T18:14:20 | 2017-11-09T18:14:20 | 110,141,017 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 241 | java | package com.lserj.bigserj.domain.entity;
public class Original implements DomainModel {
private String url;
public void setUrl(String url) {
this.url = url;
}
public String getUrl() {
return url;
}
}
| [
"sergeyconvent@gmail.com"
] | sergeyconvent@gmail.com |
b0802fffed883749dfc37baaa7ade5bad6fb1379 | d83bbb2e5ca155156523a0cf0cbbebfd939722d0 | /BFS/src/com/gzk/leetcode面0403/ListNode.java | 702c4d139236c50a2c19660481a482ee4f5fc2e6 | [] | no_license | GZK0329/LeetCodeRecord | 34b29bff5d27ddaf38c522245773977b7f264d0d | 636f4ce1b4c98d80d870345106615f5236f07eb0 | refs/heads/master | 2023-04-19T09:43:17.125320 | 2021-05-14T07:46:00 | 2021-05-14T07:46:00 | 294,640,739 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 133 | java | package com.gzk.leetcode面0403;
public class ListNode {
int val;
ListNode next;
ListNode(int x) { val = x; }
}
| [
"470590124@qq.com"
] | 470590124@qq.com |
b570360a27252f359b480feaf24e9245dc27a5c2 | 126d14e626e7164cbdbc06b4e02e03cc48243eed | /src/main/java/fr/univamu/iut/exo4/Demarreur.java | cfaa9d5f7fb0b21ce9128d8437ce549fe3290e91 | [] | no_license | MaximeHenry/TD2-fabrique-domotique | eddc6459a3978e2780329b00603e31311ea254f0 | 59f1fce397fa0d98feb949e0e9f0e2d68cbadcb1 | refs/heads/master | 2020-09-17T01:23:04.606433 | 2020-01-08T14:45:52 | 2020-01-08T14:45:52 | 223,945,632 | 0 | 0 | null | 2019-11-25T12:39:25 | 2019-11-25T12:39:24 | null | UTF-8 | Java | false | false | 424 | java | package fr.univamu.iut.exo4;
import java.util.ArrayList;
public class Demarreur {
ArrayList<Connectable> actives;
public void demarrerLesActives(){
for (Connectable c: actives
) {
System.out.println("Je démarre " + actives.toString());
}
}
public void attacher(Connectable connectable){
actives.add(connectable);
}
public void detacher(){
}
}
| [
"maxime.henry.1@etu.univ-amu.fr"
] | maxime.henry.1@etu.univ-amu.fr |
230563b7ad86bc2421904d7d00fcc7f5ef2cf794 | ce97bcbb13694102a665de0f8e0ea678d73987e5 | /app/src/main/java/org/videolan/vlc/util/VLCOptions.java | 1a77c6bdea40ae1c32faeae4accfc0bd24ffc01a | [] | no_license | yangdm0209/Mp3Player-vlc- | affcfc9739dd3d1162f65d071e4c1092cd854b10 | 564eaa62e29c9ef85a9b334a3fd03e16f4d78ac8 | refs/heads/master | 2021-05-02T18:11:06.143093 | 2016-10-31T09:31:46 | 2016-10-31T09:31:46 | 72,421,489 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,221 | java | /*****************************************************************************
* VLCOptions.java
*****************************************************************************
* Copyright © 2015 VLC authors and VideoLAN
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
package org.videolan.vlc.util;
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.support.annotation.MainThread;
import android.util.Log;
import org.videolan.libvlc.Media;
import org.videolan.libvlc.MediaPlayer;
import org.videolan.libvlc.util.HWDecoderUtil;
import org.videolan.libvlc.util.VLCUtil;
import com.stronger.audioplayer.AudioApplication;
import org.videolan.vlc.media.MediaWrapper;
import java.util.ArrayList;
public class VLCOptions {
private static final String TAG = "VLCConfig";
public static final int AOUT_AUDIOTRACK = 0;
public static final int AOUT_OPENSLES = 1;
@SuppressWarnings("unused")
public static final int HW_ACCELERATION_AUTOMATIC = -1;
public static final int HW_ACCELERATION_DISABLED = 0;
public static final int HW_ACCELERATION_DECODING = 1;
public static final int HW_ACCELERATION_FULL = 2;
public static ArrayList<String> getLibOptions() {
final SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(AudioApplication.getAppContext());
ArrayList<String> options = new ArrayList<String>(50);
final boolean timeStrechingDefault = false;
final boolean timeStreching = pref.getBoolean("enable_time_stretching_audio", timeStrechingDefault);
final String subtitlesEncoding = pref.getString("subtitle_text_encoding", "");
final boolean frameSkip = pref.getBoolean("enable_frame_skip", false);
// String chroma = pref.getString("chroma_format", AudioApplication.getAppResources().getString(R.string.chroma_format_default));
// if (chroma != null)
// chroma = chroma.equals("YV12") && !AndroidUtil.isGingerbreadOrLater() ? "" : chroma;
final boolean verboseMode = pref.getBoolean("enable_verbose_mode", true);
int deblocking = -1;
try {
deblocking = getDeblocking(Integer.parseInt(pref.getString("deblocking", "-1")));
} catch (NumberFormatException ignored) {}
int networkCaching = pref.getInt("network_caching_value", 0);
if (networkCaching > 60000)
networkCaching = 60000;
else if (networkCaching < 0)
networkCaching = 0;
/* CPU intensive plugin, setting for slow devices */
options.add(timeStreching ? "--audio-time-stretch" : "--no-audio-time-stretch");
options.add("--avcodec-skiploopfilter");
options.add("" + deblocking);
options.add("--avcodec-skip-frame");
options.add(frameSkip ? "2" : "0");
options.add("--avcodec-skip-idct");
options.add(frameSkip ? "2" : "0");
options.add("--subsdec-encoding");
options.add(subtitlesEncoding);
options.add("--stats");
/* XXX: why can't the default be fine ? #7792 */
if (networkCaching > 0)
options.add("--network-caching=" + networkCaching);
options.add("--androidwindow-chroma");
options.add("RV32");
options.add("--audio-resampler");
options.add(getResampler());
options.add(verboseMode ? "-vvv" : "-vv");
return options;
}
public static String getAout(SharedPreferences pref) {
int aout = -1;
try {
aout = Integer.parseInt(pref.getString("aout", "-1"));
} catch (NumberFormatException ignored) {}
final HWDecoderUtil.AudioOutput hwaout = HWDecoderUtil.getAudioOutputFromDevice();
if (hwaout == HWDecoderUtil.AudioOutput.AUDIOTRACK || hwaout == HWDecoderUtil.AudioOutput.OPENSLES)
aout = hwaout == HWDecoderUtil.AudioOutput.OPENSLES ? AOUT_OPENSLES : AOUT_AUDIOTRACK;
return aout == AOUT_OPENSLES ? "opensles_android" : "android_audiotrack";
}
private static int getDeblocking(int deblocking) {
int ret = deblocking;
if (deblocking < 0) {
/**
* Set some reasonable sDeblocking defaults:
*
* Skip all (4) for armv6 and MIPS by default
* Skip non-ref (1) for all armv7 more than 1.2 Ghz and more than 2 cores
* Skip non-key (3) for all devices that don't meet anything above
*/
VLCUtil.MachineSpecs m = VLCUtil.getMachineSpecs();
if (m == null)
return ret;
if ((m.hasArmV6 && !(m.hasArmV7)) || m.hasMips)
ret = 4;
else if (m.frequency >= 1200 && m.processors > 2)
ret = 1;
else if (m.bogoMIPS >= 1200 && m.processors > 2) {
ret = 1;
Log.d(TAG, "Used bogoMIPS due to lack of frequency info");
} else
ret = 3;
} else if (deblocking > 4) { // sanity check
ret = 3;
}
return ret;
}
private static String getResampler() {
final VLCUtil.MachineSpecs m = VLCUtil.getMachineSpecs();
return m.processors > 2 ? "soxr" : "ugly";
}
public static void setMediaOptions(Media media, Context context, int flags) {
boolean noHardwareAcceleration = (flags & MediaWrapper.MEDIA_NO_HWACCEL) != 0;
boolean noVideo = (flags & MediaWrapper.MEDIA_VIDEO) == 0;
final boolean paused = (flags & MediaWrapper.MEDIA_PAUSED) != 0;
int hardwareAcceleration = HW_ACCELERATION_DISABLED;
if (!noHardwareAcceleration) {
try {
final SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(context);
hardwareAcceleration = Integer.parseInt(pref.getString("hardware_acceleration", "-1"));
} catch (NumberFormatException ignored) {}
}
if (hardwareAcceleration == HW_ACCELERATION_DISABLED)
media.setHWDecoderEnabled(false, false);
else if (hardwareAcceleration == HW_ACCELERATION_FULL || hardwareAcceleration == HW_ACCELERATION_DECODING) {
media.setHWDecoderEnabled(true, true);
if (hardwareAcceleration == HW_ACCELERATION_DECODING) {
media.addOption(":no-mediacodec-dr");
media.addOption(":no-omxil-dr");
}
} /* else automatic: use default options */
if (noVideo)
media.addOption(":no-video");
if (paused)
media.addOption(":start-paused");
}
@MainThread
public static MediaPlayer.Equalizer getEqualizer(Context context) {
final SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(context);
if (pref.getBoolean("equalizer_enabled", false)) {
final float[] bands = Preferences.getFloatArray(pref, "equalizer_values");
final int bandCount = MediaPlayer.Equalizer.getBandCount();
if (bands.length != bandCount + 1)
return null;
final MediaPlayer.Equalizer eq = MediaPlayer.Equalizer.create();
eq.setPreAmp(bands[0]);
for (int i = 0; i < bandCount; ++i)
eq.setAmp(i, bands[i + 1]);
return eq;
} else
return null;
}
public static int getEqualizerPreset(Context context) {
final SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(context);
return pref.getInt("equalizer_preset", 0);
}
public static void setEqualizer(Context context, MediaPlayer.Equalizer eq, int preset) {
final SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(context);
SharedPreferences.Editor editor = pref.edit();
if (eq != null) {
editor.putBoolean("equalizer_enabled", true);
final int bandCount = MediaPlayer.Equalizer.getBandCount();
final float[] bands = new float[bandCount + 1];
bands[0] = eq.getPreAmp();
for (int i = 0; i < bandCount; ++i) {
bands[i + 1] = eq.getAmp(i);
}
Preferences.putFloatArray(editor, "equalizer_values", bands);
editor.putInt("equalizer_preset", preset);
} else {
editor.putBoolean("equalizer_enabled", false);
}
Util.commitPreferences(editor);
}
}
| [
"yangdaming@dashuqinzi.com"
] | yangdaming@dashuqinzi.com |
0fbecba71d31cb2574b6465aa2d720f02f3f5685 | ea0e20310b85dfa6078bd8ccd34a53f360d03675 | /JWTAuthentication/src/test/java/com/spring/security/jwt/JwtAuthenticationApplicationTests.java | ed8c1a82c0e0aa76371da12c900282f183a56c03 | [] | no_license | Ajaygupta1993/Jwt | 26c2961ab4b8c454a12dd749ff5ad0805026db70 | 081dba5e47c11c5c8d9b621bafcb7f9df2e9fc76 | refs/heads/master | 2021-04-21T14:23:25.277560 | 2020-05-10T18:58:01 | 2020-05-10T18:58:01 | 249,787,487 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 226 | java | package com.spring.security.jwt;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class JwtAuthenticationApplicationTests {
@Test
void contextLoads() {
}
}
| [
"AJAY@DESKTOP-I0KTAEU"
] | AJAY@DESKTOP-I0KTAEU |
1d0e94ede4c3dc066e7d22f4e2618e9b731b892a | 6740abf256160cf53db4b4721e59e8e5786cf5a3 | /guaguale_library/src/androidTest/java/com/as/guaguale_library/ExampleInstrumentedTest.java | d2fb0a3906fb3017e7c122607b54e5813abac336 | [] | no_license | zhangqifan1/Demo_GuaGuaLe | 1329f4ca0bb1bbe32ed3e76cb38143517022d9cf | 215dd915fe5d9745334556856e713981893f1977 | refs/heads/master | 2020-05-28T08:22:01.122852 | 2019-05-28T02:04:13 | 2019-05-28T02:04:13 | 188,936,223 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 735 | java | package com.as.guaguale_library;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.as.guaguale_library.test", appContext.getPackageName());
}
}
| [
"852780161@qq.com"
] | 852780161@qq.com |
fd0c8d6deaaeabb53822a1ca895041d4475f8a60 | 40ad71ae361281284ef15012b11dc7cf809c60aa | /app/src/main/java/com/example/spotick/FireBaseMessagingService.java | 7891cc3ca0b02ec2957ba94190bcac468a5bbfcd | [] | no_license | totoczko/spotick-android | ad018171c54937f07565ad0dcbd319dbfd553cb5 | bb76c70ecb139bdd64b91ed5c58a71280b7bafa5 | refs/heads/master | 2020-05-04T21:06:02.227960 | 2019-10-06T18:44:31 | 2019-10-06T18:44:31 | 179,464,146 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,703 | java | package com.example.spotick;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Build;
import android.support.v4.app.NotificationCompat;
import android.util.Log;
import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;
import androidx.work.OneTimeWorkRequest;
import androidx.work.WorkManager;
/**
* NOTE: There can only be one service in each app that receives FCM messages. If multiple
* are declared in the Manifest then the first one will be chosen.
*
* In order to make this Java sample functional, you must remove the following from the Kotlin messaging
* service in the AndroidManifest.xml:
*
* <intent-filter>
* <action android:name="com.google.firebase.MESSAGING_EVENT" />
* </intent-filter>
*/
public class FireBaseMessagingService extends FirebaseMessagingService {
private static final String TAG = "MyFirebaseMsgService";
/**
* Called when message is received.
*
* @param remoteMessage Object representing the message received from Firebase Cloud Messaging.
*/
// [START receive_message]
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
// [START_EXCLUDE]
// There are two types of messages data messages and notification messages. Data messages
// are handled
// here in onMessageReceived whether the app is in the foreground or background. Data
// messages are the type
// traditionally used with GCM. Notification messages are only received here in
// onMessageReceived when the app
// is in the foreground. When the app is in the background an automatically generated
// notification is displayed.
// When the user taps on the notification they are returned to the app. Messages
// containing both notification
// and data payloads are treated as notification messages. The Firebase console always
// sends notification
// messages. For more see: https://firebase.google.com/docs/cloud-messaging/concept-options
// [END_EXCLUDE]
// TODO(developer): Handle FCM messages here.
// Not getting messages here? See why this may be: https://goo.gl/39bRNJ
Log.d(TAG, "From: " + remoteMessage.getFrom());
// Check if message contains a data payload.
if (remoteMessage.getData().size() > 0) {
Log.d(TAG, "Message data payload: " + remoteMessage.getData());
if (/* Check if data needs to be processed by long running job */ true) {
// For long-running tasks (10 seconds or more) use WorkManager.
scheduleJob();
} else {
// Handle message within 10 seconds
handleNow();
}
}
// Check if message contains a notification payload.
if (remoteMessage.getNotification() != null) {
Log.d(TAG, "Message Notification Body: " + remoteMessage.getNotification().getBody());
}
// Also if you intend on generating your own notifications as a result of a received FCM
// message, here is where that should be initiated. See sendNotification method below.
}
// [END receive_message]
// [START on_new_token]
/**
* Called if InstanceID token is updated. This may occur if the security of
* the previous token had been compromised. Note that this is called when the InstanceID token
* is initially generated so this is where you would retrieve the token.
*/
public void onNewToken(String token) {
Log.d(TAG, "Refreshed token: " + token);
// If you want to send messages to this application instance or
// manage this apps subscriptions on the server side, send the
// Instance ID token to your app server.
sendRegistrationToServer(token);
}
// [END on_new_token]
/**
* Schedule async work using WorkManager.
*/
private void scheduleJob() {
// [START dispatch_job]
OneTimeWorkRequest work = new OneTimeWorkRequest.Builder(MessagingWorker.class)
.build();
WorkManager.getInstance().beginWith(work).enqueue();
// [END dispatch_job]
}
/**
* Handle time allotted to BroadcastReceivers.
*/
private void handleNow() {
Log.d(TAG, "Short lived task is done.");
}
/**
* Persist token to third-party servers.
*
* Modify this method to associate the user's FCM InstanceID token with any server-side account
* maintained by your application.
*
* @param token The new token.
*/
private void sendRegistrationToServer(String token) {
// TODO: Implement this method to send token to your app server.
}
/**
* Create and show a simple notification containing the received FCM message.
*
* @param messageBody FCM message body received.
*/
private void sendNotification(String messageBody) {
Intent intent = new Intent(this, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0 /* Request code */, intent,
PendingIntent.FLAG_ONE_SHOT);
String channelId = "Spotick";
Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
NotificationCompat.Builder notificationBuilder =
new NotificationCompat.Builder(this, channelId)
.setSmallIcon(R.drawable.ic_favorite)
.setContentTitle("Nowe powiadomienie!")
.setContentText(messageBody)
.setAutoCancel(true)
.setSound(defaultSoundUri)
.setContentIntent(pendingIntent);
NotificationManager notificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
// Since android Oreo notification channel is needed.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
NotificationChannel channel = new NotificationChannel(channelId,
"Channel human readable title",
NotificationManager.IMPORTANCE_DEFAULT);
notificationManager.createNotificationChannel(channel);
}
notificationManager.notify(0 /* ID of notification */, notificationBuilder.build());
}
} | [
"m.toloczko1@gmail.com"
] | m.toloczko1@gmail.com |
ecbb58eb4d6bdd882137115c6d47be98ad96ade6 | 68c93e844f45e011db2e4eeedc850d8354d3aaa8 | /ElectricityBillingSystem/src/Nhom4/PrintPreview.java | cf94e7a8ce3920f5c357f1fa13cbebf25311baf2 | [] | no_license | Dieptranivsr/ElectricityBillingSystem | 3ca9a874b88de9363133caf8b09347cc11a2ce84 | d79198348fd9ff02a881a5920162c176207bbfb9 | refs/heads/main | 2023-06-01T23:25:32.216799 | 2021-06-09T04:42:08 | 2021-06-09T04:42:08 | 372,924,063 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 285 | 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 Nhom4;
/**
*
* @author Dieptuantran
*/
public class PrintPreview {
}
| [
"dieptt.hust@gmail.com"
] | dieptt.hust@gmail.com |
ac309c5d54a91dc20929a7ba9259e580a0462f5a | d815b9d254a78bb01c83954dbff9475a302cae81 | /bionimbus/src/main/java/br/unb/cic/bionimbus/utils/UTFUtils.java | 72b96d6969d4757aa774a0365fd44a9bd14f93dc | [] | no_license | inuxkr/biofoco3 | 54db65360c37e6fd21625d77c36df2d5be583703 | d2e7b6dcecad720751f6f5f619b569f7ee72e526 | refs/heads/master | 2021-01-19T06:53:38.043771 | 2013-05-18T18:16:27 | 2013-05-18T18:16:27 | 37,865,280 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 611 | java | package br.unb.cic.bionimbus.utils;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
public final class UTFUtils {
private UTFUtils() {}
public static void writeString(OutputStream outputStream, String data) throws IOException {
DataOutputStream dos = new DataOutputStream(outputStream);
dos.writeUTF(data);
dos.flush();
}
public static String readString(InputStream inputStream) throws IOException {
DataInputStream dais = new DataInputStream(inputStream);
return dais.readUTF();
}
}
| [
"edward.ribeiro@gmail.com"
] | edward.ribeiro@gmail.com |
a91729b5dfcdf810ed3b80aebec36e127df6dac9 | b712cec619830a06f850b7d7ea90a31b29ce9224 | /app/src/main/java/com/itboy/dj/examtool/adapter/NoticeAdapter.java | ffefe2105ae669028f951b47392221730c088504 | [] | no_license | liuguangjun12/ksb | 67a7c193089396076ae7c25298449f10707e1613 | 876366b2a45c248ec6894a3cab5025441f2bfd01 | refs/heads/master | 2022-03-29T21:45:13.834923 | 2017-08-17T09:56:47 | 2017-08-17T09:56:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,466 | java | package com.itboy.dj.examtool.adapter;
import android.text.TextUtils;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.itboy.dj.examtool.R;
import com.itboy.dj.examtool.api.bean.Noticebean;
import com.itboy.dj.examtool.utils.GlideRoundTransform;
import java.util.List;
/**
* Created by Administrator on 2017/6/16.
*/
public class NoticeAdapter extends BaseQuickAdapter<Noticebean.DataBean, BaseViewHolder> {
public NoticeAdapter(int layoutResId, List<Noticebean.DataBean> data) {
super(layoutResId, data);
}
@Override
protected void convert(BaseViewHolder helper, Noticebean.DataBean item) {
helper.setText(R.id.hot_new_title, item.getTitle());
ImageView view = helper.getView(R.id.hot_img);
Glide.with(view.getContext()).load("http://p5.so.qhimgs1.com/t01f85b5b575f160e8b.jpg").placeholder(R.mipmap.a_ic_yaoqinggongyou).error(R.mipmap.a_ic_yaoqinggongyou).transform(new GlideRoundTransform(view.getContext(), 10)).into(view);
String titleImg = item.getImgURL();
if (TextUtils.isEmpty(titleImg) || "null".equals(titleImg)) {
} else {
}
helper.setText(R.id.hot_new_time, item.getCreateDate());
helper.setText(R.id.hot_new_content, item.getText());
helper.setText(R.id.hot_new_watchs, item.getViews() + "");
}
}
| [
"dongjie"
] | dongjie |
ed70370ce12c293ba5f9e8866a255e4f557f6cd0 | a80fda4b856fa9d5870f454776db2dc4567a8e45 | /ContentProviderDemo/src/com/example/provider/PersonProviderConstants.java | 1f2a9e5e207975e7bd77213a725676a4001dbfd0 | [] | no_license | ybin/AndroidDemo | 0662e0c14afd925bbdfcc963b5679c4fc82362a1 | 3b9901bad4a09bdaa6ef14929e7cf3000967c823 | refs/heads/master | 2020-04-23T14:06:44.624379 | 2016-02-17T02:27:39 | 2016-02-17T02:27:39 | 17,505,087 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 537 | java | package com.example.provider;
import android.net.Uri;
public class PersonProviderConstants {
public static final String AUTHORITY = "com.example.provider.PersonProvider";
public static final Uri PERSON_ALL_URI =
Uri.parse("content://" + AUTHORITY + "/persons");
public static final Uri NOTIFY_URI = Uri.parse("content://" + AUTHORITY + "/persons");
public static final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.scott.person";
public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/vnd.scott.person";
}
| [
"ybin.sun@gmail.com"
] | ybin.sun@gmail.com |
9b5174d5af03a605cc41403bc87c004ccbb476c4 | 8748543a9a49b45bdccbf6c1ff1e86c5a44e508a | /practical 4/src/Practical4Q7.java | 8f600ea286f4cfa965eeb0771b1f7db0d398dc78 | [] | no_license | JosephChongSP/fantastic-guacamole | 6b932ffadea51c9c3b604848aabc081222144009 | 23b0ab66012491dc783648f15b2df80d985a2c56 | refs/heads/master | 2020-08-17T19:24:50.516412 | 2019-10-17T05:44:41 | 2019-10-17T05:44:41 | 215,702,777 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 245 | 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.
*/
/**
*
* @author jrago
*/
public class Practical4Q7 {
}
| [
"jcyun01.18@ichat.sp.edu.sg"
] | jcyun01.18@ichat.sp.edu.sg |
a6938a7a4f6f09eedf3f2ad109da6aa4134796b8 | 59a5b8baa874195ecec579fed5e5471b2a03d9b3 | /Day_06/ex02/Tests/src/main/java/edu/school21/models/Product.java | f48eef12224d76828fe4591a8d446b32d6ed2e2a | [] | no_license | Arclight-V/Piscine-Java | a96562e8a5a587a77bf7494b34c4b75b39b837ec | 7bf0a692670945d9b7df576c753c490cbba90d7d | refs/heads/master | 2023-06-17T19:09:45.272041 | 2021-07-10T20:05:57 | 2021-07-10T20:05:57 | 380,243,884 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,189 | java | package edu.school21.models;
import java.util.Objects;
public class Product {
String name;
Long userId;
Long price;
public Product(String name, Long userId, Long price) {
this.name = name;
this.userId = userId;
this.price = price;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Product product = (Product) o;
return name.equals(product.name) && userId.equals(product.userId) && price.equals(product.price);
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Long getPrice() {
return price;
}
public void setPrice(Long price) {
this.price = price;
}
@Override
public int hashCode() {
return Objects.hash(name, userId, price);
}
public Product clone() {
return new Product(this.name, this.userId, this.price);
}
}
| [
"vladimtor@gmail.com"
] | vladimtor@gmail.com |
5d74128876bad64fe23e3d39c330360a0c7bcfa0 | 4aca86cfc041900786f74dc08ac19778f41553c9 | /Students/src/com/chernoivan/Student.java | bb0466e5fa220706690c19d2c5e6464284a3db8d | [] | no_license | chernoivan/summer-training | 5cb612c96e1534f8ed89b97ffbafd8744f2ac6b3 | 179bb3f428074f216ca21f1ce21fe443f1df68fb | refs/heads/master | 2023-07-02T21:05:34.178620 | 2021-08-12T20:34:53 | 2021-08-12T20:34:53 | 380,014,334 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,194 | java | package com.chernoivan;
import java.util.Objects;
public final class Student {
private final String name;
private final int age;
private final String group;
public Student(String name, int age, String group) {
this.name = name;
this.age = age;
this.group = group;
}
public String getName() {
return name;
}
public Student setName(String name) {
return new Student(name, this.age, this.group);
}
public int getAge() {
return age;
}
public Student setAge(int age) {
return new Student(this.name, age, this.group);
}
public String getGroup() {
return group;
}
public Student setGroup(String group) {
return new Student(this.name, this.age, group);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Student student = (Student) o;
return age == student.age && name.equals(student.name) && group.equals(student.group);
}
@Override
public int hashCode() {
return Objects.hash(name, age, group);
}
}
| [
"alex@Alexanders-MacBook-Air.local"
] | alex@Alexanders-MacBook-Air.local |
abddd7c3aa353db4e4fb12591609d42ed0e01ede | 4442df54649fbc8a3b33ad860f151696e880a024 | /controller/sample.java | 9070175e4b3958043b8f39e5d900f3c90e805ea7 | [] | no_license | jagarlamudirajesh34/02MAY | ac25ec65013aacd1ce29c0879bc9ba97df93b168 | 8d7ff971dec0986b98b00090d74420fbab4f578b | refs/heads/master | 2020-05-18T15:51:58.814779 | 2019-05-04T02:47:07 | 2019-05-04T02:47:07 | 184,511,670 | 0 | 0 | null | 2019-05-03T03:59:30 | 2019-05-02T02:44:03 | Java | UTF-8 | Java | false | false | 32 | java | new ed dfdf dfhdf dfdfdfd f dhf
| [
"jagarlamudirajesh34@outlook.com"
] | jagarlamudirajesh34@outlook.com |
dbe773a5af15c20635da330e44402639ea682fb1 | 32b72e1dc8b6ee1be2e80bb70a03a021c83db550 | /ast_results/wordpress-mobile_WordPress-Android/WordPress/src/main/java/org/wordpress/android/ui/main/WPMainActivity.java | 136137b117f3f5f34ba67bc91022895a50e2da58 | [] | no_license | cmFodWx5YWRhdjEyMTA5/smell-and-machine-learning | d90c41a17e88fcd99d543124eeb6e93f9133cb4a | 0564143d92f8024ff5fa6b659c2baebf827582b1 | refs/heads/master | 2020-07-13T13:53:40.297493 | 2019-01-11T11:51:18 | 2019-01-11T11:51:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 39,075 | java | // isComment
package org.wordpress.android.ui.main;
import android.app.Activity;
import android.arch.lifecycle.Observer;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.RemoteInput;
import android.support.v7.app.AppCompatActivity;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import org.wordpress.android.R;
import org.wordpress.android.WordPress;
import org.wordpress.android.analytics.AnalyticsTracker;
import org.wordpress.android.analytics.AnalyticsTracker.Stat;
import org.wordpress.android.fluxc.Dispatcher;
import org.wordpress.android.fluxc.generated.AccountActionBuilder;
import org.wordpress.android.fluxc.generated.SiteActionBuilder;
import org.wordpress.android.fluxc.model.AccountModel;
import org.wordpress.android.fluxc.model.PostModel;
import org.wordpress.android.fluxc.model.SiteModel;
import org.wordpress.android.fluxc.store.AccountStore;
import org.wordpress.android.fluxc.store.AccountStore.AuthenticationErrorType;
import org.wordpress.android.fluxc.store.AccountStore.OnAccountChanged;
import org.wordpress.android.fluxc.store.AccountStore.OnAuthenticationChanged;
import org.wordpress.android.fluxc.store.AccountStore.UpdateTokenPayload;
import org.wordpress.android.fluxc.store.PostStore;
import org.wordpress.android.fluxc.store.PostStore.OnPostUploaded;
import org.wordpress.android.fluxc.store.QuickStartStore;
import org.wordpress.android.fluxc.store.QuickStartStore.QuickStartTask;
import org.wordpress.android.fluxc.store.SiteStore;
import org.wordpress.android.fluxc.store.SiteStore.OnQuickStartCompleted;
import org.wordpress.android.fluxc.store.SiteStore.OnSiteChanged;
import org.wordpress.android.fluxc.store.SiteStore.OnSiteRemoved;
import org.wordpress.android.login.LoginAnalyticsListener;
import org.wordpress.android.networking.ConnectionChangeReceiver;
import org.wordpress.android.push.GCMMessageService;
import org.wordpress.android.push.GCMRegistrationIntentService;
import org.wordpress.android.push.NativeNotificationsUtils;
import org.wordpress.android.push.NotificationsProcessingService;
import org.wordpress.android.ui.ActivityId;
import org.wordpress.android.ui.ActivityLauncher;
import org.wordpress.android.ui.JetpackConnectionSource;
import org.wordpress.android.ui.JetpackConnectionWebViewActivity;
import org.wordpress.android.ui.RequestCodes;
import org.wordpress.android.ui.ShortcutsNavigator;
import org.wordpress.android.ui.accounts.LoginActivity;
import org.wordpress.android.ui.accounts.SignupEpilogueActivity;
import org.wordpress.android.ui.accounts.SiteCreationActivity;
import org.wordpress.android.ui.main.WPMainNavigationView.OnPageListener;
import org.wordpress.android.ui.news.NewsManager;
import org.wordpress.android.ui.notifications.NotificationEvents;
import org.wordpress.android.ui.notifications.NotificationsListFragment;
import org.wordpress.android.ui.notifications.adapters.NotesAdapter;
import org.wordpress.android.ui.notifications.receivers.NotificationsPendingDraftsReceiver;
import org.wordpress.android.ui.notifications.utils.NotificationsActions;
import org.wordpress.android.ui.notifications.utils.NotificationsUtils;
import org.wordpress.android.ui.notifications.utils.PendingDraftsNotificationsUtils;
import org.wordpress.android.ui.posts.BasicFragmentDialog.BasicDialogNegativeClickInterface;
import org.wordpress.android.ui.posts.BasicFragmentDialog.BasicDialogPositiveClickInterface;
import org.wordpress.android.ui.posts.EditPostActivity;
import org.wordpress.android.ui.posts.PromoDialog;
import org.wordpress.android.ui.posts.PromoDialog.PromoDialogClickInterface;
import org.wordpress.android.ui.prefs.AppPrefs;
import org.wordpress.android.ui.prefs.AppSettingsFragment;
import org.wordpress.android.ui.prefs.SiteSettingsFragment;
import org.wordpress.android.ui.reader.ReaderPostListFragment;
import org.wordpress.android.ui.reader.ReaderPostPagerActivity;
import org.wordpress.android.ui.uploads.UploadUtils;
import org.wordpress.android.util.AccessibilityUtils;
import org.wordpress.android.util.AniUtils;
import org.wordpress.android.util.AppLog;
import org.wordpress.android.util.AppLog.T;
import org.wordpress.android.util.AuthenticationDialogUtils;
import org.wordpress.android.util.DeviceUtils;
import org.wordpress.android.util.FluxCUtils;
import org.wordpress.android.util.LocaleManager;
import org.wordpress.android.util.NetworkUtils;
import org.wordpress.android.util.ProfilingUtils;
import org.wordpress.android.util.QuickStartUtils;
import org.wordpress.android.util.ShortcutUtils;
import org.wordpress.android.util.ToastUtils;
import org.wordpress.android.util.WPActivityUtils;
import org.wordpress.android.util.analytics.AnalyticsUtils;
import org.wordpress.android.util.analytics.service.InstallationReferrerServiceStarter;
import org.wordpress.android.widgets.WPDialogSnackbar;
import java.util.List;
import javax.inject.Inject;
import de.greenrobot.event.EventBus;
import static org.wordpress.android.WordPress.SITE;
import static org.wordpress.android.ui.JetpackConnectionSource.NOTIFICATIONS;
import static org.wordpress.android.ui.main.WPMainNavigationView.PAGE_ME;
import static org.wordpress.android.ui.main.WPMainNavigationView.PAGE_MY_SITE;
import static org.wordpress.android.ui.main.WPMainNavigationView.PAGE_NOTIFS;
import static org.wordpress.android.ui.main.WPMainNavigationView.PAGE_READER;
/**
* isComment
*/
public class isClassOrIsInterface extends AppCompatActivity implements OnPageListener, BottomNavController, BasicDialogPositiveClickInterface, BasicDialogNegativeClickInterface, PromoDialogClickInterface {
public static final String isVariable = "isStringConstant";
public static final String isVariable = "isStringConstant";
public static final String isVariable = "isStringConstant";
public static final String isVariable = "isStringConstant";
public static final String isVariable = "isStringConstant";
public static final String isVariable = "isStringConstant";
public static final String isVariable = "isStringConstant";
public static final String isVariable = "isStringConstant";
public static final String isVariable = "isStringConstant";
public static final String isVariable = "isStringConstant";
public static final String isVariable = "isStringConstant";
public static final String isVariable = "isStringConstant";
public static final String isVariable = "isStringConstant";
public static final String isVariable = "isStringConstant";
public static final String isVariable = "isStringConstant";
public static final String isVariable = "isStringConstant";
private WPMainNavigationView isVariable;
private WPDialogSnackbar isVariable;
private TextView isVariable;
private JetpackConnectionSource isVariable;
private boolean isVariable;
private boolean isVariable;
private SiteModel isVariable;
@Inject
AccountStore isVariable;
@Inject
SiteStore isVariable;
@Inject
PostStore isVariable;
@Inject
Dispatcher isVariable;
@Inject
protected LoginAnalyticsListener isVariable;
@Inject
ShortcutsNavigator isVariable;
@Inject
ShortcutUtils isVariable;
@Inject
NewsManager isVariable;
@Inject
QuickStartStore isVariable;
/*isComment*/
public interface isClassOrIsInterface {
void isMethod();
}
/*isComment*/
public interface isClassOrIsInterface {
boolean isMethod();
}
@Override
protected void isMethod(Context isParameter) {
super.isMethod(isNameExpr.isMethod(isNameExpr));
}
@Override
public void isMethod(Bundle isParameter) {
isNameExpr.isMethod("isStringConstant");
((WordPress) isMethod()).isMethod().isMethod(this);
super.isMethod(isNameExpr);
isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr);
isNameExpr = isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr);
isNameExpr.isMethod(isMethod(), this);
isNameExpr = isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr);
isNameExpr.isMethod(new View.OnClickListener() {
@Override
public void isMethod(View isParameter) {
// isComment
isNameExpr.isMethod(isNameExpr, true);
new Handler().isMethod(new Runnable() {
@Override
public void isMethod() {
if (!isMethod()) {
isMethod();
}
}
}, isIntegerConstant);
}
});
isNameExpr = isMethod().isMethod(isNameExpr, true);
isNameExpr = isMethod().isMethod(isNameExpr, true);
isNameExpr = (JetpackConnectionSource) isMethod().isMethod(isNameExpr);
String isVariable = null;
isMethod();
if (isNameExpr == null) {
if (!isNameExpr.isMethod()) {
isNameExpr.isMethod(this, null);
}
if (isNameExpr.isMethod(isNameExpr, isNameExpr)) {
// isComment
boolean isVariable = (isMethod() != null && isMethod().isMethod(isNameExpr, true));
boolean isVariable = (isMethod() != null && isMethod().isMethod(isNameExpr.isFieldAccessExpr) != null);
boolean isVariable = (isMethod() != null && isMethod().isMethod(isNameExpr));
boolean isVariable = (isMethod() != null && isMethod().isMethod(isNameExpr, true));
if (isNameExpr) {
isMethod();
} else if (isNameExpr) {
// isComment
isMethod().isMethod(isNameExpr, true);
if (isMethod().isMethod(isNameExpr.isFieldAccessExpr)) {
isMethod(isMethod().isMethod(isNameExpr.isFieldAccessExpr, isIntegerConstant), isMethod().isMethod(isNameExpr.isFieldAccessExpr, true));
} else {
isMethod();
}
} else if (isNameExpr) {
isMethod();
isNameExpr.isMethod(isMethod().isMethod(isNameExpr.isFieldAccessExpr), this, isMethod());
} else if (isNameExpr) {
isMethod(isMethod());
} else {
if (isNameExpr) {
if (isNameExpr.isMethod()) {
isNameExpr.isMethod(this, isNameExpr.isFieldAccessExpr.isFieldAccessExpr);
} else {
isNameExpr = isMethod();
}
}
// isComment
if (isMethod() != null && isMethod().isMethod() != null && isMethod().isMethod().isMethod(isNameExpr, true)) {
isNameExpr.isMethod(this, isNameExpr, (SiteModel) isMethod().isMethod(isNameExpr), isNameExpr.isMethod());
}
}
} else {
if (isNameExpr) {
isNameExpr = isMethod();
} else {
isNameExpr.isMethod(this);
isMethod();
}
}
}
// isComment
isNameExpr.isMethod(this, ReaderPostPagerActivity.class);
// isComment
isMethod();
// isComment
isNameExpr.isMethod(this);
isNameExpr.isMethod().isMethod(this);
if (isNameExpr != null) {
// isComment
UpdateTokenPayload isVariable = new UpdateTokenPayload(isNameExpr);
isNameExpr.isMethod(isNameExpr.isMethod(isNameExpr));
} else if (isMethod().isMethod(isNameExpr, true) && isNameExpr == null) {
isNameExpr.isMethod(this, isMethod().isMethod(isNameExpr, true), isMethod().isMethod(isNameExpr));
} else if (isMethod().isMethod(isNameExpr, true) && isNameExpr == null) {
isNameExpr.isMethod(this, isMethod().isMethod(isNameExpr.isFieldAccessExpr), isMethod().isMethod(isNameExpr.isFieldAccessExpr), isMethod().isMethod(isNameExpr.isFieldAccessExpr), isMethod().isMethod(isNameExpr.isFieldAccessExpr), true);
}
}
@Nullable
private String isMethod() {
Uri isVariable = isMethod().isMethod();
return isNameExpr != null ? isNameExpr.isMethod(isNameExpr.isFieldAccessExpr) : null;
}
@Override
protected void isMethod(Intent isParameter) {
super.isMethod(isNameExpr);
isMethod(isNameExpr);
isNameExpr.isMethod(isNameExpr.isFieldAccessExpr, "isStringConstant");
if (isNameExpr.isMethod(isNameExpr.isFieldAccessExpr)) {
isMethod();
}
if (isNameExpr.isMethod(isNameExpr)) {
isMethod(isNameExpr);
}
}
private void isMethod(Intent isParameter) {
String isVariable = isNameExpr.isMethod(isNameExpr);
if (!isNameExpr.isMethod(isNameExpr)) {
switch(isNameExpr) {
case isNameExpr:
isNameExpr.isMethod(isNameExpr);
break;
case isNameExpr:
isNameExpr.isMethod(isNameExpr);
break;
case isNameExpr:
isNameExpr.isMethod(isNameExpr);
break;
case isNameExpr:
if (isNameExpr == null) {
isMethod();
}
isMethod();
break;
}
} else {
isNameExpr.isMethod(isNameExpr.isFieldAccessExpr, "isStringConstant");
}
}
private void isMethod() {
isNameExpr.isMethod().isMethod(this, new Observer<Boolean>() {
@Override
public void isMethod(@Nullable Boolean isParameter) {
isNameExpr.isMethod(isNameExpr != null ? isNameExpr : true);
}
});
isNameExpr.isMethod(true);
}
private void isMethod() {
if (isMethod()) {
return;
}
// isComment
// isComment
isNameExpr.isMethod(isNameExpr);
// isComment
isMethod();
isNameExpr.isMethod(this, isMethod());
}
/*isComment*/
private void isMethod() {
if (isMethod() || isMethod() == null) {
return;
}
if (isMethod().isMethod(isNameExpr.isFieldAccessExpr)) {
isNameExpr.isMethod(this);
isNameExpr.isMethod(isMethod(), new NotificationsUtils.TwoFactorAuthCallback() {
@Override
public void isMethod(String isParameter, String isParameter, String isParameter) {
// isComment
// isComment
// isComment
String isVariable = isMethod().isMethod(isNameExpr.isFieldAccessExpr);
if (isNameExpr.isFieldAccessExpr.isMethod(isNameExpr)) {
// isComment
isNameExpr.isMethod(isNameExpr);
} else {
isNameExpr.isMethod(isNameExpr.this, isNameExpr, isNameExpr, isNameExpr);
}
}
@Override
public void isMethod() {
// isComment
isNameExpr.isMethod(isNameExpr.this, isNameExpr.isFieldAccessExpr.isFieldAccessExpr, isNameExpr.isFieldAccessExpr.isFieldAccessExpr);
isNameExpr.isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr);
}
});
}
// isComment
isNameExpr.isMethod();
isNameExpr.isMethod(isNameExpr);
// isComment
if (isNameExpr.isMethod() <= isIntegerConstant) {
String isVariable = isMethod().isMethod(isNameExpr.isFieldAccessExpr);
if (!isNameExpr.isMethod(isNameExpr)) {
isNameExpr.isMethod(isNameExpr);
// isComment
// isComment
String isVariable = null;
Bundle isVariable = isNameExpr.isMethod(isMethod());
if (isNameExpr != null) {
CharSequence isVariable = isNameExpr.isMethod(isNameExpr.isFieldAccessExpr);
if (isNameExpr != null) {
isNameExpr = isNameExpr.isMethod();
}
}
if (isNameExpr != null) {
isNameExpr.isMethod(this, isNameExpr, isNameExpr);
isMethod();
// isComment
return;
} else {
boolean isVariable = isMethod().isMethod(isNameExpr.isFieldAccessExpr, true);
isNameExpr.isMethod(this, isNameExpr, isNameExpr, null, isNameExpr.isFieldAccessExpr.isFieldAccessExpr);
}
} else {
isNameExpr.isMethod(isNameExpr.isFieldAccessExpr, "isStringConstant");
return;
}
} else {
// isComment
isNameExpr.isMethod();
}
isNameExpr.isMethod(this);
}
/**
* isComment
*/
private void isMethod(int isParameter, boolean isParameter) {
if (isMethod() || isMethod() == null) {
return;
}
isNameExpr.isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr);
isNameExpr.isMethod(isNameExpr.isMethod(isNameExpr), this);
// isComment
if (isNameExpr == isIntegerConstant) {
// isComment
if (isNameExpr) {
isNameExpr.isMethod(this, isMethod());
} else {
isNameExpr.isMethod(this, isMethod());
}
} else {
PostModel isVariable = isNameExpr.isMethod(isNameExpr);
isNameExpr.isMethod(this, isMethod(), isNameExpr);
}
}
@Override
protected void isMethod() {
isNameExpr.isMethod().isMethod(this);
isNameExpr.isMethod(this);
super.isMethod();
}
@Override
protected void isMethod() {
super.isMethod();
// isComment
isMethod();
// isComment
// isComment
isNameExpr.isMethod(this, ReaderPostPagerActivity.class);
// isComment
// isComment
int isVariable = isNameExpr.isMethod();
isMethod(isNameExpr, true);
if (isNameExpr == isNameExpr) {
// isComment
// isComment
isNameExpr.isMethod(this);
}
isMethod(isNameExpr);
isMethod();
isMethod();
// isComment
if (isNameExpr.isMethod()) {
isNameExpr.isMethod(isNameExpr.isMethod());
}
isNameExpr.isMethod("isStringConstant");
isNameExpr.isMethod();
isNameExpr.isMethod();
}
private void isMethod() {
if (isMethod() != null && isNameExpr.isMethod(this) && isNameExpr.isMethod(isNameExpr) && !isNameExpr.isMethod(isMethod().isMethod())) {
isNameExpr.isMethod(isNameExpr.isMethod(isMethod()));
}
}
private void isMethod(int isParameter) {
isMethod().isMethod().isMethod(isNameExpr.isMethod(isNameExpr));
}
@Override
public void isMethod() {
// isComment
Fragment isVariable = isNameExpr.isMethod();
if (isNameExpr instanceof OnActivityBackPressedListener) {
boolean isVariable = ((OnActivityBackPressedListener) isNameExpr).isMethod();
if (isNameExpr) {
return;
}
}
if (isMethod() && isNameExpr.isMethod().isMethod(this)) {
// isComment
return;
}
super.isMethod();
}
@Override
public void isMethod() {
isMethod(true);
}
@Override
public void isMethod() {
isMethod(true);
}
private void isMethod(boolean isParameter) {
isNameExpr.isMethod(isNameExpr ? isNameExpr.isFieldAccessExpr : isNameExpr.isFieldAccessExpr);
isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr).isMethod(isNameExpr ? isNameExpr.isFieldAccessExpr : isNameExpr.isFieldAccessExpr);
}
// isComment
@Override
public void isMethod(int isParameter) {
isMethod(isNameExpr);
isMethod(isNameExpr, true);
if (isMethod() != null) {
isNameExpr.isMethod((ViewGroup) isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr));
isMethod();
if (isNameExpr == isNameExpr && isMethod().isMethod(isNameExpr.isFieldAccessExpr)) {
// isComment
isMethod().isMethod();
}
}
}
// isComment
@Override
public void isMethod() {
if (!isNameExpr.isMethod()) {
// isComment
isNameExpr.isMethod(isNameExpr);
return;
}
if (isMethod() != null && isMethod() != null) {
if (isMethod().isMethod(isNameExpr.isFieldAccessExpr)) {
// isComment
isNameExpr.isMethod((ViewGroup) isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr));
}
}
isNameExpr.isMethod(this, isMethod(), true);
}
private void isMethod() {
isMethod(isNameExpr.isMethod());
}
private void isMethod(int isParameter) {
if (isNameExpr == isNameExpr && isNameExpr != null) {
((MainToolbarFragment) isNameExpr.isMethod()).isMethod(isNameExpr.isMethod());
} else {
((MainToolbarFragment) isNameExpr.isMethod()).isMethod(isNameExpr.isMethod(isNameExpr).isMethod());
}
}
private void isMethod() {
if (isMethod() != null) {
if (isMethod().isMethod(isNameExpr.isFieldAccessExpr, true)) {
isNameExpr.isMethod();
isMethod();
}
}
}
private void isMethod(int isParameter, boolean isParameter) {
switch(isNameExpr) {
case isNameExpr:
isNameExpr.isMethod(isNameExpr.isFieldAccessExpr);
if (isNameExpr) {
isNameExpr.isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr, isMethod());
}
break;
case isNameExpr:
isNameExpr.isMethod(isNameExpr.isFieldAccessExpr);
if (isNameExpr) {
isNameExpr.isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr);
}
break;
case isNameExpr:
isNameExpr.isMethod(isNameExpr.isFieldAccessExpr);
if (isNameExpr) {
isNameExpr.isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr);
}
break;
case isNameExpr:
isNameExpr.isMethod(isNameExpr.isFieldAccessExpr);
if (isNameExpr) {
isNameExpr.isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr);
}
break;
default:
break;
}
}
private void isMethod() {
Intent isVariable = new Intent(isNameExpr.isFieldAccessExpr, isNameExpr.isMethod(isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr)));
ResolveInfo isVariable = isMethod().isMethod(isNameExpr, isNameExpr.isFieldAccessExpr);
if (isNameExpr != null && !isMethod().isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr)) {
// isComment
isNameExpr.isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr, isNameExpr.isFieldAccessExpr.isFieldAccessExpr);
}
}
public void isMethod() {
isNameExpr.isMethod(isNameExpr);
}
private void isMethod(Intent isParameter) {
if (isNameExpr != null) {
int isVariable = isNameExpr.isMethod(isNameExpr.isFieldAccessExpr, -isIntegerConstant);
isMethod(isNameExpr);
}
}
private void isMethod(Intent isParameter) {
if (isNameExpr != null && isNameExpr.isMethod(isNameExpr.isFieldAccessExpr, true)) {
isNameExpr.isMethod(this, isNameExpr, true);
}
}
@Override
public void isMethod(int isParameter, int isParameter, Intent isParameter) {
super.isMethod(isNameExpr, isNameExpr, isNameExpr);
switch(isNameExpr) {
case isNameExpr.isFieldAccessExpr:
if (isNameExpr != isNameExpr.isFieldAccessExpr || isNameExpr == null || isMethod()) {
return;
}
int isVariable = isNameExpr.isMethod(isNameExpr.isFieldAccessExpr, isIntegerConstant);
final SiteModel isVariable = isMethod();
final PostModel isVariable = isNameExpr.isMethod(isNameExpr);
if (isNameExpr != null && isNameExpr != null) {
isNameExpr.isMethod(this, isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr), isNameExpr, isNameExpr, isNameExpr, new View.OnClickListener() {
@Override
public void isMethod(View isParameter) {
isNameExpr.isMethod(isNameExpr.this, isNameExpr, isNameExpr, isNameExpr);
}
});
}
break;
case isNameExpr.isFieldAccessExpr:
MySiteFragment isVariable = isMethod();
if (isNameExpr != null) {
isNameExpr.isMethod(isNameExpr, isNameExpr, isNameExpr);
}
isMethod(isNameExpr);
isMethod(isNameExpr);
isMethod();
break;
case isNameExpr.isFieldAccessExpr:
if (isNameExpr == isNameExpr) {
// isComment
isMethod();
} else if (!isNameExpr.isMethod(isNameExpr, isNameExpr)) {
// isComment
isMethod();
}
break;
case isNameExpr.isFieldAccessExpr:
if (isNameExpr == isNameExpr) {
// isComment
isNameExpr.isMethod(this, new Intent(this, GCMRegistrationIntentService.class));
}
break;
case isNameExpr.isFieldAccessExpr:
if (isMethod() != null) {
isMethod().isMethod(isNameExpr, isNameExpr, isNameExpr);
isMethod(isNameExpr);
isMethod(isNameExpr);
if (isNameExpr != null && isNameExpr.isMethod(isNameExpr, isIntegerConstant) == isNameExpr.isFieldAccessExpr) {
isMethod();
}
}
break;
case isNameExpr.isFieldAccessExpr:
if (isNameExpr == isNameExpr.isFieldAccessExpr) {
isMethod();
}
break;
case isNameExpr.isFieldAccessExpr:
if (isNameExpr == isNameExpr.isFieldAccessExpr) {
isMethod();
}
break;
case isNameExpr.isFieldAccessExpr:
if (isMethod() != null) {
isMethod().isMethod(isNameExpr, isNameExpr, isNameExpr);
}
break;
case isNameExpr.isFieldAccessExpr:
Fragment isVariable = isNameExpr.isMethod();
if (isNameExpr instanceof MeFragment || isNameExpr instanceof MySiteFragment) {
isNameExpr.isMethod(isNameExpr, isNameExpr, isNameExpr);
}
break;
case isNameExpr.isFieldAccessExpr:
MySiteFragment isVariable = isMethod();
if (isNameExpr != null) {
isNameExpr.isMethod(isNameExpr, isNameExpr, isNameExpr);
}
break;
}
}
private void isMethod() {
if (isNameExpr.isMethod() || isMethod() == null || !isNameExpr.isMethod(isMethod())) {
return;
}
String isVariable = isNameExpr.isFieldAccessExpr;
PromoDialog isVariable = new PromoDialog();
isNameExpr.isMethod(isNameExpr, isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr), isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr), isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr), isNameExpr.isFieldAccessExpr.isFieldAccessExpr, isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr), "isStringConstant", isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr));
isNameExpr.isMethod(isMethod(), isNameExpr);
isNameExpr.isMethod(isNameExpr.isFieldAccessExpr);
}
private void isMethod() {
// isComment
isMethod();
}
private void isMethod() {
isNameExpr.isMethod(this, new Intent(this, GCMRegistrationIntentService.class));
isNameExpr.isMethod();
}
private MySiteFragment isMethod() {
Fragment isVariable = isNameExpr.isMethod(isNameExpr);
if (isNameExpr instanceof MySiteFragment) {
return (MySiteFragment) isNameExpr;
}
return null;
}
private MeFragment isMethod() {
Fragment isVariable = isNameExpr.isMethod(isNameExpr);
if (isNameExpr instanceof MeFragment) {
return (MeFragment) isNameExpr;
}
return null;
}
private NotificationsListFragment isMethod() {
Fragment isVariable = isNameExpr.isMethod(isNameExpr);
if (isNameExpr instanceof NotificationsListFragment) {
return (NotificationsListFragment) isNameExpr;
}
return null;
}
// isComment
@SuppressWarnings("isStringConstant")
@Subscribe(threadMode = isNameExpr.isFieldAccessExpr)
public void isMethod(OnAuthenticationChanged isParameter) {
if (isNameExpr.isMethod()) {
if (isNameExpr != null && isNameExpr.isFieldAccessExpr.isFieldAccessExpr == isNameExpr.isFieldAccessExpr) {
isNameExpr.isMethod(this, isNameExpr, isNameExpr);
}
return;
}
if (isNameExpr.isMethod()) {
isNameExpr.isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr);
if (isNameExpr) {
if (isNameExpr) {
// isComment
// isComment
// isComment
isNameExpr.isMethod(true);
isNameExpr.isMethod(isNameExpr.isMethod());
if (isNameExpr != null) {
isNameExpr.isMethod(this, isNameExpr, isNameExpr);
} else {
isNameExpr.isMethod(this, null, null, null, null, true);
}
} else {
isNameExpr.isMethod();
if (isNameExpr != null) {
isNameExpr.isMethod(this, isNameExpr, isNameExpr);
} else {
isNameExpr.isMethod(this, true, isMethod().isMethod(isNameExpr));
}
}
}
}
}
@SuppressWarnings("isStringConstant")
@Subscribe(threadMode = isNameExpr.isFieldAccessExpr)
public void isMethod(OnQuickStartCompleted isParameter) {
if (isMethod() != null && !isNameExpr.isMethod()) {
// isComment
isNameExpr.isMethod(isNameExpr.isFieldAccessExpr.isMethod(), true);
}
}
@SuppressWarnings("isStringConstant")
@Subscribe(threadMode = isNameExpr.isFieldAccessExpr)
public void isMethod(OnAccountChanged isParameter) {
// isComment
if (isNameExpr.isMethod()) {
isNameExpr.isMethod(isNameExpr.isMethod().isMethod());
if (isNameExpr.isMethod()) {
isMethod();
}
}
}
/**
* isComment
*/
private void isMethod() {
AccountModel isVariable = isNameExpr.isMethod();
if (!isNameExpr.isMethod(isNameExpr.isMethod()) && !isNameExpr.isMethod(isNameExpr.isMethod())) {
isNameExpr.isMethod(isNameExpr.isMethod(), isNameExpr.isMethod());
isNameExpr.isMethod();
isNameExpr.isMethod();
}
}
@SuppressWarnings("isStringConstant")
public void isMethod(NotificationEvents.NotificationsChanged isParameter) {
isNameExpr.isMethod(isNameExpr.isFieldAccessExpr);
}
@SuppressWarnings("isStringConstant")
public void isMethod(NotificationEvents.NotificationsUnseenStatus isParameter) {
isNameExpr.isMethod(isNameExpr.isFieldAccessExpr);
}
@SuppressWarnings("isStringConstant")
public void isMethod(ConnectionChangeReceiver.ConnectionChangeEvent isParameter) {
isMethod(isNameExpr.isMethod());
}
private void isMethod() {
isMethod(isNameExpr.isMethod(this));
}
private void isMethod(boolean isParameter) {
if (isNameExpr && isNameExpr.isMethod() == isNameExpr.isFieldAccessExpr) {
isNameExpr.isMethod(isNameExpr, true);
} else if (!isNameExpr && isNameExpr.isMethod() != isNameExpr.isFieldAccessExpr) {
isNameExpr.isMethod(isNameExpr, true);
}
}
private void isMethod() {
if (!isNameExpr.isMethod(isNameExpr, isNameExpr)) {
// isComment
isNameExpr.isMethod();
// isComment
isMethod(null);
// isComment
isNameExpr.isMethod(this);
} else {
SiteModel isVariable = isMethod();
if (isNameExpr == null && isNameExpr.isMethod()) {
isNameExpr.isMethod(this, isNameExpr.isMethod().isMethod(isIntegerConstant));
}
}
}
/**
* isComment
*/
@Nullable
public SiteModel isMethod() {
return isNameExpr;
}
public void isMethod(int isParameter) {
isMethod(isNameExpr.isMethod(isNameExpr));
}
public void isMethod(@Nullable SiteModel isParameter) {
isNameExpr = isNameExpr;
if (isNameExpr == null) {
isNameExpr.isMethod(-isIntegerConstant);
return;
}
// isComment
isNameExpr.isMethod(isNameExpr.isMethod(isNameExpr));
// isComment
isNameExpr.isMethod(true);
isNameExpr.isMethod(isNameExpr.isMethod());
isMethod();
}
/**
* isComment
*/
public void isMethod() {
int isVariable = isNameExpr.isMethod();
if (isNameExpr != -isIntegerConstant) {
// isComment
isNameExpr = isNameExpr.isMethod(isNameExpr);
// isComment
if (isNameExpr != null) {
isMethod();
return;
}
}
// isComment
long isVariable = isNameExpr.isMethod().isMethod();
SiteModel isVariable = isNameExpr.isMethod(isNameExpr);
// isComment
if (isNameExpr != null) {
isMethod(isNameExpr);
return;
}
// isComment
List<SiteModel> isVariable = isNameExpr.isMethod();
if (isNameExpr.isMethod() != isIntegerConstant) {
isMethod(isNameExpr.isMethod(isIntegerConstant));
return;
}
// isComment
isNameExpr = isNameExpr.isMethod();
if (isNameExpr.isMethod() != isIntegerConstant) {
isMethod(isNameExpr.isMethod(isIntegerConstant));
}
// isComment
}
// isComment
@SuppressWarnings("isStringConstant")
@Subscribe(threadMode = isNameExpr.isFieldAccessExpr)
public void isMethod(OnPostUploaded isParameter) {
SiteModel isVariable = isMethod();
if (isNameExpr != null && isNameExpr.isFieldAccessExpr != null && isNameExpr.isFieldAccessExpr.isMethod() == isNameExpr.isMethod()) {
isNameExpr.isMethod(this, isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr), isNameExpr.isMethod(), isNameExpr.isFieldAccessExpr, null, isNameExpr, isNameExpr);
}
}
@SuppressWarnings("isStringConstant")
@Subscribe(threadMode = isNameExpr.isFieldAccessExpr)
public void isMethod(OnSiteChanged isParameter) {
// isComment
if (isMethod() == null && isNameExpr.isMethod()) {
isMethod(isNameExpr.isMethod().isMethod(isIntegerConstant));
}
if (isMethod() == null) {
return;
}
SiteModel isVariable = isNameExpr.isMethod(isMethod().isMethod());
if (isNameExpr != null) {
isNameExpr = isNameExpr;
}
if (isMethod() != null) {
isMethod().isMethod(isNameExpr);
}
}
@SuppressWarnings("isStringConstant")
@Subscribe(threadMode = isNameExpr.isFieldAccessExpr)
public void isMethod(OnSiteRemoved isParameter) {
isMethod();
}
@Override
public void isMethod(@NonNull String isParameter) {
MySiteFragment isVariable = isMethod();
if (isNameExpr != null) {
isNameExpr.isMethod(isNameExpr);
}
}
@Override
public void isMethod(@NonNull String isParameter) {
MySiteFragment isVariable = isMethod();
if (isNameExpr != null) {
isNameExpr.isMethod(isNameExpr);
}
}
@Override
public void isMethod(@NonNull String isParameter) {
MySiteFragment isVariable = isMethod();
if (isNameExpr != null) {
isNameExpr.isMethod(isNameExpr);
}
}
@Override
public void isMethod(@NonNull String isParameter) {
MySiteFragment isVariable = isMethod();
if (isNameExpr != null) {
isNameExpr.isMethod(isNameExpr);
}
}
// isComment
// isComment
public void isMethod(CharSequence isParameter) {
isMethod();
isNameExpr = isNameExpr.isMethod(isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr), isNameExpr, isNameExpr.isMethod(this, isMethod().isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr)));
isNameExpr.isMethod();
}
private void isMethod() {
if (isNameExpr != null && isNameExpr.isMethod()) {
isNameExpr.isMethod();
isNameExpr = null;
}
}
// isComment
// isComment
@Override
protected void isMethod() {
super.isMethod();
isMethod();
isNameExpr.isMethod((ViewGroup) isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr));
}
}
| [
"matheus@melsolucoes.net"
] | matheus@melsolucoes.net |
32eb7283e0fbcb7509828944522ec674d27ca5eb | 6f3c4952defc1b9aee9e8a206005539a47e55003 | /HomeWork/CheckingAccess/ExceptionOfAcces/UserNotFoundException.java | 521585a2afb46f119283971f26ca547749aafd22 | [] | no_license | DemiurgDanilych/Study-in-Netology | a34fa7768806ce663dbd512ac08a81de20f989f7 | ea61e92367faf41e78c0a501626ab0c08506a38e | refs/heads/master | 2023-03-28T23:26:44.252862 | 2021-04-03T15:11:56 | 2021-04-03T15:11:56 | 354,319,767 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 305 | java | package HomeWork.CheckingAccess.ExceptionOfAcces;
public class UserNotFoundException extends Exception {
public UserNotFoundException(String user,String pass) {
System.out.println("пользователя с логином \"" + user + "\" и паролем \"" + pass + "\" ненайден!");
}
} | [
"javaDanilAgafonov@yandex.ru"
] | javaDanilAgafonov@yandex.ru |
513f5d754ca63ff64b03b75b65cf80347669c77b | a8609020269206adec470d777cbba6f812651a2a | /app/src/main/java/kiwi/smartwallet/AlbumStorageDirFactory.java | 3b83ca58934a0922da6705a4fed7373d5b3baa68 | [] | no_license | TWKiwi/SmartWallet | 8a2263975d521bebfdb8b10b3f6226b614cfecc0 | 11fcb9df4c6af7f341d34481e0eeaba5f75d534e | refs/heads/master | 2016-09-09T17:02:42.349275 | 2014-12-26T16:08:02 | 2014-12-26T16:08:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 205 | java | package kiwi.smartwallet;
import java.io.File;
/**
* Created by 奇異果Kiwi on 2014/12/25.
*/
abstract class AlbumStorageDirFactory {
public abstract File getAlbumStorageDir(String albumName);
}
| [
"felicdad20120706@gmial.com"
] | felicdad20120706@gmial.com |
6a528643de82d0f4310e9d6423901180cad6e9db | 89eb9b0806005b7f7b22f78cf945db3883248f5c | /src/main/java/com/wearegroup11/pabwe/storage/StorageService.java | d15251ea6d9e93ea987c0cbf61b88d6563fd556c | [] | no_license | RychEmrycho/Sistem-Informasi-Komoditas-Dinas-Pertanian-SIKDP | 4cea12366db1dc2bc7c1914dabbb60bd2ef30f64 | d2a1527bb8df5a4119ffcec1a0d8e1bcc567b369 | refs/heads/master | 2020-04-11T22:34:42.862492 | 2019-01-30T13:16:39 | 2019-01-30T13:16:39 | 162,140,913 | 3 | 2 | null | null | null | null | UTF-8 | Java | false | false | 427 | java | package com.wearegroup11.pabwe.storage;
import org.springframework.core.io.Resource;
import org.springframework.web.multipart.MultipartFile;
import java.nio.file.Path;
import java.util.stream.Stream;
public interface StorageService {
void init();
void store(MultipartFile file);
Stream<Path> loadAll();
Path load(String filename);
Resource loadAsResource(String filename);
void deleteAll();
}
| [
"rychemrycho@gmail.com"
] | rychemrycho@gmail.com |
69ed2ffac2b4ab464fcc6c57fab11c33da30da59 | 15d13b17a5ffac42a1baf05830f0544a5eb7005c | /src/main/java/com/java/jkpot/dao/StudentsFullLengthMarksDAO.java | 6198862bc5378e86cb2e2e6b13849da927ee6746 | [] | no_license | ujjwalsharma1994/jkpot_service | fe2a15c2010f8d80e0eae2c1ae0d4fe7d15ca96a | 8aec3f48dc60ec4866542c00e6f9b411026d6100 | refs/heads/master | 2023-05-15T18:31:04.233359 | 2021-06-15T01:48:31 | 2021-06-15T01:48:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 511 | java | package com.java.jkpot.dao;
import java.util.List;
import org.bson.Document;
import com.java.jkpot.model.StudentsFullLengthMockMarks;
public interface StudentsFullLengthMarksDAO {
List<Document> findByExamIdAndMockId(int examId, int mockId);
Document findTopMarksOfStudent(int examId, int mockId, String userId);
List<Document> fetchHighestMarksOfStudents(int examId, int fullLengthMockId);
StudentsFullLengthMockMarks checkIfUserHasGivenTheMock(int examId, int fullLengthMockId, String userId);
}
| [
"ujjwalbennington@gmail.com"
] | ujjwalbennington@gmail.com |
4b73eaa585588f4ee5123a48b810fe3205713bb0 | 4442182757148df49c6bbd808c90a4691c722578 | /app/src/main/java/com/minminaya/materialdesigndemo/text_fields/fragment/FloatingLabelsFragment.java | b4b60996a401f5cb3190b4f3429100b6e2a88a6f | [] | no_license | minminaya/MaterialDesignLearning | c66120df83568733b92e3fdb0e479ac12d118de3 | 0d299328256de2f84c38abe3493dde98ec8d24cf | refs/heads/master | 2021-01-16T18:34:51.467166 | 2017-08-17T15:24:52 | 2017-08-17T15:24:52 | 100,096,962 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,291 | java | package com.minminaya.materialdesigndemo.text_fields.fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.TextInputEditText;
import android.support.design.widget.TextInputLayout;
import android.support.v4.app.Fragment;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.minminaya.materialdesigndemo.R;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
/**
* A simple {@link Fragment} subclass.
*/
public class FloatingLabelsFragment extends Fragment {
@BindView(R.id.layout1)
TextInputLayout layout1;
Unbinder unbinder;
@BindView(R.id.floating_labels_edit_text)
TextInputEditText floatingLabelsEditText;
public FloatingLabelsFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_floating_labels, container, false);
unbinder = ButterKnife.bind(this, view);
return view;
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
layout1.setError("程序启动即可弹出“监听到错误”,需要一定的空间");
floatingLabelsEditText.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
Log.d("FloatingLabelsFragment", "当前text:" + charSequence);
}
@Override
public void afterTextChanged(Editable editable) {
}
});
}
@Override
public void onDestroyView() {
super.onDestroyView();
unbinder.unbind();
}
}
| [
"971382989@qq.com"
] | 971382989@qq.com |
e101e374901b219eb46615d9c906541f384fc063 | 7f162e3fe425d9dc96a21683e89325e471c22e70 | /src/main/java/com/mapper/BlogMapper.java | b311ce931b29c1bd21c3bee71341e8c5a598c363 | [] | no_license | heartccace/mybatis | c239b1a76c8a65aafc227fc7c0514f4fd4149b2a | fd3fc137d2add6a99d46fdce0d7963e55bdcc60b | refs/heads/master | 2022-06-24T08:58:37.545980 | 2019-12-15T14:50:03 | 2019-12-15T14:50:03 | 214,098,738 | 0 | 0 | null | 2022-06-21T02:00:45 | 2019-10-10T05:58:30 | Java | UTF-8 | Java | false | false | 128 | java | package com.mapper;
import java.util.List;
import com.entity.Blog;
public interface BlogMapper {
List<Blog> selectBlog();
}
| [
"heartccace@gmail.com"
] | heartccace@gmail.com |
5d7b63a1ef50c926084bf541d7697186508c8ae7 | 1faff5da9fe23f2008de6c13d3ccd398659a0f9c | /Day1/DataTypes.java | 1a037739818c504269639d4fd4a72dff5e49ec65 | [
"MIT"
] | permissive | sharmaraghav260/30DaysOfCode | 42baf611091387e7e0c0bb21bb708626ee0bb854 | d59ea6e8ffdf861070c203cebbe7bc634d5962a6 | refs/heads/master | 2021-01-25T11:02:11.440108 | 2017-07-10T23:17:32 | 2017-07-10T23:17:32 | 93,902,577 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,133 | java | import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class Solution {
public static void main(String[] args) {
int i = 4;
double d = 4.0;
String s = "HackerRank ";
Scanner scan = new Scanner(System.in);
/* Declare second integer, double, and String variables. */
int n = 0;
double dou = 0.0;
String str = "";
/* Read and save an integer, double, and String to your variables.*/
// Note: If you have trouble reading the entire String, please go back and review the Tutorial closely.
n = scan.nextInt();
dou = scan.nextDouble();
str += scan.next();
str += scan.nextLine();
/* Print the sum of both integer variables on a new line. */
System.out.println(n+i);
/* Print the sum of the double variables on a new line. */
System.out.println(d+dou);
/* Concatenate and print the String variables on a new line;
the 's' variable above should be printed first. */
System.out.println(s+str);
scan.close();
}
}
| [
"sharmaraghav260@gmail.com"
] | sharmaraghav260@gmail.com |
6f6dbbe1e06628d558a7a98429bb6be3a0622456 | 7dd2ed6759bd6e20cde067fe907c40ecf6b2f0ac | /payshop/src/com/zsTrade/web/sys/service/SysResourceService.java | 6fe185fe6af567b8b67affb6d7aaff0b34e7978a | [
"Apache-2.0"
] | permissive | T5750/store-repositories | 64406e539dd41508acd4d17324a420bd722a126d | 10c44c9fc069c49ff70c45373fd3168286002308 | refs/heads/master | 2020-03-16T13:10:40.115323 | 2018-05-16T02:19:39 | 2018-05-16T02:19:43 | 132,683,143 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,986 | java | //Powered By if, Since 2014 - 2020
package com.zsTrade.web.sys.service;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zsTrade.common.base.ServiceMybatis;
import com.zsTrade.common.beetl.utils.BeetlUtils;
import com.zsTrade.common.constant.Constant;
import com.zsTrade.common.utils.TreeUtils;
import com.zsTrade.web.sys.mapper.SysResourceMapper;
import com.zsTrade.web.sys.model.SysResource;
import com.zsTrade.web.sys.model.SysUser;
import com.zsTrade.web.sys.utils.SysUserUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
/**
*
* @author
*/
@Service("sysResourceService")
public class SysResourceService extends ServiceMybatis<SysResource> {
@Resource
private SysResourceMapper sysResourceMapper;
/**
* 新增or更新SysResource
*/
public int saveSysResource(SysResource sysResource) {
int count = 0;
// 新的parentIds
sysResource.setParentIds(sysResource.getParentIds()
+ sysResource.getParentId() + ",");
if (null == sysResource.getId()) {
count = this.insertSelective(sysResource);
} else {
// getParentIds() 当前选择的父节点parentIds , getParentId()父节点的id
// 先更新parentId,此节点的parentIds以更新
count = this.updateByPrimaryKeySelective(sysResource);
// 不移动节点不更新子节点的pids
if (!StringUtils.equals(sysResource.getOldParentIds(),
sysResource.getParentIds())) {
sysResourceMapper.updateParentIds(sysResource); // 批量更新子节点的parentIds
}
}
if (count > 0) {
BeetlUtils.addBeetlSharedVars(Constant.CACHE_ALL_RESOURCE,
this.getAllResourcesMap());
SysUserUtils.clearCacheResource();
}
return count;
}
/**
* 根据父id删除自身已经所有子节点
*
* @param id
* @return
*/
public int deleteResourceByRootId(Long id) {
int count = sysResourceMapper.beforeDeleteResource(id);
if (count > 0)
return -1;
int delCount = sysResourceMapper.deleteIdsByRootId(id);
if (delCount > 0) {
// 重新查找全部资源放入缓存(为了开发时候用)
BeetlUtils.addBeetlSharedVars(Constant.CACHE_ALL_RESOURCE,
this.getAllResourcesMap());
SysUserUtils.clearCacheResource();
}
return delCount;
}
/**
* 根据用户id得到用户持有的资源
* @param userId
* @return
*/
public List<SysResource> findUserResourceByUserId(SysUser sysUser) {
return sysResourceMapper.findUserResourceByUserId(sysUser.getId());
}
/**
* 菜单管理分页显示筛选查询
* @param params {"name":"菜单名字","id":"菜单id"}
* @return
*/
public PageInfo<SysResource> findPageInfo(Map<String, Object> params) {
PageHelper.startPage(params);
List<SysResource> list = sysResourceMapper.findPageInfo(params);
return new PageInfo<SysResource>(list);
}
/**
* 获取全部资源map形式
* @return
*/
public LinkedHashMap<String, SysResource> getAllResourcesMap() {
// 读取全部资源
List<SysResource> resList = this.select(new SysResource(), "sort");
LinkedHashMap<String, SysResource> AllResourceMap = new LinkedHashMap<String, SysResource>();
for (SysResource res : resList) {
if (StringUtils.isBlank(res.getUrl())) {
AllResourceMap.put(res.getId().toString(), res);
} else {
AllResourceMap.put(res.getUrl(), res);
}
}
return AllResourceMap;
}
/**
* 获取全部资源list形式
* @return
*/
public List<SysResource> getAllResourcesList() {
LinkedHashMap<String, SysResource> allRes = BeetlUtils
.getBeetlSharedVars(Constant.CACHE_ALL_RESOURCE);
List<SysResource> resList = new ArrayList<SysResource>(allRes.values());
return resList;
}
/**
* 获取菜单树
*/
public List<SysResource> getMenuTree(){
return TreeUtils.toTreeNodeList(getAllResourcesList(),SysResource.class);
}
}
| [
"evangel_a@sina.com"
] | evangel_a@sina.com |
54ed0c5e6aacc98db6652b5dfaadcbbc1a5e22e4 | e96036a4694a73ce51a598e659ac3e48e3d8d828 | /src/Hello.java | 50d9495061350257902498e4439e66bb9fef2f7f | [] | no_license | innurur/B21_Practice2 | 39111ca216169dddf7f8e7bf123888ddd9de6301 | f94cea88b29ef15d1dd7cedb95cc2127db1bd476 | refs/heads/master | 2023-01-08T12:04:59.137540 | 2020-11-10T19:51:09 | 2020-11-10T19:51:09 | 311,768,803 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 102 | java | public class Hello {
public static void main(String[] args) {
// nothing to say
}
}
| [
"inarasalih2015@gmail.com"
] | inarasalih2015@gmail.com |
e82826f3d1d43a5ebd3453fc24f6e2c095a614a9 | c66d05bb154bce8d7e9b298790ed4929d1cc0e32 | /src/com/example/YandexTask/ImageDownloadManager.java | aa0e4a29e15881c2c07e87001dc04d46486aa7ff | [
"Apache-2.0"
] | permissive | AuthenticEshkinKot/CSCAndroidTask | e1be167c5ff57fde48a29fbb4725fb17e16c20a6 | af816f9c8bca7b844294570d4cb5ce95f491520d | refs/heads/master | 2016-09-01T09:23:55.153305 | 2015-12-04T19:09:15 | 2015-12-04T19:09:15 | 47,422,951 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,361 | java | package com.example.YandexTask;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.AsyncTask;
import android.util.DisplayMetrics;
import android.util.Log;
import android.widget.Toast;
import com.yandex.disk.client.Credentials;
import com.yandex.disk.client.ProgressListener;
import com.yandex.disk.client.TransportClient;
import java.io.*;
/**
* Created by MAX on 30.06.2014.
*/
public class ImageDownloadManager {
private static final String IMAGE_FILENAME = "image";
private static final String TAG = "ImageDownloadManager";
private static int instCode = 0;
private int imagesCount;
private File[] files;
private String[] paths;
private Context appContext;
private String token;
private DisplayMetrics metrics;
private SlideShowActivity parentActivity;
private boolean firstImage;
private boolean isWorking;
private boolean hasWorkingTask;
private boolean isFinishPlanned;
private int firstUnloaded;
public ImageDownloadManager(String[] filePaths,
SlideShowActivity parentActivity,
String token,
DisplayMetrics metrics) {
imagesCount = filePaths.length;
files = new File[imagesCount];
this.paths = filePaths;
this.parentActivity = parentActivity;
this.token = token;
this.metrics = metrics;
++instCode;
appContext = parentActivity.getApplicationContext();
}
public void LoadFromIndex(int fileIndex) {
firstImage = true;
isWorking = true;
isFinishPlanned = false;
hasWorkingTask = true;
firstUnloaded = -1;
new ImageLoaderTask().execute(paths[fileIndex], String.valueOf(fileIndex));
}
public void BitmapsRecycle() {
isFinishPlanned = true;
if(!hasWorkingTask) {
for(File file : files) {
if(file != null) {
file.delete();
}
}
}
}
public void OnConfigurationChange(SlideShowActivity parentActivity) {
this.parentActivity = parentActivity;
}
public void StopDownload() {
isWorking = false;
}
private class ImageLoaderTask extends AsyncTask<String, Void, Void> {
int indexToLoad;
protected Void doInBackground(String... params) {
indexToLoad = Integer.decode(params[1]);
Bitmap imageBmp = tryDownloadImage(params[0]);
if(imageBmp != null) {
saveImageToFile(params[1], imageBmp);
imageBmp.recycle();
}
return null;
}
private Bitmap tryDownloadImage(String path) {
TransportClient client = null;
File file = null;
Bitmap resultBmp = null;
Bitmap srcBmp = null;
try {
client = TransportClient.getInstance(appContext, new Credentials("", token));
file = File.createTempFile(IMAGE_FILENAME + String.valueOf(instCode), null, appContext.getCacheDir());
client.downloadFile(path, file, new ProgressListener() {
long prev = 0;
@Override
public void updateProgress(long loaded, long total) {
long diff = loaded - prev;
prev = loaded;
parentActivity.UpdateProgress((int)total, (int)diff);
}
@Override
public boolean hasCancelled() {
return false;
}
});
BitmapFactory.Options options = new BitmapFactory.Options();
srcBmp = BitmapFactory.decodeFile(file.getPath(), options);
srcBmp.recycle();
srcBmp = null;
System.gc();
options.inSampleSize = computeSampleSize(options.outWidth, options.outHeight, metrics);
resultBmp = BitmapFactory.decodeFile(file.getPath(), options);
} catch(OutOfMemoryError err) {
Log.d(TAG, "OutOfMemory", err);
} catch(IOException err) {
Log.d(TAG, "IOException - file is too big", err);
} catch(Exception e) {
Log.d(TAG, "Exception in ImageLoader", e);
} finally {
TransportClient.shutdown(client);
if(file != null) {
file.delete();
}
if(srcBmp != null && !srcBmp.isRecycled()) {
srcBmp.recycle();
}
System.gc();
}
return resultBmp;
}
private void saveImageToFile(String imageIndex, Bitmap resultBmp) {
String filename = IMAGE_FILENAME + String.valueOf(instCode) + String.valueOf(imageIndex);
boolean savedOnExternal = false;
if(appContext.getExternalFilesDir(null) != null) {
File file = new File(appContext.getExternalFilesDir(null), filename);
savedOnExternal = trySaveBitmapToFile(file, resultBmp);
if(!savedOnExternal) {
file.delete();
}
}
if(!savedOnExternal) {
File file = new File(appContext.getFilesDir(), filename);
if(!trySaveBitmapToFile(file, resultBmp)) {
file.delete();
}
}
}
private boolean trySaveBitmapToFile(File file, Bitmap resultBmp) {
boolean res = false;
try {
FileOutputStream fOut = new FileOutputStream(file);
resultBmp.compress(Bitmap.CompressFormat.PNG, 0, fOut);
fOut.flush();
fOut.close();
files[indexToLoad] = file;
res = true;
} catch(OutOfMemoryError err) {
Log.d(TAG, "OutOfMemory", err);
} catch(Exception e) {
Log.d(TAG, "Exception on file writing", e);
}
return res;
}
protected void onPostExecute(Void result) {
if(isFinishPlanned) {
hasWorkingTask = false;
BitmapsRecycle();
return;
}
if(firstImage) {
if(files[indexToLoad] != null) {
parentActivity.SetupBitmapShow(indexToLoad);
firstImage = false;
} else {
parentActivity.ResetProgress();
if(paths[indexToLoad] != null) {
String imageName = paths[indexToLoad].substring(paths[indexToLoad].lastIndexOf('/') + 1,
paths[indexToLoad].length());
Toast.makeText(parentActivity, "Can't load " + imageName, Toast.LENGTH_LONG).show();
}
else {
Toast.makeText(parentActivity, "Image pathToCurrentDir is null", Toast.LENGTH_LONG).show();
}
}
}
int nextToLoad = -1;
for(int i = indexToLoad + 1; i < imagesCount && nextToLoad == -1; ++i) {
if(files[i] == null) {
nextToLoad = i;
}
}
if(nextToLoad == -1) {
for(int i = 0; i < indexToLoad && nextToLoad == -1; ++i) {
if(files[i] == null) {
nextToLoad = i;
}
}
}
if(files[indexToLoad] == null) {
if(firstUnloaded == -1) {
firstUnloaded = indexToLoad;
} else if(firstUnloaded == indexToLoad) {
isWorking = false;
}
} else if(firstUnloaded != -1) {
firstUnloaded = -1;
}
if((nextToLoad == -1 || !isWorking) && firstImage) {
parentActivity.CancelSlideShow();
}
if(nextToLoad != -1 && isWorking) {
new ImageLoaderTask().execute(paths[nextToLoad], String.valueOf(nextToLoad));
} else {
hasWorkingTask = false;
}
}
private int computeSampleSize(int outWidth, int outHeight, DisplayMetrics metrics) {
int biggestImgSize = outWidth > outHeight ?
outWidth : outHeight;
int biggestScreenSize = metrics.widthPixels > metrics.heightPixels ?
metrics.widthPixels : metrics.heightPixels;
return biggestImgSize / biggestScreenSize;
}
}
public Bitmap getBitmap(int index) {
if(files[index] != null) {
Bitmap ret = null;
try {
ret = BitmapFactory.decodeFile(files[index].getPath());
} catch (Exception e) {
Log.d(TAG, "Exception in bitmap output", e);
}
return ret;
} else {
return null;
}
}
public boolean isSaved(int index) {
return files[index] != null;
}
}
| [
"maxrider@mail.ru"
] | maxrider@mail.ru |
e97cd11a793bafc7173290e90ab567511422e8bc | ec9dc9acc2168b128b157c8f3e28f791437a2f0b | /app/src/main/java/com/apps/saijestudio/bucketbudget/adapters/ResultTabsPagerAdapter.java | 3d0548bfbdad14ad2d67cf078d9398d459479b07 | [] | no_license | Sifdon/BudgetBucket | 62b138d7bb7ce01d888c9841d36fb8845e5eca3f | 1afc8a289e7f59522be6ea8117a1d5cc4251addb | refs/heads/master | 2021-01-21T08:29:40.882870 | 2017-01-28T12:02:38 | 2017-01-28T12:02:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,900 | java | package com.apps.saijestudio.bucketbudget.adapters;
import android.app.Fragment;
import android.app.FragmentManager;
import android.content.Context;
import android.os.Bundle;
import android.support.v13.app.FragmentPagerAdapter;
import com.apps.saijestudio.bucketbudget.fragments.ResultFragment;
//ResultTabsPagerAdapter sets the tabs pager that displays each category of results and makes it swipe-able
public class ResultTabsPagerAdapter extends FragmentPagerAdapter{
Context mContext;
//constructor
public ResultTabsPagerAdapter(FragmentManager fm, Context context) {
super(fm);
mContext = context;
}
@Override
public Fragment getItem(int position) {
//create ResultFragment instance regardless of position
Fragment fragment = ResultFragment.newInstance();
// Attach some data to the fragment
// that we'll use to populate our fragment layouts
Bundle args = new Bundle();
args.putInt("FRAG_ARGS_POSTION", position + 1);
fragment.setArguments(args);
return fragment;
}
@Override
public int getCount() {
//return number of pages/tabs
return 4;
}
//get page title i.e, result category based on given position
@Override
public CharSequence getPageTitle(int position) {
CharSequence pageTitle;
switch (position) {
case 0:
pageTitle = "PAGER_RECIPES";
break;
case 1:
pageTitle = "PAGER_GROCERY";
break;
case 2:
pageTitle = "PAGER_RESTAURANTS";
break;
case 3:
pageTitle = "PAGER_VIDEOS";
break;
default:
pageTitle = ("FRAG_ARGS_POSTION" + (position + 1));
break;
}
return pageTitle;
}
}
| [
"saijalsuri@live.com"
] | saijalsuri@live.com |
bc0763c1a534bb1a205d731a35ba3bbea1afc191 | 38c0e1d2d4f9bee2c53f46a08aecaef01661d99e | /src/main/java/com/example/main/filters/JWTRequestFilter.java | 656cea7640f8d9f413a47e620ab2168705b1b15a | [] | no_license | Rawat-Rahul-24/spring-security | a2c911ead4dd60e3785fba50f821467f3e9e1264 | cd52a909a352487f26da0a2f8592446ef252dc88 | refs/heads/master | 2023-04-05T10:21:33.088312 | 2021-03-26T16:37:36 | 2021-03-26T16:37:36 | 351,009,691 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,017 | java | package com.example.main.filters;
import java.io.IOException;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
import org.springframework.stereotype.Component;
import org.springframework.web.filter.OncePerRequestFilter;
import com.example.main.services.CustomUserDetailsService;
import com.example.main.util.JWTUtil;
@Component
public class JWTRequestFilter extends OncePerRequestFilter{
@Autowired
private CustomUserDetailsService userDetailsService;
@Autowired
private JWTUtil jwtUtil;
@Override
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
throws ServletException, IOException {
final String authorizationHeader = request.getHeader("Authorization");
String username=null;
String jwt=null;
if(authorizationHeader != null && authorizationHeader.startsWith("Bearer ")) {
jwt = authorizationHeader.substring(7);
username = jwtUtil.extractUsername(jwt);
}
if(username != null && SecurityContextHolder.getContext().getAuthentication() == null) {
UserDetails userDetails = userDetailsService.loadUserByUsername(username);
if(jwtUtil.validateToken(jwt, userDetails)) {
UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(userDetails, null, userDetails.getAuthorities());
token.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));
SecurityContextHolder.getContext().setAuthentication(token);
}
}
filterChain.doFilter(request, response);
}
}
| [
"rawatr0799@gmail.com"
] | rawatr0799@gmail.com |
d7bfe272b9dcb6058c894befdfd0848dd54643c1 | 11ac695f59f70ce39ef1bf2730fb6f71c116359e | /app/src/main/java/com/monordevelopers/tt/terratour/nearbypojo/Northeast.java | 7e3bcad6e735d2d185ebee08745dde73c2c731ef | [] | no_license | izajul/TerraTour | 4db53f658acd49e6532b5d941b5f5296934033e8 | aa8249f6a82048503a1d51eed12da5fb833d3fc9 | refs/heads/master | 2021-01-22T21:44:58.525722 | 2017-05-19T10:18:43 | 2017-05-19T10:18:43 | 85,467,117 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 553 | java |
package com.monordevelopers.tt.terratour.nearbypojo;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class Northeast {
@SerializedName("lat")
@Expose
private Double lat;
@SerializedName("lng")
@Expose
private Double lng;
public Double getLat() {
return lat;
}
public void setLat(Double lat) {
this.lat = lat;
}
public Double getLng() {
return lng;
}
public void setLng(Double lng) {
this.lng = lng;
}
}
| [
"md.izajul@gmail.com"
] | md.izajul@gmail.com |
4aff97e9fa9ed020e67217ca1a077be6e7fee437 | 1154ecd99fabd3c98652090a456c56d09c88ad72 | /Contacts/Problems/Book/src/Main.java | eb32b2e4a024af232890b7078a0f47a5e6bdc6fa | [] | no_license | oysbak/Sorting-Tool | ecd75f24a5dabf13499fa46f6ecb7407059196db | 9b3547aed7cbf74d1c743fd03e295bf28b209fb9 | refs/heads/master | 2023-04-11T20:01:39.264348 | 2021-05-02T17:04:35 | 2021-05-02T17:04:35 | 363,705,438 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 607 | java | class Book {
private String title;
private int yearOfPublishing;
private String[] authors;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public int getYearOfPublishing() {
return yearOfPublishing;
}
public void setYearOfPublishing(int yearOfPublishing) {
this.yearOfPublishing = yearOfPublishing;
}
public String[] getAuthors() {
return authors.clone();
}
public void setAuthors(String[] authors) {
this.authors = authors.clone();
}
}
| [
"oystein.bakken@nav.no"
] | oystein.bakken@nav.no |
24da95bc806eb280c9c23abf3067e78193a4c9a2 | 36d50f3e0878bfd16eb0ed2b10d671158b22a2e7 | /KnowledgeOnline/app/src/main/java/heqi/online/com/main/im/business/Constant.java | b99f05e74251281f4b3959a6761a20b859d6a1be | [] | no_license | BaiYegithub/KnowledgeOnline | fdd925e267a1454b4ec99a7daf4b464d157db880 | 5215995548e63d52463e29b84095067d4b4f837d | refs/heads/master | 2020-05-05T06:23:15.558578 | 2019-06-04T17:10:29 | 2019-06-04T17:11:19 | 179,786,470 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 222 | java | package heqi.online.com.main.im.business;
/**
* 常量
*/
public class Constant {
public static final int ACCOUNT_TYPE = 26209;
//sdk appid 由腾讯分配
public static final int SDK_APPID = 1400088810;
}
| [
"m15810206306@163.com"
] | m15810206306@163.com |
a85761e53ead0303a78d60eb522e500a9164824a | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/21/21_f9b8fc2a93e51bd2807bf0ec8d8a66d510e73c10/Verifier/21_f9b8fc2a93e51bd2807bf0ec8d8a66d510e73c10_Verifier_t.java | 76ab2977d7b70ee922ad4847ef67735732bd5240 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 41,614 | java | package aQute.bnd.osgi;
import java.io.*;
import java.util.*;
import java.util.Map.Entry;
import java.util.jar.*;
import java.util.regex.*;
import aQute.bnd.header.*;
import aQute.bnd.osgi.Descriptors.PackageRef;
import aQute.bnd.osgi.Descriptors.TypeRef;
import aQute.bnd.version.*;
import aQute.lib.base64.*;
import aQute.lib.filter.*;
import aQute.lib.io.*;
import aQute.libg.cryptography.*;
import aQute.libg.qtokens.*;
//
// TODO check that component XML that refer to a properties file actually have such a file
//
public class Verifier extends Processor {
private final Jar dot;
private final Manifest manifest;
private final Domain main;
private boolean r3;
private boolean usesRequire;
final static Pattern EENAME = Pattern.compile("CDC-1\\.0/Foundation-1\\.0" + "|CDC-1\\.1/Foundation-1\\.1"
+ "|OSGi/Minimum-1\\.[1-9]" + "|JRE-1\\.1" + "|J2SE-1\\.2" + "|J2SE-1\\.3"
+ "|J2SE-1\\.4" + "|J2SE-1\\.5" + "|JavaSE-1\\.6" + "|JavaSE-1\\.7"
+ "|JavaSE-1\\.8" + "|PersonalJava-1\\.1" + "|PersonalJava-1\\.2"
+ "|CDC-1\\.0/PersonalBasis-1\\.0" + "|CDC-1\\.0/PersonalJava-1\\.0");
final static int V1_1 = 45;
final static int V1_2 = 46;
final static int V1_3 = 47;
final static int V1_4 = 48;
final static int V1_5 = 49;
final static int V1_6 = 50;
final static int V1_7 = 51;
final static int V1_8 = 52;
static class EE {
String name;
int target;
EE(String name, @SuppressWarnings("unused")
int source, int target) {
this.name = name;
this.target = target;
}
@Override
public String toString() {
return name + "(" + target + ")";
}
}
final static EE[] ees = {
new EE("CDC-1.0/Foundation-1.0", V1_3, V1_1),
new EE("CDC-1.1/Foundation-1.1", V1_3, V1_2),
new EE("OSGi/Minimum-1.0", V1_3, V1_1),
new EE("OSGi/Minimum-1.1", V1_3, V1_2),
new EE("JRE-1.1", V1_1, V1_1), //
new EE("J2SE-1.2", V1_2, V1_1), //
new EE("J2SE-1.3", V1_3, V1_1), //
new EE("J2SE-1.4", V1_3, V1_2), //
new EE("J2SE-1.5", V1_5, V1_5), //
new EE("JavaSE-1.6", V1_6, V1_6), //
new EE("PersonalJava-1.1", V1_1, V1_1), //
new EE("JavaSE-1.7", V1_7, V1_7), //
new EE("JavaSE-1.8", V1_8, V1_8), //
new EE("PersonalJava-1.1", V1_1, V1_1), //
new EE("PersonalJava-1.2", V1_1, V1_1), new EE("CDC-1.0/PersonalBasis-1.0", V1_3, V1_1),
new EE("CDC-1.0/PersonalJava-1.0", V1_3, V1_1), new EE("CDC-1.1/PersonalBasis-1.1", V1_3, V1_2),
new EE("CDC-1.1/PersonalJava-1.1", V1_3, V1_2)
};
public final static Pattern ReservedFileNames = Pattern
.compile(
"CON(\\..+)?|PRN(\\..+)?|AUX(\\..+)?|CLOCK$|NUL(\\..+)?|COM[1-9](\\..+)?|LPT[1-9](\\..+)?|"
+ "\\$Mft|\\$MftMirr|\\$LogFile|\\$Volume|\\$AttrDef|\\$Bitmap|\\$Boot|\\$BadClus|\\$Secure|"
+ "\\$Upcase|\\$Extend|\\$Quota|\\$ObjId|\\$Reparse",
Pattern.CASE_INSENSITIVE);
final static Pattern CARDINALITY_PATTERN = Pattern.compile("single|multiple");
final static Pattern RESOLUTION_PATTERN = Pattern.compile("optional|mandatory");
final static Pattern BUNDLEMANIFESTVERSION = Pattern.compile("2");
public final static String SYMBOLICNAME_STRING = "[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)*";
public final static Pattern SYMBOLICNAME = Pattern.compile(SYMBOLICNAME_STRING);
public final static String VERSION_STRING = "[0-9]{1,9}(\\.[0-9]{1,9}(\\.[0-9]{1,9}(\\.[0-9A-Za-z_-]+)?)?)?";
public final static Pattern VERSION = Pattern.compile(VERSION_STRING);
final static Pattern FILTEROP = Pattern.compile("=|<=|>=|~=");
public final static Pattern VERSIONRANGE = Pattern.compile("((\\(|\\[)"
+ VERSION_STRING + "," + VERSION_STRING + "(\\]|\\)))|"
+ VERSION_STRING);
final static Pattern FILE = Pattern
.compile("/?[^/\"\n\r\u0000]+(/[^/\"\n\r\u0000]+)*");
final static Pattern WILDCARDPACKAGE = Pattern
.compile("((\\p{Alnum}|_)+(\\.(\\p{Alnum}|_)+)*(\\.\\*)?)|\\*");
public final static Pattern ISO639 = Pattern.compile("[A-Z][A-Z]");
public final static Pattern HEADER_PATTERN = Pattern.compile("[A-Za-z0-9][-a-zA-Z0-9_]+");
public final static Pattern TOKEN = Pattern.compile("[-a-zA-Z0-9_]+");
public final static Pattern NUMBERPATTERN = Pattern.compile("\\d+");
public final static Pattern PACKAGEPATTERN = Pattern
.compile("\\p{javaJavaIdentifierStart}\\p{javaJavaIdentifierPart}*(\\.\\p{javaJavaIdentifierStart}\\p{javaJavaIdentifierPart}*)*");
public final static Pattern PATHPATTERN = Pattern.compile(".*");
public final static Pattern FQNPATTERN = Pattern.compile(".*");
public final static Pattern URLPATTERN = Pattern.compile(".*");
public final static Pattern ANYPATTERN = Pattern.compile(".*");
public final static Pattern FILTERPATTERN = Pattern.compile(".*");
public final static Pattern TRUEORFALSEPATTERN = Pattern.compile("true|false|TRUE|FALSE");
public static final Pattern WILDCARDNAMEPATTERN = Pattern.compile(".*");
public static final Pattern BUNDLE_ACTIVATIONPOLICYPATTERN = Pattern.compile("lazy");
public final static String VERSION_S = "[0-9]{1,9}(:?\\.[0-9]{1,9}(:?\\.[0-9]{1,9}(:?\\.[0-9A-Za-z_-]+)?)?)?";
public final static Pattern VERSION_P = Pattern.compile(VERSION_S);
public final static String VERSION_RANGE_S = "(?:(:?\\(|\\[)" + VERSION_S + "," + VERSION_S
+ "(\\]|\\)))|" + VERSION_S;
public final static Pattern VERSIONRANGE_P = VERSIONRANGE;
public static String EXTENDED_S = "[-a-zA-Z0-9_.]+";
public static Pattern EXTENDED_P = Pattern.compile(EXTENDED_S);
public static String QUOTEDSTRING = "\"[^\"]*\"";
public static Pattern QUOTEDSTRING_P = Pattern.compile(QUOTEDSTRING);
public static String ARGUMENT_S = "(:?" + EXTENDED_S + ")|(?:" + QUOTEDSTRING + ")";
public static Pattern ARGUMENT_P = Pattern.compile(ARGUMENT_S);
public final static String EES[] = {
"CDC-1.0/Foundation-1.0", "CDC-1.1/Foundation-1.1", "OSGi/Minimum-1.0", "OSGi/Minimum-1.1",
"OSGi/Minimum-1.2", "JRE-1.1", "J2SE-1.2", "J2SE-1.3", "J2SE-1.4", "J2SE-1.5", "JavaSE-1.6", "JavaSE-1.7",
"PersonalJava-1.1", "PersonalJava-1.2", "CDC-1.0/PersonalBasis-1.0", "CDC-1.0/PersonalJava-1.0"
};
public final static String OSNAMES[] = {
"AIX", // IBM
"DigitalUnix", // Compaq
"Embos", // Segger Embedded Software Solutions
"Epoc32", // SymbianOS Symbian OS
"FreeBSD", // Free BSD
"HPUX", // hp-ux Hewlett Packard
"IRIX", // Silicon Graphics
"Linux", // Open source
"MacOS", // Apple
"NetBSD", // Open source
"Netware", // Novell
"OpenBSD", // Open source
"OS2", // OS/2 IBM
"QNX", // procnto QNX
"Solaris", // Sun (almost an alias of SunOS)
"SunOS", // Sun Microsystems
"VxWorks", // WindRiver Systems
"Windows95", "Win32", "Windows98", "WindowsNT", "WindowsCE", "Windows2000", // Win2000
"Windows2003", // Win2003
"WindowsXP", "WindowsVista",
};
public final static String PROCESSORNAMES[] = { //
//
"68k", // Motorola 68000
"ARM_LE", // Intel Strong ARM. Deprecated because it does not
// specify the endianness. See the following two rows.
"arm_le", // Intel Strong ARM Little Endian mode
"arm_be", // Intel String ARM Big Endian mode
"Alpha", //
"ia64n",// Hewlett Packard 32 bit
"ia64w",// Hewlett Packard 64 bit mode
"Ignite", // psc1k PTSC
"Mips", // SGI
"PArisc", // Hewlett Packard
"PowerPC", // power ppc Motorola/IBM Power PC
"Sh4", // Hitachi
"Sparc", // SUN
"Sparcv9", // SUN
"S390", // IBM Mainframe 31 bit
"S390x", // IBM Mainframe 64-bit
"V850E", // NEC V850E
"x86", // pentium i386
"i486", // i586 i686 Intel& AMD 32 bit
"x86-64",
};
final Analyzer analyzer;
private Instructions dynamicImports;
private boolean frombuilder;
public Verifier(Jar jar) throws Exception {
this.analyzer = new Analyzer(this);
this.analyzer.use(this);
addClose(analyzer);
this.analyzer.setJar(jar);
this.manifest = this.analyzer.calcManifest();
this.main = Domain.domain(manifest);
this.dot = jar;
getInfo(analyzer);
}
public Verifier(Analyzer analyzer) throws Exception {
super(analyzer);
this.analyzer = analyzer;
this.dot = analyzer.getJar();
this.manifest = dot.getManifest();
this.main = Domain.domain(manifest);
}
private void verifyHeaders() {
for (String h : main) {
if (!HEADER_PATTERN.matcher(h).matches())
error("Invalid Manifest header: " + h + ", pattern=" + HEADER_PATTERN);
}
}
/*
* Bundle-NativeCode ::= nativecode ( ',' nativecode )* ( ’,’ optional) ?
* nativecode ::= path ( ';' path )* // See 1.4.2 ( ';' parameter )+
* optional ::= ’*’
*/
public void verifyNative() {
String nc = get("Bundle-NativeCode");
doNative(nc);
}
public void doNative(String nc) {
if (nc != null) {
QuotedTokenizer qt = new QuotedTokenizer(nc, ",;=", false);
char del;
do {
do {
String name = qt.nextToken();
if (name == null) {
error("Can not parse name from bundle native code header: " + nc);
return;
}
del = qt.getSeparator();
if (del == ';') {
if (dot != null && !dot.exists(name)) {
error("Native library not found in JAR: " + name);
}
} else {
String value = null;
if (del == '=')
value = qt.nextToken();
String key = name.toLowerCase();
if (key.equals("osname")) {
// ...
} else if (key.equals("osversion")) {
// verify version range
verify(value, VERSIONRANGE);
} else if (key.equals("language")) {
verify(value, ISO639);
} else if (key.equals("processor")) {
// verify(value, PROCESSORS);
} else if (key.equals("selection-filter")) {
// verify syntax filter
verifyFilter(value);
} else if (name.equals("*") && value == null) {
// Wildcard must be at end.
if (qt.nextToken() != null)
error("Bundle-Native code header may only END in wildcard: nc");
} else {
warning("Unknown attribute in native code: " + name + "=" + value);
}
del = qt.getSeparator();
}
} while (del == ';');
} while (del == ',');
}
}
public boolean verifyFilter(String value) {
String s = validateFilter(value);
if (s == null)
return true;
error(s);
return false;
}
public static String validateFilter(String value) {
try {
verifyFilter(value, 0);
return null;
}
catch (Exception e) {
return "Not a valid filter: " + value + e.getMessage();
}
}
private void verifyActivator() throws Exception {
String bactivator = main.get("Bundle-Activator");
if (bactivator != null) {
TypeRef ref = analyzer.getTypeRefFromFQN(bactivator);
if (analyzer.getClassspace().containsKey(ref))
return;
PackageRef packageRef = ref.getPackageRef();
if (packageRef.isDefaultPackage())
error("The Bundle Activator is not in the bundle and it is in the default package ");
else if (!analyzer.isImported(packageRef)) {
error("Bundle-Activator not found on the bundle class path nor in imports: " + bactivator);
}
}
}
private void verifyComponent() {
String serviceComponent = main.get("Service-Component");
if (serviceComponent != null) {
Parameters map = parseHeader(serviceComponent);
for (String component : map.keySet()) {
if (component.indexOf("*") < 0 && !dot.exists(component)) {
error("Service-Component entry can not be located in JAR: " + component);
} else {
// validate component ...
}
}
}
}
/**
* Check for unresolved imports. These are referrals that are not imported
* by the manifest and that are not part of our bundle class path. The are
* calculated by removing all the imported packages and contained from the
* referred packages.
* @throws Exception
*/
private void verifyUnresolvedReferences() throws Exception {
//
// If we're being called from the builder then this should
// already have been done
//
if (isFrombuilder())
return;
Manifest m = analyzer.getJar().getManifest();
if (m == null) {
error("No manifest");
}
Domain domain = Domain.domain(m);
Set<PackageRef> unresolvedReferences = new TreeSet<PackageRef>(analyzer.getReferred().keySet());
unresolvedReferences.removeAll(analyzer.getContained().keySet());
for ( String pname : domain.getImportPackage().keySet()) {
PackageRef pref = analyzer.getPackageRef(pname);
unresolvedReferences.remove(pref);
}
// Remove any java.** packages.
for (Iterator<PackageRef> p = unresolvedReferences.iterator(); p.hasNext();) {
PackageRef pack = p.next();
if (pack.isJava())
p.remove();
else {
// Remove any dynamic imports
if (isDynamicImport(pack))
p.remove();
}
}
//
// If there is a Require bundle, all bets are off and
// we cannot verify anything
//
if (domain.getRequireBundle().isEmpty() && domain.get("ExtensionBundle-Activator") == null
&& (domain.getFragmentHost()== null || domain.getFragmentHost().getKey().equals("system.bundle"))) {
if (!unresolvedReferences.isEmpty()) {
// Now we want to know the
// classes that are the culprits
Set<String> culprits = new HashSet<String>();
for (Clazz clazz : analyzer.getClassspace().values()) {
if (hasOverlap(unresolvedReferences, clazz.getReferred()))
culprits.add(clazz.getAbsolutePath());
}
if (analyzer instanceof Builder)
warning("Unresolved references to %s by class(es) %s on the Bundle-Classpath: %s",
unresolvedReferences, culprits, analyzer.getBundleClasspath().keySet());
else
error("Unresolved references to %s by class(es) %s on the Bundle-Classpath: %s",
unresolvedReferences, culprits, analyzer.getBundleClasspath().keySet());
return;
}
} else if (isPedantic())
warning("Use of Require-Bundle, ExtensionBundle-Activator, or a system bundle fragment makes it impossible to verify unresolved references");
}
/**
* @param p
* @param pack
*/
private boolean isDynamicImport(PackageRef pack) {
if (dynamicImports == null)
dynamicImports = new Instructions(main.getDynamicImportPackage());
if (dynamicImports.isEmpty())
return false;
return dynamicImports.matches(pack.getFQN());
}
private boolean hasOverlap(Set< ? > a, Set< ? > b) {
for (Iterator< ? > i = a.iterator(); i.hasNext();) {
if (b.contains(i.next()))
return true;
}
return false;
}
public void verify() throws Exception {
verifyHeaders();
verifyDirectives("Export-Package", "uses:|mandatory:|include:|exclude:|" + IMPORT_DIRECTIVE, PACKAGEPATTERN,
"package");
verifyDirectives("Import-Package", "resolution:", PACKAGEPATTERN, "package");
verifyDirectives("Require-Bundle", "visibility:|resolution:", SYMBOLICNAME, "bsn");
verifyDirectives("Fragment-Host", "extension:", SYMBOLICNAME, "bsn");
verifyDirectives("Provide-Capability", "effective:|uses:", null, null);
verifyDirectives("Require-Capability", "effective:|resolution:|filter:", null, null);
verifyDirectives("Bundle-SymbolicName", "singleton:|fragment-attachment:|mandatory:", SYMBOLICNAME, "bsn");
verifyManifestFirst();
verifyActivator();
verifyActivationPolicy();
verifyComponent();
verifyNative();
verifyImports();
verifyExports();
verifyUnresolvedReferences();
verifySymbolicName();
verifyListHeader("Bundle-RequiredExecutionEnvironment", EENAME, false);
verifyHeader("Bundle-ManifestVersion", BUNDLEMANIFESTVERSION, false);
verifyHeader("Bundle-Version", VERSION, true);
verifyListHeader("Bundle-Classpath", FILE, false);
verifyDynamicImportPackage();
verifyBundleClasspath();
verifyUses();
if (usesRequire) {
if (!getErrors().isEmpty()) {
getWarnings()
.add(0,
"Bundle uses Require Bundle, this can generate false errors because then not enough information is available without the required bundles");
}
}
verifyRequirements();
verifyCapabilities();
verifyMetaPersistence();
verifyPathNames();
}
/**
* Verify of the path names in the JAR are valid on all OS's (mainly
* windows)
*/
void verifyPathNames() {
if (!since(About._2_3))
return;
Set<String> invalidPaths = new HashSet<String>();
Pattern pattern = ReservedFileNames;
setProperty("@", ReservedFileNames.pattern());
String p = getProperty(INVALIDFILENAMES);
unsetProperty("@");
if (p != null) {
try {
pattern = Pattern.compile(p, Pattern.CASE_INSENSITIVE);
}
catch (Exception e) {
SetLocation error = error("%s is not a valid regular expression %s: %s", INVALIDFILENAMES,
e.getMessage(), p);
error.context(p).header(INVALIDFILENAMES);
return;
}
}
Set<String> segments = new HashSet<String>();
for (String path : dot.getResources().keySet()) {
String parts[] = path.split("/");
for (String part : parts) {
if (segments.add(part) && pattern.matcher(part).matches()) {
invalidPaths.add(path);
}
}
}
if (invalidPaths.isEmpty())
return;
error("Invalid file/directory names for Windows in JAR: %s. You can set the regular expression used with %s, the default expression is %s",
invalidPaths, INVALIDFILENAMES, ReservedFileNames.pattern());
}
/**
* Verify that the imports properly use version ranges.
*/
private void verifyImports() {
if (isStrict()) {
Parameters map = parseHeader(manifest.getMainAttributes().getValue(Constants.IMPORT_PACKAGE));
Set<String> noimports = new HashSet<String>();
Set<String> toobroadimports = new HashSet<String>();
for (Entry<String,Attrs> e : map.entrySet()) {
String version = e.getValue().get(Constants.VERSION_ATTRIBUTE);
if (version == null) {
if (!e.getKey().startsWith("javax.")) {
noimports.add(e.getKey());
}
} else {
if (!VERSIONRANGE.matcher(version).matches()) {
Location location = error("Import Package %s has an invalid version range syntax %s",
e.getKey(), version).location();
location.header = Constants.IMPORT_PACKAGE;
location.context = e.getKey();
} else {
try {
VersionRange range = new VersionRange(version);
if (!range.isRange()) {
toobroadimports.add(e.getKey());
}
if (range.includeHigh() == false && range.includeLow() == false
&& range.getLow().equals(range.getHigh())) {
Location location = error(
"Import Package %s has an empty version range syntax %s, likely want to use [%s,%s]",
e.getKey(), version, range.getLow(), range.getHigh()).location();
location.header = Constants.IMPORT_PACKAGE;
location.context = e.getKey();
}
// TODO check for exclude low, include high?
}
catch (Exception ee) {
Location location = error("Import Package %s has an invalid version range syntax %s:%s",
e.getKey(), version, ee.getMessage()).location();
location.header = Constants.IMPORT_PACKAGE;
location.context = e.getKey();
}
}
}
}
if (!noimports.isEmpty()) {
Location location = error("Import Package clauses without version range (excluding javax.*): %s",
noimports).location();
location.header = Constants.IMPORT_PACKAGE;
}
if (!toobroadimports.isEmpty()) {
Location location = error(
"Import Package clauses which use a version instead of a version range. This imports EVERY later package and not as many expect until the next major number: %s",
toobroadimports).location();
location.header = Constants.IMPORT_PACKAGE;
}
}
}
/**
* Verify that the exports only use versions.
*/
private void verifyExports() {
if (isStrict()) {
Parameters map = parseHeader(manifest.getMainAttributes().getValue(Constants.EXPORT_PACKAGE));
Set<String> noexports = new HashSet<String>();
for (Entry<String,Attrs> e : map.entrySet()) {
String version = e.getValue().get(Constants.VERSION_ATTRIBUTE);
if (version == null) {
noexports.add(e.getKey());
} else {
if (!VERSION.matcher(version).matches()) {
Location location;
if (VERSIONRANGE.matcher(version).matches()) {
location = error(
"Export Package %s version is a range: %s; Exports do not allow for ranges.",
e.getKey(), version).location();
} else {
location = error("Export Package %s version has invalid syntax: %s", e.getKey(), version)
.location();
}
location.header = Constants.EXPORT_PACKAGE;
location.context = e.getKey();
}
}
if (e.getValue().containsKey(Constants.SPECIFICATION_VERSION)) {
Location location = error(
"Export Package %s uses deprecated specification-version instead of version", e.getKey())
.location();
location.header = Constants.EXPORT_PACKAGE;
location.context = e.getKey();
}
String mandatory = e.getValue().get(Constants.MANDATORY_DIRECTIVE);
if (mandatory != null) {
Set<String> missing = new HashSet<String>(split(mandatory));
missing.removeAll(e.getValue().keySet());
if (!missing.isEmpty()) {
Location location = error("Export Package %s misses mandatory attribute: %s", e.getKey(),
missing).location();
location.header = Constants.EXPORT_PACKAGE;
location.context = e.getKey();
}
}
}
if (!noexports.isEmpty()) {
Location location = error("Export Package clauses without version range: %s", noexports).location();
location.header = Constants.EXPORT_PACKAGE;
}
}
}
private void verifyRequirements() {
Parameters map = parseHeader(manifest.getMainAttributes().getValue(Constants.REQUIRE_CAPABILITY));
for (String key : map.keySet()) {
Attrs attrs = map.get(key);
verify(attrs, "filter:", FILTERPATTERN, false, "Requirement %s filter not correct", key);
String filter = attrs.get("filter:");
if (filter != null) {
String verify = new Filter(filter).verify();
if (verify != null)
error("Invalid filter syntax in requirement %s=%s. Reason %s", key, attrs, verify);
}
verify(attrs, "cardinality:", CARDINALITY_PATTERN, false, "Requirement %s cardinality not correct", key);
verify(attrs, "resolution:", RESOLUTION_PATTERN, false, "Requirement %s resolution not correct", key);
if (key.equals("osgi.extender")) {
// No requirements on extender
} else if (key.equals("osgi.serviceloader")) {
verify(attrs, "register:", PACKAGEPATTERN, false,
"Service Loader extender register: directive not a fully qualified Java name");
} else if (key.equals("osgi.contract")) {
} else if (key.equals("osgi.service")) {
} else if (key.equals("osgi.ee")) {
} else if (key.startsWith("osgi.wiring.") || key.startsWith("osgi.identity")) {
error("osgi.wiring.* namespaces must not be specified with generic requirements/capabilities");
}
verifyAttrs(attrs);
if (attrs.containsKey("mandatory:"))
error("mandatory: directive is intended for Capabilities, not Requirement %s", key);
if (attrs.containsKey("uses:"))
error("uses: directive is intended for Capabilities, not Requirement %s", key);
}
}
/**
* @param attrs
*/
void verifyAttrs(Attrs attrs) {
for (String a : attrs.keySet()) {
String v = attrs.get(a);
if (!a.endsWith(":")) {
Attrs.Type t = attrs.getType(a);
if ("version".equals(a)) {
if (t != Attrs.Type.VERSION)
error("Version attributes should always be of type version, it is %s", t);
} else
verifyType(t, v);
}
}
}
private void verifyCapabilities() {
Parameters map = parseHeader(manifest.getMainAttributes().getValue(Constants.PROVIDE_CAPABILITY));
for (String key : map.keySet()) {
Attrs attrs = map.get(key);
verify(attrs, "cardinality:", CARDINALITY_PATTERN, false, "Requirement %s cardinality not correct", key);
verify(attrs, "resolution:", RESOLUTION_PATTERN, false, "Requirement %s resolution not correct", key);
if (key.equals("osgi.extender")) {
verify(attrs, "osgi.extender", SYMBOLICNAME, true,
"Extender %s must always have the osgi.extender attribute set", key);
verify(attrs, "version", VERSION, true, "Extender %s must always have a version", key);
} else if (key.equals("osgi.serviceloader")) {
verify(attrs, "register:", PACKAGEPATTERN, false,
"Service Loader extender register: directive not a fully qualified Java name");
} else if (key.equals("osgi.contract")) {
verify(attrs, "osgi.contract", SYMBOLICNAME, true,
"Contracts %s must always have the osgi.contract attribute set", key);
} else if (key.equals("osgi.service")) {
verify(attrs, "objectClass", PACKAGEPATTERN, true,
"osgi.service %s must have the objectClass attribute set", key);
} else if (key.equals("osgi.ee")) {
// TODO
} else if (key.startsWith("osgi.wiring.") || key.startsWith("osgi.identity")) {
error("osgi.wiring.* namespaces must not be specified with generic requirements/capabilities");
}
verifyAttrs(attrs);
if (attrs.containsKey("filter:"))
error("filter: directive is intended for Requirements, not Capability %s", key);
if (attrs.containsKey("cardinality:"))
error("cardinality: directive is intended for Requirements, not Capability %s", key);
if (attrs.containsKey("resolution:"))
error("resolution: directive is intended for Requirements, not Capability %s", key);
}
}
private void verify(Attrs attrs, String ad, Pattern pattern, boolean mandatory, String msg, String... args) {
String v = attrs.get(ad);
if (v == null) {
if (mandatory)
error("Missing required attribute/directive %s", ad);
} else {
Matcher m = pattern.matcher(v);
if (!m.matches())
error(msg, (Object[]) args);
}
}
private void verifyType(@SuppressWarnings("unused")
Attrs.Type type, @SuppressWarnings("unused")
String string) {
}
/**
* Verify if the header does not contain any other directives
*
* @param header
* @param directives
*/
private void verifyDirectives(String header, String directives, Pattern namePattern, String type) {
Pattern pattern = Pattern.compile(directives);
Parameters map = parseHeader(manifest.getMainAttributes().getValue(header));
for (Entry<String,Attrs> entry : map.entrySet()) {
String pname = removeDuplicateMarker(entry.getKey());
if (namePattern != null) {
if (!namePattern.matcher(pname).matches())
if (isPedantic())
error("Invalid %s name: '%s'", type, pname);
else
warning("Invalid %s name: '%s'", type, pname);
}
for (String key : entry.getValue().keySet()) {
if (key.endsWith(":")) {
if (!key.startsWith("x-")) {
Matcher m = pattern.matcher(key);
if (m.matches())
continue;
warning("Unknown directive %s in %s, allowed directives are %s, and 'x-*'.", key, header,
directives.replace('|', ','));
}
}
}
}
}
/**
* Verify the use clauses
*/
private void verifyUses() {
// Set<String> uses = Create.set();
// for ( Map<String,String> attrs : analyzer.getExports().values()) {
// if ( attrs.containsKey(Constants.USES_DIRECTIVE)) {
// String s = attrs.get(Constants.USES_DIRECTIVE);
// uses.addAll( split(s));
// }
// }
// uses.removeAll(analyzer.getExports().keySet());
// uses.removeAll(analyzer.getImports().keySet());
// if ( !uses.isEmpty())
// warning("Export-Package uses: directive contains packages that are not imported nor exported: %s",
// uses);
}
public boolean verifyActivationPolicy() {
String policy = main.get(Constants.BUNDLE_ACTIVATIONPOLICY);
if (policy == null)
return true;
return verifyActivationPolicy(policy);
}
public boolean verifyActivationPolicy(String policy) {
Parameters map = parseHeader(policy);
if (map.size() == 0)
warning("Bundle-ActivationPolicy is set but has no argument %s", policy);
else if (map.size() > 1)
warning("Bundle-ActivationPolicy has too many arguments %s", policy);
else {
Map<String,String> s = map.get("lazy");
if (s == null)
warning("Bundle-ActivationPolicy set but is not set to lazy: %s", policy);
else
return true;
}
return false;
}
public void verifyBundleClasspath() {
Parameters bcp = main.getBundleClassPath();
if (bcp.isEmpty() || bcp.containsKey("."))
return;
for (String path : bcp.keySet()) {
if (path.endsWith("/"))
error("A Bundle-ClassPath entry must not end with '/': %s", path);
if (dot.getDirectories().containsKey(path))
// We assume that any classes are in a directory
// and therefore do not care when the bundle is included
return;
}
for (String path : dot.getResources().keySet()) {
if (path.endsWith(".class")) {
warning("The Bundle-Classpath does not contain the actual bundle JAR (as specified with '.' in the Bundle-Classpath) but the JAR does contain classes. Is this intentional?");
return;
}
}
}
/**
* <pre>
* DynamicImport-Package ::= dynamic-description
* ( ',' dynamic-description )*
*
* dynamic-description::= wildcard-names ( ';' parameter )*
* wildcard-names ::= wildcard-name ( ';' wildcard-name )*
* wildcard-name ::= package-name
* | ( package-name '.*' ) // See 1.4.2
* | '*'
* </pre>
*/
private void verifyDynamicImportPackage() {
verifyListHeader("DynamicImport-Package", WILDCARDPACKAGE, true);
String dynamicImportPackage = get("DynamicImport-Package");
if (dynamicImportPackage == null)
return;
Parameters map = main.getDynamicImportPackage();
for (String name : map.keySet()) {
name = name.trim();
if (!verify(name, WILDCARDPACKAGE))
error("DynamicImport-Package header contains an invalid package name: " + name);
Map<String,String> sub = map.get(name);
if (r3 && sub.size() != 0) {
error("DynamicPackage-Import has attributes on import: " + name
+ ". This is however, an <=R3 bundle and attributes on this header were introduced in R4. ");
}
}
}
private void verifyManifestFirst() {
if (!dot.isManifestFirst()) {
error("Invalid JAR stream: Manifest should come first to be compatible with JarInputStream, it was not");
}
}
private void verifySymbolicName() {
Parameters bsn = parseHeader(main.get(Analyzer.BUNDLE_SYMBOLICNAME));
if (!bsn.isEmpty()) {
if (bsn.size() > 1)
error("More than one BSN specified " + bsn);
String name = bsn.keySet().iterator().next();
if (!isBsn(name)) {
error("Symbolic Name has invalid format: " + name);
}
}
}
/**
* @param name
* @return
*/
public static boolean isBsn(String name) {
return SYMBOLICNAME.matcher(name).matches();
}
/**
* <pre>
* filter ::= ’(’ filter-comp ’)’
* filter-comp ::= and | or | not | operation
* and ::= ’&’ filter-list
* or ::= ’|’ filter-list
* not ::= ’!’ filter
* filter-list ::= filter | filter filter-list
* operation ::= simple | present | substring
* simple ::= attr filter-type value
* filter-type ::= equal | approx | greater | less
* equal ::= ’=’
* approx ::= ’˜=’
* greater ::= ’>=’
* less ::= ’<=’
* present ::= attr ’=*’
* substring ::= attr ’=’ initial any final
* inital ::= () | value
* any ::= ’*’ star-value
* star-value ::= () | value ’*’ star-value
* final ::= () | value
* value ::= <see text>
* </pre>
*
* @param expr
* @param index
* @return
*/
public static int verifyFilter(String expr, int index) {
try {
while (Character.isWhitespace(expr.charAt(index)))
index++;
if (expr.charAt(index) != '(')
throw new IllegalArgumentException("Filter mismatch: expected ( at position " + index + " : " + expr);
index++; // skip (
while (Character.isWhitespace(expr.charAt(index)))
index++;
switch (expr.charAt(index)) {
case '!' :
index++; // skip !
while (Character.isWhitespace(expr.charAt(index)))
index++;
if (expr.charAt(index) != '(')
throw new IllegalArgumentException("Filter mismatch: ! (not) must have one sub expression "
+ index + " : " + expr);
while (Character.isWhitespace(expr.charAt(index)))
index++;
index = verifyFilter(expr, index);
while (Character.isWhitespace(expr.charAt(index)))
index++;
if (expr.charAt(index) != ')')
throw new IllegalArgumentException("Filter mismatch: expected ) at position " + index + " : "
+ expr);
return index + 1;
case '&' :
case '|' :
index++; // skip operator
while (Character.isWhitespace(expr.charAt(index)))
index++;
while (expr.charAt(index) == '(') {
index = verifyFilter(expr, index);
while (Character.isWhitespace(expr.charAt(index)))
index++;
}
if (expr.charAt(index) != ')')
throw new IllegalArgumentException("Filter mismatch: expected ) at position " + index + " : "
+ expr);
return index + 1; // skip )
default :
index = verifyFilterOperation(expr, index);
if (expr.charAt(index) != ')')
throw new IllegalArgumentException("Filter mismatch: expected ) at position " + index + " : "
+ expr);
return index + 1;
}
}
catch (IndexOutOfBoundsException e) {
throw new IllegalArgumentException("Filter mismatch: early EOF from " + index);
}
}
static private int verifyFilterOperation(String expr, int index) {
StringBuilder sb = new StringBuilder();
while ("=><~()".indexOf(expr.charAt(index)) < 0) {
sb.append(expr.charAt(index++));
}
String attr = sb.toString().trim();
if (attr.length() == 0)
throw new IllegalArgumentException("Filter mismatch: attr at index " + index + " is 0");
sb = new StringBuilder();
while ("=><~".indexOf(expr.charAt(index)) >= 0) {
sb.append(expr.charAt(index++));
}
String operator = sb.toString();
if (!verify(operator, FILTEROP))
throw new IllegalArgumentException("Filter error, illegal operator " + operator + " at index " + index);
sb = new StringBuilder();
while (")".indexOf(expr.charAt(index)) < 0) {
switch (expr.charAt(index)) {
case '\\' :
if ("\\)(*".indexOf(expr.charAt(index + 1)) >= 0)
index++;
else
throw new IllegalArgumentException("Filter error, illegal use of backslash at index " + index
+ ". Backslash may only be used before * or () or \\");
}
sb.append(expr.charAt(index++));
}
return index;
}
private boolean verifyHeader(String name, Pattern regex, boolean error) {
String value = manifest.getMainAttributes().getValue(name);
if (value == null)
return false;
QuotedTokenizer st = new QuotedTokenizer(value.trim(), ",");
for (Iterator<String> i = st.getTokenSet().iterator(); i.hasNext();) {
if (!verify(i.next(), regex)) {
String msg = "Invalid value for " + name + ", " + value + " does not match " + regex.pattern();
if (error)
error(msg);
else
warning(msg);
}
}
return true;
}
static private boolean verify(String value, Pattern regex) {
return regex.matcher(value).matches();
}
private boolean verifyListHeader(String name, Pattern regex, boolean error) {
String value = manifest.getMainAttributes().getValue(name);
if (value == null)
return false;
Parameters map = parseHeader(value);
for (String header : map.keySet()) {
if (!regex.matcher(header).matches()) {
String msg = "Invalid value for " + name + ", " + value + " does not match " + regex.pattern();
if (error)
error(msg);
else
warning(msg);
}
}
return true;
}
// @Override
// public String getProperty(String key, String deflt) {
// if (properties == null)
// return deflt;
// return properties.getProperty(key, deflt);
// }
public static boolean isVersion(String version) {
return VERSION.matcher(version).matches();
}
public static boolean isIdentifier(String value) {
if (value.length() < 1)
return false;
if (!Character.isJavaIdentifierStart(value.charAt(0)))
return false;
for (int i = 1; i < value.length(); i++) {
if (!Character.isJavaIdentifierPart(value.charAt(i)))
return false;
}
return true;
}
public static boolean isMember(String value, String[] matches) {
for (String match : matches) {
if (match.equals(value))
return true;
}
return false;
}
public static boolean isFQN(String name) {
if (name.length() == 0)
return false;
if (!Character.isJavaIdentifierStart(name.charAt(0)))
return false;
for (int i = 1; i < name.length(); i++) {
char c = name.charAt(i);
if (Character.isJavaIdentifierPart(c) || c == '$' || c == '.')
continue;
return false;
}
return true;
}
/**
* Verify checksums
*/
/**
* Verify the checksums from the manifest against the real thing.
*
* @param all
* if each resources must be digested
* @return true if ok
* @throws Exception
*/
public void verifyChecksums(boolean all) throws Exception {
Manifest m = dot.getManifest();
if (m == null || m.getEntries().isEmpty()) {
if (all)
error("Verify checksums with all but no digests");
return;
}
List<String> missingDigest = new ArrayList<String>();
for (String path : dot.getResources().keySet()) {
if (path.equals("META-INF/MANIFEST.MF"))
continue;
Attributes a = m.getAttributes(path);
String digest = a.getValue("SHA1-Digest");
if (digest == null) {
if (!path.matches(""))
missingDigest.add(path);
} else {
byte[] d = Base64.decodeBase64(digest);
SHA1 expected = new SHA1(d);
Digester<SHA1> digester = SHA1.getDigester();
InputStream in = dot.getResource(path).openInputStream();
IO.copy(in, digester);
digester.digest();
if (!expected.equals(digester.digest())) {
error("Checksum mismatch %s, expected %s, got %s", path, expected, digester.digest());
}
}
}
if (missingDigest.size() > 0) {
error("Entries in the manifest are missing digests: %s", missingDigest);
}
}
/**
* Verify the EXTENDED_S syntax
*
* @param key
* @return
*/
public static boolean isExtended(String key) {
if (key == null)
return false;
return EXTENDED_P.matcher(key).matches();
}
/**
* Verify the ARGUMENT_S syntax
*
* @param key
* @return
*/
public static boolean isArgument(String arg) {
return arg != null && ARGUMENT_P.matcher(arg).matches();
}
/**
* Verify the QUOTEDSTRING syntax
*
* @param key
* @return
*/
public static boolean isQuotedString(String s) {
return s != null && QUOTEDSTRING_P.matcher(s).matches();
}
public static boolean isVersionRange(String range) {
return range != null && VERSIONRANGE_P.matcher(range).matches();
}
/**
* Verify the Meta-Persistence header
*
* @throws Exception
*/
public void verifyMetaPersistence() throws Exception {
List<String> list = new ArrayList<String>();
String mp = dot.getManifest().getMainAttributes().getValue(META_PERSISTENCE);
for (String location : OSGiHeader.parseHeader(mp).keySet()) {
String[] parts = location.split("!/");
Resource resource = dot.getResource(parts[0]);
if (resource == null)
list.add(location);
else {
if (parts.length > 1) {
Jar jar = new Jar("", resource.openInputStream());
try {
resource = jar.getResource(parts[1]);
if (resource == null)
list.add(location);
}
catch (Exception e) {
list.add(location);
}
finally {
jar.close();
}
}
}
}
if (list.isEmpty())
return;
error("Meta-Persistence refers to resources not in the bundle: %s", list).header("Meta-Persistence");
}
/**
* @return the frombuilder
*/
public boolean isFrombuilder() {
return frombuilder;
}
/**
* @param frombuilder
* the frombuilder to set
*/
public void setFrombuilder(boolean frombuilder) {
this.frombuilder = frombuilder;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
4db09a1c691c36686327d48abd579f27e55af7de | 13c2d3db2d49c40c74c2e6420a9cd89377f1c934 | /program_data/JavaProgramData/43/1745.java | d011ca1fb50ae7cb9e9db35e398f5af192648faa | [
"MIT"
] | permissive | qiuchili/ggnn_graph_classification | c2090fefe11f8bf650e734442eb96996a54dc112 | 291ff02404555511b94a4f477c6974ebd62dcf44 | refs/heads/master | 2021-10-18T14:54:26.154367 | 2018-10-21T23:34:14 | 2018-10-21T23:34:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 761 | java | package <missing>;
public class GlobalMembers
{
public static void Main()
{
int n;
int i;
int q;
int s;
int k;
String tempVar = ConsoleInput.scanfRead();
if (tempVar != null)
{
n = Integer.parseInt(tempVar);
}
k = Math.sqrt(n - 3);
for (i = 2;i <= k;i++)
{
if ((n - 3) % i == 0)
{
break;
}
}
if (i > k)
{
System.out.printf("3 %d\n",n - 3);
}
for (q = 5;q <= (n / 2);q++)
{
k = Math.sqrt(q);
for (i = 2;i <= k;i++)
{
if (q % i == 0)
{
break;
}
}
if (i > k)
{
s = Math.sqrt(n - q);
for (i = 2;i <= s;i++)
{
if ((n - q) % i == 0)
{
break;
}
}
if (i > s)
{
System.out.printf("%d %d\n",q,n - q);
}
}
}
}
}
| [
"y.yu@open.ac.uk"
] | y.yu@open.ac.uk |
abd0b3068a0c72d9728192e0ec295c995b19fa8c | b9c8a0ee3709a802be4037504b76c39a8f41f4c4 | /app/src/androidTest/java/com/shaan/newshere/ExampleInstrumentedTest.java | b304c41e071ef3aaad752279032ee777f0ab4418 | [] | no_license | shantanu0323/NewsHere | eadb63c7f623feea3b4f29524653a9e772e70914 | 825aac17eaa2f80c02a872cd7b42578561ef1e8b | refs/heads/master | 2023-04-28T20:27:48.500714 | 2021-05-19T13:20:28 | 2021-05-19T13:20:28 | 118,965,232 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 737 | java | package com.shaan.newshere;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.shaan.newshere", appContext.getPackageName());
}
}
| [
"srs.shaan@gmail.com"
] | srs.shaan@gmail.com |
66cd0fba830910b83cb5eb8d74297f5769ebde57 | 7472dae8f7f42a9d6aa701463bf8cb93c5f4fc72 | /src/com/company/Vehicle.java | 79a6fa95a03b3897a2e8a633c4479646c594fd6f | [] | no_license | jmpann/inheritanceChallenge | 8d84a8e8f8ac5122962f273f7dddf6d11ef20bab | 4bb703db30a106cba24e7ee03fc8f86807829726 | refs/heads/master | 2021-01-19T09:18:46.092388 | 2017-04-09T23:32:18 | 2017-04-09T23:32:18 | 87,747,275 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,565 | java | package com.company;
/**
* Created by flatironschool on 4/9/17.
*/
public class Vehicle {
private String name;
private String size;
private int currentVelocity;
private int currentDirection;
public Vehicle(String name, String size){
this.name = name;
this.size = size;
this.currentDirection = 0;
this.currentVelocity = 0;
}
public void steer(int direction) {
this.currentDirection += direction;
System.out.println("Steering at " + currentDirection + " degrees");
}
public void move(int velocity, int direction) {
currentVelocity = velocity;
currentDirection = direction;
System.out.println("Vehicle is moving at " + currentVelocity + " speed and " + direction + " direction.");
}
public void stop(){
this.currentVelocity = 0;
System.out.println("Vehicle has stopped");
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSize() {
return size;
}
public void setSize(String size) {
this.size = size;
}
public int getCurrentVelocity() {
return currentVelocity;
}
public void setCurrentVelocity(int currentVelocity) {
this.currentVelocity = currentVelocity;
}
public int getCurrentDirection() {
return currentDirection;
}
public void setCurrentDirection(int currentDirection) {
this.currentDirection = currentDirection;
}
}
| [
"josh.pann@example.com"
] | josh.pann@example.com |
d2df175f5d9b2e62087fc4749ce7aeb7455b2183 | 829cb3e438f4b7a5c7e6649bab30a40df115d267 | /cmon-app-portlet/docroot/WEB-INF/src/org/oep/cmon/dao/beans/thongtinthutuc2coquan/SourceThongTinThuTuc2CoQuan.java | c0de16cac0ac6bb5d46955890bc1b414d07f003b | [
"Apache-2.0"
] | permissive | doep-manual/CMON-App | 643bc726ca55a268fb7e44e80b181642224b2b67 | 17007602673b0ecffbf844ad78a276d953e791a7 | refs/heads/master | 2020-12-29T00:29:01.395897 | 2015-06-29T08:00:58 | 2015-06-29T08:00:58 | 38,224,623 | 0 | 0 | null | 2015-06-29T02:56:41 | 2015-06-29T02:56:41 | null | UTF-8 | Java | false | false | 818 | java | /*
* Copyright (c) 2014 by Open eGovPlatform (http://http://openegovplatform.org/).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.oep.cmon.dao.beans.thongtinthutuc2coquan;
public class SourceThongTinThuTuc2CoQuan {
int lePhiHoSo;
int phiHoSo;
int soNgayXuLy;
}
| [
"giang@dtt.vn"
] | giang@dtt.vn |
2ad254d5063b0ebfd4efafd022ea6104549d29ea | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/25/25_8ed408467a4387b3670ec8ad33eefbf963e93ba0/PafClientState/25_8ed408467a4387b3670ec8ad33eefbf963e93ba0_PafClientState_t.java | d392e54e91efe0f702bec612ba9551ae00d5b07d | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 31,420 | java | /*
* File: @(#)PafClientState.java Package: com.pace.base.state Project: Paf Base Libraries
* Created: Sep 6, 2005 By: JWatkins
* Version: x.xx
*
* Copyright (c) 2005-2006 Palladium Group, Inc. All rights reserved.
*
* This software is the confidential and proprietary information of Palladium Group, Inc.
* ("Confidential Information"). You shall not disclose such Confidential Information and
* should use it only in accordance with the terms of the license agreement you entered into
* with Palladium Group, Inc.
*
*
*
Date Author Version Changes
xx/xx/xx xxxxxxxx x.xx ..............
* 05/24/06 AFarkas x.xx Moved from com.pace.base.server (PafServer)
*
*/
package com.pace.base.state;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import com.pace.base.PafBaseConstants;
import com.pace.base.PafSecurityToken;
import com.pace.base.app.*;
import com.pace.base.comm.ClientInitRequest;
import com.pace.base.comm.PafPlannerConfig;
import com.pace.base.data.Intersection;
import com.pace.base.data.MemberTreeSet;
import com.pace.base.data.TimeSlice;
import com.pace.base.mdb.IPafConnectionProps;
import com.pace.base.mdb.PafBaseTree;
import com.pace.base.mdb.PafDimMember;
import com.pace.base.mdb.PafDimTree;
import com.pace.base.mdb.PafDimTree.DimTreeType;
import com.pace.base.rules.RuleSet;
import com.pace.base.utility.StringUtils;
import com.pace.base.view.PafMVS;
import com.pace.base.view.PafUserSelection;
import com.pace.base.view.PafView;
/**
* Stores state of a client connecting to the server
* Holds all objects of interest
*
* @version x.xx
* @author JWatkins
*
*/
public class PafClientState implements IPafClientState {
private String clientId;
private ClientInitRequest initRequest = null;
private String clientLanguage;
private String paceHome = null;
private String transferDirPath = null;
private boolean debugMode = false;
private PafApplicationDef app;
private PafSecurityToken securityToken;
private MemberTreeSet uowTrees;
private Map<String, HashMap<String, Integer>> memberIndexLists;
private UnitOfWork unitOfWork;
private Map<String, List<RuleSet>> ruleSets;
private String currentMsrRulesetName;
private Map<String, Set<Intersection>> lockedNotPlannableInterMap = new HashMap<String, Set<Intersection>>();
private Map<String, Set<Intersection>> lockedForwardPlannableInterMap = new HashMap<String, Set<Intersection>>();
private PafPlannerRole plannerRole;
private Season planSeason;
private Map<String, PafView> currentViews = new HashMap<String, PafView>();
private Map<String, PafMVS> materializedViewSections = new HashMap<String, PafMVS>();
private Map<String, IPafConnectionProps> dataSources = new HashMap<String, IPafConnectionProps>();
private Map<String, PafUserSelection[]> userSelections = new HashMap<String, PafUserSelection[]>();
private Set<String> activeVersions;
private PafPlannerConfig plannerConfig;
private boolean isDataFilteredUow = false;
private boolean isUserFilteredUow = false;
private Map<String, List<String>> roleFilterSelections = new HashMap<String, List<String>>();
private PafUserDef userDef;
private Set<String> readOnlyMeasuresSet = null;
private Map<String, PafBaseTree> mdbBaseTrees = null;
private Map<String, Set<String>> lockedPeriodMap = null;
private Set<String> lockedTimeHorizonPeriods = null;
private Set<TimeSlice> lockedTimeSlices = null;
private Set<String> invalidTimeHorizonPeriods = null;
private Set<TimeSlice> invalidTimeSlices = null;
public MemberTreeSet getUowTrees() {
return uowTrees;
}
public void setUowTrees(MemberTreeSet uowTrees) {
this.uowTrees = uowTrees;
}
public String getTimeHorizonDim() {
return PafBaseConstants.TIME_HORIZON_DIM;
}
public PafDimTree getTimeHorizonTree() {
return uowTrees.getTree(this.getTimeHorizonDim());
}
/**
* Returns the memberIndexList for the specified dimension
*
* @param dimName Dimension name
* @return Map<String, Integer>
*/
public Map<String, Integer> getMemberIndexList(String dimName) {
if (!memberIndexLists.containsKey(dimName)) throw new IllegalArgumentException("Dimension name not found in Dimension Index List structure. Dimension: " + dimName);
return memberIndexLists.get(dimName);
}
/**
* Returns the memberIndexLists property
*
* @return Map<String, HashMap<String, Integer>>
*/
public Map<String, HashMap<String, Integer>> getMemberIndexLists() {
return memberIndexLists;
}
/**
* Set the memberIndexLists property
*
* @param memberIndexLists Member index lists
*/
public void setMemberIndexLists(Map<String, HashMap<String, Integer>> memberIndexLists) {
this.memberIndexLists = memberIndexLists;
}
/**
* @return Returns the app.
*/
public PafApplicationDef getApp() {
return app;
}
/**
* @return Returns the initRequest.
*/
public ClientInitRequest getInitRequest() {
return initRequest;
}
public PafClientState(String clientId, ClientInitRequest pcInit, String paceHome, String transferDirPath, boolean debugMode) {
initRequest = pcInit;
this.clientId = clientId;
if (pcInit.getClientLanguage() != null && !pcInit.getClientLanguage().trim().equals(""))
this.clientLanguage = pcInit.getClientLanguage();
else
this.clientLanguage = PafBaseConstants.DEFAULT_LANGUAGE;
this.paceHome = paceHome;
this.transferDirPath = transferDirPath;
this.debugMode = debugMode;
}
public String getClientType() {
return initRequest.getClientType();
}
public String getClientVersion() {
return initRequest.getClientVersion();
}
public String getClientIpAddress() {
return initRequest.getIpAddress();
}
public String getPaceHome() {
return paceHome;
}
public String getTransferDirPath() {
return transferDirPath;
}
public boolean isDebugMode() {
return debugMode;
}
public void addView(PafView view) {
// Add view to views collection
currentViews.put(view.getName(), view);
}
public PafView getView(String viewName) {
return currentViews.get(viewName);
}
/**
* Add entry to "Materialized View Section" catalog
*
* @param key Materialized View section key
* @param pafMVS Materialized View Section
*/
public void addMVS(String key, PafMVS pafMVS) {
materializedViewSections.put(key, pafMVS);
}
/**
* @param key Materialized View Section key
*
* @return Returns the materialized view section for the speficied key.
*/
public PafMVS getMVS(String key) {
return materializedViewSections.get(key);
}
/**
* @return All materialized view sections
*/
public Collection<PafMVS> getAllMVS() {
return materializedViewSections.values();
}
public String getClientId() {
return clientId;
}
public void setSecurityToken(PafSecurityToken token) {
this.securityToken = token;
}
public PafSecurityToken getSecurityToken() {
return this.securityToken ;
}
/**
* @param app The app to set.
*/
public void setApp(PafApplicationDef app) {
this.app = app;
}
/**
* @return Returns the sessionToken.
*/
public String getSessionToken() {
String sessionToken = null;
if ( securityToken != null ) {
sessionToken = securityToken.getSessionToken();
}
return sessionToken;
}
/**
* @return Returns the userName.
*/
public String getUserName() {
String userName = null;
if ( securityToken != null ) {
userName = securityToken.getUserName();
}
return userName;
}
public void setUnitOfWork(UnitOfWork workUnit) {
unitOfWork = workUnit;
}
public UnitOfWork getUnitOfWork() {
return unitOfWork;
}
/**
* @return Returns the ruleSets.
*/
public Map<String, List<RuleSet>> getRuleSets() {
return ruleSets;
}
/**
* @param ruleSets The ruleSets to set.
*/
public void setRuleSets(Map<String, List<RuleSet>> ruleSets) {
this.ruleSets = ruleSets;
}
public Map<String, Set<Intersection>> getLockedForwardPlannableInterMap() {
return lockedForwardPlannableInterMap;
}
public void setLockedForwardPlannableInterMap(
Map<String, Set<Intersection>> lockedForwardPlannableInterMap) {
if ( lockedForwardPlannableInterMap == null ) {
this.lockedForwardPlannableInterMap = new HashMap<String, Set<Intersection>>();
} else {
this.lockedForwardPlannableInterMap = lockedForwardPlannableInterMap;
}
}
public Map<String, Set<Intersection>> getLockedNotPlannableInterMap() {
return lockedNotPlannableInterMap;
}
public Set<Intersection> getCurrentLockedIntersections(String viewName) {
// TODO Implement this for multiple view sections
HashSet <Intersection> set = new HashSet<Intersection>();
String sectionName = this.currentViews.get(viewName).getViewSections()[0].getName();
if (this.lockedForwardPlannableInterMap.containsKey(sectionName))
set.addAll(this.lockedForwardPlannableInterMap.get(sectionName));
if (this.lockedNotPlannableInterMap.containsKey(sectionName))
set.addAll(this.lockedNotPlannableInterMap.get(sectionName));
return set;
}
public void setLockedNotPlannableInterMap(
Map<String, Set<Intersection>> lockedNotPlannableInterMap) {
if ( lockedNotPlannableInterMap == null ) {
this.lockedNotPlannableInterMap = new HashMap<String, Set<Intersection>>();
} else {
this.lockedNotPlannableInterMap = lockedNotPlannableInterMap;
}
}
public void addLockedForwardPlannableInterMap(String key, Set<Intersection> set) {
if ( lockedForwardPlannableInterMap == null ) {
lockedForwardPlannableInterMap = new HashMap<String, Set<Intersection>>();
}
lockedForwardPlannableInterMap.put(key, set);
}
public void addLockedNotPlannableInterMap(String key, Set<Intersection> set) {
if ( lockedNotPlannableInterMap == null ) {
lockedNotPlannableInterMap = new HashMap<String, Set<Intersection>>();
}
lockedNotPlannableInterMap.put(key, set);
}
public MdbDef getMdbDef() {
return app.getMdbDef();
}
public RuleSet[] getRuleSetArray() {
List<RuleSet> ruleSets = new ArrayList<RuleSet>();
for (List<RuleSet> ruleSetList : this.ruleSets.values() ) {
ruleSets.addAll(ruleSetList);
}
return ruleSets.toArray(new RuleSet[0]);
}
public VersionDef getPlanningVersion() {
return app.getVersionDefs().get(app.findPlanCycleVersion(planSeason.getPlanCycle()));
}
public void setPlannerRole(PafPlannerRole plannerRole) {
this.plannerRole = plannerRole;
}
public void setPlanSeason(Season planSeason) {
this.planSeason = planSeason;
}
public PafPlannerRole getPlannerRole() {
return plannerRole;
}
public Season getPlanSeason() {
return planSeason;
}
/**
* @return Returns the clientLanguage.
*/
public String getClientLanguage() {
return clientLanguage;
}
/**
* @param clientLanguage The clientLanguage to set.
*/
public void setClientLanguage(String clientLanguage) {
this.clientLanguage = clientLanguage;
}
/**
* Generate token values for the current client state and merge them
* with any supplied token values from the client
*
* @param defaultTokenValues Token values to start with (derived from user input or menu def)
* @return Properties collection of tokens
*/
public Properties generateTokenCatalog(Properties defaultTokenValues) {
@SuppressWarnings("unused")
final String prefixMenuDef = PafBaseConstants.CC_TOKEN_PREFIX_MENU_DEF;
final String prefixMenuInput = PafBaseConstants.CC_TOKEN_PREFIX_MENU_INPUT;
final String prefixSession = PafBaseConstants.CC_TOKEN_PREFIX_SESSION;
final String prefixUowAggFloorGen = PafBaseConstants.CALC_TOKEN_PREFIX_UOW_AGG_FLOOR_GEN;
final String prefixUowAggFloorLevel = PafBaseConstants.CALC_TOKEN_PREFIX_UOW_AGG_FLOOR_LVL;
final String prefixUowFloorGen = PafBaseConstants.CALC_TOKEN_PREFIX_UOW_FLOOR_GEN;
final String prefixUowFloorLevel = PafBaseConstants.CALC_TOKEN_PREFIX_UOW_FLOOR_LVL;
final String prefixUowMembers = PafBaseConstants.CALC_TOKEN_PREFIX_UOW_MBRS;
final String prefixUowFloorMembers = PafBaseConstants.CALC_TOKEN_PREFIX_UOW_MBRS_FLOOR;
final String prefixUowMdbFloorMembers = PafBaseConstants.CALC_TOKEN_PREFIX_UOW_MBRS_MDBFLOOR;
final String prefixUowRoot = PafBaseConstants.CALC_TOKEN_PREFIX_UOW_ROOT;
final String prefixUserSel = PafBaseConstants.CALC_TOKEN_PREFIX_USER_SEL;
final String tokenStartChar = PafBaseConstants.CC_TOKEN_START_CHAR;
final String tokenEndChar = PafBaseConstants.CC_TOKEN_END_CHAR;
String activeView = null, parmKey = null, parmValue = null;
Date date = null;
DateFormat dateFormat = null;
Properties tokenCatalog = new Properties();
//TODO Try to merge in logic for report header tokens
/* Until now, this method has been used exclusively to resolve custom command tokens. Logic
* has been added to resolve the ROLE FILTER SELECTION custom command tokens and report
* header tokens. Going forward, it would be desirable to use this method, as much as
* possible, to generate all tokens (CC and Report Header) - AF 9/23/2010.
*/
// Get active view token
String viewProperty = prefixMenuInput + "ACTIVEVIEW";
activeView = defaultTokenValues.getProperty(viewProperty);
// Add session tokens
//-- Session date (ex: 20091101)
parmKey = tokenStartChar + prefixSession + PafBaseConstants.CC_SESSION_TOKEN_DATE + tokenEndChar;
dateFormat = new SimpleDateFormat("yyyyMMdd");
date = new Date();
parmValue = dateFormat.format(date);
tokenCatalog.setProperty(parmKey.toUpperCase(), parmValue);
//-- Session date/time (ex: 20091101-173245)
parmKey = tokenStartChar + prefixSession + PafBaseConstants.CC_SESSION_TOKEN_DATETIME + tokenEndChar;
dateFormat = new SimpleDateFormat("yyyyMMdd-HHmmss");
parmValue = dateFormat.format(date);
tokenCatalog.setProperty(parmKey.toUpperCase(), parmValue);
//-- Plan version
parmKey = tokenStartChar + prefixSession + PafBaseConstants.CC_SESSION_TOKEN_PLAN_VERSION + tokenEndChar;
parmValue = dQuotes(getPlanningVersion().getName());
tokenCatalog.setProperty(parmKey.toUpperCase(), parmValue);
//-- Plan version (no quotes)
parmKey = tokenStartChar + prefixSession + PafBaseConstants.CC_SESSION_TOKEN_PLAN_VERSION + PafBaseConstants.CC_TOKEN_SUFFIX_NOQUOTES + tokenEndChar;
parmValue = getPlanningVersion().getName();
tokenCatalog.setProperty(parmKey.toUpperCase(), parmValue);
//-- Client ID
parmKey = tokenStartChar + prefixSession + PafBaseConstants.CC_SESSION_TOKEN_CLIENTID + tokenEndChar;
parmValue = getClientId();
tokenCatalog.setProperty(parmKey.toUpperCase(), parmValue);
//-- User Name
parmKey = tokenStartChar + prefixSession + PafBaseConstants.CC_SESSION_TOKEN_USERNAME + tokenEndChar;
parmValue = this.getUserName();
tokenCatalog.setProperty(parmKey.toUpperCase(), parmValue);
//-- Role (TTN-1453)
parmKey = tokenStartChar + prefixSession + PafBaseConstants.CC_SESSION_TOKEN_ROLENAME + tokenEndChar;
parmValue = this.getPlannerRole().getRoleName();
tokenCatalog.setProperty(parmKey.toUpperCase(), parmValue);
//-- Cycle (TTN-1453)
parmKey = tokenStartChar + prefixSession + PafBaseConstants.CC_SESSION_TOKEN_CYCLENAME + tokenEndChar;
parmValue = this.getPlannerConfig().getCycle();
if (parmValue == null) { //TTN-1458
parmValue = "";
}
tokenCatalog.setProperty(parmKey.toUpperCase(), parmValue);
// Get user selection properties for the active view
if (activeView != null) {
PafUserSelection[] userSelections = getUserSelections().get(activeView);
if (userSelections != null) {
// Cycle though all user selections on a particular view
for (PafUserSelection userSel:userSelections) {
if (userSel != null) {
// Set parm key. Example format is: "USERSEL.ProductSel"
parmKey = tokenStartChar + prefixUserSel + userSel.getId() + tokenEndChar;
// Set parm value(s)- Surround all Essbase members in quotes and separate by commas
parmValue = StringUtils.arrayToString(userSel.getValues(),"","","\"","\"",",");
// Add parm key-value pair to token catalog
tokenCatalog.setProperty(parmKey.toUpperCase(), parmValue);
// Add additional generic key for user selection by dimension. This
// token should not be used on views where there are multiple product selectors.
// Example format is: "USERSEL.Product"
parmKey = tokenStartChar + prefixUserSel + userSel.getDimension() + tokenEndChar;
tokenCatalog.setProperty(parmKey.toUpperCase(), parmValue);
//TODO - Possibly add logic that merges token values, for the same dimension, on multiple selectors together
}
}
}
}
// Create UOW properties (Floor, Root, and Members) for each app dimension
// and create dimension specific properties.
//
// Cycle through all UOW base dimensions, and all attribute dimensions
//
Set<String> treeDims = new HashSet<String>(Arrays.asList(getUnitOfWork().getDimensions()));
treeDims.addAll(uowTrees.getAttributeDimensions());
for (String dimension:treeDims) {
// Get dimension's uow tree
PafDimTree uowTree = getUowTrees().getTree(dimension);
String uowRoot = uowTree.getRootNode().getKey();
// Get dimension's mdb tree (TTN-1767)
PafDimTree mdbTree = null;
if (uowTree.getTreeType() == DimTreeType.Base) {
mdbTree = mdbBaseTrees.get(dimension);
} else {
// Attribute trees are not filtered, so the uow copy is the
// same as the original mdb tree.
mdbTree = uowTree;
}
// Create Role Filter Selections tokens (TTN-1472)
List<String> filterMembers = this.getRoleFilterSelections().get(dimension);
if (filterMembers != null) {
// Create calc script token (sample format: [ROLEFILTER.SEL.PRODUCT])
parmKey = tokenStartChar + PafBaseConstants.CALC_TOKEN_PREFIX_ROLEFILTER_SEL + dimension + tokenEndChar;
// Set parm value - Surround all Essbase members in quotes and separate by commas
parmValue = StringUtils.arrayToString(filterMembers.toArray(new String[0]),"","","\"","\"",",");
tokenCatalog.setProperty(parmKey.toUpperCase(), parmValue);
// Create report header token (sample format: @ROLEFILTER.SEL.PRODUCT)
parmKey = PafBaseConstants.HEADER_TOKEN_ROLE_FILTER_SEL + PafBaseConstants.HEADER_TOKEN_PARM_START_CHAR + dimension
+ PafBaseConstants.HEADER_TOKEN_PARM_END_CHAR;
// Set parm value - Separate all members by commas
parmValue = StringUtils.arrayToString(filterMembers.toArray(new String[0]),",");
tokenCatalog.setProperty(parmKey.toUpperCase(), parmValue);
}
// Create UOW Members token (TTN-1453)
// Sample Format: UOWMEMBERS.PRODUCT
parmKey = tokenStartChar + prefixUowMembers + dimension + tokenEndChar;
String[] uowMembers = uowTree.getMemberKeys();
StringBuffer memberBuffer = new StringBuffer();
for (String member : uowMembers) {
memberBuffer.append(dQuotes(member));
memberBuffer.append(","); // Comma delimit list of members
}
parmValue = memberBuffer.substring(0, memberBuffer.length() - 1);
tokenCatalog.setProperty(parmKey.toUpperCase(), parmValue);
// Create UOW Floor Members token (TTN-1453)
// Sample Format: UOWMEMBERS.FLOOR.PRODUCT
parmKey = tokenStartChar + prefixUowFloorMembers + dimension + tokenEndChar;
List<PafDimMember> uowFloorMembers = uowTree.getLowestLevelMembers();
memberBuffer = new StringBuffer();
for (PafDimMember member : uowFloorMembers) {
memberBuffer.append(dQuotes(member.getKey()));
memberBuffer.append(","); // Comma delimit list of members
}
parmValue = memberBuffer.substring(0, memberBuffer.length() - 1);
tokenCatalog.setProperty(parmKey.toUpperCase(), parmValue);
// Create UOW Mdb Floor Members token (TTN-1767)
// Sample Format: UOWMEMBERS.MDBFLOOR.PRODUCT
parmKey = tokenStartChar + prefixUowMdbFloorMembers + dimension + tokenEndChar;
List<PafDimMember> uowDimFloorMembers = mdbTree.getMembersAtLevel(uowRoot, 0);
memberBuffer = new StringBuffer();
for (PafDimMember member : uowDimFloorMembers) {
memberBuffer.append(dQuotes(member.getKey()));
memberBuffer.append(","); // Comma delimit list of members
}
parmValue = memberBuffer.substring(0, memberBuffer.length() - 1);
tokenCatalog.setProperty(parmKey.toUpperCase(), parmValue);
// Create UOW Root properties - Surround all Essbase members in quotes
// Sample Format: UOWROOT.PRODUCT
parmKey = tokenStartChar + prefixUowRoot + dimension + tokenEndChar;
parmValue = dQuotes(uowRoot);
tokenCatalog.setProperty(parmKey.toUpperCase(), parmValue);
// Create UOW Floor properties
// Sample Format: UOWFLOOR.LEVEL.PRODUCT
parmKey = tokenStartChar + prefixUowFloorLevel + dimension + tokenEndChar;
int level = uowTree.getLowestAbsLevelInTree();
if (level != 0) {
// Essbase levels are denoted as negative numbers
level = level * -1;
}
parmValue = String.valueOf(level);
tokenCatalog.setProperty(parmKey.toUpperCase(), parmValue);
// Sample Format: UOWFLOOR.GEN.PRODUCT
parmKey = tokenStartChar + prefixUowFloorGen + dimension + tokenEndChar;
int gen = uowTree.getHighestGenInTree();
parmValue = String.valueOf(gen);
tokenCatalog.setProperty(parmKey.toUpperCase(), parmValue);
// Create UOW Agg Floor properties. Agg Floor Level is the lowest level at which
// the members for a given dimension in the UOW are being aggregated. The Agg Floor
// is equal to the UOW Floor - 1.
// Sample Format: UOWAGGFLOOR.LEVEL.PRODUCT
parmKey = tokenStartChar + prefixUowAggFloorLevel + dimension + tokenEndChar;
parmValue = String.valueOf(level - 1);
tokenCatalog.setProperty(parmKey.toUpperCase(), parmValue);
// Sample Format: UOWAGGFLOOR.GEN.PRODUCT
parmKey = tokenStartChar + prefixUowAggFloorGen + dimension + tokenEndChar;
parmValue = String.valueOf(gen - 1);
tokenCatalog.setProperty(parmKey.toUpperCase(), parmValue);
}
// Merge any supplied token values into token catalog
for (Object parmKeyObj : defaultTokenValues.keySet()) {
parmKey = (String) parmKeyObj;
parmValue = defaultTokenValues.getProperty(parmKey);
tokenCatalog.setProperty(tokenStartChar + parmKey + tokenEndChar, parmValue);
}
// Return token catalog
return tokenCatalog;
}
/**
* Put double quotes ("") around supplied text string.
*
* @param text Text string to put double quotes around
*
* @return Text string to put double quotes around
*/
private String dQuotes(String text) {
return StringUtils.doubleQuotes(text);
}
/**
* @return Returns the dataSources.
*/
public Map<String, IPafConnectionProps> getDataSources() {
return dataSources;
}
/**
* @return Returns the userSelections.
*/
public Map<String, PafUserSelection[]> getUserSelections() {
return userSelections;
}
/**
* @param userSelections The userSelections to set.
*/
public void setUserSelections(Map<String, PafUserSelection[]> userSelections) {
this.userSelections = userSelections;
}
/**
* @return Returns the activeVersions.
*/
public Set<String> getActiveVersions() {
return activeVersions;
}
/**
* @param activeVersions The activeVersions to set.
*/
public void setActiveVersions(Set<String> activeVersions) {
this.activeVersions = activeVersions;
}
public RuleSet getDefaultMsrRuleset() {
String msrDim = app.getMdbDef().getMeasureDim();
if (plannerConfig.getDefaultRulesetName() == null || plannerConfig.getDefaultRulesetName().trim().equals("")) {
// just get the 1st measure ruleset (assumed only)
return ruleSets.get(msrDim).get(0);
}
return getMsrRulsetByName(plannerConfig.getDefaultRulesetName());
}
public RuleSet getMsrRulsetByName(String ruleSetName) {
List<RuleSet>msrRulesets = ruleSets.get(app.getMdbDef().getMeasureDim());
for (RuleSet rs : msrRulesets) {
if (rs.getName().equals(ruleSetName.trim()))
return rs;
}
throw new IllegalArgumentException("No ruleset found by that name [" + ruleSetName + "]");
}
/**
* @return Returns the defaultMsrRulesetName.
*/
public String getDefaultMsrRulesetName() {
return getDefaultMsrRuleset().getName();
}
public List<RuleSet> getMsrRuleSets() {
return ruleSets.get(app.getMdbDef().getMeasureDim());
}
/**
* @return Returns the plannerConfig.
*/
public PafPlannerConfig getPlannerConfig() {
return plannerConfig;
}
/**
* @param plannerConfig The plannerConfig to set.
*/
public void setPlannerConfig(PafPlannerConfig plannerConfig) {
this.plannerConfig = plannerConfig;
}
public RuleSet getCurrentMsrRuleset() {
String msrDim = app.getMdbDef().getMeasureDim();
for (RuleSet rs : ruleSets.get(msrDim))
if (rs.getName().equalsIgnoreCase(currentMsrRulesetName)) return rs;
throw new IllegalArgumentException("Current ruleset named [" + currentMsrRulesetName + "] not found in clients ruleset list");
}
public String getCurrentMsrRulesetName() {
return currentMsrRulesetName;
}
public void setCurrentMsrRulesetName(String currentMsrRulesetName) {
this.currentMsrRulesetName = currentMsrRulesetName;
}
public boolean isDataFilteredUow() {
return isDataFilteredUow;
}
public void setDataFilteredUow(boolean isDataFilteredUow) {
this.isDataFilteredUow = isDataFilteredUow;
}
public boolean isUserFilteredUow() {
return isUserFilteredUow;
}
/**
* @param userSelectionsMap the roleFilterSelections to set
*/
public void setRoleFilterSelections(Map<String, List<String>> userSelectionsMap) {
this.roleFilterSelections = userSelectionsMap;
}
/**
* @return the roleFilterSelections
*/
public Map<String, List<String>> getRoleFilterSelections() {
return roleFilterSelections;
}
public void setUserFilteredUow(boolean isUserFilteredUow) {
this.isUserFilteredUow = isUserFilteredUow;
}
public void setUserDef(PafUserDef userDef) {
this.userDef = userDef;
}
public PafUserDef getUserDef() {
return userDef;
}
/**
* Returns read only measure set
*
* @return
*/
public Set<String> getReadOnlyMeasures() {
if ( readOnlyMeasuresSet == null ) {
readOnlyMeasuresSet = new HashSet<String>();
}
if ( readOnlyMeasuresSet.size() == 0 && plannerConfig != null && plannerConfig.getReadOnlyMeasures() != null && plannerConfig.getReadOnlyMeasures().length > 0 ) {
readOnlyMeasuresSet.addAll(Arrays.asList(plannerConfig.getReadOnlyMeasures()));
}
return readOnlyMeasuresSet;
}
/**
* @return the mdbBaseTrees
*/
public Map<String, PafBaseTree> getMdbBaseTrees() {
return mdbBaseTrees;
}
/**
* @param mdbBaseTrees the mdbBaseTrees to set
*/
public void setMdbBaseTrees(Map<String, PafBaseTree> mdbBaseTrees) {
this.mdbBaseTrees = mdbBaseTrees;
}
/**
* @return the lockedPeriodMap
*/
public Map<String, Set<String>> getLockedPeriodMap() {
return lockedPeriodMap;
}
/**
* @param lockedPeriodMap the lockedPeriodMap to set
*/
public void setLockedPeriodMap(Map<String, Set<String>> lockedPeriodMap) {
this.lockedPeriodMap = lockedPeriodMap;
}
/**
* @return the lockedTimeHorizonPeriods
*/
public Set<String> getLockedTimeHorizonPeriods() {
return lockedTimeHorizonPeriods;
}
/**
* @param lockedTimeHorizonPeriods the lockedTimeHorizonPeriods to set
*/
public void setLockedTimeHorizonPeriods(Set<String> lockedTimeHorizonPeriods) {
this.lockedTimeHorizonPeriods = lockedTimeHorizonPeriods;
}
/**
* @return the lockedTimeHorizPeriods
*/
public Set<TimeSlice> getLockedTimeSlices() {
return lockedTimeSlices;
}
/**
* @param lockedTimeSlices the lockedTimeSlices to set
*/
public void setLockedTimeSlices(Set<TimeSlice> lockedTimeSlices) {
this.lockedTimeSlices = lockedTimeSlices;
}
/**
* @return the invalidTimeHorizonPeriods
*/
public Set<String> getInvalidTimeHorizonPeriods() {
return invalidTimeHorizonPeriods;
}
/**
* @param invalidTimeHorizonPeriods the invalidTimeHorizonPeriods to set
*/
public void setInvalidTimeHorizonPeriods(Set<String> invalidTimeHorizonPeriods) {
this.invalidTimeHorizonPeriods = invalidTimeHorizonPeriods;
}
/**
* @return the invalidTimeHorizPeriods
*/
public Set<TimeSlice> getInvalidTimeSlices() {
return invalidTimeSlices;
}
/**
* @param invalidTimeSlices the invalidTimeSlices to set
*/
public void setInvalidTimeSlices(Set<TimeSlice> invalidTimeSlices) {
this.invalidTimeSlices = invalidTimeSlices;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
5ba904b6b030e8e8c73387d89da0b65f44dd81bf | 8d5412500ceb6850d9baba9c1da22e79648e99c6 | /app/src/main/java/com/reynaldlancer/reynaldlancer/InboxFragment.java | 82785f513253a34ebd8ef67c2295b7095c5040ee | [] | no_license | reynaldiRepo/ReynaldLancer | 28e1ecfc2f7d2da66a7670556f864e26fc9e5226 | c5c6202f273e4a05d831f3806092c676781d5a3c | refs/heads/master | 2022-11-11T12:09:07.697530 | 2020-07-02T05:47:28 | 2020-07-02T05:47:28 | 256,169,234 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 662 | java | package com.reynaldlancer.reynaldlancer;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
/**
* A simple {@link Fragment} subclass.
*/
public class InboxFragment extends Fragment {
public InboxFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_inbox, container, false);
}
}
| [
"38524172+reynaldiRepo@users.noreply.github.com"
] | 38524172+reynaldiRepo@users.noreply.github.com |
07f509fb3662ead869a52709448b999130f989ea | a699214f0aad6ec6e4421134b4f0b455068fbbd6 | /src/Items/PlayerResourceHolder.java | f1278a73993eb9309539180d0fd4c8ec2d0c62c4 | [] | no_license | benjaminspalding/Sidereal-Confluece | 4341a5009ebab05d185c30fbabf60ba6ff070e1b | a6a989e680f8a4c75b6bd90be20151c135690ee3 | refs/heads/master | 2020-03-12T10:50:02.990032 | 2018-06-20T21:48:48 | 2018-06-20T21:48:48 | 130,582,239 | 0 | 0 | null | 2018-04-22T15:47:02 | 2018-04-22T15:47:02 | null | UTF-8 | Java | false | false | 726 | java | package Items;
public class PlayerResourceHolder {
private Resource bf_resource;
private Integer bf_dracula;
//named resource because resources and dracula because its the count
PlayerResourceHolder(Resource resource, Integer dracula)
{
this.bf_resource = resource;
this.bf_dracula = dracula;
}
//getter methods
public Resource GetResource()
{
return this.bf_resource;
}
public Integer getCount()
{
return this.bf_dracula;
}
//setter methods
public void setResource (Resource resource)
{
this.bf_resource = resource;
}
public void setCount (Integer dracula)
{
this.bf_dracula = dracula;
}
}
| [
"benjamin.spaling02@gmail.com"
] | benjamin.spaling02@gmail.com |
259200905f4f78ee065a6bc436fe63f7626d72de | ed3cb95dcc590e98d09117ea0b4768df18e8f99e | /project_1_1/src/i/d/d/Calc_1_1_8331.java | 82b2fc2e07db4636e3d417e0f3e0f097a0a4a892 | [] | no_license | chalstrick/bigRepo1 | ac7fd5785d475b3c38f1328e370ba9a85a751cff | dad1852eef66fcec200df10083959c674fdcc55d | refs/heads/master | 2016-08-11T17:59:16.079541 | 2015-12-18T14:26:49 | 2015-12-18T14:26:49 | 48,244,030 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 131 | java | package i.d.d;
public class Calc_1_1_8331 {
/** @return the sum of a and b */
public int add(int a, int b) {
return a+b;
}
}
| [
"christian.halstrick@sap.com"
] | christian.halstrick@sap.com |
d5cfc3eb7361100345c678523a695a63f19a01ce | 41eafa099205af98589ff5282a410da683efbbcd | /src/main/java/com/mmall/concurrency/example/atomic/AtomicExample3.java | 5d35865403352f48d145a7d7c73cf22a27194533 | [] | no_license | wangzy0327/concurrency | c0fe5595f2d9c48ab206e7deb659a0455952c318 | d9a4e98579301defa4201d850fe23ab3fbff0793 | refs/heads/master | 2020-04-09T05:02:26.330401 | 2019-04-23T02:32:25 | 2019-04-23T02:32:25 | 160,048,539 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 796 | java | package com.mmall.concurrency.example.atomic;
import com.mmall.concurrency.annotations.ThreadSafe;
import lombok.extern.slf4j.Slf4j;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Semaphore;
import java.util.concurrent.atomic.AtomicReference;
import java.util.concurrent.atomic.LongAdder;
@Slf4j
@ThreadSafe
public class AtomicExample3 {
private static AtomicReference<Integer> count = new AtomicReference<>(0);
public static void main(String[] args) {
count.compareAndSet(0,2);
count.compareAndSet(0,1);
count.compareAndSet(1,3);
count.compareAndSet(2,4);
count.compareAndSet(3,5);
log.info("count:{}",count.get());
}
}
| [
"wangzy0327@qq.com"
] | wangzy0327@qq.com |
8bc5eac2d6d2aa17e423d422ff836d7974fbfccf | ec9096201f139b0e99883eefbe2ee7cc0c75aebe | /src/person/Person.java | 761c36f5a03d0230d8b8224c91a9438ac4d5c6cb | [] | no_license | mmao3/bank | f49b5139b04b4a4801bc3e37ef7d777f82dd11c8 | 02d7501ae4f595e5ce5827e1878f2f722c1d72aa | refs/heads/master | 2021-01-10T06:45:15.297740 | 2016-02-16T23:47:50 | 2016-02-16T23:47:50 | 51,665,205 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 932 | java | package person;
import java.io.Serializable;
public class Person implements Serializable {
private String First_Name;
private String Last_Name;
private String Middle_Name;
public Person(String fname, String lname, String mname) {
this.First_Name = fname;
this.Last_Name = lname;
this.Middle_Name = mname;
}
@Override
public String toString() {
return "Person [First_Name=" + First_Name + ", Last_Name=" + Last_Name + ", Middle_Name=" + Middle_Name + "]";
}
public String getFirst_Name() {
return First_Name;
}
public void setFirst_Name(String first_Name) {
First_Name = first_Name;
}
public String getLast_Name() {
return Last_Name;
}
public void setLast_Name(String last_Name) {
Last_Name = last_Name;
}
public String getMiddle_Name() {
return Middle_Name;
}
public void setMiddle_Name(String middle_Name) {
Middle_Name = middle_Name;
}
} | [
"mmao@coreipsolutions.com"
] | mmao@coreipsolutions.com |
d88049349c0cb9353ddeb5774236db4ccffd8041 | d2ae5f1637e9bf16c983b4f06285e11444c11492 | /clients/google-api-services-lifesciences/v2beta/1.30.1/com/google/api/services/lifesciences/v2beta/model/Action.java | fcecfca3c3effba77dae78ebb07bac8e6c039fce | [
"Apache-2.0"
] | permissive | yujingtaojing/google-api-java-client-services | c30b31bc5bfb2f03cc8199e99847f01d896d5748 | 70bd1768336f248a504dd1ce57509db0d1271308 | refs/heads/master | 2020-08-30T16:04:19.265219 | 2019-10-25T17:25:45 | 2019-10-25T17:25:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 28,686 | java | /*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
/*
* This code was generated by https://github.com/googleapis/google-api-java-client-services/
* Modify at your own risk.
*/
package com.google.api.services.lifesciences.v2beta.model;
/**
* Specifies a single action that runs a Docker container.
*
* <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is
* transmitted over HTTP when working with the Cloud Life Sciences API. For a detailed explanation
* see:
* <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a>
* </p>
*
* @author Google, Inc.
*/
@SuppressWarnings("javadoc")
public final class Action extends com.google.api.client.json.GenericJson {
/**
* By default, after an action fails, no further actions are run. This flag indicates that this
* action must be run even if the pipeline has already failed. This is useful for actions that
* copy output files off of the VM or for debugging.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.Boolean alwaysRun;
/**
* If specified, overrides the `CMD` specified in the container. If the container also has an
* `ENTRYPOINT` the values are used as entrypoint arguments. Otherwise, they are used as a command
* and arguments to run inside the container.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.util.List<java.lang.String> commands;
/**
* An optional name for the container. The container hostname will be set to this name, making it
* useful for inter-container communication. The name must contain only upper and lowercase
* alphanumeric characters and hyphens and cannot start with a hyphen.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String containerName;
/**
* If the specified image is hosted on a private registry other than Google Container Registry,
* the credentials required to pull the image must be specified here as an encrypted secret.
*
* The secret must decrypt to a JSON-encoded dictionary containing both `username` and `password`
* keys.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private Secret credentials;
/**
* All container images are typically downloaded before any actions are executed. This helps
* prevent typos in URIs or issues like lack of disk space from wasting large amounts of compute
* resources.
*
* If set, this flag prevents the worker from downloading the image until just before the action
* is executed.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.Boolean disableImagePrefetch;
/**
* A small portion of the container's standard error stream is typically captured and returned
* inside the `ContainerStoppedEvent`. Setting this flag disables this functionality.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.Boolean disableStandardErrorCapture;
/**
* Enable access to the FUSE device for this action. Filesystems can then be mounted into disks
* shared with other actions. The other actions do not need the `enable_fuse` flag to access the
* mounted filesystem.
*
* This has the effect of causing the container to be executed with `CAP_SYS_ADMIN` and exposes
* `/dev/fuse` to the container, so use it only for containers you trust.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.Boolean enableFuse;
/**
* If specified, overrides the `ENTRYPOINT` specified in the container.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String entrypoint;
/**
* The environment to pass into the container. This environment is merged with values specified in
* the google.cloud.lifesciences.v2beta.Pipeline message, overwriting any duplicate values.
*
* In addition to the values passed here, a few other values are automatically injected into the
* environment. These cannot be hidden or overwritten.
*
* `GOOGLE_PIPELINE_FAILED` will be set to "1" if the pipeline failed because an action has exited
* with a non-zero status (and did not have the `IGNORE_EXIT_STATUS` flag set). This can be used
* to determine if additional debug or logging actions should execute.
*
* `GOOGLE_LAST_EXIT_STATUS` will be set to the exit status of the last non-background action that
* executed. This can be used by workflow engine authors to determine whether an individual action
* has succeeded or failed.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.util.Map<String, java.lang.String> environment;
/**
* Normally, a non-zero exit status causes the pipeline to fail. This flag allows execution of
* other actions to continue instead.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.Boolean ignoreExitStatus;
/**
* Required. The URI to pull the container image from. Note that all images referenced by actions
* in the pipeline are pulled before the first action runs. If multiple actions reference the same
* image, it is only pulled once, ensuring that the same image is used for all actions in a single
* pipeline.
*
* The image URI can be either a complete host and image specification (e.g.,
* quay.io/biocontainers/samtools), a library and image name (e.g., google/cloud-sdk) or a bare
* image name ('bash') to pull from the default library. No schema is required in any of these
* cases.
*
* If the specified image is not public, the service account specified for the Virtual Machine
* must have access to pull the images from GCR, or appropriate credentials must be specified in
* the google.cloud.lifesciences.v2beta.Action.credentials field.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String imageUri;
/**
* Labels to associate with the action. This field is provided to assist workflow engine authors
* in identifying actions (for example, to indicate what sort of action they perform, such as
* localization or debugging). They are returned in the operation metadata, but are otherwise
* ignored.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.util.Map<String, java.lang.String> labels;
/**
* A list of mounts to make available to the action.
*
* In addition to the values specified here, every action has a special virtual disk mounted under
* `/google` that contains log files and other operational components.
*
* /google/logs All logs written during the pipeline execution. /google/logs/output The
* combined standard output and standard error of all actions run as part of the pipeline
* execution. /google/logs/action/stdout The complete contents of each individual action's
* standard output. /google/logs/action/stderr The complete contents of each individual
* action's standard error output.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.util.List<Mount> mounts;
/**
* An optional identifier for a PID namespace to run the action inside. Multiple actions should
* use the same string to share a namespace. If unspecified, a separate isolated namespace is
* used.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String pidNamespace;
/**
* A map of containers to host port mappings for this container. If the container already
* specifies exposed ports, use the `PUBLISH_EXPOSED_PORTS` flag instead.
*
* The host port number must be less than 65536. If it is zero, an unused random port is assigned.
* To determine the resulting port number, consult the `ContainerStartedEvent` in the operation
* metadata.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.util.Map<String, java.lang.Integer> portMappings;
/**
* Exposes all ports specified by `EXPOSE` statements in the container. To discover the host side
* port numbers, consult the `ACTION_STARTED` event in the operation metadata.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.Boolean publishExposedPorts;
/**
* This flag allows an action to continue running in the background while executing subsequent
* actions. This is useful to provide services to other actions (or to provide debugging support
* tools like SSH servers).
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.Boolean runInBackground;
/**
* The maximum amount of time to give the action to complete. If the action fails to complete
* before the timeout, it will be terminated and the exit status will be non-zero. The pipeline
* will continue or terminate based on the rules defined by the `ALWAYS_RUN` and
* `IGNORE_EXIT_STATUS` flags.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private String timeout;
/**
* By default, after an action fails, no further actions are run. This flag indicates that this
* action must be run even if the pipeline has already failed. This is useful for actions that
* copy output files off of the VM or for debugging.
* @return value or {@code null} for none
*/
public java.lang.Boolean getAlwaysRun() {
return alwaysRun;
}
/**
* By default, after an action fails, no further actions are run. This flag indicates that this
* action must be run even if the pipeline has already failed. This is useful for actions that
* copy output files off of the VM or for debugging.
* @param alwaysRun alwaysRun or {@code null} for none
*/
public Action setAlwaysRun(java.lang.Boolean alwaysRun) {
this.alwaysRun = alwaysRun;
return this;
}
/**
* If specified, overrides the `CMD` specified in the container. If the container also has an
* `ENTRYPOINT` the values are used as entrypoint arguments. Otherwise, they are used as a command
* and arguments to run inside the container.
* @return value or {@code null} for none
*/
public java.util.List<java.lang.String> getCommands() {
return commands;
}
/**
* If specified, overrides the `CMD` specified in the container. If the container also has an
* `ENTRYPOINT` the values are used as entrypoint arguments. Otherwise, they are used as a command
* and arguments to run inside the container.
* @param commands commands or {@code null} for none
*/
public Action setCommands(java.util.List<java.lang.String> commands) {
this.commands = commands;
return this;
}
/**
* An optional name for the container. The container hostname will be set to this name, making it
* useful for inter-container communication. The name must contain only upper and lowercase
* alphanumeric characters and hyphens and cannot start with a hyphen.
* @return value or {@code null} for none
*/
public java.lang.String getContainerName() {
return containerName;
}
/**
* An optional name for the container. The container hostname will be set to this name, making it
* useful for inter-container communication. The name must contain only upper and lowercase
* alphanumeric characters and hyphens and cannot start with a hyphen.
* @param containerName containerName or {@code null} for none
*/
public Action setContainerName(java.lang.String containerName) {
this.containerName = containerName;
return this;
}
/**
* If the specified image is hosted on a private registry other than Google Container Registry,
* the credentials required to pull the image must be specified here as an encrypted secret.
*
* The secret must decrypt to a JSON-encoded dictionary containing both `username` and `password`
* keys.
* @return value or {@code null} for none
*/
public Secret getCredentials() {
return credentials;
}
/**
* If the specified image is hosted on a private registry other than Google Container Registry,
* the credentials required to pull the image must be specified here as an encrypted secret.
*
* The secret must decrypt to a JSON-encoded dictionary containing both `username` and `password`
* keys.
* @param credentials credentials or {@code null} for none
*/
public Action setCredentials(Secret credentials) {
this.credentials = credentials;
return this;
}
/**
* All container images are typically downloaded before any actions are executed. This helps
* prevent typos in URIs or issues like lack of disk space from wasting large amounts of compute
* resources.
*
* If set, this flag prevents the worker from downloading the image until just before the action
* is executed.
* @return value or {@code null} for none
*/
public java.lang.Boolean getDisableImagePrefetch() {
return disableImagePrefetch;
}
/**
* All container images are typically downloaded before any actions are executed. This helps
* prevent typos in URIs or issues like lack of disk space from wasting large amounts of compute
* resources.
*
* If set, this flag prevents the worker from downloading the image until just before the action
* is executed.
* @param disableImagePrefetch disableImagePrefetch or {@code null} for none
*/
public Action setDisableImagePrefetch(java.lang.Boolean disableImagePrefetch) {
this.disableImagePrefetch = disableImagePrefetch;
return this;
}
/**
* A small portion of the container's standard error stream is typically captured and returned
* inside the `ContainerStoppedEvent`. Setting this flag disables this functionality.
* @return value or {@code null} for none
*/
public java.lang.Boolean getDisableStandardErrorCapture() {
return disableStandardErrorCapture;
}
/**
* A small portion of the container's standard error stream is typically captured and returned
* inside the `ContainerStoppedEvent`. Setting this flag disables this functionality.
* @param disableStandardErrorCapture disableStandardErrorCapture or {@code null} for none
*/
public Action setDisableStandardErrorCapture(java.lang.Boolean disableStandardErrorCapture) {
this.disableStandardErrorCapture = disableStandardErrorCapture;
return this;
}
/**
* Enable access to the FUSE device for this action. Filesystems can then be mounted into disks
* shared with other actions. The other actions do not need the `enable_fuse` flag to access the
* mounted filesystem.
*
* This has the effect of causing the container to be executed with `CAP_SYS_ADMIN` and exposes
* `/dev/fuse` to the container, so use it only for containers you trust.
* @return value or {@code null} for none
*/
public java.lang.Boolean getEnableFuse() {
return enableFuse;
}
/**
* Enable access to the FUSE device for this action. Filesystems can then be mounted into disks
* shared with other actions. The other actions do not need the `enable_fuse` flag to access the
* mounted filesystem.
*
* This has the effect of causing the container to be executed with `CAP_SYS_ADMIN` and exposes
* `/dev/fuse` to the container, so use it only for containers you trust.
* @param enableFuse enableFuse or {@code null} for none
*/
public Action setEnableFuse(java.lang.Boolean enableFuse) {
this.enableFuse = enableFuse;
return this;
}
/**
* If specified, overrides the `ENTRYPOINT` specified in the container.
* @return value or {@code null} for none
*/
public java.lang.String getEntrypoint() {
return entrypoint;
}
/**
* If specified, overrides the `ENTRYPOINT` specified in the container.
* @param entrypoint entrypoint or {@code null} for none
*/
public Action setEntrypoint(java.lang.String entrypoint) {
this.entrypoint = entrypoint;
return this;
}
/**
* The environment to pass into the container. This environment is merged with values specified in
* the google.cloud.lifesciences.v2beta.Pipeline message, overwriting any duplicate values.
*
* In addition to the values passed here, a few other values are automatically injected into the
* environment. These cannot be hidden or overwritten.
*
* `GOOGLE_PIPELINE_FAILED` will be set to "1" if the pipeline failed because an action has exited
* with a non-zero status (and did not have the `IGNORE_EXIT_STATUS` flag set). This can be used
* to determine if additional debug or logging actions should execute.
*
* `GOOGLE_LAST_EXIT_STATUS` will be set to the exit status of the last non-background action that
* executed. This can be used by workflow engine authors to determine whether an individual action
* has succeeded or failed.
* @return value or {@code null} for none
*/
public java.util.Map<String, java.lang.String> getEnvironment() {
return environment;
}
/**
* The environment to pass into the container. This environment is merged with values specified in
* the google.cloud.lifesciences.v2beta.Pipeline message, overwriting any duplicate values.
*
* In addition to the values passed here, a few other values are automatically injected into the
* environment. These cannot be hidden or overwritten.
*
* `GOOGLE_PIPELINE_FAILED` will be set to "1" if the pipeline failed because an action has exited
* with a non-zero status (and did not have the `IGNORE_EXIT_STATUS` flag set). This can be used
* to determine if additional debug or logging actions should execute.
*
* `GOOGLE_LAST_EXIT_STATUS` will be set to the exit status of the last non-background action that
* executed. This can be used by workflow engine authors to determine whether an individual action
* has succeeded or failed.
* @param environment environment or {@code null} for none
*/
public Action setEnvironment(java.util.Map<String, java.lang.String> environment) {
this.environment = environment;
return this;
}
/**
* Normally, a non-zero exit status causes the pipeline to fail. This flag allows execution of
* other actions to continue instead.
* @return value or {@code null} for none
*/
public java.lang.Boolean getIgnoreExitStatus() {
return ignoreExitStatus;
}
/**
* Normally, a non-zero exit status causes the pipeline to fail. This flag allows execution of
* other actions to continue instead.
* @param ignoreExitStatus ignoreExitStatus or {@code null} for none
*/
public Action setIgnoreExitStatus(java.lang.Boolean ignoreExitStatus) {
this.ignoreExitStatus = ignoreExitStatus;
return this;
}
/**
* Required. The URI to pull the container image from. Note that all images referenced by actions
* in the pipeline are pulled before the first action runs. If multiple actions reference the same
* image, it is only pulled once, ensuring that the same image is used for all actions in a single
* pipeline.
*
* The image URI can be either a complete host and image specification (e.g.,
* quay.io/biocontainers/samtools), a library and image name (e.g., google/cloud-sdk) or a bare
* image name ('bash') to pull from the default library. No schema is required in any of these
* cases.
*
* If the specified image is not public, the service account specified for the Virtual Machine
* must have access to pull the images from GCR, or appropriate credentials must be specified in
* the google.cloud.lifesciences.v2beta.Action.credentials field.
* @return value or {@code null} for none
*/
public java.lang.String getImageUri() {
return imageUri;
}
/**
* Required. The URI to pull the container image from. Note that all images referenced by actions
* in the pipeline are pulled before the first action runs. If multiple actions reference the same
* image, it is only pulled once, ensuring that the same image is used for all actions in a single
* pipeline.
*
* The image URI can be either a complete host and image specification (e.g.,
* quay.io/biocontainers/samtools), a library and image name (e.g., google/cloud-sdk) or a bare
* image name ('bash') to pull from the default library. No schema is required in any of these
* cases.
*
* If the specified image is not public, the service account specified for the Virtual Machine
* must have access to pull the images from GCR, or appropriate credentials must be specified in
* the google.cloud.lifesciences.v2beta.Action.credentials field.
* @param imageUri imageUri or {@code null} for none
*/
public Action setImageUri(java.lang.String imageUri) {
this.imageUri = imageUri;
return this;
}
/**
* Labels to associate with the action. This field is provided to assist workflow engine authors
* in identifying actions (for example, to indicate what sort of action they perform, such as
* localization or debugging). They are returned in the operation metadata, but are otherwise
* ignored.
* @return value or {@code null} for none
*/
public java.util.Map<String, java.lang.String> getLabels() {
return labels;
}
/**
* Labels to associate with the action. This field is provided to assist workflow engine authors
* in identifying actions (for example, to indicate what sort of action they perform, such as
* localization or debugging). They are returned in the operation metadata, but are otherwise
* ignored.
* @param labels labels or {@code null} for none
*/
public Action setLabels(java.util.Map<String, java.lang.String> labels) {
this.labels = labels;
return this;
}
/**
* A list of mounts to make available to the action.
*
* In addition to the values specified here, every action has a special virtual disk mounted under
* `/google` that contains log files and other operational components.
*
* /google/logs All logs written during the pipeline execution. /google/logs/output The
* combined standard output and standard error of all actions run as part of the pipeline
* execution. /google/logs/action/stdout The complete contents of each individual action's
* standard output. /google/logs/action/stderr The complete contents of each individual
* action's standard error output.
* @return value or {@code null} for none
*/
public java.util.List<Mount> getMounts() {
return mounts;
}
/**
* A list of mounts to make available to the action.
*
* In addition to the values specified here, every action has a special virtual disk mounted under
* `/google` that contains log files and other operational components.
*
* /google/logs All logs written during the pipeline execution. /google/logs/output The
* combined standard output and standard error of all actions run as part of the pipeline
* execution. /google/logs/action/stdout The complete contents of each individual action's
* standard output. /google/logs/action/stderr The complete contents of each individual
* action's standard error output.
* @param mounts mounts or {@code null} for none
*/
public Action setMounts(java.util.List<Mount> mounts) {
this.mounts = mounts;
return this;
}
/**
* An optional identifier for a PID namespace to run the action inside. Multiple actions should
* use the same string to share a namespace. If unspecified, a separate isolated namespace is
* used.
* @return value or {@code null} for none
*/
public java.lang.String getPidNamespace() {
return pidNamespace;
}
/**
* An optional identifier for a PID namespace to run the action inside. Multiple actions should
* use the same string to share a namespace. If unspecified, a separate isolated namespace is
* used.
* @param pidNamespace pidNamespace or {@code null} for none
*/
public Action setPidNamespace(java.lang.String pidNamespace) {
this.pidNamespace = pidNamespace;
return this;
}
/**
* A map of containers to host port mappings for this container. If the container already
* specifies exposed ports, use the `PUBLISH_EXPOSED_PORTS` flag instead.
*
* The host port number must be less than 65536. If it is zero, an unused random port is assigned.
* To determine the resulting port number, consult the `ContainerStartedEvent` in the operation
* metadata.
* @return value or {@code null} for none
*/
public java.util.Map<String, java.lang.Integer> getPortMappings() {
return portMappings;
}
/**
* A map of containers to host port mappings for this container. If the container already
* specifies exposed ports, use the `PUBLISH_EXPOSED_PORTS` flag instead.
*
* The host port number must be less than 65536. If it is zero, an unused random port is assigned.
* To determine the resulting port number, consult the `ContainerStartedEvent` in the operation
* metadata.
* @param portMappings portMappings or {@code null} for none
*/
public Action setPortMappings(java.util.Map<String, java.lang.Integer> portMappings) {
this.portMappings = portMappings;
return this;
}
/**
* Exposes all ports specified by `EXPOSE` statements in the container. To discover the host side
* port numbers, consult the `ACTION_STARTED` event in the operation metadata.
* @return value or {@code null} for none
*/
public java.lang.Boolean getPublishExposedPorts() {
return publishExposedPorts;
}
/**
* Exposes all ports specified by `EXPOSE` statements in the container. To discover the host side
* port numbers, consult the `ACTION_STARTED` event in the operation metadata.
* @param publishExposedPorts publishExposedPorts or {@code null} for none
*/
public Action setPublishExposedPorts(java.lang.Boolean publishExposedPorts) {
this.publishExposedPorts = publishExposedPorts;
return this;
}
/**
* This flag allows an action to continue running in the background while executing subsequent
* actions. This is useful to provide services to other actions (or to provide debugging support
* tools like SSH servers).
* @return value or {@code null} for none
*/
public java.lang.Boolean getRunInBackground() {
return runInBackground;
}
/**
* This flag allows an action to continue running in the background while executing subsequent
* actions. This is useful to provide services to other actions (or to provide debugging support
* tools like SSH servers).
* @param runInBackground runInBackground or {@code null} for none
*/
public Action setRunInBackground(java.lang.Boolean runInBackground) {
this.runInBackground = runInBackground;
return this;
}
/**
* The maximum amount of time to give the action to complete. If the action fails to complete
* before the timeout, it will be terminated and the exit status will be non-zero. The pipeline
* will continue or terminate based on the rules defined by the `ALWAYS_RUN` and
* `IGNORE_EXIT_STATUS` flags.
* @return value or {@code null} for none
*/
public String getTimeout() {
return timeout;
}
/**
* The maximum amount of time to give the action to complete. If the action fails to complete
* before the timeout, it will be terminated and the exit status will be non-zero. The pipeline
* will continue or terminate based on the rules defined by the `ALWAYS_RUN` and
* `IGNORE_EXIT_STATUS` flags.
* @param timeout timeout or {@code null} for none
*/
public Action setTimeout(String timeout) {
this.timeout = timeout;
return this;
}
@Override
public Action set(String fieldName, Object value) {
return (Action) super.set(fieldName, value);
}
@Override
public Action clone() {
return (Action) super.clone();
}
}
| [
"chingor@google.com"
] | chingor@google.com |
5e2841f58b64e404dec496e6ec237854acb7c572 | 834fa8ceb988a6e0e198d2da90fa5e23632202e6 | /src/Chapter7/Test5/A.java | 27f95f116ef2cf28826b3193f8f73e2c0346b399 | [] | no_license | EamonYin/Thinking-in-Java-Exercise | 70a1f72cea8f7aa090268e31c8ec3515d25ccddc | a2c89c969b867e713cefd90bf2098097b2df5fdc | refs/heads/master | 2022-12-28T13:58:40.580967 | 2020-10-07T00:19:51 | 2020-10-07T00:19:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 178 | java | package Chapter7.Test5;
/**
* @author:YiMing
* @create:2020/7/16,21:11
* @version:1.0
*/
public class A{
public A() {
System.out.println("这里是A");
}
}
| [
"l"
] | l |
732cf63e07350946d8c9067ca4652a8c9726fe9a | c41a04532c783912e249f43014e5fbef78ff8db3 | /.svn/pristine/a2/a20ff6d47a40a1a79569af792fd10e19c58bb248.svn-base | bf3afb9b301b4de1cbf6feb639076b157d16fa22 | [] | no_license | xeon-ye/jk-kq | 1916fafa9ef5a71bd7ab80f60c54e0883c745669 | 10bc74295d556e6587994e6978717b1f2ecd9833 | refs/heads/master | 2023-04-20T00:02:08.540545 | 2020-07-13T01:35:38 | 2020-07-13T01:35:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 976 | package com.jk.websocket.config;
import com.jk.websocket.handler.TestHandler;
import com.jk.websocket.interceptor.WebSocketInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.config.annotation.EnableWebSocket;
import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;
/**
* WebSocket配置器
*
* @author 缪隽峰
* @version 1.0
* @date 2018年07月18日
*/
@Configuration
@EnableWebSocket
public class WebSocketConfig implements WebSocketConfigurer {
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
//handler是webSocket的核心,配置入口
registry.addHandler(new TestHandler(), "/ws/testHandle")
//允许跨域
.setAllowedOrigins("*")
.addInterceptors(new WebSocketInterceptor());
}
}
| [
"814883929@qq.com"
] | 814883929@qq.com | |
44858fa4f488e680c7f434b12c582423e5574fdc | 3a1e38e221b16c1b960cebce53380f7d1ec59eb3 | /opensrp-common/src/main/java/org/opensrp/common/util/OpenMRSCrossVariables.java | 0f20f12bc395dc124ea346983b3a8c3fd71930a6 | [
"Apache-2.0"
] | permissive | BlueCodeSystems/opensrp-server | 9669899e962c313a0c8020db476bc048eef51873 | 1dab6c848ece7b6b51e57bea4fe489fc4e652f56 | refs/heads/master | 2022-12-15T22:24:54.133178 | 2020-09-17T16:04:24 | 2020-09-17T16:04:24 | 278,347,554 | 0 | 0 | NOASSERTION | 2020-07-23T22:11:54 | 2020-07-09T11:36:56 | Java | UTF-8 | Java | false | false | 549 | java | package org.opensrp.common.util;
public enum OpenMRSCrossVariables {
TEAM_MEMBER_URL {
public String makeVariable(String openMRSVersion) {
if (openMRSVersion.startsWith("1")) {
return "ws/rest/v1/teammodule/member";
} else {
return "ws/rest/v1/team/teammember";
}
}
},
LOCATIONS_JSON_KEY {
public String makeVariable(String openMRSVersion) {
if (openMRSVersion.startsWith("1")) {
return "location";
} else {
return "locations";
}
}
};
public abstract String makeVariable(String openMRSVersion);
}
| [
"manutarus@gmail.com"
] | manutarus@gmail.com |
b84515e07b9d7357ea3dd7ca16c1f017f4da713b | 8ade39a1dc7dc16beeb44ad9b2f6fdeec33f1f2f | /src/pdfsamp/consultas.java | 61b27e08e987b806cb78306e7de90d6df8aa1e57 | [] | no_license | andreandyp/PdfSAMP | 522cc3e42f3f3484f6d14841d1a8a456a87beb8b | 210d66005758de1266a742e91a3f9ed7729287cd | refs/heads/master | 2020-05-19T07:59:48.867597 | 2015-04-09T23:20:12 | 2015-04-09T23:20:12 | 33,697,581 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,150 | java | package pdfsamp;
import com.itextpdf.text.BaseColor;
import com.itextpdf.text.Document;
import com.itextpdf.text.DocumentException;
import com.itextpdf.text.Element;
import com.itextpdf.text.Font;
import com.itextpdf.text.Image;
import com.itextpdf.text.Phrase;
import com.itextpdf.text.Rectangle;
import com.itextpdf.text.html.WebColors;
import com.itextpdf.text.pdf.PdfContentByte;
import com.itextpdf.text.pdf.PdfFormField;
import com.itextpdf.text.pdf.PdfPCell;
import com.itextpdf.text.pdf.PdfPCellEvent;
import com.itextpdf.text.pdf.PdfPTable;
import com.itextpdf.text.pdf.PdfWriter;
import com.itextpdf.text.pdf.TextField;
import java.awt.Desktop;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.text.DateFormat;
import java.util.Date;
public class consultas implements PdfPCellEvent {
public static byte[] OWNER = "ClavePrivada127".getBytes();
final BaseColor vimss = WebColors.getRGBColor("#228B22");
final BaseColor form = WebColors.getRGBColor("#87CEEB");
Date now = new Date();
DateFormat df = DateFormat.getDateInstance(DateFormat.FULL);
protected int tf;
Font boldfont = new Font(Font.FontFamily.HELVETICA, 12, Font.BOLD);
int i = 1;
public consultas(int tf) {
this.tf = tf;
}
public void createPdf(String filename) throws DocumentException, IOException {
Image im = Image.getInstance(new File("").getAbsolutePath()+"\\imss.jpg");
Document document = new Document();
PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(filename));
writer.setEncryption(null, OWNER, PdfWriter.ALLOW_FILL_IN, PdfWriter.STANDARD_ENCRYPTION_128);
writer.createXmpMetadata();
document.open();
PdfPCell cell;
PdfPTable table = new PdfPTable(6);
table.setTotalWidth(550);
table.setLockedWidth(true);
table.addCell(im);
cell = new PdfPCell(new Phrase("Instituto Mexicano Del Seguro Social"
+ "\nDelegacion Michoacan"
+ "\nJefatura de Prestaciones Economicas y Sociales", boldfont));
cell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
cell.setColspan(5);
table.addCell(cell);
cell = new PdfPCell(new Phrase("Documento de Eleccion de Regimen (DER)"
+ "\nInvalidez y Vida",boldfont));
cell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
cell.setColspan(6);
table.addCell(cell);
cell = new PdfPCell(new Phrase("Estimado Derechohabiente:\n" +
"De acuerdo con sus datos afiliatorios, usted tiene derecho a elegir entre los regímenes pensionarios de Ley 73 (pensión pagada por el IMSS) y\n" +
"Ley 97 (pensión pagada por una\n" +
"En ambos casos, el monto de su pensión se actualizará en el mes de febrero, en la misma proporción que la inflación presentada en el año\n" +
"inmediato anterior.\n" +
"Este documento le presenta las diferentes opciones de pensión a que tiene derecho, de las cuales deberá elegir sólo una. Antes de tomar su\n" +
"decisión se sugiere leer detenidamente y asegurarse de comprender cada una de las alternativas."));
cell.setColspan(6);
table.addCell(cell);
cell = new PdfPCell(new Phrase("Datos personales del asegurado",boldfont));
cell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
cell.setBackgroundColor(vimss);
cell.setColspan(6);
table.addCell(cell);
cell = new PdfPCell(new Phrase("Nombre completo del Afiliado"));
cell.setColspan(3);
table.addCell(cell);
cell = new PdfPCell();
cell.setColspan(3);
cell.setCellEvent(new consultas(i));
table.addCell(cell);
cell = new PdfPCell(new Phrase("No. Folio"));
cell.setColspan(3);
table.addCell(cell);
cell = new PdfPCell();
cell.setCellEvent(new consultas(++i));
cell.setColspan(3);
table.addCell(cell);
cell = new PdfPCell(new Phrase("Nombre del solicitante"));
cell.setColspan(3);
table.addCell(cell);
cell = new PdfPCell();
cell.setColspan(3);
cell.setCellEvent(new consultas(++i));
table.addCell(cell);
cell = new PdfPCell(new Phrase("C.U.R.P."));
cell.setColspan(3);
table.addCell(cell);
cell = new PdfPCell();
cell.setColspan(3);
cell.setCellEvent(new consultas(++i));
table.addCell(cell);
cell = new PdfPCell(new Phrase("Numero de Seguridad Social"));
cell.setColspan(3);
table.addCell(cell);
cell = new PdfPCell();
cell.setColspan(3);
cell.setCellEvent(new consultas(++i));
table.addCell(cell);
cell = new PdfPCell(new Phrase("Pension"));
cell.setColspan(3);
table.addCell(cell);
cell = new PdfPCell();
cell.setColspan(3);
cell.setCellEvent(new consultas(++i));
table.addCell(cell);
cell = new PdfPCell(new Phrase("Pensión",boldfont));
cell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
cell.setBackgroundColor(vimss);
cell.setColspan(6);
table.addCell(cell);
cell = new PdfPCell(new Phrase("Institucion que paga la pension"));
cell.setColspan(3);
table.addCell(cell);
cell = new PdfPCell();
cell.setColspan(3);
cell.setCellEvent(new consultas(++i));
table.addCell(cell);
cell = new PdfPCell(new Phrase("Pension mensual total**"));
cell.setColspan(3);
table.addCell(cell);
cell = new PdfPCell();
cell.setCellEvent(new consultas(++i));
cell.setColspan(3);
table.addCell(cell);
cell = new PdfPCell(new Phrase("Aguinaldo anual"));
cell.setColspan(3);
table.addCell(cell);
cell = new PdfPCell();
cell.setColspan(3);
cell.setCellEvent(new consultas(++i));
table.addCell(cell);
cell = new PdfPCell(new Phrase("Importe a retirar de la AFORE*"));
cell.setColspan(3);
table.addCell(cell);
cell = new PdfPCell();
cell.setColspan(3);
cell.setCellEvent(new consultas(++i));
table.addCell(cell);
cell = new PdfPCell(new Phrase("* Las cantidades reportadas pueden variar por tratarse de saldos preliminares incluye las subcuentas de SAR 92 y Vivienda 92. En caso de régimen por\n" +
"Ley 73 incluye además las subcuentas de Retiro y Vivienda 97.\n" +
"** Los cálculos se presentan a la fecha de generación de este documento, habiéndose considerado los incrementos del Índice Nacional de Precios al\n" +
"Consumidor (INPC), en caso de ser procedente.\n" +
"***En caso de elegir Régimen 97, podrá tener un beneficio adicional único de hasta $9000, si eligiera la Aseguradora que fuera la mejor opción."));
cell.setColspan(6);
table.addCell(cell);
cell = new PdfPCell(new Phrase("Documento solo para uso informativo"));
cell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
cell.setBackgroundColor(vimss);
cell.setColspan(6);
table.addCell(cell);
document.add(table);
document.close();
}
@Override
public void cellLayout(PdfPCell cell, Rectangle rectangle, PdfContentByte[] canvases) {
PdfWriter writer = canvases[0].getPdfWriter();
TextField text = new TextField(writer, rectangle,String.format("text_%s", tf));
text.setAlignment(Element.ALIGN_LEFT);
try {PdfFormField field = text.getTextField();
writer.addAnnotation(field);}
catch(IOException | DocumentException e) {System.out.println(e.getMessage());}
}
public void abrirarchivo(String archivo){
try{
File objetofile = new File (archivo);
Desktop.getDesktop().open(objetofile);
}
catch (IOException ex){
System.out.println(ex.getMessage());
}
}
} | [
"andreandyp@outlook.com"
] | andreandyp@outlook.com |
7259005c4ddcacf7c6f5caabadd3aa85b8a051ba | 4c424dc0784baa92ceeda19a4ee9c512b075b6df | /a5/src/main/java/com/textar/a5/A5Application.java | cc83ccfff37d30f4c70eacfb1ebc0b334e45d999 | [] | no_license | symeteor/IdeaTest | 79cace5a9c4cbb60af75d80843c3da0aab34faff | e16655d811fbe997cefb2efdc1101659ef6c9fd7 | refs/heads/master | 2020-09-26T17:07:52.338111 | 2019-12-06T10:31:16 | 2019-12-06T10:31:16 | 226,268,112 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 901 | java | package com.textar.a5;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.stereotype.Repository;
@SpringBootApplication(scanBasePackages= {"com.textar"})
//@EnableJpaRepositories(basePackages="com.textar.dao")
@EntityScan(basePackages="com.textar.pojo")
@MapperScan(basePackages="com.textar",annotationClass= Repository.class)
//@MapperScan(basePackages="com.textar.*")
public class A5Application {
public static void main(String[] args) {
SpringApplication.run(A5Application.class, args);
}
@Autowired
SqlSessionFactory sqlSessionFactory = null;
}
| [
"textar@163.com"
] | textar@163.com |
88da5d96d1136d37e70cf36e9612ab809a9d37db | 5e82f6e021ebd9a4e4f9abfef7cc96cc95e59fcb | /src/main/java/project/concurrency/barbershop/Barbershop.java | a2ac02d9c58931029ef2c244cdb639d2299a4db7 | [] | no_license | Nemiarouski/SmallThings | bc105ba3ccdd0f23b2143984ed7ccd36abc231df | 1e99ddf5c3449f84be556b32276bbe3969ddabff | refs/heads/master | 2023-06-23T20:12:29.382513 | 2021-07-23T15:29:20 | 2021-07-23T15:29:20 | 388,838,574 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 771 | java | package project.concurrency.barbershop;
import java.util.concurrent.ConcurrentLinkedQueue;
public class Barbershop {
private final ConcurrentLinkedQueue<Client> clients = new ConcurrentLinkedQueue<>();
public void addClient(Client client) {
synchronized (clients) {
clients.add(client);
clients.notify();
}
}
public Client getClient() {
synchronized (clients) {
while (clients.isEmpty()) {
try {
clients.wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
Client client = clients.poll();
clients.notify();
return client;
}
}
}
| [
"nemiarouskipetr@gmail.com"
] | nemiarouskipetr@gmail.com |
480bd0a1751ece02aac2b9ad49b415f7a7c2ac07 | a96ce2d9214838bf145a971df874304e3f8c4913 | /oes-common/oes-common-netty-websocket-starter/src/main/java/com/oes/common/netty/websocket/starter/annotation/PathVariable.java | a492d3beae7ecc7a4d285a1af614df3b5f667496 | [
"Apache-2.0"
] | permissive | YunShiTiger/OES-Cloud-Testing-Platform | 3f22dfa4621907c009894d81e7b2d5a2e5e3a0ef | 19205107db6d74e5f8a521ec041799ee51ce2765 | refs/heads/master | 2023-03-06T10:21:47.850862 | 2020-11-06T02:20:40 | 2020-11-06T02:20:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 579 | java | package com.oes.common.netty.websocket.starter.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.core.annotation.AliasFor;
@Target(ElementType.PARAMETER)
@Retention(RetentionPolicy.RUNTIME)
public @interface PathVariable {
/**
* Alias for {@link #name}.
*/
@AliasFor("name")
String value() default "";
/**
* The name of the path variable to bind to.
*/
@AliasFor("value")
String name() default "";
}
| [
"chenyuexin1998@gmail.com"
] | chenyuexin1998@gmail.com |
90b73cfab562f460113fcd411a978e260af6e479 | 1ed347053287cbbf45f61cca0643d239c4cd1da8 | /src/com/ms509/ui/AboutDialog.java | 9cf206ca9d56d8c7f9a21de609116046b8f5a9a5 | [] | no_license | aStrowxyu/Cknife | 316a70d315d8a7707c9c60b712bf103ff859804a | a13eb2d6e37d36ae0376c75e1852f4c95d7bb3a1 | refs/heads/master | 2020-04-08T01:29:09.592494 | 2018-11-24T03:00:10 | 2018-11-24T03:00:10 | 158,897,102 | 2 | 2 | null | null | null | null | UTF-8 | Java | false | false | 2,881 | java | package com.ms509.ui;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Desktop;
import java.awt.Dialog;
import java.awt.GridBagLayout;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.net.URI;
import javax.swing.*;
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener;
import com.ms509.util.GBC;
public class AboutDialog extends JDialog {
private JPanel about_pane;
private JLabel img_label;
private JEditorPane about_info;
private Icon icon;
public AboutDialog() {
super(MainFrame.main, "添加shell", true);
this.setComponent();
// 初始化布局和控件
this.setVisible(true);
}
private void setComponent() {
about_pane = new JPanel();
about_pane.setLayout(new GridBagLayout());
about_pane.setOpaque(true);
about_pane.setBackground(Color.white);
GBC gbclogo = new GBC(0, 0, 1, 1).setFill(GBC.BOTH).setInsets(0, 0, 0, 0);
GBC gbccontent1 = new GBC(1, 0, 1, 1).setFill(GBC.BOTH).setWeight(1, 1).setInsets(20, 0, 0, 0);
// img
img_label = new JLabel();
try {
icon = new ImageIcon(getClass().getResource("/com/ms509/images/logo.png"));
} catch (Exception e1) {
e1.printStackTrace();
}
img_label.setSize(50, 50);
img_label.setBackground(Color.white);
img_label.setIcon(icon);
img_label.setOpaque(true);
// text
JEditorPane about_info = new JEditorPane();
about_info.setEditable(false);
about_info.setContentType("text/html");
String copy = "<html><body><div><h3 style=\"text-align:center;\">Copyright(c) 2015-2016 MS509 Team</h3></div>"
+ "<div style=\"font-size:10px;text-align:center;\">主页:<a href=\"http://www.ms509.com\">http://www.ms509.com</a></div>"
+ "<br \\><div style=\"font-size:10px;\">免责声明:本工具仅限于安全研究与教学使用,用户使用本工具所造成的所有后果,由用户承担全部法律及连带责任!作者不承担任何法律及连带责任。</div><div></div>"
+ "<div style=\"text-align:right;font-size:9px;\">Powered by Chora & MelodyZX </div>"
+ "</body></html>";
about_info.setText(copy.toString());
// 超链接事件
about_info.addHyperlinkListener(new HyperlinkListener() {
@Override
public void hyperlinkUpdate(HyperlinkEvent e) {
// TODO Auto-generated method stub
if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
try {
Desktop.getDesktop().browse(new URI("http://www.ms509.com"));
} catch (Exception e1) {
e1.printStackTrace();
}
}
}
});
about_info.setOpaque(false);
about_info.setBackground(Color.white);
about_pane.add(about_info, gbccontent1);
about_pane.add(img_label, gbclogo);
this.add(about_pane);
this.setSize(400, 250);
this.setResizable(false);
this.setTitle("关于 Cknife");
this.setLocationRelativeTo(MainFrame.main);
}
}
| [
"772958823@qq.com"
] | 772958823@qq.com |
a931affaaeca154de56dc6049265494d0317808c | 79b27adebdfedc907b448d0020d1822bfd97615a | /4-Mazzika/app/src/main/java/com/example/mazzika/Activities/SplashScreenActivity.java | fa85ad35a38887c634d4e21e1b8d311a353364ef | [] | no_license | Kareem100/ANDB-Projects | e15b29e635f8e6a99c682b44a6572a61c80e9fd8 | 7be066481c126a86b15bc994c20d9d65d15b242a | refs/heads/main | 2023-04-29T13:59:31.605813 | 2021-05-02T20:31:39 | 2021-05-02T20:31:39 | 331,135,440 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 791 | java | package com.example.mazzika.Activities;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import com.example.mazzika.R;
public class SplashScreenActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash_screen);
final Handler handler = new Handler(Looper.getMainLooper());
handler.postDelayed(new Runnable() {
@Override
public void run() {
startActivity(new Intent(SplashScreenActivity.this, MainActivity.class));
finish();
}
}, 500);
}
} | [
"kareimshreif210@yahoo.com"
] | kareimshreif210@yahoo.com |
9bed0982dc9e6decb7e99689202c8af6f0e92e4f | 9c4427d32ca222505725b8f491068e4864450f8e | /BackEnd/Project_A405/src/main/java/com/web/project/model/BasicResponse.java | 8b9f7a1cb7d8cb3da64e4ef6b9c178b59cc141cf | [] | no_license | KwonYI/WieV | 09a2ecb9a35942e19ef4150de40ccc09a9287799 | 8e09ea040f9b4f022a845395d1bfa05984ce9c25 | refs/heads/master | 2023-07-09T12:34:55.480876 | 2021-08-17T08:45:24 | 2021-08-17T08:45:24 | 340,286,619 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 349 | java | package com.web.project.model;
import io.swagger.annotations.ApiModelProperty;
public class BasicResponse {
@ApiModelProperty(value = "status", position = 1)
public boolean status;
@ApiModelProperty(value = "data", position = 2)
public String data;
@ApiModelProperty(value = "object", position = 3)
public Object object;
}
| [
"wjd1rb@gmail.com"
] | wjd1rb@gmail.com |
b50120867bfd820fd55c5890dde1f365b709d875 | 20a82870c98dc0339e294380a44b64d10b08473c | /src/test/java/ru/alexsumin/spring5recipeapp/controllers/ImageControllerTest.java | 4868b3f90f9516151ddc0e8829783aef329d3775 | [] | no_license | alexsumin/spring5-recipe-app | 1c32962433e277ad07550dfeea48e6bf6fe14e5f | 48e6ca26f4db2903d6f8f053515e9f577c0f9b5d | refs/heads/master | 2020-03-17T19:17:10.628110 | 2018-06-02T21:43:23 | 2018-06-02T21:43:23 | 133,853,346 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,530 | java | package ru.alexsumin.spring5recipeapp.controllers;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import ru.alexsumin.spring5recipeapp.commands.RecipeCommand;
import ru.alexsumin.spring5recipeapp.services.ImageService;
import ru.alexsumin.spring5recipeapp.services.RecipeService;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.*;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.multipart;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
public class ImageControllerTest {
@Mock
ImageService imageService;
@Mock
RecipeService recipeService;
ImageController controller;
MockMvc mockMvc;
@Before
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
controller = new ImageController(imageService, recipeService);
mockMvc = MockMvcBuilders.standaloneSetup(controller)
.setControllerAdvice(new ControllerExceptionHandler())
.build();
}
@Test
public void getImageForm() throws Exception {
//given
RecipeCommand command = new RecipeCommand();
command.setId(1L);
when(recipeService.findCommandById(anyLong())).thenReturn(command);
//when
mockMvc.perform(get("/recipe/1/image"))
.andExpect(status().isOk())
.andExpect(model().attributeExists("recipe"));
verify(recipeService, times(1)).findCommandById(anyLong());
}
@Test
public void handleImagePost() throws Exception {
MockMultipartFile multipartFile =
new MockMultipartFile("imagefile", "testing.txt", "text/plain",
"Spring Framework Guru".getBytes());
mockMvc.perform(multipart("/recipe/1/image").file(multipartFile))
.andExpect(status().is3xxRedirection())
.andExpect(header().string("Location", "/recipe/1/show"));
verify(imageService, times(1)).saveImageFile(anyLong(), any());
}
@Test
public void renderImageFromDB() throws Exception {
//given
RecipeCommand command = new RecipeCommand();
command.setId(1L);
String s = "fake image text";
Byte[] bytesBoxed = new Byte[s.getBytes().length];
int i = 0;
for (byte primByte : s.getBytes()) {
bytesBoxed[i++] = primByte;
}
command.setImage(bytesBoxed);
when(recipeService.findCommandById(anyLong())).thenReturn(command);
//when
MockHttpServletResponse response = mockMvc.perform(get("/recipe/1/recipeimage"))
.andExpect(status().isOk())
.andReturn().getResponse();
byte[] reponseBytes = response.getContentAsByteArray();
assertEquals(s.getBytes().length, reponseBytes.length);
}
@Test
public void testGetImageNumberFormatException() throws Exception {
mockMvc.perform(get("/recipe/asdf/recipeimage"))
.andExpect(status().isBadRequest())
.andExpect(view().name("400error"));
}
} | [
"alexandr.sumin@gmail.com"
] | alexandr.sumin@gmail.com |
04ed0ce04b83cfe3b4406533eef91a492ad13b4d | c1c62961cb09bcf96946ada7a632d40a6e532543 | /src/main/java/se/kth/bbc/jobs/spark/SparkJob.java | a0eacc7896ce2607be764b7834ee6b225c07c7a3 | [
"Apache-2.0"
] | permissive | stigviaene/hopsworksBackend | 502a9567681ca3209f941af71e5dedd2c2dc86d9 | 441af052b2c07c665bab622a1d3e173d74dac50c | refs/heads/master | 2021-01-16T20:42:04.657468 | 2015-06-09T16:41:23 | 2015-06-09T16:41:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,558 | java | package se.kth.bbc.jobs.spark;
import java.util.logging.Logger;
import se.kth.bbc.fileoperations.FileOperations;
import se.kth.bbc.jobs.HopsJob;
import se.kth.bbc.jobs.jobhistory.JobHistory;
import se.kth.bbc.jobs.jobhistory.JobHistoryFacade;
import se.kth.bbc.jobs.yarn.YarnJob;
import se.kth.bbc.jobs.yarn.YarnRunner;
/**
* Orchestrates the execution of a Spark job: run job, update history
* object.
* <p>
* @author stig
*/
public final class SparkJob extends YarnJob {
private static final Logger logger = Logger.
getLogger(SparkJob.class.getName());
public SparkJob(JobHistoryFacade facade, YarnRunner runner,
FileOperations fops) {
super(facade, runner, fops);
}
@Override
public HopsJob getInstance(JobHistory jh) throws IllegalArgumentException {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
protected void runJobInternal() {
//Update job history object
super.updateArgs();
//Keep track of time and start job
long startTime = System.currentTimeMillis();
//Try to start the AM
boolean proceed = super.startJob();
//If success: monitor running job
if (!proceed) {
return;
}
proceed = super.monitor();
//If not ok: return
if (!proceed) {
return;
}
super.copyLogs();
long endTime = System.currentTimeMillis();
long duration = endTime - startTime;
getJobHistoryFacade().update(getJobId(), getFinalState(), duration);
}
}
| [
"stigviaene@sics.se"
] | stigviaene@sics.se |
cd82e3f73cf0646484e8a5c2c0a93b7dfc349b07 | 24ac854e8168d9ec88e0e3ca74edc5efa824c0f9 | /src/main/java/com/zhuyuhua/myspring/dao/LogInfoDAO.java | 22d1e559e00927a1e139eef6d368025c880ae83c | [] | no_license | code-brewer/spring-study | 5af76a732cd7ea5d6c00c5373c8b9b9d0e060238 | 2d1b8209a2d5cc3ea1e4206e678a8d86531e068a | refs/heads/master | 2021-05-05T14:01:45.070172 | 2014-11-13T06:45:55 | 2014-11-13T06:45:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 150 | java | package com.zhuyuhua.myspring.dao;
import com.zhuyuhua.myspring.model.LogInfo;
public interface LogInfoDAO {
public void save(LogInfo logInfo);
}
| [
"zhu.yuhua@qq.com"
] | zhu.yuhua@qq.com |
52eb96ffa788ecef5c4f34c4f022bdc886211ac8 | cdf2e039bdb1e986e3de95371588d872c542197a | /src/main/java/br/com/pacdev/reader/CustomerRunnable.java | cca28a77f156fa8165a3537f8baabdb6833b26e7 | [
"Apache-2.0"
] | permissive | chagaspac/jseller | d2ad8a6d5f6a98cc830287c7d19152871f668b95 | 6b3ffc8b038b2a1f7103edf82c8e1ce0417e413c | refs/heads/master | 2021-01-21T11:45:19.316454 | 2016-05-31T21:20:41 | 2016-05-31T21:20:41 | 54,287,019 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,935 | java | package br.com.pacdev.reader;
import java.io.IOException;
import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.client.ClientProtocolException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import br.com.pacdev.exception.UrlNotFoundException;
import br.com.pacdev.object.customer.Address;
import br.com.pacdev.object.customer.Customer;
import br.com.pacdev.object.customer.Phone;
import br.com.pacdev.util.HttpUtils;
import br.com.pacdev.util.XmlUtils;
public class CustomerRunnable implements Runnable{
private String url = null;
private int max = 0;
private int timesTried = 0;
private final int MAX_TIMES = 5;
private String user=null;
private String password=null;
private String baseUrl=null;
private int index=0;
public CustomerRunnable(String url, int max, String user, String password, String baseUrl, int index) {
super();
this.url = url;
this.max = max;
this.user = user;
this.password = password;
this.baseUrl = baseUrl;
this.index = index;
}
@Override
public void run() {
Document d = null;
try {
d = HttpUtils.getInstance().getDocumentByURL(url,user,password,baseUrl);
if(d != null){
NodeList nl = XmlUtils.getInstance().getNodeListByXPath(d, "/customers/customer");
if(nl != null){
if(nl.getLength() != 100) System.out.println(url + " - QTY of Customers:"+nl.getLength());
for(int j=0; j<nl.getLength(); j++){
Customer c = this.getCustomerByElement((Element)nl.item(j));
BSellerReader.listCustomer[j+index] = c;
BSellerReader.actualNumberOfCustomersRead++;
}
}
}else{
System.err.println("Document Null");
}
BSellerReader.actualThreadNumber--;
BSellerReader.actualThreadCompletedNumber++;
} catch (ClientProtocolException e) {
if(e.getMessage().contains("404")){
System.out.println(url + " - " + e.getMessage() + " - Thread Finished");
BSellerReader.actualThreadNumber--;
BSellerReader.actualThreadCompletedNumber++;
}else{
System.out.println(url + " - " + e.getMessage() + " - Starting thread again");
run();
}
} catch (IOException e) {
if(e.getMessage().contains("404")){
System.out.println(url + " - " + e.getMessage() + " - Thread Finished");
BSellerReader.actualThreadNumber--;
BSellerReader.actualThreadCompletedNumber++;
}else{
System.out.println(url + " - " + e.getMessage() + " - Starting thread again");
run();
}
} catch (NullPointerException e) {
System.out.println(url + " - " + "Nullpointer: " + e.getMessage());
}
}
private Customer getCustomerByElement(Element e){
Customer c = new Customer();
c.setId(XmlUtils.getInstance().getStringByXPath(e, "id"));
c.setExternalId(XmlUtils.getInstance().getStringByXPath(e, "externalId"));
c.setGender(XmlUtils.getInstance().getStringByXPath(e, "gender"));
c.setBirthdate(XmlUtils.getInstance().getStringByXPath(e, "birthdate"));
c.setName(XmlUtils.getInstance().getStringByXPath(e, "name"));
c.setNick(XmlUtils.getInstance().getStringByXPath(e, "nick"));
c.setEmail(XmlUtils.getInstance().getStringByXPath(e, "email"));
c.setDocumentNumber(XmlUtils.getInstance().getStringByXPath(e, "documentNumber"));
c.setOptin(XmlUtils.getInstance().getStringByXPath(e, "optin"));
c.setComment(XmlUtils.getInstance().getStringByXPath(e, "comment"));
Phone phone = new Phone();
phone.setAreaCode(XmlUtils.getInstance().getStringByXPath(e, "phone/areaCode"));
phone.setNumber(XmlUtils.getInstance().getStringByXPath(e, "phone/number"));
c.setPhone(phone);
Phone cellPhone = new Phone();
cellPhone.setAreaCode(XmlUtils.getInstance().getStringByXPath(e, "cellPhone/areaCode"));
cellPhone.setNumber(XmlUtils.getInstance().getStringByXPath(e, "cellPhone/number"));
c.setCellPhone(cellPhone);
Phone commercialPhone = new Phone();
commercialPhone.setAreaCode(XmlUtils.getInstance().getStringByXPath(e, "commercialPhone/areaCode"));
commercialPhone.setNumber(XmlUtils.getInstance().getStringByXPath(e, "commercialPhone/number"));
c.setCommercialPhone(commercialPhone);
NodeList nlAddresses = XmlUtils.getInstance().getNodeListByXPath(e, "addresses/address");
List<Address> lAddress = new ArrayList<Address>();
for(int j=0; j<nlAddresses.getLength(); j++){
Element eAddress = (Element)nlAddresses.item(j);
Address a = new Address();
a.setContactName(XmlUtils.getInstance().getStringByXPath(eAddress, "contactName"));
a.setName(XmlUtils.getInstance().getStringByXPath(eAddress, "name"));
a.setStreet(XmlUtils.getInstance().getStringByXPath(eAddress, "street"));
a.setNumber(XmlUtils.getInstance().getStringByXPath(eAddress, "number"));
a.setNeighborhood(XmlUtils.getInstance().getStringByXPath(eAddress, "neighborhood"));
a.setComplement(XmlUtils.getInstance().getStringByXPath(eAddress, "complement"));
a.setCity(XmlUtils.getInstance().getStringByXPath(eAddress, "city"));
a.setState(XmlUtils.getInstance().getStringByXPath(eAddress, "state"));
a.setZipcode(XmlUtils.getInstance().getStringByXPath(eAddress, "zipcode"));
a.setReference(XmlUtils.getInstance().getStringByXPath(eAddress, "reference"));
a.setShipping(XmlUtils.getInstance().getStringByXPath(eAddress, "shipping"));
a.setBilling(XmlUtils.getInstance().getStringByXPath(eAddress, "billing"));
Phone aPhone = new Phone();
aPhone.setAreaCode(XmlUtils.getInstance().getStringByXPath(eAddress, "phone/areaCode"));
aPhone.setNumber(XmlUtils.getInstance().getStringByXPath(eAddress, "phone/number"));
a.setPhone(aPhone);
lAddress.add(a);
}
c.setAddresses(lAddress);
NodeList nlTags = XmlUtils.getInstance().getNodeListByXPath(e, "tags/tag");
List<String> lTag = new ArrayList<String>();
for(int j=0; j<nlTags.getLength(); j++){
lTag.add(nlTags.item(j).getTextContent());
}
c.setTags(lTag);
return c;
}
}
| [
"chagaspac@gmail.com"
] | chagaspac@gmail.com |
5e67f9de96ce8683620a6c90c5ca662c46548531 | 5ecc9d7e2b7b8958368db473d399560ac8dc5be2 | /src/test/java/CardsRetrieverTest.java | 409e64f1b5c1bd67ee3503ca9942061a68357035 | [] | no_license | HichamBI/anki | 4ff746c9292cf7cb75866c2cf9db37ba02374587 | 6befd85f01c6cbfdb52c9e7da48edf3ecbbcd5a8 | refs/heads/master | 2021-01-12T22:16:36.065206 | 2016-10-01T19:23:37 | 2016-10-01T19:23:37 | 59,955,516 | 0 | 0 | null | 2016-05-29T17:28:06 | 2016-05-29T17:28:05 | null | UTF-8 | Java | false | false | 1,010 | java | import card.Card;
import card.CardsRetriever;
import org.assertj.core.api.Assertions;
import org.junit.Before;
import org.junit.Test;
import java.io.File;
import java.net.URISyntaxException;
import java.util.LinkedList;
public class CardsRetrieverTest {
private CardsRetriever cardsRetriever;
@Before
public void setup() throws URISyntaxException {
File cardsInput = new File(getClass().getResource("cards.txt").toURI());
cardsRetriever = new CardsRetriever(cardsInput);
}
@Test
public void it_should_retrieve_cards_from_file() {
LinkedList<Card> cards = cardsRetriever.getCards();
Assertions.assertThat(cards).extracting("question").containsOnly(
"Who discovered magnetic field of electric current ?",
"Headquarters of Amnesty International is at",
"The first metal used by the man was");
Assertions.assertThat(cards).extracting("answer").containsOnly("Faraday", "London", "Copper");
}
} | [
"hicham.bouzidi@gmail.com"
] | hicham.bouzidi@gmail.com |
2489294b91af39fb85565f2319cdde593d20a47b | b630345d8ea89f1f68e61e54955b46404a9dc41e | /src/com/xwkj/form/domain/Feedback.java | 1f4540d3d23ddce21d7bac095466e35d41d75968 | [] | no_license | lm2343635/Form | f55b5b8d8d7cd7c85d0e18e199d8e7d7337ca5ef | 095303eb52d14335268a0e426449c05b2d226dc7 | refs/heads/master | 2021-05-01T11:54:53.755082 | 2016-06-13T14:33:37 | 2016-06-13T14:33:37 | 61,028,186 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,209 | java | package com.xwkj.form.domain;
import java.io.Serializable;
import java.util.Date;
public class Feedback implements Serializable {
private static final long serialVersionUID = 3786109151386805918L;
private String fid;
private String name;
private String telephone;
private String address;
private String device;
private String message;
private Date createDate;
public String getFid() {
return fid;
}
public void setFid(String fid) {
this.fid = fid;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getDevice() {
return device;
}
public void setDevice(String device) {
this.device = device;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}
| [
"lm2343635@126.com"
] | lm2343635@126.com |
9c8d3120054d114ae1bb0c786b58ea5db29f27e8 | 08ce6220feec9297036f37304598ee191223d740 | /src/main/java/ralph/baseball/controller/IndexController.java | d9262d282150d3b6e693360db47f880d420f124e | [] | no_license | JerryRalph/Baseball-app | 839b776a22b315196360db54c7f122e1bcfe45fe | adc8afe4bb85bb287d44d6569efc52dd151c396e | refs/heads/master | 2021-05-02T10:46:39.584808 | 2018-02-08T13:20:01 | 2018-02-08T13:20:01 | 120,763,736 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 368 | java | package ralph.baseball.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.view.RedirectView;
@Controller
@RequestMapping("/")
public class IndexController {
public RedirectView index() {
return new RedirectView("baseball");
}
}
| [
"ralph01@DESKTOP-LNT8O18.localdomain"
] | ralph01@DESKTOP-LNT8O18.localdomain |
60d96cdbac65b549c71cad62582e93737d327cc8 | 8a0c273a8580d386f91eaa7d212f93e6bd49e211 | /src/main/java/network/client/future/DefaultFuture.java | a30b8d4a4a4e265cdc797461d3e0c1e820e3554b | [
"MIT"
] | permissive | hbccdf/game-network | f0988ed600caaa0f7faf3e03706a512b8b9e7ce0 | cae21a5bbb983cae735d9d6e43bf70f814f65150 | refs/heads/master | 2022-11-27T18:40:16.645460 | 2020-08-04T08:30:20 | 2020-08-04T08:30:20 | 284,651,139 | 0 | 0 | MIT | 2020-08-03T08:59:16 | 2020-08-03T08:55:54 | Java | UTF-8 | Java | false | false | 769 | java | package network.client.future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
public class DefaultFuture extends BaseFuture<Boolean> {
private static final int DEFAULT_TIME_OUT = 10000;
private boolean result = false;
@Override
public Boolean get() throws InterruptedException {
try {
return get(DEFAULT_TIME_OUT, TimeUnit.MILLISECONDS);
} catch (TimeoutException e) {
}
return false;
}
@Override
public Boolean get(long timeout, TimeUnit unit) throws InterruptedException, TimeoutException {
wait(timeout, unit);
return result;
}
public void setResult(boolean result) {
this.result = result;
complete();
}
}
| [
"hbccdf@126.com"
] | hbccdf@126.com |
c2412c0d8bb3f3d884ca5bf744dd457ddab4ad42 | e881d5e30bab508b4aef1afe95e298287d85ab00 | /app/src/main/java/com/example/popularmoviesstage2/adapters/MovieListAdapter.java | 46638b6d643ffdaf1e42d85a117627b682935856 | [] | no_license | detri/PopularMoviesStage2 | 2f680acad6f8541f1a57b32aa1e725845650f363 | cfee78aa966bcf963a7e63f606190113ecd65452 | refs/heads/master | 2020-08-19T08:50:59.265159 | 2019-10-27T01:28:31 | 2019-10-27T01:28:31 | 215,900,545 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,987 | java | package com.example.popularmoviesstage2.adapters;
import android.content.Context;
import android.content.Intent;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.example.popularmoviesstage2.MovieDetailActivity;
import com.example.popularmoviesstage2.R;
import com.example.popularmoviesstage2.models.Movie;
import com.example.popularmoviesstage2.utils.NetworkUtils;
import com.squareup.picasso.Picasso;
import java.util.List;
public class MovieListAdapter extends RecyclerView.Adapter<MovieListAdapter.MovieItemViewHolder> {
private List<Movie> mDataset;
private final int deviceWidth;
public MovieListAdapter(List<Movie> movieList, Context context) {
mDataset = movieList;
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
deviceWidth = displayMetrics.widthPixels;
}
public static class MovieItemViewHolder extends RecyclerView.ViewHolder {
public ImageView movieThumbnail;
public MovieItemViewHolder(ImageView view) {
super(view);
movieThumbnail = view;
}
}
@NonNull
@Override
public MovieItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
ImageView view = (ImageView) LayoutInflater.from(parent.getContext()).inflate(R.layout.movie_list_item, parent, false);
return new MovieItemViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull final MovieItemViewHolder holder, int position) {
final Movie movie = mDataset.get(position);
String posterPath = movie.getPosterPath();
String fullPosterPath = NetworkUtils.getFullPosterPath(posterPath);
Picasso.get()
.load(fullPosterPath)
.error(R.drawable.ic_launcher_background)
.resize(deviceWidth / 2, deviceWidth / 2)
.centerCrop()
.into(holder.movieThumbnail);
holder.movieThumbnail.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Context mainContext = holder.movieThumbnail.getContext();
Intent movieDetailIntent = new Intent(mainContext, MovieDetailActivity.class);
movieDetailIntent.putExtra("movie_id", movie.getId());
mainContext.startActivity(movieDetailIntent);
}
});
}
@Override
public int getItemCount() {
if (mDataset == null) {
return 0;
}
return mDataset.size();
}
public void setMovies(List<Movie> movies) {
mDataset.clear();
mDataset.addAll(movies);
notifyDataSetChanged();
Log.d("Dataset", "Data set changed");
}
}
| [
"aaron.dosser@beam.dental"
] | aaron.dosser@beam.dental |
61096b33f8233224ebab20097b7cb52ebb785092 | 4acc59353736af3f7735247c120f7e38cde1454a | /src/by/pvt/hermanovich/coffeetrailer/entities/coffeepackages/EmptyPackage.java | 245fa85ddaca7ad54c46ae342c943cf24404f8be | [] | no_license | german-yauhen/CoffeeTrailerConsoleApplication | f6ea515f85eaf526801678e0993c2ac7d58f9547 | dac728326d441281ea16dfb77bf98ad51d0f2408 | refs/heads/master | 2020-12-02T23:57:43.083721 | 2017-07-03T10:46:01 | 2017-07-03T10:46:01 | 95,966,892 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,664 | java | /**
* EmptyPackage.
*
* Version 1.0
*
* 13.01.2017
*
* Copyright (c) 2017 Hermanovich Y. All rights reserved.
*/
package by.pvt.hermanovich.coffeetrailer.entities.coffeepackages;
/**
* This class describes an entity <b>EmptyPackage</b>. This class is a parent
* class and subscribes all characters and methods for objects extended from it.
*
* @author Hermanovich Y.
* @version 1.0
* @see Box
* @see Jar
* @see Parcel
*/
public abstract class EmptyPackage {
protected String kind;
protected double capacity;
protected double cost;
/**
* Creates new entity of the class <b>{@code Package}</b>
*/
public EmptyPackage() {
super();
}
/**
* Creates new entity (object) of class <b>{@code EmptyPackage}</b> with the
* following characters and initializes it. This constructor creates the empty
* coffee package.
*
* @param kind A kind of empty coffee package, Box, Jar or Parcel
* @param capacity A capacity of empty package depends on chosen quantity of coffee
* @param cost A cost of empty package depends on chosen kind of package capacity
*/
public EmptyPackage(String kind, double capacity, double cost) {
super();
this.kind = kind;
this.capacity = capacity;
this.cost = cost;
}
// Getters and Setters
public double getCapacity() {
return capacity;
}
public void setCapacity(double capacity) {
this.capacity = capacity;
}
public String getKind() {
return kind;
}
public void setKind(String type) {
this.kind = type;
}
public double getCost() {
return cost;
}
public void setCost(double cost) {
this.cost = cost;
}
public int hashCode() {
final int prime = 31;
int result = 1;
long temp;
temp = Double.doubleToLongBits(capacity);
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits(cost);
result = prime * result + (int) (temp ^ (temp >>> 32));
result = prime * result + ((kind == null) ? 0 : kind.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
EmptyPackage other = (EmptyPackage) obj;
if (Double.doubleToLongBits(capacity) != Double.doubleToLongBits(other.capacity))
return false;
if (Double.doubleToLongBits(cost) != Double.doubleToLongBits(other.cost))
return false;
if (kind == null) {
if (other.kind != null)
return false;
} else if (!kind.equals(other.kind))
return false;
return true;
}
public String toString() {
return " " + kind + " (cost " + String.format("%.2f", cost) + " byn, capacity " + capacity + "g)";
}
}
| [
"german.yauhen@gmail.com"
] | german.yauhen@gmail.com |
c65fc45c4aadbf331374ba4707e9209bc7bd3f4c | 9b967bdc934490333ba5d3ddd7ff05575f6ad0f5 | /fragments/src/androidTest/java/com/javierrodriguez/fragments/ApplicationTest.java | e6edc981bbe082317690d1f854f68f5a606fa44b | [] | no_license | jaroso78/cursoandrodi | 08affec5f26d125724a502f0c6771c74da470d63 | 89964d49101d5632212afaa96787f523626327d3 | refs/heads/master | 2021-01-10T19:32:43.042631 | 2015-05-20T10:55:05 | 2015-05-20T10:55:05 | 35,484,372 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 360 | java | package com.javierrodriguez.fragments;
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);
}
} | [
"jaroso78@yahoo.es"
] | jaroso78@yahoo.es |
70afed81acf99985cd986a423c18f2e815a87d27 | a3da918f3c18d9990778aa661d620ab61fb993c0 | /education/education-edu-handle/src/main/java/com/ssic/education/handle/service/impl/NutritionalServiceImpl.java | a6609344d0cbc92a44259b1aa99c29b96181ca97 | [] | no_license | jamyin/Ken-edu | 109bb0f47343849e7b398d3f2ad125e0698c43f4 | 3677ed2b2bbe2f72eb197e41af5d8afd06108f13 | refs/heads/master | 2021-01-17T20:36:06.404742 | 2016-06-22T08:23:39 | 2016-06-22T08:23:39 | 61,680,384 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,829 | java | package com.ssic.education.handle.service.impl;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ssic.educateion.common.dto.ProNutritionalDto;
import com.ssic.education.handle.dao.ProNutritionalDao;
import com.ssic.education.handle.pojo.ProNutritional;
import com.ssic.education.handle.service.INutritionalService;
import com.ssic.education.utils.util.BeanUtils;
/**
* @ClassName: NutritionalServiceImpl
* @Description: (这里用一句话描述这个类的作用)
* @author Ken Yin
* @date 2016年5月25日 上午10:41:28
*
*/
@Service
public class NutritionalServiceImpl implements INutritionalService {
protected static final Log logger = LogFactory.getLog(NutritionalServiceImpl.class);
@Autowired
private ProNutritionalDao proNutritionalDao;
@Override
public List<ProNutritionalDto> selectAllNutritional() {
List<ProNutritional> list = proNutritionalDao.selectAllNutritional();
List<ProNutritionalDto> dtoList = BeanUtils.createBeanListByTarget(list, ProNutritionalDto.class);
return dtoList;
}
@Override
public List<ProNutritionalDto> selectAllNutritionalUnit() {
List<ProNutritional> list = proNutritionalDao.selectAllNutritionalUnit();
List<ProNutritionalDto> dtoList = BeanUtils.createBeanListByTarget(list, ProNutritionalDto.class);
return dtoList;
}
@Override
public List<ProNutritionalDto> searchNutritional(List<String> packageIdList) {
List<ProNutritional> list = proNutritionalDao.searchNutritional(packageIdList);
List<ProNutritionalDto> dtoList = BeanUtils.createBeanListByTarget(list, ProNutritionalDto.class);
return dtoList;
}
}
| [
"mark_chu@ssic.cn"
] | mark_chu@ssic.cn |
c8fe878e96cae70a79ff10ae972c28e329f37a10 | 34f1eb7e458d64379eff85d8daea46d20e881047 | /app/src/main/java/com/rain/zhihui_community/ui/view/menuview/SoreButton.java | aff16df99255c9be8101815ee33d2fe7e0811ff4 | [] | no_license | ywen8/ZhiHuiCommunity | 69f94d1558a64964563557a99f1f55b3e55ee3af | 38af7d7d50a068b22570aca54e7ad401a491e751 | refs/heads/master | 2021-09-05T15:07:13.952523 | 2018-01-29T04:55:06 | 2018-01-29T04:55:06 | 119,333,611 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,275 | java | package com.rain.zhihui_community.ui.view.menuview;
import android.content.Context;
import android.content.res.TypedArray;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import com.rain.zhihui_community.R;
import com.rain.zhihui_community.ui.view.menuview.Interface.ViewControl;
import com.rain.zhihui_community.ui.view.menuview.adapter.ViewPagerAdapter;
import java.util.ArrayList;
import java.util.List;
public class SoreButton extends LinearLayout {
Context mContext;
private ViewPager viewPager;
private LinearLayout llIndicator;
//选中图片
private int RadioSelect;
//未选中图片
private int RadioUnselected;
//圆点间距
private int distance;
List<View> listSoreView = new ArrayList<>();
View soreView;
private List<Integer> listView;
//接口
private ViewControl viewControl;
//设置接口
public void setViewControl(ViewControl viewControl) {
this.viewControl = viewControl;
}
public SoreButton(Context context) {
super(context);
}
public SoreButton(Context context, AttributeSet attrs) {
super(context, attrs);
mContext = context;
LayoutInflater.from(context).inflate(R.layout.anfq_sore_button, this, true);
viewPager = (ViewPager) findViewById(R.id.viewPager);
llIndicator = (LinearLayout) findViewById(R.id.llIndicator);
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.DynamicSoreView);
if (typedArray != null) {
//选中点
RadioSelect = typedArray.getResourceId(R.styleable.DynamicSoreView_SoreRadioSelect, R.drawable.radio_select);
//未选中点
RadioUnselected = typedArray.getResourceId(R.styleable.DynamicSoreView_SoreRadioUnselected, R.drawable.radio_unselected);
//圆点间距
distance = typedArray.getInteger(R.styleable.DynamicSoreView_SoreDistance,10);
typedArray.recycle();
}
//设置空布局
listView = new ArrayList<>();
listView.add(fj.mtsortbutton.lib.R.layout.viewpager_default);
}
//初始化ViewPager
private void initViewPager(){
listSoreView = new ArrayList<>();
LayoutInflater layoutInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
int size = listView.size();
for (int i = 0; i < size; i++) {
//循环拿到传入的View
soreView = layoutInflater.inflate(listView.get(i), null);
//通过接口回掉的形式返回当前的View,实现接口后开源拿到每个View然后进行操作
if (viewControl!=null){
viewControl.setView(soreView,i);
}
//将获取到的View添加到List中
listSoreView.add(soreView);
}
//设置viewPager的Adapter
viewPager.setAdapter(new ViewPagerAdapter(listSoreView));
//初始化LinearLayout,加入指示器
initLinearLayout(viewPager, size, llIndicator);
}
/**
* 设置指示器,设置ViewPager滑动事件监听
* @param viewPager --ViewPager
* @param pageSize --View的页数
* @param linearLayout --LinearLayout
*/
private void initLinearLayout(ViewPager viewPager, int pageSize, LinearLayout linearLayout) {
linearLayout.removeAllViews();
//定义数组放置指示器的点,pageSize是View个数
final ImageView[] imageViews = new ImageView[pageSize];
for (int i = 0; i < pageSize; i++) {
//创建ImageView
ImageView image = new ImageView(mContext);
//将ImageView放入数组
imageViews[i] = image;
//默认选中第一个
if (i == 0) {
//选中的点
image.setImageResource(RadioSelect);
} else {
//未选中的点
image.setImageResource(RadioUnselected);
}
//设置宽高
LayoutParams params = new LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
params.setMargins(distance, 0, distance, 0);
//将点添加到LinearLayout中
linearLayout.addView(image, params);
}
//ViewPager的滑动事件
viewPager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageScrollStateChanged(int arg0) {}
@Override
public void onPageScrolled(int arg0, float arg1, int arg2) {}
@Override
public void onPageSelected(int arg0) {
//arg0当前ViewPager
for (int i = 0; i < imageViews.length; i++) {
//设置为选中的点
imageViews[arg0].setImageResource(RadioSelect);
//判断当前的点i如果不等于当前页的话就设置为未选中
if (arg0 != i) {
imageViews[i].setImageResource(RadioUnselected);
}
}
}
});
}
/**
* 设置圆点距离
* @param distance --距离
* @return
*/
@Deprecated
public SoreButton setDistance(int distance){
this.distance = distance;
return this;
}
/**
* 设置指示器图片
* @param radioSelect --选中图片
* @param radioUnselected --未选中图片
* @return
*/
@Deprecated
public SoreButton setIndicator(int radioSelect, int radioUnselected){
//选中图片
RadioSelect = radioSelect;
//未选中图片
RadioUnselected = radioUnselected;
return this;
}
/**
* 设置view
* @param listView --view
* @return
*/
public SoreButton setView(List<Integer> listView){
this.listView = listView;
return this;
}
/**
* 设置初始化
*/
public SoreButton init(){
initViewPager();
return this;
}
}
| [
"381226310@qq.com"
] | 381226310@qq.com |
35635136a291e08fa964106095f8fa6390f6e43d | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/34/34_6ca033c430a0bf598eb75a6e441dea183c0d7eba/AbstractRegistryGeneratorTestCase/34_6ca033c430a0bf598eb75a6e441dea183c0d7eba_AbstractRegistryGeneratorTestCase_s.java | 1d23dcdc5f82d9fcbc10c2a42733578e820465ef | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 4,309 | java | package org.codehaus.modello.plugin.registry;
/*
* Copyright (c) 2007, Codehaus.org
*
* 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.
*/
import org.codehaus.modello.AbstractModelloGeneratorTest;
import org.codehaus.modello.ModelloException;
import org.codehaus.modello.ModelloParameterConstants;
import org.codehaus.modello.core.ModelloCore;
import org.codehaus.modello.model.Model;
import org.codehaus.modello.model.ModelValidationException;
import org.codehaus.plexus.compiler.CompilerException;
import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.ReaderFactory;
import java.io.File;
import java.io.IOException;
import java.util.Properties;
public abstract class AbstractRegistryGeneratorTestCase
extends AbstractModelloGeneratorTest
{
public AbstractRegistryGeneratorTestCase( String name )
{
super( name );
}
protected void prepareTest( String outputType )
throws ComponentLookupException, ModelloException, ModelValidationException, IOException, CompilerException
{
ModelloCore modello = (ModelloCore) container.lookup( ModelloCore.ROLE );
Model model = modello.loadModel( ReaderFactory.newXmlReader( getTestFile( "src/test/resources/model.mdo" ) ) );
File generatedSources = getTestFile( "target/" + outputType + "/sources" );
File classes = getTestFile( "target/" + outputType + "/classes" );
FileUtils.deleteDirectory( generatedSources );
FileUtils.deleteDirectory( classes );
generatedSources.mkdirs();
classes.mkdirs();
Properties parameters = new Properties();
parameters.setProperty( ModelloParameterConstants.OUTPUT_DIRECTORY, generatedSources.getAbsolutePath() );
parameters.setProperty( ModelloParameterConstants.VERSION, "1.0.0" );
parameters.setProperty( ModelloParameterConstants.PACKAGE_WITH_VERSION, Boolean.toString( false ) );
modello.generate( model, "java", parameters );
modello.generate( model, outputType, parameters );
String registryVersion = System.getProperty( "registryVersion" );
addDependency( "org.codehaus.modello", "modello-core", getModelloVersion() );
addDependency( "org.codehaus.plexus.registry", "plexus-registry-api", "1.0-alpha-2" );
addDependency( "org.codehaus.plexus.registry", "plexus-registry-commons", "1.0-alpha-2" );
addDependency( "org.codehaus.plexus", "plexus-container-default", "1.0-alpha-30" );
addDependency( "commons-collections", "commons-collections", "3.1" );
addDependency( "commons-configuration", "commons-configuration", "1.3" );
addDependency( "commons-lang", "commons-lang", "2.1" );
addDependency( "commons-logging", "commons-logging-api", "1.0.4" );
if ( "1.5".compareTo( System.getProperty( "java.specification.version" ) ) <= 0 )
{
// causes a conflict with JDK 1.4 => add this dependency only with JDK 1.5+
addDependency( "xerces", "xercesImpl", "2.9.1" );
}
compile( generatedSources, classes );
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
802071617f73b4dfb2ed8a9175b61858e7272a9f | ea08265d7690aa6456ae1c9144018e1dc8a17a93 | /src/main/java/com/mzl/simple/List.java | f1fb2cf036fe913eca0db9d813129985ae8648c5 | [] | no_license | huagenlike/java8 | eb97b455f60cc22fb0eefac41e5f21c28470fce5 | c76531e807a634ea33bb961dad0638b65393384e | refs/heads/master | 2023-02-27T19:38:01.279679 | 2021-02-09T09:10:22 | 2021-02-09T09:10:22 | 277,754,815 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 231 | java | package com.mzl.simple;
/**
* @description:
* @author: lhg
* @date: Created in 2020/7/8 10:55
* @version:
* @modified By:
*/
public class List {
public List() {
System.out.println("com.mzl.simple.List");
}
}
| [
"34886711@qq.com"
] | 34886711@qq.com |
57ec4640896c12e1820875c73a69a31ec66d277b | ae92b969498bd186dd8b897f828344a30cf5c2f7 | /src/main/java/org/xlrnet/tibaija/util/CompareUtils.java | 1f1b9d0af2ed9681495342c4e8142dfc3000702f | [
"MIT"
] | permissive | bihai/tibaija | dcf380515769debfc0ce85a6774883e78657d610 | 60f8843937af61adae3c370693f6b18349286449 | refs/heads/master | 2021-01-18T18:42:43.456944 | 2015-02-22T18:43:51 | 2015-02-22T18:43:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,946 | java | /*
* Copyright (c) 2015 Jakob Hendeß
*
* 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 org.xlrnet.tibaija.util;
import java.util.Comparator;
import java.util.Objects;
/**
* Utility class that provides comparison methods with boolean results like e.g. isGreaterThan().
*/
public class CompareUtils {
/**
* Compares two given objects and returns true if the first object is <u>greater than</u> the second one i.e. the
* implementation of compareTo() must return <b>1</b>.
*
* @param o1
* The first object.
* @param o2
* The second object.
* @param <T>
* A comparable class type.
* @return True if the first object is greater or false if not.
*/
public static <T extends Comparable> boolean isGreaterThan(T o1, T o2) {
return (1 == Objects.compare(o1, o2, Comparator.<T>naturalOrder()));
}
/**
* Compares two given objects and returns true if the first object is <u>greater than or equal to</u> the second one
* i.e. the
* implementation of compareTo() must return either <b>1 or 0</b>.
*
* @param o1
* The first object.
* @param o2
* The second object.
* @param <T>
* A comparable class type.
* @return True if the first object is greater than or equal to the second. False otherwise.
*/
public static <T extends Comparable> boolean isGreaterOrEqual(T o1, T o2) {
return isGreaterThan(o1, o2) || isEqual(o1, o2);
}
/**
* Compares two given objects and returns true if the first object is <u>less than</u> the second one i.e. the
* implementation of compareTo() must return <b>-1</b>.
*
* @param o1
* The first object.
* @param o2
* The second object.
* @param <T>
* A comparable class type.
* @return True if the first object is less than the second. False otherwise..
*/
public static <T extends Comparable> boolean isLessThan(T o1, T o2) {
return (-1 == Objects.compare(o1, o2, Comparator.<T>naturalOrder()));
}
/**
* Compares two given objects and returns true if the first object is <u>less than or equal to</u> the second one
* i.e. the
* implementation of compareTo() must return either <b>-1 or 0</b>.
*
* @param o1
* The first object.
* @param o2
* The second object.
* @param <T>
* A comparable class type.
* @return True if the first object is greater than or equal to the second. False otherwise.
*/
public static <T extends Comparable> boolean isLessOrEqual(T o1, T o2) {
return isLessThan(o1, o2) || isEqual(o1, o2);
}
/**
* Compares two given objects and returns true if the first object is <u>equal to</u> the second one i.e. the
* implementation of compareTo() must return <b>0</b>.
*
* @param o1
* The first object.
* @param o2
* The second object.
* @param <T>
* A comparable class type.
* @return True if the first object is equal to the second. False otherwise.
*/
public static <T extends Comparable> boolean isEqual(T o1, T o2) {
return (0 == Objects.compare(o1, o2, Comparator.<T>naturalOrder()));
}
/**
* Compares two given objects and returns true if the first object is <u>not equal to</u> the second one i.e. the
* implementation of compareTo() must <b>not</b> return <b>0</b>.
*
* @param o1
* The first object.
* @param o2
* The second object.
* @param <T>
* A comparable class type.
* @return True if the first object is not equal to the second. False otherwise.
*/
public static <T extends Comparable> boolean isNotEqual(T o1, T o2) {
return !isEqual(o1, o2);
}
}
| [
"gebratene.ente+github@gmail.com"
] | gebratene.ente+github@gmail.com |
9c70679602c105b71a03023e789aae6fc37f0fec | ff31eb3097625f43ed24547ca9bf81e611cc0211 | /SE/Uebung/Übung 5/ex05/src/main/java/ex05/RoutePlanner.java | 75526f5f04f8b133d9973000c498054233ddafba | [] | no_license | tu-darmstadt-informatik/Tu-Darmstadt-Informatik-Kurse | 4b36cedc07971842c3cfe3774e8c119c308645e9 | 746570115d86b36c7c96a2b36b3a5438fbcf133e | refs/heads/master | 2020-05-27T18:12:38.676967 | 2019-05-06T10:00:02 | 2019-05-06T10:00:02 | 188,735,509 | 1 | 0 | null | 2019-05-26T21:57:11 | 2019-05-26T21:57:11 | null | UTF-8 | Java | false | false | 349 | java | package ex05;
import java.util.List;
@Concept("Routenplanung")
public class RoutePlanner {
@Concept("Start")
private Node start;
@Concept("Ziel")
private Node goal;
@Concept("Fahrzeit")
private int travelTime;
@Concept("Distanz")
private int distance;
@Concept("Route")
private List<Path> route;
}
| [
"myLeoart@gmx.net"
] | myLeoart@gmx.net |
baabdcc22a3a74cc0afcc8b0d0443d8cba94c44f | 9f555c4e078e1089c0dc25095c98f289c9d38ec6 | /Usuario/src/main/java/usuarios/Usuario/FuncionarioService.java | ad63b5e2bbe229935930e778fc3d2ac48d7ceb30 | [] | no_license | LidyaNascimento/ProjetoPDSC | 32e468ad06f9a5fb7fdbb1143f438b240dcba4c8 | 5239013cb7a6b726866d6de694457f6c57871636 | refs/heads/master | 2020-08-06T01:56:16.305971 | 2019-12-14T01:47:31 | 2019-12-14T01:47:31 | 212,791,416 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,624 | java | package usuarios.Usuario;
import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
import static javax.ws.rs.core.Response.Status.NOT_FOUND;
import java.util.List;
import javax.ejb.EJB;
import javax.transaction.Transactional;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Response;
import usuarios.entidades.Cliente;
import usuarios.entidades.Funcionario;
import usuarios.mapeamento.FuncionarioMapeamento;
import usuarios.ejb.FuncionarioBean;
@Path("/funcionarios")
@Produces(APPLICATION_JSON)
@Consumes(APPLICATION_JSON)
public class FuncionarioService {
@EJB
private FuncionarioBean funcionarioBean;
@GET
@Path("/{id}")
public Response findById(@PathParam("id") Long id) {
Funcionario funcionario = funcionarioBean.getFuncionario(id);
if (funcionario != null)
return Response.ok(funcionario).build();
return Response.status(NOT_FOUND).build();
}
@GET
public Response findAllFuncionarios() {
List<Funcionario> allFuncionarios = funcionarioBean.getAllFuncionarios();
if (allFuncionarios != null)
return Response.ok(allFuncionarios).build();
return Response.status(NOT_FOUND).build();
}
@POST
@Path("/adicionarFuncionario")
@Consumes(APPLICATION_JSON)
public Response cadastrarFuncionario(FuncionarioMapeamento func) {
Funcionario user = funcionarioBean.cadastrarFuncionario(func);
if (user!=null) {
func.setId(user.getId());
return Response.ok(user).build();
}
return Response.status(NOT_FOUND).build();
}
} | [
"lidyanascimento97@gmail.com"
] | lidyanascimento97@gmail.com |
f6d4b680498038353f0d3f4ab32c93c8f5e3fcab | c156a52eef137f4352955532676eaf4398c546dd | /Spring01_javaBasic/src/test/main/MainClass.java | a2a12130a79623331a98028953a10ff4d00fcb72 | [] | no_license | jyshinv/Spring_AcornSpringClass | cab3eaeda8d72937d96ba8206f8dbb9cc69ee0a2 | 7cdb613a0fed57aeab77b4a901f087f58b003160 | refs/heads/main | 2023-03-10T08:55:44.841730 | 2021-02-25T13:15:10 | 2021-02-25T13:15:10 | 331,574,483 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,147 | java | package test.main;
//다른패키지에 있는 클래스를 사용하려면 import해주어야한다.
import test.mypac.Weapon;
import test.mypac.WeaponImpl;
/*
[객체 혹은 클래스 사이의 의존관계를 느슨하게 하는 방법]
1. 인터페이스 type을 적극 활용한다.
2. 필요한 핵심 의존 객체를 직접 생성(new) 하지 않는다.
3. 필요한 핵심 의존 객체를 다른 곳에서 받아서 사용한다.
-즉, 필요한 핵심 의존객체의 생성과 관리는 하는 무언가가 필요하다
그걸 대신 해주는게 스프링 프레임 워크이다.
[느슨하게 하는 장점?]
-객체 혹은 클래스 간 영향을 덜 미친다. 즉, 유지보수가 편해진다.
*/
public class MainClass {
public static void main(String[] args) {
//무언가를 공격해야한다. 어떻게 코딩하면 될까
//공격하기 위해 필요한 객체(의존객체)를 직접 생성(new)해서
Weapon w1=new WeaponImpl();
WeaponImpl w2=new WeaponImpl();
//해당 객체의 메소드를 호출함으로써 목적을 달성했다.
w1.attack();
w2.attack();
}
}
| [
"sjy1218v@gmail.com"
] | sjy1218v@gmail.com |
78a76b25be3d3d077b0f71de0fd5a8d8d696ec49 | 7d0356696eb997ed19f670a26a86eb3bcfb69ae9 | /KT3/app/src/main/java/com/newer/kt/Refactor/Base/BaseRecyclerViewNoRefresh.java | 6a4ac3cf059dc9c6107113c9809b4672089fe8e6 | [
"Apache-2.0"
] | permissive | shenminjie/KT | 1afcac4fed54aa437e3cab2360306115bf859329 | c86bf997d9c4652d168cb1f97fa51389a2f63129 | refs/heads/master | 2021-01-23T00:54:26.542368 | 2017-03-22T15:08:26 | 2017-03-22T15:08:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,809 | java | package com.newer.kt.Refactor.Base;
import android.os.Bundle;
import android.support.v7.widget.RecyclerView;
import com.frame.app.base.Adapter.BaseRecyclerViewAdapter;
import com.frame.app.base.activity.BaseToolBarActivity2;
import com.newer.kt.R;
/**
* Created by jy on 16/6/14.
*/
public abstract class BaseRecyclerViewNoRefresh extends BaseToolBarActivity2 {
public RecyclerView mRecyclerView;
@Override
protected void initView(Bundle savedInstanceState) {
super.initView(savedInstanceState);
addContentView(R.layout.layout_recyclerview);
mRecyclerView = (RecyclerView) findViewById(R.id.layout_recyclerview_rv);
}
protected void setLayoutManager(RecyclerView.LayoutManager layout){
mRecyclerView.setLayoutManager(layout);
}
/**
* 如果可以确定每个item的高度是固定的,设置这个选项可以提高性能
*/
protected void setHasFixedSize(boolean isFixed) {
mRecyclerView.setHasFixedSize(isFixed);
}
protected void addItemDecoration(RecyclerView.ItemDecoration mItemDecoration) {
mRecyclerView.addItemDecoration(mItemDecoration);
}
protected void setItemAnimator(RecyclerView.ItemAnimator mItemAnimator){
mRecyclerView.setItemAnimator(mItemAnimator);
}
protected void setAdapter(BaseRecyclerViewAdapter adapter) {
mRecyclerView.setAdapter(adapter);
}
protected void setAdapter(RecyclerView.Adapter adapter) {
mRecyclerView.setAdapter(adapter);
}
protected RecyclerView getRecyclerView() {
return mRecyclerView;
}
protected void addOnScrollListener(RecyclerView.OnScrollListener listener){
mRecyclerView.addOnScrollListener(listener);
}
}
| [
"jasonxwz@163.com"
] | jasonxwz@163.com |
8a9586e8deeca6f1842cfd176d10b7ec55d80f53 | e3a7622a4d2e16b1683c183568341b39c0de88b4 | /IDEAProjects/StudyJava/src/a_base/ch3_inherit/Polymorphism/PrinterInfo.java | 9c56ecf3fa1abdad33712dc5c95639a9c2b69822 | [] | no_license | TriggerDark/StudyCodes | 937a8f6988cb475d275ff429cd32df823e457296 | 6f2f339d47dbae10d55d6b6da1d7e107f7dec85f | refs/heads/master | 2022-02-09T13:52:10.895963 | 2019-03-30T13:38:55 | 2019-03-30T13:38:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 665 | java | package base.ch3.Polymorphism;
/*
* 抽象方法,只包含方法头,没有方法体,可以定义为抽象方法
* 包含抽象方法的类必须定义为抽象类,抽象类可以不包含任何抽象方法
* 抽象类是不可以实例化的,抽象类可能有抽象方法,抽象方法是没有方法的,不可以被调用
* 一旦一个子类继承了抽象类,需要实现抽象类的所有方法
*/
abstract class PrinterInfo{
private String brand;
public PrinterInfo(String brand) {
this.brand = brand;
}
public String getBrand() {
return brand;
}
public abstract void print(String context);
}
| [
"2413044193@qq.com"
] | 2413044193@qq.com |
1243cfa9e97d21513ff51a47320fc3e36e05e9f6 | da2768eecc4e9db667dcb0bc13d46fdb0a6e5bf7 | /HSM/src/main/java/com/cg/hsm/exception/InsufficientExperienceException.java | 186b30468f8fd678ebb5815d9ba6079fea2dbbfa | [] | no_license | RamyaYeluri/Sprint1 | abfb9ea7e929e0555659b3b960983a37826a11ff | 9cc7a625d3efb8f4f2658de47b92070e1d2c981b | refs/heads/master | 2023-02-26T20:27:53.010424 | 2021-02-04T04:08:30 | 2021-02-04T04:08:30 | 334,588,696 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 613 | java | package com.cg.hsm.exception;
/**
* This class is an custom exception class to throw exception when experience of a doctor does not match criteria
* @author Pranjali Chaudhari
*
*/
public class InsufficientExperienceException extends Exception {
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* Create InsufficientExperienceException object without error message
*/
public InsufficientExperienceException() {
super();
}
/**
* Create InsufficientExperienceException object with error message
*/
public InsufficientExperienceException(String errMsg){
super(errMsg);
}
}
| [
"yeluriramya2409@gmail.com"
] | yeluriramya2409@gmail.com |
f3ab2d39973480dbf3b46d03b09742de1215320c | 11ad159854dc5480440ee7970f7b8a14c0e26176 | /src/test/java/com/zhlzzz/tool/ToolApplicationTests.java | b99dd35e90cfca2008fa63d836febededd70be98 | [] | no_license | liehuoren/tool-api | 492a33bf23940c7eae28d29549c6db147308ab8b | 00fd20ebcf63eb2cf4b791f53159d0ff4b39f4eb | refs/heads/master | 2020-03-29T18:30:45.862848 | 2018-09-25T06:25:52 | 2018-09-25T06:25:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 330 | java | package com.zhlzzz.tool;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class ToolApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"zhouhonglie@m-chain.com"
] | zhouhonglie@m-chain.com |
e6a9f9981587f132c98cf7726bc6ad235611fc3f | d6c83f0b3285b0107fece5694d72dc23659cf234 | /MyLoader/app/src/main/java/com/dindac/myloader/MainActivity.java | 651318ea80739658a6dbe0a45b8cd3d1c806a42f | [] | no_license | dindac/PemrogramanMobile | b26d17ed416d132755db7ab6e6962f684f0e605f | f262ea6775f97f3fc05fe0b851758f497bee3555 | refs/heads/master | 2020-12-03T12:34:15.903966 | 2020-01-02T08:29:03 | 2020-01-02T08:29:03 | 209,210,849 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,584 | java | package com.dindac.myloader;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.loader.app.LoaderManager;
import androidx.loader.content.CursorLoader;
import androidx.loader.content.Loader;
import android.Manifest;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.provider.ContactsContract;
import android.util.Log;
import android.view.View;
import android.widget.Adapter;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity implements LoaderManager.LoaderCallbacks<Cursor>, AdapterView.OnItemClickListener {
public static final String TAG = "ContactApp";
ListView lvContact;
ProgressBar progressBar;
private ContactAdapter mAdapter;
private final int CONTACT_REQUEST_CODE = 101;
private final int CALL_REQUEST_CODE = 102;
private final int CONTACT_LOAD = 110;
private final int CONTACT_SELECT = 120;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
lvContact = findViewById(R.id.lv_contact);
progressBar = findViewById(R.id.progressBar);
lvContact.setVisibility(View.INVISIBLE);
progressBar.setVisibility(View.GONE);
mAdapter = new ContactAdapter(MainActivity.this, null, true);
lvContact.setAdapter(mAdapter);
lvContact.setOnItemClickListener(this);
if (PermissionManager.isGranted(this, Manifest.permission.READ_CONTACTS)) {
getSupportLoaderManager().initLoader(CONTACT_LOAD, null, this);
} else {
PermissionManager.check(this, Manifest.permission.READ_CONTACTS, CONTACT_REQUEST_CODE);
}
}
@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
CursorLoader mCursorLoader = null;
if (id == CONTACT_LOAD) {
progressBar.setVisibility(View.VISIBLE);
String[] projectionFields = new String[]{
ContactsContract.Contacts._ID,
ContactsContract.Contacts.DISPLAY_NAME,
ContactsContract.Contacts.PHOTO_URI};
mCursorLoader = new CursorLoader(MainActivity.this,
ContactsContract.Contacts.CONTENT_URI,
projectionFields,
ContactsContract.Contacts.HAS_PHONE_NUMBER + "=1",
null, ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME + " ASC");
} else if (id == CONTACT_SELECT) {
String[] phoneProjectionFields = new String[]{ContactsContract.CommonDataKinds.Phone.NUMBER};
mCursorLoader = new CursorLoader(MainActivity.this,
ContactsContract.CommonDataKinds.Phone.CONTENT_URI,
phoneProjectionFields,
ContactsContract.CommonDataKinds.Phone.CONTACT_ID + " = ? AND " +
ContactsContract.CommonDataKinds.Phone.TYPE + " = " +
ContactsContract.CommonDataKinds.Phone.TYPE_MOBILE + " AND " +
ContactsContract.CommonDataKinds.Phone.HAS_PHONE_NUMBER + "=1",
new String[]{args.getString("id")},
null);
}
return mCursorLoader;
}
@SuppressLint("MissingPermission")
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
Log.d(TAG, "LoadFinished");
if (loader.getId() == CONTACT_LOAD) {
if (data.getCount() > 0) {
lvContact.setVisibility(View.VISIBLE);
mAdapter.swapCursor(data);
}
progressBar.setVisibility(View.GONE);
} else if (loader.getId() == CONTACT_SELECT) {
String contactNumber = null;
if (data.moveToFirst()) {
contactNumber = data.getString(data.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
}
if (PermissionManager.isGranted(this, Manifest.permission.CALL_PHONE)) {
Intent dialIntent = new Intent(Intent.ACTION_CALL,
Uri.parse("tel:" + contactNumber));
startActivity(dialIntent);
} else {
PermissionManager.check(this, Manifest.permission.CALL_PHONE, CALL_REQUEST_CODE);
}
}
}
@Override
public void onLoaderReset(Loader<Cursor> loader) {
if (loader.getId() == CONTACT_LOAD) {
progressBar.setVisibility(View.GONE);
mAdapter.swapCursor(null);
Log.d(TAG, "LoaderReset");
}
}
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Cursor cursor = (Cursor) parent.getAdapter().getItem(position);
long mContactId = cursor.getLong(0);
Log.d(TAG, "Position : " + position + " " + mContactId);
getPhoneNumber(String.valueOf(mContactId));
}
private void getPhoneNumber(String contactID) {
Bundle bundle = new Bundle();
bundle.putString("id", contactID);
getSupportLoaderManager().restartLoader(CONTACT_SELECT, bundle, this);
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
if (requestCode == CONTACT_REQUEST_CODE) {
if (grantResults.length > 0) {
if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
getSupportLoaderManager().initLoader(CONTACT_LOAD, null, this);
Toast.makeText(this, "Contact permission diterima", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(this, "Contact permission ditolak", Toast.LENGTH_SHORT).show();
}
}
} else if (requestCode == CALL_REQUEST_CODE) {
if (grantResults.length > 0) {
if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
Toast.makeText(this, "Call permission diterima", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(this, "Call permission ditolak", Toast.LENGTH_SHORT).show();
}
}
}
}
} | [
"dindacahya001@gmail.com"
] | dindacahya001@gmail.com |
8bac1ee4f62bf9a0215f3be0217054a3d876198a | 90577e7daee3183e57a14c43f0a0e26c6616c6a6 | /com.cssrc.ibms.system/src/main/java/com/cssrc/ibms/index/service/InsColNewService.java | 22cbb8f9300ca77122280b8b1d08274fb77fc84e | [] | no_license | xeon-ye/8ddp | a0fec7e10182ab4728cafc3604b9d39cffe7687e | 52c7440b471c6496f505e3ada0cf4fdeecce2815 | refs/heads/master | 2023-03-09T17:53:38.427613 | 2021-02-18T02:18:55 | 2021-02-18T02:18:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,201 | java | package com.cssrc.ibms.index.service;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.cssrc.ibms.api.core.intf.BaseService;
import com.cssrc.ibms.core.db.mybatis.dao.IEntityDao;
import com.cssrc.ibms.index.dao.InsColNewDao;
import com.cssrc.ibms.index.model.InsColNew;
/**
* 新闻栏目关联信息Service层
* @author YangBo
*
*/
@Service
public class InsColNewService extends BaseService<InsColNew>{
@Resource
private InsColNewDao dao;
protected IEntityDao<InsColNew, Long> getEntityDao() {
return this.dao;
}
/**
* 删除栏目colId下有关新闻
* @param colId
*/
public void delByColId(Long colId)
{
this.dao.delByColId(colId);
}
/**
* 删除所有显示newId的栏目新闻
* @param newId
*/
public void delByNewId(Long newId)
{
this.dao.delByNewId(newId);
}
/**
* 获取一条栏目新闻
* @param colId
* @param newId
* @return
*/
public InsColNew getByColIdNewId(Long colId, Long newId)
{
return this.dao.getByColIdNewId(colId, newId);
}
/**
* 删除一条栏目新闻
*
*/
public void delByColIdNewId(Long colId, Long newId)
{
this.dao.delByColIdNewId(colId, newId);
}
}
| [
"john_qzl@163.com"
] | john_qzl@163.com |
a78d6480d5a3b7d0becf9cbb3766213260d46455 | e27f62512230938f3aadfb22f38efb1740bbc34b | /src/main/java/project/ims/controller/MainController.java | 7c43e809afcc3f736c1efcecc066fb6b7e0b31dc | [] | no_license | nischalshakya59/Inventory-Management-With-Database-Synchronization | ee565934b9676842a11b6c581f5d25a7eb95bb0c | 0a35765fa46289dab3c7e6b013d62bf2eef3a5dd | refs/heads/master | 2021-01-22T08:19:04.352779 | 2017-05-28T03:43:51 | 2017-05-28T03:43:51 | 92,612,165 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,702 | java | package project.ims.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import project.ims.dao.BrandDAO;
import project.ims.dao.CategoryDAO;
import project.ims.dao.ProductDAO;
import project.ims.dao.SupplierDAO;
import project.ims.entity.Cart;
import project.ims.entity.Product;
@Controller
@RequestMapping ("/")
public class MainController {
@Autowired
ProductDAO productDAO;
@Autowired
BrandDAO brandDAO;
@Autowired
CategoryDAO categoryDAO;
@Autowired
SupplierDAO supplierDAO;
@RequestMapping(value = "/index")
public String supplierView(Model model) {
model.addAttribute("command");
model.addAttribute("categoryinfo", categoryDAO.getAll());
model.addAttribute("brandinfo", brandDAO.getAll());
return "customerwebpage/main/index";
}
@RequestMapping(value = "/customerproductview")
public String productView(Model model, @ModelAttribute("product1") Product product, BindingResult result){
model.addAttribute("command", new Cart());
model.addAttribute("filename", productDAO.getAll());
return "customerwebpage/main/customerproductview";
}
@RequestMapping(value = "/customerproductdetails/{id}")
public String customerProductDetails(@PathVariable("id") int id, Model model){
model.addAttribute("command", new Product());
for (Product pro : productDAO.getById(id)){
model.addAttribute("productinfo", pro);
model.addAttribute("brand", brandDAO.getByID(productDAO.getByID(id).getBrandId()));
model.addAttribute("supplier", supplierDAO.getByID(productDAO.getByID(id).getSupplierId()));
model.addAttribute("categoryinfo",categoryDAO.getAll());
model.addAttribute("quantity", pro.getProductQuantity());
model.addAttribute("productall",productDAO.getAll());
model.addAttribute("brandinfo",brandDAO.getAll());
model.addAttribute("supplierall",supplierDAO.getAll());
model.addAttribute("cart", new Cart());
}
return "customerwebpage/main/customerproductdetails";
}
@RequestMapping(value = "/customerproductview/category/{id}")
public String productsByCategory(@PathVariable("id") int id, Model model){
model.addAttribute("command", new Product());
model.addAttribute("productall", productDAO.getAll());
model.addAttribute("categoryall",categoryDAO.getAll());
model.addAttribute("categoryinfo", categoryDAO.getByID(id));
model.addAttribute("brandall",brandDAO.getAll());
model.addAttribute("supplierall",supplierDAO.getAll());
return "customerwebpage/main/productbycategory";
}
@RequestMapping(value = "customerproductview/brand/{id}")
public String productByBrand(@PathVariable("id") int id , Model model){
model.addAttribute("command", new Product());
model.addAttribute("productall", productDAO.getAll());
model.addAttribute("categoryall",categoryDAO.getAll());
model.addAttribute("brandinfo", brandDAO.getByID(id));
model.addAttribute("brandall",brandDAO.getAll());
model.addAttribute("supplierall",supplierDAO.getAll());
return "customerwebpage/main/productbybrand";
}
@RequestMapping(value = "/customerproductview/supplier/{id}")
public String productsBySupplier(@PathVariable("id") int id, Model model){
model.addAttribute("command", new Product());
model.addAttribute("productall", productDAO.getAll());
model.addAttribute("categoryall",categoryDAO.getAll());
model.addAttribute("supplierinfo", supplierDAO.getByID(id));
model.addAttribute("brandall",brandDAO.getAll());
model.addAttribute("supplierall",supplierDAO.getAll());
return "customerwebpage/main/productbysupplier";
}
@RequestMapping(value = "/contact")
public String contactDetails(Model model){
model.addAttribute("command");
return "customerwebpage/main/contact";
}
@RequestMapping(value = "/customerprofile")
public String profileDetails(Model model){
model.addAttribute("command");
return "customerwebpage/main/customerprofile";
}
}
| [
"nischalshakya59@gmail.com"
] | nischalshakya59@gmail.com |
381313c2bfcc15a64328cbaccdc3c5abf991cf92 | 1d1ec22ea32d688943f9c81002c8f46d4c45bfea | /Cinema/src/IFile.java | 52e5355d2bc84292a381b7f6f0046477ddcd10ef | [] | no_license | AlbertLouca/Cinema | e17a8c8a2b84a5559331ca53ffa72394fb845bc2 | d1eda0744b14634be432e157e1c47a0c7128f1af | refs/heads/master | 2020-04-02T11:04:39.097485 | 2018-12-01T19:20:04 | 2018-12-01T19:20:04 | 154,369,848 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 83 | java | public interface IFile {
public boolean save();
public boolean load();
}
| [
"noreply@github.com"
] | AlbertLouca.noreply@github.com |
c866ecdcf56600a9413e98e7c041e1d53f5d12fa | 91cc1a70475d54f7f7d9c3b2b72f0825dd6c85e1 | /hello.java | d0d1dfba08df4f4dee1862686f6d56eecb980774 | [] | no_license | anmolsingh12/GIT-Test | fc1c43cae348ea3de0291c12a04d97d98f855550 | 857ff261cadb4043af6f545f289d67023aea0b70 | refs/heads/master | 2021-06-22T01:45:03.159131 | 2020-12-29T14:48:58 | 2020-12-29T14:48:58 | 141,305,860 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,722 | java | import java.sql.*;
import java.util.*;
import sailpoint.object.*;
import sailpoint.object.ProvisioningPlan.AccountRequest;
import sailpoint.object.ProvisioningPlan.AttributeRequest;
List<AccountRequest> account = plan.getAccountRequests();
ProvisioningPlan.AccountRequest accReq = account.get(0);
//AttributeRequest attrReq = accReq.getAttributeRequest("entitlement_value");
List<AttributeRequest> accounts = accReq.getAttributeRequests();
PreparedStatement pstmt = null;
Identity id = plan.getIdentity();
String name = id.getName();
String ent = null;
try {
for (AttributeRequest attrReq:accounts)
{
if(attrReq.getOperation().toString().equals("Set") && attrReq.getName().toString().equals("college"))
{
String colgName = attrReq.getValue().toString();
System.out.println(colgName);
pstmt = connection.prepareStatement("UPDATE app_account SET college = ? WHERE employee_id = ?");
pstmt.setString(1, colgName);
pstmt.setString(2, name);
pstmt.executeUpdate();
}
if(attrReq.getOperation().toString().equals("Set") && attrReq.getName().toString().equals("batch"))
{
String batchYear = attrReq.getValue().toString();
System.out.println(batchYear);
pstmt = connection.prepareStatement("UPDATE app_account SET batch = ? WHERE employee_id = ?");
pstmt.setString(1, batchYear);
pstmt.setString(2, name);
pstmt.executeUpdate();
}
if (attrReq.getOperation().toString().equals("Remove")) {
System.out.println("Please remove the Entitlement from this user");
pstmt = connection.prepareStatement("delete from app_access where employee_id=?;");
pstmt.setString(1,name);
pstmt.executeUpdate();
System.out.println("The entitlement has been deleted");
}
if (attrReq.getOperation().toString().equals("Add")) {
System.out.println("Please add the requested entitlement to this user");
ent = attrReq.getValue().toString();
System.out.println(ent);
pstmt = connection.prepareStatement("select employee_id,entitlement_value from app_access where employee_id=?");
pstmt.setString(1,name);
ResultSet rs = pstmt.executeQuery();
if(!rs.next())
{
System.out.println("Starting to insert the values in the JDBC table");
pstmt = connection.prepareStatement("insert into app_access(employee_id,entitlement_value) values (?,?);");
pstmt.setString(1,name);
pstmt.setString(2,ent);
pstmt.executeUpdate();
}
}
}
}
catch(Exception se) {
se.printStackTrace();
}
finally {
if(pstmt!=null)
{
pstmt.close();
}
}
| [
"noreply@github.com"
] | anmolsingh12.noreply@github.com |
5a952bf8c503e639716405802d0261184cccf267 | 06336cb3cfad310e9c88fde516a5e7fef9fd29f0 | /src/main/java/org/openbaton/monitoring/agent/zabbix/api/Opmessage.java | 6840d21a512765d8387e5caad5e194eefcd04d4e | [
"Apache-2.0"
] | permissive | Urban123/zabbix-plugin | 07b71cdbdfdb8a79a282a53f5358fde1128565f7 | fed5dc7f27e921044fe40b0359e10830720342db | refs/heads/master | 2020-04-06T06:38:37.954599 | 2016-04-29T17:31:38 | 2016-04-29T17:31:38 | 58,357,273 | 0 | 0 | null | 2016-05-09T07:29:59 | 2016-05-09T07:29:59 | null | UTF-8 | Java | false | false | 976 | java | package org.openbaton.monitoring.agent.zabbix.api;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
/**
* Created by mob on 17.11.15.
*/
public class Opmessage {
@SerializedName("default_msg")
@Expose
private Integer defaultMsg;
@SerializedName("mediatypeid")
@Expose
private String mediatypeid;
/**
*
* @return
* The defaultMsg
*/
public Integer getDefaultMsg() {
return defaultMsg;
}
/**
*
* @param defaultMsg
* The default_msg
*/
public void setDefaultMsg(Integer defaultMsg) {
this.defaultMsg = defaultMsg;
}
/**
*
* @return
* The mediatypeid
*/
public String getMediatypeid() {
return mediatypeid;
}
/**
*
* @param mediatypeid
* The mediatypeid
*/
public void setMediatypeid(String mediatypeid) {
this.mediatypeid = mediatypeid;
}
}
| [
"marcello.monachesi@fokus.fraunhofer.de"
] | marcello.monachesi@fokus.fraunhofer.de |
2dc01f42202b1a7e4418a4857ff8b23eb70e203c | 930e5bc681432f5402bf1248c172a5494983b9d6 | /src/main/java/com/wqy/campusbbs/mapper/UserMapper.java | 971e364e1279cf824e6747322953a5ae85d087b5 | [] | no_license | wqy1998/bbs | 60cb5cc722e75c295dc848d93fa8376cf09fd06e | 4d59eac9f663f16139abdb9ea30ef90527482a58 | refs/heads/master | 2023-04-21T23:38:53.772830 | 2021-05-21T08:28:39 | 2021-05-21T08:28:39 | 347,336,285 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,231 | java | package com.wqy.campusbbs.mapper;
import com.wqy.campusbbs.model.User;
import com.wqy.campusbbs.model.UserExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
@Mapper
public interface UserMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table USER
*
* @mbg.generated Fri Apr 16 18:30:08 CST 2021
*/
long countByExample(UserExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table USER
*
* @mbg.generated Fri Apr 16 18:30:08 CST 2021
*/
int deleteByExample(UserExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table USER
*
* @mbg.generated Fri Apr 16 18:30:08 CST 2021
*/
int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table USER
*
* @mbg.generated Fri Apr 16 18:30:08 CST 2021
*/
int insert(User record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table USER
*
* @mbg.generated Fri Apr 16 18:30:08 CST 2021
*/
int insertSelective(User record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table USER
*
* @mbg.generated Fri Apr 16 18:30:08 CST 2021
*/
List<User> selectByExampleWithRowbounds(UserExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table USER
*
* @mbg.generated Fri Apr 16 18:30:08 CST 2021
*/
List<User> selectByExample(UserExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table USER
*
* @mbg.generated Fri Apr 16 18:30:08 CST 2021
*/
User selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table USER
*
* @mbg.generated Fri Apr 16 18:30:08 CST 2021
*/
int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table USER
*
* @mbg.generated Fri Apr 16 18:30:08 CST 2021
*/
int updateByExample(@Param("record") User record, @Param("example") UserExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table USER
*
* @mbg.generated Fri Apr 16 18:30:08 CST 2021
*/
int updateByPrimaryKeySelective(User record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table USER
*
* @mbg.generated Fri Apr 16 18:30:08 CST 2021
*/
int updateByPrimaryKey(User record);
}
| [
"wqy_19980810@163.com"
] | wqy_19980810@163.com |
3e0e3a126d9c8d30e9136c7c0f5bd61cf7831824 | a88cc7a647b1dc1ba78c5b708430bb14be364791 | /Lesson2VariablesandDataTypes/src/Lesson2BasketballPlayer/src/basketballplayer/BasketballPlayer.java | f4f12770c4fc24cf52bde6874e9e8ac9c3b80760 | [] | no_license | bryan3071/JavaReviewPractice | ff0a45bc4fc60867dc0718d2e9bf064d448a4ec9 | 6e9a0346aff2698b70ceb27cdd59294433e37fe3 | refs/heads/master | 2020-04-13T00:50:14.174080 | 2018-12-23T07:44:41 | 2018-12-23T07:44:41 | 162,855,797 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,241 | java | /* Challenge Activity 3
This challenge activitiy should ask for the following inputs:
- a basketball player's name
- average points per game
- height in inches
and then display the player name, average points per game,
and height in ft and inches
There are 12 inches in 1 ft. so 75 inches is 6ft 3 inches
*/
package basketballplayer;
import java.util.Scanner;
public class BasketballPlayer {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner input = new Scanner(System.in);
System.out.println("What is the basketball players name");
String name = input.nextLine();
System.out.println("What is the average points per game");
double points = input.nextDouble();
System.out.println("What is the players height in inches");
int height = input.nextInt();
int footHeight = height/12;
int inchHeight = height % 12;
System.out.println("The Player's name is " + name);
System.out.println("The Player's average points amount is " + points);
System.out.println("The Player's height in inches is " + height + " " );
System.out.println("The Player's height is " + footHeight + " feet " + inchHeight + " inches" );
}
}
| [
"noreply@github.com"
] | bryan3071.noreply@github.com |
016fe31f6198785cba1ff00b1edf1da494bce15f | 5870c22081e140c7d360dd4d36c8191275e93006 | /MathSetRunner.java | 2a11b9a6d8497bd3e0e4bfd20ce4cfcdd44fc78f | [] | no_license | csavas/uniondiffinter | 4c138818bc8a187aafd144e0b136b36b5ed5748f | 68481dd515f7653c2fcfdc53e0c690450f39ecdf | refs/heads/main | 2023-03-20T21:37:08.002704 | 2021-03-16T19:37:54 | 2021-03-16T19:37:54 | 348,470,422 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 596 | java | //(c) A+ Computer Science
//www.apluscompsci.com
//Name -Carolyn savas
import java.io.File;
import java.io.IOException;
import java.util.Scanner;
import static java.lang.System.*;
public class MathSetRunner
{
public static void main(String args[]) throws IOException
{
//add test cases
Scanner data = new Scanner(new File("mathsetdata.dat"));
MathSet test = new MathSet();
String one, two;
while(data.hasNextLine()){
one = data.nextLine();
two = data.nextLine();
test = new MathSet(one, two);
System.out.println(test + "\n \n");
}
}
}
| [
"noreply@github.com"
] | csavas.noreply@github.com |
6e4dcadb0b86092e50ad4ee1933471632d2c776e | 1f4945f4229191df8fa2e3a3d62238469c5d61bb | /src/main/java/guzinski/model/Customer.java | 7dee973b403eb69ba541cf1ac007c63738f13bcf | [] | no_license | guzinski/back-end-test-southsystem | a06cbb38eb577cc6a9d76219624021fe079e3c7d | 99d5e3d995f1a5ed2e549544cd52320007f3a94c | refs/heads/master | 2022-09-09T17:27:21.827926 | 2020-05-28T02:17:50 | 2020-05-28T02:17:50 | 261,861,661 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 182 | java | package guzinski.model;
import lombok.Builder;
import lombok.Value;
@Builder
@Value
public class Customer {
String documentNumber;
String name;
String businessArea;
}
| [
"lucianoguzinski@gmail.com"
] | lucianoguzinski@gmail.com |
86518febad89fefb50102b8ce2427abfe8512984 | af7b8bbe77461e59f32ba746f4bb055620a5c110 | /base/src/main/java/com/hz/yk/agile/patterns/command/TestActiveObjectEngine.java | 132fc4a1f9a309b201dd10283d409e1c193def90 | [] | no_license | ykdsg/MyJavaProject | 3e51564a3fb57ab4ae043c9112e1936ccc179dd5 | a7d88aee2f58698aed7d497c2cf6e23a605ebb59 | refs/heads/master | 2023-06-26T02:23:33.812330 | 2023-06-12T11:28:23 | 2023-06-12T11:28:23 | 1,435,034 | 4 | 6 | null | 2022-12-01T15:21:01 | 2011-03-03T13:30:03 | Java | UTF-8 | Java | false | false | 1,281 | java | package com.hz.yk.agile.patterns.command;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertTrue;
/**
* Created by wuzheng.yk on 2018/3/14.
*/
public class TestActiveObjectEngine {
private boolean firstCommandExecuted = false;
@Test
public void testOneCommand() throws Exception {
ActiveObjectEngine e = new ActiveObjectEngine();
e.addCommand(new Command() {
@Override
public void execute() {
firstCommandExecuted = true;
}
});
e.run();
assertTrue (firstCommandExecuted,"Command not executed");
}
private boolean secondCommandExecuted = false;
@Test
public void testTwoCommands() throws Exception {
ActiveObjectEngine e = new ActiveObjectEngine();
e.addCommand(new Command() {
@Override
public void execute() {
firstCommandExecuted = true;
}
});
e.addCommand(new Command() {
@Override
public void execute() {
secondCommandExecuted = true;
}
});
e.run();
assertTrue (firstCommandExecuted && secondCommandExecuted,"Commands not executed");
}
}
| [
"17173as@163.com"
] | 17173as@163.com |
bad06cb8af12e70c28fc8b96bb4d7e0f43477663 | 9254e7279570ac8ef687c416a79bb472146e9b35 | /alb-20200616/src/main/java/com/aliyun/alb20200616/models/DissociateAdditionalCertificatesFromListenerResponseBody.java | 3f9b4bbcb2be84adaf6357c02e1bd30945fde960 | [
"Apache-2.0"
] | permissive | lquterqtd/alibabacloud-java-sdk | 3eaa17276dd28004dae6f87e763e13eb90c30032 | 3e5dca8c36398469e10cdaaa34c314ae0bb640b4 | refs/heads/master | 2023-08-12T13:56:26.379027 | 2021-10-19T07:22:15 | 2021-10-19T07:22:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,132 | java | // This file is auto-generated, don't edit it. Thanks.
package com.aliyun.alb20200616.models;
import com.aliyun.tea.*;
public class DissociateAdditionalCertificatesFromListenerResponseBody extends TeaModel {
// 异步任务id
@NameInMap("JobId")
public String jobId;
// Id of the request
@NameInMap("RequestId")
public String requestId;
public static DissociateAdditionalCertificatesFromListenerResponseBody build(java.util.Map<String, ?> map) throws Exception {
DissociateAdditionalCertificatesFromListenerResponseBody self = new DissociateAdditionalCertificatesFromListenerResponseBody();
return TeaModel.build(map, self);
}
public DissociateAdditionalCertificatesFromListenerResponseBody setJobId(String jobId) {
this.jobId = jobId;
return this;
}
public String getJobId() {
return this.jobId;
}
public DissociateAdditionalCertificatesFromListenerResponseBody setRequestId(String requestId) {
this.requestId = requestId;
return this;
}
public String getRequestId() {
return this.requestId;
}
}
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.