blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 7
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
684M
⌀ | 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 132
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 28
values | content
stringlengths 3
9.45M
| authors
listlengths 1
1
| author_id
stringlengths 0
352
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
142fd693f905a81751cc4212cd1feff17c95033e
|
f6f319c3087a0101ae33ddd10fbe3d7d0960eeb1
|
/app/src/main/java/ppe/ece/fr/newwheels/DeviceList.java
|
a7b2b5298b9b2c5886029a7a1a2e1da5098a4a35
|
[] |
no_license
|
Baladas/NewWheels
|
0b578252299b99beec6c8b2559f9dd06f7dfe9f6
|
263ce72a570fff4c10d3b3d75558c38ec940060e
|
refs/heads/master
| 2021-01-19T10:13:55.430357
| 2017-06-06T19:58:06
| 2017-06-06T19:58:06
| 82,168,764
| 0
| 0
| null | 2017-06-06T19:37:00
| 2017-02-16T10:27:15
|
Java
|
UTF-8
|
Java
| false
| false
| 3,574
|
java
|
package ppe.ece.fr.newwheels;
import android.content.Intent;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.widget.TextView;
import android.widget.Toast;
import java.util.ArrayList;
import java.util.Set;
public class DeviceList extends AppCompatActivity
{
//widgets
Button btnPaired;
ListView devicelist;
//Bluetooth
private BluetoothAdapter myBluetooth = null;
private Set<BluetoothDevice> pairedDevices;
public static String EXTRA_ADDRESS = "device_address";
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_device_list);
//Calling widgets
btnPaired = (Button)findViewById(R.id.button);
devicelist = (ListView)findViewById(R.id.listView);
//if the device has bluetooth
myBluetooth = BluetoothAdapter.getDefaultAdapter();
if(myBluetooth == null)
{
//Show a mensag. that the device has no bluetooth adapter
Toast.makeText(getApplicationContext(), "Bluetooth Device Not Available", Toast.LENGTH_LONG).show();
//finish apk
finish();
}
else if(!myBluetooth.isEnabled())
{
//Ask to the user turn the bluetooth on
Intent turnBTon = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(turnBTon,1);
}
btnPaired.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v)
{
pairedDevicesList();
}
});
}
private void pairedDevicesList()
{
pairedDevices = myBluetooth.getBondedDevices();
ArrayList list = new ArrayList();
if (pairedDevices.size()>0)
{
for(BluetoothDevice bt : pairedDevices)
{
list.add(bt.getName() + "\n" + bt.getAddress()); //Get the device's name and the address
}
}
else
{
Toast.makeText(getApplicationContext(), "No Paired Bluetooth Devices Found.", Toast.LENGTH_LONG).show();
}
final ArrayAdapter adapter = new ArrayAdapter(this,android.R.layout.simple_list_item_1, list);
devicelist.setAdapter(adapter);
devicelist.setOnItemClickListener(myListClickListener); //Method called when the device from the list is clicked
}
private AdapterView.OnItemClickListener myListClickListener = new AdapterView.OnItemClickListener()
{
public void onItemClick (AdapterView<?> av, View v, int arg2, long arg3)
{
// Get the device MAC address, the last 17 chars in the View
String info = ((TextView) v).getText().toString();
String address = info.substring(info.length() - 17);
// Make an intent to start next activity.
//Intent i = new Intent(DeviceList.this, .class);
//Change the activity.
//i.putExtra(EXTRA_ADDRESS, address); //this will be received at ledControl (class) Activity
//startActivity(i);
}
};
}
|
[
"gilles.hoarau@edu.ece.fr"
] |
gilles.hoarau@edu.ece.fr
|
d7ffcfd93761a92ab36859b395571ea7c1c40ae1
|
e251534ffee715c1b5e7dfde41f37afaadcad839
|
/java/java-tests/testData/inspection/duplicateBranchesInSwitchFix/beforeContinue.java
|
a61416708468c103a3280108ff4e4c40ba06de0e
|
[
"Apache-2.0"
] |
permissive
|
iamzken/intellij-community
|
88e1719e881435dc2672082658eac13801b6ab63
|
ddf5753f87bfe3b3ac29da63256031f90a4cbb56
|
refs/heads/master
| 2020-04-15T09:17:44.129885
| 2019-01-07T19:33:53
| 2019-01-07T19:33:53
| 164,543,829
| 0
| 1
|
Apache-2.0
| 2019-01-08T02:49:28
| 2019-01-08T02:49:27
| null |
UTF-8
|
Java
| false
| false
| 517
|
java
|
// "Merge with 'case 1:'" "GENERIC_ERROR_OR_WARNING"
class C {
int foo(int n) {
int s = 0;
for (int i = 0; i < n; i++) {
switch (i % 4) {
case 1:
s += i;
continue;
case 2:
continue;
case 3:
<caret>s += i;
continue;
default:
s += i;
}
s /= 2;
}
return s;
}
}
|
[
"pavel.dolgov@jetbrains.com"
] |
pavel.dolgov@jetbrains.com
|
a8246cc95ceb5fa730553c7e2dd03d0fd36d8f89
|
339061e3a250d14e709e21f6b814cebedf0ffd3f
|
/spring-mvn-admin/spring-mvn-core/spring-mvn-core-amain/src/main/java/cn/spring/mvn/core/amain/PageEntity.java
|
03c2a6d803057fc59102a714c3586adc100a2d9f
|
[] |
no_license
|
liutao1024/github-mvn
|
f277daeabfdd58835d0c466c01a5b39107cc21fe
|
0b58abc929c0d7ad771a8eeccdfdddc75d999b3f
|
refs/heads/master
| 2021-07-08T16:51:46.482698
| 2019-01-30T05:24:20
| 2019-01-30T05:24:20
| 139,798,131
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 965
|
java
|
package cn.spring.mvn.core.amain;
import java.util.Map;
public class PageEntity {
private Integer page; //目前是第几页
private Integer size; //每页大小
private Map<String, Object> params; //传入的参数
private String orderColumn;
private String orderTurn = "ASC";
public String getOrderColumn() {
return orderColumn;
}
public void setOrderColumn(String orderColumn) {
this.orderColumn = orderColumn;
}
public String getOrderTurn() {
return orderTurn;
}
public void setOrderTurn(String orderTurn) {
this.orderTurn = orderTurn;
}
public Integer getPage() {
return page;
}
public void setPage(Integer page) {
this.page = page;
}
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public Map<String, Object> getParams() {
return params;
}
public void setParams(Map<String, Object> params) {
this.params = params;
}
}
|
[
"979497772@qq.com"
] |
979497772@qq.com
|
48f46bb3448585fd03fdbe0aad3b4ab0ff6db7c7
|
f0931730552b4f15c3b30e1a9709dbcbd6b8c0b2
|
/decompiled apk/app_source_from_JADX/android/support/v7/widget/aq.java
|
8f4ec3fa02eb0e47af6be70d1f7d62b8be75f7a4
|
[] |
no_license
|
VictoriaVan/GoogleCTFStuff
|
78a842578f5fb86e4e24cf3c4189a46583d5924d
|
1b58bf8fc8628f00361ac4e4e6f8ec5c81407f73
|
refs/heads/master
| 2020-03-21T09:59:31.083027
| 2018-06-23T19:35:02
| 2018-06-23T19:35:02
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 17,481
|
java
|
package android.support.v7.widget;
import android.app.SearchManager;
import android.app.SearchableInfo;
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.content.res.Resources.NotFoundException;
import android.database.Cursor;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.Drawable.ConstantState;
import android.net.Uri;
import android.net.Uri.Builder;
import android.os.Bundle;
import android.support.v4.p009b.C0092a;
import android.support.v4.widget.C0398j;
import android.support.v7.p020a.C0411a.C0401a;
import android.support.v7.p020a.C0411a.C0406f;
import android.text.SpannableString;
import android.text.TextUtils;
import android.text.style.TextAppearanceSpan;
import android.util.Log;
import android.util.TypedValue;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.List;
import java.util.WeakHashMap;
class aq extends C0398j implements OnClickListener {
private final SearchManager f2098j = ((SearchManager) this.d.getSystemService("search"));
private final SearchView f2099k;
private final SearchableInfo f2100l;
private final Context f2101m;
private final WeakHashMap<String, ConstantState> f2102n;
private final int f2103o;
private boolean f2104p = false;
private int f2105q = 1;
private ColorStateList f2106r;
private int f2107s = -1;
private int f2108t = -1;
private int f2109u = -1;
private int f2110v = -1;
private int f2111w = -1;
private int f2112x = -1;
private static final class C0588a {
public final TextView f2093a;
public final TextView f2094b;
public final ImageView f2095c;
public final ImageView f2096d;
public final ImageView f2097e;
public C0588a(View view) {
this.f2093a = (TextView) view.findViewById(16908308);
this.f2094b = (TextView) view.findViewById(16908309);
this.f2095c = (ImageView) view.findViewById(16908295);
this.f2096d = (ImageView) view.findViewById(16908296);
this.f2097e = (ImageView) view.findViewById(C0406f.edit_query);
}
}
public aq(Context context, SearchView searchView, SearchableInfo searchableInfo, WeakHashMap<String, ConstantState> weakHashMap) {
super(context, searchView.getSuggestionRowLayout(), null, true);
this.f2099k = searchView;
this.f2100l = searchableInfo;
this.f2103o = searchView.getSuggestionCommitIconResId();
this.f2101m = context;
this.f2102n = weakHashMap;
}
private Drawable m2918a(ComponentName componentName) {
Object obj = null;
String flattenToShortString = componentName.flattenToShortString();
if (this.f2102n.containsKey(flattenToShortString)) {
ConstantState constantState = (ConstantState) this.f2102n.get(flattenToShortString);
return constantState == null ? null : constantState.newDrawable(this.f2101m.getResources());
} else {
Drawable b = m2925b(componentName);
if (b != null) {
obj = b.getConstantState();
}
this.f2102n.put(flattenToShortString, obj);
return b;
}
}
private Drawable m2919a(String str) {
if (str == null || str.isEmpty() || "0".equals(str)) {
return null;
}
Drawable b;
try {
int parseInt = Integer.parseInt(str);
String str2 = "android.resource://" + this.f2101m.getPackageName() + "/" + parseInt;
b = m2927b(str2);
if (b != null) {
return b;
}
b = C0092a.m383a(this.f2101m, parseInt);
m2924a(str2, b);
return b;
} catch (NumberFormatException e) {
b = m2927b(str);
if (b != null) {
return b;
}
b = m2926b(Uri.parse(str));
m2924a(str, b);
return b;
} catch (NotFoundException e2) {
Log.w("SuggestionsAdapter", "Icon resource not found: " + str);
return null;
}
}
private static String m2920a(Cursor cursor, int i) {
String str = null;
if (i != -1) {
try {
str = cursor.getString(i);
} catch (Throwable e) {
Log.e("SuggestionsAdapter", "unexpected error retrieving valid column from cursor, did the remote process die?", e);
}
}
return str;
}
public static String m2921a(Cursor cursor, String str) {
return m2920a(cursor, cursor.getColumnIndex(str));
}
private void m2922a(ImageView imageView, Drawable drawable, int i) {
imageView.setImageDrawable(drawable);
if (drawable == null) {
imageView.setVisibility(i);
return;
}
imageView.setVisibility(0);
drawable.setVisible(false, false);
drawable.setVisible(true, false);
}
private void m2923a(TextView textView, CharSequence charSequence) {
textView.setText(charSequence);
if (TextUtils.isEmpty(charSequence)) {
textView.setVisibility(8);
} else {
textView.setVisibility(0);
}
}
private void m2924a(String str, Drawable drawable) {
if (drawable != null) {
this.f2102n.put(str, drawable.getConstantState());
}
}
private Drawable m2925b(ComponentName componentName) {
PackageManager packageManager = this.d.getPackageManager();
try {
ActivityInfo activityInfo = packageManager.getActivityInfo(componentName, 128);
int iconResource = activityInfo.getIconResource();
if (iconResource == 0) {
return null;
}
Drawable drawable = packageManager.getDrawable(componentName.getPackageName(), iconResource, activityInfo.applicationInfo);
if (drawable != null) {
return drawable;
}
Log.w("SuggestionsAdapter", "Invalid icon resource " + iconResource + " for " + componentName.flattenToShortString());
return null;
} catch (NameNotFoundException e) {
Log.w("SuggestionsAdapter", e.toString());
return null;
}
}
private Drawable m2926b(Uri uri) {
InputStream openInputStream;
try {
if ("android.resource".equals(uri.getScheme())) {
return m2935a(uri);
}
openInputStream = this.f2101m.getContentResolver().openInputStream(uri);
if (openInputStream == null) {
throw new FileNotFoundException("Failed to open " + uri);
}
Drawable createFromStream = Drawable.createFromStream(openInputStream, null);
try {
openInputStream.close();
return createFromStream;
} catch (Throwable e) {
Log.e("SuggestionsAdapter", "Error closing icon stream for " + uri, e);
return createFromStream;
}
} catch (NotFoundException e2) {
throw new FileNotFoundException("Resource does not exist: " + uri);
} catch (FileNotFoundException e3) {
Log.w("SuggestionsAdapter", "Icon not found: " + uri + ", " + e3.getMessage());
return null;
} catch (Throwable th) {
try {
openInputStream.close();
} catch (Throwable e4) {
Log.e("SuggestionsAdapter", "Error closing icon stream for " + uri, e4);
}
}
}
private Drawable m2927b(String str) {
ConstantState constantState = (ConstantState) this.f2102n.get(str);
return constantState == null ? null : constantState.newDrawable();
}
private CharSequence m2928b(CharSequence charSequence) {
if (this.f2106r == null) {
TypedValue typedValue = new TypedValue();
this.d.getTheme().resolveAttribute(C0401a.textColorSearchUrl, typedValue, true);
this.f2106r = this.d.getResources().getColorStateList(typedValue.resourceId);
}
CharSequence spannableString = new SpannableString(charSequence);
spannableString.setSpan(new TextAppearanceSpan(null, 0, 0, this.f2106r, null), 0, charSequence.length(), 33);
return spannableString;
}
private void m2929d(Cursor cursor) {
Bundle extras = cursor != null ? cursor.getExtras() : null;
if (extras != null && !extras.getBoolean("in_progress")) {
}
}
private Drawable m2930e(Cursor cursor) {
if (this.f2110v == -1) {
return null;
}
Drawable a = m2919a(cursor.getString(this.f2110v));
return a == null ? m2932g(cursor) : a;
}
private Drawable m2931f(Cursor cursor) {
return this.f2111w == -1 ? null : m2919a(cursor.getString(this.f2111w));
}
private Drawable m2932g(Cursor cursor) {
Drawable a = m2918a(this.f2100l.getSearchActivity());
return a != null ? a : this.d.getPackageManager().getDefaultActivityIcon();
}
Cursor m2933a(SearchableInfo searchableInfo, String str, int i) {
if (searchableInfo == null) {
return null;
}
String suggestAuthority = searchableInfo.getSuggestAuthority();
if (suggestAuthority == null) {
return null;
}
String[] strArr;
Builder fragment = new Builder().scheme("content").authority(suggestAuthority).query("").fragment("");
String suggestPath = searchableInfo.getSuggestPath();
if (suggestPath != null) {
fragment.appendEncodedPath(suggestPath);
}
fragment.appendPath("search_suggest_query");
String suggestSelection = searchableInfo.getSuggestSelection();
if (suggestSelection != null) {
strArr = new String[]{str};
} else {
fragment.appendPath(str);
strArr = null;
}
if (i > 0) {
fragment.appendQueryParameter("limit", String.valueOf(i));
}
return this.d.getContentResolver().query(fragment.build(), null, suggestSelection, strArr, null);
}
public Cursor mo243a(CharSequence charSequence) {
String charSequence2 = charSequence == null ? "" : charSequence.toString();
if (this.f2099k.getVisibility() != 0 || this.f2099k.getWindowVisibility() != 0) {
return null;
}
try {
Cursor a = m2933a(this.f2100l, charSequence2, 50);
if (a != null) {
a.getCount();
return a;
}
} catch (Throwable e) {
Log.w("SuggestionsAdapter", "Search suggestions query threw an exception.", e);
}
return null;
}
Drawable m2935a(Uri uri) {
String authority = uri.getAuthority();
if (TextUtils.isEmpty(authority)) {
throw new FileNotFoundException("No authority: " + uri);
}
try {
Resources resourcesForApplication = this.d.getPackageManager().getResourcesForApplication(authority);
List pathSegments = uri.getPathSegments();
if (pathSegments == null) {
throw new FileNotFoundException("No path: " + uri);
}
int size = pathSegments.size();
if (size == 1) {
try {
size = Integer.parseInt((String) pathSegments.get(0));
} catch (NumberFormatException e) {
throw new FileNotFoundException("Single path segment is not a resource ID: " + uri);
}
} else if (size == 2) {
size = resourcesForApplication.getIdentifier((String) pathSegments.get(1), (String) pathSegments.get(0), authority);
} else {
throw new FileNotFoundException("More than two path segments: " + uri);
}
if (size != 0) {
return resourcesForApplication.getDrawable(size);
}
throw new FileNotFoundException("No resource found for: " + uri);
} catch (NameNotFoundException e2) {
throw new FileNotFoundException("No package found for authority: " + uri);
}
}
public View mo257a(Context context, Cursor cursor, ViewGroup viewGroup) {
View a = super.mo257a(context, cursor, viewGroup);
a.setTag(new C0588a(a));
((ImageView) a.findViewById(C0406f.edit_query)).setImageResource(this.f2103o);
return a;
}
public void m2937a(int i) {
this.f2105q = i;
}
public void mo244a(Cursor cursor) {
if (this.f2104p) {
Log.w("SuggestionsAdapter", "Tried to change cursor after adapter was closed.");
if (cursor != null) {
cursor.close();
return;
}
return;
}
try {
super.mo244a(cursor);
if (cursor != null) {
this.f2107s = cursor.getColumnIndex("suggest_text_1");
this.f2108t = cursor.getColumnIndex("suggest_text_2");
this.f2109u = cursor.getColumnIndex("suggest_text_2_url");
this.f2110v = cursor.getColumnIndex("suggest_icon_1");
this.f2111w = cursor.getColumnIndex("suggest_icon_2");
this.f2112x = cursor.getColumnIndex("suggest_flags");
}
} catch (Throwable e) {
Log.e("SuggestionsAdapter", "error changing cursor and caching columns", e);
}
}
public void mo492a(View view, Context context, Cursor cursor) {
C0588a c0588a = (C0588a) view.getTag();
int i = this.f2112x != -1 ? cursor.getInt(this.f2112x) : 0;
if (c0588a.f2093a != null) {
m2923a(c0588a.f2093a, m2920a(cursor, this.f2107s));
}
if (c0588a.f2094b != null) {
CharSequence a = m2920a(cursor, this.f2109u);
a = a != null ? m2928b(a) : m2920a(cursor, this.f2108t);
if (TextUtils.isEmpty(a)) {
if (c0588a.f2093a != null) {
c0588a.f2093a.setSingleLine(false);
c0588a.f2093a.setMaxLines(2);
}
} else if (c0588a.f2093a != null) {
c0588a.f2093a.setSingleLine(true);
c0588a.f2093a.setMaxLines(1);
}
m2923a(c0588a.f2094b, a);
}
if (c0588a.f2095c != null) {
m2922a(c0588a.f2095c, m2930e(cursor), 4);
}
if (c0588a.f2096d != null) {
m2922a(c0588a.f2096d, m2931f(cursor), 8);
}
if (this.f2105q == 2 || (this.f2105q == 1 && (i & 1) != 0)) {
c0588a.f2097e.setVisibility(0);
c0588a.f2097e.setTag(c0588a.f2093a.getText());
c0588a.f2097e.setOnClickListener(this);
return;
}
c0588a.f2097e.setVisibility(8);
}
public CharSequence mo245c(Cursor cursor) {
if (cursor == null) {
return null;
}
String a = m2921a(cursor, "suggest_intent_query");
if (a != null) {
return a;
}
if (this.f2100l.shouldRewriteQueryFromData()) {
a = m2921a(cursor, "suggest_intent_data");
if (a != null) {
return a;
}
}
if (!this.f2100l.shouldRewriteQueryFromText()) {
return null;
}
a = m2921a(cursor, "suggest_text_1");
return a != null ? a : null;
}
public View getDropDownView(int i, View view, ViewGroup viewGroup) {
try {
return super.getDropDownView(i, view, viewGroup);
} catch (Throwable e) {
Log.w("SuggestionsAdapter", "Search suggestions cursor threw exception.", e);
View b = mo258b(this.d, this.c, viewGroup);
if (b != null) {
((C0588a) b.getTag()).f2093a.setText(e.toString());
}
return b;
}
}
public View getView(int i, View view, ViewGroup viewGroup) {
try {
return super.getView(i, view, viewGroup);
} catch (Throwable e) {
Log.w("SuggestionsAdapter", "Search suggestions cursor threw exception.", e);
View a = mo257a(this.d, this.c, viewGroup);
if (a != null) {
((C0588a) a.getTag()).f2093a.setText(e.toString());
}
return a;
}
}
public boolean hasStableIds() {
return false;
}
public void notifyDataSetChanged() {
super.notifyDataSetChanged();
m2929d(mo242a());
}
public void notifyDataSetInvalidated() {
super.notifyDataSetInvalidated();
m2929d(mo242a());
}
public void onClick(View view) {
Object tag = view.getTag();
if (tag instanceof CharSequence) {
this.f2099k.m2717a((CharSequence) tag);
}
}
}
|
[
"vv0011@uah.edu"
] |
vv0011@uah.edu
|
64a4895a7634a05cd30346cc02fc3fe22361717f
|
0746f05bb81c6c0fc504dea774f1170c6ab64b21
|
/GasPumpSystem/src/com/iit/cs586/david/java/Model/EFSM/S0.java
|
edc2417c799c6d2039ef58fa7dd8594bb1b3f7da
|
[] |
no_license
|
davidghiurco/SSA-GasPump-MDA-System
|
327b565bc2464ffc514e7b7a8dd5e4d96013574f
|
158eb4477e8324d508816c58a8985cba587c47ce
|
refs/heads/master
| 2021-01-19T19:06:21.376136
| 2017-06-03T17:15:37
| 2017-06-03T17:15:37
| 86,649,556
| 1
| 6
| null | 2017-04-12T19:46:26
| 2017-03-30T02:23:23
|
Java
|
UTF-8
|
Java
| false
| false
| 405
|
java
|
package Model.EFSM;
/*
State S0 in the EFSM model
*/
class S0 extends State {
S0(StateMachine model) {
super(model);
}
/*
Transition to State S1 and call the PayMsg() meta-action
*/
@Override
void start() {
if (model.s == model.LS[0]) {
model.s = model.LS[1];
model.getOP().PayMsg();
}
}
}
|
[
"dm.ghiurco@gmail.com"
] |
dm.ghiurco@gmail.com
|
7d231ccf2228d42656b67cadfcbcc9e6c1b839d5
|
0e2601f11ca659923e425f10e87da3cba01db70f
|
/src/Round458/D.java
|
6ffba31c5ddae18a4314a7813a5453191a2a079d
|
[] |
no_license
|
sharoha/Codeforces
|
0ef47a59dc1ed37d2eecb6fdd6e1dc7c4d0cd69f
|
387c9b696f2f7ac9688cb1fe41778d8f55d20321
|
refs/heads/master
| 2021-09-06T21:02:02.777754
| 2018-02-11T10:59:01
| 2018-02-11T10:59:01
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,571
|
java
|
package Round458;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
public class D {
String INPUT = "5\n" +
"1 2 3 4 5\n" +
"6\n" +
"1 1 4 2\n" +
"2 3 6\n" +
"1 1 4 2\n" +
"1 1 5 2\n" +
"2 5 10\n" +
"1 1 5 2";
public class Tree {
int pow = 1 << 19;
int[] gcd = new int[2 * pow];
Tree(int[] a) {
for (int i = 0; i < a.length; i++) {
gcd[pow + i] = a[i];
}
for (int i = pow - 1; i > 0; i--) {
update(i);
}
}
private void update(int v) {
gcd[v] = gcd(gcd[2 * v], gcd[2 * v + 1]);
}
private void set(int to, int x) {
set(1, 0, pow - 1, to, x);
}
private void set(int v, int l, int r, int to, int x) {
if (v >= pow) {
gcd[v] = x;
} else {
int m = (l + r) / 2;
if (to <= m) {
set(2 * v, l, m, to, x);
} else {
set(2 * v + 1, m + 1, r, to, x);
}
update(v);
}
}
private boolean get(int l, int r, int x) {
int y = get(1, 0, 0, pow - 1, l, r, x);
return y < 2;
}
private int get(int v, int n, int l, int r, int left, int right, int x) {
if (r < left || l > right) {
return n;
}
if (l >= left && r <= right) {
if (gcd[v] % x == 0) {
return n;
}
if (v >= pow) {
n++;
return n;
}
}
int m = (l + r) / 2;
n = get(2 * v, n, l, m, left, right, x);
if (n > 1) {
return n;
}
n = get(2 * v + 1, n, m + 1, r, left, right, x);
return n;
}private int gcd(int a,int b)
{
return b == 0? a: gcd(b,a%b);
}
}
void solve()
{
int n = i();
int[] a = new int[n];
for (int i = 0; i <n ; i++) {
a[i] = i();
}
Tree seg = new Tree(a);
int q = i();
while(q-->0)
{
if(i()==1)
{
out.println(seg.get(i()-1,i()-1,i())?"YES":"NO");
}
else
seg.set(i()-1,i());
}
}
///////////////////////////////////////
void run() throws Exception{
is = oj ? System.in: new ByteArrayInputStream(INPUT.getBytes());
//is = System.in;
out = new PrintWriter(System.out);
long s = System.currentTimeMillis();
solve();
out.flush();
tr(System.currentTimeMillis()-s+"ms");
}
public static void main(String[] args)throws Exception {
new D().run();
}
InputStream is;
PrintWriter out;
private byte[] inbuf = new byte[1024];
public int lenbuf = 0, ptrbuf = 0;
private int readByte()
{
if(lenbuf == -1)throw new InputMismatchException();
if(ptrbuf >= lenbuf){
ptrbuf = 0;
try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
if(lenbuf <= 0)return -1;
}
return inbuf[ptrbuf++];
}
private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }
private double d() { return Double.parseDouble(s()); }
private char c() { return (char)skip(); }
private String s()
{
int b = skip();
StringBuilder sb = new StringBuilder();
while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
sb.appendCodePoint(b);
b = readByte();
}
return sb.toString();
}
private char[] sa(int n)
{
char[] buf = new char[n];
int b = skip(), p = 0;
while(p < n && !(isSpaceChar(b))){
buf[p++] = (char)b;
b = readByte();
}
return n == p ? buf : Arrays.copyOf(buf, p);
}
private char[][] nm(int n, int m)
{
char[][] map = new char[n][];
for(int i = 0;i < n;i++)map[i] = sa(m);
return map;
}
private int[] ia(int n)
{
int[] a = new int[n];
for(int i = 0;i < n;i++)a[i] = i();
return a;
}
private int i()
{
int num = 0, b;
boolean minus = false;
while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
if(b == '-'){
minus = true;
b = readByte();
}
while(true){
if(b >= '0' && b <= '9'){
num = num * 10 + (b - '0');
}else{
return minus ? -num : num;
}
b = readByte();
}
}
private long l()
{
long num = 0;
int b;
boolean minus = false;
while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
if(b == '-'){
minus = true;
b = readByte();
}
while(true){
if(b >= '0' && b <= '9'){
num = num * 10 + (b - '0');
}else{
return minus ? -num : num;
}
b = readByte();
}
}
private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}
|
[
"sharmarohan136@gmail.com"
] |
sharmarohan136@gmail.com
|
8e524082d22ea7812beeeb0adb9128f43efcc52f
|
b2f0af50fee2e195b953a7295c688f55e6d14e81
|
/core/src/main/java/com/sdu/spark/utils/colleciton/KVArraySortDataFormat.java
|
92e6cbf458d3e9c13f9e9343501aa4b1374ac37c
|
[] |
no_license
|
nishuihanqiu/spark-java
|
f756eb69b26ab65fd0f280e6c9957dd7a794722b
|
8469746291064493e24e338f74487e44024d82fa
|
refs/heads/master
| 2022-11-19T18:40:31.875758
| 2019-04-15T15:18:21
| 2019-04-15T15:18:21
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,874
|
java
|
package com.sdu.spark.utils.colleciton;
import com.sdu.spark.utils.scala.Tuple2;
/**
* Supports sorting an array of key-value pairs where the elements of the array alternate between
* keys and values, as used in {@link AppendOnlyMap}.
*
* K Type of the sort key of each element
*
* T Type of the Array we're sorting. Typically this must extend AnyRef, to support cases
* when the keys and values are not the same type.
*
* @author hanhan.zhang
* */
@SuppressWarnings("unchecked")
public class KVArraySortDataFormat<K, T> extends SortDataFormat<K, T[]>{
@Override
public K getKey(T[] data, int pos) {
return (K) data[2 * pos];
}
@Override
public void swap(T[] data, int pos0, int pos1) {
T tmpKey = data[2 * pos0];
T tmpValue = data[2 * pos0 + 1];
data[2 * pos0] = data[2 * pos1];
data[2 * pos0 + 1] = data[2 * pos1 + 1];
data[2 * pos1] = tmpKey;
data[2 * pos1 + 1] = tmpValue;
}
@Override
public void copyElement(T[] src, int srcPos, T[] dst, int dstPos) {
dst[2 * dstPos] = src[2 * srcPos];
dst[2 * dstPos + 1] = src[2 * srcPos + 1];
}
@Override
public void copyRange(T[] src, int srcPos, T[] dst, int dstPos, int length) {
System.arraycopy(src, 2 * srcPos, dst, 2 * dstPos, 2 * length);
}
@Override
public T[] allocate(int length) {
return (T[]) new Object[length * 2];
}
public static void main(String[] args) {
Object[] buffer = new Object[]{new Tuple2<>(1, "A"), 63, new Tuple2<>(1, "B"), 56, new Tuple2<>(2, "C"), 58};
KVArraySortDataFormat<Tuple2<Integer, String>, Object> dataFormat = new KVArraySortDataFormat<>();
Tuple2<Integer, String> key = dataFormat.getKey(buffer, 0);
System.out.println("Partition: " + key._1() + ", Key: " + key._2());
}
}
|
[
"zhanghan13@meituan.com"
] |
zhanghan13@meituan.com
|
c14d66a6ff2629b6e041f663a021173bbee0bc58
|
c3ec9e0d1457965dd4d0f9b3be0d99ca8eeccfc5
|
/src/main/java/com/codeoftheweb/salvo/Interface/ScoreRepository.java
|
21a672068617dd0fa9347eb4f461475c61e24b9d
|
[] |
no_license
|
MarianoMazza/Salvo
|
5fa9c002bee491d618e5000006e43fd2abdd0edb
|
398bb64ede24ebcab17fcc974ade836e3037e7f2
|
refs/heads/main
| 2023-04-17T02:42:11.349654
| 2021-05-07T15:26:58
| 2021-05-07T15:26:58
| 350,039,056
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 322
|
java
|
package com.codeoftheweb.salvo.Interface;
import com.codeoftheweb.salvo.Model.Score;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
@RepositoryRestResource
public interface ScoreRepository extends JpaRepository<Score, Long> {
}
|
[
"mazza.mariano@hotmail.com"
] |
mazza.mariano@hotmail.com
|
87b4dd93ab0e11378ebc16826ec670e04d71af97
|
fd045b26aee40d67364b78dadaca734bbb21e506
|
/pa165-sportEvent-POM/pa165-sportEvent-Api/src/main/java/com/pa165/sportEventservice/service/SportService.java
|
dac13ba865b4ce56a89e47e8371ddc6cc4b71300
|
[] |
no_license
|
mashadmm/sportEvent
|
7bb139e705a6e5ca781520b2051e9f1b36c73dbd
|
76900eaf2f6c3d7d17e20dd1cdc3edd44cbf3870
|
refs/heads/master
| 2020-05-30T04:14:17.950138
| 2014-01-23T20:47:57
| 2014-01-23T20:47:57
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 949
|
java
|
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.pa165.sportEventservice.service;
import com.pa165.sportEventpersistence.Exceptions.ServiceFailureException;
import com.pa165.sportEventservice.DTO.EventDTO;
import com.pa165.sportEventservice.DTO.SportDTO;
import java.util.List;
/**
*
* @author Maria
*/
public interface SportService {
public SportDTO add(SportDTO sport) throws ServiceFailureException;
public void remove(SportDTO sport) throws ServiceFailureException;
public SportDTO edit(SportDTO sport) throws ServiceFailureException;
public SportDTO findById(Long id) throws ServiceFailureException;
public List<SportDTO> getAll() throws ServiceFailureException;
public List<SportDTO> findByName(String name) throws ServiceFailureException;
public List<EventDTO> getEvents(SportDTO sport) throws ServiceFailureException;
}
|
[
"Maria@147.251.232.121"
] |
Maria@147.251.232.121
|
c96bc58123f79306278e0b253bd167ad1fb7397c
|
f8d8149111b66f5c6c65c89def42b88fd932c1c6
|
/src/main/java/com/example/casestudymodule6nhomculiee/model/User/AppRole.java
|
b3f5f655621e8c7829935fc2cb073c5e6f467e97
|
[] |
no_license
|
TrungDucMai/WebtimviecModule6.BE
|
3074e767effd2f0e5b33d944d11a53f8334edc39
|
72e536c8fcc55e72a2de31e7f4d38483dc9a306e
|
refs/heads/master
| 2023-09-02T03:21:17.722229
| 2021-11-11T04:25:11
| 2021-11-11T04:25:11
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 772
|
java
|
package com.example.casestudymodule6nhomculiee.model.User;
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
@Entity
@Data
@JsonIdentityInfo(
generator = ObjectIdGenerators.PropertyGenerator.class,
property = "id")
public class AppRole implements GrantedAuthority {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String name;
@Override
public String getAuthority() {
return this.name;
}
}
|
[
"sauvole75@gmail.com"
] |
sauvole75@gmail.com
|
159e16fa7230fe539924a2b93998e2581edc7799
|
df48dd3f6009770f595d837290e84cab5b494031
|
/ST-WEB/src/main/java/com/studyhelper/domain/matching/entity/Matching.java
|
7b34c23606c797bb3cc630c98da583718c9885f0
|
[] |
no_license
|
AsherByun/Studyhelper-real
|
2a5f0c9097c4ec4c589d6a9ef64a8338c151c785
|
5ad04cd61cd957ec196842a2185424b71f69acb9
|
refs/heads/master
| 2023-08-24T01:21:12.768382
| 2021-10-25T07:10:30
| 2021-10-25T07:10:30
| 334,935,892
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 675
|
java
|
package com.studyhelper.domain.matching.entity;
import org.springframework.data.annotation.Id;
import org.springframework.data.redis.core.RedisHash;
import org.springframework.data.redis.core.index.Indexed;
import com.studyhelper.domain.matching.entity.enums.Region;
import com.studyhelper.domain.matching.entity.enums.Subject;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
@Setter
@Getter
@ToString
@RedisHash("matchings")
public class Matching {
@Id
private String seq;
@Indexed
private int size;
@Indexed
private Region region;
@Indexed
private Subject subject;
@Indexed
private String memberId;
private String requestMatchingDate;
}
|
[
"dfdo333@naver.com"
] |
dfdo333@naver.com
|
94fded428a2f4a9e751adc3789083c9cf760ebe4
|
ac019c07e7098617e575a235e923bd8242dcac1a
|
/LED_Array/app/src/main/java/com/example/russell_test/led_array/FlashActivity.java
|
ef43184c8386a233d757bb26dfd9b681bc2700ff
|
[] |
no_license
|
Original-heapsters/RT-Mods
|
33f1ddb1bd06a42abbea4a7e5b4b0844f5aba9c5
|
bea8bcd89a38c33b4bb3847bc94782804bf2ea8e
|
refs/heads/master
| 2021-05-01T08:07:31.170429
| 2017-01-22T15:17:55
| 2017-01-22T15:17:55
| 79,677,248
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,964
|
java
|
package com.example.russell_test.led_array;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutCompat;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import org.w3c.dom.Text;
public class FlashActivity extends AppCompatActivity {
private Button toggleFlash;
private TextView I2C_Preview;
private LinearLayout LED_Sim;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_flash);
initializeComponents();
createListeners();
}
private void initializeComponents()
{
toggleFlash = (Button) findViewById(R.id.toggle_flash_btn);
I2C_Preview = (TextView) findViewById(R.id.I2CPreview);
LED_Sim = (LinearLayout) findViewById(R.id.LED_Activity);
}
private void createListeners()
{
toggleFlash.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
new BackGround().execute();
}
});
}
private class BackGround extends AsyncTask <Void, String, Void> {
@Override
protected Void doInBackground(Void...params) {
while(true){
publishProgress("abc");
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
publishProgress( "def" );
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
@Override
protected void onProgressUpdate( String ...progress ){
int color = Color.TRANSPARENT;
Drawable background = LED_Sim.getBackground();
if (background instanceof ColorDrawable)
color = ((ColorDrawable) background).getColor();
//ColorDrawable bgColor = ((ColorDrawable)LED_Sim.getBackground());
if(color == getResources().getColor(R.color.colorPrimary))
{
I2C_Preview.setText("I2C Switch ON");
LED_Sim.setBackgroundColor(getResources().getColor(R.color.colorAccent));
}
else
{
I2C_Preview.setText("I2C Switch OFF");
LED_Sim.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
}
}
}
}
|
[
"sell_nat@yahoo.com"
] |
sell_nat@yahoo.com
|
856866c1544f7d6fff2dfd3d1e20216510b68d00
|
6fab2731cdacab795d36e4be70a078f4a1d62303
|
/src/main/java/com/deerinc/cloud/service/CountryService.java
|
810ae6f713d7493a9eb0b5bb2457248f64709d39
|
[] |
no_license
|
LrWm3/jhipster-experiments-deerDash
|
558ed57ce427aa69f77bc82b0794f7ec0effc223
|
19b8783dbbbc5d021be0ba25650f1bd8a2f5001e
|
refs/heads/master
| 2022-07-24T20:46:55.832776
| 2020-03-21T14:57:08
| 2020-03-21T14:57:08
| 248,997,583
| 0
| 0
| null | 2022-07-07T17:43:07
| 2020-03-21T14:53:38
|
Java
|
UTF-8
|
Java
| false
| false
| 1,051
|
java
|
package com.deerinc.cloud.service;
import com.deerinc.cloud.service.dto.CountryDTO;
import java.util.List;
import java.util.Optional;
/**
* Service Interface for managing {@link com.deerinc.cloud.domain.Country}.
*/
public interface CountryService {
/**
* Save a country.
*
* @param countryDTO the entity to save.
* @return the persisted entity.
*/
CountryDTO save(CountryDTO countryDTO);
/**
* Get all the countries.
*
* @return the list of entities.
*/
List<CountryDTO> findAll();
/**
* Get the "id" country.
*
* @param id the id of the entity.
* @return the entity.
*/
Optional<CountryDTO> findOne(Long id);
/**
* Delete the "id" country.
*
* @param id the id of the entity.
*/
void delete(Long id);
/**
* Search for the country corresponding to the query.
*
* @param query the query of the search.
*
* @return the list of entities.
*/
List<CountryDTO> search(String query);
}
|
[
"william.marsman@gmail.com"
] |
william.marsman@gmail.com
|
c76e222e7544da93162ea7bf581eaa944b320c57
|
3e9617cef027e9c5220b4dd88962062f2f4697d0
|
/Family/GeofenceService.java
|
da328ee40ecd0f12c6ea494ed4a96a513acbab91
|
[] |
no_license
|
basilisfou/AndroidDevelopment
|
e34bfd335795498463dcc4bd9dc60c0067c7b81a
|
d7704c8237c58aa82ca5ea943e2efea4436c6196
|
refs/heads/master
| 2021-01-23T00:29:04.122666
| 2017-06-02T09:19:14
| 2017-06-02T09:19:14
| 92,816,013
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 9,442
|
java
|
package services;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.location.Geocoder;
import android.location.Location;
import android.os.AsyncTask;
import android.os.IBinder;
import android.support.annotation.Nullable;
import android.telephony.SmsManager;
import android.text.TextUtils;
import android.util.Log;
import com.alarm.veriah.FamilyApp.R;
import com.google.android.gms.location.Geofence;
import com.google.android.gms.location.GeofencingEvent;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.Locale;
import java.util.TimeZone;
import javax.net.ssl.HttpsURLConnection;
import Helper.Constants;
import Helper.GD;
import Model.ContactItem;
/**
* Created by vasilis Fouroulis on 8/10/2016.
*/
/**
* Listener for geofenceIB transition changes.
*
* Receives geofenceIB transition events from Location Services in the form of an Intent containing
* the transition type and geofenceIB id(s) that triggered the transition. Creates a notification
* as the output.
*/
public class GeofenceService extends Service {
protected static final String TAG = "GeofenceService";
private SharedPreferences sharedPreferences;
private String notificationDetails;
private Geocoder geoCoder;
GD gd = GD.get();
@Nullable
@Override
public IBinder onBind(Intent intent) {
return null;
}
@Override
public void onCreate() {
super.onCreate();
sharedPreferences = getSharedPreferences(Constants.SHARRED_KEY_PREFERENCES_KEY, Context.MODE_PRIVATE);
}
@Override
public void onDestroy(){
super.onDestroy();
}
@Override
public int onStartCommand(Intent intent,int flag, int startId) {
if(intent != null) {
GeofencingEvent geofencingEvent;
geofencingEvent = GeofencingEvent.fromIntent(intent);
// Get the transition type.
int geofenceTransition = geofencingEvent.getGeofenceTransition();
// Test that the reported transition was of interest.
if (geofenceTransition == Geofence.GEOFENCE_TRANSITION_ENTER || geofenceTransition == Geofence.GEOFENCE_TRANSITION_EXIT) {
// Get the geofences that were triggered. A single event can trigger multiple geofences.
List<Geofence> triggeringGeofences = geofencingEvent.getTriggeringGeofences();
// Get the transition details as a String.
String geofenceTransitionDetails = getGeofenceTransitionDetails(
getApplicationContext(),
geofenceTransition,
triggeringGeofences
);
notificationDetails = geofenceTransitionDetails;
sendPushNotification(geofencingEvent.getTriggeringLocation(), geofencingEvent.getGeofenceTransition());
}
}
return START_STICKY;
}
/**
* Maps geofenceIB transition types to their human-readable equivalents.
* @param transitionType A transition type constant defined in Geofence
* @return A String indicating the type of transition
*/
private String getTransitionString(Context context,int transitionType) {
switch (transitionType) {
case Geofence.GEOFENCE_TRANSITION_ENTER:
return context.getString(R.string.geofence_transition_entered);
case Geofence.GEOFENCE_TRANSITION_EXIT:
return context.getString(R.string.geofence_transition_exited);
default:
return context.getString(R.string.unknown_geofence_transition);
}
}
private String getTransitionString(int transitionType) {
switch (transitionType) {
case Geofence.GEOFENCE_TRANSITION_ENTER:
return "enterZone";
case Geofence.GEOFENCE_TRANSITION_EXIT:
return "exitZone";
default:
return getString(R.string.unknown_geofence_transition);
}
}
private String getGeofenceTransitionDetails(Context context, int geofenceTransition, List<Geofence> triggeringGeofences) {
String geofenceTransitionString = getTransitionString(context,geofenceTransition);
// Get the Ids of each geofenceIB that was triggered.
ArrayList triggeringGeofencesIdsList = new ArrayList();
for (Geofence geofence : triggeringGeofences) {
triggeringGeofencesIdsList.add(geofence.getRequestId());
}
String triggeringGeofencesIdsString = TextUtils.join(", ", triggeringGeofencesIdsList);
return geofenceTransitionString + ": " + triggeringGeofencesIdsString;
}
/**Make an HTTP Call to the Web Service in order to upload the contacts to a specific user.*/
public void sendPushNotification(Location location, int tranzition) {
List<android.location.Address> addresses;
geoCoder = new Geocoder(getApplicationContext(), Locale.getDefault());
String address="";
String city ="";
try {
addresses = geoCoder.getFromLocation(location.getLatitude(), location.getLongitude(), 1); // Here 1 represent max location result to returned, by documents it recommended 1 to 5
address = addresses.get(0).getAddressLine(0); // If any additional address line present than only, check with max available address lines by getMaxAddressLineIndex()
city = addresses.get(0).getLocality();
} catch (Exception e) {
e.printStackTrace();
}
String url = Constants.SERVER_URL+ Constants.WEB_SERVICES_SMS_ZONE_TRANZITION;
String body = "token=" +sharedPreferences.getString(Constants.TOKEN,"")
+"&userName=" +sharedPreferences.getString(Constants.USERNAME,"")
+"&familyId=" +sharedPreferences.getString(Constants.PROFILE_FAMILY_ID,"")
+"&zoneId=" +""
+"&gpsLat=" + location.getLatitude()
+"&gpsLon=" + location.getLongitude()
+"&address=" + address + " " + city
+"&gmtDiff=" + getOffset()
+"&zoneTransType=" + getTransitionString(tranzition)
+"&message=" + notificationDetails ;
new HttpGeofence().execute(url,body); /*** Send push notifications ***/
}
public void sendSMSNoData() {
SmsManager smsManager = SmsManager.getDefault();
ArrayList<String> parts = smsManager.divideMessage(notificationDetails);
Log.d("SendsmsService", ":: MESSAGE no data ::" + notificationDetails);
for (ContactItem ci : gd.contactListGD) {
smsManager.sendMultipartTextMessage(ci.getMobile(), null, parts, null, null);
}
}
public int getOffset(){
TimeZone timezone = TimeZone.getDefault();
int seconds = timezone.getOffset(Calendar.ZONE_OFFSET)/1000;
return seconds;
}
protected class HttpGeofence extends AsyncTask<String,Integer,Object>{
String endPoint;
@Override
public Object doInBackground(String... params) {
URL url;
String response = "";
int responseCode= 0;
try {
endPoint = params[0];
url = new URL(endPoint);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setReadTimeout(15000);
conn.setConnectTimeout(15000);
conn.setRequestMethod("POST");
conn.setRequestProperty("Accept", "" + "application/json");
conn.setDoInput(true);
conn.setDoOutput(true);
String body = params[1];
Log.d(TAG,"body"+body);
OutputStream output = new BufferedOutputStream(conn.getOutputStream());
output.write(body.getBytes());
output.flush();
responseCode=conn.getResponseCode();
if (responseCode == HttpsURLConnection.HTTP_OK) {
String line;
BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream()));
while ((line=br.readLine()) != null) {
response+=line;
}
Log.d(TAG, "" + response);
}
else {
response="";
Log.d("TAG", "" + responseCode);
}
} catch (Exception e) {
e.printStackTrace();
}
return response;
}
@Override
protected void onPostExecute(Object result) {
try {
JSONObject json = new JSONObject(result.toString());
Log.d(TAG,result.toString());
} catch (JSONException e) {
e.printStackTrace();
//Send sms from the Phone
// sendSMSNoData();
}
}
}
}
|
[
"vasilis.fouroulis@veriah.com"
] |
vasilis.fouroulis@veriah.com
|
04ec366d93ec4f9cc85630df83688edf9b5ff76e
|
c94f888541c0c430331110818ed7f3d6b27b788a
|
/yunqing/java/src/main/java/com/antgroup/antchain/openapi/yunqing/models/QuerySolutioninstanceRequest.java
|
3b9961d590cd5ec6d35f1c00738f754d9d929bb0
|
[
"MIT",
"Apache-2.0"
] |
permissive
|
alipay/antchain-openapi-prod-sdk
|
48534eb78878bd708a0c05f2fe280ba9c41d09ad
|
5269b1f55f1fc19cf0584dc3ceea821d3f8f8632
|
refs/heads/master
| 2023-09-03T07:12:04.166131
| 2023-09-01T08:56:15
| 2023-09-01T08:56:15
| 275,521,177
| 9
| 10
|
MIT
| 2021-03-25T02:35:20
| 2020-06-28T06:22:14
|
PHP
|
UTF-8
|
Java
| false
| false
| 1,942
|
java
|
// This file is auto-generated, don't edit it. Thanks.
package com.antgroup.antchain.openapi.yunqing.models;
import com.aliyun.tea.*;
public class QuerySolutioninstanceRequest extends TeaModel {
// OAuth模式下的授权token
@NameInMap("auth_token")
public String authToken;
@NameInMap("product_instance_id")
public String productInstanceId;
// 环境id
@NameInMap("env_id")
@Validation(required = true)
public String envId;
// 当前页码,默认为1。
@NameInMap("page_num")
public Long pageNum;
// 分页大小,默认10,最大100。
//
@NameInMap("page_size")
public Long pageSize;
public static QuerySolutioninstanceRequest build(java.util.Map<String, ?> map) throws Exception {
QuerySolutioninstanceRequest self = new QuerySolutioninstanceRequest();
return TeaModel.build(map, self);
}
public QuerySolutioninstanceRequest setAuthToken(String authToken) {
this.authToken = authToken;
return this;
}
public String getAuthToken() {
return this.authToken;
}
public QuerySolutioninstanceRequest setProductInstanceId(String productInstanceId) {
this.productInstanceId = productInstanceId;
return this;
}
public String getProductInstanceId() {
return this.productInstanceId;
}
public QuerySolutioninstanceRequest setEnvId(String envId) {
this.envId = envId;
return this;
}
public String getEnvId() {
return this.envId;
}
public QuerySolutioninstanceRequest setPageNum(Long pageNum) {
this.pageNum = pageNum;
return this;
}
public Long getPageNum() {
return this.pageNum;
}
public QuerySolutioninstanceRequest setPageSize(Long pageSize) {
this.pageSize = pageSize;
return this;
}
public Long getPageSize() {
return this.pageSize;
}
}
|
[
"sdk-team@alibabacloud.com"
] |
sdk-team@alibabacloud.com
|
540b91488e512166375eb00e6f38f47df7ecfb16
|
f13418785e3717a5745a153f1802e9a7e9da1900
|
/Cultural-content-app/src/test/java/com/ktsnwt/Culturalcontentapp/controller/CulturalOfferSubtypeControllerIntegrationTest.java
|
44e2d8e4a4d568369d6acba18a92339fcfbe00b1
|
[] |
no_license
|
lebozan/KTS-NWT-2020
|
fd4aa6dea8a191ca01308d8bb55ac14eaaeef217
|
abf2374e6fcbc469c85f7361cca734d1b4715168
|
refs/heads/main
| 2023-02-22T13:54:30.466801
| 2021-01-27T22:48:36
| 2021-01-27T22:48:36
| 309,730,427
| 0
| 0
| null | 2021-01-27T22:48:38
| 2020-11-03T15:33:55
|
Java
|
UTF-8
|
Java
| false
| false
| 6,515
|
java
|
package com.ktsnwt.Culturalcontentapp.controller;
import com.ktsnwt.Culturalcontentapp.dto.AuthTokenDTO;
import com.ktsnwt.Culturalcontentapp.dto.CulturalOfferSubtypeDTO;
import com.ktsnwt.Culturalcontentapp.dto.CulturalOfferTypeDTO;
import com.ktsnwt.Culturalcontentapp.dto.LoginDTO;
import com.ktsnwt.Culturalcontentapp.helper.CulturalOfferSubtypePageImpl;
import com.ktsnwt.Culturalcontentapp.helper.CulturalOfferTypePageImpl;
import com.ktsnwt.Culturalcontentapp.service.CulturalOfferSubtypeService;
import com.ktsnwt.Culturalcontentapp.service.CulturalOfferTypeService;
import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.*;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringRunner;
import java.util.List;
import static com.ktsnwt.Culturalcontentapp.constants.CulturalOfferTypeConstants.*;
import static com.ktsnwt.Culturalcontentapp.constants.UserConstants.*;
import static org.junit.jupiter.api.Assertions.*;
import static com.ktsnwt.Culturalcontentapp.constants.CulturalOfferSubtypeConstants.*;
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment= SpringBootTest.WebEnvironment.RANDOM_PORT)
@TestPropertySource("classpath:application-test.properties")
@ActiveProfiles("test")
class CulturalOfferSubtypeControllerIntegrationTest {
@Autowired
CulturalOfferTypeService culturalOfferTypeService;
@Autowired
CulturalOfferSubtypeService culturalOfferSubtypeService;
private String accessToken;
@Autowired
private TestRestTemplate restTemplate;
public void login(String username, String password) {
ResponseEntity<AuthTokenDTO> responseEntity = restTemplate.postForEntity("/auth/login",
new LoginDTO(username,password), AuthTokenDTO.class);
accessToken = "Bearer " + responseEntity.getBody().getAccessToken();
}
@Test
void getAllCulturalOfferSubtypes() {
login(ADMIN_EMAIL1, ADMIN_PASSWORD1);
HttpHeaders headers = new HttpHeaders();
headers.add("Authorization", accessToken);
HttpEntity<Object> httpEntity = new HttpEntity<Object>(headers);
ParameterizedTypeReference<CulturalOfferSubtypePageImpl<CulturalOfferSubtypeDTO>> culturalOfferSubtypePageResponseType =
new ParameterizedTypeReference<CulturalOfferSubtypePageImpl<CulturalOfferSubtypeDTO>>() {};
ResponseEntity<CulturalOfferSubtypePageImpl<CulturalOfferSubtypeDTO>> responseEntity =
restTemplate.exchange("/api/cultural-offer-subtypes?page=0&size=2", HttpMethod.GET, httpEntity, culturalOfferSubtypePageResponseType);
List<CulturalOfferSubtypeDTO> allCulturalOfferTypes = responseEntity.getBody().getContent();
assertEquals(HttpStatus.OK, responseEntity.getStatusCode());
assertNotNull(allCulturalOfferTypes);
assertEquals(SUBTYPE_PAGE_SIZE, allCulturalOfferTypes.size());
}
@Test
void getCulturalOfferSubtype() {
login(ADMIN_EMAIL1, ADMIN_PASSWORD1);
HttpHeaders headers = new HttpHeaders();
headers.add("Authorization", accessToken);
HttpEntity<Object> httpEntity = new HttpEntity<Object>(headers);
ResponseEntity<CulturalOfferSubtypeDTO> responseEntity =
restTemplate.exchange("/api/cultural-offer-subtypes/102", HttpMethod.GET, httpEntity, CulturalOfferSubtypeDTO.class);
CulturalOfferSubtypeDTO culturalOfferSubtype = responseEntity.getBody();
assertEquals(HttpStatus.OK, responseEntity.getStatusCode());
assertNotNull(culturalOfferSubtype);
assertEquals(EXISTING_SUBTYPE_ID, culturalOfferSubtype.getId());
}
@Test
void createCulturalOfferSubtype() {
login(ADMIN_EMAIL1, ADMIN_PASSWORD1);
HttpHeaders headers = new HttpHeaders();
headers.add("Authorization", accessToken);
CulturalOfferSubtypeDTO newSubtype = new CulturalOfferSubtypeDTO();
newSubtype.setName(NEW_SUBTYPE_NAME);
CulturalOfferTypeDTO newSubtypeType = new CulturalOfferTypeDTO();
newSubtypeType.setName(NEW_SUBTYPE_TYPE_NAME);
newSubtype.setType(newSubtypeType);
HttpEntity<Object> httpEntity = new HttpEntity<Object>(newSubtype, headers);
ResponseEntity<CulturalOfferSubtypeDTO> responseEntity =
restTemplate.exchange("/api/cultural-offer-subtypes", HttpMethod.POST, httpEntity, CulturalOfferSubtypeDTO.class);
CulturalOfferSubtypeDTO newCulturalOfferSubtype = responseEntity.getBody();
assertEquals(HttpStatus.OK, responseEntity.getStatusCode());
assertNotNull(newCulturalOfferSubtype);
assertEquals(NEW_SUBTYPE_NAME, newCulturalOfferSubtype.getName());
}
@Test
void updateCulturalOfferSubtype() {
login(ADMIN_EMAIL1, ADMIN_PASSWORD1);
HttpHeaders headers = new HttpHeaders();
headers.add("Authorization", accessToken);
CulturalOfferSubtypeDTO updateDTO = new CulturalOfferSubtypeDTO();
updateDTO.setName(EXISTING_SUBTYPE_NAME_UPDATE);
HttpEntity<Object> httpEntity = new HttpEntity<Object>(updateDTO, headers);
ResponseEntity<CulturalOfferSubtypeDTO> responseEntity =
restTemplate.exchange("/api/cultural-offer-subtypes/102", HttpMethod.PUT, httpEntity, CulturalOfferSubtypeDTO.class);
CulturalOfferSubtypeDTO updatedCulturalOfferSubtype = responseEntity.getBody();
assertEquals(HttpStatus.OK, responseEntity.getStatusCode());
assertNotNull(updatedCulturalOfferSubtype);
assertEquals(EXISTING_SUBTYPE_NAME_UPDATE, updatedCulturalOfferSubtype.getName());
}
@Test
void deleteCulturalOfferSubtype() {
login(ADMIN_EMAIL1, ADMIN_PASSWORD1);
HttpHeaders headers = new HttpHeaders();
headers.add("Authorization", accessToken);
HttpEntity<Object> httpEntity = new HttpEntity<Object>(headers);
ResponseEntity<Void> responseEntity =
restTemplate.exchange("/api/cultural-offer-subtypes/101", HttpMethod.DELETE, httpEntity, Void.class);
assertEquals(HttpStatus.OK, responseEntity.getStatusCode());
}
}
|
[
"cakicbojan@gmail.com"
] |
cakicbojan@gmail.com
|
29f9b1286d2347feb2266f3cc5400b91a3d9b8fb
|
0a54300b63ca08a611b320498adcdc9dbf5b2142
|
/Java Fundamentals/Main Task/3.Вывести заданное количество случайных чисел с переходом и без перехода на новую строку/RandomNumber.java
|
ec2b50b8f448d4983818673190affa80fdf2d9c4
|
[] |
no_license
|
igralex1/EPAM_AutomatedTesting
|
8374125ac29aba1d5730b710637c15432e87639e
|
c350fbbd7f591ea18f47e4d52198abbc10afd83e
|
refs/heads/master
| 2020-11-24T07:39:16.984564
| 2019-12-15T04:28:11
| 2019-12-15T04:28:11
| 228,033,140
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 784
|
java
|
// 3. Вывести заданное количество случайных чисел с переходом и без перехода на новую строку
import java.util.ArrayList;
import java.util.Random;
import java.util.Scanner;
public class RandomNumber {
public static void main(String[] args) {
ArrayList<Integer> randomNumbers = new ArrayList<Integer>();
Random randomNumber = new Random();
System.out.println("How many number do you wnat to see ?");
Scanner in = new Scanner(System.in);
int n = in.nextInt();
for (int i = 0; i < n; i++) {
randomNumbers.add(randomNumber.nextInt(30));
}
for (int el : randomNumbers) {
System.out.println(el);
}
}
}
|
[
"igralex1@gmail.com"
] |
igralex1@gmail.com
|
291a674745a1c618ecd778277de9cce41520e088
|
4fe625fd6958fc1bcff1e94c31717ce25a8ca603
|
/src/main/java/com/lj/iproduct/IproductApplication.java
|
9829bf310ba13fd8cb4de5cc71437c3d6bae91df
|
[] |
no_license
|
Frankeleyns/iproduct
|
ab3865a59f209cb4d07d86073267a8ccd34d0dc5
|
6adc626fae209398de2104fb32ec3bae140b65e1
|
refs/heads/master
| 2022-01-24T04:32:27.114139
| 2018-10-27T11:50:14
| 2018-10-27T11:50:14
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 311
|
java
|
package com.lj.iproduct;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class IproductApplication {
public static void main(String[] args) {
SpringApplication.run(IproductApplication.class, args);
}
}
|
[
"2582726641@qq.com"
] |
2582726641@qq.com
|
7a53a0e279186f8304f602be18d58e8f361bb9c0
|
3eb44f346aeda6e34021e678c6ea09a9a5e577cc
|
/app/build/generated/source/buildConfig/debug/com/granitemountainbhc/recoverytoolkit/BuildConfig.java
|
af10d0c46c38d428e43171aba4eea00a537f1806
|
[] |
no_license
|
granitedev/RecoveryToolKit
|
5e32109a26f8ce1b8fedde72a5c172188ad1c78e
|
f05547d771fa475825019558d146ea93879034c2
|
refs/heads/master
| 2021-07-09T17:08:44.606512
| 2017-10-11T16:50:45
| 2017-10-11T16:50:49
| 105,476,965
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 483
|
java
|
/**
* Automatically generated file. DO NOT MODIFY
*/
package com.granitemountainbhc.recoverytoolkit;
public final class BuildConfig {
public static final boolean DEBUG = Boolean.parseBoolean("true");
public static final String APPLICATION_ID = "com.granitemountainbhc.recoverytoolkit";
public static final String BUILD_TYPE = "debug";
public static final String FLAVOR = "";
public static final int VERSION_CODE = 1;
public static final String VERSION_NAME = "1.0";
}
|
[
"michael.lewis@granitemountainbhc.com"
] |
michael.lewis@granitemountainbhc.com
|
64554495211220beadf9758a1d31dbc135d0fe90
|
0b4dcb28cd8047d6b778d0ca54fb31edbc0a053a
|
/src/main/java/MartinMod/relics/PlaceholderRelic.java
|
c80b021c3f9cef405605c781e412fb11489a4a45
|
[] |
no_license
|
subsistencefarmer/MartinMod
|
d2431fc7400e4479aa8e8f168a896d2a37def6f7
|
359483e10bdd096b4b207e4e97e59237c7691e92
|
refs/heads/master
| 2022-10-24T20:27:37.401361
| 2020-06-14T20:53:59
| 2020-06-14T20:53:59
| 272,281,977
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,450
|
java
|
package MartinMod.relics;
import basemod.abstracts.CustomRelic;
import com.badlogic.gdx.graphics.Texture;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import MartinMod.DefaultMod;
import MartinMod.util.TextureLoader;
import static MartinMod.DefaultMod.makeRelicOutlinePath;
import static MartinMod.DefaultMod.makeRelicPath;
public class PlaceholderRelic extends CustomRelic {
/*
* https://github.com/daviscook477/BaseMod/wiki/Custom-Relics
*
* Gain 1 energy.
*/
// ID, images, text.
public static final String ID = DefaultMod.makeID("PlaceholderRelic");
private static final Texture IMG = TextureLoader.getTexture(makeRelicPath("placeholder_relic.png"));
private static final Texture OUTLINE = TextureLoader.getTexture(makeRelicOutlinePath("placeholder_relic.png"));
public PlaceholderRelic() {
super(ID, IMG, OUTLINE, RelicTier.STARTER, LandingSound.MAGICAL);
}
// Flash at the start of Battle.
@Override
public void atBattleStartPreDraw() {
flash();
}
// Gain 1 energy on equip.
@Override
public void onEquip() {
AbstractDungeon.player.energy.energyMaster += 1;
}
// Lose 1 energy on unequip.
@Override
public void onUnequip() {
AbstractDungeon.player.energy.energyMaster -= 1;
}
// Description
@Override
public String getUpdatedDescription() {
return DESCRIPTIONS[0];
}
}
|
[
"subsistencefarmer@hotmail.com"
] |
subsistencefarmer@hotmail.com
|
aadccff4aa9b63d95036966bbde0faa76dc06891
|
61b012e7e15012b74705656a2817d3856b5bba23
|
/src/main/java/com/czareg/DataProviders.java
|
5ff49ce7ae9ecd69e4c147987ef6f16925e8c780
|
[] |
no_license
|
czarecoo/FunctionalTestNgFramework
|
7662495eae646670bbcab8aa4129c1dfe6452ce8
|
5caa235a894c8b9e2644e094e680ce794205af1f
|
refs/heads/master
| 2020-12-21T04:19:43.174941
| 2020-02-16T11:57:26
| 2020-02-16T11:57:26
| 236,304,282
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 420
|
java
|
package com.czareg;
import org.testng.annotations.DataProvider;
public class DataProviders {
@DataProvider
public static Object[][] BxAndCx() {
return new Object[][] {
{ Configuration.BX },
{ Configuration.CX }
};
}
@DataProvider
public static Object[][] Cx() {
return new Object[][] {
{ Configuration.CX }
};
}
}
|
[
"czarecoo@gmail.com"
] |
czarecoo@gmail.com
|
902f3f0c2d9e80d6b93afeac8e05b6d6aa9f639f
|
52910e4ae17dd531dfc5e38c906c7a436ec5fb4b
|
/Madisonsite/src/test/java/com/htc/madison/extentreport/ExtentManager.java
|
42b587ac94d9a525636625049461e1dbe1e43513
|
[] |
no_license
|
prashant231996/madison
|
01b380d5cab0d4a24b26693db887c25296d17129
|
3846d68f9797f741710c25910b25fea5c09e2e5f
|
refs/heads/master
| 2023-04-10T21:58:14.960941
| 2021-04-08T09:07:20
| 2021-04-08T09:07:20
| 350,316,643
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,088
|
java
|
package com.htc.madison.extentreport;
import java.io.File;
import com.aventstack.extentreports.ExtentReports;
import com.aventstack.extentreports.reporter.ExtentHtmlReporter;
import com.aventstack.extentreports.reporter.configuration.ChartLocation;
import com.aventstack.extentreports.reporter.configuration.Theme;
import com.htc.madison.constants.Constants;
import com.htc.madison.utilites.Utility;
public class ExtentManager {
private static ExtentReports extent;
private static String reportFileName = "Test-Automaton-Report" + ".html";
private static String reportFilepath = Constants.EXTENTREPORT_PATH;
private static String reportFileLocation = reportFilepath + "\\Report" + Utility.getCurrentTime() + ".html";
public static ExtentReports getInstance() {
if (extent == null)
createInstance();
return extent;
}
public static ExtentReports createInstance() {
String fileName = getReportPath(reportFilepath);
ExtentHtmlReporter htmlReporter = new ExtentHtmlReporter(fileName);
htmlReporter.config().setTestViewChartLocation(ChartLocation.BOTTOM);
htmlReporter.config().setChartVisibilityOnOpen(true);
htmlReporter.config().setTheme(Theme.STANDARD);
htmlReporter.config().setDocumentTitle(reportFileName);
htmlReporter.config().setEncoding("utf-8");
htmlReporter.config().setReportName(reportFileName);
htmlReporter.config().setTimeStampFormat("EEEE, MMMM dd, yyyy, hh:mm a '('zzz')'");
extent = new ExtentReports();
extent.attachReporter(htmlReporter);
extent.setSystemInfo("OS", "Windows");
extent.setSystemInfo("AUT", "QA");
return extent;
}
private static String getReportPath(String path) {
File testDirectory = new File(path);
if (!testDirectory.exists()) {
if (testDirectory.mkdir()) {
System.out.println("Directory: " + path + " is created!");
return reportFileLocation;
} else {
System.out.println("Failed to create directory: " + path);
return System.getProperty("user.dir");
}
} else {
System.out.println("Directory already exists: " + path);
}
return reportFileLocation;
}
}
|
[
"h@hp"
] |
h@hp
|
6b3adaf54d0b01862728733c6f649ca1d93f7e03
|
84cad0afa643c446a51123831dbcfde6c9d926a9
|
/mes-root/mes-auto-core/src/main/java/com/hengyi/japp/mes/auto/interfaces/jikon/event/JikonAdapterSilkCarInfoFetchEvent.java
|
bd6e219aedb02923e59eae6728e2ac708f60830d
|
[] |
no_license
|
HengYi-JAPP/mes
|
280e62a92703c926a9cb5002b25365af9e498fe8
|
c34aa362df7972a5c5ed0c65a7eb1a8b24a9437b
|
refs/heads/master
| 2023-03-10T07:41:43.617327
| 2022-11-15T03:11:17
| 2022-11-15T03:11:17
| 164,339,876
| 1
| 1
| null | 2023-03-02T19:48:58
| 2019-01-06T19:46:43
|
Java
|
UTF-8
|
Java
| false
| false
| 2,917
|
java
|
package com.hengyi.japp.mes.auto.interfaces.jikon.event;
import com.fasterxml.jackson.databind.JsonNode;
import com.github.ixtf.japp.vertx.Jvertx;
import com.hengyi.japp.mes.auto.application.event.EventSource;
import com.hengyi.japp.mes.auto.application.event.EventSourceType;
import com.hengyi.japp.mes.auto.domain.Operator;
import com.hengyi.japp.mes.auto.domain.SilkRuntime;
import com.hengyi.japp.mes.auto.repository.OperatorRepository;
import io.reactivex.Completable;
import io.reactivex.Single;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.security.Principal;
import java.util.Collection;
import static com.github.ixtf.japp.core.Constant.MAPPER;
/**
* @author jzb 2018-06-21
*/
@Data
@EqualsAndHashCode(callSuper = true, onlyExplicitlyIncluded = true)
public class JikonAdapterSilkCarInfoFetchEvent extends EventSource {
private JsonNode command;
private String result;
@Override
public Collection<SilkRuntime> _calcSilkRuntimes(Collection<SilkRuntime> data) {
return data;
}
@Override
protected Completable _undo(Operator operator) {
throw new IllegalAccessError();
}
@Override
public EventSourceType getType() {
return EventSourceType.JikonAdapterSilkCarInfoFetchEvent;
}
@Override
public JsonNode toJsonNode() {
final DTO dto = MAPPER.convertValue(this, DTO.class);
return MAPPER.convertValue(dto, JsonNode.class);
}
@Data
@ToString(onlyExplicitlyIncluded = true)
@EqualsAndHashCode(callSuper = true, onlyExplicitlyIncluded = true)
public static class DTO extends EventSource.DTO {
private JsonNode command;
private String result;
public static DTO from(JsonNode jsonNode) {
return MAPPER.convertValue(jsonNode, DTO.class);
}
public Single<JikonAdapterSilkCarInfoFetchEvent> toEvent() {
final JikonAdapterSilkCarInfoFetchEvent event = new JikonAdapterSilkCarInfoFetchEvent();
event.setCommand(command);
event.setResult(result);
return toEvent(event);
}
}
/**
* @author jzb 2018-11-07
*/
@Data
public static class Command implements Serializable {
@NotBlank
private String silkcarCode;
public Single<JikonAdapterSilkCarInfoFetchEvent> toEvent(Principal principal) {
final OperatorRepository operatorRepository = Jvertx.getProxy(OperatorRepository.class);
final JikonAdapterSilkCarInfoFetchEvent event = new JikonAdapterSilkCarInfoFetchEvent();
event.setCommand(MAPPER.convertValue(this, JsonNode.class));
return operatorRepository.find(principal).map(it -> {
event.fire(it);
return event;
});
}
}
}
|
[
"ixtf1984@gmail.com"
] |
ixtf1984@gmail.com
|
b371701f49561fd8f449bf53ac8cb0b06b4d8474
|
04e336f3f6bb883b00d0ce0585d30109ab8ded62
|
/main/java/com/github/alexthe666/rats/client/model/ModelPinkie.java
|
033dfa6b4cb2f15c5231b413ba843f0717132216
|
[] |
no_license
|
FuzWig/RatsModUpdate
|
2d50658a9262b5af3b2a0fb175d51bf576cd8508
|
43e7fb00e47d613edc496b07e9a879208bfa4b34
|
refs/heads/main
| 2023-07-19T18:40:50.160339
| 2021-09-07T01:38:56
| 2021-09-07T01:38:56
| 403,805,642
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,553
|
java
|
package com.github.alexthe666.rats.client.model;
import com.github.alexthe666.citadel.animation.IAnimatedEntity;
import com.github.alexthe666.citadel.client.model.AdvancedEntityModel;
import com.github.alexthe666.citadel.client.model.AdvancedModelBox;
import com.github.alexthe666.rats.server.entity.EntityRat;
import com.google.common.collect.ImmutableList;
import net.minecraft.client.renderer.model.ModelRenderer;
public class ModelPinkie<T extends EntityRat> extends AdvancedEntityModel<T>{
public AdvancedModelBox body;
public ModelPinkie() {
super();
this.textureWidth = 16;
this.textureHeight = 16;
this.body = new AdvancedModelBox(this, 0, 0);
this.body.setRotationPoint(0.0F, 23.0F, 0.0F);
this.body.addBox(-1.0F, -1.0F, -2.0F, 2, 2, 4, 0.0F);
this.updateDefaultPose();
}
@Override
public Iterable<AdvancedModelBox> getAllParts() {
return ImmutableList.of(body);
}
@Override
public Iterable<ModelRenderer> getParts() {
return ImmutableList.of(body);
}
public void animate(IAnimatedEntity entity, float f, float f1, float f2, float f3, float f4) {
this.resetToDefaultPose();
}
public void setRotationAngles(EntityRat rat, float f, float f1, float f2, float f3, float f4) {
float speedIdle = 0.35F;
float degreeIdle = 0.15F;
animate((IAnimatedEntity) rat, f, f1, f2, f3, f4);
this.swing(this.body, speedIdle * 1.5F, degreeIdle * 1.5F, true, 0, 0F, rat.ticksExisted, 1);
}
}
|
[
"90226960+FuzWig@users.noreply.github.com"
] |
90226960+FuzWig@users.noreply.github.com
|
5ca346feb4c5698617251aeafc51ff3c50a12e68
|
d4005a7e9ee5e8421bfa5e614c67c06350df0fa5
|
/Programmierung/Transshipment/src/applications/transshipment/model/schedule/scheduleSchemes/priorityrules/operations/EarliestFinishTimeRule.java
|
c1d3ffd54210560a11f52b27eda6c1c115705496
|
[] |
no_license
|
matthiasbode/multiskalen
|
cccf4ea7473f5362fd4d015881304d03baf15b79
|
fb555ce9aa49a0e8d80a5688e5106701c36e737f
|
refs/heads/master
| 2021-01-18T23:26:29.775565
| 2016-07-08T20:11:19
| 2016-07-08T20:11:19
| 34,849,433
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,609
|
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 applications.transshipment.model.schedule.scheduleSchemes.priorityrules.operations;
import applications.mmrcsp.model.basics.ActivityOnNodeGraph;
import applications.mmrcsp.model.operations.Operation;
import applications.mmrcsp.model.restrictions.precedence.EarliestAndLatestStartsAndEnds;
import applications.mmrcsp.model.schedule.Schedule;
import java.util.Collection;
import java.util.Map;
import math.FieldElement;
/**
* Sortiert RoutingTransportOperations dahingehend, dass die Operationen mit der
* geringsten frühsten Endzeit vorne in der Liste zu finden sind.
*
* @author bode
*/
public class EarliestFinishTimeRule<E extends Operation> implements OperationRules<E> {
Map<E, EarliestAndLatestStartsAndEnds> ealosaes;
@Override
public int compare(E o1, E o2) {
FieldElement earliestOperationEnd1 = ealosaes.get(o1).getEarliestEnd();
FieldElement earliestOperationEnd2 = ealosaes.get(o2).getEarliestEnd();
if (earliestOperationEnd1.equals(earliestOperationEnd2)) {
return 0;
}
return earliestOperationEnd1.isLowerThan(earliestOperationEnd2) ? -1 : 1;
}
@Override
public void setAdditionalInformation(Schedule schedule, Collection<E> operationsToSchedule,Map<E, EarliestAndLatestStartsAndEnds> ealosaes, ActivityOnNodeGraph<E> graph) {
if (ealosaes != null) {
this.ealosaes = ealosaes;
}
}
}
|
[
"mail@matthiasbo.de"
] |
mail@matthiasbo.de
|
fe666214501111670a279e2ed099c7fe398fd07c
|
070f699f435bf666f0d2f1960119924068fad0b3
|
/projects/jzbot2-old/src/net/sf/opengroove/common/proxystorage/Search.java
|
df652803a6e70765b7c4a5d6e10f4832a3f38cdb
|
[] |
no_license
|
javawizard/afn
|
049e510069b2eaf39ac10560f8c706ff5aa74277
|
d9d95e24673794a20bb8138ce44d5bac236e07ed
|
refs/heads/master
| 2016-09-06T06:53:28.872368
| 2013-09-19T08:12:52
| 2013-09-19T08:12:52
| 3,390,850
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,085
|
java
|
package net.sf.opengroove.common.proxystorage;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* Methods on an object annotated with ProxyBean can be annotated with this to
* indicate that the method is a search method. When the method is called,
* objects in a particular stored list on that object will be searched, and a
* list of those, or the first match, depending on whether the return type for
* the method is an array of the object or a single instance of the object, will
* be returned. The return type of the search method should either be the list
* type of the list to search, or an array of the list type of the list to
* search.
*
* @author Alexander Boyd
*
*/
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface Search
{
/**
* The name of the property on the interface that contains the method
* annotated with this annotation that is a StoredList, and is the list to
* be searched.
*
* @return
*/
public String listProperty();
/**
* The name of the property that contains the data to be searched. This is a
* property that should be present on the component type of the stored list
* to search.
*
* If, for some reason, this search wishes to operate on the proxy storage
* built-in id, then this string can be the literal "proxystorage_id", and
* the search method's argument must be of type long.
*
* @return
*/
public String searchProperty();
/**
* Whether or not the search must be exact. This is treated as if it were
* true for all types other than String. If it is true, then the value
* passed into the search method must be exactly equal to the search
* property in order for the object to be included in the result list. If it
* is false (it can only be false if the list property is a string), then
* the list property need only be equal to the search string as determined
* by the SQL "like" keyword (with asterisks in the search string replaced
* with the percent sign) for a particular element to be included in the
* result list.
*
* @return
*/
public boolean exact() default true;
/**
* This is only used if {@link #exact()} is false (and, by extension, the
* property type annotated is a string). If this is true, then the string is
* prefixed and suffixed with asterisks, thereby making it so that a search
* string can appear anywhere within the target property, instead of needing
* to match starting exactly at the beginning and ending exactly at the end.
* For example, with this equal to false, the string "abc*ghi" would match
* "abcdefghi" but not "123abcdefghijkl" or "123abcdefghi". With this set to
* true, however, all of the examples mentioned would match.
* @return
*/
public boolean anywhere() default false;
}
|
[
"javawizard@trivergia.com@9038e2a8-f00e-11dd-89c5-9df526a60542"
] |
javawizard@trivergia.com@9038e2a8-f00e-11dd-89c5-9df526a60542
|
6bd63760649321e21db7d1575ba99a570a86a667
|
d2a2af81c9c10ea78b4e69f5439d89eade407fed
|
/app/src/test/java/com/example/day9homework/ExampleUnitTest.java
|
50383b8f57606b34a98e7782407db1d1dc75f50a
|
[] |
no_license
|
ShangShuang/day9homework
|
4ab9ef3f772e723749ffe2c248cee4b52df4f352
|
26be209b17fee6cf2ce77bf97d7bbcca3ece59dd
|
refs/heads/master
| 2022-11-26T01:26:31.124434
| 2020-07-21T08:01:27
| 2020-07-21T08:01:27
| 281,334,421
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 385
|
java
|
package com.example.day9homework;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}
|
[
"www.2224745900@qq.com"
] |
www.2224745900@qq.com
|
bf60e86431af277e197c12e477bdbdb83285ee6e
|
84dad2fa8e7a1be1841ef9985254af539bcac3de
|
/src/com/hiasenna/shejimoshi/Single.java
|
6e54dd9ebab918d04119f9afbc0d2c6966c1535a
|
[] |
no_license
|
zhanghaoyu2017/Leetcode
|
cf18c326f0b800643109ce573ec866c23ee7dba7
|
9ebc402dafa80859fd77c61056e801cabcb9baae
|
refs/heads/master
| 2023-02-24T12:21:33.461183
| 2021-02-02T03:28:22
| 2021-02-02T03:28:22
| 335,156,960
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 544
|
java
|
package com.hiasenna.shejimoshi;
/**
* @ClassName Single
* @Description T0D0
* @Author zhanghaoyu
* @Date 2020/8/12-10:15
* @Version 1.0
**/
public class Single {
public static void main(String[] args) {
Singleton singleton1 = Singleton.getInstance();
Singleton singleton2 = Singleton.getInstance();
System.out.println(singleton1 == singleton2);
}
}
class Singleton {
private static Singleton instance = new Singleton();
public static Singleton getInstance() {
return instance;
}
}
|
[
"273903932@qq.com"
] |
273903932@qq.com
|
428c3d303f5f9b46595b76ec1b14913b3dfaa398
|
5d7b7c9c49c3808bb638b986a00a87dabb3f4361
|
/boot/security-redis-jpa-restdoc-swagger-jwt-email-angular-thymeleaf-multi/cores/core/src/main/java/com/ceragem/iot/core/domain/base/UserBase.java
|
1651ca733c4a76a72803207e4f5804107e70cbc5
|
[] |
no_license
|
kopro-ov/lib-spring
|
f4e67f8d9e81f9ec4cfbf190e30479013a2bcc1c
|
89e7d4b9a6318138d24f81e4e0fc2646f2d6a3d5
|
refs/heads/master
| 2023-04-04T07:56:14.312704
| 2021-02-15T01:59:59
| 2021-02-15T01:59:59
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,603
|
java
|
package com.ceragem.iot.core.domain.base;
import com.ceragem.iot.core.model.ModelBase;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.persistence.PrePersist;
import java.io.Serializable;
import java.time.ZonedDateTime;
@Getter
@Setter
@MappedSuperclass
@EqualsAndHashCode(callSuper = false)
public class UserBase extends ModelBase implements Serializable {
@Id
@Column(name = "no")
Long no;
@Column(name = "login_type")
String login_type;
@Column(name = "id")
String id;
@Column(name = "email")
String email;
@Column(name = "name")
String name;
@Column(name = "image")
String image;
@Column(name = "phone")
String phone;
@Column(name = "join_channel")
String joinChannel;
@Column(name = "birth")
ZonedDateTime birth;
@Column(name = "join_date")
ZonedDateTime joinDate;
@Column(name = "last_login_date")
ZonedDateTime lastLoginDate;
@Column(name = "is_push")
Long isPush;
@Column(name = "machine_add_count")
Long machineAddCount;
@Column(name = "machine_use_count")
Long machineUseCount;
@Column(name = "is_machine_add")
Long isMachineAdd;
@Column(name = "machine_req_reg_date")
ZonedDateTime machineReqRegDate;
@Column(name = "total_mileage_point")
Long totalMileagePoint;
@Column(name = "total_use_second")
Long totalUseSecond;
@PrePersist
protected void onCreate() {
}
}
|
[
"visualkhh@gmail.com"
] |
visualkhh@gmail.com
|
e8ed25ee1e68da7824aa200fc296b70b75763fad
|
2f7606008e13ff31f1bff9a65835488c333fe8c5
|
/avrora/src/main/java/avrora/avrora/syntax/atmel/AtmelParser.java
|
d31f1ddde0970779df4554e29c8a0bfceab402d7
|
[] |
no_license
|
avrora-framework/avrora-cvsimport-with-branch-merged
|
2613c398dee1ec22a4c2b8fca5061d797b539917
|
78ec289ec4f2142e008c3b5ec858f1bf753447d0
|
refs/heads/master
| 2020-12-11T04:06:49.715675
| 2015-07-01T16:16:02
| 2015-07-01T16:16:02
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 61,399
|
java
|
/* Generated By:JavaCC: Do not edit this line. AtmelParser.java */
package avrora.avrora.syntax.atmel;
import java.io.InputStream;
import java.util.Enumeration;
import java.util.Vector;
import avrora.avrora.syntax.AbstractParser;
import avrora.avrora.syntax.Expr;
import avrora.avrora.syntax.ExprList;
import avrora.avrora.syntax.Module;
import avrora.avrora.syntax.SyntacticOperand;
import avrora.cck.parser.SimpleCharStream;
public class AtmelParser extends AbstractParser implements AtmelParserConstants
{
public AtmelParser(InputStream stream, Module m, String fname)
{
this(new FileMarkingTokenManager(new SimpleCharStream(stream, 1, 1),
fname));
module = m;
}
/* Begin GRAMMAR */
public void Module() throws ParseException
{
label_1: while (true)
{
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
{
case ADD:
case ADC:
case ADIW:
case AND:
case ANDI:
case ASR:
case BCLR:
case BLD:
case BRBC:
case BRBS:
case BRCC:
case BRCS:
case BREAK:
case BREQ:
case BRGE:
case BRHC:
case BRHS:
case BRID:
case BRIE:
case BRLO:
case BRLT:
case BRMI:
case BRNE:
case BRPL:
case BRSH:
case BRTC:
case BRTS:
case BRVC:
case BRVS:
case BSET:
case BST:
case CALL:
case CBI:
case CBR:
case CLC:
case CLH:
case CLI:
case CLN:
case CLR:
case CLS:
case CLT:
case CLV:
case CLZ:
case COM:
case CP:
case CPC:
case CPI:
case CPSE:
case DEC:
case EICALL:
case EIJMP:
case ELPM:
case EOR:
case FMUL:
case FMULS:
case FMULSU:
case ICALL:
case IJMP:
case IN:
case INC:
case JMP:
case LD:
case LDD:
case LDI:
case LDS:
case LPM:
case LSL:
case LSR:
case MOV:
case MOVW:
case MUL:
case MULS:
case MULSU:
case NEG:
case NOP:
case OR:
case ORI:
case OUT:
case POP:
case PUSH:
case RCALL:
case RET:
case RETI:
case RJMP:
case ROL:
case ROR:
case SBC:
case SBCI:
case SBI:
case SBIC:
case SBIS:
case SBIW:
case SBR:
case SBRC:
case SBRS:
case SEC:
case SEH:
case SEI:
case SEN:
case SER:
case SES:
case SET:
case SEV:
case SEZ:
case SLEEP:
case SPM:
case ST:
case STD:
case STS:
case SUB:
case SUBI:
case SWAP:
case TST:
case WDR:
case IDENTIFIER:
case 149:
case 151:
case 152:
case 153:
case 154:
case 155:
case 156:
case 157:
case 159:
case 160:
case 161:
case 162:
case 163:
break;
default:
jj_la1[0] = jj_gen;
break label_1;
}
Statement();
}
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
{
case 0:
jj_consume_token(0);
break;
case 158:
ExitDirective();
break;
default:
jj_la1[1] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
public void Statement() throws ParseException
{
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
{
case 149:
case 151:
case 152:
case 153:
case 154:
case 155:
case 156:
case 157:
case 159:
case 160:
case 161:
case 162:
case 163:
Directive();
break;
case ADD:
case ADC:
case ADIW:
case AND:
case ANDI:
case ASR:
case BCLR:
case BLD:
case BRBC:
case BRBS:
case BRCC:
case BRCS:
case BREAK:
case BREQ:
case BRGE:
case BRHC:
case BRHS:
case BRID:
case BRIE:
case BRLO:
case BRLT:
case BRMI:
case BRNE:
case BRPL:
case BRSH:
case BRTC:
case BRTS:
case BRVC:
case BRVS:
case BSET:
case BST:
case CALL:
case CBI:
case CBR:
case CLC:
case CLH:
case CLI:
case CLN:
case CLR:
case CLS:
case CLT:
case CLV:
case CLZ:
case COM:
case CP:
case CPC:
case CPI:
case CPSE:
case DEC:
case EICALL:
case EIJMP:
case ELPM:
case EOR:
case FMUL:
case FMULS:
case FMULSU:
case ICALL:
case IJMP:
case IN:
case INC:
case JMP:
case LD:
case LDD:
case LDI:
case LDS:
case LPM:
case LSL:
case LSR:
case MOV:
case MOVW:
case MUL:
case MULS:
case MULSU:
case NEG:
case NOP:
case OR:
case ORI:
case OUT:
case POP:
case PUSH:
case RCALL:
case RET:
case RETI:
case RJMP:
case ROL:
case ROR:
case SBC:
case SBCI:
case SBI:
case SBIC:
case SBIS:
case SBIW:
case SBR:
case SBRC:
case SBRS:
case SEC:
case SEH:
case SEI:
case SEN:
case SER:
case SES:
case SET:
case SEV:
case SEZ:
case SLEEP:
case SPM:
case ST:
case STD:
case STS:
case SUB:
case SUBI:
case SWAP:
case TST:
case WDR:
Instruction();
break;
case IDENTIFIER:
Label();
break;
default:
jj_la1[2] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
public void Directive() throws ParseException
{
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
{
case 149:
EquDirective();
break;
case 151:
OrgDirective();
break;
case 152:
ReserveDirective();
break;
case 153:
case 154:
case 155:
DataDirective();
break;
case 156:
DefDirective();
break;
case 157:
IncludeDirective();
break;
case 159:
NoListDirective();
break;
case 160:
ListDirective();
break;
case 161:
case 162:
case 163:
SegDirective();
break;
default:
jj_la1[3] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
public void Instruction() throws ParseException
{
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
{
case ADD:
case ADC:
case AND:
case CP:
case CPC:
case CPSE:
case EOR:
case FMUL:
case FMULS:
case FMULSU:
case MOV:
case MOVW:
case MUL:
case MULS:
case MULSU:
case OR:
case SBC:
case SUB:
InstrGPRGPR();
break;
case ASR:
case CLR:
case COM:
case DEC:
case INC:
case LSL:
case LSR:
case NEG:
case POP:
case PUSH:
case ROL:
case ROR:
case SER:
case SWAP:
case TST:
InstrGPR();
break;
case ADIW:
case ANDI:
case BLD:
case BST:
case CBR:
case CPI:
case ORI:
case SBCI:
case SBIW:
case SBR:
case SBRC:
case SBRS:
case SUBI:
InstrGPRIMM();
break;
case BCLR:
case BRCC:
case BRCS:
case BREQ:
case BRGE:
case BRHC:
case BRHS:
case BRID:
case BRIE:
case BRLO:
case BRLT:
case BRMI:
case BRNE:
case BRPL:
case BRSH:
case BRTC:
case BRTS:
case BRVC:
case BRVS:
case BSET:
case CALL:
case JMP:
case RCALL:
case RJMP:
InstrIMM();
break;
case BRBC:
case BRBS:
case CBI:
case SBI:
case SBIC:
case SBIS:
InstrIMMIMM();
break;
case BREAK:
case CLC:
case CLH:
case CLI:
case CLN:
case CLS:
case CLT:
case CLV:
case CLZ:
case EICALL:
case EIJMP:
case ICALL:
case IJMP:
case NOP:
case RET:
case RETI:
case SEC:
case SEH:
case SEI:
case SEN:
case SES:
case SET:
case SEV:
case SEZ:
case SLEEP:
case SPM:
case WDR:
InstrBARE();
break;
case ELPM:
case LD:
case LDD:
case LDI:
case LDS:
case LPM:
InstrLoad();
break;
case ST:
case STD:
case STS:
InstrStore();
break;
case IN:
InstrInput();
break;
case OUT:
InstrOutput();
break;
default:
jj_la1[4] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
public void InstrGPRGPR() throws ParseException
{
Token t;
SyntacticOperand.Register r1, r2;
t = OpcodeGPRGPR();
r1 = Register();
jj_consume_token(145);
r2 = Register();
module.addInstruction(t.image, t, r1, r2);
}
public Token OpcodeGPRGPR() throws ParseException
{
Token t;
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
{
case ADD:
t = jj_consume_token(ADD);
break;
case ADC:
t = jj_consume_token(ADC);
break;
case SUB:
t = jj_consume_token(SUB);
break;
case SBC:
t = jj_consume_token(SBC);
break;
case AND:
t = jj_consume_token(AND);
break;
case OR:
t = jj_consume_token(OR);
break;
case EOR:
t = jj_consume_token(EOR);
break;
case MUL:
t = jj_consume_token(MUL);
break;
case MULS:
t = jj_consume_token(MULS);
break;
case MULSU:
t = jj_consume_token(MULSU);
break;
case FMUL:
t = jj_consume_token(FMUL);
break;
case FMULS:
t = jj_consume_token(FMULS);
break;
case FMULSU:
t = jj_consume_token(FMULSU);
break;
case CPSE:
t = jj_consume_token(CPSE);
break;
case CP:
t = jj_consume_token(CP);
break;
case CPC:
t = jj_consume_token(CPC);
break;
case MOV:
t = jj_consume_token(MOV);
break;
case MOVW:
t = jj_consume_token(MOVW);
break;
default:
jj_la1[5] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
return t;
}
public void InstrGPR() throws ParseException
{
Token t;
SyntacticOperand.Register r1;
t = OpcodeGPR();
r1 = Register();
module.addInstruction(t.image, t, r1);
}
public Token OpcodeGPR() throws ParseException
{
Token t;
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
{
case COM:
t = jj_consume_token(COM);
break;
case NEG:
t = jj_consume_token(NEG);
break;
case INC:
t = jj_consume_token(INC);
break;
case DEC:
t = jj_consume_token(DEC);
break;
case TST:
t = jj_consume_token(TST);
break;
case CLR:
t = jj_consume_token(CLR);
break;
case SER:
t = jj_consume_token(SER);
break;
case PUSH:
t = jj_consume_token(PUSH);
break;
case POP:
t = jj_consume_token(POP);
break;
case LSL:
t = jj_consume_token(LSL);
break;
case LSR:
t = jj_consume_token(LSR);
break;
case ROL:
t = jj_consume_token(ROL);
break;
case ROR:
t = jj_consume_token(ROR);
break;
case ASR:
t = jj_consume_token(ASR);
break;
case SWAP:
t = jj_consume_token(SWAP);
break;
default:
jj_la1[6] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
return t;
}
public void InstrGPRIMM() throws ParseException
{
Token t;
SyntacticOperand.Register r1;
SyntacticOperand.Expr c1;
t = OpcodeGPRIMM();
r1 = Register();
jj_consume_token(145);
c1 = Const();
module.addInstruction(t.image, t, r1, c1);
}
public Token OpcodeGPRIMM() throws ParseException
{
Token t;
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
{
case ADIW:
t = jj_consume_token(ADIW);
break;
case SUBI:
t = jj_consume_token(SUBI);
break;
case SBCI:
t = jj_consume_token(SBCI);
break;
case SBIW:
t = jj_consume_token(SBIW);
break;
case ANDI:
t = jj_consume_token(ANDI);
break;
case ORI:
t = jj_consume_token(ORI);
break;
case SBR:
t = jj_consume_token(SBR);
break;
case CBR:
t = jj_consume_token(CBR);
break;
case CPI:
t = jj_consume_token(CPI);
break;
case SBRC:
t = jj_consume_token(SBRC);
break;
case SBRS:
t = jj_consume_token(SBRS);
break;
case BST:
t = jj_consume_token(BST);
break;
case BLD:
t = jj_consume_token(BLD);
break;
default:
jj_la1[7] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
return t;
}
public void InstrIMM() throws ParseException
{
Token t;
SyntacticOperand.Expr c1;
t = OpcodeIMM();
c1 = Const();
module.addInstruction(t.image, t, c1);
}
public Token OpcodeIMM() throws ParseException
{
Token t;
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
{
case RJMP:
t = jj_consume_token(RJMP);
break;
case JMP:
t = jj_consume_token(JMP);
break;
case RCALL:
t = jj_consume_token(RCALL);
break;
case CALL:
t = jj_consume_token(CALL);
break;
case BREQ:
t = jj_consume_token(BREQ);
break;
case BRNE:
t = jj_consume_token(BRNE);
break;
case BRCS:
t = jj_consume_token(BRCS);
break;
case BRCC:
t = jj_consume_token(BRCC);
break;
case BRSH:
t = jj_consume_token(BRSH);
break;
case BRLO:
t = jj_consume_token(BRLO);
break;
case BRMI:
t = jj_consume_token(BRMI);
break;
case BRPL:
t = jj_consume_token(BRPL);
break;
case BRGE:
t = jj_consume_token(BRGE);
break;
case BRLT:
t = jj_consume_token(BRLT);
break;
case BRHS:
t = jj_consume_token(BRHS);
break;
case BRHC:
t = jj_consume_token(BRHC);
break;
case BRTS:
t = jj_consume_token(BRTS);
break;
case BRTC:
t = jj_consume_token(BRTC);
break;
case BRVS:
t = jj_consume_token(BRVS);
break;
case BRVC:
t = jj_consume_token(BRVC);
break;
case BRIE:
t = jj_consume_token(BRIE);
break;
case BRID:
t = jj_consume_token(BRID);
break;
case BSET:
t = jj_consume_token(BSET);
break;
case BCLR:
t = jj_consume_token(BCLR);
break;
default:
jj_la1[8] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
return t;
}
public void InstrIMMIMM() throws ParseException
{
Token t;
SyntacticOperand.Expr c1, c2;
t = OpcodeIMMIMM();
c1 = Const();
jj_consume_token(145);
c2 = Const();
module.addInstruction(t.image, t, c1, c2);
}
public Token OpcodeIMMIMM() throws ParseException
{
Token t;
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
{
case SBIC:
t = jj_consume_token(SBIC);
break;
case SBIS:
t = jj_consume_token(SBIS);
break;
case BRBS:
t = jj_consume_token(BRBS);
break;
case BRBC:
t = jj_consume_token(BRBC);
break;
case SBI:
t = jj_consume_token(SBI);
break;
case CBI:
t = jj_consume_token(CBI);
break;
default:
jj_la1[9] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
return t;
}
public void InstrLoad() throws ParseException
{
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
{
case LDI:
InstrLDI();
break;
case LD:
InstrLD_variant();
break;
case LDD:
InstrLDD();
break;
case LDS:
InstrLDS();
break;
case ELPM:
case LPM:
InstrLPM_variant();
break;
default:
jj_la1[10] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
public void InstrLDI() throws ParseException
{
Token t;
SyntacticOperand.Register r1;
SyntacticOperand.Expr c1;
t = jj_consume_token(LDI);
r1 = Register();
jj_consume_token(145);
c1 = Const();
module.addInstruction(t.image, t, r1, c1);
}
public void InstrLD_variant() throws ParseException
{
if (jj_2_1(5))
{
InstrLDPI();
} else if (jj_2_2(4))
{
InstrLDPD();
} else
{
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
{
case LD:
InstrLD();
break;
default:
jj_la1[11] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
}
public void InstrLD() throws ParseException
{
Token t;
SyntacticOperand.Register r1, r2;
t = jj_consume_token(LD);
r1 = Register();
jj_consume_token(145);
r2 = Register();
module.addInstruction("ld", t, r1, r2);
}
public void InstrLDPI() throws ParseException
{
Token t;
SyntacticOperand.Register r1, r2;
t = jj_consume_token(LD);
r1 = Register();
jj_consume_token(145);
r2 = Register();
jj_consume_token(146);
module.addInstruction("ldpi", t, r1, r2);
}
public void InstrLDPD() throws ParseException
{
Token t;
SyntacticOperand.Register r1, r2;
t = jj_consume_token(LD);
r1 = Register();
jj_consume_token(145);
jj_consume_token(147);
r2 = Register();
module.addInstruction("ldpd", t, r1, r2);
}
public void InstrLDD() throws ParseException
{
Token t;
SyntacticOperand.Register r1, r2;
SyntacticOperand.Expr c1;
t = jj_consume_token(LDD);
r1 = Register();
jj_consume_token(145);
r2 = Register();
jj_consume_token(146);
c1 = Const();
module.addInstruction(t.image, t, r1, r2, c1);
}
public void InstrLDS() throws ParseException
{
Token t;
SyntacticOperand.Register r1;
SyntacticOperand.Expr c1;
t = jj_consume_token(LDS);
r1 = Register();
jj_consume_token(145);
c1 = Const();
module.addInstruction(t.image, t, r1, c1);
}
public void InstrLPM_variant() throws ParseException
{
if (jj_2_3(5))
{
InstrLPMGPRGPRP();
} else if (jj_2_4(3))
{
InstrLPMGPRGPR();
} else
{
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
{
case ELPM:
case LPM:
InstrLPMBARE();
break;
default:
jj_la1[12] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
}
public void InstrLPMGPRGPR() throws ParseException
{
Token t;
SyntacticOperand.Register r1, r2;
t = OpcodeLPM();
r1 = Register();
jj_consume_token(145);
r2 = Register();
module.addInstruction(t.image + 'd', t, r1, r2);
}
public void InstrLPMGPRGPRP() throws ParseException
{
Token t;
SyntacticOperand.Register r1, r2;
t = OpcodeLPM();
r1 = Register();
jj_consume_token(145);
r2 = Register();
jj_consume_token(146);
module.addInstruction(t.image + "pi", t, r1, r2);
}
public void InstrLPMBARE() throws ParseException
{
Token t;
t = OpcodeLPM();
module.addInstruction(t.image, t);
}
public Token OpcodeLPM() throws ParseException
{
Token t;
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
{
case LPM:
t = jj_consume_token(LPM);
break;
case ELPM:
t = jj_consume_token(ELPM);
break;
default:
jj_la1[13] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
return t;
}
public void InstrStore() throws ParseException
{
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
{
case ST:
InstrST_variant();
break;
case STD:
InstrSTD();
break;
case STS:
InstrSTS();
break;
default:
jj_la1[14] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
public void InstrST_variant() throws ParseException
{
if (jj_2_5(3))
{
InstrST();
} else if (jj_2_6(3))
{
InstrSTPI();
} else
{
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
{
case ST:
InstrSTPD();
break;
default:
jj_la1[15] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
}
public void InstrST() throws ParseException
{
Token t;
SyntacticOperand.Register r1, r2;
t = jj_consume_token(ST);
r1 = Register();
jj_consume_token(145);
r2 = Register();
module.addInstruction("st", t, r1, r2);
}
public void InstrSTPI() throws ParseException
{
Token t;
SyntacticOperand.Register r1, r2;
t = jj_consume_token(ST);
r1 = Register();
jj_consume_token(146);
jj_consume_token(145);
r2 = Register();
module.addInstruction("stpi", t, r1, r2);
}
public void InstrSTPD() throws ParseException
{
Token t;
SyntacticOperand.Register r1, r2;
t = jj_consume_token(ST);
jj_consume_token(147);
r1 = Register();
jj_consume_token(145);
r2 = Register();
module.addInstruction("stpd", t, r1, r2);
}
public void InstrSTD() throws ParseException
{
Token t;
SyntacticOperand.Register r1, r2;
SyntacticOperand.Expr c1;
t = jj_consume_token(STD);
r1 = Register();
jj_consume_token(146);
c1 = Const();
jj_consume_token(145);
r2 = Register();
module.addInstruction(t.image, t, r1, c1, r2);
}
public void InstrSTS() throws ParseException
{
Token t;
SyntacticOperand.Register r1;
SyntacticOperand.Expr c1;
t = jj_consume_token(STS);
c1 = Const();
jj_consume_token(145);
r1 = Register();
module.addInstruction(t.image, t, c1, r1);
}
public void InstrBARE() throws ParseException
{
Token t;
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
{
case IJMP:
t = jj_consume_token(IJMP);
break;
case ICALL:
t = jj_consume_token(ICALL);
break;
case RET:
t = jj_consume_token(RET);
break;
case RETI:
t = jj_consume_token(RETI);
break;
case SEC:
t = jj_consume_token(SEC);
break;
case CLC:
t = jj_consume_token(CLC);
break;
case SEN:
t = jj_consume_token(SEN);
break;
case CLN:
t = jj_consume_token(CLN);
break;
case SEZ:
t = jj_consume_token(SEZ);
break;
case CLZ:
t = jj_consume_token(CLZ);
break;
case SEI:
t = jj_consume_token(SEI);
break;
case CLI:
t = jj_consume_token(CLI);
break;
case SES:
t = jj_consume_token(SES);
break;
case CLS:
t = jj_consume_token(CLS);
break;
case SEV:
t = jj_consume_token(SEV);
break;
case CLV:
t = jj_consume_token(CLV);
break;
case SET:
t = jj_consume_token(SET);
break;
case CLT:
t = jj_consume_token(CLT);
break;
case SEH:
t = jj_consume_token(SEH);
break;
case CLH:
t = jj_consume_token(CLH);
break;
case NOP:
t = jj_consume_token(NOP);
break;
case SLEEP:
t = jj_consume_token(SLEEP);
break;
case WDR:
t = jj_consume_token(WDR);
break;
case BREAK:
t = jj_consume_token(BREAK);
break;
case SPM:
t = jj_consume_token(SPM);
break;
case EIJMP:
t = jj_consume_token(EIJMP);
break;
case EICALL:
t = jj_consume_token(EICALL);
break;
default:
jj_la1[16] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
module.addInstruction(t.image, t);
}
public void InstrInput() throws ParseException
{
Token t;
SyntacticOperand.Register r1;
SyntacticOperand.Expr c1;
t = jj_consume_token(IN);
r1 = Register();
jj_consume_token(145);
c1 = Const();
module.addInstruction(t.image, t, r1, c1);
}
public void InstrOutput() throws ParseException
{
Token t;
SyntacticOperand.Register r1;
SyntacticOperand.Expr c1;
t = jj_consume_token(OUT);
c1 = Const();
jj_consume_token(145);
r1 = Register();
module.addInstruction(t.image, t, c1, r1);
}
public SyntacticOperand.Register Register() throws ParseException
{
Token tok;
tok = jj_consume_token(IDENTIFIER);
return module.newOperand(tok);
}
public void Label() throws ParseException
{
Token tok;
tok = jj_consume_token(IDENTIFIER);
jj_consume_token(148);
module.addLabel(tok);
}
public void EquDirective() throws ParseException
{
Token tok;
Expr e;
jj_consume_token(149);
tok = jj_consume_token(IDENTIFIER);
jj_consume_token(150);
e = Expr();
module.addConstant(tok, e);
}
public void OrgDirective() throws ParseException
{
Token tok;
jj_consume_token(151);
tok = jj_consume_token(INTEGER_LITERAL);
module.setOrigin(new Expr.Constant(tok));
}
public void ReserveDirective() throws ParseException
{
Expr e;
jj_consume_token(152);
e = Expr();
module.reserveBytes(e, null);
}
public void DataDirective() throws ParseException
{
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
{
case 153:
ByteDirective();
break;
case 154:
WordDirective();
break;
case 155:
DoubleWordDirective();
break;
default:
jj_la1[17] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
public void ByteDirective() throws ParseException
{
ExprList l;
jj_consume_token(153);
l = DataList();
module.addDataBytes(l);
}
public void WordDirective() throws ParseException
{
ExprList l;
jj_consume_token(154);
l = DataList();
module.addDataWords(l);
}
public void DoubleWordDirective() throws ParseException
{
ExprList l;
jj_consume_token(155);
l = DataList();
module.addDataDoubleWords(l);
}
public void DefDirective() throws ParseException
{
Token name;
SyntacticOperand.Register reg;
jj_consume_token(156);
name = jj_consume_token(IDENTIFIER);
jj_consume_token(150);
reg = Register();
module.addDefinition(name, reg.name);
}
public void IncludeDirective() throws ParseException
{
Token file;
jj_consume_token(157);
file = jj_consume_token(STRING_LITERAL);
module.includeFile(file);
}
public void ExitDirective() throws ParseException
{
jj_consume_token(158);
}
public void NoListDirective() throws ParseException
{
jj_consume_token(159);
}
public void ListDirective() throws ParseException
{
jj_consume_token(160);
}
public void SegDirective() throws ParseException
{
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
{
case 161:
jj_consume_token(161);
module.enterDataSegment();
break;
case 162:
jj_consume_token(162);
module.enterProgramSegment();
break;
case 163:
jj_consume_token(163);
module.enterEEPROMSegment();
break;
default:
jj_la1[18] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
public SyntacticOperand.Expr Const() throws ParseException
{
Expr e;
e = Expr();
return module.newOperand(e);
}
public ExprList DataList() throws ParseException
{
ExprList list = new ExprList();
Expr e;
e = Data();
list.add(e);
label_2: while (true)
{
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
{
case 145:
break;
default:
jj_la1[19] = jj_gen;
break label_2;
}
jj_consume_token(145);
e = Data();
list.add(e);
}
return list;
}
public Expr Data() throws ParseException
{
Token tok;
Expr e;
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
{
case INTEGER_LITERAL:
case LOW:
case HIGH:
case LO8:
case HI8:
case BYTE2:
case BYTE3:
case BYTE4:
case LWRD:
case HWRD:
case PAGE:
case EXP2:
case LOG2:
case IDENTIFIER:
case 147:
case 179:
case 180:
case 181:
e = Expr();
break;
case STRING_LITERAL:
tok = jj_consume_token(STRING_LITERAL);
e = new Expr.StringLiteral(tok);
break;
default:
jj_la1[20] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
return e;
}
public Expr Expr() throws ParseException
{
Expr e;
e = LorExpr();
return e;
}
public Expr LorExpr() throws ParseException
{
Token tok;
Expr e, er;
e = LandExpr();
label_3: while (true)
{
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
{
case 164:
break;
default:
jj_la1[21] = jj_gen;
break label_3;
}
tok = jj_consume_token(164);
er = LandExpr();
e = new Expr.BinOp(tok, e, er);
}
return e;
}
public Expr LandExpr() throws ParseException
{
Token tok;
Expr e, er;
e = OrExpr();
label_4: while (true)
{
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
{
case 165:
break;
default:
jj_la1[22] = jj_gen;
break label_4;
}
tok = jj_consume_token(165);
er = OrExpr();
e = new Expr.BinOp(tok, e, er);
}
return e;
}
public Expr OrExpr() throws ParseException
{
Token tok;
Expr e, er;
e = XorExpr();
label_5: while (true)
{
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
{
case 166:
break;
default:
jj_la1[23] = jj_gen;
break label_5;
}
tok = jj_consume_token(166);
er = XorExpr();
e = new Expr.BinOp(tok, e, er);
}
return e;
}
public Expr XorExpr() throws ParseException
{
Token tok;
Expr e, er;
e = AndExpr();
label_6: while (true)
{
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
{
case 167:
break;
default:
jj_la1[24] = jj_gen;
break label_6;
}
tok = jj_consume_token(167);
er = AndExpr();
e = new Expr.BinOp(tok, e, er);
}
return e;
}
public Expr AndExpr() throws ParseException
{
Token tok;
Expr e, er;
e = EqExpr();
label_7: while (true)
{
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
{
case 168:
break;
default:
jj_la1[25] = jj_gen;
break label_7;
}
tok = jj_consume_token(168);
er = EqExpr();
e = new Expr.BinOp(tok, e, er);
}
return e;
}
public Expr EqExpr() throws ParseException
{
Token tok;
Expr e, er;
e = RelExpr();
label_8: while (true)
{
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
{
case 169:
case 170:
break;
default:
jj_la1[26] = jj_gen;
break label_8;
}
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
{
case 169:
tok = jj_consume_token(169);
break;
case 170:
tok = jj_consume_token(170);
break;
default:
jj_la1[27] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
er = RelExpr();
e = new Expr.BinOp(tok, e, er);
}
return e;
}
public Expr RelExpr() throws ParseException
{
Token tok;
Expr e, er;
e = ShiftExpr();
label_9: while (true)
{
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
{
case 171:
case 172:
case 173:
case 174:
break;
default:
jj_la1[28] = jj_gen;
break label_9;
}
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
{
case 171:
tok = jj_consume_token(171);
break;
case 172:
tok = jj_consume_token(172);
break;
case 173:
tok = jj_consume_token(173);
break;
case 174:
tok = jj_consume_token(174);
break;
default:
jj_la1[29] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
er = ShiftExpr();
e = new Expr.BinOp(tok, e, er);
}
return e;
}
public Expr ShiftExpr() throws ParseException
{
Token tok;
Expr e, er;
e = AddExpr();
label_10: while (true)
{
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
{
case 175:
case 176:
break;
default:
jj_la1[30] = jj_gen;
break label_10;
}
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
{
case 175:
tok = jj_consume_token(175);
break;
case 176:
tok = jj_consume_token(176);
break;
default:
jj_la1[31] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
er = AddExpr();
e = new Expr.BinOp(tok, e, er);
}
return e;
}
public Expr AddExpr() throws ParseException
{
Token tok;
Expr e, er;
e = MulExpr();
label_11: while (true)
{
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
{
case 146:
case 147:
break;
default:
jj_la1[32] = jj_gen;
break label_11;
}
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
{
case 146:
tok = jj_consume_token(146);
break;
case 147:
tok = jj_consume_token(147);
break;
default:
jj_la1[33] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
er = MulExpr();
e = new Expr.BinOp(tok, e, er);
}
return e;
}
public Expr MulExpr() throws ParseException
{
Token tok;
Expr e, er;
e = UnaryExpr();
label_12: while (true)
{
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
{
case 177:
case 178:
break;
default:
jj_la1[34] = jj_gen;
break label_12;
}
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
{
case 177:
tok = jj_consume_token(177);
break;
case 178:
tok = jj_consume_token(178);
break;
default:
jj_la1[35] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
er = UnaryExpr();
e = new Expr.BinOp(tok, e, er);
}
return e;
}
public Expr UnaryExpr() throws ParseException
{
Token tok;
Expr e;
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
{
case 147:
case 179:
case 180:
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
{
case 179:
tok = jj_consume_token(179);
break;
case 180:
tok = jj_consume_token(180);
break;
case 147:
tok = jj_consume_token(147);
break;
default:
jj_la1[36] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
e = UnaryExpr();
e = new Expr.UnOp(tok, e);
break;
case INTEGER_LITERAL:
case LOW:
case HIGH:
case LO8:
case HI8:
case BYTE2:
case BYTE3:
case BYTE4:
case LWRD:
case HWRD:
case PAGE:
case EXP2:
case LOG2:
case IDENTIFIER:
case 181:
e = Term();
break;
default:
jj_la1[37] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
return e;
}
public Expr Term() throws ParseException
{
Token tok;
Expr e;
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
{
case IDENTIFIER:
tok = jj_consume_token(IDENTIFIER);
e = new Expr.Variable(tok);
break;
case LOW:
case HIGH:
case LO8:
case HI8:
case BYTE2:
case BYTE3:
case BYTE4:
case LWRD:
case HWRD:
case PAGE:
case EXP2:
case LOG2:
e = Func();
break;
case INTEGER_LITERAL:
tok = jj_consume_token(INTEGER_LITERAL);
e = new Expr.Constant(tok);
break;
case 181:
jj_consume_token(181);
e = Expr();
jj_consume_token(182);
break;
default:
jj_la1[38] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
return e;
}
public Expr Func() throws ParseException
{
Token tok;
Token l;
Expr e;
tok = FuncName();
jj_consume_token(181);
e = Expr();
l = jj_consume_token(182);
return new Expr.Func(tok, e, l);
}
public Token FuncName() throws ParseException
{
Token tok;
switch (jj_ntk == -1 ? jj_ntk() : jj_ntk)
{
case LOW:
tok = jj_consume_token(LOW);
break;
case HIGH:
tok = jj_consume_token(HIGH);
break;
case LO8:
tok = jj_consume_token(LO8);
break;
case HI8:
tok = jj_consume_token(HI8);
break;
case BYTE2:
tok = jj_consume_token(BYTE2);
break;
case BYTE3:
tok = jj_consume_token(BYTE3);
break;
case BYTE4:
tok = jj_consume_token(BYTE4);
break;
case LWRD:
tok = jj_consume_token(LWRD);
break;
case HWRD:
tok = jj_consume_token(HWRD);
break;
case PAGE:
tok = jj_consume_token(PAGE);
break;
case EXP2:
tok = jj_consume_token(EXP2);
break;
case LOG2:
tok = jj_consume_token(LOG2);
break;
default:
jj_la1[39] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
return tok;
}
private boolean jj_2_1(int xla)
{
jj_la = xla;
jj_lastpos = jj_scanpos = token;
boolean retval = !jj_3_1();
jj_save(0, xla);
return retval;
}
private boolean jj_2_2(int xla)
{
jj_la = xla;
jj_lastpos = jj_scanpos = token;
boolean retval = !jj_3_2();
jj_save(1, xla);
return retval;
}
private boolean jj_2_3(int xla)
{
jj_la = xla;
jj_lastpos = jj_scanpos = token;
boolean retval = !jj_3_3();
jj_save(2, xla);
return retval;
}
private boolean jj_2_4(int xla)
{
jj_la = xla;
jj_lastpos = jj_scanpos = token;
boolean retval = !jj_3_4();
jj_save(3, xla);
return retval;
}
private boolean jj_2_5(int xla)
{
jj_la = xla;
jj_lastpos = jj_scanpos = token;
boolean retval = !jj_3_5();
jj_save(4, xla);
return retval;
}
private boolean jj_2_6(int xla)
{
jj_la = xla;
jj_lastpos = jj_scanpos = token;
boolean retval = !jj_3_6();
jj_save(5, xla);
return retval;
}
private boolean jj_3R_22()
{
return jj_scan_token(ELPM);
}
private boolean jj_3_6()
{
return jj_3R_18();
}
private boolean jj_3R_15()
{
if (jj_3R_20())
return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos)
return false;
if (jj_3R_19())
return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos)
return false;
if (jj_scan_token(145))
return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos)
return false;
if (jj_3R_19())
return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos)
return false;
return jj_scan_token(146);
}
private boolean jj_3_5()
{
return jj_3R_17();
}
private boolean jj_3_2()
{
return jj_3R_14();
}
private boolean jj_3R_16()
{
if (jj_3R_20())
return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos)
return false;
if (jj_3R_19())
return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos)
return false;
return jj_scan_token(145);
}
private boolean jj_3_1()
{
return jj_3R_13();
}
private boolean jj_3R_14()
{
if (jj_scan_token(LD))
return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos)
return false;
if (jj_3R_19())
return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos)
return false;
if (jj_scan_token(145))
return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos)
return false;
return jj_scan_token(147);
}
private boolean jj_3R_18()
{
if (jj_scan_token(ST))
return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos)
return false;
if (jj_3R_19())
return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos)
return false;
return jj_scan_token(146);
}
private boolean jj_3R_21()
{
return jj_scan_token(LPM);
}
private boolean jj_3R_19()
{
return jj_scan_token(IDENTIFIER);
}
private boolean jj_3R_20()
{
Token xsp;
xsp = jj_scanpos;
if (jj_3R_21())
{
jj_scanpos = xsp;
if (jj_3R_22())
return true;
}
return false;
}
private boolean jj_3_4()
{
return jj_3R_16();
}
private boolean jj_3_3()
{
return jj_3R_15();
}
private boolean jj_3R_13()
{
if (jj_scan_token(LD))
return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos)
return false;
if (jj_3R_19())
return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos)
return false;
if (jj_scan_token(145))
return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos)
return false;
if (jj_3R_19())
return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos)
return false;
return jj_scan_token(146);
}
private boolean jj_3R_17()
{
if (jj_scan_token(ST))
return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos)
return false;
if (jj_3R_19())
return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos)
return false;
return jj_scan_token(145);
}
public AtmelParserTokenManager token_source;
public Token token, jj_nt;
private int jj_ntk;
private Token jj_scanpos, jj_lastpos;
private int jj_la;
private int jj_gen;
private final int[] jj_la1 = new int[40];
private static int[] jj_la1_0;
private static int[] jj_la1_1;
private static int[] jj_la1_2;
private static int[] jj_la1_3;
private static int[] jj_la1_4;
private static int[] jj_la1_5;
static
{
jj_la1_0();
jj_la1_1();
jj_la1_2();
jj_la1_3();
jj_la1_4();
jj_la1_5();
}
private static void jj_la1_0()
{
jj_la1_0 = new int[] { 0xf0000000, 0x1, 0xf0000000, 0x0, 0xf0000000,
0xb0000000, 0x0, 0x40000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0xfff8200, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0xfff0200, 0xfff0200, 0xfff0000, };
}
private static void jj_la1_1()
{
jj_la1_1 = new int[] { 0xffffffff, 0x0, 0xffffffff, 0x0, 0xffffffff,
0x0, 0x2, 0x24000009, 0xbfffec4, 0x10000030, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0xc0000100, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, };
}
private static void jj_la1_2()
{
jj_la1_2 = new int[] { 0xffffffff, 0x0, 0xffffffff, 0x0, 0xffffffff,
0xf0b00, 0xc0801084, 0x400, 0x1000000, 0x0, 0x3e008000,
0x2000000, 0x20008000, 0x20008000, 0x0, 0x0, 0x30607b, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, };
}
private static void jj_la1_3()
{
jj_la1_3 = new int[] { 0xffffffff, 0x0, 0xffffffff, 0x0, 0xffffffff,
0x4009f, 0x80030c20, 0x7880100, 0x9000, 0x700000, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x78006040, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, };
}
private static void jj_la1_4()
{
jj_la1_4 = new int[] { 0xbfa07fff, 0x40000000, 0xbfa07fff, 0xbfa00000,
0x3fff, 0x200, 0x1800, 0x400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x1c0, 0x40, 0x203f, 0xe000000, 0x0, 0x20000, 0x84000, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc0000, 0xc0000,
0x0, 0x0, 0x80000, 0x84000, 0x4000, 0x0, };
}
private static void jj_la1_5()
{
jj_la1_5 = new int[] { 0xf, 0x0, 0xf, 0xf, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe, 0x0, 0x380000,
0x10, 0x20, 0x40, 0x80, 0x100, 0x600, 0x600, 0x7800, 0x7800,
0x18000, 0x18000, 0x0, 0x0, 0x60000, 0x60000, 0x180000,
0x380000, 0x200000, 0x0, };
}
private final JJCalls[] jj_2_rtns = new JJCalls[6];
private boolean jj_rescan = false;
private int jj_gc = 0;
public AtmelParser(AtmelParserTokenManager tm)
{
token_source = tm;
token = new Token();
jj_ntk = -1;
jj_gen = 0;
for (int i = 0; i < 40; i++)
jj_la1[i] = -1;
for (int i = 0; i < jj_2_rtns.length; i++)
jj_2_rtns[i] = new JJCalls();
}
private Token jj_consume_token(int kind) throws ParseException
{
Token oldToken;
if ((oldToken = token).next != null)
token = token.next;
else
token = token.next = token_source.getNextToken();
jj_ntk = -1;
if (token.kind == kind)
{
jj_gen++;
if (++jj_gc > 100)
{
jj_gc = 0;
for (int i = 0; i < jj_2_rtns.length; i++)
{
JJCalls c = jj_2_rtns[i];
while (c != null)
{
if (c.gen < jj_gen)
c.first = null;
c = c.next;
}
}
}
return token;
}
token = oldToken;
jj_kind = kind;
throw generateParseException();
}
private boolean jj_scan_token(int kind)
{
if (jj_scanpos == jj_lastpos)
{
jj_la--;
if (jj_scanpos.next == null)
{
jj_lastpos = jj_scanpos = jj_scanpos.next = token_source
.getNextToken();
} else
{
jj_lastpos = jj_scanpos = jj_scanpos.next;
}
} else
{
jj_scanpos = jj_scanpos.next;
}
if (jj_rescan)
{
int i = 0;
Token tok = token;
while (tok != null && tok != jj_scanpos)
{
i++;
tok = tok.next;
}
if (tok != null)
jj_add_error_token(kind, i);
}
return jj_scanpos.kind != kind;
}
private int jj_ntk()
{
if ((jj_nt = token.next) == null)
return jj_ntk = (token.next = token_source.getNextToken()).kind;
else
return jj_ntk = jj_nt.kind;
}
private Vector<int[]> jj_expentries = new Vector<int[]>();
private int[] jj_expentry;
private int jj_kind = -1;
private int[] jj_lasttokens = new int[100];
private int jj_endpos;
private void jj_add_error_token(int kind, int pos)
{
if (pos >= 100)
return;
if (pos == jj_endpos + 1)
{
jj_lasttokens[jj_endpos++] = kind;
} else if (jj_endpos != 0)
{
jj_expentry = new int[jj_endpos];
System.arraycopy(jj_lasttokens, 0, jj_expentry, 0, jj_endpos);
boolean exists = false;
for (Enumeration<int[]> enm = jj_expentries.elements(); enm
.hasMoreElements();)
{
int[] oldentry = enm.nextElement();
if (oldentry.length == jj_expentry.length)
{
exists = true;
for (int i = 0; i < jj_expentry.length; i++)
{
if (oldentry[i] != jj_expentry[i])
{
exists = false;
break;
}
}
if (exists)
break;
}
}
if (!exists)
jj_expentries.addElement(jj_expentry);
if (pos != 0)
jj_lasttokens[(jj_endpos = pos) - 1] = kind;
}
}
public ParseException generateParseException()
{
jj_expentries.removeAllElements();
boolean[] la1tokens = new boolean[183];
for (int i = 0; i < 183; i++)
{
la1tokens[i] = false;
}
if (jj_kind >= 0)
{
la1tokens[jj_kind] = true;
jj_kind = -1;
}
for (int i = 0; i < 40; i++)
{
if (jj_la1[i] == jj_gen)
{
for (int j = 0; j < 32; j++)
{
if ((jj_la1_0[i] & 1 << j) != 0)
{
la1tokens[j] = true;
}
if ((jj_la1_1[i] & 1 << j) != 0)
{
la1tokens[32 + j] = true;
}
if ((jj_la1_2[i] & 1 << j) != 0)
{
la1tokens[64 + j] = true;
}
if ((jj_la1_3[i] & 1 << j) != 0)
{
la1tokens[96 + j] = true;
}
if ((jj_la1_4[i] & 1 << j) != 0)
{
la1tokens[128 + j] = true;
}
if ((jj_la1_5[i] & 1 << j) != 0)
{
la1tokens[160 + j] = true;
}
}
}
}
for (int i = 0; i < 183; i++)
{
if (la1tokens[i])
{
jj_expentry = new int[1];
jj_expentry[0] = i;
jj_expentries.addElement(jj_expentry);
}
}
jj_endpos = 0;
jj_rescan_token();
jj_add_error_token(0, 0);
int[][] exptokseq = new int[jj_expentries.size()][];
for (int i = 0; i < jj_expentries.size(); i++)
{
exptokseq[i] = jj_expentries.elementAt(i);
}
return new ParseException(token, exptokseq, tokenImage);
}
private void jj_rescan_token()
{
jj_rescan = true;
for (int i = 0; i < 6; i++)
{
JJCalls p = jj_2_rtns[i];
do
{
if (p.gen > jj_gen)
{
jj_la = p.arg;
jj_lastpos = jj_scanpos = p.first;
switch (i)
{
case 0:
jj_3_1();
break;
case 1:
jj_3_2();
break;
case 2:
jj_3_3();
break;
case 3:
jj_3_4();
break;
case 4:
jj_3_5();
break;
case 5:
jj_3_6();
break;
}
}
p = p.next;
} while (p != null);
}
jj_rescan = false;
}
private void jj_save(int index, int xla)
{
JJCalls p = jj_2_rtns[index];
while (p.gen > jj_gen)
{
if (p.next == null)
{
p = p.next = new JJCalls();
break;
}
p = p.next;
}
p.gen = jj_gen + xla - jj_la;
p.first = token;
p.arg = xla;
}
static class JJCalls
{
int gen;
Token first;
int arg;
JJCalls next;
}
}
|
[
"rubienr@gmail.com"
] |
rubienr@gmail.com
|
fea3e2203ad33525ce8682c19fee8bc497c41bca
|
ff2ee33bd124c73aaa130459bf64c1fc605f931c
|
/JavaProgramming_EU5/src/day6_logicaloperators/C1_logicalOperators.java
|
a52fe5ec6170d0010c13dc08fb2025b03d776365
|
[] |
no_license
|
SAkkaya/EU_5_Self_Practice--Deneme
|
312bd522dcb78277d1533c781e2f2698965e7d1d
|
3ce756e0bec3cda7615addb1778aaaf4477599f4
|
refs/heads/master
| 2023-06-17T08:18:09.171393
| 2021-07-17T20:11:16
| 2021-07-17T20:11:16
| 365,317,253
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,024
|
java
|
package day6_logicaloperators;
public class C1_logicalOperators {
public static void main(String[] args) {
char c1 ='A';
char c2= 65;
int i1 =5;
int i2=10;
boolean res1 = (i1==i2) & (c1==c2); // False & True = False
boolean res2 = (i1==i2) && (c1==c2); // False & -- second exp I dont care--- = False
System.out.println("res1 = " + res1); //f
System.out.println("res2 = " + res2); // f
/*
*int i1 =10;
int i2=10;
boolean res1 = (i1==i2) && (c1==c2++);
System.out.println("res1 = " + res1 + " " + c2); //res1 = true B
*/
boolean res3 = (c1==c2) | (i1==i2); // T | F = T
boolean res4 = (c1==c2) || (i1==i2); // T ||-----(2. expressiion i kontrol etmeyecek = T
System.out.println("res3 = " + res3);
System.out.println("res4 = " + res4);
boolean res5 = (c1==c2) ^ (i1==i2); // T ^ F = T
boolean res6 = (c1==c2) ^ (i1!=i2); // T ^ T = F
System.out.println("res5 = " + res5);
System.out.println("res6 = " + res6);
}
}
|
[
"JACK1@192.168.0.4"
] |
JACK1@192.168.0.4
|
a8e8e64fd8378ab991fd0ad64a74906e3bb81570
|
68a8f866acba7d1af5838b11692a6e75053d307c
|
/src/main/java/net/onrc/openvirtex/packet/TCP.java
|
28fe398f01dffbe8fb9073452fd808fb3b03a0cd
|
[
"Apache-2.0"
] |
permissive
|
praveingk/bnvirt
|
06d658ba9f7417df298557390895a69448d02934
|
fbc6bbdcf64e0e62801313f3ea361c327843d2d0
|
refs/heads/master
| 2021-12-14T02:13:40.886230
| 2021-12-13T05:45:08
| 2021-12-13T05:45:08
| 141,460,348
| 0
| 0
|
Apache-2.0
| 2021-12-13T05:45:10
| 2018-07-18T16:19:53
|
Java
|
UTF-8
|
Java
| false
| false
| 10,061
|
java
|
/*******************************************************************************
* Copyright 2014 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.
******************************************************************************/
/**
* Copyright 2011, Big Switch Networks, Inc.
* Originally created by David Erickson, Stanford University
*
* 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 net.onrc.openvirtex.packet;
import java.nio.ByteBuffer;
/**
*
* @author shudong.zhou@bigswitch.com
*/
public class TCP extends BasePacket {
protected short sourcePort;
protected short destinationPort;
protected int sequence;
protected int acknowledge;
protected byte dataOffset;
protected short flags;
protected short windowSize;
protected short checksum;
protected short urgentPointer;
protected byte[] options;
/**
* @return the sourcePort
*/
public short getSourcePort() {
return this.sourcePort;
}
/**
* @param sourcePort
* the sourcePort to set
*/
public TCP setSourcePort(final short sourcePort) {
this.sourcePort = sourcePort;
return this;
}
/**
* @return the destinationPort
*/
public short getDestinationPort() {
return this.destinationPort;
}
/**
* @param destinationPort
* the destinationPort to set
*/
public TCP setDestinationPort(final short destinationPort) {
this.destinationPort = destinationPort;
return this;
}
/**
* @return the checksum
*/
public short getChecksum() {
return this.checksum;
}
public int getSequence() {
return this.sequence;
}
public TCP setSequence(final int seq) {
this.sequence = seq;
return this;
}
public int getAcknowledge() {
return this.acknowledge;
}
public TCP setAcknowledge(final int ack) {
this.acknowledge = ack;
return this;
}
public byte getDataOffset() {
return this.dataOffset;
}
public TCP setDataOffset(final byte offset) {
this.dataOffset = offset;
return this;
}
public short getFlags() {
return this.flags;
}
public TCP setFlags(final short flags) {
this.flags = flags;
return this;
}
public short getWindowSize() {
return this.windowSize;
}
public TCP setWindowSize(final short windowSize) {
this.windowSize = windowSize;
return this;
}
public short getTcpChecksum() {
return this.checksum;
}
public TCP setTcpChecksum(final short checksum) {
this.checksum = checksum;
return this;
}
@Override
public void resetChecksum() {
this.checksum = 0;
super.resetChecksum();
}
public short getUrgentPointer(final short urgentPointer) {
return this.urgentPointer;
}
public TCP setUrgentPointer(final short urgentPointer) {
this.urgentPointer = urgentPointer;
return this;
}
public byte[] getOptions() {
return this.options;
}
public TCP setOptions(final byte[] options) {
this.options = options;
this.dataOffset = (byte) (20 + options.length + 3 >> 2);
return this;
}
/**
* @param checksum
* the checksum to set
*/
public TCP setChecksum(final short checksum) {
this.checksum = checksum;
return this;
}
/**
* Serializes the packet. Will compute and set the following fields if they
* are set to specific values at the time serialize is called: -checksum : 0
* -length : 0
*/
@Override
public byte[] serialize() {
int length;
if (this.dataOffset == 0) {
this.dataOffset = 5; // default header length
}
length = this.dataOffset << 2;
byte[] payloadData = null;
if (this.payload != null) {
this.payload.setParent(this);
payloadData = this.payload.serialize();
length += payloadData.length;
}
final byte[] data = new byte[length];
final ByteBuffer bb = ByteBuffer.wrap(data);
bb.putShort(this.sourcePort);
bb.putShort(this.destinationPort);
bb.putInt(this.sequence);
bb.putInt(this.acknowledge);
bb.putShort((short) (this.flags | this.dataOffset << 12));
bb.putShort(this.windowSize);
bb.putShort(this.checksum);
bb.putShort(this.urgentPointer);
if (this.dataOffset > 5) {
int padding;
bb.put(this.options);
padding = (this.dataOffset << 2) - 20 - this.options.length;
for (int i = 0; i < padding; i++) {
bb.put((byte) 0);
}
}
if (payloadData != null) {
bb.put(payloadData);
}
if (this.parent != null && this.parent instanceof IPv4) {
((IPv4) this.parent).setProtocol(IPv4.PROTOCOL_TCP);
}
// compute checksum if needed
if (this.checksum == 0) {
bb.rewind();
int accumulation = 0;
// compute pseudo header mac
if (this.parent != null && this.parent instanceof IPv4) {
final IPv4 ipv4 = (IPv4) this.parent;
accumulation += (ipv4.getSourceAddress() >> 16 & 0xffff)
+ (ipv4.getSourceAddress() & 0xffff);
accumulation += (ipv4.getDestinationAddress() >> 16 & 0xffff)
+ (ipv4.getDestinationAddress() & 0xffff);
accumulation += ipv4.getProtocol() & 0xff;
accumulation += length & 0xffff;
}
for (int i = 0; i < length / 2; ++i) {
accumulation += 0xffff & bb.getShort();
}
// pad to an even number of shorts
if (length % 2 > 0) {
accumulation += (bb.get() & 0xff) << 8;
}
accumulation = (accumulation >> 16 & 0xffff)
+ (accumulation & 0xffff);
this.checksum = (short) (~accumulation & 0xffff);
bb.putShort(16, this.checksum);
}
return data;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 5807;
int result = super.hashCode();
result = prime * result + this.checksum;
result = prime * result + this.destinationPort;
result = prime * result + this.sourcePort;
return result;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (!super.equals(obj)) {
return false;
}
if (!(obj instanceof TCP)) {
return false;
}
final TCP other = (TCP) obj;
// May want to compare fields based on the flags set
return this.checksum == other.checksum
&& this.destinationPort == other.destinationPort
&& this.sourcePort == other.sourcePort
&& this.sequence == other.sequence
&& this.acknowledge == other.acknowledge
&& this.dataOffset == other.dataOffset
&& this.flags == other.flags
&& this.windowSize == other.windowSize
&& this.urgentPointer == other.urgentPointer
&& (this.dataOffset == 5 || this.options.equals(other.options));
}
@Override
public IPacket deserialize(final byte[] data, final int offset,
final int length) {
final ByteBuffer bb = ByteBuffer.wrap(data, offset, length);
this.sourcePort = bb.getShort();
this.destinationPort = bb.getShort();
this.sequence = bb.getInt();
this.acknowledge = bb.getInt();
this.flags = bb.getShort();
this.dataOffset = (byte) (this.flags >> 12 & 0xf);
this.flags = (short) (this.flags & 0x1ff);
this.windowSize = bb.getShort();
this.checksum = bb.getShort();
this.urgentPointer = bb.getShort();
if (this.dataOffset > 5) {
int optLength = (this.dataOffset << 2) - 20;
if (bb.limit() < bb.position() + optLength) {
optLength = bb.limit() - bb.position();
}
try {
this.options = new byte[optLength];
bb.get(this.options, 0, optLength);
} catch (final IndexOutOfBoundsException e) {
this.options = null;
}
}
this.payload = new Data();
this.payload = this.payload.deserialize(data, bb.position(), bb.limit()
- bb.position());
this.payload.setParent(this);
return this;
}
}
|
[
"praveingk@gmail.com"
] |
praveingk@gmail.com
|
4125c9d341f7c90fb296fe1f277b8f64d49a955f
|
93d42fca0cb566af8319a13e80185588cb698680
|
/src/main/java/com/springcore/ref/A.java
|
1b4fd48b8b960dfd0be3cba596453f09b7d1480f
|
[] |
no_license
|
Aishwaryatidke/Spring
|
a3b18c407ba4ae6bbb55d0841a4bb9eda1177cd9
|
e2e707940d646dfe7b49bf97c4aa6e3614447ffd
|
refs/heads/master
| 2023-04-28T08:58:57.955601
| 2021-05-09T16:12:24
| 2021-05-09T16:12:24
| 359,196,348
| 0
| 0
| null | 2021-05-09T16:12:24
| 2021-04-18T16:26:35
|
Java
|
UTF-8
|
Java
| false
| false
| 482
|
java
|
package com.springcore.ref;
public class A {
private int x;
private B obj;
@Override
public String toString() {
return "A [x=" + x + ", obj=" + obj + "]";
}
public A() {
super();
// TODO Auto-generated constructor stub
}
public A(int x, B obj) {
super();
this.x = x;
this.obj = obj;
}
public int getX() {
return x;
}
public void setX(int x) {
this.x = x;
}
public B getObj() {
return obj;
}
public void setObj(B obj) {
this.obj = obj;
}
}
|
[
"Aishwarya@DESKTOP-SPDK205"
] |
Aishwarya@DESKTOP-SPDK205
|
4bcf2c71fa66e1456baadc5865869f3c2fdc2064
|
a120b89c66e4183c64dfecc71cd462d73167f6b1
|
/app/src/main/java/com/tool/jizhang/base/db/entity/SearchRecord.java
|
a90a1b381588ec9203527ab7f46151b36d8b9937
|
[] |
no_license
|
xiaoyue904118851/jizhangapp
|
3f230f0508a26aab1046c6f82ee534a3fd7c31aa
|
0fcbd5fee6bfb1c62cb7b224dd720feec4c16147
|
refs/heads/master
| 2023-01-02T01:55:52.543348
| 2020-10-26T06:42:53
| 2020-10-26T06:42:53
| 305,249,665
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,869
|
java
|
/*
* Copyright (C) 2019 xuexiangjys(xuexiangjys@163.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.tool.jizhang.base.db.entity;
import androidx.annotation.NonNull;
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;
/**
* 搜索记录
*
* @author xuexiang
* @since 2019-12-04 22:57
*/
@DatabaseTable(tableName = "search_record")
public class SearchRecord {
@DatabaseField(generatedId = true)
private long Id;
/**
* 搜索内容
*/
@DatabaseField
private String content;
/**
* 搜索时间
*/
@DatabaseField
private long time;
public long getId() {
return Id;
}
public SearchRecord setId(long id) {
Id = id;
return this;
}
public String getContent() {
return content;
}
public SearchRecord setContent(String content) {
this.content = content;
return this;
}
public long getTime() {
return time;
}
public SearchRecord setTime(long time) {
this.time = time;
return this;
}
@NonNull
@Override
public String toString() {
return "QueryRecord{" +
"Id=" + Id +
", content='" + content + '\'' +
", time=" + time +
'}';
}
}
|
[
"904118851@qq.com"
] |
904118851@qq.com
|
532e7456b094fc1fa8f31b3aa43683c44d27f3b0
|
a70dc6b56e540f2ef39ce42f69aa87907517ea56
|
/src/main/java/com/hjh/controller/PatrolRecordController.java
|
29a8267e3e92aa42de093966036dba80a59add2a
|
[] |
no_license
|
CallmeJeRrYHo/admanger
|
ce7aa5d05ae9b2edef991a2824bc44d28137441c
|
103c9fee1557b9667d82f66357c842ab7caa2630
|
refs/heads/master
| 2020-03-28T12:23:16.042647
| 2018-12-16T09:33:17
| 2018-12-16T09:33:17
| 148,292,756
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,951
|
java
|
package com.hjh.controller;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.hjh.constant.Constant;
import com.hjh.dao.PatrolRecordDao;
import com.hjh.dao.PicFileDao;
import com.hjh.entity.PatrolRecord;
import com.hjh.service.IPatrolRecordService;
import com.hjh.utils.BaseController;
import com.hjh.utils.ResultInfoUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
* @Author: Jerry
* @Descrption:
* @Date: Create in 10:01 2018/12/6
*/
@RequestMapping("/patrolRecord")
@RestController
public class PatrolRecordController extends BaseController{
@Autowired
IPatrolRecordService iPatrolRecordService;
@Autowired
PatrolRecordDao patrolRecordDao;
@Autowired
PicFileDao picFileDao;
@RequestMapping("/add")
public String add(String userId,Integer hasProblem,Integer isWarning,String warningNo,String pics,String advertisementId){
try{
checkNecessaryParameter("userId",userId);
checkNecessaryParameter("advertisementId",advertisementId);
checkNecessaryParameter("是否有问题",hasProblem);
checkNecessaryParameter("是否报警",isWarning);
return iPatrolRecordService.add(userId,hasProblem,isWarning,warningNo,pics,advertisementId);
}catch(Exception e){
return handleError(e);
}
}
@RequestMapping("/list")
public String list(String advertisementId){
try{
checkNecessaryParameter("advertisementId",advertisementId);
List<Map<String, Object>> patrolRecords = patrolRecordDao.selectMaps(new EntityWrapper<PatrolRecord>().eq("advertisement_id", advertisementId).eq("status", Constant.STATUS_NORMAL));
return ResultInfoUtils.infoData(patrolRecords);
}catch(Exception e){
return handleError(e);
}
}
@RequestMapping("/detail")
public String detail(String patrolRecordId){
try{
checkNecessaryParameter("patrolRecordId",patrolRecordId);
PatrolRecord p=new PatrolRecord();
p.setStatus(Constant.STATUS_NORMAL);
p.setPatrolRecordId(patrolRecordId);
List<Map<String, Object>> patrolRecord = patrolRecordDao.selectMaps(new EntityWrapper<PatrolRecord>().eq("status",Constant.STATUS_NORMAL)
.eq("patrol_record_id",patrolRecordId));
if (patrolRecord.size()<=0){
throw new RuntimeException("不存在");
}
List<Map<String, Object>> maps = picFileDao.selectPatrolRecordPic(patrolRecordId);
patrolRecord.get(0).put("pics",maps);
return ResultInfoUtils.infoData(patrolRecord.get(0));
}catch(Exception e){
return handleError(e);
}
}
}
|
[
"410734465@qq.com"
] |
410734465@qq.com
|
7507580851d44c556ea5df50dd8a7d36d60f0e08
|
fd521cd83c9ba598a1db67c77a5dc7660c4923a6
|
/src/br/com/nakano/teste/loja/padronizado/CategoryDAO.java
|
0f85419a096bab009a1e90d0410e865f6c74cc0f
|
[] |
no_license
|
alenakano/jdbc-studies
|
50e9b2d778a2d6e87ec897a0880da79680d11e0c
|
eef98bb59eb83edc4c322753553825aa3a7ff1b1
|
refs/heads/main
| 2023-01-31T20:46:14.810268
| 2020-12-10T20:48:17
| 2020-12-10T20:48:17
| 320,386,929
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,831
|
java
|
package br.com.nakano.teste.loja.padronizado;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import br.com.nakano.teste.loja.padronizado.model.Category;
import br.com.nakano.teste.loja.padronizado.model.Product;
public class CategoryDAO {
private Connection connection;
public CategoryDAO (Connection conn) {
this.connection = conn;
}
public List<Category> list() throws SQLException {
List<Category> categories = new ArrayList<Category>();
try(PreparedStatement pstm = this.connection.prepareStatement("SELECT ID, NOME FROM CATEGORIA")) {
pstm.execute();
try (ResultSet resultSet = pstm.getResultSet()) {
while(resultSet.next()) {
Category category = new Category(resultSet.getInt(1), resultSet.getString(2));
categories.add(category);
}
}
};
return categories;
}
public List<Category> listProductsbyCategory() throws SQLException {
List<Category> categories = new ArrayList<Category>();
Category lastCategory = null;
try(PreparedStatement pstm = this.connection.prepareStatement(
"SELECT C.ID, C.NOME, P.ID, P.NOME, P.DESCRICAO FROM CATEGORIA C INNER JOIN PRODUTO P ON C.ID = P.CATEGORIA_ID")) {
pstm.execute();
try (ResultSet resultSet = pstm.getResultSet()) {
while(resultSet.next()) {
if(lastCategory == null || lastCategory.getId() != resultSet.getInt(1)) {
Category category = new Category(resultSet.getInt(1), resultSet.getString(2));
lastCategory = category;
categories.add(category);
}
Product product = new Product(resultSet.getInt(3), resultSet.getString(4), resultSet.getString(5));
lastCategory.addProduct(product);
}
}
};
return categories;
}
}
|
[
"alexandre.nakano1@ibm.com"
] |
alexandre.nakano1@ibm.com
|
b5cd29ac4bc6ee20a0903e4ba95a1e40792d3b6f
|
c885ef92397be9d54b87741f01557f61d3f794f3
|
/results/Time-2/org.joda.time.Partial/BBC-F0-opt-70/tests/1/org/joda/time/Partial_ESTest.java
|
a9315b71e1683acda6dc4785b21b114b5246c91b
|
[
"CC-BY-4.0",
"MIT"
] |
permissive
|
pderakhshanfar/EMSE-BBC-experiment
|
f60ac5f7664dd9a85f755a00a57ec12c7551e8c6
|
fea1a92c2e7ba7080b8529e2052259c9b697bbda
|
refs/heads/main
| 2022-11-25T00:39:58.983828
| 2022-04-12T16:04:26
| 2022-04-12T16:04:26
| 309,335,889
| 0
| 1
| null | 2021-11-05T11:18:43
| 2020-11-02T10:30:38
| null |
UTF-8
|
Java
| false
| false
| 78,179
|
java
|
/*
* This file was automatically generated by EvoSuite
* Tue Oct 19 22:19:29 GMT 2021
*/
package org.joda.time;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import java.util.Locale;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.joda.time.Chronology;
import org.joda.time.DateTime;
import org.joda.time.DateTimeField;
import org.joda.time.DateTimeFieldType;
import org.joda.time.DateTimeZone;
import org.joda.time.Duration;
import org.joda.time.DurationFieldType;
import org.joda.time.Instant;
import org.joda.time.LocalDateTime;
import org.joda.time.LocalTime;
import org.joda.time.MonthDay;
import org.joda.time.Months;
import org.joda.time.Partial;
import org.joda.time.Period;
import org.joda.time.ReadableDuration;
import org.joda.time.ReadableInstant;
import org.joda.time.ReadablePartial;
import org.joda.time.ReadablePeriod;
import org.joda.time.Weeks;
import org.joda.time.YearMonth;
import org.joda.time.chrono.BuddhistChronology;
import org.joda.time.chrono.CopticChronology;
import org.joda.time.chrono.EthiopicChronology;
import org.joda.time.chrono.GJChronology;
import org.joda.time.chrono.GregorianChronology;
import org.joda.time.chrono.ISOChronology;
import org.joda.time.chrono.IslamicChronology;
import org.joda.time.chrono.JulianChronology;
import org.joda.time.chrono.StrictChronology;
import org.joda.time.format.DateTimeFormatter;
import org.joda.time.tz.FixedDateTimeZone;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true)
public class Partial_ESTest extends Partial_ESTest_scaffolding {
@Test(timeout = 4000)
public void test000() throws Throwable {
YearMonth yearMonth0 = new YearMonth();
Partial partial0 = new Partial(yearMonth0);
boolean boolean0 = partial0.isMatch((ReadablePartial) yearMonth0);
assertTrue(boolean0);
}
@Test(timeout = 4000)
public void test001() throws Throwable {
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.weekOfWeekyear();
JulianChronology julianChronology0 = JulianChronology.getInstance();
Partial partial0 = new Partial(dateTimeFieldType0, 13, julianChronology0);
Instant instant0 = Instant.now();
Instant instant1 = instant0.withMillis(0L);
Duration duration0 = new Duration(instant0, instant1);
Duration duration1 = duration0.dividedBy(13);
Instant instant2 = instant0.minus((ReadableDuration) duration1);
boolean boolean0 = partial0.isMatch((ReadableInstant) instant2);
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test002() throws Throwable {
YearMonth yearMonth0 = new YearMonth();
Partial partial0 = new Partial(yearMonth0);
Period period0 = Period.millis(1);
Partial partial1 = partial0.minus(period0);
assertTrue(partial1.equals((Object)partial0));
assertNotSame(partial1, partial0);
}
@Test(timeout = 4000)
public void test003() throws Throwable {
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.weekOfWeekyear();
JulianChronology julianChronology0 = JulianChronology.getInstance();
Partial partial0 = new Partial(dateTimeFieldType0, 13, julianChronology0);
// Undeclared exception!
try {
partial0.withField(dateTimeFieldType0, (-753));
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Value -753 for weekOfWeekyear must be in the range [1,53]
//
verifyException("org.joda.time.field.FieldUtils", e);
}
}
@Test(timeout = 4000)
public void test004() throws Throwable {
YearMonth yearMonth0 = new YearMonth();
Partial partial0 = new Partial(yearMonth0);
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.millisOfSecond();
Partial partial1 = partial0.with(dateTimeFieldType0, 1);
Partial partial2 = partial1.without(dateTimeFieldType0);
assertTrue(partial2.equals((Object)partial0));
}
@Test(timeout = 4000)
public void test005() throws Throwable {
DateTimeFieldType[] dateTimeFieldTypeArray0 = new DateTimeFieldType[7];
int[] intArray0 = new int[1];
Partial partial0 = null;
try {
partial0 = new Partial(dateTimeFieldTypeArray0, intArray0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Values array must be the same length as the types array
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test006() throws Throwable {
LocalDateTime localDateTime0 = LocalDateTime.now();
Partial partial0 = new Partial(localDateTime0);
Locale locale0 = Locale.forLanguageTag("m|\"xg.");
Partial.Property partial_Property0 = new Partial.Property(partial0, 216);
// Undeclared exception!
try {
partial_Property0.setCopy("[year=2014, monthOfYear=2, dayOfMonth=14, millisOfDay=73281320]", locale0);
fail("Expecting exception: ArrayIndexOutOfBoundsException");
} catch(ArrayIndexOutOfBoundsException e) {
//
// 216
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test007() throws Throwable {
Partial partial0 = new Partial();
Partial.Property partial_Property0 = new Partial.Property(partial0, 0);
// Undeclared exception!
try {
partial_Property0.getField();
fail("Expecting exception: ArrayIndexOutOfBoundsException");
} catch(ArrayIndexOutOfBoundsException e) {
//
// 0
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test008() throws Throwable {
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.yearOfCentury();
Partial partial0 = new Partial(dateTimeFieldType0, 0);
Partial.Property partial_Property0 = partial0.property(dateTimeFieldType0);
Partial partial1 = partial_Property0.addToCopy(30);
assertNotSame(partial0, partial1);
}
@Test(timeout = 4000)
public void test009() throws Throwable {
YearMonth yearMonth0 = new YearMonth();
Partial partial0 = new Partial(yearMonth0);
Months months0 = Months.FOUR;
Partial partial1 = partial0.plus(months0);
assertFalse(partial1.equals((Object)partial0));
assertNotSame(partial1, partial0);
}
@Test(timeout = 4000)
public void test010() throws Throwable {
YearMonth yearMonth0 = new YearMonth();
Partial partial0 = new Partial(yearMonth0);
Months months0 = Months.FOUR;
DurationFieldType durationFieldType0 = months0.getFieldType();
Partial partial1 = partial0.withFieldAdded(durationFieldType0, (-2125));
assertNotSame(partial1, partial0);
}
@Test(timeout = 4000)
public void test011() throws Throwable {
YearMonth yearMonth0 = new YearMonth();
Partial partial0 = new Partial(yearMonth0);
Months months0 = Months.FOUR;
DurationFieldType durationFieldType0 = months0.getFieldType();
Partial partial1 = partial0.withFieldAddWrapped(durationFieldType0, 1188);
assertNotSame(partial1, partial0);
}
@Test(timeout = 4000)
public void test012() throws Throwable {
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.yearOfCentury();
Partial partial0 = new Partial(dateTimeFieldType0, 0);
Partial partial1 = partial0.withField(dateTimeFieldType0, 2);
assertNotSame(partial1, partial0);
assertFalse(partial1.equals((Object)partial0));
}
@Test(timeout = 4000)
public void test013() throws Throwable {
Partial partial0 = new Partial();
IslamicChronology islamicChronology0 = IslamicChronology.getInstance();
Partial partial1 = partial0.withChronologyRetainFields(islamicChronology0);
assertNotSame(partial1, partial0);
}
@Test(timeout = 4000)
public void test014() throws Throwable {
Partial partial0 = new Partial();
Locale locale0 = Locale.TAIWAN;
String string0 = partial0.toString("Z", locale0);
assertEquals("", string0);
}
@Test(timeout = 4000)
public void test015() throws Throwable {
Partial partial0 = new Partial();
String string0 = partial0.toString((String) null);
assertEquals("[]", string0);
}
@Test(timeout = 4000)
public void test016() throws Throwable {
Partial partial0 = new Partial();
int int0 = partial0.size();
assertEquals(0, int0);
}
@Test(timeout = 4000)
public void test017() throws Throwable {
YearMonth yearMonth0 = new YearMonth();
Partial partial0 = new Partial(yearMonth0);
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.year();
Partial partial1 = partial0.with(dateTimeFieldType0, (-410));
Partial.Property partial_Property0 = partial1.property(dateTimeFieldType0);
assertEquals((-410), partial_Property0.get());
}
@Test(timeout = 4000)
public void test018() throws Throwable {
Partial partial0 = new Partial();
Months months0 = Months.TWO;
Partial partial1 = partial0.minus(months0);
assertNotSame(partial1, partial0);
assertTrue(partial1.equals((Object)partial0));
}
@Test(timeout = 4000)
public void test019() throws Throwable {
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.weekOfWeekyear();
JulianChronology julianChronology0 = JulianChronology.getInstance();
Partial partial0 = new Partial(dateTimeFieldType0, 13, julianChronology0);
int[] intArray0 = partial0.getValues();
assertArrayEquals(new int[] {13}, intArray0);
}
@Test(timeout = 4000)
public void test020() throws Throwable {
Partial partial0 = new Partial();
int[] intArray0 = partial0.getValues();
assertEquals(0, intArray0.length);
}
@Test(timeout = 4000)
public void test021() throws Throwable {
YearMonth yearMonth0 = new YearMonth();
Partial partial0 = new Partial(yearMonth0);
int int0 = partial0.getValue(1);
assertEquals(2, int0);
}
@Test(timeout = 4000)
public void test022() throws Throwable {
CopticChronology copticChronology0 = CopticChronology.getInstance();
DateTimeFieldType[] dateTimeFieldTypeArray0 = new DateTimeFieldType[5];
int[] intArray0 = new int[6];
intArray0[1] = (-1301);
Partial partial0 = new Partial(copticChronology0, dateTimeFieldTypeArray0, intArray0);
int int0 = partial0.getValue(1);
assertEquals((-1301), int0);
}
@Test(timeout = 4000)
public void test023() throws Throwable {
YearMonth yearMonth0 = new YearMonth();
Partial partial0 = new Partial(yearMonth0);
DateTimeFieldType[] dateTimeFieldTypeArray0 = partial0.getFieldTypes();
assertEquals(2, dateTimeFieldTypeArray0.length);
}
@Test(timeout = 4000)
public void test024() throws Throwable {
YearMonth yearMonth0 = new YearMonth();
Partial partial0 = new Partial(yearMonth0);
DateTimeFieldType dateTimeFieldType0 = partial0.getFieldType(1);
assertEquals("monthOfYear", dateTimeFieldType0.getName());
}
@Test(timeout = 4000)
public void test025() throws Throwable {
YearMonth yearMonth0 = new YearMonth();
Partial partial0 = new Partial(yearMonth0);
EthiopicChronology ethiopicChronology0 = EthiopicChronology.getInstanceUTC();
DateTimeField dateTimeField0 = partial0.getField(1, (Chronology) ethiopicChronology0);
assertNotNull(dateTimeField0);
}
@Test(timeout = 4000)
public void test026() throws Throwable {
DateTimeFieldType[] dateTimeFieldTypeArray0 = new DateTimeFieldType[2];
int[] intArray0 = new int[0];
Partial partial0 = new Partial((Chronology) null, dateTimeFieldTypeArray0, intArray0);
Chronology chronology0 = partial0.getChronology();
assertNull(chronology0);
}
@Test(timeout = 4000)
public void test027() throws Throwable {
Partial partial0 = new Partial();
Chronology chronology0 = partial0.getChronology();
assertNotNull(chronology0);
}
@Test(timeout = 4000)
public void test028() throws Throwable {
YearMonth yearMonth0 = new YearMonth();
Partial partial0 = new Partial(yearMonth0);
int[] intArray0 = new int[5];
Partial partial1 = new Partial(partial0, intArray0);
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.year();
// Undeclared exception!
try {
partial1.without(dateTimeFieldType0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Value 0 for monthOfYear must not be smaller than 1
//
verifyException("org.joda.time.chrono.BaseChronology", e);
}
}
@Test(timeout = 4000)
public void test029() throws Throwable {
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.weekyear();
DateTimeZone dateTimeZone0 = DateTimeZone.forOffsetMillis((-1880));
GJChronology gJChronology0 = GJChronology.getInstance(dateTimeZone0);
Partial partial0 = new Partial(gJChronology0, (DateTimeFieldType[]) null, (int[]) null);
// Undeclared exception!
try {
partial0.without(dateTimeFieldType0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
@Test(timeout = 4000)
public void test030() throws Throwable {
GJChronology gJChronology0 = GJChronology.getInstanceUTC();
DateTimeZone dateTimeZone0 = gJChronology0.getZone();
EthiopicChronology ethiopicChronology0 = EthiopicChronology.getInstance(dateTimeZone0, 5);
DateTimeFieldType[] dateTimeFieldTypeArray0 = new DateTimeFieldType[8];
int[] intArray0 = new int[5];
Partial partial0 = new Partial(ethiopicChronology0, dateTimeFieldTypeArray0, intArray0);
// Undeclared exception!
try {
partial0.without(dateTimeFieldTypeArray0[0]);
fail("Expecting exception: ArrayIndexOutOfBoundsException");
} catch(ArrayIndexOutOfBoundsException e) {
}
}
@Test(timeout = 4000)
public void test031() throws Throwable {
Weeks weeks0 = Weeks.weeks(250);
int[] intArray0 = new int[6];
Partial partial0 = new Partial((Chronology) null, (DateTimeFieldType[]) null, intArray0);
// Undeclared exception!
try {
partial0.withPeriodAdded(weeks0, 250);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
@Test(timeout = 4000)
public void test032() throws Throwable {
ISOChronology iSOChronology0 = ISOChronology.getInstance();
int[] intArray0 = new int[0];
Partial partial0 = new Partial(iSOChronology0, (DateTimeFieldType[]) null, intArray0);
DurationFieldType durationFieldType0 = DurationFieldType.seconds();
// Undeclared exception!
try {
partial0.withFieldAdded(durationFieldType0, (-1464));
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
@Test(timeout = 4000)
public void test033() throws Throwable {
EthiopicChronology ethiopicChronology0 = EthiopicChronology.getInstanceUTC();
DateTimeFieldType[] dateTimeFieldTypeArray0 = new DateTimeFieldType[4];
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.hourOfHalfday();
dateTimeFieldTypeArray0[0] = dateTimeFieldType0;
dateTimeFieldTypeArray0[1] = dateTimeFieldTypeArray0[0];
DateTimeFieldType dateTimeFieldType1 = DateTimeFieldType.secondOfDay();
dateTimeFieldTypeArray0[2] = dateTimeFieldType1;
int[] intArray0 = new int[1];
Partial partial0 = new Partial(ethiopicChronology0, dateTimeFieldTypeArray0, intArray0);
DurationFieldType durationFieldType0 = dateTimeFieldType1.getDurationType();
// Undeclared exception!
try {
partial0.withFieldAdded(durationFieldType0, 542);
fail("Expecting exception: ArrayIndexOutOfBoundsException");
} catch(ArrayIndexOutOfBoundsException e) {
//
// 2
//
verifyException("org.joda.time.field.BaseDateTimeField", e);
}
}
@Test(timeout = 4000)
public void test034() throws Throwable {
DateTimeZone dateTimeZone0 = DateTimeZone.getDefault();
CopticChronology copticChronology0 = CopticChronology.getInstance(dateTimeZone0);
int[] intArray0 = new int[9];
Partial partial0 = new Partial(copticChronology0, (DateTimeFieldType[]) null, intArray0);
DurationFieldType durationFieldType0 = DurationFieldType.WEEKYEARS_TYPE;
// Undeclared exception!
try {
partial0.withFieldAddWrapped(durationFieldType0, 3177);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
@Test(timeout = 4000)
public void test035() throws Throwable {
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.dayOfYear();
BuddhistChronology buddhistChronology0 = BuddhistChronology.getInstance();
DateTimeZone dateTimeZone0 = buddhistChronology0.getZone();
GregorianChronology gregorianChronology0 = GregorianChronology.getInstance(dateTimeZone0);
int[] intArray0 = new int[5];
Partial partial0 = new Partial(gregorianChronology0, (DateTimeFieldType[]) null, intArray0);
// Undeclared exception!
try {
partial0.withField(dateTimeFieldType0, 623191204);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
@Test(timeout = 4000)
public void test036() throws Throwable {
GJChronology gJChronology0 = GJChronology.getInstance();
DateTimeFieldType[] dateTimeFieldTypeArray0 = new DateTimeFieldType[9];
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.clockhourOfHalfday();
dateTimeFieldTypeArray0[0] = dateTimeFieldType0;
int[] intArray0 = new int[1];
Partial partial0 = new Partial(gJChronology0, dateTimeFieldTypeArray0, intArray0);
// Undeclared exception!
try {
partial0.withField(dateTimeFieldTypeArray0[3], 1);
fail("Expecting exception: ArrayIndexOutOfBoundsException");
} catch(ArrayIndexOutOfBoundsException e) {
//
// 1
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test037() throws Throwable {
GJChronology gJChronology0 = GJChronology.getInstanceUTC();
DateTimeZone dateTimeZone0 = gJChronology0.getZone();
DateTimeFieldType[] dateTimeFieldTypeArray0 = new DateTimeFieldType[8];
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.millisOfDay();
dateTimeFieldTypeArray0[0] = dateTimeFieldType0;
DateTimeFieldType dateTimeFieldType1 = DateTimeFieldType.dayOfWeek();
dateTimeFieldTypeArray0[1] = dateTimeFieldType1;
BuddhistChronology buddhistChronology0 = BuddhistChronology.getInstance(dateTimeZone0);
int[] intArray0 = new int[5];
Partial partial0 = new Partial(buddhistChronology0, dateTimeFieldTypeArray0, intArray0);
// Undeclared exception!
try {
partial0.withChronologyRetainFields(gJChronology0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Value 0 for dayOfWeek must not be smaller than 1
//
verifyException("org.joda.time.chrono.BaseChronology", e);
}
}
@Test(timeout = 4000)
public void test038() throws Throwable {
GJChronology gJChronology0 = GJChronology.getInstanceUTC();
DateTimeZone dateTimeZone0 = gJChronology0.getZone();
EthiopicChronology ethiopicChronology0 = EthiopicChronology.getInstance(dateTimeZone0, 5);
DateTimeFieldType[] dateTimeFieldTypeArray0 = new DateTimeFieldType[8];
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.millisOfDay();
dateTimeFieldTypeArray0[0] = dateTimeFieldType0;
dateTimeFieldTypeArray0[1] = dateTimeFieldType0;
dateTimeFieldTypeArray0[2] = dateTimeFieldTypeArray0[0];
dateTimeFieldTypeArray0[3] = dateTimeFieldTypeArray0[1];
BuddhistChronology buddhistChronology0 = BuddhistChronology.getInstance(dateTimeZone0);
dateTimeFieldTypeArray0[4] = dateTimeFieldTypeArray0[1];
int[] intArray0 = new int[5];
Partial partial0 = new Partial(ethiopicChronology0, dateTimeFieldTypeArray0, intArray0);
// Undeclared exception!
try {
partial0.withChronologyRetainFields(buddhistChronology0);
fail("Expecting exception: ArrayIndexOutOfBoundsException");
} catch(ArrayIndexOutOfBoundsException e) {
//
// 5
//
verifyException("org.joda.time.chrono.BaseChronology", e);
}
}
@Test(timeout = 4000)
public void test039() throws Throwable {
YearMonth yearMonth0 = new YearMonth();
Partial partial0 = new Partial(yearMonth0);
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.yearOfCentury();
// Undeclared exception!
try {
partial0.with(dateTimeFieldType0, (-410));
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test040() throws Throwable {
int[] intArray0 = new int[0];
DateTimeZone dateTimeZone0 = DateTimeZone.getDefault();
LocalDateTime localDateTime0 = new LocalDateTime((long) 1, dateTimeZone0);
Partial partial0 = new Partial(localDateTime0);
Partial partial1 = new Partial(partial0, intArray0);
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.era();
// Undeclared exception!
try {
partial1.with(dateTimeFieldType0, (-1816));
fail("Expecting exception: ArrayIndexOutOfBoundsException");
} catch(ArrayIndexOutOfBoundsException e) {
}
}
@Test(timeout = 4000)
public void test041() throws Throwable {
ISOChronology iSOChronology0 = ISOChronology.getInstance();
DateTimeFieldType[] dateTimeFieldTypeArray0 = new DateTimeFieldType[2];
int[] intArray0 = new int[9];
Partial partial0 = new Partial(iSOChronology0, dateTimeFieldTypeArray0, intArray0);
// Undeclared exception!
try {
partial0.toStringList();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test042() throws Throwable {
GJChronology gJChronology0 = GJChronology.getInstanceUTC();
DateTimeZone dateTimeZone0 = gJChronology0.getZone();
EthiopicChronology ethiopicChronology0 = EthiopicChronology.getInstance(dateTimeZone0, 5);
DateTimeFieldType[] dateTimeFieldTypeArray0 = new DateTimeFieldType[8];
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.millisOfDay();
dateTimeFieldTypeArray0[0] = dateTimeFieldType0;
dateTimeFieldTypeArray0[1] = dateTimeFieldTypeArray0[0];
dateTimeFieldTypeArray0[2] = dateTimeFieldTypeArray0[1];
dateTimeFieldTypeArray0[3] = dateTimeFieldTypeArray0[0];
dateTimeFieldTypeArray0[4] = dateTimeFieldTypeArray0[0];
dateTimeFieldTypeArray0[5] = dateTimeFieldTypeArray0[4];
int[] intArray0 = new int[5];
Partial partial0 = new Partial(ethiopicChronology0, dateTimeFieldTypeArray0, intArray0);
// Undeclared exception!
try {
partial0.toStringList();
fail("Expecting exception: ArrayIndexOutOfBoundsException");
} catch(ArrayIndexOutOfBoundsException e) {
//
// 5
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test043() throws Throwable {
Partial partial0 = new Partial();
// Undeclared exception!
try {
partial0.toString("'", (Locale) null);
fail("Expecting exception: UnsupportedOperationException");
} catch(UnsupportedOperationException e) {
//
// Both printing and parsing not supported
//
verifyException("org.joda.time.format.DateTimeFormatterBuilder", e);
}
}
@Test(timeout = 4000)
public void test044() throws Throwable {
LocalDateTime localDateTime0 = LocalDateTime.now();
Partial partial0 = new Partial(localDateTime0);
Partial partial1 = new Partial(partial0, (int[]) null);
Locale locale0 = Locale.GERMANY;
// Undeclared exception!
try {
partial1.toString((String) null, locale0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test045() throws Throwable {
Partial partial0 = new Partial();
Locale locale0 = Locale.CANADA_FRENCH;
// Undeclared exception!
try {
partial0.toString("z8I,:lpp)S", locale0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Illegal pattern component: I
//
verifyException("org.joda.time.format.DateTimeFormat", e);
}
}
@Test(timeout = 4000)
public void test046() throws Throwable {
int[] intArray0 = new int[0];
DateTimeFieldType[] dateTimeFieldTypeArray0 = new DateTimeFieldType[7];
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.minuteOfHour();
dateTimeFieldTypeArray0[0] = dateTimeFieldType0;
Partial partial0 = new Partial((Chronology) null, dateTimeFieldTypeArray0, intArray0);
Locale locale0 = Locale.PRC;
// Undeclared exception!
try {
partial0.toString((String) null, locale0);
fail("Expecting exception: ArrayIndexOutOfBoundsException");
} catch(ArrayIndexOutOfBoundsException e) {
//
// 0
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test047() throws Throwable {
BuddhistChronology buddhistChronology0 = BuddhistChronology.getInstance();
DateTimeFieldType[] dateTimeFieldTypeArray0 = new DateTimeFieldType[4];
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.yearOfEra();
dateTimeFieldTypeArray0[0] = dateTimeFieldType0;
int[] intArray0 = new int[7];
Partial partial0 = new Partial(buddhistChronology0, dateTimeFieldTypeArray0, intArray0);
// Undeclared exception!
try {
partial0.toString(",^S7&;;+");
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// The resulting instant is below the supported minimum of 0001-01-01T00:00:00.000Z (BuddhistChronology[Etc/UTC])
//
verifyException("org.joda.time.chrono.LimitChronology", e);
}
}
@Test(timeout = 4000)
public void test048() throws Throwable {
Partial partial0 = new Partial();
// Undeclared exception!
try {
partial0.toString("'");
fail("Expecting exception: UnsupportedOperationException");
} catch(UnsupportedOperationException e) {
//
// Both printing and parsing not supported
//
verifyException("org.joda.time.format.DateTimeFormatterBuilder", e);
}
}
@Test(timeout = 4000)
public void test049() throws Throwable {
YearMonth yearMonth0 = new YearMonth();
Partial partial0 = new Partial(yearMonth0);
// Undeclared exception!
try {
partial0.toString("The divisor must be at least 2");
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Illegal pattern component: T
//
verifyException("org.joda.time.format.DateTimeFormat", e);
}
}
@Test(timeout = 4000)
public void test050() throws Throwable {
BuddhistChronology buddhistChronology0 = BuddhistChronology.getInstance();
DateTimeFieldType[] dateTimeFieldTypeArray0 = new DateTimeFieldType[4];
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.yearOfEra();
dateTimeFieldTypeArray0[0] = dateTimeFieldType0;
int[] intArray0 = new int[0];
Partial partial0 = new Partial(buddhistChronology0, dateTimeFieldTypeArray0, intArray0);
// Undeclared exception!
try {
partial0.toString(",^S7&;;+");
fail("Expecting exception: ArrayIndexOutOfBoundsException");
} catch(ArrayIndexOutOfBoundsException e) {
//
// 0
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test051() throws Throwable {
DateTimeFieldType[] dateTimeFieldTypeArray0 = new DateTimeFieldType[4];
GregorianChronology gregorianChronology0 = GregorianChronology.getInstanceUTC();
int[] intArray0 = new int[3];
Partial partial0 = new Partial(gregorianChronology0, dateTimeFieldTypeArray0, intArray0);
// Undeclared exception!
try {
partial0.toString();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test052() throws Throwable {
DateTimeFieldType[] dateTimeFieldTypeArray0 = new DateTimeFieldType[4];
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.weekyear();
dateTimeFieldTypeArray0[0] = dateTimeFieldType0;
DateTimeFieldType dateTimeFieldType1 = DateTimeFieldType.dayOfYear();
dateTimeFieldTypeArray0[1] = dateTimeFieldType1;
ISOChronology iSOChronology0 = ISOChronology.getInstance();
DateTimeFieldType[] dateTimeFieldTypeArray1 = new DateTimeFieldType[8];
dateTimeFieldTypeArray1[0] = dateTimeFieldType0;
dateTimeFieldTypeArray1[1] = dateTimeFieldTypeArray0[1];
dateTimeFieldTypeArray1[2] = dateTimeFieldType0;
dateTimeFieldTypeArray1[3] = dateTimeFieldType0;
dateTimeFieldTypeArray1[4] = dateTimeFieldTypeArray0[0];
dateTimeFieldTypeArray1[5] = dateTimeFieldType0;
dateTimeFieldTypeArray1[6] = dateTimeFieldType0;
dateTimeFieldTypeArray1[7] = dateTimeFieldType1;
int[] intArray0 = new int[7];
Partial partial0 = new Partial(iSOChronology0, dateTimeFieldTypeArray1, intArray0);
// Undeclared exception!
try {
partial0.toString();
fail("Expecting exception: ArrayIndexOutOfBoundsException");
} catch(ArrayIndexOutOfBoundsException e) {
//
// 7
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test053() throws Throwable {
EthiopicChronology ethiopicChronology0 = EthiopicChronology.getInstance();
int[] intArray0 = new int[3];
Partial partial0 = new Partial(ethiopicChronology0, (DateTimeFieldType[]) null, intArray0);
// Undeclared exception!
try {
partial0.size();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
@Test(timeout = 4000)
public void test054() throws Throwable {
EthiopicChronology ethiopicChronology0 = EthiopicChronology.getInstance();
int[] intArray0 = new int[5];
Partial partial0 = new Partial(ethiopicChronology0, (DateTimeFieldType[]) null, intArray0);
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.hourOfHalfday();
// Undeclared exception!
try {
partial0.property(dateTimeFieldType0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
@Test(timeout = 4000)
public void test055() throws Throwable {
Period period0 = new Period();
BuddhistChronology buddhistChronology0 = BuddhistChronology.getInstance();
DateTimeFieldType[] dateTimeFieldTypeArray0 = new DateTimeFieldType[7];
Partial partial0 = new Partial(buddhistChronology0, dateTimeFieldTypeArray0, (int[]) null);
// Undeclared exception!
try {
partial0.plus(period0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test056() throws Throwable {
Months months0 = Months.TEN;
JulianChronology julianChronology0 = JulianChronology.getInstance();
int[] intArray0 = new int[7];
Partial partial0 = new Partial(julianChronology0, (DateTimeFieldType[]) null, intArray0);
// Undeclared exception!
try {
partial0.minus(months0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
@Test(timeout = 4000)
public void test057() throws Throwable {
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.hourOfHalfday();
GregorianChronology gregorianChronology0 = GregorianChronology.getInstanceUTC();
StrictChronology strictChronology0 = StrictChronology.getInstance(gregorianChronology0);
Partial partial0 = new Partial(dateTimeFieldType0, 0, strictChronology0);
Partial partial1 = new Partial(partial0, (int[]) null);
// Undeclared exception!
try {
partial1.isMatch((ReadablePartial) partial0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test058() throws Throwable {
YearMonth yearMonth0 = new YearMonth();
Partial partial0 = new Partial(yearMonth0);
int[] intArray0 = new int[0];
Partial partial1 = new Partial(partial0, intArray0);
// Undeclared exception!
try {
partial1.isMatch((ReadablePartial) partial1);
fail("Expecting exception: ArrayIndexOutOfBoundsException");
} catch(ArrayIndexOutOfBoundsException e) {
//
// 0
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test059() throws Throwable {
DateTime dateTime0 = new DateTime();
GregorianChronology gregorianChronology0 = GregorianChronology.getInstance();
DateTimeFieldType[] dateTimeFieldTypeArray0 = new DateTimeFieldType[8];
Partial partial0 = new Partial(gregorianChronology0, dateTimeFieldTypeArray0, (int[]) null);
// Undeclared exception!
try {
partial0.isMatch((ReadableInstant) dateTime0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test060() throws Throwable {
DateTime dateTime0 = DateTime.now();
EthiopicChronology ethiopicChronology0 = EthiopicChronology.getInstance();
DateTimeFieldType[] dateTimeFieldTypeArray0 = new DateTimeFieldType[5];
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.weekyearOfCentury();
dateTimeFieldTypeArray0[0] = dateTimeFieldType0;
int[] intArray0 = new int[0];
Partial partial0 = new Partial(ethiopicChronology0, dateTimeFieldTypeArray0, intArray0);
// Undeclared exception!
try {
partial0.isMatch((ReadableInstant) dateTime0);
fail("Expecting exception: ArrayIndexOutOfBoundsException");
} catch(ArrayIndexOutOfBoundsException e) {
//
// 0
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test061() throws Throwable {
YearMonth yearMonth0 = new YearMonth();
Partial partial0 = new Partial(yearMonth0);
// Undeclared exception!
try {
partial0.getValue((-502));
fail("Expecting exception: ArrayIndexOutOfBoundsException");
} catch(ArrayIndexOutOfBoundsException e) {
//
// -502
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test062() throws Throwable {
BuddhistChronology buddhistChronology0 = BuddhistChronology.getInstanceUTC();
int[] intArray0 = new int[4];
Partial partial0 = new Partial(buddhistChronology0, (DateTimeFieldType[]) null, intArray0);
// Undeclared exception!
try {
partial0.getFormatter();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
@Test(timeout = 4000)
public void test063() throws Throwable {
EthiopicChronology ethiopicChronology0 = EthiopicChronology.getInstance();
int[] intArray0 = new int[1];
Partial partial0 = new Partial(ethiopicChronology0, (DateTimeFieldType[]) null, intArray0);
// Undeclared exception!
try {
partial0.getFieldTypes();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test064() throws Throwable {
GJChronology gJChronology0 = GJChronology.getInstance();
int[] intArray0 = new int[5];
Partial partial0 = new Partial(gJChronology0, (DateTimeFieldType[]) null, intArray0);
// Undeclared exception!
try {
partial0.getFieldType(100);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test065() throws Throwable {
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.yearOfCentury();
Partial partial0 = new Partial(dateTimeFieldType0, 0);
// Undeclared exception!
try {
partial0.getFieldType(3);
fail("Expecting exception: ArrayIndexOutOfBoundsException");
} catch(ArrayIndexOutOfBoundsException e) {
//
// 3
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test066() throws Throwable {
DateTimeZone dateTimeZone0 = DateTimeZone.getDefault();
ISOChronology iSOChronology0 = ISOChronology.getInstance(dateTimeZone0);
DateTimeFieldType[] dateTimeFieldTypeArray0 = new DateTimeFieldType[6];
int[] intArray0 = new int[9];
Partial partial0 = new Partial(iSOChronology0, dateTimeFieldTypeArray0, intArray0);
// Undeclared exception!
try {
partial0.getField(1, (Chronology) iSOChronology0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test067() throws Throwable {
Partial partial0 = new Partial();
FixedDateTimeZone fixedDateTimeZone0 = (FixedDateTimeZone)DateTimeZone.UTC;
GJChronology gJChronology0 = GJChronology.getInstance((DateTimeZone) fixedDateTimeZone0, 1L, 4);
// Undeclared exception!
try {
partial0.getField(3, (Chronology) gJChronology0);
fail("Expecting exception: ArrayIndexOutOfBoundsException");
} catch(ArrayIndexOutOfBoundsException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
@Test(timeout = 4000)
public void test068() throws Throwable {
DateTimeFieldType[] dateTimeFieldTypeArray0 = new DateTimeFieldType[4];
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.centuryOfEra();
dateTimeFieldTypeArray0[0] = dateTimeFieldType0;
DateTimeFieldType dateTimeFieldType1 = DateTimeFieldType.halfdayOfDay();
dateTimeFieldTypeArray0[1] = dateTimeFieldType1;
DateTimeFieldType dateTimeFieldType2 = DateTimeFieldType.hourOfHalfday();
dateTimeFieldTypeArray0[2] = dateTimeFieldType2;
DateTimeFieldType dateTimeFieldType3 = DateTimeFieldType.minuteOfHour();
dateTimeFieldTypeArray0[3] = dateTimeFieldType3;
int[] intArray0 = new int[4];
intArray0[1] = 17887500;
Partial partial0 = null;
try {
partial0 = new Partial(dateTimeFieldTypeArray0, intArray0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Value 17887500 for halfdayOfDay must not be larger than 1
//
verifyException("org.joda.time.chrono.BaseChronology", e);
}
}
@Test(timeout = 4000)
public void test069() throws Throwable {
EthiopicChronology ethiopicChronology0 = EthiopicChronology.getInstance((DateTimeZone) null);
StrictChronology strictChronology0 = StrictChronology.getInstance(ethiopicChronology0);
LocalDateTime localDateTime0 = new LocalDateTime((Chronology) strictChronology0);
Duration duration0 = new Duration(3145L, (-12219292800000L));
LocalDateTime localDateTime1 = localDateTime0.withDurationAdded(duration0, 2014);
Partial partial0 = null;
try {
partial0 = new Partial(localDateTime1);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// The instant is below the supported minimum of 0001-01-01T00:00:00.000Z (EthiopicChronology[UTC])
//
verifyException("org.joda.time.chrono.LimitChronology", e);
}
}
@Test(timeout = 4000)
public void test070() throws Throwable {
FixedDateTimeZone fixedDateTimeZone0 = (FixedDateTimeZone)DateTimeZone.UTC;
MonthDay monthDay0 = MonthDay.now((DateTimeZone) fixedDateTimeZone0);
MonthDay monthDay1 = new MonthDay(monthDay0, (int[]) null);
Partial partial0 = null;
try {
partial0 = new Partial(monthDay1);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.joda.time.base.BasePartial", e);
}
}
@Test(timeout = 4000)
public void test071() throws Throwable {
GJChronology gJChronology0 = GJChronology.getInstanceUTC();
DateTimeZone dateTimeZone0 = gJChronology0.getZone();
DateTimeFieldType[] dateTimeFieldTypeArray0 = new DateTimeFieldType[8];
BuddhistChronology buddhistChronology0 = BuddhistChronology.getInstance(dateTimeZone0);
int[] intArray0 = new int[5];
Partial partial0 = new Partial(buddhistChronology0, dateTimeFieldTypeArray0, intArray0);
Partial partial1 = null;
try {
partial1 = new Partial(partial0);
fail("Expecting exception: ArrayIndexOutOfBoundsException");
} catch(ArrayIndexOutOfBoundsException e) {
//
// 5
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test072() throws Throwable {
int[] intArray0 = new int[3];
Partial partial0 = null;
try {
partial0 = new Partial((Partial) null, intArray0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test073() throws Throwable {
CopticChronology copticChronology0 = CopticChronology.getInstanceUTC();
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.yearOfCentury();
Partial partial0 = null;
try {
partial0 = new Partial(dateTimeFieldType0, 3188, copticChronology0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Value 3188 for yearOfCentury must not be larger than 100
//
verifyException("org.joda.time.chrono.BaseChronology", e);
}
}
@Test(timeout = 4000)
public void test074() throws Throwable {
GJChronology gJChronology0 = GJChronology.getInstance();
Partial partial0 = null;
try {
partial0 = new Partial((DateTimeFieldType) null, 687, gJChronology0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// The field type must not be null
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test075() throws Throwable {
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.yearOfEra();
Partial partial0 = null;
try {
partial0 = new Partial(dateTimeFieldType0, 0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Value 0 for yearOfEra must not be smaller than 1
//
verifyException("org.joda.time.chrono.BaseChronology", e);
}
}
@Test(timeout = 4000)
public void test076() throws Throwable {
YearMonth yearMonth0 = new YearMonth();
Partial partial0 = new Partial(yearMonth0);
String string0 = partial0.toStringList();
assertEquals("[year=2014, monthOfYear=2]", string0);
}
@Test(timeout = 4000)
public void test077() throws Throwable {
JulianChronology julianChronology0 = JulianChronology.getInstance();
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.secondOfMinute();
Partial partial0 = new Partial(dateTimeFieldType0, 13, julianChronology0);
String string0 = partial0.toString();
assertEquals("--13", string0);
}
@Test(timeout = 4000)
public void test078() throws Throwable {
Partial partial0 = new Partial();
DateTimeFormatter dateTimeFormatter0 = partial0.getFormatter();
assertNull(dateTimeFormatter0);
}
@Test(timeout = 4000)
public void test079() throws Throwable {
Partial partial0 = new Partial();
Months months0 = Months.TWO;
Partial partial1 = partial0.withPeriodAdded(months0, 2443);
assertTrue(partial1.equals((Object)partial0));
assertNotSame(partial1, partial0);
}
@Test(timeout = 4000)
public void test080() throws Throwable {
DateTimeFieldType[] dateTimeFieldTypeArray0 = new DateTimeFieldType[2];
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.weekyearOfCentury();
dateTimeFieldTypeArray0[0] = dateTimeFieldType0;
DateTimeFieldType dateTimeFieldType1 = DateTimeFieldType.halfdayOfDay();
dateTimeFieldTypeArray0[1] = dateTimeFieldType1;
int[] intArray0 = new int[2];
EthiopicChronology ethiopicChronology0 = EthiopicChronology.getInstanceUTC();
Partial partial0 = null;
try {
partial0 = new Partial(dateTimeFieldTypeArray0, intArray0, ethiopicChronology0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Value 0 for weekyearOfCentury must not be smaller than 1
//
verifyException("org.joda.time.chrono.BaseChronology", e);
}
}
@Test(timeout = 4000)
public void test081() throws Throwable {
DateTimeFieldType[] dateTimeFieldTypeArray0 = new DateTimeFieldType[0];
int[] intArray0 = new int[0];
Partial partial0 = new Partial(dateTimeFieldTypeArray0, intArray0);
assertEquals(0, partial0.size());
}
@Test(timeout = 4000)
public void test082() throws Throwable {
Partial partial0 = new Partial();
Partial partial1 = new Partial(partial0, (int[]) null);
// Undeclared exception!
try {
partial1.getValue(1936);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test083() throws Throwable {
DateTimeFieldType[] dateTimeFieldTypeArray0 = new DateTimeFieldType[6];
Partial partial0 = new Partial((Chronology) null, dateTimeFieldTypeArray0, (int[]) null);
// Undeclared exception!
try {
partial0.getValues();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test084() throws Throwable {
LocalTime localTime0 = new LocalTime((-2906L));
Partial partial0 = new Partial(localTime0);
Locale locale0 = Locale.PRC;
String string0 = partial0.toString("@)_", locale0);
assertEquals("@)_", string0);
}
@Test(timeout = 4000)
public void test085() throws Throwable {
int[] intArray0 = new int[2];
Partial partial0 = new Partial((Chronology) null, (DateTimeFieldType[]) null, intArray0);
// Undeclared exception!
try {
partial0.toString((String) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
@Test(timeout = 4000)
public void test086() throws Throwable {
Partial partial0 = new Partial();
String string0 = partial0.toString("z");
assertEquals("", string0);
}
@Test(timeout = 4000)
public void test087() throws Throwable {
LocalDateTime localDateTime0 = LocalDateTime.now();
Partial partial0 = new Partial(localDateTime0);
DateTimeFormatter dateTimeFormatter0 = partial0.getFormatter();
assertNotNull(dateTimeFormatter0);
String string0 = partial0.toString();
assertEquals("[year=2014, monthOfYear=2, dayOfMonth=14, millisOfDay=73281320]", string0);
}
@Test(timeout = 4000)
public void test088() throws Throwable {
YearMonth yearMonth0 = new YearMonth();
Partial partial0 = new Partial(yearMonth0);
DateTimeFormatter dateTimeFormatter0 = partial0.getFormatter();
assertTrue(dateTimeFormatter0.isParser());
}
@Test(timeout = 4000)
public void test089() throws Throwable {
Partial partial0 = new Partial();
String string0 = partial0.toString();
assertEquals("[]", string0);
}
@Test(timeout = 4000)
public void test090() throws Throwable {
YearMonth yearMonth0 = new YearMonth();
Partial partial0 = new Partial(yearMonth0);
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.millisOfSecond();
Partial partial1 = partial0.with(dateTimeFieldType0, 1);
DateTimeFormatter dateTimeFormatter0 = partial1.getFormatter();
assertFalse(dateTimeFormatter0.isOffsetParsed());
}
@Test(timeout = 4000)
public void test091() throws Throwable {
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.weekyear();
Partial partial0 = new Partial(dateTimeFieldType0, (-2337));
// Undeclared exception!
try {
partial0.isMatch((ReadablePartial) null);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// The partial must not be null
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test092() throws Throwable {
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.weekOfWeekyear();
JulianChronology julianChronology0 = JulianChronology.getInstance();
Partial partial0 = new Partial(dateTimeFieldType0, 13, julianChronology0);
Instant instant0 = Instant.now();
boolean boolean0 = partial0.isMatch((ReadableInstant) instant0);
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test093() throws Throwable {
YearMonth yearMonth0 = new YearMonth();
Partial partial0 = new Partial(yearMonth0);
boolean boolean0 = partial0.isMatch((ReadableInstant) null);
assertTrue(boolean0);
}
@Test(timeout = 4000)
public void test094() throws Throwable {
Partial partial0 = new Partial();
Months months0 = Months.monthsBetween((ReadablePartial) partial0, (ReadablePartial) partial0);
Partial partial1 = partial0.withPeriodAdded(months0, 0);
assertSame(partial1, partial0);
}
@Test(timeout = 4000)
public void test095() throws Throwable {
Partial partial0 = new Partial();
Partial partial1 = partial0.withPeriodAdded((ReadablePeriod) null, 1270);
assertSame(partial1, partial0);
}
@Test(timeout = 4000)
public void test096() throws Throwable {
YearMonth yearMonth0 = new YearMonth();
Partial partial0 = new Partial(yearMonth0);
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.dayOfYear();
DurationFieldType durationFieldType0 = dateTimeFieldType0.getDurationType();
Partial partial1 = partial0.with(dateTimeFieldType0, 1);
// Undeclared exception!
try {
partial1.withFieldAddWrapped(durationFieldType0, (-3631));
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Fields invalid for add
//
verifyException("org.joda.time.field.BaseDateTimeField", e);
}
}
@Test(timeout = 4000)
public void test097() throws Throwable {
YearMonth yearMonth0 = YearMonth.now();
Partial partial0 = new Partial(yearMonth0);
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.yearOfCentury();
DurationFieldType durationFieldType0 = dateTimeFieldType0.getDurationType();
Partial partial1 = partial0.withFieldAdded(durationFieldType0, 0);
assertSame(partial1, partial0);
}
@Test(timeout = 4000)
public void test098() throws Throwable {
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.yearOfCentury();
Partial partial0 = new Partial(dateTimeFieldType0, 0);
Partial partial1 = partial0.withField(dateTimeFieldType0, 0);
assertSame(partial1, partial0);
}
@Test(timeout = 4000)
public void test099() throws Throwable {
Partial partial0 = new Partial();
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.dayOfMonth();
Partial partial1 = partial0.without(dateTimeFieldType0);
assertSame(partial0, partial1);
}
@Test(timeout = 4000)
public void test100() throws Throwable {
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.weekOfWeekyear();
JulianChronology julianChronology0 = JulianChronology.getInstance();
Partial partial0 = new Partial(dateTimeFieldType0, 13, julianChronology0);
// Undeclared exception!
try {
partial0.with(dateTimeFieldType0, 542);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Value 542 for weekOfWeekyear must be in the range [1,53]
//
verifyException("org.joda.time.field.FieldUtils", e);
}
}
@Test(timeout = 4000)
public void test101() throws Throwable {
LocalDateTime localDateTime0 = new LocalDateTime();
Partial partial0 = new Partial(localDateTime0);
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.millisOfSecond();
// Undeclared exception!
try {
partial0.with(dateTimeFieldType0, 2181);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Value 2181 for millisOfSecond must not be larger than 999
//
verifyException("org.joda.time.chrono.BaseChronology", e);
}
}
@Test(timeout = 4000)
public void test102() throws Throwable {
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.weekOfWeekyear();
LocalDateTime localDateTime0 = new LocalDateTime();
Partial partial0 = new Partial(localDateTime0);
// Undeclared exception!
try {
partial0.with(dateTimeFieldType0, 206);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Value 206 for weekOfWeekyear must not be larger than 53
//
verifyException("org.joda.time.chrono.BaseChronology", e);
}
}
@Test(timeout = 4000)
public void test103() throws Throwable {
DateTimeZone dateTimeZone0 = DateTimeZone.getDefault();
LocalDateTime localDateTime0 = new LocalDateTime((long) 1, dateTimeZone0);
Partial partial0 = new Partial(localDateTime0);
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.era();
// Undeclared exception!
try {
partial0.with(dateTimeFieldType0, (-1816));
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Types array must not contain duplicate: era and year
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test104() throws Throwable {
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.weekOfWeekyear();
JulianChronology julianChronology0 = JulianChronology.getInstance();
Partial partial0 = new Partial(dateTimeFieldType0, 13, julianChronology0);
Partial partial1 = partial0.with(dateTimeFieldType0, 13);
assertEquals(1, partial1.size());
}
@Test(timeout = 4000)
public void test105() throws Throwable {
YearMonth yearMonth0 = new YearMonth();
Partial partial0 = new Partial(yearMonth0);
// Undeclared exception!
try {
partial0.with((DateTimeFieldType) null, 23);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// The field type must not be null
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test106() throws Throwable {
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.weekOfWeekyear();
JulianChronology julianChronology0 = JulianChronology.getInstance();
Partial partial0 = new Partial(dateTimeFieldType0, 13, julianChronology0);
Partial partial1 = partial0.withChronologyRetainFields(julianChronology0);
assertSame(partial1, partial0);
}
@Test(timeout = 4000)
public void test107() throws Throwable {
DateTimeFieldType[] dateTimeFieldTypeArray0 = new DateTimeFieldType[7];
Partial partial0 = new Partial((Chronology) null, dateTimeFieldTypeArray0, (int[]) null);
// Undeclared exception!
try {
partial0.withChronologyRetainFields((Chronology) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.joda.time.chrono.BaseChronology", e);
}
}
@Test(timeout = 4000)
public void test108() throws Throwable {
Partial partial0 = null;
try {
partial0 = new Partial((ReadablePartial) null);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// The partial must not be null
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test109() throws Throwable {
DateTimeFieldType[] dateTimeFieldTypeArray0 = new DateTimeFieldType[4];
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.era();
dateTimeFieldTypeArray0[0] = dateTimeFieldType0;
DateTimeFieldType dateTimeFieldType1 = DateTimeFieldType.dayOfYear();
dateTimeFieldTypeArray0[1] = dateTimeFieldType1;
dateTimeFieldTypeArray0[2] = dateTimeFieldTypeArray0[1];
dateTimeFieldTypeArray0[3] = dateTimeFieldType1;
int[] intArray0 = new int[4];
Partial partial0 = null;
try {
partial0 = new Partial(dateTimeFieldTypeArray0, intArray0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Types array must not contain duplicate: dayOfYear and dayOfYear
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test110() throws Throwable {
DateTimeFieldType[] dateTimeFieldTypeArray0 = new DateTimeFieldType[3];
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.hourOfHalfday();
dateTimeFieldTypeArray0[0] = dateTimeFieldType0;
DateTimeFieldType dateTimeFieldType1 = DateTimeFieldType.hourOfDay();
dateTimeFieldTypeArray0[1] = dateTimeFieldType1;
dateTimeFieldTypeArray0[2] = dateTimeFieldTypeArray0[1];
int[] intArray0 = new int[3];
Partial partial0 = null;
try {
partial0 = new Partial(dateTimeFieldTypeArray0, intArray0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Types array must be in order largest-smallest: hourOfHalfday < hourOfDay
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test111() throws Throwable {
DateTimeFieldType[] dateTimeFieldTypeArray0 = new DateTimeFieldType[2];
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.weekyearOfCentury();
dateTimeFieldTypeArray0[0] = dateTimeFieldType0;
DateTimeFieldType dateTimeFieldType1 = DateTimeFieldType.weekyear();
dateTimeFieldTypeArray0[1] = dateTimeFieldType1;
int[] intArray0 = new int[2];
Partial partial0 = null;
try {
partial0 = new Partial(dateTimeFieldTypeArray0, intArray0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Types array must be in order largest-smallest: weekyearOfCentury < weekyear
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test112() throws Throwable {
DateTimeFieldType[] dateTimeFieldTypeArray0 = new DateTimeFieldType[5];
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.era();
dateTimeFieldTypeArray0[0] = dateTimeFieldType0;
dateTimeFieldTypeArray0[1] = dateTimeFieldTypeArray0[0];
dateTimeFieldTypeArray0[2] = dateTimeFieldType0;
dateTimeFieldTypeArray0[3] = dateTimeFieldTypeArray0[1];
dateTimeFieldTypeArray0[4] = dateTimeFieldTypeArray0[0];
int[] intArray0 = new int[5];
Partial partial0 = null;
try {
partial0 = new Partial(dateTimeFieldTypeArray0, intArray0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Types array must not contain duplicate: era and era
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test113() throws Throwable {
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.era();
CopticChronology copticChronology0 = CopticChronology.getInstance();
DateTimeFieldType[] dateTimeFieldTypeArray0 = new DateTimeFieldType[1];
dateTimeFieldTypeArray0[0] = dateTimeFieldType0;
int[] intArray0 = new int[8];
Partial partial0 = new Partial(copticChronology0, dateTimeFieldTypeArray0, intArray0);
DateTimeFieldType dateTimeFieldType1 = DateTimeFieldType.dayOfMonth();
// Undeclared exception!
try {
partial0.with(dateTimeFieldType1, 3);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Value 0 for era must not be smaller than 1
//
verifyException("org.joda.time.chrono.BaseChronology", e);
}
}
@Test(timeout = 4000)
public void test114() throws Throwable {
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.era();
DateTimeFieldType dateTimeFieldType1 = DateTimeFieldType.dayOfYear();
DateTimeFieldType[] dateTimeFieldTypeArray0 = new DateTimeFieldType[4];
dateTimeFieldTypeArray0[0] = dateTimeFieldType1;
dateTimeFieldTypeArray0[1] = dateTimeFieldType0;
dateTimeFieldTypeArray0[2] = dateTimeFieldType1;
dateTimeFieldTypeArray0[3] = dateTimeFieldType0;
int[] intArray0 = new int[4];
Partial partial0 = null;
try {
partial0 = new Partial(dateTimeFieldTypeArray0, intArray0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Types array must be in order largest-smallest: dayOfYear < era
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test115() throws Throwable {
DateTimeFieldType[] dateTimeFieldTypeArray0 = new DateTimeFieldType[8];
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.minuteOfDay();
dateTimeFieldTypeArray0[0] = dateTimeFieldType0;
DateTimeFieldType dateTimeFieldType1 = DateTimeFieldType.minuteOfHour();
dateTimeFieldTypeArray0[1] = dateTimeFieldType1;
DateTimeFieldType dateTimeFieldType2 = DateTimeFieldType.monthOfYear();
dateTimeFieldTypeArray0[2] = dateTimeFieldType2;
dateTimeFieldTypeArray0[3] = dateTimeFieldType2;
dateTimeFieldTypeArray0[4] = dateTimeFieldTypeArray0[2];
dateTimeFieldTypeArray0[5] = dateTimeFieldTypeArray0[1];
dateTimeFieldTypeArray0[6] = dateTimeFieldType2;
dateTimeFieldTypeArray0[7] = dateTimeFieldTypeArray0[2];
int[] intArray0 = new int[8];
Partial partial0 = null;
try {
partial0 = new Partial(dateTimeFieldTypeArray0, intArray0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Types array must be in order largest-smallest: minuteOfHour < monthOfYear
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test116() throws Throwable {
CopticChronology copticChronology0 = CopticChronology.getInstanceUTC();
DateTimeFieldType[] dateTimeFieldTypeArray0 = new DateTimeFieldType[0];
int[] intArray0 = new int[0];
Partial partial0 = new Partial(dateTimeFieldTypeArray0, intArray0, copticChronology0);
assertEquals(0, partial0.size());
}
@Test(timeout = 4000)
public void test117() throws Throwable {
DateTimeFieldType[] dateTimeFieldTypeArray0 = new DateTimeFieldType[2];
int[] intArray0 = new int[4];
IslamicChronology islamicChronology0 = IslamicChronology.getInstanceUTC();
Partial partial0 = null;
try {
partial0 = new Partial(dateTimeFieldTypeArray0, intArray0, islamicChronology0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Values array must be the same length as the types array
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test118() throws Throwable {
DateTimeFieldType[] dateTimeFieldTypeArray0 = new DateTimeFieldType[0];
Partial partial0 = null;
try {
partial0 = new Partial(dateTimeFieldTypeArray0, (int[]) null);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Values array must not be null
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test119() throws Throwable {
int[] intArray0 = new int[5];
Partial partial0 = null;
try {
partial0 = new Partial((DateTimeFieldType[]) null, intArray0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Types array must not be null
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test120() throws Throwable {
Partial partial0 = null;
try {
partial0 = new Partial((DateTimeFieldType) null, 4);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// The field type must not be null
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test121() throws Throwable {
FixedDateTimeZone fixedDateTimeZone0 = (FixedDateTimeZone)DateTimeZone.UTC;
CopticChronology copticChronology0 = CopticChronology.getInstance((DateTimeZone) fixedDateTimeZone0);
Partial partial0 = new Partial(copticChronology0);
Partial.Property partial_Property0 = new Partial.Property(partial0, 1);
// Undeclared exception!
try {
partial_Property0.withMinimumValue();
fail("Expecting exception: ArrayIndexOutOfBoundsException");
} catch(ArrayIndexOutOfBoundsException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
@Test(timeout = 4000)
public void test122() throws Throwable {
EthiopicChronology ethiopicChronology0 = EthiopicChronology.getInstanceUTC();
int[] intArray0 = new int[0];
Partial partial0 = new Partial(ethiopicChronology0, (DateTimeFieldType[]) null, intArray0);
Partial.Property partial_Property0 = new Partial.Property(partial0, 1);
// Undeclared exception!
try {
partial_Property0.withMaximumValue();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test123() throws Throwable {
Partial partial0 = new Partial();
Partial.Property partial_Property0 = new Partial.Property(partial0, 427);
Partial partial1 = partial_Property0.getPartial();
assertEquals(0, partial1.size());
}
@Test(timeout = 4000)
public void test124() throws Throwable {
YearMonth yearMonth0 = new YearMonth();
Partial partial0 = new Partial(yearMonth0);
Partial.Property partial_Property0 = new Partial.Property(partial0, (-3811));
ReadablePartial readablePartial0 = partial_Property0.getReadablePartial();
assertEquals(2, readablePartial0.size());
}
@Test(timeout = 4000)
public void test125() throws Throwable {
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.weekOfWeekyear();
JulianChronology julianChronology0 = JulianChronology.getInstance();
Partial partial0 = new Partial(dateTimeFieldType0, 8, julianChronology0);
Partial.Property partial_Property0 = partial0.property(dateTimeFieldType0);
Partial partial1 = partial_Property0.setCopy(8);
assertTrue(partial1.equals((Object)partial0));
}
@Test(timeout = 4000)
public void test126() throws Throwable {
YearMonth yearMonth0 = new YearMonth();
Partial partial0 = new Partial(yearMonth0);
Partial.Property partial_Property0 = new Partial.Property(partial0, 1);
Partial partial1 = partial_Property0.addWrapFieldToCopy(66);
assertNotSame(partial0, partial1);
}
@Test(timeout = 4000)
public void test127() throws Throwable {
EthiopicChronology ethiopicChronology0 = EthiopicChronology.getInstance();
DateTimeFieldType[] dateTimeFieldTypeArray0 = new DateTimeFieldType[3];
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.centuryOfEra();
dateTimeFieldTypeArray0[0] = dateTimeFieldType0;
int[] intArray0 = new int[3];
Partial partial0 = new Partial(ethiopicChronology0, dateTimeFieldTypeArray0, intArray0);
Partial.Property partial_Property0 = partial0.property(dateTimeFieldType0);
int int0 = partial_Property0.get();
assertEquals(0, int0);
}
@Test(timeout = 4000)
public void test128() throws Throwable {
YearMonth yearMonth0 = YearMonth.now();
Partial partial0 = new Partial(yearMonth0);
Partial.Property partial_Property0 = new Partial.Property(partial0, 0);
partial_Property0.setCopy("6");
assertEquals(2014, partial_Property0.get());
}
@Test(timeout = 4000)
public void test129() throws Throwable {
Months months0 = Months.MAX_VALUE;
Partial partial0 = new Partial();
assertEquals(0, partial0.size());
Partial partial1 = partial0.plus(months0);
assertTrue(partial1.equals((Object)partial0));
assertNotSame(partial1, partial0);
}
@Test(timeout = 4000)
public void test130() throws Throwable {
LocalTime localTime0 = new LocalTime((-2906L));
Partial partial0 = new Partial(localTime0);
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.millisOfDay();
Partial partial1 = partial0.with(dateTimeFieldType0, 2013);
assertEquals(5, partial1.size());
}
@Test(timeout = 4000)
public void test131() throws Throwable {
CopticChronology copticChronology0 = CopticChronology.getInstance();
DateTimeFieldType[] dateTimeFieldTypeArray0 = new DateTimeFieldType[5];
int[] intArray0 = new int[6];
Partial partial0 = new Partial(copticChronology0, dateTimeFieldTypeArray0, intArray0);
int int0 = partial0.getValue(1);
assertEquals(0, int0);
}
@Test(timeout = 4000)
public void test132() throws Throwable {
Partial partial0 = new Partial();
DateTimeFieldType[] dateTimeFieldTypeArray0 = partial0.getFieldTypes();
assertEquals(0, dateTimeFieldTypeArray0.length);
}
@Test(timeout = 4000)
public void test133() throws Throwable {
DateTimeFieldType[] dateTimeFieldTypeArray0 = new DateTimeFieldType[2];
int[] intArray0 = new int[2];
Partial partial0 = null;
try {
partial0 = new Partial(dateTimeFieldTypeArray0, intArray0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Types array must not contain null: index 0
//
verifyException("org.joda.time.Partial", e);
}
}
@Test(timeout = 4000)
public void test134() throws Throwable {
CopticChronology copticChronology0 = CopticChronology.getInstance();
DateTimeFieldType[] dateTimeFieldTypeArray0 = new DateTimeFieldType[5];
DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.centuryOfEra();
int[] intArray0 = new int[6];
Partial partial0 = new Partial(copticChronology0, dateTimeFieldTypeArray0, intArray0);
// Undeclared exception!
try {
partial0.property(dateTimeFieldType0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Field 'centuryOfEra' is not supported
//
verifyException("org.joda.time.base.AbstractPartial", e);
}
}
}
|
[
"pderakhshanfar@serg2.ewi.tudelft.nl"
] |
pderakhshanfar@serg2.ewi.tudelft.nl
|
4285f27fd63284794aa8d27640bc672ebe7f6ce2
|
d6aba592c1eb0ece01e76c562fb3bae11bf7143d
|
/app/src/main/java/com/ullas/SignInPackage/session_id.java
|
2fbed42306b59df5ff538aeeda8d182cff35e639
|
[] |
no_license
|
ullasms/omdb-ullas
|
8d7b6709ad89cfa3cc28657766f5e9a1120f007f
|
4ccd289f173da5fd37a7fa17a7b6f6b4daa8cb93
|
refs/heads/master
| 2020-07-10T03:41:08.515028
| 2019-08-24T13:36:18
| 2019-08-24T13:36:18
| 204,158,839
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 86
|
java
|
package com.ullas.SignInPackage;
public class session_id {
String session_id;
}
|
[
"ullasms91@gmail.com"
] |
ullasms91@gmail.com
|
35d27fad0e7605912cb13cf20574a368005cfd09
|
194d183d29234081fe860a8664f173659f58929b
|
/src/com/jhlabs/image/GradientWipeFilter.java
|
d2e7e977b62bb1c4133ad99229ced4f665f49d3f
|
[] |
no_license
|
Darkxell/EDMHouse
|
38d6b472315b787afb73f8dc2791b6d9bd3f837b
|
2e2a9c440ddb73d9c37c5c6661b9ec9eacf614dc
|
refs/heads/master
| 2021-01-23T18:49:35.639760
| 2015-10-14T11:54:39
| 2015-10-14T11:54:39
| 38,841,086
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,025
|
java
|
/*
Copyright 2006 Jerry Huxtable
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package com.jhlabs.image;
import java.awt.image.*;
/**
* A filter which can be used to produce wipes by transferring the luma of a
* mask image into the alpha channel of the source.
*/
public class GradientWipeFilter extends AbstractBufferedImageOp {
private float density = 0;
private float softness = 0;
private boolean invert;
private BufferedImage mask;
public GradientWipeFilter() {
}
/**
* Set the density of the image in the range 0..1. *arg density The density
*/
public void setDensity(float density) {
this.density = density;
}
public float getDensity() {
return density;
}
/**
* Set the softness of the dissolve in the range 0..1.
*
* @param softness
* the softness
* @min-value 0
* @max-value 1
* @see #getSoftness
*/
public void setSoftness(float softness) {
this.softness = softness;
}
/**
* Get the softness of the dissolve.
*
* @return the softness
* @see #setSoftness
*/
public float getSoftness() {
return softness;
}
public void setMask(BufferedImage mask) {
this.mask = mask;
}
public BufferedImage getMask() {
return mask;
}
public void setInvert(boolean invert) {
this.invert = invert;
}
public boolean getInvert() {
return invert;
}
public BufferedImage filter(BufferedImage src, BufferedImage dst) {
int width = src.getWidth();
int height = src.getHeight();
if (dst == null)
dst = createCompatibleDestImage(src, null);
if (mask == null)
return dst;
int maskWidth = mask.getWidth();
int maskHeight = mask.getHeight();
float d = density * (1 + softness);
float lower = 255 * (d - softness);
float upper = 255 * d;
int[] inPixels = new int[width];
int[] maskPixels = new int[maskWidth];
for (int y = 0; y < height; y++) {
getRGB(src, 0, y, width, 1, inPixels);
getRGB(mask, 0, y % maskHeight, maskWidth, 1, maskPixels);
for (int x = 0; x < width; x++) {
int maskRGB = maskPixels[x % maskWidth];
int inRGB = inPixels[x];
int v = PixelUtils.brightness(maskRGB);
float f = ImageMath.smoothStep(lower, upper, v);
int a = (int) (255 * f);
if (invert)
a = 255 - a;
inPixels[x] = (a << 24) | (inRGB & 0x00ffffff);
}
setRGB(dst, 0, y, width, 1, inPixels);
}
return dst;
}
public String toString() {
return "Transitions/Gradient Wipe...";
}
}
|
[
"darkxell.mc@gmail.com"
] |
darkxell.mc@gmail.com
|
acf2fead3d64eb567db03d412405f6fe62f34705
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/31/31_5f93ea0b746c1f06e951b671d2771c8f1a63f7fa/CmsIndex/31_5f93ea0b746c1f06e951b671d2771c8f1a63f7fa_CmsIndex_t.java
|
c3d5c36da73178bfbebfaa0d1844f75333270295
|
[] |
no_license
|
zhongxingyu/Seer
|
48e7e5197624d7afa94d23f849f8ea2075bcaec0
|
c11a3109fdfca9be337e509ecb2c085b60076213
|
refs/heads/master
| 2023-07-06T12:48:55.516692
| 2023-06-22T07:55:56
| 2023-06-22T07:55:56
| 259,613,157
| 6
| 2
| null | 2023-06-22T07:55:57
| 2020-04-28T11:07:49
| null |
UTF-8
|
Java
| false
| false
| 6,993
|
java
|
package org.alt60m.cms.servlet;
import org.alt60m.util.ObjectHashUtil;
import java.io.IOException;
import java.util.*;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.lucene.index.*;
import org.apache.lucene.analysis.*;
import org.apache.lucene.document.*;
import org.apache.lucene.queryParser.*;
import org.apache.lucene.search.*;
public class CmsIndex {
static String searchIndexPath;
static String fileSpecsPath;
private static Log log = LogFactory.getLog(CmsIndex.class);
public CmsIndex() {}
public static void SetIndexPath(String searchIndexPathIn) {
searchIndexPath = searchIndexPathIn;
}
public static void setFileSpecsPath(String fileSpecsPath) {
CmsIndex.fileSpecsPath = fileSpecsPath;
}
public void populate() {
try {
IndexWriter writer = new IndexWriter(searchIndexPath, new SimpleAnalyzer(), true);
Hashtable fileSpecs = CmsFileSpecsProcessor.parse(fileSpecsPath);
// get all the files in the cms
org.alt60m.cms.model.File a = new org.alt60m.cms.model.File();
Vector fileSet = (Vector)ObjectHashUtil.list(a.selectList("1=1 order by CmsFileID"));
for (int i=0;i<fileSet.size();i++) {
Hashtable f = (Hashtable)fileSet.get(i);
log.debug("Indexing file " + f.get("FileId"));
add(f,writer,fileSpecs);
}
log.debug("Optimizing");
writer.optimize();
writer.close();
} catch (Exception e) {
log.error(e, e);
}
}
public static void add(Hashtable d) {
try {
IndexWriter writer;
writer = new IndexWriter(searchIndexPath, new SimpleAnalyzer(), false);
Hashtable fileSpecs = CmsFileSpecsProcessor.parse(fileSpecsPath);
add(d,writer,fileSpecs);
writer.close();
} catch (IOException ioe) {
log.error("Error while adding to search index!", ioe);
}
}
public static void add(Hashtable d, Hashtable fileSpecs) {
try {
IndexWriter writer;
writer = new IndexWriter(searchIndexPath, new SimpleAnalyzer(), false);
add(d,writer,fileSpecs);
writer.close();
} catch (IOException ioe) {
log.error("Error while adding to search index!", ioe);
}
}
public static void add(Hashtable d, IndexWriter writer, Hashtable fileSpecs) {
try {
String id = (String)d.get("FileId");
Document doc = new Document();
doc.add(Field.Keyword("FileId",id));
doc.add(Field.Text("title",(String)d.get("Title")));
doc.add(Field.Text("author",(String)d.get("Author")));
doc.add(Field.Text("submitter",(String)d.get("Submitter")));
doc.add(Field.Text("contact",(String)d.get("Contact")));
doc.add(Field.Text("keywords",(String)d.get("Keywords")));
doc.add(Field.Text("summary",(String)d.get("Summary")));
doc.add(Field.Keyword("language",(String)d.get("Language")));
try {doc.add(Field.Keyword("dateAdded",DateField.dateToString((Date)d.get("DateAdded"))));}
catch (NullPointerException ne) {doc.add(Field.Keyword("dateAdded",""));}
doc.add(Field.Keyword("quality",(String)d.get("Quality")));
doc.add(Field.Keyword("mime",(String)d.get("Mime")));
doc.add(Field.Keyword("url",(String)d.get("Url")));
doc.add(Field.Text("all",""+d.get("Title")+" "+d.get("Author")+" "+d.get("Submitter")+" "+d.get("Contact")+" "+d.get("Keywords")+" "+d.get("Summary")));
// add type of doc based on filespec type
String url = (String)d.get("Url");
try {
String ext = url.toLowerCase().substring(url.lastIndexOf("."));
if ((d.get("submitType")!=null)&&(d.get("submitType").equals("web"))) { ext = ".html"; }
if (((String)d.get("Url")).startsWith("http://")) { ext = ".html"; }
Hashtable fileSpec = (Hashtable)fileSpecs.get(ext);
if (fileSpec != null) {
doc.add(Field.Keyword("type",(String)fileSpec.get("Group")));
} else {
log.warn("File '" + d.get("Title") + "' with extension '" + ext + "' has no group");
doc.add(Field.Keyword("type","none"));
}
}
catch (StringIndexOutOfBoundsException sioobe)
{
doc.add(Field.Keyword("type","none"));
}
writer.addDocument(doc);
} catch (IOException ioe) {
log.error("Error while adding to search index!", ioe);
}
}
public static void update(Hashtable d, Hashtable fileSpecs) {
String url = (String)d.get("Url");
CmsIndex.remove(url);
CmsIndex.add(d, fileSpecs);
}
public static void remove(String id) {
try {
IndexReader reader = IndexReader.open(searchIndexPath);
//this should work but there is a bug in Lucene with using an int as a value for the term
//Term term = new Term("cmsFileId", id);
Term term = new Term("url", id);
reader.delete(term);
reader.close();
} catch (IOException ioe) {
log.error("Error while deleting from search index", ioe);
}
}
public static Hashtable search(String queryString) {
Hashtable h = new Hashtable();
try {
Query query = QueryParser.parse(queryString, "all", new StopAnalyzer());
h = CmsIndex.search(query);
} catch (ParseException pe) {
log.error(pe);
}
return h;
}
public static Hashtable search(Query query) {
Hashtable results = new Hashtable();
try {
Searcher searcher = new IndexSearcher(searchIndexPath);
new StopAnalyzer(); //Is this being used?
//Query query1 = QueryParser.parse(queryString+" +quality:1", "all", analyzer);
log.info("Searching for: " + query.toString("all"));
Hits hits = searcher.search(query);
log.info(hits.length() + " total matching document(s)");
for (int i=0; i < hits.length(); i++) {
Hashtable hit = new Hashtable();
hit.put("FileId",hits.doc(i).get("FileId"));
hit.put("Title",hits.doc(i).get("title"));
hit.put("Author",hits.doc(i).get("author"));
hit.put("Submitter",hits.doc(i).get("submitter"));
hit.put("Contact",hits.doc(i).get("contact"));
hit.put("Summary",hits.doc(i).get("summary"));
hit.put("Language",hits.doc(i).get("language"));
hit.put("DateAdded",hits.doc(i).get("dateAdded"));
hit.put("Quality",hits.doc(i).get("quality"));
hit.put("Mime",hits.doc(i).get("mime"));
hit.put("Url",hits.doc(i).get("url"));
hit.put("Score",Float.toString(hits.score(i)*100));
results.put(Integer.toString(i),hit);
}
searcher.close();
} catch (Exception e) {
log.error(" caught a " + e.getClass() +
"\n with message: " + e.getMessage());
}
return results;
}
// javac -d G:\ade4\classes G:\ade4\controlled-src\services-src\source\org\alt60m\cms\servlet\CmsIndex.java
public static void main(String[] args) {
CmsIndex ci = new CmsIndex();
log.info("Index creation Started");
ci.populate();
/*
Hashtable results = ci.search(args[0]);
for (int i=0;i<results.size();i++) {
Hashtable result = (Hashtable)results.get(new Integer(i).toString());
log.info((i+1) + ". " + result.get("Title") + " (" + result.get("Score") + "%)");
}
*/
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
ad1942efa7efbfd02664c68d565030ac01738fd8
|
94bcbb9b3051298e0644109a28dd3afa461fa638
|
/06-KataRover/java/session2/src/main/java/com/capgemini/coedevon/codingdojo/lunarrover/East.java
|
96e04d8aeb789144c36e91984c33e6f3aa99d989
|
[
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
acuestav/codingDojo
|
3a5fe4ca171143c76e17fe7b57675dfcb61566fb
|
a127d47965df25bb5fc15815fff3969a1f7fc158
|
refs/heads/master
| 2020-08-27T03:54:13.450097
| 2019-10-23T09:01:16
| 2019-10-23T09:01:16
| 217,237,263
| 0
| 0
|
MIT
| 2019-10-24T07:23:43
| 2019-10-24T07:23:43
| null |
UTF-8
|
Java
| false
| false
| 853
|
java
|
package com.capgemini.coedevon.codingdojo.lunarrover;
import java.util.Objects;
/**
* @author pajimene
*
*/
public class East implements Orientation {
private static Orientation instance;
private East() {
}
public static Orientation getInstance() {
if (Objects.isNull(instance)) {
instance = new East();
}
return instance;
}
@Override
public void turnLeft(Rover rover) {
rover.setOrientation(North.getInstance());
}
@Override
public void turnRight(Rover rover) {
rover.setOrientation(South.getInstance());
}
@Override
public char getOrientation() {
return 'E';
}
@Override
public void moveForward(Rover rover) {
rover.getPosition().moveX(MOVEMENT_UNIT);
}
@Override
public void moveBackward(Rover rover) {
rover.getPosition().moveX(-MOVEMENT_UNIT);
}
}
|
[
"pablo.jimenez-martinez@capgemini.com"
] |
pablo.jimenez-martinez@capgemini.com
|
3ba4b6576b570e8545354b6bf761df6f37766fab
|
a1bab855fe03f76d5f01ea43bd8eaebf9798c645
|
/state/src/main/java/com/evelyn/design/pattern/state/AfternoonState.java
|
c4a683b7f1923bdf4dd49486493ef0c56a8f0126
|
[] |
no_license
|
EvelynJone/javapattern
|
bb0a20126cfab0a86ef924cf1bcafb0df0df2a87
|
75c2407d5503ad0b1a5defbd3a8fa957dd712dbd
|
refs/heads/master
| 2020-03-17T07:02:18.513832
| 2018-06-04T11:15:02
| 2018-06-04T11:15:02
| 133,380,084
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 650
|
java
|
package com.evelyn.design.pattern.state;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* 功能说明:TODO
*
* @auther by zhaoxl
* @return <br/>
* 修改历史:<br/>
* 1.[2018年05月22日上午20:12]
*/
public class AfternoonState extends State {
private static final Logger LOG = LoggerFactory.getLogger(AfternoonState.class);
@Override
public void writeProgram(Work w) {
if (w.getHour() < 17) {
LOG.info("当前时间:{}点 下午状态还不错,继续努力",w.getHour());
}else {
w.setState(new EveningState());
w.writeProgram();
}
}
}
|
[
"waner@tsign.cn"
] |
waner@tsign.cn
|
33d08d0831f1de98c232e237ae0d9f28fd2ffcbd
|
06bb1087544f7252f6a83534c5427975f1a6cfc7
|
/modules/admin-gui/src/org/ejbca/ui/web/admin/approval/ApprovalDataVOView.java
|
98ba5347c3a8f3cc40286c6bf91a125258062af1
|
[] |
no_license
|
mvilche/ejbca-ce
|
65f2b54922eeb47aa7a132166ca5dfa862cee55b
|
a89c66218abed47c7b310c3999127409180969dd
|
refs/heads/master
| 2021-03-08T08:51:18.636030
| 2020-03-12T18:53:18
| 2020-03-12T18:53:18
| 246,335,702
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 15,899
|
java
|
/*************************************************************************
* *
* EJBCA Community: The OpenSource Certificate Authority *
* *
* This software is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or any later version. *
* *
* See terms of license at gnu.org. *
* *
*************************************************************************/
package org.ejbca.ui.web.admin.approval;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.security.Principal;
import java.security.cert.Certificate;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.ejb.EJBException;
import javax.faces.application.Application;
import javax.faces.context.FacesContext;
import org.apache.log4j.Logger;
import org.cesecore.authentication.tokens.AuthenticationToken;
import org.cesecore.authentication.tokens.PublicAccessAuthenticationToken;
import org.cesecore.authentication.tokens.PublicWebPrincipal;
import org.cesecore.authentication.tokens.WebPrincipal;
import org.cesecore.authorization.AuthorizationDeniedException;
import org.cesecore.certificates.ca.CAInfo;
import org.cesecore.util.CertTools;
import org.ejbca.core.model.approval.ApprovalDataText;
import org.ejbca.core.model.approval.ApprovalDataVO;
import org.ejbca.core.model.approval.ApprovalRequest;
import org.ejbca.core.model.approval.approvalrequests.AddEndEntityApprovalRequest;
import org.ejbca.core.model.approval.approvalrequests.EditEndEntityApprovalRequest;
import org.ejbca.core.model.approval.profile.ApprovalProfile;
import org.ejbca.core.model.util.EjbLocalHelper;
import org.ejbca.ui.web.admin.LinkView;
import org.ejbca.ui.web.admin.configuration.EjbcaJSFHelper;
/**
* Class representing the view of one ApprovalDataVO data
*
*
* @version $Id: ApprovalDataVOView.java 28844 2018-05-04 08:31:02Z samuellb $
*/
public class ApprovalDataVOView implements Serializable {
private static final long serialVersionUID = 1L;
private static final Logger log = Logger.getLogger(ApprovalDataVOView.class);
private final EjbLocalHelper ejbLocalHelper = new EjbLocalHelper();
private ApprovalDataVO data;
// Table of the translation constants in languagefile.xx.properties
private static final String CERTSERIALNUMBER = "CERTSERIALNUMBER";
private static final String ISSUERDN = "ISSUERDN";
private static final String USERNAME = "USERNAME";
public ApprovalDataVOView(ApprovalDataVO data) {
this.data = data;
}
public ApprovalDataVOView() { }
public ApprovalRequest getApprovalRequest() {
return data.getApprovalRequest();
}
public String getRequestDate() {
return fastDateFormat(data.getRequestDate());
}
public String getExpireDate() {
return fastDateFormat(data.getExpireDate());
}
private String fastDateFormat(final Date date) {
return EjbcaJSFHelper.getBean().getEjbcaWebBean().formatAsISO8601(date);
}
public String getCaName() {
EjbcaJSFHelper helpBean = EjbcaJSFHelper.getBean();
if (data.getCAId() == ApprovalDataVO.ANY_CA) {
return helpBean.getEjbcaWebBean().getText("ANYCA", true);
}
try {
CAInfo caInfo = ejbLocalHelper.getCaSession().getCAInfo(helpBean.getAdmin(), data.getCAId());
if(caInfo != null) {
return caInfo.getName();
} else {
log.error("Can not get CA with id: "+data.getCAId());
}
} catch (AuthorizationDeniedException e) {
log.error("Can not get CA with id: "+data.getCAId(), e);
}
return "Error";
}
public String getEndEntityProfileName() {
EjbcaJSFHelper helpBean = EjbcaJSFHelper.getBean();
if (data.getEndEntityProfileId() == ApprovalDataVO.ANY_ENDENTITYPROFILE) {
return helpBean.getEjbcaWebBean().getText("ANYENDENTITYPROFILE", true);
}
return ejbLocalHelper.getEndEntityProfileSession().getEndEntityProfileName(data.getEndEntityProfileId());
}
public String getRemainingApprovals() {
return "" + data.getRemainingApprovals();
}
public ApprovalProfile getApprovalProfile() {
return data.getApprovalProfile();
}
public String getApproveActionName() {
return EjbcaJSFHelper.getBean().getEjbcaWebBean()
.getText(ApprovalDataVO.APPROVALTYPENAMES[data.getApprovalRequest().getApprovalType()], true);
}
public String getRequestAdminName() {
String retval;
final Certificate cert = data.getApprovalRequest().getRequestAdminCert();
final AuthenticationToken reqAdmin = data.getApprovalRequest().getRequestAdmin();
if (cert != null) {
String dn = CertTools.getSubjectDN(cert);
String o = CertTools.getPartFromDN(dn, "O");
if (o == null) {
o = "";
} else {
o = ", " + o;
}
retval = CertTools.getPartFromDN(dn, "CN") + o;
} else {
retval = EjbcaJSFHelper.getBean().getEjbcaWebBean().getText("CLITOOL", true); // Assume CLI if not match
if (reqAdmin != null) {
for (Principal principal : reqAdmin.getPrincipals()) {
if (principal instanceof PublicAccessAuthenticationToken.PublicAccessPrincipal) {
// Unauthenticated users accessing the RA
retval = EjbcaJSFHelper.getBean().getEjbcaWebBean().getText("RAWEB", true);
break;
} else if (principal instanceof PublicWebPrincipal) {
// Mostly self-registration in the Public Web
final String ipAddress = ((PublicWebPrincipal) principal).getClientIPAddress();
retval = EjbcaJSFHelper.getBean().getEjbcaWebBean().getText("PUBLICWEB", true) + ": " + ipAddress;
break;
} else if (principal instanceof WebPrincipal) {
// Other things, such as CMP, etc. We probably shouldn't ever get here, unless something is miss-configured.
retval = principal.getName(); // e.g. "NameOfServlet: 198.51.100.123"
break;
}
}
}
}
log.debug("getRequestAdminName " + retval);
return retval;
}
public String getStatus() {
FacesContext context = FacesContext.getCurrentInstance();
Application app = context.getApplication();
ApproveActionManagedBean value = app.evaluateExpressionGet(context, "#{approvalActionManagedBean}", ApproveActionManagedBean.class);
return value.getStatusText().get(Integer.valueOf(data.getStatus()));
}
public ApprovalDataVO getApproveActionDataVO() {
return data;
}
public int getApprovalId() {
return data.getApprovalId();
}
/**
* Constructs JavaScript that opens up a new window and opens up actionview
* there
*/
public String getApproveActionWindowLink() {
String link = EjbcaJSFHelper.getBean().getEjbcaWebBean().getBaseUrl()
+ EjbcaJSFHelper.getBean().getEjbcaWebBean().getGlobalConfiguration().getAdminWebPath() + "approval/approveaction.jsf?uniqueId="
+ data.getId();
return "window.open('" + link + "', 'ViewApproveAction', 'width=1000,height=800,scrollbars=yes,toolbar=no,resizable=yes').focus()";
}
public boolean getShowViewRequestorCertLink() {
// Return true if there is a certificate
return (data.getApprovalRequest().getRequestAdminCert() != null);
}
public String getViewRequestorCertLink() {
String retval = "";
if (data.getApprovalRequest().getRequestAdminCert() != null) {
String link;
try {
link = EjbcaJSFHelper.getBean().getEjbcaWebBean().getBaseUrl()
+ EjbcaJSFHelper.getBean().getEjbcaWebBean().getGlobalConfiguration().getAdminWebPath()
+ "viewcertificate.jsp?certsernoparameter="
+ java.net.URLEncoder.encode(data.getReqadmincertsn() + "," + data.getReqadmincertissuerdn(), "UTF-8");
} catch (UnsupportedEncodingException e) {
throw new EJBException(e);
}
retval = "viewcert('" + link + "')";
}
return retval;
}
/**
* Detect all certificate and user links from approval data based on the
* static translations variables.
*
* @return An array of Link-objects
*/
public boolean isContainingLink() {
final List<ApprovalDataText> newTextRows = getNewRequestDataAsText();
for (final ApprovalDataText row : newTextRows) {
if (row.getHeader().equals(CERTSERIALNUMBER) || row.getHeader().equals(ISSUERDN) || row.getHeader().equals(USERNAME)) {
return true;
}
}
return false;
}
/**
* Extract all certificate and user links from approval data based on the
* static translations variables.
*
* @return An array of Link-objects
*/
public List<LinkView> getApprovalDataLinks() {
List<LinkView> certificateLinks = new ArrayList<>();
List<String> certificateSerialNumbers = new ArrayList<>();
List<String> certificateIssuerDN = new ArrayList<>();
List<ApprovalDataText> newTextRows = getNewRequestDataAsText();
for (final ApprovalDataText row : newTextRows) {
if (row.getHeader().equals(CERTSERIALNUMBER)) {
certificateSerialNumbers.add(row.getData());
}
if (row.getHeader().equals(ISSUERDN)) {
certificateIssuerDN.add(row.getData());
}
}
if (certificateIssuerDN.size() != certificateSerialNumbers.size()) {
// Return an empty array if we have a mismatch
return certificateLinks;
}
String link = null;
for (int i = 0; i < certificateSerialNumbers.size(); i++) {
try {
link = EjbcaJSFHelper.getBean().getEjbcaWebBean().getBaseUrl()
+ EjbcaJSFHelper.getBean().getEjbcaWebBean().getGlobalConfiguration().getAdminWebPath()
+ "viewcertificate.jsp?certsernoparameter="
+ java.net.URLEncoder.encode(certificateSerialNumbers.get(i) + "," + certificateIssuerDN.get(i), "UTF-8");
} catch (UnsupportedEncodingException e) {
log.warn("UnsupportedEncoding creating approval data link. ", e);
}
certificateLinks.add(new LinkView(link, EjbcaJSFHelper.getBean().getEjbcaWebBean().getText(CERTSERIALNUMBER) + ": ",
certificateSerialNumbers.get(i), ""));
}
return certificateLinks;
}
public List<TextComparisonView> getTextListExceptLinks() {
ArrayList<TextComparisonView> textComparisonList = new ArrayList<>();
List<ApprovalDataText> newTextRows = getNewRequestDataAsText();
for (final ApprovalDataText row : newTextRows) {
if (row.getHeader().equals(CERTSERIALNUMBER)
|| row.getHeader().equals(ISSUERDN)) {
continue;
}
String newString = "";
try {
newString = translateApprovalDataText(row);
} catch (ArrayIndexOutOfBoundsException e) {
// Do nothing orgstring should be "";
}
textComparisonList.add(new TextComparisonView(null, newString));
}
return textComparisonList;
}
public List<TextComparisonView> getTextComparisonList() {
ArrayList<TextComparisonView> textComparisonList = new ArrayList<>();
if (data.getApprovalRequest().getApprovalRequestType() == ApprovalRequest.REQUESTTYPE_COMPARING) {
List<ApprovalDataText> newTextRows = getNewRequestDataAsText();
List<ApprovalDataText> orgTextRows = getOldRequestDataAsText();
int size = newTextRows.size();
if (orgTextRows.size() > size) {
size = orgTextRows.size();
}
for (int i = 0; i < size; i++) {
String orgString = "";
try {
orgString = translateApprovalDataText(orgTextRows.get(i));
} catch (IndexOutOfBoundsException e) {
// Do nothing orgstring should be "";
}
String newString = "";
try {
newString = translateApprovalDataText(newTextRows.get(i));
} catch (IndexOutOfBoundsException e) {
// Do nothing orgstring should be "";
}
textComparisonList.add(new TextComparisonView(orgString, newString));
}
} else {
for(ApprovalDataText approvalDataText : getNewRequestDataAsText()) {
textComparisonList.add(new TextComparisonView(null, translateApprovalDataText(approvalDataText)));
}
}
return textComparisonList;
}
private String translateApprovalDataText(ApprovalDataText data) {
String retval = "";
if (data.isHeaderTranslateable()) {
retval = EjbcaJSFHelper.getBean().getEjbcaWebBean().getText(data.getHeader(), true);
} else {
retval = data.getHeader();
}
if (data.isDataTranslatable()) {
retval += " : " + EjbcaJSFHelper.getBean().getEjbcaWebBean().getText(data.getData(), true);
} else {
retval += " : " + data.getData();
}
return retval;
}
private List<ApprovalDataText> getNewRequestDataAsText() {
ApprovalRequest approvalRequest = data.getApprovalRequest();
AuthenticationToken admin = EjbcaJSFHelper.getBean().getAdmin();
if (approvalRequest instanceof EditEndEntityApprovalRequest) {
return ((EditEndEntityApprovalRequest)approvalRequest).getNewRequestDataAsText(ejbLocalHelper.getCaSession(),
ejbLocalHelper.getEndEntityProfileSession(), ejbLocalHelper.getCertificateProfileSession(), ejbLocalHelper.getHardTokenSession());
} else if (approvalRequest instanceof AddEndEntityApprovalRequest) {
return ((AddEndEntityApprovalRequest)approvalRequest).getNewRequestDataAsText(ejbLocalHelper.getCaSession(),
ejbLocalHelper.getEndEntityProfileSession(), ejbLocalHelper.getCertificateProfileSession(), ejbLocalHelper.getHardTokenSession());
} else {
return approvalRequest.getNewRequestDataAsText(admin);
}
}
private List<ApprovalDataText> getOldRequestDataAsText() {
ApprovalRequest approvalRequest = data.getApprovalRequest();
AuthenticationToken admin = EjbcaJSFHelper.getBean().getAdmin();
if (approvalRequest instanceof EditEndEntityApprovalRequest) {
return ((EditEndEntityApprovalRequest)approvalRequest).getOldRequestDataAsText(admin, ejbLocalHelper.getCaSession(),
ejbLocalHelper.getEndEntityProfileSession(), ejbLocalHelper.getCertificateProfileSession(), ejbLocalHelper.getHardTokenSession());
} else {
return approvalRequest.getOldRequestDataAsText(admin);
}
}
}
|
[
"mfvilche@gmail.com"
] |
mfvilche@gmail.com
|
e3b4bf298c00e15d399e6801eb535d0d25fca2f9
|
dc519cd920d3fa9014af4da171de63ca82186996
|
/Booking System/src/Excursion.java
|
f1105da743097f5aa5b9ba2b8224fdcfd7a150b6
|
[] |
no_license
|
LeonardRoll/Java-database-SSD
|
8cf7f7346c551f714dc8f6afb274753ded7d3e42
|
c9070bd3fb4029150dbc840aac352491e97488d5
|
refs/heads/master
| 2020-12-24T17:53:54.542702
| 2015-06-11T19:37:48
| 2015-06-11T19:37:48
| 37,282,061
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,718
|
java
|
import java.io.*;
public class Excursion implements Serializable {
private static final long serialVersionUID = 1L;
//Attributes
private int E_ID;
private double Price;
private Location Location;
private String Information;
private Transportation Transport;
//Brochure
private Date Date;
private Time Times;
private String Duration;
public int getE_ID() {
return E_ID;
}
public void setID(int e_ID) {
E_ID = e_ID;
}
public double getPrice() {
return Price;
}
public void setPrice(double price) {
Price = price;
}
public Location getLocation() {
return Location;
}
public void setLocation(Location location) {
Location = location;
}
public String getInformation() {
return Information;
}
public void setInformation(String information) {
Information = information;
}
public Transportation getTransport() {
return Transport;
}
public void setTransport(Transportation transport) {
Transport = transport;
}
public Date getDate() {
return Date;
}
public void setDate(Date date) {
Date = date;
}
public Time getTimes() {
return Times;
}
public void setTimes(Time times) {
Times = times;
}
public String getDuration() {
return Duration;
}
public void setDuration(String duration) {
Duration = duration;
}
//Constructor
public Excursion(int e_ID,double price,Location location,String information,
Transportation transport,Date date,Time times,String duration){
E_ID = e_ID;
Price = price;
Location = location;
Information = information;
Transport = transport;
Date = date;
Times = times;
Duration = duration;
}
public String toString(){
return "Location: " + Location.getName() + " Date: " + Date;
}
}
|
[
"leonard_roll@yahoo.co.uk"
] |
leonard_roll@yahoo.co.uk
|
509574294b13ec6b84074407663beca4c3eecd3b
|
610d642d5b9d3b7774c8ba3f1bcc4fc6dcda9457
|
/src/com/ga/folding/utils/RouletteWheel.java
|
640936b206bcb098f0058dd25baafe5fb34333b5
|
[] |
no_license
|
PaulSchult/GeneticAlgorithms
|
8bd0cf579d3da9db64c36b229f1a5778ff21a60f
|
c6e70108825b67f2c0dd99a14a8d8d3fb7aa2ffc
|
refs/heads/master
| 2022-11-09T00:25:06.255610
| 2020-06-25T08:05:20
| 2020-06-25T08:05:20
| 266,339,140
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 586
|
java
|
package com.ga.folding.utils;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
public class RouletteWheel {
private List<Double> probabilities = new ArrayList<Double>();
public RouletteWheel() {
}
public void addProbability(double value) {
probabilities.add(value);
}
public int spin() {
Random random = new Random();
double p = 100 * random.nextDouble();
double sum = 0.0;
int i = 0;
while(sum < p && i < probabilities.size()) {
sum += probabilities.get(i);
i++;
}
return (i - 1);
}
}
|
[
"paul.schult@stud.h-da.de"
] |
paul.schult@stud.h-da.de
|
a7eca33108529a1c9b8132dea97c497dcd9d9d91
|
665e2a823e04b7c9238cd3fd22349c1b2ff280d0
|
/app/src/main/java/com/example/nimish/technews/MainActivity.java
|
61612c7534d1a3c6103647d16ab9449ab61d9d94
|
[] |
no_license
|
nimisane/TechNews
|
dbb0108d15c2bac865726b5e018556c59f95518f
|
c876053fcbe02e99768e60339fcb865161ee5cb0
|
refs/heads/master
| 2021-06-25T15:18:17.715369
| 2021-02-15T14:51:36
| 2021-02-15T14:51:36
| 203,003,716
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,001
|
java
|
package com.example.nimish.technews;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.support.design.widget.TextInputLayout;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import com.android.volley.AuthFailureError;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Pattern;
import static com.android.volley.VolleyLog.TAG;
public class MainActivity extends AppCompatActivity {
private static final Pattern UserID_Pattern =Pattern.compile("^[a-zA-Z]+([a-zA-Z0-9](_|-| )[a-zA-Z0-9])*[a-zA-Z0-9]+$");
private static final Pattern Password_Pattern = Pattern.compile("(?=.*[a-z])(?=.*[A-Z])(?=.*[\\d])(?=.*[~`!@#\\$%\\^&\\*\\(\\)\\-_\\+=\\{\\}\\[\\]\\|\\;:\"<>,./\\?]).{8,}");
TextView skip_login;
public TextInputLayout user_id;
public TextInputLayout password;
Button sign_up;
Button login;
ProgressBar pb;
Intent i;
String userid_input;
String password_input;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if(SharedPreferenceManager.getInstance(this).isLoggedIn()){
finish();
i=new Intent(MainActivity.this,News_feed.class);
startActivity(i);
return;
}
user_id = (TextInputLayout) findViewById(R.id.user_ID_layout);
password = (TextInputLayout) findViewById(R.id.password_login_layout);
login = findViewById(R.id.login);
sign_up=findViewById(R.id.sign_up);
skip_login=findViewById(R.id.skip);
pb=(ProgressBar)findViewById(R.id.progressBar);
pb.setVisibility(View.INVISIBLE);
login.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(!validateUserid() | !validatePassword())
{
pb.setVisibility(View.GONE);
return;
}
else
{
if(online()) {
pb.setVisibility(View.VISIBLE);
userLogin();
}
else {
Toast.makeText(getApplicationContext(),"No Internet Connection",Toast.LENGTH_SHORT).show();
}
}
}
});
}
@Override
public void onBackPressed() {
if(!SharedPreferenceManager.getInstance(this).isLoggedIn()){
Intent a = new Intent(Intent.ACTION_MAIN);
a.addCategory(Intent.CATEGORY_HOME);
a.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(a);
}
else{
super.onBackPressed();
}
}
public void SignUp(View v)
{
i = new Intent(this,Sign_up_Activity.class);
startActivity(i);
}
public void Skip_login(View v)
{
SharedPreferenceManager.getInstance(getApplicationContext()).userlogin("Guest","123");
i = new Intent(this,News_feed.class);
startActivity(i);
finish();
}
private boolean validateUserid()
{
userid_input = user_id.getEditText().getText().toString().trim();
if(!(UserID_Pattern.matcher(userid_input).matches()))
{
user_id.setError("Invalid UserID");
return false;
}
else{
user_id.setError(null);
return true;
}
}
private boolean validatePassword()
{
password_input = password.getEditText().getText().toString().trim();
if(!Password_Pattern.matcher(password_input).matches())
{
password.setError("Invalid Password");
return false;
}
else{
password.setError(null);
return true;
}
}
protected boolean online()
{
ConnectivityManager cm = (ConnectivityManager)getApplicationContext().getSystemService(CONNECTIVITY_SERVICE);
NetworkInfo info = cm.getActiveNetworkInfo();
if(info != null && info.isConnectedOrConnecting())
{
return true;
}
else
{
return false;
}
}
public void userLogin(){
StringRequest stringRequest = new StringRequest(Request.Method.POST, Constants.login_url, new Response.Listener<String>() {
@Override
public void onResponse(String response) {
try {
JSONObject jsonObject = new JSONObject(response);
if(jsonObject.getInt("success")==1){ //!jsonObject.getBoolean("error")
SharedPreferenceManager.getInstance(getApplicationContext()).userlogin(jsonObject.getString("userid"),jsonObject.getString("user_password"));
Toast.makeText(getApplicationContext(),jsonObject.getString("message"),Toast.LENGTH_SHORT).show();
pb.setVisibility(View.GONE);
i=new Intent(MainActivity.this,News_feed.class);
startActivity(i);
finish();
}
else if(jsonObject.getInt("success")==0) {
pb.setVisibility(View.GONE);
Toast.makeText(getApplicationContext(),jsonObject.getString("message"),Toast.LENGTH_SHORT).show();
}
else {
Toast.makeText(getApplicationContext(),"Check Your Internet Connection",Toast.LENGTH_SHORT).show();
}
} catch (JSONException e) {
//e.printStackTrace();
Log.e(TAG, "LoginError", e);
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
//Toast.makeText(getApplicationContext(),error.getMessage(),Toast.LENGTH_SHORT).show();
Log.e(TAG, "LoginVolleyError", error);
}
}){
@Override
protected Map<String, String> getParams() throws AuthFailureError {
Map<String,String> params = new HashMap<>();
params.put("userid",userid_input);
params.put("user_password",password_input);
return params;
}
};
RequestHandler.getInstance(this).addToRequestQueue(stringRequest);
}
}
|
[
"nimishsane9@gmail.com"
] |
nimishsane9@gmail.com
|
3492f75b7db74328285976663f56b8d328507881
|
6a182f3c3e0e653c5fbefb603b9a2b6cdbdd6e7a
|
/src/test/java/ptrmarcowski/springframework/converters/NotesToNotesCommandTest.java
|
14049cd423bbfb6b21161d419eace57614e4cabc
|
[] |
no_license
|
ptrmarcowski/spring5-recipe-app
|
30afb762b1938a43ba38432b352835ba255a3fad
|
ca00f43e7bf63234f0c971cd7497ef60f4b4efd3
|
refs/heads/master
| 2023-05-06T12:14:34.290318
| 2021-05-24T19:44:18
| 2021-05-24T19:44:18
| 335,255,661
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,156
|
java
|
package ptrmarcowski.springframework.converters;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import ptrmarcowski.springframework.commands.NotesCommand;
import ptrmarcowski.springframework.domain.Notes;
import static org.junit.jupiter.api.Assertions.*;
class NotesToNotesCommandTest {
public static final Long ID_VALUE = new Long(1L);
public static final String RECIPE_NOTES = "Notes";
NotesToNotesCommand converter;
@BeforeEach
void setUp() {
converter = new NotesToNotesCommand();
}
@Test
public void testNull() throws Exception {
assertNull(converter.convert(null));
}
@Test
public void testEmptyObject() {
assertNotNull(converter.convert(new Notes()));
}
@Test
public void convert() {
//given
Notes notes = new Notes();
notes.setId(ID_VALUE);
notes.setRecipeNotes(RECIPE_NOTES);
//when
NotesCommand notesCommand = converter.convert(notes);
//then
assertEquals(ID_VALUE, notesCommand.getId());
assertEquals(RECIPE_NOTES, notesCommand.getRecipeNotes());
}
}
|
[
"piotr.marcowski@gmail.com"
] |
piotr.marcowski@gmail.com
|
931835c34ab07a9327d7ce4d9c870bbfc6424ed0
|
ee5aefd578e1c466b6b42eef90e5d85344880df3
|
/src/main/java/com/vahundos/service/menu/MenuServiceImpl.java
|
d21b5fb05420d3d1eaf9683e4942cda5bb1979ed
|
[] |
no_license
|
vahundos/Restaurant-voting-system
|
780bf2a78a9160e7e5cc0ee78837a15828a699c4
|
caf637f3609f34e74c48ef8acd368d32471dbaf3
|
refs/heads/master
| 2022-04-05T02:40:23.416128
| 2018-02-27T06:07:58
| 2018-02-27T06:07:58
| 116,108,811
| 0
| 0
| null | 2020-01-12T15:09:13
| 2018-01-03T07:54:44
|
Java
|
UTF-8
|
Java
| false
| false
| 2,581
|
java
|
package com.vahundos.service.menu;
import com.vahundos.model.Menu;
import com.vahundos.model.MenuMeal;
import com.vahundos.repository.CrudMealRepository;
import com.vahundos.repository.CrudMenuRepository;
import com.vahundos.repository.CrudRestaurantRepository;
import com.vahundos.to.menu.MenuTo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
import java.time.LocalDate;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
import static com.vahundos.util.ValidationUtil.checkNotFoundWithId;
@Service
public class MenuServiceImpl implements MenuService {
private final CrudMenuRepository menuRepository;
private final CrudRestaurantRepository restaurantRepository;
private final CrudMealRepository mealRepository;
@Autowired
public MenuServiceImpl(CrudMenuRepository menuRepository, CrudRestaurantRepository restaurantRepository, CrudMealRepository mealRepository) {
this.menuRepository = menuRepository;
this.restaurantRepository = restaurantRepository;
this.mealRepository = mealRepository;
}
@Override
@CacheEvict(value = "restaurantsWithMenu", allEntries = true)
public Menu create(MenuTo menuTo) {
Assert.notNull(menuTo, "menuTo must not be null");
return menuRepository.save(getForCreation(menuTo));
}
@Override
@CacheEvict(value = "restaurantsWithMenu", allEntries = true)
public void update(MenuTo menuTo) {
checkNotFoundWithId(menuRepository.save(getForUpdate(menuTo)), menuTo.getId());
}
@Override
public void makeVote(int menuId, int userId, LocalDate date) {
menuRepository.makeVote(menuId, userId, date);
}
private Menu getForCreation(MenuTo menuTo) {
Menu menu = new Menu();
menu.setDate(menuTo.getDate());
menu.setRestaurant(restaurantRepository.getOne(menuTo.getRestaurantId()));
Set<MenuMeal> menuMeals = menuTo.getMeals().stream()
.map(m -> new MenuMeal(mealRepository.getOne(m.getId()), m.getPrice()))
.collect(Collectors.toSet());
menu.setMenuMeals(menuMeals);
return menu;
}
private Menu getForUpdate(MenuTo menuTo) {
Menu menu = getForCreation(menuTo);
menu.setId(menuTo.getId());
menu.setVotes(Objects.requireNonNull(menuRepository.findById(menu.getId()).orElse(null)).getVotes());
return menu;
}
}
|
[
"vahundos@gmail.com"
] |
vahundos@gmail.com
|
2289c13059fbc73d817ee37e7f20f3f1f36358ef
|
1fb1ce0ec9216fc3c17ade26d1ed9d6230f808a1
|
/toutiao/src/main/java/com/toutiao/dao/UserDAO.java
|
7c19e424c8f0bd8dfe5ec4f4910e8e6425e83410
|
[] |
no_license
|
lcandyl/toutiao
|
f055f3c4ab4030140857935945ee91b665f0c571
|
1f50c7bdf4fb211978104a4d028b254b9ac32de9
|
refs/heads/master
| 2021-01-20T19:36:15.095147
| 2016-08-02T06:40:37
| 2016-08-02T06:40:37
| 64,729,762
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,006
|
java
|
package com.toutiao.dao;
import ch.qos.logback.classic.db.names.TableName;
import com.toutiao.model.User;
import org.apache.ibatis.annotations.*;
import javax.annotation.ManagedBean;
/**
* Created by admin on 16-7-7.
*/
@Mapper
public interface UserDAO {
String TABLE_NAME = "user";
String INSERT_FIELDS = " name, password, salt, head_url ";
String SELECT_FIELDS = " id, name, password, salt, head_url ";
@Insert({"insert into",TABLE_NAME,"(", INSERT_FIELDS,") values (#{name},#{password},#{salt},#{headUrl})"})
int addUser(User user);
@Select({"select ", SELECT_FIELDS, "from",TABLE_NAME,"where id = #{id}"})
User selectById(int id);
@Select({"select ", SELECT_FIELDS, "from",TABLE_NAME,"where name = #{name}"})
User selectByName(String name);
@Update({"update ",TABLE_NAME," set password = #{password} where name = #{name}"})
void updataPassword (User user);
@Delete({"delete from", TABLE_NAME, "where id = #{id}"})
void deleteByID(int id);
}
|
[
"zhangqi920503@163.com"
] |
zhangqi920503@163.com
|
212f675019d3312c49c9031acb23c3d01c989eb8
|
dfbae0a74fcb2434f2f58d7ccaccc618f3d503ca
|
/core-api/src/main/java/org/lemarche/core/shop/loyalty/LoyaltyPoints.java
|
d91d5b2de1ad6217c8dc5b832b7b40f0694190aa
|
[
"Apache-2.0"
] |
permissive
|
rocher50/lemarche
|
ec391909507f124039e5c5455c44caccd70c802b
|
479c2b9fc0e8b342f33e68b3949977335bc4d370
|
refs/heads/master
| 2021-07-06T11:23:28.907382
| 2017-10-03T23:02:19
| 2017-10-03T23:02:19
| 105,398,357
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 834
|
java
|
/*
* Copyright 2017 Oleksiy Lubyanskyy and other contributors as indicated by
* the @author tags.
*
* 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.lemarche.core.shop.loyalty;
/**
* @author olubyans
*
*/
public class LoyaltyPoints {
private long amount;
private LoyaltyProgram loyaltyProgrram;
}
|
[
"olubyans@redhat.com"
] |
olubyans@redhat.com
|
f5796f6732aaf9a695854f5838633c4f2fc99f92
|
f692c5bde90457f729cebf6add1eca72acf91b12
|
/week9/ClockTest.java
|
c5aba5986761edeed24990a7700c85416a973512
|
[] |
no_license
|
prdickson/coursera-pp
|
f66f774a633b8abb3d73c47ab413411f1fe10c31
|
3238d91e3a7b71420db6b153a0dd77106131b31a
|
refs/heads/master
| 2023-03-25T01:16:39.230923
| 2021-03-24T22:53:05
| 2021-03-24T22:53:05
| 317,804,396
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,606
|
java
|
import org.junit.Test;
import static org.junit.Assert.*;
public class ClockTest {
@Test
public void testThrowsWhenInstantiatedWithInvalidHours() {
assertThrows(IllegalArgumentException.class, () -> new Clock(-1, 0));
assertThrows(IllegalArgumentException.class, () -> new Clock(24, 0));
}
@Test
public void testThrowsWhenInstantiatedWithInvalidMinutes() {
assertThrows(IllegalArgumentException.class, () -> new Clock(0, -1));
assertThrows(IllegalArgumentException.class, () -> new Clock(0, 60));
}
@Test
public void testThrowsWhenInstantiatedWithStringWithoutColon() {
assertThrows(IllegalArgumentException.class, () -> new Clock("hey"));
}
@Test
public void testThrowsWhenInstantiatedWithStringWithThreeParts() {
assertThrows(IllegalArgumentException.class, () -> new Clock("hey:hey:hey"));
}
@Test
public void testThrowsWhenInstantiatedWithStringNonNumericHours() {
assertThrows(IllegalArgumentException.class, () -> new Clock("hey:10"));
}
@Test
public void testThrowsWhenInstantiatedWithStringNonNumericMinutes() {
assertThrows(IllegalArgumentException.class, () -> new Clock("10:hey"));
}
@Test
public void testThrowsWhenInstantiatedWithInvalidTimeString() {
assertThrows(IllegalArgumentException.class, () -> new Clock("-01:00"));
assertThrows(IllegalArgumentException.class, () -> new Clock("24:00"));
assertThrows(IllegalArgumentException.class, () -> new Clock("00:-01"));
assertThrows(IllegalArgumentException.class, () -> new Clock("00:60"));
}
@Test
public void testToStringWithoutPadding() {
assertEquals("12:34", new Clock(12, 34).toString());
}
@Test
public void testToStringWithPadding() {
assertEquals("01:02", new Clock(1, 2).toString());
}
@Test
public void testEarlierThanWhenHourIsEarlier() {
assertTrue(new Clock(1, 0).isEarlierThan(new Clock(2, 0)));
}
@Test
public void testEarlierThanWhenMinutesIsEarlier() {
assertTrue(new Clock(1, 1).isEarlierThan(new Clock(1, 2)));
}
@Test
public void testNotEarlierThanWhenHourIsLater() {
assertFalse(new Clock(2, 1).isEarlierThan(new Clock(1, 2)));
}
@Test
public void testNotEarlierThanWhenHourIsEqualButMinutesIsLater() {
assertFalse(new Clock(1, 3).isEarlierThan(new Clock(1, 2)));
}
@Test
public void testCanAddMinute() {
Clock c = new Clock(1, 1);
c.tic();
assertEquals("01:02", c.toString());
}
@Test
public void testCanAddMinuteOnHour() {
Clock c = new Clock(1, 59);
c.tic();
assertEquals("02:00", c.toString());
}
@Test
public void testCanAddMinuteAtMidnight() {
Clock c = new Clock(23, 59);
c.tic();
assertEquals("00:00", c.toString());
}
@Test
public void testCanAddManyMinutes() {
Clock c = new Clock(1, 0);
c.toc(30);
assertEquals("01:30", c.toString());
}
@Test
public void testCanAddManyMinutesHours() {
Clock c = new Clock(1, 30);
c.toc(75);
assertEquals("02:45", c.toString());
}
@Test
public void testCanAddManyMinutesDays() {
Clock c = new Clock(23, 30);
c.toc(75);
assertEquals("00:45", c.toString());
}
@Test
public void testThrowsIfDeltaIsNegative() {
Clock c = new Clock(23, 30);
assertThrows(IllegalArgumentException.class, () -> c.toc(-1));
}
}
|
[
"3018673+prdickson@users.noreply.github.com"
] |
3018673+prdickson@users.noreply.github.com
|
8774645c8bfd982e4cdf91cfaf67a223ad3a4a00
|
968a33e4f521cf389cfb8cb8fd73afcb1aab9ad4
|
/src/assignments/A4.java
|
403c72b29f542e79d36059ea00cc2013bb8f6bf3
|
[] |
no_license
|
Mohamed-Fathy-Salah/Datastructures
|
00827670b58750a2cb371d4ba7a61a5fdc16300d
|
3890421cee965d68df44f871f136d5c5e1a4564e
|
refs/heads/master
| 2023-03-26T18:09:14.465357
| 2021-03-13T15:50:07
| 2021-03-13T15:50:07
| 340,441,259
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,227
|
java
|
package assignments;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Stack;
public class A4 {
public String decimalToBinary(int n) {
StringBuilder s = new StringBuilder();
while (n > 0) {
s.append(n & 1);
n >>= 1;
}
return s.reverse().toString();
}
public String decimalToBase(int n, int b) {
StringBuilder s = new StringBuilder();
while (n > 0) {
int x = n % b;
if (x > 9)
s.append((char) ('A' + x - 10));
else
s.append(x);
n /= b;
}
return s.reverse().toString();
}
public static class TwoStacks {
private int arr[], l, r;
public TwoStacks() {
arr = new int[10];
l = 0;
r = 9;
}
public void push1(int x) {
if (l > r)
return;
arr[l++] = x;
}
public void push2(int x) {
if (l > r)
return;
arr[r--] = x;
}
public int pop1() {
if (l == 0)
return -1;
return arr[--l];
}
public int pop2() {
if (r == 9)
return -1;
return arr[++r];
}
@Override
public String toString() {
StringBuilder s = new StringBuilder();
for (int i = 0; i < arr.length; i++)
s.append(arr[i] + " ");
return s.toString();
}
}
/*
* Write a method Queue reverse (Queue q) for reversing the order of a queue.
*/
public Queue reverse(Queue q) {
reverse1(q);
return q;
}
private void reverse1(Queue q) {
if (q.isEmpty())
return;
Object n = q.poll();
reverse1(q);
q.add(n);
}
/*
* Implement stack data structure using two Queues, use Dequeue() and Enqueue()
* methods to implement Push() and POP() methods.
*/
public class QStack {
private Queue<Integer> l, r;
public QStack() {
l = new LinkedList<>();
r = new LinkedList<>();
}
public void push(int k) {
l.add(k);
}
public int pop() {
if(r.isEmpty())flip();
if(r.isEmpty())return (Integer) null;
return r.poll();
}
private void flip(){
if(l.isEmpty())return;
int n = l.poll();
flip();
r.add(n);
}
}
/*
* Implement Queue data structure using two Stacks, use Push() and POP() methods
* to implement Dequeue() and Enqueue() methods
*/
public class SQueue{
private Stack<Integer> l,r;
public SQueue(){
l = new Stack<>();
r = new Stack<>();
}
public void push(int k){
l.push(k);
}
public int pop(){
if(r.isEmpty())flip();
if(r.isEmpty())return (Integer)null;
return r.pop();
}
private void flip(){
while(!l.isEmpty())r.push(l.poll());
}
}
}
|
[
"mofasa.peace@gmail.com"
] |
mofasa.peace@gmail.com
|
19902aa402ca298169db00b7252ce8f20420c5aa
|
8ae88d7958e058e1f5bb2b67d6a657ca89ba26d6
|
/app/src/androidTest/java/com/example/xlo/walletforandroid/settingTest/SettingTest.java
|
083c2097859bcb717ff7817f96ee020b837000f6
|
[] |
no_license
|
xloypaypa/WalletForAndroidOld
|
1aaf6cf13afff41522f56995332c10f014ddb893
|
1a17bfbec4de5e51277118a36b191324b7d32151
|
refs/heads/master
| 2021-01-18T01:43:42.263298
| 2015-06-16T05:49:59
| 2015-06-16T05:49:59
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 873
|
java
|
package com.example.xlo.walletforandroid.settingTest;
import com.example.xlo.walletforandroid.baseTool.MainPageTest;
import com.example.xlo.walletforandroid.baseTool.TestCase;
import com.example.xlo.walletforandroid.userTest.LoginTest;
/**
* Created by LT on 2015/3/24.
*
*/
public class SettingTest extends TestCase {
@Override
public void setUp() throws Exception {
super.setUp();
LoginTest.createUserAndLogin();
MainPageTest.changeToPage("setting");
}
public static void toAdd(){
solo.clickOnButton("add money type");
solo.waitForDialogToOpen();
}
public static void toRename(){
solo.clickOnButton("rename money type");
solo.waitForDialogToOpen();
}
public static void toRemove(){
solo.clickOnButton("remove money type");
solo.waitForDialogToOpen();
}
}
|
[
"245532675@qq.com"
] |
245532675@qq.com
|
3948226712df08c3498cabffcfef7badcbfb1dc2
|
fc4638f5f6c31feb065b21b0f04cdd8b1dcf1395
|
/src/main/java/EmcapsulamentoGetSet/automoveis.java
|
1bd6825e62b18819136d736baa5de9d14bf735bd
|
[] |
no_license
|
jmarcos9/Matrizes
|
849dc9683ba7be4e07e30a1c540266b4ce10c4b0
|
4807ceb23677385709697a097b9f47d9ca916bf4
|
refs/heads/master
| 2022-11-23T22:24:28.921084
| 2020-07-30T00:07:12
| 2020-07-30T00:07:12
| 274,016,295
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 374
|
java
|
package EmcapsulamentoGetSet;
public class automoveis {
public static void main(String[] args) {
Veiculos van = new Veiculos(10, 30, 4 );
van.setMarca("Fiat");
van.setModelo("Ducato");
System.out.println(van.getMarca());
System.out.println(van.getModelo());
System.out.println(van.getNumerosPassageiros());
}
}
|
[
"jmarcos9@gmail.com"
] |
jmarcos9@gmail.com
|
ab97e84c10af0e05a445214985650723e39011f4
|
768a1e26fb19e9e7a29b211b2c247940483af7b8
|
/api/src/main/java/milesahead/api/service1/Service1.java
|
3eaee7eae47a4ba652d7dca6c5163b992beeb1b0
|
[] |
no_license
|
Miles-Ahead-Digital/cucumber-apidep
|
c504fe9d1c9bcfb357762ab739a8e68fa735b920
|
2cc6615fe19eef2c7d2d91ab72307add61710119
|
refs/heads/master
| 2023-04-19T12:06:12.741032
| 2021-05-08T06:57:07
| 2021-05-08T06:57:07
| 364,502,414
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 427
|
java
|
package milesahead.api.service1;
public class Service1 {
private final long id;
private final String content;
public Service1(long id, String content) {
this.id = id;
this.content = content;
}
public Service1() {
this.id = 0;
this.content = null;
}
public long getId() {
return id;
}
public String getContent() {
return content;
}
}
|
[
"devops@miles-ahead.digital"
] |
devops@miles-ahead.digital
|
114f81043eab6120a20a6a14830cbb5ef9c31435
|
d60e189ad944dcfe5dd086581475dc905be4042a
|
/src/main/java/random/DefaultRandom.java
|
0322ce357a6a601fb3a2e82be499343c8ba49c21
|
[] |
no_license
|
xiaoxiaodexiao/JavaNote
|
32ba07dfa99ff768efaedec8ae6d19b69e4d5e08
|
e85b7684e5ef14fce46ebec0d6cb339f78e3b7aa
|
refs/heads/master
| 2022-11-28T13:55:20.761817
| 2020-08-16T12:18:57
| 2020-08-16T12:18:57
| 287,649,709
| 0
| 0
| null | 2020-08-16T09:41:27
| 2020-08-15T00:31:17
|
Java
|
UTF-8
|
Java
| false
| false
| 4,411
|
java
|
package random;
import lang.StringUtil;
import java.util.Random;
/**
* 产生随机数的接口,使用了默认实现
*
* @author shu
*/
public interface DefaultRandom {
/** int类型的长度限制为10(不超过9个)*/
int LIMIT_INT_LENGTH = 10;
// 使用到Algerian字体,系统里没有的话需要安装字体,字体只显示大写,去掉了1,0,i,o几个容易混淆的字符
String VERIFY_CODES = "23456789ABCDEFGHJKMNPQRSTUVWXYZ";
// public static final String VERIFY_CODES = "23456789abcdefghjkmnpqrstuvwxyzABCDEFGHJKMNPQRSTUVWXYZ";
/**
* 返回的范围是[0,num) 需要重写
*
* @param num 数字
*/
int random(int num);
/**
* 返回的范围是[start,end)
*
* @param start 范围起始值
* @param end 范围终止值
*/
default int random(int start, int end) {
// return random(end - start) + start; //返回[start, end)
// return random(end - start + 1) + start; //返回[start, end]
return random(end - start) + start;
}
/**
* 生成含有字母的验证码
* @param length
* @return
*/
default String verifyCodeHasLetter(int length) {
String sources = VERIFY_CODES;
int codesLen = sources.length();
StringBuilder verifyCode = new StringBuilder(length);
for (int i = 0; i < length; i++) {
verifyCode.append(sources.charAt(random(codesLen - 1)));
}
return verifyCode.toString();
}
/**
* 返回的几位数之间的值, length范围 [1,10) <br>
* 如length=1,返回[0, 10) 即0-9之间的值<br>
* 如length=2,返回[10, 100) 即10-99之间的值<br>
* 如length=3,返回[100, 1000) 即100-999之间的值<br>
*
* @param length 几位数
*/
default int randomByLength2Int(int length) {
int start = 0;
if (length == 1) {
return random(10);
} else if (length > 1 && length < LIMIT_INT_LENGTH) {
// 由于10^0 =1,所以单独处理
start = (int) Math.pow(10, (length - 1));
} else {
throw new IllegalArgumentException("超过范围, length范围是[1,10)");
}
int end = (int) Math.pow(10, length);
return random(start, end);
}
/**
* 返回的几位数之间的值, length范围 [1, +∞) <br>
* 如length=1,返回[0, 10) 即0-9之间的值<br>
* 如length=2,返回[10, 100) 即10-99之间的值<br>
* 如length=3,返回[100, 1000) 即100-999之间的值<br>
*
* @param length 几位数
*/
default String randomByLength2Str(int length) {
String randomId = "";
int restLength = 0;
int limitLength = LIMIT_INT_LENGTH - 1;//最多9位
if (length < 1) {
throw new IllegalArgumentException("超过范围, length范围是[1,+∞)");
} else if (length < LIMIT_INT_LENGTH) {
restLength = length;
} else {
int count = length / limitLength;
for (int i = 0; i < count; i++) {
randomId = randomId + randomByLength2Int(limitLength);
}
//加上不满长度的部分
restLength = length - count * limitLength;
}
if (restLength != 0) {
randomId = randomId + randomByLength2Int(restLength);
}
return randomId;
}
/**
* 返回的几位数的值, 位数不够则补零, length范围 [1,10) <br>
* 如length=1,返回[0, 10) 即0-9之间的值<br>
* 如length=2,返回[00, 100) 即00-99之间的值<br>
* 如length=3,返回[000, 1000) 即000-999之间的值<br>
*
* @param length 几位数
*/
default String randomFillZeroHasLimit(int length) {
if (length > 0 && length < LIMIT_INT_LENGTH) {
int end = (int) Math.pow(10, length);
int num = random(end);
return StringUtil.fillLeftZero(num, length);
} else {
throw new IllegalArgumentException("超过范围, length范围是[1,10)");
}
}
//觉得冗余可以调用StringUtil.fillZero
// private static String fillZero(int num, int length) {
// return String.format("%0" + length + "d", num);
// }
}
|
[
"271638742@qq.com"
] |
271638742@qq.com
|
efcedb919e79cd758857d0dbe8e952276c7fb82c
|
505a88da99d66667348c70edd2422085e277a167
|
/csTask46/Die.java
|
42331c819afeb23874716b3cb327f7fb747b7c18
|
[] |
no_license
|
AbtahiChowdhury/APCS
|
bed996154a67b6e3dd30e5a69a37338653004d49
|
6c35b0d2a686b634e063078c6e9758ee22eec246
|
refs/heads/master
| 2020-05-03T11:08:24.107238
| 2019-03-30T18:15:18
| 2019-03-30T18:15:18
| 178,594,289
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 355
|
java
|
public class Die
{
private int numFaces;
private int faceValue;
public Die()
{
numFaces = 6;
faceValue = 1;
}
public int roll()
{
faceValue = (int) (Math.random() * numFaces) + 1;
return faceValue;
}
public int getFaceValue()
{
return faceValue;
}
}
|
[
"abtahichowdhury@gmail.com"
] |
abtahichowdhury@gmail.com
|
bb8354d7da2c4f7da81dcd3bfdb70a2b00fb8294
|
a77b193d0cf7c4fa0e5655f33ade9d374541aed4
|
/JAVA LEC/L4/Prt2.java
|
44ea16fd508ce35f973a804c1418cda1b7cb7581
|
[] |
no_license
|
pagotarane/program_for_reffer
|
05297a443954b20a493a44df3a9b8cea9be0a300
|
de3e48488be7e1a3878c98d36258c3961738fed8
|
refs/heads/main
| 2023-06-19T05:31:21.655389
| 2021-07-17T02:58:17
| 2021-07-17T02:58:17
| 386,659,998
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 381
|
java
|
//wap using while loop to find the sum of the digit
class Prt2
{
public static void main(String args[])
{
int num=Integer.parseInt(args[0]);
if (num < 0)
System.out.println("b+ ve");
else
{
int sum=0, digit = 0;
while (num > 0)
{
digit = num % 10;
sum = sum + digit;
num = num / 10;
}
System.out.println("sum = "+sum);
}
}
}
|
[
"pagotarne@gmail.com"
] |
pagotarne@gmail.com
|
4001a8ba588aaed960c94e38c9ea8f4fd4d5a1e3
|
eaa8060a9d4f0d3737790a802f4de9e908a86cc7
|
/src/main/java/com/example/demo/security/JwtTokenProvider.java
|
b63635ed0f3788049d42aebef42c053186dbbd70
|
[] |
no_license
|
makimaliev/demo
|
70ae7a203ddf1c82edfb8d0c716eb32fc1fb648d
|
ddd9209f09e89ff3edcc6a3371ec5087bb95e2d1
|
refs/heads/master
| 2023-04-14T10:17:57.798765
| 2021-04-18T15:33:37
| 2021-04-18T15:33:37
| 359,084,242
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,059
|
java
|
package com.example.demo.security;
import io.jsonwebtoken.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Component;
import java.util.Date;
@Component
public class JwtTokenProvider {
private static final Logger logger = LoggerFactory.getLogger(JwtTokenProvider.class);
@Value("${app.jwtSecret}")
private String jwtSecret;
@Value("${app.jwtExpirationInMs}")
private int jwtExpirationInMs;
public String generateToken(Authentication authentication) {
UserPrincipal userPrincipal = (UserPrincipal) authentication.getPrincipal();
Date now = new Date();
Date expiryDate = new Date(now.getTime() + jwtExpirationInMs);
return Jwts.builder()
.setSubject(Long.toString(userPrincipal.getId()))
.setIssuedAt(new Date())
.setExpiration(expiryDate)
.signWith(SignatureAlgorithm.HS512, jwtSecret)
.compact();
}
public Long getUserIdFromJWT(String token) {
Claims claims = Jwts.parser()
.setSigningKey(jwtSecret)
.parseClaimsJws(token)
.getBody();
return Long.parseLong(claims.getSubject());
}
public boolean validateToken(String authToken) {
try {
Jwts.parser().setSigningKey(jwtSecret).parseClaimsJws(authToken);
return true;
} catch (SignatureException ex) {
logger.error("Invalid JWT signature");
} catch (MalformedJwtException ex) {
logger.error("Invalid JWT token");
} catch (ExpiredJwtException ex) {
logger.error("Expired JWT token");
} catch (UnsupportedJwtException ex) {
logger.error("Unsupported JWT token");
} catch (IllegalArgumentException ex) {
logger.error("JWT claims string is empty.");
}
return false;
}
}
|
[
"makimaliev@gmail.com"
] |
makimaliev@gmail.com
|
89fe0010a5b88d8f2dd5fd85c826f9c47c555cf9
|
d11858d5864b38ef71a499f9e570c446f644f068
|
/src/test/java/com/jbariel/example/springboot/HelloWorldTest.java
|
f9cd615cd26b335b1f2dcfd6c8306d3ea760255b
|
[
"Apache-2.0"
] |
permissive
|
komalkubsad/spring-boot-example
|
3c416095f3cf38afb7c62f2a604da658321b0078
|
4aa748fed87050854ff983d9876ad416e98a5674
|
refs/heads/master
| 2020-04-30T01:57:48.504378
| 2019-03-19T21:33:58
| 2019-03-19T21:33:58
| 176,544,742
| 0
| 1
|
Apache-2.0
| 2019-03-19T15:35:31
| 2019-03-19T15:35:31
| null |
UTF-8
|
Java
| false
| false
| 2,179
|
java
|
package com.jbariel.example.springboot;
import static org.hamcrest.Matchers.containsString;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import com.jbariel.example.springboot.controllers.HelloWorldController;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
/* // Test Using mock mvc
@RunWith(SpringRunner.class)
@SpringBootTest
@AutoConfigureMockMvc
public class HelloWorldTest {
@Autowired
private MockMvc mockMvc;
//test for hello world!
@Test
public void shouldReturnDefaultMessage() throws Exception {
this.mockMvc.perform(get("/hello/")).andDo(print()).andExpect(status().isOk())
.andExpect(content().string(containsString("Hello World!")));
}
//test for hello name
@Test
public void shoudReturnName() throws Exception {
this.mockMvc.perform(get("/hello/{name}", "komal")).andDo(print()).andExpect(status().isOk())
.andExpect(content().string(containsString("Hello komal!")));
}
}
*/
public class HelloWorldTest{
@Mock
private HelloWorldController helloController;
@Before
public void init() {
MockitoAnnotations.initMocks(this);
}
@Test
public void whenSayHelloIsCalledReturnHello() throws Exception{
Mockito.when(helloController.sayHello()).thenReturn("Hello World!");
Assert.assertEquals("Hello World!", helloController.sayHello());
}
}
|
[
"swathi.rao.pejakala@gmail.com"
] |
swathi.rao.pejakala@gmail.com
|
b504db29127c271ef7b301b283224210fed00ab0
|
bddad72d9421793b54fe89d65ecaaadcbfed6fda
|
/src/main/java/com/salvador/runners/progress/PageProgress.java
|
2faa7f992c03ca2ea5303c7b590c31dcecb7372c
|
[] |
no_license
|
mearlam/salvador
|
c15d97f7bd81102b4458fbb13d28be10d709967a
|
847129935747f8d6df1e4c985086c8d3fd45599b
|
refs/heads/master
| 2016-09-05T17:38:05.138166
| 2013-02-27T14:41:04
| 2013-02-27T14:41:04
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 174
|
java
|
package com.salvador.runners.progress;
/**
* Created by IntelliJ IDEA.
* User: mearlam
* Date: 27/02/13
* Time: 08:00
*/
public class PageProgress extends Progress {
}
|
[
"mark.earlam@gmail.com"
] |
mark.earlam@gmail.com
|
4f337ed5fa79cbf6630095a5418d853772f6c27a
|
55dca62e858f1a44c2186774339823a301b48dc7
|
/code/my-app/functions/3/isNotifiable_ChangeSet.java
|
fefa839bf9493c4095f9d7286b37fed429165f44
|
[] |
no_license
|
jwiszowata/code_reaper
|
4fff256250299225879d1412eb1f70b136d7a174
|
17dde61138cec117047a6ebb412ee1972886f143
|
refs/heads/master
| 2022-12-15T14:46:30.640628
| 2022-02-10T14:02:45
| 2022-02-10T14:02:45
| 84,747,455
| 0
| 0
| null | 2022-12-07T23:48:18
| 2017-03-12T18:26:11
|
Java
|
UTF-8
|
Java
| false
| false
| 75
|
java
|
public boolean isNotifiable(ServerPlayer serverPlayer) {
return true;
}
|
[
"wiszowata.joanna@gmail.com"
] |
wiszowata.joanna@gmail.com
|
12a7a5274a03287a7f810a1665637adcd011c980
|
2f88a4c3357ca697b3666e7758548a93984884a8
|
/src/main/java/com/miaoshaproject/service/impl/CacheServiceImpl.java
|
eca48598f84cac6861563135b037f2be2c78c5c8
|
[] |
no_license
|
ben1247/miaosha
|
30b44a0b0c09af41dad86b9a5b4c0fb4b14bd74c
|
72186119eac26afa38b5b643ddab1f494b30eb0d
|
refs/heads/master
| 2022-07-08T07:45:19.558091
| 2021-03-22T07:00:22
| 2021-03-22T07:00:22
| 250,992,841
| 0
| 0
| null | 2022-06-21T03:05:20
| 2020-03-29T09:10:46
|
Java
|
UTF-8
|
Java
| false
| false
| 1,118
|
java
|
package com.miaoshaproject.service.impl;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import com.miaoshaproject.service.CacheService;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import java.util.concurrent.TimeUnit;
@Service
public class CacheServiceImpl implements CacheService {
private Cache<String,Object> commonCache = null;
@PostConstruct
public void init(){
commonCache = CacheBuilder.newBuilder()
// 设置缓存容器的初始容量为10
.initialCapacity(10)
// 设置缓存中最大可以存储100个Key,超过100个之后会按照LRU的策略移除缓存项
.maximumSize(100)
// 设置写缓存后多少秒过期
.expireAfterWrite(30, TimeUnit.SECONDS).build();
}
@Override
public void setCommonCache(String key, Object value) {
commonCache.put(key,value);
}
@Override
public Object getFromCommonCache(String key) {
return commonCache.getIfPresent(key);
}
}
|
[
"yue.zhang@shuyun.com"
] |
yue.zhang@shuyun.com
|
176bda7b84c65ca66a19e338cfb3575b19379fa9
|
c7ac06fe9c6d77eaba71126f9e61ebbf1b5d4abe
|
/mohamed-youssfi-pocs-courses/kafka-spring-tut/src/test/java/org/sid/kafkaspringtut/KafkaSpringTutApplicationTests.java
|
d33348b6b4973303bde059b7384371fff8a186fc
|
[] |
no_license
|
amirensit/pocs
|
e0ecf709ea2d4d0a28d300b56674933ff321b7cf
|
77cb1f02cf65abfc3f87fcafe0721901f1427972
|
refs/heads/master
| 2023-08-15T22:42:24.312352
| 2023-08-09T14:10:33
| 2023-08-09T14:10:33
| 224,437,606
| 1
| 3
| null | 2023-03-05T09:16:47
| 2019-11-27T13:30:10
|
Java
|
UTF-8
|
Java
| false
| false
| 222
|
java
|
package org.sid.kafkaspringtut;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class KafkaSpringTutApplicationTests {
@Test
void contextLoads() {
}
}
|
[
"amirensit@gmail.com"
] |
amirensit@gmail.com
|
9eec835a9a92e4c39c2b1989bc9be66b878ec05e
|
8c86b30a8ba05db82fcd98ada5c0ff092f352318
|
/app/src/main/java/mi/song/weekand/farm/util/TimeUtils.java
|
d81850f944d01e9d7eb71d88eb2a154a2a77e600
|
[] |
no_license
|
songmilee/weekand-farm
|
2736321f43211c59869e7266a0ae415eca6259f0
|
dedfa130fd1444356c0ce695a14f5ca815624870
|
refs/heads/master
| 2021-05-19T07:46:31.747351
| 2020-07-21T05:53:53
| 2020-07-21T05:53:53
| 251,590,834
| 0
| 0
| null | 2020-06-03T12:58:20
| 2020-03-31T12:04:40
|
Java
|
UTF-8
|
Java
| false
| false
| 268
|
java
|
package mi.song.weekand.farm.util;
import java.text.SimpleDateFormat;
public class TimeUtils {
public static String parseLongTime(Long timeMillis){
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
return sdf.format(timeMillis);
}
}
|
[
"lsm941010@gmail.com"
] |
lsm941010@gmail.com
|
1afec16762ef9d49b6f7469750b502d1c6aabbf8
|
128eb90ce7b21a7ce621524dfad2402e5e32a1e8
|
/laravel-converted/src/main/java/com/project/convertedCode/includes/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/file_NoCallsException_php.java
|
37e786027f78126760b7f53b077bcfcf85741e72
|
[
"MIT",
"LicenseRef-scancode-warranty-disclaimer"
] |
permissive
|
RuntimeConverter/RuntimeConverterLaravelJava
|
657b4c73085b4e34fe4404a53277e056cf9094ba
|
7ae848744fbcd993122347ffac853925ea4ea3b9
|
refs/heads/master
| 2020-04-12T17:22:30.345589
| 2018-12-22T10:32:34
| 2018-12-22T10:32:34
| 162,642,356
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,154
|
java
|
package com.project.convertedCode.includes.vendor.phpspec.prophecy.src.Prophecy.Exception.Prediction;
import com.runtimeconverter.runtime.RuntimeStack;
import com.runtimeconverter.runtime.interfaces.ContextConstants;
import com.runtimeconverter.runtime.includes.RuntimeIncludable;
import com.runtimeconverter.runtime.includes.IncludeEventException;
import com.runtimeconverter.runtime.classes.RuntimeClassBase;
import com.runtimeconverter.runtime.RuntimeEnv;
import com.runtimeconverter.runtime.interfaces.UpdateRuntimeScopeInterface;
import com.runtimeconverter.runtime.arrays.ZPair;
/*
Converted with The Runtime Converter (runtimeconverter.com)
vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/NoCallsException.php
*/
public class file_NoCallsException_php implements RuntimeIncludable {
public static final file_NoCallsException_php instance = new file_NoCallsException_php();
public final void include(RuntimeEnv env, RuntimeStack stack) throws IncludeEventException {
Scope2451 scope = new Scope2451();
stack.pushScope(scope);
this.include(env, stack, scope);
stack.popScope();
}
public final void include(RuntimeEnv env, RuntimeStack stack, Scope2451 scope)
throws IncludeEventException {
// Namespace import was here
// Conversion Note: class named NoCallsException was here in the source code
env.addManualClassLoad("Prophecy\\Exception\\Prediction\\NoCallsException");
}
private static final ContextConstants runtimeConverterContextContantsInstance =
new ContextConstants()
.setDir("/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction")
.setFile(
"/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/NoCallsException.php");
public ContextConstants getContextConstants() {
return runtimeConverterContextContantsInstance;
}
private static class Scope2451 implements UpdateRuntimeScopeInterface {
public void updateStack(RuntimeStack stack) {}
public void updateScope(RuntimeStack stack) {}
}
}
|
[
"git@runtimeconverter.com"
] |
git@runtimeconverter.com
|
6098a9f122e25747874e5198a4b3c4958bc7a465
|
4aa5ddab58c4b8eeed9157b88b8fa78eb69a636b
|
/aterwebsrv/src/main/java/br/gov/df/emater/aterwebsrv/importador/sisater/SisaterCh.java
|
f817c1d40e4de77e5ee03b07e3222ed65db7802b
|
[] |
no_license
|
Zanguient/projeto
|
9ccb6abce99fafd39a9faf4f84756cc05c2db764
|
fcb36908ec617334db52f6772ff6beba9e81fccc
|
refs/heads/master
| 2020-03-17T10:35:42.256533
| 2018-04-02T15:08:17
| 2018-04-02T15:08:17
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 855
|
java
|
package br.gov.df.emater.aterwebsrv.importador.sisater;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import br.gov.df.emater.aterwebsrv.bo._Cadeia;
@Service("SisaterCh")
public class SisaterCh extends _Cadeia {
@Autowired
public SisaterCh(SisaterPendenciasExcluirCmd c1, SisaterComunidadeCmd c2, SisaterEmpregadoCmd c3,
SisaterPublicoAlvoCmd c4, SisaterPropriedadeRuralExportaUTMCmd c5, SisaterPropriedadeRuralCmd c6,
SisaterPublicoAlvoPropriedadeRuralCmd c7, SisaterIndiceProducaoCmd c8, SisaterAcompanhamentoAterCh c9) {
//super.addCommand(c1);
//super.addCommand(c2);
//super.addCommand(c3);
super.addCommand(c4);
//super.addCommand(c5);
//super.addCommand(c6);
super.addCommand(c7);
//super.addCommand(c8);
//super.addCommand(c9);
}
}
|
[
"pt2ferreira@gmail.com"
] |
pt2ferreira@gmail.com
|
7363c318e56fc2c2c69a5e86fa597aa89f1c6775
|
0a8b2140c796097e515e583b1647ca0a34398e65
|
/src/main/java/com/example/Annotating_Relationships/models/Folder.java
|
78f4ec139e02aecacdec0e638beee743cdd391aa
|
[] |
no_license
|
atrp87/Annotating_Relationships_RECAP
|
f515d0861574ef142407ab2759135572f6c9453c
|
6c166fd8e4faf5d6b604af2f28d75bd1aa37f36b
|
refs/heads/master
| 2022-06-20T04:08:00.985084
| 2020-05-13T07:54:55
| 2020-05-13T07:54:55
| 263,458,153
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,283
|
java
|
package com.example.Annotating_Relationships.models;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;
@Entity
@Table(name="folders")
public class Folder {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
@Column(name = "name")
private String name;
@JsonIgnoreProperties("folder")
@OneToMany(mappedBy = "folder")
private List<File> files;
@ManyToOne
@JoinColumn(name = "user_id", nullable = false)
private User user;
public Folder(String name, User user) {
this.name = name;
this.user = user;
this.files = new ArrayList<>();
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public List<File> getFiles() {
return files;
}
public void setFiles(List<File> files) {
this.files = files;
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
public void addFile(File dump) {
}
}
|
[
"drewpeattie@hotmail.com"
] |
drewpeattie@hotmail.com
|
fd5ca991668437fdbc6651c06f27bb35af0707f1
|
0e9d214b8d3bab0c6c11065579a2840d022fc67e
|
/src/com/braggae/DeluxeBurger.java
|
18a01ca4820b795aa2de0e020b2a75fc3764abd1
|
[] |
no_license
|
braggae/java_course_oop_master_chalange
|
6460a01a77f525b8e34ae4c4de7ada36a8201e3e
|
9f5cd9c94a8512114543e98673ba1b3e1585b2b6
|
refs/heads/master
| 2021-01-19T08:29:46.747977
| 2017-04-08T14:03:11
| 2017-04-08T14:03:11
| 87,637,487
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 381
|
java
|
package com.braggae;
public class DeluxeBurger extends Hamburger {
public DeluxeBurger(String name, String meat, String breadRollType, double price, boolean isVegan) {
super(name, meat, breadRollType, price, isVegan);
this.additionsLimit = 2;
this.addAddition(new Addition(1.20, "Chips"));
this.addAddition(new Addition(0.99, "Cola"));
}
}
|
[
"bregman.y@gmail.com"
] |
bregman.y@gmail.com
|
47aeb726d6a4a8ba5bc3d6035f405642b722fbad
|
cefa05f01f29ee39f79acc05465b3125195e1d12
|
/src/main/java/com/hiring/jobs/controller/RoleController.java
|
ca7f16562a15877ffae74891adcf8b4aabc1a6c4
|
[] |
no_license
|
mochwira/HiringMerger
|
f518af01b593fbb1c82921d7ad80cd52c3c65b40
|
58c77f9c2960fde7af469b92c97592ccee1d8e6c
|
refs/heads/master
| 2023-06-05T14:52:45.207388
| 2021-06-18T04:04:38
| 2021-06-18T04:04:38
| 378,028,107
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,532
|
java
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.hiring.jobs.controller;
import com.hiring.jobs.entity.TblRole;
import com.hiring.jobs.services.RoleService;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
*
* @author D
*/
@Controller
@RequestMapping
public class RoleController {
@Autowired
private RoleService roleService;
@GetMapping("/role")
public String getRoleStatus(Model model) {
Iterable<TblRole> role = roleService.getRoleActive();
model.addAttribute("roles", role);
TblRole roleCrud = new TblRole();
// model.addAttribute("masterAdd", masterCrud);
// model.addAttribute("masterEdit", masterCrud);
model.addAttribute("roleRemove", roleCrud);
return "role/v_page.html";
}
@GetMapping("/role/add")
public String roleAdd(
Model model
)
{
// Iterable<Master> master = masterService.getMasterActive();
// model.addAttribute("masters", master);
//
TblRole roleCrud = new TblRole();
model.addAttribute("roleAdd", roleCrud);
return "role/v_page_add.html";
}
//idnya dimana ?
@GetMapping("/role/edit/{roleId}")
public String roleEdit(
Model model,
@PathVariable Integer roleId
)
{
Optional<TblRole> role = roleService.getRoleById(roleId);
model.addAttribute("roleEdit", role);
return "role/v_page_edit.html";
}
@PostMapping("/role/insert")
public String roleInsert(
@ModelAttribute("roleAdd") TblRole role
)
{
this.roleService.save(role);
return "redirect:/role";
}
@PostMapping(value = "/role/update")
public String roleUpdate(
@RequestParam(value = "roleId", required = false) Integer roleId,
@RequestParam(value = "namaRole", required = false) String namaRole,
@RequestParam(value = "statusRole", required = false) Boolean statusRole
) {
TblRole role = new TblRole(roleId, namaRole, statusRole);
role.setRoleId(roleId);
role.setNamaRole(namaRole);
role.setStatusRole(statusRole);
this.roleService.save(role);
return "redirect:/role";
}
@GetMapping(value = "/role/remove/{roleId}")
public String roleRemove(
@PathVariable Integer roleId
) {
Optional<TblRole> roles = roleService.getRoleById(roleId);
Integer Id = roles.get().getRoleId();
String namaRole = roles.get().getNamaRole();
Boolean statusRole = true;
TblRole role = new TblRole(roleId, namaRole, statusRole);
role.setRoleId(roleId);
role.setNamaRole(namaRole);
role.setStatusRole(statusRole);
this.roleService.save(role);
return "redirect:/role";
}
}
|
[
"mochamadwirasanjaya@gmail.com"
] |
mochamadwirasanjaya@gmail.com
|
91e58de35f74b28c5ed9699c37e77c54a659f1a6
|
7180670aff354166c0cfddff8af4d64f64a24274
|
/src/main/java/com/tissue/core/Node.java
|
6bdac91a76c0230efc261de68343cdba70611c90
|
[] |
no_license
|
guoyingshou/tissue-coreutils
|
a40c6a12063c67fd84a864b315d9c696186ec90a
|
b981b0d8ec1b5103400597dbb6df8b378e56a95b
|
refs/heads/master
| 2021-01-16T18:46:21.027736
| 2013-07-03T06:01:18
| 2013-07-03T06:01:18
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,498
|
java
|
package com.tissue.core;
import org.joda.time.DateTime;
import org.joda.time.Period;
import java.util.Set;
import java.util.List;
import java.util.ArrayList;
import java.util.Date;
import java.security.AccessControlException;
public class Node {
protected String id;
protected String type;
protected Date createTime;
protected Date updateTime;
protected boolean deleted = false;
protected Account account;
public void setId(String id) {
this.id = id;
}
public String getId() {
return id;
}
public void setType(String type) {
this.type = type;
}
public String getType() {
return type;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getCreateTime() {
return createTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setAccount(Account account) {
this.account = account;
}
public Account getAccount() {
return account;
}
public boolean isOwner(Account viewerAccount) {
if((viewerAccount != null) && viewerAccount.getId().equals(account.getId())) {
return true;
}
return false;
}
/**
* Intended to be used in controller.
*/
public void checkPermission(Account viewerAccount, String role) {
if((viewerAccount != null) && !viewerAccount.hasRole("ROLE_EVIL") && (viewerAccount.hasRole(role) || viewerAccount.getId().equals(account.getId()))) {
return;
}
throw new AccessControlException("Access of " + id + " denied: " + account);
}
/**
* Intended to be used in view.
*/
public boolean isAllowed(Account viewerAccount, String role) {
if((viewerAccount == null) || viewerAccount.hasRole("ROLE_EVIL")) {
return false;
}
if(viewerAccount.hasRole(role) || viewerAccount.getId().equals(account.getId())) {
return true;
}
return false;
}
public void setDeleted(boolean deleted) {
this.deleted = deleted;
}
public boolean isDeleted() {
return deleted;
}
public TimeFormat getTimeBefore() {
return new TimeFormat(new DateTime(getCreateTime()), new DateTime());
}
public String toString() {
return this.id;
}
}
|
[
"guoyingshou@tianji.com"
] |
guoyingshou@tianji.com
|
d390111e68c990982d12ce960c6da093e989d82f
|
6e5aa5ca493dc659bddf9e0d3b7676b75592b529
|
/platform-manager/platform-manager-dao/src/main/java/com/lanou3g/platform/dao/SysUserMapper.java
|
07b4f34222e461bd801e958e3d5a7bb4095a11ae
|
[] |
no_license
|
sandishui/xiaoqufuwupingtai
|
6b469f9b82e10fdca80540d3c89c6ce6b135d10e
|
c5a8893880d7a0864a8e2039784b7056b5dc3571
|
refs/heads/master
| 2021-09-06T19:17:43.121856
| 2018-02-10T09:21:21
| 2018-02-10T09:21:21
| 118,703,410
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,170
|
java
|
package com.lanou3g.platform.dao;
import com.lanou3g.platform.pojo.SysUser;
import com.lanou3g.platform.pojo.SysUserExample;
import com.lanou3g.platform.pojo.SysUserExt;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface SysUserMapper {
int countByExample(SysUserExample example);
int deleteByExample(SysUserExample example);
int deleteByPrimaryKey(Integer id);
int insert(SysUser record);
int insertSelective(SysUser record);
List<SysUser> selectByExample(SysUserExample example);
SysUser selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") SysUser record, @Param("example") SysUserExample example);
int updateByExample(@Param("record") SysUser record, @Param("example") SysUserExample example);
int updateByPrimaryKeySelective(SysUser record);
int updateByPrimaryKey(SysUser record);
int deleteUser(int[] userid);
int updateStateStart(Integer[] ids);
int updateStateStop(Integer[] ids);
/**
* 查询所有
* @param param
* @return
*/
List<SysUserExt> selectAll(SysUserExample example);
}
|
[
"san_dishui@163.com"
] |
san_dishui@163.com
|
2cd5fc36764c81c2c24d5cb95d349b72e079bc21
|
af05dcaf7fd3ad0f606928fc290c75e961e7c301
|
/src/main/java/com/liangxu/effectivejava/chapter04/paragraph01/demo04/Chooser.java
|
17cefdccbd672a5d4a79fb7237e49f78933c7143
|
[] |
no_license
|
tomsprxl/effective-java
|
0cd345b039ae9209faf6e68349f0752d02f84d12
|
77ff52a16041afcc69118096f3ed29500fca64d3
|
refs/heads/master
| 2020-07-09T14:59:08.160212
| 2019-09-27T08:22:18
| 2019-09-27T08:22:18
| 204,001,809
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 346
|
java
|
package com.liangxu.effectivejava.chapter04.paragraph01.demo04;
import java.util.Collection;
// A first cut at making Chooser generic - won't compile
public class Chooser<T> {
private final T[] choiceArray;
public Chooser(Collection<T> choices) {
choiceArray = (T[]) choices.toArray();
}
// choose method unchanged
}
|
[
"xuliang@efunong.com"
] |
xuliang@efunong.com
|
a69f2f5babf6b9f7df8767d72060ba4fb09d1091
|
4efb0150cbaaa73a2f1925f15884c580f33d7807
|
/cp.obd.evdatautility/src/cp/obd/evdatautility/GPSDataStream.java
|
794bfb6a879e2ab7bc6c9e20b0ac8d1d727ccf0a
|
[
"MIT"
] |
permissive
|
philiptyler/EVDataAndroidApp
|
ae493deb4d8363dfc7943af70131b427151879c5
|
89cd559cb1277b471e980aed3595efcefc73af11
|
refs/heads/master
| 2021-01-15T14:02:05.646679
| 2013-11-30T01:09:51
| 2013-11-30T01:09:57
| 14,812,637
| 6
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,988
|
java
|
package cp.obd.evdatautility;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import cp.obd.evdatautility.MyLocation;
import cp.obd.evdatautility.MyLocation.LocationResult;
import android.location.Location;
import android.os.Environment;
import android.text.format.Time;
import android.util.Log;
public class GPSDataStream extends EVDataStream {
private Time currentTime;
protected MyLocation myLocation;
@Override
public boolean init(String filePrefix) {
try {
File root = Environment.getExternalStorageDirectory();
dataFile = new File(root, filePrefix+".csv");
fos = new BufferedWriter(new FileWriter(dataFile));
fos.append("Latitude");
fos.append(',');
fos.append("Longitude");
fos.append(',');
fos.append("Altitude");
fos.append(',');
fos.append("Time Stamp");
fos.append("\r\n");
} catch (Exception e) {
Log.e("FILE", "Cannot create temp file for " + filePrefix);
return false;
}
return true;
}
public void init(BlueToothActivity activity) {
LocationResult locationResult = new LocationResult(){
@Override
public void gotLocation(Location location){
if (location != null) {
try {
addToFile(location);
}
catch (Exception e) {
Log.e("GPS", "CANNOT WRITE LOCATION");
}
}
}
};
myLocation = new MyLocation();
myLocation.getLocation(activity, locationResult);
currentTime = new Time();
init("Gps");
}
public void addToFile(Location loc) throws IOException {
fos.append(String.valueOf(loc.getLatitude()));
fos.append(',');
fos.append(String.valueOf(loc.getLongitude()));
fos.append(',');
fos.append(String.valueOf(loc.getAltitude()));
fos.append(',');
currentTime.setToNow();
fos.append(currentTime.toString().substring(0, 15));
fos.append("\r\n");
}
public File endStream() throws IOException {
myLocation.cancel();
return super.endStream();
}
}
|
[
"philip.b.tyler@gmail.com"
] |
philip.b.tyler@gmail.com
|
0d568fd23f31216a4cf76e56caa3568ee29afcb9
|
1e0d2613af81362370a59fc99bde1429088d4f2c
|
/src/test/java/tests/java/nio/file/FilesTest.java
|
03ae1e5cae783b3b88940e5dc558246b97d426d7
|
[
"Apache-2.0"
] |
permissive
|
jjYBdx4IL/java-evaluation
|
3134605ae4a666cabf41494dd4261a0d21585a16
|
744dc4f4a26e264eb1aeab9383babb505aeae056
|
refs/heads/master
| 2021-07-01T16:25:16.416416
| 2021-06-19T14:44:44
| 2021-06-19T14:44:44
| 88,812,127
| 3
| 3
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 658
|
java
|
package tests.java.nio.file;
import static org.junit.Assert.assertTrue;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import org.apache.commons.io.FileUtils;
import org.junit.Before;
import org.junit.Test;
import com.github.jjYBdx4IL.utils.env.Maven;
/**
*
* @author Github jjYBdx4IL Projects
*/
public class FilesTest {
private static final File TEMP_DIR = Maven.getTempTestDir(FilesTest.class);
@Before
public void beforeTest() throws IOException {
FileUtils.cleanDirectory(TEMP_DIR);
}
@Test
public void testExists() {
assertTrue(Files.exists(TEMP_DIR.toPath()));
}
}
|
[
"jjYBdx4IL@github.com"
] |
jjYBdx4IL@github.com
|
0e101c89359fc684720afc1337ff36cea8940831
|
58cdae2013497b89a2294dda5614b09c24d91618
|
/app/src/androidTest/java/com/example/positioningble/ExampleInstrumentedTest.java
|
af49f6adbb4366dadd4fdeae3b27dc6ad4fbe53a
|
[] |
no_license
|
Aditi-hande/PositioningBle
|
55befbd5e3832b035a553a65851f10d26271d399
|
e78a8a2577dd9b2ce5acb45adabc1fe8f4593e75
|
refs/heads/master
| 2020-12-08T17:45:18.597112
| 2020-01-10T13:23:18
| 2020-01-10T13:23:18
| 233,051,727
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 768
|
java
|
package com.example.positioningble;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.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.getInstrumentation().getTargetContext();
assertEquals("com.example.positioningble", appContext.getPackageName());
}
}
|
[
"aditi321hande@gmail.com"
] |
aditi321hande@gmail.com
|
a429a7ffaf8f17f144b8b54991c8eff7f38ee667
|
d593ad37a82a6396effceaf11679e70fddcabc06
|
/sangnung/chap09/bitmapfun/src/com/example/android/bitmapfun/ui/ImageGridFragment.java
|
fb18d07f705ce0a462fd5fc62dc06f1a1206aca5
|
[] |
no_license
|
psh667/android
|
8a18ea22c8c977852ba2cd9361a8489586e06f05
|
8f7394de8e26ce5106d9828cf95eb1617afca757
|
refs/heads/master
| 2018-12-27T23:30:46.988404
| 2013-09-09T13:16:46
| 2013-09-09T13:16:46
| 12,700,292
| 3
| 5
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 12,338
|
java
|
/*
* Copyright (C) 2012 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.example.android.bitmapfun.ui;
import android.annotation.TargetApi;
import android.app.ActivityOptions;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.view.ViewTreeObserver;
import android.widget.AbsListView;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.Toast;
import com.example.android.bitmapfun.BuildConfig;
import com.example.android.bitmapfun.R;
import com.example.android.bitmapfun.provider.Images;
import com.example.android.bitmapfun.util.ImageCache.ImageCacheParams;
import com.example.android.bitmapfun.util.ImageFetcher;
import com.example.android.bitmapfun.util.Utils;
/**
* The main fragment that powers the ImageGridActivity screen. Fairly straight forward GridView
* implementation with the key addition being the ImageWorker class w/ImageCache to load children
* asynchronously, keeping the UI nice and smooth and caching thumbnails for quick retrieval. The
* cache is retained over configuration changes like orientation change so the images are populated
* quickly if, for example, the user rotates the device.
*/
public class ImageGridFragment extends Fragment implements AdapterView.OnItemClickListener {
private static final String TAG = "ImageGridFragment";
private static final String IMAGE_CACHE_DIR = "thumbs";
private int mImageThumbSize;
private int mImageThumbSpacing;
private ImageAdapter mAdapter;
private ImageFetcher mImageFetcher;
/**
* Empty constructor as per the Fragment documentation
*/
public ImageGridFragment() {}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setHasOptionsMenu(true);
mImageThumbSize = getResources().getDimensionPixelSize(R.dimen.image_thumbnail_size);
mImageThumbSpacing = getResources().getDimensionPixelSize(R.dimen.image_thumbnail_spacing);
mAdapter = new ImageAdapter(getActivity());
ImageCacheParams cacheParams = new ImageCacheParams(getActivity(), IMAGE_CACHE_DIR);
cacheParams.setMemCacheSizePercent(0.25f); // Set memory cache to 25% of app memory
// The ImageFetcher takes care of loading images into our ImageView children asynchronously
mImageFetcher = new ImageFetcher(getActivity(), mImageThumbSize);
mImageFetcher.setLoadingImage(R.drawable.empty_photo);
mImageFetcher.addImageCache(getActivity().getSupportFragmentManager(), cacheParams);
}
@Override
public View onCreateView(
LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
final View v = inflater.inflate(R.layout.image_grid_fragment, container, false);
final GridView mGridView = (GridView) v.findViewById(R.id.gridView);
mGridView.setAdapter(mAdapter);
mGridView.setOnItemClickListener(this);
mGridView.setOnScrollListener(new AbsListView.OnScrollListener() {
@Override
public void onScrollStateChanged(AbsListView absListView, int scrollState) {
// Pause fetcher to ensure smoother scrolling when flinging
if (scrollState == AbsListView.OnScrollListener.SCROLL_STATE_FLING) {
mImageFetcher.setPauseWork(true);
} else {
mImageFetcher.setPauseWork(false);
}
}
@Override
public void onScroll(AbsListView absListView, int firstVisibleItem,
int visibleItemCount, int totalItemCount) {
}
});
// This listener is used to get the final width of the GridView and then calculate the
// number of columns and the width of each column. The width of each column is variable
// as the GridView has stretchMode=columnWidth. The column width is used to set the height
// of each view so we get nice square thumbnails.
mGridView.getViewTreeObserver().addOnGlobalLayoutListener(
new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
if (mAdapter.getNumColumns() == 0) {
final int numColumns = (int) Math.floor(
mGridView.getWidth() / (mImageThumbSize + mImageThumbSpacing));
if (numColumns > 0) {
final int columnWidth =
(mGridView.getWidth() / numColumns) - mImageThumbSpacing;
mAdapter.setNumColumns(numColumns);
mAdapter.setItemHeight(columnWidth);
if (BuildConfig.DEBUG) {
Log.d(TAG, "onCreateView - numColumns set to " + numColumns);
}
}
}
}
});
return v;
}
@Override
public void onResume() {
super.onResume();
mImageFetcher.setExitTasksEarly(false);
mAdapter.notifyDataSetChanged();
}
@Override
public void onPause() {
super.onPause();
mImageFetcher.setExitTasksEarly(true);
mImageFetcher.flushCache();
}
@Override
public void onDestroy() {
super.onDestroy();
mImageFetcher.closeCache();
}
@TargetApi(16)
@Override
public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
final Intent i = new Intent(getActivity(), ImageDetailActivity.class);
i.putExtra(ImageDetailActivity.EXTRA_IMAGE, (int) id);
if (Utils.hasJellyBean()) {
// makeThumbnailScaleUpAnimation() looks kind of ugly here as the loading spinner may
// show plus the thumbnail image in GridView is cropped. so using
// makeScaleUpAnimation() instead.
ActivityOptions options =
ActivityOptions.makeScaleUpAnimation(v, 0, 0, v.getWidth(), v.getHeight());
getActivity().startActivity(i, options.toBundle());
} else {
startActivity(i);
}
}
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
inflater.inflate(R.menu.main_menu, menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.clear_cache:
mImageFetcher.clearCache();
Toast.makeText(getActivity(), R.string.clear_cache_complete_toast,
Toast.LENGTH_SHORT).show();
return true;
}
return super.onOptionsItemSelected(item);
}
/**
* The main adapter that backs the GridView. This is fairly standard except the number of
* columns in the GridView is used to create a fake top row of empty views as we use a
* transparent ActionBar and don't want the real top row of images to start off covered by it.
*/
private class ImageAdapter extends BaseAdapter {
private final Context mContext;
private int mItemHeight = 0;
private int mNumColumns = 0;
private int mActionBarHeight = 0;
private GridView.LayoutParams mImageViewLayoutParams;
public ImageAdapter(Context context) {
super();
mContext = context;
mImageViewLayoutParams = new GridView.LayoutParams(
LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
// Calculate ActionBar height
TypedValue tv = new TypedValue();
if (context.getTheme().resolveAttribute(
android.R.attr.actionBarSize, tv, true)) {
mActionBarHeight = TypedValue.complexToDimensionPixelSize(
tv.data, context.getResources().getDisplayMetrics());
}
}
@Override
public int getCount() {
// Size + number of columns for top empty row
return Images.imageThumbUrls.length + mNumColumns;
}
@Override
public Object getItem(int position) {
return position < mNumColumns ?
null : Images.imageThumbUrls[position - mNumColumns];
}
@Override
public long getItemId(int position) {
return position < mNumColumns ? 0 : position - mNumColumns;
}
@Override
public int getViewTypeCount() {
// Two types of views, the normal ImageView and the top row of empty views
return 2;
}
@Override
public int getItemViewType(int position) {
return (position < mNumColumns) ? 1 : 0;
}
@Override
public boolean hasStableIds() {
return true;
}
@Override
public View getView(int position, View convertView, ViewGroup container) {
// First check if this is the top row
if (position < mNumColumns) {
if (convertView == null) {
convertView = new View(mContext);
}
// Set empty view with height of ActionBar
convertView.setLayoutParams(new AbsListView.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, mActionBarHeight));
return convertView;
}
// Now handle the main ImageView thumbnails
ImageView imageView;
if (convertView == null) { // if it's not recycled, instantiate and initialize
imageView = new ImageView(mContext);
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
imageView.setLayoutParams(mImageViewLayoutParams);
} else { // Otherwise re-use the converted view
imageView = (ImageView) convertView;
}
// Check the height matches our calculated column width
if (imageView.getLayoutParams().height != mItemHeight) {
imageView.setLayoutParams(mImageViewLayoutParams);
}
// Finally load the image asynchronously into the ImageView, this also takes care of
// setting a placeholder image while the background thread runs
mImageFetcher.loadImage(Images.imageThumbUrls[position - mNumColumns], imageView);
return imageView;
}
/**
* Sets the item height. Useful for when we know the column width so the height can be set
* to match.
*
* @param height
*/
public void setItemHeight(int height) {
if (height == mItemHeight) {
return;
}
mItemHeight = height;
mImageViewLayoutParams =
new GridView.LayoutParams(LayoutParams.MATCH_PARENT, mItemHeight);
mImageFetcher.setImageSize(height);
notifyDataSetChanged();
}
public void setNumColumns(int numColumns) {
mNumColumns = numColumns;
}
public int getNumColumns() {
return mNumColumns;
}
}
}
|
[
"paksan@daum.net"
] |
paksan@daum.net
|
60913350048463db67cd238450e81853af69b325
|
fb2c996f1864b04811dfd2ee847687e97a2cd071
|
/src/main/java/net/nifoo/myswing/render/tab/ColorRenderer.java
|
88ef522b739778284055726f892d99306c37ab82
|
[] |
no_license
|
LinkNing/MyUI
|
0cfba11161c6395760fbdf39b33ac022f7f16aa1
|
1b2a90925f8ad4ce1601c1a8acf82d5d00c5dfe5
|
refs/heads/master
| 2016-08-04T23:28:40.526117
| 2013-12-05T08:10:30
| 2013-12-05T08:10:30
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,167
|
java
|
package net.nifoo.myswing.render.tab;
import java.awt.Color;
import java.awt.Component;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JTable;
import javax.swing.plaf.basic.BasicComboBoxRenderer;
import javax.swing.table.TableCellRenderer;
public class ColorRenderer extends BasicComboBoxRenderer implements TableCellRenderer{
private static final long serialVersionUID = 1L;
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
boolean cellHasFocus) {
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
JLabel lbl = (JLabel) this;
if (value != null) {
ColorIcon c = new ColorIcon((Color) value);
lbl.setText(c.getColorName());
lbl.setIcon(c);
}
return this;
}
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,
int row, int column) {
JLabel lbl = (JLabel) this;
if (value != null) {
ColorIcon c = new ColorIcon((Color) value);
lbl.setText(c.getColorName());
lbl.setIcon(c);
}
return this;
}
}
|
[
"LinkNingZH@gmail.com"
] |
LinkNingZH@gmail.com
|
a192ad66ace0d78885cbd728cfdd7c137f45136b
|
d0094600f42b68016a22d8c1ee9f5d99337da421
|
/src/main/java/us/ihmc/simulationconstructionset/gui/dialogConstructors/ExportGraphsToFileGenerator.java
|
72bd1b60dcc5bdcf08566e6613fbd2cd17c82465
|
[
"Apache-2.0"
] |
permissive
|
loulansuiye/simulation-construction-set
|
fbfa6faaaa09c71950eef7306701146796fdb33d
|
ae0250ec1febaad21d7b18f3522c76ef13b40984
|
refs/heads/master
| 2020-04-04T12:58:01.134556
| 2018-09-07T19:35:30
| 2018-09-07T19:35:30
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,182
|
java
|
package us.ihmc.simulationconstructionset.gui.dialogConstructors;
import java.awt.BorderLayout;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import javax.swing.JCheckBox;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JPanel;
import com.jmatio.io.MatFileWriter;
import com.jmatio.types.MLArray;
import com.jmatio.types.MLDouble;
import us.ihmc.commons.exception.DefaultExceptionHandler;
import us.ihmc.commons.nio.FileTools;
import us.ihmc.commons.nio.WriteOption;
import us.ihmc.yoVariables.dataBuffer.DataEntry;
import us.ihmc.yoVariables.variable.YoVariable;
import us.ihmc.yoVariables.dataBuffer.DataBuffer;
import us.ihmc.simulationconstructionset.SimulationConstructionSet;
import us.ihmc.simulationconstructionset.gui.GraphArrayPanel;
import us.ihmc.simulationconstructionset.gui.GraphArrayWindow;
import us.ihmc.simulationconstructionset.gui.StandardSimulationGUI;
import us.ihmc.simulationconstructionset.gui.YoGraph;
import us.ihmc.tools.gui.MyFileFilter;
public class ExportGraphsToFileGenerator implements ExportGraphsToFileConstructor
{
private final static String matEnding = ".mat";
private final static String csvEnding = ".csv";
private javax.swing.filechooser.FileFilter matFileFilter = new MyFileFilter(new String[] {matEnding}, "Matlab/octave file (.mat)");
private javax.swing.filechooser.FileFilter csvFileFilter = new MyFileFilter(new String[] {csvEnding}, "CSV file (.csv)");
private JFileChooser dataFileChooser;
private JFrame frame;
private GUIEnablerAndDisabler guiEnablerAndDisabler;
private GraphArrayPanel graphArrayPanel;
private StandardSimulationGUI myGUI;
private JPanel accessory;
private JCheckBox saveAllGraphs;
private DataBuffer dataBuffer;
public ExportGraphsToFileGenerator(SimulationConstructionSet scs, JFrame frame, GraphArrayPanel graphArrayPanel, StandardSimulationGUI myGUI)
{
this.frame = frame;
this.guiEnablerAndDisabler = scs;
this.graphArrayPanel = graphArrayPanel;
this.myGUI = myGUI;
this.dataBuffer = scs.getDataBuffer();
this.dataFileChooser = new JFileChooser();
this.dataFileChooser.setAcceptAllFileFilterUsed(false);
this.dataFileChooser.addChoosableFileFilter(matFileFilter);
this.dataFileChooser.addChoosableFileFilter(csvFileFilter);
this.accessory = new JPanel();
this.saveAllGraphs = new JCheckBox("Save graphs in all graph windows");
this.accessory.setLayout(new BorderLayout());
this.accessory.add(this.saveAllGraphs, BorderLayout.SOUTH);
this.dataFileChooser.setAccessory(accessory);
}
@Override
public void constructDialog()
{
guiEnablerAndDisabler.disableGUIComponents();
this.saveAllGraphs.setSelected(false);
if (dataFileChooser.showSaveDialog(frame) == JFileChooser.APPROVE_OPTION)
{
ArrayList<DataEntry> entriesToExport = new ArrayList<>();
if(saveAllGraphs.isSelected())
{
for (YoGraph graph : myGUI.getGraphArrayPanel().getGraphsOnThisPanel())
{
entriesToExport.addAll(graph.getEntriesOnThisGraph());
}
for(GraphArrayWindow graphArrayWindow : myGUI.getGraphArrayWindows())
{
for (YoGraph graph : graphArrayWindow.getGraphArrayPanel().getGraphsOnThisPanel())
{
entriesToExport.addAll(graph.getEntriesOnThisGraph());
}
}
}
else
{
for (YoGraph graph : graphArrayPanel.getGraphsOnThisPanel())
{
entriesToExport.addAll(graph.getEntriesOnThisGraph());
}
}
if(dataFileChooser.getFileFilter() == matFileFilter)
{
exportToMAT(dataFileChooser.getSelectedFile(), entriesToExport);
}
else if (dataFileChooser.getFileFilter() == csvFileFilter)
{
exportToCSV(dataFileChooser.getSelectedFile(), entriesToExport);
}
else
{
throw new RuntimeException("Unknown data type selected " + dataFileChooser.getFileFilter());
}
}
guiEnablerAndDisabler.enableGUIComponents();
}
private void exportToCSV(File chosenFile, ArrayList<DataEntry> entriesToExport)
{
String filename = chosenFile.getName();
if (!filename.endsWith(csvEnding))
{
chosenFile = new File(chosenFile.getParent(), filename.concat(csvEnding));
}
PrintWriter writer = FileTools.newPrintWriter(chosenFile.toPath(), WriteOption.TRUNCATE, DefaultExceptionHandler.PRINT_STACKTRACE);
for (DataEntry dataEntry : entriesToExport)
{
writer.print(dataEntry.getVariableName() + ",");
}
writer.println();
for (int i = dataBuffer.getInPoint(); i < dataBuffer.getOutPoint(); i++)
{
for (DataEntry dataEntry : entriesToExport)
{
writer.print(dataEntry.getData()[i] + ",");
}
writer.println();
}
writer.close();
}
private void exportToMAT(File chosenFile, ArrayList<DataEntry> entriesToExport)
{
String filename = chosenFile.getName();
if (!filename.endsWith(matEnding))
{
chosenFile = new File(chosenFile.getParent(), filename.concat(matEnding));
}
ArrayList<MLArray> matlabData = new ArrayList<>();
for(DataEntry entry : entriesToExport)
{
matlabData.add(convertToMatlabArray(entry, dataBuffer.getInPoint(), dataBuffer.getOutPoint()));
}
try
{
new MatFileWriter(chosenFile, matlabData);
}
catch (IOException e)
{
e.printStackTrace();
}
}
@Override
public void closeAndDispose()
{
matFileFilter = null;
csvFileFilter = null;
dataFileChooser = null;
frame = null;
myGUI = null;
accessory = null;
saveAllGraphs = null;
}
public static MLDouble convertToMatlabArray(DataEntry entry, int inPoint, int outPoint)
{
YoVariable<?> variable = entry.getVariable();
double[] inData = entry.getData();
double[] data;
if(inPoint == outPoint)
{
// Edge case, export one element
data = new double[1];
data[0] = inData[inPoint];
}
else if(inPoint < outPoint)
{
// Data is not wrapped
data = new double[outPoint + 1 - inPoint];
System.arraycopy(inData, inPoint, data, 0, data.length);
}
else
{
// Data is wrapped
int length = inData.length - inPoint + outPoint + 1;
data = new double[length];
System.arraycopy(inData, inPoint, data, 0, inData.length - inPoint);
System.arraycopy(inData, 0, data, inData.length - inPoint, outPoint + 1);
}
return new MLDouble(variable.getName(), data, 1);
}
}
|
[
"dragon_ryderz@maillist.ihmc.us"
] |
dragon_ryderz@maillist.ihmc.us
|
dc8d147f74fa5c293c959d43b478ae6246e0c9b3
|
184f96a225cdfe80aa85b06eba030cc7b7a0bbcc
|
/src/main/edu/vanderbilt/codeview/BlockComboBoxListener.java
|
24f6559d0ab283203726b9b63e8d2f5bb462a8bf
|
[] |
no_license
|
vimapk12/ViMAP
|
595d7978c3ac7a52ec20c451875d5525ae90aab2
|
2b9cd9b8ef730423649a79718e49b35064c56a4f
|
refs/heads/master
| 2020-12-24T17:44:18.769806
| 2015-06-15T21:24:01
| 2015-06-15T21:24:01
| 23,327,238
| 3
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,206
|
java
|
//--//--//--//--//--//--//
//
// Copyright 2014
// Mind, Matter & Media Lab, Vanderbilt University.
// This is a source file for the ViMAP open source project.
// Principal Investigator: Pratim Sengupta
// Lead Developer: Mason Wright
//
// Simulations powered by NetLogo.
// The copyright information for NetLogo can be found here:
// https://ccl.northwestern.edu/netlogo/docs/copyright.html
//
//--//--//--//--//--//--//
package edu.vanderbilt.codeview;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public final class BlockComboBoxListener implements ActionListener {
private final edu.vanderbilt.codecomponentview.SwingUserCodeView codeView;
public BlockComboBoxListener(
final edu.vanderbilt.codecomponentview.SwingUserCodeView aCodeView
) {
this.codeView = aCodeView;
}
@Override
public void actionPerformed(final ActionEvent event) {
final BlockComboBox comboBox = (BlockComboBox) event.getSource();
this.codeView.enumValueChanged(
comboBox.getBlockId(),
comboBox.getName(),
comboBox.getSelectedItem().toString()
);
}
}
|
[
"jordan.doug.nelson@gmail.com"
] |
jordan.doug.nelson@gmail.com
|
9041dfc7a6cb4017cf5d657a52b8cfe793415876
|
45b38469bfb9f3388e5905e16cef0d994475136c
|
/Afb88/src/main/java/com/nanyang/app/main/home/sport/poll/PoolOutRightState.java
|
12aaa5aef4affb4481a5c951e144fb985ece5765
|
[
"Apache-2.0"
] |
permissive
|
q197585312/testApp
|
e0f1357baa01e8627f52d237d98eea186de4ecd6
|
af19577a99a962efb97f1a8beadf9fceb25b2f76
|
refs/heads/master
| 2023-06-11T00:32:27.893459
| 2021-03-12T05:08:21
| 2021-03-12T05:08:21
| 78,402,432
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,509
|
java
|
package com.nanyang.app.main.home.sport.poll;
import com.nanyang.app.AppConstant;
import com.nanyang.app.MenuItemInfo;
import com.nanyang.app.R;
import com.nanyang.app.main.home.sport.main.OutRightState;
import com.nanyang.app.main.home.sport.main.SportContract;
/**
* Created by Administrator on 2017/3/13.
*/
public class PoolOutRightState extends OutRightState {
public PoolOutRightState(SportContract.View baseView) {
super(baseView);
}
@Override
public boolean mix() {
return false;
}
@Override
public MenuItemInfo getStateType() {
return new MenuItemInfo<String>(0,getBaseView().getContextActivity().getString(R.string.OutRight),"OutRight",getBaseView().getContextActivity().getString(R.string.Pool));
}
@Override
protected String getRefreshUrl() {
return AppConstant.getInstance().URL_POOL_OUTRIGHT+"&ot=e";
}
@Override
protected void onTypeClick(MenuItemInfo item) {
switch (item.getType()) {
case "Today":
getBaseView().switchState(new PoolTodayState(getBaseView()));
break;
case "Early":
getBaseView().switchState(new PoolEarlyState(getBaseView()));
break;
case "Running":
getBaseView().switchState(new PoolRunningState(getBaseView()));
break;
case "OutRight":
getBaseView().switchState(this);
break;
}
}
}
|
[
"yangjiechao945@qq.com.com"
] |
yangjiechao945@qq.com.com
|
f56c60502cae287f7e6dac8c1311ba8b00be67e2
|
35d268ca22949452d1edc33bd770e89b79e57aa7
|
/project/src/main/java/main/controllers/DefaultController.java
|
ba91b335aafd4db342c7701f22d3dc863303007b
|
[] |
no_license
|
AlewBrex/WaveAccess
|
34b147da8acf4bfde3a54bc1b1b9687b310ec5b4
|
8ab08a41aad9ad6a69efd2900834b5b5ec15aa53
|
refs/heads/main
| 2023-02-05T10:40:42.296399
| 2020-12-23T07:39:59
| 2020-12-23T07:39:59
| 322,531,900
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 274
|
java
|
package main.controllers;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class DefaultController
{
@RequestMapping("/")
public String index()
{
return "index";
}
}
|
[
"alewbrex@gmail.com"
] |
alewbrex@gmail.com
|
e29539cbcb0accffdb429fadac92656e388a5bfd
|
7d75743204d83bda289e987f594e9c805a2c3041
|
/WS-JAVABASICO/OBJETO/OBJ_Heranca/src/heranca/animal/Animal.java
|
7514327913145a3a09aa948598f05dd5c4b059bd
|
[] |
no_license
|
LucasDrovere/Projetos
|
53526cae031de43de5f9edf8540f4f09167a573d
|
2334b6070accbaebce9e0501192c47b7afc8706d
|
refs/heads/master
| 2020-04-01T18:33:16.113653
| 2018-10-17T17:50:37
| 2018-10-17T17:50:37
| 153,499,385
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 239
|
java
|
package heranca.animal;
public abstract class Animal {
protected String nome;
public abstract void exibir() ;
public void setNomeAnimal(String nome) {
this.nome = nome;
}
public String getNomeAnimal() {
return nome;
}
}
|
[
"lucasdrovere@gmail.com"
] |
lucasdrovere@gmail.com
|
7081a6e614ea587fa9f2e8492311329209c2e4c9
|
2b6c9949423b0cc932c40a8beadd45669699c5a4
|
/src/main/java/com/visionarysoftwaresolutions/smacker/api/physique/BMI.java
|
a916f2db51d8062aa508d3f7546d8031787a09c8
|
[
"MIT"
] |
permissive
|
Byter/smacker
|
c05d9b77860ce867b2d85ebaccfd1b3e679b378d
|
4f50c78e9aabfd7a1978b8b7d447a303f542d8f0
|
refs/heads/master
| 2016-08-08T06:57:24.053372
| 2014-10-05T04:53:39
| 2014-10-05T04:53:39
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 87
|
java
|
package com.visionarysoftwaresolutions.smacker.api.physique;
public interface BMI {
}
|
[
"visionary.software.solutions@gmail.com"
] |
visionary.software.solutions@gmail.com
|
a35d6db93c09a4bf998c94c84130f66df6bd5afd
|
25aa09263571a5074d3bd5655e83429b12103d6f
|
/EjerciciosJDBC/src/ej10_manipulacion_de_datos/InsertarDep.java
|
78a15fbbc37ce4a0fab6f3f2b018afffd8a3e011
|
[] |
no_license
|
gasparpd/ADT
|
3de815cacf6a47f20244dfbc77243a4f8d4518c8
|
4fa498dfe7c2c631b6b76f20668b10d0b28ab6c2
|
refs/heads/master
| 2022-07-20T23:56:23.857092
| 2020-03-20T20:12:46
| 2020-03-20T20:12:46
| 233,665,830
| 0
| 0
| null | 2022-06-21T04:13:02
| 2020-01-13T18:33:55
|
Java
|
ISO-8859-1
|
Java
| false
| false
| 1,803
|
java
|
package ej10_manipulacion_de_datos;
import java.sql.*;
public class InsertarDep {
public static void main(String[] args) {
try {
Class.forName("com.mysql.jdbc.Driver");// Cargar el driver
// Establecemos la conexion con la BD
Connection conexion = DriverManager.getConnection
("jdbc:mysql://localhost/ejemplo", "ejemplo", "ejemplo");
/*Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conexion = DriverManager
.getConnection("jdbc:oracle:thin:@localhost:1521:XE",
"ejemplo", "ejemplo");
*/
// recuperar argumentos de main
String dep = args[0]; // num. departamento
String dnombre = args[1]; // nombre
String loc = args[2]; // localidad
//construir orden INSERT
String sql = String.format("INSERT INTO departamentos VALUES (%s, '%s', '%s')",
dep,dnombre,loc);
System.out.println(sql);
//https://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html
System.out.println(sql);
Statement sentencia = conexion.createStatement();
int filas=0;
try {
filas = sentencia.executeUpdate(sql.toString());
System.out.println("Filas afectadas: " + filas);
} catch (SQLException e) {
//e.printStackTrace();
System.out.printf("HA OCURRIDO UNA EXCEPCIÓN:%n");
System.out.printf("Mensaje : %s %n", e.getMessage());
System.out.printf("SQL estado: %s %n", e.getSQLState());
System.out.printf("Cód error : %s %n", e.getErrorCode());
}
sentencia.close(); // Cerrar Statement
conexion.close(); // Cerrar conexión
} catch (ClassNotFoundException cn) {
cn.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
}
}// fin de main
}// fin de la clase
|
[
"you@example.com"
] |
you@example.com
|
7735764186cc32e88a2b3bc37e2053bb87130c79
|
3a5eb78af18a5d03c368b48ed13123d2c65d3d17
|
/src/com/ace/capitalflows/db/model/DaoModelFactory.java
|
dda5598f815e8f8d6def3f80f174f0394465029f
|
[] |
no_license
|
AceLee39/Ace
|
cca282948922e31b8abe48aa25d65173cc629b03
|
528ed740480af0f7a101f6454236b812481d4abe
|
refs/heads/master
| 2021-01-23T19:35:12.961944
| 2014-05-26T06:25:01
| 2014-05-26T06:25:01
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,313
|
java
|
// Copyright (c) 2014 All rights reserved.
// ============================================================================
// CURRENT VERSION 1
// ============================================================================
// CHANGE LOG// 1 : 2014-XX-XX, Administrator, creation
// ============================================================================
package com.ace.capitalflows.db.model;
/**
* @author Administrator
*
*/
public class DaoModelFactory {
private DaoModelFactory() {}
private static class DaoModelFactoryInstance {
private static final DaoModelFactory instance = new DaoModelFactory();
}
public static DaoModelFactory getInstance() {
return DaoModelFactoryInstance.instance;
}
@SuppressWarnings("unchecked")
public DaoModel getDaoModel(final String className) {
DaoModel daoModel = null;
try {
final Class<DaoModel> clazz = (Class<DaoModel>) Class.forName(className);
daoModel = clazz.newInstance();
} catch (final ClassNotFoundException e) {
e.printStackTrace();
} catch (final InstantiationException e) {
e.printStackTrace();
} catch (final IllegalAccessException e) {
e.printStackTrace();
}
return daoModel;
}
}
|
[
"liyx_ice@126.com"
] |
liyx_ice@126.com
|
fcc9095de166b90f084e5a0b4f5dde81d3959d51
|
44e7adc9a1c5c0a1116097ac99c2a51692d4c986
|
/aws-java-sdk-forecast/src/main/java/com/amazonaws/services/forecast/model/transform/DeleteDatasetRequestProtocolMarshaller.java
|
00b66040546b8652f5fad08c11986e2eafaed05d
|
[
"Apache-2.0"
] |
permissive
|
QiAnXinCodeSafe/aws-sdk-java
|
f93bc97c289984e41527ae5bba97bebd6554ddbe
|
8251e0a3d910da4f63f1b102b171a3abf212099e
|
refs/heads/master
| 2023-01-28T14:28:05.239019
| 2020-12-03T22:09:01
| 2020-12-03T22:09:01
| 318,460,751
| 1
| 0
|
Apache-2.0
| 2020-12-04T10:06:51
| 2020-12-04T09:05:03
| null |
UTF-8
|
Java
| false
| false
| 2,669
|
java
|
/*
* Copyright 2015-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.forecast.model.transform;
import javax.annotation.Generated;
import com.amazonaws.SdkClientException;
import com.amazonaws.Request;
import com.amazonaws.http.HttpMethodName;
import com.amazonaws.services.forecast.model.*;
import com.amazonaws.transform.Marshaller;
import com.amazonaws.protocol.*;
import com.amazonaws.protocol.Protocol;
import com.amazonaws.annotation.SdkInternalApi;
/**
* DeleteDatasetRequest Marshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class DeleteDatasetRequestProtocolMarshaller implements Marshaller<Request<DeleteDatasetRequest>, DeleteDatasetRequest> {
private static final OperationInfo SDK_OPERATION_BINDING = OperationInfo.builder().protocol(Protocol.AWS_JSON).requestUri("/")
.httpMethodName(HttpMethodName.POST).hasExplicitPayloadMember(false).hasPayloadMembers(true).operationIdentifier("AmazonForecast.DeleteDataset")
.serviceName("AmazonForecast").build();
private final com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory;
public DeleteDatasetRequestProtocolMarshaller(com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory) {
this.protocolFactory = protocolFactory;
}
public Request<DeleteDatasetRequest> marshall(DeleteDatasetRequest deleteDatasetRequest) {
if (deleteDatasetRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
final ProtocolRequestMarshaller<DeleteDatasetRequest> protocolMarshaller = protocolFactory.createProtocolMarshaller(SDK_OPERATION_BINDING,
deleteDatasetRequest);
protocolMarshaller.startMarshalling();
DeleteDatasetRequestMarshaller.getInstance().marshall(deleteDatasetRequest, protocolMarshaller);
return protocolMarshaller.finishMarshalling();
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
}
|
[
""
] | |
3c056077f55a3fb0ad6a6d4376617247a1557cff
|
f37f678a4ca48eb837d879ec14cb4d94f4e0e941
|
/Java Projects/J2EEProjectsAN/21-SpringInWeb/src/com/training/ui/EmployeeServlet.java
|
fbdd380f0e85ba369585bb84b2acef4570bba36b
|
[] |
no_license
|
Ameerameex/JAVA
|
4177bbaaf1998241902f776d41cfce7efe7fd6f7
|
cde7f3c7eab789e8c82e369ad88b085d2b2cd0ee
|
refs/heads/master
| 2020-03-28T03:51:20.705890
| 2018-09-06T13:49:20
| 2018-09-06T13:49:20
| 147,676,082
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,278
|
java
|
package com.training.ui;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;
import com.training.business.Employee;
public class EmployeeServlet extends HttpServlet {
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
ServletContext context=getServletContext();
WebApplicationContext applicationContext=WebApplicationContextUtils.getWebApplicationContext(context);
Employee employee=(Employee) applicationContext.getBean("employeeBean");
RequestDispatcher dispatcher=request.getRequestDispatcher("employeeDisplayer.jsp");
request.setAttribute("emp",employee);
dispatcher.forward(request, response);
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doGet(request, response);
}
}
|
[
"ameer.syed@ameexusa.com"
] |
ameer.syed@ameexusa.com
|
b46b714aeb4abdb3769bea65104120660a983438
|
61ab75473c05ddbd46c44d91959302dce3bfaedf
|
/elasticfile/src/main/java/com/nikoyo/ucontent/elasticfile/local/LocalFileSystem.java
|
c76a97fef4f8a1147dce309ae33df78c5a316e05
|
[
"Apache-2.0"
] |
permissive
|
nkowh/UC8
|
ebd6eaf25e1a0e8a7e36afda41a6a4a622a92648
|
f4b5fe92b4e3ff88fc98227bb5591eff5a067af1
|
refs/heads/master
| 2021-01-01T18:28:35.227134
| 2015-06-01T06:23:35
| 2015-06-01T06:23:35
| 35,146,244
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,728
|
java
|
package com.nikoyo.ucontent.elasticfile.local;
import com.nikoyo.ucontent.elasticfile.Configuration;
import com.nikoyo.ucontent.elasticfile.FileSystem;
import com.nikoyo.ucontent.elasticfile.Utils;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import java.io.File;
import java.io.IOException;
public class LocalFileSystem implements FileSystem {
private final String root;
public LocalFileSystem() {
root = Configuration.UC_PROPERTIES.getProperty("fs.local.root");
for (int i = 0; i < 256; i++) {
String level1 = FilenameUtils.concat(root, String.format("%02X", i));
for (int j = 0; j < 256; j++) {
File level2 = new File(FilenameUtils.concat(level1, String.format("%02X", j)));
boolean res = level2.mkdirs();
if (!res) return;
}
}
}
@Override
public String write(byte[] bytes) throws IOException {
File dest = buildFilePath(bytes);
if (!dest.exists()) FileUtils.writeByteArrayToFile(dest, bytes);
return dest.getAbsolutePath();
}
private File buildFilePath(byte[] bytes) throws IOException {
String crc32 = Utils.checksumCRC32(bytes);
String first2 = crc32.substring(0, 2);
String first4 = crc32.substring(2, 4);
return new File(FilenameUtils.concat(FilenameUtils.concat(FilenameUtils.concat(root, first2), first4), crc32));
}
@Override
public byte[] read(String location) {
try {
return FileUtils.readFileToByteArray(new File(location));
} catch (IOException e) {
e.printStackTrace();
return new byte[0];
}
}
}
|
[
"xiaoqlster@gmail.com"
] |
xiaoqlster@gmail.com
|
888d8c2070c7aaaf18e1d9a43d1ef81d9a262c77
|
0f418db6b70a199c969bbbd354964e47adee30fd
|
/IT-DSS/src/main/java/com/web/bl/dao/EmailsHome.java
|
9e1519ce5f023044ac689d8262bb8b01e7daccf1
|
[] |
no_license
|
reazulhaque20/itdss
|
b8bec704b7cbd84383c539a08c9e72de37841613
|
08fe1c6ce35712c1c658c41494f74a5d8e7f6bb3
|
refs/heads/master
| 2020-03-28T23:03:54.144152
| 2018-05-07T10:02:20
| 2018-05-07T10:02:20
| 149,274,174
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,412
|
java
|
package com.web.bl.dao;
// Generated Apr 15, 2018 10:36:42 AM by Hibernate Tools 4.3.5.Final
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import javax.transaction.Transactional;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Repository;
import com.web.bl.model.Emails;
/**
* Home object for domain model class Emails.
* @see com.web.bl.model.Emails
* @author Hibernate Tools
*/
@Repository
@Transactional
public class EmailsHome {
private static final Log log = LogFactory.getLog(EmailsHome.class);
@PersistenceContext
private EntityManager entityManager;
public void persist(Emails transientInstance) {
log.debug("persisting Emails instance");
try {
entityManager.persist(transientInstance);
log.debug("persist successful");
} catch (RuntimeException re) {
log.error("persist failed", re);
throw re;
}
}
public void remove(Emails persistentInstance) {
log.debug("removing Emails instance");
try {
entityManager.remove(persistentInstance);
log.debug("remove successful");
} catch (RuntimeException re) {
log.error("remove failed", re);
throw re;
}
}
public Emails merge(Emails detachedInstance) {
log.debug("merging Emails instance");
try {
Emails result = entityManager.merge(detachedInstance);
log.debug("merge successful");
return result;
} catch (RuntimeException re) {
log.error("merge failed", re);
throw re;
}
}
public Emails findById(Emails id) {
log.debug("getting Emails instance with id: " + id);
try {
Emails instance = entityManager.find(Emails.class, id);
log.debug("get successful");
return instance;
} catch (RuntimeException re) {
log.error("get failed", re);
throw re;
}
}
public Emails finfByMSISDN(String msisdn) {
Query query;
try {
query = entityManager.createQuery("SELECT e FROM Emails e WHERE e.id.msisdn=:msisdn", Emails.class).setParameter("msisdn", msisdn);
//query = entityManager.createNativeQuery("select t.*, t.rowid from emails t where t.msisdn = '1962424653'", Emails.class);
return (Emails) query.getSingleResult();
}
catch(Exception ex) {
ex.printStackTrace();
return null;
}
}
}
|
[
"reazul.haque@reazul-haque.banglalinkgsm.com"
] |
reazul.haque@reazul-haque.banglalinkgsm.com
|
8a44382825928b405b34d14d936183279cf65cb2
|
2d5c00d38e838fefa8c84375b2f8f7e49a93a23f
|
/src/com/analogics/dao/AlarmDataDao.java
|
dd2dd0c80afca51e99ccfd2d8ebaa4f3c126e547
|
[] |
no_license
|
achyuthkanth/NEPAL_BILLING
|
14a56dcd3526e9a7d183c6fb50acb0b3db4bc83c
|
cde39d61537edc0ad80f2b3eb637f02ed1cdd51e
|
refs/heads/main
| 2023-02-28T04:01:13.936700
| 2021-01-20T11:26:44
| 2021-01-20T11:26:44
| 317,815,474
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,294
|
java
|
package com.analogics.dao;
import java.util.ArrayList;
import java.util.List;
import org.hibernate.Query;
import org.hibernate.Session;
import com.analogics.um.dao.BaseHibernateDAO;
import com.analogics.um.vo.LevelIndexMaster;
import com.analogics.utils.CommonQueryFrameUtils;
import com.analogics.utils.UserHierarchyQueryFraming;
import com.analogics.vo.AlarmData;
import com.analogics.vo.AlarmDataLatest;
public class AlarmDataDao extends BaseHibernateDAO{
UserHierarchyQueryFraming frameObj = new UserHierarchyQueryFraming();
CommonQueryFrameUtils queryFrameObj = new CommonQueryFrameUtils();
public List<AlarmData> fetchAlarmDataList(int pageNumber, int parseInt,
String searchParameter, AlarmData masterObj,
LevelIndexMaster levelIndexObj) {
List<AlarmData> list = new ArrayList<AlarmData>();
Session session = null;
try {
session = getSession();
StringBuilder strb = new StringBuilder();
StringBuilder strb1 = new StringBuilder();
strb.append(" from AlarmData data, MeterMaster master,LevelIndexMaster levels ");
strb.append("where data.meterNumber=master.meterNumber");
strb.append(" and data.nodeDate between '"+masterObj.getFromDate()+"' and '"+masterObj.getToDate()+"'");
strb.append(" and master.indexid=levels.indexid");
strb.append(frameObj.frameUserHierarchyQuery(levelIndexObj));
if(!masterObj.getSearchSelectVar().equalsIgnoreCase("")
&& !masterObj.getSearchSelectVar().equalsIgnoreCase("SELECT")){
strb.append(" and ");
strb1 = queryFrameObj.conditionQuery(masterObj.getSearchSelectVar(),
masterObj.getSearchParameter(),
masterObj.getConditionStr());
strb.append(strb1);
}
strb.append(" order by master.insertedDate desc");
Query queryObj = session.createQuery(strb.toString());
queryObj.setFirstResult(pageNumber);
queryObj.setMaxResults(parseInt);
@SuppressWarnings("unchecked")
List<Object[]> objList= queryObj.list();
for(Object[] objArr:objList){
AlarmData dObj=(AlarmData) objArr[0];
list.add(dObj);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
if (session.isOpen())
session.close();
}
return list;
}
public Long fetchAlarmDataCount(AlarmData masterObj,
LevelIndexMaster levelIndexObj) {
long count = 0;
Session session = null;
try {
session = getSession();
StringBuilder strb = new StringBuilder();
StringBuilder strb1 = new StringBuilder();
strb.append("select count(*) from AlarmData data, MeterMaster master,LevelIndexMaster levels ");
strb.append("where data.meterNumber=master.meterNumber ");
strb.append(" and data.nodeDate between '"+masterObj.getFromDate()+"' and '"+masterObj.getToDate()+"'");
strb.append(" and master.indexid=levels.indexid");
strb.append(frameObj
.frameUserHierarchyQuery(levelIndexObj));
if(!masterObj.getSearchSelectVar().equalsIgnoreCase("")
&& !masterObj.getSearchSelectVar().equalsIgnoreCase("SELECT")){
strb.append(" and ");
strb1 = queryFrameObj.conditionQuery(masterObj.getSearchSelectVar(),
masterObj.getSearchParameter(),
masterObj.getConditionStr());
strb.append(strb1);
}
Query queryObj = session.createQuery(strb.toString());
count = (Long) queryObj.list().get(0);
} catch (Exception e) {
e.printStackTrace();
} finally {
if (session.isOpen())
session.close();
}
return count;
}
public List<AlarmDataLatest> fetchAlarmDataLatestList(int pageNumber,
int parseInt, String searchParameter, AlarmDataLatest masterObj,
LevelIndexMaster levelIndexObj) {
List<AlarmDataLatest> list = new ArrayList<AlarmDataLatest>();
Session session = null;
try {
session = getSession();
StringBuilder strb = new StringBuilder();
StringBuilder strb1 = new StringBuilder();
strb.append(" from AlarmDataLatest data, MeterMaster master,LevelIndexMaster levels ");
strb.append("where data.meterNumber=master.meterNumber");
// strb.append(" and data.nodeDate between '"+masterObj.getFromDate()+"' and '"+masterObj.getToDate()+"'");
strb.append(" and master.indexid=levels.indexid");
strb.append(frameObj.frameUserHierarchyQuery(levelIndexObj));
if(!masterObj.getSearchSelectVar().equalsIgnoreCase("")
&& !masterObj.getSearchSelectVar().equalsIgnoreCase("SELECT")){
strb.append(" and ");
strb1 = queryFrameObj.conditionQuery(masterObj.getSearchSelectVar(),
masterObj.getSearchParameter(),
masterObj.getConditionStr());
strb.append(strb1);
}
strb.append(" order by master.insertedDate desc");
Query queryObj = session.createQuery(strb.toString());
queryObj.setFirstResult(pageNumber);
queryObj.setMaxResults(parseInt);
@SuppressWarnings("unchecked")
List<Object[]> objList= queryObj.list();
for(Object[] objArr:objList){
AlarmDataLatest dObj=(AlarmDataLatest) objArr[0];
list.add(dObj);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
if (session.isOpen())
session.close();
}
return list;
}
public Long fetchAlarmDataLatestCount(AlarmDataLatest masterObj,
LevelIndexMaster levelIndexObj) {
long count = 0;
Session session = null;
try {
session = getSession();
StringBuilder strb = new StringBuilder();
StringBuilder strb1 = new StringBuilder();
strb.append("select count(*) from AlarmDataLatest data, MeterMaster master,LevelIndexMaster levels ");
strb.append("where data.meterNumber=master.meterNumber ");
// strb.append(" and data.nodeDate between '"+masterObj.getFromDate()+"' and '"+masterObj.getToDate()+"'");
strb.append(" and master.indexid=levels.indexid");
strb.append(frameObj
.frameUserHierarchyQuery(levelIndexObj));
if(!masterObj.getSearchSelectVar().equalsIgnoreCase("")
&& !masterObj.getSearchSelectVar().equalsIgnoreCase("SELECT")){
strb.append(" and ");
strb1 = queryFrameObj.conditionQuery(masterObj.getSearchSelectVar(),
masterObj.getSearchParameter(),
masterObj.getConditionStr());
strb.append(strb1);
}
Query queryObj = session.createQuery(strb.toString());
count = (Long) queryObj.list().get(0);
} catch (Exception e) {
e.printStackTrace();
} finally {
if (session.isOpen())
session.close();
}
return count;
}
}
|
[
"softwaresupport@analogicgroup.com"
] |
softwaresupport@analogicgroup.com
|
3b9c7e8f22427001fd30b4f3dd197fd96d0bbe82
|
42c7788b116c8b5a2eb58508242c50302020d0f1
|
/backend/src/main/java/com/example/addd/myapplication/backend/UserRecond.java
|
de905fecf967a799fad85fb1907e5a7a3860b568
|
[] |
no_license
|
PutraNasri/Coba
|
e0bde3c0c44c308b631463675ccc92a739f9ec59
|
7537f2de3f526b43995da01d18f00fda28501ca5
|
refs/heads/master
| 2021-01-10T16:08:59.982429
| 2015-10-23T10:06:23
| 2015-10-23T10:06:23
| 44,731,871
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,335
|
java
|
package com.example.addd.myapplication.backend;
import com.googlecode.objectify.annotation.Cache;
import com.googlecode.objectify.annotation.Entity;
import com.googlecode.objectify.annotation.Id;
import com.googlecode.objectify.annotation.Index;
/**
* Created by addd on 10/22/2015.
*/
@Entity
@Cache
public class UserRecond {
@Id
Long id;
@Index private String userId;
@Index private String namaLengkap;
@Index private String noHP;
@Index private String role;
private String password;
public Long getId() {
return id;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getNamaLengkap() {
return namaLengkap;
}
public void setNamaLengkap(String namaLengkap) {
this.namaLengkap = namaLengkap;
}
public String getNoHP() {
return noHP;
}
public void setNoHP(String noHP) {
this.noHP = noHP;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
public UserRecond() {
}
}
|
[
"nasrisyawaldi@gmail.com"
] |
nasrisyawaldi@gmail.com
|
dba78bdc1d4704d9c889962ad77263ea7c139317
|
fdc0fea15ee5bd12b18dbb53691aebe76aeae404
|
/design_pattern/src/main/java/com/xyw55/gof/singleton/Singleton.java
|
2df85e02a3065e7d07d0d83496379be58ef38ab0
|
[] |
no_license
|
xyw55/study
|
355b23760ed2999ed9b148a07765b1c93d8cdfe2
|
ad0d9b15141265c17dc84e6bb6441d71584851b3
|
refs/heads/master
| 2022-06-23T05:38:35.475112
| 2020-04-19T17:19:15
| 2020-04-19T17:19:15
| 105,488,825
| 0
| 0
| null | 2022-06-17T01:47:21
| 2017-10-02T01:48:38
|
Java
|
UTF-8
|
Java
| false
| false
| 106
|
java
|
package com.xyw55.gof.singleton;
/**
* Created by xiayiwei on 11/27/16.
*/
public class Singleton {
}
|
[
"yiwei.xia@ele.me"
] |
yiwei.xia@ele.me
|
f3e876ea84dbb9375b05d019851240c975db2ded
|
550c9f4a04efeba80ee4df6aaafcbd2e244caf87
|
/src/main/java/com/tanjiaming99/myblog/service/impl/BlogServiceImpl.java
|
d9653d8b49c66d5f80672204a048e03e61f6f1c6
|
[] |
no_license
|
Jammillk/My-Blog
|
6198e1b3b35a3c7863ccbeed58fe48f4e418dce2
|
c1fca35249cfc989ee52118f26db2f1d00eae5eb
|
refs/heads/main
| 2023-06-09T10:29:00.951587
| 2021-06-27T07:45:23
| 2021-06-27T07:45:23
| 380,680,056
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 515
|
java
|
package com.tanjiaming99.myblog.service.impl;
import com.tanjiaming99.myblog.entity.Blog;
import com.tanjiaming99.myblog.mapper.BlogMapper;
import com.tanjiaming99.myblog.service.BlogService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author author:tanjiaming99.com
* @since 2021-06-23
*/
@Service
public class BlogServiceImpl extends ServiceImpl<BlogMapper, Blog> implements BlogService {
}
|
[
"im@tanjiaming99.com"
] |
im@tanjiaming99.com
|
fe0b0fb0df1eb60c5fe77ac7c99f33bb19305e3d
|
4c1fa530c96b7cf4af3d9c12d10fcda8397f8bc2
|
/src/main/java/com/geekbrains/book/store/controllers/CartController.java
|
69641501aae307d832c698540e6740710f99d5f1
|
[] |
no_license
|
arzek357/book-store
|
69a29986d5d5de22a8dcf6ca27442a4fb62279cb
|
e59c66d2911b9c1424ae4ed44f83801f1dba2bad
|
refs/heads/master
| 2022-12-12T07:21:24.714635
| 2020-08-28T09:53:27
| 2020-08-28T09:53:27
| 286,846,024
| 0
| 0
| null | 2020-08-30T11:23:01
| 2020-08-11T20:55:18
|
Java
|
UTF-8
|
Java
| false
| false
| 1,919
|
java
|
package com.geekbrains.book.store.controllers;
import com.geekbrains.book.store.beans.Cart;
import com.geekbrains.book.store.services.BookService;
import com.geekbrains.book.store.services.orderServices.OrderService;
import com.geekbrains.book.store.utils.BookFilter;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.security.Principal;
@Controller
@RequestMapping("/cart")
@AllArgsConstructor
public class CartController {
private BookService bookService;
private OrderService orderService;
private Cart cart;
@GetMapping
public String showCart(Model model){
model.addAttribute("goods",cart.getGoodsList());
return "cart-page";
}
@GetMapping("/add/{id}")
public void addProductInCart(
@PathVariable long id,
@RequestParam(defaultValue = "1") int number,
HttpServletRequest request,
HttpServletResponse response) throws IOException {
cart.addNewBooks(bookService.findById(id),number);
response.sendRedirect(request.getHeader("referer"));
}
@GetMapping("/delete/{id}")
public String deleteProductFromCart(@PathVariable long id){
cart.deleteBooks(bookService.findById(id));
return "redirect:/cart";
}
@GetMapping("/create_order")
public String createOrder(Principal principal){
orderService.saveNewOrder(principal.getName(),cart.getOrderItemsListAndCleanCart());
return "redirect:/books";
}
}
|
[
"arzek357@gmail.com"
] |
arzek357@gmail.com
|
a83f52be29a8b2de97bcb498e6d9fe7c65b86572
|
7b3830a17ea50ff54e503f4d30bb1a29ec97a8d7
|
/jhipster/src/main/java/com/videogen/videogen/security/SecurityUtils.java
|
76308f58a54e31fc76cc19fae785044c82ce9bf1
|
[] |
no_license
|
FAMILIAR-project/VideoGen
|
d6c30a23efcaaf1b0df13fc709033870f2c56fc6
|
14441a7a41399ee28befa781bdf514ebf5d20a63
|
refs/heads/master
| 2021-05-04T10:02:02.130831
| 2017-02-13T10:25:10
| 2017-02-13T10:25:10
| 44,157,659
| 4
| 52
| null | 2017-02-13T11:04:02
| 2015-10-13T06:52:00
|
HTML
|
UTF-8
|
Java
| false
| false
| 2,590
|
java
|
package com.videogen.videogen.security;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;
/**
* Utility class for Spring Security.
*/
public final class SecurityUtils {
private SecurityUtils() {
}
/**
* Get the login of the current user.
*
* @return the login of the current user
*/
public static String getCurrentUserLogin() {
SecurityContext securityContext = SecurityContextHolder.getContext();
Authentication authentication = securityContext.getAuthentication();
String userName = null;
if (authentication != null) {
if (authentication.getPrincipal() instanceof UserDetails) {
UserDetails springSecurityUser = (UserDetails) authentication.getPrincipal();
userName = springSecurityUser.getUsername();
} else if (authentication.getPrincipal() instanceof String) {
userName = (String) authentication.getPrincipal();
}
}
return userName;
}
/**
* Check if a user is authenticated.
*
* @return true if the user is authenticated, false otherwise
*/
public static boolean isAuthenticated() {
SecurityContext securityContext = SecurityContextHolder.getContext();
Authentication authentication = securityContext.getAuthentication();
if (authentication != null) {
return authentication.getAuthorities().stream()
.noneMatch(grantedAuthority -> grantedAuthority.getAuthority().equals(AuthoritiesConstants.ANONYMOUS));
}
return false;
}
/**
* If the current user has a specific authority (security role).
*
* <p>The name of this method comes from the isUserInRole() method in the Servlet API</p>
*
* @param authority the authority to check
* @return true if the current user has the authority, false otherwise
*/
public static boolean isCurrentUserInRole(String authority) {
SecurityContext securityContext = SecurityContextHolder.getContext();
Authentication authentication = securityContext.getAuthentication();
if (authentication != null) {
return authentication.getAuthorities().stream()
.anyMatch(grantedAuthority -> grantedAuthority.getAuthority().equals(authority));
}
return false;
}
}
|
[
"git-account@loicguegan.fr"
] |
git-account@loicguegan.fr
|
395e36a41bbb81f7c884d368eec98f1f83e02fed
|
b6c6d3de910b2a72bb3b54b4df32397f1679c3db
|
/casadocodigo/src/main/java/br/com/zup/casadocodigo/autor/AutorController.java
|
9dc177dfe8c856d4ba854b8ca3428c4637f3863d
|
[
"Apache-2.0"
] |
permissive
|
adamcoutinho/orange-talents-01-template-casa-do-codigo
|
517c5836c03effa6de22c47de09f8d3b07e3d996
|
fdf710c40b7055a10c0703d6d8a5730357880fa8
|
refs/heads/main
| 2023-02-24T05:46:11.004552
| 2021-01-29T22:38:19
| 2021-01-29T22:38:19
| 331,656,088
| 0
| 0
|
Apache-2.0
| 2021-01-21T14:39:21
| 2021-01-21T14:39:21
| null |
UTF-8
|
Java
| false
| false
| 963
|
java
|
package br.com.zup.casadocodigo.autor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.persistence.EntityManager;
import javax.transaction.Transactional;
import javax.validation.Valid;
@RestController
@RequestMapping("/autor")
public class AutorController {
@Autowired
private EntityManager manager;
@PostMapping("/cadastrar")
@Transactional
public ResponseEntity<?> create(@RequestBody @Valid AutorFormRequest request) {
Autor autor = request.toModel();
manager.persist(autor);
return ResponseEntity.status(HttpStatus.OK).body(autor);
}
}
|
[
"adamcoutinho@gmail.com"
] |
adamcoutinho@gmail.com
|
e5bce746df05a31f689a181a022ac620855bf4fc
|
ef2211e24ba5412627de1bfea0018bab4769be75
|
/app/src/androidTest/java/com/example/muhammed/calculatesum/ExampleInstrumentedTest.java
|
61045127286b4de8d2dcab8b7631ed8860806370
|
[] |
no_license
|
flyingbutter/CalculateSum
|
7f59aa5e8840bf5b7dce3fc292cad088d1f835e5
|
ea0bbac6a89113ef13123f4ae7aac57b980a5335
|
refs/heads/master
| 2021-01-25T07:54:28.591000
| 2017-06-09T14:04:25
| 2017-06-09T14:04:25
| 93,679,678
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 770
|
java
|
package com.example.muhammed.calculatesum;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.example.muhammed.calculatesum", appContext.getPackageName());
}
}
|
[
"mtanir22@gmail.com"
] |
mtanir22@gmail.com
|
dd33d76001cfad3cd4850f080f80300eb6ca6e03
|
1c9f7c7426051a15342a19b22e732f46f6b2a99e
|
/src/main/java/kata/domain/film/Film.java
|
f88b544787a05e156e36e66e58102864a1f57fec
|
[
"MIT"
] |
permissive
|
chaabani-anis/mocks-fakes-spies-and-stubs-kata
|
2581a17b2f48ab4c4224f7ce2e298a244b8139cc
|
cf186a837ceca2e78c5f5d0fe7ab9abd98eabd34
|
refs/heads/master
| 2022-12-17T11:52:10.349549
| 2020-09-16T20:10:09
| 2020-09-16T20:10:09
| 296,120,764
| 1
| 0
|
MIT
| 2020-09-16T18:51:40
| 2020-09-16T18:51:39
| null |
UTF-8
|
Java
| false
| false
| 1,366
|
java
|
package kata.domain.film;
import java.time.Duration;
import java.util.List;
import java.util.Objects;
public class Film {
public final String title;
public final Duration duration;
public final List<String> categories;
public final Integer releaseDate;
Film(String title, Duration duration, List<String> categories, Integer releaseDate) {
Objects.requireNonNull(title, "title must not be null");
Objects.requireNonNull(duration, "duration must not be null");
Objects.requireNonNull(categories, "categories must not be null");
Objects.requireNonNull(releaseDate, "releaseDate must not be null");
if (title.isEmpty()) {
throw new IllegalArgumentException("title is empty");
}
this.title = title;
this.duration = duration;
this.categories = categories;
this.releaseDate = releaseDate;
}
public static Film of(String title, Duration duration, List<String> categories, Integer releaseDate) {
return new Film(title, duration, categories, releaseDate);
}
@Override
public String toString() {
return "Film{" +
"title='" + title + '\'' +
", duration=" + duration +
", categories=" + categories +
", releaseDate=" + releaseDate +
'}';
}
}
|
[
"aleixmp@users.noreply.github.com"
] |
aleixmp@users.noreply.github.com
|
6e852dbf641631da16ea0e0c25d5ce18b785e505
|
3a3afe2608f59ed4b03c3813a47428c7a16e729d
|
/src/main/java/sandbox/velocity/example/module/Transformer.java
|
5d4f46e64dc25a89bcff792c28d9473ae3fd37e5
|
[] |
no_license
|
seonghoonkang/DataTypeManager
|
5d5e38f50a0b6c0d85722c6031b65c1cf255bdaa
|
6c6165bf9184728a8a296fd2d3b209af7e2afcb0
|
refs/heads/main
| 2023-03-23T16:50:10.281284
| 2021-02-27T07:22:45
| 2021-02-27T07:22:45
| 342,430,249
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,230
|
java
|
package sandbox.velocity.example.module;
import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
import org.apache.velocity.app.VelocityEngine;
import org.apache.velocity.runtime.RuntimeConstants;
import org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader;
import sandbox.velocity.example.vo.RowData;
import java.io.StringWriter;
public class Transformer {
private VelocityEngine engine;
private void engineInit(){
engine = new VelocityEngine();
engine.setProperty(RuntimeConstants.RESOURCE_LOADER, "classpath");
engine.setProperty("classpath.resource.loader.class", ClasspathResourceLoader.class.getName());
engine.init();
}
public String generate(RowData rowData) {
engineInit();
VelocityContext context = new VelocityContext();
context.put("packageName", rowData.getPackageName());
context.put("className", rowData.getClassName());
context.put("properties", rowData.getProperties());
StringWriter writer = new StringWriter();
Template template = engine.getTemplate("templates/fact_class.vm");
template.merge(context, writer);
return writer.toString();
}
}
|
[
"skang@bizflow.com"
] |
skang@bizflow.com
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.