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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5014dd95b002498a20f042a09b94fb22a2df6887 | 17b9d33a31e8d83c6fc2db509c90160f9ece9269 | /FoodSupplyManagement/src/Business/WorkQueue/WorkRequest.java | 248bae7e7ae3a65f161090a6d0fb1280128ec3f1 | [] | no_license | shubham414/Food-Supply-Management | e72be5e7e45207ead8a63dc221b49d226e392413 | f16b2419d3ed68fbca640f6ee71682bc00a43dc0 | refs/heads/master | 2020-12-08T01:44:15.211504 | 2020-03-17T17:59:09 | 2020-03-17T17:59:09 | 232,851,003 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,826 | 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 Business.WorkQueue;
import Business.Food.Food;
import Business.UserAccount.UserAccount;
import java.util.Date;
/**
*
* @author
*/
public abstract class WorkRequest {
private Food food;
private UserAccount sender;
private UserAccount receiver;
private String status;
private String dayOfDelivery;
private Date requestDate;
private Date resolveDate;
public WorkRequest() {
requestDate = new Date();
}
public Food getFood() {
return food;
}
public void setFood(Food food) {
this.food = food;
}
public UserAccount getSender() {
return sender;
}
public void setSender(UserAccount sender) {
this.sender = sender;
}
public UserAccount getReceiver() {
return receiver;
}
public void setReceiver(UserAccount receiver) {
this.receiver = receiver;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public Date getRequestDate() {
return requestDate;
}
public void setRequestDate(Date requestDate) {
this.requestDate = requestDate;
}
public Date getResolveDate() {
return resolveDate;
}
public void setResolveDate(Date resolveDate) {
this.resolveDate = resolveDate;
}
public String getDayOfDelivery() {
return dayOfDelivery;
}
public void setDayOfDelivery(String dayOfDelivery) {
this.dayOfDelivery = dayOfDelivery;
}
@Override
public String toString() {
return status;
}
}
| [
"shubh@Shubhams-MacBook-Pro.local"
] | shubh@Shubhams-MacBook-Pro.local |
3ce2404212b674c11a61e25f008475d46d7d77cd | 2b786a5dd91da5b66a39841b394e18b901cf2efc | /src/main/java/com/ngyb/study/db/BaseConnectionHandler.java | 0bffccde4ec9db8cfb6c5aad3f0ab89fd40df84d | [] | no_license | nangongyibin/Java_Study | 748a79c624f3a36324589c2f0676382e36ac4a80 | 53acb1cee3789a1b559b7ea2354b59b817924fb2 | refs/heads/master | 2022-06-26T13:49:07.515130 | 2020-08-09T11:13:03 | 2020-08-09T11:13:03 | 204,569,137 | 1 | 0 | null | 2022-06-17T03:10:23 | 2019-08-26T22:01:35 | HTML | UTF-8 | Java | false | false | 1,816 | java | package com.ngyb.study.db;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.sql.Connection;
/**
* 调用处理器
*/
class BaseConnectionHandler implements InvocationHandler {
/**
* 真正的连接
*/
private Connection realConnection;
/**
* 包装后的连接
*/
private Connection warpedConnection;
/**
* 应用数据源
*/
private JdbcPool jdbcPool;
/**
* 每个连接的最大使用次数
*/
private int maxUseCount = JdbcPool.maxUseCountToInt;
/**
* 当前使用次数
*/
private int currentUseCount = 0;
/**
* 构造方法
*
* @param jdbcPool
*/
public BaseConnectionHandler(JdbcPool jdbcPool) {
this.jdbcPool = jdbcPool;
}
/**
* 创建连接
*
* @param realConn
* @return
*/
public Connection bind(Connection realConn) {
this.realConnection = realConn;
// 代理来创建一个类,这个类实现java.sql.Connection接口,传递给this这个类
this.warpedConnection = (Connection) Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class[]{Connection.class}, this);
return warpedConnection;
}
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
if ("close".equals(method.getName())) {
this.currentUseCount++;
if (this.currentUseCount < this.maxUseCount) {
this.jdbcPool.connectionPool.addLast(this.warpedConnection);
} else {
this.realConnection.close();
this.jdbcPool.currentCount--;
}
}
return method.invoke(this.realConnection, args);
}
}
| [
"nangongyibin@gmail.com"
] | nangongyibin@gmail.com |
b6b14958419c368e9eb38637838a40c41ea62cec | 8a6a43be0164b50d870e97de31a5c272147914d3 | /src/main/java/com/techupdate/microservices/namingserver/NamingServerApplication.java | 9aa9578790d11de2479f189fd4c6724cff0eeed3 | [] | no_license | HarshalSolao/docker-microservice-naming-server | 16a2073256c0d41025e4be013804601ef5de968d | 7d86a46310a4d7aad0a1984ea7e99a9681289aee | refs/heads/main | 2023-08-07T00:09:48.731655 | 2021-10-03T17:35:53 | 2021-10-03T17:35:53 | 413,150,293 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 441 | java | package com.techupdate.microservices.namingserver;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
@EnableEurekaServer
@SpringBootApplication
public class NamingServerApplication {
public static void main(String[] args) {
SpringApplication.run(NamingServerApplication.class, args);
}
}
| [
"harshalsolao@gmail.com"
] | harshalsolao@gmail.com |
a669bc7a5849a4744e5c9a387451bcddcfa69edf | b5c06681283ad5f5287ac394793ccaf3862a7e44 | /AndroidTabDemo-master/app/src/main/java/edu/pprakashumd/tabdemo/MainActivity.java | a27b6edade2ae896db90e5871591bb7f8dd5e1f7 | [] | no_license | m-furman/TerpTweets | c993e5e64212aa53871ee83f2cdf6f10f5174966 | 2c7c9c18042a453fe629fa7be0e892927fbb1587 | refs/heads/master | 2016-09-13T21:25:42.346560 | 2016-04-19T01:24:32 | 2016-04-19T01:24:32 | 56,554,246 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,117 | java | package edu.pprakashumd.tabdemo;
import android.os.Bundle;
import android.support.design.widget.NavigationView;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.app.ListFragment;
import android.support.v4.view.GravityCompat;
import android.support.v4.view.ViewPager;
import android.support.v4.widget.DrawerLayout;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AbsListView;
import android.widget.ListView;
import com.twitter.sdk.android.Twitter;
import com.twitter.sdk.android.core.Callback;
import com.twitter.sdk.android.core.Result;
import com.twitter.sdk.android.core.TwitterAuthConfig;
import com.twitter.sdk.android.core.TwitterException;
import com.twitter.sdk.android.core.models.Tweet;
import com.twitter.sdk.android.tweetui.TimelineResult;
import com.twitter.sdk.android.tweetui.TweetTimelineListAdapter;
import com.twitter.sdk.android.tweetui.UserTimeline;
import java.util.ArrayList;
import io.fabric.sdk.android.Fabric;
public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener {
// Note: Your consumer key and secret should be obfuscated in your source code before shipping.
private static final String TWITTER_KEY = "MLELpEfgLiwNTWqhu32We4w24";
private static final String TWITTER_SECRET = "vq8uNmF0w8BHQyoRfQBTT8j52tJQLfj3Fs6iDLB5vC3AP24jm4";
private long uOfMarylandID = 16129880;
private long presidentLohID = 299743215;
private long diamondbackID = 36003748;
/**
* The {@link android.support.v4.view.PagerAdapter} that will provide
* fragments for each of the sections. We use a
* {@link FragmentPagerAdapter} derivative, which will keep every
* loaded fragment in memory. If this becomes too memory intensive, it
* may be best to switch to a
* {@link android.support.v4.app.FragmentStatePagerAdapter}.
*/
private SectionsPagerAdapter mSectionsPagerAdapter;
private static TweetTimelineListAdapter mAdapter;
private static ArrayList<TweetTimelineListAdapter> mAdapters = new ArrayList<>();
/**
* The {@link ViewPager} that will host the section contents.
*/
private ViewPager mViewPager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TwitterAuthConfig authConfig = new TwitterAuthConfig(TWITTER_KEY, TWITTER_SECRET);
Fabric.with(this, new Twitter(authConfig));
setContentView(R.layout.activity_main);
UserTimeline userTimeline = new UserTimeline.Builder()
.userId(diamondbackID)
//.screenName("UofMaryland")
.build();
UserTimeline userTimeline2 = new UserTimeline.Builder()
.userId(presidentLohID)
//.screenName("UofMaryland")
.build();
UserTimeline userTimeline3 = new UserTimeline.Builder()
.userId(uOfMarylandID)
//.screenName("UofMaryland")
.build();
final TweetTimelineListAdapter adapter = new TweetTimelineListAdapter.Builder(this)
.setTimeline(userTimeline)
.build();
final TweetTimelineListAdapter adapter2 = new TweetTimelineListAdapter.Builder(this)
.setTimeline(userTimeline2)
.build();
final TweetTimelineListAdapter adapter3 = new TweetTimelineListAdapter.Builder(this)
.setTimeline(userTimeline3)
.build();
mAdapter = adapter;
mAdapters.add(adapter);
mAdapters.add(adapter2);
mAdapters.add(adapter3);
//Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
//setSupportActionBar(toolbar);
// Create the adapter that will return a fragment for each of the three
// primary sections of the activity.
mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
// Set up the ViewPager with the sections adapter.
mViewPager = (ViewPager) findViewById(R.id.container);
mViewPager.setAdapter(mSectionsPagerAdapter);
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
navigationView.setNavigationItemSelectedListener(this);
}
@Override
public void onBackPressed() {
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
if (drawer.isDrawerOpen(GravityCompat.START)) {
drawer.closeDrawer(GravityCompat.START);
} else {
super.onBackPressed();
}
}
@SuppressWarnings("StatementWithEmptyBody")
@Override
public boolean onNavigationItemSelected(MenuItem item) {
// Handle navigation view item clicks here.
int id = item.getItemId();
if (id == R.id.nav_camera) {
// Handle the camera action
} else if (id == R.id.nav_gallery) {
} else if (id == R.id.nav_slideshow) {
} else if (id == R.id.nav_manage) {
} else if (id == R.id.nav_share) {
} else if (id == R.id.nav_send) {
}
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
drawer.closeDrawer(GravityCompat.START);
return true;
}
// @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);
// }
/**
* A placeholder fragment containing a simple view.
*/
public static class PlaceholderFragment extends ListFragment implements SwipeRefreshLayout.OnRefreshListener{
/**
* The fragment argument representing the section number for this
* fragment.
*/
private static final String ARG_SECTION_NUMBER = "section_number";
private SwipeRefreshLayout swipeRefreshLayout;
private TweetTimelineListAdapter fragmentAdapter;
public PlaceholderFragment(){
}
/**
* Returns a new instance of this fragment for the given section
* number.
*/
public static PlaceholderFragment newInstance(int sectionNumber) {
PlaceholderFragment fragment = new PlaceholderFragment();
Bundle args = new Bundle();
args.putInt(ARG_SECTION_NUMBER, sectionNumber);
fragment.setArguments(args);
return fragment;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// View rootView = inflater.inflate(R.layout.fragment_main, container, false);
// TextView textView = (TextView) rootView.findViewById(R.id.section_label);
// textView.setText(getString(R.string.section_format, getArguments().getInt(ARG_SECTION_NUMBER)));
View rootView = inflater.inflate(R.layout.timeline, container, false);
//ListAdapter l = TweetTimelineListAdapter(getActivity(), R.id.android_list);
//ListView l = (ListView) rootView.findViewById(R.id.android_list);
swipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.swipe_refresh_layout);
swipeRefreshLayout.setOnRefreshListener(this);
fragmentAdapter = mAdapters.get(getArguments().getInt(ARG_SECTION_NUMBER) - 1);
setListAdapter(mAdapters.get(getArguments().getInt(ARG_SECTION_NUMBER) - 1));
final ListView listView = (ListView) rootView.findViewById(android.R.id.list);
listView.setOnScrollListener(new AbsListView.OnScrollListener() {
boolean enableRefresh = false;
@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
}
@Override
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount,
int totalItemCount) {
if (listView != null && listView.getChildCount() > 0) {
// check that the first item is visible and that its top matches the parent
enableRefresh = listView.getFirstVisiblePosition() == 0 &&
listView.getChildAt(0).getTop() >= 0;
} else {
enableRefresh = false;
}
swipeRefreshLayout.setEnabled(enableRefresh);
}
});
return rootView;
}
@Override
public void onRefresh() {
swipeRefreshLayout.setRefreshing(true);
fragmentAdapter.refresh(new Callback<TimelineResult<Tweet>>() {
@Override
public void success(Result<TimelineResult<Tweet>> result) {
swipeRefreshLayout.setRefreshing(false);
}
@Override
public void failure(TwitterException exception) {
swipeRefreshLayout.setRefreshing(false);
}
});
}
}
/**
* A {@link FragmentPagerAdapter} that returns a fragment corresponding to
* one of the sections/tabs/pages.
*/
public class SectionsPagerAdapter extends FragmentPagerAdapter {
public SectionsPagerAdapter(FragmentManager fm) {
super(fm);
}
@Override
public Fragment getItem(int position) {
// getItem is called to instantiate the fragment for the given page.
// Return a PlaceholderFragment (defined as a static inner class below).
return PlaceholderFragment.newInstance(position + 1);
}
@Override
public int getCount() {
// Show 3 total pages.
return 3;
}
@Override
public CharSequence getPageTitle(int position) {
switch (position) {
case 0:
return "SECTION 1";
case 1:
return "SECTION 2";
case 2:
return "SECTION 3";
}
return null;
}
}
}
| [
"mariafurman@live.com"
] | mariafurman@live.com |
459653cde5e239117de370e9885e915165228a3b | 54513e6588696460c913df9c233efb078fdf027b | /robot-starter/src/test/java/com/github/guigumua/robot/starter/test/bean/mapper/SetuMapper.java | 9aa6813eb82c88e94866b30256bc2866da8ba8ba | [
"Apache-2.0"
] | permissive | shoaky009/robot-parent | 34870c3766cec249354be7171ed46da6c4d50da5 | 28907ee0c9b6ab046db97792c540e6ca14a14bf4 | refs/heads/master | 2022-04-20T11:58:43.726081 | 2020-04-24T05:07:00 | 2020-04-24T05:07:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 632 | java | package com.github.guigumua.robot.starter.test.bean.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.guigumua.robot.starter.test.bean.entity.Setu;
import org.apache.ibatis.annotations.Select;
/**
* <p>
* Mapper 接口
* </p>
*
* @author vicente
* @since 2020-04-21
*/
public interface SetuMapper extends BaseMapper<Setu> {
@Select("SELECT *\r\n"
+ "FROM `setu` AS t1 JOIN (SELECT ROUND(RAND() * ((SELECT MAX(id) FROM `setu`)-(SELECT MIN(id) FROM `setu`))+(SELECT MIN(id) FROM `setu`)) AS id) AS t2\r\n"
+ "WHERE t1.id >= t2.id\r\n" + "ORDER BY t1.id LIMIT 1;")
Setu randomSetu();
}
| [
"wymc.mail@qq.com"
] | wymc.mail@qq.com |
1908b27b437cc2e4f645d8cc9e6a45929aa2c737 | a914f632192474809cc7cb0c5a7ca92fe5710f06 | /hibernate-04-one-to-many-uni--Udemy26/src/pl/jaceksysiak/hibernate/demo/GetInstructorDetailDemo.java | 3ff7e39d996a6d2c16edd5dd2c2e39492d57f893 | [] | no_license | j4sysiak/hibernate-04-one-to-many-uni--Udemy26 | 833ae8aa1fe91b12b5a552927db489eb4d2e52d0 | 7480b497eb3bfc8009d367b65812551c059bc75c | refs/heads/master | 2021-02-07T21:44:19.442859 | 2020-03-01T04:04:14 | 2020-03-01T04:04:14 | 244,079,846 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,423 | java | package pl.jaceksysiak.hibernate.demo;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
import pl.jaceksysiak.hibernate.demo.entity.Instructor;
import pl.jaceksysiak.hibernate.demo.entity.InstructorDetail;
public class GetInstructorDetailDemo {
public static void main(String[] args) {
// create session factory
SessionFactory factory = new Configuration()
.configure("hibernate.cfg.xml")
.addAnnotatedClass(Instructor.class)
.addAnnotatedClass(InstructorDetail.class)
.buildSessionFactory();
// create session
Session session = factory.getCurrentSession();
try {
// start a transaction
session.beginTransaction();
// get the instructor detail object
int theId = 21111;
InstructorDetail tempInstructorDetail =
session.get(InstructorDetail.class, theId);
// print the instructor detail
System.out.println("tempInstructorDetail: " + tempInstructorDetail);
// print the associated instructor
System.out.println("the associated instructor: " +
tempInstructorDetail.getInstructor());
// commit transaction
session.getTransaction().commit();
System.out.println("Done!");
}
catch (Exception exc) {
exc.printStackTrace();
}
finally {
// handle connection leak issue
session.close();
factory.close();
}
}
}
| [
"Jacek@BERLIN"
] | Jacek@BERLIN |
ff77d93d04e137d8d770e0690a1305e20eba954c | bd955c3081f55a6c711c4d3b4018df904959c1d3 | /src/my/concrete/HourlyEmployee.java | ed11ef2603f2e70dbf0057fff1cf9f3e5d82d850 | [] | no_license | rvikmyhr/InheritancePractice | 8ba01cb34a52629116b20cfe2543d87ae44093a9 | 21f4d943684a967db6fc567cb39190983d171749 | refs/heads/master | 2020-05-04T08:33:57.049101 | 2014-02-03T23:07:20 | 2014-02-03T23:07:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 496 | 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 my.concrete;
/**
*
* @author Ron
*/
public class HourlyEmployee extends Employee {
private double hourlyPay;
public double getHourlyPay() {
return hourlyPay;
}
public void setHourlyPay(double hourlyPay) {
this.hourlyPay = hourlyPay;
}
}
| [
"rvikmyhr@my.wctc.edu"
] | rvikmyhr@my.wctc.edu |
7e4ccfa0a58cd95bba0e78dd425c9e6ee3414bf6 | f883e1fdda8875220cb7cf5c497704368c88c2bd | /xd-mvc/xd-mvc-core/src/main/java/com/xindian/mvc/result/StringResult.java | 47da7746eb66a10aabb4991c5745d25e5825b49c | [] | no_license | go2zo/XD | 433adbd736b45fcf36b2bdf140b5447fc7bc7d50 | 07d3fe7ab704c7ececbefef2f726bbd5632ffce4 | refs/heads/master | 2020-12-10T03:25:08.950332 | 2015-06-05T11:54:05 | 2015-06-05T11:54:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,413 | java | package com.xindian.mvc.result;
/**
* Returns a String to the client
*
* @author Elva
* @date 2011-1-17
* @version 1.0
*/
public class StringResult extends ReadableResult<StringResult> implements Resultable
{
private StringBuffer value;
// private String contentType;
// private String encoding;
public StringResult(CharSequence string)
{
setContentType("text/plain");
append(string);
}
public StringResult()
{
setContentType("text/plain");
}
/**
* Append some char sequence to be sent to the client
*
* @param string
* @return
*/
public StringResult append(CharSequence string)
{
if (value == null)
{
value = new StringBuffer(string.length());
}
value.append(string);
return this;
}
public CharSequence getValue()
{
return value;
}
public StringResult setValue(CharSequence value)
{
this.value = new StringBuffer(value);
return this;
}
/**
*
<code>
public String getEncoding()
{
return encoding;
}
public StringResult setEncoding(String encoding)
{
// Charset.isSupported(encoding);
this.encoding = encoding;
return this;
}
public String getContentType()
{
return contentType;
}
public StringResult setContentType(String contentType)
{
this.contentType = contentType;
return this;
}
</code>
*/
@Override
public Class<? extends ResultHandler> getHandler()
{
return StringResultHandler.class;
}
}
| [
"kanalun@163.com"
] | kanalun@163.com |
3caf902be5e2923f8469c072fbfc8ad0f410f542 | 6193f2aab2b5aba0fcf24c4876cdcb6f19a1be88 | /hgzb/src/client/nc/ui/zb/pub/refmodel/BiddingRefModelAll2.java | 2b653ec5413f30e904777a52acfba1815e4b7946 | [] | no_license | uwitec/nc-wandashan | 60b5cac6d1837e8e1e4f9fbb1cc3d9959f55992c | 98d9a19dc4eb278fa8aa15f120eb6ebd95e35300 | refs/heads/master | 2016-09-06T12:15:04.634079 | 2011-11-05T02:29:15 | 2011-11-05T02:29:15 | 41,097,642 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 2,642 | java | package nc.ui.zb.pub.refmodel;
/**
* 标书参照类 关联供应商信息
*/
import nc.ui.bd.ref.AbstractRefModel;
import nc.ui.pub.ClientEnvironment;
import nc.vo.pub.BusinessException;
import nc.vo.scm.pu.PuPubVO;
import nc.vo.trade.pub.IBillStatus;
import nc.vo.zb.pub.ZbPubConst;
import nc.vo.zb.pub.ZbPubTool;
public class BiddingRefModelAll2 extends AbstractRefModel{
public BiddingRefModelAll2() {
super();
}
private String cvendorid = null;
public BiddingRefModelAll2(String cvendorid) {
super();
this.cvendorid = cvendorid;
}
public void setVendor(String cvendorid){
this.cvendorid = cvendorid;
}
@Override
public String getWherePart() {
String sql = " isnull(zb_bidding_h.dr,0)= 0 and (zb_bidding_h.vbillstatus = "+ IBillStatus.CHECKPASS+") "
+ " and zb_bidding_h.pk_corp = '"+ClientEnvironment.getInstance().getCorporation().getPrimaryKey()+"'"
+ " and isnull(zb_bidding_h.dr,0)=0 and zb_bidding_h.ibusstatus in("+ZbPubConst.BIDDING_BUSINESS_STATUE_INIT
+ ","+ZbPubConst.BIDDING_BUSINESS_STATUE_SUBMIT+")";
String re =sql;
try {
String s =ZbPubTool.getParam();
if(s!=null &&!"".equals(s))
re = sql+" and zb_bidding_h.reserve1 = '"+s+"'";
if(PuPubVO.getString_TrimZeroLenAsNull(cvendorid)==null)
return re;
re = re + " and zb_bidding_h.cbiddingid in (select zb_biddingsuppliers.cbiddingid from zb_biddingsuppliers where isnull(zb_biddingsuppliers.dr,0)=0 "
+ " and coalesce(zb_biddingsuppliers.fisclose,'N') = 'N' and zb_biddingsuppliers.ccustmanid = '"
+ cvendorid.trim()+"')";
} catch (BusinessException e) {
e.printStackTrace();
return sql;
}
return re;
}
@Override
public String[] getFieldCode() {
return new String[] {
"zb_bidding_h.vbillno",
"zb_bidding_h.cname",
"zb_bidding_h.cbiddingid"
};
}
@Override
public String[] getFieldName() {
return new String[] { "标书编码", "标书名称"};
}
@Override
public String[] getHiddenFieldCode() {
return new String[] {"zb_bidding_h.cbiddingid"};
}
@Override
public int getDefaultFieldCount() {
return 5;
}
@Override
public String getPkFieldCode() {
return "zb_bidding_h.cbiddingid";
}
@Override
public String getRefTitle() {
return "标书档案";
}
@Override
public String getTableName() {
return " zb_bidding_h ";
}
@Override
protected String getRefCacheSqlKey() {
//设置不缓存
setCacheEnabled(false);
return "";
}
public String getOrderPart(){
return "zb_bidding_h.vbillno";
}
}
| [
"liuyushi_alice@163.com"
] | liuyushi_alice@163.com |
060fcd3cf930026ae50bbcf82bed2f80e8b118af | 3370c29bb204f83bb8caf04dcdfaf8b49bf05078 | /app/src/main/java/com/nazir/shopping/Model/Images.java | 71b1ef9e16a6c05ecdd1cb9490589198fdf22851 | [] | no_license | nazirahmad50/Android-Shopping-App-Client | 7da22fbb0f8ba43232f5af4b12c68c0c63aa81e0 | f04cd0e080f4ef40ffeee5fce677a4a57b0af73b | refs/heads/master | 2021-10-22T23:10:28.156874 | 2019-03-13T13:19:02 | 2019-03-13T13:19:02 | 173,788,945 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 565 | java | package com.nazir.shopping.Model;
public class Images {
private String imageLink;
private String color;
public Images() {
}
public Images(String imageLink, String color) {
this.imageLink = imageLink;
this.color = color;
}
public String getImageLink() {
return imageLink;
}
public void setImageLink(String imageLink) {
this.imageLink = imageLink;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
}
| [
"n_ahmad20@live.co.uk"
] | n_ahmad20@live.co.uk |
7b6e0c579e439b5a37a2fd000de9e51e3e2b9a6f | a58a5025f159e7129c749005cfb17f6193225f8c | /shop/src/main/java/com/searun/shop/util/SaveString.java | c02f3fb6dd5659c916c21758e92239af4a3e5179 | [] | no_license | cooltribe/Shop | fd7db777fe199bf78a0d6f9f905bab9ac2e9c0d5 | 40a8c716f693ac39e5d46d0d94265f8f3fd36296 | refs/heads/master | 2021-01-19T09:41:53.848223 | 2015-09-21T04:23:20 | 2015-09-21T04:23:20 | 38,291,314 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 777 | java | package com.searun.shop.util;
import android.content.Context;
import android.widget.Toast;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
public class SaveString {
public static void stringSave(String tag , Context context, String str) {
try {
FileOutputStream fOut = context.openFileOutput(tag + "textfile.txt", context.MODE_WORLD_READABLE);
OutputStreamWriter osw = new OutputStreamWriter(fOut);
// ---write the string to the file---
osw.write(str);
osw.flush();
osw.close();
// ---display file saved message---
Toast.makeText(context, "File saved successfully!", Toast.LENGTH_SHORT).show();
// ---clears the EditText---
} catch (IOException ioe) {
ioe.printStackTrace();
}
}
}
| [
"20865367@qq.com"
] | 20865367@qq.com |
67671037b4e43e60a9e750b5c9830b3ea20ea236 | ceb4272c0ab30d14fc39fb8aa86c118b1c042e07 | /src/main/java/org/codelibs/fess/app/web/admin/esreq/AdminEsreqAction.java | ded1401f108302f934f7f037dbe5423adb0dd28f | [
"Apache-2.0",
"MIT"
] | permissive | khazeshgar/fess | e06181524127dacadcd0ef781087b699abeb55fb | 2434a1a840a03caefe132d20670fd0e39665b676 | refs/heads/master | 2021-01-22T04:54:22.850578 | 2017-02-10T10:00:37 | 2017-02-10T10:00:37 | 81,598,962 | 1 | 0 | null | 2017-02-10T19:23:54 | 2017-02-10T19:23:54 | null | UTF-8 | Java | false | false | 5,796 | java | /*
* Copyright 2012-2017 CodeLibs Project and the Others.
*
* 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.codelibs.fess.app.web.admin.esreq;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Locale;
import org.codelibs.core.io.CopyUtil;
import org.codelibs.core.io.ReaderUtil;
import org.codelibs.core.lang.StringUtil;
import org.codelibs.elasticsearch.runner.net.Curl;
import org.codelibs.elasticsearch.runner.net.CurlRequest;
import org.codelibs.elasticsearch.runner.net.CurlResponse;
import org.codelibs.fess.Constants;
import org.codelibs.fess.app.web.base.FessAdminAction;
import org.codelibs.fess.util.ResourceUtil;
import org.lastaflute.web.Execute;
import org.lastaflute.web.response.ActionResponse;
import org.lastaflute.web.response.HtmlResponse;
import org.lastaflute.web.ruts.process.ActionRuntime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @author shinsuke
*/
public class AdminEsreqAction extends FessAdminAction {
private static final Logger logger = LoggerFactory.getLogger(AdminEsreqAction.class);
@Override
protected void setupHtmlData(final ActionRuntime runtime) {
super.setupHtmlData(runtime);
runtime.registerData("helpLink", systemHelper.getHelpLink(fessConfig.getOnlineHelpNameEsreq()));
}
@Execute
public HtmlResponse index() {
return asListHtml(() -> saveToken());
}
@Execute
public ActionResponse upload(final UploadForm form) {
validate(form, messages -> {}, () -> asListHtml(null));
verifyToken(() -> asListHtml(() -> saveToken()));
String header = null;
final StringBuilder buf = new StringBuilder(1000);
try (final BufferedReader reader = new BufferedReader(new InputStreamReader(form.requestFile.getInputStream(), Constants.UTF_8))) {
header = ReaderUtil.readLine(reader);
String line;
while ((line = ReaderUtil.readLine(reader)) != null) {
buf.append(line);
}
} catch (final Exception e) {
throwValidationError(messages -> messages.addErrorsFailedToReadRequestFile(GLOBAL, e.getMessage()), () -> {
return asListHtml(() -> saveToken());
});
}
final CurlRequest curlRequest = getCurlRequest(header);
if (curlRequest == null) {
final String msg = header;
throwValidationError(messages -> messages.addErrorsInvalidHeaderForRequestFile(GLOBAL, msg), () -> {
return asListHtml(() -> saveToken());
});
} else {
try (final CurlResponse response = curlRequest.body(buf.toString()).execute()) {
final File tempFile = File.createTempFile("esreq_", ".json");
try (final InputStream in = response.getContentAsStream()) {
CopyUtil.copy(in, tempFile);
} catch (final Exception e1) {
if (tempFile != null && tempFile.exists() && !tempFile.delete()) {
logger.warn("Failed to delete " + tempFile.getAbsolutePath());
}
throw e1;
}
return asStream("es_" + System.currentTimeMillis() + ".json").contentTypeOctetStream().stream(out -> {
try (final InputStream in = new FileInputStream(tempFile)) {
out.write(in);
} finally {
if (tempFile.exists() && !tempFile.delete()) {
logger.warn("Failed to delete " + tempFile.getAbsolutePath());
}
}
});
} catch (final Exception e) {
logger.warn("Failed to process request file: " + form.requestFile.getFileName(), e);
throwValidationError(messages -> messages.addErrorsInvalidHeaderForRequestFile(GLOBAL, e.getMessage()), () -> {
return asListHtml(() -> saveToken());
});
}
}
return redirect(getClass()); // no-op
}
private CurlRequest getCurlRequest(final String header) {
if (StringUtil.isBlank(header)) {
return null;
}
final String[] values = header.split(" ");
if (values.length != 2) {
return null;
}
final String url;
if (values[1].startsWith("/")) {
url = ResourceUtil.getElasticsearchHttpUrl() + values[1];
} else {
url = ResourceUtil.getElasticsearchHttpUrl() + "/" + values[1];
}
switch (values[0].toUpperCase(Locale.ROOT)) {
case "GET":
return Curl.get(url);
case "POST":
return Curl.post(url);
case "PUT":
return Curl.put(url);
case "DELETE":
return Curl.delete(url);
default:
break;
}
return null;
}
private HtmlResponse asListHtml(final Runnable runnable) {
if (runnable != null) {
runnable.run();
}
return asHtml(path_AdminEsreq_AdminEsreqJsp).useForm(UploadForm.class);
}
}
| [
"shinsuke@yahoo.co.jp"
] | shinsuke@yahoo.co.jp |
e29568495363f23b6163132d74d815462acd5561 | da181f89e0b26ffb3fc5f9670a3a5f8f1ccf0884 | /BackGestionTextilLevel/src/ar/com/textillevel/gui/modulos/personal/modulos/vales/cabecera/ModeloCabeceraValesAnticipo.java | b05d681da4219ea1e41199037233d9778f9b42d8 | [] | no_license | nacho270/GTL | a1b14b5c95f14ee758e6b458de28eae3890c60e1 | 7909ed10fb14e24b1536e433546399afb9891467 | refs/heads/master | 2021-01-23T15:04:13.971161 | 2020-09-18T00:58:24 | 2020-09-18T00:58:24 | 34,962,369 | 2 | 1 | null | 2016-08-22T22:12:57 | 2015-05-02T20:31:49 | Java | UTF-8 | Java | false | false | 1,030 | java | package ar.com.textillevel.gui.modulos.personal.modulos.vales.cabecera;
import java.sql.Date;
import ar.com.textillevel.modulos.personal.entidades.recibosueldo.enums.EEstadoValeAnticipo;
public class ModeloCabeceraValesAnticipo {
private Date fechaDesde;
private Date fechaHasta;
private String apellidoEmpleado;
private EEstadoValeAnticipo estadoVale;
public Date getFechaDesde() {
return fechaDesde;
}
public void setFechaDesde(Date fechaDesde) {
this.fechaDesde = fechaDesde;
}
public Date getFechaHasta() {
return fechaHasta;
}
public void setFechaHasta(Date fechaHasta) {
this.fechaHasta = fechaHasta;
}
public String getApellidoEmpleado() {
return apellidoEmpleado;
}
public void setApellidoEmpleado(String apellidoEmpleado) {
this.apellidoEmpleado = apellidoEmpleado;
}
public EEstadoValeAnticipo getEstadoVale() {
return estadoVale;
}
public void setEstadoVale(EEstadoValeAnticipo estadoVale) {
this.estadoVale = estadoVale;
}
}
| [
"ignaciocicero@gmail.com@9de48aec-ec99-11dd-b2d9-215335d0b316"
] | ignaciocicero@gmail.com@9de48aec-ec99-11dd-b2d9-215335d0b316 |
89f82e7e8a2890464ae0870b98950d10287226a0 | b4b95c21572ac6573706df0edba99e4abb947924 | /singer-parent/singer-java/src/test/java/org/talend/sdk/component/singer/java/SingerTest.java | 262e60d551c13fbc372a839ccf6dd29eb9d90797 | [
"Apache-2.0"
] | permissive | RyanSkraba/component-runtime | 33d3231658cda17c3861f16f0cceca628c27a4c2 | cae7b10238ee5b62256a72a780c781c40fc52822 | refs/heads/master | 2023-02-18T02:38:37.859335 | 2021-01-18T15:31:32 | 2021-01-18T18:07:04 | 126,361,369 | 0 | 0 | Apache-2.0 | 2018-03-22T16:07:04 | 2018-03-22T16:07:01 | null | UTF-8 | Java | false | false | 2,984 | java | /**
* Copyright (C) 2006-2020 Talend Inc. - www.talend.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.talend.sdk.component.singer.java;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.fail;
import java.io.ByteArrayOutputStream;
import java.io.OutputStream;
import java.io.PrintStream;
import java.io.UnsupportedEncodingException;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.function.Consumer;
import javax.json.Json;
import org.junit.jupiter.api.Test;
class SingerTest {
@Test
void writeRecord() throws UnsupportedEncodingException {
write(s -> s.writeRecord("test_stream", Json.createObjectBuilder().add("id", 1).add("name", "Test").build()),
"{\"type\":\"RECORD\",\"stream\":\"test_stream\",\"time_extracted\":\"2019-08-23T11:26:00.000Z\",\"record\":{\"id\":1,\"name\":\"Test\"}}");
}
@Test
void writeShema() throws UnsupportedEncodingException {
write(s -> s
.writeSchema("test_stream", Json.createObjectBuilder().add("id", 1).add("name", "Test").build(),
Json.createArrayBuilder().add("foo").build(), Json.createArrayBuilder().add("bar").build()),
"{\"type\":\"SCHEMA\",\"stream\":\"test_stream\",\"schema\":{\"id\":1,\"name\":\"Test\"},\"key_properties\":[\"foo\"],\"bookmark_properties\":[\"bar\"]}");
}
@Test
void writeState() throws UnsupportedEncodingException {
write(s -> s.writeState(Json.createObjectBuilder().add("offset", 1).build()),
"{\"type\":\"STATE\",\"value\":{\"offset\":1}}");
}
private void write(final Consumer<Singer> singerConsumer, final String expected)
throws UnsupportedEncodingException {
final ByteArrayOutputStream stdout = new ByteArrayOutputStream();
final PrintStream stdoutPs = new PrintStream(stdout);
final Singer singer = new Singer(new IO(System.in, stdoutPs, faillingPrintStream()),
() -> ZonedDateTime.of(2019, 8, 23, 11, 26, 0, 0, ZoneId.of("UTC")));
singerConsumer.accept(singer);
stdoutPs.flush();
assertEquals(expected, stdout.toString("UTF-8").trim());
}
private PrintStream faillingPrintStream() {
return new PrintStream(new OutputStream() {
@Override
public void write(int b) {
fail();
}
});
}
}
| [
"rmannibucau@gmail.com"
] | rmannibucau@gmail.com |
cd92e357c8895f6f320cebd1aa6b88357cede98f | 79d7fa13763041f6e399af8e19827359c4c42a30 | /app/src/main/java/com/android/hcbd/dailylog/entity/WorkLogInfo.java | 11cdfb56454b887972456ab1a3c6d133eb159ef4 | [] | no_license | guocheng0606/Hcbd_DailyLog | 34d6fe14d3659ba6a7458e916ace13b60ce0d2f2 | d1622e5bae8ece3b15b772ac68befa5774df286e | refs/heads/master | 2020-03-21T17:20:03.891948 | 2018-06-27T03:42:04 | 2018-06-27T03:42:04 | 138,826,284 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,813 | java | package com.android.hcbd.dailylog.entity;
import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Generated;
import java.io.Serializable;
/**
* Created by guocheng on 2017/12/15.
*/
@Entity
public class WorkLogInfo implements Serializable {
static final long serialVersionUID = 42L;
@Id(autoincrement = true)
private Long id;
private String date; //日期
private String time; //时间
private String week; //星期几
private String weather; //天气
private String contents; //今日工作
private String visits; //今日拜访
private String phoneComms; //今日电话沟通
private String cheats; //今日备忘
private String planss; //明日计划
private String conclusion; //问题与体会
private String template; //模板类型
private String data1; //备用字段1
private String data2; //备用字段2
@Generated(hash = 1173835821)
public WorkLogInfo(Long id, String date, String time, String week,
String weather, String contents, String visits, String phoneComms,
String cheats, String planss, String conclusion, String template,
String data1, String data2) {
this.id = id;
this.date = date;
this.time = time;
this.week = week;
this.weather = weather;
this.contents = contents;
this.visits = visits;
this.phoneComms = phoneComms;
this.cheats = cheats;
this.planss = planss;
this.conclusion = conclusion;
this.template = template;
this.data1 = data1;
this.data2 = data2;
}
@Generated(hash = 1238775740)
public WorkLogInfo() {
}
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
public String getDate() {
return this.date;
}
public void setDate(String date) {
this.date = date;
}
public String getWeek() {
return this.week;
}
public void setWeek(String week) {
this.week = week;
}
public String getWeather() {
return this.weather;
}
public void setWeather(String weather) {
this.weather = weather;
}
public String getContents() {
return this.contents;
}
public void setContents(String contents) {
this.contents = contents;
}
public String getVisits() {
return this.visits;
}
public void setVisits(String visits) {
this.visits = visits;
}
public String getPhoneComms() {
return this.phoneComms;
}
public void setPhoneComms(String phoneComms) {
this.phoneComms = phoneComms;
}
public String getCheats() {
return this.cheats;
}
public void setCheats(String cheats) {
this.cheats = cheats;
}
public String getPlanss() {
return this.planss;
}
public void setPlanss(String planss) {
this.planss = planss;
}
public String getConclusion() {
return this.conclusion;
}
public void setConclusion(String conclusion) {
this.conclusion = conclusion;
}
public String getTime() {
return this.time;
}
public void setTime(String time) {
this.time = time;
}
public String getTemplate() {
return this.template;
}
public void setTemplate(String template) {
this.template = template;
}
public String getData1() {
return this.data1;
}
public void setData1(String data1) {
this.data1 = data1;
}
public String getData2() {
return this.data2;
}
public void setData2(String data2) {
this.data2 = data2;
}
}
| [
"1452535964@qq.com"
] | 1452535964@qq.com |
ee044c4010e1251f8f53683a1decd7ff8f1cdeb3 | 85a2d89c2c2a2908b67312c47b73b16fe58c5b58 | /src/main/java/com/cheatbreaker/nethandler/shared/CBPacketWaypointAdd.java | 14bfd1295936a782a433456d2402bdd83e597ec2 | [] | no_license | CoOwner/CheatBreakerAPINetHandler | 60f92479f34d65eba06c4c30459f5f0ce78f0ade | 0f2222f8ada77da1a6d4d1ec431e1335b62ec570 | refs/heads/master | 2022-09-13T21:40:56.815361 | 2020-05-23T19:21:08 | 2020-05-23T19:21:08 | 266,401,321 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,230 | java | package com.cheatbreaker.nethandler.shared;
import com.google.common.base.*;
import java.io.*;
import com.cheatbreaker.nethandler.*;
public class CBPacketWaypointAdd extends CBPacket
{
private String name;
private String world;
private int color;
private int x;
private int y;
private int z;
private boolean forced;
private boolean visible;
public CBPacketWaypointAdd(String name, String world, int color, int x, int y, int z, boolean forced, boolean visible) {
this.name = (String)Preconditions.checkNotNull((Object)name, "name");
this.world = (String)Preconditions.checkNotNull((Object)world, "world");
this.color = color;
this.x = x;
this.y = y;
this.z = z;
this.forced = forced;
this.visible = visible;
}
@Override
public void write(ByteBufWrapper b) throws IOException {
b.writeString(this.name);
b.writeString(this.world);
b.buf().writeInt(this.color);
b.buf().writeInt(this.x);
b.buf().writeInt(this.y);
b.buf().writeInt(this.z);
b.buf().writeBoolean(this.forced);
b.buf().writeBoolean(this.visible);
}
@Override
public void read(ByteBufWrapper b) throws IOException {
this.name = b.readString();
this.world = b.readString();
this.color = b.buf().readInt();
this.x = b.buf().readInt();
this.y = b.buf().readInt();
this.z = b.buf().readInt();
this.forced = b.buf().readBoolean();
this.visible = b.buf().readBoolean();
}
@Override
public void process(ICBNetHandler handler) {
handler.handleAddWaypoint(this);
}
public String getName() {
return this.name;
}
public String getWorld() {
return this.world;
}
public int getColor() {
return this.color;
}
public int getX() {
return this.x;
}
public int getY() {
return this.y;
}
public int getZ() {
return this.z;
}
public boolean isForced() {
return this.forced;
}
public boolean isVisible() {
return this.visible;
}
public CBPacketWaypointAdd() {
}
}
| [
"david@orbit.games"
] | david@orbit.games |
57639fca100387742d049f980afffaa6286d41dc | 9dd61b24ee3b8099480bde807aaceaa16f0aeca0 | /app/src/main/java/example/com/mycustomview/view/DrawRectView.java | 92cf6e3c80d33b20d0fc56ceb56fc1597cef85dc | [] | no_license | wanghao200906/myView | 6565f8acc0d5ac3ce136ddb00bb5ac8839dc5521 | d4586ef5e35f90db4327c9ca37e7329f00259ee5 | refs/heads/master | 2021-01-23T20:00:09.424785 | 2017-09-08T09:21:36 | 2017-09-08T09:21:36 | 102,843,181 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,538 | java | package example.com.mycustomview.view;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.view.View;
/**
* 创建日期: 15/12/9 下午1:02
* 作者:wanghao
* 描述:
*/
public class DrawRectView extends View {
Paint paint;
public DrawRectView(Context context) {
this(context, null);
}
public DrawRectView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public DrawRectView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
paint = new Paint(Paint.ANTI_ALIAS_FLAG);
}
int width;
int height;
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
width = canvas.getWidth();
height = canvas.getHeight();
paint.setColor(Color.RED);
//画一个矩形
canvas.drawRect(0, 0, width / 2, height / 3, paint);
paint.setColor(Color.GRAY);
Rect r = new Rect(width / 2, 0, width, height / 3);
canvas.drawRect(r, paint);
paint.setColor(Color.GREEN);
RectF f = new RectF(0, height / 3, width / 2, height / 2);
canvas.drawRect(f, paint);
//画一个圆角矩形
RectF f1 = new RectF(width / 2, height / 3, width, height / 2);
canvas.drawRoundRect(f1, 100, 100, paint);
}
}
| [
"1045189341@qq.com"
] | 1045189341@qq.com |
f57be11807a00e2fa9b9243455714a23aa3c0f44 | 06560d44b685a508952fe7dad25153019cf9de98 | /src/main/java/duke/util/DateTime.java | 1951f1be1214dd425433103d5cfb21fd2912b6fa | [] | no_license | SimJunYou/ip | 5bd39312f508f34e92b0f2beaabc89e957824fa3 | c0a19b795d06dd021ae94e16dc0640900c9232a2 | refs/heads/master | 2022-12-24T14:56:21.652852 | 2020-09-28T08:18:02 | 2020-09-28T08:18:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,348 | java | package duke.util;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
/**
* The DateTime type. Encapsulates all logic for the LocalDateTime class of objects.
*/
public class DateTime {
private static final DateTimeFormatter commandForm = DateTimeFormatter.ofPattern("d/MM/yyyy HH:mm");
private static final DateTimeFormatter outputForm = DateTimeFormatter.ofPattern("E HH:mm, d MMM yyyy");
/**
* Convert a string into a LocalDateTime object with the slashForm format.
*
* @param input String to be parsed
* @return LocalDate object
*/
public static LocalDateTime parseDate(String input) {
return LocalDateTime.parse(input, commandForm);
}
/**
* Checks whether a given string is a valid date or not.
*
* @param input The string to be checked
* @return boolean of whether the string is a valid date
*/
public static boolean checkValidDate(String input) {
try {
parseDate(input);
return true;
} catch (Exception e) {
return false;
}
}
public static String getStringForm(LocalDateTime inputDate){
return outputForm.format(inputDate);
}
public static String getCommandForm(LocalDateTime inputDate){
return commandForm.format(inputDate);
}
}
| [
"simjunyou99@gmail.com"
] | simjunyou99@gmail.com |
e306ca81e57b75d37ae00813f0baa6bde63110dd | 1432fbe91585ebc86ad1c7c6550f03204e1c962c | /src/zjitc/net/homework/homework5/express/Test.java | 924fa4a34a08890e783b7aef7d0811bb155092b7 | [] | no_license | dyk0419/java2019 | 1b0c7bc6b30cc34618d8253998ccea21f96eea9c | 186af114663bda4cfd948ceedfda20549ec39946 | refs/heads/master | 2020-05-17T15:10:51.868789 | 2019-04-28T13:31:58 | 2019-04-28T13:31:58 | 183,782,613 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 367 | java | package zjitc.net.homework.homework5.express;
/**
* @author 杜源康
* @date 2019-03-24 22:36
*/
public class Test {
public static void main(String[] args) {
Express express=new Express("HYX0001",800.0);
express.sendBefore();
Car car=new Truck("A2025","","小王");
express.send(car);
express.sendAfter(car);
}
}
| [
"1197264772@qq.com"
] | 1197264772@qq.com |
ec02141d2d6b00df62ee714e57486ed1309d6fd0 | 99b8477ad42bfbc17d4e1062a16272187f05ef17 | /app/src/main/java/com/nqnghia/dryersystemapplication/RecipeAdapter.java | c805b0d626f525fa83365dcce2a0cb7d2e94f38a | [] | no_license | nqnghia285/DryerSystemApplication | 9d811c84f481a2358aedfbe7ba6472af4887f66e | 55126fe75e7ae617d479c7da9d50e665f17ced51 | refs/heads/master | 2021-02-12T02:02:02.109259 | 2020-05-17T17:37:17 | 2020-05-17T17:37:17 | 244,550,321 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,968 | java | package com.nqnghia.dryersystemapplication;
import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import java.util.List;
public class RecipeAdapter extends ArrayAdapter<RecipeItem> {
LayoutInflater inflater;
int resId;
List<RecipeItem> objects;
Context context;
public RecipeAdapter(Activity context, int resId, List<RecipeItem> list) {
super(context, resId, list);
inflater = context.getLayoutInflater();
this.resId = resId;
objects = list;
this.context = context;
}
@NonNull
@Override
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
RecipeItem item = getItem(position);
View rowView = inflater.inflate(resId, null, true);
TextView recipeTitleOption = rowView.findViewById(R.id.recipe_title_option);
recipeTitleOption.setText(item.getRecipeTitle() + ": " + item.getWeighTextView() + "Kg");
return rowView;
}
@Override
public View getDropDownView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
return getCustomDropDownView(position, convertView, parent);
}
public View getCustomDropDownView(int position, View convertView, ViewGroup parent) {
LayoutInflater layoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View row = layoutInflater.inflate(R.layout.selecte_recipes_layout, parent, false);
RecipeItem item = getItem(position);
TextView recipeTitleOption = row.findViewById(R.id.recipe_title_option);
recipeTitleOption.setText(item.getRecipeTitle() + ": " + item.getWeighTextView() + "Kg");
return row;
}
}
| [
"nqnghia285@gmail.com"
] | nqnghia285@gmail.com |
4fd6a90743bbb2623dcf2edea82c308b51b45de8 | 4ec3bf36837420a2cb84bec4adb772d2664f6e92 | /FrameworkDartesESP_alunosSDIS/brokerOM2M/org.eclipse.om2m/org.eclipse.om2m.persistence.mongodb/src/main/java/org/eclipse/om2m/persistence/mongodb/DBTransactionImpl.java | 5520d4545d75fb5b7c0c081e3727ceaf16c2730e | [] | no_license | BaltasarAroso/SDIS_OM2M | 1f2ce310b3c1bf64c2a95ad9d236c64bf672abb0 | 618fdb4da1aba5621a85e49dae0442cafef5ca31 | refs/heads/master | 2020-04-08T19:08:22.073674 | 2019-01-20T15:42:48 | 2019-01-20T15:42:48 | 159,641,777 | 0 | 2 | null | 2020-03-06T15:49:51 | 2018-11-29T09:35:02 | C | UTF-8 | Java | false | false | 4,539 | java | /*******************************************************************************
* Copyright (c) 2014, 2016 Orange.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/
package org.eclipse.om2m.persistence.mongodb;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.eclipse.om2m.commons.entities.ResourceEntity;
import org.eclipse.om2m.persistence.service.DBTransaction;
public class DBTransactionImpl implements DBTransaction {
private static final Log LOGGER = LogFactory.getLog(DBTransactionImpl.class);
private static final Set<String> GLOBAL_LOCKED_OBJECTS = new HashSet<>();
private final UUID uuid;
private final Set<String> lockedObjects;
private boolean childToBeLoaded = true;
public DBTransactionImpl() {
uuid = UUID.randomUUID();
lockedObjects = new HashSet<>();
}
@Override
public void open() {
// nothing to do
}
@Override
public void commit() {
LOGGER.info("commit() for trasaction " + uuid);
Set<String> currentLockedObjects = new HashSet<>();
synchronized (lockedObjects) {
currentLockedObjects.addAll(lockedObjects);
}
for(String lockedResourceId : currentLockedObjects) {
unlock(lockedResourceId);
}
}
@Override
public void close() {
}
@Override
public void clear() {
}
@Override
public void lock(Object object) {
LOGGER.info("lock()");;
ResourceEntity resourceEntityToBeLocked = null;
if (object instanceof ResourceEntity) {
resourceEntityToBeLocked = (ResourceEntity) object;
}
if (resourceEntityToBeLocked != null) {
// handle lock
String resourceId = resourceEntityToBeLocked.getResourceID();
LOGGER.info("request lock for " + resourceId + " by transaction " + uuid);
// add global lock (blocking call for 10s max
if (addGlobalLock(resourceId)) {
synchronized (lockedObjects) {
lockedObjects.add(resourceId);
}
} else {
throw new RuntimeException("unable to acquire lock for resource " + resourceId + " by transaction " + uuid);
}
} else {
// does nothing ?
throw new RuntimeException();
}
}
@Override
public void unlock(Object object) {
LOGGER.info("unlock object=" + object + " for transaction " + uuid);
ResourceEntity resourceEntityToBeLocked = null;
if (object instanceof ResourceEntity) {
resourceEntityToBeLocked = (ResourceEntity) object;
}
if (resourceEntityToBeLocked != null) {
String resourceId = resourceEntityToBeLocked.getResourceID();
unlock(resourceId);
}
}
private void unlock(String resourceId) {
LOGGER.debug("try to unlock " + resourceId + " by transaction " + uuid);
synchronized (lockedObjects) {
if (lockedObjects.remove(resourceId)) {
removeGlobalLock(resourceId);
}
}
}
public boolean isChildToBeLoaded() {
return childToBeLoaded;
}
public void setChildToBeLoaded(boolean childToBeLoaded) {
this.childToBeLoaded = childToBeLoaded;
}
/**
* Check if a global lock exists for the provided resourceId
*
* @param resourceId
* @return true if a lock exists for this resourceId
*/
private static boolean isExistingLock(final String resourceId) {
synchronized (GLOBAL_LOCKED_OBJECTS) {
return GLOBAL_LOCKED_OBJECTS.contains(resourceId);
}
}
private synchronized static boolean addGlobalLock(final String resourceId) {
synchronized (GLOBAL_LOCKED_OBJECTS) {
long initialTime = System.currentTimeMillis();
while (System.currentTimeMillis() < initialTime + 10000) {
if (GLOBAL_LOCKED_OBJECTS.contains(resourceId)) {
try {
GLOBAL_LOCKED_OBJECTS.wait(1000);
} catch (InterruptedException e) {
return false;
}
}
if (!GLOBAL_LOCKED_OBJECTS.contains(resourceId)) {
GLOBAL_LOCKED_OBJECTS.add(resourceId);
return true;
}
}
}
return false;
}
private synchronized static void removeGlobalLock(final String resourceId) {
synchronized (GLOBAL_LOCKED_OBJECTS) {
GLOBAL_LOCKED_OBJECTS.remove(resourceId);
GLOBAL_LOCKED_OBJECTS.notifyAll();
}
}
}
| [
"ba_aroso@icloud.com"
] | ba_aroso@icloud.com |
35f0f93d5028b22f4e3ee9330409941e52643aa2 | 4f8fafc348710a165d85423eda79d150622e7448 | /src/main/java/kr/co/wincom/imcs/api/getNSVisitDtl/GetNSVisitDtlRequestVO.java | 3238f22cfa297b6491fb385fabe8f1ffe41030ed | [] | no_license | yyj7952/wincom | 79162632b3b4da95e9c9ffbdf14d54a58e8460cc | a443dec8aca0238f62f1bb3bbf4feeeae6129796 | refs/heads/master | 2023-06-24T20:15:36.839737 | 2021-07-26T06:59:50 | 2021-07-26T06:59:50 | 377,038,803 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,464 | java | package kr.co.wincom.imcs.api.getNSVisitDtl;
import java.io.Serializable;
import java.util.HashMap;
import kr.co.wincom.imcs.common.ImcsConstants;
import kr.co.wincom.imcs.common.vo.NoSqlLoggingVO;
import kr.co.wincom.imcs.handler.ImcsException;
@SuppressWarnings("serial")
public class GetNSVisitDtlRequestVO extends NoSqlLoggingVO implements Serializable {
/********************************************************************
* getNSVisitDtl API 전문 칼럼(순서 일치)
********************************************************************/
private String saId = ""; // 가입자 정보
private String stbMac = ""; // 가입자 MAC_ADDRESS
private String albumId = ""; // 앨범 ID
private String catId = ""; // 카테고리 ID
/********************************************************************
* 추가 사용 파라미터
********************************************************************/
private String pid = "";
private String resultCode = "";
private long tp_start = 0;
public GetNSVisitDtlRequestVO(){}
public GetNSVisitDtlRequestVO(String szParam){
String[] arrStat = szParam.split("\\|");
String key = "";
String value = "";
int nStr = 0;
HashMap<String, String> paramMap = new HashMap<String, String>();
for(int i = 0; i < arrStat.length; i++){
nStr = arrStat[i].indexOf("=");
if(nStr > 0) {
key = arrStat[i].substring(0, nStr).toLowerCase().trim();
value = arrStat[i].substring(nStr + 1, arrStat[i].length()).trim();
paramMap.put(key, value);
/*if( !value.matches(ImcsConstants.N_SP_PTN) && key.toLowerCase().indexOf("name") == -1 ){
//특수문자 있음
throw new ImcsException();
}*/
if(key.toLowerCase().equals("sa_id")) this.saId = value;
if(key.toLowerCase().equals("stb_mac")) this.stbMac = value;
if(key.toLowerCase().equals("cat_id")) this.catId = value;
if(key.toLowerCase().equals("album_id")) this.albumId = value;
}
}
//GetNSVisitDtlController.saId = paramMap.get("sa_id");
//GetNSVisitDtlController.stbMac = paramMap.get("stb_mac");
/*if(this.saId.length() > 12 || this.saId.length() < 7 ){
throw new ImcsException();
}
if(this.stbMac.length() > 39 || this.stbMac.length() < 14 ){
throw new ImcsException();
}*/
/*String szTempCatId = "";
if(this.catId != null && this.catId.length() > 5)
szTempCatId = this.catId.substring(0, 4);*/
if( "".equals(this.saId) && "".equals(this.stbMac) || this.catId.indexOf("undef") != -1){
throw new ImcsException();
}
}
public String getSaId() {
return saId;
}
public void setSaId(String saId) {
this.saId = saId;
}
public String getStbMac() {
return stbMac;
}
public void setStbMac(String stbMac) {
this.stbMac = stbMac;
}
public String getAlbumId() {
return albumId;
}
public void setAlbumId(String albumId) {
this.albumId = albumId;
}
public String getCatId() {
return catId;
}
public void setCatId(String catId) {
this.catId = catId;
}
public String getPid() {
return pid;
}
public void setPid(String pid) {
this.pid = pid;
}
public String getResultCode() {
return resultCode;
}
public void setResultCode(String resultCode) {
this.resultCode = resultCode;
}
public long getTp_start() {
return tp_start;
}
public void setTp_start(long tp_start) {
this.tp_start = tp_start;
}
}
| [
"yyj7952@gmail.com"
] | yyj7952@gmail.com |
f02b17adc6d6bd40a6c2b5f19a8763c7cbc06230 | 2360dd00aa57355e542d5edc0d8a9d058f71b7b9 | /JMapper Test/src/test/java/com/googlecode/jmapper/integrationtest/conversions/bean/DExplicitXmlConversion.java | d1b6bb9814f9e3b8d89ad8ca787fc40a3e420bba | [] | no_license | madhu4a3/jmapper-framework | 3367d99a60373a3aec1fe122d7f945937fad6d13 | 75d034529c1ac86cc0b311130f2698a362a0866c | refs/heads/master | 2021-01-10T07:49:30.745004 | 2015-04-17T11:29:22 | 2015-04-17T11:29:22 | 48,153,004 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,042 | java | package com.googlecode.jmapper.integrationtest.conversions.bean;
public class DExplicitXmlConversion {
private String dField;
private String dField2;
private String dField3;
public DExplicitXmlConversion() {}
/**
* @param dField
* @param dField2
* @param dField3
*/
public DExplicitXmlConversion(String dField, String dField2, String dField3) {
super();
this.dField = dField;
this.dField2 = dField2;
this.dField3 = dField3;
}
public String getDField() {
return dField;
}
public void setDField(String dField) {
this.dField = dField;
}
public String getDField2() {
return dField2;
}
public void setDField2(String dField2) {
this.dField2 = dField2;
}
public String getDField3() {
return dField3;
}
public void setDField3(String dField3) {
this.dField3 = dField3;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((dField == null) ? 0 : dField.hashCode());
result = prime * result + ((dField2 == null) ? 0 : dField2.hashCode());
result = prime * result + ((dField3 == null) ? 0 : dField3.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
DExplicitXmlConversion other = (DExplicitXmlConversion) obj;
if (dField == null) {
if (other.dField != null)
return false;
} else if (!dField.equals(other.dField))
return false;
if (dField2 == null) {
if (other.dField2 != null)
return false;
} else if (!dField2.equals(other.dField2))
return false;
if (dField3 == null) {
if (other.dField3 != null)
return false;
} else if (!dField3.equals(other.dField3))
return false;
return true;
}
@Override
public String toString() {
return "DExplicitXmlConversion: dField(" + dField + ") dField2(" + dField2 + ") dField3(" + dField3 + ")";
}
}
| [
"alessandro.vurro@092d7813-c906-8c0d-5406-876db11828ef"
] | alessandro.vurro@092d7813-c906-8c0d-5406-876db11828ef |
630377d971b3c87d8e985357c378bfcf6f76fa50 | 1eed4292f14b8c21f639cd676870443896856d67 | /src/main/java/com/f6/utils/PasswordHelper.java | 57b57ab25c6d9fb0ea39561b8d204cc9fe82c5a6 | [] | no_license | sg-wang/f6 | 35c5351fb8407bfd08031426ed4fa94eca0a1d73 | bd023f258e8ad8e260e67e65871a14ae0f753c58 | refs/heads/master | 2021-05-31T01:27:56.463715 | 2016-03-01T05:07:36 | 2016-03-01T05:07:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,773 | java | package com.f6.utils;
import org.apache.commons.codec.binary.Base64;
import org.apache.shiro.crypto.RandomNumberGenerator;
import org.apache.shiro.crypto.SecureRandomNumberGenerator;
import org.apache.shiro.crypto.hash.SimpleHash;
import org.apache.shiro.util.ByteSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import com.f6.auth.domain.UserVO;
@Component("passwordHelper")
public class PasswordHelper {
private Logger logger = LoggerFactory.getLogger(PasswordHelper.class);
private static final String SALT = "FRAMEWORK6";
private static RandomNumberGenerator generator = new SecureRandomNumberGenerator();
private static String algorithmName = "md5";
private static final int hashIterations = 1;
public static void encryptPassword(UserVO user) {
if (user.getUserSalt() == null || "".equals(user.getUserSalt())) {
String salt = generator.nextBytes().toHex();
user.setUserSalt(salt);
}
String newPassword = new SimpleHash(algorithmName, user.getUserPassword(), ByteSource.Util.bytes(user.getUserSalt()), hashIterations).toHex();
user.setUserPassword(newPassword);
}
public static String encryptString(String str) {
String newPassword = "";
try {
// String salt = generator.nextBytes().toHex();
newPassword = new SimpleHash(algorithmName, str, ByteSource.Util.bytes(SALT), hashIterations).toHex();
} catch (Exception e) {
e.printStackTrace();
}
return newPassword;
}
public static String generateToken(String userid, String encryptedpwd, String requestIP) {
String source=userid + encryptedpwd + requestIP;
String token = "";
try {
token = new SimpleHash(algorithmName, source, SALT, hashIterations).toHex();
} catch (Exception e) {
e.printStackTrace();
}
return token;
}
public static String[] parseTZToken(String token) {
String[] decrypstr = new String[2];
try {
// String salt = generator.nextBytes().toHex();
String decrypedstr = decodeStr(token);
String userid = decrypedstr.substring(0, 18);
String tokenstr = decrypedstr.substring(18);
decrypstr[0] = userid;
decrypstr[1] = tokenstr;
} catch (Exception e) {
e.printStackTrace();
}
return decrypstr;
}
public static void main(String[] args) {
}
public static String encodeStr(String plainText) {
byte[] b = plainText.getBytes();
Base64 base64 = new Base64();
b = base64.encode(b);
String s = new String(b);
return s;
}
/**
*
* 创建日期2011-4-25上午10:15:11 修改日期 作者:dh *TODO 使用Base64加密 return
*/
public static String decodeStr(String encodeStr) {
byte[] b = encodeStr.getBytes();
Base64 base64 = new Base64();
b = base64.decode(b);
String s = new String(b);
return s;
}
}
| [
"sgwang@cn.ibm.com"
] | sgwang@cn.ibm.com |
e9cdb4f8c6e721e901014cee1847ca6d01fa08dd | 3d3df308a60ffc6122965e108181c39c6c406500 | /src/test/java/model/CMSUserTest.java | 64915fe219db1c107945127da03eb989fac30075 | [] | no_license | MichalKuk10/quest-store | 2a7714dec34f3f88ba1ba90d7d6413417820a336 | 787e5fcd68f961e98492b7ed7616e756edc24167 | refs/heads/main | 2023-03-18T17:17:56.356951 | 2021-03-11T09:51:46 | 2021-03-11T09:51:46 | 346,630,812 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 946 | java | package model;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
public class CMSUserTest {
@Test
@DisplayName("It should return Admin as String")
public void shouldReturnAdminRoleAsString() {
//given
CMSUser user = new CMSUser.Builder()
.userRole(true)
.build();
String expected = "Admin";
//when
String result = user.getRole();
//then
assertEquals(expected, result);
}
@Test
@DisplayName("It should return Mentor as String")
public void shouldReturnMentorRoleAsString() {
// given
CMSUser user = new CMSUser.Builder()
.userRole(false)
.build();
String expected = "Mentor";
//when
String result = user.getRole();
//then
assertEquals(expected, result);
}
} | [
"kuk.michal3@gmail.com"
] | kuk.michal3@gmail.com |
7f551291d3a9ede64a7c99e9294881479f160dad | cd14c8ea6779a9f88a0d310f3147dd35aac2c70f | /app/src/main/java/com/example/StartQuest/TheNinthTask.java | 3c43ad47028c8fe3cf524e71be987e3dd07c303c | [] | no_license | TkachenkoND/Project_Autoquest | cdad291de283753c97e1a41433dbb514c089ea03 | 631af3044e694618823ce25e7bab300784a8d930 | refs/heads/master | 2023-07-07T09:12:12.187436 | 2021-08-06T09:45:36 | 2021-08-06T09:45:36 | 393,322,858 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,107 | java | package com.example.StartQuest;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import com.example.project_aq_version009.R;
public class TheNinthTask extends AppCompatActivity implements View.OnClickListener{
private TextView _tvTxtQuest, _time;
private EditText _answerQuest;
private Button _takePrompt;
private Button _enterAnswerQuest;
private CountDownTimer countDownTimer;
private long timeLeftInMilliseconds = 900000; //15 mins
private double point;
private int mins, seconds;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.the_ninth_task_activity);
getWindow().getDecorView().setSystemUiVisibility
(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
|View.SYSTEM_UI_FLAG_FULLSCREEN);
_tvTxtQuest = (TextView) findViewById(R.id._txtQuest);
_time = (TextView) findViewById(R.id.time);
_answerQuest = (EditText) findViewById(R.id._answerQuest);
_takePrompt = (Button) findViewById(R.id._btPrompt);
_takePrompt.setOnClickListener(this);
_enterAnswerQuest = (Button) findViewById(R.id._btEnterAnswer);
_enterAnswerQuest.setOnClickListener(this);
startTimer();
}
public void onClick(View view){
String _answerForQuest = _answerQuest.getText().toString().trim();
switch (view.getId()){
case R.id._btEnterAnswer:
if(TextUtils.isEmpty(_answerForQuest)){
Toast.makeText(getApplicationContext(), "Поле для вводу пусте", Toast.LENGTH_SHORT).show();
return;
}
if (!_answerForQuest.equalsIgnoreCase("Усі")){
Toast.makeText(getApplicationContext(), "Відповідь неправиль(", Toast.LENGTH_SHORT).show();
return;
}
//Начисляємо бали відповідно до часу проходження завдання
point = TheFirstTask.getPoint();
point += 10 - (900 - (mins * 60 + seconds) ) * 0.1;
Toast.makeText(getApplicationContext(), "Бали = " + point, Toast.LENGTH_SHORT).show();
TheFirstTask.setPoint(point);
Intent intent = new Intent(TheNinthTask.this, NinthCoordinate.class);
startActivity(intent);
break;
case R.id._btPrompt:
AlertDialog.Builder builder = new AlertDialog.Builder(TheNinthTask.this);
builder.setMessage("Ви точно хочете використати підказку?");
builder.setPositiveButton("Так", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
point = TheFirstTask.getPoint();
point -= 3;
TheFirstTask.setPoint(point);
Toast.makeText(getApplicationContext(), "Це синонім до слова -КОЖЕН- ", Toast.LENGTH_LONG).show();
}
});
builder.setNegativeButton("Ні", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
AlertDialog alertDialog = builder.create();
alertDialog.show();
break;
}
}
public void startTimer(){
countDownTimer = new CountDownTimer(timeLeftInMilliseconds, 1000) {
@Override
public void onTick(long l) {
timeLeftInMilliseconds = l;
updateTimer();
}
@Override
public void onFinish() {
}
}.start();
}
public void updateTimer(){
mins = (int)timeLeftInMilliseconds/60000;
seconds = (int)timeLeftInMilliseconds % 60000 / 1000;
String timeLeftText;
timeLeftText = "" + mins;
timeLeftText += ":";
if(seconds < 10) timeLeftText += "0";
timeLeftText += seconds;
_time.setText(timeLeftText);
if(mins == 0 && seconds == 0){
point = TheFirstTask.getPoint();
point += 0;
TheFirstTask.setPoint(point);
Intent intent = new Intent(TheNinthTask.this, NinthCoordinate.class);
startActivity(intent);
}
}
}
| [
"tkachenkond00@gmail.com"
] | tkachenkond00@gmail.com |
c2018d6a3d352a065edf58d43504e56a15f4e936 | 279bffecb84102ab7a91726607a5e4c1d18e961f | /my/my-api/src/main/java/com/qcloud/component/my/QMyConsignee.java | 983fa996e2ea97603124a5ee2f7bfb71d1c51e8b | [] | no_license | ChiRains/forest | 8b71de51c477f66a134d9b515b58039a8c94c2ee | cf0b41ff83e4cee281078afe338bba792de05052 | refs/heads/master | 2021-01-19T07:13:19.597344 | 2016-08-18T01:35:54 | 2016-08-18T01:35:54 | 65,869,894 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 261 | java | package com.qcloud.component.my;
public interface QMyConsignee {
String getName();
String getMobile();
String getEmail();
String getProvince();
String getCity();
String getDistrict();
String getAddress();
}
| [
"dengfei@ed19df75-bd51-b445-9863-9e54940520a8"
] | dengfei@ed19df75-bd51-b445-9863-9e54940520a8 |
c03332761b16f159d728565281a48fae3e4b74aa | ab63bfb71ef607c59662f5a5cb14a794186f082f | /jo.chview.rcp/src/chuck/terran/admin/ui/NetworkStatusContribution.java | 47d68f75f634e0998d4744fe731aaf44b8bf6462 | [] | no_license | Surtac/ChView | cef5af20acd4f66b93b3c893d5e12c00355f9847 | e927267be2b95b6250419c0b88464ba396d8f71f | refs/heads/master | 2021-05-29T23:59:43.430203 | 2015-07-10T21:12:42 | 2015-07-10T21:12:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,062 | java | package chuck.terran.admin.ui;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import jo.d2k.data.logic.RuntimeLogic;
import jo.util.logic.ThreadLogic;
import jo.util.ui.utils.GridUtils;
import jo.util.ui.utils.ImageUtils;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.menus.WorkbenchWindowControlContribution;
public class NetworkStatusContribution extends WorkbenchWindowControlContribution {
private CLabel mLabel;
private Thread mWatcher = null;
private int mIconTick = 1;
protected Control createControl( Composite parent ) {
Composite client = new Composite(parent, SWT.NULL);
GridLayout gl = new GridLayout(2, false);
gl.horizontalSpacing = 0;
gl.marginBottom = 0;
gl.marginHeight = 0;
gl.marginLeft = 0;
gl.marginRight = 0;
gl.marginTop = 0;
gl.marginWidth = 0;
client.setLayout(gl);
Label separator = new Label(client, SWT.SEPARATOR);
GridUtils.setLayoutData(separator, "");
mLabel = new CLabel(client, SWT.LEFT);
GridUtils.setLayoutData(separator, "size=16x16");
fgWatching();
RuntimeLogic.getInstance().addPropertyChangeListener("busyCount", new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt)
{
if ((RuntimeLogic.getInstance().getBusyCount() > 0) && (mWatcher == null))
startWatcher();
}
});
return client;
}
private void startWatcher()
{
mWatcher = new Thread("BusyWatcher") { public void run() { bgWatching(); } };
mWatcher.start();
}
private void bgWatching()
{
mIconTick = 1;
for (;;)
{
if (mLabel.isDisposed())
break;
ThreadLogic.runMethodOnUIThread(this, "fgWatching");
if (++mIconTick > 10)
mIconTick = 1;
if (RuntimeLogic.getInstance().getBusyCount() <= 0)
break;
try
{
Thread.sleep(250);
}
catch (InterruptedException e)
{
}
}
mWatcher = null;
}
public void fgWatching()
{
if (mLabel.isDisposed())
return;
int count = RuntimeLogic.getInstance().getBusyCount();
if (count <= 0)
{
mLabel.setImage(ImageUtils.getMappedImage("app_busy0"));
//mLabel.setText("");
}
else
{
mLabel.setImage(ImageUtils.getMappedImage("app_busy"+mIconTick));
//mLabel.setText("busy");
}
}
} | [
"jo_grant@GYRALLEN"
] | jo_grant@GYRALLEN |
ee1ea14fd8b413d77542798d7c2b941f6281e2ba | ed5159d056e98d6715357d0d14a9b3f20b764f89 | /src/irvine/oeis/a148/A148021.java | f69a238132fcf7e0e6a5c55cea73dd637ae81d90 | [] | no_license | flywind2/joeis | c5753169cf562939b04dd246f8a2958e97f74558 | e5efd6971a0062ac99f4fae21a7c78c9f9e74fea | refs/heads/master | 2020-09-13T18:34:35.080552 | 2019-11-19T05:40:55 | 2019-11-19T05:40:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 588 | java | package irvine.oeis.a148;
// Generated by gen_seq4.pl walk23 3 5 1 221212001120102 at 2019-07-08 22:06
// DO NOT EDIT here!
import irvine.oeis.WalkCubeSequence;
/**
* A148021 Number of walks within <code>N^3</code> (the first octant of <code>Z^3)</code> starting at <code>(0,0,0)</code> and consisting of n steps taken from <code>{(-1, -1, 1), (-1, 1, -1), (0, 0, 1), (1, -1, 0), (1, 0, -1)}</code>.
* @author Georg Fischer
*/
public class A148021 extends WalkCubeSequence {
/** Construct the sequence. */
public A148021() {
super(0, 3, 5, "", 1, "221212001120102");
}
}
| [
"sairvin@gmail.com"
] | sairvin@gmail.com |
695ff133e60beb404767d49d5850c5320e9a325d | 279630e23e2c019842b74cc2cef05465daf7c9bb | /trendscart/src/main/java/com/niit/trendscart/dao/SupplierDAOImpl.java | 7231d1156f00c84dc27137e788dfd722ca3d961c | [] | no_license | SeethalJain/java | a9b73c1b2faf5b8b3ae33e0bdb87a08ef26f8c9e | a68451c06879cd0667233af87ce880e0751111bf | refs/heads/master | 2021-01-21T06:53:00.277975 | 2017-05-16T11:54:37 | 2017-05-16T11:54:37 | 83,292,403 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,210 | java | package com.niit.trendscart.dao;
import java.util.List;
import org.hibernate.Criteria;
import org.hibernate.Query;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.transaction.annotation.Transactional;
import com.niit.trendscart.model.Category;
import com.niit.trendscart.model.Supplier;
@EnableTransactionManagement
@Repository
public class SupplierDAOImpl implements SupplierDAO {
@Autowired
private SessionFactory sessionFactory;
public SupplierDAOImpl(SessionFactory sessionFactory)
{
try
{
this.sessionFactory = sessionFactory;
}
catch (Exception e)
{
e.printStackTrace();
}
}
@Transactional
public boolean delete(String id) {
Supplier supplier = new Supplier();
supplier.setId(id);
try {
sessionFactory.getCurrentSession().delete(supplier);
} catch (Exception e) {
e.printStackTrace();
return false;
}
return true;
}
@Transactional
public Supplier get(String id) {
String hql = "from Supplier where id =" + "'" + id + "'";
Query query = sessionFactory.getCurrentSession().createQuery(hql);
@SuppressWarnings("unchecked")
List<Supplier> list = (List<Supplier>) query.list();
if (list != null && !list.isEmpty()) {
return list.get(0);
}
return null;
}
@Transactional
public List<Supplier> list() {
@SuppressWarnings("unchecked")
List<Supplier> list = (List<Supplier>) sessionFactory.getCurrentSession().createCriteria(Supplier.class)
.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY).list();
return list;
}
@Transactional
public Supplier getByName(String name) {
String hql = "from Supplier where name =" + "'" + name + "'";
Query query = sessionFactory.getCurrentSession().createQuery(hql);
@SuppressWarnings("unchecked")
List<Supplier> list = (List<Supplier>) query.list();
if (list != null && !list.isEmpty()) {
return list.get(0);
}
return null;
}
@Transactional
public void saveOrUpdate(Supplier supplier) {
sessionFactory.getCurrentSession().saveOrUpdate(supplier);
}
}
| [
"call.sjjain10@gmail.com"
] | call.sjjain10@gmail.com |
f9824e53bc0bc9a601d25f75de27418c92d4064b | 1a5858d01fcbedb17f43a5a7ba7b597590a88f26 | /src/br/ufmg/reuso/negocio/carta/CartaPenalizacao.java | 671320286e00dc028c2d0d752f654b371c9cb561 | [] | no_license | viniciusbcs/ufmg.reuso.software | 0406dd6cd68ad433e9d7663024d32ccee667440b | eaf92cc9cf79f4ec270cb2d2181b5d6e1774d650 | refs/heads/master | 2020-04-04T06:41:24.518222 | 2018-11-10T01:52:44 | 2018-11-10T01:52:44 | 155,753,445 | 0 | 1 | null | 2018-11-01T17:45:11 | 2018-11-01T17:45:10 | null | UTF-8 | Java | false | false | 5,003 | java | /*
* Federal University of Minas Gerais
* Department of Computer Science
* Simules-SPL Project
*
* Created by Michael David
* Date: 16/07/2011
*/
package br.ufmg.reuso.negocio.carta;
/**
* @author Michael David
*
*/
public class CartaPenalizacao extends Carta
{
private String referenciaBibliografica;
private int duracaoEfeito;
private String condicaoProblema;
private int quantidadePrimeiroEfeito; /** contém quanto de efeito será gerado.*/
private int quantidadeSegundoEfeito; /** contém quanto de efeito será gerado.*/
private int tipoPrimeiroEfeito; /** será igual a uma das constantes de efeitos oriundos de carta problema de Constants.java */
private int tipoSegundoEfeito; /** será igual a uma das constantes de efeitos oriundos de carta problema de Constants.java*/
private int quantidadePrimeiraCondicao; /** contém quanto de condicao é necessária.*/
private int quantidadeSegundaCondicao; /** contém quanto de condicao é necessária.*/
private int tipoPrimeiraCondicao; /** será igual a uma das de condições oriundas de carta problema constantes de Constants.java*/
private int tipoSegundaCondicao; /** será igual a uma das de condições oriundas de carta problema constantes de Constants.java*/
public CartaPenalizacao (String titulo, String codigo, String texto, //construindo a carta de conceito
String referencia, int duracao, String condicao,int efeito1,int efeito2, int quantidadeEfeito1,
int quantidadeEfeito2, int condicao1, int condicao2, int quantCondicao1, int quantCondicao2)
{
//inicializando a superclasse explicitamente, texto significa a descricao do problema ao utlizar a carta
super (titulo, codigo, texto,PROBLEMA);
setReferenciaBibliografica(referencia);
setDuracaoEfeito(duracao);
setCondicaoProblema(condicao);
setQuantidadePrimeiroEfeito(quantidadeEfeito1);
setQuantidadeSegundoEfeito(quantidadeEfeito2);
setTipoPrimeiroEfeito(efeito1);
setTipoSegundoEfeito(efeito2);
setQuantidadePrimeiraCondicao(quantCondicao1);
setQuantidadeSegundaCondicao(quantCondicao2);
setTipoPrimeiraCondicao(condicao1);
setTipoSegundaCondicao(condicao2);
}
@Override
public void mostrarCarta()
{
System.out.printf("%s\t%s\n%s\nCondicao: %s\n\n\n", super.getTituloCarta(), super.getCodigoCarta(), super.getTextoCarta(), getCondicaoProblema());
}
public void inserirEfeito()
{
if (codigoCarta =="a")
{
//para cada codigo descrever problema
}
}
public String getReferenciaBibliografica()
{
return referenciaBibliografica;
}
public void setReferenciaBibliografica(String referenciaBibliografica)
{
this.referenciaBibliografica = referenciaBibliografica;
}
public int getDuracaoEfeito()
{
return duracaoEfeito;
}
public void setDuracaoEfeito(int duracaoEfeito)
{
this.duracaoEfeito = duracaoEfeito;
}
public String getCondicaoProblema()
{
return condicaoProblema;
}
public void setCondicaoProblema(String condicaoProblema)
{
this.condicaoProblema = condicaoProblema;
}
public int getQuantidadePrimeiroEfeito()
{
return quantidadePrimeiroEfeito;
}
public void setQuantidadePrimeiroEfeito(int quantidadePrimeiroEfeito)
{
this.quantidadePrimeiroEfeito = quantidadePrimeiroEfeito;
}
public int getQuantidadeSegundoEfeito()
{
return quantidadeSegundoEfeito;
}
public void setQuantidadeSegundoEfeito(int quantidadeSegundoEfeito)
{
this.quantidadeSegundoEfeito = quantidadeSegundoEfeito;
}
public int getTipoPrimeiroEfeito()
{
return tipoPrimeiroEfeito;
}
public void setTipoPrimeiroEfeito(int tipoPrimeiroEfeito)
{
this.tipoPrimeiroEfeito = tipoPrimeiroEfeito;
}
public int getTipoSegundoEfeito()
{
return tipoSegundoEfeito;
}
public void setTipoSegundoEfeito(int tipoSegundoEfeito)
{
this.tipoSegundoEfeito = tipoSegundoEfeito;
}
public int getQuantidadePrimeiraCondicao()
{
return quantidadePrimeiraCondicao;
}
public void setQuantidadePrimeiraCondicao(int quantidadePrimeiraCondicao)
{
this.quantidadePrimeiraCondicao = quantidadePrimeiraCondicao;
}
public int getQuantidadeSegundaCondicao()
{
return quantidadeSegundaCondicao;
}
public void setQuantidadeSegundaCondicao(int quantidadeSegundaCondicao)
{
this.quantidadeSegundaCondicao = quantidadeSegundaCondicao;
}
public int getTipoPrimeiraCondicao()
{
return tipoPrimeiraCondicao;
}
public void setTipoPrimeiraCondicao(int tipoPrimeiraCondicao)
{
this.tipoPrimeiraCondicao = tipoPrimeiraCondicao;
}
public int getTipoSegundaCondicao()
{
return tipoSegundaCondicao;
}
public void setTipoSegundaCondicao(int tipoSegundaCondicao)
{
this.tipoSegundaCondicao = tipoSegundaCondicao;
}
}
| [
"deby.ac@gmail.com"
] | deby.ac@gmail.com |
e97dcbca02545cec69c15cf408f338145eda33a1 | eb76f70a39df661f403ee0459c89dc4be69124ef | /src/main/java/com/offbynull/portmapper/mappers/pcp/externalmessages/InternalUtils.java | 699a408f8f231d2db78d67c57908d25c85cac70f | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-unknown"
] | permissive | offbynull/portmapper | 9a8571c0cf32a10c6fd42444d6726f59d4b6f4d6 | 585598dd8c57dad5ca7aeaf58fd574fdb78a0c38 | refs/heads/master | 2023-01-21T21:22:39.696964 | 2023-01-06T02:26:38 | 2023-01-06T02:26:38 | 20,952,883 | 99 | 20 | Apache-2.0 | 2023-01-06T01:41:29 | 2014-06-18T07:12:50 | Java | UTF-8 | Java | false | false | 5,568 | java | /*
* Copyright 2013-2016, Kasra Faghihi
*
* 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.offbynull.portmapper.mappers.pcp.externalmessages;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang3.Validate;
final class InternalUtils {
// RFC drafts 26 to 29 use version number 2. Prior drafts use version 1. The version number change was introduced to avoid communication
// issues between clients and servers that implemented draft-versions of the spec. The RFC draft changelog notes this change as ...
// "Bump version number from 1 to 2, to accommodate pre-RFC PCP client implementations without needing a heuristic."
//
// Prior to version 2, the RFC drafts are all over the place. The communication protocol (packet structures / constants / etc...) change
// non-trivially between drafts. For example, changes between draft 24 and 25 include the addition of nonces for MAP/PEER and a maximum
// UDP packet size of 1024 (as opposed to 1100 in the final RFC).
//
// As such, it would be impossible to support all variations of version 1. Chances are that home-grade routers that supported some draft
// version of PCP version 1 also supported other protocols capable of IPv6 support (such as UPNP-IGDv2) or have subsequently been
// updated to support PCP version 2 via a firmware update.
//
// Given all this, we're only going to support PCP_VERSION 2.
static final int PCP_VERSION = 2;
static final int MAX_UDP_PAYLOAD = 1100;
private InternalUtils() {
// do nothing
}
// http://stackoverflow.com/a/5616073/1196226
static long bytesToLong(byte[] data, int offset) {
return ((data[offset + 0] & 0xFFL) << 56)
| ((data[offset + 1] & 0xFFL) << 48)
| ((data[offset + 2] & 0xFFL) << 40)
| ((data[offset + 3] & 0xFFL) << 32)
| ((data[offset + 4] & 0xFFL) << 24)
| ((data[offset + 5] & 0xFFL) << 16)
| ((data[offset + 6] & 0xFFL) << 8)
| (data[offset + 7] & 0xFFL);
}
static void longToBytes(byte[] data, int offset, long value) {
data[offset] = (byte) ((value >> 56) & 0xFF);
data[offset + 1] = (byte) ((value >> 48) & 0xFF);
data[offset + 2] = (byte) ((value >> 40) & 0xFF);
data[offset + 3] = (byte) ((value >> 32) & 0xFF);
data[offset + 4] = (byte) ((value >> 24) & 0xFF);
data[offset + 5] = (byte) ((value >> 16) & 0xFF);
data[offset + 6] = (byte) ((value >> 8) & 0xFF);
data[offset + 7] = (byte) (value & 0xFF);
}
static int bytesToInt(byte[] data, int offset) {
return ((data[offset + 0] & 0xFF) << 24)
| ((data[offset + 1] & 0xFF) << 16)
| ((data[offset + 2] & 0xFF) << 8)
| (data[offset + 3] & 0xFF);
}
static void intToBytes(byte[] data, int offset, int value) {
data[offset] = (byte) ((value >> 24) & 0xFF);
data[offset + 1] = (byte) ((value >> 16) & 0xFF);
data[offset + 2] = (byte) ((value >> 8) & 0xFF);
data[offset + 3] = (byte) (value & 0xFF);
}
static short bytesToShort(byte[] data, int offset) {
return (short)
(((data[offset + 0] & 0xFF) << 8)
| (data[offset + 1] & 0xFF));
}
static void shortToBytes(byte[] data, int offset, short value) {
data[offset] = (byte) ((value >> 8) & 0xFF);
data[offset + 1] = (byte) (value & 0xFF);
}
static List<PcpOption> parseOptions(byte[] buffer, int offset) {
Validate.notNull(buffer);
Validate.isTrue(offset >= 0);
Validate.isTrue(offset <= buffer.length);
List<PcpOption> pcpOptionsList = new ArrayList<>();
while (offset < buffer.length) {
PcpOption option;
try {
option = new FilterPcpOption(buffer, offset);
offset += option.getBufferLength();
pcpOptionsList.add(option);
continue;
} catch (IllegalArgumentException iae) {
// do nothing
}
try {
option = new PreferFailurePcpOption(buffer, offset);
offset += option.getBufferLength();
pcpOptionsList.add(option);
continue;
} catch (IllegalArgumentException iae) {
// do nothing
}
try {
option = new ThirdPartyPcpOption(buffer, offset);
offset += option.getBufferLength();
pcpOptionsList.add(option);
continue;
} catch (IllegalArgumentException iae) {
// do nothing
}
option = new UnknownPcpOption(buffer, offset);
offset += option.getBufferLength();
pcpOptionsList.add(option);
}
return pcpOptionsList;
}
}
| [
"offbynull@gmail.com"
] | offbynull@gmail.com |
53b4ae051479d0a48995a1084ba22e684da8c6e6 | 26fdeb296420e84568015081e7b517e6a2af6d21 | /SecondaryTypeDI/src/main/java/com/bridgelabz/test/TestSecondaryData.java | 272537b2c915f5f7b81df1e93559a11e923b37f0 | [] | no_license | sujay-a-v/spring-projects | b497e77f0fe91bc1bc7dd6fb1f65e1c9b103b66f | edc22e89d3ed90a57462b7991827cef8f372381f | refs/heads/master | 2021-07-20T22:57:13.842154 | 2017-10-24T04:49:06 | 2017-10-24T04:49:06 | 107,792,654 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 529 | java | package com.bridgelabz.test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import com.bridgelabz.model.Car;
public class TestSecondaryData {
public static void main(String[] args) {
ApplicationContext context=new ClassPathXmlApplicationContext("secondaryData.xml");
Car car=(Car) context.getBean("car");
car.display();
System.out.println("\nUsing inner Beans");
Car car1=(Car) context.getBean("car1");
car1.display();
}
}
| [
"sujay.av555@gmail.com"
] | sujay.av555@gmail.com |
0f8fbd4c536598e2890896e5da0bf2d68a3076e1 | 0be6473c3eefb492c7e14562f94b0f6219a440f9 | /src/main/java/com/sparknetworks/loveos/controller/FilterMatchesController.java | eb0b73aa0f99838f4bdac57caaed0e7f29f753a4 | [] | no_license | lucasventurasc/filtering-matches | d250d6ddce3610578ed884c378798d4191c61f98 | ff577c2eef320b6e92a4de7270fd901d8f3bce7d | refs/heads/master | 2020-07-09T19:55:14.978640 | 2019-08-23T20:55:58 | 2019-08-23T20:55:58 | 204,069,002 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,628 | java | package com.sparknetworks.loveos.controller;
import com.sparknetworks.loveos.application.filtermatches.FilteredMatchesRetrieval;
import com.sparknetworks.loveos.application.filtermatches.Filters;
import com.sparknetworks.loveos.application.filtermatches.UserMatchedDTO;
import com.sparknetworks.loveos.application.filtermatches.UserMatchedFilterBuilder;
import com.sparknetworks.loveos.domain.ProfileNotFoundException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindException;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@Controller
@RequestMapping("/api/v1/matches/{user}")
public class FilterMatchesController {
private FilteredMatchesRetrieval filteredMatchesRetrieval;
@Autowired
public FilterMatchesController(FilteredMatchesRetrieval filteredMatchesRetrieval) {
this.filteredMatchesRetrieval = filteredMatchesRetrieval;
}
@GetMapping
public ResponseEntity<List<UserMatchedDTO>> filterMatches(@PathVariable("user") String user, @Validated QueryFilter queryFilter) {
UserMatchedFilterBuilder userMatchedFiltersBuilder = new UserMatchedFilterBuilder();
Filters filters = userMatchedFiltersBuilder
.shouldHavePhoto(queryFilter.getHasPhoto().equals("true"))
.shouldBeFavorited(queryFilter.getFavorited().equals("true"))
.shouldHaveExchangedContacts(queryFilter.getInContact().equals("true"))
.shouldHaveCompatibilityScoreRange(queryFilter.getCompatibilityScoreRange())
.shouldBeAgedBetween(queryFilter.getAgeRange())
.shouldHasAHeightBetween(queryFilter.getHeightRange())
.distanceInKmFromRelatedProfileCityShouldBeLessThan(queryFilter.getDistanceInKm())
.build();
List<UserMatchedDTO> userMatchedDTOS = filteredMatchesRetrieval.retrieve(user, filters);
return ResponseEntity.ok(userMatchedDTOS);
}
@ExceptionHandler(ProfileNotFoundException.class)
public ResponseEntity<String> profileNotFoundException() {
return ResponseEntity.notFound().build();
}
@ExceptionHandler(BindException.class)
public ResponseEntity<String> exceptionHandlerBindException(BindException bindException) {
return ResponseEntity.badRequest().body(bindException.getFieldError().getDefaultMessage());
}
}
| [
"lucas.ventura@softplan.com.br"
] | lucas.ventura@softplan.com.br |
3b40caf70f3e8e93618cb4b896a9224557388dd9 | b5da15cd5640f355c8fc3ce4bcb9e51725c50d17 | /src/main/java/org/apache/ibatis/reflection/ParamNameUtil.java | 434d82bc6cbf4f5b59b37ef2deee39d80d0963de | [
"Apache-2.0",
"BSD-3-Clause"
] | permissive | lice019/lice-mybatis-3.5.0 | cb0e95c6d9edaa4c91de7857c9d1fdf11f40fdeb | 2923b1ac656e1689ed9c5f3655dd40316b5fea23 | refs/heads/master | 2022-10-17T20:27:05.553721 | 2019-10-18T11:14:02 | 2019-10-18T11:14:02 | 215,783,583 | 1 | 1 | Apache-2.0 | 2022-09-08T01:03:15 | 2019-10-17T12:11:07 | Java | UTF-8 | Java | false | false | 1,487 | java | /**
* Copyright ${license.git.copyrightYears} 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.apache.ibatis.reflection;
import java.lang.reflect.Constructor;
import java.lang.reflect.Executable;
import java.lang.reflect.Method;
import java.lang.reflect.Parameter;
import java.util.ArrayList;
import java.util.List;
public class ParamNameUtil {
public static List<String> getParamNames(Method method) {
return getParameterNames(method);
}
public static List<String> getParamNames(Constructor<?> constructor) {
return getParameterNames(constructor);
}
private static List<String> getParameterNames(Executable executable) {
final List<String> names = new ArrayList<>();
final Parameter[] params = executable.getParameters();
for (Parameter param : params) {
names.add(param.getName());
}
return names;
}
private ParamNameUtil() {
super();
}
}
| [
"11606537852@qq.com"
] | 11606537852@qq.com |
96f0fb613873484dac02a73ea112fe43d065e159 | fb14aa26e912d2b8e78df0b85336d08530b7a278 | /src/annoj/annotation/Exclude.java | d5ad9fb618cf9f198555ed1897767260b39ca43b | [] | no_license | akostajti/UtilityAnnotations | ca2f68809f51005cc2fe0032aa22fc847624c8b6 | d5fea5c333a94a2299d4bb266a7146569143e1a5 | refs/heads/master | 2021-12-28T19:01:16.651263 | 2021-10-12T07:42:10 | 2021-10-12T07:42:10 | 5,142,712 | 0 | 1 | null | 2021-10-12T07:01:16 | 2012-07-22T16:01:46 | Java | UTF-8 | Java | false | false | 528 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package annoj.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Place before a field if you want to leave out that field from the string
* returned by <code>toString</code>.
*
* @author tajti
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD})
public @interface Exclude {
}
| [
"akostajti"
] | akostajti |
2e14b23c740e66827212cb2df547ada6c20fd62f | 0de581acf188fa228923f56546ea864d2efb29f0 | /src/main/java/com/rafaeldeluca/beerstock/service/BeerService.java | 1f2825cddfa84b6b3dffefec99722fb800be7d41 | [] | no_license | rafaelgauderio/api-beer-manage-stock | 4da2f78d7b910d9e7c27f52bddb3a5be416d8ecf | b5d6511b53d94db96fb8b047d23b0adbdd26642b | refs/heads/main | 2023-06-26T20:50:29.753753 | 2021-07-29T20:37:01 | 2021-07-29T20:37:01 | 389,734,310 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,577 | java | package com.rafaeldeluca.beerstock.service;
import com.rafaeldeluca.beerstock.exception.BeerAlreadyRegisteredException;
import com.rafaeldeluca.beerstock.exception.BeerNotFoundException;
import com.rafaeldeluca.beerstock.exception.BeerStockExceededException;
import com.rafaeldeluca.beerstock.mapper.BeerMapper;
import com.rafaeldeluca.beerstock.repository.BeerRepository;
import lombok.AllArgsConstructor;
import com.rafaeldeluca.beerstock.dto.BeerDTO;
import com.rafaeldeluca.beerstock.entity.Beer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
@Service
@AllArgsConstructor(onConstructor = @__(@Autowired))
public class BeerService {
private final BeerRepository beerRepository;
private final BeerMapper beerMapper = BeerMapper.INSTANCE;
public BeerDTO createBeer(BeerDTO beerDTO) throws BeerAlreadyRegisteredException {
verifyIfIsAlreadyRegistered(beerDTO.getName());
Beer beer = beerMapper.toModel(beerDTO);
Beer savedBeer = beerRepository.save(beer);
return beerMapper.toDTO(savedBeer);
}
public BeerDTO findByName(String name) throws BeerNotFoundException {
Beer foundBeer = beerRepository.findByName(name)
.orElseThrow(() -> new BeerNotFoundException(name));
return beerMapper.toDTO(foundBeer);
}
public List<BeerDTO> listAll() {
return beerRepository.findAll()
.stream()
.map(beerMapper::toDTO)
.collect(Collectors.toList());
}
public void deleteById(Long id) throws BeerNotFoundException {
verifyIfExists(id);
beerRepository.deleteById(id);
}
private void verifyIfIsAlreadyRegistered(String name) throws BeerAlreadyRegisteredException {
Optional<Beer> optSavedBeer = beerRepository.findByName(name);
if (optSavedBeer.isPresent()) {
throw new BeerAlreadyRegisteredException(name);
}
}
private Beer verifyIfExists(Long id) throws BeerNotFoundException {
return beerRepository.findById(id)
.orElseThrow(() -> new BeerNotFoundException(id));
}
public BeerDTO increment(Long id, int quantityToIncrement) throws BeerNotFoundException, BeerStockExceededException {
Beer beerToIncrementStock = verifyIfExists(id);
int quantityAfterIncrement = quantityToIncrement + beerToIncrementStock.getQuantity() ;
if (quantityAfterIncrement <= beerToIncrementStock.getMax()) {
beerToIncrementStock.setQuantity(beerToIncrementStock.getQuantity() + quantityToIncrement);
Beer incrementedBeerStock = beerRepository.save(beerToIncrementStock);
return beerMapper.toDTO(incrementedBeerStock);
}
throw new BeerStockExceededException(id,quantityToIncrement);
}
public BeerDTO decrement(Long id, int quantityToDecrement) throws BeerNotFoundException, BeerStockExceededException {
Beer beerToDecrementStock = verifyIfExists(id);
int beerStockAfterDecremented = beerToDecrementStock.getQuantity() - quantityToDecrement;
if (beerStockAfterDecremented >= 0) {
beerToDecrementStock.setQuantity(beerStockAfterDecremented);
Beer decrementedBeerStock = beerRepository.save(beerToDecrementStock);
return beerMapper.toDTO(decrementedBeerStock);
}
throw new BeerStockExceededException(id, quantityToDecrement);
}
}
| [
"deluca1712@gmail.com"
] | deluca1712@gmail.com |
f0bff6ffba765f74b2ed7f46e3eb036b9215fd52 | 067eb6bde5d5570a120534ff8b8992e9236d5dd7 | /kcp-math/src/test/java/com/github/kuangcp/math/number/FractionTest.java | 95bcec9575ecef43196a961c78fa4a2c7398ccfd | [
"Apache-2.0"
] | permissive | Kuangcp/kcp-tool-java | f29c08ca0e279cd16c773d080bdb187cbe4faac1 | 7ca06d35ca84dc2a66a93a7f47ccd7697e5cfa33 | refs/heads/master | 2020-04-22T14:15:30.481598 | 2020-03-27T09:26:11 | 2020-03-27T09:26:11 | 170,437,381 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,474 | java | package com.github.kuangcp.math.number;
import static org.hamcrest.core.IsEqual.equalTo;
import static org.junit.Assert.assertThat;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
/**
* @author kuangcp on 3/14/19-5:09 PM
*/
@Slf4j
public class FractionTest {
@Test
public void testInit() {
Fraction fraction = new Fraction(1);
assertThat(fraction, equalTo(new Fraction(1, 1)));
assertThat(fraction.intValue(), equalTo(1));
assertThat(new Fraction(2, 3).doubleValue(), equalTo(2 / 3.0));
assertThat(Fraction.valueOf("3.1").doubleValue(), equalTo(31 / 10.0));
assertThat(Fraction.valueOf("3.31342423").doubleValue(), equalTo(331342423 / 10000_0000.0));
}
@Test
public void testAdd() {
Fraction one = Fraction.valueOf("3.2");
Fraction two = Fraction.valueOf("-3.5");
assertThat(one.add(two), equalTo(new Fraction(-3, 10)));
log.info("{} {} {}", one.simplify(), two.simplify(), one.add(two).simplify());
assertThat(new Fraction(2, 3).add(new Fraction(4, 3)), equalTo(2));
assertThat(new Fraction(2, 3).add(new Fraction(4, 3)), equalTo(new Fraction(6, 3)));
}
@Test
public void testSimplify() {
Fraction fraction = new Fraction(12, 3);
assertThat(fraction, equalTo(4.0000f));
assertThat(new Fraction(0, 1), equalTo(0));
assertThat(new Fraction(0, 1).isZero(), equalTo(true));
assertThat(new Fraction(1, 0).isInfinity(), equalTo(true));
assertThat(new Fraction(1, 0), equalTo(Double.POSITIVE_INFINITY));
assertThat(new Fraction(-1, 0), equalTo(Double.NEGATIVE_INFINITY));
// assertThat(1/0, equalTo(Double.POSITIVE_INFINITY));
}
@Test
public void testSubtract() {
assertThat(new Fraction(10, 3).subtract(new Fraction(4, 3)), equalTo(new Fraction(6, 3)));
}
@Test
public void testDivide() {
Fraction result = new Fraction(25, 1).divide(new Fraction(0, 3));
assertThat(result, equalTo(Fraction.INFINITY));
assertThat(result, equalTo(new Fraction(0, 3)));
log.info("result: result={}", result);
}
@Test
public void testMulti() {
Fraction result = Fraction.valueOf("1.4").multiply(Fraction.valueOf("2.3"));
assertThat(result, equalTo(new Fraction(14 * 23, 100)));
}
@Test
public void testSimple() {
}
//测试比较函数
@Test
public void compare() {
}
@Test
public void testIsZero() {
}
@Test
public void testIsInfinity() {
}
@Test
public void testIsPositive() {
}
} | [
"kuangcp@aliyun.com"
] | kuangcp@aliyun.com |
fa23bc78537c1dc973430919aa2e67d0a35df834 | 6586a8dcdfe9e8832a5f773bea0d9167ffcf689d | /app/src/androidTest/java/com/aupadhyay/datepickerdialog/ApplicationTest.java | 555d860c984ba9026878902858d6a88a2e271a4c | [] | no_license | amit-upadhyay-IT/DatePickerDialog | 56163276c68a845334b3e1114c51555fa720367e | 26b7a0f6796515d3776eb45d9358d49f7131a42c | refs/heads/master | 2021-01-20T18:15:36.931625 | 2016-07-11T06:47:35 | 2016-07-11T06:47:35 | 63,043,458 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 361 | java | package com.aupadhyay.datepickerdialog;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
} | [
"youarefreak1@gmail.com"
] | youarefreak1@gmail.com |
8ff072c3621e173a7ec31638a69785422de0cf3d | 82a07689302ab53ea06d9b83e3a6988061d54a6f | /src/main/java/app/model/WSOut.java | 642ae655da64bbb6f9865b6fa6d8d5f2f116fc1f | [] | no_license | jeremythuff/springWSChat | bec624d548674b12d9d66c1984ba6606ab2cb7b0 | 56da614da4eba21792f7116de1873052f89f43c4 | refs/heads/master | 2020-04-26T12:33:53.570279 | 2014-12-19T22:57:26 | 2014-12-19T22:57:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 688 | java | package app.model;
import java.util.List;
public class WSOut {
private String name;
private String message;
private String action;
private List<String> users;
public WSOut(String action, String message, String name) {
this.name = name;
this.action = action;
this.message = message;
}
public WSOut(String action, List<String> users) {
this.users = users;
this.action = action;
}
public String getMessage() {
return message;
}
public String getName() {
return name;
}
public String getAction() {
return action;
}
public List<String> getUsers() {
return users;
}
}
| [
"jeremythuff@gmail.com"
] | jeremythuff@gmail.com |
2d219f6daedcf41aab9751ba6e95a664c74cf357 | 85c8d32e595e4d15090538ea10a3f327d33226ab | /app/src/main/java/com/example/groceryshopaish/Admin.java | b041334abab2268b6444079a30856a80dda0bc7a | [] | no_license | Aishwarya01-github/Grocery-Shop-Application | a6bb2848117271108cb1283b8047bae8d8b6cba9 | d7599cf3d56fef8df7944ccc76ad8f35bb63e7d7 | refs/heads/main | 2023-06-01T15:42:31.495807 | 2021-06-21T05:58:06 | 2021-06-21T05:58:06 | 378,821,441 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,662 | java | package com.example.groceryshopaish;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class Admin extends Activity {
Button show,add,del,upd;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_admin);
show = findViewById(R.id.show);
add = findViewById(R.id.add);
del = findViewById(R.id.del);
upd = findViewById(R.id.upd);
show.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent ia1 = new Intent(getApplicationContext(),ShowUser.class);
startActivity(ia1);
}
});
add.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent ia2 = new Intent(getApplicationContext(),AddGrocery.class);
startActivity(ia2);
}
});
del.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent ia3 = new Intent(getApplicationContext(),DeleteGrocery.class);
startActivity(ia3);
}
});
upd.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent ia4 = new Intent(getApplicationContext(),UpdateGrocery.class);
startActivity(ia4);
}
});
}
}
| [
"apm2024@gmail.com"
] | apm2024@gmail.com |
765d065c1cebaf8fafc8186afdeccb914d8a6743 | 805b2a791ec842e5afdd33bb47ac677b67741f78 | /Mage/src/mage/abilities/effects/common/DontUntapInControllersUntapStepTargetEffect.java | ba9999bb968dbbddcb5eaaef22d5233b0140b8c4 | [] | no_license | klayhamn/mage | 0d2d3e33f909b4052b0dfa58ce857fbe2fad680a | 5444b2a53beca160db2dfdda0fad50e03a7f5b12 | refs/heads/master | 2021-01-12T19:19:48.247505 | 2015-08-04T20:25:16 | 2015-08-04T20:25:16 | 39,703,242 | 2 | 0 | null | 2015-07-25T21:17:43 | 2015-07-25T21:17:42 | null | UTF-8 | Java | false | false | 4,351 | java | /*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. 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.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``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 BetaSteward_at_googlemail.com 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.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.abilities.effects.common;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.PhaseStep;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class DontUntapInControllersUntapStepTargetEffect extends ContinuousRuleModifyingEffectImpl {
public DontUntapInControllersUntapStepTargetEffect(Duration duration) {
super(duration, Outcome.Detriment);
}
public DontUntapInControllersUntapStepTargetEffect(final DontUntapInControllersUntapStepTargetEffect effect) {
super(effect);
}
@Override
public DontUntapInControllersUntapStepTargetEffect copy() {
return new DontUntapInControllersUntapStepTargetEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
return false;
}
@Override
public String getInfoMessage(Ability source, GameEvent event, Game game) {
MageObject mageObject = game.getObject(source.getSourceId());
Permanent permanentToUntap = game.getPermanent((event.getTargetId()));
if (permanentToUntap != null && mageObject != null) {
return permanentToUntap.getLogName() + " doesn't untap (" + mageObject.getLogName() + ")";
}
return null;
}
@Override
public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.UNTAP;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
if (PhaseStep.UNTAP.equals(game.getTurn().getStepType())) {
for (UUID targetId : targetPointer.getTargets(game, source)) {
if (event.getTargetId().equals(targetId)) {
Permanent permanent = game.getPermanent(targetId);
if (permanent != null && game.getActivePlayerId().equals(permanent.getControllerId())) {
return true;
}
}
}
}
return false;
}
@Override
public String getText(Mode mode) {
if (staticText != null) {
return staticText;
}
return "Target " + mode.getTargets().get(0).getTargetName()
+ " doesn't untap during its controller's untap step" + (getDuration().toString().isEmpty() ? "":" " + getDuration());
}
}
| [
"ludwig.hirth@online.de"
] | ludwig.hirth@online.de |
fd42455df5b184fb5523101e08c7f38414801132 | 649406b56b7581b83ffae8c82ec6a7659b4af2cb | /RequestRecvPJ/src/sample_pkg02/RequestRecv.java | 1fcc5ba17dffa59e2fcf96621353c8d4838a750f | [] | no_license | teamoo24/Java_Servlet_Project | 2bfd097aa4d1cf5b6024637622469b5e06c27210 | 0a2ef81715795b2082c55af740f565fe01f92cba | refs/heads/master | 2020-05-23T13:36:50.590937 | 2019-05-18T02:24:43 | 2019-05-18T02:24:43 | 186,781,005 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,185 | java | package sample_pkg02;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* Servlet implementation class RequestRecv
*/
@WebServlet("/RequestRecv")
public class RequestRecv extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public RequestRecv() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
request.setCharacterEncoding("UTF-8");
response.setContentType("text/html; charset=UTF-8");
String gameName = request.getParameter("Game");
Cookie cookGameTitle = new Cookie("GameTitle",gameName);
cookGameTitle.setMaxAge(60*60*24);
response.addCookie(cookGameTitle);
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<head>");
out.println("<title>あなたの回答</title>");
out.println("</head>");
out.println("<body>");
out.println("<h1>あなたの回答</h1>");
out.println("好きなゲームは" + gameName + "です。");
out.println("では、そのゲームの好きなナンバリングは?<br />");
out.println("<form action=\"SampleGetCookie\" method=\"POST\">");
out.println("<input type=\"TEXT\" name=\"GameNumbering\" size=40>");
out.println("<input type=\"submit\" value=\"次のサーブレットを起動\">");
out.println("</form>");
out.println("</body>");
out.println("</html>");
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
doGet(request, response);
}
}
| [
"601107w@gmail.com"
] | 601107w@gmail.com |
b13b57eef89e95321e7e90d119ee37e47c824e8a | fdeb0a796e2cef8d67725faebcdf2cb6132ef608 | /test_check_api_json_bdd_tdd/src/main/java/com/atmecs/practice/automation/testscripts/jsonpath/FetchEmployeeDetailsUsingJsonPath.java | 1614783f73f162dbd541de5e735d1ec4a66afa6e | [] | no_license | KasiAnnapoorna-Batchu/restapiautomationtesting | ed06936735036bb386908bf7b20fe967fa7647fd | 4fad8d5f5c99b3765c7685995ba83de0db44ccc5 | refs/heads/master | 2023-05-12T18:55:49.773169 | 2020-06-05T15:59:06 | 2020-06-05T15:59:06 | 269,662,599 | 0 | 0 | null | 2023-05-09T18:29:22 | 2020-06-05T14:20:51 | HTML | UTF-8 | Java | false | false | 9,690 | java | package com.atmecs.practice.automation.testscripts.jsonpath;
import java.io.FileNotFoundException;
import java.util.Iterator;
import java.util.Map;
import org.testng.Reporter;
import org.testng.annotations.Test;
import com.atmecs.practice.automation.common.ReusableFunctions;
import com.jayway.jsonpath.DocumentContext;
import com.jayway.jsonpath.JsonPath;
import com.jayway.jsonpath.PathNotFoundException;
import net.minidev.json.JSONArray;
/**
*
* @author Kasi.Batchu
*
* Fetches employee details from related json file. Here it is :
* Employee_Details_Sample_Json.json file
*/
public class FetchEmployeeDetailsUsingJsonPath {
ReusableFunctions cf = new ReusableFunctions();
/**
* Loads config and read the specific json file.
*
* @param JsonFileName
* @return
* @throws Exception
*/
public String loadConfigAndReadJson(String JsonFileName) throws Exception {
try {
cf.loadConfig();
String JsonFilePath = cf.setConfig(JsonFileName);
String wholeJsonAsString = cf.getAndReadJsonFile(JsonFilePath);
return wholeJsonAsString;
} catch (Exception e) {
// error
Reporter.log("Unexpected exception occur: " + e.getMessage());
e.printStackTrace();
}
return null;
}
/**
* Get Basic comapny Details.
*
* @throws FileNotFoundException
* @throws PathNotFoundException
* @throws Exception
*/
public void getBasicCompanyDetails() throws FileNotFoundException, PathNotFoundException, Exception {
try {
String companyJsonString = this.loadConfigAndReadJson("employee_details_json");
DocumentContext docCtx = JsonPath.parse(companyJsonString);
// Get Company Name
JsonPath companyName = cf.jsonCompile("$.['Company Name']");
String cn = docCtx.read(companyName);
System.out.println(cn);
// Get Company Location
JsonPath companyLocation = cf.jsonCompile("$.['Company Location']");
String cl = docCtx.read(companyLocation);
System.out.println(cl);
// Get Address
JsonPath address = cf.jsonCompile("$.Address");
String ad = docCtx.read(address);
System.out.println(ad);
// Get State
JsonPath state = cf.jsonCompile("$.State");
String st = docCtx.read(state);
System.out.println(st);
} catch (FileNotFoundException fe) {
Reporter.log("File is not found in specified path: " + fe.getMessage());
fe.printStackTrace();
} catch (PathNotFoundException pe) {
Reporter.log("No results for path");
pe.printStackTrace();
} catch (Exception e) {
// error
Reporter.log("Unexpected exception occur: " + e.getMessage());
e.printStackTrace();
}
}
/**
* Get Company Branches Info.
*
* @throws FileNotFoundException
* @throws PathNotFoundException
* @throws Exception
*
*/
public void getBranchesInfo() throws FileNotFoundException, PathNotFoundException, Exception {
try {
String companyJsonString = this.loadConfigAndReadJson("employee_details_json");
DocumentContext docCtx = JsonPath.parse(companyJsonString);
// Get Branch Names
JsonPath branches = cf.jsonCompile("$.Branches");
Map br = docCtx.read(branches);
System.out.println("");
Iterator<Map.Entry> itr1 = br.entrySet().iterator();
while (itr1.hasNext()) {
Map.Entry pair1 = itr1.next();
System.out.println(pair1.getKey() + " --> " + pair1.getValue());
}
} catch (FileNotFoundException fe) {
Reporter.log("File is not found in specified path: " + fe.getMessage());
fe.printStackTrace();
} catch (PathNotFoundException pe) {
Reporter.log("No results for path");
pe.printStackTrace();
} catch (Exception e) {
// error
Reporter.log("Unexpected exception occur: " + e.getMessage());
e.printStackTrace();
}
}
/**
* Get first Particular Employee Details.
*
* @throws FileNotFoundException
* @throws PathNotFoundException
* @throws Exception
*
*/
public void getOnlyParticularEmpDetails() throws FileNotFoundException, PathNotFoundException, Exception {
try {
String companyJsonString = this.loadConfigAndReadJson("employee_details_json");
DocumentContext docCtx = JsonPath.parse(companyJsonString);
// Get only Particular Employee Info.
JsonPath getOneEmpDet = cf.jsonCompile("$..['emp Ids info'].[0]");
JSONArray empDetails = docCtx.read(getOneEmpDet);
System.out.println("");
System.out.println("Overall Details of Employee --> " + empDetails);
} catch (FileNotFoundException fe) {
Reporter.log("File is not found in specified path: " + fe.getMessage());
fe.printStackTrace();
} catch (PathNotFoundException pe) {
Reporter.log("No results for path");
pe.printStackTrace();
} catch (Exception e) {
// error
Reporter.log("Unexpected exception occur: " + e.getMessage());
e.printStackTrace();
}
}
/**
* Get Personal Info of an Employee
*
* @throws PathNotFoundException
* @throws FileNotFoundException
* @throws Exception
*
*/
public void getPersonalInfo() throws PathNotFoundException, FileNotFoundException, Exception {
try {
String companyJsonString = this.loadConfigAndReadJson("employee_details_json");
DocumentContext docCtx = JsonPath.parse(companyJsonString);
// Get only Particular Employee personal Info.
JsonPath getPersonalInfo = cf.jsonCompile("$..['emp Ids info'].[0].['Personal Info']");
JSONArray persInfo = docCtx.read(getPersonalInfo);
System.out.println("");
System.out.println(" ************ Get Personal Info *********** ");
System.out.println("");
// Getting Fisrt Name of an Employee
JsonPath fisrtName = cf.jsonCompile("$..['emp Ids info'].[0].['Personal Info'].['First Name']");
JSONArray fN = docCtx.read(fisrtName);
System.out.println("First Name --> " + fN);
// Getting Last Name of an Employee
JsonPath lastName = cf.jsonCompile("$..['emp Ids info'].[0].['Personal Info'].['Last Name']");
JSONArray lN = docCtx.read(lastName);
System.out.println("Last Name --> " + lN);
} catch (FileNotFoundException fe) {
Reporter.log("File is not found in specified path: " + fe.getMessage());
fe.printStackTrace();
} catch (PathNotFoundException pe) {
Reporter.log("No results for path");
pe.printStackTrace();
} catch (Exception e) {
// error
Reporter.log("Unexpected exception occur: " + e.getMessage());
e.printStackTrace();
}
}
/**
* Get Home Contact No of an particular employee.
*
* @throws PathNotFoundException
* @throws FileNotFoundException
* @throws Exception
*
*/
public void getHomeContactNoOfParticularEmployee() throws PathNotFoundException, FileNotFoundException, Exception {
try {
String companyJsonString = this.loadConfigAndReadJson("employee_details_json");
DocumentContext docCtx = JsonPath.parse(companyJsonString);
// Get Home Contact No.
JsonPath contactInfo = cf.jsonCompile(
"$..['emp Ids info'][0]['Personal Info'].['Contact Nos'].[?(@.type==\"home\")].number");
JSONArray conInf = docCtx.read(contactInfo);
System.out.println("");
System.out.println(" Home Contact No --> " + conInf);
System.out.println("");
} catch (FileNotFoundException fe) {
Reporter.log("File is not found in specified path: " + fe.getMessage());
fe.printStackTrace();
} catch (PathNotFoundException pe) {
Reporter.log("No results for path");
pe.printStackTrace();
} catch (Exception e) {
// error
Reporter.log("Unexpected exception occur: " + e.getMessage());
e.printStackTrace();
}
}
/**
* Get Professional Info of an Employee
*
* @throws PathNotFoundException
* @throws FileNotFoundException
* @throws Exception
*
*/
public void getProfessionalInfo() throws PathNotFoundException, FileNotFoundException, Exception {
try {
String companyJsonString = this.loadConfigAndReadJson("employee_details_json");
DocumentContext docCtx = JsonPath.parse(companyJsonString);
// Get only Particular Employee Professional Info.
JsonPath getProfessionalInfo = cf.jsonCompile("$..['emp Ids info'].[0].['Professional Info']");
JSONArray profInfo = docCtx.read(getProfessionalInfo);
System.out.println("");
System.out.println(" Professional Info --> " + profInfo);
} catch (FileNotFoundException fe) {
Reporter.log("File is not found in specified path: " + fe.getMessage());
fe.printStackTrace();
} catch (PathNotFoundException pe) {
Reporter.log("No results for path");
pe.printStackTrace();
} catch (Exception e) {
// error
Reporter.log("Unexpected exception occur: " + e.getMessage());
e.printStackTrace();
}
}
/**
* Get Programming Skills of an Employee.
*
* @throws PathNotFoundException
* @throws FileNotFoundException
* @throws Exception
*
*/
public void getProgrammingSkills() throws PathNotFoundException, FileNotFoundException, Exception {
try {
String companyJsonString = this.loadConfigAndReadJson("employee_details_json");
DocumentContext docCtx = JsonPath.parse(companyJsonString);
// Get Programming Skills of an Employee
JsonPath programmingSkills = cf.jsonCompile(
"$..['emp Ids info'].[0].['Professional Info'].['Technical Skill set'][0].['Programming Languages']");
JSONArray progSkills = docCtx.read(programmingSkills);
System.out.println("");
System.out.println(" Programming Skills --> " + progSkills);
} catch (FileNotFoundException fe) {
Reporter.log("File is not found in specified path: " + fe.getMessage());
fe.printStackTrace();
} catch (PathNotFoundException pe) {
Reporter.log("No results for path");
pe.printStackTrace();
} catch (Exception e) {
// error
Reporter.log("Unexpected exception occur: " + e.getMessage());
e.printStackTrace();
}
}
}
| [
"Kasi.Batchu@ATMECS.CORP"
] | Kasi.Batchu@ATMECS.CORP |
de8b2781df8c5a32d54c431a9fdbc6b62437a30e | 66e6fd558126f3fd14a65b291ba0f9e122776a34 | /core/src/com/cellular/automaton/engine/logic/neighbourhood/HexagonalRightNeighbourhood.java | 5edb8a254a683b63e4959496774f55dd134fad40 | [] | no_license | IzeTPL/cellularautomaton | b0233c9cf2c1be01d23cb75b5005b7b64a2d603e | b5fa44a829e2a3b971e6022d2bf66537fbf15f94 | refs/heads/master | 2020-05-23T23:52:20.324485 | 2017-05-26T14:51:50 | 2017-05-26T14:51:50 | 187,003,129 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,418 | java | package com.cellular.automaton.engine.logic.neighbourhood;
import com.cellular.automaton.engine.logic.Cell;
import com.cellular.automaton.engine.logic.Point;
import com.cellular.automaton.engine.logic.boudarycondition.BoundaryCondition;
import java.util.ArrayList;
import java.util.List;
/**
* Created by marian on 06.05.17.
*/
public class HexagonalRightNeighbourhood extends Neighborhood {
@Override
public List<Cell> findNeighbors(List<Cell> cells, Cell currentCell, BoundaryCondition boundaryCondition, Point size) {
List<Cell> neighbors = new ArrayList<>();
for (int i = currentCell.getPosition().x - 1; i <= currentCell.getPosition().x + 1; i++) {
for (int j = currentCell.getPosition().y - 1; j <= currentCell.getPosition().y + 1; j++) {
Point position = new Point(i, j);
position = boundaryCondition.getPosition(position, size);
if ((currentCell.getPosition().x == position.x && currentCell.getPosition().y == position.y) || (currentCell.getPosition().x == i - 1 && currentCell.getPosition().y == j + 1) || (currentCell.getPosition().x == i + 1 && currentCell.getPosition().y == j - 1) || boundaryCondition.skip(position, size)) {
continue;
}
neighbors.add(cells.get(position.x * size.x + position.y));
}
}
return neighbors;
}
}
| [
"marcin122131@gmail.com"
] | marcin122131@gmail.com |
9959ed2907db4d0ab10152eaf1a9cdc5277beb54 | 2d2e1c6126870b0833c6f80fec950af7897065e5 | /scriptom-office-2k3/src/main/java/org/codehaus/groovy/scriptom/tlb/office/word/WdSalutationType.java | 0081c6a39ad495b0833f551f438aa29c69a4ac5f | [] | no_license | groovy/Scriptom | d650b0464f58d3b58bb13469e710dbb80e2517d5 | 790eef97cdacc5da293d18600854b547f47e4169 | refs/heads/master | 2023-09-01T16:13:00.152780 | 2022-02-14T12:30:17 | 2022-02-14T12:30:17 | 39,463,850 | 20 | 7 | null | 2015-07-23T12:48:26 | 2015-07-21T18:52:11 | Java | UTF-8 | Java | false | false | 3,119 | java | /*
* Copyright 2009 (C) The Codehaus. All Rights Reserved.
*
* Redistribution and use of this software and associated documentation
* ("Software"), with or without modification, are permitted provided that the
* following conditions are met:
* 1. Redistributions of source code must retain copyright statements and
* notices. Redistributions must also contain a copy of this document.
* 2. 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.
* 3. The name "groovy" must not be used to endorse or promote products
* derived from this Software without prior written permission of The Codehaus.
* For written permission, please contact info@codehaus.org.
* 4. Products derived from this Software may not be called "groovy" nor may
* "groovy" appear in their names without prior written permission of The
* Codehaus. "groovy" is a registered trademark of The Codehaus.
* 5. Due credit should be given to The Codehaus - http://groovy.codehaus.org/
*
* THIS SOFTWARE IS PROVIDED BY THE CODEHAUS AND CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESSED 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 CODEHAUS OR ITS 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.codehaus.groovy.scriptom.tlb.office.word;
import java.util.Map;
import java.util.TreeMap;
import java.util.Collections;
/**
* @author Jason Smith
*/
public final class WdSalutationType
{
private WdSalutationType()
{
}
/**
* Value is 0 (0x0)
*/
public static final Integer wdSalutationInformal = Integer.valueOf(0);
/**
* Value is 1 (0x1)
*/
public static final Integer wdSalutationFormal = Integer.valueOf(1);
/**
* Value is 2 (0x2)
*/
public static final Integer wdSalutationBusiness = Integer.valueOf(2);
/**
* Value is 3 (0x3)
*/
public static final Integer wdSalutationOther = Integer.valueOf(3);
/**
* A {@code Map} of the symbolic names to constant values.
*/
public static final Map<String,Object> values;
static
{
TreeMap<String,Object> v = new TreeMap<String,Object>();
v.put("wdSalutationInformal", wdSalutationInformal);
v.put("wdSalutationFormal", wdSalutationFormal);
v.put("wdSalutationBusiness", wdSalutationBusiness);
v.put("wdSalutationOther", wdSalutationOther);
values = Collections.synchronizedMap(Collections.unmodifiableMap(v));
}
}
| [
"ysb33r@gmail.com"
] | ysb33r@gmail.com |
deea485810f01f7bf5cfefd0e2d8e01704851f69 | 8c2fd91899b78e92b614afc00535a981ad7a7e2a | /RobotCarApp/app/src/main/java/app/techsol/robotcar/ui/send/SendFragment.java | a196744a83f1186812b1af014d1861321803e5c7 | [] | no_license | androidgeek077/Robotcar | 79f410bd937e83bc0968c2cc428407718211f563 | 4ba661a9aa5b7757094f7a2ef7f07b58907e3374 | refs/heads/master | 2022-06-05T00:55:24.748681 | 2020-05-06T17:18:21 | 2020-05-06T17:18:21 | 261,828,369 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,147 | java | package app.techsol.robotcar.ui.send;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProviders;
import app.techsol.robotcar.R;
public class SendFragment extends Fragment {
private SendViewModel sendViewModel;
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
sendViewModel =
ViewModelProviders.of(this).get(SendViewModel.class);
View root = inflater.inflate(R.layout.fragment_send, container, false);
final TextView textView = root.findViewById(R.id.text_send);
sendViewModel.getText().observe(this, new Observer<String>() {
@Override
public void onChanged(@Nullable String s) {
textView.setText("QR code section");
}
});
return root;
}
} | [
"vickylucky088@gmail.com"
] | vickylucky088@gmail.com |
cbd90c7f3240def74c5a94b174c50c4da61672fb | fffdb8bf485949e71942000042860b5cb09e76a1 | /src/test/java/br/com/nameproject/models/ConfiguracaoAmbiente.java | 004a7d090f1d98192b257afe2701131e54f3e627 | [] | no_license | fabioalves77777/selenium-cucumber-junit | 62569f3a06536cad6aa2d6b629ca852df9b92014 | ad1e63c6edd72ba837443053e11895e419b8b88d | refs/heads/master | 2021-07-08T14:56:16.703591 | 2020-08-20T19:28:57 | 2020-08-20T19:28:57 | 234,646,250 | 1 | 0 | null | 2021-03-31T21:45:04 | 2020-01-17T22:16:31 | HTML | UTF-8 | Java | false | false | 756 | java | package br.com.nameproject.models;
import br.com.nameproject.support.EnumAmbiente;
import br.com.nameproject.support.EnumNavegador;
public class ConfiguracaoAmbiente {
public ConfiguracaoAmbiente() {
this.navegador = EnumNavegador.CHROME;
this.ambiente = EnumAmbiente.TST;
}
public Enum<?> navegador;
public Enum<?> ambiente;
public static String UrlTst = "https://seubarriga.wcaquino.me/login";
public static String UrlHml = "https://seubarriga.wcaquino.me/login";
public void setNavegador(Enum<?> Navegador) {
this.navegador = Navegador;
}
public Enum<?> getNavegador() {
return navegador;
}
public Enum<?> getAmbiente() {
return ambiente;
}
public void setAmbiente(Enum<?> ambiente) {
this.ambiente = ambiente;
}
}
| [
"fabioaraujo.alves@castgroup.com.br"
] | fabioaraujo.alves@castgroup.com.br |
a2f44fc3d20ddcb6f9da4086a05d0419031740f7 | 74735a10900cd1e1f8b72b2d7cad2585b0920150 | /src/main/java/br/com/alura/spring/data/SpringDataApplication.java | b123c6b29518877b270e781f7829f951c4555fd8 | [] | no_license | tiagoaraujobarreto/spring-data | 0c37aa56b11e4ed735970c4ba63eb08cba28f0e0 | 6a8758a8b15e965df5a2a0d66e3330e61b40de45 | refs/heads/main | 2023-08-04T18:59:54.373319 | 2021-09-16T23:53:58 | 2021-09-16T23:53:58 | 393,559,029 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,542 | java | package br.com.alura.spring.data;
import java.util.Scanner;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import br.com.alura.spring.data.service.CrudCargoService;
import br.com.alura.spring.data.service.CrudFuncionarioService;
import br.com.alura.spring.data.service.CrudUnidadeDeTrabalhoService;
import br.com.alura.spring.data.service.RelatorioFuncionarioDinamico;
import br.com.alura.spring.data.service.RelatoriosService;
@SpringBootApplication
public class SpringDataApplication implements CommandLineRunner {
private final CrudCargoService cargoService;
private final CrudFuncionarioService funcionarioService;
private final CrudUnidadeDeTrabalhoService CrudUnidadeDeTrabalhoService;
private final RelatoriosService relatoriosService;
private final RelatorioFuncionarioDinamico relatorioFuncionarioDinamico;
private Boolean system = true;
public SpringDataApplication(CrudCargoService cargoService, CrudFuncionarioService funcionarioService,
CrudUnidadeDeTrabalhoService CrudUnidadeDeTrabalhoService, RelatoriosService relatoriosService,
RelatorioFuncionarioDinamico relatorioFuncionarioDinamico) {
this.cargoService = cargoService;
this.funcionarioService = funcionarioService;
this.CrudUnidadeDeTrabalhoService = CrudUnidadeDeTrabalhoService;
this.relatoriosService = relatoriosService;
this.relatorioFuncionarioDinamico = relatorioFuncionarioDinamico;
}
public static void main(String[] args) {
SpringApplication.run(SpringDataApplication.class, args);
}
@Override
public void run(String... args) throws Exception {
Scanner scanner = new Scanner(System.in);
while (system) {
System.out.println("Qual ação você quer executar");
System.out.println("0 - Sair");
System.out.println("1 - Cargo");
System.out.println("2 - Funcionario");
System.out.println("3 - Unidade de trabalho");
System.out.println("4 - Relatórios");
System.out.println("5 - Relatórios Dinâmico");
int action = scanner.nextInt();
switch (action) {
case 1:
cargoService.inicial(scanner);
break;
case 2:
funcionarioService.inicial(scanner);
break;
case 3:
CrudUnidadeDeTrabalhoService.inicial(scanner);
break;
case 4:
relatoriosService.inicial(scanner);
break;
case 5:
relatorioFuncionarioDinamico.inicial(scanner);
break;
default:
System.out.println("Finalizado!");
system = false;
}
}
}
}
| [
"tiagoaraujo.barreto@gmail.com"
] | tiagoaraujo.barreto@gmail.com |
74926ae758996e8ee50136d716debb879f08d089 | 313733c9bb92c3e014ff1d016d4f1aff1ef34604 | /src/main/java/uz/pdp/controller/CrudService.java | 90e7458e5fa67b398d90bed6a403cbc7ac1e7559 | [] | no_license | mahmudsalomov/spring-mvc-thymeleaf | c10ef2b5ba529090043381b025143d72ba53c0a3 | 4f2f5414209f0eee893bef30d612eeef99f64b2f | refs/heads/master | 2023-03-05T20:05:32.398875 | 2021-02-23T12:30:11 | 2021-02-23T12:30:11 | 339,765,700 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,248 | java | package uz.pdp.controller;
import java.sql.*;
import java.util.ArrayList;
import java.util.List;
public class CrudService {
private final String url="jdbc:postgresql://localhost:5432/student";
private final String user="postgres";
private final String password="postgres";
// private final String url="postgres://oykpbydvsatswh:a80ae4519b6e93714dc564b408459be4b5e2ab3ad26fda3a216bdbdecad43ff7@ec2-34-254-69-72.eu-west-1.compute.amazonaws.com:5432/d1j12ep23ung7o";
// private final String user="oykpbydvsatswh";
// private final String password="a80ae4519b6e93714dc564b408459be4b5e2ab3ad26fda3a216bdbdecad43ff7";
Connection connection=null;
Statement statement=null;
PreparedStatement preparedStatement=null;
String query="";
public CrudService() throws SQLException {
}
public List<Student> getAll(){
List<Student> studentList=new ArrayList<>();
try {
Class.forName("org.postgresql.Driver");
connection = DriverManager.getConnection(url, user, password);
statement=connection.createStatement();
query="select * from students order by id";
ResultSet resultSet=statement.executeQuery(query);
while (resultSet.next()){
Student student=new Student(resultSet.getLong(1),resultSet.getString(2), resultSet.getString(3));
studentList.add(student);
}
statement.close();
connection.close();
} catch (ClassNotFoundException | SQLException e) {
e.printStackTrace();
}
return studentList;
}
public int pageCount() throws ClassNotFoundException, SQLException {
Class.forName("org.postgresql.Driver");
connection = DriverManager.getConnection(url, user, password);
statement=connection.createStatement();
ResultSet resultSet=statement.executeQuery("select count(*) from students");
while (resultSet.next()){
return resultSet.getInt(1)/10+1;
}
return 0;
}
public List<Student> getLimit(Integer offset){
offset*=10;
int limit=10;
List<Student> studentList=new ArrayList<>();
try {
Class.forName("org.postgresql.Driver");
connection = DriverManager.getConnection(url, user, password);
statement=connection.createStatement();
query="select * from students order by students.id limit "+limit+" offset "+offset;
ResultSet resultSet=statement.executeQuery(query);
while (resultSet.next()){
Student student=new Student(resultSet.getLong(1),resultSet.getString(2), resultSet.getString(3));
studentList.add(student);
}
statement.close();
connection.close();
} catch (ClassNotFoundException | SQLException e) {
e.printStackTrace();
}
return studentList;
}
public List<Student> search(String keyword){
List<Student> studentList=new ArrayList<>();
try {
Class.forName("org.postgresql.Driver");
connection = DriverManager.getConnection(url, user, password);
query="SELECT * from students where position( lower(?) in lower(students.name))>0 or position( lower(?) in lower(students.surname))>0 order by id";
preparedStatement=connection.prepareStatement(query);
preparedStatement.setString(1,keyword);
preparedStatement.setString(2,keyword);
ResultSet resultSet=preparedStatement.executeQuery();
while (resultSet.next()){
Student student=new Student(resultSet.getLong(1),resultSet.getString(2), resultSet.getString(3));
studentList.add(student);
}
preparedStatement.close();
connection.close();
} catch (ClassNotFoundException | SQLException e) {
e.printStackTrace();
}
return studentList;
}
public boolean post(Student student){
try {
Class.forName("org.postgresql.Driver");
connection = DriverManager.getConnection(url, user, password);
statement=connection.createStatement();
ResultSet resultSet=statement.executeQuery("select count(*) from students");
while (resultSet.next()){
if (resultSet.getInt(1)>50){
return false;
}
}
query="insert into students (name, surname) values (?,?)";
preparedStatement=connection.prepareStatement(query);
preparedStatement.setString(1,student.getName());
preparedStatement.setString(2,student.getSurname());
preparedStatement.execute();
connection.close();
preparedStatement.close();
} catch (ClassNotFoundException | SQLException e) {
e.printStackTrace();
}
return true;
}
public void put(Student student){
try {
Class.forName("org.postgresql.Driver");
connection = DriverManager.getConnection(url, user, password);
query="update students set name=?, surname=? where id=?";
preparedStatement=connection.prepareStatement(query);
preparedStatement.setString(1,student.getName());
preparedStatement.setString(2,student.getSurname());
preparedStatement.setLong(3, student.getId());
preparedStatement.execute();
connection.close();
preparedStatement.close();
} catch (ClassNotFoundException | SQLException e) {
e.printStackTrace();
}
}
public void delete(Long id){
try {
Class.forName("org.postgresql.Driver");
connection = DriverManager.getConnection(url, user, password);
statement=connection.createStatement();
query="delete from students where id="+id;
statement.execute(query);
statement.close();
connection.close();
} catch (ClassNotFoundException | SQLException e) {
e.printStackTrace();
}
}
}
| [
"primat.2000@mail.ru"
] | primat.2000@mail.ru |
fedb95e9d7c4c6f7bd4ac6149a897f8eeb007e91 | 6d2fe29219cbdd28b64a3cff54c3de3050d6c7be | /plc4j/drivers/c-bus/src/main/generated/org/apache/plc4x/java/cbus/readwrite/HVACHumidity.java | 1bb90ba6020eedad2bf1d54aaea36b1aa4d3532c | [
"Apache-2.0",
"Unlicense"
] | permissive | siyka-au/plc4x | ca5e7b02702c8e59844bf45ba595052fcda24ac8 | 44e4ede3b4f54370553549946639a3af2c956bd1 | refs/heads/develop | 2023-05-12T12:28:09.037476 | 2023-04-27T22:55:23 | 2023-04-27T22:55:23 | 179,656,431 | 4 | 3 | Apache-2.0 | 2023-03-02T21:19:18 | 2019-04-05T09:43:27 | Java | UTF-8 | Java | false | false | 4,676 | 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.plc4x.java.cbus.readwrite;
import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*;
import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*;
import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*;
import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*;
import static org.apache.plc4x.java.spi.generation.StaticHelper.*;
import java.time.*;
import java.util.*;
import org.apache.plc4x.java.api.exceptions.*;
import org.apache.plc4x.java.api.value.*;
import org.apache.plc4x.java.spi.codegen.*;
import org.apache.plc4x.java.spi.codegen.fields.*;
import org.apache.plc4x.java.spi.codegen.io.*;
import org.apache.plc4x.java.spi.generation.*;
// Code generated by code-generation. DO NOT EDIT.
public class HVACHumidity implements Message {
// Properties.
protected final int humidityValue;
public HVACHumidity(int humidityValue) {
super();
this.humidityValue = humidityValue;
}
public int getHumidityValue() {
return humidityValue;
}
public float getHumidityInPercent() {
return (float) ((getHumidityValue()) / (65535F));
}
public void serialize(WriteBuffer writeBuffer) throws SerializationException {
PositionAware positionAware = writeBuffer;
boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get();
int startPos = positionAware.getPos();
writeBuffer.pushContext("HVACHumidity");
// Simple Field (humidityValue)
writeSimpleField("humidityValue", humidityValue, writeUnsignedInt(writeBuffer, 16));
// Virtual field (doesn't actually serialize anything, just makes the value available)
float humidityInPercent = getHumidityInPercent();
writeBuffer.writeVirtual("humidityInPercent", humidityInPercent);
writeBuffer.popContext("HVACHumidity");
}
@Override
public int getLengthInBytes() {
return (int) Math.ceil((float) getLengthInBits() / 8.0);
}
@Override
public int getLengthInBits() {
int lengthInBits = 0;
HVACHumidity _value = this;
boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get();
// Simple field (humidityValue)
lengthInBits += 16;
// A virtual field doesn't have any in- or output.
return lengthInBits;
}
public static HVACHumidity staticParse(ReadBuffer readBuffer, Object... args)
throws ParseException {
PositionAware positionAware = readBuffer;
return staticParse(readBuffer);
}
public static HVACHumidity staticParse(ReadBuffer readBuffer) throws ParseException {
readBuffer.pullContext("HVACHumidity");
PositionAware positionAware = readBuffer;
int startPos = positionAware.getPos();
int curPos;
boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get();
int humidityValue = readSimpleField("humidityValue", readUnsignedInt(readBuffer, 16));
float humidityInPercent =
readVirtualField("humidityInPercent", float.class, (humidityValue) / (65535F));
readBuffer.closeContext("HVACHumidity");
// Create the instance
HVACHumidity _hVACHumidity;
_hVACHumidity = new HVACHumidity(humidityValue);
return _hVACHumidity;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof HVACHumidity)) {
return false;
}
HVACHumidity that = (HVACHumidity) o;
return (getHumidityValue() == that.getHumidityValue()) && true;
}
@Override
public int hashCode() {
return Objects.hash(getHumidityValue());
}
@Override
public String toString() {
WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true);
try {
writeBufferBoxBased.writeSerializable(this);
} catch (SerializationException e) {
throw new RuntimeException(e);
}
return "\n" + writeBufferBoxBased.getBox().toString() + "\n";
}
}
| [
"christofer.dutz@c-ware.de"
] | christofer.dutz@c-ware.de |
04c563f8093405c2885a140b17756fe282885ffb | 47b8c5962d305827b08989a3d2c92a6bdec59e83 | /payroll/src/main/java/dev/craftsmanship/ddd/payroll/domain/gestao_pessoas/cargo/Cargo.java | 8c36d1339ef5a2a2587094647815b7d37d096d39 | [] | no_license | artesaosw/projects | b70603069d6d2d060e5f385de8cf5aef28de4504 | c4cabbbe22f84888f18198d28b22530940fb7d9a | refs/heads/master | 2023-06-22T18:49:35.424488 | 2020-06-18T16:29:42 | 2020-06-18T16:29:42 | 268,029,796 | 0 | 0 | null | 2020-06-18T16:29:43 | 2020-05-30T07:21:20 | Java | UTF-8 | Java | false | false | 2,255 | java | package dev.craftsmanship.ddd.payroll.domain.gestao_pessoas.cargo;
import lombok.Getter;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Id;
import java.io.Serializable;
import java.util.Objects;
import java.util.UUID;
import static dev.craftsmanship.ddd.payroll.utils.Erros.parametroInvalido;
@Entity
@Getter
public class Cargo implements Serializable, CargoContrato {
@Id
private UUID identificacao;
private UUID entidadeID;
private String descricao;
@Enumerated(EnumType.ORDINAL)
private NaturezaCargo natureza;
private double valor;
@Deprecated(since = "For ORM framework use only.")
Cargo() { }
public Cargo(UUID entidadeID, String descricao, NaturezaCargo natureza, double valor) {
if (entidadeID == null) {
parametroInvalido("A entidade à qual pertence o cargo deve ser informada.");
}
if (descricao == null || descricao.trim().length() < 3){
parametroInvalido("Descrição deve ser informada.");
}
if (natureza == null) {
parametroInvalido("Natureza do cargo deve ser informada.");
}
if (valor < 0) {
parametroInvalido("Valor do cargo deve ser maior do que 0.00.");
}
this.identificacao = UUID.randomUUID();
this.descricao = descricao;
this.natureza = natureza;
this.valor = valor;
}
void reajustar(double percentualReajuste){
valor = valor + ((valor * percentualReajuste) / 100);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Cargo)) return false;
Cargo cargo = (Cargo) o;
return identificacao.equals(cargo.identificacao);
}
@Override
public int hashCode() {
return Objects.hash(identificacao);
}
@Override
public String toString() {
return "Cargo{" +
"identificacao=" + identificacao +
", entidadeID=" + entidadeID +
", descricao='" + descricao + '\'' +
", natureza=" + natureza +
", valor=" + valor +
'}';
}
}
| [
"ruben.linssilva@altran.com"
] | ruben.linssilva@altran.com |
a54e12050c5acb8a91226c859eba266ed185d66c | 7ae648285a5813e92bfbbaf3b0c79dea6da0781e | /src/com/how2java/tmall/pojo/Order.java | ac7106e95e5b374ccb30a338ba46c910e6587d38 | [] | no_license | PGE123/tmall_ssh | 45612d75d65959dc6fd0afb3d902c118c2c7495d | c1123d0d688ca9c1990b4cae680438946ef8da40 | refs/heads/master | 2022-12-25T00:15:31.658543 | 2020-10-03T02:51:54 | 2020-10-03T02:51:54 | 261,716,101 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 3,744 | java | package com.how2java.tmall.pojo;
import java.util.Date;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;
import com.how2java.tmall.service.OrderService;
@Entity
@Table(name="order_")
public class Order {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name="id")
private int id;
@ManyToOne
@JoinColumn(name="uid")
private User user;
private String orderCode;
private String address;
private String post;
private String receiver;
private String mobile;
private String userMessage;
private Date createDate;
private Date payDate;
private Date deliveryDate;
private Date confirmDate;
private String status;
@Transient
private List<OrderItem> orderItems;
@Transient
private float total;
@Transient
private int totalNumber;
public String getStatusDesc(){
String desc = "未知";
switch(status){
case OrderService.waitPay:
desc="待付";
break;
case OrderService.waitDelivery:
desc="待发";
break;
case OrderService.waitConfirm:
desc="待收";
break;
case OrderService.waitReview:
desc="等评";
break;
case OrderService.finish:
desc="完成";
break;
case OrderService.delete:
desc="删除";
break;
default:
desc="未知";
}
return desc;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
public String getOrderCode() {
return orderCode;
}
public void setOrderCode(String orderCode) {
this.orderCode = orderCode;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getPost() {
return post;
}
public void setPost(String post) {
this.post = post;
}
public String getReceiver() {
return receiver;
}
public void setReceiver(String receiver) {
this.receiver = receiver;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getUserMessage() {
return userMessage;
}
public void setUserMessage(String userMessage) {
this.userMessage = userMessage;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public Date getPayDate() {
return payDate;
}
public void setPayDate(Date payDate) {
this.payDate = payDate;
}
public Date getDeliveryDate() {
return deliveryDate;
}
public void setDeliveryDate(Date deliveryDate) {
this.deliveryDate = deliveryDate;
}
public Date getConfirmDate() {
return confirmDate;
}
public void setConfirmDate(Date confirmDate) {
this.confirmDate = confirmDate;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public List<OrderItem> getOrderItems() {
return orderItems;
}
public void setOrderItems(List<OrderItem> orderItems) {
this.orderItems = orderItems;
}
public float getTotal() {
return total;
}
public void setTotal(float total) {
this.total = total;
}
public int getTotalNumber() {
return totalNumber;
}
public void setTotalNumber(int totalNumber) {
this.totalNumber = totalNumber;
}
}
| [
"2659093940@qq.com"
] | 2659093940@qq.com |
7cc2f3431149ded04022d3777e05149c636c748c | ce2e882846ad4d71d1b9804c53c8661dab39f943 | /src/main/java/com/example/incubation_planner/aop/LogAspect.java | 9bf5a22559877e9d4772f56e33143944d85df755 | [] | no_license | gergana-cisarova/incubation_planner | 06ba2c584610462248d35a0ce9e5154a6eb62649 | 9ad7d1fb9c514adadefe46270089bbaad63ce18e | refs/heads/master | 2023-04-14T01:45:29.193138 | 2021-04-10T11:40:55 | 2021-04-10T11:40:55 | 353,063,283 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,494 | java | package com.example.incubation_planner.aop;
import com.example.incubation_planner.models.binding.IdeaAddBindingModel;
import com.example.incubation_planner.services.LogService;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;
@Aspect
@Component
public class LogAspect {
private final LogService logService;
public LogAspect(LogService logService) {
this.logService = logService;
}
@Pointcut("execution(* com.example.incubation_planner.web.ProjectController.joinProject(..))")
public void joinPointCut() {
}
@Pointcut("execution(* com.example.incubation_planner.web.IdeaController.postIdea(..))")
public void ideaCreatePointCut() {
}
@After("joinPointCut()")
public void joinProjectAfterAdvice(JoinPoint joinPoint) {
Object[] args = joinPoint.getArgs();
String projectId = (String) args[0];
String action = joinPoint.getSignature().getName();
logService.createProjectJoinLog(action, projectId);
}
@After("ideaCreatePointCut()")
public void ideaCreateAfterAdvice(JoinPoint joinPoint) {
Object[] args = joinPoint.getArgs();
String ideaName = ((IdeaAddBindingModel) args[0]).getName();
String action = joinPoint.getSignature().getName();
logService.createIdeaAddLog(action, ideaName);
}
}
| [
"gergana.cisarova@gmail.com"
] | gergana.cisarova@gmail.com |
74aec33505668554f78d823b357dd713267cfcea | a31b4f2c79d97a445562eca025c2d536cecbe5d8 | /app/src/main/java/com/wzsykj/wuyaojiu/widget/PreferenceUtils.java | 4056c19dacc53bb7066dc07ecebfc3bf3554dc4f | [] | no_license | glodlike/bopihui | 28b9c00401c7c477e0c70f609426880b2165ce34 | 7bffd3bfc1308ffd611f6acc4216442f56339e3e | refs/heads/master | 2021-01-06T20:43:26.898909 | 2017-08-07T06:52:08 | 2017-08-07T06:52:08 | 99,546,047 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,250 | java | package com.wzsykj.wuyaojiu.widget;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.preference.PreferenceManager;
/**
* Created by chen on 16/8/18.
* SwipeBackLayout
* 工具类
*/
public class PreferenceUtils {
public static String getPrefString(Context context, String key, final String defaultValue) {
final SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context);
return settings.getString(key, defaultValue);
}
public static void setPrefString(Context context, final String key, final String value) {
final SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context);
settings.edit().putString(key, value).commit();
}
public static boolean getPrefBoolean(Context context, final String key,
final boolean defaultValue) {
final SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context);
return settings.getBoolean(key, defaultValue);
}
public static boolean hasKey(Context context, final String key) {
return PreferenceManager.getDefaultSharedPreferences(context).contains(key);
}
public static void setPrefBoolean(Context context, final String key, final boolean value) {
final SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context);
settings.edit().putBoolean(key, value).commit();
}
public static void setPrefInt(Context context, final String key, final int value) {
final SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context);
settings.edit().putInt(key, value).commit();
}
public static int getPrefInt(Context context, final String key, final int defaultValue) {
final SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context);
return settings.getInt(key, defaultValue);
}
public static void setPrefFloat(Context context, final String key, final float value) {
final SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context);
settings.edit().putFloat(key, value).commit();
}
public static float getPrefFloat(Context context, final String key, final float defaultValue) {
final SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context);
return settings.getFloat(key, defaultValue);
}
public static void setSettingLong(Context context, final String key, final long value) {
final SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context);
settings.edit().putLong(key, value).commit();
}
public static long getPrefLong(Context context, final String key, final long defaultValue) {
final SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context);
return settings.getLong(key, defaultValue);
}
public static void clearPreference(Context context, final SharedPreferences p) {
final Editor editor = p.edit();
editor.clear();
editor.commit();
}
}
| [
"291338574@qq.com"
] | 291338574@qq.com |
12f27c47655bba59860d26d334ffb229320721d8 | 647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4 | /com.tencent.mm/classes.jar/com/tencent/tav/core/parallel/control/ParallelExportController.java | d2ba54d29f0f5461a702143092c2e7f2baafe4fe | [] | no_license | tsuzcx/qq_apk | 0d5e792c3c7351ab781957bac465c55c505caf61 | afe46ef5640d0ba6850cdefd3c11badbd725a3f6 | refs/heads/main | 2022-07-02T10:32:11.651957 | 2022-02-01T12:41:38 | 2022-02-01T12:41:38 | 453,860,108 | 36 | 9 | null | 2022-01-31T09:46:26 | 2022-01-31T02:43:22 | Java | UTF-8 | Java | false | false | 24,971 | java | package com.tencent.tav.core.parallel.control;
import android.os.HandlerThread;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.tav.core.AssetParallelSegmentStatus;
import com.tencent.tav.core.parallel.info.PipelineIndicatorInfo;
import com.tencent.tav.core.parallel.info.PipelineWorkInfo;
import com.tencent.tav.coremedia.CMSampleBuffer;
import com.tencent.tav.decoder.logger.Logger;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import kotlin.Metadata;
import kotlin.ah;
import kotlin.g.a.b;
import kotlin.g.a.q;
import kotlin.g.b.s;
import kotlin.k.k;
@Metadata(bv={1, 0, 3}, d1={""}, d2={"Lcom/tencent/tav/core/parallel/control/ParallelExportController;", "", "()V", "currentFrameRate", "", "exportWork", "Ljava/util/ArrayList;", "Lcom/tencent/tav/core/parallel/info/PipelineWorkInfo;", "Lkotlin/collections/ArrayList;", "hardwareLimit", "", "lastFrameRate", "lastTimestampMs", "", "maxParallelCount", "getMaxParallelCount", "()I", "setMaxParallelCount", "(I)V", "performanceMap", "Ljava/util/HashMap;", "Lcom/tencent/tav/core/parallel/control/ParallelExportAnalyse;", "Lkotlin/collections/HashMap;", "releaseWork", "Lkotlin/Function3;", "Lkotlin/ParameterName;", "name", "info", "Ljava/lang/Runnable;", "callback", "_", "", "startTimeMs", "startWork", "Lkotlin/Function1;", "totalFrame", "allSuccess", "allWorkFinish", "analyseAppendSampleBuffer", "buffer", "Lcom/tencent/tav/coremedia/CMSampleBuffer;", "analyseGetSampleBuffer", "canWorkReuse", "createNewWork", "currentRunSize", "handleWorkFinish", "hasPreparedWork", "markHardwareLimit", "Lcom/tencent/tav/core/parallel/info/PipelineIndicatorInfo;", "registerFunction", "releaseWorkResource", "reuseWork", "setupWorkInfo", "startExport", "tryStartOneMoreWork", "Companion", "avfoundation_release"}, k=1, mv={1, 1, 15})
public final class ParallelExportController
{
public static final ParallelExportController.Companion Companion;
private static final int DEFAULT_FRAME = 20;
private static final int FRAME_BUFF = 10;
private static final int MAX_WORK_COUNT = 5;
private static final String TAG = "ParallelExportController";
private static final int TIME_INTERVAL = 3000;
private int currentFrameRate;
private ArrayList<PipelineWorkInfo> exportWork;
private boolean hardwareLimit;
private int lastFrameRate;
private long lastTimestampMs;
private int maxParallelCount;
private final HashMap<PipelineWorkInfo, ParallelExportAnalyse> performanceMap;
private q<? super PipelineWorkInfo, ? super Runnable, ? super Boolean, ah> releaseWork;
private long startTimeMs;
private b<? super PipelineWorkInfo, ah> startWork;
private int totalFrame;
static
{
AppMethodBeat.i(215637);
Companion = new ParallelExportController.Companion(null);
AppMethodBeat.o(215637);
}
public ParallelExportController()
{
AppMethodBeat.i(215635);
this.performanceMap = new HashMap();
this.totalFrame = 30;
this.lastFrameRate = 20;
this.currentFrameRate = 20;
AppMethodBeat.o(215635);
}
private final void createNewWork(b<? super PipelineWorkInfo, ah> paramb)
{
Object localObject3 = null;
AppMethodBeat.i(215625);
label180:
if (paramb != null)
{
Object localObject1 = this.exportWork;
Object localObject2;
Object localObject4;
PipelineIndicatorInfo localPipelineIndicatorInfo;
int i;
if (localObject1 != null)
{
localObject2 = ((Iterable)localObject1).iterator();
if (((Iterator)localObject2).hasNext())
{
localObject1 = ((Iterator)localObject2).next();
localObject4 = (PipelineWorkInfo)localObject1;
localPipelineIndicatorInfo = ((PipelineWorkInfo)localObject4).getIndicator();
s.r(localPipelineIndicatorInfo, "it.indicator");
if ((localPipelineIndicatorInfo.getSegmentStatus() == AssetParallelSegmentStatus.AssetParallelStatusPrepared) && (((PipelineWorkInfo)localObject4).getIndicator().type == 1))
{
i = 1;
label95:
if (i == 0) {
break label180;
}
}
}
}
label99:
for (localObject1 = (PipelineWorkInfo)localObject1;; localObject1 = null)
{
localObject4 = new StringBuilder("tryStartOneMoreWork index:");
localObject2 = localObject3;
if (localObject1 != null)
{
localPipelineIndicatorInfo = ((PipelineWorkInfo)localObject1).getIndicator();
localObject2 = localObject3;
if (localPipelineIndicatorInfo != null) {
localObject2 = Integer.valueOf(localPipelineIndicatorInfo.getIndex());
}
}
Logger.i("ParallelExportController", localObject2);
paramb.invoke(localObject1);
AppMethodBeat.o(215625);
return;
i = 0;
break label95;
break;
localObject1 = null;
break label99;
}
}
AppMethodBeat.o(215625);
}
private final int currentFrameRate()
{
return this.currentFrameRate * 1000 / 3000;
}
private final boolean hasPreparedWork()
{
AppMethodBeat.i(215632);
Object localObject = this.exportWork;
int i;
if (localObject != null)
{
Iterator localIterator = ((Iterable)localObject).iterator();
if (localIterator.hasNext())
{
localObject = localIterator.next();
PipelineWorkInfo localPipelineWorkInfo = (PipelineWorkInfo)localObject;
PipelineIndicatorInfo localPipelineIndicatorInfo = localPipelineWorkInfo.getIndicator();
s.r(localPipelineIndicatorInfo, "it.indicator");
if ((localPipelineIndicatorInfo.getSegmentStatus() == AssetParallelSegmentStatus.AssetParallelStatusPrepared) && (localPipelineWorkInfo.getIndicator().type == 1))
{
i = 1;
label85:
if (i == 0) {
break label108;
}
}
}
}
label89:
for (localObject = (PipelineWorkInfo)localObject;; localObject = null)
{
if (localObject == null) {
break label120;
}
AppMethodBeat.o(215632);
return true;
i = 0;
break label85;
label108:
break;
localObject = null;
break label89;
}
label120:
AppMethodBeat.o(215632);
return false;
}
private final void releaseWorkResource(Runnable paramRunnable)
{
AppMethodBeat.i(215619);
Object localObject1 = this.exportWork;
if (localObject1 != null)
{
Object localObject2 = ((Iterable)localObject1).iterator();
int i;
if (((Iterator)localObject2).hasNext())
{
localObject1 = ((Iterator)localObject2).next();
Object localObject3 = (PipelineWorkInfo)localObject1;
PipelineIndicatorInfo localPipelineIndicatorInfo = ((PipelineWorkInfo)localObject3).getIndicator();
s.r(localPipelineIndicatorInfo, "it.indicator");
if ((localPipelineIndicatorInfo.getSegmentStatus() == AssetParallelSegmentStatus.AssetReaderStatusWriteFinish) && (((PipelineWorkInfo)localObject3).getIndicator().type == 1))
{
localObject3 = ((PipelineWorkInfo)localObject3).thread;
if ((localObject3 != null) && (((HandlerThread)localObject3).isAlive() == true))
{
i = 1;
label109:
if (i == 0) {
break label155;
}
}
}
}
for (;;)
{
localObject1 = (PipelineWorkInfo)localObject1;
if (localObject1 == null) {
break label168;
}
localObject2 = this.releaseWork;
if (localObject2 == null) {
break label162;
}
((q)localObject2).invoke(localObject1, paramRunnable, Boolean.FALSE);
AppMethodBeat.o(215619);
return;
i = 0;
break label109;
label155:
break;
localObject1 = null;
}
label162:
AppMethodBeat.o(215619);
return;
}
label168:
paramRunnable.run();
AppMethodBeat.o(215619);
}
private final void reuseWork(b<? super PipelineWorkInfo, ah> paramb)
{
AppMethodBeat.i(215615);
Object localObject1 = this.exportWork;
if (localObject1 != null)
{
Object localObject2 = ((Iterable)localObject1).iterator();
int i;
if (((Iterator)localObject2).hasNext())
{
localObject1 = ((Iterator)localObject2).next();
localObject3 = (PipelineWorkInfo)localObject1;
localObject4 = ((PipelineWorkInfo)localObject3).getIndicator();
s.r(localObject4, "it.indicator");
if ((((PipelineIndicatorInfo)localObject4).getSegmentStatus() == AssetParallelSegmentStatus.AssetReaderStatusWriteFinish) && (((PipelineWorkInfo)localObject3).getIndicator().type == 1))
{
i = 1;
label88:
if (i == 0) {
break label208;
}
label92:
localObject2 = (PipelineWorkInfo)localObject1;
if (localObject2 == null) {
break label331;
}
localObject1 = this.exportWork;
if (localObject1 != null)
{
localObject3 = ((Iterable)localObject1).iterator();
label123:
if (!((Iterator)localObject3).hasNext()) {
break label220;
}
localObject1 = ((Iterator)localObject3).next();
localObject4 = (PipelineWorkInfo)localObject1;
PipelineIndicatorInfo localPipelineIndicatorInfo = ((PipelineWorkInfo)localObject4).getIndicator();
s.r(localPipelineIndicatorInfo, "todoWork.indicator");
if ((localPipelineIndicatorInfo.getSegmentStatus() != AssetParallelSegmentStatus.AssetParallelStatusPrepared) || (((PipelineWorkInfo)localObject4).getIndicator().type != 1)) {
break label215;
}
i = 1;
label186:
if (i == 0) {
break label218;
}
}
}
}
for (;;)
{
localObject1 = (PipelineWorkInfo)localObject1;
if (localObject1 != null) {
break label225;
}
AppMethodBeat.o(215615);
return;
i = 0;
break label88;
label208:
break;
localObject1 = null;
break label92;
label215:
i = 0;
break label186;
label218:
break label123;
label220:
localObject1 = null;
}
label225:
Object localObject3 = new StringBuilder("try reuse Work from:");
Object localObject4 = ((PipelineWorkInfo)localObject2).getIndicator();
s.r(localObject4, "reuseWork.indicator");
localObject3 = ((StringBuilder)localObject3).append(((PipelineIndicatorInfo)localObject4).getIndex()).append(" to:");
localObject4 = ((PipelineWorkInfo)localObject1).getIndicator();
s.r(localObject4, "work.indicator");
Logger.i("ParallelExportController", ((PipelineIndicatorInfo)localObject4).getIndex());
((PipelineWorkInfo)localObject2).reuseWork((PipelineWorkInfo)localObject1);
if (paramb != null)
{
paramb.invoke(localObject2);
AppMethodBeat.o(215615);
return;
}
AppMethodBeat.o(215615);
return;
}
label331:
AppMethodBeat.o(215615);
}
private final void setupWorkInfo(ArrayList<PipelineWorkInfo> paramArrayList)
{
AppMethodBeat.i(215598);
this.exportWork = paramArrayList;
Object localObject = this.exportWork;
if (localObject != null)
{
Iterator localIterator = ((Iterable)localObject).iterator();
if (localIterator.hasNext())
{
localObject = localIterator.next();
if (((PipelineWorkInfo)localObject).type == 2)
{
i = 1;
label62:
if (i == 0) {
break label177;
}
label66:
localObject = (PipelineWorkInfo)localObject;
label71:
if (localObject == null) {
break label189;
}
i = 1;
label77:
if (i == 0) {
break label194;
}
}
}
}
label177:
label189:
label194:
for (int i = 1;; i = 0)
{
Logger.i("ParallelExportController", "exportWork video count:" + (paramArrayList.size() - i) + " audio count:" + i);
paramArrayList = ((Iterable)paramArrayList).iterator();
while (paramArrayList.hasNext())
{
localObject = (PipelineWorkInfo)paramArrayList.next();
((Map)this.performanceMap).put(localObject, new ParallelExportAnalyse((PipelineWorkInfo)localObject));
}
i = 0;
break label62;
break;
localObject = null;
break label66;
localObject = null;
break label71;
i = 0;
break label77;
}
AppMethodBeat.o(215598);
}
public final boolean allSuccess()
{
AppMethodBeat.i(215717);
Object localObject = this.exportWork;
int i;
if (localObject != null)
{
Iterator localIterator = ((Iterable)localObject).iterator();
if (localIterator.hasNext())
{
localObject = localIterator.next();
PipelineIndicatorInfo localPipelineIndicatorInfo = ((PipelineWorkInfo)localObject).getIndicator();
s.r(localPipelineIndicatorInfo, "it.indicator");
if (localPipelineIndicatorInfo.getSegmentStatus() != AssetParallelSegmentStatus.AssetReaderStatusWriteFinish)
{
i = 1;
label70:
if (i == 0) {
break label94;
}
}
}
}
label74:
for (localObject = (PipelineWorkInfo)localObject;; localObject = null)
{
if (localObject != null) {
break label106;
}
AppMethodBeat.o(215717);
return true;
i = 0;
break label70;
label94:
break;
localObject = null;
break label74;
}
label106:
AppMethodBeat.o(215717);
return false;
}
public final boolean allWorkFinish()
{
AppMethodBeat.i(215710);
Object localObject1 = this.exportWork;
int i;
if (localObject1 != null)
{
Iterator localIterator = ((Iterable)localObject1).iterator();
if (localIterator.hasNext())
{
localObject1 = localIterator.next();
Object localObject2 = (PipelineWorkInfo)localObject1;
PipelineIndicatorInfo localPipelineIndicatorInfo = ((PipelineWorkInfo)localObject2).getIndicator();
s.r(localPipelineIndicatorInfo, "it.indicator");
if (localPipelineIndicatorInfo.getSegmentStatus() == AssetParallelSegmentStatus.AssetReaderStatusWriteFinish)
{
localObject2 = ((PipelineWorkInfo)localObject2).getIndicator();
s.r(localObject2, "it.indicator");
if (((PipelineIndicatorInfo)localObject2).getSegmentStatus() == AssetParallelSegmentStatus.AssetParallelStatusFailed) {}
}
else
{
i = 1;
label99:
if (i == 0) {
break label123;
}
}
}
}
label103:
for (localObject1 = (PipelineWorkInfo)localObject1;; localObject1 = null)
{
if (localObject1 != null) {
break label135;
}
AppMethodBeat.o(215710);
return true;
i = 0;
break label99;
label123:
break;
localObject1 = null;
break label103;
}
label135:
AppMethodBeat.o(215710);
return false;
}
public final void analyseAppendSampleBuffer(PipelineWorkInfo paramPipelineWorkInfo, CMSampleBuffer paramCMSampleBuffer)
{
AppMethodBeat.i(215668);
s.t(paramPipelineWorkInfo, "info");
s.t(paramCMSampleBuffer, "buffer");
paramPipelineWorkInfo = (ParallelExportAnalyse)this.performanceMap.get(paramPipelineWorkInfo);
if (paramPipelineWorkInfo != null)
{
paramPipelineWorkInfo.analyseAppendSampleBuffer(paramCMSampleBuffer);
AppMethodBeat.o(215668);
return;
}
AppMethodBeat.o(215668);
}
public final void analyseGetSampleBuffer(PipelineWorkInfo paramPipelineWorkInfo, CMSampleBuffer paramCMSampleBuffer)
{
AppMethodBeat.i(215660);
s.t(paramPipelineWorkInfo, "info");
s.t(paramCMSampleBuffer, "buffer");
paramPipelineWorkInfo = (ParallelExportAnalyse)this.performanceMap.get(paramPipelineWorkInfo);
if (paramPipelineWorkInfo != null) {
paramPipelineWorkInfo.analyseGetSampleBuffer(paramCMSampleBuffer);
}
this.totalFrame += 1;
this.currentFrameRate += 1;
if (System.currentTimeMillis() - this.lastTimestampMs >= 3000L)
{
this.lastTimestampMs = System.currentTimeMillis();
long l = this.totalFrame * 1000 / (this.lastTimestampMs - this.startTimeMs);
if ((currentFrameRate() - this.lastFrameRate >= 10) && (!this.hardwareLimit)) {
tryStartOneMoreWork();
}
Logger.i("ParallelExportController", "current work size:" + currentRunSize() + " frameRate:" + l + " currentRate:" + currentFrameRate() + " lastFrameRate:" + this.lastFrameRate);
this.lastFrameRate = k.qu(currentFrameRate(), this.lastFrameRate);
this.currentFrameRate = 0;
}
this.maxParallelCount = k.qu(this.maxParallelCount, currentRunSize());
AppMethodBeat.o(215660);
}
public final boolean canWorkReuse()
{
return false;
}
public final int currentRunSize()
{
AppMethodBeat.i(215700);
Object localObject1 = this.exportWork;
if (localObject1 != null)
{
Object localObject2 = (Iterable)localObject1;
localObject1 = (Collection)new ArrayList();
localObject2 = ((Iterable)localObject2).iterator();
label120:
while (((Iterator)localObject2).hasNext())
{
Object localObject3 = ((Iterator)localObject2).next();
PipelineWorkInfo localPipelineWorkInfo = (PipelineWorkInfo)localObject3;
PipelineIndicatorInfo localPipelineIndicatorInfo = localPipelineWorkInfo.getIndicator();
s.r(localPipelineIndicatorInfo, "it.indicator");
if ((localPipelineIndicatorInfo.getSegmentStatus() == AssetParallelSegmentStatus.AssetParallelStatusStarted) && (localPipelineWorkInfo.getIndicator().type == 1)) {}
for (i = 1;; i = 0)
{
if (i == 0) {
break label120;
}
((Collection)localObject1).add(localObject3);
break;
}
}
int i = ((List)localObject1).size();
AppMethodBeat.o(215700);
return i;
}
AppMethodBeat.o(215700);
return 0;
}
public final int getMaxParallelCount()
{
return this.maxParallelCount;
}
public final void handleWorkFinish(final PipelineWorkInfo paramPipelineWorkInfo, Runnable paramRunnable)
{
AppMethodBeat.i(215689);
s.t(paramPipelineWorkInfo, "info");
s.t(paramRunnable, "callback");
if (hasPreparedWork())
{
if (canWorkReuse())
{
reuseWork(this.startWork);
AppMethodBeat.o(215689);
return;
}
paramRunnable = this.releaseWork;
if (paramRunnable != null)
{
paramRunnable.invoke(paramPipelineWorkInfo, new Runnable()
{
public final void run()
{
AppMethodBeat.i(215578);
this.this$0.tryStartOneMoreWork();
AppMethodBeat.o(215578);
}
}, Boolean.FALSE);
AppMethodBeat.o(215689);
return;
}
AppMethodBeat.o(215689);
return;
}
q localq = this.releaseWork;
if (localq != null)
{
localq.invoke(paramPipelineWorkInfo, paramRunnable, Boolean.FALSE);
AppMethodBeat.o(215689);
return;
}
AppMethodBeat.o(215689);
}
public final void markHardwareLimit(PipelineIndicatorInfo paramPipelineIndicatorInfo)
{
AppMethodBeat.i(215727);
Logger.i("ParallelExportController", "markHardwareLimit:".concat(String.valueOf(paramPipelineIndicatorInfo)));
this.hardwareLimit = true;
AppMethodBeat.o(215727);
}
public final void registerFunction(b<? super PipelineWorkInfo, ah> paramb, q<? super PipelineWorkInfo, ? super Runnable, ? super Boolean, ah> paramq)
{
this.startWork = paramb;
this.releaseWork = paramq;
}
public final void setMaxParallelCount(int paramInt)
{
this.maxParallelCount = paramInt;
}
public final void startExport(ArrayList<PipelineWorkInfo> paramArrayList)
{
AppMethodBeat.i(215675);
s.t(paramArrayList, "info");
setupWorkInfo(paramArrayList);
this.lastTimestampMs = System.currentTimeMillis();
this.startTimeMs = this.lastTimestampMs;
b localb = this.startWork;
int i;
if (localb != null)
{
paramArrayList = this.exportWork;
if (paramArrayList == null) {
break label163;
}
Iterator localIterator = ((Iterable)paramArrayList).iterator();
if (!localIterator.hasNext()) {
break label158;
}
paramArrayList = localIterator.next();
PipelineWorkInfo localPipelineWorkInfo = (PipelineWorkInfo)paramArrayList;
PipelineIndicatorInfo localPipelineIndicatorInfo = localPipelineWorkInfo.getIndicator();
s.r(localPipelineIndicatorInfo, "it.indicator");
if ((localPipelineIndicatorInfo.getSegmentStatus() != AssetParallelSegmentStatus.AssetParallelStatusPrepared) || (localPipelineWorkInfo.getIndicator().type != 2)) {
break label153;
}
i = 1;
label125:
if (i == 0) {
break label156;
}
}
label129:
label153:
label156:
label158:
label163:
for (paramArrayList = (PipelineWorkInfo)paramArrayList;; paramArrayList = null)
{
localb.invoke(paramArrayList);
tryStartOneMoreWork();
AppMethodBeat.o(215675);
return;
i = 0;
break label125;
break;
paramArrayList = null;
break label129;
}
}
/* Error */
public final void tryStartOneMoreWork()
{
// Byte code:
// 0: aload_0
// 1: monitorenter
// 2: ldc_w 394
// 5: invokestatic 101 com/tencent/matrix/trace/core/AppMethodBeat:i (I)V
// 8: ldc 84
// 10: ldc_w 396
// 13: iconst_1
// 14: anewarray 4 java/lang/Object
// 17: dup
// 18: iconst_0
// 19: aload_0
// 20: invokevirtual 330 com/tencent/tav/core/parallel/control/ParallelExportController:currentRunSize ()I
// 23: invokestatic 190 java/lang/Integer:valueOf (I)Ljava/lang/Integer;
// 26: aastore
// 27: invokestatic 399 com/tencent/tav/decoder/logger/Logger:i (Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V
// 30: aload_0
// 31: invokevirtual 330 com/tencent/tav/core/parallel/control/ParallelExportController:currentRunSize ()I
// 34: iconst_5
// 35: if_icmplt +12 -> 47
// 38: ldc_w 394
// 41: invokestatic 110 com/tencent/matrix/trace/core/AppMethodBeat:o (I)V
// 44: aload_0
// 45: monitorexit
// 46: return
// 47: aload_0
// 48: invokespecial 366 com/tencent/tav/core/parallel/control/ParallelExportController:hasPreparedWork ()Z
// 51: ifeq +11 -> 62
// 54: aload_0
// 55: aload_0
// 56: getfield 370 com/tencent/tav/core/parallel/control/ParallelExportController:startWork Lkotlin/g/a/b;
// 59: invokespecial 401 com/tencent/tav/core/parallel/control/ParallelExportController:createNewWork (Lkotlin/g/a/b;)V
// 62: ldc_w 394
// 65: invokestatic 110 com/tencent/matrix/trace/core/AppMethodBeat:o (I)V
// 68: goto -24 -> 44
// 71: astore_1
// 72: aload_0
// 73: monitorexit
// 74: aload_1
// 75: athrow
// Local variable table:
// start length slot name signature
// 0 76 0 this ParallelExportController
// 71 4 1 localObject Object
// Exception table:
// from to target type
// 2 44 71 finally
// 47 62 71 finally
// 62 68 71 finally
}
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes9.jar
* Qualified Name: com.tencent.tav.core.parallel.control.ParallelExportController
* JD-Core Version: 0.7.0.1
*/ | [
"98632993+tsuzcx@users.noreply.github.com"
] | 98632993+tsuzcx@users.noreply.github.com |
1f4252e06cd3890b470daa6b155aeef0ca55a629 | 8123d082a2c622973926c3b465d5181449972075 | /app/src/main/java/com/example/baforecast/model/Weather.java | fe908e2a6672b7de6075a2df0e0f2e3ed11a35ef | [] | no_license | AnyaBananya/Android2 | 62d3ab976a52f039faf9d099e0e6a30b2f2be29b | 6a642f8ae6823f2e3f1eb1a07223a56a0aa2db81 | refs/heads/master | 2023-02-22T00:07:37.965304 | 2020-12-06T22:07:46 | 2020-12-06T22:07:46 | 319,134,721 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 423 | java | package com.example.baforecast.model;
public class Weather {
private String main;
private String description;
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;
}
}
| [
"Gavrish@lanit.ru"
] | Gavrish@lanit.ru |
ccac77280bdb2b17a770637cb4143f029ceb02bb | 0e38715d5147ea6fa8ce8b32791982d5134f4623 | /yundd/src/main/java/com/vomont/yundudao/ui/pic/AllPicActivity.java | 14321743200c8d2c9d4942b5daf93f2cda4877bb | [] | no_license | xieyunfeng123sao/yundd-zip | 5d945541b3e9943fc158cb8e1eb782d0811ebec7 | e6a74df4fbd6ef777d7809a18c3bdb180f0e1f41 | refs/heads/master | 2021-08-31T17:31:25.892083 | 2017-12-22T07:49:24 | 2017-12-22T07:49:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 21,295 | java | package com.vomont.yundudao.ui.pic;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.LinearLayout.LayoutParams;
import android.widget.ListView;
import android.widget.PopupWindow;
import android.widget.PopupWindow.OnDismissListener;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.vomont.yundudao.R;
import com.vomont.yundudao.bean.FactoryInfo;
import com.vomont.yundudao.bean.PicTimeBean;
import com.vomont.yundudao.bean.PicTimeInfo;
import com.vomont.yundudao.ui.pic.adapter.LineListAdapter;
import com.vomont.yundudao.ui.pic.adapter.LineListAdapter.OnCenterPicListener;
import com.vomont.yundudao.utils.GlideCacheUtil;
import com.vomont.yundudao.utils.Playutil;
import com.vomont.yundudao.view.BaseActivity;
import com.vomont.yundudao.view.expandView.ViewBottom;
import com.vomont.yundudao.view.expandView.ViewBottom.OnItemClicListener;
public class AllPicActivity extends BaseActivity implements OnClickListener
{
private ImageView go_back;
private TextView top_name;
private RelativeLayout select_pic;
private List<FactoryInfo> mlist;
private ListView pic_time_line;
private LineListAdapter adapter;
private Intent intent;
private PopupWindow mPopupWindow;
private ViewBottom viewBottom;
private String moth, time, year;
private Playutil playutil;
private List<String> list;
private List<PicTimeBean> pic_list;
private List<PicTimeBean> show_list;
private String from;
private TextView show_pic_fatory;
private ImageView show_fatory_view;
private ImageView empty_all_pic;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_all_pic);
initView();
initData();
initImage();
initListener();
}
private void initImage()
{
playutil = new Playutil(this);
list = playutil.getImageName();
show_list = new ArrayList<PicTimeBean>();
pic_list = new ArrayList<PicTimeBean>();
List<String> hasmoth = new ArrayList<String>();
if (list != null)
{
for (int i = 0; i < list.size(); i++)
{
PicTimeBean picTimeBean = new PicTimeBean();
year = list.get(i).substring(0, 4);
moth = list.get(i).substring(4, 8);
time = list.get(i).substring(8, 12);
picTimeBean.setYear(year);
picTimeBean.setTime(time);
picTimeBean.setDate(moth);
if (!hasmoth.contains(moth))
{
pic_list.add(picTimeBean);
hasmoth.add(moth);
}
}
for (int i = 0; i < pic_list.size(); i++)
{
List<PicTimeInfo> mlsit = new ArrayList<PicTimeInfo>();
for (int j = 0; j < list.size(); j++)
{
moth = list.get(j).substring(4, 8);
year = list.get(j).substring(0, 4);
if (pic_list.get(i).getDate().equals(moth))
{
String newname = list.get(j).substring(0, list.get(j).length() - 4);
String string = new String(newname);
String[] info = string.split("-");
if (info.length == 4)
{
PicTimeInfo picTimeInfo = new PicTimeInfo();
picTimeInfo.setDeviceid(Integer.parseInt(info[3]));
picTimeInfo.setSubfactoryid(Integer.parseInt(info[2]));
picTimeInfo.setFactoryid(Integer.parseInt(info[1]));
picTimeInfo.setPath(playutil.getPath());
picTimeInfo.setTime(info[0]);
picTimeInfo.setName(list.get(j));
mlsit.add(picTimeInfo);
}
}
}
pic_list.get(i).setPaths(mlsit);
}
}
if (pic_list != null && pic_list.size() != 0)
{
for (int i = 0; i < pic_list.size(); i++)
{
if ((pic_list.get(i).getPaths() == null) || (pic_list.get(i).getPaths().size() == 0))
{
pic_list.remove(i);
}
}
}
adapterControl(pic_list);
if (pic_list == null || pic_list.size() == 0)
{
empty_all_pic.setVisibility(View.VISIBLE);
}
else
{
empty_all_pic.setVisibility(View.GONE);
}
}
public PicTimeInfo getPicInfo(int i, PicTimeBean picTimeBean)
{
PicTimeInfo picTimeInfo = new PicTimeInfo();
picTimeInfo.setDealId(picTimeBean.getPaths().get(i).getDealId());
picTimeInfo.setDeviceid(picTimeBean.getPaths().get(i).getDeviceid());
picTimeInfo.setFactoryid(picTimeBean.getPaths().get(i).getFactoryid());
picTimeInfo.setName(picTimeBean.getPaths().get(i).getName());
picTimeInfo.setPath(picTimeBean.getPaths().get(i).getPath());
picTimeInfo.setSubfactoryid(picTimeBean.getPaths().get(i).getFactoryid());
picTimeInfo.setTime(picTimeBean.getPaths().get(i).getTime());
return picTimeInfo;
}
@Override
public void onWindowAttributesChanged(android.view.WindowManager.LayoutParams params)
{
super.onWindowAttributesChanged(params);
}
private void initView()
{
show_pic_fatory = (TextView)findViewById(R.id.show_pic_fatory);
pic_time_line = (ListView)findViewById(R.id.pic_time_line);
go_back = (ImageView)findViewById(R.id.go_back);
top_name = (TextView)findViewById(R.id.top_name);
select_pic = (RelativeLayout)findViewById(R.id.select_pic);
show_fatory_view = (ImageView)findViewById(R.id.show_fatory_view);
empty_all_pic = (ImageView)findViewById(R.id.empty_all_pic);
}
@SuppressWarnings("unchecked")
private void initData()
{
top_name.setText("图片中心");
intent = getIntent();
from = intent.getStringExtra("from");
mlist = (List<FactoryInfo>)intent.getSerializableExtra("factoryBean");
viewBottom = new ViewBottom(this, mlist);
mPopupWindow = new PopupWindow(viewBottom, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, true);
mPopupWindow.setBackgroundDrawable(getResources().getDrawable(R.drawable.actionsheet_top_normal));// 设置背景
mPopupWindow.setTouchable(true);
mPopupWindow.setOutsideTouchable(false);
mPopupWindow.setOnDismissListener(new OnDismissListener()
{
@Override
public void onDismiss()
{
show_fatory_view.setPivotX(show_fatory_view.getWidth() / 2);
show_fatory_view.setPivotY(show_fatory_view.getHeight() / 2);// 支点在图片中心
show_fatory_view.setRotation(0);
}
});
viewBottom.setOnitemClickListener(new OnItemClicListener()
{
@Override
public void getItem(int onePostion, int twoPostion, int threePostion)
{
show_list.clear();
if (onePostion == 0)
{
// 所有厂区的图片
show_list.addAll(pic_list);
show_pic_fatory.setText(mlist.get(onePostion).getFactoryname());
}
else
{
// 指定厂区
if (twoPostion == 0)
{
show_pic_fatory.setText(mlist.get(onePostion).getFactoryname());
// 指定厂 的所有的图片
if (pic_list != null && pic_list.size() != 0)
{
for (int i = 0; i < pic_list.size(); i++)
{
PicTimeBean bean = new PicTimeBean();
bean.setYear(pic_list.get(i).getYear());
bean.setDate(pic_list.get(i).getDate());
if (pic_list.get(i).getPaths() != null && pic_list.get(i).getPaths().size() != 0)
{
List<PicTimeInfo> pic_info = new ArrayList<PicTimeInfo>();
for (int j = 0; j < pic_list.get(i).getPaths().size(); j++)
{
if (mlist.get(onePostion).getFactoryid() == pic_list.get(i).getPaths().get(j).getFactoryid())
{
pic_info.add(pic_list.get(i).getPaths().get(j));
}
}
bean.setPaths(pic_info);
}
show_list.add(bean);
}
}
}
else
{
show_pic_fatory.setText(mlist.get(onePostion).getFactoryname() + "/" + mlist.get(onePostion).getMlist().get(twoPostion - 1).getSubfactoryname());
if (threePostion == 0)
{
// 指定厂 指定厂区的所有设备的图片
if (pic_list != null && pic_list.size() != 0)
{
for (int i = 0; i < pic_list.size(); i++)
{
PicTimeBean bean = new PicTimeBean();
bean.setYear(pic_list.get(i).getYear());
bean.setDate(pic_list.get(i).getDate());
if (pic_list.get(i).getPaths() != null && pic_list.get(i).getPaths().size() != 0)
{
List<PicTimeInfo> pic_info = new ArrayList<PicTimeInfo>();
for (int j = 0; j < pic_list.get(i).getPaths().size(); j++)
{
if (mlist.get(onePostion).getFactoryid() == pic_list.get(i).getPaths().get(j).getFactoryid())
{
if (mlist.get(onePostion).getMlist() != null && mlist.get(onePostion).getMlist().size() != 0)
{
if (mlist.get(onePostion).getMlist().get(twoPostion - 1).getSubfactoryid() == pic_list.get(i).getPaths().get(j).getSubfactoryid())
{
pic_info.add(pic_list.get(i).getPaths().get(j));
}
}
}
}
bean.setPaths(pic_info);
}
show_list.add(bean);
}
}
}
else
{
show_pic_fatory.setText(mlist.get(onePostion).getFactoryname() + "/" + mlist.get(onePostion).getMlist().get(twoPostion - 1).getSubfactoryname() + "/"
+ mlist.get(onePostion).getMlist().get(twoPostion - 1).getMlist_device().get(threePostion - 1).getDevicename());
// 指定厂 指定厂区 指定设备的所有设备的图片
if (pic_list != null && pic_list.size() != 0)
{
for (int i = 0; i < pic_list.size(); i++)
{
PicTimeBean bean = new PicTimeBean();
bean.setYear(pic_list.get(i).getYear());
bean.setDate(pic_list.get(i).getDate());
if (pic_list.get(i).getPaths() != null && pic_list.get(i).getPaths().size() != 0)
{
List<PicTimeInfo> pic_info = new ArrayList<PicTimeInfo>();
for (int j = 0; j < pic_list.get(i).getPaths().size(); j++)
{
if (mlist.get(onePostion).getFactoryid() == pic_list.get(i).getPaths().get(j).getFactoryid())
{
if (mlist.get(onePostion).getMlist() != null && mlist.get(onePostion).getMlist().size() != 0)
{
if (mlist.get(onePostion).getMlist().get(twoPostion - 1).getSubfactoryid() == pic_list.get(i).getPaths().get(j).getSubfactoryid())
{
if (mlist.get(onePostion).getMlist().get(twoPostion - 1).getMlist_device() != null
&& mlist.get(onePostion).getMlist().get(twoPostion - 1).getMlist_device().size() != 0)
{
if (mlist.get(onePostion).getMlist().get(twoPostion - 1).getMlist_device().get(threePostion - 1).getDeviceid() == pic_list.get(i)
.getPaths()
.get(j)
.getDeviceid())
{
pic_info.add(pic_list.get(i).getPaths().get(j));
}
}
}
}
}
}
bean.setPaths(pic_info);
}
show_list.add(bean);
}
}
}
}
}
if (show_list != null && show_list.size() != 0)
{
for (int i = 0; i < show_list.size(); i++)
{
if ((show_list.get(i).getPaths() == null) || (show_list.get(i).getPaths().size() == 0))
{
show_list.remove(i);
i--;
}
}
}
adapterControl(show_list);
// adapter = new LineListAdapter(AllPicActivity.this, show_list, from, intent);
// pic_time_line.setAdapter(adapter);
// adapter.notifyDataSetChanged();
}
@Override
public void lastItem()
{
mPopupWindow.dismiss();
show_fatory_view.setPivotX(show_fatory_view.getWidth() / 2);
show_fatory_view.setPivotY(show_fatory_view.getHeight() / 2);// 支点在图片中心
show_fatory_view.setRotation(0);
}
});
}
public void adapterControl(List<PicTimeBean> list)
{
// 过滤删选 重新排列 不用GridView的原因是 如果使用GridView 由于嵌套在listView中 所以需要重新定义GridView高度
// 导致GridView中的元素 是一下子全部加载的 而不是通过Holder复用 导致占用内存太高 在后面编辑图片时 会出现内存溢出
// 所以改成listview通过复用的关系 可以更好的管理内存
final List<PicTimeBean> show_pic = new ArrayList<PicTimeBean>();
for (PicTimeBean picTimeBean : list)
{
int h = 0;
if (picTimeBean.getPaths().size() > 3)
{
int size = picTimeBean.getPaths().size() % 3 == 0 ? picTimeBean.getPaths().size() / 3 : (picTimeBean.getPaths().size() / 3 + 1);
for (int i = 0; i < size; i++)
{
PicTimeBean picTimeBean2 = new PicTimeBean();
picTimeBean2.setDate(picTimeBean.getDate());
picTimeBean2.setTime(picTimeBean.getTime());
picTimeBean2.setYear(picTimeBean.getYear());
if (h == 0)
{
picTimeBean2.setFirst(true);
}
else
{
picTimeBean2.setFirst(false);
}
h++;
List<PicTimeInfo> mlist_info = new ArrayList<PicTimeInfo>();
if (i * 3 < picTimeBean.getPaths().size())
{
PicTimeInfo picTimeInfo = getPicInfo(i * 3, picTimeBean);
mlist_info.add(picTimeInfo);
}
if ((i * 3 + 1) < picTimeBean.getPaths().size())
{
PicTimeInfo picTimeInfo = getPicInfo(i * 3 + 1, picTimeBean);
mlist_info.add(picTimeInfo);
}
if ((i * 3 + 2) < picTimeBean.getPaths().size())
{
PicTimeInfo picTimeInfo = getPicInfo(i * 3 + 2, picTimeBean);
mlist_info.add(picTimeInfo);
}
picTimeBean2.setPaths(mlist_info);
show_pic.add(picTimeBean2);
}
}
else
{
picTimeBean.setFirst(true);
show_pic.add(picTimeBean);
}
}
adapter = new LineListAdapter(this, show_pic, from, intent);
pic_time_line.setAdapter(adapter);
adapter.notifyDataSetChanged();
adapter.setImageClickListener(new OnCenterPicListener()
{
@Override
public void onClick(int position, int childPosition, String name)
{
for (PicTimeBean picTimeBean : pic_list)
{
for (int i = 0; i < picTimeBean.getPaths().size(); i++)
{
if (name.equals(picTimeBean.getPaths().get(i).getName()))
{
Intent intent = new Intent(AllPicActivity.this, PicCenterActivity.class);
intent.putExtra("picinfo", (Serializable)picTimeBean);
intent.putExtra("postion", i);
startActivity(intent);
break;
}
}
}
}
});
}
private void initListener()
{
go_back.setOnClickListener(this);
select_pic.setOnClickListener(this);
}
@Override
protected void onStop()
{
super.onStop();
GlideCacheUtil.getInstance().clearImageAllCache(this);
}
@Override
protected void onDestroy()
{
super.onDestroy();
GlideCacheUtil.getInstance().clearImageAllCache(this);
}
@Override
public void onClick(View v)
{
switch (v.getId())
{
case R.id.go_back:
finish();
break;
case R.id.select_pic:
mPopupWindow.showAsDropDown(v);
show_fatory_view.setPivotX(show_fatory_view.getWidth() / 2);
show_fatory_view.setPivotY(show_fatory_view.getHeight() / 2);// 支点在图片中心
show_fatory_view.setRotation(180);
break;
default:
break;
}
}
public void animotion()
{
}
}
| [
"773675907@qq.com"
] | 773675907@qq.com |
d11f967250febd805e10eb68e148668d61482210 | 0318c59b15211e2bab73bfe59cb866cd341c15ec | /src/main/java/com/demo/demo/student/StudentConfig.java | 46e2ff0ad8ac35e6822121e59b8579b13ff7a813 | [] | no_license | IsraelZ99/Demo-SpringBoot-JpaRepository | 54f177e15f0ab67682511b26f6d06207105f3bae | e929d82d2de838612c718419b11f1c679f7141b9 | refs/heads/master | 2023-05-07T23:29:14.249214 | 2021-06-01T20:55:37 | 2021-06-01T20:55:37 | 372,959,107 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 712 | java | package com.demo.demo.student;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.time.LocalDate;
import java.util.List;
@Configuration
public class StudentConfig {
@Bean
CommandLineRunner commandLineRunner(StudentRepository repository){
return args -> {
Student israel = new Student("Israel", "israel@hotmail.com", LocalDate.of(1999, 10, 23));
Student monse = new Student("Monse", "monse@hotmail.com", LocalDate.of(1999, 06, 13));
repository.saveAll(
List.of(israel, monse)
);
};
}
}
| [
"israel.garcia@decsef.com"
] | israel.garcia@decsef.com |
b291678540301be99bcc168ccf3a807790406fb4 | 36ced08acd9c78bb05e713e761e7b712c063e576 | /generated/src/org/apache/jsp/Contact_0020Us_jsp.java | cf7228a01445b98d44283e685887f4f3181bf623 | [] | no_license | iamdempa/Vehicle-Service-Centre | bb0253f7e5e5395777c2aadc21b9a3d0865861fb | 06261cb2216427694a0c59029fd835934b1b6a43 | refs/heads/master | 2020-03-15T18:10:19.180724 | 2018-05-05T20:48:33 | 2018-05-05T20:48:33 | 132,277,937 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 31,259 | java | package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
public final class Contact_0020Us_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();
private static java.util.List<String> _jspx_dependants;
private org.glassfish.jsp.api.ResourceInjector _jspx_resourceInjector;
public java.util.List<String> getDependants() {
return _jspx_dependants;
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
response.setContentType("text/html;charset=UTF-8");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
_jspx_resourceInjector = (org.glassfish.jsp.api.ResourceInjector) application.getAttribute("com.sun.appserv.jsp.resource.injector");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("<!DOCTYPE html>\n");
out.write("<html>\n");
out.write(" <head>\n");
out.write(" <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n");
out.write(" <title>Ponja - Contact Us</title>\n");
out.write("\n");
out.write(" <link rel=\"icon\" href=\"images/1.png\">\n");
out.write(" <link rel=\"stylesheet\" type=\"text/css\" href=\"css/bootstrap.css\">\n");
out.write(" <link rel=\"stylesheet\" type=\"text/css\" href=\"css/mdb.css\">\n");
out.write(" <link rel=\"stylesheet\" type=\"text/css\" href=\"css/mdbootstrap.css\">\n");
out.write(" <link rel=\"stylesheet\" href=\"css/font-awesome.css\"> \n");
out.write(" <script type=\"text/javascript\" src=\"js/jquery-3.2.1.min.js\"></script>\n");
out.write("\n");
out.write("\n");
out.write(" <link rel=\"stylesheet\" type=\"text/css\" href=\"css/Homepage/NavigationBar.css\">\n");
out.write(" <link rel=\"stylesheet\" type=\"text/css\" href=\"css/Homepage/carousel.css\">\n");
out.write(" <link rel=\"stylesheet\" type=\"text/css\" href=\"css/Homepage/cards.css\">\n");
out.write("\n");
out.write(" </head>\n");
out.write(" <body>\n");
out.write(" <!--Navbar-->\n");
out.write(" <nav class=\"navbar navbar-expand-lg navigation-bar\">\n");
out.write("\n");
out.write(" <!-- Navbar brand --> \n");
out.write("\n");
out.write(" <img class=\"logo\" alt=\"Brand\" src=\"images/1.png\">\n");
out.write(" <a class=\"navbar-brand\" href=\"Homepage.jsp\">Ponja Vehicle Service Centre</a>\n");
out.write(" <!-- Collapse button -->\n");
out.write(" <button class=\"navbar-toggler\" type=\"button\" data-toggle=\"collapse\" data-target=\"#basicExampleNav\" aria-controls=\"basicExampleNav\"\n");
out.write(" aria-expanded=\"false\" aria-label=\"Toggle navigation\">\n");
out.write(" <span class=\"navbar-toggler-icon\"></span>\n");
out.write(" </button>\n");
out.write("\n");
out.write(" <!-- Collapsible content -->\n");
out.write(" <div class=\"collapse navbar-collapse\" id=\"basicExampleNav\">\n");
out.write("\n");
out.write(" <!-- Links -->\n");
out.write(" <ul class=\"navbar-nav ml-auto\">\n");
out.write(" <li class=\"nav-item active\">\n");
out.write(" <a class=\"nav-link\" href=\"#\">Home\n");
out.write(" <span class=\"sr-only\">(current)</span>\n");
out.write(" </a>\n");
out.write(" </li>\n");
out.write(" <li class=\"nav-item\">\n");
out.write(" <a class=\"nav-link\" href=\"#\">About Us</a>\n");
out.write(" </li>\n");
out.write(" <li class=\"nav-item dropdown\">\n");
out.write(" <a class=\" nav-link dropdown-toggle\" id=\"navbarDropdownMenuLink\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">\n");
out.write(" Services\n");
out.write(" </a>\n");
out.write(" <div class=\"dropdown-menu dropdown-services\" aria-labelledby=\"navbarDropdownMenuLink\"> \n");
out.write(" <a class=\"dropdown-item hvr-sweep-to-top\" href=\"Our Services.html\"> Car Wash</a>\n");
out.write(" <a class=\"dropdown-item hvr-sweep-to-top\" href=\"Our Services.html\"> Auto Detailing</a>\n");
out.write(" <a class=\"dropdown-item hvr-sweep-to-top\" href=\"Our Services.html\"> Lubrication Service</a> \n");
out.write(" <a class=\"dropdown-item hvr-sweep-to-top\" href=\"Our Services.html\"> Wheel Alignment</a> \n");
out.write(" </div>\n");
out.write(" </li>\n");
out.write(" <li class=\"nav-item\">\n");
out.write(" <a class=\"nav-link\" href=\"#\">Book Online</a>\n");
out.write(" </li>\n");
out.write(" <li class=\"nav-item vertical-line\">\n");
out.write(" <a class=\"nav-link\" href=\"#\">Contact Us</a>\n");
out.write(" </li>\n");
out.write(" <li>\n");
out.write(" <span class=\"fa fa-sign-in fa\" aria-hidden=\"true\"></span>\n");
out.write(" </li>\n");
out.write(" <li class=\"nav-item \">\n");
out.write(" <a class=\"nav-link\" href=\"Login.jsp\">Login</a>\n");
out.write(" </li> \n");
out.write(" </ul>\n");
out.write(" <!-- Links --> \n");
out.write(" </div>\n");
out.write(" <!-- Collapsible content -->\n");
out.write(" </nav>\n");
out.write(" <!--/.Navbar-->\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write(" <br>\n");
out.write("\n");
out.write(" <div class=\"jumbotron\">\n");
out.write(" <h1>Contact Us- Our Branch network</h1>\n");
out.write(" <p>Any customers from anywhere around the country can choose between following branches of our Service Centres. We are that spreaded out.</p>\n");
out.write(" <!--<p><a class=\"btn btn-primary btn-lg\" href=\"#\" role=\"button\">Learn more</a></p>-->\n");
out.write(" </div>\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write(" <!-- <div class=\"media\">\n");
out.write(" <div class=\"media-left\">\n");
out.write(" <a href=\"#\">\n");
out.write(" <img class=\"media-object\" src=\"http://via.placeholder.com/64x64\" alt=\"...\">\n");
out.write(" </a>\n");
out.write(" </div>\n");
out.write(" <div class=\"media-body\">\n");
out.write(" <h4 class=\"media-heading\">Attidiya</h4>\n");
out.write(" # 66, Attidiya Road, Ratmalana\n");
out.write(" Tel: 011 5742218 / 001 5766041 \n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" \n");
out.write(" <div class=\"media\">\n");
out.write(" <div class=\"media-left\">\n");
out.write(" <a href=\"#\">\n");
out.write(" <img class=\"media-object\" src=\"http://via.placeholder.com/64x64\" alt=\"...\">\n");
out.write(" </a>\n");
out.write(" </div>\n");
out.write(" <div class=\"media-body\">\n");
out.write(" <h4 class=\"media-heading\">Dematagoda Baseline</h4>\n");
out.write(" # 279,Baseline Rd, Dematagoda \n");
out.write(" Tel: 011-5761414 \n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" \n");
out.write(" <div class=\"media\">\n");
out.write(" <div class=\"media-left\">\n");
out.write(" <a href=\"#\">\n");
out.write(" <img class=\"media-object\" src=\"http://via.placeholder.com/64x64\" alt=\"...\">\n");
out.write(" </a>\n");
out.write(" </div>\n");
out.write(" <div class=\"media-body\">\n");
out.write(" <h4 class=\"media-heading\">Katubedda Ram</h4>\n");
out.write(" # Galle Road, Katubadde, Moratuwa\n");
out.write(" Tel: 011 5232180\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" \n");
out.write(" <div class=\"media\">\n");
out.write(" <div class=\"media-left\">\n");
out.write(" <a href=\"#\">\n");
out.write(" <img class=\"media-object\" src=\"http://via.placeholder.com/64x64\" alt=\"...\">\n");
out.write(" </a>\n");
out.write(" </div>\n");
out.write(" <div class=\"media-body\">\n");
out.write(" <h4 class=\"media-heading\">Maharagama</h4>\n");
out.write(" No.161,Dehiwala Rd, Maharagma.\n");
out.write(" Tel: 011 2850239 / Fax: 011 2850239\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" \n");
out.write(" <div class=\"media\">\n");
out.write(" <div class=\"media-left\">\n");
out.write(" <a href=\"#\">\n");
out.write(" <img class=\"media-object\" src=\"http://via.placeholder.com/64x64\" alt=\"...\">\n");
out.write(" </a>\n");
out.write(" </div>\n");
out.write(" <div class=\"media-body\">\n");
out.write(" <h4 class=\"media-heading\">Charles PL, Moratuwa</h4>\n");
out.write(" # 50, Charles Place, Moratuwa\n");
out.write(" Tel: 011 5555988 / 011 5735540\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" \n");
out.write(" <div class=\"media\">\n");
out.write(" <div class=\"media-left\">\n");
out.write(" <a href=\"#\">\n");
out.write(" <img class=\"media-object\" src=\"http://via.placeholder.com/64x64\" alt=\"...\">\n");
out.write(" </a>\n");
out.write(" </div>\n");
out.write(" <div class=\"media-body\">\n");
out.write(" <h4 class=\"media-heading\">Mt.Lavinia</h4>\n");
out.write(" # 58, Galle Road, Mount Lavinia\n");
out.write(" Tel: 011 5766043 \n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" \n");
out.write(" <div class=\"media\">\n");
out.write(" <div class=\"media-left\">\n");
out.write(" <a href=\"#\">\n");
out.write(" <img class=\"media-object\" src=\"http://via.placeholder.com/64x64\" alt=\"...\">\n");
out.write(" </a>\n");
out.write(" </div>\n");
out.write(" <div class=\"media-body\">\n");
out.write(" <h4 class=\"media-heading\">UKNawala</h4>\n");
out.write(" # 354,Nawala Rd, Rajagiriya\n");
out.write(" Tel: 011 5379061 \n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" \n");
out.write(" <div class=\"media\">\n");
out.write(" <div class=\"media-left\">\n");
out.write(" <a href=\"#\">\n");
out.write(" <img class=\"media-object\" src=\"http://via.placeholder.com/64x64\" alt=\"...\">\n");
out.write(" </a>\n");
out.write(" </div>\n");
out.write(" <div class=\"media-body\">\n");
out.write(" <h4 class=\"media-heading\">Panadura</h4>\n");
out.write(" No 262 , Galle Road, Walana, Panadura\n");
out.write(" Tel: 038 5729999\n");
out.write(" </div>\n");
out.write(" </div>-->\n");
out.write("\n");
out.write(" \n");
out.write("\n");
out.write(" <div class=\"container-fluid\">\n");
out.write(" <div class=\"row\">\n");
out.write(" <div class=\"col-3 col-md-3\">\n");
out.write("\n");
out.write(" <div class=\"card\" style=\"width: 17rem;\">\n");
out.write(" <img class=\"card-img-top\" src=\"http://via.placeholder.com/350x230\" alt=\"Card image cap\">\n");
out.write(" <div class=\"card-body\">\n");
out.write(" <h5 class=\"card-title\">Attidiya</h5>\n");
out.write(" <p class=\"card-text\"># 66, Attidiya Road, Ratmalana\n");
out.write(" Tel: 011 5742218 / 001 5766041 </p>\n");
out.write(" <!--<a href=\"#\" class=\"btn btn-primary\">Body Shop</a>-->\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write("\n");
out.write(" </div>\n");
out.write(" <div class=\"col-3 col-md-3\">\n");
out.write("\n");
out.write(" <div class=\"card\" style=\"width: 17rem;\">\n");
out.write(" <img class=\"card-img-top\" src=\"http://via.placeholder.com/350x230\" alt=\"Card image cap\">\n");
out.write(" <div class=\"card-body\">\n");
out.write(" <h5 class=\"card-title\">Dematagoda Baseline</h5>\n");
out.write(" <p class=\"card-text\"># 279,Baseline Rd, Dematagoda \n");
out.write(" Tel: 011-5761414</p>\n");
out.write(" <!--<a href=\"#\" class=\"btn btn-primary\">Mechanical Unit</a>-->\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write("\n");
out.write(" </div>\n");
out.write(" <div class=\"col-3 col-md-3\">\n");
out.write("\n");
out.write(" <div class=\"card\" style=\"width: 17rem;\">\n");
out.write(" <img class=\"card-img-top\" src=\"http://via.placeholder.com/350x230\" alt=\"Card image cap\">\n");
out.write(" <div class=\"card-body\">\n");
out.write(" <h5 class=\"card-title\">Katubedda Ram</h5>\n");
out.write(" <p class=\"card-text\"># Galle Road, Katubadde, Moratuwa\n");
out.write(" Tel: 011 5232180</p>\n");
out.write(" <!--<a href=\"#\" class=\"btn btn-primary\">Go somewhere</a>-->\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write("\n");
out.write(" </div>\n");
out.write(" <div class=\"col-3 col-md-3\">\n");
out.write("\n");
out.write(" <div class=\"card\" style=\"width: 17rem;\">\n");
out.write(" <img class=\"card-img-top\" src=\"http://via.placeholder.com/350x230\" alt=\"Card image cap\">\n");
out.write(" <div class=\"card-body\">\n");
out.write(" <h5 class=\"card-title\">Maharagama</h5>\n");
out.write(" <p class=\"card-text\">No.161,Dehiwala Rd, Maharagma.\n");
out.write(" Tel: 011 2850239 / Fax: 011 2850239</p>\n");
out.write(" <!--<a href=\"#\" class=\"btn btn-primary\">Go somewhere</a>-->\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write("\n");
out.write(" </div> \n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" <br>\n");
out.write(" <div class=\"container-fluid\">\n");
out.write(" <div class=\"row\">\n");
out.write(" <div class=\"col-3 col-md-3\">\n");
out.write("\n");
out.write(" <div class=\"card\" style=\"width: 17rem;\">\n");
out.write(" <img class=\"card-img-top\" src=\"http://via.placeholder.com/350x230\" alt=\"Card image cap\">\n");
out.write(" <div class=\"card-body\">\n");
out.write(" <h5 class=\"card-title\">Charles PL, Moratuwa</h5>\n");
out.write(" <p class=\"card-text\"># 50, Charles Place, Moratuwa\n");
out.write(" Tel: 011 5555988 / 011 5735540</p>\n");
out.write(" <!--<a href=\"#\" class=\"btn btn-primary\">Body Shop</a>-->\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write("\n");
out.write(" </div>\n");
out.write(" <div class=\"col-3 col-md-3\">\n");
out.write("\n");
out.write(" <div class=\"card\" style=\"width: 17rem;\">\n");
out.write(" <img class=\"card-img-top\" src=\"http://via.placeholder.com/350x230\" alt=\"Card image cap\">\n");
out.write(" <div class=\"card-body\">\n");
out.write(" <h5 class=\"card-title\">Mt.Lavinia</h5> \n");
out.write(" <p class=\"card-text\"># 58, Galle Road, Mount Lavinia\n");
out.write(" Tel: 011 5766043 </p>\n");
out.write(" <!--<a href=\"#\" class=\"btn btn-primary\">Mechanical Unit</a>-->\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write("\n");
out.write(" </div>\n");
out.write(" <div class=\"col-3 col-md-3\">\n");
out.write("\n");
out.write(" <div class=\"card\" style=\"width: 17rem;\">\n");
out.write(" <img class=\"card-img-top\" src=\"http://via.placeholder.com/350x230\" alt=\"Card image cap\">\n");
out.write(" <div class=\"card-body\">\n");
out.write(" <h5 class=\"card-title\">UKNawala</h5>\n");
out.write(" <p class=\"card-text\"># 354,Nawala Rd, Rajagiriya\n");
out.write(" Tel: 011 5379061</p>\n");
out.write(" <!--<a href=\"#\" class=\"btn btn-primary\">Go somewhere</a>-->\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write("\n");
out.write(" </div>\n");
out.write(" <div class=\"col-3 col-md-3\">\n");
out.write("\n");
out.write(" <div class=\"card\" style=\"width: 17rem;\">\n");
out.write(" <img class=\"card-img-top\" src=\"http://via.placeholder.com/350x230\" alt=\"Card image cap\">\n");
out.write(" <div class=\"card-body\">\n");
out.write(" <h5 class=\"card-title\">Panadura</h5>\n");
out.write(" <p class=\"card-text\">No 262 , Galle Road, Walana, Panadura\n");
out.write(" Tel: 038 5729999</p>\n");
out.write(" <!--<a href=\"#\" class=\"btn btn-primary\">Go somewhere</a>-->\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write("\n");
out.write(" </div> \n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write(" <!--==========================================-->\n");
out.write(" <!--Footer-->\n");
out.write(" <!--==========================================-->\n");
out.write(" <footer class=\"page-footer stylish-color-dark\">\n");
out.write("\n");
out.write(" <!--Footer Links-->\n");
out.write(" <div class=\"container\">\n");
out.write("\n");
out.write(" <!-- Footer links -->\n");
out.write(" <div class=\"row text-center text-md-left mt-3 pb-3\">\n");
out.write("\n");
out.write(" <!--First column-->\n");
out.write(" <div class=\"col-md-3 col-lg-3 col-xl-3 mx-auto mt-3\">\n");
out.write(" <h6 class=\"title mb-4 font-bold\">Ponja Vehicle Service Center</h6>\n");
out.write(" <p>Ponja the total auto care specialists commenced to offer total auto care solutions in 1994 and continues to believe every customer is a valuable business partner.</p>\n");
out.write(" </div>\n");
out.write(" <!--/.First column-->\n");
out.write("\n");
out.write(" <hr class=\"w-100 clearfix d-md-none\">\n");
out.write("\n");
out.write(" <!--Second column-->\n");
out.write(" <div class=\"col-md-2 col-lg-2 col-xl-2 mx-auto mt-3\">\n");
out.write(" <h6 class=\"title mb-4 font-bold\">Packages</h6>\n");
out.write(" <p><a href=\"#!\">Car Wash Packages</a></p>\n");
out.write(" <p><a href=\"#!\">Full Lubrication Service Packages</a></p>\n");
out.write(" <p><a href=\"#!\">Auto Detailing Packages</a></p>\n");
out.write(" <!--<p><a href=\"#!\">Customer Delight Services</a></p>-->\n");
out.write(" </div>\n");
out.write(" <!--/.Second column-->\n");
out.write("\n");
out.write(" <hr class=\"w-100 clearfix d-md-none\">\n");
out.write("\n");
out.write(" <!--Third column-->\n");
out.write(" <div class=\"col-md-3 col-lg-2 col-xl-2 mx-auto mt-3\">\n");
out.write(" <h6 class=\"title mb-4 font-bold\">Useful links</h6>\n");
out.write(" <p><a href=\"#!\">About Us</a></p>\n");
out.write(" <p><a href=\"#!\">Services</a></p>\n");
out.write(" <p><a href=\"#!\">Book Online</a></p>\n");
out.write(" <!--<p><a href=\"#!\">Help</a></p>-->\n");
out.write(" </div>\n");
out.write(" <!--/.Third column-->\n");
out.write("\n");
out.write(" <hr class=\"w-100 clearfix d-md-none\">\n");
out.write("\n");
out.write(" <!--Fourth column-->\n");
out.write(" <div class=\"col-md-4 col-lg-3 col-xl-3 mx-auto mt-3\">\n");
out.write(" <h6 class=\"title mb-4 font-bold\">Contact</h6>\n");
out.write(" <p><i class=\"fa fa-home mr-3\"></i> Pasan Mw, Welivita Rd, Malabe.</p>\n");
out.write(" <a data-toggle=\"modal\" data-target=\"#emailUs\" id=\"email-modal-trigger-btn\" ><p><i class=\"fa fa-envelope mr-3\"></i> info@ponja.lk</p></a>\n");
out.write(" <!--<p><i class=\"fa fa-home mr-3\"></i> <button type=\"button\" class=\"btn btn-outline-white btn-sm\" data-toggle=\"modal\" data-target=\"#emailUs\">info@example.com</button></p>-->\n");
out.write(" <!--<button type=\"button\" class=\"btn btn-outline-blue btn-sm\" ><i class=\"fa fa-envelope mr-3\"></i>info@example.com</button>-->\n");
out.write(" <p><i class=\"fa fa-phone mr-3\"></i> + 94 234 567 88</p></a\n");
out.write(" <p><i class=\"fa fa-print mr-3\"></i> + 94 234 567 89</p> \n");
out.write(" </div>\n");
out.write(" <!--/.Fourth column-->\n");
out.write("\n");
out.write(" </div>\n");
out.write(" <!-- Footer links -->\n");
out.write("\n");
out.write(" <hr>\n");
out.write("\n");
out.write(" <div class=\"row py-3 d-flex align-items-center\">\n");
out.write("\n");
out.write(" <!--Grid column-->\n");
out.write(" <div class=\"col-md-8 col-lg-9\">\n");
out.write("\n");
out.write(" <!--Copyright-->\n");
out.write(" <p class=\"text-center text-md-left grey-text\">© 2018 Copyright: <a href=\"Homepage.jsp\"><strong> www.ponjavehicleservice.lk</strong></a></p>\n");
out.write(" <!--/.Copyright-->\n");
out.write("\n");
out.write(" </div>\n");
out.write(" <!--Grid column-->\n");
out.write("\n");
out.write(" <!--Grid column-->\n");
out.write(" <div class=\"col-md-4 col-lg-3 ml-lg-0\">\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write(" </div>\n");
out.write(" <!--Grid column-->\n");
out.write("\n");
out.write(" </div>\n");
out.write("\n");
out.write(" </div>\n");
out.write("\n");
out.write(" </footer>\n");
out.write(" <!--==========================================-->\n");
out.write(" <!--End of Footer-->\n");
out.write(" <!--==========================================-->\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write(" <script>\n");
out.write(" $(document).ready(function () {\n");
out.write(" $(\"#button\").click(function () {\n");
out.write(" $('html, body').animate({\n");
out.write(" scrollTop: $(\"#myCarousel\").offset().top\n");
out.write(" }, 500);\n");
out.write(" });\n");
out.write(" });\n");
out.write(" </script> \n");
out.write("\n");
out.write(" <!-- JQuery -->\n");
out.write(" <script type=\"text/javascript\" src=\"js/jquery-3.2.1.min.js\"></script> \n");
out.write(" <!-- Bootstrap core JavaScript -->\n");
out.write(" <script type=\"text/javascript\" src=\"js/bootstrap.js\"></script>\n");
out.write(" <!-- MDB core JavaScript -->\n");
out.write(" <script type=\"text/javascript\" src=\"js/mdb.min.js\"></script>\n");
out.write("\n");
out.write(" <!--==========================================-->\n");
out.write(" <!--End of carousel-->\n");
out.write(" <!--==========================================-->\n");
out.write("\n");
out.write(" </body>\n");
out.write("</html>\n");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
else throw new ServletException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
| [
"noreply@github.com"
] | noreply@github.com |
9e38155c48908ff35f833820b306c919b46a2669 | cccd83fe61ce3473be8c4e0e9a3f8e82d5c93a41 | /src/cn/yunzhisheng/vui/assistant/SettingActivity.java | 229d5983bd6541194789b025c06cb68fa66dc47a | [] | no_license | yourk/vui_car_assistant_2.0 | 33c02a6672586208f1f09e1fadfbd97b3fc25059 | a600e389c64c8a152561084a57c0d3bce4ba492b | refs/heads/master | 2016-09-07T18:48:01.585822 | 2015-08-19T10:47:36 | 2015-08-19T10:47:36 | 41,028,444 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,430 | java | package cn.yunzhisheng.vui.assistant;
import cn.yunzhisheng.common.util.LogUtil;
import cn.yunzhisheng.vui.assistant.SettingFragment.SettingFragmentListener;
import com.ilincar.voice.R;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentTransaction;
public class SettingActivity extends FragmentActivity {
private String TAG = "SettingActivity";
public SettingActivity() {
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_setting);
FragmentTransaction transaction = this.getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.fragment, new SettingFragment(mSettingFragmentListener));
transaction.addToBackStack(null);
transaction.commit();
}
SettingFragmentListener mSettingFragmentListener = new SettingFragmentListener() {
@Override
public void onClickBtn(int btnId) {
LogUtil.d(TAG, "onClickReturnBtn");
switch (btnId) {
case R.id.setting_return:
finish();
break;
case R.id.setting_help:
Intent intent = new Intent(SettingActivity.this,
HelpActivity.class);
startActivity(intent);
break;
default:
break;
}
};
};
@Override
public void onBackPressed() {
finish();
}
}
| [
"839514320@qq.com"
] | 839514320@qq.com |
866cdc82380fa50a515030716b6159c4bee4520c | 377a53687e79f173ccfbcc7a8664f813f65d12f8 | /src/main/java/br/com/project/repository/CustomAuditEventRepository.java | 8f3014538e5cde39921048976a5714668bb6c51f | [
"MIT"
] | permissive | ArmandoFGNeto/classmanager | ef7e448cb76e7f2e61f67977d868248d45b826d5 | 816f3e9c5fd41fdf942b1367b51755782225a8b7 | refs/heads/master | 2022-12-21T23:43:50.147740 | 2019-09-18T13:28:26 | 2019-09-18T13:35:40 | 209,315,273 | 0 | 0 | MIT | 2022-12-16T05:05:45 | 2019-09-18T13:26:55 | Java | UTF-8 | Java | false | false | 3,600 | java | package br.com.project.repository;
import br.com.project.config.Constants;
import br.com.project.config.audit.AuditEventConverter;
import br.com.project.domain.PersistentAuditEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.actuate.audit.AuditEvent;
import org.springframework.boot.actuate.audit.AuditEventRepository;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.time.Instant;
import java.util.*;
/**
* An implementation of Spring Boot's {@link AuditEventRepository}.
*/
@Repository
public class CustomAuditEventRepository implements AuditEventRepository {
private static final String AUTHORIZATION_FAILURE = "AUTHORIZATION_FAILURE";
/**
* Should be the same as in Liquibase migration.
*/
protected static final int EVENT_DATA_COLUMN_MAX_LENGTH = 255;
private final PersistenceAuditEventRepository persistenceAuditEventRepository;
private final AuditEventConverter auditEventConverter;
private final Logger log = LoggerFactory.getLogger(getClass());
public CustomAuditEventRepository(PersistenceAuditEventRepository persistenceAuditEventRepository,
AuditEventConverter auditEventConverter) {
this.persistenceAuditEventRepository = persistenceAuditEventRepository;
this.auditEventConverter = auditEventConverter;
}
@Override
public List<AuditEvent> find(String principal, Instant after, String type) {
Iterable<PersistentAuditEvent> persistentAuditEvents =
persistenceAuditEventRepository.findByPrincipalAndAuditEventDateAfterAndAuditEventType(principal, after, type);
return auditEventConverter.convertToAuditEvent(persistentAuditEvents);
}
@Override
@Transactional(propagation = Propagation.REQUIRES_NEW)
public void add(AuditEvent event) {
if (!AUTHORIZATION_FAILURE.equals(event.getType()) &&
!Constants.ANONYMOUS_USER.equals(event.getPrincipal())) {
PersistentAuditEvent persistentAuditEvent = new PersistentAuditEvent();
persistentAuditEvent.setPrincipal(event.getPrincipal());
persistentAuditEvent.setAuditEventType(event.getType());
persistentAuditEvent.setAuditEventDate(event.getTimestamp());
Map<String, String> eventData = auditEventConverter.convertDataToStrings(event.getData());
persistentAuditEvent.setData(truncate(eventData));
persistenceAuditEventRepository.save(persistentAuditEvent);
}
}
/**
* Truncate event data that might exceed column length.
*/
private Map<String, String> truncate(Map<String, String> data) {
Map<String, String> results = new HashMap<>();
if (data != null) {
for (Map.Entry<String, String> entry : data.entrySet()) {
String value = entry.getValue();
if (value != null) {
int length = value.length();
if (length > EVENT_DATA_COLUMN_MAX_LENGTH) {
value = value.substring(0, EVENT_DATA_COLUMN_MAX_LENGTH);
log.warn("Event data for {} too long ({}) has been truncated to {}. Consider increasing column width.",
entry.getKey(), length, EVENT_DATA_COLUMN_MAX_LENGTH);
}
}
results.put(entry.getKey(), value);
}
}
return results;
}
}
| [
"armando.ferraz@inatel.br"
] | armando.ferraz@inatel.br |
a4112950970fd98051d10b11be084442b6e2c324 | b1e52d855b23ec3ca27e43576ade391359311a5d | /admin/src/main/java/com/mj/admin/AdminApplication.java | a37624613909159190fc0e94c0c3c2945cd6924a | [] | no_license | shikaizhong/mj-admin | 280a6b2af208b1a0ac7f6314d4d988f919f16e99 | fadfbf7ef278db87c68f443711600244d09e0415 | refs/heads/master | 2022-12-22T11:36:45.458132 | 2019-09-24T05:49:47 | 2019-09-24T05:49:47 | 203,763,807 | 0 | 0 | null | 2022-12-10T04:50:17 | 2019-08-22T09:44:10 | Java | UTF-8 | Java | false | false | 1,622 | java | package com.mj.admin;
import com.github.pagehelper.PageHelper;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import java.util.Properties;
//@Import({DynamicDataSourceRegister.class})
@SpringBootApplication
//@SpringBootApplication(scanBasePackages = {"com.mj"},exclude = DataSourceAutoConfiguration.class)
@MapperScan(value = "com.mj.dao.repository")
//public class AdminApplication extends SpringBootServletInitializer {
public class AdminApplication{
// @Bean
// public DynamicDataSourceAnnotationAdvisor dynamicDatasourceAnnotationAdvisor() {
// return new DynamicDataSourceAnnotationAdvisor(new DynamicDataSourceAnnotationInterceptor());
// }
@Bean
public PageHelper pageHelper() {
PageHelper pageHelper = new PageHelper();
Properties properties = new Properties();
properties.setProperty("offsetAsPageNum", "true");
properties.setProperty("rowBoundsWithCount", "true");
properties.setProperty("reasonable", "true");
properties.setProperty("dialect", "mysql");
pageHelper.setProperties(properties);
return pageHelper;
}
public static void main(String[] args) {
SpringApplication.run(AdminApplication.class, args);
}
// @Override
// protected SpringApplicationBuilder configure(SpringApplicationBuilder builder){
// return builder.sources(AdminApplication.class);
// }
}
| [
"1987442058@qq.com"
] | 1987442058@qq.com |
7637b4312304c8d77ba13667ef963e480d12f736 | f4849e780268e15e8b428f5dd444170ae8f141c5 | /src/main/java/de/unidue/inf/is/AnimalServlet.java | 61431caa8efa6252c98c1ca18628343a4e62a5c0 | [] | no_license | dbp010/block3 | 7062437f4c79656cab166c5327b2c02de238b406 | cb63ecc022cdae029243d14e1ad3c634ded364c5 | refs/heads/master | 2021-01-11T23:04:29.153630 | 2017-02-05T17:30:44 | 2017-02-05T17:30:44 | 78,544,267 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 991 | java | package de.unidue.inf.is;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import de.unidue.inf.is.dbp010.db.GOTDB2PersistenceManager;
import de.unidue.inf.is.dbp010.db.GOTDB2PersistenceManager.Entity;
import de.unidue.inf.is.dbp010.db.entity.Animal;
import de.unidue.inf.is.dbp010.db.util.RatingLink.RatingType;
public class AnimalServlet extends AGoTServlet {
public AnimalServlet() {
super("animal.ftl");
}
private static final long serialVersionUID = 1L;
@Override
protected void appendAttributes(GOTDB2PersistenceManager pm, HttpServletRequest req, HttpServletResponse resp)
throws IOException, ServletException {
Animal animal = (Animal) loadEntity(req, "cid", Entity.animal, pm);
if(animal != null) {
addRatingAttributes(RatingType.character, animal.getCid(), pm, req, resp);
}
req.setAttribute("animal", animal);
}
} | [
"lubuntu-nb@lubuntu-nb"
] | lubuntu-nb@lubuntu-nb |
9c3823893e2c9adc8092197ff7063b5e5d8bbbbc | 928df089b81a1ca07470da08d34cb15c34a4387f | /src/com/eachedu/dict/OrderStatus.java | d704ad62e28d0567ed78491b5a490e8dc88efd58 | [] | no_license | mslfifa/eachedu | 6f9d87a2ba189e111c8eeaed3fda7c1eb5af9f3d | d627b725432c7eecc9fc7604f393713880f6dcb1 | refs/heads/master | 2021-01-10T22:28:53.529387 | 2015-08-04T03:48:52 | 2015-08-04T03:48:52 | 39,002,701 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 233 | java | package com.eachedu.dict;
/**
* 订单状态
* @author Administrator
*
*/
public enum OrderStatus {
//交易申请
TRADE_APPLY,
//交易成功
TRADE_SUCCESS,
//: 交易失败
TRADE_FAIL,
//交易关闭
TRADE_CLOSED
}
| [
"mslfifa@163.com"
] | mslfifa@163.com |
d6ceb2f4d53e333ca42ac82c6022e2102dbbcec9 | 7a6ac9a07866f40753c873357da42ad40608d5f5 | /src/main/java/com/kveola/cb/warmupOne/PrintEveryX.java | 466776c328bf71b070941f5e87398bbebce16a44 | [] | no_license | kveola13/java-tutorials | 06401aecb7bda55738f450c63b6b05325e7bca3c | 2935d8d27a780980ea333633325f3bb950027c2c | refs/heads/master | 2023-05-10T16:48:31.602063 | 2023-05-03T08:43:31 | 2023-05-03T08:43:31 | 204,342,247 | 0 | 1 | null | 2023-05-03T08:43:32 | 2019-08-25T19:46:50 | Java | UTF-8 | Java | false | false | 366 | java | package com.kveola.cb.warmupOne;
public class PrintEveryX {
public static String everyNth(String str, int n) {
StringBuilder returnStr = new StringBuilder();
for (int i = 0; i < str.length(); i++) {
if(i % n == 0){
returnStr.append(str.charAt(i));
}
}
return returnStr.toString();
}
}
| [
"kveola13@student.westerdals.no"
] | kveola13@student.westerdals.no |
9e6764f7fd49c98f4e5f3eeeeb90a46f01b915c3 | f1f2b8cf236d53a002abe5ca21e85d2b24d47f31 | /app/src/main/java/activities/BillsListActivity.java | e021458aac60631803292a0cbeffcc83041a4965 | [] | no_license | MrBohdan/Android-expense-tracker-app | 93f95a188867e5a0b94796823c0cd858c6b67876 | 31f46c55ac9ba0c27a8fdcdecfaf16237a16f789 | refs/heads/master | 2020-06-29T09:04:55.200559 | 2019-10-04T20:19:40 | 2019-10-04T20:19:40 | 200,494,462 | 7 | 0 | null | null | null | null | UTF-8 | Java | false | false | 20,062 | java | package activities;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.TextInputEditText;
import android.support.design.widget.TextInputLayout;
import android.support.v7.widget.helper.ItemTouchHelper;
import com.aru.expapp.R;
import validation.InputValidation;
import adapters.BillAdapter;
import adapters.CategorySelectAdapter;
import adapters.NothingSelectedSpinnerAdapter;
import android.app.DatePickerDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.*;
import android.util.Log;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.*;
import controllers.NumberTextController;
import controllers.SwipeController;
import controllers.SwipeControllerActions;
import database.DBcatch;
import global.GlobalProperties;
import models.Bills;
import models.Category;
import java.text.SimpleDateFormat;
import java.util.*;
public class BillsListActivity extends AppCompatActivity {
final Calendar myCalendar = Calendar.getInstance();
final Context context = this;
private RecyclerView recyclerViewBills;
private TextInputEditText textInputEditTextDate;
private AppCompatActivity activity = BillsListActivity.this;
private TextInputLayout textInputLayoutAmount;
private TextInputLayout textInputLayoutDescription;
private TextInputLayout textInputLayoutDate;
private TextInputLayout textInputLayoutCompany;
private TextInputLayout textInputLayoutCategory;
private AppCompatButton appCompatButtonModify;
private TextInputEditText textInputEditTextAmount;
private TextInputEditText textInputEditTextDescription;
private TextInputEditText textInputEditTextCompany;
private Spinner textInputEditTextCategory;
private AppCompatTextView appCompatTextViewCancelLink;
private AppCompatButton appCompatButtonAdd;
SwipeController swipeController = null;
private Dialog dialog;
private InputValidation inputValidation;
private BillAdapter billAdapter;
private DBcatch dbCatch;
private List<Bills> listBills;
private Category category;
private Bills bills;
private String getTextAmount;
private String refactorAmount;
private List<Category> categoryList;
private CategorySelectAdapter categorySelectAdapter;
private FloatingActionButton floatingActionButton;
private int user_id, bill_ID;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_billing_list);
getSupportActionBar().setTitle("");
floatingActionButton =
(FloatingActionButton) findViewById(R.id.fab);
callDialog();
initViews();
initObjects();
}
private void callDialog() {
floatingActionButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
dialog = new Dialog(context);
dialog.setContentView(R.layout.activity_popup_bill);
dialog.setTitle("Add Bill");
//-
initDialogViews();
//create an adapters to describe how the items are displayed, adapters are used in several places in android.
ArrayAdapter<Category> adapter = new ArrayAdapter<>(getApplicationContext(), R.layout.contact_spinner_row_nothing_selected, categoryList);
//set the spinners adapters to the previously created one.'
textInputEditTextCategory.setAdapter(
new NothingSelectedSpinnerAdapter(
adapter,
R.layout.contact_spinner_row_nothing_selected,
BillsListActivity.this));
final DatePickerDialog.OnDateSetListener date = new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker view, int year, int monthOfYear,
int dayOfMonth) {
// TODO Auto-generated method stub
myCalendar.set(Calendar.YEAR, year);
myCalendar.set(Calendar.MONTH, monthOfYear);
myCalendar.set(Calendar.DAY_OF_MONTH, dayOfMonth);
updateLabel();
}
};
textInputEditTextDate.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
new DatePickerDialog(BillsListActivity.this, R.style.DialogTheme, date, myCalendar
.get(Calendar.YEAR), myCalendar.get(Calendar.MONTH),
myCalendar.get(Calendar.DAY_OF_MONTH)).show();
}
});
//to make layout behind routed corners transparent
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
// if button is clicked, close the custom dialog
appCompatButtonAdd.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
postDataToSQLite();
}
});
// if button is clicked, close the custom dialog
appCompatTextViewCancelLink.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
dialog.show();
}
});
}
private void initDialogViews() {
// initViews of popup
appCompatButtonModify = (AppCompatButton) dialog.findViewById(R.id.appCompatButtonModify);
textInputLayoutAmount = (TextInputLayout) dialog.findViewById(R.id.textInputLayoutAmount);
textInputLayoutDescription = (TextInputLayout) dialog.findViewById(R.id.textInputLayoutDescription);
textInputLayoutDate = (TextInputLayout) dialog.findViewById(R.id.textInputLayoutDate);
textInputLayoutCompany = (TextInputLayout) dialog.findViewById(R.id.textInputLayoutCompany);
textInputLayoutCategory = (TextInputLayout) dialog.findViewById(R.id.textInputLayoutCategory);
textInputEditTextAmount = (TextInputEditText) dialog.findViewById(R.id.textInputEditTextAmount);
textInputEditTextAmount.addTextChangedListener(new NumberTextController(textInputEditTextAmount, "#,###.##"));
textInputEditTextDescription = (TextInputEditText) dialog.findViewById(R.id.textInputEditTextDescription);
textInputEditTextDate = (TextInputEditText) dialog.findViewById(R.id.textInputEditTextDate);
textInputEditTextCompany = (TextInputEditText) dialog.findViewById(R.id.textInputEditTextCompany);
textInputEditTextCategory = (Spinner) dialog.findViewById(R.id.textInputEditTextCategory);
appCompatButtonAdd = (AppCompatButton) dialog.findViewById(R.id.appCompatButtonAdd);
appCompatTextViewCancelLink = (AppCompatTextView) dialog.findViewById(R.id.appCompatTextViewCancelLink);
}
private void updateLabel() {
String myFormat = "dd/MM/yy";
SimpleDateFormat sdf = new SimpleDateFormat(myFormat, Locale.UK);
textInputEditTextDate.setText(sdf.format(myCalendar.getTime()));
}
/**
* This method is to initialize views
*/
private void initViews() {
recyclerViewBills = (RecyclerView) findViewById(R.id.recyclerViewBills);
}
/**
* This method is to initialize objects to be used
*/
private void initObjects() {
inputValidation = new InputValidation(activity);
dbCatch = new DBcatch(activity);
listBills = new ArrayList<>();
billAdapter = new BillAdapter(listBills);
categoryList = new ArrayList<>();
categorySelectAdapter = new CategorySelectAdapter(categoryList);
category = new Category();
bills = new Bills();
user_id = ((GlobalProperties) this.getApplication()).getUserTokenVariable();
RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(getApplicationContext());
recyclerViewBills.setLayoutManager(mLayoutManager);
recyclerViewBills.setHasFixedSize(true);
recyclerViewBills.setItemAnimator(new DefaultItemAnimator());
recyclerViewBills.smoothScrollToPosition(0);
recyclerViewBills.setAdapter(billAdapter);
billAdapter.notifyItemInserted(0);
recyclerViewBills.scrollToPosition(0);
recyclerViewBills.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
if (dy > 0 && floatingActionButton.getVisibility() == View.VISIBLE) {
floatingActionButton.hide();
} else if (dy < 0 && floatingActionButton.getVisibility() != View.VISIBLE) {
floatingActionButton.show();
}
}
});
//attach Controller to RecyclerViewBills
swipeController = new SwipeController(new SwipeControllerActions() {
@Override
public void onRightClicked(int position) {
DBcatch dbCatch = new DBcatch(BillsListActivity.this);
dbCatch.deleteBill(listBills.get(position).getId());
listBills.remove(position);
billAdapter.notifyItemRemoved(position);
billAdapter.notifyItemRangeChanged(position, billAdapter.getItemCount());
}
@Override
public void onLeftClicked(int position) {
dialog = new Dialog(context);
dialog.setContentView(R.layout.activity_popup_edit_bill);
dialog.setTitle("Edit Bill");
//-
ArrayList<Bills> getBill = dbCatch.getBillByID(listBills.get(position).getId());
initDialogViews();
for (Bills b : getBill) {
Log.d("GET BILL", "The bills extracted bill " + String.valueOf(getBill.size()));
Log.d("GET BILL", "Amount" + String.valueOf(b.getAmount()) + " /Description " + b.getDescription()
+ " /Date" + b.getDateString() + " /Company name" + b.getCompany_name() + " /Category" + b.getCategory() + b.getId());
bill_ID = listBills.get(position).getId();
//textInputEditTextAmount.addTextChangedListener(new NumberTextController(textInputEditTextAmount, "#,###.##"));
textInputEditTextAmount.setText(String.valueOf(b.getAmount()));
textInputEditTextDescription.setText(b.getDescription());
textInputEditTextDate.setText(b.getDateString());
textInputEditTextCompany.setText(b.getCompany_name());
ArrayAdapter<Category> adapter1 = new ArrayAdapter<>(getApplicationContext(), R.layout.contact_spinner_row_nothing_selected, categoryList);
//set the spinners adapters to the previously created one.'
textInputEditTextCategory.setAdapter(
new NothingSelectedSpinnerAdapter(
adapter1,
R.layout.contact_spinner_row_nothing_selected,
BillsListActivity.this));
appCompatButtonModify.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
modifyDataInSQLite();
}
});
}
final DatePickerDialog.OnDateSetListener date = new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker view, int year, int monthOfYear,
int dayOfMonth) {
// TODO Auto-generated method stub
myCalendar.set(Calendar.YEAR, year);
myCalendar.set(Calendar.MONTH, monthOfYear);
myCalendar.set(Calendar.DAY_OF_MONTH, dayOfMonth);
updateLabel();
}
};
textInputEditTextDate.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
new DatePickerDialog(BillsListActivity.this, R.style.DialogTheme, date, myCalendar
.get(Calendar.YEAR), myCalendar.get(Calendar.MONTH),
myCalendar.get(Calendar.DAY_OF_MONTH)).show();
}
});
//to make layout behind routed corners transparent
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
// if button is clicked, close the custom dialog
// if button is clicked, close the custom dialog
appCompatTextViewCancelLink.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
dialog.show();
}
});
ItemTouchHelper itemTouchhelper = new ItemTouchHelper(swipeController);
itemTouchhelper.attachToRecyclerView(recyclerViewBills);
recyclerViewBills.addItemDecoration(new RecyclerView.ItemDecoration() {
@Override
public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) {
swipeController.onDrawBothButton(c);
}
});
getBillsFromSQLite();
getCategoryFromSQLite();
}
@Override
public void onBackPressed() {
Intent intentUserInter = new Intent(getApplicationContext(), HomeActivity.class);
startActivity(intentUserInter);
}
/**
* This method is to validate the input text fields and post data to SQLite
*/
private void postDataToSQLite() {
if (!inputValidation.isInputEditTextFilled(textInputEditTextAmount, textInputLayoutAmount, getString(R.string.error_empty_amount))) {
return;
}
if (!inputValidation.isInputEditTextFilled(textInputEditTextDate, textInputLayoutDate, getString(R.string.error_empty_date))) {
return;
}
if (textInputEditTextCategory.getSelectedItem() == null) {
Toast toast = Toast.makeText(BillsListActivity.this, getString(R.string.error_empty_category), Toast.LENGTH_SHORT);
toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
ViewGroup group = (ViewGroup) toast.getView();
TextView messageTextView = (TextView) group.getChildAt(0);
messageTextView.setTextSize(20);
toast.show();
return;
}
bills.setUserID(user_id);
bills.setDescription(textInputEditTextDescription.getText().toString().trim());
getTextAmount = textInputEditTextAmount.getText().toString();
refactorAmount = getTextAmount.replaceAll("[$,.\\s+]", "");
float convertStringToInt = Float.parseFloat(refactorAmount);
float convert = convertStringToInt / 100;
String refactor_Amount = Float.toString(convert);
bills.setAmount(Float.parseFloat(refactor_Amount));
bills.setDateString(textInputEditTextDate.getText().toString().trim());
bills.setCompany_name(textInputEditTextCompany.getText().toString().trim());
bills.setCategory(textInputEditTextCategory.getSelectedItem().toString().trim());
dbCatch.addBill(bills);
Intent intentUserInter = new Intent(getApplicationContext(), BillsListActivity.class);
startActivity(intentUserInter);
}
private void modifyDataInSQLite() {
if (!inputValidation.isInputEditTextFilled(textInputEditTextAmount, textInputLayoutAmount, getString(R.string.error_empty_amount))) {
return;
}if (!inputValidation.isInputEditTextFilled(textInputEditTextDate, textInputLayoutDate, getString(R.string.error_empty_date))) {
return;
}if (textInputEditTextCategory.getSelectedItem() == null){
Toast toast = Toast.makeText(BillsListActivity.this, getString(R.string.error_empty_category), Toast.LENGTH_SHORT);
toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
ViewGroup group = (ViewGroup) toast.getView();
TextView messageTextView = (TextView) group.getChildAt(0);
messageTextView.setTextSize(20);
toast.show();
return;
}
bills.setId(bill_ID);
bills.setUserID(user_id);
bills.setDescription(textInputEditTextDescription.getText().toString().trim());
getTextAmount = textInputEditTextAmount.getText().toString();
refactorAmount = getTextAmount.replaceAll("[$,.\\s+]", "");
float convertStringToInt = Float.parseFloat(refactorAmount);
float convert = convertStringToInt / 10;
String refactor_Amount = Float.toString(convert);
bills.setAmount(Float.parseFloat(refactor_Amount));
bills.setDateString(textInputEditTextDate.getText().toString().trim());
bills.setCompany_name(textInputEditTextCompany.getText().toString().trim());
bills.setCategory(textInputEditTextCategory.getSelectedItem().toString().trim());
dbCatch.updateBill(bills);
Intent intentUserInter = new Intent(getApplicationContext(), BillsListActivity.class);
startActivity(intentUserInter);
}
/**
* This method is to fetch all user records from SQLite
*/
private void getCategoryFromSQLite() {
// AsyncTask is used that SQLite operation not blocks the UI Thread.
new AsyncTask<Void, Void, Void>() {
@Override
protected Void doInBackground(Void... params) {
categoryList.clear();
categoryList.addAll(dbCatch.getCategoriesByUserID(user_id));
return null;
}
@Override
protected void onPostExecute(Void aVoid) {
super.onPostExecute(aVoid);
}
}.execute();
}
private void getBillsFromSQLite() {
// AsyncTask is used that SQLite operation not blocks the UI Thread.
new AsyncTask<Void, Void, Void>() {
@Override
protected Void doInBackground(Void... params) {
listBills.clear();
listBills.addAll(dbCatch.getBillsByUserID(user_id));
Collections.reverse(listBills);
billAdapter.notifyItemInserted(0);
return null;
}
@Override
protected void onPostExecute(Void aVoid) {
super.onPostExecute(aVoid);
billAdapter.notifyItemInserted(0);
billAdapter.notifyDataSetChanged();
recyclerViewBills.scrollToPosition(0);
}
}.execute();
}
}
| [
"mrbudda2012@gmail.com"
] | mrbudda2012@gmail.com |
9f72d08ef20e5679c3db55362a08ebb03a5689d5 | f1e0d373c45691379e589aabf9e09dd04b7bdbfb | /src/main/java/com/circleci/demojavaspring/DemoJavaSpringApplication.java | 8bf3a1dad1d63b207de0c57d4b27752599568619 | [
"MIT"
] | permissive | circleci-book/java-sample | cac1498a560d54a7b052f3962db900c9dd834e7b | fdff23ec4426aad2815f4ccaa6bd57568bdba350 | refs/heads/master | 2022-12-06T19:23:57.316234 | 2020-09-07T01:00:51 | 2020-09-07T01:00:51 | 213,616,524 | 1 | 3 | MIT | 2020-07-16T11:45:17 | 2019-10-08T10:45:47 | Java | UTF-8 | Java | false | false | 347 | java | package com.circleci.demojavaspring;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class DemoJavaSpringApplication {
public static void main(String[] args) {
SpringApplication.run(DemoJavaSpringApplication.class, args);
}
}
| [
"yangkookkim@gmail.com"
] | yangkookkim@gmail.com |
3456ea1dcc52a9c990765e4c0576c8be174818b4 | bb0f27ddb2aa52accd89251f45048fdd41c37881 | /src/main/java/com/classattendancemaster/RESTControllers/StudentController.java | c819de884d46035bc014c2f32ecc20e71c559cc9 | [] | no_license | Halaisgit/ClassAttendanceMaster | 70a271ba2285105ad5cda26a4899855c40f251d3 | a368b07e9b94bd387f91d7d6f57f12e402d58b32 | refs/heads/master | 2021-06-17T20:16:46.168699 | 2017-06-08T14:06:58 | 2017-06-08T14:06:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,261 | java | package com.classattendancemaster.RESTControllers;
import com.classattendancemaster.DAOImpl.StudentDAOImpl;
import com.classattendancemaster.Entities.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* Created by Konrad on 2017-04-06.
*/
@RestController
@RequestMapping("/students")
public class StudentController {
private final StudentDAOImpl studentDAO;
@Autowired
public StudentController(StudentDAOImpl studentDAO) {
this.studentDAO = studentDAO;
}
@GetMapping("/{id}")
public Student findOne(@PathVariable long id) {
return studentDAO.findOne(id);
}
@GetMapping("")
public List<Student> getAll() {
return studentDAO.findAll();
}
@RequestMapping("/create")
public void create(@RequestBody Student student) {
Student studentDummy = studentDAO.findByAlbumNumber(student.getAlbumNumber());
if (studentDummy == null) {
studentDAO.save(student);
}
}
@RequestMapping("/delete/{id}")
public void delete(@PathVariable Long id) {
Student studentDummy = studentDAO.findOne(id);
studentDAO.delete(studentDummy);
}
}
| [
"gabara.konrad@gmail.com"
] | gabara.konrad@gmail.com |
278e028ed7285cb596063433d721edd4c952a27d | 0f2d15e30082f1f45c51fdadc3911472223e70e0 | /src/3.7/plugins/com.perforce.team.core/p4java/src/main/java/com/perforce/p4java/option/UsageOptions.java | 8ec02dc8d7abf4de1b4487bb7f6b97f145b8e321 | [
"BSD-2-Clause"
] | permissive | eclipseguru/p4eclipse | a28de6bd211df3009d58f3d381867d574ee63c7a | 7f91b7daccb2a15e752290c1f3399cc4b6f4fa54 | refs/heads/master | 2022-09-04T05:50:25.271301 | 2022-09-01T12:47:06 | 2022-09-01T12:47:06 | 136,226,938 | 2 | 1 | BSD-2-Clause | 2022-09-01T19:42:29 | 2018-06-05T19:45:54 | Java | UTF-8 | Java | false | false | 13,856 | java | /**
*
*/
package com.perforce.p4java.option;
import java.util.Properties;
import com.perforce.p4java.PropertyDefs;
import com.perforce.p4java.exception.NullPointerError;
import com.perforce.p4java.exception.P4JavaError;
/**
* Global server usage options class.<p>
*
* Intended to implement some of the options described in
* the main Perforce p4 usage and p4 undoc documentation on
* a per-IOptionsServer object basis, and also implements some of
* the broader environment settings (such as the client name used
* by the P4Java server implementation when no client has been
* associated with the server).<p>
*
* The UsageOptions object associated with a server is read and used
* for a small number of usage values (currently programName, programVersion,
* unsetUserName, and unsetClientName) each time a command is issued to the
* corresponding Perforce server, so updates to the UsageOptions object
* and / or any associated Properties object will be reflected
* at the next command execution except where noted. Note that this means that
* UsageOption objects shared between multiple servers are sensitive to such
* changes, and that changes that occur when a server is processing command
* requests may cause unexpected results.<p>
*
* A UsageOption object is associated with a server instance when
* the server is issued by the server factory; this can be the default
* object or one passed-in to the server factory specifically for that
* server.<p>
*
* Note that the UsageOptions class should be used with some
* care as the possible side effects of setting some of the
* usage parameters to the wrong value can lead to unexpected or
* odd behaviour.
*/
public class UsageOptions {
/**
* The name of the system property used to determine the JVM's current
* working directory.
*/
public static final String WORKING_DIRECTORY_PROPNAME = "user.dir";
/**
* Properties object used to get default field values from. Note that
* these properties are potentially accessed for each command, so any
* changes in the properties will be reflected the next time the options
* object is used.
*/
protected Properties props = null;
/**
* If not null, will be used to identify the P4Java application's
* program name to the Perforce server.
*/
protected String programName = null;
/**
* If not null, will be used to identify the P4Java application's
* program version to the Perforce server.
*/
protected String programVersion = null;
/**
* If not null, this specifies the Perforce server's idea of each command's
* working directory for the associated server object. Corresponds to
* the p4 -d usage option.<p>
*
* This affects all commands on the associated server from this point on,
* and the passed-in path should be both absolute and valid, otherwise
* strange errors may appear from the server. If workingDirectory is null,
* the Java VM's actual current working directory <b>at the time this object
* is constructed</b> is used instead (which is almost always a safe option unless
* you're using Perforce alt roots).<p>
*
* Note: no checking is done at any time for correctness (or otherwise)
* of the workingDirectory option.
*/
protected String workingDirectory = null;
/**
* If not null, specifies the host name used by the server's commands.
* Set to null by the default constructor. Corresponds to the p4 -H
* usage option. HostName is not live -- that is, unlike many other
* UsageOption fields, its value is only read once when the associated
* server is created; subsequent changes will not be reflected in the
* associated server.
*/
protected String hostName = null;
/**
* If not null, use this field to tell the server which language to
* use in text messages it sends back to the client. Corresponds to
* the p4 -L option, with the same limitations. Set to null by
* the default constructor.
*/
protected String textLanguage = null;
/**
* What will be sent to the Perforce server with each command as the user
* name if no user name has been explicitly set for servers associated with
* this UsageOption.
*/
protected String unsetUserName = null;
/**
* If set, this will be used as the name of the client when no
* client has actually been explicitly set for the associated server(s).
*/
protected String unsetClientName = null;
/**
* Default working directory from the JVM to fall back to if not working
* directory is set on the usage options
*/
protected String defaultWorkingDirectory = null;
/**
* Default constructor. Sets props field then calls setFieldDefaults
* to set appropriate field default values; otherwise does nothing.
*/
public UsageOptions(Properties props) {
if (props == null) {
this.props = new Properties();
} else {
this.props = props;
}
setFieldDefaults(getProps());
}
/**
* Explicit value constructor. After setting any values explicitly,
* calls setFieldDefaults() to tidy up any still-null fields that shouldn't
* be null.
*/
public UsageOptions(Properties props, String programName, String programVersion,
String workingDirectory, String hostName, String textLanguage,
String unsetUserName, String noClientName) {
if (props == null) {
this.props = new Properties();
} else {
this.props = props;
}
this.programName = programName;
this.programVersion = programVersion;
this.workingDirectory = workingDirectory;
this.hostName = hostName;
this.textLanguage = textLanguage;
this.unsetUserName = unsetUserName;
this.unsetClientName = noClientName;
setFieldDefaults(getProps());
}
/**
* Set any non-null default values when the object
* is constructed. Basically, this means running down the fields
* and if a field is null and it's not a field that should have a null
* default value, calling the corresponding getXXXXDefault method.<p>
*
* Fields set here: workingDirectory.
*/
protected void setFieldDefaults(Properties props) {
this.defaultWorkingDirectory = getWorkingDirectoryDefault(props);
}
/**
* Get a suitable default value for the programName field.
* This version tries to find a suitable value in the passed-in
* properties with the key PropertyDefs.PROG_NAME_KEY_SHORTFORM, then
* with the key PropertyDefs.PROG_NAME_KEY; if that comes up null,
* it uses the value of PropertyDefs.PROG_NAME_DEFAULT.
*
* @return non-null default programName value.
*/
protected String getProgramNameDefault(Properties props) {
if (props == null) {
throw new NullPointerError("Null properties in UsageOptions");
}
return props.getProperty(PropertyDefs.PROG_NAME_KEY_SHORTFORM,
props.getProperty(PropertyDefs.PROG_NAME_KEY,
PropertyDefs.PROG_NAME_DEFAULT));
}
/**
* Get a suitable default value for the programVersion field.
* This version tries to find a suitable value in the passed-in
* properties with the key PropertyDefs.PROG_VERSION_KEY_SHORTFORM, then
* with the key PropertyDefs.PROG_VERSION_KEY; if that comes up null,
* it uses the value of PropertyDefs.PROG_VERSION_DEFAULT.
*
* @return non-null default programVersion value.
*/
protected String getProgramVersionDefault(Properties props) {
if (props == null) {
throw new NullPointerError("Null properties in UsageOptions");
}
return props.getProperty(PropertyDefs.PROG_VERSION_KEY_SHORTFORM,
props.getProperty(PropertyDefs.PROG_VERSION_KEY,
PropertyDefs.PROG_VERSION_DEFAULT));
}
/**
* Get a suitable default value for the workingDirectory field. This
* is taken from the JVM's system properties using the WORKING_DIRECTORY_PROPNAME
* system properties key (which is normally user.dir).
*
* @return non-null working directory.
*/
protected String getWorkingDirectoryDefault(Properties props) {
String cwd = System.getProperty(WORKING_DIRECTORY_PROPNAME);
if (cwd == null) {
// Oh dear. This should never happen...
throw new P4JavaError(
"Unable to retrieve current working directory from JVM system properties");
}
return cwd;
}
/**
* Get a suitable default value for the unsetUserName field. This version
* returns the value of the property associated with the PropertyDefs.USER_UNSET_NAME_KEY
* if it exists, or PropertyDefs.USER_UNSET_NAME_DEFAULT if not.
*
* @return non-null default unsetUserName value.
*/
protected String getUnsetUserNameDefault(Properties props) {
if (props == null) {
throw new NullPointerError("Null properties in UsageOptions");
}
return this.props.getProperty(PropertyDefs.USER_UNSET_NAME_KEY,
PropertyDefs.USER_UNSET_NAME_DEFAULT);
}
/**
* Get a suitable default value for the unsetClientName field. This version
* returns the value of the property associated with the PropertyDefs.CLIENT_UNSET_NAME_KEY
* if it exists, or PropertyDefs.CLIENT_UNSET_NAME_DEFAULT if not.
*
* @return non-null default unsetClientName value.
*/
protected String getUnsetClientNameDefault(Properties props) {
if (props == null) {
throw new NullPointerError("Null properties in UsageOptions");
}
return this.props.getProperty(PropertyDefs.CLIENT_UNSET_NAME_KEY,
PropertyDefs.CLIENT_UNSET_NAME_DEFAULT);
}
/**
* Return the program name. The current program name is determined by
* first seeing if there's been one explicitly set in this options object;
* if so, it's returned, otherwise the associated properties are searched
* for a value with the key PropertyDefs.PROG_NAME_KEY_SHORTFORM, then
* with the key PropertyDefs.PROG_NAME_KEY; if that comes up null,
* it returns the value of PropertyDefs.PROG_NAME_DEFAULT.
*/
public String getProgramName() {
if (this.programName != null) {
return this.programName;
}
if (props == null) {
throw new NullPointerError("Null properties in UsageOptions");
}
return props.getProperty(PropertyDefs.PROG_NAME_KEY_SHORTFORM,
props.getProperty(PropertyDefs.PROG_NAME_KEY,
PropertyDefs.PROG_NAME_DEFAULT));
}
public UsageOptions setProgramName(String programName) {
this.programName = programName;
return this;
}
/**
* Return the program version. The current program version is determined by
* first seeing if there's been one explicitly set in this options object;
* if so, it's returned, otherwise the associated properties are searched
* for a value with the key PropertyDefs.PROG_VERSION_KEY_SHORTFORM, then
* with the key PropertyDefs.PROG_VERSION_KEY; if that comes up null,
* it returns the value of PropertyDefs.PROG_VERSION_DEFAULT.
*/
public String getProgramVersion() {
if (this.programVersion != null) {
return this.programVersion;
}
if (props == null) {
throw new NullPointerError("Null properties in UsageOptions");
}
return props.getProperty(PropertyDefs.PROG_VERSION_KEY_SHORTFORM,
props.getProperty(PropertyDefs.PROG_VERSION_KEY,
PropertyDefs.PROG_VERSION_DEFAULT));
}
public UsageOptions setProgramVersion(String programVersion) {
this.programVersion = programVersion;
return this;
}
/**
* Return the current value of the working directory; this can be dynamically
* set explicitly using the setter method or implicitly when the object is
* constructed using the JVM's working directory as reflected in the
* System properties.
*/
public String getWorkingDirectory() {
return workingDirectory != null ? workingDirectory
: defaultWorkingDirectory;
}
public UsageOptions setWorkingDirectory(String workingDirectory) {
this.workingDirectory = workingDirectory;
return this;
}
public String getHostName() {
return hostName;
}
/**
* Set the host name. Calling this method has no effect at all after
* any associated server object is created.
*/
public UsageOptions setHostName(String hostName) {
this.hostName = hostName;
return this;
}
public String getTextLanguage() {
return textLanguage;
}
public UsageOptions setTextLanguage(String textLanguage) {
this.textLanguage = textLanguage;
return this;
}
public Properties getProps() {
return props;
}
public UsageOptions setProps(Properties props) {
this.props = props;
return this;
}
/**
* Return the unset client name. The current value is determined by
* first seeing if there's been one explicitly set in this options object;
* if so, it's returned; otherwise the associated properties are searched
* for a value with the key PropertyDefs.CLIENT_UNSET_NAME_KEY; if that comes
* up null, it returns the value of PropertyDefs.CLIENT_UNSET_NAME_DEFAULT.
*/
public String getUnsetClientName() {
if (this.unsetClientName != null) {
return this.unsetClientName;
}
if (props == null) {
throw new NullPointerError("Null properties in UsageOptions");
}
return props.getProperty(PropertyDefs.CLIENT_UNSET_NAME_KEY,
PropertyDefs.CLIENT_UNSET_NAME_DEFAULT);
}
public UsageOptions setUnsetClientName(String unsetClientName) {
this.unsetClientName = unsetClientName;
return this;
}
/**
* Return the unset user name. The current value is determined by
* first seeing if there's been one explicitly set in this options object;
* if so, it's returned; otherwise the associated properties are searched
* for a value with the key PropertyDefs.USER_UNSET_NAME_KEY; if that comes
* up null, it returns the value of PropertyDefs.USER_UNSET_NAME_DEFAULT.
*/
public String getUnsetUserName() {
if (this.unsetUserName != null) {
return this.unsetUserName;
}
if (props == null) {
throw new NullPointerError("Null properties in UsageOptions");
}
return props.getProperty(PropertyDefs.USER_UNSET_NAME_KEY,
PropertyDefs.USER_UNSET_NAME_DEFAULT);
}
public UsageOptions setUnsetUserName(String unsetUserName) {
this.unsetUserName = unsetUserName;
return this;
}
}
| [
"gunnar@wagenknecht.org"
] | gunnar@wagenknecht.org |
7a6a6238466610fb4e23615b4a1dbc9d485fea09 | 6c4162b7e5f06c18ded5a830d1138bfda21f55dd | /app/src/main/java/com/poly/chuhieu/pt13355_duan1_hieucvph06411/activity/SuaSPActivity.java | 6838f1a3571fe9edbbde12f644a289938b356249 | [] | no_license | ChuHieu02/PT13355_DuAn1_Hieucvph06411 | dcba0fafe24a1eeb0abec435c197c4fb26b0086f | 2c328ae6fd13a1b8861bbe83ef81d9bbfdddc228 | refs/heads/master | 2020-04-03T14:57:14.134214 | 2018-12-01T01:56:59 | 2018-12-01T01:56:59 | 155,343,582 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,415 | java | package com.poly.chuhieu.pt13355_duan1_hieucvph06411.activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;
import com.poly.chuhieu.pt13355_duan1_hieucvph06411.R;
import com.poly.chuhieu.pt13355_duan1_hieucvph06411.sqlitedao.SanPhamDAO;
public class SuaSPActivity extends AppCompatActivity {
Toolbar tbTypeBook;
EditText edtIDType;
EditText edtNameType;
EditText edtLocationType;
EditText edtInfoTypebook;
String id, name, location, info;
SanPhamDAO typeBookDAO;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.sua_sp);
tbTypeBook = findViewById(R.id.toolbar);
edtIDType = (EditText) findViewById(R.id.edtIDType);
edtNameType = (EditText) findViewById(R.id.edtNameType);
edtLocationType = (EditText) findViewById(R.id.edtLocationType);
edtInfoTypebook = (EditText) findViewById(R.id.edtInfoTypebook);
typeBookDAO = new SanPhamDAO(this);
setSupportActionBar(tbTypeBook);
getSupportActionBar().setDisplayShowTitleEnabled(false);
tbTypeBook.setNavigationIcon(R.drawable.ic_arrow_back_black_24dp);
tbTypeBook.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
Intent in = getIntent();
Bundle bundle = in.getExtras();
id = bundle.getString("ID");
name = bundle.getString("NAME");
location = bundle.getString("LOCATION");
info = bundle.getString("NOTI");
edtNameType.setText(name);
edtLocationType.setText(location);
edtInfoTypebook.setText(info);
}
public void EditTypebook(View view) {
if (typeBookDAO.updateTypeBook(id, edtNameType.getText().toString(), edtLocationType.getText().toString(), edtInfoTypebook.getText().toString()) > 0) {
Toast.makeText(getApplicationContext(), "Lưu thành công", Toast.LENGTH_SHORT).show();
finish();
} else {
Toast.makeText(getApplicationContext(), "Lưu thất bại", Toast.LENGTH_SHORT).show();
}
}
}
| [
"chuhieu020297@gmail.com"
] | chuhieu020297@gmail.com |
6ebe3ce6c22ef4d06d8846817e3ee1523b3d6486 | 129fd358de77155e0c29d695f634a3e24b089be0 | /app/src/main/java/hackerrepublic/sarkarsalahkar/fragments/ProfileFragment.java | cd09d7d540f91ad7d64e03b85de096d7322622b5 | [] | no_license | ShivayaDevs/SarkarSalahkar | 71068a007b9e80263d5e7787f55c995164f72ea3 | ab4fb8116db87152a12ccc37d0159d5e4d927a03 | refs/heads/master | 2021-09-24T03:13:13.419654 | 2018-10-02T12:19:31 | 2018-10-02T12:19:31 | 103,757,791 | 4 | 0 | null | 2018-10-02T12:19:32 | 2017-09-16T14:22:35 | Java | UTF-8 | Java | false | false | 839 | java | package hackerrepublic.sarkarsalahkar.fragments;
import android.support.v4.app.Fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import hackerrepublic.sarkarsalahkar.R;
/**
* Inflates the user's profile.
*
* @author vermayash8
*/
public class ProfileFragment extends Fragment {
public ProfileFragment() {
// Required.
}
/**
* Called when first created.
*/
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle
savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
View view = inflater.inflate(R.layout.fragment_profile, container, false);
return view;
}
}
| [
"verma.yash8@gmail.com"
] | verma.yash8@gmail.com |
1e697fe49ee40510fd00c903dae656be231a9c4c | 1acb3f60ba25a3cf6ddeda7c6c2da82781355fab | /src/main/java/com/github/fbascheper/image/transformer/ImageCropTransformer.java | 2c5673a5f8c32b8157824cbedbf8b0cdaefc7483 | [
"Apache-2.0"
] | permissive | fbascheper/kafka-connect-storage-converters | c3d7677ac50dfedc1c235985dbc9753a4691e910 | 0223d5422e45b8112dce254e95954275aa871479 | refs/heads/develop | 2023-08-04T06:20:40.399459 | 2019-07-03T14:37:36 | 2019-07-03T14:37:36 | 156,188,013 | 0 | 2 | Apache-2.0 | 2023-07-21T20:48:20 | 2018-11-05T08:57:35 | Java | UTF-8 | Java | false | false | 1,604 | java | package com.github.fbascheper.image.transformer;
import com.github.fbascheper.image.transformer.util.Scalr;
import java.awt.image.BufferedImage;
/**
* Transforms the size of a given image by cropping to a width and height.
*
* @author Erik-Berndt Scheper
* @since 15-04-2019
*/
public class ImageCropTransformer implements ImageTransformer {
private final int cropLeft;
private final int cropRight;
private final int cropTop;
private final int cropBottom;
/**
* Constructor for crop operations, using the given parameters
*
* @param cropLeft pixels to crop from left
* @param cropRight pixels to crop from right
* @param cropTop pixels to crop from top
* @param cropBottom pixels to crop from bottom
*/
@SuppressWarnings("WeakerAccess")
public ImageCropTransformer(int cropLeft, int cropRight, int cropTop, int cropBottom) {
this.cropLeft = cropLeft >= 0 ? cropLeft : 0;
this.cropRight = cropRight >= 0 ? cropRight : 0;
this.cropTop = cropTop >= 0 ? cropTop : 0;
this.cropBottom = cropBottom >= 0 ? cropBottom : 0;
}
@Override
public BufferedImage transform(BufferedImage source) {
final int x = this.cropLeft;
final int y = this.cropTop;
final int width = source.getWidth() - x - this.cropRight;
final int height = source.getHeight() - y - this.cropBottom;
if (width >= 0 && height >= 0) {
return Scalr.crop(source, x, y, width, height);
} else {
return Scalr.crop(source, 0, 0, 0, 0);
}
}
}
| [
"erik.berndt.scheper@gmail.com"
] | erik.berndt.scheper@gmail.com |
c1ce90c34412c72b53e3986e2e0280dec16f2f61 | 2b8dd45ebc292bdd544d3916524594916d5193db | /Middleware/TRENCADIS_Middleware/src/trencadis/middleware/files/pdfs/CONSTANTS_XPATH_RM.java | 4629507054965912fdf9018547fddab3954057d4 | [] | no_license | grycap/trencadis | f2a0e5f112e70b5b60d5ec79c1e596531173288c | e2f193995ed3e1951c3758bbbe27286b794b689f | refs/heads/master | 2020-05-17T10:56:33.644228 | 2015-09-29T11:31:51 | 2015-09-29T11:31:51 | 33,665,695 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,019 | java |
package trencadis.middleware.files.pdfs;
public class CONSTANTS_XPATH_RM {
/*************************************************/
/***** TIPOS DE INFORME *************************/
static String strTYPE_REPORT_CODE_SCHEME = "RADLEX";
static String strTYPE_REPORT_CODE__VALUE = "RID10312";
static String strTYPE_REPORT_CODE_MEANING = "Resonancia Magnética";
/*************************************************/
/*************************************************/
/***** TIPOS DE LESIONES *************************/
static String [] astrTYPE_LESION_CODE_SCHEME = {"RADLEX", "RADLEX"};
static String [] astrTYPE_LESION_CODE_VALUE = {"RID3874", "RID34342"};
static String [] astrTYPE_LESION_CODE_MEANING = {"Nódulo/Masa", "Realce NO-Masa/Asimetría de Captación"};
/*************************************************/
}
| [
"lorenacalabuig@gmail.com"
] | lorenacalabuig@gmail.com |
922615713e615e76990c6bed121193d68b0da0ed | d94673635bce6f48caa882dadac079665460d5b5 | /src/main/java/com/shejimoshi/reflection/Person.java | 109cfffd403b6992a794ba4d5d165d9192d7fe46 | [] | no_license | Mr2277/shejimoshi | 3507da8f38b4defe6a4463374f97e1db45fb5c8c | abdc87f3d93e683691c6064f5003d857d7293929 | refs/heads/master | 2018-10-22T05:59:56.091829 | 2018-10-14T10:56:49 | 2018-10-14T10:56:49 | 119,014,733 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 821 | java | package com.shejimoshi.reflection;
public class Person {
private String name;
private String gender;
private int age;
public Person() {
}
public Person(String name, String gender, int age) {
this.name = name;
this.gender = gender;
this.age = age;
}
//getter和setter方法
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public String toString(){
return "姓名:"+name+" 性别:"+gender+" 年龄:"+age;
}
}
| [
"837544713@qq.com"
] | 837544713@qq.com |
660884479bbdf50d89f381b930538d3db9084c16 | 0d3d228c58b0648a87f3298e09589f9f8c618540 | /gestionGerencial/src/main/java/org/ge/web/controller/GestionarObjetivoController.java | e68a38344fe0ff20f4fd98001ffdac3ceccf1239 | [] | no_license | oscarramosp/chilis-tp3 | 32411a19c6ca0d2ee94af5283596d4d9d13eea58 | cab23a194cac757a92aad2e6bb67e86aeda26ba8 | refs/heads/master | 2021-01-01T06:33:05.331995 | 2013-06-12T22:45:25 | 2013-06-12T22:45:25 | 32,544,272 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,655 | java | package org.ge.web.controller;
import java.util.List;
import org.ge.model.Area;
import org.ge.model.Objetivo;
import org.ge.model.ObjetivoFuncional;
import org.ge.model.ObjetivoGeneral;
import org.ge.service.ObjetivoManager;
import org.ge.service.OrganizacionManager;
import org.ge.service.mail.MailService;
import org.ge.web.validator.ObjetivoValidator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.support.SessionStatus;
@Controller
public class GestionarObjetivoController {
@Autowired
private ObjetivoManager objetivoManager;
@Autowired
private OrganizacionManager organizacionManager;
@Autowired
private ObjetivoValidator objetivoValidator;
@Autowired
private MailService mailService;
@RequestMapping(value = "/consultaObjetivos.htm", method = RequestMethod.GET)
public void ConsultarObjetivo(Model model,
@ModelAttribute("objetivoBusqueda") ObjetivoFuncional objetivoBusqueda) {
if(objetivoBusqueda.getTipoObjetivo()== null){
objetivoBusqueda.setTipoObjetivo("General");
}
}
@RequestMapping(value = "/consultaObjetivos.htm", method = RequestMethod.POST)
public void verListaConsulta(Model model,
@ModelAttribute("objetivoBusqueda") ObjetivoFuncional objetivoBusqueda, BindingResult result) {
if(objetivoBusqueda.getTipoObjetivo().equals("Funcional")){
List<ObjetivoFuncional> objetivos = objetivoManager.getListaObjetivosFuncionales(objetivoBusqueda);
model.addAttribute("objetivos", objetivos);
objetivoValidator.validarLista(objetivos, result);
} else {
ObjetivoGeneral aux = new ObjetivoGeneral(objetivoBusqueda.getDescripcion(), "");
aux.setEstado(objetivoBusqueda.getEstado());
List<ObjetivoGeneral> objetivos = objetivoManager.getListaObjetivosGenerales(aux);
model.addAttribute("objetivos", objetivos);
objetivoValidator.validarLista(objetivos, result);
}
model.addAttribute("objetivoBusqueda", objetivoBusqueda);
model.addAttribute("tipoObjetivo", "General");
}
@RequestMapping(value = "/registroObjetivo.htm", method = RequestMethod.GET)
public @ModelAttribute("objetivoNuevo") Objetivo registrarObjetivo (Model model, @RequestParam(value = "codigoObjetivo", required = false) Integer codigoObjetivo) {
if (codigoObjetivo == null){
Objetivo objetivoNuevo = new ObjetivoFuncional();
objetivoNuevo.setTipoObjetivo("General");
model.addAttribute("tipoOperacion","Registrar");
String visibilidadFuncional = "none";
model.addAttribute("visibilidadFuncional", visibilidadFuncional);
return objetivoNuevo;
} else {
String visibilidadFuncional = "block";
model.addAttribute("visibilidadFuncional", visibilidadFuncional);
Objetivo objetivoNuevo = objetivoManager.getObjetivoPorCodigo(codigoObjetivo);
model.addAttribute("tipoOperacion","Actualizar");
// if(objetivoNuevo.getTipoObjetivo().equals("General")){
// model.addAttribute("tipoOperacion","Actualizar");
// } else {
// model.addAttribute("tipoOperacion","Actualizar");
// }
return objetivoNuevo;
}
}
@RequestMapping(value = "/registroObjetivo.htm", method = RequestMethod.POST)
public String saveObjetivo(Model model, @ModelAttribute("objetivoNuevo") ObjetivoFuncional objetivoNuevo,
BindingResult result, SessionStatus status) {
try {
objetivoValidator.validate(objetivoNuevo, result);
if (result.hasErrors()) {
if(objetivoNuevo.getCodigo()==null){
model.addAttribute("tipoOperacion","Registrar");
} else {
model.addAttribute("tipoOperacion","Actualizar");
}
return "registroObjetivo";
}
if(objetivoNuevo.getCodigo()==null){
if(objetivoNuevo.getTipoObjetivo().equals("General")){
ObjetivoGeneral aux = new ObjetivoGeneral(objetivoNuevo.getDescripcion(),objetivoNuevo.getComentarios());
objetivoManager.guardarObjetivoGeneral(aux);
mailService.mandarAlerta(organizacionManager.getEmpleadoPorCodigo(4), aux);
} else {
ObjetivoFuncional aux = new ObjetivoFuncional(objetivoNuevo.getDescripcion(), ((ObjetivoFuncional) objetivoNuevo).getArea(), ((ObjetivoFuncional) objetivoNuevo).getObjetivoVinculado(), objetivoNuevo.getComentarios());
objetivoManager.guardarObjetivoFuncional(aux);
mailService.mandarAlerta(organizacionManager.getResponsableArea(aux.getArea()), aux);
}
model.addAttribute("mensajeConfirmacion", "PendRegistro");
} else {
if(objetivoNuevo.getTipoObjetivo().equals("General")){
objetivoNuevo.setFechaRegistro(objetivoManager.getObjetivoGeneralPorCodigo(objetivoNuevo.getCodigo()).getFechaRegistro());
ObjetivoGeneral aux = objetivoManager.getObjetivoGeneralPorCodigo(objetivoNuevo.getCodigo());
aux.setEstado("pendUpdate");
aux.setDescripcion(objetivoNuevo.getDescripcion());
aux.setComentarios(objetivoNuevo.getComentarios());
objetivoManager.guardarObjetivoGeneral(aux);
mailService.mandarAlerta(organizacionManager.getEmpleadoPorCodigo(4), aux);
} else {
ObjetivoFuncional aux = objetivoManager.getObjetivoFuncionalPorCodigo(objetivoNuevo.getCodigo());
aux.setArea(objetivoNuevo.getArea());
aux.setObjetivoVinculado(objetivoNuevo.getObjetivoVinculado());
aux.setEstado("pendUpdate");
aux.setDescripcion(objetivoNuevo.getDescripcion());
aux.setComentarios(objetivoNuevo.getComentarios());
aux.setFechaRegistro(objetivoManager.getObjetivoFuncionalPorCodigo(objetivoNuevo.getCodigo()).getFechaRegistro());
objetivoManager.guardarObjetivoFuncional(aux);
mailService.mandarAlerta(organizacionManager.getResponsableArea(aux.getArea()), aux);
}
model.addAttribute("mensajeConfirmacion", "PendActualizacion");
}
return "consultaObjetivos";
} catch (Exception e) {
return "registroObjetivo";
}
}
@RequestMapping("/bajaObjetivo.htm")
public String darBajaObjetivo(Model model,
@RequestParam(value = "codigoObjetivo", required = false) Integer codigoObjetivo) {
Objetivo objetivo = objetivoManager.getObjetivoPorCodigo(codigoObjetivo);
if(objetivo.getTipoObjetivo().equals("General")){
ObjetivoGeneral aux = objetivoManager.getObjetivoGeneralPorCodigo(codigoObjetivo);
aux.setEstado("pendBaja");
objetivoManager.guardarObjetivoGeneral(aux);
} else {
ObjetivoFuncional aux = objetivoManager.getObjetivoFuncionalPorCodigo(codigoObjetivo);
aux.setEstado("pendBaja");
objetivoManager.guardarObjetivoFuncional(aux);
}
model.addAttribute("mensajeConfirmacion", "PendBaja");
return "consultaObjetivos";
}
@ModelAttribute("listaAreas")
public List<Area> listarAreas() {
List<Area> listaAreas = organizacionManager.getListaAreas();
listaAreas.remove(4);
return listaAreas;
}
@ModelAttribute("visibilidadFuncional")
public String visibilidadFuncional(@ModelAttribute("objetivoBusqueda") ObjetivoFuncional objetivoBusqueda) {
if(objetivoBusqueda.getTipoObjetivo()!= null && objetivoBusqueda.getTipoObjetivo().equals("Funcional")){
return "block";
} else {
return "none";
}
}
@ModelAttribute("listaObjetivosGenerales")
public List<ObjetivoGeneral> listarObjetivosGenerales() {
List<ObjetivoGeneral> listaObjetivos = objetivoManager.getListaObjetivosGenerales(null);
return listaObjetivos;
}
}
| [
"mmerinovega@gmail.com@e721ef72-feba-3062-5dd9-1d49d08ceec4"
] | mmerinovega@gmail.com@e721ef72-feba-3062-5dd9-1d49d08ceec4 |
858b3562055d8647a4dc5f84ad724f7ccc170144 | 926a4b0dc6a9c376d225bc213140360a3879828e | /app/src/main/java/com/android/lehuitong/adapter/MyCartAdapter.java | c37a4be6bdd3bd1f531d9db5a27551d83c308623 | [] | no_license | zcrman/CarBY | 135fb953595ae797b0c60176e93f31d66fa4ebc5 | b970d7989b4f2ee7908148bda2e2fd3016c32122 | refs/heads/master | 2021-01-10T01:42:31.309225 | 2016-04-01T08:45:45 | 2016-04-01T08:46:33 | 55,145,000 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,496 | java | package com.android.lehuitong.adapter;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.BeeFramework.view.WebImageView;
import com.alipay.sdk.app.t;
import com.android.lehuitong.component.MyCartHolderpter;
import com.android.lehuitong.protocol.GOODS_LIST;
import com.android.lehuitong.protocol.ProtocolConst;
import com.funmi.lehuitong.R;
import android.R.integer;
import android.content.Context;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
public class MyCartAdapter extends BaseAdapter {
String addmuber;
String count;
Boolean pressBoolean = true;
public static int setNumberCount = 0;
private Map<Integer, Integer> addNumberMap = new HashMap<Integer, Integer>();
private Map<Integer, String> price = new HashMap<Integer, String>();
public Map<Integer, Boolean> delete = new HashMap<Integer, Boolean>();
private Map<Integer, Boolean> selectStatus = new HashMap<Integer, Boolean>();
private Context context;
boolean b, select, finish;
private List<GOODS_LIST> list;
private Handler handler;
private String totalPrice;
private int selectNum = 0;
private String mprice;
public MyCartAdapter(Context context, boolean b, boolean select, boolean finish, Handler handler) {
this.context = context;
this.b = b;
this.select = select;
this.finish = finish;
this.handler = handler;
}
public String getTotalprice() {
return totalPrice;
}
public void bindData(List<GOODS_LIST> list) {
this.list = list;
for (int i = 0; i < list.size(); i++) {
selectStatus.put(i, select);
}
}
public void getdata(String count) {
this.count = count;
}
public boolean isB() {
return b;
}
public void setB(boolean b) {
this.b = b;
}
public boolean isSelect() {
return select;
}
public void setSelect(boolean select) {
this.select = select;
}
public Map<Integer, Integer> getAddNumberMap() {
return addNumberMap;
}
public void setAddNumberMap(Map<Integer, Integer> addNumberMap) {
this.addNumberMap = addNumberMap;
}
public Map<Integer, Boolean> getDelete() {
return delete;
}
public void setDelete(Map<Integer, Boolean> delete) {
this.delete = delete;
}
public Handler getHandler() {
return handler;
}
public void setHandler(Handler handler) {
this.handler = handler;
}
public Map<Integer, String> getPrice() {
return price;
}
public void setPrice(Map<Integer, String> price) {
this.price = price;
}
@Override
public int getCount() {
return list.size();
}
@Override
public Object getItem(int position) {
return position;
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
final MyCartHolderpter holder;
final GOODS_LIST good_list = list.get(position);
if (convertView == null) {
holder = new MyCartHolderpter(context);
convertView = LayoutInflater.from(context).inflate(R.layout.item_my_cart, null);
holder.mycar_choice=(LinearLayout) convertView.findViewById(R.id.mycar_chioce);
holder.trade_name = (TextView) convertView.findViewById(R.id.trade_name);
holder.goods_cart = (TextView) convertView.findViewById(R.id.goods_cart);
holder.price = (TextView) convertView.findViewById(R.id.price);
holder.shop_cart_subtract = (ImageView) convertView.findViewById(R.id.shop_cart_subtract);
holder.shop_cart_add = (ImageView) convertView.findViewById(R.id.shop_cart_add);
holder.have_choose = (ImageView) convertView.findViewById(R.id.have_choose);
holder.shop_cart = (TextView) convertView.findViewById(R.id.shop_cart);
holder.edittext_relativelayout = (RelativeLayout) convertView.findViewById(R.id.edittext_relativelayout);
holder.edittext_linearlayout = (LinearLayout) convertView.findViewById(R.id.edittext_linearlayout);
holder.goodsImg = (WebImageView) convertView.findViewById(R.id.cart_image);
convertView.setTag(holder);
} else {
holder = (MyCartHolderpter) convertView.getTag();
}
if (b == true) {
holder.edittext_relativelayout.setVisibility(View.GONE);
holder.edittext_linearlayout.setVisibility(View.VISIBLE);
if (setNumberCount < list.size()*2) {
holder.shop_cart.setText(good_list.goods_number);
setNumberCount++;
}
}
if (selectStatus.get(position)) {
holder.have_choose.setImageResource(R.drawable.my_shopping_cart_choice_icon);
if (price.get(position) != null) {
delete.remove(position);
price.remove(position);
}
delete.put(position, true);
// if(list.get(position).is_promote.equals("1")){
// price.put(position, list.get(position).promote_price);
// }else{
price.put(position, list.get(position).subtotal);
// }
} else {
holder.have_choose.setImageResource(R.drawable.my_hopping_cart_not_selected_icon);
if (price.get(position) != null) {
delete.remove(position);
price.remove(position);
}
Message message = Message.obtain();
message.obj = "false";
handler.sendMessage(message);
}
selectNum = 0;
for (int i = 0; i < list.size(); i++) {
if (selectStatus.get(i)) {
selectNum++;
}else {
break;
}
}
if (selectNum==list.size()) {
Message message = Message.obtain();
message.obj = "true";
handler.sendMessage(message);
}
String str_temp = "price";
Message message = Message.obtain();
message.obj = str_temp;
handler.sendMessage(message);
holder.shop_cart_subtract.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
String Str = holder.shop_cart.getText().toString();
int date = Integer.parseInt(Str);
int subtractdata = date;
if (subtractdata > 1) {
subtractdata--;
addmuber = String.valueOf(subtractdata);
holder.shop_cart.setText(addmuber);
if (subtractdata != date) {
addNumberMap.put(position, subtractdata);
} else {
addNumberMap.put(position, date);
}
notifyDataSetChanged();
}
}
});
holder.shop_cart_add.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
String Str = holder.shop_cart.getText().toString();
int date = Integer.parseInt(Str);
int adddata = date;
adddata++;
if (adddata != date) {
addNumberMap.put(position, adddata);
} else {
addNumberMap.put(position, date);
}
addmuber = String.valueOf(adddata);
holder.shop_cart.setText(addmuber);
notifyDataSetChanged();
}
});
holder.mycar_choice.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
if (selectStatus.get(position) == true) {
holder.have_choose.setImageResource(R.drawable.my_shopping_cart_not_selected_icon);
selectStatus.remove(position);
selectStatus.put(position, false);
notifyDataSetChanged();
delete.put(position, false);
delete.remove(position);
price.remove(position);
String str_temp = "price";
Message message = Message.obtain();
message.obj = str_temp;
handler.sendMessage(message);
} else if (selectStatus.get(position) == false) {
selectStatus.remove(position);
selectStatus.put(position, true);
holder.have_choose.setImageResource(R.drawable.my_shopping_cart_choice_icon);
// if(list.get(position).is_promote.equals("1")){
// price.put(position, list.get(position).promote_price);
// }else{
price.put(position, list.get(position).subtotal);
// }
notifyDataSetChanged();
delete.put(position, true);
String str_temp = "price";
Message message = Message.obtain();
message.obj = str_temp;
handler.sendMessage(message);
}
}
});
String mname = good_list.goods_name;
String mgoods_number;
if (finish == true) {
mgoods_number = count;
notifyDataSetChanged();
} else {
mgoods_number = good_list.goods_number;
}
// if(good_list.is_promote != null && good_list.is_promote.equals("1")){
// mprice = good_list.promote_price;
// }else{
mprice = good_list.subtotal;
// }
String imgUrl = good_list.img.thumb;
holder.SetMyCouponsInfo(mname, mgoods_number, mprice, imgUrl);
return convertView;
}
}
| [
"zcrman@163.com"
] | zcrman@163.com |
2b5ef90174c25ab29313189ed33a1d7b6d869684 | d23350bb4e3d79b71b9886d4e2ea8a10ac0068bd | /core/src/com/retrommo/client/ecs/EntityManager.java | 0e43b6cae72459d4402778e14cf4f46056ade284 | [] | no_license | unenergizer/RetroMMO-Client-OLD | e8daf9754bdf61587518329086c95403e92918ab | 1adfb03cf37c782a59dfdb6e246e5403010a9c11 | refs/heads/master | 2022-08-14T06:57:15.140067 | 2017-04-07T02:39:49 | 2017-04-07T02:39:49 | 86,646,184 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,669 | java | package com.retrommo.client.ecs;
import com.retrommo.client.RetroMMO;
import com.retrommo.client.assets.Assets;
import com.retrommo.iocommon.enums.EntityTypes;
import com.retrommo.iocommon.wire.server.SendEntityData;
import java.util.HashMap;
import java.util.Map;
import lombok.Getter;
/*********************************************************************************
*
* OWNER: Robert Andrew Brown & Joseph Rugh
* PROGRAMMER: Robert Andrew Brown & Joseph Rugh
* PROJECT: RetroMMO-Client
* DATE: 4/2/2017
* _______________________________________________________________________________
*
* Copyright © 2017 RetroMMO.com. All Rights Reserved.
*
* No part of this project and/or code and/or source code and/or source may be
* reproduced, distributed, or transmitted in any form or by any means,
* including photocopying, recording, or other electronic or mechanical methods,
* without the prior written permission of the owner.
*/
@Getter
public class EntityManager {
private final RetroMMO retroMMO;
private final Map<Integer, EntityData> serverIDtoEntityData = new HashMap<>();
private final Map<Integer, EntityData> localIDtoEntityData = new HashMap<>();
private EntityData clientData;
public EntityManager(RetroMMO retroMMO) {
this.retroMMO = retroMMO;
}
public int serverIDtoLocalID(int serverID) {
if (clientData.getServerID() == serverID) {
return clientData.getLocalID(); // local player
}
return serverIDtoEntityData.get(serverID).getLocalID(); // online player/
}
/**
* Here we are creating entities and adding them to the above HashMaps for
* reference. We do this because we need to keep track of entity server ID's.
*
* @param serverEntityData Data from the server that describes our entity.
*/
public void addEntity(SendEntityData serverEntityData) {
// TODO: Sort out the types of entities and associated graphics for each..
String imagePath = Assets.graphics.TEMP_PLAYER_IMG;
int serverID = serverEntityData.getServerEntityID();
EntityTypes type = serverEntityData.getEntityType();
float x = serverEntityData.getX();
float y = serverEntityData.getY();
int localID = retroMMO.getGameScreen().getEntityFactory().makeEntity(
x,
y,
25,//width
25,//height
imagePath, serverID);
System.out.println("Setting up entity...");
System.out.println("ServerID: " + serverID);
System.out.println("LocalID: " + localID);
// Setup HashMaps
EntityData localEntityData = new EntityData(serverID, localID, type);
if (type == EntityTypes.CLIENT_PLAYER) {
// If the entity type is Client_Player then set up our local player.
clientData = localEntityData;
} else {
// Else we add all entities to our HashMaps for easy reference.
serverIDtoEntityData.put(serverID, localEntityData);
localIDtoEntityData.put(localID, localEntityData);
}
}
/**
* This will remove a entity from the HashMap reference via the Server ID.
* Note: if used improperly this could remove the wrong entity or not remove
* any entity at all! Make sure to only use a SERVER ID here!!!
*
* @param serverID A ID assigned by the Server that represents the entity we
* will remove.
*/
public void removeEntityViaServerID(int serverID) {
removeEntity(serverID, serverIDtoEntityData.get(serverID).getLocalID());
}
/**
* This will remove a entity from the HashMap reference via the Local Client ID.
* Note: if used improperly this could remove the wrong entity or not remove
* any entity at all! Make sure to only use a LOCAL CLIENT ID here!!!
*
* @param localID A ID assigned by the game client to represent a server entity
* that we will remove.
*/
public void removeEntityViaLocalID(int localID) {
removeEntity(localIDtoEntityData.get(localID).getServerID(), localID);
}
/**
* This method will remove reference of a Server and Local entity.
*
* @param serverID The ID sent to us from the Server that represents
* the entity we will remove.
* @param localID The ID assigned to an entity created locally.
*/
private void removeEntity(int serverID, int localID) {
//TODO: Remove entity from ECS!!
serverIDtoEntityData.remove(serverID);
localIDtoEntityData.remove(localID);
}
}
| [
"unenergizer@gmail.com"
] | unenergizer@gmail.com |
6495e2e7f65d233e3d211b02e1aaaa0758d9db06 | 347098f65ab7c5d5ad6b9c32d4c7381092bb917d | /30012ExpXXX/src/main/java/billydev/Exp023_MinimumSpanningTree/Graph.java | 897d543b6a84c8198b3eac49c1a48249cb7fd009 | [] | no_license | billydevInGitHub/30012 | 6af1cbd852fe5f5f76e8d5f80f2523d8f0ad91ca | cd5481c9f9c1c6933d3ebe69dd7771b0e4cbcd2a | refs/heads/master | 2022-12-31T02:27:56.834979 | 2020-10-17T02:37:04 | 2020-10-17T02:37:04 | 304,782,387 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,058 | java | package billydev.Exp023_MinimumSpanningTree;
import java.util.Arrays;
public class Graph {
// A class to represent a graph edge
class Edge implements Comparable<Edge>
{
int src, dest, weight;
// Comparator function used for sorting edges
// based on their weight
public int compareTo(Edge compareEdge)
{
return this.weight-compareEdge.weight;
}
};
// A class to represent a subset for union-find
class subset
{
int parent, rank;
};
int V, E; // V-> no. of vertices & E->no.of edges
Edge edge[]; // collection of all edges
// Creates a graph with V vertices and E edges
Graph(int v, int e)
{
V = v;
E = e;
edge = new Edge[E];
for (int i=0; i<e; ++i)
edge[i] = new Edge();
}
// A utility function to find set of an element i
// (uses path compression technique)
int find(subset subsets[], int i)
{
// find root and make root as parent of i (path compression)
if (subsets[i].parent != i)
subsets[i].parent = find(subsets, subsets[i].parent);
return subsets[i].parent;
}
// A function that does union of two sets of x and y
// (uses union by rank)
void Union(subset subsets[], int x, int y)
{
int xroot = find(subsets, x);
int yroot = find(subsets, y);
// Attach smaller rank tree under root of high rank tree
// (Union by Rank)
if (subsets[xroot].rank < subsets[yroot].rank)
subsets[xroot].parent = yroot;
else if (subsets[xroot].rank > subsets[yroot].rank)
subsets[yroot].parent = xroot;
// If ranks are same, then make one as root and increment
// its rank by one
else
{
subsets[yroot].parent = xroot;
subsets[xroot].rank++;
}
}
// The main function to construct MST using Kruskal's algorithm
void KruskalMST()
{
Edge result[] = new Edge[V]; // Tnis will store the resultant MST
int e = 0; // An index variable, used for result[]
int i = 0; // An index variable, used for sorted edges
for (i=0; i<V; ++i)
result[i] = new Edge();
// Step 1: Sort all the edges in non-decreasing order of their
// weight. If we are not allowed to change the given graph, we
// can create a copy of array of edges
Arrays.sort(edge);
// Allocate memory for creating V ssubsets
subset subsets[] = new subset[V];
for(i=0; i<V; ++i)
subsets[i]=new subset();
// Create V subsets with single elements
for (int v = 0; v < V; ++v)
{
subsets[v].parent = v;
subsets[v].rank = 0;
}
i = 0; // Index used to pick next edge
// Number of edges to be taken is equal to V-1
while (e < V - 1)
{
// Step 2: Pick the smallest edge. And increment
// the index for next iteration
Edge next_edge = new Edge();
next_edge = edge[i++];
int x = find(subsets, next_edge.src);
int y = find(subsets, next_edge.dest);
// If including this edge does't cause cycle,
// include it in result and increment the index
// of result for next edge
if (x != y)
{
result[e++] = next_edge;
Union(subsets, x, y);
}
// Else discard the next_edge
}
// print the contents of result[] to display
// the built MST
System.out.println("Following are the edges in " +
"the constructed MST");
for (i = 0; i < e; ++i)
System.out.println(result[i].src+" -- " +
result[i].dest+" == " + result[i].weight);
}
// Driver Program
public static void main (String[] args)
{
/* Let us create following weighted graph
10
0--------1
| \ |
6| 5\ |15
| \ |
2--------3
4 */
int V = 4; // Number of vertices in graph
int E = 5; // Number of edges in graph
Graph graph = new Graph(V, E);
// add edge 0-1
graph.edge[0].src = 0;
graph.edge[0].dest = 1;
graph.edge[0].weight = 10;
// add edge 0-2
graph.edge[1].src = 0;
graph.edge[1].dest = 2;
graph.edge[1].weight = 6;
// add edge 0-3
graph.edge[2].src = 0;
graph.edge[2].dest = 3;
graph.edge[2].weight = 5;
// add edge 1-3
graph.edge[3].src = 1;
graph.edge[3].dest = 3;
graph.edge[3].weight = 15;
// add edge 2-3
graph.edge[4].src = 2;
graph.edge[4].dest = 3;
graph.edge[4].weight = 4;
graph.KruskalMST();
}
}
| [
"billydev@gmail.com"
] | billydev@gmail.com |
0e86f3bf0b84077139c6ac07a57b84120d4fb9e5 | 6fc6df9ab41f87aa4a197c8c34c920276979760e | /value-driven/src/dvd_mindmap/impl/EdgeImpl.java | 67ce1008bc8b216986dad19541136d96a229be6a | [] | no_license | erroso/EugeniaDVD | 3f85ee58f346a114341d2dbf5837be4653c691f8 | fb9bc566c408b050cf298f5c34c9975d45cc5818 | refs/heads/master | 2022-01-20T06:20:58.359936 | 2019-07-21T21:24:40 | 2019-07-21T21:24:40 | 198,104,985 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,850 | java | /**
*/
package dvd_mindmap.impl;
import dvd_mindmap.Dvd_mindmapPackage;
import dvd_mindmap.Edge;
import dvd_mindmap.Node;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Edge</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link dvd_mindmap.impl.EdgeImpl#getSource <em>Source</em>}</li>
* <li>{@link dvd_mindmap.impl.EdgeImpl#getTarget <em>Target</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class EdgeImpl extends EObjectImpl implements Edge {
/**
* The cached value of the '{@link #getSource() <em>Source</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSource()
* @generated
* @ordered
*/
protected Node source;
/**
* The cached value of the '{@link #getTarget() <em>Target</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTarget()
* @generated
* @ordered
*/
protected Node target;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected EdgeImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return Dvd_mindmapPackage.Literals.EDGE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Node getSource() {
if (source != null && source.eIsProxy()) {
InternalEObject oldSource = (InternalEObject)source;
source = (Node)eResolveProxy(oldSource);
if (source != oldSource) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, Dvd_mindmapPackage.EDGE__SOURCE, oldSource, source));
}
}
return source;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Node basicGetSource() {
return source;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setSource(Node newSource) {
Node oldSource = source;
source = newSource;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Dvd_mindmapPackage.EDGE__SOURCE, oldSource, source));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Node getTarget() {
if (target != null && target.eIsProxy()) {
InternalEObject oldTarget = (InternalEObject)target;
target = (Node)eResolveProxy(oldTarget);
if (target != oldTarget) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, Dvd_mindmapPackage.EDGE__TARGET, oldTarget, target));
}
}
return target;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Node basicGetTarget() {
return target;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setTarget(Node newTarget) {
Node oldTarget = target;
target = newTarget;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Dvd_mindmapPackage.EDGE__TARGET, oldTarget, target));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case Dvd_mindmapPackage.EDGE__SOURCE:
if (resolve) return getSource();
return basicGetSource();
case Dvd_mindmapPackage.EDGE__TARGET:
if (resolve) return getTarget();
return basicGetTarget();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case Dvd_mindmapPackage.EDGE__SOURCE:
setSource((Node)newValue);
return;
case Dvd_mindmapPackage.EDGE__TARGET:
setTarget((Node)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case Dvd_mindmapPackage.EDGE__SOURCE:
setSource((Node)null);
return;
case Dvd_mindmapPackage.EDGE__TARGET:
setTarget((Node)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case Dvd_mindmapPackage.EDGE__SOURCE:
return source != null;
case Dvd_mindmapPackage.EDGE__TARGET:
return target != null;
}
return super.eIsSet(featureID);
}
} //EdgeImpl
| [
"eurocha@gmail.com"
] | eurocha@gmail.com |
4c04e74df982a84bc6b5f5a15a3a4081967b9f2a | ad14cb93f1ecc057557d1ac886910b3500cfc8ab | /Baek/백준풀이/B0113/Q2442.java | 1a8de8ecf0ab4834a93b9c6ffaceda6f9451d166 | [] | no_license | ksr20612/dataStructure | f36914fc19e61fd6b316ad636fb92febefe344a9 | 7e1cb647d0cabd0bf2d0d0695df7e74644d0253f | refs/heads/master | 2022-04-30T22:14:29.734544 | 2022-04-25T10:15:49 | 2022-04-25T10:15:49 | 239,664,634 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 500 | java | package B0113;
import java.util.Scanner;
public class Q2442 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
for(int i=1;i<=a;i++) { // 돌아가는 바퀴 수
for(int j=a-i;j>=1;j--) { // j = 공백의 개수
System.out.print(" ");
}
for(int k=1;k<=2*i-1;k++) { // k = 별의 개수
System.out.print("*");
}
System.out.println();
}
}
}
| [
"ksr02@DESKTOP-ILITQ34"
] | ksr02@DESKTOP-ILITQ34 |
3cd85206900ed9d5b9591c001cda00cd77cf046b | ff25ab39567161b7314fa00267177480380ffae1 | /simple-spring-memcached/src/test/java/com/google/code/ssm/aop/ReadThroughMultiCacheAdviceCoordTest.java | e2b977cd1fe68bb75586657152829862dd0e0d1a | [
"MIT"
] | permissive | longstudio/simple-spring-memcached | 62058242cddd386a96df073256287ca7b6d1c1b5 | 37d61f27d981a190fff3da0e23c6bb3e1d7f185a | refs/heads/master | 2020-05-20T22:22:45.347259 | 2014-12-02T21:12:45 | 2014-12-02T21:12:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,160 | java | /* Copyright (c) 2014 Jakub Białek
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package com.google.code.ssm.aop;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Matchers.anyObject;
import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeoutException;
import org.aspectj.lang.ProceedingJoinPoint;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Answers;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.runners.MockitoJUnitRunner;
import org.mockito.stubbing.Answer;
import com.google.code.ssm.Cache;
import com.google.code.ssm.aop.support.AnnotationData;
import com.google.code.ssm.aop.support.PertinentNegativeNull;
import com.google.code.ssm.api.ParameterValueKeyProvider;
import com.google.code.ssm.api.ReadThroughMultiCache;
import com.google.code.ssm.api.ReadThroughMultiCacheOption;
import com.google.code.ssm.api.format.SerializationType;
import com.google.code.ssm.providers.CacheException;
/**
*
* @author Jakub Białek
*
*/
@RunWith(MockitoJUnitRunner.class)
public class ReadThroughMultiCacheAdviceCoordTest {
private static final String NS = "T1";
private static final int EXPIRATION = 321;
private final List<String> expected = Arrays.asList("a", "b");
private final Object[] args = new Object[] { Arrays.asList(1, 2) };
private final List<String> cacheKeys = Arrays.asList(NS + ":" + 1, NS + ":" + 2);
@Mock(answer = Answers.RETURNS_DEEP_STUBS)
private CacheBase cacheBase;
@Mock
private ProceedingJoinPoint pjp;
@Mock
private ReadThroughMultiCache annotation;
@Mock
private Cache cache;
@InjectMocks
private ReadThroughMultiCacheAdvice advice = new ReadThroughMultiCacheAdvice();
@Test
public void shouldExecuteMethodAndNotModifyArgsIfAllMiss() throws Throwable {
final Method methodToCache = TestService.class.getMethod("getList", List.class);
initMocks(methodToCache, Collections.<String, Object> emptyMap());
when(pjp.proceed(args)).thenReturn(expected);
final Object result = advice.cacheMulti(pjp);
assertNotNull(result);
assertEquals(expected, result);
verify(pjp).proceed(args);
verify(cache).getBulk(eq(new HashSet<String>(cacheKeys)), any(SerializationType.class));
for (int i = 0; i < expected.size(); i++) {
verify(cache).setSilently(cacheKeys.get(i), EXPIRATION, expected.get(i), null);
}
}
@Test
public void shouldExecuteMethodAndModifyArgsIfSomeMiss() throws Throwable {
final Method methodToCache = TestService.class.getMethod("getList", List.class);
final Object[] modifiedArgs = new Object[] { Arrays.asList(2) };
final Map<String, Object> cacheResponse = Collections.<String, Object> singletonMap(cacheKeys.get(0), expected.get(0));
initMocks(methodToCache, cacheResponse);
when(pjp.proceed(modifiedArgs)).thenReturn(Collections.singletonList("b"));
final Object result = advice.cacheMulti(pjp);
assertNotNull(result);
assertEquals(expected, result);
verify(pjp).proceed(modifiedArgs);
verify(cache).getBulk(eq(new HashSet<String>(cacheKeys)), any(SerializationType.class));
verify(cache).setSilently(NS + ":" + 2, EXPIRATION, "b", null);
}
@Test
public void shouldNotExecuteMethodIfAllHits() throws Throwable {
final Method methodToCache = TestService.class.getMethod("getList", List.class);
final Map<String, Object> cacheResponse = new HashMap<String, Object>();
cacheResponse.put(cacheKeys.get(0), expected.get(0));
cacheResponse.put(cacheKeys.get(1), expected.get(1));
initMocks(methodToCache, cacheResponse);
final Object result = advice.cacheMulti(pjp);
assertNotNull(result);
assertEquals(expected, result);
verify(cache).getBulk(eq(new HashSet<String>(cacheKeys)), any(SerializationType.class));
verify(pjp, never()).proceed(any(Object[].class));
verify(cache, never()).setSilently(anyString(), anyInt(), anyObject(), any(SerializationType.class));
}
@Test
public void shouldNotAddNullsToCache() throws Throwable {
final Method methodToCache = TestService.class.getMethod("getList", List.class);
final List<String> expected = Collections.emptyList();
initMocks(methodToCache, Collections.<String, Object> emptyMap());
when(pjp.proceed(args)).thenReturn(expected);
final Object result = advice.cacheMulti(pjp);
assertNotNull(result);
assertEquals(expected, result);
verify(pjp).proceed(args);
verify(cache).getBulk(eq(new HashSet<String>(cacheKeys)), any(SerializationType.class));
verify(cache, never()).setSilently(anyString(), anyInt(), anyObject(), any(SerializationType.class));
verify(cache, never()).addSilently(anyString(), anyInt(), anyObject(), any(SerializationType.class));
}
@Test
public void shouldAddNullsToCache() throws Throwable {
final Method methodToCache = TestService.class.getMethod("getListCacheNulls", List.class);
final List<String> expected = Collections.emptyList();
initMocks(methodToCache, Collections.<String, Object> emptyMap());
when(pjp.proceed(args)).thenReturn(expected);
final Object result = advice.cacheMulti(pjp);
assertNotNull(result);
assertEquals(expected, result);
verify(pjp).proceed(args);
verify(cache).getBulk(eq(new HashSet<String>(cacheKeys)), any(SerializationType.class));
verify(cache, never()).setSilently(anyString(), anyInt(), anyObject(), any(SerializationType.class));
verify(cache).addSilently(eq(cacheKeys.get(0)), eq(EXPIRATION), eq(PertinentNegativeNull.NULL), any(SerializationType.class));
verify(cache).addSilently(eq(cacheKeys.get(1)), eq(EXPIRATION), eq(PertinentNegativeNull.NULL), any(SerializationType.class));
}
private void initMocks(final Method methodToCache, final Map<String, Object> cacheResponse) throws NoSuchMethodException,
TimeoutException, CacheException {
when(pjp.getArgs()).thenReturn(args);
when(cacheBase.getMethodToCache(pjp)).thenReturn(methodToCache);
when(cacheBase.getCache(any(AnnotationData.class))).thenReturn(cache);
when(cacheBase.getSubmission(anyObject())).thenAnswer(new Answer<Object>() {
@Override
public Object answer(InvocationOnMock invocation) throws Throwable {
return (invocation.getArguments()[0] == null) ? PertinentNegativeNull.NULL : invocation.getArguments()[0];
}
});
when(cacheBase.getCacheKeyBuilder().getCacheKeys(any(AnnotationData.class), eq(args), eq(methodToCache.toString()))).thenReturn(
cacheKeys);
when(cache.getBulk(eq(new HashSet<String>(cacheKeys)), any(SerializationType.class))).thenReturn(cacheResponse);
}
private static class TestService {
@ReadThroughMultiCache(namespace = NS, expiration = EXPIRATION)
public List<String> getList(@ParameterValueKeyProvider final List<Integer> id1) {
return Collections.<String> emptyList();
}
@ReadThroughMultiCache(namespace = NS, expiration = EXPIRATION, option = @ReadThroughMultiCacheOption(addNullsToCache = true))
public List<String> getListCacheNulls(@ParameterValueKeyProvider final List<Integer> id1) {
return Collections.<String> emptyList();
}
}
}
| [
"ragnor84@gmail.com"
] | ragnor84@gmail.com |
fa83346dec267a596c0bdac38475d32aa4c64be9 | 1b881eca1733586e66f260d7ef090e6eca2d7395 | /salesconnect/src/main/java/com/orgin/sales/controller/ProductController.java | 6f46b533f2f133c5d724673c35151dc3011dce86 | [] | no_license | BALASILVA/sales-connect | 219a059655492ded78ae0149a53d22428fd41274 | 8a1c5efd3136570e761de991ed0cc6c751a731e6 | refs/heads/master | 2022-12-08T03:15:06.366157 | 2020-09-06T09:58:05 | 2020-09-06T09:58:05 | 293,244,357 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,955 | java | package com.orgin.sales.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import com.orgin.sales.model.Product;
import com.orgin.sales.model.User;
import com.orgin.sales.service.ProductService;
import com.orgin.sales.validator.ProductDetailValidation;
@RestController
public class ProductController {
@Autowired
private ProductService productService;
@Autowired
ProductDetailValidation productDetailValidator;
@GetMapping(value = "/product")
@PreAuthorize("hasRole('ADMIN') or hasRole('USER')")
public ResponseEntity<List<Product>> getAllUserByAdmin()
{
List<Product> users = productService.findAll();
return new ResponseEntity<List<Product>>(users,HttpStatus.OK);
}
@PostMapping(value = "/product")
@PreAuthorize("hasRole('ADMIN') or hasRole('USER')")
public ResponseEntity<List<Product>> findAllByAdminId(@RequestBody User user)
{
List<Product> users = productService.findAllByAdminId(user.getAdminId());
return new ResponseEntity<List<Product>>(users,HttpStatus.OK);
}
@PostMapping(value = "/addproduct")
@PreAuthorize("hasRole('ADMIN') or hasRole('USER')")
public Boolean addProduct(@RequestBody Product product)
{
if(productDetailValidator.validateProduct(product)) {
Product dbProduct = productService.save(product);
if(dbProduct!=null)
{
return true;
}
else
{
return false;
}
}
else
{
return false;
}
}
}
| [
"ELCOT@Lenovo"
] | ELCOT@Lenovo |
c5bd6cc6c35028ab1a1e8d2ddb0f59ef06bda4d0 | 552e913586857480fac3649366edff3b7484f291 | /ppmtool/src/main/java/com/example/demo/services/CustomUserDetailService.java | f25bf320b104b014776ab2dad1839198393856ca | [] | no_license | pranshu30/AgilePPMTool | 8f838398d262b54f5b7814c776d50c3f51a53b18 | 918f8dd54f7399055f0feade659b8219d57c97e1 | refs/heads/master | 2020-04-19T13:10:22.467603 | 2019-02-15T18:00:09 | 2019-02-15T18:00:09 | 168,211,070 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,144 | java | package com.example.demo.services;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.example.demo.domain.User;
import com.example.demo.repositories.UserRepository;
@Service
public class CustomUserDetailService implements UserDetailsService{
@Autowired
private UserRepository userRepository;
@Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
// TODO Auto-generated method stub
User user = userRepository.findByUsername(username);
if(user==null) new UsernameNotFoundException("Username not found");
return user;
}
@Transactional
public User loadUserById(Long id) {
User user = userRepository.getById(id);
if(user==null) new UsernameNotFoundException("Username not found");
return user;
}
}
| [
"pranshu11@bitbucket.org"
] | pranshu11@bitbucket.org |
427bc874da133771144cda0cdba4653016a3dc33 | 8358717b853f240843ffa56784773a29b1efc19e | /service-interface-wms/src/main/java/com/jumbo/wms/model/vmi/etamData/EtamSales.java | d946ef79a113d0d28ce7a46c01db41c2f0af6a6d | [] | no_license | huanglongf/enterprise_project | 65ec3e2c56e4a2909f0881a9276a9966857bb9c7 | de1865e638c9620e702818124f0b2deac04028c9 | refs/heads/master | 2020-05-07T13:25:07.223338 | 2018-10-21T08:44:33 | 2018-10-21T08:44:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,209 | java | package com.jumbo.wms.model.vmi.etamData;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import org.hibernate.annotations.OptimisticLockType;
import com.jumbo.wms.model.BaseModel;
@Entity
@Table(name = "T_ETAM_SALES")
@org.hibernate.annotations.Entity(optimisticLock = OptimisticLockType.VERSION)
public class EtamSales extends BaseModel {
private static final long serialVersionUID = 1886748693308476590L;
public final static Integer STATUS_NEW = 0;// 未发送
public final static Integer STATUS_SENT = 1;// 发送成功
public final static Integer STATUS_DOING = 5;// 正在同步发送
public final static Integer STATUS_ERROR = 101;// 异常情况,失败
private Long id;
private Long soId;
private String orderNo;
private String skuNo;
private String sSize;
private String color;
private Long qty;
private Long shopId;
private String sysType;
private String vipId;
private String oriOrderNo;
private String batchId;
private BigDecimal totalActual;
private BigDecimal netRetail;
private Integer status;
private String msg;
private Date storeCreateTime;
private Date version;
/**
* 创建时间
*
* @return
*/
private Date createTime;
@Id
@Column(name = "ID")
@SequenceGenerator(name = "SEQ_T_ETAM_SALES", sequenceName = "S_T_ETAM_SALES", allocationSize = 1)
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_T_ETAM_SALES")
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
@Column(name = "SO_ID")
public Long getSoId() {
return soId;
}
public void setSoId(Long soId) {
this.soId = soId;
}
@Column(name = "ORDER_NO", length = 100)
public String getOrderNo() {
return orderNo;
}
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
@Column(name = "SKU_CODE", length = 100)
public String getSkuNo() {
return skuNo;
}
public void setSkuNo(String skuNo) {
this.skuNo = skuNo;
}
@Column(name = "SSIZE", length = 20)
public String getsSize() {
return sSize;
}
public void setsSize(String sSize) {
this.sSize = sSize;
}
@Column(name = "COLOR", length = 20)
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
@Column(name = "QTY")
public Long getQty() {
return qty;
}
public void setQty(Long qty) {
this.qty = qty;
}
@Column(name = "SHOP_ID")
public Long getShopId() {
return shopId;
}
public void setShopId(Long shopId) {
this.shopId = shopId;
}
@Column(name = "SYS_TYPE", length = 2)
public String getSysType() {
return sysType;
}
public void setSysType(String sysType) {
this.sysType = sysType;
}
@Column(name = "VIP_ID", length = 20)
public String getVipId() {
return vipId;
}
public void setVipId(String vipId) {
this.vipId = vipId;
}
@Column(name = "ORI_ORDER_NO", length = 100)
public String getOriOrderNo() {
return oriOrderNo;
}
public void setOriOrderNo(String oriOrderNo) {
this.oriOrderNo = oriOrderNo;
}
@Column(name = "BATCH_ID", length = 25)
public String getBatchId() {
return batchId;
}
public void setBatchId(String batchId) {
this.batchId = batchId;
}
@Column(name = "TOTAL_ACTUAL")
public BigDecimal getTotalActual() {
return totalActual;
}
public void setTotalActual(BigDecimal totalActual) {
this.totalActual = totalActual;
}
@Column(name = "NET_RETAIL")
public BigDecimal getNetRetail() {
return netRetail;
}
public void setNetRetail(BigDecimal netRetail) {
this.netRetail = netRetail;
}
@Column(name = "STATUS", length = 3)
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
@Column(name = "MSG", length = 100)
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
@Column(name = "STORE_CREATE_TIME")
public Date getStoreCreateTime() {
return storeCreateTime;
}
public void setStoreCreateTime(Date storeCreateTime) {
this.storeCreateTime = storeCreateTime;
}
@Column(name = "VERSION")
public Date getVersion() {
return version;
}
public void setVersion(Date version) {
this.version = version;
}
@Column(name = "CREATE_TIME")
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}
| [
"lijg@many-it.com"
] | lijg@many-it.com |
10bbddd9a62ff1339f39cc5381f16028b4d9057e | 238c2d32ffa3f91f200af5e004ab4e66b568965e | /app/src/main/java/com/example/notesapp/entities/Note.java | ce688646af574d74132f28675c65a367b28c1cd2 | [] | no_license | Asmaa-k/NotesApp | 287dd4b7002c64351e4f006b5ffc9d263e5b1b25 | b98caad4c30fd8daf9fbfe9eb5ed0ddcfe24f149 | refs/heads/master | 2020-05-09T16:08:42.643346 | 2019-04-14T05:17:33 | 2019-04-14T05:17:33 | 181,260,290 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,038 | java | package com.example.notesapp.entities;
import android.arch.persistence.room.ColumnInfo;
import android.arch.persistence.room.Entity;
import android.arch.persistence.room.PrimaryKey;
import android.os.Parcel;
import android.os.Parcelable;
@Entity(tableName = "note_table")
public class Note implements Parcelable {
@PrimaryKey(autoGenerate = true)
private int id;
private String title;
@ColumnInfo(name = "note")
private String NoteContent;
@ColumnInfo(name = "date")
private long timeStamp;
public Note(String title, String noteContent, long time) {
this.title = title;
NoteContent = noteContent;
this.timeStamp = time;
}
public Note() { }
protected Note(Parcel in) {
id = in.readInt();
title = in.readString();
NoteContent = in.readString();
timeStamp = in.readLong();
}
public static final Creator<Note> CREATOR = new Creator<Note>() {
@Override
public Note createFromParcel(Parcel in) {
return new Note(in);
}
@Override
public Note[] newArray(int size) {
return new Note[size];
}
};
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getNoteContent() {
return NoteContent;
}
public void setNoteContent(String noteContent) {
NoteContent = noteContent;
}
public long getTimeStamp() {
return timeStamp;
}
public void setTimeStamp(long timeStamp) {
this.timeStamp = timeStamp;
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(id);
dest.writeString(title);
dest.writeString(NoteContent);
dest.writeLong(timeStamp);
}
} | [
"47636256+Asmaa-k@users.noreply.github.com"
] | 47636256+Asmaa-k@users.noreply.github.com |
b4b2b02358133c8299e5d0200d444ced59619c2f | 5547e4f1cba7b92c301a9421bdcc91534f273166 | /MyBooksAtHome/app/src/main/java/be/gershon_lehrer/mybooksathome/controller/fragments/BookDetailFragment.java | f2a886655a3f249627f3ea9cb5dd3dc6436c58fa | [] | no_license | lehrer/AndroidStuff | 0064beed94d9e9870186ad6b75e9499551ed90bc | 9fdbb05a52af1f6c49a5b3f4b9a07d6d6c98ad11 | refs/heads/master | 2021-01-24T03:09:10.296798 | 2017-04-25T14:59:57 | 2017-04-25T14:59:57 | 68,606,147 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,599 | java | package be.gershon_lehrer.mybooksathome.controller.fragments;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import be.gershon_lehrer.mybooksathome.App;
import be.gershon_lehrer.mybooksathome.controller.LibraryManagement;
import be.gershon_lehrer.mybooksathome.controller.PreviewGoogleBookWebviewActivity;
import be.gershon_lehrer.mybooksathome.R;
import be.gershon_lehrer.mybooksathome.model.Book;
import be.gershon_lehrer.mybooksathome.model.SearchTypeLocalDB;
/**
* Created by gershonlehrer on 08/07/16.
*/
public class BookDetailFragment extends Fragment{
private TextView mTitle, mShortDescription, mAuthor, mBookDescription, mBookAuthor, mBookISBN;
private ImageView mBookThumbnail;
private Book mBook;
private ImageButton mGetGoogleBookPreviewButton;
private Toolbar mToolbar;
private static final String POSITION="be.gershon-lehrer.mybooksathome.book_detail_position";
private static final String PREVIEWBOOKISBN="be.gershon-lehrer.mybooksathome.book_detail_google_book_preview_ISBN";
// public static BookDetailFragment newInstance(Book book){
// mBook.importChanges(book);
// BookDetailFragment fragment=new BookDetailFragment();
// return fragment;
// }
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Bundle bundle = this.getArguments();
int position = bundle.getInt(POSITION);
mBook=new Book();
mBook.importChanges(App.getInstance().getBookList().get(position));
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.book_detail_layout, container, false);
super.onCreate(savedInstanceState);
mBookThumbnail = (ImageView) v.findViewById(R.id.book_detail_layout_imageView);
mTitle = (TextView) v.findViewById(R.id.book_detail_layout_book_title);
mAuthor = (TextView) v.findViewById(R.id.book_detail_layout_book_author);
mBookDescription = (TextView) v.findViewById(R.id.book_detail_layout_book_long_description);
//mShortDescription = (TextView) v.findViewById(R.id.book_detail_layout_book_short_description);
mBookISBN = (TextView) v.findViewById(R.id.book_detail_layout_textViewISBN);
//toolbar met drie bolletjes en menu laden en inflaten
mToolbar = (Toolbar)v.findViewById(R.id.book_detail_layout_card_toolbar);
mToolbar.inflateMenu(R.menu.book_item_view_holder_toolbar_menu);
if (App.isInLocalDB(mBook)) {
mToolbar.getMenu().findItem(R.id.menu_item_copy_to_db).setEnabled(false);
mToolbar.getMenu().findItem(R.id.menu_item_delete_from_db).setEnabled(true);
} else {
mToolbar.getMenu().findItem(R.id.menu_item_copy_to_db).setEnabled(true);
mToolbar.getMenu().findItem(R.id.menu_item_delete_from_db).setEnabled(false);
}
//ToolBar en Menu actions:
mToolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
switch (item.getItemId()) {
case R.id.menu_item_copy_to_db:
LibraryManagement.addOrUpdateBook(mBook);
item.setEnabled(false);
mToolbar.getMenu().findItem(R.id.menu_item_delete_from_db).setEnabled(true); //eigenlijk overbodig omdat Recyclerviewer geupdated dient te worden
break;
case R.id.menu_item_delete_from_db:
boolean deleted=LibraryManagement.deleteSpecificBook(mBook);
if (deleted) Toast.makeText(App.getContext(),String.format(getString(R.string.has_been_deleted),mBook.getTitle()),Toast.LENGTH_LONG).show();
else Toast.makeText(App.getContext(),String.format(getString(R.string.has_not_been_deleted),mBook.getTitle()),Toast.LENGTH_LONG).show();
item.setEnabled(false);
mToolbar.getMenu().findItem(R.id.menu_item_copy_to_db).setEnabled(true); //eigenlijk overbodig omdat Recyclerviewer geupdated dient te worden
App.getInstance().setBookList(LibraryManagement.getAllBooks(App.getContext()));
}
return true;
}
});
//GoogleBooks Preview Button
mGetGoogleBookPreviewButton=(ImageButton)v.findViewById(R.id.preview_google_book_link_button);
if (mBook.getPreviewLink().length()<=0){
mGetGoogleBookPreviewButton.setVisibility(View.INVISIBLE);
}
else {
mGetGoogleBookPreviewButton.setVisibility(View.VISIBLE);
mGetGoogleBookPreviewButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Log.d(App.getTAG(),"STARTING INTENT with"+mBook.getISBN());
Intent intent=new Intent(v.getContext(), PreviewGoogleBookWebviewActivity.class);
intent.putExtra(PREVIEWBOOKISBN,mBook.getISBN());
startActivity(intent);
}
});
}
mTitle.setText(mBook.getTitle());
mBookDescription.setText(mBook.getDescription());
String authorNames = App.getContext().getString(R.string.Author_s);
for (int i = 0; i < mBook.getAuthors().size(); i++) {
authorNames += mBook.getAuthors().get(i).getName();
//if there is a next author in the list, we need to add a newline and a comma
if (i < mBook.getAuthors().size() - 1) authorNames += ",\n";
}
mAuthor.setText(authorNames);
mBookISBN.setText(this.getString(R.string.isbn) + ": " + mBook.getISBN());
ImageLoader imageLoader=App.getImageLoader();
String uriBookThumbnail=mBook.getThumbnailURL();
// Load image, decode it to Bitmap and display Bitmap in ImageView (or any other view
// which implements ImageAware interface)
if (uriBookThumbnail!="") {
DisplayImageOptions options = new DisplayImageOptions.Builder().cacheOnDisk(true).cacheInMemory(true).build();
imageLoader.displayImage(uriBookThumbnail, mBookThumbnail, options);
Log.d(App.getTAG(), "RESULTSNULL?" + LibraryManagement.getExactSameBook(mBook.getId(), SearchTypeLocalDB.UID) != null ? "null" : LibraryManagement.getExactSameBook(mBook.getId(), SearchTypeLocalDB.UID).getTitle());
}
else{
//"drawable://" + R.drawable.img // from drawables (non-9patch images)
uriBookThumbnail="drawable://"+R.drawable.no_image_found_en;
DisplayImageOptions options = new DisplayImageOptions.Builder().cacheOnDisk(true).cacheInMemory(true).build();
imageLoader.displayImage(uriBookThumbnail, mBookThumbnail, options);
}
return v;
}
}
| [
"gershonlehrer@Gershons-MacBook-Pro.local"
] | gershonlehrer@Gershons-MacBook-Pro.local |
57e73578c8eb3806f1fa048550fd2960062eb448 | 08ba956a0e0e6101bc9f09b5ab134cc533982a90 | /mall-order/src/main/java/com/krill/mall/order/entity/OrderReturnReasonEntity.java | 5c6f4e5e8b7aff46e520530d2862fd1760683b57 | [
"Apache-2.0"
] | permissive | krillingone/CopyMall | 60cb8ae86ba64e220f2732f7b9d93adb3c87d870 | 90094df8cb2fc50d44e38b880c0e182a141de59e | refs/heads/master | 2023-05-31T00:43:14.971804 | 2021-06-28T09:15:53 | 2021-06-28T09:15:53 | 347,898,191 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 735 | java | package com.krill.mall.order.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 退货原因
*
* @author krill9594
* @email krilling.one@gmail.com
* @date 2021-03-16 23:23:49
*/
@Data
@TableName("oms_order_return_reason")
public class OrderReturnReasonEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId
private Long id;
/**
* 退货原因名
*/
private String name;
/**
* 排序
*/
private Integer sort;
/**
* 启用状态
*/
private Integer status;
/**
* create_time
*/
private Date createTime;
}
| [
"krilling.one@gmail.com"
] | krilling.one@gmail.com |
167aec03a58502a34bf8bed8026fe7030897e598 | c70309e89829b2ab3646fc7a94d299039c5720e7 | /service-shop/service/src/main/java/com/resto/service/shop/entity/ShopCart.java | 258192d21e11473c34178645a020871b84e2d404 | [] | no_license | Catfeeds/tongyong | d014c93cc0e327ae8e4643e7b414db83b91aacf5 | 3f85464f1e9cfaa12b23efa4ddade7ee08ab0804 | refs/heads/master | 2020-08-27T22:51:00.904615 | 2019-10-22T06:44:41 | 2019-10-22T06:44:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 756 | java | package com.resto.service.shop.entity;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class ShopCart implements Serializable {
private static final long serialVersionUID = 4039632860998800248L;
private Integer id;
private Integer number;
private String customerId;
private String articleId;
private String shopDetailId;
private Integer distributionModeId;
private String userId;
private String shopType;
private Integer pid;
private List<ShopCart> currentItem;
private Integer attrId;
private String recommendId;
private String recommendArticleId;
private String unitNewId;
private List<ShopCart> unitList;
private String uuid;
} | [
"disvenk@163.com"
] | disvenk@163.com |
2923cbc400e5e1f63d922f5236e2dec1f7a8a752 | 436ba3c9280015b6473f6e78766a0bb9cfd21998 | /parent/web/src/main/java/by/itacademy/keikom/taxi/web/dto/BrandDTO.java | d2a679bdd8713669b1f3247449f4e28dac29ee11 | [] | no_license | KeMihail/parent | 4ba61debc5581f29a6cabfe2a767dbdeaed57eb6 | 398a7617d7a4c94703e3d85daca1e3b22d8920fa | refs/heads/master | 2022-12-24T09:31:34.156316 | 2019-06-13T20:29:10 | 2019-06-13T20:29:10 | 191,828,552 | 0 | 0 | null | 2022-12-15T23:25:17 | 2019-06-13T20:26:20 | Java | UTF-8 | Java | false | false | 368 | java | package by.itacademy.keikom.taxi.web.dto;
import java.sql.Timestamp;
public class BrandDTO {
private Integer id;
private String name;
public BrandDTO() {
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
| [
"mihaila4038@gmail.com"
] | mihaila4038@gmail.com |
f7c1cc92ad5481c8026aa4b4e6bc7939236ed50f | e3a37aaf17ec41ddc7051f04b36672db62a7863d | /common-service/user-service-project/user-service/src/main/java/com/iot/user/entity/Role.java | c56b829dc0836dda49f1c4609b2a5a15144c08c9 | [] | no_license | github4n/cloud | 68477a7ecf81d1526b1b08876ca12cfe575f7788 | 7974042dca1ee25b433177e2fe6bda1de28d909a | refs/heads/master | 2020-04-18T02:04:33.509889 | 2019-01-13T02:19:32 | 2019-01-13T02:19:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,874 | java | package com.iot.user.entity;
import java.util.Date;
/**
* 项目名称:立达信IOT云平台
* 模块名称:权限模块
* 功能描述:角色信息
* 创建人: 490485964@qq.com
* 创建时间:2018年06月28日 16:58
* 修改人: 490485964@qq.com
* 修改时间:2018年06月28日 16:58
*/
public class Role {
/**
* 角色id,自动增长
*/
private Long id;
/**
* 角色编码 role_type为1时才有值
*/
private String roleCode;
/**
* 角色名称
*/
private String roleName;
/**
* 角色类型 (1:默认角色;2:自定义角色)
*/
private Integer roleType;
/**
* 用户级别
*/
private Integer userLevel;
/**
* 租户id 当用户级别为1时,租户id可为空
*/
private Long tenantId;
/**
* 角色描述
*/
private String desc;
/**
* 创建时间
*/
private Date createTime;
/**
* 修改时间
*/
private Date updateTime;
/**
* 数据有效性(0:失效,1:有效)
*/
private Integer dataStatus;
/**
* 角色id,自动增长
*
* @return id - 角色id,自动增长
*/
public Long getId() {
return id;
}
/**
* 角色id,自动增长
*
* @param id 角色id,自动增长
*/
public void setId(Long id) {
this.id = id;
}
/**
* 角色编码 role_type为1时才有值
*
* @return role_code - 角色编码 role_type为1时才有值
*/
public String getRoleCode() {
return roleCode;
}
/**
* 角色编码 role_type为1时才有值
*
* @param roleCode 角色编码 role_type为1时才有值
*/
public void setRoleCode(String roleCode) {
this.roleCode = roleCode;
}
/**
* 角色名称
*
* @return role_name - 角色名称
*/
public String getRoleName() {
return roleName;
}
/**
* 角色名称
*
* @param roleName 角色名称
*/
public void setRoleName(String roleName) {
this.roleName = roleName;
}
/**
* 角色类型 (1:默认角色;2:自定义角色)
*
* @return role_type - 角色类型 (1:默认角色;2:自定义角色)
*/
public Integer getRoleType() {
return roleType;
}
/**
* 角色类型 (1:默认角色;2:自定义角色)
*
* @param roleType 角色类型 (1:默认角色;2:自定义角色)
*/
public void setRoleType(Integer roleType) {
this.roleType = roleType;
}
/**
* 用户级别
*
* @return user_level - 用户级别
*/
public Integer getUserLevel() {
return userLevel;
}
/**
* 用户级别
*
* @param userLevel 用户级别
*/
public void setUserLevel(Integer userLevel) {
this.userLevel = userLevel;
}
/**
* 租户id 当用户级别为1时,租户id可为空
*
* @return tenant_id - 租户id 当用户级别为1时,租户id可为空
*/
public Long getTenantId() {
return tenantId;
}
/**
* 租户id 当用户级别为1时,租户id可为空
*
* @param tenantId 租户id 当用户级别为1时,租户id可为空
*/
public void setTenantId(Long tenantId) {
this.tenantId = tenantId;
}
/**
* 角色描述
*
* @return desc - 角色描述
*/
public String getDesc() {
return desc;
}
/**
* 角色描述
*
* @param desc 角色描述
*/
public void setDesc(String desc) {
this.desc = desc;
}
/**
* 创建时间
*
* @return create_time - 创建时间
*/
public Date getCreateTime() {
return createTime;
}
/**
* 创建时间
*
* @param createTime 创建时间
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* 修改时间
*
* @return update_time - 修改时间
*/
public Date getUpdateTime() {
return updateTime;
}
/**
* 修改时间
*
* @param updateTime 修改时间
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
/**
* 数据有效性(0:失效,1:有效)
*
* @return data_status - 数据有效性(0:失效,1:有效)
*/
public Integer getDataStatus() {
return dataStatus;
}
/**
* 数据有效性(0:失效,1:有效)
*
* @param dataStatus 数据有效性(0:失效,1:有效)
*/
public void setDataStatus(Integer dataStatus) {
this.dataStatus = dataStatus;
}
} | [
"qizhiyong@LDS-Z-C5497.LEEDARSON.LOCAL"
] | qizhiyong@LDS-Z-C5497.LEEDARSON.LOCAL |
50413c1cd4f134df6d6d95af15eea9a38ebb4cb0 | 3bab3736a21267f7c4a6a11f7461100316806b17 | /redbus1/src/redbus1_homepage/TC_3.java | 847dd954e4576d178c038ff2adf66405fbfc5ddd | [] | no_license | sirishatumma/redbus1 | 231d9c3e995c2f2db62ec64af94304b5ae91bd82 | 24002648518e55d63421b788a049b0a751e6b1e2 | refs/heads/master | 2023-04-01T03:08:43.229518 | 2021-04-09T05:07:02 | 2021-04-09T05:07:02 | 356,139,753 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 738 | java | package redbus1_homepage;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class TC_3 {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.setProperty("webdriver.chrome.driver", "D:\\selenium download\\browser driver\\chromedriver.exe");
WebDriver rb=new ChromeDriver();
rb.get("https://www.redbus.in/");
rb.manage().window().maximize();
rb.findElement(By.id("pilgrimages")).click();
System.out.println(rb.getTitle());
if(rb.getTitle().equals("redBus")) {
System.out.println("TC_2 Pass");
}
else {
System.out.println("TC_2 Fail");
}
rb.close();
}
}
| [
"ram@10.0.0.4"
] | ram@10.0.0.4 |
efc876f07b5b0158f2b6fb438094d0c8373e6c9b | 870ab3409872f1a226a8feb101372c93942cf448 | /app/src/main/java/tads/eaj/com/projetotubarao/dao/UsuarioDAOImpl.java | c25fede100bd193f82ef1b256e4d9f97fa41b2b3 | [] | no_license | taniro/TubaraoProject | df87127f667fe85338de54c99e28aa85b156c094 | 1c7086baae8ef06cabad8260ed7a49f6a2640de5 | refs/heads/master | 2020-05-25T11:32:14.282028 | 2016-08-12T15:03:38 | 2016-08-12T15:03:38 | 65,519,435 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,562 | java | package tads.eaj.com.projetotubarao.dao;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import java.util.ArrayList;
import java.util.List;
import tads.eaj.com.projetotubarao.util.TubaraoDB;
import tads.eaj.com.projetotubarao.model.Usuario;
/**
* Created by Taniro on 01/06/2016.
* Adaptado por Laércio & Filipe 07/06/2016
*/
public class UsuarioDAOImpl implements UsuarioDAO {
private SQLiteDatabase bd;
public UsuarioDAOImpl(Context context) {
TubaraoDB auxBd = new TubaraoDB(context);
bd = auxBd.getWritableDatabase();
}
public void inserir(Usuario usuario) {
ContentValues valores = new ContentValues();
valores.put("nome", usuario.getNome());
valores.put("tipo", usuario.getTipo());
valores.put("email", usuario.getEmail());
valores.put("fone", usuario.getFone());
valores.put("matricula", usuario.getMatricula());
valores.put("curso", usuario.getCurso());
valores.put("ativo", usuario.getAtivo());
bd.insert("usuario", null, valores);
bd.close();
}
public void atualizar(Usuario usuario) {
ContentValues valores = new ContentValues();
valores.put("nome", usuario.getNome());
valores.put("tipo", usuario.getTipo());
valores.put("email", usuario.getEmail());
valores.put("fone", usuario.getFone());
valores.put("matricula", usuario.getMatricula());
valores.put("curso", usuario.getCurso());
valores.put("ativo", usuario.getAtivo());
bd.update("usuario", valores, "_id = ?", new String[]{"" + usuario.getIdUsuario()});
bd.close();
}
//public void deletar(Livro livro){bd.delete("livro", "_id = "+livro.getId_livro(), null);
//}
public List<Usuario> buscar() {
List<Usuario> list = new ArrayList<Usuario>();
String[] colunas = new String[]{"_id", "nome", "email", "fone", "matricula", "curso"};
Cursor cursor = bd.query("usuario", colunas, null, null, null, null, "nome ASC");
if (cursor.getCount() > 0) {
cursor.moveToFirst();
do {
Usuario l = new Usuario();
l.setIdUsuario(cursor.getInt(0));
l.setNome(cursor.getString(1));
l.setEmail(cursor.getString(2));
l.setFone(cursor.getString(3));
l.setMatricula(cursor.getString(4));
l.setCurso(cursor.getString(5));
list.add(l);
} while (cursor.moveToNext());
}
bd.close();
return (list);
}
//METODO IMPLEMENTADO QUE RECEBE DUAS STRINGS E RETORNA UM USUARIO
@Override
public Usuario buscarUser(String matricula) {
Cursor cursor = bd.rawQuery("SELECT * FROM USUARIO WHERE MATRICULA=? AND ATIVO=?;", new String[]{matricula,"1"});
if (cursor.getCount() > 0) {
cursor.moveToFirst();
Usuario l = new Usuario();
l.setIdUsuario(cursor.getInt(0));
l.setNome(cursor.getString(1));
l.setTipo(cursor.getInt(2));
l.setEmail(cursor.getString(3));
l.setFone(cursor.getString(4));
l.setMatricula(cursor.getString(5));
l.setCurso(cursor.getString(6));
l.setAtivo(cursor.getInt(7));
cursor.close();
bd.close();
return l;
} else {
return null;
}
}
} | [
"alakazamxdgithub12"
] | alakazamxdgithub12 |
5182add88c9fcf64ecc681e48f5177b19bd80183 | 9f3c0b95d5a8dcc776dd76b06945cd3ad535366a | /Work 2/ConstantesMatematicas/src/ConstantesMatematicas.java | fc355365b2d89c66aef91ed43470bd43afdf4de5 | [] | no_license | bentodvictor/ufsm-java | 9035c69110e4a9767f8898630dd484189f79babf | 68a89aa670f9aae395cad8d47d071b72a64e633b | refs/heads/master | 2023-04-12T19:53:40.964544 | 2021-05-09T21:55:38 | 2021-05-09T21:55:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 378 | java |
public class ConstantesMatematicas {
// A raiz quadrada de 2
final static public double raizDe2 = 1.4142135623730950488;
// A raiz quadrada de 3
final static public double raizDe3 = 1.7320508075688772935;
// A raiz quadrada de 5
final static public double raizDe5 = 2.2360679774997896964;
// A raiz quadrada de 6
final static public double raizDe6 = raizDe2*raizDe3;
}
| [
"victordallbento@yahoo.com.br"
] | victordallbento@yahoo.com.br |
ca1967a4ead4e1e463c3661b3c81a89dd06b68b2 | 3623abdf222f5102f595a9ab3889a75ddca753ec | /Example-Spring/main/java/model/AutoType.java | 07b19e52e92afe5ddb59e2eb0b9cf43da853c2a0 | [] | no_license | Pomeo44/AutoService | 3d92fce8cade551767dfc3e13395ee92d1a8c2e0 | 70c9d973eb9cb6fb65cd9f0b4fc2f6b86b47c42f | refs/heads/master | 2021-01-10T16:05:42.861064 | 2017-09-16T13:22:10 | 2017-09-16T13:22:10 | 44,000,664 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,162 | java | package model;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import javax.persistence.*;
import java.util.HashSet;
import java.util.Set;
/**
* Created by Pomeo on 20.10.2016.
*/
@Entity
@Table(name = "AUTO_TYPE")
public class AutoType extends BaseEntity {
@JsonProperty
private Integer id;
@JsonProperty
private String name;
@JsonProperty
private Boolean isDelete;
@JsonIgnore
private Set<AutoModel> autoModels = new HashSet<AutoModel>();
@JsonIgnore
private Set<Price> prices = new HashSet<Price>();
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name = "AUTO_TYPE_ID", unique = true, nullable = false)
@Override
public Integer getId() {
return id;
}
public void setId(Integer autoTypeId) {
this.id = autoTypeId;
}
@Basic
@Column(name = "NAME", nullable = false, length = 100)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Basic
@Column(name = "IS_DELETE", nullable = false)
public Boolean getIsDelete() {
return isDelete;
}
public void setIsDelete(Boolean isDelete) {
this.isDelete = isDelete;
}
@OneToMany(mappedBy = "autoType", fetch = FetchType.LAZY)
public Set<AutoModel> getAutoModels() {
return autoModels;
}
public void setAutoModels(Set<AutoModel> autoModels) {
this.autoModels = autoModels;
}
@OneToMany(mappedBy = "autoType", fetch = FetchType.LAZY)
public Set<Price> getPrices() {
return prices;
}
public void setPrices(Set<Price> prices) {
this.prices = prices;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
AutoType autoType = (AutoType) o;
if (id != autoType.id) return false;
return true;
}
@Override
public int hashCode() {
int result = id;
result = 31 * result;
return result;
}
}
| [
"for_vkontakte86@mail.ru"
] | for_vkontakte86@mail.ru |
49ac21df4a872989f6b9adcb70d6f6c929413a66 | 3a157ba2204a69cdb3bc5588f5407d53aa297c41 | /ml-crawler-common/src/main/java/mtime/ml/crawler/common/downloader/SeleniumDownloaderExt.java | 2676f80d05531b16976afbae4c21eaaeb8202940 | [] | no_license | ycj007/crawler | 2060b98384710798da95e4698fffe7cfa8359146 | 7a44717c9218996df2a141048b13c68217985100 | refs/heads/master | 2020-03-18T21:05:09.122293 | 2018-05-29T07:35:16 | 2018-05-29T07:35:16 | 135,258,325 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,717 | java | package mtime.ml.crawler.common.downloader;
import mtime.lark.pb.utils.StringUtils;
import org.apache.log4j.Logger;
import org.openqa.selenium.*;
import org.openqa.selenium.interactions.Actions;
import us.codecraft.webmagic.Page;
import us.codecraft.webmagic.Request;
import us.codecraft.webmagic.Site;
import us.codecraft.webmagic.Task;
import us.codecraft.webmagic.downloader.Downloader;
import us.codecraft.webmagic.selector.Html;
import us.codecraft.webmagic.selector.PlainText;
import java.io.Closeable;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
/**
* 使用Selenium调用浏览器进行渲染。目前仅支持chrome。<br>
* 需要下载Selenium driver支持。<br>
*
* @author code4crafter@gmail.com <br>
* Date: 13-7-26 <br>
* Time: 下午1:37 <br>
*/
public class SeleniumDownloaderExt implements Downloader, Closeable {
private volatile WebDriverPool webDriverPool;
private Logger logger = Logger.getLogger(getClass());
private int sleepTime = 0;
private int poolSize = 1;
private static final String DRIVER_PHANTOMJS = "phantomjs";
/**
* 新建
*
* @param chromeDriverPath chromeDriverPath
*/
public SeleniumDownloaderExt(String chromeDriverPath) {
System.getProperties()
.setProperty("webdriver.chrome.driver",
chromeDriverPath);
}
/**
* Constructor without any filed. Construct PhantomJS browser
*
* @author bob.li.0718@gmail.com
*/
public SeleniumDownloaderExt() {
// System.setProperty("phantomjs.binary.path",
// "/Users/Bingo/Downloads/phantomjs-1.9.7-macosx/bin/phantomjs");
}
/**
* set sleep time to wait until load success
*
* @param sleepTime sleepTime
* @return this
*/
public SeleniumDownloaderExt setSleepTime(int sleepTime) {
this.sleepTime = sleepTime;
return this;
}
@Override
public Page download(Request request, Task task) {
checkInit();
WebDriver webDriver;
try {
webDriver = webDriverPool.get();
} catch (InterruptedException e) {
logger.warn("interrupted", e);
return null;
}
logger.info("downloading page " + request.getUrl());
webDriver.get(request.getUrl());
try {
Thread.sleep(sleepTime);
} catch (InterruptedException e) {
e.printStackTrace();
}
WebDriver.Options manage = webDriver.manage();
Site site = task.getSite();
if (site.getCookies() != null) {
for (Map.Entry<String, String> cookieEntry : site.getCookies()
.entrySet()) {
Cookie cookie = new Cookie(cookieEntry.getKey(),
cookieEntry.getValue());
manage.addCookie(cookie);
}
}
/*
* TODO You can add mouse event or other processes
*
* @author: bob.li.0718@gmail.com
*/
actions(webDriver);
WebElement webElement = webDriver.findElement(By.xpath("/html"));
String content = webElement.getAttribute("outerHTML");
Page page = new Page();
page.setRawText(content);
page.setHtml(new Html(content, request.getUrl()));
page.setUrl(new PlainText(request.getUrl()));
page.setRequest(request);
webDriverPool.returnToPool(webDriver);
return page;
}
private void checkInit() {
if (webDriverPool == null) {
synchronized (this) {
webDriverPool = new WebDriverPool(poolSize);
}
}
}
@Override
public void setThread(int thread) {
this.poolSize = thread;
}
@Override
public void close() throws IOException {
webDriverPool.closeAll();
}
private void actions(WebDriver webDriver ){
/* Actions action = new Actions(webDriver);//-------------------------------------------声明一个动作
WebElement xia = webDriver.findElement(By.xpath("//*[@id='bqBotNav']"));//----------找到向下滑动到的元素位置
action.moveToElement(xia).build().perform();*/
//WebElement xia = webDriver.findElement(By.xpath("//*[@id='bqBotNav']"));
int lastCount=0;
int currentCount=0;
List<String> end=findEnd(webDriver);
int retryTimes = 0;
boolean endFlag = false;
currentCount = end.size();
while(!endFlag){
boolean canExecut =false;
if(currentCount > lastCount){
canExecut =true;
retryTimes=0;
}else if(retryTimes<3){
retryTimes++;
canExecut =true;
}
if(canExecut) {
lastCount = end.size();
((JavascriptExecutor) webDriver).executeScript("window.scrollTo(0, document.body.scrollHeight)");
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
end = findEnd(webDriver);
currentCount = end.size();
}else {
endFlag =true;
}
}
}
private List<String> findEnd(WebDriver webDriver){
WebElement webElement = webDriver.findElement(By.xpath("/html"));
String content = webElement.getAttribute("outerHTML");
Html html = new Html(content);
return html.css(".grid-item").all();
}
}
| [
"chongjie.yuan@mtime.com"
] | chongjie.yuan@mtime.com |
37b8fdf2620f0990c42ce519d5be6ef74820b3a4 | 3c0765728d56db3247498556d9fdc1831cc20ea5 | /school/src/main/java/com/schooltriangle/interfaces/Member.java | 78f9ad6133334d1d6a60fb3a43e40f4b2cb443e1 | [] | no_license | shah00070/school | 5b8814eb8592e9999913a1e9a800de5faeaa306e | a8b57ede5087f1b0a44e59222d9be3964f16ee4b | refs/heads/master | 2021-01-20T18:52:21.398133 | 2016-06-03T08:49:11 | 2016-06-03T08:49:11 | 61,518,740 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,288 | java | package com.schooltriangle.interfaces;
import com.schooltriangle.pojos.BloodGroupResponse;
import com.schooltriangle.pojos.ConsumerDetailsResponse;
import com.schooltriangle.pojos.ConsumerUpdateRequestModel;
import com.schooltriangle.pojos.HealthTipsResponse;
import com.schooltriangle.pojos.ResponseApi;
import com.schooltriangle.pojos.UpdateConsumerResponse;
import com.schooltriangle.pojos.UpdateEmailPasswordRequestData;
import com.schooltriangle.pojos.UserFamilyDetailsResult;
import retrofit.Callback;
import retrofit.http.Body;
import retrofit.http.GET;
import retrofit.http.Header;
import retrofit.http.POST;
import retrofit.http.PUT;
import retrofit.http.Path;
/**
* Created by user on 9/3/2015.
*/
public interface Member {
@GET("/Profile/{consumer_id}/Type/3")
// void getConsumer(@Header("X-Jeevom-RequestLocation")String locationObject,@Header("authorization") String token,@Path("consumer_id") String consumer_id, @Header("x-jeevom-android-app-version") String version, Callback<ConsumerDetailsResponse> callback);
void getConsumer(@Header("authorization") String token, @Path("consumer_id") String consumer_id, @Header("x-jeevom-android-app-version") String version, Callback<ConsumerDetailsResponse> callback);
@GET("/membership/BloodGroupType/list")
// void getBloodGroup(@Header("X-Jeevom-RequestLocation")String locationObject,@Header("authorization") String token,Callback<BloodGroupResponse> callback);
void getBloodGroup(@Header("authorization") String token, Callback<BloodGroupResponse> callback);
@PUT("/Profile/Update")
void updateConsumerProfile(@Header("authorization") String token, @Body ConsumerUpdateRequestModel object, Callback<UpdateConsumerResponse> callback);
@POST("/membership/UpdateEmailCellNumber")
void addPhoneNumberOrEmail(@Header("authorization") String token,
@Body UpdateEmailPasswordRequestData object,
Callback<ResponseApi<String>> callback);
@GET("/tip/list")
void getHealthTips(Callback<HealthTipsResponse> callback);
@GET("/profile/Member/Family/{member_id}")
void getFamilyMemberList(@Header("authorization") String token, @Path("member_id") String member_id, Callback<UserFamilyDetailsResult> callback);
}
| [
"shah.h@jeevom.com"
] | shah.h@jeevom.com |
2d100d3ad3912df4a30c1ed7e32a288911d03573 | 1f19aec2ecfd756934898cf0ad2758ee18d9eca2 | /u-1/u-11/u-11-111/u-11-111-1112/u-11-111-1112-11113-111111/u-11-111-1112-11113-111111-f2419.java | 459567a2cd02461adee64a747e85cbbc2c113bc8 | [] | no_license | apertureatf/perftest | f6c6e69efad59265197f43af5072aa7af8393a34 | 584257a0c1ada22e5486052c11395858a87b20d5 | refs/heads/master | 2020-06-07T17:52:51.172890 | 2019-06-21T18:53:01 | 2019-06-21T18:53:01 | 193,039,805 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 106 | java | mastercard 5555555555554444 4012888888881881 4222222222222 378282246310005 6011111111111117
2688912415340 | [
"jenkins@khan.paloaltonetworks.local"
] | jenkins@khan.paloaltonetworks.local |
a8da0b95a25a8e11b1f9f7e5fa1063fd58b54047 | b647fa78fd6c4e46bcaf11ab21d9b880e0c83f24 | /src/designPatterns/chainOfResponsibility/classic/case3/Handler.java | 30ebb18a95980cf72b8cffc0bf368956bd4d28e8 | [] | no_license | Garazd/DesignPatterns | 88b8f15816dec1346122fe267ba28ceddadda9f8 | 0df55b69e5791e4a4b45f7b8cec7c0702b40da75 | refs/heads/master | 2021-01-17T13:43:07.664499 | 2016-06-24T19:36:34 | 2016-06-24T19:36:34 | 36,253,867 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,373 | java | package designPatterns.chainOfResponsibility.classic.case3;
// еще более хитрый абстрактнфй хендлер
public abstract class Handler {
// все так же прячем следующий элемент
private Handler successor;
// все так же сетаем его из клиента
public void setSuccessor(Handler successor) {
this.successor = successor;
}
// все тот же template method (public final, помнишь?)
public final void handleRequest(Request request) {
// если текущий может обработать
if (canHandle(request)) {
// пусть сделает это!
handle(request);
} else {
// если есть еще обработчик
if (successor != null) {
// отдаем запрос ему
successor.handleRequest(request);
}
}
}
// правда проще стало?
// а клиенты пусть реализуют обработчик
// (заметь тут boolean уже нету)
protected abstract void handle(Request request);
// и сами решают, можгут ли они обработать этот запрос
protected abstract boolean canHandle(Request request);
} | [
"GarazdVZ@gmail.com"
] | GarazdVZ@gmail.com |
32067abbb56a587a1a5883935477ef603019e397 | 7d444c9f91feda65ece3d6bf4cfcd75e5a0a90c4 | /src/Console/Card.java | 964628d7b2b8d6104b314d72cd52c423672aa0fa | [] | no_license | MelissaOzcan/CS-Fair-2020 | 95d46664b70237aad96b28652700f8e40a9d1287 | 8834703b8669ec8aad26daee5362db1bafd56167 | refs/heads/master | 2022-11-13T20:01:49.763750 | 2020-07-12T02:30:44 | 2020-07-12T02:30:44 | 267,469,931 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 651 | java | package src.Console;
// Made by Melissa Ozcan
// Last worked: 6/24/20
public class Card {
private String word;
private String def;
public Card() {
word = null;
def = null;
}
//for testing
public Card(String w, String d) {
word = w;
def = d;
}
// this is useful for initialization
public Card(String s) {
String[] values = s.split(":");
word = values[0];
def = values[1];
}
public String getWord() {
return word;
}
public String getDef() {
return def;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.