blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 332 | content_id stringlengths 40 40 | detected_licenses listlengths 0 50 | license_type stringclasses 2 values | repo_name stringlengths 7 115 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 557 values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 77.7k | fork_events_count int64 0 48k | gha_license_id stringclasses 17 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 82 values | src_encoding stringclasses 28 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 7 5.41M | extension stringclasses 11 values | content stringlengths 7 5.41M | authors listlengths 1 1 | author stringlengths 0 161 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6fdf27a45c47e0a108aa75fb167e09dd09b82b36 | 76c57f57d35f77fb02c3531956e957606a42dbee | /Mezzanine/macros/meshAndSave.java | 65199f5023558133b95b0fd488bfe1d4fac0ed7b | [] | no_license | nnmrec/marine-star | 6c25b8e46bf2ef440e035fabd33d822c4a2abf4f | 1cad718a674ea78f5f3cdd7cdb385fe1f9c0db96 | refs/heads/master | 2021-01-10T06:23:09.396361 | 2016-02-21T22:22:01 | 2016-02-21T22:22:01 | 49,032,755 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,367 | java | // STAR-CCM+ macro: meshAndSave.java
// Written by STAR-CCM+ 10.06.010
//
// license: ?
//
// issues:
// * how to read the existing filename (with absolute or relative path) and then add a prefix to filename? Alternatively, could user input the filename, or pass input argument to this function from main driver code
//
//
package macro;
import java.util.*;
import star.common.*;
import star.base.neo.*;
import star.meshing.*;
public class meshAndSave extends StarMacro {
///////////////////////////////////////////////////////////////////////////////
// USER INPUTS
//
// String path0 = "Mezzanine_v0.sim";
static final int save_iters = 100; // number of iterations to trigger the auto-save
///////////////////////////////////////////////////////////////////////////////
public void execute() {
execute0();
// /mnt/data-RAID-1/danny/marine-star/Mezzanine/meshed.Mezzanine.v0.sim
execute1();
}
private void execute0() {
Simulation simulation_0 =
getActiveSimulation();
// setup the auto-save
AutoSave autoSave_0 =
simulation_0.getSimulationIterator().getAutoSave();
autoSave_0.setAutoSaveMesh(true);
StarUpdate starUpdate_0 =
autoSave_0.getStarUpdate();
starUpdate_0.setEnabled(true);
IterationUpdateFrequency iterationUpdateFrequency_0 =
starUpdate_0.getIterationUpdateFrequency();
iterationUpdateFrequency_0.setIterations(save_iters);
// clear any previous solutions and meshes (start clean) NOTE: should not clear the mesh or solution if you want to map the solution fields
// Solution solution_0 =
// simulation_0.getSolution();
// solution_0.clearSolution();
// MeshPipelineController meshPipelineController_0 =
// simulation_0.get(MeshPipelineController.class);
// meshPipelineController_0.clearGeneratedMeshes();
// generate the volume mesh
AutoMeshOperation autoMeshOperation_1 =
((AutoMeshOperation) simulation_0.get(MeshOperationManager.class).getObject("Automated Mesh"));
autoMeshOperation_1.execute();
// save the meshed simulation
// simulation_0.saveState(resolvePath(path0));
simulation_0.saveState(getSimulation().getPresentationName()+".sim");
} // end execute0()
private void execute1() {
} // end execute1()
} // end public class
| [
"dsale@uw.edu"
] | dsale@uw.edu |
0537f4b66a750a195a24a31bb4b9bfe32d2e174b | d1b864a4ce361aa83c95506382e20843f19d9bda | /test/HPalang/Core/Messages/NormalMessageTest.java | 2554e664bbff3e9e06b0ef2a5e9f7dae4aa02f4c | [] | no_license | jahandideh-iman/HybridRebeca | 4483f33b2f18be7216b6f73134f405d36dcdbd1f | e7f7e93212ba12c2577a1bae5092599f8611b7bc | refs/heads/master | 2021-10-24T08:38:15.232459 | 2019-03-24T04:48:51 | 2019-03-24T04:48:51 | 71,126,219 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 979 | 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 HPalang.Core.Messages;
import HPalang.Core.Message;
import HPalang.Core.MessageHandler;
import HPalang.Core.Statement;
import HPalang.Core.Statements.DelayStatement;
import Mocks.EmptyStatement;
import java.util.Queue;
import static org.hamcrest.CoreMatchers.equalTo;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author Iman Jahandideh
*/
public class NormalMessageTest
{
@Test
public void MessagesWithEqualMessageHandlersAreEqual()
{
MessageHandler messageHandler = new MessageHandler(Message.MessageType.Control);
NormalMessage message1 = new NormalMessage(messageHandler);
NormalMessage message2 = new NormalMessage(messageHandler);
assertThat(message2, equalTo(message1));
}
}
| [
"jahandideh_iman@yahoo.com"
] | jahandideh_iman@yahoo.com |
b9889a8b4f2f8a06932f383ef969f27d99ce445d | 317bf7c42543d45da175bb39ee6fbe439f820b7b | /healthcare/src/main/java/ir/madjeed/healthcare/logic/entity/PhysicalActivity.java | 8b264548bbea8c2e6d229f00fff77ccaaf571310 | [] | no_license | sajadbanooie/HealthCare | b2d0bb221670ef42101ed1ab82510f64277bdd0f | b9e323f0ea5f34d5ea3d048285719bcf5c730267 | refs/heads/master | 2021-01-15T12:10:37.259593 | 2015-06-02T08:12:39 | 2015-06-02T08:12:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 402 | java | package ir.madjeed.healthcare.logic.entity;
import java.util.Date;
public abstract class PhysicalActivity {
public abstract int getId();
public abstract User getPatient();
public abstract void setPatient(User patient);
public abstract Integer getWalk();
public abstract void setWalk(Integer walk);
public abstract Date getDate();
public abstract void setDate(Date date);
} | [
"mmobini@ce.sharif.edu"
] | mmobini@ce.sharif.edu |
21768b62b911b6eed2077f82eea88ca2da64b8f1 | 2d840a44ecc779999afddd972ae5b0b72cdb98ae | /WiseSayings/src/com/walter/wisesayings/Help_About.java | fb48afb2dd37a1333d229ffa3cc65acb92ddfa7f | [] | no_license | walteranyika/android_apps | fcca883ef6c979da0f16f7ad990ca8e5273b0bc6 | 84d87c25021e54e4324b27f3b2112f99fced5853 | refs/heads/master | 2021-01-10T01:35:09.129241 | 2015-11-11T12:08:25 | 2015-11-11T12:08:25 | 45,979,414 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 844 | java | package com.walter.wisesayings;
import com.example.wisesayings.R;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class Help_About extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.help_about);
TextView tv=(TextView) findViewById(R.id.tv);
tv.setText("Help\n" +
"To use this application, simply refresh by " +
"pressing the refresh icon after the application has loaded.\n" +
"The application might delay loading the items the first time it is installed. Please give it a few seconds to initialize then refresh.\n" +
"\n " +
"About\n" +
"Application Name: Wise Sayings\n" +
"Version: 1.0\n" +
"Developer:Waltz Inc");
}
}
| [
"walteranyika@gmail.com"
] | walteranyika@gmail.com |
265db24a388978027e99562b37d4ff8fedc995c8 | 53d677a55e4ece8883526738f1c9d00fa6560ff7 | /com/tencent/mm/plugin/appbrand/dynamic/a/c.java | 8e1e2b09d267943ad05f1f9d267b709652424274 | [] | no_license | 0jinxing/wechat-apk-source | 544c2d79bfc10261eb36389c1edfdf553d8f312a | f75eefd87e9b9ecf2f76fc6d48dbba8e24afcf3d | refs/heads/master | 2020-06-07T20:06:03.580028 | 2019-06-21T09:17:26 | 2019-06-21T09:17:26 | 193,069,132 | 9 | 4 | null | null | null | null | UTF-8 | Java | false | false | 14,331 | java | package com.tencent.mm.plugin.appbrand.dynamic.a;
import android.content.Context;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.view.View.OnAttachStateChangeListener;
import com.tencent.luggage.g.h;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.modelappbrand.f;
import com.tencent.mm.modelappbrand.l;
import com.tencent.mm.modelappbrand.u;
import com.tencent.mm.modelappbrand.w;
import com.tencent.mm.plugin.appbrand.appcache.z;
import com.tencent.mm.plugin.appbrand.dynamic.WxaWidgetInitializer;
import com.tencent.mm.plugin.appbrand.dynamic.h.a.a;
import com.tencent.mm.plugin.appbrand.dynamic.i;
import com.tencent.mm.plugin.appbrand.dynamic.j.a.1;
import com.tencent.mm.plugin.appbrand.dynamic.widget.IPCDynamicPageView;
import com.tencent.mm.plugin.appbrand.dynamic.widget.IPCDynamicPageView.3;
import com.tencent.mm.sdk.platformtools.ak;
import com.tencent.mm.sdk.platformtools.ao;
import com.tencent.mm.sdk.platformtools.ao.c;
import java.net.URLDecoder;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
import junit.framework.Assert;
import org.json.JSONException;
import org.json.JSONObject;
public final class c
implements View.OnAttachStateChangeListener, com.tencent.mm.modelappbrand.e, a.a, ao.c
{
private String gtl;
private volatile com.tencent.mm.modelappbrand.c hmc;
private volatile b hmj;
private volatile e hmk;
private com.tencent.mm.modelappbrand.c azN()
{
AppMethodBeat.i(10749);
if (this.hmc == null);
try
{
if (this.hmc == null)
{
localObject1 = new com/tencent/mm/plugin/appbrand/dynamic/a/a;
((a)localObject1).<init>();
this.hmc = ((com.tencent.mm.modelappbrand.c)localObject1);
}
Object localObject1 = this.hmc;
AppMethodBeat.o(10749);
return localObject1;
}
finally
{
AppMethodBeat.o(10749);
}
}
public final String a(String paramString, View paramView, Bundle paramBundle, com.tencent.mm.modelappbrand.ab paramab)
{
AppMethodBeat.i(10745);
if (!(paramView instanceof IPCDynamicPageView))
{
paramView = "";
AppMethodBeat.o(10745);
return paramView;
}
Object localObject1 = com.tencent.mm.plugin.appbrand.r.n.gv(System.nanoTime());
com.tencent.mm.plugin.appbrand.collector.c.d("widget_launch", (String)localObject1, "on_bind_view", true);
com.tencent.mm.plugin.appbrand.collector.c.bE((String)localObject1, "init_finish");
IPCDynamicPageView localIPCDynamicPageView = (IPCDynamicPageView)paramView;
Object localObject2 = null;
String str1;
if (paramBundle != null)
{
str1 = paramBundle.getString("app_id");
localObject2 = paramBundle.getString("msg_id");
paramBundle.putString("__session_id", paramString);
paramBundle.putLong("__on_bind_nano_time", System.nanoTime());
paramBundle.putString("__session_id", (String)localObject1);
paramBundle.putParcelable("__cost_time_session", com.tencent.mm.plugin.appbrand.collector.c.yH((String)localObject1));
}
while (true)
{
while (true)
{
localObject1 = paramBundle.getString("wxa_unique_id");
paramView = (View)localObject1;
if (TextUtils.isEmpty((CharSequence)localObject1))
paramView = WxaWidgetInitializer.bL(str1, (String)localObject2);
localObject2 = paramBundle.getString("exec_process_name", "com.tencent.mm:support");
i.azC().bK(paramView, (String)localObject2);
u.i("MicroMsg.DynamicPageService", "onBindView(%s)", new Object[] { paramView });
com.tencent.mm.plugin.appbrand.dynamic.e.azz().b(paramView, localIPCDynamicPageView);
Object localObject4 = (String)h.bP(paramBundle.getString("msg_path", "")).get("widgetData");
if (!TextUtils.isEmpty((CharSequence)localObject4));
try
{
localObject1 = new org/json/JSONObject;
((JSONObject)localObject1).<init>(URLDecoder.decode((String)localObject4));
if ((((JSONObject)localObject1).has("render_data")) && (((JSONObject)localObject1).getJSONObject("render_data").has("actions")))
{
u.i("MicroMsg.DynamicPageService", "get render_data and begin predraw", new Object[0]);
localObject4 = ((JSONObject)localObject1).getJSONObject("render_data").getJSONArray("actions");
localObject1 = new org/json/JSONObject;
((JSONObject)localObject1).<init>();
((JSONObject)localObject1).put("actions", localObject4);
((JSONObject)localObject1).put("reserve", false);
String str2 = ((JSONObject)localObject1).toString();
((JSONObject)localObject1).put("__invoke_jsapi_timestamp", System.currentTimeMillis());
localObject4 = new com/tencent/mm/plugin/appbrand/dynamic/d/b/b;
((com.tencent.mm.plugin.appbrand.dynamic.d.b.b)localObject4).<init>();
((com.tencent.mm.plugin.appbrand.dynamic.d.b.b)localObject4).a((String)localObject2, paramView, (JSONObject)localObject1, null, null, com.tencent.mm.plugin.appbrand.dynamic.d.b.a.bb(paramView, paramBundle.getInt("draw_strategy")), str2);
com.tencent.mm.plugin.appbrand.dynamic.d.b.a.bb(paramView, paramBundle.getInt("draw_strategy")).a((com.tencent.mm.plugin.appbrand.dynamic.d.b.b)localObject4);
localObject2 = (w)paramab.px("WidgetPreDrawCallback");
if (localObject2 != null)
((w)localObject2).abM();
u.pp(paramView);
}
localIPCDynamicPageView.removeOnAttachStateChangeListener(this);
localIPCDynamicPageView.addOnAttachStateChangeListener(this);
Assert.assertNotNull(paramView);
localIPCDynamicPageView.hpr = System.currentTimeMillis();
if (paramab != null)
{
localObject2 = paramab.abN();
if ((localIPCDynamicPageView.eIq != null) && (!paramView.equals(localIPCDynamicPageView.eIq)))
localIPCDynamicPageView.cleanup();
if ((localObject2 != null) && ((!paramView.equals(localIPCDynamicPageView.eIq)) || (!localIPCDynamicPageView.hpq)))
((f)localObject2).F(localIPCDynamicPageView, 0);
localIPCDynamicPageView.hpq = false;
u.i("MicroMsg.IPCDynamicPageView", "attach (%s)", new Object[] { paramView });
IPCDynamicPageView.hlg.post(new IPCDynamicPageView.3(localIPCDynamicPageView, paramView, paramBundle, paramab, str1));
com.tencent.mm.sdk.platformtools.ab.v("MicroMsg.DynamicPageService", "onBindView(%s)", new Object[] { paramView });
paramBundle = com.tencent.mm.plugin.appbrand.dynamic.h.a.aAb();
if ((paramString != null) && (paramString.length() != 0))
break label635;
com.tencent.mm.plugin.appbrand.dynamic.h.a.aAb().c(paramString, localIPCDynamicPageView);
azN().d(paramString, localIPCDynamicPageView);
AppMethodBeat.o(10745);
}
}
catch (JSONException localJSONException)
{
while (true)
{
com.tencent.mm.sdk.platformtools.ab.printErrStackTrace("MicroMsg.DynamicPageService", localJSONException, "", new Object[0]);
continue;
Object localObject3 = null;
continue;
label635: paramBundle.hoE.put(paramString, this);
}
}
}
str1 = null;
}
}
public final void a(String paramString, View paramView)
{
AppMethodBeat.i(10746);
if (!(paramView instanceof IPCDynamicPageView))
AppMethodBeat.o(10746);
while (true)
{
return;
paramView = (IPCDynamicPageView)paramView;
com.tencent.mm.sdk.platformtools.ab.v("MicroMsg.DynamicPageService", "onUnBindView(%s)", new Object[] { paramView.getExtId() });
paramView.removeOnAttachStateChangeListener(this);
azN().e(paramString, paramView);
com.tencent.mm.plugin.appbrand.dynamic.h.a.aAb().b(paramString, paramView);
paramView.detach();
i.azC().zW(paramString);
AppMethodBeat.o(10746);
}
}
public final void a(String paramString, IPCDynamicPageView paramIPCDynamicPageView)
{
AppMethodBeat.i(10755);
com.tencent.mm.sdk.platformtools.ab.v("MicroMsg.DynamicPageService", "onOverLength(sessionId : %s, view : %s)", new Object[] { paramString, paramIPCDynamicPageView.getExtId() });
a(paramString, paramIPCDynamicPageView);
AppMethodBeat.o(10755);
}
public final com.tencent.mm.modelappbrand.d aby()
{
AppMethodBeat.i(10750);
if (this.hmj == null);
try
{
if (this.hmj == null)
{
localb = new com/tencent/mm/plugin/appbrand/dynamic/a/b;
localb.<init>(azN());
this.hmj = localb;
}
b localb = this.hmj;
AppMethodBeat.o(10750);
return localb;
}
finally
{
AppMethodBeat.o(10750);
}
}
public final l abz()
{
AppMethodBeat.i(10751);
if (this.hmk == null);
try
{
if (this.hmk == null)
{
locale = new com/tencent/mm/plugin/appbrand/dynamic/a/e;
locale.<init>();
this.hmk = locale;
}
e locale = this.hmk;
AppMethodBeat.o(10751);
return locale;
}
finally
{
AppMethodBeat.o(10751);
}
}
public final void b(String paramString, Throwable paramThrowable)
{
AppMethodBeat.i(10752);
com.tencent.mm.sdk.platformtools.ab.e("MicroMsg.DynamicPageService", "uncaughtException(%s)", new Object[] { Log.getStackTraceString(paramThrowable) });
shutdown();
AppMethodBeat.o(10752);
}
public final View bS(Context paramContext)
{
AppMethodBeat.i(10744);
paramContext = new IPCDynamicPageView(paramContext);
AppMethodBeat.o(10744);
return paramContext;
}
public final void cg(View paramView)
{
AppMethodBeat.i(10747);
if (!(paramView instanceof IPCDynamicPageView))
AppMethodBeat.o(10747);
while (true)
{
return;
((IPCDynamicPageView)paramView).nQ(2104);
AppMethodBeat.o(10747);
}
}
public final com.tencent.mm.modelappbrand.n ch(View paramView)
{
if ((paramView instanceof IPCDynamicPageView));
for (paramView = (com.tencent.mm.modelappbrand.n)paramView; ; paramView = null)
return paramView;
}
public final void initialize()
{
AppMethodBeat.i(10742);
if ((this.gtl != null) && (this.gtl.length() != 0))
shutdown();
this.gtl = ("Token#" + System.nanoTime());
ao.a(this);
z.a(new com.tencent.mm.plugin.appbrand.dynamic.b.d());
AppMethodBeat.o(10742);
}
public final void onViewAttachedToWindow(View paramView)
{
AppMethodBeat.i(10753);
if ((paramView == null) || (!(paramView instanceof IPCDynamicPageView)))
AppMethodBeat.o(10753);
while (true)
{
return;
paramView = (IPCDynamicPageView)paramView;
com.tencent.mm.sdk.platformtools.ab.d("MicroMsg.DynamicPageService", "onViewAttachedToWindow(%s)", new Object[] { paramView.getExtId() });
paramView.onResume();
AppMethodBeat.o(10753);
}
}
public final void onViewDetachedFromWindow(View paramView)
{
AppMethodBeat.i(10754);
if ((paramView == null) || (!(paramView instanceof IPCDynamicPageView)))
AppMethodBeat.o(10754);
while (true)
{
return;
paramView = (IPCDynamicPageView)paramView;
com.tencent.mm.sdk.platformtools.ab.d("MicroMsg.DynamicPageService", "onViewDetachedFromWindow(%s)", new Object[] { paramView.getExtId() });
paramView.onPause();
AppMethodBeat.o(10754);
}
}
public final void pm(String paramString)
{
AppMethodBeat.i(10748);
com.tencent.mm.plugin.appbrand.dynamic.h.a.aAb().hoD.remove(paramString);
Object localObject1 = com.tencent.mm.plugin.appbrand.dynamic.h.a.aAb();
if ((paramString == null) || (paramString.length() == 0))
{
localObject1 = azN().be(paramString);
if ((localObject1 != null) && (!((Set)localObject1).isEmpty()))
break label79;
AppMethodBeat.o(10748);
}
while (true)
{
return;
((com.tencent.mm.plugin.appbrand.dynamic.h.a)localObject1).hoE.remove(paramString);
break;
label79: localObject1 = ((Set)localObject1).iterator();
while (((Iterator)localObject1).hasNext())
{
Object localObject2 = (View)((Iterator)localObject1).next();
if ((localObject2 != null) && ((localObject2 instanceof IPCDynamicPageView)))
{
localObject2 = (IPCDynamicPageView)localObject2;
com.tencent.mm.sdk.platformtools.ab.v("MicroMsg.DynamicPageService", "onUnbindAllView, do unBindView(%s)", new Object[] { ((IPCDynamicPageView)localObject2).getExtId() });
((IPCDynamicPageView)localObject2).removeOnAttachStateChangeListener(this);
((IPCDynamicPageView)localObject2).detach();
}
}
if (azN().abx().isEmpty())
com.tencent.mm.ce.a.post(new a.1());
i.azC().zW(paramString);
AppMethodBeat.o(10748);
}
}
public final void shutdown()
{
AppMethodBeat.i(10743);
Object localObject = azN().abx();
if ((localObject == null) || (((Map)localObject).isEmpty()))
AppMethodBeat.o(10743);
while (true)
{
return;
Iterator localIterator = new LinkedHashSet(((Map)localObject).keySet()).iterator();
while (localIterator.hasNext())
{
localObject = localIterator.next();
if ((localObject != null) && ((localObject instanceof String)))
pm((String)localObject);
}
AppMethodBeat.o(10743);
}
}
}
/* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes2-dex2jar.jar
* Qualified Name: com.tencent.mm.plugin.appbrand.dynamic.a.c
* JD-Core Version: 0.6.2
*/ | [
"172601673@qq.com"
] | 172601673@qq.com |
ebac0b08c3be8aeb2f590246e2c0f26fb6f5378d | eb5578299187e48b16e19c6e217ef604c1389b79 | /java-mongodb/src/main/java/challenge/RecipeComment.java | 2a08c86b95240c087f80bd24982ea59d5dab2f5f | [] | no_license | hoytei/codenation | 493ff88224a44464de28e459c3921794dfd7ef14 | f2c720e1b2215cf339cacb5cfcd3a77708797f7c | refs/heads/master | 2020-04-20T23:22:15.857435 | 2019-02-15T01:55:22 | 2019-02-15T01:55:22 | 169,166,167 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 400 | java | package challenge;
import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;
public class RecipeComment {
@Id
private String id;
private String comment;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getComment() {
return comment;
}
public void setComment(String comment) {
this.comment = comment;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
a68fa191d589d242e31f2823d2e9338c88f1e2e5 | 7a859d65ef876fea8b9577761014e1b2e05c577f | /czb-app/src/main/java/bessant/chris/training/App.java | 1cc7e5edc170c3382a716210c4c16c6aa62d8226 | [] | no_license | chrisbessant/Just-a-test | ac519703e218969ee646072fbb4c6c965204cbf1 | 71796182b8339bd73c71f5e18b37bf815e7af73d | refs/heads/master | 2021-01-10T13:43:55.957507 | 2013-02-27T15:24:55 | 2013-02-27T15:24:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 185 | java | package bessant.chris.training;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}
| [
"chris.bessant@iop.org"
] | chris.bessant@iop.org |
7e436ecbeec9ca231872c0e1048bef70af068317 | 5af754264141edde80278e5beac885b4c53b97de | /ZadokShira/src/com/company/ReverseAlgorithm.java | f88bed9fadcc3036f626353091eccd6ba11fae11 | [] | no_license | shiraOra/ShiraZadok | e7b2f59ccd709d33579fceb8aa0aaa9ef571dffd | 057d42e08b0f26edcaf46f3e2d47378270f848b0 | refs/heads/master | 2021-01-21T10:19:02.177316 | 2017-03-27T13:08:39 | 2017-03-27T13:08:39 | 83,401,648 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 624 | java | package com.company;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
public class ReverseAlgorithm extends Algorithm {
private Algorithm algorithm;
public ReverseAlgorithm(Algorithm algorithm) {
this.algorithm = algorithm;
}
@Override
public void encrypt (InputStream inputStream, OutputStream outputStream) throws IOException {
algorithm.decrypt(inputStream,outputStream);
}
public void decrypt(InputStream inputStream, OutputStream outputStream) throws IOException {
algorithm.encrypt(inputStream,outputStream);
}
}
| [
"Shiraora10@gmail.com"
] | Shiraora10@gmail.com |
4ad31819c8c927ed9016f52bd89f6d74c1f6e5eb | ff05688835bbedd74e2f6655804a4637d3b32515 | /log-structured-storage/src/main/java/com/mastfrog/logstructured/LogStructuredAppenderImpl.java | 22ca65ae7e5bfbb69e5292211bf686fef6766869 | [] | no_license | timboudreau/util | cf2d60588368dada45731ca31ad8a98cff880289 | 0816dad90fb627e7acb7a792ba73966cc4c0a977 | refs/heads/master | 2023-08-07T13:53:35.680182 | 2023-03-26T06:17:41 | 2023-03-26T06:17:41 | 9,271,429 | 6 | 3 | null | null | null | null | UTF-8 | Java | false | false | 5,037 | java | /*
* The MIT License
*
* Copyright 2019 Mastfrog Technologies.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to useAsLong, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.mastfrog.logstructured;
import com.mastfrog.file.channels.FileChannelPool;
import com.mastfrog.file.channels.Lease;
import com.mastfrog.util.preconditions.Checks;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardOpenOption;
import java.nio.file.attribute.FileAttribute;
import java.nio.file.attribute.PosixFilePermission;
import java.nio.file.attribute.PosixFilePermissions;
import java.util.EnumSet;
import java.util.Set;
/**
*
* @author Tim Boudreau
*/
class LogStructuredAppenderImpl<T> implements LogStructuredAppender<T> {
static final FileAttribute<Set<PosixFilePermission>> ATTRS = PosixFilePermissions.asFileAttribute(
EnumSet.of(PosixFilePermission.OWNER_READ, PosixFilePermission.OWNER_WRITE));
private static final Set<StandardOpenOption> WRITE_OPTIONS
= EnumSet.of(StandardOpenOption.WRITE, StandardOpenOption.APPEND, StandardOpenOption.CREATE);
private final Path path;
private Lease appendLease;
private Runnable onWrite;
private final Serde<T> serde;
private final FileChannelPool pool;
LogStructuredAppenderImpl(Path path, Serde<T> serde, FileChannelPool pool) {
this.path = path;
this.serde = serde;
this.pool = pool;
}
@Override
public String toString() {
return path.toString();
}
@Override
public synchronized boolean isOpen() {
// return channel != null && channel.isOpen();
return appendLease != null && Files.exists(path);
}
@SuppressWarnings(value = "ThrowFromFinallyBlock")
@Override
public void onWrite(Runnable onWrite) {
Runnable old = this.onWrite;
if (old != null && !old.equals(onWrite)) {
this.onWrite = () -> {
Throwable t = null;
try {
old.run();
} catch (RuntimeException | Error e) {
t = e;
} finally {
try {
onWrite.run();
} catch (RuntimeException | Error e1) {
if (t == null) {
t = e1;
} else {
t.addSuppressed(e1);
}
} finally {
if (t != null) {
if (t instanceof RuntimeException) {
throw (RuntimeException) t;
} else {
throw (Error) t;
}
}
}
}
};
} else {
this.onWrite = onWrite;
}
}
private Lease channel() throws IOException {
assert Thread.holdsLock(this);
if (appendLease == null) {
appendLease = pool.lease(path, WRITE_OPTIONS, ATTRS);
}
return appendLease;
}
@Override
public synchronized long size() throws IOException {
if (appendLease != null) {
return appendLease.size();
}
return Files.exists(path) ? Files.size(path) : -1;
}
@Override
public synchronized T append(T env) throws IOException {
Checks.notNull("env", env);
channel().use(writeChannel -> {
serde.serialize(env, writeChannel);
if (onWrite != null) {
onWrite.run();
}
});
return env;
}
@Override
public synchronized void close() throws IOException {
if (appendLease != null && Files.exists(path)) {
appendLease.use(ch -> {
ch.force(true);
});
appendLease = null;
} else if (appendLease != null) {
appendLease = null;
}
}
}
| [
"tim@timboudreau.com"
] | tim@timboudreau.com |
0cee1152b76d8dd0e81ceb67c6fc5ae82f2796b8 | 85f19d5fb8e334e88d3dc84010808975c791c7e4 | /app/src/main/java/com/example/raghav/chefiermain/SavedDishesScreen.java | af7a77fc0a68d400342e2f98d598a3c9179e7b6b | [] | no_license | raghav020798/ChefierMain | f0478e2089eaa7fc8680889e5aff2840a55cdb60 | bfaf7e9ee20ae7ddbf3c3cca7fcdafde0e56556d | refs/heads/master | 2021-05-06T01:09:59.484197 | 2017-12-18T10:38:25 | 2017-12-18T10:38:25 | 114,406,063 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,577 | java | package com.example.raghav.chefiermain;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.widget.ListView;
import com.example.raghav.chefiermain.Adapters.SavedDishAdapter;
import com.example.raghav.chefiermain.Models.SavedDishes;
import com.google.firebase.database.ChildEventListener;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import java.util.ArrayList;
public class SavedDishesScreen extends AppCompatActivity {
private ArrayList<SavedDishes> savedDishesArrayList;
private SavedDishAdapter savedDishesAdapter;
private ListView SavedDishesListView;
FirebaseDatabase database = FirebaseDatabase.getInstance();
DatabaseReference mSavedDishesReference = database.getReference().child("Dishes");
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_saved_dishes_screen);
database = FirebaseDatabase.getInstance();
savedDishesArrayList = new ArrayList<SavedDishes>();
SavedDishesListView = (ListView) findViewById(R.id.saved_dishes_list);
savedDishesAdapter = new SavedDishAdapter(this, savedDishesArrayList);
SavedDishesListView.setAdapter(savedDishesAdapter);
mSavedDishesReference.addChildEventListener(new ChildEventListener() {
@Override
public void onChildAdded(DataSnapshot dataSnapshot, String s) {
for (DataSnapshot child : dataSnapshot.getChildren()) {
SavedDishes savedDishes = child.getValue(SavedDishes.class);
String DishName = savedDishes.getDishName();
Log.v("sddd",DishName);
savedDishesAdapter.add(savedDishes);
savedDishesAdapter.notifyDataSetChanged();
}
savedDishesAdapter.notifyDataSetChanged();
}
@Override
public void onChildChanged(DataSnapshot dataSnapshot, String s) {
}
@Override
public void onChildRemoved(DataSnapshot dataSnapshot) {
}
@Override
public void onChildMoved(DataSnapshot dataSnapshot, String s) {
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
}
}
| [
"raghavmehta22@github.com"
] | raghavmehta22@github.com |
4bfb7fae21c72cbbb4391dc07821e52ec8d29079 | 11f5c65f7a273959a7598ced359732f88c3e2370 | /app/src/main/java/com/nirbhaya/app/dagger/scope/AppScope.java | 53ed53962b3acfbd816409c42e0f657ff1e37e90 | [] | no_license | solankivinay4u/Nirbhaya | 2c151e3f05f50464f8ebbd8aa1e7f534479f8b81 | 390129133954771a90555420567ca887c12f812b | refs/heads/master | 2021-01-11T21:09:02.539271 | 2017-01-17T18:29:20 | 2017-01-17T18:29:20 | 79,256,282 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 228 | java | package com.nirbhaya.app.dagger.scope;
import java.lang.annotation.Retention;
import javax.inject.Scope;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
@Scope
@Retention(RUNTIME)
public @interface AppScope {
}
| [
"vinay@Vinaykumars-MacBook-Pro.local"
] | vinay@Vinaykumars-MacBook-Pro.local |
26a31bf694fb46e6934c25affd7fde04f137319d | ded1078979437f8bb58547b2da747aac728f2290 | /src/main/java/io/ebean/config/dbplatform/DbDefaultValue.java | 6b74f44980d5a68c9b6a5fc428bc59df6520aea6 | [
"Apache-2.0"
] | permissive | peterko2017/ebean | 1ad8286489c6824e977829567e591cfa80c16d66 | 4fb61b9bc3a9bf858809f0f00e13a3ca72f04c80 | refs/heads/master | 2022-11-28T09:02:08.189794 | 2020-08-04T22:16:23 | 2020-08-04T22:16:23 | 285,066,796 | 0 | 0 | NOASSERTION | 2020-08-04T22:16:24 | 2020-08-04T18:35:45 | null | UTF-8 | Java | false | false | 5,945 | java | package io.ebean.config.dbplatform;
import java.sql.Types;
import java.util.LinkedHashMap;
import java.util.Map;
import javax.xml.bind.DatatypeConverter;
import io.ebean.annotation.DbDefault;
/**
* DB Column default values mapping to database platform specific literals.
*/
public class DbDefaultValue {
/**
* The key for FALSE.
*/
public static final String FALSE = "false";
/**
* The key for TRUE.
*/
public static final String TRUE = "true";
/**
* The key for the NOW / current timestamp.
*/
public static final String NOW = "now";
/**
* The 'null' literal.
*/
public static final String NULL = "null";
protected final Map<String, String> map = new LinkedHashMap<>();
/**
* Set the DB now function.
*/
public void setNow(String dbFunction) {
put(NOW, dbFunction);
}
/**
* Set the DB false literal.
*/
public void setFalse(String dbFalseLiteral) {
put(FALSE, dbFalseLiteral);
}
/**
* Set the DB true literal.
*/
public void setTrue(String dbTrueLiteral) {
put(TRUE, dbTrueLiteral);
}
/**
* Add an translation entry.
*/
public void put(String dbLiteral, String dbTranslated) {
map.put(dbLiteral, dbTranslated);
}
/**
* Convert the DB default literal to platform specific type or function.
* <p>
* This is intended for the DB column default clause in DDL.
* </p>
*/
public String convert(String dbDefaultLiteral) {
if (dbDefaultLiteral == null) {
return null;
}
if (dbDefaultLiteral.startsWith("$RAW:")) {
return dbDefaultLiteral.substring(5);
}
String val = map.get(dbDefaultLiteral);
return val != null ? val : dbDefaultLiteral;
}
/**
* This method checks & convert the {@link DbDefault#value()} to a valid SQL literal.
*
* This is mainly to quote string literals and verify integer/dates for correctness.
* <p>
* Note: There are some special cases:
* </p>
* <ul>
* <li>Normal Quoting: <code>@DbDefault("User's default")</code> on a String propery
* returns: <code>default 'User''s default'</code><br/>
* (the same on an integer property will throw a NumberFormatException)</li>
* <li>Special case null: <code>@DbDefault("null")</code> will return this: <code>default null</code><br/>
* If you need really the String "null", you have to specify <code>@DbDefault("'null'")</code>
* which gives you the <code>default 'null'</code> statement.</li>
* <li>Any statement, that begins and ends with single quote will not be checked or get quoted again.</li>
* <li>A statement that begins with "$RAW:", e.g <code>@DbDefault("$RAW:N'SANDNES'")</code> will lead to
* a <code>default N'SANDNES'</code> in DDL. Note that this is platform specific!</li>
* </ul>
*/
public static String toSqlLiteral(String defaultValue, Class<?> propertyType, int sqlType) {
if (propertyType == null
|| defaultValue == null
|| NULL.equals(defaultValue)
|| (defaultValue.startsWith("'") && defaultValue.endsWith("'"))
|| (defaultValue.startsWith("$RAW:"))) {
return defaultValue;
}
if (Boolean.class.isAssignableFrom(propertyType) || Boolean.TYPE.isAssignableFrom(propertyType)) {
return toBooleanLiteral(defaultValue);
}
if (Number.class.isAssignableFrom(propertyType)
|| Byte.TYPE.equals(propertyType)
|| Short.TYPE.equals(propertyType)
|| Integer.TYPE.equals(propertyType)
|| Long.TYPE.equals(propertyType)
|| Float.TYPE.equals(propertyType)
|| Double.TYPE.equals(propertyType)
|| (propertyType.isEnum() && sqlType == Types.INTEGER)) {
Double.valueOf(defaultValue); // verify if it is a number
return defaultValue;
}
// check if it is a date/time - in all other cases return quoted defaultValue
switch (sqlType) {
// date
case Types.DATE:
return toDateLiteral(defaultValue);
// time
case Types.TIME:
case Types.TIME_WITH_TIMEZONE:
return toTimeLiteral(defaultValue);
// timestamp
case Types.TIMESTAMP:
case Types.TIMESTAMP_WITH_TIMEZONE:
return toDateTimeLiteral(defaultValue);
default:
return toTextLiteral(defaultValue); // do not check other datatypes
}
}
/**
* Checks if specified value is either 'true' or 'false'. The literal is translated later.
*/
private static String toBooleanLiteral(String value) {
if (DbDefaultValue.FALSE.equals(value) || DbDefaultValue.TRUE.equals(value)) {
return value;
}
throw new IllegalArgumentException("'" + value + "' is not a valid value for boolean");
}
/**
* This adds single qoutes around the <code>value</code> and doubles single quotes.
* "User's home" will return "'User''s home'"
*/
private static String toTextLiteral(String value) {
StringBuilder sb = new StringBuilder(value.length()+10);
sb.append('\'');
for (int i = 0; i < value.length(); i++) {
char ch = value.charAt(i);
if (ch == '\'') {
sb.append("''");
} else {
sb.append(ch);
}
}
sb.append('\'');
return sb.toString();
}
private static String toDateLiteral(String value) {
if (NOW.equals(value)) {
return value; // this will get translated later
}
DatatypeConverter.parseDate(value); // verify
return toTextLiteral(value);
}
private static String toTimeLiteral(String value) {
if (NOW.equals(value)) {
return value; // this will get translated later
}
DatatypeConverter.parseTime(value); // verify
return toTextLiteral(value);
}
private static String toDateTimeLiteral(String value) {
if (NOW.equals(value)) {
return value; // this will get translated later
}
DatatypeConverter.parseDateTime(value); // verify
return toTextLiteral(value);
}
}
| [
"robin.bygrave@gmail.com"
] | robin.bygrave@gmail.com |
efbbb29bdff1e7d32ce49c49edb9175de91884ce | 9d6a4f95ef7bb02496c19ac2a1b4ee497307dfeb | /app/src/main/java/informatika/com/augmentedrealityforhistory/fragments/ListPoi.java | f2abf51bff1acb8376176922e6c913bbf3982d48 | [] | no_license | ichwanhs96/AugmentedRealityForHistory | 24d1cf717c4412aab72692b0ed04c8e431ab9ad1 | da961173dce32d18f060bda7c6b95fc2d066f400 | refs/heads/master | 2020-04-06T07:11:05.358459 | 2016-09-09T01:34:12 | 2016-09-09T01:34:12 | 62,492,470 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,672 | java | package informatika.com.augmentedrealityforhistory.fragments;
import android.Manifest;
import android.app.ProgressDialog;
import android.content.pm.PackageManager;
import android.location.Location;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import com.android.volley.AuthFailureError;
import com.android.volley.DefaultRetryPolicy;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.Volley;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.location.LocationListener;
import com.google.android.gms.location.LocationRequest;
import com.google.android.gms.location.LocationServices;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapView;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import informatika.com.augmentedrealityforhistory.R;
import informatika.com.augmentedrealityforhistory.activities.MainMenuActivity;
import informatika.com.augmentedrealityforhistory.models.PointOfInterest;
import informatika.com.augmentedrealityforhistory.resources.ResourceClass;
import informatika.com.augmentedrealityforhistory.util.GsonRequest;
/**
* Created by USER on 8/24/2016.
*/
public class ListPoi extends Fragment implements LocationListener, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener
,OnMapReadyCallback {
private GoogleApiClient mGoogleApiClient;
private Location mLastLocation;
private LocationRequest mLocationRequest;
private RequestQueue mRequestQueue;
private GoogleMap mMap;
private List<PointOfInterest> poiArray;
private List<PointOfInterest> pois;
private ProgressDialog dialog;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fragment_listpoi, container, false);
poiArray = new ArrayList<>();
dialog = new ProgressDialog(getActivity());
dialog.setCanceledOnTouchOutside(false);
mGoogleApiClient = new GoogleApiClient.Builder(getActivity())
.addApi(LocationServices.API)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.build();
// Obtain the SupportMapFragment and get notified when the map is ready to be used.
SupportMapFragment mapFragment = (SupportMapFragment) getChildFragmentManager().findFragmentById(R.id.listPoiMap);
mapFragment.getMapAsync(this);
return v;
}
@Override
public void onConnected(@Nullable Bundle bundle) {
if (ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
// TODO: Consider calling
// ActivityCompat#requestPermissions
// here to request the missing permissions, and then overriding
// public void onRequestPermissionsResult(int requestCode, String[] permissions,
// int[] grantResults)
// to handle the case where the user grants the permission. See the documentation
// for ActivityCompat#requestPermissions for more details.
return;
}
mLastLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
if(mLastLocation != null){
ResourceClass.deviceLocation = mLastLocation;
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(
new LatLng(ResourceClass.deviceLocation.getLatitude(), ResourceClass.deviceLocation.getLongitude()), 13));
}
mLocationRequest = LocationRequest.create();
mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
mLocationRequest.setInterval(1000);
LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this);
}
@Override
public void onStart() {
mGoogleApiClient.connect();
super.onStart();
}
@Override
public void onStop() {
mGoogleApiClient.disconnect();
super.onStop();
}
@Override
public void onConnectionSuspended(int i) {
}
@Override
public void onLocationChanged(Location location) {
ResourceClass.deviceLocation = location;
}
@Override
public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {
}
@Override
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;
if (ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
// TODO: Consider calling
// ActivityCompat#requestPermissions
// here to request the missing permissions, and then overriding
// public void onRequestPermissionsResult(int requestCode, String[] permissions,
// int[] grantResults)
// to handle the case where the user grants the permission. See the documentation
// for ActivityCompat#requestPermissions for more details.
return;
}
mMap.setMyLocationEnabled(true);
loadPointOfInterests();
}
private void loadPointOfInterests(){
dialog.setMessage("Retrieving POI...");
dialog.show();
String url = ResourceClass.url+"PointOfInterests";
mRequestQueue = Volley.newRequestQueue(getActivity());
GsonRequest<PointOfInterest[]> myReq = new GsonRequest<PointOfInterest[]>(
Request.Method.GET,
url,
PointOfInterest[].class,
new com.android.volley.Response.Listener<PointOfInterest[]>() {
@Override
public void onResponse(PointOfInterest[] response) {
poiArray = Arrays.asList(response);
for(PointOfInterest result : poiArray){
LatLng loc = new LatLng(result.location.getLat(), result.location.getLng());
mMap.addMarker(new MarkerOptions().position(loc).title(result.title));
}
if (dialog.isShowing()) {
dialog.dismiss();
}
}
},
new com.android.volley.Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Toast.makeText(getActivity(), "point of interest cant be retrieved", Toast.LENGTH_SHORT).show();
System.out.println(error.getMessage());
if (dialog.isShowing()) {
dialog.dismiss();
}
((MainMenuActivity)getActivity()).goToMainFragment();
}
}
){
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
HashMap<String, String> headers = new HashMap<String, String>();
headers.put("Content-Type", "application/json");
headers.put("Authorization", ResourceClass.auth_key);
return headers;
}
};
myReq.setRetryPolicy(new DefaultRetryPolicy(5000,
DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
mRequestQueue.add(myReq);
}
}
| [
"ichwanharyosembodo96@gmail.com"
] | ichwanharyosembodo96@gmail.com |
e4e5ecfbd4d3dec5680c76f694915636d96a4e30 | a645e24accb2de939d6ec4317951c332b0c47e14 | /dubbo-common/src/main/java/com/alibaba/dubbo/common/json/GenericJSONConverter.java | 32149c97a0ab1bbf45710c298aa297e85da3c5fb | [
"LicenseRef-scancode-unknown-license-reference",
"GPL-1.0-or-later",
"GPL-2.0-only",
"Apache-2.0"
] | permissive | dengbq/dubbox | a0168c71c33215bd790b67e23b20a1db9205a471 | badea7dee9db560de96f3809fcf20848991347b0 | refs/heads/master | 2020-04-11T21:54:25.716489 | 2019-02-11T08:39:24 | 2019-02-11T08:39:24 | 162,118,936 | 1 | 0 | Apache-2.0 | 2018-12-17T11:16:21 | 2018-12-17T11:16:21 | null | UTF-8 | Java | false | false | 11,995 | java | /*
* Copyright 1999-2011 Alibaba Group.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alibaba.dubbo.common.json;
import java.io.IOException;
import java.lang.reflect.Array;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
import com.alibaba.dubbo.common.bytecode.Wrapper;
import com.alibaba.dubbo.common.io.Bytes;
public class GenericJSONConverter implements JSONConverter
{
private static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
protected interface Encoder{ void encode(Object obj, JSONWriter jb) throws IOException; }
protected interface Decoder{ Object decode(Object jv) throws IOException; }
private static final Map<Class<?>, Encoder> GlobalEncoderMap = new HashMap<Class<?>, Encoder>();
private static final Map<Class<?>, Decoder> GlobalDecoderMap = new HashMap<Class<?>, Decoder>();
@SuppressWarnings("unchecked")
public void writeValue(Object obj, JSONWriter jb, boolean writeClass) throws IOException
{
if (obj == null) {
jb.valueNull();
return;
}
Class<?> c = obj.getClass();
Encoder encoder = GlobalEncoderMap.get(c);
if( encoder != null )
{
encoder.encode(obj, jb);
}
else if( obj instanceof JSONNode )
{
((JSONNode)obj).writeJSON(this, jb, writeClass);
}
else if( c.isEnum() )
{
jb.valueString(((Enum<?>)obj).name());
}
else if( c.isArray() )
{
int len = Array.getLength(obj);
jb.arrayBegin();
for(int i=0;i<len;i++)
writeValue(Array.get(obj, i), jb, writeClass);
jb.arrayEnd();
}
else if( Map.class.isAssignableFrom(c) )
{
Object key, value;
jb.objectBegin();
for( Map.Entry<Object, Object> entry : ((Map<Object, Object>)obj).entrySet() )
{
key = entry.getKey();
if( key == null )
continue;
jb.objectItem(key.toString());
value = entry.getValue();
if( value == null )
jb.valueNull();
else
writeValue(value, jb, writeClass);
}
jb.objectEnd();
}
else if( Collection.class.isAssignableFrom(c) )
{
jb.arrayBegin();
for( Object item : (Collection<Object>)obj )
{
if( item == null )
jb.valueNull();
else
writeValue(item, jb, writeClass);
}
jb.arrayEnd();
}
else
{
jb.objectBegin();
Wrapper w = Wrapper.getWrapper(c);
String pns[] = w.getPropertyNames();
for( String pn : pns )
{
if ((obj instanceof Throwable) && (
"localizedMessage".equals(pn)
|| "cause".equals(pn)
|| "stackTrace".equals(pn))) {
continue;
}
jb.objectItem(pn);
Object value = w.getPropertyValue(obj,pn);
if( value == null || value == obj)
jb.valueNull();
else
writeValue(value, jb, writeClass);
}
if (writeClass) {
jb.objectItem(JSONVisitor.CLASS_PROPERTY);
writeValue(obj.getClass().getName(), jb, writeClass);
}
jb.objectEnd();
}
}
@SuppressWarnings({ "unchecked", "rawtypes" })
public Object readValue(Class<?> c, Object jv) throws IOException
{
if (jv == null) {
return null;
}
Decoder decoder = GlobalDecoderMap.get(c);
if( decoder != null ) {
return decoder.decode(jv);
}
if (c.isEnum()) {
return Enum.valueOf((Class<Enum>)c, String.valueOf(jv));
}
return jv;
}
static
{
// init encoder map.
Encoder e = new Encoder(){
public void encode(Object obj, JSONWriter jb) throws IOException
{
jb.valueBoolean((Boolean)obj);
}
};
GlobalEncoderMap.put(boolean.class, e);
GlobalEncoderMap.put(Boolean.class, e);
e = new Encoder(){
public void encode(Object obj, JSONWriter jb) throws IOException
{
jb.valueInt(((Number)obj).intValue());
}
};
GlobalEncoderMap.put(int.class, e);
GlobalEncoderMap.put(Integer.class, e);
GlobalEncoderMap.put(short.class, e);
GlobalEncoderMap.put(Short.class, e);
GlobalEncoderMap.put(byte.class, e);
GlobalEncoderMap.put(Byte.class, e);
GlobalEncoderMap.put(AtomicInteger.class, e);
e = new Encoder(){
public void encode(Object obj, JSONWriter jb) throws IOException
{
jb.valueString(Character.toString((Character)obj));
}
};
GlobalEncoderMap.put(char.class, e);
GlobalEncoderMap.put(Character.class, e);
e = new Encoder(){
public void encode(Object obj, JSONWriter jb) throws IOException
{
jb.valueLong(((Number)obj).longValue());
}
};
GlobalEncoderMap.put(long.class, e);
GlobalEncoderMap.put(Long.class, e);
GlobalEncoderMap.put(AtomicLong.class, e);
GlobalEncoderMap.put(BigInteger.class, e);
e = new Encoder(){
public void encode(Object obj, JSONWriter jb) throws IOException
{
jb.valueFloat(((Number)obj).floatValue());
}
};
GlobalEncoderMap.put(float.class, e);
GlobalEncoderMap.put(Float.class, e);
e = new Encoder(){
public void encode(Object obj, JSONWriter jb) throws IOException
{
jb.valueDouble(((Number)obj).doubleValue());
}
};
GlobalEncoderMap.put(double.class, e);
GlobalEncoderMap.put(Double.class, e);
GlobalEncoderMap.put(BigDecimal.class, e);
e = new Encoder(){
public void encode(Object obj, JSONWriter jb) throws IOException
{
jb.valueString(obj.toString());
}
};
GlobalEncoderMap.put(String.class, e);
GlobalEncoderMap.put(StringBuilder.class, e);
GlobalEncoderMap.put(StringBuffer.class, e);
e = new Encoder(){
public void encode(Object obj, JSONWriter jb) throws IOException
{
jb.valueString(Bytes.bytes2base64((byte[])obj));
}
};
GlobalEncoderMap.put(byte[].class, e);
e = new Encoder(){
public void encode(Object obj, JSONWriter jb) throws IOException
{
jb.valueString(new SimpleDateFormat(DATE_FORMAT).format((Date)obj));
}
};
GlobalEncoderMap.put(Date.class, e);
// init decoder map.
Decoder d = new Decoder(){
public Object decode(Object jv){
return jv.toString();
}
};
GlobalDecoderMap.put(String.class, d);
d = new Decoder(){
public Object decode(Object jv)
{
if( jv instanceof Boolean ) return ((Boolean)jv).booleanValue();
return false;
}
};
GlobalDecoderMap.put(boolean.class, d);
d = new Decoder(){
public Object decode(Object jv)
{
if( jv instanceof Boolean ) return (Boolean)jv;
return (Boolean)null;
}
};
GlobalDecoderMap.put(Boolean.class, d);
d = new Decoder(){
public Object decode(Object jv)
{
if( jv instanceof String && ((String)jv).length() > 0) return ((String)jv).charAt(0);
return (char)0;
}
};
GlobalDecoderMap.put(char.class, d);
d = new Decoder(){
public Object decode(Object jv)
{
if( jv instanceof String && ((String)jv).length() > 0) return ((String)jv).charAt(0);
return (Character)null;
}
};
GlobalDecoderMap.put(Character.class, d);
d = new Decoder(){
public Object decode(Object jv)
{
if( jv instanceof Number ) return ((Number)jv).intValue();
return 0;
}
};
GlobalDecoderMap.put(int.class, d);
d = new Decoder(){
public Object decode(Object jv)
{
if( jv instanceof Number ) return Integer.valueOf(((Number)jv).intValue());
return (Integer)null;
}
};
GlobalDecoderMap.put(Integer.class, d);
d = new Decoder(){
public Object decode(Object jv)
{
if( jv instanceof Number ) return ((Number)jv).shortValue();
return (short)0;
}
};
GlobalDecoderMap.put(short.class, d);
d = new Decoder(){
public Object decode(Object jv)
{
if( jv instanceof Number ) return Short.valueOf(((Number)jv).shortValue());
return (Short)null;
}
};
GlobalDecoderMap.put(Short.class, d);
d = new Decoder(){
public Object decode(Object jv)
{
if( jv instanceof Number ) return ((Number)jv).longValue();
return (long)0;
}
};
GlobalDecoderMap.put(long.class, d);
d = new Decoder(){
public Object decode(Object jv)
{
if( jv instanceof Number ) return Long.valueOf(((Number)jv).longValue());
return (Long)null;
}
};
GlobalDecoderMap.put(Long.class, d);
d = new Decoder(){
public Object decode(Object jv)
{
if( jv instanceof Number ) return ((Number)jv).floatValue();
return (float)0;
}
};
GlobalDecoderMap.put(float.class, d);
d = new Decoder(){
public Object decode(Object jv)
{
if( jv instanceof Number ) return new Float(((Number)jv).floatValue());
return (Float)null;
}
};
GlobalDecoderMap.put(Float.class, d);
d = new Decoder(){
public Object decode(Object jv)
{
if( jv instanceof Number ) return ((Number)jv).doubleValue();
return (double)0;
}
};
GlobalDecoderMap.put(double.class, d);
d = new Decoder(){
public Object decode(Object jv)
{
if( jv instanceof Number ) return new Double(((Number)jv).doubleValue());
return (Double)null;
}
};
GlobalDecoderMap.put(Double.class, d);
d = new Decoder(){
public Object decode(Object jv)
{
if( jv instanceof Number ) return ((Number)jv).byteValue();
return (byte)0;
}
};
GlobalDecoderMap.put(byte.class, d);
d = new Decoder(){
public Object decode(Object jv)
{
if( jv instanceof Number ) return Byte.valueOf(((Number)jv).byteValue());
return (Byte)null;
}
};
GlobalDecoderMap.put(Byte.class, d);
d = new Decoder(){
public Object decode(Object jv) throws IOException
{
if( jv instanceof String ) return Bytes.base642bytes((String)jv);
return (byte[])null;
}
};
GlobalDecoderMap.put(byte[].class, d);
d = new Decoder(){
public Object decode(Object jv) throws IOException{ return new StringBuilder(jv.toString()); }
};
GlobalDecoderMap.put(StringBuilder.class, d);
d = new Decoder(){
public Object decode(Object jv) throws IOException{ return new StringBuffer(jv.toString()); }
};
GlobalDecoderMap.put(StringBuffer.class, d);
d = new Decoder(){
public Object decode(Object jv) throws IOException
{
if( jv instanceof Number ) return BigInteger.valueOf(((Number)jv).longValue());
return (BigInteger)null;
}
};
GlobalDecoderMap.put(BigInteger.class, d);
d = new Decoder(){
public Object decode(Object jv) throws IOException
{
if( jv instanceof Number ) return BigDecimal.valueOf(((Number)jv).doubleValue());
return (BigDecimal)null;
}
};
GlobalDecoderMap.put(BigDecimal.class, d);
d = new Decoder(){
public Object decode(Object jv) throws IOException
{
if( jv instanceof Number ) return new AtomicInteger(((Number)jv).intValue());
return (AtomicInteger)null;
}
};
GlobalDecoderMap.put(AtomicInteger.class, d);
d = new Decoder(){
public Object decode(Object jv) throws IOException
{
if( jv instanceof Number ) return new AtomicLong(((Number)jv).longValue());
return (AtomicLong)null;
}
};
GlobalDecoderMap.put(AtomicLong.class, d);
d = new Decoder(){
public Object decode(Object jv) throws IOException
{
if( jv instanceof String ) {
try {
return new SimpleDateFormat(DATE_FORMAT).parse((String) jv);
} catch (ParseException e) {
throw new IllegalArgumentException(e.getMessage(), e);
}
}
if( jv instanceof Number )
return new Date(((Number)jv).longValue());
return (Date)null;
}
};
GlobalDecoderMap.put(Date.class, d);
}
} | [
"ding.lid@1a56cb94-b969-4eaa-88fa-be21384802f2"
] | ding.lid@1a56cb94-b969-4eaa-88fa-be21384802f2 |
d8e518edaffade6ad48f4e55926bd31020d86d6a | ad35f700cad595c4aadbf074af14c866237fd2b2 | /src/main/java/com/github/weChart/service/UserService.java | f6e3a2f0ae44c43b39d0237c028388ac7e6284be | [] | no_license | Senvirtual/weChart | b716bcc26f676459430e702c7650b8b562624589 | 70ff1910230a5a0e5d543c6eb430862a0b866a52 | refs/heads/master | 2021-01-23T22:30:22.269729 | 2017-09-09T08:07:04 | 2017-09-09T08:07:04 | 102,936,822 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,230 | java | package com.github.weChart.service;
import com.github.weChart.mapper.UserMapper;
import com.github.weChart.model.User;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Created by chenkaihua on 15-9-15.
*/
@Service
public class UserService {
@Autowired
UserMapper userMapper;
@RequiresRoles("admin")
public void deleteWithAdminRoleById(int id){
userMapper.deleteByPrimaryKey(id);
}
public User getUserById(int id){
return userMapper.selectByPrimaryKey(id);
}
public boolean isExist(User user){
System.out.println(user.toString());
return userMapper.selectCount(user)>0;
}
public void addUser(User user){
userMapper.insert(user);
}
public List<User> getUsers(User user){
if (user == null) {
return userMapper.selectAll();
}
return userMapper.select(user);
}
public void deleteById(int id){
userMapper.deleteByPrimaryKey(id);
}
public void update(User user){
userMapper.updateByPrimaryKey(user);
}
}
| [
"cwbqwert@foxmail.com"
] | cwbqwert@foxmail.com |
b8f3fbd078179c5d1bd0a2b77ac4d91a7e87103a | 05a69b3aa76790205950c7731034bcb1eb5539fb | /app/src/main/java/com/ejb/uplus/contract/UserProfileContract.java | 268877c31f3ee8786388ba79cc8950c5599ac068 | [] | no_license | yansenkeler/uplus | c5c70a34a0ab5ed11dca7a243fdfef06a502f915 | 49a848b2e0ef7223a9a422f472f8b03d4d632284 | refs/heads/master | 2020-07-29T08:31:36.604072 | 2016-11-24T06:42:28 | 2016-11-24T06:42:28 | 73,677,424 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 957 | java | package com.ejb.uplus.contract;
import com.cl.core.MVPFrame.BaseView;
/**
* Created by John on 10/26/2016.
*/
public class UserProfileContract
{
public interface IView extends BaseView
{
void initViews();
void initConfigs();
void setListeners();
void initPage();
void logout();
void openCamera();
void openAlbum();
void openSexSelectDialog();
void openCityPicker(int p, int c, int d);
void closeCityPicker();
void setCityBtn(String text);
boolean isCityPickerShown();
String getSexText();
void setMaleIcon(int res);
void setFemaleIcon(int res);
}
public interface IPresenter
{
void getUserProfile();
void onDestroy();
void dealSexSelectBtnClick();
void dealCitySelectBtnClick();
void dealCitySelected(String t1, String t2, String t3, int i1, int i2, int i3);
}
}
| [
"qianyuxinjustone@gmail.com"
] | qianyuxinjustone@gmail.com |
e27fe3955f469e68a0a02afde7df104939e91099 | 6c1ddcdfe9f5c707cb80e62fe514b15ffc09609c | /main/java/main/Interaccion.java | ff9424e9bfc202b4b8126bd6bec100c1c137369d | [] | no_license | Llorens92/AccesoDatos-Prac1 | 343bcb9fbca04c21cf4b34989e647e397c1b16d3 | 4a28001f4e77003b619d404c3c75ab4ac148f860 | refs/heads/master | 2020-05-23T06:23:38.449360 | 2016-10-27T10:29:49 | 2016-10-27T10:29:49 | 70,234,378 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,596 | java | package main;
import java.util.Scanner;
import ClasesPrincipales.Cafes;
public class Interaccion {
public static void Ver(Cafes miCafe){
System.out.println("Los datos de todos los cafes son:");
miCafe.verTabla();
}
public static void Buscar(Cafes miCafe){
Scanner lc = new Scanner(System.in);
System.out.println("Introduzca el nombre del café cuyos datos desea consultar:");
miCafe.BuscarCafe(lc.next());
}
public static void Insertar (Cafes miCafe){
Scanner lc = new Scanner(System.in);
System.out.println("Introduzca el nombre del café cuyos datos desea insertar:");
String nom = lc.next();
System.out.println("Introduzca el Id del café cuyos datos desea insertar:");
int id = lc.nextInt();
System.out.println("Introduzca el precio del café cuyos datos desea insertar:");
float precio = lc.nextFloat();
System.out.println("Introduzca las ventas del café cuyos datos desea insertar:");
int ventas = lc.nextInt();
System.out.println("Introduzca el total del café cuyos datos desea insertar:");
int total = lc.nextInt();
miCafe.InsertarCafe(nom, id, precio, ventas, total);
}
public static void Borrar(Cafes miCafe){
Scanner lc = new Scanner(System.in);
System.out.println("Introduzca el nombre del café cuyos datos desea borrar:");
miCafe.BorrarCafe(lc.next());
}
public static void BuscarDatosProv(Cafes miCafe){
Scanner lc = new Scanner(System.in);
System.out.println("Introduzca el id del proveedor cuyos datos desea consultar:");
miCafe.cafesProveedor(lc.nextInt());
}
}
| [
"noreply@github.com"
] | noreply@github.com |
8842e8b6a3f5c51bbf8fd8527797906b17d4dcaf | 069db98b04c2c2b306ca6d0911ecfaa9d3484291 | /chis/src/main/java/chis/source/conf/TumourHighRiskConfigManageService.java | 2711092e454f9df07e7d3fc8965a73a6f20c2eb4 | [] | no_license | zhouhui521/his | 59270696d3667c8c6eb8f7104af0a9501a90942a | 8d26b62e73d6ec95111eff66ab9d7aee61674f73 | refs/heads/master | 2023-02-03T16:20:57.561243 | 2020-12-24T06:33:46 | 2020-12-24T06:33:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,834 | java | /**
* @(#)TumourHighRiskConfigManageService.java Created on 2014-4-10 下午5:13:40
*
* 版权:版权所有 bsoft 保留所有权力。
*/
package chis.source.conf;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import ctd.service.core.ServiceException;
import ctd.util.context.Context;
import ctd.util.exp.ExpException;
import chis.source.BaseDAO;
import chis.source.dic.BusinessType;
import chis.source.service.AbstractActionService;
import chis.source.service.DAOSupportable;
import chis.source.service.ServiceCode;
import chis.source.util.CNDHelper;
import chis.source.util.SchemaUtil;
import chis.source.visitplan.CreateVisitPlanException;
import chis.source.visitplan.PlanInstance;
import chis.source.visitplan.VisitPlanModel;
/**
* @description
*
* @author <a href="mailto:chenxr@bsoft.com.cn">ChenXianRui</a>
*/
public class TumourHighRiskConfigManageService extends AbstractActionService
implements DAOSupportable {
private static Logger logger = LoggerFactory
.getLogger(TumourHighRiskConfigManageService.class);
// 肿瘤高危人群随访有效时间范围
public static final String THR_START_MONTH = "tumourHighRiskStartMonth";
public static final String THR_END_MONTH = "tumourHighRiskEndMonth";
/**
* @Description:保存肿瘤高危人群随访计划生成配置参数
* @param req
* @param res
* @param dao
* @param ctx
* @throws ServiceException
* @author ChenXianRui 2014-4-11 上午9:55:01
* @Modify:
*/
@SuppressWarnings("unchecked")
public void doSaveConfig(Map<String, Object> req, Map<String, Object> res,
BaseDAO dao, Context ctx) throws ServiceException {
HashMap<String, Object> body = (HashMap<String, Object>) req
.get("body");
if (body == null || body.size() < 1) {
logger.error("body is missing!");
res.put(RES_CODE, ServiceCode.CODE_INVALID_REQUEST);
res.put(RES_MESSAGE, "请求数据丢失!");
return;
}
Map<String, Object> formBody = (HashMap<String, Object>) body
.get("form");
ArrayList<Map<String, Object>> gridBody = (ArrayList<Map<String, Object>>) body
.get("grid");
SystemCofigManageModel smm = new SystemCofigManageModel(dao);
try {
// 保存配置文件信息
Map<String, Object> map = new HashMap<String, Object>();
map.put(BusinessType.THR+"_planMode", formBody.get("planMode"));
map.put(THR_START_MONTH, StringUtils.trimToEmpty((String) formBody
.get("startMonth")));
map.put(THR_END_MONTH,
StringUtils.trimToEmpty((String) formBody.get("endMonth")));
map.put(BusinessType.THR + "_precedeDays",
formBody.get("precedeDays"));
map.put(BusinessType.THR + "_delayDays", formBody.get("delayDays"));
smm.saveSystemConfigData(map);
// 保存随访计划配置前,将旧计划删除
VisitPlanModel vpm = new VisitPlanModel(dao);
vpm.deletePlanInstanceByInstanceType(BusinessType.THR);
// 保存随访计划配置
for (int i = 0; i < gridBody.size(); i++) {
Map<String, Object> planBody = (HashMap<String, Object>) gridBody
.get(i);
Object group = planBody.get("group");
Object tumourType = planBody.get("tumourType");
if (group != null && tumourType != null) {
if (!StringUtils.isEmpty(group.toString())) {
String expression = "['and',['eq', ['s', 'group'], ['s', '"
+ group
+ "']],['eq',['s','tumourType'],['s','"
+ tumourType + "']]]";
planBody.put("expression", expression);
}
}
planBody.put("instanceType", BusinessType.THR);
vpm.savePlanInstanceRecord("create", planBody);
}
} catch (Exception e) {
logger.error(
"Failed to delete the old plan type records OR save new plan type records for tumour !",
e);
throw new ServiceException(e);
}
}
/**
*
* @Description:获取配置文件中配置的参数
* @param req
* @param res
* @param dao
* @param ctx
* @throws ServiceException
* @author ChenXianRui 2014-4-11 上午10:43:26
* @Modify:
*/
public void doQueryFormConfig(Map<String, Object> req, Map<String, Object> res,
BaseDAO dao, Context ctx) throws ServiceException {
SystemCofigManageModel smm = new SystemCofigManageModel(dao);
// 读取配置文件年度开始月份和年度结束月份信息
Map<String, Object> body = null;
try {
Map<String, String> configMap = new HashMap<String, String>();
configMap.put(THR_START_MONTH, "startMonth");
configMap.put(THR_END_MONTH, "endMonth");
configMap.put(BusinessType.THR + "_precedeDays", "precedeDays");
configMap.put(BusinessType.THR + "_delayDays", "delayDays");
configMap.put(BusinessType.THR + "_planMode", "planMode");
body = smm.getSystemConfigData(configMap);
res.put("body", smm.makeFormResBody(body, ADMIN_TumourHighRiskConfig));
} catch (Exception e) {
logger.error("failed to get tumour hight risk parameter of config!", e);
throw new ServiceException(e);
}
}
/**
*
* @Description:
* 从数据中记录的计划生成方案表达式中解析出计划生成方案配置
* @param req
* @param res
* @param dao
* @param ctx
* @throws ServiceException
* @author ChenXianRui 2014-4-11 上午10:46:42
* @Modify:
*/
public void doQueryListConfig(Map<String, Object> req,
Map<String, Object> res, BaseDAO dao, Context ctx)
throws ServiceException {
VisitPlanModel vpm = new VisitPlanModel(dao);
List<PlanInstance> list = null;
try {
list = vpm.getPlanInstanceExpressions(BusinessType.THR, ctx);
} catch (CreateVisitPlanException e) {
logger.error("Failed to get tumour high risk plan instance records!", e);
throw new ServiceException(e);
}
ArrayList<Map<String, Object>> abody = new ArrayList<Map<String, Object>>();
for (int i = 0; i < list.size(); i++) {
PlanInstance inst = list.get(i);
String expression = inst.getExpression();
Map<String, Object> result = new HashMap<String, Object>();
if (!StringUtils.isEmpty(expression)) {
try {
List<?> cnd = CNDHelper.toListCnd(expression);
List<?> start = (List<?>) cnd.get(1);
if (start.size() > 2) {
List<?> ge = (List<?>) start.get(2);
Object group = ge.get(1);
result.put("group", group);
}
List<?> end = (List<?>) cnd.get(2);
if (end.size() > 2) {
List<?> lt = (List<?>) end.get(2);
Object tumourType = lt.get(1);
result.put("tumourType", tumourType);
}
} catch (ExpException e) {
e.printStackTrace();
}
}
result.put("instanceType", inst.getInstanceType());
result.put("planTypeCode", inst.getPlanTypeCode());
abody.add(SchemaUtil.setDictionaryMessageForList(result,
ADMIN_TumourHighRiskConfigDetail));
}
res.put("body", abody);
}
}
| [
"renw1@bsoft.com.cn"
] | renw1@bsoft.com.cn |
2d0eb84aca1dbb5fdf5e82f76552653587ba8ec8 | 2edd3eeef5584721a767e5da192b09dc5419d1cd | /src/_runner/DaoRegionRunner.java | 018d22dac96174926899235f460846b4537dccaf | [] | no_license | sokhoda/TaskProj | f31cacdd550d8471fb7780dcb9f8b2edc114f486 | ea13d7f6a9b2a0796d0fab1e57160832b04fbb41 | refs/heads/master | 2021-01-19T03:24:35.768209 | 2016-08-11T20:51:00 | 2016-08-11T20:51:00 | 65,468,560 | 0 | 0 | null | null | null | null | WINDOWS-1251 | Java | false | false | 787 | java | package _runner;
import interfaces.dao.IRegionDao;
import bean.Region;
import dao.factory.MySqlDaoFactory;
public class DaoRegionRunner {
public static void main(String[] args) {
Region reg = new Region(65L, 36L, "Волинська", "ferf");
// BaseDaoFactory baseFactory =
// DaoFactory.getFactory(DriverTypes.MYSQL);
// IAgentDao agentDao = baseFactory.getAgentDao();
IRegionDao rgDao = MySqlDaoFactory.getRegionDao();
// System.out.println(rgDao.create(reg));
System.out.println(rgDao.read(190));
// rgDao.update(reg);
// rgDao.delete(reg);
System.out.println(rgDao.findAll());
System.out.println(rgDao.findByNamePattern("%ськ%"));
System.out.println(rgDao.findByName("Полтавська"));
System.out.println(rgDao.findByCountryId(37L));
}
}
| [
"oleksandr.khodakovskyi@gmail.com"
] | oleksandr.khodakovskyi@gmail.com |
065ccae3c1b5d49d10bf6c7f055896478bcec24d | 3ae7de34a857911a829cb102a64013c2eec355ba | /src/test/java/com/lazerycode/selenium/page_objects/CreateNewTodoPageObject.java | 0a86c7b0152fa6a738b435816df66cec6e249283 | [] | no_license | gevorgmushyan/Workfront-automation | d9566263bae9a6fedefee7ffbb96ebe601abc335 | 6c61b7a25af7cba612689b73131c2ef695f9d146 | refs/heads/master | 2020-05-05T10:54:00.578916 | 2019-04-07T12:54:00 | 2019-04-07T12:54:00 | 179,966,004 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,081 | java | package com.lazerycode.selenium.page_objects;
import com.lazerycode.selenium.entities.Priority;
import com.lazerycode.selenium.entities.ToDoItem;
import com.lazerycode.selenium.util.Query;
import org.openqa.selenium.By;
import org.openqa.selenium.support.ui.Select;
import static com.lazerycode.selenium.DriverBase.getDriver;
import static com.lazerycode.selenium.util.AssignDriver.initQueryObjects;
public class CreateNewTodoPageObject {
private Query titleInput = new Query().defaultLocator(By.id("title"));
private Query dateInput = new Query().defaultLocator(By.id("dueDate"));
private Query prioritySelect = new Query().defaultLocator(By.id("priority"));
private Query createButton = new Query().defaultLocator(By.cssSelector("#createTodoForm button.btn.btn-primary"));
private Query cancelButton = new Query().defaultLocator(By.cssSelector("#createTodoForm button:nth-child(2)"));
public CreateNewTodoPageObject() throws Exception {
initQueryObjects(this, getDriver());
}
public void setTitle(String title) {
titleInput.findWebElement().clear();
titleInput.findWebElement().sendKeys(title);
}
public void setDate(String date) throws Exception {
getDriver().executeScript("arguments[0].value = '" + date + "'",
dateInput.findWebElement());
}
public void setPriority(Priority priority) {
Select select = new Select(prioritySelect.findWebElement());
select.selectByValue(priority.name());
}
public void clickOnCreateButton() {
createButton.findWebElement().click();
}
public void clickOnCancelButton() {
cancelButton.findWebElement().click();
}
public ToDoItem createTodo(ToDoItem item) throws Exception {
setTitle(item.getTitle());
setDate(item.getDate());
setPriority(item.getPriority());
clickOnCreateButton();
return item;
}
public ToDoItem createTodo() throws Exception{
ToDoItem item = ToDoItem.getToDoItem();
return createTodo(item);
}
}
| [
"gevorg.stdev@gmail.com"
] | gevorg.stdev@gmail.com |
90d56f351acfc725c3d7a9b4356ca98030dd53b2 | b19674396d9a96c7fd7abdcfa423fe9fea4bb5be | /ratis-proto-shaded/src/main/java/org/apache/ratis/shaded/io/netty/handler/codec/http/websocketx/extensions/compression/package-info.java | 0a7a4e96777d9650d73a1ae9cff2821a80de1a95 | [] | no_license | snemuri/ratis.github.io | 0529ceed6f86ad916fbc559576b39ae123c465a0 | 85e1dd1890477d4069052358ed0b163c3e23db76 | refs/heads/master | 2020-03-24T07:18:03.130700 | 2018-07-27T13:29:06 | 2018-07-27T13:29:06 | 142,558,496 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,449 | java | /*
* Copyright 2014 The Netty Project
*
* The Netty Project licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
/**
* Encoder, decoder, handshakers to handle most common WebSocket Compression Extensions.
* <p>
* This package supports different web socket extensions.
* The specification currently supported are:
* <ul>
* <li><a href="http://tools.ietf.org/html/draft-ietf-hybi-permessage-compression-18">permessage-deflate</a></li>
* <li><a href="https://tools.ietf.org/id/draft-tyoshino-hybi-websocket-perframe-deflate-06.txt">
* perframe-deflate and x-webkit-deflate-frame</a></li>
* </ul>
* </p>
* <p>
* See <tt>org.apache.ratis.shaded.io.netty.example.http.websocketx.client.WebSocketClient</tt> and
* <tt>org.apache.ratis.shaded.io.netty.example.http.websocketx.html5.WebSocketServer</tt> for usage.
* </p>
*/
package org.apache.ratis.shaded.io.netty.handler.codec.http.websocketx.extensions.compression;
| [
"snemuri@hortonworks.com"
] | snemuri@hortonworks.com |
83343ba1634eb7d03ee170a0c08aefe89a5d2b6d | b4fe16e97653b8e4ee4c5f0922565ede2986c776 | /src/firstproject/Computer.java | a16a3b352b11995a1a2c0fdf5de0a95939f65a0c | [] | no_license | asianshohrat/Java | 11edb63cd0bf98a0c34013b0b3b386627dca44e6 | c794ff9902d4def7ad87a90b2803960f49af0383 | refs/heads/master | 2021-01-02T17:21:13.334195 | 2020-04-28T01:26:52 | 2020-04-28T01:26:52 | 239,719,398 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 904 | java | package firstproject;
import java.util.Scanner;
public class Computer {
public static void main(String[] args) {
Scanner scanner=new Scanner(System.in);
System.out.print("Member?(Y/N) : ");
String member = scanner.next();
if(member.compareToIgnoreCase("Y")==0) {
System.out.print("size? (S/M/L) : ");
}
// else if (member.compareToIgnoreCase("N")==0){
// System.out.println("Sorry we can not sell you");
// }
String size = scanner.next();
if(size.equals("S")){
System.out.println("$9.99");
}
else if(size.equals("M")) {
System.out.println("$10.99");
}
else if(size.compareToIgnoreCase("L")==0){
System.out.println("$11.99");
}
else {
System.out.println("Sorry only S/M/L");
}
}
}
| [
"asianshohrat@gmail.com"
] | asianshohrat@gmail.com |
0fc0f4b3065f9ebdcd51cec9489a1a589f298ebc | 04855758ed1d9cab7c7335225662c799340477a0 | /service/service_acl/src/main/java/com/gtguigu/aclservice/mapper/UserRoleMapper.java | ca01f50db2efa6f8e554a6ad4abbafb3bf2edae2 | [] | no_license | Afeiaa/guli_parent | 71913f1cd08dd7620cc21b19575609bf3cd02bef | 5239d886dff1de3d55e676dc2931d512c4e08e45 | refs/heads/master | 2023-09-06T04:23:38.939587 | 2021-11-25T09:57:49 | 2021-11-25T09:57:49 | 422,574,510 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 263 | java | package com.gtguigu.aclservice.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gtguigu.aclservice.entity.UserRole;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface UserRoleMapper extends BaseMapper<UserRole> {
}
| [
"wangruofei@eccom.com.cn"
] | wangruofei@eccom.com.cn |
8fb655426810072d77a8be9f4e6f1a8770cbb8d8 | 97faab88539c707483d7de5aaedbf7e1a551889e | /src/com/algoexpert/LongestCommonSubsequence.java | 36db985dd9ca51bf56bb3eb28d67afb2aa38f0b7 | [] | no_license | syedirfan33/ProblemSolving | 83cf047c1f08ed089553401e61561e7e560e4712 | 07f0e565f3f6d39d10d3464f2aafe5b6de6bc3e5 | refs/heads/master | 2023-08-15T12:53:53.922113 | 2021-09-25T04:04:26 | 2021-09-25T04:04:26 | 261,063,747 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,426 | java | package com.algoexpert;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class LongestCommonSubsequence {
public static List<Character> longestCommonSubsequence(String str1, String str2) {
int[][] dp = new int[str1.length() + 1][str2.length() + 1];
for (int i = 1; i < dp.length; i++) {
for (int j = 1; j < dp[0].length; j++) {
if (str1.charAt(i - 1) == str2.charAt(j - 1)) dp[i][j] = 1 + dp[i - 1][j - 1];
else dp[i][j] = Math.max(dp[i - 1][j], dp[i][j - 1]);
}
}
System.out.println(Arrays.deepToString(dp));
return buildRes(dp, str1, str2);
}
private static List<Character> buildRes(int[][] dp, String str1, String str2) {
List<Character> res = new ArrayList<>();
int i = dp.length - 1;
int j = dp[0].length - 1;
while (i != 0 && j != 0) {
// This means we have came from left, do go to left
if (dp[i][j] == dp[i][j - 1]) {
j--;
// THis means that we have came from top, go to top
} else if (dp[i][j] == dp[i - 1][j]) {
i--;
// Else we have came from diagonal, including current char
} else {
res.add(0, str1.charAt(i - 1));
i--;
j--;
}
}
return res;
}
}
| [
"syed.irfan@maybank.com"
] | syed.irfan@maybank.com |
213b0be66261df1ee42e6f191322082f64acb4a6 | 56b07f88505a364ab717a3c0c9d161162cf8381f | /zuul/src/main/java/com/wei/zuul/ZuulApplication.java | 8e3e33ee14037f0d27cb22b559f0a0622c888b6d | [] | no_license | skyemin/shop | 8c1b1cf5afe34893afb25d81e8249e0af5d753ac | 5636eef09be06321d6908f837376aa8afc1f2ffe | refs/heads/master | 2022-06-25T12:49:51.697053 | 2021-03-25T09:12:15 | 2021-03-25T09:12:15 | 188,152,460 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,167 | java | package com.wei.zuul;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.oauth2.client.EnableOAuth2Sso;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
@SpringBootApplication
@EnableDiscoveryClient
@EnableZuulProxy
@EnableOAuth2Sso
public class ZuulApplication extends WebSecurityConfigurerAdapter {
public static void main(String[] args) {
SpringApplication.run(ZuulApplication.class, args);
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.antMatchers("/login", "/user/**")
.permitAll()
.anyRequest()
.authenticated()
.and()
.csrf()
.disable();
}
}
| [
"1515054372@qq.com"
] | 1515054372@qq.com |
cd5617c1c5d62ef42e76623a37cb2bb4e7bb8cbf | 4b2b6fe260ba39f684f496992513cb8bc07dfcbc | /com/planet_ink/coffee_mud/Commands/AutoMelee.java | c450def948dbf48193cc5ce2f43e60dc9d6f9c57 | [
"Apache-2.0"
] | permissive | vjanmey/EpicMudfia | ceb26feeac6f5b3eb48670f81ea43d8648314851 | 63c65489c673f4f8337484ea2e6ebfc11a09364c | refs/heads/master | 2021-01-18T20:12:08.160733 | 2014-06-22T04:38:14 | 2014-06-22T04:38:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,442 | java | package com.planet_ink.coffee_mud.Commands;
import com.planet_ink.coffee_mud.core.interfaces.*;
import com.planet_ink.coffee_mud.core.*;
import com.planet_ink.coffee_mud.core.collections.*;
import com.planet_ink.coffee_mud.Abilities.interfaces.*;
import com.planet_ink.coffee_mud.Areas.interfaces.*;
import com.planet_ink.coffee_mud.Behaviors.interfaces.*;
import com.planet_ink.coffee_mud.CharClasses.interfaces.*;
import com.planet_ink.coffee_mud.Commands.interfaces.*;
import com.planet_ink.coffee_mud.Common.interfaces.*;
import com.planet_ink.coffee_mud.Exits.interfaces.*;
import com.planet_ink.coffee_mud.Items.interfaces.*;
import com.planet_ink.coffee_mud.Locales.interfaces.*;
import com.planet_ink.coffee_mud.MOBS.interfaces.*;
import com.planet_ink.coffee_mud.Races.interfaces.*;
import java.util.*;
/*
Copyright 2000-2014 Bo Zimmerman
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.
*/
@SuppressWarnings("rawtypes")
public class AutoMelee extends StdCommand
{
public AutoMelee(){}
private final String[] access=_i(new String[]{"AUTOMELEE"});
@Override public String[] getAccessWords(){return access;}
@Override
public boolean execute(MOB mob, Vector commands, int metaFlags)
throws java.io.IOException
{
if(!CMath.bset(mob.getBitmap(),MOB.ATT_AUTOMELEE))
{
mob.setBitmap(CMath.setb(mob.getBitmap(),MOB.ATT_AUTOMELEE));
mob.tell(_("Automelee has been turned off. You will no longer charge into melee combat from a ranged position."));
if(mob.isMonster())
CMLib.commands().postSay(mob,null,_("I will no longer charge into melee."),false,false);
}
else
{
mob.setBitmap(CMath.unsetb(mob.getBitmap(),MOB.ATT_AUTOMELEE));
mob.tell(_("Automelee has been turned back on. You will now enter melee combat normally."));
if(mob.isMonster())
CMLib.commands().postSay(mob,null,_("I will now enter melee combat normally."),false,false);
}
return false;
}
@Override public boolean canBeOrdered(){return true;}
}
| [
"vjanmey@gmail.com"
] | vjanmey@gmail.com |
a65ff8467f43f65606b986c56f5100aad7ee8ba4 | a0730c40258091b42d3379a48ffb91de96798ca3 | /Algorithm_Java/src/main/java/author/hyun/sik/lim/sw/expert/academy/Q10033_not/Solution.java | 19f8d00ddb6d728075a1e3a23191dd3b2ead5b4f | [] | no_license | BerkleyLim/Basic_Algorithm | 9a8c4a9e9ca2d7a934a9621dbddb56f378281014 | 573d9331a69d0b5d8d042deee287f8a878ccb08a | refs/heads/master | 2023-08-27T04:35:41.315986 | 2021-10-21T14:29:02 | 2021-10-21T14:29:02 | 153,599,863 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,847 | java | package author.hyun.sik.lim.sw.expert.academy.Q10033_not;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
// 카드 뒤집기
// N 개의 카드가 이렬로 놓여 있고
// 앞면 : 검은색(B), 뒷면 : 흰색(W)
// N개의 문자열 S로 표현 가능
// S의 왼쪽에서부터 i번째 글자는 카드 덱에서 왼쪽에서부터 i번째에 있는 카드의 윗면의 색
// 연산 과정 - 0회 이상 반복 가능
// 1) 왼쪽 부터 i번째 카드는 윗면 : 검은색, i+1번째 카드는 윗면이 흰색이 되도록 하는 정수 i (1 ~ N-1) 고름
// 만일 i가 존재하지 않을 시 연산 수행 불가
// 2) 왼쪽에서부터 i번째 카드와 i+1번째 카드를 뒤집음, 왼쪽에서부터 i번째 카드는 윗면이 흰색, i+1번째 카드는 윗면이 검은색
// 전제 조건 : 문자열 길이 200,000 이내
//
public class Solution {
static int indexB;
public static void main(String args[]) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine());
int T = Integer.parseInt(st.nextToken());
for(int test_case = 1; test_case <= T; test_case++) {
String str = init(br);
System.out.println("#" + test_case + " " + solution(str));
}
br.close();
}
private static int solution(String str) {
// TODO Auto-generated method stub
indexB = str.indexOf("B");
//System.out.println(indexB);
if (indexB < 0)
return 0;
int count = 0;
int Bcount = 1;
int N = str.length();
String token = str.substring(indexB, N);
// 여기서는 B가 몇개이고 W가 몇개이며 B와 W의 갯수 지정
// B 갯수만큼 카운터를 센다
// 이유는 : WWBBBBWWWWWBWBW 라고 주어질 경우를 생각한다.
/*
wwbbbwbwwwwwwwbwb - 3
wwbbwbwbwwwwwwwbb - 6
wwbwbwbwbwwwwwwbb - 9
wwwbwbwbwbwwwwwbb - 13
wwwwbwbwbwbwwwwbb - 17
wwwwwbwbwbwbwwwbb - 21
wwwwwwbwbwbwbwwbb - 25
wwwwwwwbwbwbwbwbb - 29
wwwwwwwwbwbwbwbbb - 33
wwwwwwwwwbwbwbbbb - 36
wwwwwwwwwwbwbbbbb - 38
wwwwwwwwwwwbbbbbb - 39
* */
for (int i = 1; i < token.length(); i++) {
if (token.substring(i,i+1).equals("B")) {
Bcount++;
} else {
count += Bcount;
}
}
return count;
}
private static String init(BufferedReader br) throws Exception {
// TODO Auto-generated method stub
String str = br.readLine();
return str;
}
}
| [
"berkleylim16@gmail.com"
] | berkleylim16@gmail.com |
14c730d1ac5c0de6b316a978c6cc9be2846264a4 | 7bcce18f12d83e20997a4a9fcbab55d203b76c31 | /Leap year check.java | 70f24eb63ec9f8f2b38e76dac1fcddf5d7b242d8 | [] | no_license | ThamizhPrabhakaran/Java-Programs | d6d9009481ea18dbe38936a99e319919ace354de | 3ed0ef3b63642ec087fda1c4419cee6e9b5ff132 | refs/heads/master | 2021-05-18T02:49:11.279041 | 2020-07-14T14:28:04 | 2020-07-14T14:28:04 | 251,071,726 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 370 | java | import java.util.Scanner;
public class LeapYear {
public static void main(String[] args) {
Scanner in = new Scanner (System.in);
System.out.print("Enter the year: ");
int n = in.nextInt();
if(((n%4)==0)&&((n%100)!=0)||((n%400)==0)) {
System.out.print(n+" is a leap year");
}else{
System.out.print(n+" is not a leap year");
}
}
}
| [
"noreply@github.com"
] | noreply@github.com |
0d0bb061cbda12cbcda5bc234488ef14600cf35c | 31e1042f6d1bf1096699a1ee3bde7fd2edcbe247 | /src/day05/LoopNesting.java | 3acf89d04fb4555dde2686fde15ad1b11a63b4ae | [] | no_license | yn0315/java_basic | dd72f5ece10296d2ef7312e4c5dc85fd197382b1 | 1f2cbfb28ab7e816e91f98751042f30da8e8cfed | refs/heads/master | 2023-08-19T16:45:28.353630 | 2021-09-23T02:53:02 | 2021-09-23T02:53:02 | 389,817,979 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 619 | java | package day05;
public class LoopNesting {
public static void main(String[] args) {
//중첩반복문
for (int i = 0; i < 3; i++) {
System.out.println("outer" + i);
for (int j = 0; j < 2; j++) {
System.out.println("inner" + j);
for (int k = 0; k < 4; k++) {
System.out.println("inner_" + k);
}
System.out.println("-------------------------");
}//end inner for
System.out.println("==========================");
}//end outer for
}//end main
}//end class
| [
"yunu0315@naver.com"
] | yunu0315@naver.com |
9f465e5185c2447e5124139caa96826d57db584f | 791fed31d1745b773428c7614f35b29e29b5e5b2 | /1.JavaSyntax/src/com/codegym/task/task07/task0705/Solution.java | f9e904890f9f6bf039daf6fa2573661b654736d1 | [] | no_license | dasra-iscteiulpt/CodeGym | 7914bd3e0ef86dd3d6c32f99dc007bc3587639d5 | d3d74db6322ea63fb20ecf371afa434465fc1f4e | refs/heads/master | 2022-11-18T09:29:25.639448 | 2020-03-10T11:04:36 | 2020-03-10T11:04:36 | 243,569,037 | 0 | 1 | null | 2022-11-16T09:23:26 | 2020-02-27T16:56:51 | Java | UTF-8 | Java | false | false | 790 | java | package com.codegym.task.task07.task0705;
import java.io.BufferedReader;
import java.io.InputStreamReader;
/*
One large array and two small ones
*/
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int [] array=new int[20];
for(int i=0; i<20;i++){
int s = Integer.parseInt(br.readLine());
array[i]=s;
}
int [] array2=new int[10];
int [] array3=new int[10];
for(int i=0; i<10;i++){
array2[i]=array[i];
}
for(int i=10; i<20;i++){
array3[i-10]=array[i];
}
for(int i=0; i<10;i++){
System.out.println(array3[i]);
}
}
}
| [
"dasra@iscte-iul.pt"
] | dasra@iscte-iul.pt |
1e2abdbe858e4c697bc256c746c2ca215aedf216 | b5810512bd805065f8371ace6167462a968aaf9c | /src/main/java/com/icarodebarros/cursomc/services/exceptions/AuthorizationException.java | 3f426266725c98a5324c38f8fe0e913e83e877b2 | [] | no_license | icarodebarros/cursomc | abd55c2c1e3b55d042973e67ff0040a0d2277c09 | 1e4922c0b09dc0cd2d0281bbab15df8efb59ee77 | refs/heads/master | 2022-08-11T09:28:54.984302 | 2021-05-01T00:08:42 | 2021-05-01T00:08:42 | 238,082,964 | 0 | 0 | null | 2022-07-15T21:07:44 | 2020-02-03T23:24:15 | Java | UTF-8 | Java | false | false | 325 | java | package com.icarodebarros.cursomc.services.exceptions;
public class AuthorizationException extends RuntimeException {
private static final long serialVersionUID = 1L;
public AuthorizationException(String msg) {
super(msg);
}
public AuthorizationException(String msg, Throwable cause) {
super(msg, cause);
}
}
| [
"icarodebarros@gmail.com"
] | icarodebarros@gmail.com |
33004a95946365cda227aa7007a3aef735697faa | 438f0c2beb39bdf49aeae38475b9d18dfa2e1202 | /hibernate2/src/com/model/BuyerBuyProductId.java | b73caa8a3b02e9c191157e4ca42e72e6d864fe98 | [] | no_license | ShiboTanany/NetbeansTask | d0d7c67235c6d55ae3bd1587491631407a52d201 | b5d9e5e125285457113c9b6184b0746e3e994446 | refs/heads/master | 2021-01-19T14:13:41.331876 | 2017-04-13T08:07:01 | 2017-04-13T08:07:01 | 88,139,231 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,331 | java | package com.model;
// Generated Mar 21, 2017 3:29:37 PM by Hibernate Tools 4.3.1
/**
* BuyerBuyProductId generated by hbm2java
*/
public class BuyerBuyProductId implements java.io.Serializable {
private int buyerId;
private int productId;
public BuyerBuyProductId() {
}
public BuyerBuyProductId(int buyerId, int productId) {
this.buyerId = buyerId;
this.productId = productId;
}
public int getBuyerId() {
return this.buyerId;
}
public void setBuyerId(int buyerId) {
this.buyerId = buyerId;
}
public int getProductId() {
return this.productId;
}
public void setProductId(int productId) {
this.productId = productId;
}
public boolean equals(Object other) {
if ( (this == other ) ) return true;
if ( (other == null ) ) return false;
if ( !(other instanceof BuyerBuyProductId) ) return false;
BuyerBuyProductId castOther = ( BuyerBuyProductId ) other;
return (this.getBuyerId()==castOther.getBuyerId())
&& (this.getProductId()==castOther.getProductId());
}
public int hashCode() {
int result = 17;
result = 37 * result + this.getBuyerId();
result = 37 * result + this.getProductId();
return result;
}
}
| [
"shaaban.altanany@gmail.com"
] | shaaban.altanany@gmail.com |
d4f41afe62ae2bfaccaad1cdd14cdc76abbf3345 | 3c70f00063b2c683faba74f4cf3578f0030962e1 | /my_taotao_manager/my_taotao_manager_interface/src/main/java/com/taotao/my/manager/service/ItemService.java | ba07c008ede6332e483899c9541e2066974c905e | [] | no_license | loseyou1306/taotao | a5cd481e431fc05e93bbf881c95ed048a9cbd9f2 | 63875ce2ada5654dc02bf56c06a82137b75b4b80 | refs/heads/master | 2021-01-11T17:00:44.204100 | 2018-01-11T02:44:16 | 2018-01-11T02:44:16 | 68,824,902 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 429 | java | package com.taotao.my.manager.service;
import com.taotao.my.manager.domain.TbItem;
import com.taotao.my.manager.domain.TbItemDesc;
import com.taotao.my.manager.utils.ResultList;
import com.taotao.my.manager.utils.TaotaoResult;
public interface ItemService {
TbItem findIbitemById(Long id);
ResultList findIbItemByPage(Integer page,Integer rows);
TaotaoResult saveItemAndDesc(TbItem item,TbItemDesc desc);
}
| [
"1411889141@qq.com"
] | 1411889141@qq.com |
c984c86b2cdb1d986351324afd513ba5f17c6c79 | ae5eb1a38b4d22c82dfd67c86db73592094edc4b | /project140/src/test/java/org/gradle/test/performance/largejavamultiproject/project140/p701/Test14021.java | b84ae790115188c795ca0dbaa113754421131654 | [] | no_license | big-guy/largeJavaMultiProject | 405cc7f55301e1fd87cee5878a165ec5d4a071aa | 1cd6a3f9c59e9b13dffa35ad27d911114f253c33 | refs/heads/main | 2023-03-17T10:59:53.226128 | 2021-03-04T01:01:39 | 2021-03-04T01:01:39 | 344,307,977 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,112 | java | package org.gradle.test.performance.largejavamultiproject.project140.p701;
import org.junit.Test;
import static org.junit.Assert.*;
public class Test14021 {
Production14021 objectUnderTest = new Production14021();
@Test
public void testProperty0() {
String value = "value";
objectUnderTest.setProperty0(value);
assertEquals(value, objectUnderTest.getProperty0());
}
@Test
public void testProperty1() {
String value = "value";
objectUnderTest.setProperty1(value);
assertEquals(value, objectUnderTest.getProperty1());
}
@Test
public void testProperty2() {
String value = "value";
objectUnderTest.setProperty2(value);
assertEquals(value, objectUnderTest.getProperty2());
}
@Test
public void testProperty3() {
String value = "value";
objectUnderTest.setProperty3(value);
assertEquals(value, objectUnderTest.getProperty3());
}
@Test
public void testProperty4() {
String value = "value";
objectUnderTest.setProperty4(value);
assertEquals(value, objectUnderTest.getProperty4());
}
@Test
public void testProperty5() {
String value = "value";
objectUnderTest.setProperty5(value);
assertEquals(value, objectUnderTest.getProperty5());
}
@Test
public void testProperty6() {
String value = "value";
objectUnderTest.setProperty6(value);
assertEquals(value, objectUnderTest.getProperty6());
}
@Test
public void testProperty7() {
String value = "value";
objectUnderTest.setProperty7(value);
assertEquals(value, objectUnderTest.getProperty7());
}
@Test
public void testProperty8() {
String value = "value";
objectUnderTest.setProperty8(value);
assertEquals(value, objectUnderTest.getProperty8());
}
@Test
public void testProperty9() {
String value = "value";
objectUnderTest.setProperty9(value);
assertEquals(value, objectUnderTest.getProperty9());
}
} | [
"sterling.greene@gmail.com"
] | sterling.greene@gmail.com |
d0e9aeed329ea79467d688b4bccb9763d1501c96 | 69311ed74923aaa73393289bbdbe2e00f10a0034 | /src/main/java/com/mjj/travelling/service/TeamPostService.java | 4c1a853e035eea10792f6e6ee087b7db78f801ed | [] | no_license | majj1995/HaiJiao_Backend | a1487a111e0f6d4e1d8dcd353369fd46bf28b17d | 529bc466a3ecdc96feaaee254d0b92c03ecd1108 | refs/heads/master | 2020-04-20T15:16:03.482691 | 2019-02-03T08:17:37 | 2019-02-03T08:17:37 | 168,923,538 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 522 | java | package com.mjj.travelling.service;
import com.mjj.travelling.model.TeamPost;
import com.mjj.travelling.service.VO.TeamPostVO;
import org.springframework.data.domain.Page;
public interface TeamPostService {
TeamPost save(TeamPost teamPost);
void delete(Integer teamPostId);
Page<TeamPost> load(Integer page);
Page<TeamPost> load(Integer page, Integer size);
TeamPostVO loadByTeamPostId(Integer teamPostId);
void incLikesNum(Integer teamPostId);
void decLikesNum(Integer teamPostId);
}
| [
"595641927@qq.com"
] | 595641927@qq.com |
611421785855c7d54bd4dbb8384bec01a6681597 | aac41c61d99123acdd0950e1678f378f689c3441 | /src/main/java/com/example/springmvcstarter/SpringMvcStarterApplication.java | 9002115747886ef15f728eab94dc9dbde2b317d9 | [] | no_license | pelepelin/spring-mvc-starter | 59614aef8af73fde6a6e3cbac9cd9e8bba40b886 | e1022d78025d1bd67c211555e5aace96740d7f7f | refs/heads/master | 2021-06-09T01:25:57.130139 | 2018-06-17T12:18:28 | 2018-06-17T12:18:28 | 137,792,298 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 352 | java | package com.example.springmvcstarter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class SpringMvcStarterApplication {
public static void main(String[] args) {
SpringApplication.run(SpringMvcStarterApplication.class, args);
}
}
| [
"Konstantin.Pelepelin@gmail.com"
] | Konstantin.Pelepelin@gmail.com |
8e7a11a1c1d0c4530c366616b38a1fac0fa88373 | 2fba0e08a0da7f4ea5ee5bec0be12a8de2ed51e3 | /app/src/main/java/cn/garymb/ygomobile/core/images/ImageLoadManager.java | 752a13d2fcb038198956eb75515a2f2a125bbcba | [] | no_license | TheOnePharaoh/YGOPro-for-New-Master-Rule | 1610a4a31248e56a4b5e4ad92335883843e18476 | 98fd86990ed4c962f53752c5e4dafbe738fcb3d6 | refs/heads/master | 2021-01-21T18:42:48.613223 | 2017-05-18T05:06:36 | 2017-05-18T05:06:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,827 | java | package cn.garymb.ygomobile.core.loader;
import android.graphics.Bitmap;
import android.os.Handler;
import android.os.Handler.Callback;
import android.os.Message;
import java.io.File;
import java.util.Iterator;
import java.util.LinkedList;
import cn.garymb.ygomobile.StaticApplication;
import cn.garymb.ygomobile.common.Constants;
import cn.garymb.ygomobile.model.data.ImageItem;
import cn.garymb.ygomobile.model.data.ImageItemInfoHelper;
import cn.garymb.ygomobile.utils.BitmapLruCache;
import cn.garymb.ygomobile.utils.BitmapUtils;
import cn.garymb.ygomobile.utils.LruCache;
public class ImageLoadManager implements Callback {
class ImageLoadThreadImpl extends Thread {
@Override
public void run() {
while (true) {
BitmapHolder holder = null;
synchronized (mSyncObject) {
if (!mLoadQueue.isEmpty()) {
holder = mLoadQueue.removeFirst();
} else if (!mPreLoadQueue.isEmpty()) {
holder = mPreLoadQueue.removeFirst();
} else {
try {
mSyncObject.wait();
} catch (InterruptedException e) {
continue;
}
}
} // end of synchronized (mSyncObject)
if (holder != null) {
// TODO load bitmap
final ImageItem item = holder.getImageItem();
final String path = ImageItemInfoHelper.getImagePath(item);
Bitmap bmp = null;
int[] resolution = new int[]{item.width, item.height};
bmp = BitmapUtils.createNewBitmapAndCompressByFile(
path, resolution, true);
if (bmp == null) {
File zipfile = new File(StaticApplication.get().getResourcePath(), Constants.CORE_PICS_ZIP);
if (zipfile.exists()) {
bmp = BitmapUtils.getBitmap(zipfile, item.id, item.width, item.height);
}
}
if (bmp != null) {
holder.setBitmap(bmp);
if (holder.getImageType() == Constants.IMAGE_TYPE_ORIGINAL) {
mOriginalCache.put(item.id, bmp);
} else {
mThumnailCache.put(item.id, bmp);
}
}
if (holder.isBitmapLoaded()) {
synchronized (mSyncObject) {
mLoadedQueue.add(holder);
}
mHandler.sendEmptyMessage(MSG_LOADED);
}
}
}
}
}
final static int MAX_THUMNAIL_BMP_CACHE_SIZE = 60;
final static int MAX_ORIGINAL_BMP_CACHE_SIZE = 20;
final static int MAX_LOAD_QUEUE_SIZE = 30;
final static int MAX_PRELOAD_QUEUE_SIZE = 20;
final static int MAX_ORIGINAL_BMP_CACHE_BYTES_SIZE = 8 * 1024 * 1024;
LruCache<String, Bitmap> mThumnailCache = new BitmapLruCache<String>(
MAX_THUMNAIL_BMP_CACHE_SIZE, 0);
LruCache<String, Bitmap> mOriginalCache = new BitmapLruCache<String>(
MAX_ORIGINAL_BMP_CACHE_SIZE, MAX_ORIGINAL_BMP_CACHE_BYTES_SIZE);
LinkedList<BitmapHolder> mLoadQueue = new LinkedList<BitmapHolder>();
LinkedList<BitmapHolder> mPreLoadQueue = new LinkedList<BitmapHolder>();
LinkedList<BitmapHolder> mLoadedQueue = new LinkedList<BitmapHolder>();
private ImageLoadThreadImpl mThread = null;
private Object mSyncObject = new Object();
final static int MSG_LOADED = 0;
private Handler mHandler = new Handler(this);
private ImageLoadedCallback mCallback;
public void setImageLoadedCallback(ImageLoadedCallback callback) {
mCallback = callback;
}
/**
* Try to get bitmap from local cache.
*
* @param holder
* @return bitmap object if hit cache, null otherwise.
*/
public Bitmap getBitmap(BitmapHolder holder) {
if (holder == null)
return null;
ImageItem item = holder.getImageItem();
if (item == null)
return null;
if (holder.getImageType() == Constants.IMAGE_TYPE_ORIGINAL)
return mOriginalCache.get(item.id);
else
return mThumnailCache.get(item.id);
}
/**
* Try to reove bitmap from local cache.
*
* @param id
* @return bitmap object if hit cache, null otherwise.
*/
public void removeBitmap(String id, int type) {
if (id == null)
return;
if (type == Constants.IMAGE_TYPE_ORIGINAL)
mOriginalCache.remove(id);
else
mThumnailCache.get(id);
}
/**
* 添加一个加载Bitmap的任务
*
* @param holder
* @param isPreload 标示是否是预加载任务
*/
public void addLoadTask(BitmapHolder holder, boolean isPreload) {
synchronized (mSyncObject) {
if (isPreload)
mPreLoadQueue.addFirst(holder);
else
mLoadQueue.addFirst(holder);
if (mThread == null) {
mThread = new ImageLoadThreadImpl();
mThread.start();
} else {
mSyncObject.notify();
}
}
}
private void onBitmapLoaded() {
synchronized (mSyncObject) {
Iterator<BitmapHolder> it = mLoadedQueue.iterator();
while (it.hasNext()) {
BitmapHolder holder = it.next();
if (mCallback != null)
mCallback.onImageLoaded(holder);
}
mLoadedQueue.clear();
}
}
public void onDestroy() {
synchronized (mSyncObject) {
mLoadQueue.clear();
mPreLoadQueue.clear();
mLoadedQueue.clear();
mThumnailCache.evictAll();
mOriginalCache.evictAll();
}
}
@Override
public boolean handleMessage(Message msg) {
switch (msg.what) {
case MSG_LOADED:
onBitmapLoaded();
break;
}
return false;
}
/**
* 清除指定的Bitmap缓存
*
* @param type {@code IMAGE_TYPE_ORIGINAL} or {@code IMAGE_TYPE_THUMNAIL}
*/
public void resetCache(int type) {
if (Constants.IMAGE_TYPE_ORIGINAL == type) {
mOriginalCache.evictAll();
} else if (Constants.IMAGE_TYPE_THUMNAIL == type) {
mThumnailCache.evictAll();
}
}
/**
* 改变加载队列的优先级,将预加载队列提升为加载队列或加载队列降级为预加载队列。
*
* @param type {@code LOAD_TYPE_LOAD} or {@code LOAD_TYPE_PRELOAD}
*/
public void changeLoadPriority(int type) {
synchronized (mSyncObject) {
if (Constants.BITMAP_LOAD_TYPE_LOAD == type
&& !mLoadQueue.isEmpty()) {
mPreLoadQueue.addAll(0, mLoadQueue);
mLoadQueue.clear();
// 控制预加载队列长度
while (mPreLoadQueue.size() > MAX_PRELOAD_QUEUE_SIZE)
mPreLoadQueue.removeLast();
} else if (Constants.BITMAP_LOAD_TYPE_PRELOAD == type
&& !mPreLoadQueue.isEmpty()) {
mLoadQueue.addAll(0, mPreLoadQueue);
mPreLoadQueue.clear();
// 控制加载队列长度
while (mLoadQueue.size() > MAX_LOAD_QUEUE_SIZE)
mLoadQueue.removeLast();
}
}
}
}
| [
"247321453@qq.com"
] | 247321453@qq.com |
7ebcdd66f505c1530303eb2e645ea952a66e05cb | a8dcd63b5482cab31cfe80523cd9b13507e9af1f | /src/main/java/com/hxm/netty/selfHandler/server/Server.java | a0c60c2f8c0f9974c51723706d73e504b4ae93dc | [] | no_license | z596593851/io | 137fa7c19730289d45517f6e7ef174cadc1c5feb | 73bb3601e96b04a3c001d689bb51399dc9de71f1 | refs/heads/master | 2022-06-14T06:00:01.199308 | 2021-03-29T13:51:03 | 2021-03-29T13:51:03 | 172,219,447 | 1 | 0 | null | 2022-05-25T06:27:36 | 2019-02-23T13:47:50 | Java | UTF-8 | Java | false | false | 1,543 | java | package com.hxm.netty.selfHandler.server;
import com.hxm.netty.selfHandler.common.codc.RequestDecoder;
import com.hxm.netty.selfHandler.common.codc.ResponseEncoder;
import org.jboss.netty.bootstrap.ServerBootstrap;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelPipelineFactory;
import org.jboss.netty.channel.Channels;
import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory;
import java.net.InetSocketAddress;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/**
* netty服务端入门
* @author -琴兽-
*
*/
public class Server {
public static void main(String[] args) {
//服务类
ServerBootstrap bootstrap = new ServerBootstrap();
//boss线程监听端口,worker线程负责数据读写
ExecutorService boss = Executors.newCachedThreadPool();
ExecutorService worker = Executors.newCachedThreadPool();
//设置niosocket工厂
bootstrap.setFactory(new NioServerSocketChannelFactory(boss, worker));
//设置管道的工厂
bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
@Override
public ChannelPipeline getPipeline() throws Exception {
ChannelPipeline pipeline = Channels.pipeline();
pipeline.addLast("decoder", new RequestDecoder());
pipeline.addLast("encoder", new ResponseEncoder());
pipeline.addLast("helloHandler", new HelloHandler());
return pipeline;
}
});
bootstrap.bind(new InetSocketAddress(10101));
System.out.println("start!!!");
}
}
| [
"596593851@qq.com"
] | 596593851@qq.com |
3572c7ab0dc902baa0b86e67638867139a8b0d9e | daf12c5d021aeefb553e99335e6e070f15ff99a9 | /src/web/CheckUsernameServlet.java | fb79b044d3bb2d26eea316e011c81dc0f7e98c3f | [] | no_license | zhangyp8/shop | b735a91c668ab53d1d5a7768c32a386d76504742 | c358c9dfb6b6231246b336a3756acb69f39372f2 | refs/heads/master | 2020-04-27T13:08:04.987779 | 2019-03-07T14:17:28 | 2019-03-07T14:17:28 | 174,357,295 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,103 | java | package web;
import java.io.IOException;
import java.sql.SQLException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import service.UserService;
public class CheckUsernameServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
public CheckUsernameServlet() {
super();
// TODO Auto-generated constructor stub
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String username = request.getParameter("username");
UserService service = new UserService();
boolean isExsit = false;
try {
isExsit = service.checkUsername(username);
} catch (SQLException e) {
e.printStackTrace();
}
response.getWriter().write("{\"isExist\":"+isExsit+"}");
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
doGet(request, response);
}
}
| [
"zhangyp7@yonyou.com"
] | zhangyp7@yonyou.com |
aeda3e64da6d282c261833061031930920f77a9b | c1a1173fb118ac282b2b2ec1fbb0cd6befb47e67 | /gen/org/intellij/jflex/psi/JFlexOption.java | a29fb434dbb123a6c4e5e63b3f2abfeff524c997 | [
"Apache-2.0"
] | permissive | antontuzov/Grammar-Kit | 236d92fd0e4c66a566e17ca9a25d19d6e0c861ef | 63d3880d65af37edac54e4e539f0c4ed9bceb252 | refs/heads/master | 2022-06-24T23:23:28.512208 | 2020-05-08T21:45:18 | 2020-05-08T21:45:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 785 | java | /*
* Copyright 2011-present Greg Shrago
*
* 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.intellij.jflex.psi;
import java.util.List;
import org.jetbrains.annotations.*;
import com.intellij.psi.PsiElement;
public interface JFlexOption extends JFlexComposite {
}
| [
"gregory.shrago@jetbrains.com"
] | gregory.shrago@jetbrains.com |
8e684bf73820490aedb71ddc24d2d562777eee6b | aae268ff91ebf03c86a9c4f7020529aafa846c15 | /app/src/main/java/com/example/sanchez/webservices_02/Principal.java | d147f30cba5065810c0451f28db079561de50f68 | [] | no_license | alberto017/WebServices_02 | 71782d07ad7bcf19a235d618fb4df03a5fdc29f6 | 127a633558773095e305235c39e7d0629c7e1e75 | refs/heads/master | 2022-09-29T23:37:31.181574 | 2020-06-07T04:54:38 | 2020-06-07T04:54:38 | 267,773,212 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,894 | java | package com.example.sanchez.webservices_02;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.design.widget.NavigationView;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.FrameLayout;
import com.example.sanchez.webservices_02.fragments.ConsultaCompletaFragment;
import com.example.sanchez.webservices_02.fragments.ConsultaIndividualFragment;
import com.example.sanchez.webservices_02.fragments.RegistrarFragment;
public class Principal extends AppCompatActivity
implements NavigationView.OnNavigationItemSelectedListener {
private FrameLayout flPrincipal;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_principal);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
drawer.addDrawerListener(toggle);
toggle.syncState();
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
navigationView.setNavigationItemSelectedListener(this);
flPrincipal = findViewById(R.id.flPrincipal);
setFragment(new ConsultaIndividualFragment());
}//onCreate
@Override
public void onBackPressed() {
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
if (drawer.isDrawerOpen(GravityCompat.START)) {
drawer.closeDrawer(GravityCompat.START);
} else {
super.onBackPressed();
}//else
}//onBackPressed
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.principal, menu);
return true;
}//onCreateOptionsMenu
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}//if
return super.onOptionsItemSelected(item);
}//onOptionsItemSelected
@SuppressWarnings("StatementWithEmptyBody")
@Override
public boolean onNavigationItemSelected(MenuItem item) {
// Handle navigation view item clicks here.
int id = item.getItemId();
if (id == R.id.nav_inicio) {
setFragment(new ConsultaCompletaFragment());
} else if (id == R.id.nav_registrar) {
setFragment(new RegistrarFragment());
} else if (id == R.id.nav_lista) {
setFragment(new ConsultaIndividualFragment());
}//else
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
drawer.closeDrawer(GravityCompat.START);
return true;
}//onNAvigtionOptinSelected
public void setFragment(Fragment fragment){
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
fragmentTransaction.replace(flPrincipal.getId(),fragment);
fragmentTransaction.commit();
}//setFragment
}//Principal
| [
"xavihdz09@gmail.com"
] | xavihdz09@gmail.com |
06b43f8dd98f5c2f44dd3d66ed9088130705e7e2 | 065c1f648e8dd061a20147ff9c0dbb6b5bc8b9be | /eclipsejdt_cluster/25809/tar_1.java | 2ed77f1d9a10b20bc5997ade6321a88e08071c92 | [] | no_license | martinezmatias/GenPat-data-C3 | 63cfe27efee2946831139747e6c20cf952f1d6f6 | b360265a6aa3bb21bd1d64f1fc43c3b37d0da2a4 | refs/heads/master | 2022-04-25T17:59:03.905613 | 2020-04-15T14:41:34 | 2020-04-15T14:41:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,153 | java | /*******************************************************************************
* Copyright (c) 2000, 2009 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.batch;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader;
import org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException;
import org.eclipse.jdt.internal.compiler.env.AccessRuleSet;
import org.eclipse.jdt.internal.compiler.env.NameEnvironmentAnswer;
import org.eclipse.jdt.internal.compiler.util.ManifestAnalyzer;
import org.eclipse.jdt.internal.compiler.util.Util;
public class ClasspathJar extends ClasspathLocation {
protected File file;
protected ZipFile zipFile;
protected boolean closeZipFileAtEnd;
protected Hashtable packageCache;
public ClasspathJar(File file, boolean closeZipFileAtEnd,
AccessRuleSet accessRuleSet, String destinationPath) {
super(accessRuleSet, destinationPath);
this.file = file;
this.closeZipFileAtEnd = closeZipFileAtEnd;
}
public List fetchLinkedJars(FileSystem.ClasspathSectionProblemReporter problemReporter) {
// expected to be called once only - if multiple calls desired, consider
// using a cache
InputStream inputStream = null;
try {
initialize();
ArrayList result = new ArrayList();
ZipEntry manifest = this.zipFile.getEntry("META-INF/MANIFEST.MF"); //$NON-NLS-1$
if (manifest != null) { // non-null implies regular file
inputStream = this.zipFile.getInputStream(manifest);
ManifestAnalyzer analyzer = new ManifestAnalyzer();
boolean success = analyzer.analyzeManifestContents(inputStream);
List calledFileNames = analyzer.getCalledFileNames();
if (problemReporter != null) {
if (!success || analyzer.getClasspathSectionsCount() == 1 && calledFileNames == null) {
problemReporter.invalidClasspathSection(getPath());
} else if (analyzer.getClasspathSectionsCount() > 1) {
problemReporter.multipleClasspathSections(getPath());
}
}
if (calledFileNames != null) {
Iterator calledFilesIterator = calledFileNames.iterator();
String directoryPath = getPath();
int lastSeparator = directoryPath.lastIndexOf(File.separatorChar);
directoryPath = directoryPath.substring(0, lastSeparator + 1); // potentially empty (see bug 214731)
while (calledFilesIterator.hasNext()) {
result.add(new ClasspathJar(new File(directoryPath + (String) calledFilesIterator.next()), this.closeZipFileAtEnd, this.accessRuleSet, this.destinationPath));
}
}
}
return result;
} catch (IOException e) {
return null;
} finally {
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException e) {
// best effort
}
}
}
}
public NameEnvironmentAnswer findClass(char[] typeName, String qualifiedPackageName, String qualifiedBinaryFileName) {
return findClass(typeName, qualifiedPackageName, qualifiedBinaryFileName, false);
}
public NameEnvironmentAnswer findClass(char[] typeName, String qualifiedPackageName, String qualifiedBinaryFileName, boolean asBinaryOnly) {
if (!isPackage(qualifiedPackageName))
return null; // most common case
try {
ClassFileReader reader = ClassFileReader.read(this.zipFile, qualifiedBinaryFileName);
if (reader != null)
return new NameEnvironmentAnswer(reader, fetchAccessRestriction(qualifiedBinaryFileName));
} catch(ClassFormatException e) {
// treat as if class file is missing
} catch (IOException e) {
// treat as if class file is missing
}
return null;
}
public char[][][] findTypeNames(String qualifiedPackageName) {
if (!isPackage(qualifiedPackageName))
return null; // most common case
ArrayList answers = new ArrayList();
nextEntry : for (Enumeration e = this.zipFile.entries(); e.hasMoreElements(); ) {
String fileName = ((ZipEntry) e.nextElement()).getName();
// add the package name & all of its parent packages
int last = fileName.lastIndexOf('/');
while (last > 0) {
// extract the package name
String packageName = fileName.substring(0, last);
if (!qualifiedPackageName.equals(packageName))
continue nextEntry;
int indexOfDot = fileName.lastIndexOf('.');
if (indexOfDot != -1) {
String typeName = fileName.substring(last + 1, indexOfDot);
char[] packageArray = packageName.toCharArray();
answers.add(
CharOperation.arrayConcat(
CharOperation.splitOn('/', packageArray),
typeName.toCharArray()));
}
}
}
int size = answers.size();
if (size != 0) {
char[][][] result = new char[size][][];
answers.toArray(result);
return null;
}
return null;
}
public void initialize() throws IOException {
if (this.zipFile == null) {
this.zipFile = new ZipFile(this.file);
}
}
public boolean isPackage(String qualifiedPackageName) {
if (this.packageCache != null)
return this.packageCache.containsKey(qualifiedPackageName);
this.packageCache = new Hashtable(41);
this.packageCache.put(Util.EMPTY_STRING, Util.EMPTY_STRING);
nextEntry : for (Enumeration e = this.zipFile.entries(); e.hasMoreElements(); ) {
String fileName = ((ZipEntry) e.nextElement()).getName();
// add the package name & all of its parent packages
int last = fileName.lastIndexOf('/');
while (last > 0) {
// extract the package name
String packageName = fileName.substring(0, last);
if (this.packageCache.containsKey(packageName))
continue nextEntry;
this.packageCache.put(packageName, packageName);
last = packageName.lastIndexOf('/');
}
}
return this.packageCache.containsKey(qualifiedPackageName);
}
public void reset() {
if (this.zipFile != null && this.closeZipFileAtEnd) {
try {
this.zipFile.close();
} catch(IOException e) {
// ignore
}
this.zipFile = null;
}
this.packageCache = null;
}
public String toString() {
return "Classpath for jar file " + this.file.getPath(); //$NON-NLS-1$
}
public char[] normalizedPath() {
if (this.normalizedPath == null) {
String path2 = this.getPath();
char[] rawName = path2.toCharArray();
if (File.separatorChar == '\\') {
CharOperation.replace(rawName, '\\', '/');
}
this.normalizedPath = CharOperation.subarray(rawName, 0, CharOperation.lastIndexOf('.', rawName));
}
return this.normalizedPath;
}
public String getPath() {
if (this.path == null) {
try {
this.path = this.file.getCanonicalPath();
} catch (IOException e) {
// in case of error, simply return the absolute path
this.path = this.file.getAbsolutePath();
}
}
return this.path;
}
}
| [
"375833274@qq.com"
] | 375833274@qq.com |
9992f8268be8eb3458491ad31b3ccaad783a26b2 | e5f4e559cf188f79a1629000d971c39c2a48ee27 | /modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/trait/DistributionFunction.java | 2d25b298adbcfc3df68e45fc548e1f850182152c | [
"Apache-2.0",
"LicenseRef-scancode-gutenberg-2020",
"CC0-1.0",
"BSD-3-Clause"
] | permissive | NSAmelchev/ignite | 704f29e90606c15dcbe6648a593acb520202ba89 | 3acf3f1098d38ddea6d7f3d55c0d0ec2dafad17d | refs/heads/master | 2023-08-16T22:58:22.536044 | 2022-08-04T07:39:55 | 2022-08-04T07:39:55 | 80,110,041 | 1 | 0 | Apache-2.0 | 2023-01-25T14:45:55 | 2017-01-26T11:45:47 | Java | UTF-8 | Java | false | false | 10,368 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.ignite.internal.processors.query.calcite.trait;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.UUID;
import org.apache.calcite.rel.RelDistribution;
import org.apache.calcite.rel.RelNode;
import org.apache.calcite.util.ImmutableIntList;
import org.apache.ignite.internal.processors.query.calcite.exec.ExecutionContext;
import org.apache.ignite.internal.processors.query.calcite.metadata.AffinityService;
import org.apache.ignite.internal.processors.query.calcite.metadata.ColocationGroup;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.internal.CU;
import org.apache.ignite.internal.util.typedef.internal.U;
/**
* Distribution function.
*/
public abstract class DistributionFunction {
/** */
private String name;
/** */
private DistributionFunction() {
// No-op.
}
/**
* @return Distribution function type.
*/
public abstract RelDistribution.Type type();
/**
* @return Function name. This name used for equality checking and in {@link RelNode#getDigest()}.
*/
public final String name() {
if (name != null)
return name;
return name = name0().intern();
}
/** */
public boolean affinity() {
return false;
}
/** */
public int cacheId() {
return CU.UNDEFINED_CACHE_ID;
}
/** */
public Object identity() {
return type().shortName;
}
/**
* Creates a destination based on this function algorithm, given nodes mapping and given distribution keys.
*
* @param ctx Execution context.
* @param affinityService Affinity function source.
* @param group Target mapping.
* @param keys Distribution keys.
* @return Destination function.
*/
abstract <Row> Destination<Row> destination(ExecutionContext<Row> ctx, AffinityService affinityService,
ColocationGroup group, ImmutableIntList keys);
/**
* @return Function name. This name used for equality checking and in {@link RelNode#getDigest()}.
*/
protected String name0() {
return type().shortName;
}
/** {@inheritDoc} */
@Override public final int hashCode() {
return Objects.hashCode(name());
}
/** {@inheritDoc} */
@Override public final boolean equals(Object obj) {
if (obj instanceof DistributionFunction)
//noinspection StringEquality
return name() == ((DistributionFunction)obj).name();
return false;
}
/** {@inheritDoc} */
@Override public final String toString() {
return name();
}
/** */
public static DistributionFunction any() {
return AnyDistribution.INSTANCE;
}
/** */
public static DistributionFunction broadcast() {
return BroadcastDistribution.INSTANCE;
}
/** */
public static DistributionFunction singleton() {
return SingletonDistribution.INSTANCE;
}
/** */
public static DistributionFunction random() {
return RandomDistribution.INSTANCE;
}
/** */
public static DistributionFunction hash() {
return HashDistribution.INSTANCE;
}
/** */
public static DistributionFunction affinity(int cacheId, Object identity) {
return new AffinityDistribution(cacheId, identity);
}
/** */
public static boolean satisfy(DistributionFunction f0, DistributionFunction f1) {
if (f0 == f1 || f0.name() == f1.name())
return true;
return f0 instanceof AffinityDistribution && f1 instanceof AffinityDistribution &&
Objects.equals(((AffinityDistribution)f0).identity(), ((AffinityDistribution)f1).identity());
}
/** */
private static final class AnyDistribution extends DistributionFunction {
/** */
public static final DistributionFunction INSTANCE = new AnyDistribution();
/** {@inheritDoc} */
@Override public RelDistribution.Type type() {
return RelDistribution.Type.ANY;
}
/** {@inheritDoc} */
@Override public <Row> Destination<Row> destination(ExecutionContext<Row> ctx, AffinityService affinityService,
ColocationGroup m, ImmutableIntList k) {
throw new AssertionError();
}
}
/** */
private static final class BroadcastDistribution extends DistributionFunction {
/** */
public static final DistributionFunction INSTANCE = new BroadcastDistribution();
/** {@inheritDoc} */
@Override public RelDistribution.Type type() {
return RelDistribution.Type.BROADCAST_DISTRIBUTED;
}
/** {@inheritDoc} */
@Override public <Row> Destination<Row> destination(ExecutionContext<Row> ctx, AffinityService affinityService,
ColocationGroup m, ImmutableIntList k) {
assert m != null && !F.isEmpty(m.nodeIds());
return new AllNodes<>(m.nodeIds());
}
}
/** */
private static final class RandomDistribution extends DistributionFunction {
/** */
public static final DistributionFunction INSTANCE = new RandomDistribution();
/** {@inheritDoc} */
@Override public RelDistribution.Type type() {
return RelDistribution.Type.RANDOM_DISTRIBUTED;
}
/** {@inheritDoc} */
@Override public <Row> Destination<Row> destination(ExecutionContext<Row> ctx, AffinityService affinityService,
ColocationGroup m, ImmutableIntList k) {
assert m != null && !F.isEmpty(m.nodeIds());
return new RandomNode<>(m.nodeIds());
}
}
/** */
private static final class SingletonDistribution extends DistributionFunction {
/** */
public static final DistributionFunction INSTANCE = new SingletonDistribution();
/** {@inheritDoc} */
@Override public RelDistribution.Type type() {
return RelDistribution.Type.SINGLETON;
}
/** {@inheritDoc} */
@Override public <Row> Destination<Row> destination(ExecutionContext<Row> ctx, AffinityService affinityService,
ColocationGroup m, ImmutableIntList k) {
if (m == null || m.nodeIds() == null || m.nodeIds().size() != 1)
throw new AssertionError();
return new AllNodes<>(Collections
.singletonList(Objects
.requireNonNull(F
.first(m.nodeIds()))));
}
}
/** */
private static final class HashDistribution extends DistributionFunction {
/** Singleton instance. */
public static final DistributionFunction INSTANCE = new HashDistribution();
/** {@inheritDoc} */
@Override public RelDistribution.Type type() {
return RelDistribution.Type.HASH_DISTRIBUTED;
}
/** {@inheritDoc} */
@Override public <Row> Destination<Row> destination(ExecutionContext<Row> ctx, AffinityService affSrvc,
ColocationGroup m, ImmutableIntList k) {
assert m != null && !F.isEmpty(m.assignments()) && !k.isEmpty();
List<List<UUID>> assignments = m.assignments();
if (U.assertionsEnabled()) {
for (List<UUID> assignment : assignments)
assert F.isEmpty(assignment) || assignment.size() == 1;
}
AffinityAdapter<Row> affinity = new AffinityAdapter<>(affSrvc.affinity(CU.UNDEFINED_CACHE_ID), k.toIntArray(),
ctx.rowHandler());
return new Partitioned<>(assignments, affinity);
}
}
/** */
private static final class AffinityDistribution extends DistributionFunction {
/** */
private final int cacheId;
/** */
private final Object identity;
/**
* @param cacheId Cache ID.
* @param identity Affinity identity key.
*/
public AffinityDistribution(int cacheId, Object identity) {
this.cacheId = cacheId;
this.identity = identity;
}
/** {@inheritDoc} */
@Override public boolean affinity() {
return true;
}
/** {@inheritDoc} */
@Override public int cacheId() {
return cacheId;
}
/** {@inheritDoc} */
@Override public RelDistribution.Type type() {
return RelDistribution.Type.HASH_DISTRIBUTED;
}
/** {@inheritDoc} */
@Override public <Row> Destination<Row> destination(ExecutionContext<Row> ctx, AffinityService affSrvc,
ColocationGroup m, ImmutableIntList k) {
assert m != null && !F.isEmpty(m.assignments()) && k.size() == 1;
List<List<UUID>> assignments = m.assignments();
if (U.assertionsEnabled()) {
for (List<UUID> assignment : assignments)
assert F.isEmpty(assignment) || assignment.size() == 1;
}
AffinityAdapter<Row> affinity = new AffinityAdapter<>(affSrvc.affinity(cacheId), k.toIntArray(), ctx.rowHandler());
return new Partitioned<>(assignments, affinity);
}
/** {@inheritDoc} */
@Override public Object identity() {
return identity;
}
/** {@inheritDoc} */
@Override protected String name0() {
return "affinity[identity=" + identity + ", cacheId=" + cacheId + ']';
}
}
}
| [
"plehanov.alex@gmail.com"
] | plehanov.alex@gmail.com |
db7a633121203df16e1a3588d1f15c880d4577b9 | 1adfb2e63697a328997535237ea47a01b0b2d105 | /Algorithms_Java/src/_CombinatorialAlgorithms/Variations_2.java | 9b7e17c99caf7eedbf932e9bd1900bc8814f25c9 | [] | no_license | AdilBozov/Java_Training | 163a6bb85d5d603b2a4dc61ac40a01ed6e6366f8 | 111de4387af2c3d064506c47e4780492b2c78701 | refs/heads/master | 2021-01-12T01:05:28.646568 | 2017-01-13T17:33:22 | 2017-01-13T17:33:22 | 78,343,982 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 697 | java | package _CombinatorialAlgorithms;
import java.util.Arrays;
public class Variations_2 {
static final int n = 5;
static final int k = 3;
static int[] arr = new int[k];
public static void main(String[] args) {
// TODO Auto-generated method stub
do{
Print(arr);
}while(Increment(arr));
}
static boolean Increment(int[] arr) {
// TODO Auto-generated method stub
int diget = arr.length-1;
while(diget >= 0){
arr[diget]++;
if(arr[diget] == n){
arr[diget] = 0;
diget--;
}
else{
return true;
}
}
return false;
}
static void Print(int[] arr2) {
// TODO Auto-generated method stub
System.out.println(Arrays.toString(arr2));
}
}
| [
"adilbozov@hotmail.com"
] | adilbozov@hotmail.com |
c08c9175d7c3989d252ae27ddc7fc583a75f5930 | cd840c08bd0ab1d1591941a0ab2d4339b16aa7c3 | /p0520/src/MyMath2.java | 8f13e6802d0f0e787f34cb043031deb03191a524 | [] | no_license | koalra1/javatest | dcf82cf8725167ac9dec24cc0fa8cf7e82782280 | 322f231fbb3332e0a048988eb000f7a6a774a337 | refs/heads/master | 2023-06-12T15:38:53.703662 | 2021-07-10T05:58:14 | 2021-07-10T05:58:14 | 368,441,575 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 376 | java |
public class MyMath2 {
long a,b; // 같은 타입은 한줄로 쓸수있다. 인스턴스변수 - 객체선언후 사용, 클래스내에서사용
long add() { //인스턴스메소드 -> 객체선언후 사용, 클래스내에서 사용
return a+b;
}
static long add(long a,long b) { //클래스메소드 -> 객체선언없이 사용
return a+b;
}
}
| [
"jmp@DESKTOP-FAQGNP0"
] | jmp@DESKTOP-FAQGNP0 |
e046d27216babf31f82834e1280af0afd777595f | 2561883edb31bc4ac6168bac519a1de97712e48c | /blockchain/src/main/java/edu/ictt/blockchain/socket/body/upperbody/UBlockHash.java | 615160e4a729776437716367df50e761bdb4e61b | [] | no_license | icttyjw/blockchain | 4b0bfe7e54c0103e6a86da4fe8540e4fdb93ed77 | a4e3691d71c9c13802a03b4cc6913fa044f46a74 | refs/heads/master | 2022-06-25T01:51:14.430764 | 2020-01-07T01:11:51 | 2020-01-07T01:11:51 | 157,945,135 | 0 | 0 | null | 2022-06-17T02:02:17 | 2018-11-17T02:57:57 | Java | UTF-8 | Java | false | false | 1,564 | java | package edu.ictt.blockchain.socket.body.upperbody;
import org.omg.CosNaming.NamingContextExtPackage.StringNameHelper;
public class UBlockHash {
/**
* 区块的uhash
*/
private String uhash;
/**
* 区块的bhash
*/
private String bhash;
/**
* 前一区块的uhash
*/
private String preUHash;
/**
* 前一区块的bhash
*/
private String preBHash;
/**
* 节点id
*/
private String appId;
public UBlockHash() {
super();
}
public UBlockHash(String uhash, String bhash, String preUHash, String preBHash, String appId) {
super();
this.uhash = uhash;
this.bhash = bhash;
this.preUHash = preUHash;
this.preBHash = preBHash;
this.appId = appId;
}
public String getUhash() {
return uhash;
}
public void setUhash(String uhash) {
this.uhash = uhash;
}
public String getBhash() {
return bhash;
}
public void setBhash(String bhash) {
this.bhash = bhash;
}
public String getPreUHash() {
return preUHash;
}
public void setPreUHash(String preUHash) {
this.preUHash = preUHash;
}
public String getPreBHash() {
return preBHash;
}
public void setPreBHash(String preBHash) {
this.preBHash = preBHash;
}
public String getAppId() {
return appId;
}
public void setAppId(String appId) {
this.appId = appId;
}
@Override
public String toString() {
return "UBlockHash [uhash=" + uhash + ", bhash=" + bhash + ", preUHash=" + preUHash + ", preBHash=" + preBHash
+ ", appId=" + appId + "]";
}
}
| [
"tu_zoe@163.com"
] | tu_zoe@163.com |
3d082e0972e6c11e5b09dd57f84a347b5561edd2 | aaf1f10561226bbdf06a12a1907d4a45f397e90b | /src/main/java/com/myjavaworld/gui/MPopupMenu.java | 1ef9c454bad67afdcf895eb1b2b91962846eb261 | [
"Apache-2.0"
] | permissive | wordlessly/jftp | dcd5e87078d940fc47fed68161c0ff30aedae404 | 14e62ceba4e371c2a0b955604b10f065f46f4f7d | refs/heads/master | 2020-06-22T18:01:11.372565 | 2012-07-06T11:27:23 | 2012-07-06T11:27:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,435 | java | /*
* Copyright 2012 jMethods, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.myjavaworld.gui;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Point;
import java.awt.Toolkit;
import javax.swing.Action;
import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;
import javax.swing.SwingUtilities;
/**
* An extension of <code>javax.swing.JPopupMenu</code> with the additional
* functionality of displaying the popup with in the screen limits by adjusting
* the popup position if required.
*
* @author Sai Pullabhotla, psai [at] jMethods [dot] com
* @version 1.0
*
*/
public class MPopupMenu extends JPopupMenu {
/**
* Displays this popup menu at the given position x and y on the component,
* <code>invoker</code>. This method always makes sure that the popup will
* fit in the screen. If the popup is going beyond the screen size, the
* orientation of the popup will be changed to fit in the screen area.
*
* @param invoker
* Component that invoked this popup menu.
* @param x
* X position
* @param y
* Y position.
*
*/
@Override
public void show(Component invoker, int x, int y) {
Dimension size = getSize();
if (size.width == 0 || size.height == 0) {
size = getPreferredSize();
}
Point p = new Point(x + size.width, y + size.height);
SwingUtilities.convertPointToScreen(p, invoker);
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
int x1 = 0, y1 = 0;
if (p.y > screenSize.height - 25) {
y1 = y - size.height;
}
if (p.x > screenSize.width) {
x1 = x - size.width;
}
super.show(invoker, x1 == 0 ? x : x1, y1 == 0 ? y : y1);
}
@Override
public JMenuItem add(Action action) {
MMenuItem mi = new MMenuItem(action);
mi.setIcon(null);
add(mi);
return mi;
}
}
| [
"sai.pullabhotla@gmail.com"
] | sai.pullabhotla@gmail.com |
fe7f8fd88c9d6e6279038f1cf97a26acbee09871 | 25f3205761a7162bf02874eb11433c42c9d2ef5a | /app/src/main/java/com/example/oliverh/bakerapp/ui/selectstep/SelectRecipeDetailsFragmentViewModel.java | 9c357ed580d7ada143bce9c6a648bea293bcaabe | [] | no_license | jhlink/BakerApp | b955d5745cd1e8580b2cd22c75b0423df919fb1c | 32647d4a193453ad8ef982772bdeb7763e3206c9 | refs/heads/master | 2020-04-05T01:07:11.691888 | 2018-11-23T18:38:33 | 2018-11-23T18:38:33 | 156,424,202 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 975 | java | package com.example.oliverh.bakerapp.ui.selectstep;
import android.arch.lifecycle.LiveData;
import android.arch.lifecycle.ViewModel;
import com.example.oliverh.bakerapp.data.RecipeRepository;
import com.example.oliverh.bakerapp.data.network.RepositoryResponse;
public class SelectRecipeDetailsFragmentViewModel extends ViewModel {
private final RecipeRepository mRepository;
private final LiveData<RepositoryResponse> recipeSteps;
private final LiveData<RepositoryResponse> recipeIngredients;
public SelectRecipeDetailsFragmentViewModel(int recipeId) {
mRepository = RecipeRepository.getExistingInstance();
recipeSteps = mRepository.getRecipeSteps(recipeId);
recipeIngredients = mRepository.getRecipeIngredients(recipeId);
}
public LiveData<RepositoryResponse> getRecipeSteps() {
return recipeSteps;
}
public LiveData<RepositoryResponse> getRecipeIngredients() {
return recipeIngredients;
}
}
| [
"jhlink@users.noreply.github.com"
] | jhlink@users.noreply.github.com |
199369362377c1934c2e43d101fe5c3fe0ed7440 | 2e90ea1d851c4c974864559db46c39fddec6c88c | /src/main/java/logic/is/power/logic_warehouse/Connective.java | 2c7b7d035f6f50a8bace2ec401a6b8b774fb37ec | [
"Apache-2.0"
] | permissive | riazanov/logic-warehouse | 06c845b6a2866885b019c625b7f9d6e202918b81 | 7cc4953e88279b730a7b13a0e54bc7fb9bb58d22 | refs/heads/master | 2021-01-10T05:08:52.156397 | 2015-10-19T22:45:59 | 2015-10-19T22:45:59 | 44,554,091 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,892 | java | /* Copyright (C) 2010 Alexandre Riazanov (Alexander Ryazanov)
*
* The copyright owner licenses this file to You under the Apache License,
* Version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package logic.is.power.logic_warehouse;
/**
* Representation of connective symbols (including nullary ones).
*/
public class Connective extends Symbol {
public static class Id {
public static final int Not = 0;
public static final int And = 1;
public static final int Or = 2;
public static final int Equivalent = 3;
public static final int Implies = 4;
public static final int ReverseImplies = 5;
public static final int NotEquivalent = 6;
public static final int NotOr = 7;
public static final int NotAnd = 8;
};
public final int id() { return _id; }
public String name() {
switch (_id)
{
case Id.Not: return "~";
case Id.And: return "&";
case Id.Or: return "|";
case Id.Equivalent: return "<=>";
case Id.Implies: return "=>";
case Id.ReverseImplies: return "<=";
case Id.NotEquivalent: return "<~>";
case Id.NotOr: return "~|";
case Id.NotAnd: return "~&";
};
assert false;
return null;
}
public final boolean isAssociative() {
return _id == Id.And || _id == Id.Or;
}
public static Connective get(int id) {
switch (id)
{
case Id.Not: return getNot();
case Id.And: return getAnd();
case Id.Or: return getOr();
case Id.Equivalent: return getEquivalent();
case Id.Implies: return getImplies();
case Id.ReverseImplies: return getReverseImplies();
case Id.NotEquivalent: return getNotEquivalent();
case Id.NotOr: return getNotOr();
case Id.NotAnd: return getNotAnd();
};
assert false;
return null;
}
public static Connective getNot() {
return _not;
}
public static Connective getAnd() {
return _and;
}
public static Connective getOr() {
return _or;
}
public static Connective getEquivalent() {
return _equivalent;
}
public static Connective getImplies() {
return _implies;
}
public static Connective getReverseImplies() {
return _reverseImplies;
}
public static Connective getNotEquivalent() {
return _notEquivalent;
}
public static Connective getNotOr() {
return _notOr;
}
public static Connective getNotAnd() {
return _notAnd;
}
// Private methods:
/** Note that this constructor is private; objects of this class
* can only be created/destroyed inside other methods.
*/
private Connective(int id,int arity) {
super(Symbol.Category.Connective,arity);
_id = id;
}
// Data:
private int _id;
private static Connective _not = new Connective(Id.Not,1);
private static Connective _and = new Connective(Id.And,2);
private static Connective _or = new Connective(Id.Or,2);
private static Connective _equivalent = new Connective(Id.Equivalent,2);
private static Connective _implies = new Connective(Id.Implies,2);
private static Connective _reverseImplies =
new Connective(Id.ReverseImplies,2);
private static Connective _notEquivalent =
new Connective(Id.NotEquivalent,2);
private static Connective _notOr = new Connective(Id.NotOr,2);
private static Connective _notAnd = new Connective(Id.NotAnd,2);
}; // class Symbol
| [
"alexandre.riazanov@gmail.com"
] | alexandre.riazanov@gmail.com |
b4cd03da745aad6b3fa7e24ee537a77b69c798c9 | 8decaec9c742f14f74a21e003a37ca8791b84d72 | /TA/Common/Item/ItemArtifact_StarCloak.java | 7a922a12a06f4ab3b8ed1bf65cf4730143bae88f | [] | no_license | Modbder/TerraArts | b587088fd041950825aa196c8b6aa327a4842377 | 69920cf9907851f59f2e1adc141493a2d43af5ec | refs/heads/master | 2021-01-21T22:29:03.109821 | 2014-04-19T07:05:19 | 2014-04-19T07:05:19 | 18,935,826 | 2 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,564 | java | package TA.Common.Item;
import TA.API.IArtifact;
import TA.Common.Entity.EntityFallingStar;
import TA.Common.Inventory.InventoryArtifacts;
import TA.Utils.TAUtils;
import am2.api.IExtendedProperties;
import DummyCore.Utils.MathUtils;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class ItemArtifact_StarCloak extends ItemArtifact{
public ItemArtifact_StarCloak(String par1) {
super(par1);
}
@Override
public float setDamage(ItemStack par1ItemStack, EntityPlayer p,
float am) {
boolean shouldWork = true;
if(TAUtils.playerInvTable.containsKey(p.username))
{
InventoryArtifacts ia = (InventoryArtifacts) TAUtils.playerInvTable.get(p.username);
for(int i = 0; i < 5; ++i)
{
ItemStack stack = ia.mainInventory[i];
if(stack != null && stack.getItem() instanceof IArtifact)
{
IArtifact art = (IArtifact) stack.getItem();
if(art instanceof ItemArtifact_StarVeil)
{
shouldWork = false;
break;
}
}
}
}
if(shouldWork)
for(int i = 0; i < 1+p.worldObj.rand.nextInt(5); ++i)
{
EntityFallingStar star = new EntityFallingStar(p.worldObj, p);
star.setPositionAndRotation(p.posX+MathUtils.randomDouble(p.worldObj.rand)*4, p.posY+32, p.posZ+MathUtils.randomDouble(p.worldObj.rand)*4, 0, 0);
if(!p.worldObj.isRemote)
p.worldObj.spawnEntityInWorld(star);
star.motionX = 0;
star.motionZ = 0;
}
return am;
}
}
| [
"Modbder@gmail.com"
] | Modbder@gmail.com |
fbc9001d5b3bd758dac31198dd27bcfb520ec590 | 36d6791ab493831020a7ccb161d2be184032e4b6 | /src/main/java/edu/uade/app/App.java | 83a7f9d5323c24c474b558b234ec11e424a13d25 | [] | no_license | alexcabezas1/merkletree-java | b44a603061563c3bdd6e60d972d902299576e491 | 9bb05ddb5ebd24bc98a65c2237393b33cb1bd69d | refs/heads/master | 2023-01-20T05:28:38.501323 | 2020-11-20T04:05:35 | 2020-11-20T04:05:35 | 310,520,834 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 134 | java | package edu.uade.app;
import edu.uade.merkletree.*;
public class App
{
public static void main( String[] args )
{
}
}
| [
"alexander.cabezas@autodesk.com"
] | alexander.cabezas@autodesk.com |
53c3319ccafbe680ff3df0922edd512f1db68278 | f5049214ff99cdd7c37da74619b60ac4a26fc6ba | /runtime/net/eu.agno3.runtime.net.dns/src/main/java/eu/agno3/runtime/net/dns/SRVEntry.java | 025ccc1a703f9aedd5cd214739adde01b50a4618 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | AgNO3/code | d17313709ee5db1eac38e5811244cecfdfc23f93 | b40a4559a10b3e84840994c3fd15d5f53b89168f | refs/heads/main | 2023-07-28T17:27:53.045940 | 2021-09-17T14:25:01 | 2021-09-17T14:31:41 | 407,567,058 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,357 | java | /**
* © 2015 AgNO3 Gmbh & Co. KG
* All right reserved.
*
* Created: 31.03.2015 by mbechler
*/
package eu.agno3.runtime.net.dns;
/**
* @author mbechler
*
*/
public class SRVEntry {
private int priortity;
private int weight;
private String name;
private int port;
private int ttl;
/**
* @param name
* @param priority
* @param weight
* @param port
* @param ttl
*
*/
public SRVEntry ( String name, int priority, int weight, int port, int ttl ) {
this.name = name;
if ( this.name.charAt(this.name.length() - 1) == '.' ) {
this.name = this.name.substring(0, this.name.length() - 1);
}
this.priortity = priority;
this.weight = weight;
this.port = port;
this.ttl = ttl;
}
/**
* @return the priortity
*/
public int getPriority () {
return this.priortity;
}
/**
* @return the weight
*/
public int getWeight () {
return this.weight;
}
/**
* @return the name
*/
public String getName () {
return this.name;
}
/**
* @return the port
*/
public int getPort () {
return this.port;
}
/**
* @return the record TTL
*/
public int getTTL () {
return this.ttl;
}
}
| [
"bechler@agno3.eu"
] | bechler@agno3.eu |
6075235ee2cad3b6536f0a3be302b0902854363e | 4f707b4609bbaa053ff6fb7dc9e26e57315b1e71 | /src/report/cn/com/infostrategy/ui/report/BillCellHtmlHrefListener.java | 90df60d0069206382fa5bd196a8c5ee42b671756 | [] | no_license | wnsalary/weblight | 16f14e446b3aa44d66a9efef50d236e1c132b289 | 8b9a1700728c003862f55506ab7b600ef7006be2 | refs/heads/master | 2022-12-17T11:42:43.373712 | 2020-09-23T07:28:19 | 2020-09-23T07:28:19 | 263,282,545 | 1 | 0 | null | null | null | null | GB18030 | Java | false | false | 343 | java | package cn.com.infostrategy.ui.report;
import java.util.EventListener;
/**
* Excel模板控件上的超链接监听器!!!即BillCellPanel上的超链接!!!
*
* @author xch
*
*/
public interface BillCellHtmlHrefListener extends EventListener {
public void onBillCellHtmlHrefClicked(BillCellHtmlHrefEvent _event); //点击动作!!!
}
| [
"17744571124@163.com"
] | 17744571124@163.com |
04ef1370783bbbf261be32bcf0e98d5530101805 | 29045b09c444237e6b689dd77b0d5cf8b329a372 | /17_Debuging/src/main/java/com/ict/test/Ex03Test.java | ffa91432e205a1e70724145107ad4ba8e6c8988c | [] | no_license | zerohoons/04_Guestbook-05_UpDown | f29d677d5b664a9947834f7063c79b7faf219f8e | 52a1208691a5cbd6235cb629adf6470873e13996 | refs/heads/master | 2023-06-05T19:15:14.388209 | 2021-07-05T09:16:29 | 2021-07-05T09:16:29 | 375,278,447 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,027 | java | package com.ict.test;
import static org.junit.Assert.*;
import java.util.Arrays;
import java.util.Collection;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import com.ict.junit.Ex01;
//Ex01Test의 마지막 버전의 변경. 하나의 메소드의 여러개의 테스트 케이스를 이용하는 것.
@RunWith(Parameterized.class)
public class Ex03Test {
Ex01 t1;
private int expected;
private int valueA;
private int valueB;
@Before
public void test_before() {
t1 = new Ex01();
}
public Ex03Test(int expected, int valueA, int valueB) {
super();
this.expected = expected;
this.valueA = valueA;
this.valueB = valueB;
}
@Parameters
public static Collection<Integer[]> getTestParameters(){
return Arrays.asList(new Integer[][]{
{21,16,5},{11,16,-5},{-11,-16,5},{-21,-16-5}
});
}
@Test
public void test() {
assertEquals(expected, t1.add(valueA, valueB));
}
}
| [
"zerohoons@gmail.com"
] | zerohoons@gmail.com |
632be1aa7311fb1348e5127a2854090647473856 | 3ee1c41f1fc133d77ac2681842bc9eefebad38ae | /openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/src/main/java/org/openecomp/core/zusammen/impl/ItemElementLoggerTargetServiceName.java | 1a4466a3c5c8f5f240d606b53827ce7d9975b6a7 | [
"Apache-2.0"
] | permissive | onapdemo/sdc | b225395934e07b36f96ba46ab04be533d755c521 | 3f1fee2ca76332b48e6f36662b32f2b5096c25e7 | refs/heads/master | 2020-03-17T21:17:00.804170 | 2018-05-21T06:47:17 | 2018-05-21T06:47:17 | 133,952,212 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 717 | java | package org.openecomp.core.zusammen.impl;
/**
* @author Avrahamg.
* @since February 19, 2017
*/
public enum ItemElementLoggerTargetServiceName {
ITEM_CREATION("Item Creation"),
ITEM_VERSION_CREATION("Item Version Creation"),
ELEMENT_CREATION("Element Creation"),
ELEMENT_UPDATE("Element Update"),
ELEMENT_LIST("Element List"),
ELEMENT_GET("Element Get"),
ELEMENT_GET_BY_PROPERTY("Element Get By Property"),
ITEM_RETRIEVAL("Item retrieval"),
ITEM_VERSION_RETRIEVAL("Item version retrieval)");
private final String description;
public String getDescription() {
return description;
}
ItemElementLoggerTargetServiceName(String description) {
this.description = description;
}
}
| [
"Sudhakar.reddy@amdocs.com"
] | Sudhakar.reddy@amdocs.com |
e4ff3fc26bde345d97b7d4666bda751e5ed7d576 | 5da3202d0309a5ed5699d67ae543497c936c670c | /app/src/main/java/com/example/administrator/healthlife/moudle/disease/bean/FourBean.java | bbaa9cbef22c4c39ced7d56ee571fd1d4a9a447e | [
"Apache-2.0"
] | permissive | XHao217/healthlife | 30d3d6e3a3d66fdbc06f1c2cd288fdc0763d759d | 7e3272f027387b3a7adb7f41ec4d70b5592ac3a0 | refs/heads/master | 2021-01-20T00:53:44.692999 | 2017-04-24T07:22:31 | 2017-04-24T07:22:31 | 89,208,973 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 18,728 | java | package com.example.administrator.healthlife.moudle.disease.bean;
import android.os.Parcel;
import android.os.Parcelable;
import java.util.List;
/**
* Created by Administrator on 2017/4/19.
*/
public class FourBean {
/**
* status : true
* total : 7006
* tngou : [{"address":"广东省广州市天河区燕岭路燕侨大厦三楼","area":52,"charge":"","classcode":"","count":215,"createdate":1041350400000,"fcount":0,"id":7106,"img":"/factory/150806/85595225e675c65430ff6602babfa4f4.jpg","legal":"","name":"淮安百纳药业有限公司","number":"","paddress":"","raddress":"","rcount":0,"tel":"020-32491857","type":"","url":"http://www.bainayy.com/","x":113.328,"y":23.1608,"zipcode":"510000"},{"address":"浙江省宁波市鄞州区嵩江西路321号 (南区)","area":379,"charge":"梁国芬","classcode":"Y","count":184,"createdate":1300896000000,"fcount":0,"id":7105,"img":"/factory/150806/2e955d11c0c3d3eb89382d34de3316a6.jpg","legal":"项志秋","name":"宁波明贝中药业有限公司","number":"浙20000201","paddress":"宁波市鄞州区嵩江西路321号 (南区)*","raddress":"宁波市鄞州区嵩江西路321号","rcount":0,"tel":"0574-87334820","type":"有限责任公司","url":"http://www.120v.cn","x":121.536,"y":29.8324,"zipcode":"315000"},{"address":"贵州省贵阳市扎佐医药工业园万江路","area":89,"charge":"江沨","classcode":"","count":144,"createdate":1230739200000,"fcount":0,"id":7104,"img":"/factory/150806/4719b8123de03c68afae9968b743c722.png","legal":"江祖怡","name":"贵州源和药业有限公司","number":"黔HbZbF20090268","paddress":"贵阳市扎佐医药工业园万江路","raddress":"贵阳市扎佐医药工业园万江路","rcount":0,"tel":"114","type":"有限责任公司(自然人投资或控股)","url":"http://www.120v.cn/Yaochang.html","x":108.27,"y":28.192,"zipcode":"550000"},{"address":"云南省昆明市经开区信息产业基地13-2号海归创业园3幢303-304号","area":362,"charge":"","classcode":"","count":145,"createdate":1347379200000,"fcount":0,"id":7103,"img":"/factory/150806/0aec8b15b1a1787d7dc7604be47458ce.jpg","legal":"","name":"云南云尚生物技术有限公司","number":"","paddress":"","raddress":"","rcount":0,"tel":"0871-4617057","type":"","url":"http://www.yunshang-china.com/","x":102.842,"y":24.9739,"zipcode":"650228"},{"address":"云南省西双版纳傣族自治州勐海县勐遮镇漫列","area":362,"charge":"李超坤","classcode":"","count":132,"createdate":1199116800000,"fcount":0,"id":7102,"img":"/factory/150806/7fa5c332afd53a81569a04354a5a408e.jpg","legal":"周说明","name":"西双版纳佛鑫药业有限公司中药(傣药)饮片厂","number":"滇Y20080180","paddress":"勐海县勐遮镇漫列;","raddress":"勐海县双拥路12号","rcount":0,"tel":"114","type":"自然人出资有限公司","url":"http://www.120v.cn/Yaochang.html","x":100.267,"y":21.9857,"zipcode":"666200"},{"address":"浙江省杭州市萧山区南阳镇南庄路10号","area":379,"charge":"高涛涛","classcode":"Zb","count":129,"createdate":1293724800000,"fcount":0,"id":7101,"img":"/factory/150806/d5018dd6bdce8d0863fb86b7ff2d587b.jpg","legal":"高涛涛","name":"杭州百科药业有限公司","number":"浙20000087","paddress":"杭州市萧山区南阳镇南庄路10号*","raddress":"杭州市萧山区南阳镇南庄路10号","rcount":0,"tel":"0571-57176029","type":"有限责任(公司)","url":"http://www.bioce.com.cn","x":120.449,"y":30.2609,"zipcode":"311200"},{"address":"湖北省荆州市石首市金平工业园区","area":163,"charge":"付在秀","classcode":"Hb","count":158,"createdate":1293811200000,"fcount":0,"id":7100,"img":"/factory/150806/34f52de015ce443f7a7fe08c3a1e5cb4.jpg","legal":"付在秀","name":"石首市千湖药业有限公司","number":"鄂20110383","paddress":"湖北省荆州石首市金平工业园区*","raddress":"湖北省荆州石首市金平工业园区","rcount":0,"tel":"114","type":"有限责任公司(私营)","url":"http://www.120v.cn/Yaochang.html","x":111.341,"y":30.7886,"zipcode":"434400"},{"address":"吉林省松原市松原大路255号","area":196,"charge":"冯辉","classcode":"HbZab","count":131,"createdate":1293811200000,"fcount":0,"id":7099,"img":"/factory/150806/313f030517f48c17f0b7d057d1eb8056.jpg","legal":"张成海","name":"松原市美罗药业有限责任公司","number":"吉20110283","paddress":"松原市松原大路255号*","raddress":"松原市松原大路255号","rcount":0,"tel":"114","type":"有限责任公司","url":"http://www.120v.cn/Yaochang.html","x":124.798,"y":45.1398,"zipcode":"138000"},{"address":"浙江省杭州市滨江区长河街道滨康路568号","area":379,"charge":"徐春玲","classcode":"Hb","count":129,"createdate":1363104000000,"fcount":0,"id":7098,"img":"/factory/default.jpg","legal":"陈岳忠","name":"杭州康恩贝制药有限公司","number":"浙20000027","paddress":"杭州市滨江区长河街道滨康路568号*","raddress":"杭州市滨江区长河街道滨康路568号","rcount":0,"tel":"0571\u201487774413","type":"有限责任公司(法人独资)","url":"http://hzconba.conbagroup.com","x":120.195,"y":30.1772,"zipcode":"310052"},{"address":"云南省昆明市高新技术开发区","area":365,"charge":"赵红","classcode":"Zb","count":124,"createdate":820425600000,"fcount":0,"id":7097,"img":"/factory/150806/4820deac74ab614d65ad42bd6d3ac878.jpg","legal":"刘士君","name":"云南理想药业有限公司","number":"滇20110038","paddress":"昆明国家高新技术产业开发区科锦路139号*","raddress":"昆明高新技术开发区","rcount":0,"tel":"0871-68310213","type":"非自然人出资有限责任公司","url":"http://www.lixiang.yn.cn/","x":101.519,"y":25.0503,"zipcode":"650106"},{"address":"浙江省金华市兰溪市城郊西路20号","area":379,"charge":"王明霞","classcode":"Q","count":115,"createdate":1365350400000,"fcount":0,"id":7096,"img":"/factory/150806/77f92f824e6aa2c78bf0b09a33eca807.jpg","legal":"余 斌","name":"浙江丰登化工股份有限公司","number":"浙20030377","paddress":"浙江省兰溪市城郊西路20号*","raddress":"浙江省兰溪市城郊西路20号","rcount":0,"tel":"0579-8231518","type":"股份有限(公司)","url":"http://www.120v.cn","x":119.452,"y":29.2338,"zipcode":"321100"},{"address":"学府路690号金鼎科技园内五号厂房B座","area":362,"charge":"李建军","classcode":"ZbHb","count":118,"createdate":915120000000,"fcount":0,"id":7095,"img":"/factory/150806/6ad705785e9c6dd749083697906ac49a.jpg","legal":"李建军","name":"云南通用善美制药有限责任公司","number":"滇20110039","paddress":"昆明市学府路690号金鼎科技园内五号厂房B座*","raddress":"昆明市学府路690号金鼎科技园内五号厂房B座","rcount":0,"tel":"0871-3108526","type":"有限责任公司","url":"http://www.120v.cn/YaoChangDetails-7095.html","x":102.676,"y":25.0639,"zipcode":"650033"},{"address":"陕西省西安市华山镇","area":305,"charge":"胡西儒","classcode":"HabC","count":106,"createdate":725817600000,"fcount":0,"id":7094,"img":"/factory/150806/2fa30a7871f8af370a7b74dce4160991.jpg","legal":"胡西儒","name":"陕西西岳制药有限公司","number":"陕20110035","paddress":"陕西省华阴市华山镇*","raddress":"陕西省华阴市华山镇","rcount":0,"tel":"029-88233710","type":"自然人控股或私营性质企业控股","url":"http://www.xiyuezy.com/","x":108.948,"y":34.2632,"zipcode":"714203"},{"address":"浙江省台州市三门县海游镇方卢村","area":379,"charge":"罗斯.路易斯.佩里兹加通","classcode":"Ha","count":128,"createdate":1338998400000,"fcount":0,"id":7093,"img":"/factory/150806/ed9843b81c9375b759fe370de8feda7e.png","legal":"古斯塔沃.丹尼尔.洛伦索.佩里扎里(Gustavo Daniel Lorenzo Pelizzari)","name":"浙江金明药业有限公司","number":"浙20070482","paddress":"浙江省三门县海游镇方卢村*","raddress":"浙江省三门县海游镇方卢村","rcount":0,"tel":"0576-83310681","type":"中外合资企业","url":"http://www.120v.cn","x":121.403,"y":29.0899,"zipcode":"317100"},{"address":"陕西省西安市火炬路18号楼","area":305,"charge":"丁美海","classcode":"Hb","count":148,"createdate":1293811200000,"fcount":0,"id":7092,"img":"/factory/150806/4dce7d90ce9c2c474830b965ba77e6d8.jpg","legal":"丁美海","name":"陕西得安制药有限责任公司","number":"陕20110123","paddress":"陕西省西安市火炬路18号楼*","raddress":"西安市火炬路18号楼","rcount":0,"tel":"114","type":"有限责任公司","url":"http://www.120v.cn/Yaochang.html","x":109.003,"y":34.2469,"zipcode":"710000"},{"address":"云南省昆明市东川区北郊","area":362,"charge":"李耿标","classcode":"HabZab","count":131,"createdate":31507200000,"fcount":0,"id":7091,"img":"/factory/150806/9d4f6218f4fb22738e534364c96a7732.jpg","legal":"李耿标","name":"云南一枝蒿制药有限公司","number":"滇20110040","paddress":"云南省昆明市东川区北郊*","raddress":"云南省昆明市东川区北郊","rcount":0,"tel":"0871-8184966","type":"自然人出资有限责任公司","url":"http://www.yizhihao.com/","x":103.182,"y":26.0835,"zipcode":"654100"},{"address":"河北省沧州市新华区津德路8号","area":118,"charge":"","classcode":"","count":117,"createdate":1293811200000,"fcount":0,"id":7090,"img":"/factory/150806/656b333d0e77184eb9b10584c8b6c5d0.jpg","legal":"","name":"沧州天元中药饮片加工有限公司","number":"","paddress":"","raddress":"","rcount":0,"tel":"114","type":"","url":"http://www.120v.cn/Yaochang.html","x":116.894,"y":38.3639,"zipcode":"061000"},{"address":"浙江省台州市三门县海游镇枫坑塘","area":379,"charge":"","classcode":"","count":124,"createdate":1356624000000,"fcount":0,"id":7089,"img":"/factory/150806/f148ddcba1986d0a8f6a3fc662ad632c.jpg","legal":"","name":"浙江三门恒康制药有限公司","number":"","paddress":"","raddress":"","rcount":0,"tel":"0576-83375888","type":"","url":"http://www.120v.cn","x":121.363,"y":29.1106,"zipcode":"317100"},{"address":"云南省昆明市盘龙区青云办事处青龙321号","area":362,"charge":"李万平","classcode":"Zb","count":133,"createdate":757353600000,"fcount":0,"id":7088,"img":"/factory/150806/f30d03674b27e207d454a9051f29c8fc.jpg","legal":"夏彤","name":"云南无敌制药有限责任公司","number":"滇20110041","paddress":"昆明市盘龙区青云办事处青龙321号*","raddress":"昆明市盘龙区青云办事处青龙321号","rcount":0,"tel":"400-6313-777","type":"有限责任公司","url":"http://www.ynwdzy.com/","x":102.796,"y":25.0499,"zipcode":"650216"},{"address":"浙江省台州市仙居现代工业园区","area":379,"charge":"张宇松","classcode":"Hab","count":121,"createdate":63043200000,"fcount":0,"id":7087,"img":"/factory/150806/a43751c321f32fbeebfb4acb3b372d1e.jpg","legal":"金敬德","name":"浙江仙琚制药股份有限公司","number":"浙20000295","paddress":"浙江省台州市仙居现代工业园区*浙江省台州市仙居县经济开发区现代区块兴业路6号*浙江省台州市仙居县仙药路1号*浙江省台州市仙居县南峰路*","raddress":"浙江省台州市仙居县仙药路1号","rcount":0,"tel":"0086-571-88900980","type":"股份有限(公司)","url":"http://www.xjpharma.com","x":120.73,"y":28.8397,"zipcode":"317300"}]
*/
private boolean status;
private int total;
private List<TngouBean> tngou;
public boolean isStatus() {
return status;
}
public void setStatus(boolean status) {
this.status = status;
}
public int getTotal() {
return total;
}
public void setTotal(int total) {
this.total = total;
}
public List<TngouBean> getTngou() {
return tngou;
}
public void setTngou(List<TngouBean> tngou) {
this.tngou = tngou;
}
public static class TngouBean implements Parcelable{
/**
* address : 广东省广州市天河区燕岭路燕侨大厦三楼
* area : 52
* charge :
* classcode :
* count : 215
* createdate : 1041350400000
* fcount : 0
* id : 7106
* img : /factory/150806/85595225e675c65430ff6602babfa4f4.jpg
* legal :
* name : 淮安百纳药业有限公司
* number :
* paddress :
* raddress :
* rcount : 0
* tel : 020-32491857
* type :
* url : http://www.bainayy.com/
* x : 113.328
* y : 23.1608
* zipcode : 510000
*/
private String address;
private int area;
private String charge;
private String classcode;
private int count;
private long createdate;
private int fcount;
private int id;
private String img;
private String legal;
private String name;
private String number;
private String paddress;
private String raddress;
private int rcount;
private String tel;
private String type;
private String url;
private double x;
private double y;
private String zipcode;
protected TngouBean(Parcel in) {
address = in.readString();
area = in.readInt();
charge = in.readString();
classcode = in.readString();
count = in.readInt();
createdate = in.readLong();
fcount = in.readInt();
id = in.readInt();
img = in.readString();
legal = in.readString();
name = in.readString();
number = in.readString();
paddress = in.readString();
raddress = in.readString();
rcount = in.readInt();
tel = in.readString();
type = in.readString();
url = in.readString();
x = in.readDouble();
y = in.readDouble();
zipcode = in.readString();
}
public static final Creator<TngouBean> CREATOR = new Creator<TngouBean>() {
@Override
public TngouBean createFromParcel(Parcel in) {
return new TngouBean(in);
}
@Override
public TngouBean[] newArray(int size) {
return new TngouBean[size];
}
};
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public int getArea() {
return area;
}
public void setArea(int area) {
this.area = area;
}
public String getCharge() {
return charge;
}
public void setCharge(String charge) {
this.charge = charge;
}
public String getClasscode() {
return classcode;
}
public void setClasscode(String classcode) {
this.classcode = classcode;
}
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
public long getCreatedate() {
return createdate;
}
public void setCreatedate(long createdate) {
this.createdate = createdate;
}
public int getFcount() {
return fcount;
}
public void setFcount(int fcount) {
this.fcount = fcount;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getImg() {
return img;
}
public void setImg(String img) {
this.img = img;
}
public String getLegal() {
return legal;
}
public void setLegal(String legal) {
this.legal = legal;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getNumber() {
return number;
}
public void setNumber(String number) {
this.number = number;
}
public String getPaddress() {
return paddress;
}
public void setPaddress(String paddress) {
this.paddress = paddress;
}
public String getRaddress() {
return raddress;
}
public void setRaddress(String raddress) {
this.raddress = raddress;
}
public int getRcount() {
return rcount;
}
public void setRcount(int rcount) {
this.rcount = rcount;
}
public String getTel() {
return tel;
}
public void setTel(String tel) {
this.tel = tel;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public double getX() {
return x;
}
public void setX(double x) {
this.x = x;
}
public double getY() {
return y;
}
public void setY(double y) {
this.y = y;
}
public String getZipcode() {
return zipcode;
}
public void setZipcode(String zipcode) {
this.zipcode = zipcode;
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel parcel, int i) {
parcel.writeString(address);
parcel.writeInt(area);
parcel.writeString(charge);
parcel.writeString(classcode);
parcel.writeInt(count);
parcel.writeLong(createdate);
parcel.writeInt(fcount);
parcel.writeInt(id);
parcel.writeString(img);
parcel.writeString(legal);
parcel.writeString(name);
parcel.writeString(number);
parcel.writeString(paddress);
parcel.writeString(raddress);
parcel.writeInt(rcount);
parcel.writeString(tel);
parcel.writeString(type);
parcel.writeString(url);
parcel.writeDouble(x);
parcel.writeDouble(y);
parcel.writeString(zipcode);
}
}
}
| [
"229441469@qq.com"
] | 229441469@qq.com |
6222862524c2e12ffb1d477169e165bc2a6ba444 | c89333d091f152c8c36623065cf6974997530876 | /modulesnov3/sa.elm.ob.hcm/src/sa/elm/ob/hcm/ad_process/employeeEvaluation/EmployeeEvaluationDAO.java | 4fad913b441e88dd0dd66cfa282d7a00db2a9a9a | [] | no_license | Orkhan42/openbravotest | 24cb0f35986732c41a21963d7aa7a0910e7b4afd | 82c7bfb60dda7a30be276a2b07e5ca2b4a92c585 | refs/heads/master | 2023-03-01T00:35:37.463178 | 2021-02-04T12:55:45 | 2021-02-04T12:55:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 472 | java | package sa.elm.ob.hcm.ad_process.employeeEvaluation;
import sa.elm.ob.hcm.EHCMEmpEvaluation;
/**
* Interface for all Employee Evaluation related DB Operations
*
* @author divya -12-02-2018
*
*/
public interface EmployeeEvaluationDAO {
/**
* update the Employee Evaluation status
*
* @param empEvaluationObj
* @param action
* @throws Exception
*/
void updateEmpEvaluationStatus(EHCMEmpEvaluation empEvaluationObj, String action) throws Exception;
}
| [
"laiquddin.syed83@gmail.com"
] | laiquddin.syed83@gmail.com |
332131c6644c0da3963d0307e9df14d0180e7827 | 7141587444439b430c43588b67163fd237e745fa | /src/test/java/org/reqresAPItests/AppTest.java | 737862bd4b63cbe892e620cac4fa1425c9110d11 | [] | no_license | MikhailNakko/APITestsBasics | a6d1f2addeed61b87bbb7075d469ba83c9bd6f34 | 2b2850d903dc9e648de28cbcaaa2ded21b5eaf27 | refs/heads/master | 2021-01-02T05:01:41.032846 | 2020-02-10T11:50:04 | 2020-02-10T11:50:04 | 239,499,183 | 0 | 0 | null | 2020-10-13T19:25:36 | 2020-02-10T11:47:51 | Java | UTF-8 | Java | false | false | 1,019 | java | package org.reqresAPItests;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import io.restassured.RestAssured;
import io.restassured.builder.RequestSpecBuilder;
import io.restassured.filter.log.ResponseLoggingFilter;
import io.restassured.specification.RequestSpecification;
import netscape.javascript.JSObject;
import org.json.simple.JSONObject;
import org.junit.Test;
/**
* Unit test for simple App.
*/
public class AppTest extends BaseTest
{
/**
* Rigorous Test :-)
*/
public void specs(){
}
@Test
public void apiFirstTest() {
JSONObject requestParams = new JSONObject();
requestParams.put("name", "Johnsons");
requestParams.put("job", "janitor");
RestAssured
.given(requestSpecificationForPOSTWithResponseLogging(requestParams))
.post(postCreateUserURI)
.then().statusCode(201).body("id", is(notNullValue()));
}
}
| [
"mykhailo_nakko@epam.com"
] | mykhailo_nakko@epam.com |
617f646d5447d68f6fd5c10f71e6c1939215c152 | ccacc3c8bc089b467d80bb61c5b701bfe11ba3d0 | /src/org/springframework/aop/AfterReturningAdvice.java | 6f770474df4214165256a1310bcac58dd4b2a7fe | [
"Apache-2.0",
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | pulllock/spring1.1.1_source | 0c42668a04471730b8c97083db229c60bf94847a | 619264d13a0badd343dc03882a87e9477427708e | refs/heads/master | 2022-12-14T16:55:58.146859 | 2017-06-07T15:17:09 | 2017-06-07T15:17:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,208 | java | /*
* Copyright 2002-2004 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.aop;
import java.lang.reflect.Method;
import org.aopalliance.aop.Advice;
/**
* After returning advice is invoked only on normal method return, not if an
* exception is thrown. Such advice can see the return value, but cannot change it.
* @author Rod Johnson
* 后置通知,可以访问返回值,但是不能改变返回值,可以访问被调用的方法,参数和目标对象
*/
public interface AfterReturningAdvice extends Advice {
void afterReturning(Object returnValue, Method m, Object[] args, Object target) throws Throwable;
}
| [
"pullocked@gmail.com"
] | pullocked@gmail.com |
dd6997411428d8f832eefe2aa7303b18dc6bc57a | bdf1c91c8844b3fb1480378815e117cae454d5bc | /src/santatoon/wand/domain/Customer.java | 5f6888c1ede70321357416ed7ed24649821e19d6 | [] | no_license | santatoon/keysearch | 3eeee2e24b2b4eab87524e454d0eda1efcaf3a74 | 284dcbcc46be8858e215d3a2bc3e7ad47432c363 | refs/heads/master | 2021-01-17T16:00:19.608319 | 2016-06-17T04:06:46 | 2016-06-17T04:06:46 | 56,474,228 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 2,507 | java | package santatoon.wand.domain;
import java.sql.Date;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import org.springframework.format.annotation.DateTimeFormat;
public class Customer {
@NotNull
int id;
@NotNull
String email;
@NotNull
String password;
@NotNull
String firstname;
@NotNull
String lastname;
@NotNull
Skintype skintype;
@NotNull
Troubletype troubletype;
@DateTimeFormat(style = "M-")
Date created;
@DateTimeFormat(style = "M-")
Date modified;
public Customer() {
}
public Customer(int id, String email, String password, String firstname, String lastname, Skintype skintype, Troubletype troubletype,
Date created, Date modified) {
super();
this.id = id;
this.email = email;
this.password = password;
this.firstname = firstname;
this.lastname = lastname;
this.skintype = skintype;
this.troubletype = troubletype;
this.created = created;
this.modified = modified;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getFirstname() {
return firstname;
}
public void setFirstname(String firstname) {
this.firstname = firstname;
}
public String getLastname() {
return lastname;
}
public void setLastname(String lastname) {
this.lastname = lastname;
}
public Skintype getSkintype() {
return skintype;
}
public void setSkintype(Skintype skintype) {
this.skintype = skintype;
}
public Troubletype getTroubletype() {
return troubletype;
}
public void setTroubletype(Troubletype troubletype) {
this.troubletype = troubletype;
}
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.created = created;
}
public Date getModified() {
return modified;
}
public void setModified(Date modified) {
this.modified = modified;
}
public void initDates() {
Date now = new Date(new java.util.Date().getTime());
if (this.created == null)
this.created = now;
if (this.modified == null)
this.modified = now;
}
}
| [
"santatoon@gmail.com"
] | santatoon@gmail.com |
dc985ed5e8b90893f2d0e9faed773dd930640b05 | 3142b4f08f72f587abe376dd729159bca97d9cac | /src/com/tjh/util/ResourceBundleBackedSingleton.java | b74ab7e8b55ca51fdcaf3311c0697a3d370236f4 | [
"Apache-2.0"
] | permissive | tjhart/tjh-util | 98058ccd04fa7fad61d805a1043e4e50829a24f8 | a50297b9d3a58bed49ddcf0cc217c18cb90b0307 | refs/heads/master | 2021-01-01T19:06:15.204488 | 2013-09-30T15:32:34 | 2013-09-30T15:32:34 | 3,028,103 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 315 | java | package com.tjh.util;
import java.util.ResourceBundle;
public class ResourceBundleBackedSingleton {
public static ResourceBundle getResourceBundle(final Class<?> aClass, final String name) {
return ResourceBundle.getBundle(aClass.getPackage().getName() + "." + aClass.getSimpleName() + name);
}
}
| [
"tjhart@me.com"
] | tjhart@me.com |
358dc05e31713bdb7e338efee2bc14dc6a22e357 | faae3e00a1fd32eb38eeaa3bfdbc0b4f05e994c7 | /src/main/java/com/hamidApp1/dao/companies/impl/CompaniesDaoImpl.java | 52d62c63c5416120c10fa8ebc8735ad367435d61 | [] | no_license | hhammidd/app2 | 11ee5470d393eae51c7712e52a1c25f4b475b448 | 7af6be28215b2110ae320f75e32b6627fed6a8a1 | refs/heads/master | 2020-04-01T17:09:58.388300 | 2019-01-11T17:31:22 | 2019-01-11T17:31:22 | 153,416,283 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 811 | java | package com.hamidApp1.dao.companies.impl;
import com.hamidApp1.dao.companies.CompaniesQueryDao;
import com.hamidApp1.model.companies.Companies;
import org.springframework.stereotype.Component;
import javax.persistence.*;
import java.util.List;
@Component
public class CompaniesDaoImpl implements CompaniesQueryDao {
@PersistenceUnit
protected EntityManagerFactory emf;
@PersistenceContext
protected EntityManager em;
@Override
public List<Companies> findAll() {
TypedQuery<Companies> usersQuery = em.createQuery("SELECT u FROM com.hamidApp1.model.companies.Companies u", Companies.class);
List<Companies> usersRes = usersQuery.getResultList();
System.out.println("Users: " + usersRes);
System.out.println("Done...");
return usersRes;
}
}
| [
"hamid.shafikani@gmail.com"
] | hamid.shafikani@gmail.com |
6d14c75eddefc8ec22f28420276253d0b099137e | 3947391aac8d8351e9b87bcb8a14257098b0f6cf | /src/main/java/by/ntck/sten/dao/impls/SkladDaoImpl.java | a1d923b45a089f79f9eab8d14e301497bba63512 | [] | no_license | VVATOR/SKLADIK_NTCK | 6dad4c91e1a88c0a11d011a9977e87c57da7de08 | ee36cd63489c582ee8c340e8f66ecde28530c918 | refs/heads/master | 2021-03-13T03:46:21.296273 | 2017-05-06T07:21:54 | 2017-05-06T07:21:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,262 | java | package by.ntck.sten.dao.impls;
import java.util.List;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.query.Query;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;
import by.ntck.sten.dao.ISkladDao;
import by.ntck.sten.model.Kladovshik;
import by.ntck.sten.model.Sklad;
@Repository
public class SkladDaoImpl implements ISkladDao {
private static final Logger LOG = LoggerFactory.getLogger(SkladDaoImpl.class);
private SessionFactory sessionFactory;
public void setSessionFactory(SessionFactory sessionFactory) {
this.sessionFactory = sessionFactory;
}
@Override
public void add(Sklad sklad) {
Session session = this.sessionFactory.getCurrentSession();
session.persist(sklad);
LOG.info("Sklad successfully saved. Sklad details: " + sklad);
}
@Override
public void update(Sklad sklad) {
Session session = this.sessionFactory.getCurrentSession();
session.update(sklad);
LOG.info("Sklad successfully update. Sklad details: " + sklad);
}
@Override
public void remove(int id) {
Session session = this.sessionFactory.getCurrentSession();
Sklad sklad = (Sklad) session.load(Sklad.class, new Integer(id));
if (sklad != null){
session.delete(sklad);
}
LOG.info("Sklad successfully removed. Sklad details: " + sklad);
}
@Override
public Sklad getById(int id) {
Session session = this.sessionFactory.getCurrentSession();
Sklad sklad = (Sklad) session.load(Sklad.class, new Integer(id));
LOG.info("Sklad successfully loaded. Sklad detalis: " + sklad);
return sklad;
}
@Override
public List<Sklad> list() {
Session session = this.sessionFactory.getCurrentSession();
List<Sklad> skladList = (List<Sklad>) session.createQuery("from Sklad").list();
for(Sklad sklad : skladList){
LOG.info("Sklad list: " + sklad);
}
return skladList;
}
@Override
public List<Sklad> skladSearch(int sklad_id) {
Session session = this.sessionFactory.getCurrentSession();
List<Sklad> skladList = (List<Sklad>) session.createNativeQuery("SELECT * FROM sklad WHERE id_sklad LIKE %1 ").getResultList();
return skladList;
}
}
| [
"serq106@mail.ru"
] | serq106@mail.ru |
33d7ffe10770836e9eb8a84ad9e4b0e9336a2add | 14e7c43264d2f33f4487ff5c2eac5ec07e687c9b | /aiga3/src/main/java/com/ai/aiga/view/json/StaffMsgRequest.java | d6f6cb5ace02c5b10665ce8880cfb630a654371e | [] | no_license | wang-shun/aiga3 | 0f7e822b28d910b7054f8feb2a81ca05decbd213 | 8eb83d19214dc3637a53178ccc670cb038c052a7 | refs/heads/master | 2020-04-02T06:48:10.308384 | 2018-08-27T10:29:20 | 2018-08-27T10:29:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,185 | java | package com.ai.aiga.view.json;
public class StaffMsgRequest {
private Long staffId;
private String code;
private String name;
private Byte state;
private Long organizeId;
private String organizeName;
private String organizeCode;
public Long getStaffId() {
return staffId;
}
public void setStaffId(Long staffId) {
this.staffId = staffId;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Byte getState() {
return state;
}
public void setState(Byte state) {
this.state = state;
}
public Long getOrganizeId() {
return organizeId;
}
public void setOrganizeId(Long organizeId) {
this.organizeId = organizeId;
}
public String getOrganizeName() {
return organizeName;
}
public void setOrganizeName(String organizeName) {
this.organizeName = organizeName;
}
public String getOrganizeCode() {
return organizeCode;
}
public void setOrganizeCode(String organizeCode) {
this.organizeCode = organizeCode;
}
}
| [
"dch@person"
] | dch@person |
cdd529c8911b8fb7cc1b75d45b216de12e033ed9 | 9c1f462fc3059f4b045eeaaca3ee3b42719569ba | /java-network/src/main/java/com/linkedin/norbert/javacompat/network/RingHashLoadBalancerFactory.java | 0667c094ca0389592d78e76f0a1099dc943b83cf | [
"Apache-2.0"
] | permissive | jhartman/norbert | 56d8431516d612486e00e50eed71715800c4f30b | 65bbff3f516f77b7faab6348b1717837b8481fd9 | refs/heads/master | 2021-01-18T09:04:21.590857 | 2013-06-19T21:00:55 | 2013-06-19T21:00:55 | 609,140 | 11 | 5 | null | 2017-11-06T19:00:51 | 2010-04-13T21:31:03 | Scala | UTF-8 | Java | false | false | 1,533 | java | ///*
//* Copyright 2009-2010 LinkedIn, Inc
//*
//* Licensed under the Apache License, Version 2.0 (the "License"); you may not
//* use this file except in compliance with the License. You may obtain a copy of
//* the License at
//*
//* http://www.apache.org/licenses/LICENSE-2.0
//*
//* Unless required by applicable law or agreed to in writing, software
//* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
//* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
//* License for the specific language governing permissions and limitations under
//* the License.
//*/
//package com.linkedin.norbert.javacompat.network;
//
//import java.util.Set;
//
//import com.linkedin.norbert.cluster.InvalidClusterException;
//import org.apache.log4j.Logger;
//
//import com.linkedin.norbert.javacompat.cluster.Node;
//
//public class RingHashLoadBalancerFactory implements PartitionedLoadBalancerFactory<Integer>
//{
// private static Logger logger = Logger.getLogger(RingHashLoadBalancerFactory.class);
// private final int _numberOfReplicas;
// private final HashFunction<String> _hashingStrategy;
//
// public RingHashLoadBalancerFactory(HashFunction<String> hashing, int numRep)
// {
// _numberOfReplicas = numRep;
// _hashingStrategy = hashing;
// }
//
// @Override
// public PartitionedLoadBalancer<Integer> newLoadBalancer(Set<Endpoint> endpoints) throws InvalidClusterException {
// return new RingHashLoadBalancer(_hashingStrategy, _numberOfReplicas, endpoints);
// }
//}
| [
"jhartman@linkedin.com"
] | jhartman@linkedin.com |
4efa7c884166fb8ff980ca8d8b66b24b171a7045 | 611e0544ff871e5df58f13a5f2898102f521ec8e | /streams/src/main/java/org/apache/kafka/streams/state/TimestampedWindowStore.java | 7d52c12b17ff6df2f33ee6bcf10d9eaf1ae59165 | [
"Apache-2.0",
"GPL-2.0-only",
"LicenseRef-scancode-public-domain",
"W3C",
"CC0-1.0",
"GPL-1.0-or-later",
"CPL-1.0",
"GPL-2.0-or-later",
"LicenseRef-scancode-generic-export-compliance",
"LicenseRef-scancode-other-permissive",
"CC-PDDC",
"BSD-3-Clause",
"APSL-2.0",
"LicenseRef-scancode-free-... | permissive | confluentinc/kafka | 3b0830c0afd81bc84ff409fa9eff61418636d697 | cae0baef40b0d5d97af32256800492cb9d6471df | refs/heads/master | 2023-09-03T12:54:24.118935 | 2023-08-31T18:05:22 | 2023-08-31T18:05:22 | 37,555,321 | 216 | 235 | Apache-2.0 | 2023-09-14T12:05:20 | 2015-06-16T20:48:28 | Java | UTF-8 | Java | false | false | 1,557 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.kafka.streams.state;
import org.apache.kafka.streams.kstream.Windowed;
/**
* Interface for storing the aggregated values of fixed-size time windows.
* <p>
* Note, that the stores's physical key type is {@link Windowed Windowed<K>}.
* In contrast to a {@link WindowStore} that stores plain windowedKeys-value pairs,
* a {@code TimestampedWindowStore} stores windowedKeys-(value/timestamp) pairs.
* <p>
* While the window start- and end-timestamp are fixed per window, the value-side timestamp is used
* to store the last update timestamp of the corresponding window.
*
* @param <K> Type of keys
* @param <V> Type of values
*/
public interface TimestampedWindowStore<K, V> extends WindowStore<K, ValueAndTimestamp<V>> { } | [
"noreply@github.com"
] | noreply@github.com |
f223d5929f728ca530399e8e9c066cc8184ab574 | 83f58e4dd6e7219c22ae494b76e580acf5ca6734 | /core/src/com/patys/llgame/UserInterface/MainView.java | 1bb164c0d1b63382ff51d0e4438032d260d5474f | [] | no_license | Patys/LLGame | 65f21db13ca61bef4ca61a0c7badde1f8a46693b | ede790d55bf9a8afa6a533db3fc42ffb79fdb3e7 | refs/heads/master | 2021-01-19T09:14:30.353889 | 2017-04-30T12:30:35 | 2017-04-30T12:30:35 | 82,078,391 | 0 | 0 | null | null | null | null | WINDOWS-1250 | Java | false | false | 2,280 | java | package com.patys.llgame.UserInterface;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.ui.Table;
import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
import com.badlogic.gdx.scenes.scene2d.ui.TextButton.TextButtonStyle;
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;
public class MainView extends Table{
private TextButton playButton;
private TextButton shopButton;
private TextButton exitButton;
private DefaultSkin skin;
public MainView(final UserInterface userInterface) {
skin = new DefaultSkin();
// // Configure a TextButtonStyle and name it "default". Skin resources are stored by type, so this doesn't overwrite the font.
// TextButtonStyle textButtonStyle = new TextButtonStyle();
// textButtonStyle.up = skin.newDrawable("white", Color.DARK_GRAY);
// textButtonStyle.down = skin.newDrawable("white", Color.DARK_GRAY);
// textButtonStyle.checked = skin.newDrawable("white", Color.BLUE);
// textButtonStyle.over = skin.newDrawable("white", Color.LIGHT_GRAY);
// textButtonStyle.font = skin.getFont("default");
// skin.add("default", textButtonStyle);
//
playButton = new TextButton("Graj", skin.getSkin());
playButton.padLeft(20);
playButton.padRight(20);
playButton.padTop(5);
playButton.padBottom(5);
shopButton = new TextButton("Sklep", skin.getSkin());
shopButton.padLeft(20);
shopButton.padRight(20);
shopButton.padTop(5);
shopButton.padBottom(5);
exitButton = new TextButton("Wyjście", skin.getSkin());
this.add(playButton).space(10);
this.row();
this.add(shopButton).space(10);
this.row();
this.add(exitButton);
playButton.addListener(new ChangeListener() {
@Override
public void changed (ChangeEvent event, Actor actor) {
userInterface.goToGame();
}
});
shopButton.addListener(new ChangeListener() {
@Override
public void changed (ChangeEvent event, Actor actor) {
userInterface.goToShop();
}
});
exitButton.addListener(new ChangeListener() {
@Override
public void changed (ChangeEvent event, Actor actor) {
Gdx.app.exit();
}
});
}
}
| [
"patysprog@gmail.com"
] | patysprog@gmail.com |
80c2ac9184163f264fc0a2ddfac8db5afdf55138 | 15ab1fb61474f85ca7c572774e9dff30e53d4536 | /jpashop-v20210728/src/main/java/jpabook/jpashop/controller/MemberController.java | 2c856d23751bcaaa07acd23b01c4898768590fb9 | [] | no_license | kkjiyeon/1 | 763b2f543769b5df6558e14547a46cccc720d58a | 0161f05ad0448c876b7aa295a5f36e20fedb6fd8 | refs/heads/main | 2023-09-05T05:51:38.866234 | 2021-11-15T05:36:46 | 2021-11-15T05:36:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 74 | java | package jpabook.jpashop.controller;
public class MemberController {
}
| [
"noreply@github.com"
] | noreply@github.com |
cc3ff7c8c5cda1f71db399c8c1168000224586c6 | c1fe7d7dbdb667418430f28a2b49abeab5f7e2e3 | /app/src/main/java/com/kuchingitsolution/asus/eventmanagement/feed/FeedModel.java | 165ee5885b5bd6eb16c77dd1b57fedfbfd93cbf1 | [] | no_license | tw-voon/event-s-ndbox | 1ad1bf467b89182f1f8198abe98d46300df10da2 | 05164937ea2f502ce9633a44d37aa6b15e36bc63 | refs/heads/master | 2020-04-20T07:14:47.934479 | 2019-12-01T07:30:17 | 2019-12-01T07:30:17 | 168,705,575 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,579 | java | package com.kuchingitsolution.asus.eventmanagement.feed;
import org.json.JSONArray;
import org.json.JSONObject;
public class FeedModel {
private String id, username, type_name, location_name, status_name, officer_name, link, last_action, title, description, created_at, suggestion, company_name, lat, lon, start_time, end_time;
private int user_id, type_id, location_id, status_id, officer_id, media_type, bookmark, support, support_this;
public FeedModel(JSONObject form_data, JSONArray responses){
JSONObject locations = form_data.optJSONObject("locations");
JSONObject event_owner = form_data.optJSONObject("user");
JSONArray media = form_data.optJSONArray("media");
JSONObject img_cover = media.optJSONObject(0);
JSONObject resposne = responses.optJSONObject(0);
this.id = form_data.optString("id");
this.user_id = event_owner.optInt("id");
this.username = event_owner.optString("name");
this.type_id = form_data.optInt("category_id");
this.type_name = form_data.optString("category_name");
this.location_id = form_data.optInt("location_id");
this.location_name = locations.optString("name");
this.lat = locations.optString("lat");
this.lon = locations.optString("lon");
this.lon = locations.optString("address");
this.status_id = form_data.optInt("status_id");
this.officer_id = form_data.optInt("officer_id");
this.officer_name = form_data.optString("officer_name", "NULL");
this.title = form_data.optString("title");
this.description = form_data.optString("description");
this.suggestion = form_data.optString("extra_info", null);
this.link = img_cover.optString("link");
this.support = form_data.optInt("support");
this.bookmark = form_data.optInt("bookmarked");
this.created_at = form_data.optString("created_at");
this.company_name = event_owner.optString("name");
this.start_time = form_data.optString("start_time");
this.end_time = form_data.optString("end_time");
if(responses.length() > 0){
this.support_this = resposne.optInt("support");
}
}
public FeedModel(JSONObject form_data){
this.id = form_data.optString("id");
this.user_id = form_data.optInt("user_id");
this.username = form_data.optString("username");
this.type_id = form_data.optInt("type_id");
this.type_name = form_data.optString("type_name");
this.location_id = form_data.optInt("location_id");
this.location_name = form_data.optString("location_name");
this.lat = form_data.optString("lat");
this.lon = form_data.optString("lon");
this.lon = form_data.optString("address");
this.status_id = form_data.optInt("status_id");
this.officer_id = form_data.optInt("officer_id");
this.officer_name = form_data.optString("officer_name", "NULL");
this.title = form_data.optString("title");
this.description = form_data.optString("description");
this.suggestion = form_data.optString("extra_info", null);
this.link = form_data.optString("link");
this.support = form_data.optInt("support");
this.bookmark = form_data.optInt("bookmarked");
this.created_at = form_data.optString("created_at");
this.company_name = form_data.optString("name");
this.start_time = form_data.optString("start_time");
this.end_time = form_data.optString("end_time");
this.support_this = form_data.optInt("support_this");
}
public void setSupport_this(int status){ this.support_this = status; }
public void setSupport(int total){ this.support = total; }
public void setBookmark(int status) { this.bookmark = status; }
public String getUsername(){
return username;
}
public String getReportTitle(){
return title;
}
public String getNewsDescription(){
return description;
}
public String getCreated_at() { return created_at; }
public String getLink(){
return link;
}
public String getId() { return id; }
public String getLocation_name(){ return location_name;}
public int getBookmarked() {return bookmark;}
public int getSupported() {return support; }
public int getSupport_this(){ return this.support_this; }
public int getUser_id(){ return user_id; }
public int getStatus_id(){return status_id;}
public int getType_id(){return type_id;}
public int getLocation_id(){return location_id;}
public int getOfficer_id(){return officer_id;}
public int getMedia_type(){return media_type;}
public int getSupport(){return support;}
public String getOfficer_name() { return officer_name; }
public String getType_name(){return type_name;}
public String getTitle(){ return title;}
public String getDescription(){ return description; }
public String getCompany_name(){return company_name; }
public String getSuggestion() { return suggestion; }
public String getLat(){return lat;}
public String getLon(){return lon;}
public String getStart_time(){ return this.start_time; }
public String getEnd_time(){ return this.end_time; }
public void setOfficer(int id, String name){
this.officer_id = id;
this.officer_name = name;
}
public void support(){
this.support = this.support + 1;
}
public void noSupport(){
this.support = this.support - 1;
}
}
| [
"t.wui1993@gmail.com"
] | t.wui1993@gmail.com |
f53e21ee39da519d4f8b46043e6b3223abb338e2 | 2990a28fbac9fdb37b821b9a7e4e4411b89115e5 | /app/src/main/java/com/izcax/myapplication/model/weather/Weather_.java | a2b5f2b076ec6bc9cdc3db666abe3da0af02fbbb | [] | no_license | Yuzwan19/WeatherApp | baa81927e0f20103a5a6e8fa9cdd9e5ea04c748c | b17284e755dc0808bdc8ecf8d8f5e79018a5f9ff | refs/heads/master | 2021-05-10T21:58:44.115262 | 2018-01-29T14:40:10 | 2018-01-29T14:40:10 | 118,243,954 | 2 | 2 | null | null | null | null | UTF-8 | Java | false | false | 995 | java |
package com.izcax.myapplication.model.weather;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class Weather_ {
@SerializedName("id")
@Expose
private Integer id;
@SerializedName("main")
@Expose
private String main;
@SerializedName("description")
@Expose
private String description;
@SerializedName("icon")
@Expose
private String icon;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getMain() {
return main;
}
public void setMain(String main) {
this.main = main;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
}
| [
"yuzwan19@gmail.com"
] | yuzwan19@gmail.com |
42d33167e82b9fd029f07f7423736ba1affb3d6d | 12e8f5c14ceb0e4c44f20068ead136f0fc5a454d | /app/src/main/java/ggdc/opengooglemaps/MainActivity.java | 35dffb86965540d849682c6a413be4ef2230916b | [] | no_license | ardhityawiedhairawan/OpenGoogleMaps | 2ffa6e30f33fee4a8e9c29cb9028ebf89215afeb | 3238b88828d7e4cc1206a534cd6d442c000bccff | refs/heads/master | 2020-04-02T06:51:13.414646 | 2016-07-22T02:19:16 | 2016-07-22T02:19:16 | 63,837,387 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,204 | java | package ggdc.opengooglemaps;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Button;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button btnNyk = (Button) findViewById(R.id.btnNyk);
btnNyk.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Uri gmmIntentUri = Uri.parse("geo:40.7053048,-73.8976729");
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
mapIntent.setPackage("com.google.android.apps.maps");
startActivity(mapIntent);
}
});
Button btnOld = (Button) findViewById(R.id.btnOld);
btnOld.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Uri gmmIntentUri = Uri.parse("geo:53.4630892,-2.2930782");
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
mapIntent.setPackage("com.google.android.apps.maps");
startActivity(mapIntent);
}
});
Button btnStOld = (Button) findViewById(R.id.btnStOld);
btnStOld.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Uri gmmIntentUri = Uri.parse("google.streetview:cbll=53.4633197,-2.2915337");
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
mapIntent.setPackage("com.google.android.apps.maps");
startActivity(mapIntent);
}
});
Button btnMount = (Button) findViewById(R.id.btnMount);
btnMount.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Uri gmmIntentUri = Uri.parse("geo:27.9893083,86.9237386");
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
mapIntent.setPackage("com.google.android.apps.maps");
startActivity(mapIntent);
}
});
Button btnStMount = (Button) findViewById(R.id.btnStMount);
btnStMount.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Uri gmmIntentUri = Uri.parse("google.streetview:cbll=27.9531846,86.6944041");
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
mapIntent.setPackage("com.google.android.apps.maps");
startActivity(mapIntent);
}
});
Button btnYog = (Button) findViewById(R.id.btnYog);
btnYog.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Uri gmmIntentUri = Uri.parse("geo:-7.7928119,110.3660043?q=restaurant");
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
mapIntent.setPackage("com.google.android.apps.maps");
startActivity(mapIntent);
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
| [
"ardhityawiedhairawan@gmail.com"
] | ardhityawiedhairawan@gmail.com |
82428468116bed32b8a3a5c9eff4bf4a08d083f3 | 6753cefcba35f3972bffbb61b8d280157a424b82 | /P7/module_base/src/main/java/com/gwchina/sdk/base/data/NetProviderImpl.java | 49e78548ca5c4a70097f12623470b5c14c8fb7a5 | [] | no_license | ancient-yan/PermissionsManager | 224b933dda5fe62daa4f191e2b5b5e0145ef31a8 | 4e70b51046e5f0aaa3467c3f95f61600f4b17774 | refs/heads/master | 2021-07-17T01:15:08.434213 | 2021-07-16T10:08:37 | 2021-07-16T10:08:37 | 95,729,181 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,534 | java | package com.gwchina.sdk.base.data;
import com.android.base.utils.android.ResourceUtils;
import com.android.sdk.net.core.ExceptionFactory;
import com.android.sdk.net.core.Result;
import com.android.sdk.net.exception.ApiErrorException;
import com.android.sdk.net.provider.ApiHandler;
import com.android.sdk.net.provider.ErrorDataAdapter;
import com.android.sdk.net.provider.ErrorMessage;
import com.android.sdk.net.provider.HttpConfig;
import com.android.sdk.net.provider.PostTransformer;
import com.app.base.BuildConfig;
import com.app.base.R;
import com.gwchina.sdk.base.data.api.ApiHelper;
import com.gwchina.sdk.base.data.api.ApiSpecification;
import com.gwchina.sdk.base.data.api.RetryWhenDeviceMissing;
import com.gwchina.sdk.base.data.exception.DeviceAlreadyBoundException;
import com.gwchina.sdk.base.data.exception.DeviceNotExistException;
import com.gwchina.sdk.base.data.exception.DeviceNotSupportException;
import com.gwchina.sdk.base.debug.DebugTools;
import org.reactivestreams.Publisher;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.util.concurrent.TimeUnit;
import io.reactivex.Flowable;
import io.reactivex.Observable;
import io.reactivex.ObservableSource;
import io.reactivex.Single;
import io.reactivex.SingleSource;
import okhttp3.OkHttpClient;
import okhttp3.ResponseBody;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
import timber.log.Timber;
/**
* @author Ztiany
* Email: ztiany3@gmail.com
* Date : 2018-11-08 16:16
*/
final class NetProviderImpl {
ExceptionFactory mExceptionFactory = new ExceptionFactory() {
final int CODE_DEVICE_ALREADY_BOUND = 2;
final int CODE_DEVICE_NOT_EXIST = 20;
final int CODE_DEVICE_NOT_SUPPORT = 22;
@Override
public Exception create(Result result) {
if (result.getCode() == CODE_DEVICE_ALREADY_BOUND) {
return new DeviceAlreadyBoundException(result.getCode(), result.getMessage());
} else if (result.getCode() == CODE_DEVICE_NOT_EXIST) {
return new DeviceNotExistException(result.getCode(), result.getMessage());
} else if (result.getCode() == CODE_DEVICE_NOT_SUPPORT) {
return new DeviceNotSupportException(result.getCode(), result.getMessage());
}
return null;
}
};
ApiHandler mApiHandler = result -> {
int code = result.getCode();
//登录状态已过期,请重新登录、账号在其他设备登陆
if (ApiHelper.isLoginExpired(code) || ApiHelper.isSSOLoginExpired(code)) {
DataContext.getInstance().publishLoginExpired(code);
}
};
HttpConfig mHttpConfig = new HttpConfig() {
private static final int CONNECTION_TIME_OUT = 10;
private static final int IO_TIME_OUT = 20;
@Override
public void configHttp(OkHttpClient.Builder builder) {
//常规配置
builder.connectTimeout(CONNECTION_TIME_OUT, TimeUnit.SECONDS)
.readTimeout(IO_TIME_OUT, TimeUnit.SECONDS)
.writeTimeout(IO_TIME_OUT, TimeUnit.SECONDS)
.hostnameVerifier((hostname, session) -> {
Timber.d("hostnameVerifier called with: hostname 、session = [" + hostname + "、" + session.getProtocol() + "]");
return true;
});
//调试配置
configDebug(builder);
//Api 规范
ApiSpecification.configHttp(builder);
}
void configDebug(OkHttpClient.Builder builder) {
if (BuildConfig.openDebug) {
HttpLoggingInterceptor httpLoggingInterceptor = new HttpLoggingInterceptor(
message -> Timber.tag("===OkHttp===").i(message)
);
httpLoggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
builder.addInterceptor(httpLoggingInterceptor);
DebugTools.installStethoHttp(builder);
}
}
@Override
public boolean configRetrofit(Retrofit.Builder builder) {
return false;
}
@Override
public String baseUrl() {
return DataContext.baseUrl();
}
};
ErrorMessage mErrorMessage = new ErrorMessage() {
@Override
public CharSequence netErrorMessage(Throwable exception) {
return ResourceUtils.getString(R.string.error_net_error);
}
@Override
public CharSequence serverDataErrorMessage(Throwable exception) {
return ResourceUtils.getString(R.string.error_service_data_error);
}
@Override
public CharSequence serverErrorMessage(Throwable exception) {
return ResourceUtils.getString(R.string.error_service_error);
}
@Override
public CharSequence clientRequestErrorMessage(Throwable exception) {
return ResourceUtils.getString(R.string.error_request_error);
}
@Override
public CharSequence apiErrorMessage(ApiErrorException exception) {
return ResourceUtils.getString(R.string.error_api_code_mask_tips, exception.getCode());
}
@Override
public CharSequence unknowErrorMessage(Throwable exception) {
return ResourceUtils.getString(R.string.error_unknow);
}
};
ErrorDataAdapter mErrorDataAdapter = new ErrorDataAdapter() {
@Override
public Object createErrorDataStub(Type type, Annotation[] annotations, Retrofit retrofit, ResponseBody value) {
return ApiHelper.newErrorDataStub();
}
@Override
public boolean isErrorDataStub(Object object) {
return ApiHelper.isDataError(object);
}
};
PostTransformer mPostTransformer = new PostTransformer<Object>() {
@Override
public SingleSource<Object> apply(Single<Object> upstream) {
return upstream.retryWhen(RetryWhenDeviceMissing.newRetryWhenDeviceMissingFlowable(3));
}
@Override
public Publisher<Object> apply(Flowable<Object> upstream) {
return upstream.retryWhen(RetryWhenDeviceMissing.newRetryWhenDeviceMissingFlowable(3));
}
@Override
public ObservableSource<Object> apply(Observable<Object> upstream) {
return upstream.retryWhen(RetryWhenDeviceMissing.newRetryWhenDeviceMissingObservable(3));
}
};
} | [
"yan--qiang@sohu.com"
] | yan--qiang@sohu.com |
53679321e00a5fd7d242d0cb9cf607485ad8a44d | de7b19dbc84cd1410ab6a52fa37ebf1254e7d9a6 | /app/src/main/java/io/github/aungkothet/padc/assignment5/network/dataAgents/OkHttpDataAgentImpl.java | 14f756b7ae4c49e76f0859ae32614283a99edd88 | [] | no_license | aungkothet/Assignment5 | 0361acdb21c968040b82987181b6f49d4386811f | 2a92a62074f448ba15dfa11eda386ffec89dbb5f | refs/heads/master | 2020-07-15T00:06:05.510186 | 2019-09-06T18:39:44 | 2019-09-06T18:39:44 | 205,432,858 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,293 | java | package io.github.aungkothet.padc.assignment5.network.dataAgents;
import android.os.AsyncTask;
import com.google.gson.Gson;
import io.github.aungkothet.padc.assignment5.network.responses.GetHouseListResponse;
import io.github.aungkothet.padc.assignment5.utils.Constants;
import okhttp3.FormBody;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
import static io.github.aungkothet.padc.assignment5.utils.Constants.EM_NULL_RESPONSE;
import static java.util.concurrent.TimeUnit.SECONDS;
public class OkHttpDataAgentImpl implements HouseDataAgent {
private static OkHttpDataAgentImpl objInstance;
private OkHttpClient mHttpClient;
private OkHttpDataAgentImpl() {
mHttpClient = new OkHttpClient.Builder()
.connectTimeout(15, SECONDS)
.writeTimeout(15, SECONDS)
.readTimeout(15, SECONDS)
.build();
}
public static OkHttpDataAgentImpl getObjInstance() {
if (objInstance == null) {
objInstance = new OkHttpDataAgentImpl();
}
return objInstance;
}
@Override
public void getHouseList(String accessToken, GetHouseListFromNetworkDelegates delegates) {
new GetEventsTask(mHttpClient, accessToken, delegates).execute();
}
private static class GetEventsTask extends AsyncTask<Void, Void, GetHouseListResponse> {
OkHttpClient httpClient;
String accessToken;
GetHouseListFromNetworkDelegates delegates;
public GetEventsTask(OkHttpClient okHttpClient, String accessToken, GetHouseListFromNetworkDelegates delegates) {
this.httpClient = okHttpClient;
this.accessToken = accessToken;
this.delegates = delegates;
}
@Override
protected GetHouseListResponse doInBackground(Void... voids) {
RequestBody requestBody = new FormBody.Builder()
.add(Constants.PARAM_ACCESS_TOKEN, accessToken)
.build();
Request request = new Request.Builder()
.url(Constants.URL_GET_ALL_HOUSE)
.post(requestBody)
.build();
try {
Response response = httpClient.newCall(request).execute();
if (response.isSuccessful()) {
String responseString = response.body().string();
GetHouseListResponse getEventsResponse = new Gson().fromJson(responseString, GetHouseListResponse.class);
return getEventsResponse;
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
@Override
protected void onPostExecute(GetHouseListResponse getEventsResponse) {
super.onPostExecute(getEventsResponse);
if (getEventsResponse != null) {
if (getEventsResponse.isResponseOk()) {
delegates.onSuccess(getEventsResponse.getData());
} else {
delegates.onFailure(getEventsResponse.getMessage());
}
} else {
delegates.onFailure(EM_NULL_RESPONSE);
}
}
}
}
| [
"aungkothet@ucsy.edu.mm"
] | aungkothet@ucsy.edu.mm |
d4d5186cb1a636469abdea276fe88fd70300b877 | 55c3e72b969082e02fe490c006030efc157aa6b2 | /jas-score-service/src/main/java/com/wizinno/jas/score/domain/model/Score.java | 189d2e3d0ae68e8b6bd603eff97eee1bcf06e15b | [] | no_license | yanglong1360075452/jas_lot_cloud | 4c457b373da47be4b1d08acbdfe1199a7658ab47 | b782ff1be3d1176e67e03ede208cf7d4aeb49873 | refs/heads/master | 2021-05-11T10:00:53.802417 | 2018-01-19T07:09:36 | 2018-01-19T07:09:36 | 118,090,335 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,700 | java | package com.wizinno.jas.score.domain.model;
import java.io.Serializable;
import java.util.Date;
public class Score implements Serializable {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column score.id
*
* @mbggenerated Thu Aug 17 15:34:25 CST 2017
*/
private Long id;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column score.user_id
*
* @mbggenerated Thu Aug 17 15:34:25 CST 2017
*/
private Long userId;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column score.score_change
*
* @mbggenerated Thu Aug 17 15:34:25 CST 2017
*/
private Integer scoreChange;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column score.change_value
*
* @mbggenerated Thu Aug 17 15:34:25 CST 2017
*/
private String changeValue;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column score.surplus_score
*
* @mbggenerated Thu Aug 17 15:34:25 CST 2017
*/
private Long surplusScore;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column score.create_time
*
* @mbggenerated Thu Aug 17 15:34:25 CST 2017
*/
private Date createTime;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column score.update_time
*
* @mbggenerated Thu Aug 17 15:34:25 CST 2017
*/
private Date updateTime;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table score
*
* @mbggenerated Thu Aug 17 15:34:25 CST 2017
*/
private static final long serialVersionUID = 1L;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column score.id
*
* @return the value of score.id
*
* @mbggenerated Thu Aug 17 15:34:25 CST 2017
*/
public Long getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column score.id
*
* @param id the value for score.id
*
* @mbggenerated Thu Aug 17 15:34:25 CST 2017
*/
public void setId(Long id) {
this.id = id;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column score.user_id
*
* @return the value of score.user_id
*
* @mbggenerated Thu Aug 17 15:34:25 CST 2017
*/
public Long getUserId() {
return userId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column score.user_id
*
* @param userId the value for score.user_id
*
* @mbggenerated Thu Aug 17 15:34:25 CST 2017
*/
public void setUserId(Long userId) {
this.userId = userId;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column score.score_change
*
* @return the value of score.score_change
*
* @mbggenerated Thu Aug 17 15:34:25 CST 2017
*/
public Integer getScoreChange() {
return scoreChange;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column score.score_change
*
* @param scoreChange the value for score.score_change
*
* @mbggenerated Thu Aug 17 15:34:25 CST 2017
*/
public void setScoreChange(Integer scoreChange) {
this.scoreChange = scoreChange;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column score.change_value
*
* @return the value of score.change_value
*
* @mbggenerated Thu Aug 17 15:34:25 CST 2017
*/
public String getChangeValue() {
return changeValue;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column score.change_value
*
* @param changeValue the value for score.change_value
*
* @mbggenerated Thu Aug 17 15:34:25 CST 2017
*/
public void setChangeValue(String changeValue) {
this.changeValue = changeValue;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column score.surplus_score
*
* @return the value of score.surplus_score
*
* @mbggenerated Thu Aug 17 15:34:25 CST 2017
*/
public Long getSurplusScore() {
return surplusScore;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column score.surplus_score
*
* @param surplusScore the value for score.surplus_score
*
* @mbggenerated Thu Aug 17 15:34:25 CST 2017
*/
public void setSurplusScore(Long surplusScore) {
this.surplusScore = surplusScore;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column score.create_time
*
* @return the value of score.create_time
*
* @mbggenerated Thu Aug 17 15:34:25 CST 2017
*/
public Date getCreateTime() {
return createTime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column score.create_time
*
* @param createTime the value for score.create_time
*
* @mbggenerated Thu Aug 17 15:34:25 CST 2017
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column score.update_time
*
* @return the value of score.update_time
*
* @mbggenerated Thu Aug 17 15:34:25 CST 2017
*/
public Date getUpdateTime() {
return updateTime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column score.update_time
*
* @param updateTime the value for score.update_time
*
* @mbggenerated Thu Aug 17 15:34:25 CST 2017
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
} | [
"1360075452@qq.com"
] | 1360075452@qq.com |
7feec7ad5050a62cff7bba07f87e05b6887998db | 5e1d9c02a5e2b53e7620917db2536ee4891bbae8 | /app/src/test/java/com/bysj/chatting/ExampleUnitTest.java | ffbf139bfd097e408173d69446c13bd6994229ed | [] | no_license | zhouqianyu/chatting_android | 544889113c9c02f825eed83f030800d0f1e49d00 | 6576d5fe2ef800731fb7834a074d7ac5f40e9e30 | refs/heads/master | 2020-05-17T19:47:05.813448 | 2019-05-19T05:11:16 | 2019-05-19T05:11:16 | 183,925,733 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 395 | java | package com.bysj.chatting;
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() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"shao-xin@qq.com"
] | shao-xin@qq.com |
def11d83f517c82eccf94d2c2a4436dfcf1af7e8 | 5fa4fa9b5a8eaf1609f112e5a778935d98e65985 | /app/src/main/java/com/letv/leauto/ecolink/utils/ShadowViewHelper.java | 68423fb928e26b2a64be242e13e6dbff47c3bdd2 | [] | no_license | xingfeng2010/LinkProject | fbde6052101626a87b164ac20e501c69ed6771e0 | 7fc5b1f451cf609cc919e2d8280c2393f8e6449f | refs/heads/master | 2021-01-22T13:03:18.510617 | 2017-09-16T12:57:52 | 2017-09-16T12:57:52 | 102,362,315 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 5,662 | java | package com.letv.leauto.ecolink.utils;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.StateListDrawable;
import android.os.Build;
import android.view.View;
import android.view.ViewTreeObserver;
public class ShadowViewHelper {
private ShadowProperty shadowProperty;
private View view;
private ShadowViewDrawable shadowViewDrawable;
private ShadowViewDrawable shadowViewDrawableHighlighted;
private int color;
private int highlightedColor;
private float rx;
private float ry;
private StateListDrawable stateListDrawable;
public static ShadowViewHelper bindShadowHelper(ShadowProperty shadowProperty, View view) {
return new ShadowViewHelper(shadowProperty, view, Color.WHITE, Color.WHITE, 0, 0);
}
public static ShadowViewHelper bindShadowHelper(ShadowProperty shadowProperty, View view, int color) {
return new ShadowViewHelper(shadowProperty, view, color, color, 0, 0);
}
public static ShadowViewHelper bindShadowHelper(ShadowProperty shadowProperty, View view, int color, int highlightedColor) {
return new ShadowViewHelper(shadowProperty, view, color, highlightedColor, 0, 0);
}
public static ShadowViewHelper bindShadowHelper(ShadowProperty shadowProperty, View view, float rx, float ry) {
return new ShadowViewHelper(shadowProperty, view, Color.WHITE, Color.WHITE, rx, ry);
}
public static ShadowViewHelper bindShadowHelper(ShadowProperty shadowProperty, View view, int color, float rx, float ry) {
return new ShadowViewHelper(shadowProperty, view, color, color, rx, ry);
}
public static ShadowViewHelper bindShadowHelper(ShadowProperty shadowProperty, View view, int color, int highlightedColor, float rx, float ry) {
return new ShadowViewHelper(shadowProperty, view, color, highlightedColor, rx, ry);
}
private ShadowViewHelper(ShadowProperty shadowProperty, View view, int color, int highlightedColor, float rx, float ry) {
this.shadowProperty = shadowProperty;
this.view = view;
this.color = color;
this.highlightedColor = highlightedColor;
this.rx = rx;
this.ry = ry;
// If default color is not the same as highlighted color,
// then set background to be a StateListDrawable
init(this.color != this.highlightedColor ? true : false);
}
private void init(boolean useStateListDrawable) {
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.HONEYCOMB) {
view.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
}
int shadowOffset = shadowProperty.getShadowOffset();
view.setPadding(view.getPaddingLeft() + shadowOffset, view.getPaddingTop() + shadowOffset, view.getPaddingRight() + shadowOffset, view.getPaddingBottom() + shadowOffset);
shadowViewDrawable = new ShadowViewDrawable(shadowProperty, color, rx, ry);
view.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
shadowViewDrawable.setBounds(0, 0, view.getMeasuredWidth(), view.getMeasuredHeight());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
view.getViewTreeObserver().removeOnGlobalLayoutListener(this);
} else {
view.getViewTreeObserver().removeGlobalOnLayoutListener(this);
}
}
});
// Create StateListDrawable with different states if highlighted color is different from default colour.
if (useStateListDrawable) {
shadowViewDrawableHighlighted = new ShadowViewDrawable(shadowProperty, highlightedColor, rx, ry);
view.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
shadowViewDrawableHighlighted.setBounds(0, 0, view.getMeasuredWidth(), view.getMeasuredHeight());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
view.getViewTreeObserver().removeOnGlobalLayoutListener(this);
} else {
view.getViewTreeObserver().removeGlobalOnLayoutListener(this);
}
}
});
stateListDrawable = new StateListDrawable();
int[] stateHighlighted = new int[]{android.R.attr.state_pressed};
Drawable highlightedDrawable = shadowViewDrawableHighlighted;
stateListDrawable.addState(stateHighlighted, highlightedDrawable);
int[] stateNormal = new int[]{};
Drawable normalDrawable = shadowViewDrawable;
stateListDrawable.addState(stateNormal, normalDrawable);
}
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
if (stateListDrawable != null) {
view.setBackgroundDrawable(stateListDrawable);
} else {
view.setBackgroundDrawable(shadowViewDrawable);
}
} else {
if (stateListDrawable != null) {
view.setBackground(stateListDrawable);
} else {
view.setBackground(shadowViewDrawable);
}
}
}
public ShadowViewDrawable getShadowViewDrawable() {
return shadowViewDrawable;
}
public View getView() {
return view;
}
public ShadowProperty getShadowProperty() {
return shadowProperty;
}
}
| [
"583354000@qq.com"
] | 583354000@qq.com |
561472bb493621a53ac1dd77534d803caa92f94f | 623b26eb3eaba1847179fce3633ffda0f8dce0b6 | /OpenxUseApi/src/main/java/com/orbit/openx/utils/Constants.java | e10f39664e65d0611f47a57aa650bce1abe45812 | [] | no_license | mrarbi/openx | 03d0e020c081b0f1e9959b7a6335b3d9d6a6d486 | c15da985d03d4efcb9d73bb5738301074ee69acd | refs/heads/master | 2016-09-05T18:28:32.885757 | 2015-01-12T14:10:08 | 2015-01-12T14:10:08 | 29,138,280 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 586 | java | package com.orbit.openx.utils;
public interface Constants {
public static final String FORMAT_DATE_SIMPLE = "dd/MM/yyyy";
public static final String PROTOCOL_HTTP_SLACH = "http://";
public static final String PARAM_ID_EQUAL = "?id=";
public static final String FUNCTION_AD_SCRIPT = "OA_show";
public static final String TAG_TYPE_JAVASCRIPT_HEADER = "javaScript-Header";
public static final String TAG_TYPE_JAVASCRIPT = "javaScript";
public static final String TAG_TYPE_IFRAME = "iframe";
public static final String TAG_TYPE_NOSCRIPT = "noscript";
}
| [
"m.arbi@PC35-PC.orbit.dom"
] | m.arbi@PC35-PC.orbit.dom |
5bd6832d64d86e55d78b89ae16854026dff10e0f | 4984ce7b008b27c85a46510ab08f3e883677490d | /jdroid-android/src/main/java/com/jdroid/android/location/LocationHelper.java | ca9e30086ca760bed2189dd92598e7bd3fd6d0b3 | [
"Apache-2.0"
] | permissive | ADao12/jdroid | 6e1b8b02bf620756ac6f3d91a7fe1416f44b0902 | 0eafe588e9c8cd8ab16cfb52cc12c0a57012759f | refs/heads/master | 2021-01-15T20:23:31.075855 | 2015-07-27T02:54:16 | 2015-07-27T02:54:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,980 | java | package com.jdroid.android.location;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.os.SystemClock;
import com.jdroid.android.AbstractApplication;
import com.jdroid.android.utils.AlarmUtils;
import com.jdroid.java.utils.LoggerUtils;
import org.slf4j.Logger;
import java.util.List;
public class LocationHelper implements LocationListener {
private static final Logger LOGGER = LoggerUtils.getLogger(LocationHelper.class);
private static final String GPS_TIMEOUT_ACTION = "ACTION_GPS_TIMEOUT";
// 5 minutes
public static final Long DEFAULT_FREQUENCY = 300000L;
// 2 minutes
private static final int MAXIMUM_TIME_DELTA = 120000;
private static final LocationHelper INSTANCE = new LocationHelper();
private static final int LOCATION_MIN_TIME = 10000;
private static final int LOCATION_MAX_TIME = 30000;
private Location location;
private Long locationTime;
private Boolean started = false;
private LocationManager locationManager;
public static LocationHelper get() {
return INSTANCE;
}
public LocationHelper() {
// Acquire a reference to the system Location Manager
locationManager = (LocationManager)AbstractApplication.get().getSystemService(Context.LOCATION_SERVICE);
BroadcastReceiver stopLocalizationBroadcastReceiver = (new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
stopLocalization();
}
});
AbstractApplication.get().registerReceiver(stopLocalizationBroadcastReceiver,
new IntentFilter(GPS_TIMEOUT_ACTION));
}
public Boolean isLocalizationEnabled() {
return locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)
|| locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
}
/**
* Register the listener with the Location Manager to receive location updates
*/
public synchronized void startLocalization() {
if (!started && hasSignificantlyOlderLocation()) {
started = true;
// get all enabled providers
List<String> enabledProviders = locationManager.getProviders(true);
boolean gpsProviderEnabled = enabledProviders != null && enabledProviders.contains(LocationManager.GPS_PROVIDER);
boolean networkProviderEnabled = enabledProviders != null && enabledProviders.contains(LocationManager.NETWORK_PROVIDER);
if (gpsProviderEnabled || networkProviderEnabled) {
if (gpsProviderEnabled) {
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, LOCATION_MIN_TIME, 0, this);
}
if (networkProviderEnabled) {
locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, LOCATION_MIN_TIME, 0, this);
}
AlarmUtils.scheduleElapsedRealtimeAlarm(SystemClock.elapsedRealtime() + LOCATION_MAX_TIME,
getCancelPendingIntent());
LOGGER.info("Localization started");
} else {
started = false;
LOGGER.info("All providers disabled");
}
}
}
private PendingIntent getCancelPendingIntent() {
Intent gpsIntent = new Intent(GPS_TIMEOUT_ACTION);
return PendingIntent.getBroadcast(AbstractApplication.get(), 0, gpsIntent,
PendingIntent.FLAG_CANCEL_CURRENT);
}
/**
* Remove the listener to receive location updates
*/
public synchronized void stopLocalization() {
if (started) {
AlarmUtils.cancelAlarm(getCancelPendingIntent());
locationManager.removeUpdates(this);
if (location == null) {
location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
if (location == null) {
location = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
}
locationTime = System.currentTimeMillis();
}
started = false;
LOGGER.info("Localization stopped");
}
}
/**
* @see android.location.LocationListener#onLocationChanged(android.location.Location)
*/
@Override
public void onLocationChanged(Location location) {
if (isBetterLocation(location, this.location)) {
LOGGER.info("Location changed");
this.location = location;
locationTime = System.currentTimeMillis();
} else {
LOGGER.info("Location discarded");
}
}
public void onMapLocationChanged(Location location) {
if (location != null) {
LOGGER.info("Location changed");
this.location = location;
locationTime = System.currentTimeMillis();
} else {
LOGGER.info("Location discarded");
}
}
/**
* @see android.location.LocationListener#onStatusChanged(java.lang.String, int, android.os.Bundle)
*/
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
// Do Nothing
}
/**
* @see android.location.LocationListener#onProviderEnabled(java.lang.String)
*/
@Override
public void onProviderEnabled(String provider) {
LOGGER.info("Provider enabled: " + provider);
// Do Nothing
}
/**
* @see android.location.LocationListener#onProviderDisabled(java.lang.String)
*/
@Override
public void onProviderDisabled(String provider) {
LOGGER.info("Provider disabled: " + provider);
// Do Nothing
}
/**
* Determines whether one Location reading is better than the current Location fix
*
* @param location The new Location that you want to evaluate
* @param currentBestLocation The current Location fix, to which you want to compare the new one
*/
protected boolean isBetterLocation(Location location, Location currentBestLocation) {
if (currentBestLocation == null) {
// A new location is always better than no location
return true;
}
// Check whether the new location fix is newer or older
long timeDelta = location.getTime() - currentBestLocation.getTime();
boolean isSignificantlyNewer = timeDelta > MAXIMUM_TIME_DELTA;
boolean isSignificantlyOlder = timeDelta < -MAXIMUM_TIME_DELTA;
boolean isNewer = timeDelta > 0;
// If it's been more than two minutes since the current location, use the new location
// because the user has likely moved
if (isSignificantlyNewer) {
return true;
// If the new location is more than two minutes older, it must be worse
} else if (isSignificantlyOlder) {
return false;
}
// Check whether the new location fix is more or less accurate
int accuracyDelta = (int)(location.getAccuracy() - currentBestLocation.getAccuracy());
boolean isLessAccurate = accuracyDelta > 0;
boolean isMoreAccurate = accuracyDelta < 0;
boolean isSignificantlyLessAccurate = accuracyDelta > 200;
// Check if the old and new location are from the same provider
boolean isFromSameProvider = isSameProvider(location.getProvider(), currentBestLocation.getProvider());
// Determine location quality using a combination of timeliness and accuracy
if (isMoreAccurate) {
return true;
} else if (isNewer && !isLessAccurate) {
return true;
} else if (isNewer && !isSignificantlyLessAccurate && isFromSameProvider) {
return true;
}
return false;
}
/**
* Checks whether two providers are the same
*
* @param provider1
* @param provider2
* @return
*/
private boolean isSameProvider(String provider1, String provider2) {
if (provider1 == null) {
return provider2 == null;
}
return provider1.equals(provider2);
}
/**
* @return the location
*/
public Location getLocation() {
return location;
}
public Boolean hasLocation() {
return location != null;
}
public Boolean hasSignificantlyOlderLocation() {
if (location != null) {
long timeDelta = System.currentTimeMillis() - locationTime;
return timeDelta > MAXIMUM_TIME_DELTA;
}
return true;
}
public Double getLatitude() {
return location != null ? location.getLatitude() : null;
}
public Double getLongitude() {
return location != null ? location.getLongitude() : null;
}
}
| [
"maxirosson@gmail.com"
] | maxirosson@gmail.com |
0545f4aef29e04722469c330f14bc897124ba5f8 | 3da2091b4ba1efe3ebb9797d12c290b4f2a72bb4 | /src/main/java/com/wzj/jpatest/repository/GoodsRepository.java | 9a50e7af531e713109f961fdc313cc82a370d7f4 | [] | no_license | 778557665/jpatest | 15475d6c0d2df179c080a60ba4f22a66580ffe96 | ca2e7545eb9de85a6cc8d7994e11b1b6ee142572 | refs/heads/master | 2020-04-04T19:04:44.134142 | 2019-03-14T09:32:57 | 2019-03-14T09:32:57 | 156,190,973 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 269 | java | package com.wzj.jpatest.repository;
import com.wzj.jpatest.bean.Goods;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface GoodsRepository extends JpaRepository<Goods, Long> {
}
| [
"wengzhoujun@zhibitech.com"
] | wengzhoujun@zhibitech.com |
d0bad902791f56aba79ba362f4e7d30c37a6daec | dfa5d7f16f171e6a52d92f24827ccaf6c5eccf54 | /modules/services/src/main/java/billiongoods/server/services/payment/impl/HibernateTimeline.java | d90937b7952faa495f67ded5f13adfdaeeddba18 | [] | no_license | Letractively/wisematches.temp | 4ebdbb74387fb32d1c171330864f2c60ece24108 | a1466a1ccc1f054398cd2aedc2aa44a72f21a4f9 | refs/heads/master | 2016-08-12T18:39:31.497465 | 2015-01-20T07:40:02 | 2015-01-20T07:40:02 | 45,893,186 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,951 | java | package billiongoods.server.services.payment.impl;
import billiongoods.server.services.payment.Timeline;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import java.time.LocalDateTime;
import java.time.temporal.Temporal;
/**
* @author Sergey Klimenko (smklimenko@gmail.com)
*/
@Embeddable
public class HibernateTimeline implements Timeline {
@Column(name = "created")
private LocalDateTime created;
@Column(name = "started")
private LocalDateTime started;
@Column(name = "processed")
private LocalDateTime processed;
@Column(name = "shipped")
private LocalDateTime shipped;
@Column(name = "finished")
private LocalDateTime finished;
@Deprecated
HibernateTimeline() {
}
HibernateTimeline(LocalDateTime created) {
this.created = created;
}
@Override
public Temporal getCreated() {
return created;
}
@Override
public Temporal getStarted() {
return started;
}
@Override
public Temporal getProcessed() {
return processed;
}
@Override
public Temporal getShipped() {
return shipped;
}
@Override
public Temporal getFinished() {
return finished;
}
void setStarted(LocalDateTime started) {
if (this.started != null) {
throw new IllegalStateException("Timeline already has started point");
}
this.started = started;
}
void setProcessed(LocalDateTime processed) {
if (this.processed != null) {
throw new IllegalStateException("Timeline already has processed point");
}
this.processed = processed;
}
void setShipped(LocalDateTime shipped) {
if (this.shipped != null) {
throw new IllegalStateException("Timeline already has shipped point");
}
this.shipped = shipped;
}
void setFinished(LocalDateTime finished) {
if (this.finished != null) {
throw new IllegalStateException("Timeline already has finished point");
}
this.finished = finished;
}
}
| [
"smklimenko@localhost"
] | smklimenko@localhost |
955c5c1988d9c6c1360889e6ac9518b0f78d5443 | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /large-multiproject/project22/src/test/java/org/gradle/test/performance22_5/Test22_495.java | c5048693ea2439082cf8b628dd693d8609aee5f6 | [] | no_license | gradle/performance-comparisons | b0d38db37c326e0ce271abebdb3c91769b860799 | e53dc7182fafcf9fedf07920cbbea8b40ee4eef4 | refs/heads/master | 2023-08-14T19:24:39.164276 | 2022-11-24T05:18:33 | 2022-11-24T05:18:33 | 80,121,268 | 17 | 15 | null | 2022-09-30T08:04:35 | 2017-01-26T14:25:33 | null | UTF-8 | Java | false | false | 292 | java | package org.gradle.test.performance22_5;
import static org.junit.Assert.*;
public class Test22_495 {
private final Production22_495 production = new Production22_495("value");
@org.junit.Test
public void test() {
assertEquals(production.getProperty(), "value");
}
} | [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
4f4b87e84a665a1b1bf88488eb0ae313d1bd09ad | 6a254cd9ff0b1628d1e9ab7b9c85de4f710bcc64 | /ShapesProject/test/RightIsoscelesTest.java | 5221f5d8fcc82f4c203e6bce6703204259248058 | [] | no_license | Full-Creative/Projects | 2631c8021bc1aa5ae294f2996b157ce839660cf7 | c66863120829585f95eba535f014ea4024fcb861 | refs/heads/main | 2023-02-26T14:40:40.450866 | 2021-01-29T05:57:24 | 2021-01-29T05:57:24 | 314,543,435 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 621 | java | import static org.junit.Assert.*;
import org.junit.Test;
public class RightIsoscelesTest {
@Test
public void testDraw() {
String result = new RightIsosceles().draw(3);
assertEquals("*\n**\n***\n", result);
}
@Test
public void testDraw1() {
String result = new RightIsosceles().draw(4);
assertEquals("*\n**\n***\n****\n", result);
}
@Test
public void testDraw2() {
String result = new RightIsosceles().draw(5);
assertEquals("*\n**\n***\n****\n*****\n", result);
}
@Test
public void testDraw3() {
String result = new RightIsosceles().draw(6);
assertNotEquals("*\n**\n***\n", result);
}
}
| [
"vaishu2395@gmail.com"
] | vaishu2395@gmail.com |
bb446c942805dc68e2d2d41b81af7c57a7f4aaba | 373dac46f510933d0f739849bf430a0b7a0dddf2 | /src/main/java/net/filippov/uniastrum/blackbase_handler/writers/CsvWriter.java | 8138883a1012973634222b3adbc0953ebfe1951a | [] | no_license | oleg-filippov/blackbase-handler | 7f4aa2637291a95e1efa341529a688b1850dd41e | 361258f27419cd71d4a64608d4840a7f377c0fb4 | refs/heads/master | 2021-01-10T05:54:33.018911 | 2016-01-11T11:11:42 | 2016-01-11T11:11:42 | 48,578,070 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,873 | java | package net.filippov.uniastrum.blackbase_handler.writers;
import static net.filippov.uniastrum.blackbase_handler.main.StringUtils.buildString;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import net.filippov.uniastrum.blackbase_handler.exceptions.CsvWriterException;
/**
* Writer in *.csv format
*
* @author Oleg Filippov
*
*/
public class CsvWriter {
private PrintWriter csvWriter;
private final char OUTPUT_DELIMITER;
/**
* Constructor
*
* @param inputFilePath inputfile full path
* @param charset specified charset
* @param blackBaseType the type of a record BlackBaseType
* @param output_delimiter delimiter used between the record field's values
* @throws CsvWriterException if an output exception occurred
*/
public CsvWriter(String inputFilePath, String charset, String blackBaseType, char output_delimiter)
throws CsvWriterException {
init(inputFilePath, charset, blackBaseType);
OUTPUT_DELIMITER = output_delimiter;
}
/**
* Initializes the Writer
*
* @param inputPath inputPath to construct output path
* @param charset specified charset
* @param blackBaseType the type of a record BlackBaseType
*/
private void init(String inputPath, String charset, String blackBaseType) {
try {
csvWriter = new PrintWriter(
new BufferedWriter(
new OutputStreamWriter(
new FileOutputStream(getOutputFilePath(inputPath, blackBaseType)), charset)));
} catch (FileNotFoundException e) {
throw new CsvWriterException(e.getMessage(), e);
} catch (UnsupportedEncodingException e) {
throw new CsvWriterException(buildString("Incorrect encoding: ", e.getMessage()), e);
}
}
/**
* Constructs an output filename in the inputFilePath
*
* @param prefix String representation of record type BlackBaseType
* @return the output path
*/
private String getOutputFilePath(String inputFilePath, String prefix) {
File inputFile = new File(inputFilePath);
return buildString(
inputFile.getParent(),
prefix,
" ",
inputFile.getName().substring(0, inputFile.getName().lastIndexOf(".")+1),
"csv"
);
}
/**
* Writes the current record field values
*
* @param recordFields an array of record fields
*/
public void writeRecord(String[] recordFields) {
String outputLine = buildString(
OUTPUT_DELIMITER,
true,
recordFields);
if (outputLine.indexOf("\r\n") > -1) {
outputLine = outputLine.replaceAll("\r\n", " ");
}
csvWriter.println(outputLine);
}
/**
* Closes writer
*/
public void close() {
csvWriter.close();
}
}
| [
"Oleg@Oleg-PC"
] | Oleg@Oleg-PC |
d5cbfc30f9329e67ddb93d39b95974e7e183937f | 7ec3d1408fb1a32e8eb0a25a2683a18f88940fb2 | /src/main/java/fr/istic/domain/Course.java | d5e84625d983aa19f078cab1e79631751b4ab324 | [
"MIT"
] | permissive | correctexam/corrigeExamBack | e86db4d72d97fb43c804b6a76d689daa85b8bad1 | 13a189ad2566ffc1179003f309b0f0fd82739c29 | refs/heads/deploy | 2023-09-04T09:26:45.767098 | 2023-07-25T19:40:41 | 2023-07-25T19:40:41 | 468,035,473 | 1 | 21 | MIT | 2023-07-25T19:40:42 | 2022-03-09T17:51:47 | Java | UTF-8 | Java | false | false | 4,194 | java | package fr.istic.domain;
import io.quarkus.hibernate.orm.panache.PanacheEntityBase;
import javax.json.bind.annotation.JsonbTransient;
import io.quarkus.hibernate.orm.panache.PanacheQuery;
import io.quarkus.runtime.annotations.RegisterForReflection;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.Optional;
/**
* A Course.
*/
@Entity
@Table(name = "course")
@Cacheable
@RegisterForReflection
public class Course extends PanacheEntityBase implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Long id;
@NotNull
@Column(name = "name", nullable = false)
public String name;
@OneToMany(mappedBy = "course", cascade = CascadeType.REMOVE, fetch = FetchType.LAZY)
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public Set<Exam> exams = new HashSet<>();
@OneToMany(mappedBy = "course", cascade = CascadeType.REMOVE, fetch = FetchType.LAZY)
// @Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL)
public Set<CourseGroup> groups = new HashSet<>();
@ManyToMany
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@NotNull
@JoinTable(name = "course_prof",
joinColumns = @JoinColumn(name = "course_id", referencedColumnName = "id"),
inverseJoinColumns = @JoinColumn(name = "prof_id", referencedColumnName = "id"))
@JsonbTransient
public Set<User> profs = new HashSet<>();
// jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof Course)) {
return false;
}
return id != null && id.equals(((Course) o).id);
}
@Override
public int hashCode() {
return 31;
}
@Override
public String toString() {
return "Course{" +
"id=" + id +
", name='" + name + "'" +
"}";
}
public Course update() {
return update(this);
}
public Course persistOrUpdate() {
return persistOrUpdate(this);
}
public static Course update(Course course) {
if (course == null) {
throw new IllegalArgumentException("course can't be null");
}
var entity = Course.<Course>findById(course.id);
if (entity != null) {
entity.name = course.name;
entity.exams = course.exams;
entity.groups = course.groups;
entity.profs = course.profs;
}
return entity;
}
public static Course persistOrUpdate(Course course) {
if (course == null) {
throw new IllegalArgumentException("course can't be null");
}
if (course.id == null) {
persist(course);
return course;
} else {
return update(course);
}
}
public static PanacheQuery<Course> findAllWithEagerRelationships() {
return find("select distinct course from Course course left join fetch course.profs");
}
public static Optional<Course> findOneWithEagerRelationships(Long id) {
return find("select course from Course course left join fetch course.profs where course.id =?1", id).firstResultOptional();
}
public static PanacheQuery<Course> findByProfIsCurrentUser( String login) {
return find("select course from Course course join course.profs as u where u.login =?1", login);
}
public static PanacheQuery<Course> canAccess(long courseId, String login) {
return find("select course from Course course join course.profs as u where u.login =?1 and course.id = ?2", login, courseId);
}
public static PanacheQuery<User> findByProfIsCurrentUserFetchProf( long courseid) {
return find("select course.profs from Course course where course.id = ?1", courseid );
}
}
| [
"olivieR.barais@gmail.com"
] | olivieR.barais@gmail.com |
216d9d0b12e999e0726e5bdab2bba3c9d285ee2b | 1fbfd70eecee94fd2fffe4664bf44aff596ceaaa | /src/main/java/com/michaelgrenon/chargerks/ops/IndexIntentCommand.java | 0796d6b334f38b59c4ab684eaf471e48c6db0a2e | [
"MIT"
] | permissive | nsipid/chargerks | 8c7123c2d2f075a73ba5a5489fe9a09ebd381670 | 8885295c411318d3ab79dc02aef2ffb2c9f1f050 | refs/heads/master | 2021-03-22T05:07:21.124671 | 2018-05-15T16:10:29 | 2018-05-15T16:10:29 | 88,607,497 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,644 | java | package com.michaelgrenon.chargerks.ops;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import com.michaelgrenon.chargerks.NeoConceptBinding;
import com.michaelgrenon.chargerks.NeoGraph;
import org.neo4j.driver.v1.StatementResult;
import org.neo4j.driver.v1.summary.ResultSummary;
import org.neo4j.driver.v1.summary.SummaryCounters;
public class IndexIntentCommand implements MultiCommand {
private static final String NEW_LINE = System.getProperty("line.separator");
private LinkedHashSet<String> commands;
public IndexIntentCommand(NeoGraph intent) {
commands = new LinkedHashSet<>();
for (NeoConceptBinding binding : intent.getConcepts()) {
StringBuilder builder = new StringBuilder();
builder.append("CREATE INDEX ON :");
builder.append(binding.getConcept().getType());
builder.append("(referent);");
builder.append(NEW_LINE);
commands.add(builder.toString());
}
}
@Override
public List<Command> toList() {
return commands.stream().map(comStr -> new Command() {
@Override
public String toCypher() {
return comStr;
}
@Override
public String getSummary(StatementResult result) {
ResultSummary summary = result.consume();
SummaryCounters counts = summary.counters();
return String.format("Added %d indexes in %d ms.", counts.indexesAdded(), summary.resultAvailableAfter(TimeUnit.MILLISECONDS));
}
}).collect(Collectors.toList());
}
} | [
"nsipid@gmail.com"
] | nsipid@gmail.com |
de31caab3cbefeff256a75f20b5290e0836d5ca2 | e93f1174b12d20a1e0a61edbc767ba727ddd3f2c | /class_759.java | 92d01dc90a0d54a42bde2d10d6fc4b0bb2cf6de6 | [] | no_license | a3535ed54a5ee6917a46cfa6c3f12679/7c314649_Menoria_OLD_SemiObf | 47319a81a8c0dcf371aa8b3fd72c1030edacb370 | d62d112cbedd5bb3007cd4f53c82e926dfc64e8a | refs/heads/master | 2021-04-27T16:19:45.530463 | 2018-02-22T13:59:19 | 2018-02-22T13:59:19 | 122,485,270 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,719 | java |
// $FF: renamed from: wG
public abstract class class_759 extends class_753 {
// $FF: renamed from: <init> (ahb) void
public void method_3847(ahb var1) {
super.method_3847(var1);
}
// $FF: renamed from: b (float) void
protected void method_3874(float var1) {}
// $FF: renamed from: a (double, boolean) void
protected void method_3870(double var1, boolean var3) {}
// $FF: renamed from: e (float, float) void
public void method_4224(float var1, float var2) {
String[] var3;
label62: {
class_759 var9;
label58: {
label63: {
var3 = class_752.method_4253();
boolean var10000 = this.method_3876();
if(var3 != null) {
if(var10000) {
this.method_3882(var1, var2, 0.02F);
this.method_3864(this.field_2997, this.field_2998, this.field_2999);
this.field_2997 *= 0.800000011920929D;
this.field_2998 *= 0.800000011920929D;
this.field_2999 *= 0.800000011920929D;
if(var3 != null) {
break label62;
}
}
var9 = this;
if(var3 == null) {
break label63;
}
var10000 = this.method_3881();
}
if(!var10000) {
break label58;
}
this.method_3882(var1, var2, 0.02F);
this.method_3864(this.field_2997, this.field_2998, this.field_2999);
this.field_2997 *= 0.5D;
this.field_2998 *= 0.5D;
var9 = this;
}
var9.field_2999 *= 0.5D;
if(var3 != null) {
break label62;
}
}
float var4;
label43: {
var4 = 0.91F;
var9 = this;
if(var3 != null) {
if(!this.field_3005) {
break label43;
}
var9 = this;
}
var4 = var9.field_2990.getBlock(class_1715.method_9561(this.field_2994), class_1715.method_9561(this.field_3004.field_6910) - 1, class_1715.method_9561(this.field_2996)).field_2008 * 0.91F;
}
float var5 = 0.16277136F / (var4 * var4 * var4);
this.method_3882(var1, var2, this.field_3005?0.1F * var5:0.02F);
var4 = 0.91F;
var9 = this;
if(var3 != null) {
if(this.field_3005) {
var4 = this.field_2990.getBlock(class_1715.method_9561(this.field_2994), class_1715.method_9561(this.field_3004.field_6910) - 1, class_1715.method_9561(this.field_2996)).field_2008 * 0.91F;
}
this.method_3864(this.field_2997, this.field_2998, this.field_2999);
this.field_2997 *= (double)var4;
this.field_2998 *= (double)var4;
var9 = this;
}
var9.field_2999 *= (double)var4;
}
this.field_3322 = this.field_3323;
double var10 = this.field_2994 - this.field_2991;
double var6 = this.field_2996 - this.field_2993;
float var8 = class_1715.method_9558(var10 * var10 + var6 * var6) * 4.0F;
if(var3 != null) {
if(var8 > 1.0F) {
var8 = 1.0F;
}
this.field_3323 += (var8 - this.field_3323) * 0.4F;
this.field_3324 += this.field_3323;
}
}
// $FF: renamed from: h_ () boolean
public boolean method_4197() {
return false;
}
}
| [
"unknowlk@tuta.io"
] | unknowlk@tuta.io |
31be6842c436eba89ea1345bd7976bc3290ab6b1 | a596a3adf0c5a7ce76ef77f09550c99544d41f42 | /src/MIR/IROperand/ConstNull.java | 10fceb07477df9c1e1da2ad58d1a640b4c394192 | [] | no_license | IvyCharon/Compiler | b3472b62ab67b29bc39139d545bdb19db3bd3da5 | 3d071962ec1afc4d2c8de0c7cf8dde706d03d0a3 | refs/heads/main | 2023-06-04T19:39:35.787359 | 2021-06-30T07:28:20 | 2021-06-30T07:28:20 | 321,276,577 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 297 | java | package MIR.IROperand;
import MIR.IRType.*;
public class ConstNull extends operand {
public ConstNull() {
super(new NullType());
}
@Override
public boolean isConst() {
return true;
}
@Override
public String toString() {
return null;
}
}
| [
"shihanwen@sjtu.edu.cn"
] | shihanwen@sjtu.edu.cn |
5a76d86bfa98d3f4a30c31086b223845c3262a98 | 656e21d1cd65bd2fc35243eeb93ddad6c58f65ca | /2-android/finance-control/src/financecontrol/control/MainActivity.java | 0a931a32956be1057b9ffca1d2c172b229baa752 | [] | no_license | flachadriano/finance-control | 9e826779c3894571c29f697277a4a31cbd43a7bd | 34786f5ea5bdf8b7573da5307cf4a371009a4d9d | refs/heads/master | 2021-01-22T08:59:44.887028 | 2015-11-14T16:23:51 | 2015-11-14T16:23:51 | 3,556,076 | 0 | 0 | null | null | null | null | WINDOWS-1257 | Java | false | false | 6,376 | java | package financecontrol.control;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Date;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.format.DateFormat;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnFocusChangeListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.Spinner;
import financecontrol.android.R;
import financecontrol.model.Files;
import financecontrol.model.Functions;
import financecontrol.model.Messages;
public class MainActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Files.createDefaultFiles(this);
loadInitialBalance();
loadCategories();
ImageView categoryAdd = (ImageView) findViewById(R.id.categoryAdd);
categoryAdd.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
// show route screen
Intent intent = new Intent(v.getContext(), CategoryActivity.class);
startActivity(intent);
}
});
final EditText description = (EditText) findViewById(R.id.description);
description.setOnFocusChangeListener(new OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
if (hasFocus) {
if (description.getText().toString().equals("Descri¨‹o")) {
description.setText("");
}
} else if (description.getText().toString().equals("")) {
description.setText("Descri¨‹o");
}
}
});
Button record = (Button) findViewById(R.id.record);
record.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
recordValue();
}
});
Button list = (Button) findViewById(R.id.list);
list.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// list of transactions
Intent intent = new Intent(v.getContext(), ListActivity.class);
startActivity(intent);
}
});
}
private void loadInitialBalance() {
try {
String value = Functions.openFileAndObtainContent(this, Files.FILENAME_BALANCE);
EditText balance = (EditText) findViewById(R.id.balance);
balance.setText(value.equals("") ? "0" : value);
} catch (Exception e) {
e.printStackTrace();
}
}
private void loadCategories() {
FileOutputStream outCategory = null;
try {
String value = Functions.openFileAndObtainContent(this, Files.FILENAME_CATEGORIES);
Spinner category = (Spinner) findViewById(R.id.category);
ArrayAdapter<CharSequence> adapter = new ArrayAdapter<CharSequence>(this, android.R.layout.simple_spinner_item, value.split("\n"));
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
category.setAdapter(adapter);
} catch (FileNotFoundException e) {
Functions.showMessage(this, Messages.FILE_NOT_FOUND);
} catch (IOException e) {
Functions.showMessage(this, Messages.FILE_NOT_FOUND);
} catch (IllegalArgumentException e) {
Functions.showMessage(this, e.getMessage());
}finally {
try {
if (outCategory != null) {
outCategory.flush();
outCategory.close();
}
} catch (IOException e) {}
}
}
private void recordValue() {
FileOutputStream outBalance = null;
FileOutputStream outTransaction = null;
try {
RadioButton expenseRadioButton = (RadioButton) findViewById(R.id.expense);
int expense = expenseRadioButton.isChecked() ? 1 : 2;
Spinner categorySpinner = (Spinner) findViewById(R.id.category);
String category = categorySpinner.getSelectedItem().toString();
EditText valueEdit = (EditText) findViewById(R.id.value);
if (valueEdit.getText().toString().equals("")) {
throw new IllegalArgumentException(Messages.VALUE_TRANSACTION);
}
Float value = Float.parseFloat(valueEdit.getText().toString());
valueEdit.setText("");
EditText descriptionEdit = (EditText) findViewById(R.id.description);
String description = descriptionEdit.getText().toString();
EditText balanceEdit = (EditText) findViewById(R.id.balance);
Float balance = Float.parseFloat(balanceEdit.getText().toString().equals("") ? "0" : balanceEdit.getText().toString());
Float result = balance + (expense==1 ? value*-1 : value);
balanceEdit.setText(result.toString());
outBalance = this.openFileOutput(Files.FILENAME_BALANCE, Context.MODE_PRIVATE);
outBalance.write(result.toString().getBytes());
outTransaction = this.openFileOutput(Files.FILENAME_TRANSACTIONS, Context.MODE_APPEND);
outTransaction.write(DateFormat.format("dd/MM/yyyy", new Date()).toString().getBytes());
outTransaction.write("|".getBytes());
outTransaction.write(expense);
outTransaction.write("|".getBytes());
outTransaction.write(category.getBytes());
outTransaction.write("|".getBytes());
outTransaction.write(value.toString().getBytes());
outTransaction.write("|".getBytes());
outTransaction.write("Descri¨‹o".equals(description) ? "".getBytes() : description.getBytes());
outTransaction.write("\n".getBytes());
} catch (FileNotFoundException e) {
Functions.showMessage(this, Messages.FILE_NOT_FOUND);
} catch (IOException e) {
Functions.showMessage(this, Messages.FILE_NOT_FOUND);
} catch (IllegalArgumentException e) {
Functions.showMessage(this, e.getMessage());
}finally {
try {
if (outBalance != null) {
outBalance.flush();
outBalance.close();
}
if (outTransaction != null) {
outTransaction.flush();
outTransaction.close();
}
} catch (IOException e) {}
}
}
} | [
"flachadriano@gmail.com"
] | flachadriano@gmail.com |
0a78077e33c1faca2b873ad5b212f0dfcc03cc82 | 23d554cc1373440c56f1f0c835125d639df9be11 | /common/src/main/java/com/vpmsbcm/common/model/NormalRocket.java | 566e0de0f17811714cdfda30ab746fc88450acaa | [] | no_license | simonmulser/vpmsbcm | 5341935d388e1b1e51e0833e5b4650bad255522c | 17b64beb41156d47767ca22d9ebeeb726a1c3773 | refs/heads/master | 2022-08-31T05:45:15.366582 | 2015-01-09T14:25:01 | 2015-01-09T14:25:01 | 26,540,655 | 0 | 0 | null | 2022-08-09T13:31:48 | 2014-11-12T14:51:00 | Java | UTF-8 | Java | false | false | 991 | java | package com.vpmsbcm.common.model;
import java.util.List;
import com.gigaspaces.annotation.pojo.FifoSupport;
import com.gigaspaces.annotation.pojo.SpaceClass;
@SpaceClass(fifoSupport = FifoSupport.OPERATION)
public class NormalRocket extends Rocket {
public NormalRocket() {
super();
}
public NormalRocket(Wood wood, Detonator detonator, List<Charge> charges, Integer chargeAmount, List<Load> loades, Integer producerID) {
super(wood, detonator, charges, chargeAmount, loades, producerID);
}
@Override
public String toString() {
return "NormalRocket [id=" + id + ", wood=" + wood + ", detonator=" + detonator + ", charges=" + charges + ", loades=" + loades + ", chargeAmount=" + chargeAmount
+ ", state=" + state + ", producerID=" + producerID + ", controllerID=" + controllerID + ", exporterID=" + exporterID + "]";
}
@Override
public int hashCode() {
return super.hashCode();
}
@Override
public boolean equals(Object obj) {
return super.equals(obj);
}
}
| [
"simonmulser@gmail.com"
] | simonmulser@gmail.com |
ae5eef9a1b078c6b0d70368afa36216c461c6c5e | 4304c2bef11d6cf27aac1831e53d5c2e70f71733 | /src/org/garden/web/prototype/web/vo/JSONResponse.java | 164f83a362127895aa530b1d2b7a0a9932291fab | [] | no_license | gardengenuis/prototype | 47596b49cac277ee9aad4a6afcf266f23ab85d26 | 1dc093f9724890a8e88370708c1f17b1416920ac | refs/heads/master | 2020-05-21T13:28:23.490112 | 2017-03-27T02:32:33 | 2017-03-27T02:32:33 | 48,212,580 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,557 | java | /*
* Copyright (c) 2004, 2014, Garden Lee. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* - Neither the name of Oracle or the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.garden.web.prototype.web.vo;
/**
* JSONResponse.java
*
* @author Garden
* create on 2014年11月11日 下午2:56:08
*/
public class JSONResponse<T> {
public static final String JSON_RESPONSE_CODE_ERROR = "1";
public static final String JSON_RESPONSE_CODE_SUCCESS = "0";
private T object;
private String code;
private String msg;
/**
* @return the object
*/
public T getObject() {
return object;
}
/**
* @param object the object to set
*/
public void setObject(T object) {
this.object = object;
}
/**
* @return the code
*/
public String getCode() {
return code;
}
/**
* @param code the code to set
*/
public void setCode(String code) {
this.code = code;
}
/**
* @return the msg
*/
public String getMsg() {
return msg;
}
/**
* @param msg the msg to set
*/
public void setMsg(String msg) {
this.msg = msg;
}
}
| [
"gardengenuis@gmail.com"
] | gardengenuis@gmail.com |
2a6cdec3b816dc0d3ad3a504a803ff22b16b1c15 | 789c3e319963884452eee0a8957012c746ee0828 | /code/cloud/provider01/src/main/java/com/cong/provider01/Provider01Application.java | c6f6c846a53f14c2047026261519754846224338 | [] | no_license | Letitmiss/SpringX-learning | 8e06faee6802e3c381edec8bfc8f06832533ecdd | 74a650816f02f06893d52de6cd6350f06ec2ca0f | refs/heads/master | 2021-10-08T12:38:55.667562 | 2018-12-12T07:39:18 | 2018-12-12T07:39:18 | 111,535,029 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 496 | java | package com.cong.provider01;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
@SpringBootApplication
@EnableEurekaClient
public class Provider01Application {
public static void main(String[] args) {
SpringApplication.run(Provider01Application.class, args);
}
}
| [
"missyou124@163.com"
] | missyou124@163.com |
eae7d89a766a40a2575cb75140bb44ac34e35ae1 | 60f87c9c386581eb4e99d30689a7edcfee005e37 | /src/main/java/com/demik/functional/lambdaexercises/Class4_12.java | 68565ea788123786c20b981d0f36b0d57f6d9b2d | [] | no_license | AthyLau/functional | 6c984266ee3239446f44bc156b6d81a3cf885a08 | 542d84832b37dd7740676b80e2a1beba708d140a | refs/heads/master | 2020-07-02T05:08:38.043954 | 2019-10-09T12:02:39 | 2019-10-09T12:02:39 | 201,424,072 | 0 | 0 | null | 2019-10-09T12:02:40 | 2019-08-09T08:19:19 | Java | UTF-8 | Java | false | false | 1,300 | java | package com.demik.functional.lambdaexercises;
import com.demik.functional.lambdaexpression.pojo.Artist;
import java.util.List;
import java.util.Optional;
import java.util.stream.Stream;
/**
* @author AthyLau
* @dare: 2019/10/8 4:29 PM
* @since JDK 1.8
*/
public class Class4_12 {
public static void main(String args[]) {
}
}
interface Performance {
String getName();
Stream<Artist> getMusicians();
default Stream<String> getAllMusicians(){
return getMusicians().flatMap(artist -> Stream.concat(artist.getMembers().stream().map(Artist::getName), Stream.of(artist).map(Artist::getName)));
}
}
class Artists {
private List<Artist> artists;
public Artists(List<Artist> artists) {
this.artists = artists;
}
public Optional<Artist> getArtist(int index) {
if (index < 0 || index >= artists.size()) {
return Optional.empty();
// indexException(index);
}
return Optional.of(artists.get(index));
}
private void indexException(int index) {
throw new IllegalArgumentException(index +
"doesn't correspond to an Artist");
}
public String getArtistName(int index) {
return getArtist(index).map(Artist::getName).orElse("unknown");
}
}
| [
"1015141113@qq.com"
] | 1015141113@qq.com |
9fa43bffab3ee5477872ccea533902822b4f9325 | c23ac6d6f4fe5e43edf2425e819a0d5781aedd7e | /src/com/vshow/control/tq/ch/ShowtqAction.java | a4c94d50664ce82659b1a16a1bbb65762aebf9ca | [] | no_license | harry1080/vs | ccaa4829983767de717fb351e78adfd24f009efd | e8659f5a1a41b6c1c8fa0e1ec3c92a9c9e9e618c | refs/heads/master | 2020-05-16T09:53:51.103973 | 2019-04-19T01:53:25 | 2019-04-19T01:53:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,879 | java | package com.vshow.control.tq.ch;
import com.ibatis.sqlmap.client.SqlMapClient;
import com.opensymphony.xwork.Action;
import com.vshow.control.data.Tq;
import com.vshow.control.tool.SqlConnect;
public class ShowtqAction implements Action {
private String key;
private Tq tq;
private Tq tq2;
private int dx;
private String ys;
private int id;
private String ys2;
private int imgsize;
public String getYs2() {
return ys2;
}
public void setId(int id) {
this.id = id;
}
public int getDx() {
return dx;
}
public void setDx(int dx) {
this.dx = dx;
}
public String getYs() {
return ys;
}
public void setYs(String ys) {
this.ys = ys;
}
public int getId() {
return id;
}
public String execute() throws Exception {
ys2 = ys;
ys = "#" + ys;
SqlMapClient sm = SqlConnect.getSqlMapInstance();
if (Integer.parseInt(key) >= 101010100) {
Tq tqs = (Tq) sm.queryForObject("g_wotq_citykey", key);
if (tqs != null) {
tq = new Tq();
tq.setCity(tqs.getCity());
tq.setDay(tqs.getDay().split("\\|")[0]);
tq.setGif(tqs.getGif().split("\\|")[0]);
tq.setContent(tqs.getContent().split("\\|")[0]);
tq2 = new Tq();
tq2.setDay(tqs.getDay().split("\\|")[1]);
tq2.setGif(tqs.getGif().split("\\|")[1]);
tq2.setContent(tqs.getContent().split("\\|")[1]);
}
} else {
tq = (Tq) sm.queryForObject("g_enwotq_citykey", key);
}
return SUCCESS;
}
public Tq getTq() {
return tq;
}
public void setTq(Tq tq) {
this.tq = tq;
}
public void setYs2(String ys2) {
this.ys2 = ys2;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public int getImgsize() {
return imgsize;
}
public void setImgsize(int imgsize) {
this.imgsize = imgsize;
}
public Tq getTq2() {
return tq2;
}
public void setTq2(Tq tq2) {
this.tq2 = tq2;
}
}
| [
"18173437843@163.com"
] | 18173437843@163.com |
74f93eb11b6030c1a544d6525f36e6f13138ab7b | 2916fdb9d4eb74b852d2f41ac34e2293be4a1d66 | /lib_tcvideojoiner/build/generated/source/r/debug/android/support/graphics/drawable/animated/R.java | c012b4b15e7f365ff099a36e816c2ab9b374559e | [] | no_license | LeiShuang/- | 9a032534697a0e5ab7c6f04f19505bf0d9c5c194 | 508e9e4f4ecba6b2dc9c687ea82d2a1f8e21d3c1 | refs/heads/master | 2020-08-31T15:24:31.975174 | 2019-10-31T08:43:34 | 2019-10-31T08:43:34 | 218,718,022 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,108 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* gradle plugin from the resource data it found. It
* should not be modified by hand.
*/
package android.support.graphics.drawable.animated;
public final class R {
public static final class attr {
public static int coordinatorLayoutStyle = 0x7f04006a;
public static int font = 0x7f040086;
public static int fontProviderAuthority = 0x7f040088;
public static int fontProviderCerts = 0x7f040089;
public static int fontProviderFetchStrategy = 0x7f04008a;
public static int fontProviderFetchTimeout = 0x7f04008b;
public static int fontProviderPackage = 0x7f04008c;
public static int fontProviderQuery = 0x7f04008d;
public static int fontStyle = 0x7f04008e;
public static int fontWeight = 0x7f04008f;
public static int keylines = 0x7f0400a1;
public static int layout_anchor = 0x7f0400a4;
public static int layout_anchorGravity = 0x7f0400a5;
public static int layout_behavior = 0x7f0400a6;
public static int layout_dodgeInsetEdges = 0x7f0400a7;
public static int layout_insetEdge = 0x7f0400a8;
public static int layout_keyline = 0x7f0400a9;
public static int statusBarBackground = 0x7f040116;
}
public static final class bool {
public static int abc_action_bar_embed_tabs = 0x7f050001;
}
public static final class color {
public static int notification_action_color_filter = 0x7f06009a;
public static int notification_icon_bg_color = 0x7f06009b;
public static int ripple_material_light = 0x7f0600b3;
public static int secondary_text_default_material_light = 0x7f0600b5;
}
public static final class dimen {
public static int compat_button_inset_horizontal_material = 0x7f08004c;
public static int compat_button_inset_vertical_material = 0x7f08004d;
public static int compat_button_padding_horizontal_material = 0x7f08004e;
public static int compat_button_padding_vertical_material = 0x7f08004f;
public static int compat_control_corner_material = 0x7f080050;
public static int notification_action_icon_size = 0x7f08006e;
public static int notification_action_text_size = 0x7f08006f;
public static int notification_big_circle_margin = 0x7f080070;
public static int notification_content_margin_start = 0x7f080071;
public static int notification_large_icon_height = 0x7f080072;
public static int notification_large_icon_width = 0x7f080073;
public static int notification_main_column_padding_top = 0x7f080074;
public static int notification_media_narrow_margin = 0x7f080075;
public static int notification_right_icon_size = 0x7f080076;
public static int notification_right_side_padding_top = 0x7f080077;
public static int notification_small_icon_background_padding = 0x7f080078;
public static int notification_small_icon_size_as_large = 0x7f080079;
public static int notification_subtext_size = 0x7f08007a;
public static int notification_top_pad = 0x7f08007b;
public static int notification_top_pad_large_text = 0x7f08007c;
}
public static final class drawable {
public static int notification_action_background = 0x7f09008f;
public static int notification_bg = 0x7f090090;
public static int notification_bg_low = 0x7f090091;
public static int notification_bg_low_normal = 0x7f090092;
public static int notification_bg_low_pressed = 0x7f090093;
public static int notification_bg_normal = 0x7f090094;
public static int notification_bg_normal_pressed = 0x7f090095;
public static int notification_icon_background = 0x7f090096;
public static int notification_template_icon_bg = 0x7f090097;
public static int notification_template_icon_low_bg = 0x7f090098;
public static int notification_tile_bg = 0x7f090099;
public static int notify_panel_notification_icon_bg = 0x7f09009a;
}
public static final class id {
public static int action_container = 0x7f0c000c;
public static int action_divider = 0x7f0c000e;
public static int action_image = 0x7f0c000f;
public static int action_text = 0x7f0c0015;
public static int actions = 0x7f0c0016;
public static int async = 0x7f0c001b;
public static int blocking = 0x7f0c0021;
public static int bottom = 0x7f0c0022;
public static int chronometer = 0x7f0c0029;
public static int end = 0x7f0c0032;
public static int forever = 0x7f0c004a;
public static int icon = 0x7f0c004e;
public static int icon_group = 0x7f0c004f;
public static int info = 0x7f0c0052;
public static int italic = 0x7f0c0054;
public static int left = 0x7f0c006f;
public static int line1 = 0x7f0c0070;
public static int line3 = 0x7f0c0071;
public static int none = 0x7f0c007d;
public static int normal = 0x7f0c007e;
public static int notification_background = 0x7f0c007f;
public static int notification_main_column = 0x7f0c0080;
public static int notification_main_column_container = 0x7f0c0081;
public static int right = 0x7f0c008b;
public static int right_icon = 0x7f0c008c;
public static int right_side = 0x7f0c008d;
public static int start = 0x7f0c00a9;
public static int tag_transition_group = 0x7f0c00b3;
public static int text = 0x7f0c00b4;
public static int text2 = 0x7f0c00b5;
public static int time = 0x7f0c00b9;
public static int title = 0x7f0c00ba;
public static int top = 0x7f0c00be;
}
public static final class integer {
public static int status_bar_notification_info_maxnum = 0x7f0d0005;
}
public static final class layout {
public static int notification_action = 0x7f0f002a;
public static int notification_action_tombstone = 0x7f0f002b;
public static int notification_template_custom_big = 0x7f0f0032;
public static int notification_template_icon_group = 0x7f0f0033;
public static int notification_template_part_chronometer = 0x7f0f0037;
public static int notification_template_part_time = 0x7f0f0038;
}
public static final class string {
public static int status_bar_notification_info_overflow = 0x7f150061;
}
public static final class style {
public static int TextAppearance_Compat_Notification = 0x7f160105;
public static int TextAppearance_Compat_Notification_Info = 0x7f160106;
public static int TextAppearance_Compat_Notification_Line2 = 0x7f160107;
public static int TextAppearance_Compat_Notification_Time = 0x7f160108;
public static int TextAppearance_Compat_Notification_Title = 0x7f160109;
public static int Widget_Compat_NotificationActionContainer = 0x7f160178;
public static int Widget_Compat_NotificationActionText = 0x7f160179;
public static int Widget_Support_CoordinatorLayout = 0x7f16017a;
}
public static final class styleable {
public static int[] CoordinatorLayout = { 0x7f0400a1, 0x7f040116 };
public static int CoordinatorLayout_keylines = 0;
public static int CoordinatorLayout_statusBarBackground = 1;
public static int[] CoordinatorLayout_Layout = { 0x010100b3, 0x7f0400a4, 0x7f0400a5, 0x7f0400a6, 0x7f0400a7, 0x7f0400a8, 0x7f0400a9 };
public static int CoordinatorLayout_Layout_android_layout_gravity = 0;
public static int CoordinatorLayout_Layout_layout_anchor = 1;
public static int CoordinatorLayout_Layout_layout_anchorGravity = 2;
public static int CoordinatorLayout_Layout_layout_behavior = 3;
public static int CoordinatorLayout_Layout_layout_dodgeInsetEdges = 4;
public static int CoordinatorLayout_Layout_layout_insetEdge = 5;
public static int CoordinatorLayout_Layout_layout_keyline = 6;
public static int[] FontFamily = { 0x7f040088, 0x7f040089, 0x7f04008a, 0x7f04008b, 0x7f04008c, 0x7f04008d };
public static int FontFamily_fontProviderAuthority = 0;
public static int FontFamily_fontProviderCerts = 1;
public static int FontFamily_fontProviderFetchStrategy = 2;
public static int FontFamily_fontProviderFetchTimeout = 3;
public static int FontFamily_fontProviderPackage = 4;
public static int FontFamily_fontProviderQuery = 5;
public static int[] FontFamilyFont = { 0x01010532, 0x0101053f, 0x01010533, 0x7f040086, 0x7f04008e, 0x7f04008f };
public static int FontFamilyFont_android_font = 0;
public static int FontFamilyFont_android_fontStyle = 1;
public static int FontFamilyFont_android_fontWeight = 2;
public static int FontFamilyFont_font = 3;
public static int FontFamilyFont_fontStyle = 4;
public static int FontFamilyFont_fontWeight = 5;
}
}
| [
"939952154@qq.com"
] | 939952154@qq.com |
47bffae0a065c60342ff86c2b39143aed636bf0c | c87a922628184d3bcc9953812d4f5046d9d13ea2 | /src/test/java/stepDefinitions/LoginStep.java | d1513cef25e04bd4be8bf3276b8009ab7d34769d | [] | no_license | lalith93kumar/MobileAutomationAppium | 7a50855ada2cdb4af569182287bebd67713921d3 | 01eb45bf39a5ee353ae8a2824d21276645d02b75 | refs/heads/master | 2023-04-02T21:19:14.852048 | 2021-03-27T05:04:24 | 2021-03-27T05:04:24 | 307,166,017 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,117 | java | package stepDefinitions;
import io.cucumber.java.en.Given;
import io.cucumber.java.en.Then;
import io.cucumber.java.en.When;
import pages.Login;
public class LoginStep {
Login login = new Login();
@Given("^Login with Username: (.*) and Password: (.*)$")
public void userIsOnSearchScreen(String userName, String password) throws Throwable {
login.signUp(userName,password);
}
@When("^Wait until check credentials page disappear$")
public void userSearchForATextInSearchScreen() throws Throwable {
login.waitForCheckCredentaials();
}
@Then("^Validate the user: (.*) login into the app$")
public void searchResultsShouldDisplayForSearchCriteria(String userName) throws Throwable {
login.verifySignUp(userName);
}
@Then("^Validate the app is not loged with user cred$")
public void verifywhetherAppLoginError() throws Throwable {
login.verifyNotSignUp();
}
@Then("^Validate the error message as (.*)$")
public void validateErrorMessage(String message) throws Throwable {
login.verifyErrorMessage(message);
}
}
| [
"lalithmax20@gmail.com"
] | lalithmax20@gmail.com |
d0d2eb76322d9a9926a29cd7c3810400cd65bce2 | b8f8de320e76d82eb9ed36696b5eb1ba16098b33 | /YiJianYS/app/src/main/java/com/czm/videocompress/util/SGLog.java | d29a8b7e28a857cdea688bcd9962893cb8415834 | [] | no_license | cngmsy/18yearSecondTask | d33baa1965fff2128667533cc52a07459de53c41 | 0a1fde2d0e9964a61f33d05131f3d9db97319a58 | refs/heads/master | 2021-05-11T09:05:17.184318 | 2018-03-26T08:55:47 | 2018-03-26T08:55:47 | 118,067,081 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,413 | java | package com.czm.videocompress.util;
import android.text.TextUtils;
import android.util.Log;
import java.util.ArrayList;
/**
* Created by jamy on 15/12/18.
*/
public class SGLog {
static private final String LOG_TAG = "SGLog";
/**
* 日志的class必须以此为开头才打印。
*/
private static String LogFilter_classNameStartsWith = null;
private static ArrayList<String> logPackage = new ArrayList<String>();
public static void addLogPackage(String packageName) {
if (TextUtils.isEmpty(packageName)) {
return;
}
if (logPackage.contains(packageName)) {
return;
}
logPackage.add(packageName);
}
/**
* 设置只打印以某个 class name 开头的日志。
*
* @param classNameStartsWith 传入null取消限制。
*/
public static void setClassNameStartWithLogFilter(String classNameStartsWith) {
LogFilter_classNameStartsWith = classNameStartsWith;
}
/**
* 打印Info信息
*
* @param className 类名
* @param method 方法名
* @param msg 消息
* @return
*/
static private void i(String className, String method, String msg) {
String log = createMsg(true, className, method, msg);
if (log != null) {
Log.i(LOG_TAG, log);
}
}
/**
* 打印error信息
*
* @param className 类名
* @param method 方法名
* @param msg 消息
* @return
*/
static private void e(String className, String method, String msg) {
String log = createMsg(false, className, method, msg);
if (log != null) {
Log.e(LOG_TAG, log);
}
}
/**
* 打印Warning信息
*
* @param className 类名
* @param method 方法名
* @param msg 消息
* @return
*/
static private void w(String className, String method, String msg) {
String log = createMsg(false, className, method, msg);
if (log != null) {
Log.w(LOG_TAG, log);
}
}
/**
* 打印verbose信息
*
* @param className 类名
* @param method 方法名
* @param msg 消息
* @return
*/
static private void v(String className, String method, String msg) {
String log = createMsg(true, className, method, msg);
if (log != null) {
Log.v(LOG_TAG, log);
}
}
/**
* 打印debug信息
*
* @param className 类名
* @param method 方法名
* @param msg 消息
* @return
*/
static private void d(String className, String method, String msg) {
String log = createMsg(true, className, method, msg);
if (log != null) {
Log.d(LOG_TAG, log);
}
}
static private String createMsg(boolean underPageackContrl, String className, String method, String msg) {
if (LogFilter_classNameStartsWith != null && !msg.startsWith(LogFilter_classNameStartsWith)) {
return null;
}
if (underPageackContrl && !isLogable(className)) {
return null;
}
StringBuffer fullMsg = new StringBuffer(100);
fullMsg.append(className);
fullMsg.append(":");
fullMsg.append(method);
fullMsg.append(":");
fullMsg.append(msg);
return fullMsg.toString();
}
static public int printLog(int type, String msg) {
StackTraceElement[] elements = Thread.currentThread().getStackTrace();
if (elements.length < 5) {
return -1;
}
StackTraceElement element = elements[4];
String methodName = element.getMethodName();
String className = element.getClassName();
if (type > 1 && !isLogable(className)) {
return -1;
}
if (type == 0) {
e(className, methodName, msg);
} else if (type == 1) {
w(className, methodName, msg);
} else if (type == 2) {
i(className, methodName, msg);
} else if (type == 3) {
d(className, methodName, msg);
} else {
v(className, methodName, msg);
}
return 0;
}
private static boolean isLogable(String className) {
if (logPackage.size() == 0) {
return false;
}
boolean isLog = false;
for (String item : logPackage) {
if (className.startsWith(item)) {
isLog = true;
}
}
return isLog;
}
static public int detailException(String msg, Throwable t) {
Log.e(LOG_TAG, msg, t);
return printLog(0, msg);
}
static public int detailException(Throwable t) {
Log.e(LOG_TAG, t.getMessage(), t);
return printLog(0, t.getMessage());
}
static public int e(Throwable e) {
return printLog(0, e.getMessage());
}
static public int e(String msg) {
return printLog(0, msg);
}
static public int w(String msg) {
return printLog(1, msg);
}
static public int i(String msg) {
return printLog(2, msg);
}
static public int d(String msg) {
Log.d(LOG_TAG, msg);
return printLog(3, msg);
}
static public int v(String msg) {
return printLog(4, msg);
}
}
| [
"2548868040@.com"
] | 2548868040@.com |
b861e4244b137d5c3fcc4150cb93b1118c91db8a | baecac3e033bff86a8a228f4a65156f6c319b586 | /idea-gosu-plugin/src/main/java/gw/plugin/ij/actions/AbstractCreateEnhancementInPackageAction.java | c373d07770bb355b3e1945eb5342aa47742c2125 | [
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer",
"BSD-3-Clause"
] | permissive | ikornienko/gosu-lang | 8f1683a52b64e6e959ad24f8428c3c6c9dc80640 | 9f5cecfa813889dbf72754cc6b1d63fc0e7e41ed | refs/heads/master | 2021-01-21T04:11:31.229243 | 2015-04-03T22:54:19 | 2015-04-03T22:54:19 | 34,691,254 | 0 | 1 | null | 2015-04-27T21:06:52 | 2015-04-27T21:06:52 | null | UTF-8 | Java | false | false | 5,138 | java | /*
* Copyright 2014 Guidewire Software, Inc.
*/
package gw.plugin.ij.actions;
import com.intellij.CommonBundle;
import com.intellij.ide.IdeView;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.actionSystem.LangDataKeys;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.PsiDirectory;
import com.intellij.psi.PsiFile;
import com.intellij.util.IncorrectOperationException;
import gw.lang.reflect.module.IModule;
import gw.plugin.ij.util.GosuModuleUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
/**
* This class is modified from CreateFromTemplateAction.java
* We need to show a different dialog for enhancement, yet the actionPerformed() method in CreateFromTemplateAction cannot be overriden.
*
* @author pfong
*/
public abstract class AbstractCreateEnhancementInPackageAction<T extends PsiFile> extends AbstractCreateInPackageAction {
public AbstractCreateEnhancementInPackageAction(String text, String description, Icon icon) {
super(text, description, icon, true);
}
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
final DataContext dataContext = e.getDataContext();
final IdeView view = LangDataKeys.IDE_VIEW.getData(dataContext);
if (view == null) {
return;
}
final Project project = PlatformDataKeys.PROJECT.getData(dataContext);
final PsiDirectory dir = view.getOrChooseDirectory();
if (dir == null || project == null) {
return;
}
final CreateEnhancementDialog.Builder builder = CreateEnhancementDialog.createDialog(project);
buildDialog(project, dir, builder);
final T createdElement =
builder.show(getErrorTitle(), new CreateEnhancementDialog.FileCreator<T>() {
public void checkBeforeCreate(@NotNull String name, @NotNull String enhancedClassName, @NotNull String templateName ) {
AbstractCreateEnhancementInPackageAction.this.checkBeforeCreate(name, enhancedClassName, templateName, dir);
}
public T createFile(@NotNull String name, @NotNull String enhancedClassName, @NotNull String templateName) {
return AbstractCreateEnhancementInPackageAction.this.createFile(name, enhancedClassName, templateName, dir);
}
@NotNull
public String getActionName(@NotNull String name, @NotNull String templateName) {
return AbstractCreateEnhancementInPackageAction.this.getActionName(dir, name, templateName);
}
});
if (createdElement != null) {
view.selectElement(createdElement);
}
}
protected String getErrorTitle() {
return CommonBundle.getErrorTitle();
}
@Nullable
protected T createFile(String name, String enhancedClassName, @NotNull String templateName, @NotNull PsiDirectory dir) {
return checkOrCreate(name, dir, enhancedClassName, templateName, false, getModule(dir));
}
protected IModule getModule(@NotNull PsiDirectory dir) {
return GosuModuleUtil.findModuleForFile(dir.getVirtualFile(), dir.getProject());
}
protected void checkBeforeCreate(String name, String enhancedClassName, @NotNull String templateName, @NotNull PsiDirectory dir) {
checkOrCreate(name, dir, enhancedClassName, templateName, true, getModule(dir));
}
@Nullable
private T checkOrCreate(String newName, PsiDirectory directory, String enhancedClassName, @NotNull String templateName, boolean check, IModule module) throws IncorrectOperationException {
PsiDirectory dir = directory;
String className = newName;
final String extension = StringUtil.getShortName(templateName);
if (StringUtil.isNotEmpty(extension)) {
className = StringUtil.trimEnd(className, "." + extension);
}
if (className.contains(".")) {
String[] names = className.split("\\.");
for (int i = 0; i < names.length - 1; i++) {
String name = names[i];
PsiDirectory subDir = dir.findSubdirectory(name);
if (subDir == null) {
if (check) {
dir.checkCreateSubdirectory(name);
return null;
}
subDir = dir.createSubdirectory(name);
}
dir = subDir;
}
className = names[names.length - 1];
}
if (check) {
doCheckCreate(dir, className, enhancedClassName);
return null;
}
return doCreate(dir, className, enhancedClassName, templateName, module);
}
protected abstract void buildDialog(Project project, PsiDirectory directory, CreateEnhancementDialog.Builder builder);
protected abstract String getActionName(PsiDirectory directory, String newName, String templateName);
protected abstract T doCreate(PsiDirectory dir, String className, String enhancedClassName, String templateName, IModule module) throws IncorrectOperationException;
protected abstract void doCheckCreate(PsiDirectory dir, String className, String enhancedClassName) throws IncorrectOperationException;
}
| [
"lboasso@guidewire.com"
] | lboasso@guidewire.com |
fa714fe5558f4fe6019e3eab12f9ecfddcdb4b19 | e9f153849501657065e0caf9eb244d49cf2bbb73 | /src/operatorInJava/EqualityAndRelationOperator.java | 29da7ef477660d2029349d099f6863af5312c97f | [] | no_license | mohammedhashem1/PracticeCoreJava- | c2ece2d3394303b706d03a73c44ecf42e754d607 | ffe6e1a2ac407ee83a8409624f22e0a74ecfd1bd | refs/heads/master | 2022-12-22T18:15:42.384851 | 2020-09-11T01:21:54 | 2020-09-11T01:21:54 | 294,561,892 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,581 | java | package operatorInJava;
public class EqualityAndRelationOperator {
public static void main(String[] args) {
int x=40;
int y=50;
x=y;
if(x==y) { // Equality operator
}
if (x != y) {// not equal operator
}
if ( x>y) { // Greater than operator
}
if (x>=y) {//greater than equal and equal operator
}
if (x<=y) {//equal and less than opertor
}
int a=10;
int b=15;
if (a==b){//Equal operator
}
if (a!=b) {//not equal operator
}
if(a>b ) {// greater than operator
}
if (a>=b) {//greater and equal operator
}
if (a<=b) {//less than equal operator
}
double p=25.5;
double q=67.5;
if (p==q) {// equal operator
}
if (p!=q) {// not equal operator
}
if (p>q) {// greater than operator
}
if (p>=q) { //greater than equal operator
}
if (p <= q) {//less than equal operator
}
double titu=7.5;
double pintu =7.75;
if (titu==pintu) {
System.out.println("Titu and Pintu is not equal");
}else if (titu!=pintu){
System.out.println("Titu is not equal to pintu");
}else if (pintu>titu){
System.out.println("pintu is not greater than pintu");
}else if(pintu>=titu) {
System.out.println("pintu is not greater than or equal to titu");
}else if (titu>=pintu) {
System.out.println("Titu is not equal too pintu");
}else if (titu<=pintu) {
System.out.println("titu is equal orless than pintu");
}else if (titu>pintu) {
System.out.println("titu is greater than pintu");
} else {
System.out.println("all the statement above is in valids");
}
}
} | [
"hashemmohammed5@gmail.com"
] | hashemmohammed5@gmail.com |
8428fb390b52ff117106a85e26dd3bfe04c921fa | 950cc9ee9e3b20ee15234d2db9f1167f21a396c4 | /src/main/java/fhi0/DIDR/dto/InternetDowntimeDto.java | 3d5ede2002908d0a3fdc545368cbf652e6c71e73 | [] | no_license | hectorjoey/network-performance | 707a2d6ed9863a2dbe72485b753a0576ba57491c | 30edf680c00b75365dd4ddc29aaa68fe13f4824a | refs/heads/main | 2023-08-30T18:56:55.905422 | 2021-11-16T07:21:00 | 2021-11-16T07:21:00 | 428,555,754 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,039 | java | package fhi0.DIDR.dto;
public class InternetDowntimeDto {
private String date;
private String name;
private String day;
private String location;
private String link;
private double duration;
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDay() {
return day;
}
public void setDay(String day) {
this.day = day;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public String getLink() {
return link;
}
public void setLink(String link) {
this.link = link;
}
public double getDuration() {
return duration;
}
public void setDuration(double duration) {
this.duration = duration;
}
} | [
"stanleychike@yahoo.com"
] | stanleychike@yahoo.com |
955f1f15253178f98e544115fb0ee09f901f7170 | 83a37e5dfd0e5a507081a56c63b526f56141ab0a | /mvcClient/src/java/client/MyClient.java | eea7f52ec862a0e1800cf656219a7573e5eb4d5c | [] | no_license | tjumfb/bafflePractice | 7aa6714a7dbdc63dc6568a77cdacf6b794192b3e | 3858ef4d426d6ea7eda404d8e1e41fed7da88461 | refs/heads/master | 2022-12-27T08:54:12.000967 | 2019-06-05T03:20:45 | 2019-06-05T03:20:45 | 188,362,883 | 0 | 0 | null | 2022-12-16T04:24:42 | 2019-05-24T06:11:58 | Java | UTF-8 | Java | false | false | 3,691 | java | package client;
import org.apache.http.Header;
import org.apache.http.HttpEntity;
import org.apache.http.HttpHost;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import util.FileIOutil;
import java.io.*;
import java.util.*;
// 存储response内容
class Content implements Serializable {
String httpEntity;
ArrayList<String> headers = new ArrayList<String>();
public Content(String httpEntity, Header[] headers){
this.httpEntity = httpEntity;
for(Header header:headers){
this.headers.add(header.toString());
}
}
public Content(File file) {
try {
FileReader fr = new FileReader(file);
BufferedReader br = new BufferedReader(fr);
String s;
while (!((s=br.readLine()).equals("entity"))){
headers.add(s);
}
httpEntity = br.readLine();
br.close();
fr.close();
} catch (IOException e) {
e.printStackTrace();
}
}
public void saveContent(File file){
try {
FileWriter fw = new FileWriter(file);
BufferedWriter bw = new BufferedWriter(fw);
for(String s:headers){
bw.write(s+"\n");
}
bw.write("entity\n");
bw.write(httpEntity);
bw.close();
fw.close();
} catch (IOException e) {
e.printStackTrace();
}
}
@Override
public String toString(){
StringBuffer stringBuffer = new StringBuffer();
for(String header:headers){
stringBuffer.append(header.toString()+" ");
}
stringBuffer.append("\n");
stringBuffer.append(httpEntity);
return stringBuffer.toString();
}
}
public class MyClient {
static String hostIni = "http://localhost:8080";
static CloseableHttpClient httpClient = HttpClients.createDefault();
static HttpHost httpHost = HttpHost.create(hostIni);
public static String requestResponse(String url){
HttpGet httpGet = new HttpGet(url);
String response = "err: exit via exception";
// 挡板
File targetFile = new File(FileIOutil.getFileName(hostIni+url));
if(targetFile.exists()){
System.out.print("挡板触发: ");
return new Content(targetFile).httpEntity;
}else {
FileIOutil.createNewFile(hostIni+url);
}
try {
CloseableHttpResponse closeableHttpResponse = httpClient.execute(httpHost,httpGet);
response = EntityUtils.toString(closeableHttpResponse.getEntity());
// 储存header与content
new Content(response,closeableHttpResponse.getAllHeaders()).saveContent(new File(FileIOutil.getFileName(hostIni+url)));
closeableHttpResponse.close();
} catch (IOException e) {
e.printStackTrace();
}
return response;
}
public static void selectAll(){
String url = "/mvcApp/mysql/select/all";
String response = requestResponse(url);
System.out.println("selectAll: "+response);
}
public static void selectOne(int id){
String url = "/mvcApp/mysql/select/one?id="+ id;
String response = requestResponse(url);
System.out.println("selectOne: "+response);
}
public static void main(String[] args) {
selectAll();
selectOne(1);
selectOne(2);
}
}
| [
"895948506@qq.com"
] | 895948506@qq.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.