blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
132 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
28 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
352
f2f970331a97b9cc61daac32b82645cc558d9394
b43cd9fca4ef6034704e7f63834302b367bfb241
/LinkedLists/src/Main.java
df063498ec5f78052d1eaa7a57e9e28cadfe0647
[]
no_license
suhas99/LearnJava
5b656d4eb8a2e43aa704dec263453b1f4f1837de
801dc00a917f80f5bbff6c76ee6503fc30f8cb40
refs/heads/master
2022-12-27T07:49:40.344766
2020-10-01T02:19:01
2020-10-01T02:19:01
269,268,533
7
4
null
null
null
null
UTF-8
Java
false
false
1,318
java
import java.util.ArrayList; import java.util.LinkedList; import java.util.ListIterator; public class Main { private static ArrayList<Album> albums=new ArrayList<Album>(); public static void main(String[] args) { Album album =new Album("Kannada breakup Album","Mixed breakup singers"); album.addSong("kagadada Doniayalli",3.5); album.addSong("Bisilu kudre",3); album.addSong("Marate hogide hrta karana",4); albums.add(album); album =new Album("Kannada Love Album","Vijay prakash"); album.addSong("Belgageduu",3.37); album.addSong("Love you jaanu",4.22); album.addSong("Its time for mohabat",3.40); albums.add(album); LinkedList<Song> playlist =new LinkedList<Song>(); albums.get(0).addToPlayList("Bisilu kudre",playlist); albums.get(1).addToPlayList("Love you jaanu",playlist); albums.get(0).addToPlayList(1,playlist); play(playlist); } private static void play(LinkedList<Song> playlist ){ ListIterator<Song> node =playlist.listIterator(); if(playlist.size()==0){ System.out.println("no songs in playlist"); return; } else{ System.out.println("now playing "+node.next().toString()); } } }
[ "suhaskashyap2@gmail.com" ]
suhaskashyap2@gmail.com
a7d0642d123845541f2585765b2f59fc41443ea2
15e19e16bf109bc771abdebc256eb9416af477b5
/app/src/main/java/com/example/doit/UserFragment.java
ae8db954cad25caad56cc6c3548e4e15aedd6120
[]
no_license
mjini-dev/Do-it_Android
698717e42d72bdd4e7f74903278da47ccaf0b852
bccc1e8b814d3933bb1de99b2ba8d7dbeb9deb83
refs/heads/master
2023-03-08T11:15:45.159790
2021-02-26T15:11:46
2021-02-26T15:11:46
342,642,092
0
0
null
null
null
null
UTF-8
Java
false
false
7,471
java
package com.example.doit; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import androidx.fragment.app.Fragment; import com.android.volley.RequestQueue; import com.android.volley.Response; import com.android.volley.toolbox.Volley; import org.json.JSONObject; /** * A simple {@link Fragment} subclass. * Activities that contain this fragment must implement the * {@link UserFragment.OnFragmentInteractionListener} interface * to handle interaction events. * Use the {@link UserFragment#newInstance} factory method to * create an instance of this fragment. */ public class UserFragment extends Fragment { public static Intent serviceIntent; String ID; // TODO: Rename parameter arguments, choose names that match // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER private static final String ARG_PARAM1 = "param1"; private static final String ARG_PARAM2 = "param2"; // TODO: Rename and change types of parameters private String mParam1; private String mParam2; private OnFragmentInteractionListener mListener; public UserFragment() { // Required empty public constructor } /** * Use this factory method to create a new instance of * this fragment using the provided parameters. * * @param param1 Parameter 1. * @param param2 Parameter 2. * @return A new instance of fragment UserFragment. */ // TODO: Rename and change types and number of parameters public static UserFragment newInstance(String param1, String param2) { UserFragment fragment = new UserFragment(); Bundle args = new Bundle(); args.putString(ARG_PARAM1, param1); args.putString(ARG_PARAM2, param2); fragment.setArguments(args); return fragment; } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (getArguments() != null) { mParam1 = getArguments().getString(ARG_PARAM1); mParam2 = getArguments().getString(ARG_PARAM2); } } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.fragment_user, container, false); ID = MainActivity.ID; serviceIntent = Svc_MyService.serviceIntent; //관심사 변경 (관심사데이터가 있을경우와 없을경우를 생각) final TextView interest = rootView.findViewById(R.id.interest); interest.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Response.Listener<String> responseListener = new Response.Listener<String>() { @Override public void onResponse(String response) { //해당 웹사이트에 접속한 이후, 특정 JSON 응답을 다시 받을 수 있도록작성 try { JSONObject jsonResponse = new JSONObject(response); //JSONObject를 만들어서 response값을 넣어줌 boolean success = jsonResponse.getBoolean("success"); //해당과정이 정상적으로 진행 되었는지(응답 값 확인) if(success) { //ID가 없다면(관심사 데이터가 없다->test 진행) Intent intentR = new Intent(getActivity(), Test_1.class); intentR.putExtra("userID",ID); getActivity().startActivity(intentR); } else { //ID가 있다(관심사 데이터가 있다->관심사 변경) Intent intentR = new Intent(getActivity(), User_choice_like.class); intentR.putExtra("userID",ID); getActivity().startActivity(intentR); } } catch (Exception e) { e.printStackTrace(); } } }; //실제로 접속 할 수 있도록 ValidateRequest 생성자를 통해 객체를 만들어 준다. VolleyR_CheckDBRequest volleyRCheckDBRequest = new VolleyR_CheckDBRequest(ID, responseListener); //요청을 보낼 수 있도록 큐를 만든다 RequestQueue queue = Volley.newRequestQueue(getActivity()); //만들어진 큐에, ValidateRequest 객체를 넣어준다. queue.add(volleyRCheckDBRequest); //onDestroy(); } }); //비밀번호변경 change_PW final TextView change_PW = rootView.findViewById(R.id.change_PW); change_PW.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent intentC = new Intent(getActivity(), User_changePassword.class); intentC.putExtra("userID",ID); getActivity().startActivity(intentC); } }); //로그아웃기능 final TextView logout = rootView.findViewById(R.id.log_out); logout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { serviceIntent = new Intent(getActivity(), Svc_MyService.class); getActivity().stopService(serviceIntent); if (serviceIntent!=null) { //stopService(serviceIntent); serviceIntent = null; } ID = null; // ((MainActivity)getActivity()).stopService() //로그아웃하면 서비스 중지. //((MainActivity)getActivity()).stopService(serviceIntent); //로그아웃하면 서비스 중지. Intent intent = new Intent(getActivity(), LoginActivity.class); startActivity(intent); getActivity().finish(); //onDestroy(); } }); //return inflater.inflate(R.layout.fragment_user, container, false); return rootView; } // TODO: Rename method, update argument and hook method into UI event public void onButtonPressed(Uri uri) { if (mListener != null) { mListener.onFragmentInteraction(uri); } } @Override public void onDetach() { super.onDetach(); mListener = null; } /** * This interface must be implemented by activities that contain this * fragment to allow an interaction in this fragment to be communicated * to the activity and potentially other fragments contained in that * activity. * <p> * See the Android Training lesson <a href= * "http://developer.android.com/training/basics/fragments/communicating.html" * >Communicating with Other Fragments</a> for more information. */ public interface OnFragmentInteractionListener { // TODO: Update argument type and name void onFragmentInteraction(Uri uri); } }
[ "mjin9075@gmail.com" ]
mjin9075@gmail.com
387c5bb286e065c8a55d4d24179d87965471c422
dc3fc648784a42dd8271e352555c7958f094d3ca
/src/test/java/org/zeroturnaround/zip/CharsetTest.java
cfcdbfbd86fa4554d4f9c753747c5e92f63897e6
[ "Apache-2.0" ]
permissive
zeroturnaround/zt-zip
6d31a2d4e351ff1de58071f00d0e977c2863f3f7
5e6ccbd4179cb16d1088674f0cc33959713acf60
refs/heads/master
2023-08-30T21:17:22.450509
2023-08-03T11:56:10
2023-08-03T11:56:10
2,828,642
1,260
275
Apache-2.0
2023-03-30T17:45:24
2011-11-22T15:26:37
Java
UTF-8
Java
false
false
5,696
java
package org.zeroturnaround.zip; /** * Copyright (C) 2012 ZeroTurnaround LLC <support@zeroturnaround.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. */ import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.nio.charset.Charset; import java.nio.file.Files; import java.util.ArrayList; import java.util.Enumeration; import java.util.List; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; import junit.framework.TestCase; public class CharsetTest extends TestCase { private static final File file = new File("src/test/resources/umlauts-o\u0308a\u0308s\u030c.zip"); // See StackOverFlow post why I'm not using just unicode // http://stackoverflow.com/questions/6153345/different-utf8-encoding-in-filenames-os-x/6153713#6153713 private static final List fileContents = new ArrayList() { { add("umlauts-öäš/"); add("umlauts-öäš/Ro\u0308mer.txt"); // Römer - but using the escape code that HFS uses add("umlauts-öäš/Raudja\u0308rv.txt"); // Raudjärv - but escape code from HFS add("umlauts-öäš/S\u030celajev.txt"); // Šelajev - but escape code from HFS } }; public boolean ignoreTestIfJava6() { return (System.getProperty("java.version").startsWith("1.6")); } public void testIterateWithCharset() throws Exception { if (ignoreTestIfJava6()) { return; } FileInputStream fis = new FileInputStream(file); ZipUtil.iterate(fis, new ZipEntryCallback() { public void process(InputStream in, ZipEntry zipEntry) throws IOException { assertTrue(zipEntry.getName(), fileContents.contains(zipEntry.getName())); } }, Charset.forName("UTF8")); } public void testIterateWithEntryNamesAndCharset() throws Exception { if (ignoreTestIfJava6()) { return; } FileInputStream fis = new FileInputStream(file); String[] entryNames = (String[]) fileContents.toArray(new String[] {}); ZipUtil.iterate(fis, entryNames, new ZipEntryCallback() { public void process(InputStream in, ZipEntry zipEntry) throws IOException { assertTrue(zipEntry.getName(), fileContents.contains(zipEntry.getName())); } }, Charset.forName("UTF8")); } public void testZipFileGetEntriesWithCharset() throws Exception { if (ignoreTestIfJava6()) { return; } ZipFile zf = ZipFileUtil.getZipFile(file, Charset.forName("UTF8")); Enumeration entries = zf.entries(); while (entries.hasMoreElements()) { ZipEntry ze = (ZipEntry) entries.nextElement(); assertTrue(ze.getName(), fileContents.contains(ze.getName())); } } /* * I'm using a archive created on Windows 10. The files in the archive have * umlauts in their name. The default encoding in compression is IBM437 (I didn't * know that but found out from [1]. Unpacking this archive with any other encoding * will result in wrong filenames (windows-1252) or Zip exception during the * getEntry() or when opening the file. * * [1] http://stackoverflow.com/questions/1510791/how-to-create-zip-files-with-specific-encoding */ public void testIterateExtractWithCharset() throws Exception { if (ignoreTestIfJava6()) { return; } final File src = new File("src/test/resources/windows-compressed.zip"); FileInputStream inputStream = new FileInputStream(src); ZipUtil.iterate(inputStream, new ZipEntryCallback() { public void process(InputStream in, ZipEntry zipEntry) throws IOException { if (zipEntry.getName().indexOf("raud") != -1) { assertEquals("windows-default-encoded/raudjärv.txt", zipEntry.getName()); } else { assertEquals("windows-default-encoded/römer.txt", zipEntry.getName()); } } }, Charset.forName("IBM437")); inputStream.close(); } /* * If a charset is not specified for the unpack then the test will just fail. */ public void testExtractWithCharset() throws Exception { if (ignoreTestIfJava6()) { return; } final File src = new File("src/test/resources/windows-compressed.zip"); File tmpDir = Files.createTempDirectory("zt-zip-tests").toFile(); ZipUtil.unpack(src, tmpDir, Charset.forName("IBM437")); } public void testExtractEntryWithCharset() throws Exception { if (ignoreTestIfJava6()) { return; } final File src = new File("src/test/resources/windows-compressed.zip"); byte[] bytes = ZipUtil.unpackEntry(src, "windows-default-encoded/römer.txt", Charset.forName("IBM437")); assertTrue(bytes.length > 0); } /* * If a charset is not specified for the unpack then the test will just fail. */ public void testExtractWithCharsetUsingStream() throws Exception { if (ignoreTestIfJava6()) { return; } final File src = new File("src/test/resources/windows-compressed.zip"); FileInputStream inputStream = new FileInputStream(src); File tmpDir = Files.createTempDirectory("zt-zip-tests").toFile(); ZipUtil.unpack(inputStream, tmpDir, Charset.forName("IBM437")); inputStream.close(); } }
[ "toomas@zeroturnaround.com" ]
toomas@zeroturnaround.com
987e65e6e58f2ed60f182c97c0504a921656e334
d4439f3ea17fefbc63011fb6e1b48f3758329944
/src/test/java/com/pm/demo/DemoApplicationTests.java
bd3ca1aaf2a8136fbb2dbd118f5177d94d00f643
[]
no_license
sameershrestha333/PersonalProjectManagement
a211a003399ef6766e26bee9a673090d6b037757
6bd22e601c19ed3d0b9857c41c683c1589b7436a
refs/heads/master
2020-09-11T18:08:44.236234
2019-11-16T19:22:44
2019-11-16T19:22:44
222,113,845
0
0
null
null
null
null
UTF-8
Java
false
false
210
java
package com.pm.demo; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class DemoApplicationTests { @Test void contextLoads() { } }
[ "sameershrestha333@gmail.com" ]
sameershrestha333@gmail.com
a88e8a59febfd47b54bd7ef63988c95f576b9b65
afefdb0541c3bdcc5fe8a3e7983406dfa889aad7
/src/main/java/jbasis/util/JBasisException.java
bd3c7129653fb4e10bf6834ac34fb13d75b140d9
[ "MIT" ]
permissive
jeffdoolittle/jbasis
8fde0c066d865d83cc83e387707269b517debb56
ba5cec4cbe28e35b6af6f69e699491183d757167
refs/heads/master
2020-07-14T18:40:23.233539
2019-09-19T21:35:51
2019-09-20T03:50:45
205,376,008
0
0
MIT
2019-09-19T22:45:31
2019-08-30T12:16:05
Java
UTF-8
Java
false
false
601
java
package jbasis.util; /** * Exception type for all jbasis exceptions. * <p> * Note that this is a RuntimeException. Checked exceptions * have their place but can lead to bloated exception * handling that is better addressed with test coverage. * <p> * Let the exceptions bubble up and deal with them at the * edges. */ public class JBasisException extends RuntimeException { private static final long serialVersionUID = 1L; public JBasisException(String message) { super(message); } public JBasisException(String message, Throwable cause) { super(message, cause); } }
[ "jeffdoolittle@gmail.com" ]
jeffdoolittle@gmail.com
60b87fec288c372c514ec40ea9ce69dfae58a1e2
73f14233f8fc78b352b5b1c3e1c3f33876487fdd
/pandapay/src/com/pandapay/controller/back/BackerInviteCodeRecordController.java
1ccb460fa45c825f16754b039676c8543c9706f2
[]
no_license
vemwyzys/xsmcvifu
faf709d9c2c85dd811a689e7955e6aba1fb39f69
d241530bbfbe10be7b1baef43846c1daaa53e85c
refs/heads/master
2021-08-28T05:07:54.165198
2017-12-11T08:37:37
2017-12-11T08:37:37
113,831,995
0
0
null
null
null
null
UTF-8
Java
false
false
3,784
java
package com.pandapay.controller.back; import java.sql.Timestamp; import java.util.List; import javax.servlet.http.HttpServletRequest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import com.iqmkj.utils.StringUtil; import com.pandapay.entity.DO.BackerRecordInviteCodeDO; import com.pandapay.interceptor.BackerWebInterceptor; import com.pandapay.service.IBackerRecordInviteCodeService; /** * 发放邀请码记录 * @author zjl * */ @Controller @Scope(value = "prototype") @RequestMapping("/backerWeb/backerInviteCodeRecord/") public class BackerInviteCodeRecordController { /** 邀请码记录服务*/ @Autowired private IBackerRecordInviteCodeService backerRecordInviteCodeService; /** 查询数据*/ public void showList(HttpServletRequest request){ String userAccount = StringUtil.stringNullHandle(request.getParameter("userAccount")); String remarks = StringUtil.stringNullHandle(request.getParameter("remarks")); String backerAccount = StringUtil.stringNullHandle(request.getParameter("backerAccount")); String startTimeStr = StringUtil.stringNullHandle(request.getParameter("startTime")); String endTimeStr = StringUtil.stringNullHandle(request.getParameter("endTime")); String pageNumberStr = StringUtil.stringNullHandle(request.getParameter("pageNumber")); Timestamp startTime = null; if(StringUtil.isNotNull(startTimeStr)){ startTime = Timestamp.valueOf(startTimeStr); } Timestamp endTime = null; if(StringUtil.isNotNull(endTimeStr)){ endTime = Timestamp.valueOf(endTimeStr); } int pageNumber = 0; if(StringUtil.isNotNull(pageNumberStr)){ pageNumber = Integer.parseInt(pageNumberStr); } int pageSize = 20; int totalNumber = backerRecordInviteCodeService.queryRecordTotalOfBack(userAccount, remarks, backerAccount, startTime, endTime); //总页码数 int totalPageNumber = (int) (totalNumber/1.0/pageSize); //若页码总数恰为页码大小的整数倍,则总数减一 if (totalNumber > 0 && Math.ceil(totalNumber/1.0/pageSize) == totalPageNumber) { totalPageNumber--; } if(pageNumber > totalPageNumber){ pageNumber = totalPageNumber; } List<BackerRecordInviteCodeDO> list = null; if(totalNumber > 0){ list = backerRecordInviteCodeService.queryRecordListOfBack(userAccount, remarks, backerAccount, startTime, endTime, pageNumber, pageSize); } request.setAttribute("userAccount", userAccount); request.setAttribute("remarks", remarks); request.setAttribute("backerAccount", backerAccount); request.setAttribute("startTime", startTimeStr); request.setAttribute("endTime", endTimeStr); request.setAttribute("totalNumber", totalNumber); request.setAttribute("pageNumber", pageNumber); request.setAttribute("totalPageNumber", totalPageNumber); request.setAttribute("list", list); //添加当前页面,页面权限码 request.getSession().setAttribute("backer_pagePowerId", 181200); } /** 显示页面*/ @RequestMapping("show.htm") public String show(HttpServletRequest request){ boolean result = BackerWebInterceptor.validatePower(request, 181201); if (!result) { request.setAttribute("code", 2); request.setAttribute("message", "您没有该权限!"); request.getSession().setAttribute("backer_pagePowerId", 0); return "page/back/index"; } showList(request); request.setAttribute("code", 1); request.setAttribute("message", "操作成功!"); return "page/back/backerRecordInviteCode"; } }
[ "disanxinshi@hotmail.com" ]
disanxinshi@hotmail.com
6eb7423838b56967e576923e0cde2b7404161a52
a5d27cf82b8830b91fdfe216bda48697ecb9c01f
/src/main/java/org/kordamp/jsr377/formatter/ShortFormatter.java
3dfb352283b6e484160ae67964305ceddc09fe38
[ "LicenseRef-scancode-generic-cla", "Apache-2.0" ]
permissive
jsr377/jsr377-converters
20c1912d062ca2ac628b65a708d78c6771e587dd
36d9881ec4502fda994fe577917053e66a1e705a
refs/heads/master
2021-11-25T08:48:51.816639
2021-11-06T23:15:20
2021-11-06T23:15:20
109,632,426
0
3
Apache-2.0
2018-09-28T16:00:31
2017-11-06T01:25:46
Java
UTF-8
Java
false
false
1,229
java
/* * SPDX-License-Identifier: Apache-2.0 * * Copyright 2015-2021 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.kordamp.jsr377.formatter; /** * @author Andres Almiray */ public class ShortFormatter extends AbstractNumberFormatter<Short> { public ShortFormatter() { this(null); } public ShortFormatter(String pattern) { super(pattern); } @Override public Short parse(String str) throws ParseException { if (isBlank(str)) { return null; } try { return numberFormat.parse(str).shortValue(); } catch (java.text.ParseException e) { throw new ParseException(e); } } }
[ "aalmiray@gmail.com" ]
aalmiray@gmail.com
21e3c143131ad8ac1f9e3b318ba1903eee22d188
fb251da39ed2702a9fbfc4eb185ca8e0daa784c9
/src/main/java/com/example/demo/study/thread/resourceshare/newcomponent/countlatch/CountDownLatchDemo.java
0bc879133b229dd87f97af6cf3b87176ade4d977
[]
no_license
yinfeng201809/springboot
fec53a3dceaff59be6b2f434b0b69775eab01971
0479a3035f1f78f4f79393b42219c53239564839
refs/heads/master
2023-06-24T04:29:05.558904
2022-07-31T04:13:29
2022-07-31T04:13:29
162,996,052
0
0
null
2023-06-14T22:33:09
2018-12-24T14:00:19
Java
UTF-8
Java
false
false
725
java
package com.example.demo.study.thread.resourceshare.newcomponent.countlatch; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; public class CountDownLatchDemo { static final int size=100; public static void main(String[] args) { ExecutorService exec = Executors.newCachedThreadPool(); CountDownLatch latch = new CountDownLatch(size); for (int i = 0; i < 10; i++) { exec.execute(new WaitingTask(latch)); } for (int i = 0; i < size; i++) { exec.execute(new TaskPortion(latch)); } System.out.println("启动了所有任务"); exec.shutdown(); } }
[ "316133870@qq.com" ]
316133870@qq.com
cf135120f7479bd8557645f05e10fa6c9d0b3932
319b83e461e71d360a7873e54d08fe431c480b1c
/app/src/main/java/com/nextep/pelmel/providers/impl/UserInfoProvider.java
1665d74ee0c70b05fadcf46918860ca4a9535c08
[]
no_license
christophefondacci/pelmel-android
f9c990add3e452f198458d5037d9b841104fe41d
4df6507b42bc8b9ba34d6448aa7bae9e6505e6d0
refs/heads/master
2022-11-04T05:29:40.495780
2015-10-29T18:03:52
2015-10-29T18:03:52
39,413,341
0
0
null
null
null
null
UTF-8
Java
false
false
10,779
java
package com.nextep.pelmel.providers.impl; import android.content.Context; import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.widget.LinearLayout; import com.nextep.pelmel.PelMelApplication; import com.nextep.pelmel.R; import com.nextep.pelmel.activities.Refreshable; import com.nextep.pelmel.helpers.Strings; import com.nextep.pelmel.model.Action; import com.nextep.pelmel.model.CalObject; import com.nextep.pelmel.model.Event; import com.nextep.pelmel.model.Image; import com.nextep.pelmel.model.NetworkStatus; import com.nextep.pelmel.model.User; import com.nextep.pelmel.providers.CountersProvider; import com.nextep.pelmel.providers.CountersProviderExtended; import com.nextep.pelmel.providers.SnippetInfoProvider; import com.nextep.pelmel.services.ActionManager; import com.nextep.pelmel.services.ConversionService; import java.util.Collections; import java.util.List; /** * Created by cfondacci on 28/07/15. */ public class UserInfoProvider implements SnippetInfoProvider, CountersProviderExtended { private User user; public UserInfoProvider(User user) { this.user = user; } @Override public CalObject getItem() { return user; } @Override public String getTitle() { return user.getName(); } @Override public String getSubtitle() { return Strings.getText(user.isOnline() ? R.string.online : R.string.offline); } @Override public Bitmap getSubtitleIcon() { int res = user.isOnline() ? R.drawable.online : R.drawable.offline; return BitmapFactory.decodeResource(PelMelApplication.getInstance().getResources(), res); } @Override public Image getSnippetImage() { return user.getThumb(); } @Override public int getLikesCount() { return user.getLikeCount(); } @Override public int getReviewsCount() { return 0; } @Override public int getCheckinsCount() { return 0; } @Override public String getDescription() { return user.getDescription(); } @Override public String getItemTypeLabel() { return null; } @Override public String getCity() { return user.getCityName(); } @Override public String getHoursBadgeSubtitle() { return null; } @Override public String getHoursBadgeTitle() { return null; } @Override public int getHoursColor() { return 0; } @Override public String getDistanceIntroText() { return null; } @Override public String getDistanceText() { final ConversionService conversionService = PelMelApplication.getConversionService(); return conversionService.getDistanceStringForMiles(user.getRawDistanceMiles()); } @Override public List<String> getAddressComponents() { return Collections.emptyList(); } @Override public List<Event> getEvents() { return null; } @Override public boolean hasCustomSnippetView() { return false; } @Override public void createCustomSnippetView(Context context, LinearLayout parent) { } @Override public void refreshCustomSnippetView(Context context, LinearLayout parent) { } @Override public CountersProvider getCountersProvider() { return this; } @Override public int getThumbListsRowCount() { int rowCount = 0; if(!user.getLikedPlaces().isEmpty()) { rowCount++; } if(!user.getLikedUsers().isEmpty()) { rowCount++; } return rowCount; } @Override public List<CalObject> getThumbListObjects(int row) { if(row==0 && !user.getLikedPlaces().isEmpty()) { return (List)user.getLikedPlaces(); } else { return (List)user.getLikedUsers(); } } @Override public String getThumbListSectionTitle(int row) { if(row==0 && !user.getLikedPlaces().isEmpty()) { return Strings.getCountedText(R.string.thumbs_section_liked_places_singular,R.string.thumbs_section_liked_places,user.getLikedPlaces().size()).toString(); } else { return Strings.getCountedText(R.string.thumbs_section_liked_users_singular, R.string.thumbs_section_liked_users, user.getLikedUsers().size()).toString(); } } @Override public Bitmap getThumbListSectionIcon(int row) { Resources resources = PelMelApplication.getInstance().getResources(); if(row==0 && !user.getLikedPlaces().isEmpty()) { return BitmapFactory.decodeResource(resources,R.drawable.ovv_icon_check_white); } else { return BitmapFactory.decodeResource(resources,R.drawable.snp_icon_like_white); } } @Override public String getCounterLabelAtIndex(int index) { switch(index) { case COUNTER_LIKE: return Strings.getCountedText(R.string.counter_likes_singular,R.string.counter_likes,user.getLikeCount()).toString(); case COUNTER_CHECKIN: return Strings.getText(R.string.counter_network); case COUNTER_CHAT: return Strings.getText(R.string.action_chat); } return null; } @Override public String getCounterActionLabelAtIndex(int index) { int res = 0; switch(index) { case COUNTER_LIKE: if(user.isLiked()) { res = R.string.action_unlike; } else { res = R.string.action_like; } break; case COUNTER_CHECKIN: final NetworkStatus status = PelMelApplication.getUserService().getNetworkStatusFor(user); switch(status) { case PENDING_APPROVAL: res = R.string.counter_network_accept; break; case PENDING_REQUEST: res = R.string.counter_network_cancel; break; case FRIENDS: res = R.string.counter_network_friends; break; case NOT_IN_NETWORK: res = R.string.counter_network_add; break; } break; case COUNTER_CHAT: res = R.string.action_chat; } if(res!=0) { return Strings.getText(res); } return null; } @Override public boolean isCounterSelectedAtIndex(int index) { switch(index) { case COUNTER_LIKE: return user.isLiked(); case COUNTER_CHECKIN: final NetworkStatus status = PelMelApplication.getUserService().getNetworkStatusFor(user); return status != NetworkStatus.NOT_IN_NETWORK; default: return false; } } @Override public void executeCounterActionAtIndex(final Context context, final Refreshable refreshable, int index) { ActionManager mgr = PelMelApplication.getActionManager(); final boolean selected = isCounterSelectedAtIndex(index); switch(index) { case COUNTER_LIKE: mgr.executeAction(selected ? Action.UNLIKE : Action.LIKE, user, new ActionManager.ActionCallback() { @Override public void actionCompleted(boolean isSucess, Object result) { if(!selected) { PelMelApplication.getUiService().showInfoMessage(context, R.string.alert_like_success_title, R.string.alert_like_user_success); } else { PelMelApplication.getUiService().showInfoMessage(context, R.string.alert_unlike_success_title, R.string.alert_unlike_user_success); } refreshable.updateData(); } }); break; case COUNTER_CHECKIN: final NetworkStatus status = PelMelApplication.getUserService().getNetworkStatusFor(user); Action action = null; switch(status) { case FRIENDS: case PENDING_REQUEST: action = Action.NETWORK_CANCEL; break; case NOT_IN_NETWORK: action = Action.NETWORK_REQUEST; break; case PENDING_APPROVAL: action = Action.NETWORK_RESPOND; break; } if(action != null) { mgr.executeAction(action, user); } break; case COUNTER_CHAT: mgr.executeAction(Action.CHAT,user); break; } } @Override public CalObject getCounterObject() { return null; } @Override public int getCounterBackgroundResource(int index) { boolean isSelected = isCounterSelectedAtIndex(index); if(!isSelected) { return R.drawable.bg_counter; } else { return index == COUNTER_CHECKIN ? R.drawable.bg_counter_network_selected : R.drawable.bg_counter_selected; } } @Override public Bitmap getCounterImageAtIndex(int index) { switch(index) { case COUNTER_LIKE: return BitmapFactory.decodeResource(PelMelApplication.getInstance().getResources(),R.drawable.snp_icon_like_white); case COUNTER_CHECKIN: final NetworkStatus status = PelMelApplication.getUserService().getNetworkStatusFor(user); int resId = 0; switch(status) { case NOT_IN_NETWORK: resId = R.drawable.btn_snp_network_add; break; case FRIENDS: resId = R.drawable.btn_snp_network_friends; break; default: resId = R.drawable.btn_snp_network_pending; break; } return BitmapFactory.decodeResource(PelMelApplication.getInstance().getResources(),resId); case COUNTER_CHAT: return BitmapFactory.decodeResource(PelMelApplication.getInstance().getResources(),R.drawable.snp_icon_chat); } return null; } @Override public boolean hasCounter(int index) { return true; } }
[ "cfondacci@gmail.com" ]
cfondacci@gmail.com
1185a6649c6c4177c12133c2fbbe223d18d867b6
5fa7462dc506c5dee385c2186db9d5ab54436b05
/src/main/java/com/pendownabook/constraint/FieldMatchValidator.java
de2d6c9a11e6946a5b5aab9ab0686b244c6d785e
[]
no_license
Vishvin95/PenDownABook
a61bdf1a56a904f24d5cfed75874c95001b48648
1c4c55b6b5582fb6323e45e50fe473c9a314b061
refs/heads/master
2023-01-27T13:09:48.329132
2020-12-09T18:55:18
2020-12-09T18:55:18
261,965,692
0
0
null
null
null
null
UTF-8
Java
false
false
932
java
package com.pendownabook.constraint; import javax.validation.ConstraintValidator; import javax.validation.ConstraintValidatorContext; import org.apache.commons.beanutils.BeanUtils; public class FieldMatchValidator implements ConstraintValidator<FieldMatch, Object> { private String firstFieldName; private String secondFieldName; @Override public void initialize(final FieldMatch constraintAnnotation) { firstFieldName = constraintAnnotation.first(); secondFieldName = constraintAnnotation.second(); } @Override public boolean isValid(final Object value, final ConstraintValidatorContext context) { try { final Object firstObj = BeanUtils.getProperty(value, firstFieldName); final Object secondObj = BeanUtils.getProperty(value, secondFieldName); return firstObj == null && secondObj == null || firstObj != null && firstObj.equals(secondObj); } catch (final Exception ignore) { } return true; } }
[ "vishwesh.vinchurkar@gmail.com" ]
vishwesh.vinchurkar@gmail.com
569d48d7e6f7cc9a70fd25a060d1afd386f67c32
ba98b26212abd001f4152d22409e1e2aae9decf8
/src/OOP_3/IceCream/MainClass.java
3d905d358734dae54c9fa423efb6347eb8c1ead7
[]
no_license
fatihakbuluttr/lessonOOP
b184aadf28908f3af4cce681cc46daf2311163cc
7a960a61ae0e781d737c2f59040b4fb59d13ed34
refs/heads/main
2023-03-24T12:20:38.099393
2021-03-23T19:26:37
2021-03-23T19:26:37
350,238,947
0
0
null
null
null
null
UTF-8
Java
false
false
976
java
package OOP_3.IceCream; import java.util.Arrays; public class MainClass { public static void main(String[] args) { IceCream ice1=new IceCream("Chocolate",13); IceCream ice2=new IceCream("Vanilla",0); IceCream ice3=new IceCream("Strawberry",7); IceCream ice4=new IceCream("Plain",18); IceCream ice5=new IceCream("ChocolateChip",3); IceCream[] array1= {ice1,ice2,ice3,ice4,ice5}; IceCream[] array2= {ice2,ice3}; sweetestIceCream(array1); sweetestIceCream(array2); } private static int sweetestIceCream(IceCream[] iceCreamArray){ int[] arraySweetness=new int[iceCreamArray.length]; for (int i = 0; i < iceCreamArray.length; i++) { arraySweetness[i]=iceCreamArray[i].getValue(); } Arrays.sort(arraySweetness); System.out.println(arraySweetness[arraySweetness.length-1]); return arraySweetness[arraySweetness.length-1]; } }
[ "User@DESKTOP-ENT97T7" ]
User@DESKTOP-ENT97T7
49306b9671b77320229a53fa0b1566114cb3e857
82841e03823b3f7a5c1e0a83a26bf7b48d237204
/app/src/main/java/com/blog/ken/myblog/MainActivity.java
26ad1b6b1fda8e0c2dbc879e3ab30844d0a2b0c3
[]
no_license
huangyuekai/MyBlog
8b91d9a6bba9264321e3a1dfd422535cfb2f5ec1
012aee398961dfd9c62a6ea2702ef2de35b3e198
refs/heads/master
2020-06-12T09:02:04.314946
2016-12-09T06:48:18
2016-12-09T06:48:18
75,595,030
0
0
null
null
null
null
UTF-8
Java
false
false
1,777
java
package com.blog.ken.myblog; import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.View; import android.view.Menu; import android.view.MenuItem; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) .setAction("Action", null).show(); } }); } @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); } }
[ "2077067673@qq.com" ]
2077067673@qq.com
ccecde01245a83d32fe189e2647d9574e36c36fe
9232d83f1e1a64c50c9bd9a180f4129ec43636cf
/app/src/main/java/com/example/wyattsullivan/fridgeio/UpdateTriplet.java
cefc307b9d908ee0b31b49030a7264ff33cb6b4d
[]
no_license
wsull001/FridgeIo
b629f88c42ddf204a72057f85eafee39ecfa69fd
9c9e46b80be8126e70c363c22446b8a3da14af7c
refs/heads/master
2021-05-04T23:53:18.268702
2018-03-12T18:06:01
2018-03-12T18:06:01
119,436,485
0
0
null
null
null
null
UTF-8
Java
false
false
498
java
package com.example.wyattsullivan.fridgeio; /** * Created by wyattsullivan on 3/11/18. */ public class UpdateTriplet { private final int type; private final int updID; private final String prodID; public UpdateTriplet(int tp, int uID, String pID) { this.type = tp; this.updID = uID; this.prodID = pID; } public int getType() { return type; } public int getUpdateID() { return updID; } public String getProductID() { return prodID; } }
[ "wsull001@ucr.edu" ]
wsull001@ucr.edu
8f43641cedeab56b9e81215167e90eed90c89352
9fd8d06e5dd9731d45c49104be21ef6554596a08
/src/com/Project273/Server/LWM2MServer.java
020e0395707a58d5153c5029e6976f9bfccd1af3
[]
no_license
shibunath/273
ff8e0a9c7b5d2371b0cffd2cb326e1aa00847cf7
c7785db04a68d38466c792ac97d476df71c010c7
refs/heads/master
2021-01-10T03:46:29.212762
2016-02-07T07:42:48
2016-02-07T07:42:48
51,239,814
0
0
null
null
null
null
UTF-8
Java
false
false
5,343
java
package com.Project273.Server; import java.util.ArrayList; import java.util.List; import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import com.Project273.Client.Track; import com.mongodb.BasicDBObject; import com.mongodb.BasicDBObjectBuilder; import com.mongodb.DB; import com.mongodb.DBCollection; import com.mongodb.DBObject; import com.mongodb.MongoClient; @Path("/api") public class LWM2MServer { @POST @Path("/registration") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.TEXT_PLAIN ) public String createTrackInJSON() throws Exception { DBObject doc; String result=""; MongoClient mongoClient = new MongoClient("localhost", 27017); try { DB db = mongoClient.getDB("adas"); boolean auth = db.authenticate("cmpe273", "1234567a".toCharArray()); if(auth) { DBCollection col = db.getCollection("ClientRegistration"); doc = createDBObject(); col.insert(doc); result = "Registered"; } else { result = "Not Registered"; } } catch(Exception e) { throw e; } mongoClient.close(); return result; } private static DBObject createDBObject() { BasicDBObjectBuilder docBuilder = BasicDBObjectBuilder.start(); docBuilder.append("_id", "client-id1"); docBuilder.append("ClientEndPointName","Client1"); docBuilder.append("Lifetime", 12345); docBuilder.append("Lwm2mVersion", 1.4); docBuilder.append("BindingMode", "S"); docBuilder.append("SmsNumber", 512578672); docBuilder.append("ObjectInstances", "Yes"); return docBuilder.get(); } @GET @Path("/select/{id}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public List<Track> selectTrackInJSON(@PathParam("id") String _id) throws Exception { DBObject dbo = null; BasicDBObject whereQuery = new BasicDBObject(); whereQuery.put("_id", _id); Track cr = new Track(); List<Track> lis = new ArrayList<Track>(); MongoClient mongoClient = new MongoClient("167.88.36.125", 27017); try { DB db = mongoClient.getDB("adas"); boolean auth = db.authenticate("cmpe273", "1234567a".toCharArray()); if(auth) { DBCollection col = db.getCollection("ClientRegistration"); dbo = col.findOne(whereQuery); String id = (String) dbo.get("_id"); String clientEndPointName = (String) dbo.get("ClientEndPointName"); int lifetime = (int) dbo.get("Lifetime"); double lwm2m_version = (Double) dbo.get("Lwm2mVersion"); String binding_mode = (String) dbo.get("BindingMode"); int smsNumber = (int) dbo.get("SmsNumber"); String object_instances = (String) dbo.get("ObjectInstances"); cr.setId(id); cr.setClientEndPointName(clientEndPointName); cr.setLifetime(lifetime); cr.setBindingMode(binding_mode); cr.setLwm2mVersion(lwm2m_version); cr.setSmsNumber(smsNumber); cr.setObjInst(object_instances); lis.add(cr); } } catch(Exception e) { throw e; } mongoClient.close(); return lis; } @POST @Path("/update/{id}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.TEXT_PLAIN) public String updateTrackInJSON(@PathParam("id")String _id) throws Exception { String result = null; MongoClient mongoClient = new MongoClient("167.88.36.125", 27017); try { DB db = mongoClient.getDB("adas"); boolean auth = db.authenticate("cmpe273", "1234567a".toCharArray()); if(auth) { DBCollection col = db.getCollection("Trackistration"); BasicDBObject newDocument = new BasicDBObject(); newDocument.append("$set", new BasicDBObject().append("Lwm2mVersion", 2.2)); BasicDBObject searchQuery = new BasicDBObject().append("_id", _id); col.update(searchQuery, newDocument); result = "Updated Successfully"; } else { result = "Update Failed"; } } catch(Exception e) { throw e; } mongoClient.close(); return result; } @POST @Path("/delete/{id}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.TEXT_PLAIN) public String deleteTrackinJSON(@PathParam("id")String _id) throws Exception { String result = null; MongoClient mongoClient = new MongoClient("167.88.36.125", 27017); try { DB db = mongoClient.getDB("adas"); boolean auth = db.authenticate("cmpe273", "1234567a".toCharArray()); if(auth) { DBCollection col = db.getCollection("ClientRegistration"); BasicDBObject document = new BasicDBObject(); document.put("_id", _id); col.remove(document); result = "Deleted Successfully"; } else { result = "Delete Failed"; } } catch(Exception e) { throw e; } mongoClient.close(); return result; } }
[ "shibunathshanker@ymail.com" ]
shibunathshanker@ymail.com
c9febc1b48f91bcab515c8769c5a799bdd13aee0
a549f89462ebe404fafd186045b7241b98c86cd0
/service/service-edu/src/test/java/com/atguigu/guli/service/edu/CodeGenerator.java
d906ff2a922aab1d95364aeb58658b76dc48f1cb
[]
no_license
chen106/guli-edu
bc939da0dcfcbf3c07822169442bed9f04e8ee5c
24ca25d04807907c3ea1ab7ee7557bdab51fb74d
refs/heads/master
2022-07-13T17:20:47.593518
2019-11-20T12:30:18
2019-11-20T12:30:18
222,874,542
0
0
null
2022-06-17T02:41:50
2019-11-20T07:15:12
Java
UTF-8
Java
false
false
3,981
java
package com.atguigu.guli.service.edu; import com.baomidou.mybatisplus.annotation.DbType; import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.generator.AutoGenerator; import com.baomidou.mybatisplus.generator.config.DataSourceConfig; import com.baomidou.mybatisplus.generator.config.GlobalConfig; import com.baomidou.mybatisplus.generator.config.PackageConfig; import com.baomidou.mybatisplus.generator.config.StrategyConfig; import com.baomidou.mybatisplus.generator.config.po.TableFill; import com.baomidou.mybatisplus.generator.config.rules.DateType; import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; import org.junit.Test; import java.util.ArrayList; /** * @author chen * @date 2019/11/20/16:49 */ public class CodeGenerator { @Test public void genCode() { String prefix = "chen_"; String moduleName = "edu"; // 1、创建代码生成器 AutoGenerator mpg = new AutoGenerator(); // 2、全局配置 GlobalConfig gc = new GlobalConfig(); String projectPath = System.getProperty("user.dir"); gc.setOutputDir(projectPath + "/src/main/java"); gc.setAuthor("Chen"); gc.setOpen(false); //生成后是否打开资源管理器 gc.setFileOverride(false); //重新生成时文件是否覆盖 gc.setServiceName("%sService"); //去掉Service接口的首字母I gc.setIdType(IdType.ID_WORKER_STR); //主键策略 gc.setDateType(DateType.ONLY_DATE);//定义生成的实体类中日期类型 gc.setSwagger2(true);//开启Swagger2模式 mpg.setGlobalConfig(gc); // 3、数据源配置 DataSourceConfig dsc = new DataSourceConfig(); dsc.setUrl("jdbc:mysql://192.168.67.128:3306/" + prefix + "guli_" + moduleName); dsc.setDriverName("com.mysql.jdbc.Driver"); dsc.setUsername("root"); dsc.setPassword("root"); dsc.setDbType(DbType.MYSQL); mpg.setDataSource(dsc); // 4、包配置 PackageConfig pc = new PackageConfig(); pc.setModuleName(moduleName); //模块名 pc.setParent("com.atguigu.guli.service"); pc.setController("controller"); pc.setEntity("entity"); pc.setService("service"); pc.setMapper("mapper"); mpg.setPackageInfo(pc); // 5、策略配置 StrategyConfig strategy = new StrategyConfig(); strategy.setInclude(moduleName + "_\\w*");//设置要映射的表名 strategy.setNaming(NamingStrategy.underline_to_camel);//数据库表映射到实体的命名策略 strategy.setTablePrefix(pc.getModuleName() + "_");//设置表前缀不生成 strategy.setColumnNaming(NamingStrategy.underline_to_camel);//数据库表字段映射到实体的命名策略 strategy.setEntityLombokModel(true); // lombok 模型 @Accessors(chain = true) setter链式操作 strategy.setLogicDeleteFieldName("is_deleted");//逻辑删除字段名 strategy.setEntityBooleanColumnRemoveIsPrefix(true);//去掉布尔值的is_前缀 //自动填充 TableFill gmtCreate = new TableFill("gmt_create", FieldFill.INSERT); TableFill gmtModified = new TableFill("gmt_modified", FieldFill.INSERT_UPDATE); ArrayList<TableFill> tableFills = new ArrayList<>(); tableFills.add(gmtCreate); tableFills.add(gmtModified); strategy.setTableFillList(tableFills); strategy.setRestControllerStyle(true); //restful api风格控制器 strategy.setControllerMappingHyphenStyle(true); //url中驼峰转连字符 //设置BaseEntity strategy.setSuperEntityClass("BaseEntity"); // 写于BaseEntity中的公共字段 strategy.setSuperEntityColumns("id", "gmt_create", "gmt_modified"); mpg.setStrategy(strategy); // 6、执行 mpg.execute(); } }
[ "1060196082@qq.com" ]
1060196082@qq.com
1aa162b0ae74834166750ea62432bd2b1b16404a
7c80a13408420b14a6feab806ca81b6685b41228
/colab/colab-test/colab/client/ColabClientTester.java
7b10acc1f7c2c42dd6fcf5bb336a3ee28aceef27
[]
no_license
chris-martin/gatech-cs-3300-software-engineering
41537c68b2b2d795ab294a2efc04f1ba9e8e0d22
f95d150ce131426687e3ee9b69690045d7bb9bdc
refs/heads/master
2021-01-22T14:32:31.691027
2014-01-06T06:37:24
2014-01-06T06:38:45
15,667,013
0
1
null
null
null
null
UTF-8
Java
false
false
2,244
java
package colab.client; import junit.framework.TestCase; import colab.common.exception.UnableToConnectException; import colab.server.ColabServer; import colab.server.MockColabServer; /** * Test cases for {@link ColabClient}. */ public final class ColabClientTester extends TestCase { /** The port on which the server runs. */ private static final int PORT = 12863; /** A server used for testing connectivity. */ private ColabServer server; /** * Creates a server and binds it to the RMI registry. * * @throws Exception if any exception is thrown */ @Override public void setUp() throws Exception { this.server = new MockColabServer(); this.server.publish(PORT); } /** * Unbinds the server from the RMI registry. * * @throws Exception if any exception is thrown */ @Override public void tearDown() throws Exception { this.server.unpublish(); } /** * Tests attempting to connect to an incorrect address. * * @throws Exception if any unexpected exception is thrown */ public void testConnectFailure() throws Exception { ColabClient client = new ColabClient(); UnableToConnectException expectedException = null; try { client.connect("bad server"); } catch (UnableToConnectException e) { expectedException = e; } assertNotNull(expectedException); } /** * Creates a new client and connects to the server. * * @throws Exception if any exception is thrown */ public void testConnectSuccess() throws Exception { ColabClient client = new ColabClient(); client.connect("localhost:" + PORT); } /* ConnectionRemote connection = server.connect(client); connection.logIn(new UserName("Chris"), "pass4".toCharArray()); Logger.log("User logged in."); CommunityName communityName = new CommunityName("Team Awesome"); connection.logIn(communityName, "awesomePass".toCharArray()); Logger.log("Logged into community."); */ }
[ "ch.martin@gmail.com" ]
ch.martin@gmail.com
62a9eb92c4ec9cd6565600fb3a8995e28e15e895
fb7797b6f7324cf6c6d3ad5c3b2465cdfadabc09
/MyProject/app/src/main/java/com/dpkpranay/myproject/Main3Activity.java
7e7a19611ace82c1c202b42db1cb1ae55343bd74
[]
no_license
deShodhan/College-management
a5c7484d28b08352b3988af24cdfdaf1601b542d
19af9fb3eb9e72acbd7bcaa28ceaad2708efdc4d
refs/heads/main
2023-08-07T20:11:37.897372
2021-09-22T03:36:16
2021-09-22T03:36:16
409,053,819
0
0
null
null
null
null
UTF-8
Java
false
false
715
java
package com.dpkpranay.myproject; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import java.util.Timer; import java.util.TimerTask; public class Main3Activity extends AppCompatActivity { Timer timer; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main3); timer=new Timer(); timer.schedule(new TimerTask() { @Override public void run() { Intent intent=new Intent(Main3Activity.this,startingActivity.class); startActivity(intent); } },5000); } }
[ "60747462+deShodhan@users.noreply.github.com" ]
60747462+deShodhan@users.noreply.github.com
3c735e4583a518f211821aec77dc9503d9508598
c212b9e333f8a488393b3e432a6a5425c18ab68c
/kylodw_pay/src/androidTest/java/com/kylodw/kylodw/pay/ExampleInstrumentedTest.java
a5fbb849717af87a33479a9a46c09805160df3c5
[]
no_license
kylodw/JavaBasicKnowledge
fc1aaa56a014e07ad5ecde5d0a527ccc597797d6
296ece03f45bc42e163c8fcd616a7ecfc39467b2
refs/heads/master
2020-05-17T08:16:30.910324
2019-05-13T00:39:50
2019-05-13T00:39:50
183,600,984
0
0
null
null
null
null
UTF-8
Java
false
false
731
java
package com.kylodw.kylodw.pay; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.kylodw.kylodw.pay.test", appContext.getPackageName()); } }
[ "3222748221@qq.com" ]
3222748221@qq.com
b0fed811e3a993cbb07addb56b67f9270545859a
08ec6edd01c58978c1052866fac3db105f959c4b
/src/chapter07/gitHubQueen.java
b75cb8618b38ce2e97968cdd35d7cb8e143ae41b
[]
no_license
EvgeniiaVak/introToJava
a2c246dec152a654bca0efd9f0e3c31cadb546d6
7491578039ad760ea970a3216743a3f81e31ebdd
refs/heads/master
2021-01-20T08:46:12.311048
2018-10-17T14:49:41
2018-10-17T14:49:41
101,567,532
0
0
null
null
null
null
UTF-8
Java
false
false
4,012
java
package chapter07; /********************************************************************************* * (Game: Eight Queens) The classic Eight Queens puzzle is to place eight queens * * on a chessboard such that no two queens can attack each other (i.e., no two * * queens are on the same row, same column, or same diagonal). There are many * * possible solutions. Write a program that displays one such solution. * *********************************************************************************/ public class gitHubQueen { /** Main method */ public static void main(String[] args) { char[] board; // Create an array // Repeat while queens are attacking do { // Generate a board board = getNewBoard(); // Place eight queens placeQueens(board); } while (isAttacking(board)); // Display solution print(board); } /** placeQueens randomly places eight queens on the board*/ public static void placeQueens(char[] board) { int location; for (int i = 0; i < 8; i++) { do { location = placeQueens(); } while (isOccupied(board[location])); board[location] = 'Q'; } } /** placeQueens randomly places one queen on the board */ public static int placeQueens() { return (int)(Math.random() * 64); } /** isAttacking returns true if two queens are attacking each other */ public static boolean isAttacking(char[] board) { return isSameRow(board) || isSameColumn(board) || isSameDiagonal(board); } /** isSameRow returns true if two queens are in the same row */ public static boolean isSameRow(char[] board) { int[] rows = new int[8]; for (int i = 0; i < board.length; i++) { if (isOccupied(board[i])) { rows[getRow(i)]++; } if (rows[getRow(i)] > 1) return true; } return false; } /** isSameColumn returns true if two queens are in the same column */ public static boolean isSameColumn(char[] board) { int[] columns = new int[8]; for (int i = 0; i < board.length; i++) { if (isOccupied(board[i])) { columns[getColumn(i)]++; } if (columns[getColumn(i)] > 1) return true; } return false; } /** isSameDiagonal returns true if two queens are on the same diagonal */ public static boolean isSameDiagonal(char[] board) { for (int i = 0; i < board.length; i++) { if (isOccupied(board[i])) { for (int j = 0; j < board.length; j++) { if (isOccupied(board[j]) && Math.abs(getColumn(j) - getColumn(i)) == Math.abs(getRow(j) - getRow(i)) && j != i) { return true; } } } } return false; } /** isOccupied returns true if the element in x is the char Q */ public static boolean isOccupied(char x) { return x == 'Q'; } /** getNewBoard returns a char array filled with blank space */ public static char[] getNewBoard() { char[] board = new char[64]; for (int i = 0; i < board.length; i++) board[i] = ' '; return board; } /** print displays the board */ public static void print(char[] board) { for (int i = 0; i < board.length; i++) { System.out.print( "|" + ((getRow(i + 1) == 0) ? board[i] + "|\n" : board[i])); } } /** getRow returns the row number that corresponds to the given index */ public static int getRow(int index) { return index % 8; } /** getColumn returns the column number that corresponds to the given index */ public static int getColumn(int index) { return index / 8; } }
[ "27793901+EvgeniiaVak@users.noreply.github.com" ]
27793901+EvgeniiaVak@users.noreply.github.com
09ecfd166a775210a86cd82a61ec6eaa2d634360
d5ea46cbbec89fedd6b0ba6a6646b7b14424748f
/app/src/androidTest/java/com/joe/bibi/ApplicationTest.java
52ec6da6da4434be8133e0a5243495f050234e8e
[ "Apache-2.0" ]
permissive
JoeSteven/BiBi
9b22b35588b84005cced60463ec0f43a5d84e204
9ec529e74e8ff9b61b72800b5c4fa3dd491e619f
refs/heads/master
2021-01-10T16:39:18.849791
2016-03-13T14:10:17
2016-03-13T14:10:19
51,812,308
6
1
null
null
null
null
UTF-8
Java
false
false
343
java
package com.joe.bibi; 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); } }
[ "qiaoxiaoxi621@163.com" ]
qiaoxiaoxi621@163.com
400a38ff76bad2e05cd65c2c8bffc51c86ac25f6
ca03d018498f251da38ea6f91ce52f7579896e85
/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/work/Catalina/localhost/TomcatTest/org/apache/jsp/security_jsp.java
9100cb7652ce7b13325d77f34a91fc9db8c728c4
[]
no_license
Miyanaqy/Tomcat_JSP
ddbd6da30c93a97b8f2428f206bc45dcb87cbb33
dbca60b06b157553a237bc512e302591b5919af8
refs/heads/master
2020-12-02T07:47:44.116155
2017-08-04T06:27:05
2017-08-04T06:27:05
96,727,258
0
0
null
null
null
null
UTF-8
Java
false
false
4,087
java
/* * Generated by the Jasper component of Apache Tomcat * Version: Apache Tomcat/7.0.79 * Generated at: 2017-07-08 09:32:38 UTC * Note: The last modified time of this file was set to * the last modified time of the source file after * generation to assist with modification tracking. */ package org.apache.jsp; import javax.servlet.*; import javax.servlet.http.*; import javax.servlet.jsp.*; public final class security_jsp extends org.apache.jasper.runtime.HttpJspBase implements org.apache.jasper.runtime.JspSourceDependent { private static final javax.servlet.jsp.JspFactory _jspxFactory = javax.servlet.jsp.JspFactory.getDefaultFactory(); private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants; private volatile javax.el.ExpressionFactory _el_expressionfactory; private volatile org.apache.tomcat.InstanceManager _jsp_instancemanager; public java.util.Map<java.lang.String,java.lang.Long> getDependants() { return _jspx_dependants; } public javax.el.ExpressionFactory _jsp_getExpressionFactory() { if (_el_expressionfactory == null) { synchronized (this) { if (_el_expressionfactory == null) { _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory(); } } } return _el_expressionfactory; } public org.apache.tomcat.InstanceManager _jsp_getInstanceManager() { if (_jsp_instancemanager == null) { synchronized (this) { if (_jsp_instancemanager == null) { _jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig()); } } } return _jsp_instancemanager; } public void _jspInit() { } public void _jspDestroy() { } public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException { final javax.servlet.jsp.PageContext pageContext; javax.servlet.http.HttpSession session = null; final javax.servlet.ServletContext application; final javax.servlet.ServletConfig config; javax.servlet.jsp.JspWriter out = null; final java.lang.Object page = this; javax.servlet.jsp.JspWriter _jspx_out = null; javax.servlet.jsp.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; out.write("\r\n"); out.write("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\r\n"); out.write("<html>\r\n"); out.write("<head>\r\n"); out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\r\n"); out.write("<title>Insert title here</title>\r\n"); out.write("</head>\r\n"); out.write("<body>\r\n"); if(request.isUserInRole("admin")){ out.write("\r\n"); out.write("<h2>welcome to China</h2>\r\n"); } out.write("\r\n"); out.write("</body>\r\n"); out.write("</html>"); } catch (java.lang.Throwable t) { if (!(t instanceof javax.servlet.jsp.SkipPageException)){ out = _jspx_out; if (out != null && out.getBufferSize() != 0) try { if (response.isCommitted()) { out.flush(); } else { out.clearBuffer(); } } catch (java.io.IOException e) {} if (_jspx_page_context != null) _jspx_page_context.handlePageException(t); else throw new ServletException(t); } } finally { _jspxFactory.releasePageContext(_jspx_page_context); } } }
[ "2247762766@qq.com" ]
2247762766@qq.com
0e2c06aef9ea187e12fe2162fc9b3fe3456e6a7c
98d313cf373073d65f14b4870032e16e7d5466f0
/gradle-open-labs/example/src/main/java/se/molybden/Class13642.java
e1e318650e486cc974f11674216254eb2d3d730a
[]
no_license
Molybden/gradle-in-practice
30ac1477cc248a90c50949791028bc1cb7104b28
d7dcdecbb6d13d5b8f0ff4488740b64c3bbed5f3
refs/heads/master
2021-06-26T16:45:54.018388
2016-03-06T20:19:43
2016-03-06T20:19:43
24,554,562
0
0
null
null
null
null
UTF-8
Java
false
false
110
java
public class Class13642{ public void callMe(){ System.out.println("called"); } }
[ "jocce.nilsson@gmail.com" ]
jocce.nilsson@gmail.com
01b25c66ff33df7fce994317227d9fa9b9e12b6e
200cf734e286f2ab15385213da9712388da308db
/src/main/java/com/diamond/ElevatorMetrics.java
a9993634e8f588975bf2822134be8fb60c6ec8c4
[]
no_license
sdiamond/elevator-sample
6363ad98436302b3e80ff53d38facc108c16f4c0
2ce81fc58467fa5986d3599bc9158ebf3c036b6c
refs/heads/master
2021-06-25T23:48:25.621245
2018-09-13T12:40:16
2018-09-13T12:40:16
147,271,115
0
0
null
null
null
null
UTF-8
Java
false
false
2,869
java
package com.diamond; public class ElevatorMetrics { private static long totalWaitTime = 0; private static int totalRequests = 0; private static int totalRides = 0; // number of elevator rides ;a ride is one direction; private static int totalEmptyTraversals = 0; //not sure how to count this private static int totalStops= 0; // how many time all elevators stop, combine with total rides and number of riders // to get number of stops in each ride per rider. public static void addWaitTime (long waitTime){ ElevatorMetrics.totalWaitTime = ElevatorMetrics.totalWaitTime + waitTime; } public static void incrementTotalRequests(){ ElevatorMetrics.totalRequests++; } public static void incrementTotalRides(){ ElevatorMetrics.totalRides++; } public static void incrementEmptyTraversals (){ ElevatorMetrics.totalEmptyTraversals++; } public static void incrementTotalStops(){ ElevatorMetrics.totalStops++; } public static int getTotalRides (){ return totalRides; } public static int getTotalRequests(){ return totalRequests; } public static int getTotalStops(){ return totalStops; } public static int getEmptyTraversals(){ return totalEmptyTraversals; } public static float getAvgNumberRidersPerRide(){ if (totalRides != 0){ return (float)ElevatorMetrics.totalRequests/ElevatorMetrics.totalRides; } else{ return 0; } } public static float getStopsPerRidePerRider(){ if (totalRides > 0 && totalRequests > 0){ return (ElevatorMetrics.totalStops/(ElevatorMetrics.totalRides*ElevatorMetrics.totalRequests)); } return 0; } public static void printOutMetrics(){ System.out.println("*************** Metrics *****************"); System.out.println("total reqeusts: "+ ElevatorMetrics.totalRequests); System.out.println("total rides: "+ totalRides); System.out.println("total stops: "+ totalStops); if (totalRequests != 0){ System.out.println("Wait Time Per Request: "+ ElevatorMetrics.totalWaitTime/ElevatorMetrics.totalRequests); } else{ System.out.println("Wait Time not calculated due to zero value total requests"); } System.out.println("Number of Riders on Each ride (average): "+ getAvgNumberRidersPerRide()); System.out.println("Idle Traversals: "+ ElevatorMetrics.totalEmptyTraversals); System.out.println("Number of stops in each ride per rider (average): "+ getStopsPerRidePerRider()); } public static void reset() { totalWaitTime = 0; totalRequests = 0; totalRides = 0; totalEmptyTraversals = 0; totalStops = 0; } }
[ "stephan@Stephans-MBP.fios-router.home" ]
stephan@Stephans-MBP.fios-router.home
1ba124ba5253908e93969e56cdf556b777926f13
7e156c3a4e52c107143acf0a4c96483b2a5e5719
/library/common/src/main/java/com/arksh/common/utils/ImageLoaderUtils.java
5a44ef57e2ec909dfee58d24eb6f6d74956d97de
[]
no_license
wscaco3/summer
37f8778c688cc6681859e1a467d487c3277c9b34
2268da2eb21353ae7b00ab13eab176ce3c19e39a
refs/heads/master
2021-01-11T07:24:58.234125
2016-11-22T06:28:20
2016-11-22T06:28:20
71,984,542
0
0
null
null
null
null
UTF-8
Java
false
false
3,619
java
package com.arksh.common.utils; import android.content.Context; import android.widget.ImageView; import com.arksh.common.R; import com.bumptech.glide.Glide; import com.bumptech.glide.load.DecodeFormat; import com.bumptech.glide.load.engine.DiskCacheStrategy; import java.io.File; /** * Description : 图片加载工具类 使用glide框架封装 */ public class ImageLoaderUtils { public static void display(Context context, ImageView imageView, String url, int placeholder, int error) { if (imageView == null) { throw new IllegalArgumentException("argument error"); } Glide.with(context).load(url).placeholder(placeholder) .error(error).crossFade().into(imageView); } public static void display(Context context, ImageView imageView, String url) { if (imageView == null) { throw new IllegalArgumentException("argument error"); } Glide.with(context).load(url) .diskCacheStrategy(DiskCacheStrategy.ALL) .centerCrop() .placeholder(R.drawable.ic_image_loading) .error(R.drawable.ic_empty_picture) .crossFade().into(imageView); } public static void display(Context context, ImageView imageView, File url) { if (imageView == null) { throw new IllegalArgumentException("argument error"); } Glide.with(context).load(url) .diskCacheStrategy(DiskCacheStrategy.ALL) .centerCrop() .placeholder(R.drawable.ic_image_loading) .error(R.drawable.ic_empty_picture) .crossFade().into(imageView); } public static void displaySmallPhoto(Context context, ImageView imageView, String url) { if (imageView == null) { throw new IllegalArgumentException("argument error"); } Glide.with(context).load(url).asBitmap() .diskCacheStrategy(DiskCacheStrategy.ALL) .placeholder(R.drawable.ic_image_loading) .error(R.drawable.ic_empty_picture) .thumbnail(0.5f) .into(imageView); } public static void displayBigPhoto(Context context, ImageView imageView, String url) { if (imageView == null) { throw new IllegalArgumentException("argument error"); } Glide.with(context).load(url).asBitmap() .format(DecodeFormat.PREFER_ARGB_8888) .diskCacheStrategy(DiskCacheStrategy.ALL) .placeholder(R.drawable.ic_image_loading) .error(R.drawable.ic_empty_picture) .into(imageView); } public static void display(Context context, ImageView imageView, int url) { if (imageView == null) { throw new IllegalArgumentException("argument error"); } Glide.with(context).load(url) .diskCacheStrategy(DiskCacheStrategy.ALL) .centerCrop() .placeholder(R.drawable.ic_image_loading) .error(R.drawable.ic_empty_picture) .crossFade().into(imageView); } public static void displayRound(Context context, ImageView imageView, String url) { if (imageView == null) { throw new IllegalArgumentException("argument error"); } Glide.with(context).load(url) .diskCacheStrategy(DiskCacheStrategy.ALL) .error(R.drawable.toux2) .centerCrop().transform(new GlideRoundTransformUtil(context)).into(imageView); } }
[ "wscaco3@sina.com" ]
wscaco3@sina.com
d6b2498f15f6179f680a06f3e94930dfd12cc89f
daa2170cf85046fc1f45a034e87b5bb10b6e4022
/src/main/java/cn/livorth/Pojo/Books.java
debef4e12b382ccb0f12d83680ebbe54f54a2a03
[]
no_license
Livorth/SSM-Model
bbcbc66a1128f83a447a1bdc4e45e9a2b2ca50b1
8d79f12760e260cc83b27a17afb7540fead1c626
refs/heads/master
2023-04-01T17:23:57.115416
2021-03-26T12:38:53
2021-03-26T12:38:53
351,630,066
0
0
null
null
null
null
UTF-8
Java
false
false
291
java
package cn.livorth.Pojo; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @Data @NoArgsConstructor @AllArgsConstructor public class Books { private int bookID; private String bookName; private int bookCounts; private String detail; }
[ "livorth@qq.com" ]
livorth@qq.com
ff7f853ebe0476e6658436e72fe56deb404706a6
ef4a5ac5a4497d52d2c2dd831c5fce8fb36ae88b
/src/stringprevie/Prime.java
037a4c770713b0934af98597f9beedf38ea57355
[]
no_license
manikandankasinathan/String
7db4dca9d1b51fd25a767e5c68289139fcf743f7
e0a90521f9c8be550eb6a3bb42ff472bec29a271
refs/heads/master
2020-05-16T11:00:50.790128
2019-08-15T12:58:57
2019-08-15T12:58:57
183,001,999
0
0
null
2019-08-15T12:10:39
2019-04-23T11:38:53
Java
UTF-8
Java
false
false
523
java
package stringprevie; public class Prime { //prime number or not /*public static int input() { int inputnumber=15; for(int i=2;i<=inputnumber/2;i++) { if((inputnumber % i) == 0) { System.out.print("prime"); } } return inputnumber; }*/ public static void main(String args[]) { //input(); int inputnumber=4; for(int i=2;i<=inputnumber/2;i++) { if((inputnumber % i) == 0) { System.out.print("prime"); } } //return inputnumber; } }
[ "Manikandan@Sony-PC" ]
Manikandan@Sony-PC
f2c9a35abdaeaf7b12d58dc28e402dbf1d8a2a66
2a7906626f6f57fba24b5b236d817d9e69c023ae
/exercise20_1/src/main/java/cs544/exercise20_1/IBookDao.java
6caf40f5c23ea9823bc02a70b5c3fb3958256e1e
[]
no_license
jimkatunguka/Enterprise-Architecture
60d0c4ccf2f821ab5efc31e718f843d1a58161f5
9658455c44e06d018806cafc40189759cb68914e
refs/heads/master
2022-12-23T12:01:47.760506
2020-03-11T19:07:16
2020-03-11T19:07:16
243,116,570
0
0
null
null
null
null
UTF-8
Java
false
false
295
java
package cs544.exercise20_1; import java.util.List; public interface IBookDao { public abstract List<Book> getAll(); public abstract void add(Book book); public abstract Book get(int id); public abstract void update(int bookId, Book book); public abstract void delete(int bookId); }
[ "jimkatunguka@gmail.com" ]
jimkatunguka@gmail.com
184c75413a86c12d4d3bd4a8d75ff10abf55309f
5f5d8a57e508699ddd22b7730d1f52b51098ce9e
/webStudy04_MVC/src/main/java/kr/or/ddit/vo/FreeReplyVO.java
2c07c60f538430258288d9698a49f8fcb4a5d3f4
[]
no_license
HYEONSEONG-KIM/JSP_Study
354f90675cdfb07b623b466817c858cb386f49e0
7f8460dc7acfb13524d4c6ead2108017b2c68ab7
refs/heads/main
2023-07-07T21:19:07.071264
2021-07-30T12:53:14
2021-07-30T12:53:14
376,468,033
0
0
null
null
null
null
UTF-8
Java
false
false
403
java
package kr.or.ddit.vo; import java.io.Serializable; import lombok.Data; import lombok.EqualsAndHashCode; @Data @EqualsAndHashCode(of="repNo") public class FreeReplyVO implements Serializable{ private Integer repNo; private Integer boNo; private String repContent; private String repWriter; private String repMail; private String repPass; private String preDate; private Integer repParent; }
[ "kimgustjd@naver.com" ]
kimgustjd@naver.com
68d505cd25b65e71300021e3a3e29f6a841e5e35
f15889af407de46a94fd05f6226c66182c6085d0
/smartsis/src/main/java/com/oreon/smartsis/web/action/domain/DepartmentActionBase.java
03538e4e32d3d774c468a68ddb8c6ebe23e8dea6
[]
no_license
oreon/sfcode-full
231149f07c5b0b9b77982d26096fc88116759e5b
bea6dba23b7824de871d2b45d2a51036b88d4720
refs/heads/master
2021-01-10T06:03:27.674236
2015-04-27T10:23:10
2015-04-27T10:23:10
55,370,912
0
0
null
null
null
null
UTF-8
Java
false
false
5,166
java
package com.oreon.smartsis.web.action.domain; import com.oreon.smartsis.domain.Department; import org.witchcraft.seam.action.BaseAction; import java.util.ArrayList; import java.util.List; import javax.faces.event.ValueChangeEvent; import javax.faces.model.SelectItem; import javax.persistence.EntityManager; import org.hibernate.Criteria; import org.hibernate.criterion.Restrictions; import org.apache.commons.lang.StringUtils; import org.jboss.seam.ScopeType; import org.jboss.seam.annotations.Scope; import org.jboss.seam.annotations.Begin; import org.jboss.seam.annotations.End; import org.jboss.seam.annotations.Factory; import org.jboss.seam.annotations.In; import org.jboss.seam.annotations.Logger; import org.jboss.seam.annotations.Name; import org.jboss.seam.annotations.Out; import org.jboss.seam.Component; import org.jboss.seam.security.Identity; import org.jboss.seam.annotations.datamodel.DataModel; import org.jboss.seam.annotations.datamodel.DataModelSelection; import org.jboss.seam.faces.FacesMessages; import org.jboss.seam.log.Log; import org.jboss.seam.annotations.Observer; import org.witchcraft.base.entity.FileAttachment; import org.apache.commons.io.FileUtils; import org.richfaces.event.UploadEvent; import org.richfaces.model.UploadItem; import com.oreon.smartsis.domain.Employee; public abstract class DepartmentActionBase extends BaseAction<Department> implements java.io.Serializable { @In(create = true) @Out(required = false) @DataModelSelection private Department department; @In(create = true, value = "employeeAction") com.oreon.smartsis.web.action.domain.EmployeeAction employeesAction; @DataModel private List<Department> departmentRecordList; public void setDepartmentId(Long id) { if (id == 0) { clearInstance(); clearLists(); loadAssociations(); return; } setId(id); if (!isPostBack()) loadAssociations(); } /** for modal dlg we need to load associaitons regardless of postback * @param id */ public void setDepartmentIdForModalDlg(Long id) { setId(id); clearLists(); loadAssociations(); } public Long getDepartmentId() { return (Long) getId(); } public Department getEntity() { return department; } //@Override public void setEntity(Department t) { this.department = t; loadAssociations(); } public Department getDepartment() { return (Department) getInstance(); } @Override protected Department createInstance() { Department instance = super.createInstance(); return instance; } public void load() { if (isIdDefined()) { wire(); } } public void wire() { getInstance(); } public boolean isWired() { return true; } public Department getDefinedInstance() { return (Department) (isIdDefined() ? getInstance() : null); } public void setDepartment(Department t) { this.department = t; if (department != null) setDepartmentId(t.getId()); loadAssociations(); } @Override public Class<Department> getEntityClass() { return Department.class; } public com.oreon.smartsis.domain.Department findByUnqName(String name) { return executeSingleResultNamedQuery("department.findByUnqName", name); } /** This function is responsible for loading associations for the given entity e.g. when viewing an order, we load the customer so * that customer can be shown on the customer tab within viewOrder.xhtml * @see org.witchcraft.seam.action.BaseAction#loadAssociations() */ public void loadAssociations() { initListEmployees(); } public void updateAssociations() { com.oreon.smartsis.domain.Employee employees = (com.oreon.smartsis.domain.Employee) org.jboss.seam.Component .getInstance("employee"); employees.setDepartment(department); events.raiseTransactionSuccessEvent("archivedEmployee"); } protected List<com.oreon.smartsis.domain.Employee> listEmployees = new ArrayList<com.oreon.smartsis.domain.Employee>(); void initListEmployees() { if (listEmployees.isEmpty()) listEmployees.addAll(getInstance().getEmployees()); } public List<com.oreon.smartsis.domain.Employee> getListEmployees() { prePopulateListEmployees(); return listEmployees; } public void prePopulateListEmployees() { } public void setListEmployees( List<com.oreon.smartsis.domain.Employee> listEmployees) { this.listEmployees = listEmployees; } public void deleteEmployees(int index) { listEmployees.remove(index); } @Begin(join = true) public void addEmployees() { initListEmployees(); Employee employees = new Employee(); employees.setDepartment(getInstance()); getListEmployees().add(employees); } public void updateComposedAssociations() { if (listEmployees != null) { getInstance().getEmployees().clear(); getInstance().getEmployees().addAll(listEmployees); } } public void clearLists() { listEmployees.clear(); } public String viewDepartment() { load(currentEntityId); return "viewDepartment"; } }
[ "singhj@38423737-2f20-0410-893e-9c0ab9ae497d" ]
singhj@38423737-2f20-0410-893e-9c0ab9ae497d
2c5c29b663999a0c9c6aba98cac0890195a3e790
6e90a9a893a09a89032be47460d5142a8a105d41
/src/main/java/com/kpi/lubchenko/lab1/Ball.java
eca53f56304d0959ac0713eb8d54959c4d64d8ee
[]
no_license
LubchenkoGleb/java-concurrent-kpi
d870b8111003b18fe629dd88944251f0140d9caa
8a4a68d04ae1610ae9ee12e381167ac2215af6c8
refs/heads/master
2021-01-23T17:56:44.496671
2017-11-19T19:50:49
2017-11-19T19:50:49
102,783,903
0
0
null
null
null
null
UTF-8
Java
false
false
2,044
java
package com.kpi.lubchenko.lab1; import lombok.Data; import java.awt.*; import java.awt.geom.Ellipse2D; import java.util.Random; @Data class Ball { private int speed = 50; private boolean isInPocket; private Color color; private BallCanvas canvas; private int size = 20; private int x = 0; private int y = 0; private int dx = 2; private int dy = 2; public Ball(BallCanvas c, Color color) { this.color = color; this.canvas = c; if (Math.random() < 0.5) { x = new Random().nextInt(this.canvas.getWidth() - this.canvas.pocketRadius) + this.canvas.pocketRadius; y = 0; } else { x = 0; y = new Random().nextInt(this.canvas.getHeight() - this.canvas.pocketRadius) + this.canvas.pocketRadius; } } public void draw(Graphics2D g2, Integer number) { Ellipse2D.Double ball = new Ellipse2D.Double(x, y, size, size); g2.setPaint(color); g2.fill(ball); g2.drawString(number.toString(), x, y); checkBallInThePocket(x, y); } public void move() { x += dx; y += dy; if (x < 0) { x = 0; dx = -dx; } if (x + size >= this.canvas.getWidth()) { x = this.canvas.getWidth() - size; dx = -dx; } if (y < 0) { y = 0; dy = -dy; } if (y + size >= this.canvas.getHeight()) { y = this.canvas.getHeight() - size; dy = -dy; } this.canvas.repaint(); } private void checkBallInThePocket(int x, int y) { boolean leftX = x + size < canvas.pocketRadius; boolean rightX = x > canvas.getWidth() - canvas.pocketRadius; boolean topY = y + size < canvas.pocketRadius; boolean downY = y > canvas.getHeight() - canvas.pocketRadius; if((leftX && topY) || (rightX && topY) || (rightX && downY) || (leftX && downY)) { isInPocket = true; } } }
[ "gleb.lubchenko@gmail.com" ]
gleb.lubchenko@gmail.com
7be846fc337de29a50b3ffa63057ca7893441508
e02042bb32f65850fa5691d087a232324016f1e1
/src/com/jspProj/designer/web/DesignerInsert.java
57291fc23b807e1f23b05607fbee881c9bf3d7cc
[]
no_license
choqqd/jspProj
168ba37bfe76d9f8dd0e3366f07ec765bc195780
50cc6693c562dfe956ad5d8fd476d28f49ff7d43
refs/heads/master
2023-05-07T18:23:26.477232
2021-06-07T07:32:43
2021-06-07T07:32:43
371,582,724
0
0
null
null
null
null
UTF-8
Java
false
false
2,088
java
package com.jspProj.designer.web; import java.io.IOException; import java.io.PrintWriter; import java.util.Enumeration; import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.jspProj.common.DbCommand; import com.jspProj.designer.service.DesignerService; import com.jspProj.designer.serviceImpl.DesignerServiceImpl; import com.jspProj.designer.vo.DesignerVO; import com.oreilly.servlet.MultipartRequest; import com.oreilly.servlet.multipart.DefaultFileRenamePolicy; public class DesignerInsert implements DbCommand { @Override public String execute(HttpServletRequest request, HttpServletResponse response) { response.setCharacterEncoding("UTF-8"); int size = 10 * 1024 * 1024; String path = "c:/tmp"; ServletContext sc = request.getServletContext(); path = sc.getRealPath("designer"); String fileName=""; MultipartRequest multi = null; try { multi = new MultipartRequest(request, path, size, "utf-8", new DefaultFileRenamePolicy()); Enumeration files = multi.getFileNames(); while(files.hasMoreElements()) { String itemImage = (String) files.nextElement(); fileName = multi.getFilesystemName(itemImage); } } catch (IOException e) { e.printStackTrace(); } String dsname = multi.getParameter("designerName"); String dsinfo = multi.getParameter("designerinfo"); DesignerVO vo = new DesignerVO(); vo.setDsName(dsname); vo.setDsInfo(dsinfo); vo.setDsImage(fileName); DesignerService service = new DesignerServiceImpl(); int r = service.insertDesigner(vo); String page=""; if(r>0) { page = "designerPage.do"; }else { PrintWriter script; try { script = response.getWriter(); script.println("<script>"); script.println("window.alert('등록에 실패했습니다.')"); script.println("history.go(-1)"); script.println("</script>"); } catch (IOException e) { e.printStackTrace(); } } return page; } }
[ "admin@DESKTOP-2NVHVIH" ]
admin@DESKTOP-2NVHVIH
cac68e361fe2ab981787bdfb8c7dd6c2704248dc
132b755058e5cc6dd6e63ecabcb55ca845dbd549
/app/src/main/java/com/example/user/testapphandh/data/BaseRequest.java
9dc1cef1e6b92a969f7bf34ecadb55432fa59c01
[]
no_license
luck-alex13/TestAppHandH
4754ede37823557efa1fd9c2e2193609f3669e82
2c298a9caf7102e35827b57a0c58ebc4e1708930
refs/heads/master
2020-04-26T12:16:15.160928
2019-08-18T08:19:07
2019-08-18T08:19:07
173,543,983
0
0
null
null
null
null
UTF-8
Java
false
false
424
java
package com.example.user.testapphandh.data; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; public class BaseRequest { @SerializedName("code") @Expose private int code; public BaseRequest(int code) { this.code = code; } public int getCode() { return code; } public void setCode(int code) { this.code = code; } }
[ "luck.alex13@gmail.com" ]
luck.alex13@gmail.com
f1cc5233538b549214a80b459fecd5526d2539be
37b612f49be0b799c638ae9d7a3bf8d00ce45cc1
/app/src/main/java/com/astgo/naoxuanfeng/tools/XmlUtil.java
7ffdcbd80aca8691536b9a2a64fce4b95b11b711
[]
no_license
3051619471/NewSimple-fenxiao
76afd03ae2d3d0f3dd0093cbb644af60eaf42ed3
115720f8da158a6f1fc8b0974d97730d1d799f77
refs/heads/master
2020-04-07T19:03:40.303021
2018-12-19T07:35:16
2018-12-19T07:36:09
158,634,742
0
0
null
null
null
null
UTF-8
Java
false
false
5,306
java
package com.astgo.naoxuanfeng.tools; import android.text.TextUtils; import android.util.Log; import com.astgo.naoxuanfeng.MyConstant; import com.astgo.naoxuanfeng.bean.RingPhoneBean; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlPullParserFactory; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.StringReader; import java.util.ArrayList; import java.util.List; /** * Created by Leef on 2015/4/19. * XmlPullParser 解析 XML 工具类 */ public class XmlUtil { // private static final String ENCODE = "UTF-8"; // 获取 API 请求返回的 XML 字符串中的 Ret 节点值 public static int getRetXML(String xml) { try { return Integer.parseInt(parserFilterXML(xml, MyConstant.RET)); } catch (NumberFormatException e) { e.printStackTrace(); return -1; } } /** * @param xmlData 需要解析的 XML 字符串 * @param field 指定要解析的节点 * @return 解析结果 */ public static String parserFilterXML(String xmlData, String field) { String result = null; if(!TextUtils.isEmpty(xmlData)){ try { XmlPullParserFactory factory = XmlPullParserFactory.newInstance(); XmlPullParser xpp = factory.newPullParser(); xpp.setInput(new StringReader(xmlData)); int eventType = xpp.getEventType(); while (eventType != XmlPullParser.END_DOCUMENT) { String nodeName = xpp.getName(); switch (eventType) { case XmlPullParser.START_TAG: if (field.equals(nodeName)) { result = xpp.nextText(); } break; case XmlPullParser.END_TAG: break; default: break; } eventType = xpp.next(); } } catch (XmlPullParserException | IOException e) { // e.printStackTrace(); } } return result; } public static List<RingPhoneBean> parserRingPhoneXML(String xmlData){ Log.d("parserRingPhoneXML", xmlData); List<RingPhoneBean> list = new ArrayList<>(); RingPhoneBean ringPhoneBean = null; List<String> phones = null; try { XmlPullParserFactory factory = XmlPullParserFactory.newInstance(); XmlPullParser xpp = factory.newPullParser(); xpp.setInput(getStringStream(xmlData) ,"utf-8"); int eventType = xpp.getEventType(); while (eventType != XmlPullParser.END_DOCUMENT) { switch (eventType) { case XmlPullParser.START_TAG: if("Item".equals(xpp.getName())){ ringPhoneBean = new RingPhoneBean(); }else if("Name".equals(xpp.getName())){ ringPhoneBean.setPhoneName(xpp.nextText()); }else if("PhoneList".equals(xpp.getName())){ phones = new ArrayList<>(); int eventType1 = xpp.getEventType(); while(eventType1 != XmlPullParser.END_TAG || !"PhoneList".equals(xpp.getName())){ if(xpp.getEventType() == XmlPullParser.START_TAG && "Item".equals(xpp.getName())){ phones.add(xpp.nextText()); } eventType1 = xpp.next(); } ringPhoneBean.setPhoneListNum(phones); } break; case XmlPullParser.END_TAG: if("Item".equals(xpp.getName())){ list.add(ringPhoneBean); ringPhoneBean = null; } break; default: break; } eventType = xpp.next(); } } catch (XmlPullParserException | IOException e) { // e.printStackTrace(); } return list; } //将流对象读取到内存中转换成字符串 public static byte[] readInput(InputStream in ) throws IOException{ ByteArrayOutputStream out=new ByteArrayOutputStream(); int len=0; byte[] buffer=new byte[1024]; while((len=in.read(buffer))>0){ out.write(buffer,0,len); } out.close(); in.close(); return out.toByteArray(); } //以流的方式从内存中读出 public static InputStream getStringStream(String sInputString){ ByteArrayInputStream tInputStringStream=null; if (sInputString != null && !sInputString.trim().equals("")){ tInputStringStream = new ByteArrayInputStream(sInputString.getBytes()); } return tInputStringStream; } }
[ "3051619471@qq.com" ]
3051619471@qq.com
ce68e8f123e90f8efdfec31ae0ce7ca0c25baf77
c365281a0d65dfc588001d1c42535d594f85a98a
/batch-server/src/main/java/com/example/model/JobRunModel.java
e6ea6bc67bcee0e9711309c13b88bbbc260b2c25
[]
no_license
aegis78/spring-boot-batch-sample
39ef20a2db7a18fce4238cee1b3591a5f2b59ec0
906cc5fbde1d313a0acf8aac08d257e4c1d83176
refs/heads/master
2021-08-28T02:28:24.978271
2017-12-11T03:32:53
2017-12-11T03:32:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
180
java
package com.example.model; import lombok.Data; import lombok.ToString; @Data @ToString public class JobRunModel { private String jobName; private String jobParameters; }
[ "kimyg3174@gmail.com" ]
kimyg3174@gmail.com
291f2e270ba4bbf8643336e7dc228770668c0f0b
73b00b58acdffd869d061116a86de9fcec009c50
/app/controllers/IngredientController.java
742ca9196a4e91bea9e1a0d39f2212e92f8c99c8
[ "CC0-1.0" ]
permissive
NachoHAF/Receta-Api-Playframework-MIMO
3437c68833c243e528a02906d73fe7e660ee4ac2
8541dfa00cb5dbacc68b782ddf0fc376bb16f56a
refs/heads/main
2023-03-24T19:11:53.685923
2021-03-01T20:35:31
2021-03-01T20:35:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,684
java
package controllers; import com.fasterxml.jackson.databind.node.ObjectNode; import models.Ingredient; import models.Recipe; import play.data.Form; import play.data.FormFactory; import play.i18n.Messages; import play.i18n.MessagesApi; import play.mvc.Controller; import play.mvc.Http; import play.mvc.Result; import play.mvc.Results; import play.twirl.api.Content; import javax.inject.Inject; import java.util.List; /** * This controller contains an action to handle HTTP requests * to the application's home page. */ public class IngredientController extends Controller { @Inject private FormFactory formFactory; private final play.i18n.MessagesApi messagesApi; @Inject public IngredientController(MessagesApi messagesApi) { this.messagesApi = messagesApi; } public boolean check_duplicate( Ingredient ingredient ) { for ( int i = 0; i < Ingredient.allIngredients().size(); i++ ) { if ( Ingredient.allIngredients().get( i ).getName_ingredient().equals( ingredient.getName_ingredient() ) ) { return(true); } } return(false); } public Result createIngredient(Http.Request request) { { Messages messages = this.messagesApi.preferred(request); Form<Ingredient> ingredientForm = formFactory.form( Ingredient.class ).bindFromRequest( request ); if ( ingredientForm.hasErrors() ) { return(Results.badRequest( ingredientForm.errorsAsJson() ) ); }else{ Ingredient ingredient = ingredientForm.get(); if ( check_duplicate( ingredient ) ) { return(Results.badRequest( messages.at("Repeat_ingredient") ) ); } ingredient.save(); return(Results.ok( messages.at("Saved_ingredient") ) ); } } } public Result showIngredients(Http.Request request) { Messages messages = this.messagesApi.preferred(request); List<Ingredient> ingredientList = Ingredient.allIngredients(); if ( Ingredient.allIngredients().isEmpty() ) { return(Results.badRequest( messages.at("No_ingredient_list")) ); } else { if ( request.accepts( "application/json" ) ) { ObjectNode result = play.libs.Json.newObject(); int counter = 0; for ( Ingredient c : ingredientList ) { result.put( Integer.toString( ++counter ), c.getName_ingredient() ); } return(Results.ok( result ) ); } else if ( request.accepts( "application/xml" ) ) { Content content = views.xml.ingredients.render( ingredientList ); return(Results.ok( content ) ); } } return(Results.status( 406 ) ); } public Result showIngredient(Long ingredient_id, Http.Request request) { Messages messages = this.messagesApi.preferred(request); Ingredient ingredient = Ingredient.findById( ingredient_id ); if ( ingredient == null ) { return(Results.badRequest( messages.at("No_ingredient") ) ); }else { if ( request.accepts( "application/json" ) ) { ObjectNode result = play.libs.Json.newObject(); result.put( "Ingredient_name", ingredient.getName_ingredient() ); return(Results.ok( result ) ); }else if ( request.accepts( "application/xml" ) ) { Content content = views.xml.ingredient.render( ingredient ); return(Results.ok( content ) ); } } return(Results.status( 406 ) ); } public Result updateIngredient(Long ingredient_id, Http.Request request) { Messages messages = this.messagesApi.preferred(request); Form<Ingredient> ingredientForm = formFactory.form( Ingredient.class ).bindFromRequest( request ); if ( ingredientForm.hasErrors() ) { return(Results.badRequest( ingredientForm.errorsAsJson() ) ); } else { Ingredient ingredientform = ingredientForm.get(); Ingredient ingredient = Ingredient.findById( ingredient_id ); if ( ingredient == null ) { return(Results.badRequest( messages.at("No_found_update") ) ); } else { if ( check_duplicate( ingredientform ) ) { return(Results.badRequest( messages.at("Already_exist_ingredient") ) ); } ingredient.setName_ingredient( ingredientform.getName_ingredient() ); ingredient.update(); return(Results.ok( messages.at("Success_update") ) ); } } } public Result deleteIngredient(Long ingredient_id, Http.Request request) { Messages messages = this.messagesApi.preferred(request); Ingredient ingredient = Ingredient.findById( ingredient_id ); if ( ingredient == null ) { return(Results.badRequest( messages.at("No_found_delete") ) ); } else { ingredient.delete(); return(Results.ok( messages.at("Deleted")) ); } } public Result showRecipesForIngredient(Long ingredient_id, Http.Request request) { Messages messages = this.messagesApi.preferred(request); Ingredient ingredient = Ingredient.findById(ingredient_id); if (ingredient == null) { return (Results.badRequest(messages.at("No_exist_this_ingredient"))); } else { List<Recipe> recipesList = ingredient.get_all_recipes(); if (recipesList.isEmpty()) { return Results.badRequest(messages.at("No_exist_recipes_ingredient")); } if (request.accepts("application/json")) { ObjectNode result = play.libs.Json.newObject(); int counter = 0; for (Recipe c : recipesList) { result.put(Integer.toString(++counter), c.getRecipe_name()); } return (Results.ok(result)); } else if (request.accepts("application/xml")) { Content content = views.xml.recipes.render(recipesList); return (Results.ok(content)); } return(Results.status( 406 ) ); } } }
[ "nachochovivo@gmail.com" ]
nachochovivo@gmail.com
752842697adf95adaea43fcceb66b59f4dbebd2f
62190fd11f54fdf9adf014481f367677ec07e4d7
/src/de/uni_tuebingen/wsi/ct/slang2/dbc/data/Isotope.java
04042fb7bfa879e88b24c23ef4269c6452f8fbf4
[]
no_license
rogerbraun/Slang-DBC
8f5f3321e924671885e212c141180419952128d3
8508137bdd73f4218dedeb01cbfb176a3cbd4515
refs/heads/master
2020-05-26T18:16:30.000495
2010-06-01T09:53:18
2010-06-01T09:53:18
null
0
0
null
null
null
null
ISO-8859-1
Java
false
false
1,901
java
/* * Erstellt: 21.12.2004 */ package de.uni_tuebingen.wsi.ct.slang2.dbc.data; import de.uni_tuebingen.wsi.ct.slang2.dbc.share.DBC_Key; /** * Repräsentiert die Verbindung von einem Wort zu einer Isotopiekategorie. * * @author Volker Klöbb */ public class Isotope extends DB_Element { /** * */ private static final long serialVersionUID = -8098356250731727256L; private transient Chapter chapter; private transient Word word; private String category; private int wordIndex; Isotope(int id, Chapter chapter, String category, Word word) { super(id); this.chapter = chapter; this.category = category; this.word = word; wordIndex = word.getIndex(); } /** * Die Kategorie dieser Isotopie */ public String getCategory() { return category; } /** * Setzt die Kategorie neu */ public void setCategory(String category) { this.category = category; changeState(CHANGE); } /** * Das Kapitel, in dem diese Isotopie vorkommt. */ public Chapter getChapter() { return chapter; } /** * Das Word, auf das sich diese Kategorie bezieht. */ public Word getWord() { return word; } public boolean equals(Object o) { if (o instanceof Isotope) { Isotope i = (Isotope) o; return category.equals(i.category) && word == i.word; } return false; } public String toString() { return category + ": " + word.getContent(); } public int getIndex() { return 0; } /** * Wird vom DBC benötigt. */ public void setChapter(DBC_Key key, Chapter chapter) { key.unlock(); this.chapter = chapter; this.word = (Word) chapter.getTokenAtIndex(wordIndex); } public boolean remove() { changeState(REMOVE); return true; } }
[ "hoesler" ]
hoesler
f0f86d0175c0534fcc7256dd8d479f759a92dcca
e3b4fbb378bd349bd5eb87b8f8bd4145a1f0c2ad
/ComponentImpl/src/main/java/com/xiaojinzi/component/impl/interceptor/OpenOnceInterceptor.java
683fde2a6e1f24b5153212a71370f0a49174a440
[ "Apache-2.0" ]
permissive
hpdx/Component
ffd00061c6f014ce55c96355570eaa85da381a94
d5ff6d370fbb8084523256b8afbb8036d14576df
refs/heads/master
2020-07-30T13:05:17.523507
2019-09-15T08:48:01
2019-09-15T08:48:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,054
java
package com.xiaojinzi.component.impl.interceptor; import android.net.Uri; import com.xiaojinzi.component.error.ignore.NavigationFailException; import com.xiaojinzi.component.impl.RouterInterceptor; /** * 这个拦截器必须在其他任何一个拦截器之前执行 * 从根本上限制同一个界面在一秒钟内只能打开一次,这个拦截器会被框架最先执行 * note: 这个拦截器没有连同 {@link Uri#getScheme()} 一起判断,其实应该一起的, * 但是现实中应该也不会出现一秒钟 host 和 path 都相同的两次路由了 * * time : 2019/01/23 * * @author : xiaojinzi 30212 */ public class OpenOnceInterceptor implements RouterInterceptor { private OpenOnceInterceptor() { } private static class SingletonInstance { private static final OpenOnceInterceptor INSTANCE = new OpenOnceInterceptor(); } public static OpenOnceInterceptor getInstance() { return OpenOnceInterceptor.SingletonInstance.INSTANCE; } private String preHost; private String prePath; /** * 记录上一个界面跳转的时间 */ private long preTargetTime; @Override public void intercept(Chain chain) throws Exception { Uri uri = chain.request().uri; String currentHost = uri.getHost(); String currentPath = uri.getPath(); // 调试的情况下可能会失效,因为你断点打到这里慢慢的往下走那么可能时间已经过了一秒,就失去了限制的作用 long currentTime = System.currentTimeMillis(); // 如果匹配了 if (currentHost.equals(preHost) && currentPath.equals(prePath) && (currentTime - preTargetTime) < 1000) { chain.callback().onError(new NavigationFailException("target '" + uri.toString() + "' can't launch twice in a second")); } else { preHost = currentHost; prePath = currentPath; preTargetTime = currentTime; // 放过执行 chain.proceed(chain.request()); } } }
[ "347837667@qq.com" ]
347837667@qq.com
0f4e5a596eaee1b6f73d5b84b0118a5cde328440
56778297c5917beef88e462d978ef4edc491da71
/keshe/app/src/main/java/com/example/keshe/RegistActivity.java
5cfb686c6d0525d405aa4c7cd2a59a3ad75f3b89
[]
no_license
TEANAET/Plant-ventilation-system
0f3f90c72ea65d7a3702e595ea89e4ded6c7260d
c97ec2792ba30ec1ebbf14d692eb87a47b12d25d
refs/heads/main
2023-07-19T18:36:25.399382
2021-09-02T00:57:47
2021-09-02T00:57:47
402,244,469
0
0
null
null
null
null
UTF-8
Java
false
false
2,305
java
package com.example.keshe; import android.os.Bundle; import android.os.Looper; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; import base.BaseActivity; import mysqllink.DBUtils; import static android.content.ContentValues.TAG; public class RegistActivity extends BaseActivity implements View.OnClickListener{ private EditText user_et; private EditText pas_et; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_regist); init(); } private void init(){ user_et=findViewById(R.id.username); pas_et=findViewById(R.id.password); Button regist=findViewById(R.id.regist); regist.setOnClickListener(this); } @Override public void onClick(View v) { switch (v.getId()){ case R.id.regist: new Thread(new Runnable() { @Override public void run() { String n = user_et.getText().toString().trim(); String psw = pas_et.getText().toString().trim(); if(n.equals("")||psw.equals("")){ Looper.prepare(); Toast toast = Toast.makeText(RegistActivity.this,"输入的账户名或密码不能为空!",Toast.LENGTH_SHORT); toast.show(); Looper.loop(); } DBUtils dbUtils = new DBUtils(); boolean result =dbUtils.regist(n,psw); if (!result){ Looper.prepare(); Toast toast = Toast.makeText(RegistActivity.this,"注册成功!",Toast.LENGTH_SHORT); toast.show(); //Looper.loop(); open(LoginActivity.class); finish(); } //以上为jdbc注册 } }).start(); break; default: break; } } }
[ "ljw17769329455@163.com" ]
ljw17769329455@163.com
12c8eeb09c20178c16c96ebd7f3a97f4d0de5305
c6a2bd81902df5b42019a183c9633f8e1310ba30
/src/main/java/com/example/demo/web/model/BeerInventoryDto.java
3e107e16197aa7b1c97535abb5c31cfe5e07c934
[]
no_license
Rohan9841/ms-beer-service
22f3092ec3696ef2aebce4fccf7f3139a6a621f7
15e228d2c26703d420ea1c24ed82fa28b623a3db
refs/heads/master
2022-12-17T21:23:49.182894
2020-09-11T20:54:40
2020-09-11T20:54:40
288,028,145
0
0
null
null
null
null
UTF-8
Java
false
false
445
java
package com.example.demo.web.model; import java.time.OffsetDateTime; import java.util.UUID; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; @Data @NoArgsConstructor @AllArgsConstructor @Builder public class BeerInventoryDto { private UUID id; private OffsetDateTime createdDate; private OffsetDateTime lastModifiedDate; private UUID beerId; private Integer quantityOnHand; }
[ "mahar@DESKTOP-KGE636K.myfiosgateway.com" ]
mahar@DESKTOP-KGE636K.myfiosgateway.com
a132387d9d518686388ab075ecdb1b16882720d5
9f357dfa2227f3514c8478cf40a934bb2af69551
/week13/CalculatorFerdig.java
42053a229d52a0270738d33c9ed5e7e5537b1e32
[]
no_license
erikfsk/in1010
814b7b56c9404e3ff1bd7992251cd07161e9a25e
d3123440a2c804c998ca161cda2b64e908a419e5
refs/heads/master
2021-05-11T02:45:08.389673
2018-04-27T12:11:59
2018-04-27T12:11:59
118,371,580
0
0
null
null
null
null
UTF-8
Java
false
false
2,544
java
import javafx.application.Application; import javafx.stage.Stage; import javafx.scene.Scene; import javafx.scene.layout.VBox; import javafx.scene.layout.HBox; import javafx.scene.control.Button; import javafx.scene.control.TextField; import javafx.event.EventHandler; import javafx.event.ActionEvent; import javafx.geometry.Pos; public class CalculatorFerdig extends Application { /*Trenger aa kunne hente ut disse i ButtonHandler*/ HBox textPane; TextField t1, t2; HBox buttonPane; TextField res; @Override public void start (Stage stage) { VBox rootPane = new VBox(); textPane = new HBox(); textPane.setAlignment(Pos.CENTER); t1 = new TextField("Number 1"); t2 = new TextField("Number 2"); textPane.getChildren().addAll(t1, t2); buttonPane = new HBox(); buttonPane.setAlignment(Pos.CENTER); Button plusB = new Button("+"); Button minusB = new Button("-"); Button multB = new Button("X"); Button divB = new Button ("/"); buttonPane.getChildren().addAll(plusB, minusB, multB, divB); ButtonHandler btnH = new ButtonHandler(); plusB.setOnAction(btnH); minusB.setOnAction(btnH); multB.setOnAction(btnH); divB.setOnAction(btnH); res = new TextField("Result"); rootPane.getChildren().addAll(textPane, buttonPane, res); stage.setScene(new Scene(rootPane, 200, 100)); stage.setTitle("My Calculator"); stage.show(); } public static void main(String[] args) { launch (args); } //(Bedre?) alternativ -> 4 handlers class ButtonHandler implements EventHandler<ActionEvent>{ @Override public void handle (ActionEvent e) { /*Finner ut hvilken knapp som har vært trykket*/ Button tmp = (Button) e.getSource(); Double num1 = 0.0, num2 = 0.0; try { num1 = Double.parseDouble(t1.getText()); num2 = Double.parseDouble(t2.getText()); } catch (NumberFormatException nfe) { System.out.println("Those aren't numbers!"); return; } String op = tmp.getText(); double r = 0; switch (op){ case "+": r = num1+num2; break; case "-": r = num1-num2; break; case "X": r = num1*num2; break; case "/": r = num1/num2; break; } res.setText(""+r); } } }
[ "erikfsk@student.matnat.uio.no" ]
erikfsk@student.matnat.uio.no
c0982f4df0b247853bd63dcd0a97e446d93fa011
701c9f82e5a5e6f1e5ea74dbcd9978b7793f3376
/SmartBoardGUI/build/generated-sources/jax-ws/WSClient/LoginService.java
2db9acab45b08317694fd3bf35b7df9dde5845b7
[]
no_license
dossee-tsi/iwb_gui
4b8f33b3449e737ae4fb02c5d2fd363f59fbd464
5adc7903fdeb1d1e24361f137aee6def4c2a6dd3
refs/heads/master
2021-01-10T20:55:38.673653
2011-03-18T10:21:27
2011-03-18T10:21:27
1,356,181
2
0
null
null
null
null
UTF-8
Java
false
false
2,799
java
package WSClient; import java.net.MalformedURLException; import java.net.URL; import javax.xml.namespace.QName; import javax.xml.ws.Service; import javax.xml.ws.WebEndpoint; import javax.xml.ws.WebServiceClient; import javax.xml.ws.WebServiceException; import javax.xml.ws.WebServiceFeature; /** * This class was generated by the JAX-WS RI. * JAX-WS RI 2.2-hudson-752- * Generated source version: 2.2 * */ @WebServiceClient(name = "LoginService", targetNamespace = "http://users/", wsdlLocation = "http://192.168.199.36:8000/WS/LoginService?wsdl") public class LoginService extends Service { private final static URL LOGINSERVICE_WSDL_LOCATION; private final static WebServiceException LOGINSERVICE_EXCEPTION; private final static QName LOGINSERVICE_QNAME = new QName("http://users/", "LoginService"); static { URL url = null; WebServiceException e = null; try { url = new URL("http://192.168.199.36:8000/WS/LoginService?wsdl"); } catch (MalformedURLException ex) { e = new WebServiceException(ex); } LOGINSERVICE_WSDL_LOCATION = url; LOGINSERVICE_EXCEPTION = e; } public LoginService() { super(__getWsdlLocation(), LOGINSERVICE_QNAME); } public LoginService(WebServiceFeature... features) { super(__getWsdlLocation(), LOGINSERVICE_QNAME, features); } public LoginService(URL wsdlLocation) { super(wsdlLocation, LOGINSERVICE_QNAME); } public LoginService(URL wsdlLocation, WebServiceFeature... features) { super(wsdlLocation, LOGINSERVICE_QNAME, features); } public LoginService(URL wsdlLocation, QName serviceName) { super(wsdlLocation, serviceName); } public LoginService(URL wsdlLocation, QName serviceName, WebServiceFeature... features) { super(wsdlLocation, serviceName, features); } /** * * @return * returns Login */ @WebEndpoint(name = "LoginPort") public Login getLoginPort() { return super.getPort(new QName("http://users/", "LoginPort"), Login.class); } /** * * @param features * A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values. * @return * returns Login */ @WebEndpoint(name = "LoginPort") public Login getLoginPort(WebServiceFeature... features) { return super.getPort(new QName("http://users/", "LoginPort"), Login.class, features); } private static URL __getWsdlLocation() { if (LOGINSERVICE_EXCEPTION!= null) { throw LOGINSERVICE_EXCEPTION; } return LOGINSERVICE_WSDL_LOCATION; } }
[ "Maxim@aipol033.uah.es" ]
Maxim@aipol033.uah.es
d5706e08bea28683ff9c18322ae4368efe213c6d
58fcc56982486817b13f65fc10c1e04e0a4c81f8
/src/main/java/com/ruyicai/scorecenter/controller/ResponseData.java
8ac56bf28fa5acf1d597b7253642af98feb4078c
[]
no_license
yilucode/scorecenter
c44dac8ad73da07f94267852532d28c4902e6bc2
322da4b4aba58a539445a70b08e310ea88a25de0
refs/heads/master
2021-05-27T07:07:31.731494
2014-08-19T02:32:06
2014-08-19T02:32:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
259
java
package com.ruyicai.scorecenter.controller; import org.springframework.roo.addon.javabean.RooJavaBean; import org.springframework.roo.addon.json.RooJson; @RooJson @RooJavaBean public class ResponseData { private String errorCode; private Object value; }
[ "xiongdecai@ruyicai.com" ]
xiongdecai@ruyicai.com
ed2353e468b8d14d1dc764c3607fa31983212bed
d15058fec18f4cd2c4d869f6a5e2fb5116215eb3
/src/main/java/com/tranzvision/gd/TZMyEnrollmentClueBundle/model/PsTzXsLabelTblKey.java
536a1d8cbcff21e13872760682f3fe9854705fc5
[]
no_license
YujunWu-King/university
1c08118d753c870f4c3fa410f7127d910a4e3f2d
bac7c919f537153025bec9de2942f0c9890d1b7a
refs/heads/BaseLocal
2022-12-26T19:51:20.994957
2019-12-30T11:38:20
2019-12-30T11:38:20
231,065,763
0
0
null
2022-12-16T06:34:06
2019-12-31T09:43:56
Java
UTF-8
Java
false
false
535
java
package com.tranzvision.gd.TZMyEnrollmentClueBundle.model; public class PsTzXsLabelTblKey { private String tzLeadId; private String tzLabelId; public String getTzLeadId() { return tzLeadId; } public void setTzLeadId(String tzLeadId) { this.tzLeadId = tzLeadId == null ? null : tzLeadId.trim(); } public String getTzLabelId() { return tzLabelId; } public void setTzLabelId(String tzLabelId) { this.tzLabelId = tzLabelId == null ? null : tzLabelId.trim(); } }
[ "zhanglang@tranzvision.com.cn" ]
zhanglang@tranzvision.com.cn
f41d2ef47f2ec7f785a6ea56ca6d7e662cde7f9e
70fac9f57ee95ef37310b16e2ac5cf41ec54abd6
/kurtgeiger/src/test/java/pageobject/CheckOutPage.java
f3b4ef6a1f67e23d99339d2121a4cd0375af2b0b
[]
no_license
hirenh/es.kurtgeiger
0fe67f67996aa27aa00f284bcfef779b3c435704
8f3a765f9360148cd68ea05bf171674c636e09e2
refs/heads/master
2020-03-19T01:35:35.465944
2018-05-31T09:14:47
2018-05-31T09:14:47
135,556,661
0
0
null
2018-05-31T09:49:26
2018-05-31T08:40:51
Java
UTF-8
Java
false
false
2,832
java
package pageobject; import driver_helpers.DriverHelpers; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.Select; public class CheckOutPage extends DriverHelpers { public void loginAsAGuest() { driver.findElement(By.id("register-guest:email")).sendKeys("hirenh@mail.com"); driver.findElement(By.cssSelector(".buttons-set.login>button>span>span")).click(); } public void dropDownTitleByPassingValue() { driver.findElement(By.cssSelector(".input-box>input[id=\"shipping:firstname\"]")).sendKeys("john"); driver.findElement(By.cssSelector(".input-box>input[id=\"shipping:lastname\"]")).sendKeys("smith"); driver.findElement(By.cssSelector(".input-box>input[id=\"shipping:telephone\"]")).sendKeys("07852071592"); new Select(driver.findElement(By.id("addressfinder:shippingcountry"))).selectByVisibleText("Spain"); driver.findElement(By.cssSelector("input[ id=\"addressfinder:shipping\"]")).sendKeys("Calle Evangelios, 4"); driver.findElement(By.cssSelector("input[id=\"shipping:street1\"]")).sendKeys("28026 Madrid"); driver.findElement(By.cssSelector("input[id=\"shipping:city\"]")).sendKeys("spain"); new Select(driver.findElement(By.name("shipping[region_id]"))).selectByVisibleText("Alava"); } public void contiuneToPayment() { driver.findElement(By.cssSelector(".button[title=\"Continue to Payment\"]")).click(); } public String paymentSummeryPage() { String actual = driver.findElement(By.cssSelector(".page-title>h2")).getText(); System.out.println(actual); return actual; } public void selectPaymentMethod() { driver.findElement(By.cssSelector("#p_method_sagepayserver_label")).click(); } public void enterCreditCardAndExpiryDetails(String creditCardNumber, String expiry) { driver.switchTo().frame("sagepaysuite-server-incheckout-iframe"); WebElement card = driver.findElement(By.id("form-card_details.field-pan")); WebElement expirydate = driver.findElement(By.cssSelector(".form-group__controls>div>input")); card.sendKeys(creditCardNumber); expirydate.sendKeys(expiry); } public void cvcDetails(String cvcNumber) { WebElement searchBox1 = driver.findElement(By.cssSelector(".form-group__controls>input")); searchBox1.sendKeys(cvcNumber); } public void cardDetails() { WebElement confirmCardDetails = driver.findElement(By.cssSelector("button[value=\"proceed\"]")); confirmCardDetails.click(); } public String cardValidityChecks() { String actual = driver.findElement(By.cssSelector(".form-group__error")).getText(); System.out.println(actual); return actual; } }
[ "patelhirenh@gmail.com" ]
patelhirenh@gmail.com
13d53b2d5c67b535ce9ff8955c17f267d0c86c57
482d9b166afae981b5bbc23eb4e2167138b96063
/src/solutions/Ch16Moderate/Q16_18_Pattern_Matcher/QuestionA.java
7542b370649c901c1f8b22c1ac6fb9ca828927bf
[]
no_license
dhirajhimani/JavaCodePrep
6a7c34efa02c3763da4291bab588eeac8b5fd141
528148894385c74d594454044d2cedae3370c7f1
refs/heads/master
2023-01-13T04:05:19.010479
2020-11-20T10:50:39
2020-11-20T10:50:39
311,274,533
0
0
null
null
null
null
UTF-8
Java
false
false
1,362
java
package solutions.Ch16Moderate.Q16_18_Pattern_Matcher; public class QuestionA { public static boolean doesMatch(String pattern, String value) { if (pattern.length() == 0) return value.length() == 0; int size = value.length(); for (int mainSize = 0; mainSize <= size; mainSize++) { String main = value.substring(0, mainSize); for (int altStart = mainSize; altStart <= size; altStart++) { for (int altEnd = altStart; altEnd <= size; altEnd++) { String alt = value.substring(altStart, altEnd); String cand = buildFromPattern(pattern, main, alt); if (cand.equals(value)) { System.out.println(main + ", " + alt); return true; } } } } return false; } public static String buildFromPattern(String pattern, String main, String alt) { StringBuffer sb = new StringBuffer(); char first = pattern.charAt(0); for (char c : pattern.toCharArray()) { if (c == first) { sb.append(main); } else { sb.append(alt); } } return sb.toString(); } public static void main(String[] args) { String[][] tests = {{"ababb", "backbatbackbatbat"}, {"abab", "backsbatbackbats"}, {"aba", "backsbatbacksbat"}}; for (String[] test : tests) { String pattern = test[0]; String value = test[1]; System.out.println(pattern + ", " + value + ": " + doesMatch(pattern, value)); } } }
[ "dhimani@blackberry.com" ]
dhimani@blackberry.com
63850511177d8b81cc27a0db7ac5902de0c07259
46afd53f643b062454de798bcd4f9565f78f667a
/src/main/java/com/neusoft/SSMTest/bean/Game.java
eb13120ae06e598b4e9b8c78cfa890fa83312d56
[]
no_license
1820057132/maven-ssm
85e7970547c0360955be8e1320eca3a1f34da39e
25d12d596545aed90f933318c29734ace724d931
refs/heads/master
2020-03-28T19:23:58.711163
2018-09-16T07:12:08
2018-09-16T07:12:08
148,972,218
0
0
null
null
null
null
UTF-8
Java
false
false
2,172
java
package com.neusoft.SSMTest.bean; /** * Created by xhbg on 2018/9/5. */ public class Game { //public static final String TABLE_ALIAS = "Game"; //public static final String ALIAS_ID = "游戏Id 自增生成,必须是唯一的"; //public static final String ALIAS_NAME = "游戏名"; //public static final String ALIAS_HOT = "热度"; //public static final String ALIAS_ICON = "图标地址"; //public static final String ALIAS_LETTER = "首字母"; //public static final String ALIAS_HOMEPAGE = "是否首页"; //public static final String ALIAS_TYPE = "type"; //可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息 //columns START // //游戏Id 自增生成,必须是唯一的 private Integer id; //@Length(max=100) //游戏名 private String name; // //热度 private Integer hot; //@Length(max=100) //图标地址 private String icon; //@Length(max=10) //首字母 private String letter; //@Length(max=10) //是否首页 private String homepage; //@Length(max=10) //type private String type; //columns END public void setId(Integer value) { this.id = value; } public Integer getId() { return this.id; } public void setName(String value) { this.name = value; } public String getName() { return this.name; } public void setHot(Integer value) { this.hot = value; } public Integer getHot() { return this.hot; } public void setIcon(String value) { this.icon = value; } public String getIcon() { return this.icon; } public void setLetter(String value) { this.letter = value; } public String getLetter() { return this.letter; } public void setHomepage(String value) { this.homepage = value; } public String getHomepage() { return this.homepage; } public void setType(String value) { this.type = value; } public String getType() { return this.type; } }
[ "1820057132@qq.com" ]
1820057132@qq.com
a9a233169c7e63dc0adade8a189e32002c5c74bf
37d571cca76e4e671605d6866f82d2d59554c769
/app/src/main/java/com/gg/robot/utils/HttpUtils.java
b09b23690b198b9c6c145e6d735738fa18e014b3
[]
no_license
jiangzhiguo1992/Robot
e140e0f5cd351a80040df03b62bd63bb1eb792d3
1206849bc7c6643d35e404b4602a8668faf998c7
refs/heads/master
2021-05-30T21:23:32.197467
2016-01-17T06:35:27
2016-01-17T06:35:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,661
java
package com.gg.robot.utils; import android.util.Log; import java.io.IOException; import java.io.InputStream; import java.net.URLEncoder; import java.util.HashMap; import java.util.Map; import okhttp3.MediaType; import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.RequestBody; import okhttp3.Response; import okhttp3.ResponseBody; /** * author cipherGG * Created by Administrator on 2015/12/25. * describe */ public class HttpUtils { public static final String ROBOT_KEY = "141724ebf2336e4dee725909b41df44e"; public static final String ROBOT_INDEX_PATH = "http://op.juhe.cn/robot/index"; public static final String ROBOT_CODE_PATH = "http://op.juhe.cn/robot/code"; public static ResponseBody getBody(String url, HashMap<String, Object> params) { OkHttpClient client = new OkHttpClient(); try { StringBuilder buffer = new StringBuilder(); //GET里记得加上? buffer.append("?"); if (params != null) { for (Map.Entry<String, Object> entry : params.entrySet()) { buffer.append(entry.getKey()) .append("=") .append(URLEncoder.encode(entry.getValue().toString(), "utf-8")) .append("&"); } //删去最后一个符号& buffer.deleteCharAt(buffer.length() - 1); } Request request = new Request.Builder() .url(url + buffer.toString()) .build(); Response response = client.newCall(request).execute(); if (response != null) { return response.body(); } } catch (IOException e) { e.printStackTrace(); } Log.e("Response", " == null"); return null; } public static String getString(String url, HashMap<String, Object> params) { ResponseBody responseBody = getBody(url, params); if (responseBody != null) { try { return responseBody.string();//看清楚是string,不是toString!!! } catch (IOException e) { e.printStackTrace(); } } Log.e("ResponseBody", "== null"); return null; } public static InputStream getStream(String url, HashMap<String, Object> params) { ResponseBody responseBody = getBody(url, params); if (responseBody != null) { return responseBody.byteStream(); } Log.e("ResponseBody", "== null"); return null; } public static byte[] getBytes(String url, HashMap<String, Object> params) { ResponseBody responseBody = getBody(url, params); if (responseBody != null) { try { return responseBody.bytes(); } catch (IOException e) { e.printStackTrace(); } } Log.e("ResponseBody", "== null"); return null; } public static ResponseBody postBody(String url, String json) { OkHttpClient client = new OkHttpClient(); MediaType JSON = MediaType.parse("application/json; charset=utf-8"); RequestBody body = RequestBody.create(JSON, json); Request request = new Request.Builder() .url(url) .post(body) .build(); try { Response response = client.newCall(request).execute(); return response.body(); } catch (IOException e) { e.printStackTrace(); } return null; } }
[ "727918130@qq.com" ]
727918130@qq.com
b40e4cca5870c109b6d2ec4e89f61acc31f0b747
9d0b5f0e99925fcfb73f5aebdc74081040db8973
/PatternsComportamentais/src/Strategy_ex6_1/MensagemDeTerca.java
c42100f56d219165ffda03c1b6feff46c696f50a
[]
no_license
vtrcavassana/java_Patterns_Comportamentais
19df786d464e505aa823093b115baaa7073590cb
d3ab6d01302c4070e2be79c0f190b28007282a97
refs/heads/master
2022-09-16T23:51:49.735297
2020-06-06T02:49:18
2020-06-06T02:49:18
269,827,551
0
0
null
null
null
null
ISO-8859-1
Java
false
false
364
java
package Strategy_ex6_1; public class MensagemDeTerca implements MensagemDoDia { @Override public String mensagem() { return "Hoje infelizmente ainda é terça! Eclipse IDE, StackOverflow e fóruns de informática com alguém DESESPERADO pedindo ajuda com o mesmo problema que você está enfrentando AGORA, porém em 2002, e infelizmente sem resposta."; } }
[ "victor.cavassana@outlook.com" ]
victor.cavassana@outlook.com
d8bd9586e74e636a9b465a84744fcb0e202a2db6
68022d311463a775dd7d184369f6086c31f91c69
/Gedistribueerde Systemen/voorbeeld TCP-IP/src/be/kdg/componenten/client/Client.java
6049121721ce0d293a7315bb422a4dd27216dd7b
[ "Apache-2.0" ]
permissive
XavierGeerinck/KdG_IAO301A
067e18fc9f803e9796a0ff4517eb6b494ee0282e
6937c5fa10f6b1cfce31979551b16f7186532483
refs/heads/master
2021-05-26T20:53:30.074092
2013-12-04T15:29:58
2013-12-04T15:29:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,985
java
/* * Gedistribueerde systemen * Karel de Grote-Hogeschool * 2006-2007 * Kris Demuynck */ package be.kdg.componenten.client; import be.kdg.componenten.communication.NetworkAddress; import be.kdg.componenten.contacts.Address; import be.kdg.componenten.contacts.Contacts; import be.kdg.componenten.contacts.ContactsStub; /** * Represents a client component that tests the Contacts component. */ public class Client { private Contacts contacts; /** * Creates a new Client component. * * @param contactsAddress the address of the Contacts component. */ public Client(NetworkAddress contactsAddress) { contacts = new ContactsStub(contactsAddress); } /** * Adds two contacts (1 invalid and one correct) to the Contacts component * and tests if they are present. */ private void run() { Address address = new Address("Langestraat", "42", "2000", "Ergens"); contacts.add("ikke", address, "03/123.45.67"); address = new Address("Langestraat", "42", "2000", "Antwerpen"); contacts.add("gij", address, "03/765.43.21"); System.out.println("address of ikke is:"); address = contacts.addressOf("ikke"); System.out.println(address); System.out.println("address of gij is:"); address = contacts.addressOf("gij"); System.out.println(address); } /** * Starts this component. * * @param args the ip-address and port-number of the Contacts component. */ public static void main(String[] args) { if (args.length != 2) { System.err.println("Usage: java Client <contactsIP> <contactsPort>"); System.exit(1); } int port = Integer.parseInt(args[1]); NetworkAddress contactsAddress = new NetworkAddress(args[0], port); Client client = new Client(contactsAddress); client.run(); } }
[ "xaviergeerinck@Xaviers-MacBook-Pro.local" ]
xaviergeerinck@Xaviers-MacBook-Pro.local
309277c353dc548634fcfee6bb71fcd78486d7b9
bfcac99207b4d362572f025a28e7ceb2b9d71385
/src/main/java/temperatus/model/dao/impl/GameDaoImpl.java
bd66b02461bb89132f0b526a8f5e7fe948e66f38
[]
no_license
albertoqa/temperatus
e0885ac2e988c53a7edf7d7f6d50ec617d17674e
913d40d6a4d8f0f173921a6f991710af39d906ce
refs/heads/master
2021-03-27T17:30:40.107243
2019-03-17T19:49:18
2019-03-17T19:49:18
51,263,280
0
0
null
null
null
null
UTF-8
Java
false
false
284
java
package temperatus.model.dao.impl; import org.springframework.stereotype.Repository; import temperatus.model.dao.GameDao; /** * Created by alberto on 26/12/15. */ @Repository public class GameDaoImpl extends GenericDaoImpl implements GameDao{ public GameDaoImpl() { } }
[ "qa.alberto@gmail.com" ]
qa.alberto@gmail.com
442bdeac66c6af852b37e3c3312d40ff2a88fc70
775de28f30260bf433e604aedb7c8d670b0f0d1f
/src/main/java/root/appConfiguration/ApplicationConfig.java
b28042f6baa0ba0e7208265bcf0bb2944eb0186c
[]
no_license
league55/car-server
5bd38893b5761f2e1e5fb0895a12cf2f9001b30e
ac993530fe372c6c9e158f0c09a183ea1a65e7bc
refs/heads/master
2021-04-12T03:46:12.954910
2018-04-16T07:29:33
2018-04-16T07:29:33
125,924,078
0
0
null
null
null
null
UTF-8
Java
false
false
163
java
package root.appConfiguration; import org.springframework.context.annotation.Configuration; @Configuration public class ApplicationConfig { // not used now }
[ "marudenko96@gmail.com" ]
marudenko96@gmail.com
66f5f117779e0a7433dbd38c11308cef69cb61d9
aaccdc6095fe8111f7c6a0d6368f3da893cff573
/src/com/freedom/search/services/ArticleService.java
09d374607b5e0f06dd413a1de538210116490a48
[]
no_license
hecj/solr-search
b08daf1b579684c90fe42c29ef9629a9b9adf1a2
65a7fb89ea0c5663a47c6b223ccce5fb1d3a2b41
refs/heads/master
2021-01-01T16:31:16.937843
2015-03-19T08:43:25
2015-03-19T08:43:25
27,591,848
0
0
null
null
null
null
UTF-8
Java
false
false
2,073
java
package com.freedom.search.services; import java.util.List; import java.util.Map; import com.freedom.search.hibernate.entity.LaArticle; /** * @类功能说明:文章业务类 * @类修改者: * @修改日期: * @修改说明: * @作者:HECJ * @创建时间:2014-12-4 上午09:45:35 * @版本:V1.0 */ public interface ArticleService { /** * @函数功能说明 根据文章ID查询 * @修改作者名字 HECJ * @修改时间 2014-12-2 * @修改内容 * @参数: @param id * @参数: @return * @return Article * @throws */ public LaArticle searchArticleById(String pArticleNo); /** * @函数功能说明 添加 * @修改作者名字 HECJ * @修改时间 2014-12-3 * @修改内容 * @参数: @param article * @return void * @throws */ public void addArticle(LaArticle pArticle); /** * @函数功能说明 添加 * @修改作者名字 HECJ * @修改时间 2014-12-3 * @修改内容 * @参数: @param article * @return void * @throws */ public void addArticle(List<LaArticle> pArticles); /** * @函数功能说明 根据文章Id删除 * @修改作者名字 HECJ * @修改时间 2014-12-5 * @修改内容 * @参数: @param pArticleNo * @return void * throws */ public void deleteArticle(String pArticleNo); /** * @函数功能说明 分页查询文章集合 * @修改作者名字 HECJ * @修改时间 2014-12-5 * @修改内容 * @参数: @param pParams{pagination:Pagination}<br> * @参数: @return{rArticleList:List<Article/>,pPagination:Pagination} * @return Map<String,Object> * throws */ public Map<String,Object> searchArticleList(Map<String,Object> pParams); /** * @函数功能说明 从solr中查询文章集合 * @修改作者名字 HECJ * @修改时间 2014-12-8 * @修改内容 * @参数: @param pParams * @参数: @return * @return Map<String,Object> * throws */ public Map<String,Object> searchArticleListBySolr(Map<String,Object> pParams); }
[ "275070023@qq.com" ]
275070023@qq.com
724a2e48c770bf88f4e502acdb198171b155f2a7
542efb2d447273d5142ef92129bbbdd9914344a2
/onedrivesdk/src/main/java/com/onedrive/sdk/generated/IBaseThumbnailStreamRequestBuilder.java
9c329046dd3023b49a74979fe7bd316330e8e4fa
[ "MIT" ]
permissive
spudi/onedrive-sdk-android
d8c58640345a7f7e6e35efc6e1c68384c93e21df
1553371690e52d9b4ff9c9ee0b89c44879b43711
refs/heads/master
2021-04-27T00:22:41.735684
2018-03-05T14:32:55
2018-03-05T14:32:55
123,801,688
0
0
MIT
2018-03-04T15:25:44
2018-03-04T15:25:44
null
UTF-8
Java
false
false
2,089
java
// ------------------------------------------------------------------------------ // Copyright (c) 2015 Microsoft Corporation // // 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.onedrive.sdk.generated; import com.onedrive.sdk.concurrency.*; import com.onedrive.sdk.core.*; import com.onedrive.sdk.extensions.*; import com.onedrive.sdk.http.*; import com.onedrive.sdk.generated.*; import com.onedrive.sdk.options.*; import com.onedrive.sdk.serializer.*; import java.util.*; // **NOTE** This file was generated by a tool and any changes will be overwritten. /** * The interface for the Base Thumbnail Stream Request Builder. */ public interface IBaseThumbnailStreamRequestBuilder extends IRequestBuilder { /** * Creates the request */ IThumbnailStreamRequest buildRequest(); /** * Creates the request with specific options instead of the existing options */ IThumbnailStreamRequest buildRequest(final List<Option> options); }
[ "pnied@microsoft.com" ]
pnied@microsoft.com
bbfadaa63bbde3400ed2113114aa53cb95f57df3
4e9b445b1f4453078994f6bc9c5b59183f1b2be1
/HW_02/src/hr/fer/zemris/java/custom/collections/EmptyStackException.java
d0faea8f9c84ab5b80b2dffdab294309ef56036a
[]
no_license
antespajic/java-fer
e286ad672bb9d1975e1e0f8942208c094a3867d5
0bd6cf121b2df4586a974230119a18eba880cae4
refs/heads/master
2021-07-22T19:08:15.210926
2017-11-02T05:48:27
2017-11-02T05:48:27
53,845,916
0
4
null
null
null
null
UTF-8
Java
false
false
648
java
package hr.fer.zemris.java.custom.collections; /** * Thrown by methods in the <code>ObjectStack</code> class to indicate that the * stack is empty. * * @author Ante Spajic */ public class EmptyStackException extends RuntimeException { private static final long serialVersionUID = 5084686378493302095L; /** * Constructs a new <code>EmptyStackException</code> with <tt>null</tt> as * its error message string. */ public EmptyStackException() { } /** * Constructs a new <code>EmptyStackException</code> with provided message * as its error message string. */ public EmptyStackException(String string) { super(string); } }
[ "ante.spajic@yahoo.com" ]
ante.spajic@yahoo.com
6429b1ca90151d30e843d9d0eb79e16d192ecabe
40d6492ab8e60fe78392d1e744dd6b4a707a30d2
/180517/NoVlakna/src/test/java/NoVlaknaTest.java
638473348590b22d9818af5b58f549ccb3f7dab3
[]
no_license
kockahonza/UvodDoProgramovani
f99f13e03c59b067083f8e96ef7f387fc9654c0f
ed70c90bd596360c6aad1729fc476cf3e8788269
refs/heads/master
2018-12-13T00:53:15.433958
2018-09-13T13:53:22
2018-09-13T13:53:22
111,068,912
0
0
null
null
null
null
UTF-8
Java
false
false
174
java
import static org.junit.Assert.assertEquals; import org.junit.Test; public class NoVlaknaTest { @Test public void NoVlaknaExists() { NoVlakna SMC = new NoVlakna(); } }
[ "kockahonza@gmail.com" ]
kockahonza@gmail.com
ebc3efcb917c99e1346b94b71857ff79bd1f045c
0ae04e33577b4239d2a5163a17e075325eda6805
/Assignment2/src/ca/utoronto/utm/othello/viewcontroller/ClausesStopwatchEventHandler.java
0af5f5ebc9b19912848d322ce4d55e30c676ca23
[]
no_license
shadowshadow725/CSC207H5F
f81d11a277d16ab6000114b5da91346d3b587407
6cc3840fde4ec483022a473dc6b0e183a557a8b9
refs/heads/master
2023-02-21T17:34:56.161193
2021-01-24T20:57:18
2021-01-24T20:57:18
332,552,365
1
0
null
null
null
null
UTF-8
Java
false
false
892
java
package ca.utoronto.utm.othello.viewcontroller; import ca.utoronto.utm.othello.model.Othello; import javafx.animation.Timeline; import javafx.event.ActionEvent; import javafx.event.Event; import javafx.event.EventHandler; import java.sql.SQLOutput; /** * Stop watch EventHandler * * @author team RankedFlexofFour */ public class ClausesStopwatchEventHandler implements EventHandler<ActionEvent> { private int secondsLeft; private ClausesStopwatch cs ; private Timeline countdownTimeline; public ClausesStopwatchEventHandler(int sec, ClausesStopwatch cs, Timeline tl){ this.secondsLeft = sec; this.cs = cs; this.countdownTimeline = tl; } @Override public void handle(ActionEvent event) { cs.secondPass(); cs.notifyObservers(); if (secondsLeft <= 0) { countdownTimeline.stop(); } } }
[ "xinhao.hou@mail.utoronto.ca" ]
xinhao.hou@mail.utoronto.ca
7ad503eb6a5e3a8d821fb897c31fac65043711f4
7ac08ae2bf5ca5b5de9ea50834add1a94e4216e0
/webapp/src/main/java/de/nitram509/mkat/api/search/KeywordCombination.java
894c41022034201e7bddc4d41fb4dee67a902fa6
[]
no_license
nitram509/mkat
bdae7c37b4dabbac69a9a10a53309ed01b1d8292
64f68d633df715e837769871915f94d361287f5b
refs/heads/master
2023-01-23T21:38:09.757682
2023-01-21T10:47:55
2023-01-21T10:47:55
15,527,535
2
0
null
2023-01-21T10:48:33
2013-12-30T12:41:39
Java
UTF-8
Java
false
false
433
java
package de.nitram509.mkat.api.search; public enum KeywordCombination { OR, AND; public static KeywordCombination valueFrom(String value, KeywordCombination defaultValue) { if (value != null) { value = value.toUpperCase(); for (KeywordCombination keywordCombination : values()) { if (keywordCombination.toString().equals(value)) return keywordCombination; } } return defaultValue; } }
[ "maki@bitkings.de" ]
maki@bitkings.de
44ca25ec9ee574c1b5447ac99770c8c6318a96b1
dd227b26dcafc86c421365095df9849c256eaa5b
/MapEditor2/MapEditor.java
3cd6a396189bd614de0d2d4723e3468902537610
[]
no_license
Ethen80/TankWar
f0e9b30316463db4e0548a962b2e12a34b7ea224
4337f40724f2df0b28a54496c3b4541357d60e05
refs/heads/master
2022-10-10T08:37:00.380169
2020-06-04T01:16:10
2020-06-04T01:16:10
267,213,563
0
0
null
null
null
null
UTF-8
Java
false
false
124
java
package MapEditor2; public class MapEditor { public static void main(String[] args) { new FrameMain(); } }
[ "wcz94438@hotmail.com" ]
wcz94438@hotmail.com
32c03d36ee304f30cbe55acfcb9c5c5e0597dcc5
a35d63bf12540450433ef4bb5aac8f1d74054471
/jpa-interface-sample/src/main/java/com/sample/jpa/model/state/StateDiagram.java
5455d9033357db2103f5fb20437527ac6f9810ac
[]
no_license
Consolefire/sample-projects
2439f7bf07e78c5052823e350cc1bb61d04618c7
37391a584223da7bb087cf456a8f0a3fc9ed0cda
refs/heads/master
2021-01-10T17:39:33.323339
2016-04-29T13:42:32
2016-04-29T13:43:06
50,579,290
0
0
null
null
null
null
UTF-8
Java
false
false
2,222
java
/** * */ package com.sample.jpa.model.state; import java.util.HashSet; import java.util.Set; import javax.persistence.Access; import javax.persistence.AccessType; import javax.persistence.CascadeType; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.OneToMany; import javax.persistence.OneToOne; import javax.persistence.Table; import com.sample.jpa.model.framework.DirectedGraph; import com.sample.jpa.model.service.Service; /** * @author sabuj.das * */ @Entity @Table @Access(AccessType.PROPERTY) public class StateDiagram extends DirectedGraph<Service, State, StateNode> { @Id @GeneratedValue(strategy = GenerationType.AUTO) public Long getId() { return super.getId(); } @Override @OneToMany(targetEntity = StateNode.class, cascade = CascadeType.ALL) public Set<StateNode> getNodes() { return super.getNodes(); } @Override @OneToOne(targetEntity = Service.class, cascade = CascadeType.ALL) @JoinColumn(name = "owner_node_id") public Service getOwner() { return super.getOwner(); } @Override @OneToOne(targetEntity = StateNode.class, cascade = CascadeType.ALL) public Set<StateNode> getRoots() { return super.getRoots(); } public void addStateTransition(StateNode sourceNode, StateNode targetNode) { if(null == targetNode){ return; } if(null == sourceNode){ addNode(targetNode); } addNode(targetNode, sourceNode); StateTransition stateTransition = new StateTransition(); stateTransition.setSource(sourceNode); stateTransition.setTarget(targetNode); sourceNode.addTransition(stateTransition); } public Set<StateNode> getStateNodesOf(StateNode.Type type){ Set<StateNode> nodes = new HashSet<>(); for (StateNode sn : getNodes()) { if(type.equals(sn.getType())){ nodes.add(sn); } } return nodes; } public StateDiagram copy(){ StateDiagram diagram = new StateDiagram(); return diagram; } /** * @param diagram */ public void copy(StateDiagram diagram) { } }
[ "sabuj.das@flipkart.com" ]
sabuj.das@flipkart.com
656af46c8eb2d2271bdb6d6d07c8970712b89ee8
a889b5b6e35667e76178b7914146a534dd22aa5e
/W6_GeoQuiz_MVC_start/app/src/main/java/itp341/geoquiz/Model/QuizQuestion.java
6df8b36d55a55261fa26317a131f5820e75c088a
[]
no_license
Shamitbh/ITP-341
361563de81f263f8746c14c1e174bd09e609606b
4eb9196cd1af6ef88c699390e16bde42826faf30
refs/heads/master
2021-01-25T10:07:51.423914
2018-02-28T20:53:17
2018-02-28T20:53:17
123,340,661
0
1
null
null
null
null
UTF-8
Java
false
false
1,067
java
package itp341.geoquiz.Model; import java.io.Serializable; /** * Created by Shamit on 9/25/17. */ public class QuizQuestion implements Serializable{ private String question; private boolean answer; public QuizQuestion(String question, boolean answer) { this.question = question; this.answer = answer; } public QuizQuestion(String question, int booleanAsInt) { this.question = question; if (booleanAsInt == 0){ this.answer = false; } else{ this.answer = true; } } public String getQuestion() { return question; } public void setQuestion(String question) { this.question = question; } public boolean isAnswer() { return answer; } public void setAnswer(boolean answer) { this.answer = answer; } @Override public String toString() { return "QuizQuestion{" + "question='" + question + '\'' + ", answer=" + answer + '}'; } }
[ "Shamitbh@usc.edu" ]
Shamitbh@usc.edu
d93125be0175f51e32d5a442848f1d787a63a7ba
7e3d5d0a35ec01c562a75150220b7f9afe9a6f12
/src/pl/datasets/utils/Pallete.java
e67596c28c6ab83c2b6132c2929a14c8a6b2cbe4
[]
no_license
Marchuck/Datasets
48bfd8682e2da8b3f14b529c480e391c8030f338
be7c02076dec17e6e35e20dff8b31084a2c82d6c
refs/heads/master
2020-05-21T23:13:27.320040
2016-06-22T22:42:30
2016-06-22T22:42:30
59,765,238
2
1
null
null
null
null
UTF-8
Java
false
false
884
java
package pl.datasets.utils; import java.awt.*; /** * @author Lukasz * @since 26.05.2016. * Defines the app colors here */ public class Pallete { private Pallete() { } public static Color hex2Rgb(String colorStr) { return new Color( Integer.valueOf(colorStr.substring(1, 3), 16), Integer.valueOf(colorStr.substring(3, 5), 16), Integer.valueOf(colorStr.substring(5, 7), 16)); } public static Color primaryColor() { return hex2Rgb("#3F51B5"); } public static Color primaryDarkColor() { return hex2Rgb("#FFC107"); } public static Color accentColor() { return hex2Rgb("#3f51b5"); } public static Color primaryTextColor() { return hex2Rgb("#212121"); } public static Color secondaryTextColor() { return hex2Rgb("#727272"); } }
[ "lukmar993@gmail.com" ]
lukmar993@gmail.com
837b1a357caf16b71b9e042a06dd9282f1166cf6
5ee228d4a113066323175f280b73aad7b06b0c81
/realestate/src/com/realestate/action/ModifyHouseInfoActionTransfer.java
43a916a2aff3fd47aa94c6465b5c1ffd51265757
[]
no_license
zzxwill/huffman4zzxwill
e06125262afa9140ac407b104e5d0e1d23c319fb
f60e499a017a7e36fd132029180de76e676f7a94
refs/heads/master
2021-01-16T01:08:15.143548
2008-12-31T16:02:00
2008-12-31T16:02:00
32,726,230
0
0
null
null
null
null
UTF-8
Java
false
false
664
java
package com.realestate.action; import com.opensymphony.xwork2.ActionSupport; import com.realestate.dao.HouseDAO; import com.realestate.pojo.House; public class ModifyHouseInfoActionTransfer extends ActionSupport{ private String id; private House house; public String execute(){ house = new House(); HouseDAO dao = new HouseDAO(); house = dao.findById(Integer.valueOf(id)); return SUCCESS; } public String getId(){ return this.id; } public void setId(String id){ this.id = id; } public House getHouse(){ return this.house; } public void setHouse(House house){ this.house = house; } }
[ "zzxwill@9ba967c2-d752-11dd-8179-53c65a4d6d95" ]
zzxwill@9ba967c2-d752-11dd-8179-53c65a4d6d95
6ef0b264d8a54b83a509a7a09e87433cca950b79
2cd99ada931d731e98a7a288c59fb50935b4c089
/src/test/java/Pages/MyAppsPage.java
d188418e30e59dad829d13d3d9b3e13f744cea91
[]
no_license
salmon500apps/pbxPlus
c8ea552e70108e8aba2babff206b7d37c8cd48ed
682d67a603a4d88ed4b810415ca86b6e177caef0
refs/heads/master
2022-12-24T14:40:30.954789
2020-10-05T11:22:53
2020-10-05T11:22:53
301,376,022
0
0
null
null
null
null
UTF-8
Java
false
false
377
java
package Pages; import org.openqa.selenium.By; public class MyAppsPage { //public static By createAccount=By.xpath("//a[@id='createAccountSubmit']"); public static By allappslink=By.xpath("//*[@class='border-0 card-body card-padding']/h5"); public static String pbxpluslinknm = "Click on PBX PLus link"; public static String botuplinknm = "Click on Botup link"; }
[ "salmon.ajipur@500apps.com" ]
salmon.ajipur@500apps.com
3fb10e5fbd4429a4d6075b7f9c3d5419ac8cc663
3158f150b6e9c7dfc2d705d6335be94b43474d0b
/src/main/java/com/king/modules/sys/home/entity/HomeViewList.java
b7273d7a487ec83730edd205862836ac5b7b5d18
[]
no_license
KINGYJH/AmazeUI-Admin
171cad93f3e97cd48e8c0207e826313c51c043e2
e1adc7b6ef1a9ff8ba10fa75478133fc828dd990
refs/heads/master
2020-11-30T00:33:25.328811
2017-09-25T08:29:37
2017-09-25T08:29:37
95,857,949
0
0
null
null
null
null
UTF-8
Java
false
false
1,456
java
package com.king.modules.sys.home.entity; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import java.io.Serializable; import java.text.Collator; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; /** * Created by YJH * on 2017/7/26 15:46. * 注释: */ //设置生成的xml的根节点的名称 @XmlRootElement(name = "MenuViews") public class HomeViewList implements Serializable { private List<HomeView> homeViews = new ArrayList<>(); @XmlElement(name = "MenuView") public List<HomeView> getHomeViews() { return homeViews; } public void setHomeViews(List<HomeView> homeViews) { this.homeViews = homeViews; } public HomeViewList sort() { Collections.sort(this.homeViews, new Comparator<HomeView>() { @Override public int compare(HomeView o1, HomeView o2) { return o1.getSort().compareTo(o2.getSort()); } }); return this; } public List<HomeView> getShowHomeViews() { List<HomeView> returnList = new ArrayList<>(); for (HomeView item : this.homeViews) { if (item.getIsShow().equals("0")) { returnList.add(item); } } return returnList; } }
[ "695724629@qq.com" ]
695724629@qq.com
cd882bd366ab984bda5272cad1b817bcceec7fa1
795642815477885267d4544ad7e89d3e6c86f2b1
/src/test/java/de/rkable/coverity/metrics/DirectoryTest.java
285a8abdbe8e63c692b56fb05f7835eba73a5116
[]
no_license
MarkDrei/CoverityMetricsAnalyzer
5c799c8be2e78bbedeb2021476f8d9d41e2caadf
2185e3eab0a0b7e63c92dfe2033ee6b4f59c86d1
refs/heads/master
2020-03-24T07:46:57.209726
2018-10-11T16:16:56
2018-10-11T16:16:56
142,574,678
0
0
null
null
null
null
UTF-8
Java
false
false
1,694
java
package de.rkable.coverity.metrics; import static org.junit.jupiter.api.Assertions.*; import org.junit.jupiter.api.Test; public class DirectoryTest { @Test public void testThatDirectoryWithoutSlashIsInvalid() { assertThrows(IllegalArgumentException.class, () -> new Directory("")); } @Test public void testSimpleHierarchyPrintout() { Directory directory = new Directory("/"); String expected = "directory: /\n"; assertEquals(expected, directory.printHierarchy()); } @Test public void testSimpleHierarchyWithNamePrintout() { Directory directory = new Directory("/root"); String expected = "directory: /root\n"; assertEquals(expected, directory.printHierarchy()); } @Test public void testTwoLevelHierarchy() { Directory root = new Directory("/root"); Directory child = new Directory("/root/child"); root.addChild(child); String expected = "directory: /root\n" + " directory: /root/child\n"; assertEquals(expected, root.printHierarchy()); } @Test public void testHierarchyWithFiles() { Directory root = new Directory("/root"); File file = new File("/root/fileA"); root.addFile(file); Directory child = new Directory("/root/child"); root.addChild(child); String expected = "directory: /root\n" + " file: /root/fileA\n" + " directory: /root/child\n"; assertEquals(expected, root.printHierarchy()); } }
[ "mark@mopedoversum.de" ]
mark@mopedoversum.de
1538107bd9d8c7fbcf4d5c7fd47439400d820037
dfcf12d0015a2bd1e8da5ebfd9add6585aee6414
/flamingo/src/main/java/org/pushingpixels/flamingo/internal/ui/common/CommandButtonLayoutManagerTile.java
253dc128f77ff464cb29c727310062de5ff5df07
[ "BSD-3-Clause" ]
permissive
https-ultronhouse-com/radiance
1176a6222ee3e765af599cb5e00eaefcee95f61f
0f4851821b311de7a92244565685817c46069f74
refs/heads/master
2020-06-25T20:05:09.965232
2019-07-21T14:29:46
2019-07-21T14:29:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
20,249
java
/* * Copyright (c) 2005-2019 Radiance Kirill Grouchnikov. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * o 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. * * o Neither the name of the copyright holder nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.pushingpixels.flamingo.internal.ui.common; import org.pushingpixels.flamingo.api.common.*; import org.pushingpixels.flamingo.api.common.JCommandButton.CommandButtonKind; import org.pushingpixels.flamingo.internal.utils.FlamingoUtilities; import org.pushingpixels.neon.icon.ResizableIcon; import org.pushingpixels.substance.internal.utils.SubstanceMetricsUtilities; import javax.swing.*; import java.awt.*; import java.util.ArrayList; public class CommandButtonLayoutManagerTile implements CommandButtonLayoutManager { @Override public int getPreferredIconSize(AbstractCommandButton commandButton) { return FlamingoUtilities.getScaledSize(32, commandButton.getFont().getSize(), 2.0, 4); } @Override public Dimension getPreferredSize(AbstractCommandButton commandButton) { Insets borderInsets = commandButton.getInsets(); int by = borderInsets.top + borderInsets.bottom; FontMetrics fm = SubstanceMetricsUtilities.getFontMetrics(commandButton.getFont()); String buttonText = commandButton.getText(); int titleWidth = (buttonText == null) ? 0 : fm .stringWidth(commandButton.getText()); String extraText = commandButton.getExtraText(); int extraWidth = (extraText == null) ? 0 : fm.stringWidth(extraText); double textWidth = Math.max(titleWidth, extraWidth); int layoutHGap = FlamingoUtilities.getHLayoutGap(commandButton); boolean hasIcon = (commandButton.getIcon() != null); boolean hasText = (textWidth > 0); boolean hasPopupIcon = FlamingoUtilities.hasPopupAction(commandButton); int prefIconSize = hasIcon ? this.getPreferredIconSize(commandButton) : 0; // start with the left insets int width = borderInsets.left; // icon? if (hasIcon) { // padding before the icon width += layoutHGap; // icon width width += prefIconSize; // padding after the icon width += layoutHGap; } // text? if (hasText) { // padding before the text width += layoutHGap; // text width width += textWidth; // padding after the text width += layoutHGap; } // popup icon? if (hasPopupIcon) { // padding before the popup icon width += 2 * layoutHGap; // text width width += 1 + fm.getHeight() / 2; // padding after the popup icon width += 2 * layoutHGap; } if (commandButton instanceof JCommandButton) { JCommandButton jcb = (JCommandButton) commandButton; CommandButtonKind buttonKind = jcb.getCommandButtonKind(); boolean hasSeparator = false; if (buttonKind == CommandButtonKind.ACTION_AND_POPUP_MAIN_ACTION && (hasIcon || hasText)) { hasSeparator = true; } if (buttonKind == CommandButtonKind.ACTION_AND_POPUP_MAIN_POPUP && hasIcon) { hasSeparator = true; } if (hasSeparator) { // space for a vertical separator width += new JSeparator(JSeparator.VERTICAL).getPreferredSize().width; } } // right insets width += borderInsets.right; // and remove the padding before the first and after the last elements width -= 2 * layoutHGap; return new Dimension(width, by + Math.max(prefIconSize, 2 * (fm.getAscent() + fm.getDescent()))); } @Override public Point getActionKeyTipAnchorCenterPoint(AbstractCommandButton commandButton) { CommandButtonLayoutInfo layoutInfo = this.getLayoutInfo(commandButton); boolean hasIcon = (commandButton.getIcon() != null); int height = commandButton.getHeight(); if (commandButton.getComponentOrientation().isLeftToRight()) { // If the button shows icon, the key tip is at the right edge of the icon // otherwise it is at the right edge of the full action click area int x = hasIcon ? layoutInfo.iconRect.x + layoutInfo.iconRect.width : layoutInfo.actionClickArea.x + layoutInfo.actionClickArea.width; return new Point(x, (height + layoutInfo.actionClickArea.height) / 2); } else { // If the button shows icon, the key tip is at the left edge of the icon // otherwise it is at the left edge of the full action click area int x = hasIcon ? layoutInfo.iconRect.x : layoutInfo.actionClickArea.x; return new Point(x, (height + layoutInfo.actionClickArea.height) / 2); } } @Override public Point getPopupKeyTipAnchorCenterPoint(AbstractCommandButton commandButton) { CommandButtonLayoutInfo layoutInfo = this.getLayoutInfo(commandButton); int height = commandButton.getHeight(); if (commandButton.getComponentOrientation().isLeftToRight()) { return new Point(layoutInfo.popupClickArea.x + layoutInfo.popupClickArea.width, (height + layoutInfo.popupClickArea.height) / 2); } else { return new Point(layoutInfo.popupClickArea.x, (height + layoutInfo.popupClickArea.height) / 2); } } @Override public CommandButtonLayoutInfo getLayoutInfo(AbstractCommandButton commandButton) { CommandButtonLayoutInfo result = new CommandButtonLayoutInfo(); result.actionClickArea = new Rectangle(0, 0, 0, 0); result.popupClickArea = new Rectangle(0, 0, 0, 0); Insets ins = commandButton.getInsets(); result.iconRect = new Rectangle(); result.popupActionRect = new Rectangle(); boolean ltr = commandButton.getComponentOrientation().isLeftToRight(); int width = commandButton.getWidth(); int height = commandButton.getHeight(); int prefWidth = this.getPreferredSize(commandButton).width; int shiftX = 0; if (width > prefWidth) { // We have more horizontal space than needed to display the content. // Consult the horizontal alignment attribute of the command button to see // how we should shift the content horizontally. switch (commandButton.getHorizontalAlignment()) { case SwingConstants.LEADING: if (!ltr) { // shift everything to the right shiftX = width - prefWidth; } break; case SwingConstants.CENTER: // shift everything to be centered horizontally shiftX = (width - prefWidth) / 2; break; case SwingConstants.TRAILING: if (ltr) { // shift everything to the right shiftX = width - prefWidth; } } } ResizableIcon buttonIcon = commandButton.getIcon(); String buttonText = commandButton.getText(); String buttonExtraText = commandButton.getExtraText(); boolean hasIcon = (buttonIcon != null); boolean hasText = (buttonText != null) || (buttonExtraText != null); boolean hasPopupIcon = FlamingoUtilities.hasPopupAction(commandButton); FontMetrics fm = SubstanceMetricsUtilities.getFontMetrics(commandButton.getFont()); int labelHeight = fm.getAscent() + fm.getDescent(); JCommandButton.CommandButtonKind buttonKind = (commandButton instanceof JCommandButton) ? ((JCommandButton) commandButton).getCommandButtonKind() : JCommandButton.CommandButtonKind.ACTION_ONLY; int layoutHGap = FlamingoUtilities.getHLayoutGap(commandButton); if (ltr) { int x = ins.left + shiftX - layoutHGap; // icon if (hasIcon) { x += layoutHGap; int iconHeight = buttonIcon.getIconHeight(); int iconWidth = buttonIcon.getIconWidth(); result.iconRect.x = x; result.iconRect.y = (height - iconHeight) / 2; result.iconRect.width = iconWidth; result.iconRect.height = iconHeight; x += (iconWidth + layoutHGap); } // text if (hasText) { x += layoutHGap; TextLayoutInfo lineLayoutInfo = new TextLayoutInfo(); lineLayoutInfo.text = commandButton.getText(); lineLayoutInfo.textRect = new Rectangle(); lineLayoutInfo.textRect.x = x; lineLayoutInfo.textRect.y = (height - 2 * labelHeight) / 2; lineLayoutInfo.textRect.width = (buttonText == null) ? 0 : fm.stringWidth(buttonText); lineLayoutInfo.textRect.height = labelHeight; result.textLayoutInfoList = new ArrayList<>(); result.textLayoutInfoList.add(lineLayoutInfo); String extraText = commandButton.getExtraText(); TextLayoutInfo extraLineLayoutInfo = new TextLayoutInfo(); extraLineLayoutInfo.text = extraText; extraLineLayoutInfo.textRect = new Rectangle(); extraLineLayoutInfo.textRect.x = x; extraLineLayoutInfo.textRect.y = lineLayoutInfo.textRect.y + labelHeight; extraLineLayoutInfo.textRect.width = (extraText == null) ? 0 : fm.stringWidth(extraText); extraLineLayoutInfo.textRect.height = labelHeight; result.extraTextLayoutInfoList = new ArrayList<>(); result.extraTextLayoutInfoList.add(extraLineLayoutInfo); x += Math.max(lineLayoutInfo.textRect.width, extraLineLayoutInfo.textRect.width); x += layoutHGap; } if (hasPopupIcon) { x += 2 * layoutHGap; result.popupActionRect.x = x; result.popupActionRect.y = (height - labelHeight) / 2 - 1; result.popupActionRect.width = 1 + labelHeight / 2; result.popupActionRect.height = labelHeight + 2; x += result.popupActionRect.width; x += 2 * layoutHGap; } int xBorderBetweenActionAndPopup = 0; int verticalSeparatorWidth = new JSeparator(JSeparator.VERTICAL) .getPreferredSize().width; // compute the action and popup click areas switch (buttonKind) { case ACTION_ONLY: result.actionClickArea.x = 0; result.actionClickArea.y = 0; result.actionClickArea.width = width; result.actionClickArea.height = height; result.isTextInActionArea = true; break; case POPUP_ONLY: result.popupClickArea.x = 0; result.popupClickArea.y = 0; result.popupClickArea.width = width; result.popupClickArea.height = height; result.isTextInActionArea = false; break; case ACTION_AND_POPUP_MAIN_ACTION: // 1. break before popup icon if button has text or icon // 2. no break (all popup) if button has no text and no icon if (hasText || hasIcon) { // shift popup action rectangle to the right to // accomodate the vertical separator result.popupActionRect.x += verticalSeparatorWidth; xBorderBetweenActionAndPopup = result.popupActionRect.x - 2 * layoutHGap; result.actionClickArea.x = 0; result.actionClickArea.y = 0; result.actionClickArea.width = xBorderBetweenActionAndPopup; result.actionClickArea.height = height; result.popupClickArea.x = xBorderBetweenActionAndPopup; result.popupClickArea.y = 0; result.popupClickArea.width = width - xBorderBetweenActionAndPopup; result.popupClickArea.height = height; result.separatorOrientation = CommandButtonSeparatorOrientation.VERTICAL; result.separatorArea = new Rectangle(); result.separatorArea.x = xBorderBetweenActionAndPopup; result.separatorArea.y = 0; result.separatorArea.width = verticalSeparatorWidth; result.separatorArea.height = height; } else { result.popupClickArea.x = 0; result.popupClickArea.y = 0; result.popupClickArea.width = width; result.popupClickArea.height = height; } result.isTextInActionArea = true; break; case ACTION_AND_POPUP_MAIN_POPUP: // 1. break after icon if button has icon // 2. no break (all popup) if button has no icon if (hasIcon) { // shift text rectangles and popup action rectangle to the // right // to accomodate the vertical separator if (result.textLayoutInfoList != null) { for (TextLayoutInfo textLayoutInfo : result.textLayoutInfoList) { textLayoutInfo.textRect.x += verticalSeparatorWidth; } } if (result.extraTextLayoutInfoList != null) { for (TextLayoutInfo extraTextLayoutInfo : result.extraTextLayoutInfoList) { extraTextLayoutInfo.textRect.x += verticalSeparatorWidth; } } result.popupActionRect.x += verticalSeparatorWidth; xBorderBetweenActionAndPopup = result.iconRect.x + result.iconRect.width + layoutHGap; result.actionClickArea.x = 0; result.actionClickArea.y = 0; result.actionClickArea.width = xBorderBetweenActionAndPopup; result.actionClickArea.height = height; result.popupClickArea.x = xBorderBetweenActionAndPopup; result.popupClickArea.y = 0; result.popupClickArea.width = width - xBorderBetweenActionAndPopup; result.popupClickArea.height = height; result.separatorOrientation = CommandButtonSeparatorOrientation.VERTICAL; result.separatorArea = new Rectangle(); result.separatorArea.x = xBorderBetweenActionAndPopup; result.separatorArea.y = 0; result.separatorArea.width = verticalSeparatorWidth; result.separatorArea.height = height; } else { result.popupClickArea.x = 0; result.popupClickArea.y = 0; result.popupClickArea.width = width; result.popupClickArea.height = height; } result.isTextInActionArea = false; break; } } else { int x = width - ins.right - shiftX + layoutHGap; // icon if (hasIcon) { x -= layoutHGap; int iconHeight = buttonIcon.getIconHeight(); int iconWidth = buttonIcon.getIconWidth(); result.iconRect.x = x - iconWidth; result.iconRect.y = (height - iconHeight) / 2; result.iconRect.width = iconWidth; result.iconRect.height = iconHeight; x -= (iconWidth + layoutHGap); } // text if (hasText) { x -= layoutHGap; TextLayoutInfo lineLayoutInfo = new TextLayoutInfo(); lineLayoutInfo.text = commandButton.getText(); lineLayoutInfo.textRect = new Rectangle(); lineLayoutInfo.textRect.width = (buttonText == null) ? 0 : fm.stringWidth(buttonText); lineLayoutInfo.textRect.x = x - lineLayoutInfo.textRect.width; lineLayoutInfo.textRect.y = (height - 2 * labelHeight) / 2; lineLayoutInfo.textRect.height = labelHeight; result.textLayoutInfoList = new ArrayList<>(); result.textLayoutInfoList.add(lineLayoutInfo); String extraText = commandButton.getExtraText(); TextLayoutInfo extraLineLayoutInfo = new TextLayoutInfo(); extraLineLayoutInfo.text = extraText; extraLineLayoutInfo.textRect = new Rectangle(); extraLineLayoutInfo.textRect.width = (extraText == null) ? 0 : fm.stringWidth(buttonText); extraLineLayoutInfo.textRect.x = x - extraLineLayoutInfo.textRect.width; extraLineLayoutInfo.textRect.y = lineLayoutInfo.textRect.y + labelHeight; extraLineLayoutInfo.textRect.height = labelHeight; result.extraTextLayoutInfoList = new ArrayList<TextLayoutInfo>(); result.extraTextLayoutInfoList.add(extraLineLayoutInfo); x -= Math.max(lineLayoutInfo.textRect.width, extraLineLayoutInfo.textRect.width); x -= layoutHGap; } if (hasPopupIcon) { x -= 2 * layoutHGap; result.popupActionRect.width = 1 + labelHeight / 2; result.popupActionRect.x = x - result.popupActionRect.width; result.popupActionRect.y = (height - labelHeight) / 2 - 1; result.popupActionRect.height = labelHeight + 2; x -= result.popupActionRect.width; x -= 2 * layoutHGap; } int xBorderBetweenActionAndPopup = 0; int verticalSeparatorWidth = new JSeparator(JSeparator.VERTICAL) .getPreferredSize().width; // compute the action and popup click areas switch (buttonKind) { case ACTION_ONLY: result.actionClickArea.x = 0; result.actionClickArea.y = 0; result.actionClickArea.width = width; result.actionClickArea.height = height; result.isTextInActionArea = true; break; case POPUP_ONLY: result.popupClickArea.x = 0; result.popupClickArea.y = 0; result.popupClickArea.width = width; result.popupClickArea.height = height; result.isTextInActionArea = false; break; case ACTION_AND_POPUP_MAIN_ACTION: // 1. break before popup icon if button has text or icon // 2. no break (all popup) if button has no text and no icon if (hasText || hasIcon) { // shift popup action rectangle to the left to // accomodate the vertical separator result.popupActionRect.x -= verticalSeparatorWidth; xBorderBetweenActionAndPopup = result.popupActionRect.x + result.popupActionRect.width + 2 * layoutHGap; result.actionClickArea.x = xBorderBetweenActionAndPopup; result.actionClickArea.y = 0; result.actionClickArea.width = width - xBorderBetweenActionAndPopup; result.actionClickArea.height = height; result.popupClickArea.x = 0; result.popupClickArea.y = 0; result.popupClickArea.width = xBorderBetweenActionAndPopup; result.popupClickArea.height = height; result.separatorOrientation = CommandButtonSeparatorOrientation.VERTICAL; result.separatorArea = new Rectangle(); result.separatorArea.x = xBorderBetweenActionAndPopup; result.separatorArea.y = 0; result.separatorArea.width = verticalSeparatorWidth; result.separatorArea.height = height; } else { result.popupClickArea.x = 0; result.popupClickArea.y = 0; result.popupClickArea.width = width; result.popupClickArea.height = height; } result.isTextInActionArea = true; break; case ACTION_AND_POPUP_MAIN_POPUP: // 1. break after icon if button has icon // 2. no break (all popup) if button has no icon if (hasIcon) { // shift text rectangles and popup action rectangle to the // left to accomodate the vertical separator if (result.textLayoutInfoList != null) { for (TextLayoutInfo textLayoutInfo : result.textLayoutInfoList) { textLayoutInfo.textRect.x -= verticalSeparatorWidth; } } if (result.extraTextLayoutInfoList != null) { for (TextLayoutInfo extraTextLayoutInfo : result.extraTextLayoutInfoList) { extraTextLayoutInfo.textRect.x -= verticalSeparatorWidth; } } result.popupActionRect.x -= verticalSeparatorWidth; xBorderBetweenActionAndPopup = result.iconRect.x - layoutHGap; result.actionClickArea.x = xBorderBetweenActionAndPopup; result.actionClickArea.y = 0; result.actionClickArea.width = width - xBorderBetweenActionAndPopup; result.actionClickArea.height = height; result.popupClickArea.x = 0; result.popupClickArea.y = 0; result.popupClickArea.width = xBorderBetweenActionAndPopup; result.popupClickArea.height = height; result.separatorOrientation = CommandButtonSeparatorOrientation.VERTICAL; result.separatorArea = new Rectangle(); result.separatorArea.x = xBorderBetweenActionAndPopup; result.separatorArea.y = 0; result.separatorArea.width = verticalSeparatorWidth; result.separatorArea.height = height; } else { result.popupClickArea.x = 0; result.popupClickArea.y = 0; result.popupClickArea.width = width; result.popupClickArea.height = height; } result.isTextInActionArea = false; break; } } return result; } }
[ "kirill.grouchnikov@gmail.com" ]
kirill.grouchnikov@gmail.com
6e9cb7131fbfefc5c6605c1f80d9d1d5a1523536
85f4410fece930dc2cca6669eb4c7a448ecd024b
/CallKit/src/main/java/io/rong/callkit/MyInputDialog.java
27266f74afeba5ff819907647d614392a0b6e2b8
[]
no_license
runla/24
ef30548ab647454ac390df8fd795dd8c6d786362
94caa23a6087282857ae36c633c534c3c746410f
refs/heads/master
2020-03-14T01:45:13.318168
2018-04-28T07:36:18
2018-04-28T07:36:18
131,384,218
0
0
null
null
null
null
UTF-8
Java
false
false
5,352
java
package io.rong.callkit; import android.app.Activity; import android.content.Context; import android.os.Bundle; import android.support.annotation.Nullable; import android.view.View; import android.view.Window; import android.view.WindowManager; import android.view.inputmethod.InputMethodManager; import android.widget.EditText; import android.widget.TextView; import com.example.fansonlib.widget.dialogfragment.base.BaseDialogFragment; import com.example.fansonlib.widget.dialogfragment.base.Utils; import com.example.fansonlib.widget.dialogfragment.base.ViewHolder; /** * Created by chenjianrun on 2017/10/23. * 描述:简单输入对话框 */ public class MyInputDialog extends BaseDialogFragment { public static final String CONTENT_PARAM = "InputContent"; private String content; private EditText mEditInput; private TextView mTvSend; private TextView mTvPicture; private OnTextSendListener mOnTextSendListener; // 系统软键盘 private InputMethodManager mInputMethodManager; @Override public int intLayoutId() { return R.layout.dialog_input; } /** * 创建对话框实例 * @return */ public static MyInputDialog newInstance(){ MyInputDialog dialog = new MyInputDialog(); return dialog; } @Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setShowBottom(true); setOutCancel(true); if (savedInstanceState!=null){ content = savedInstanceState.getString(CONTENT_PARAM); } } @Override public void convertView(ViewHolder holder, BaseDialogFragment dialog) { mEditInput = holder.getView(R.id.edit_input); mTvSend = holder.getView(R.id.tv_send); mTvPicture = holder.getView(R.id.tv_pic); // 弹出软键盘 mInputMethodManager = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE); // 发送按钮点击事件 mTvSend.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (mOnTextSendListener != null) { mOnTextSendListener.onTextSend(mEditInput.getText().toString().trim(),false); } mEditInput.setText(""); // dismiss(); // mInputMethodManager.hideSoftInputFromWindow(mEditInput.getWindowToken(),InputMethodManager.HIDE_NOT_ALWAYS); } }); mTvSend.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (mOnTextSendListener != null) { mOnTextSendListener.onTextSend(mEditInput.getText().toString().trim(),false); } } }); } @Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putString(CONTENT_PARAM,mEditInput.getText().toString().trim()); } @Override public void onStart() { super.onStart(); Window window = getDialog().getWindow(); if (window != null) { WindowManager.LayoutParams lp = window.getAttributes(); lp.width = Utils.getScreenWidth(getContext()); window.setAttributes(lp); } } @Override public void dismiss() { super.dismiss(); KeyBoardCancle(); // hintKeyboard(); // mInputMethodManager.toggleSoftInput(0,InputMethodManager.HIDE_IMPLICIT_ONLY); // mInputMethodManager.hideSoftInputFromWindow(mEditInput.getWindowToken(),InputMethodManager.HIDE_NOT_ALWAYS); } private void hintKeyboard() { //切换软键盘的显示与隐藏 InputMethodManager imm = (InputMethodManager)getContext().getSystemService(Context.INPUT_METHOD_SERVICE); Activity activity = (Activity) getContext(); imm.toggleSoftInputFromWindow(activity.getCurrentFocus().getWindowToken(), 0, InputMethodManager.HIDE_NOT_ALWAYS); if(imm.isActive()&&activity.getCurrentFocus()!=null){ if (activity.getCurrentFocus().getWindowToken()!=null) { imm.hideSoftInputFromWindow(activity.getCurrentFocus().getWindowToken(), InputMethodManager.RESULT_HIDDEN); } } } // 强制隐藏软键盘 public void KeyBoardCancle() { Activity activity = (Activity) getContext(); View view = activity.getWindow().peekDecorView(); if (view != null) { InputMethodManager inputmanger = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE); inputmanger.hideSoftInputFromWindow(view.getWindowToken(), 0); } } @Override public void onResume() { super.onResume(); } /** * 设置发送内容的结果回调 * @param mOnTextSendListener */ public MyInputDialog setmOnTextSendListener(OnTextSendListener mOnTextSendListener) { this.mOnTextSendListener = mOnTextSendListener; return this; } public interface OnTextSendListener { /** * * @param msg * @param askOpen 提问开关 */ void onTextSend(String msg, boolean askOpen); } }
[ "q578490030@gmail.com" ]
q578490030@gmail.com
251474d87919e925bf58075cb32be0498d0fa86a
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/3/3_fcd3e8f059326743f6ae13579e41f7cbb6799bcc/Plus1BannerView/3_fcd3e8f059326743f6ae13579e41f7cbb6799bcc_Plus1BannerView_t.java
1335c4c1ec15dbb68a0c17dada5a0c2b909c7141
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
5,076
java
/** * Copyright (c) 2011, Alexander Klestov <a.klestov@co.wapstart.ru> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * Neither the name of the "Wapstart" nor the names * of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package ru.wapstart.plus1.sdk; import android.content.Context; import android.content.Intent; import android.graphics.*; import android.util.AttributeSet; import android.view.View; import android.view.animation.Animation; import android.view.animation.TranslateAnimation; import android.widget.ImageView; import android.widget.TextView; import android.widget.LinearLayout; /** * @author Alexander Klestov <a.klestov@co.wapstart.ru> * @copyright Copyright (c) 2011, Wapstart */ public class Plus1BannerView extends LinearLayout { private Plus1Banner banner; private TextView title; private TextView content; private ImageView image; private Animation hideAnimation = null; private Animation showAnimation = null; public Plus1BannerView(Context context) { super(context); init(); } public Plus1BannerView(Context context, AttributeSet attr) { super(context, attr); init(); } public Plus1Banner getBanner() { return banner; } public void setBanner(Plus1Banner banner) { this.banner = banner; if ((banner != null) && (banner.getId() > 0)) { if (getVisibility() == INVISIBLE) { startAnimation(showAnimation); setVisibility(VISIBLE); } title.setText(banner.getTitle()); content.setText(banner.getTitle()); String imageUrl = null; if (!banner.getPictureUrl().equals("")) imageUrl = banner.getPictureUrl(); else if (!banner.getPictureUrlPng().equals("")) imageUrl = banner.getPictureUrlPng(); if (imageUrl != null) new ImageDowloader(this.image).execute(imageUrl); } else if (getVisibility() == VISIBLE) { startAnimation(hideAnimation); setVisibility(INVISIBLE); } } private void init() { setBackgroundResource(R.drawable.wp_banner_background); ImageView shild = new ImageView(getContext()); shild.setImageResource(R.drawable.wp_banner_shild); shild.setMaxWidth(9); addView(shild); LinearLayout ll = new LinearLayout(getContext()); ll.setOrientation(VERTICAL); this.title = new TextView(getContext()); title.setTypeface(Typeface.SANS_SERIF, Typeface.BOLD); title.setTextSize(14f); title.setTextColor(Color.WHITE); ll.addView(title); this.content = new TextView(getContext()); content.setTypeface(Typeface.SANS_SERIF); content.setTextSize(13f); content.setTextColor(Color.WHITE); ll.addView(content); this.image = new ImageView(getContext()); ll.addView(image); addView(ll); setOnClickListener( new OnClickListener() { public void onClick(View view) { if ( (banner == null) || (banner.getLink() == null) ) return; // TODO: click2call getContext().startActivity( new Intent( Intent.ACTION_VIEW, android.net.Uri.parse(banner.getLink()) ) ); } } ); this.showAnimation = new TranslateAnimation( Animation.RELATIVE_TO_SELF, 0f, Animation.RELATIVE_TO_SELF, 0f, Animation.RELATIVE_TO_SELF, -1f, Animation.RELATIVE_TO_SELF, 0f ); showAnimation.setDuration(500); this.hideAnimation = new TranslateAnimation( Animation.RELATIVE_TO_SELF, 0f, Animation.RELATIVE_TO_SELF, 0f, Animation.RELATIVE_TO_SELF, 0f, Animation.RELATIVE_TO_SELF, -1f ); hideAnimation.setDuration(500); setVisibility(INVISIBLE); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
9da0548df0297a1373dbbf578975e18084cdd7ef
238b826c6b620d7c5bba9c2b967debda5b40bfbf
/jnf-parent/jnf-bean/src/main/java/com/jsjn/jnf/bean/bo/integration/yfb/.svn/text-base/RefundOrderReqBo.java.svn-base
49f7a6cfa159160ea50c833c36a33d77e3291e5e
[]
no_license
rankyangel2014/Spring
6972acd9dd806a8d6b98d110603dca389083f64d
ecef7e8c6b0b38bad430946d09bbfc699f2de815
refs/heads/master
2021-01-22T04:24:21.988756
2017-09-22T09:28:01
2017-09-22T09:28:01
92,461,626
0
1
null
null
null
null
UTF-8
Java
false
false
4,032
package com.jsjn.jnf.bean.bo.integration.yfb; import java.io.Serializable; /** * * @author nicolaslonely * */ public class RefundOrderReqBo implements Serializable{ /** * */ private static final long serialVersionUID = 1L; /** * 系统接入方 */ private String merchantNo; /** * 公钥索引 */ private String publicKeyIndex; /** * 接口版本号 */ private String version; /** * 签名 */ private String signature; /** * 签名算法 */ private String signAlgorithm; /** * 编码类型 */ private String inputCharset; /** * 提交时间 yyyyMMddHHmmss */ private String submitTime; /** * 服务器异步通知 URL */ private String notifyUrl; /** * 退款单号 */ private String refundOrderNo; /** * 原商户唯一订单 号 */ private String origOutOrderNo; /** * 原订单创建时间 */ private String origOrderTime; /** * 退款订单创建时间 */ private String refundOrderTime; /** * 退款金额 */ private String refundAmount; /** * 操作人 */ private String operator; /** * 退款理由 */ private String refundReason; /** * 备注 */ private String remark; /** * 扩展信息 */ private String tunnelData; public String getMerchantNo() { return merchantNo; } public void setMerchantNo(String merchantNo) { this.merchantNo = merchantNo; } public String getPublicKeyIndex() { return publicKeyIndex; } public void setPublicKeyIndex(String publicKeyIndex) { this.publicKeyIndex = publicKeyIndex; } public String getVersion() { return version; } public void setVersion(String version) { this.version = version; } public String getSignature() { return signature; } public void setSignature(String signature) { this.signature = signature; } public String getSignAlgorithm() { return signAlgorithm; } public void setSignAlgorithm(String signAlgorithm) { this.signAlgorithm = signAlgorithm; } public String getInputCharset() { return inputCharset; } public void setInputCharset(String inputCharset) { this.inputCharset = inputCharset; } public String getSubmitTime() { return submitTime; } public void setSubmitTime(String submitTime) { this.submitTime = submitTime; } public String getNotifyUrl() { return notifyUrl; } public void setNotifyUrl(String notifyUrl) { this.notifyUrl = notifyUrl; } public String getRefundOrderNo() { return refundOrderNo; } public void setRefundOrderNo(String refundOrderNo) { this.refundOrderNo = refundOrderNo; } public String getOrigOutOrderNo() { return origOutOrderNo; } public void setOrigOutOrderNo(String origOutOrderNo) { this.origOutOrderNo = origOutOrderNo; } public String getOrigOrderTime() { return origOrderTime; } public void setOrigOrderTime(String origOrderTime) { this.origOrderTime = origOrderTime; } public String getRefundOrderTime() { return refundOrderTime; } public void setRefundOrderTime(String refundOrderTime) { this.refundOrderTime = refundOrderTime; } public String getRefundAmount() { return refundAmount; } public void setRefundAmount(String refundAmount) { this.refundAmount = refundAmount; } public String getOperator() { return operator; } public void setOperator(String operator) { this.operator = operator; } public String getRefundReason() { return refundReason; } public void setRefundReason(String refundReason) { this.refundReason = refundReason; } public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } public String getTunnelData() { return tunnelData; } public void setTunnelData(String tunnelData) { this.tunnelData = tunnelData; } }
[ "xie_kx@xie-kx.centit.com" ]
xie_kx@xie-kx.centit.com
acdb2abb83a5ebfc8b15f9f7a27d5a589ca3d044
674b570ccd852f88e3f3ef946072cf3a9ca7229f
/app/src/main/java/br/unifor/pin/ssa/activity/SolicitacaoDetailActivity.java
c22395b8ff4e093909668cc8c74a4ce007ea961d
[]
no_license
danjorge/AgendamentoUniforAndroid
2f985057fe9111830145ff6e1b5f9d2d98a3657e
8d992140edc70dc2e69afadb7ceee6e0badc22b6
refs/heads/master
2021-01-15T09:42:01.401960
2016-06-03T18:59:30
2016-06-03T18:59:30
48,251,973
0
0
null
null
null
null
UTF-8
Java
false
false
3,992
java
package br.unifor.pin.ssa.activity; import android.content.Context; import android.os.Bundle; import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.inputmethod.InputMethodManager; import android.widget.TextView; import br.unifor.pin.ssa.R; import br.unifor.pin.ssa.entity.Solicitacao; /** * Classe de iniciacao da Activity de detalhe da solicitacao * Created by Daniel Jorge on 08/04/2016. */ public class SolicitacaoDetailActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_solicitacao_detail); final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setDisplayHomeAsUpEnabled(true); } setTitle(""); /** * Recupera o objeto passado de outra activity/fragment para setar nas labels que compoem a activity */ Solicitacao solicitacao = (Solicitacao) getIntent().getSerializableExtra("Solicitacao"); TextView txtIdSolicitacao = (TextView) findViewById(R.id.txt_id_solicitacao); TextView txtStatusSolicitacao = (TextView) findViewById(R.id.txt_status_solicitacao_detail); TextView txtSolicitante = (TextView) findViewById(R.id.txt_solicitante_detail); TextView txtAssuntoSolicitacao = (TextView) findViewById(R.id.txt_assunto_solicitacao_detail); TextView txtDscSolicitacao = (TextView) findViewById(R.id.txt_dsc_solicitacao_detail); TextView labelRespostaSolicitacao = (TextView) findViewById(R.id.label_resposta_solicitacao_detail); TextView txtRespostaSolicitacao = (TextView ) findViewById(R.id.txt_resposta_solicitacao_detail); if (txtIdSolicitacao != null) { txtIdSolicitacao.setText(solicitacao.getId().toString()); } if (txtStatusSolicitacao != null) { txtStatusSolicitacao.setText(solicitacao.getStatusSolicitacao().getDescricao().toUpperCase()); } if (txtSolicitante != null) { txtSolicitante.setText(solicitacao.getUsuario().getNome()); } if (txtAssuntoSolicitacao != null) { txtAssuntoSolicitacao.setText(solicitacao.getAssunto().toUpperCase()); } if (txtDscSolicitacao != null) { txtDscSolicitacao.setText(solicitacao.getDescricao().toUpperCase()); } if (labelRespostaSolicitacao != null) { labelRespostaSolicitacao.setVisibility(solicitacao.getRespostaSolicitacao() != null ? View.VISIBLE : View.GONE); } if (txtRespostaSolicitacao != null) { txtRespostaSolicitacao.setVisibility(solicitacao.getRespostaSolicitacao() != null ? View.VISIBLE : View.GONE); txtRespostaSolicitacao.setText(txtRespostaSolicitacao.getVisibility() == View.VISIBLE ? solicitacao.getRespostaSolicitacao().toUpperCase() : ""); } } public void hideSoftKeyboard() { if(getCurrentFocus()!=null) { InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); inputMethodManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0); } } @Override public void onBackPressed() { super.onBackPressed(); hideSoftKeyboard(); overridePendingTransition(R.anim.right_out, R.anim.left_in); } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()){ case android.R.id.home: onBackPressed(); return false; } return super.onOptionsItemSelected(item); } }
[ "danjorge@gmail.com" ]
danjorge@gmail.com
80fff90a7abc11937ace928dd2663ede0114a2f1
f689208b82a9a8262d97a73e3e87ee9069b1c171
/SimonJiayan/src/SimonJiayan/MoveInterfaceJiayan.java
5f0bb77481afd17251ba1de535b4a096acc39f6c
[]
no_license
summ99/SimonJiayan6
cebac2c4b8ede3b45a524baf5d7e9e3c077f1836
c8bf02f1af2e7b112c027c8727df4a7699584ce7
refs/heads/master
2021-01-11T23:11:30.578164
2017-01-11T17:34:12
2017-01-11T17:34:12
78,555,919
0
0
null
null
null
null
UTF-8
Java
false
false
108
java
package SimonJiayan; public interface MoveInterfaceJiayan { ButtonInterfaceJiayan getButton(); }
[ "Student 6@10.8.33.178" ]
Student 6@10.8.33.178
c491bcfdb0c27440100b42a7cdb9d705e2085c5b
b23404e272db01f2bf46320565c11b9e02cf0c61
/new/pps/src/main/java/ice/cn/joy/ggg/api/model/CollectHolder.java
ab036f8c44759142c0cd6abbf0342df8974c7908
[]
no_license
brucesq/brucedamon001
95ab98798f1c29d722a397681956c24ff4091385
92ab181f90005afffb354d10768921545912119c
refs/heads/master
2021-05-29T09:35:05.115101
2011-12-20T05:42:28
2011-12-20T05:42:28
32,131,555
0
1
null
null
null
null
UTF-8
Java
false
false
749
java
// ********************************************************************** // // Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. // // ********************************************************************** // Ice version 3.4.0 package cn.joy.ggg.api.model; // <auto-generated> // // Generated from file `community.ice' // // Warning: do not edit this file. // // </auto-generated> public final class CollectHolder { public CollectHolder() { } public CollectHolder(Collect value) { this.value = value; } public Collect value; }
[ "quanzhi@8cf3193c-f4eb-11de-8355-bf90974c4141" ]
quanzhi@8cf3193c-f4eb-11de-8355-bf90974c4141
fcc48101bfd6d284441564ca9ebbd57008cd71f4
da1e71dfeb40ed3ab83b45f1c9039e5d53740beb
/MLSListingApp.java
a68bdf67303c6ecdcfafb39d0cf07217c5489e4f
[]
no_license
bhenriquez8/MLSListing
25437dcc3b226a065e81f90bc673761abf3b2a11
807c78b7ee50e7246ff222f9565020890f5a831f
refs/heads/master
2020-06-29T13:35:51.549721
2019-08-04T23:37:42
2019-08-04T23:37:42
200,552,096
0
0
null
null
null
null
UTF-8
Java
false
false
796
java
import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.awt.BorderLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.nio.*; import java.nio.file.*; import java.nio.file.AccessMode.*; import java.io.*; public class MLSListingApp { public static void main(String[] args) { PropertyList listOfProperties = new PropertyList(); listOfProperties.initialize(); EventQueue.invokeLater(new Runnable() { public void run() { MLSListingView mlsView = new MLSListingView(); mlsView.setProperties(listOfProperties); mlsView.setVisible(true); mlsView.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } }); } }
[ "bhenri88@gmail.com" ]
bhenri88@gmail.com
959bbbe55cd0be76f8c080ea876c58676f188ca6
db33c79c573d537fe2af991913c313d14ec8a815
/src/main/java/com/dataworker/udf/text/mark/GenericUDFMaskShowFirstN.java
e10dfadbfba6c7d6f9a197fe4584b809c5d68088
[]
no_license
zhanglei/dataworker-udf
b8c822f86c11994e2183a2fd7a3f20e73024b792
fc26a68f1bff06432ab9f8241422a01c3b372815
refs/heads/master
2023-07-09T14:54:48.983840
2021-08-12T09:02:39
2021-08-12T09:02:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,426
java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.dataworker.udf.text.mark; import org.apache.hadoop.hive.ql.exec.Description; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; @Description(name = "mask_show_first_n", value = "masks all but first n characters of the value", extended = "Examples:\n " + " mask_show_first_n(ccn, 8)\n " + " mask_show_first_n(ccn, 8, 'x', 'x', 'x')\n " + "Arguments:\n " + " mask_show_first_n(value, charCount, upperChar, lowerChar, digitChar, otherChar, numberChar)\n " + " value - value to mask. Supported types: TINYINT, SMALLINT, INT, BIGINT, STRING, VARCHAR, CHAR\n " + " charCount - number of characters. Default value: 4\n " + " upperChar - character to replace upper-case characters with. Specify -1 to retain original character. Default value: 'X'\n " + " lowerChar - character to replace lower-case characters with. Specify -1 to retain original character. Default value: 'x'\n " + " digitChar - character to replace digit characters with. Specify -1 to retain original character. Default value: 'n'\n " + " otherChar - character to replace all other characters with. Specify -1 to retain original character. Default value: -1\n " + " numberChar - character to replace digits in a number with. Valid values: 0-9. Default value: '1'\n " ) public class GenericUDFMaskShowFirstN extends BaseMaskUDF { public static final String UDF_NAME = "mask_show_first_n"; public GenericUDFMaskShowFirstN() { super(new MaskShowFirstNTransformer(), UDF_NAME); } } class MaskShowFirstNTransformer extends MaskTransformer { int charCount = 4; public MaskShowFirstNTransformer() { super(); } @Override public void init(ObjectInspector[] arguments, int argsStartIdx) { super.init(arguments, argsStartIdx + 1); // first argument is charCount, which is consumed here charCount = getIntArg(arguments, argsStartIdx, 4); if(charCount < 0) { charCount = 0; } } @Override String transform(final String value) { if(value.length() <= charCount) { return value; } final StringBuilder ret = new StringBuilder(value.length()); for(int i = 0; i < charCount; i++) { ret.appendCodePoint(value.charAt(i)); } for(int i = charCount; i < value.length(); i++) { ret.appendCodePoint(transformChar(value.charAt(i))); } return ret.toString(); } @Override Byte transform(final Byte value) { byte val = value; if(value < 0) { val *= -1; } // count number of digits in the value int digitCount = 0; for(byte v = val; v != 0; v /= 10) { digitCount++; } // number of digits to mask from the end final int maskCount = digitCount - charCount; if(maskCount <= 0) { return value; } byte ret = 0; int pos = 1; for(int i = 0; val != 0; i++) { if(i < maskCount) { // mask this digit ret += (maskedNumber * pos); } else { //retain this digit ret += ((val % 10) * pos); } val /= 10; pos *= 10; } if(value < 0) { ret *= -1; } return ret; } @Override Short transform(final Short value) { short val = value; if(value < 0) { val *= -1; } // count number of digits in the value int digitCount = 0; for(short v = val; v != 0; v /= 10) { digitCount++; } // number of digits to mask from the end final int maskCount = digitCount - charCount; if(maskCount <= 0) { return value; } short ret = 0; int pos = 1; for(int i = 0; val != 0; i++) { if(i < maskCount) { // mask this digit ret += (maskedNumber * pos); } else { // retain this digit ret += ((val % 10) * pos); } val /= 10; pos *= 10; } if(value < 0) { ret *= -1; } return ret; } @Override Integer transform(final Integer value) { int val = value; if(value < 0) { val *= -1; } // count number of digits in the value int digitCount = 0; for(int v = val; v != 0; v /= 10) { digitCount++; } // number of digits to mask from the end final int maskCount = digitCount - charCount; if(maskCount <= 0) { return value; } int ret = 0; int pos = 1; for(int i = 0; val != 0; i++) { if(i < maskCount) { // mask this digit ret += maskedNumber * pos; } else { // retain this digit ret += ((val % 10) * pos); } val /= 10; pos *= 10; } if(value < 0) { ret *= -1; } return ret; } @Override Long transform(final Long value) { long val = value; if(value < 0) { val *= -1; } // count number of digits in the value int digitCount = 0; for(long v = val; v != 0; v /= 10) { digitCount++; } // number of digits to mask from the end final int maskCount = digitCount - charCount; if(maskCount <= 0) { return value; } long ret = 0; long pos = 1; for(int i = 0; val != 0; i++) { if(i < maskCount) { // mask this digit ret += (maskedNumber * pos); } else { // retain this digit ret += ((val % 10) * pos); } val /= 10; pos *= 10; } if(value < 0) { ret *= -1; } return ret; } }
[ "binsong.li@tongdun.cn" ]
binsong.li@tongdun.cn
362358c10b3f3cde5cdf9d2197ce67bd82fb1487
0ca5ec38507c92317e7dc844a3f13015999497f1
/app/babybox/events/map/TouchEvent.java
7f347b414f12e186da2d755e701432cda73afac6
[]
no_license
mybabybox/BB-Server2
525201b00af2f70326a078b3a28c64de7f510b37
5e2822ac59d08f8f01c7ece07adacfb1d24207ad
refs/heads/master
2021-01-10T06:54:29.902876
2016-04-18T03:15:34
2016-04-18T03:15:34
45,766,176
1
1
null
null
null
null
UTF-8
Java
false
false
117
java
package babybox.events.map; import java.util.HashMap; public class TouchEvent extends HashMap<String, Object> { }
[ "keithlei01@gmail.com" ]
keithlei01@gmail.com
72ad246fcff2741fcd5a3eaf6e49db2d31ef4632
dd6e8bae4a5b66d527e01d221674039143665ce9
/文件/src/scanner.java
9a4ff0e08322b5a20fb2da7addf339d33c08a815
[]
no_license
Consini/JavaSE
51ee5c9c45db10702ad84587e6e68667bec45412
b457df85fe408d2bcba7f78b2e421b964ad44e7a
refs/heads/master
2021-07-09T09:39:21.502806
2020-08-21T04:00:51
2020-08-21T04:00:51
183,192,975
0
0
null
null
null
null
UTF-8
Java
false
false
753
java
import java.io.File; import java.io.PrintStream; /** * @Description TODO * @Author K * @Date 2019/12/1 11:26 **/ public class scanner { public static void scannerDirectory(TreeNode node){ File[] files = node.file.listFiles(); if(files == null){ return; } for(File file : files){ TreeNode child = new TreeNode(); child.file = file; if(file.isDirectory()){ scannerDirectory(child); }else{ child.totalLength = file.length(); } node.totalLength += child.totalLength; node.children.add(child); } } public static void main(String[] args) { PrintStream out; } }
[ "2459971164@qq.com" ]
2459971164@qq.com
a0e2ce16c6888b87df6a5a66f5030a2e14049b8c
28ae90f474f0e4c82b4c4e46e9469a51fb93cd9f
/app/src/main/java/com/jekz/stepitup/data/request/LoginRequest.java
9430184a70513f19cb6f2548728667314e327e7d
[]
no_license
ZAhmed95/Jekz_Step_It_Up
dcc123e5b36c8cbbf8555a0dc9af4a16d90cfb33
599412ac3c240235bf87f167ff5d1d77d32560b6
refs/heads/master
2020-04-02T03:23:25.889482
2018-01-11T00:05:03
2018-01-11T00:05:03
153,962,650
1
0
null
2018-10-21T01:19:09
2018-10-21T01:19:09
null
UTF-8
Java
false
false
5,399
java
package com.jekz.stepitup.data.request; import android.os.AsyncTask; import android.util.Log; import org.json.JSONException; import org.json.JSONObject; import java.io.BufferedInputStream; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.net.HttpURLConnection; import java.net.URL; import java.security.cert.Certificate; import javax.net.ssl.HttpsURLConnection; /** * Created by evanalmonte on 12/12/17. */ public class LoginRequest extends AsyncTask<String, Integer, String> { private static final String TAG = LoginRequest.class.getName(); private String cookie; private String username; private String password; private LoginRequest.LoginRequestCallback callback; public LoginRequest(String username, String password, String cookie, LoginRequestCallback callback) { this.username = username; this.password = password; this.cookie = cookie; this.callback = callback; } @Override protected String doInBackground(String... params) { try { URL url = new URL(params[0]); if (RequestString.isLocal()) { HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection(); urlConnection.setDoOutput(true); urlConnection.setDoInput(true); urlConnection.setRequestMethod("POST"); urlConnection.setRequestProperty("Content-Type", "application/json; charset=UTF-8"); urlConnection.setRequestProperty("Cookie", cookie); //printHttpsCert(urlConnection); OutputStreamWriter out = new OutputStreamWriter(urlConnection.getOutputStream()); JSONObject data = new JSONObject(); data.put("username", username); data.put("password", password); out.write(data.toString()); out.flush(); out.close(); StringBuilder builder = new StringBuilder(); InputStream is; is = new BufferedInputStream(urlConnection.getInputStream()); BufferedReader br = new BufferedReader(new InputStreamReader(is)); String inputLine; while ((inputLine = br.readLine()) != null) { builder.append(inputLine).append("\n"); } return builder.toString(); } else { HttpsURLConnection urlConnection = (HttpsURLConnection) url.openConnection(); urlConnection.setDoOutput(true); urlConnection.setDoInput(true); urlConnection.setRequestMethod("POST"); urlConnection.setRequestProperty("Content-Type", "application/json; charset=UTF-8"); urlConnection.setRequestProperty("Cookie", cookie); //printHttpsCert(urlConnection); OutputStreamWriter out = new OutputStreamWriter(urlConnection.getOutputStream()); JSONObject data = new JSONObject(); data.put("username", username); data.put("password", password); out.write(data.toString()); out.flush(); out.close(); StringBuilder builder = new StringBuilder(); InputStream is; is = new BufferedInputStream(urlConnection.getInputStream()); BufferedReader br = new BufferedReader(new InputStreamReader(is)); String inputLine; while ((inputLine = br.readLine()) != null) { builder.append(inputLine).append("\n"); } return builder.toString(); } } catch (IOException | JSONException e) { e.printStackTrace(); } return "ERROR"; } @Override protected void onPostExecute(String result) { Log.d(TAG, result); if (result.contains(username.toLowerCase() + "'s Home Page")) { callback.onProcessLogin(cookie, username); } else if (result.contains("ERROR")) { callback.networkError(); } else { callback.invalidCredentials(); } } private void printHttpsCert(HttpsURLConnection con) { if (con != null) try { Log.d(TAG, "Response Code : " + con.getResponseCode()); Log.d(TAG, "Cipher Suite : " + con.getCipherSuite()); Log.d(TAG, "\n"); Certificate[] certs = con.getServerCertificates(); for (Certificate cert : certs) { Log.d(TAG, "Cert Type : " + cert.getType()); Log.d(TAG, "Cert Hash Code : " + cert.hashCode()); Log.d(TAG, "Cert Public Key Algorithm : " + cert.getPublicKey().getAlgorithm()); Log.d(TAG, "Cert Public Key Format : " + cert.getPublicKey().getFormat()); Log.d(TAG, "\n"); } } catch (IOException e) { e.printStackTrace(); } } public interface LoginRequestCallback { void onProcessLogin(String cookie, String username); void invalidCredentials(); void networkError(); } }
[ "ealmonte102@qc.cuny.edu" ]
ealmonte102@qc.cuny.edu
6ac949339520f7a6a1a1238c40db0270be2ff9ce
ae821b3c478428339a919678ce6ba683c387308d
/src/builderpattern/Pepsi.java
e6f2b4e0db53f2500ebd134413b44f1a99ed8583
[]
no_license
Jiazhiwei/DesignMode
61360c9e564d49aa0e697feda1f4a4e64769e63a
d5e50a747cf95ad8fa67361ffecc677040430045
refs/heads/master
2023-01-19T13:51:10.777097
2020-11-19T15:21:08
2020-11-19T15:21:08
306,205,752
0
0
null
null
null
null
UTF-8
Java
false
false
278
java
package builderpattern; /** * * @author jzw * @date 2020-11-18 23:13 * @since cloud2.0 */ public class Pepsi extends ColdDrink { @Override public float price() { return 35.0f; } @Override public String name() { return "Pepsi"; } }
[ "1207985219@qq.com" ]
1207985219@qq.com
33e0c8fc4a6219767fce34093da1649ff0370750
f87cc002778fb8f42c4c60c2329de4dabb9a034f
/Chapter14/src/Exercises/Ex_14_22.java
827e3e3fa35604ccca62c440cb29b7eec1e82e49
[]
no_license
ademerdzhiev/JavaBookExercises
3873aad352ff209678005c3eb16e10d114a3fa6c
ec2e5e8d195ad17f46daa8662e7311e17e19af65
refs/heads/master
2020-05-31T13:58:10.441969
2019-07-03T15:27:48
2019-07-03T15:27:48
190,317,680
0
0
null
null
null
null
UTF-8
Java
false
false
2,348
java
package Exercises; import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.layout.Pane; import javafx.scene.paint.Color; import javafx.scene.shape.Circle; import javafx.scene.shape.Line; import javafx.scene.text.Text; import javafx.stage.Stage; public class Ex_14_22 extends Application { @Override public void start(Stage stage) throws Exception { Pane pane = new Pane(); Scene scene = new Scene(pane,450, 450); double paneWidth = scene.getWidth() - 15; double paneHeight = scene.getHeight() - 15; double centerX1 = Math.random()*paneWidth; double centerY1 = Math.random()*paneHeight; double centerX2 = Math.random()*paneWidth; double centerY2 = Math.random()*paneHeight; conncectCircles(centerX1, centerY1, centerX2, centerY2, pane); stage.setScene(scene); stage.setTitle("CONNECT MY CIRCLES"); stage.show(); } public static void main(String[] args) { launch(); } private static void conncectCircles(double centerX1, double centerY1, double centerX2, double centerY2, Pane pane) { double radius = 15; Circle circle1 = new Circle(centerX1, centerY1, radius); circle1.setFill(Color.WHITE); circle1.setStroke(Color.BLACK); Circle circle2 = new Circle(centerX2, centerY2, radius); circle2.setFill(Color.WHITE); circle2.setStroke(Color.BLACK); double slope = (centerY1 - centerY2)/(centerX1 - centerX2); double arctan = Math.atan(slope); double startX = centerX1 + Math.cos(arctan)*radius; double startY = centerY1 + Math.sin(arctan)*radius; double endX = centerX2 - Math.cos(arctan)*radius; double endY = centerY2 - Math.sin(arctan)*radius; if (centerX1 > centerX2) { startX = centerX1 - Math.cos(arctan)*radius; startY = centerY1 - Math.sin(arctan)*radius; endX = centerX2 + Math.cos(arctan)*radius; endY = centerY2 + Math.sin(arctan)*radius; } Text text1 = new Text(centerX1, centerY1, "1"); Text text2 = new Text(centerX2, centerY2, "2"); Line line = new Line(startX, startY, endX, endY); pane.getChildren().addAll(circle1, circle2, line, text1, text2); } }
[ "a.demerdzhiev@gmail.com" ]
a.demerdzhiev@gmail.com
7a0f45821399232adb3a41f706b5e2bdf9468747
5eafb2576c8eadcdc5694561d22ccae05c83c384
/java/tips/src/com/company/数组.java
79bbd88114111418e1a197b6ffcf705dd3bde447
[]
no_license
lijianmin01/2019SummerHolidays
20accf1c4448709673ac2f14a57319d9673e750e
c8279f2e917fded6fdafc5b88ad43480815319ec
refs/heads/master
2020-06-16T17:52:10.756076
2019-09-05T00:08:20
2019-09-05T00:08:20
195,656,230
1
1
null
null
null
null
UTF-8
Java
false
false
3,289
java
package com.company; import java.util.Scanner; public class 数组 { public static void main(String[] args) { //投票统计 /*写一个程序,输入数量不确定的[0,9]范围内的整数,统计每一种 数字出现的次数,输入-1表示结束 * */ // int x; // Scanner in =new Scanner(System.in); // int[] nums=new int[10]; // x=in.nextInt(); // for(int j=0;j<nums.length;j++) // { // System.out.println(nums[j]); // } // while(x!=-1) // { // if(x>=0&&x<10) // { // nums[x]++; // } // x=in.nextInt(); // } // //System.out.println(nums.length); // for(int i=0;i<nums.length;i++) // { // System.out.println(i+":"+nums[i]); // } //直接初始化数组 /*new 创建数组会得到默认的0值 * int[] scores={87,98,67,54,65,76,87,99}; * 直接用大括号给出数组的所有元素的初始值 * 不需要给出数组大小,编译器替你数数~length * */ // int[] scores={87,98,67,54,65,76,87,99}; // System.out.println(scores.length); // for(int i=0;i<scores.length;i++) // { // System.out.print(scores[i]+" "); // } //数组名只是管理者,Java可以有多个管理者 //数组名比较是否共同管理同一个数组 //仅判断一个数是否在数组中 // boolean found=false; // int[] nums={1,11,111,1111,11111,111111}; // Scanner in=new Scanner(System.in); // int x=in.nextInt(); // while(x!=-1) // { // for(int k:nums) // { // if(k==x) // { // found=true; // break; // } // } // if(found==true) // { // System.out.println(x+"存在数组中"); // }else{ // System.out.println(x+"不存在存在数组中"); // } // found=false; // x=in.nextInt(); // } //判断一个数是否是素数~无需到x-1,到sqrt(x)就够了 // boolean isPrime=true; //// Scanner in=new Scanner(System.in); //// int x=in.nextInt(); //// for(int i=3;i<Math.sqrt(x);i+=2) //// { //// if(x%i==0) //// { //// isPrime=false; //// brea; //// } //// } //二维数组 /* * int[] a=new int[3][5]; * 通常理解为a为一个3行5列的矩阵 * 二维数组的初始化 * int[][] a={{1,2,3,4},{1,2,3},}; * *编译器来数数 * *每行一个{},逗号分隔 * *最后的逗号可以存在,有古老的传统 * *如果省略,表示补零 * */ } } /*定义数组变量 <类型>[] <名字>=new <类型>[元素个数] int[] grades=new int[100]; double[] averages=new double[20]; *元素个数必须是整数 *元素个数必须给出 *元素个数可以是变量 length 每个数组有一个内部成员length,会告诉你它的元素数量——名字.length * */
[ "1796887546@qq.com" ]
1796887546@qq.com
6f0e5881379b4c657b4c2966c51b7cbd8e66f00a
2c92c73da2a0d899ba4ee894ae0abe8cd5d07909
/src/com/fiveinarow/Main.java
2ee30d774b4194ffb9d339df1e1e8cf9e15c1b5d
[]
no_license
TurcsanyAdam/FiveInaRow
5b0985312430fe1263c6a42854fc734ed49b0ab9
9f7b004d8988b833c7fa21e295b9322ec4546c34
refs/heads/master
2022-11-13T02:53:16.901413
2020-06-23T09:30:29
2020-06-23T09:30:29
274,364,874
0
0
null
null
null
null
UTF-8
Java
false
false
124
java
package com.fiveinarow; public class Main { public static void main(String[] args) { Game game = new Game(); } }
[ "turcsanyadam@gmail.com" ]
turcsanyadam@gmail.com
1528d732bc1bfc124f861b720dc7681fed535807
36e2316e4f39a48cab5def7aa4bf53551fabcd79
/设计模式/src/com/dp/composite/example2/Client.java
8957e4afed4b4d802e896d7df95abdf69c7ff18b
[]
no_license
PlumpMath/DesignPattern-327
b47f935638541367214812a5d1cafe45af5d543e
aee4c13e94d04279792c5c34dd58ce068f2e9a8d
refs/heads/master
2021-01-20T09:36:48.199768
2015-09-25T00:57:52
2015-09-25T00:57:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
739
java
package com.dp.composite.example2; /** * @desc 请用一句话描述此文件 * @creator caozhiqing * @data 2015/8/12 */ public class Client { public static void main(String[] arg){ Component root = new Composite("服装"); Component man = new Composite("男装"); Component wom = new Composite("女装"); root.addChild(man); root.addChild(wom); Component leaf1 = new Leaf("夹克"); Component leaf2 = new Leaf("寸衫"); man.addChild(leaf1); man.addChild(leaf2); Component leaf3 = new Leaf("短裙"); Component leaf4 = new Leaf("Browse"); wom.addChild(leaf3); wom.addChild(leaf4); root.operation(""); } }
[ "1148392049@qq.com" ]
1148392049@qq.com
4914cba0c5fd8521c72fc93f99a4f7bf2aa60e4b
3c7eb828084af8e6bf708f8f60308cde1de2b62a
/SMART_FARM (WT MINI PRO)/source_code/swe/entry.java
b1cc35c75a7279df2c869e1edc09a5eb82072315
[]
no_license
swethasureshs/smart_farm_project
5719a9e7ab12e4135fce0656b565acda21d0cafa
826a7b7cf3efb66b749fede57b7779f38fcc325a
refs/heads/master
2022-07-01T11:41:50.414032
2020-04-29T16:13:03
2020-04-29T16:13:03
259,969,902
0
0
null
null
null
null
UTF-8
Java
false
false
2,156
java
package swe; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.EventQueue; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.border.EmptyBorder; import javax.swing.JButton; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import javax.swing.JLabel; import java.awt.Font; public class entry extends JFrame { private JPanel contentPane; public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { try { entry frame = new entry(); } catch (Exception e) { e.printStackTrace(); } } }); } public entry() { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setPreferredSize(new Dimension(1300, 650)); pack(); setLocationRelativeTo(null); setTitle("SMART FARM"); setVisible(true); //setBounds(100, 100, 450, 300); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(null); contentPane.setBackground(Color.BLACK); JButton b1 = new JButton("LOGIN"); b1.setFont(new Font("Tahoma", Font.PLAIN, 18)); b1.setBounds(532,255,148,44); b1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if(e.getSource()==b1) { try { login l= new login(); l.setVisible(true); } catch(Exception en) {} } } }); contentPane.add(b1); JButton b2 = new JButton("SIGNUP"); b2.setFont(new Font("Tahoma", Font.PLAIN, 18)); b2.setBounds(532, 336, 148, 44); b2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e1) { if(e1.getSource()==b2) { try { signup s= new signup(); s.setVisible(true); } catch(Exception emn) {} } } }); contentPane.add(b2); JLabel lblNewLabel = new JLabel("SMART FARM"); lblNewLabel.setFont(new Font("Tahoma", Font.BOLD | Font.ITALIC, 27)); lblNewLabel.setForeground(new Color(255, 255, 255)); lblNewLabel.setBounds(507, 143, 202, 30); contentPane.add(lblNewLabel); } }
[ "sswetha1605@gmail.com" ]
sswetha1605@gmail.com
0cd320584f540734744147371bda096e5b912bb1
531419143e516f38e1d210660d7c8f523f89fe5a
/projects/Java/src/com/chronoxor/test/fbe/FinalModelEnumEmpty.java
ca86e7df9fd929500823d6c286502fbc4c130c74
[ "MIT" ]
permissive
rizalgowandy/FastBinaryEncoding
e4d9cde5183054e476d17447bdf6c9fb1a7b6632
413acbf08567585a0a44b656236d174d46b202de
refs/heads/master
2023-02-25T22:12:03.245908
2021-12-18T21:31:14
2021-12-18T21:31:14
190,369,220
0
0
MIT
2021-12-19T23:08:22
2019-06-05T09:47:52
C++
UTF-8
Java
false
false
1,591
java
// Automatically generated by the Fast Binary Encoding compiler, do not modify! // https://github.com/chronoxor/FastBinaryEncoding // Source: test.fbe // Version: 1.7.0.0 package com.chronoxor.test.fbe; // Fast Binary Encoding EnumEmpty final model public final class FinalModelEnumEmpty extends com.chronoxor.fbe.FinalModel { public FinalModelEnumEmpty(com.chronoxor.fbe.Buffer buffer, long offset) { super(buffer, offset); } // Get the allocation size public long fbeAllocationSize(com.chronoxor.test.EnumEmpty value) { return fbeSize(); } // Get the final size @Override public long fbeSize() { return 4; } // Check if the value is valid @Override public long verify() { if ((_buffer.getOffset() + fbeOffset() + fbeSize()) > _buffer.getSize()) return Long.MAX_VALUE; return fbeSize(); } // Get the value public com.chronoxor.test.EnumEmpty get(com.chronoxor.fbe.Size size) { if ((_buffer.getOffset() + fbeOffset() + fbeSize()) > _buffer.getSize()) return new com.chronoxor.test.EnumEmpty(); size.value = fbeSize(); return new com.chronoxor.test.EnumEmpty(readInt32(fbeOffset())); } // Set the value public long set(com.chronoxor.test.EnumEmpty value) { assert ((_buffer.getOffset() + fbeOffset() + fbeSize()) <= _buffer.getSize()) : "Model is broken!"; if ((_buffer.getOffset() + fbeOffset() + fbeSize()) > _buffer.getSize()) return 0; write(fbeOffset(), value.getRaw()); return fbeSize(); } }
[ "chronoxor@gmail.com" ]
chronoxor@gmail.com
b948a263a1b8c00e1a4745f60b9c3e066996e8d9
473fc28d466ddbe9758ca49c7d4fb42e7d82586e
/app/src/main/java/com/syd/source/aosp/external/droiddriver/src/io/appium/droiddriver/duo/DuoDriver.java
0ad84bf7420c2b217d248990972550cf88c4edbb
[ "Apache-2.0" ]
permissive
lz-purple/Source
a7788070623f2965a8caa3264778f48d17372bab
e2745b756317aac3c7a27a4c10bdfe0921a82a1c
refs/heads/master
2020-12-23T17:03:12.412572
2020-01-31T01:54:37
2020-01-31T01:54:37
237,205,127
4
2
null
null
null
null
UTF-8
Java
false
false
2,233
java
/* * Copyright (C) 2016 DroidDriver committers * * 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 io.appium.droiddriver.duo; import android.annotation.TargetApi; import android.app.Activity; import android.app.Instrumentation; import io.appium.droiddriver.base.AbstractDroidDriver; import io.appium.droiddriver.base.CompositeDroidDriver; import io.appium.droiddriver.instrumentation.InstrumentationDriver; import io.appium.droiddriver.uiautomation.UiAutomationDriver; import io.appium.droiddriver.util.ActivityUtils; import io.appium.droiddriver.util.InstrumentationUtils; /** * Implementation of DroidDriver that attempts to use the best driver for the current activity. * If the activity is part of the application under instrumentation, the InstrumentationDriver is * used. Otherwise, the UiAutomationDriver is used. */ @TargetApi(18) public class DuoDriver extends CompositeDroidDriver { private final String targetApkPackage; private final UiAutomationDriver uiAutomationDriver; private final InstrumentationDriver instrumentationDriver; public DuoDriver() { Instrumentation instrumentation = InstrumentationUtils.getInstrumentation(); targetApkPackage = InstrumentationUtils.getTargetContext().getPackageName(); uiAutomationDriver = new UiAutomationDriver(instrumentation); instrumentationDriver = new InstrumentationDriver(instrumentation); } @Override protected AbstractDroidDriver getApplicableDriver() { Activity activity = ActivityUtils.getRunningActivity(); if (activity != null && targetApkPackage.equals( activity.getApplicationContext().getPackageName())) { return instrumentationDriver; } return uiAutomationDriver; } }
[ "997530783@qq.com" ]
997530783@qq.com
5772d808a95cc91d4b0765514a318f8a89b7bb45
85b6d0af6102e3ece9464887aab99f0d586650cc
/src/Array/No_888_Fair_Candy_Swap/Solution.java
d0dcee625102e88fbe2450c701fa3f6bd473ecf0
[]
no_license
Edison0716/DailyLeetCode
040c2d0f0a35b92588942c73f0c48d72dcc74712
19432a1a43b1bd276ce04dcc714d6643c1e0c819
refs/heads/master
2020-04-17T03:28:15.775590
2020-03-02T14:46:27
2020-03-02T14:46:27
166,184,552
0
1
null
null
null
null
UTF-8
Java
false
false
2,843
java
package Array.No_888_Fair_Candy_Swap; import java.util.HashSet; /** * FileName: Solution * Author: mac * Date: 2019-01-31 10:38 * Description: Fair Candy Swap * <p> * Alice and Bob have candy bars of different sizes: A[i] is the size of the i-th bar of candy that Alice has, and B[j] is the size of the j-th bar of candy that Bob has. * <p> * Since they are friends, they would like to exchange one candy bar each so that after the exchange, they both have the same total amount of candy. (The total amount of candy a person has is the sum of the sizes of candy bars they have.) * <p> * Return an integer array ans where ans[0] is the size of the candy bar that Alice must exchange, and ans[1] is the size of the candy bar that Bob must exchange. * <p> * If there are multiple answers, you may return any one of them. It is guaranteed an answer exists. * <p> * <p> * <p> * Example 1: * <p> * Input: A = [1,1], B = [2,2] * Output: [1,2] * Example 2: * <p> * Input: A = [1,2], B = [2,3] * Output: [1,2] * Example 3: * <p> * Input: A = [2], B = [1,3] * Output: [2,3] * Example 4: * <p> * Input: A = [1,2,5], B = [2,4] * Output: [5,4] */ public class Solution { public int[] fairCandySwap(int[] A, int[] B) { int totalA = 0; int totalB = 0; for (int num : A) { totalA = totalA + num; } for (int num : B) { totalB = totalB + num; } HashSet<Integer> integers = new HashSet<>(); for (int num : B) { integers.add(num); } int avg = (totalA + totalB) / 2; for (int i = 0; i < A.length; i++) { int num = avg - (totalA - A[i]); //平均数 - A总数中不包含当前选中的值 if (integers.contains(num)) { return new int[]{A[i], num}; } } throw null; } //超时 public int[] fairCandySwap1(int[] A, int[] B) { int totalNum = 0; int[] resultArray = new int[2]; for (int i = 0; i < A.length; i++) { totalNum = totalNum + A[i]; } for (int i = 0; i < B.length; i++) { totalNum = totalNum + B[i]; } System.out.println(totalNum); int avgNum = totalNum / 2; for (int i = 0; i < A.length; i++) { int tem; for (int j = 0; j < B.length; j++) { tem = B[j]; B[j] = 0; int total = 0; for (int k = 0; k < B.length; k++) { total = total + B[k]; } if (avgNum == total + A[i]) { resultArray[0] = A[i]; resultArray[1] = tem; } B[j] = tem; } } return resultArray; } }
[ "18644056528@163.com" ]
18644056528@163.com
e95d04699005f1a984fff2fc32ef994536ed5a8c
b89d6fdfca0fbd67ec966adb96fa424a46d6281e
/src/creational_patterns/factory_method_pattern/calculator/factory/OperationMulFactory.java
5fa0ddc0aa9a9946cd93e2b401637b79ca21e6dc
[]
no_license
GeniusDSY/DesignPatterns
6dbd0a9dcb6aa3d76038f33e7425a419f8b4efda
679de181200d9de9a00a27ecb34c846276e9f417
refs/heads/master
2020-04-29T23:03:44.597880
2019-04-10T15:00:05
2019-04-10T15:00:05
176,466,068
0
0
null
null
null
null
UTF-8
Java
false
false
523
java
package creational_patterns.factory_method_pattern.calculator.factory; import creational_patterns.factory_method_pattern.calculator.production.OperationMulProduction; import creational_patterns.factory_method_pattern.calculator.production.OperationProduction; /** * @author :DengSiYuan * @date :2019/3/19 21:21 * @desc :乘法工厂 */ public class OperationMulFactory implements OperationFactory { @Override public OperationProduction createOperation() { return new OperationMulProduction(); } }
[ "genius_dsy@foxmail.com" ]
genius_dsy@foxmail.com
c5bfa96422eff807618bb48743ef7b615a463b04
f8ca95c96d65f3290fd7a9f74084b6f4b6491cc2
/AlgoStudy/src/Sorting/SelectionSort2.java
95a75b69f080f8df080fdca172d57e5668be669c
[]
no_license
OJieun/AlgoStudy
f929549bad32e61955ea0328978222fba8a5b105
de5b825bd7a548a0bae23bef62b8314be731f09b
refs/heads/master
2020-12-25T18:53:03.973557
2017-07-16T14:45:00
2017-07-16T14:45:00
94,010,163
0
0
null
null
null
null
UTF-8
Java
false
false
1,020
java
package Sorting; import java.util.Scanner; public class SelectionSort2 { public static void main(String[] args) { // TODO Auto-generated method stub String[] strArr; Scanner sc = new Scanner(System.in); String inputStr = sc.nextLine(); System.out.println("input : " + inputStr); strArr = inputStr.split(" "); int[] arr = new int[strArr.length]; for(int i=0; i<strArr.length; i++){ arr[i] = Integer.parseInt(strArr[i]); } System.out.println(); sorting(arr); printing(arr); } public static void sorting(int[] arr){ for(int i=0; i<arr.length; i++){ int minIdx = i; for(int j=i+1; j<arr.length; j++){ if (arr[j]<arr[minIdx]){ minIdx = j; } } int temp = arr[i]; arr[i] = arr[minIdx]; arr[minIdx] = temp; } } public static void printing(int[] arr){ System.out.println("output : "); for(int i=0; i<arr.length; i++){ System.out.print(arr[i] + ", "); } } }
[ "JE@DESKTOP-CNR8OQO" ]
JE@DESKTOP-CNR8OQO
f8b491448f39bdc042c60e4a570024fe63c4d69c
7a53bcc441dddf1de30e3d8bcb4090a1ea7fe6ce
/src/org/neusoft/action/TeacherAction.java
9eec0302f0dc4e4837329815222111b81784cdc5
[]
no_license
drduan/neusoftsms
726ec3f611c77c83d22aea4db5ad230e66e623b4
805146a58b14c87060157a3b8ec843a776a1945c
refs/heads/master
2021-01-20T18:34:04.703047
2016-08-02T13:51:08
2016-08-02T13:51:08
60,894,670
0
0
null
null
null
null
UTF-8
Java
false
false
1,998
java
package org.neusoft.action; import java.io.Serializable; import java.util.List; import java.util.Map; import org.apache.struts2.convention.annotation.Action; import org.apache.struts2.convention.annotation.Namespace; import org.apache.struts2.convention.annotation.ParentPackage; import org.apache.struts2.convention.annotation.Result; import org.apache.struts2.convention.annotation.Results; import org.neusoft.hb.entites.Classinfo; import org.neusoft.hb.entites.Student; import org.neusoft.hb.entites.Teacher; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Controller; import com.opensymphony.xwork2.ActionContext; @Namespace(value = "/neusoft/crol/teacheraction") @Results(value = { @Result(name = "infoes", location = "/WEB-INF/infoes/info_teacher.jsp"), @Result(name = "insert_or_update", location = "/WEB-INF/update/insert_teacher.jsp") }) public class TeacherAction extends BaseAction { private Teacher teacher; private List<Teacher> batch_list; public void setBatch_list(List<Teacher> batch_list) { this.batch_list = batch_list; } public Teacher getTeacher() { return teacher; } public void setTeacher(Teacher teacher) { this.teacher = teacher; } @Override public String getKey() { // TODO Auto-generated method stub return getService().TEACHER; } @Override public List getBatch_list() { // TODO Auto-generated method stub return batch_list; } public Serializable getEntity() { // TODO Auto-generated method stub return this.teacher; } @Action(value = "toInsertOrUpdate") public String toInsertOrUpdate() { if (teacher != null && teacher.getTid() != null) { this.teacher = (Teacher) getService().getInfoByID(getKey(), teacher.getTid()); } List<Teacher> infoes = this.getService().getAll( getService().TEACHER); Map<String, Object> mp = (Map<String, Object>) ActionContext .getContext().get("request"); mp.put("infoes", infoes); return "insert_or_update"; } }
[ "drduan@vip.qq.com" ]
drduan@vip.qq.com
1772f7f4a3d5baf2d0a87f7353568029ca029b33
852eaef4704a814cc60917102559d1f772582666
/src/main/java/com/zhb/manager/LockManager.java
953830704301f2f8ba053d78269dff6c5d9c5099
[]
no_license
RobinZhouAu/audit
71747c96f068a3938c73c5f7f1da95aeaf88fed9
f072c64d4842ddf92c01535d2e55f0199b1f275e
refs/heads/master
2021-06-13T18:50:15.612663
2017-03-17T06:07:01
2017-03-17T06:07:01
76,326,679
0
0
null
null
null
null
UTF-8
Java
false
false
3,577
java
package com.zhb.manager; import org.apache.log4j.Logger; import java.util.HashMap; import java.util.Iterator; import java.util.Map; /** * Created by zhouhaibin on 2016/11/30. * 资源锁的管理 */ public class LockManager { static Logger logger = Logger.getLogger(LockManager.class); static Map<String, ResourceLock> locks = new HashMap<>(); public static Map<String, ResourceLock> getLocks() { return locks; } //添加资源锁 public static boolean addLock(String resourceId, int resourceType, String userId, String sessionId) { ResourceLock resourceLock = locks.get(resourceId); if (resourceLock != null) { if (resourceLock.getUserId().equals(userId)) { resourceLock.update(); logger.debug(String.format("update resource lock[%s][%s]", resourceId, userId)); return true; } return false; } resourceLock = new ResourceLock(resourceId, resourceType, userId); resourceLock.setSessionId(sessionId); locks.put(resourceLock.getResourceId(), resourceLock); logger.debug(String.format("add resource lock[%s][%s]", resourceId, userId)); return true; } //释放资源锁 public static boolean releaseLock(String resourceId, String userId) { ResourceLock resourceLock = locks.get(resourceId); if (resourceLock == null) return true; if (!resourceLock.getUserId().equals(userId)) return false; locks.remove(resourceId); logger.debug(String.format("release resource lock[%s][%s]", resourceId, userId)); return true; } //释放某个用户的所有资源锁 public static void releaseUserAllLocks(String userId) { logger.debug(String.format("release all user's resource lock[%s]", userId)); for (Iterator iterator = locks.keySet().iterator(); iterator.hasNext(); ) { String resourceId = (String)iterator.next(); ResourceLock resourceLock = locks.get(resourceId); if (resourceLock.getUserId().equals(userId)) { locks.remove(resourceId); logger.debug(String.format("release user's resource lock[%s]", resourceId)); } } } //释放某个Session所有资源锁 public static void releaseSessionAllLocks(String sessionId) { logger.debug(String.format("release all session's resource lock[%s]", sessionId)); for (Iterator iterator = locks.keySet().iterator(); iterator.hasNext(); ) { String resourceId = (String)iterator.next(); ResourceLock resourceLock = locks.get(resourceId); if (resourceLock.getSessionId().equals(sessionId)) { locks.remove(resourceId); logger.debug(String.format("release session's resource lock[%s]", resourceId)); } } } //获得锁定某个资源的用户Id public static String getResourceLocker(String resourceId) { ResourceLock resourceLock = locks.get(resourceId); if (resourceLock != null) { return resourceLock.getUserId(); } return null; } //管理员解锁 public static boolean releaseByAdmin(String resourceId) { ResourceLock resourceLock = locks.get(resourceId); if (resourceLock == null) return true; locks.remove(resourceId); logger.debug(String.format("release resource lock by admin [%s]", resourceId)); return true; } }
[ "robin.zhou.au@gmail.com" ]
robin.zhou.au@gmail.com
5363f5aef6bcec28a4f9b3ab9030493ccc362152
c8682f670d46a897d42bc14be978dea9487371c3
/jhaws/swing/src/test/java/org/swingeasy/DateTimeDemo.java
776c6599664dc8c65c37e60e25a734502fb8ca1a
[ "MIT" ]
permissive
jurgendl/jhaws
04322a1d7073b6e3509040ef2ddcaa587e5d365a
871af0de8a23f618bfd0d47b879a0e8de35b785d
refs/heads/master
2023-08-09T03:03:09.106795
2023-07-29T10:51:08
2023-07-29T10:51:08
32,465,714
4
0
MIT
2023-08-27T15:43:08
2015-03-18T15:03:58
JavaScript
UTF-8
Java
false
false
1,914
java
package org.swingeasy; import java.awt.BorderLayout; import java.awt.Container; import java.awt.GridLayout; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.WindowConstants; /** * @author Jurgen */ public class DateTimeDemo { private static void addComponents(Container container) { container.setLayout(new GridLayout(-1, 1)); final EDateEditor ede0 = new EDateEditor(); final EDateTimeEditor edte0 = new EDateTimeEditor(); final ETimeEditor edt0 = new ETimeEditor(); { container.add(ede0, BorderLayout.NORTH); container.add(edte0, BorderLayout.CENTER); container.add(edt0, BorderLayout.SOUTH); } final EDateEditor ede = new EDateEditor(); final EDateTimeEditor edte = new EDateTimeEditor(); final ETimeEditor edt = new ETimeEditor(); { ede.setDate(null); container.add(ede, BorderLayout.NORTH); edte.setDate(null); container.add(edte, BorderLayout.CENTER); edt.setDate(null); container.add(edt, BorderLayout.SOUTH); } JButton log = new JButton("log"); log.addActionListener(e -> { System.out.println(ede0.getDate()); System.out.println(edte0.getDate()); System.out.println(ede.getDate()); System.out.println(edte.getDate()); }); container.add(log); } public static void main(String[] args) { // SystemSettings.setCurrentLocale(Locale.US); UIUtils.niceLookAndFeel(); JFrame frame = new JFrame(); frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); DateTimeDemo.addComponents(frame.getContentPane()); frame.pack(); frame.setLocationRelativeTo(null); frame.setTitle("DateDemo"); frame.setVisible(true); } }
[ "jurgen.de.landsheer@gmail.com" ]
jurgen.de.landsheer@gmail.com
f07750d4b083d9efbd78bfb3c1b09624e54822d4
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/5/5_741371e196dfc73d68ddfdfefd08966b8dab8f8a/JSIncluder/5_741371e196dfc73d68ddfdfefd08966b8dab8f8a_JSIncluder_s.java
02e310dd02e2cc49a6e33f917090409c4fd0f990
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
8,629
java
/** * Copyright (C) 2012 JBoss Inc * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.jboss.dashboard.ui.components.js; import org.jboss.dashboard.Application; import org.jboss.dashboard.annotation.config.Config; import org.apache.commons.lang.ArrayUtils; import org.apache.commons.lang.StringUtils; import javax.annotation.PostConstruct; import javax.enterprise.context.ApplicationScoped; import javax.inject.Inject; import java.io.*; @ApplicationScoped public class JSIncluder { private static transient org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(JSIncluder.class.getName()); public static final String HEAD = "head"; public static final String BOTTOM = "bottom"; @Inject @Config("/javascript/Head.js") private String headScriptFile; @Inject @Config("/javascript/Bottom.js") private String bottomScriptFile; @Inject @Config("false") private boolean existHead; @Inject @Config("false") private boolean existBottom; @Inject @Config("/components/bam/displayer/chart/gauge/raphael.2.1.0.min.js," + "/components/bam/displayer/chart/gauge/justgage.1.0.1.min.js," + "/components/bam/displayer/chart/nvd3/lib/d3.v2.min.js," + "/components/bam/displayer/chart/nvd3/nv.d3.min.js," + "/components/bam/displayer/chart/nvd3/src/tooltip.js," + "/components/bam/displayer/chart/nvd3/src/utils.js," + "/components/bam/displayer/chart/nvd3/src/models/axis.js," + "/components/bam/displayer/chart/nvd3/src/models/discreteBar.js," + "/components/bam/displayer/chart/nvd3/src/models/discreteBarChart.js," + "/components/bam/displayer/chart/nvd3/src/models/legend.js," + "/components/bam/displayer/chart/nvd3/src/models/scatter.js," + "/components/bam/displayer/chart/nvd3/src/models/line.js," + "/components/bam/displayer/chart/nvd3/src/models/lineChart.js," + "/components/bam/displayer/chart/nvd3/src/models/pie.js," + "/components/bam/displayer/chart/nvd3/src/models/pieChart.js," + "/js/lib/scriptaculous-js-1.9.0/prototype.js," + "/js/lib/scriptaculous-js-1.9.0/scriptaculous.js," + "/js/lib/scriptaculous-js-1.9.0/effects.js," + "/js/lib/scriptaculous-js-1.9.0/dragdrop.js," + "/common/rs/popup.js," + "/fckeditor/fckeditor.js") private String[] pagesToIncludeInHeader; @Inject @Config("/components/colorpicker/js/colorPicker.jsp") private String[] jspPagesToIncludeInHeader; @Inject @Config("") private String[] jspPagesToIncludeInBottom; @Inject @Config("") private String[] pagesToIncludeInBottom; @PostConstruct public void start() throws Exception { setExists(HEAD, deployJS(HEAD)); setExists(BOTTOM, deployJS(BOTTOM)); } public String getJSFileURL(String position) { return getJSFilePath(position); } public String getJSFilePath(String position) { if (HEAD.equals(position)) return headScriptFile; else if (BOTTOM.equals(position)) return bottomScriptFile; return null; } public String[] getJSPFilesPath(String position) { if (HEAD.equals(position)) return jspPagesToIncludeInHeader; else if (BOTTOM.equals(position)) return jspPagesToIncludeInBottom; return null; } public boolean checkAndDeploy(String position) { if (!getExists(position)) return setExists(position, deployJS(position)); return true; } protected boolean getExists(String position) { if (HEAD.equals(position)) return existHead; else if (BOTTOM.equals(position)) return existBottom; return false; } protected boolean setExists(String position, boolean value) { if (HEAD.equals(position)) existHead = value; else if (BOTTOM.equals(position)) existBottom = value; return value; } public boolean deployJS(String position) { if (HEAD.equals(position)) return deployJS(headScriptFile, pagesToIncludeInHeader); else if (BOTTOM.equals(position)) return deployJS(bottomScriptFile, pagesToIncludeInBottom); log.warn("Unable to deploy JS option '" + position +"'"); return false; } protected boolean deployJS(String scriptFile, String[] pagesToInclude) { if (StringUtils.isEmpty(scriptFile) || ArrayUtils.isEmpty(pagesToInclude)) return false; BufferedWriter out = null; try { File destFile = getScriptFile(scriptFile); out = new BufferedWriter(new FileWriter(destFile)); for (String pageToInclude : pagesToInclude) { BufferedReader in = new BufferedReader(new FileReader(Application.lookup().getBaseAppDirectory() + pageToInclude)); try { String l; while ((l = in.readLine()) != null) { out.write(l.trim()); out.newLine(); } } catch (Exception e) { log.error("Error writting JS file '" + pageToInclude + "': ", e); } finally { try {in.close();} catch (Exception ex) {} } } return true; } catch (Exception e) { log.error("Error writting JS file: ", e); } finally { if (out != null) try {out.close();} catch (Exception ex){} } return false; } private File getScriptFile(String scriptFile) throws Exception { File destFile = new File(Application.lookup().getBaseAppDirectory() + scriptFile); if (destFile.exists()) destFile.delete(); if (!destFile.getParentFile().exists()) destFile.getParentFile().mkdirs(); destFile.createNewFile(); return destFile; } public String[] getPagesToIncludeInHeader() { return pagesToIncludeInHeader; } public void setPagesToIncludeInHeader(String[] pagesToIncludeInHeader) { this.pagesToIncludeInHeader = pagesToIncludeInHeader; } public String[] getPagesToIncludeInBottom() { return pagesToIncludeInBottom; } public void setPagesToIncludeInBottom(String[] pagesToIncludeInBottom) { this.pagesToIncludeInBottom = pagesToIncludeInBottom; } public String[] getJspPagesToIncludeInHeader() { return jspPagesToIncludeInHeader; } public void setJspPagesToIncludeInHeader(String[] jspPagesToIncludeInHeader) { this.jspPagesToIncludeInHeader = jspPagesToIncludeInHeader; } public String[] getJspPagesToIncludeInBottom() { return jspPagesToIncludeInBottom; } public void setJspPagesToIncludeInBottom(String[] jspPagesToIncludeInBottom) { this.jspPagesToIncludeInBottom = jspPagesToIncludeInBottom; } public String getHeadScriptFile() { return headScriptFile; } public void setHeadScriptFile(String headScriptFile) { this.headScriptFile = headScriptFile; } public String getBottomScriptFile() { return bottomScriptFile; } public void setBottomScriptFile(String bottomScriptFile) { this.bottomScriptFile = bottomScriptFile; } public boolean isExistHead() { return existHead; } public void setExistHead(boolean existHead) { this.existHead = existHead; } public boolean isExistBottom() { return existBottom; } public void setExistBottom(boolean existBottom) { this.existBottom = existBottom; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
1cb52b252f0adf6f1ccc78615b16814a40d9177a
beba535c8106d05168a53535235b150a8dfe852c
/src/main/java/com/jxau/grain/entity/admin/Menu.java
2a031af21cc875dffb88f093b6f5fda9bce5f243
[]
no_license
DengrenAyane/grain-purchase
6ceaa1c0ccdfb437564640a78342afed556bbb62
a2bbb84aef76c9ff97bb81bca6c1e04b9502405d
refs/heads/master
2023-01-02T03:27:21.561637
2020-10-26T12:53:44
2020-10-26T12:53:44
307,358,700
0
0
null
null
null
null
UTF-8
Java
false
false
2,347
java
package com.jxau.grain.entity.admin; import com.jxau.grain.annotion.ValidateEntity; import org.springframework.data.jpa.domain.support.AuditingEntityListener; import javax.persistence.*; /** * 后台菜单实体类 * @author Administrator * */ @Entity @Table(name="lssf_menu") @EntityListeners(AuditingEntityListener.class) public class Menu extends BaseEntity{ /** * */ private static final long serialVersionUID = 1L; @ValidateEntity(required=true,requiredLeng=true,minLength=1,maxLength=18,errorRequiredMsg="菜单名称不能为空!",errorMinLengthMsg="菜单名称长度需大于1!",errorMaxLengthMsg="菜单名称长度不能大于18!") @Column(name="name",nullable=false,length=18) private String name;//菜单名称 @ManyToOne @JoinColumn(name="parent_id") private Menu parent;//菜单父分类 @ValidateEntity(required=false) @Column(name="url",length=128) private String url;//菜单url @ValidateEntity(required=false) @Column(name="icon",length=32) private String icon;//菜单图标icon @Column(name="sort",nullable=false,length=4) private Integer sort = 0;//菜单顺序,默认升序排列,默认是0 @Column(name="is_bitton",nullable=false) private boolean isButton = false;//是否是按钮 @Column(name="is_show",nullable=false) private boolean isShow = true;//是否显示 public String getName() { return name; } public void setName(String name) { this.name = name; } public Menu getParent() { return parent; } public void setParent(Menu parent) { this.parent = parent; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } public String getIcon() { return icon; } public void setIcon(String icon) { this.icon = icon; } public Integer getSort() { return sort; } public void setSort(Integer sort) { this.sort = sort; } public boolean isButton() { return isButton; } public void setButton(boolean isButton) { this.isButton = isButton; } public boolean isShow() { return isShow; } public void setShow(boolean isShow) { this.isShow = isShow; } @Override public String toString() { return "Menu [name=" + name + ", parent=" + parent + ", url=" + url + ", icon=" + icon + ", sort=" + sort + ", isButton=" + isButton + ", isShow=" + isShow + "]"; } }
[ "1548488689@qq.com" ]
1548488689@qq.com
4450879acbe18fffba1328d4b909e4bb688b1195
06185eae44f8d78474077593013fce33b5a32c29
/src/com/example/dsa/linkedlist/intersection/Node.java
97c536e8205fabf3d679f6cfcc2f680f001fe882
[]
no_license
shshankar1/DataStructureNAlgo
752a1963d0694db7e5838b4a31d3af48b0181f18
1ccb2721e7723195a0a3692edb929e5db00c8eb0
refs/heads/master
2020-04-06T05:48:45.338703
2017-06-26T09:14:59
2017-06-26T09:14:59
95,429,079
0
2
null
null
null
null
UTF-8
Java
false
false
329
java
package com.example.dsa.linkedlist.intersection; public class Node<T> { private T value; private Node<T> next; public T getValue() { return value; } public void setValue(T value) { this.value = value; } public Node<T> getNext() { return next; } public void setNext(Node<T> next) { this.next = next; } }
[ "sh.shankar1@gmail.com" ]
sh.shankar1@gmail.com
d7c62275c8cfc900b7648954a4318a49fbf07076
152fa4c9564a920844cc062f6af8d979f577a9be
/3-5-management_system/src/com/duben/springmvc/entity/CommonResultList.java
b3e5373e42429537702568cdc3b357ec85192522
[]
no_license
SWXY33/JS-CSS-HTML-java
38a91aa24bdb3a008df389a3d1064c7b1bdb7e2e
244e76d7d8e42f4ffde92bdd1a832613fb6a7fd2
refs/heads/master
2022-11-14T18:01:07.845532
2020-07-10T09:07:07
2020-07-10T09:07:07
268,398,760
1
1
null
2020-07-10T09:14:35
2020-06-01T01:40:30
Python
UTF-8
Java
false
false
468
java
package com.duben.springmvc.entity; public class CommonResultList<T> { private long status; private String msg; private T data ; public long getStatus() { return status; } public void setStatus(long status) { this.status = status; } public String getMsg() { return msg; } public void setMsg(String msg) { this.msg = msg; } public T getData() { return data; } public void setData(T data) { this.data = data; } }
[ "15607732513@163.com" ]
15607732513@163.com
96b964be9ea336b75d39e9ec138f773dfa9355f4
7925703a2d10ccb23578e08b2c0ed0c83e288c0c
/Etap_8/mmo_mybatis/src/main/java/pl/psk/to/mmo/mmo_mybatis/model/Country.java
a8dd0212fd5dcc8ebc7d01fe1ec3d5c5e17a9fc2
[]
no_license
cherro0125/technologie-obiektowe
d6459b1a7c7d7da94205a04cc2712ae2fce6cfa5
a580f645aac5dd847d8e54847c4fd47476af5630
refs/heads/master
2023-06-06T01:24:40.006465
2021-06-28T15:40:53
2021-06-28T15:40:53
348,785,110
0
0
null
null
null
null
UTF-8
Java
false
false
308
java
package pl.psk.to.mmo.mmo_mybatis.model; import lombok.Data; import lombok.EqualsAndHashCode; import pl.psk.to.mmo.mmo_mybatis.model.base.Auditable; @EqualsAndHashCode(callSuper = true) @Data public class Country extends Auditable { private Long id; private String code; private String name; }
[ "dkaliszewski@pretius.com" ]
dkaliszewski@pretius.com
d88e2cbf875e1373f78a4ef19788ce12aa20a926
5e1f119efe8a8a3fa2be2db12665f240cb8d6a29
/1.JavaSyntax/src/com/javarush/task/task07/task0728/Solution.java
8c038eb3d09aababfc6bac7277c989072973cc0a
[]
no_license
VilFenoX/JavaRushTasks
194a80351502d34fecf597ff2e1756425a7f775b
e009c7808f583d0758bbadb670723c374c3541d6
refs/heads/master
2023-08-14T04:00:43.881190
2021-10-03T17:29:03
2021-10-03T17:29:03
400,264,278
1
0
null
null
null
null
UTF-8
Java
false
false
947
java
package com.javarush.task.task07.task0728; import java.io.BufferedReader; import java.io.InputStreamReader; /* В убывающем порядке */ public class Solution { public static void main(String[] args) throws Exception { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); int[] array = new int[20]; for (int i = 0; i < 20; i++) { array[i] = Integer.parseInt(reader.readLine()); } sort(array); for (int x : array) { System.out.println(x); } } public static void sort(int[] array) { for (int i = array.length-1; i>0; i--){ for (int j=0; j<i;j++){ if(array[j]<array[j+1]){ int temp = array[j]; array[j] = array[j+1]; array[j+1] = temp; } } }//напишите тут ваш код } }
[ "68443337+VilFenoX@users.noreply.github.com" ]
68443337+VilFenoX@users.noreply.github.com
168e14ccd77192adac5b60c7fea4a7d4dfa09637
4adbe93e02634b0c363a19827a54d3407557c90f
/End_Module3/src/main/java/com/example/End_Module3/controller/ProductServlet.java
e3b10b08a79dee963419b3b190259c3a978b90b1
[]
no_license
Huy-Le2002/MODULE_3
8d17b08c9b54b4a993d16fb5f020f55090ee116e
38eb713c44a53f04be5fcdffc9649f91ff4615aa
refs/heads/master
2023-05-15T00:14:37.299338
2021-06-08T09:18:17
2021-06-08T09:18:17
373,039,941
0
0
null
null
null
null
UTF-8
Java
false
false
6,440
java
package com.example.End_Module3.controller; import com.example.End_Module3.dao.ProductDAO; import com.example.End_Module3.model.Category; import com.example.End_Module3.model.Product; import javax.servlet.*; import javax.servlet.http.*; import javax.servlet.annotation.*; import java.io.IOException; import java.sql.SQLException; import java.util.Calendar; import java.util.List; @WebServlet(name = "ProductServlet", value = "/product") public class ProductServlet extends HttpServlet { ProductDAO productDAO = new ProductDAO(); @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String action = request.getParameter("action"); if (action == null) { action = ""; } switch (action) { case "create": showInsertProduct(request,response); break; case "edit": showEditProduct(request,response); break; case "delete": try { deleteProduct(request,response); } catch (SQLException throwables) { throwables.printStackTrace(); } case "find": findProduct(request,response); break; default: listAllProduct(request,response); break; } } @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.setCharacterEncoding("UTF-8"); String action = request.getParameter("action"); if (action == null) { action = ""; } switch (action) { case "create": try { insertProduct(request,response); } catch (SQLException throwables) { throwables.printStackTrace(); } break; case "edit": try { editProduct(request,response); } catch (SQLException throwables) { throwables.printStackTrace(); } break; } } private void findProduct(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String key = request.getParameter("key"); List<Product> list = productDAO.findData(key); request.setAttribute("list",list); RequestDispatcher requestDispatcher = request.getRequestDispatcher("product/find.jsp"); requestDispatcher.forward(request,response); } private void editProduct(HttpServletRequest request, HttpServletResponse response) throws SQLException, ServletException, IOException { int id = Integer.parseInt(request.getParameter("id")); String name = request.getParameter("name"); float price = Float.parseFloat(request.getParameter("price")); int quantity = Integer.parseInt(request.getParameter("quantity")); String color = request.getParameter("color"); String des = request.getParameter("des"); int category = Integer.parseInt(request.getParameter("category")); Product product = new Product(id,name,price,quantity,color,des,category); productDAO.updateProduct(product); request.setAttribute("message","Update success"); RequestDispatcher requestDispatcher = request.getRequestDispatcher("product/edit.jsp"); requestDispatcher.forward(request,response); } private void deleteProduct(HttpServletRequest request, HttpServletResponse response) throws SQLException, IOException, ServletException { try{ int id = Integer.parseInt(request.getParameter("id")); productDAO.deleteProduct(id); List<Product> list = productDAO.selectAllProduct(); request.setAttribute("list",list); RequestDispatcher requestDispatcher = request.getRequestDispatcher("product/list.jsp"); requestDispatcher.forward(request,response); }catch (Exception e){ System.out.println(e.getMessage()); } } private void showEditProduct(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { int id = Integer.parseInt(request.getParameter("id")); Product product = productDAO.selectProduct(id); List<Category> list = productDAO.selectAllCategory(); request.setAttribute("data_category",list); request.setAttribute("data_product",product); RequestDispatcher requestDispatcher = request.getRequestDispatcher("product/edit.jsp"); requestDispatcher.forward(request,response); } private void insertProduct(HttpServletRequest request, HttpServletResponse response) throws SQLException, ServletException, IOException { String name = request.getParameter("name"); float price = Float.parseFloat(request.getParameter("price")); int quantity = Integer.parseInt(request.getParameter("quantity")); String color = request.getParameter("color"); int category = Integer.parseInt(request.getParameter("category")); Product product = new Product(name,price,quantity,color,category); productDAO.insertProduct(product); RequestDispatcher requestDispatcher = request.getRequestDispatcher("product/create.jsp"); request.setAttribute("message","Add thành công"); requestDispatcher.forward(request,response); } private void listAllProduct(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { List<Product> list = productDAO.selectAllProduct(); request.setAttribute("list",list); RequestDispatcher requestDispatcher = request.getRequestDispatcher("product/list.jsp"); requestDispatcher.forward(request,response); } private void showInsertProduct(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { List<Category> categoryList = productDAO.selectAllCategory(); request.setAttribute("data",categoryList); RequestDispatcher requestDispatcher = request.getRequestDispatcher("product/create.jsp"); requestDispatcher.forward(request,response); } }
[ "huysvit@gmail.com" ]
huysvit@gmail.com
aa998ce3ed6379e61531db7ae1defa6a128188ff
6c7445f4cb06e3f11ca0e3b62cd294596d43bc1b
/docroot/WEB-INF/src/net/sareweb/txotx/service/persistence/JarraipenPersistenceImpl.java
75feb4faba4d38a9b6d534d2c47088a1ac662418
[]
no_license
aritzg/Txotx-portlet
ec915c7d1e9caf288c1b19fab240a0816d9a12fe
4e22a2084368b54a242a4cdd8ea0d2bda51c5e18
refs/heads/master
2016-08-06T02:04:04.620786
2014-03-13T06:45:45
2014-03-13T06:45:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
51,854
java
/** * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved. * * This library is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. */ package net.sareweb.txotx.service.persistence; import com.liferay.portal.NoSuchModelException; import com.liferay.portal.kernel.bean.BeanReference; import com.liferay.portal.kernel.cache.CacheRegistryUtil; import com.liferay.portal.kernel.dao.orm.EntityCacheUtil; import com.liferay.portal.kernel.dao.orm.FinderCacheUtil; import com.liferay.portal.kernel.dao.orm.FinderPath; import com.liferay.portal.kernel.dao.orm.Query; import com.liferay.portal.kernel.dao.orm.QueryPos; import com.liferay.portal.kernel.dao.orm.QueryUtil; import com.liferay.portal.kernel.dao.orm.Session; import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.log.Log; import com.liferay.portal.kernel.log.LogFactoryUtil; import com.liferay.portal.kernel.util.GetterUtil; import com.liferay.portal.kernel.util.InstanceFactory; import com.liferay.portal.kernel.util.OrderByComparator; import com.liferay.portal.kernel.util.PropsKeys; import com.liferay.portal.kernel.util.PropsUtil; import com.liferay.portal.kernel.util.StringBundler; import com.liferay.portal.kernel.util.StringPool; import com.liferay.portal.kernel.util.StringUtil; import com.liferay.portal.model.CacheModel; import com.liferay.portal.model.ModelListener; import com.liferay.portal.service.persistence.BatchSessionUtil; import com.liferay.portal.service.persistence.ResourcePersistence; import com.liferay.portal.service.persistence.UserPersistence; import com.liferay.portal.service.persistence.impl.BasePersistenceImpl; import net.sareweb.txotx.NoSuchJarraipenException; import net.sareweb.txotx.model.Jarraipen; import net.sareweb.txotx.model.impl.JarraipenImpl; import net.sareweb.txotx.model.impl.JarraipenModelImpl; import java.io.Serializable; import java.util.ArrayList; import java.util.Collections; import java.util.List; /** * The persistence implementation for the jarraipen service. * * <p> * Caching information and settings can be found in <code>portal.properties</code> * </p> * * @author A.Galdos * @see JarraipenPersistence * @see JarraipenUtil * @generated */ public class JarraipenPersistenceImpl extends BasePersistenceImpl<Jarraipen> implements JarraipenPersistence { /* * NOTE FOR DEVELOPERS: * * Never modify or reference this class directly. Always use {@link JarraipenUtil} to access the jarraipen persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class. */ public static final String FINDER_CLASS_NAME_ENTITY = JarraipenImpl.class.getName(); public static final String FINDER_CLASS_NAME_LIST_WITH_PAGINATION = FINDER_CLASS_NAME_ENTITY + ".List1"; public static final String FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION = FINDER_CLASS_NAME_ENTITY + ".List2"; public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_BY_JARRAITZAILEUSERID = new FinderPath(JarraipenModelImpl.ENTITY_CACHE_ENABLED, JarraipenModelImpl.FINDER_CACHE_ENABLED, JarraipenImpl.class, FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findByJarraitzaileUserId", new String[] { Long.class.getName(), "java.lang.Integer", "java.lang.Integer", "com.liferay.portal.kernel.util.OrderByComparator" }); public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_JARRAITZAILEUSERID = new FinderPath(JarraipenModelImpl.ENTITY_CACHE_ENABLED, JarraipenModelImpl.FINDER_CACHE_ENABLED, JarraipenImpl.class, FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findByJarraitzaileUserId", new String[] { Long.class.getName() }, JarraipenModelImpl.JARRAITZAILEUSERID_COLUMN_BITMASK); public static final FinderPath FINDER_PATH_COUNT_BY_JARRAITZAILEUSERID = new FinderPath(JarraipenModelImpl.ENTITY_CACHE_ENABLED, JarraipenModelImpl.FINDER_CACHE_ENABLED, Long.class, FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByJarraitzaileUserId", new String[] { Long.class.getName() }); public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_BY_JARRAITUAID = new FinderPath(JarraipenModelImpl.ENTITY_CACHE_ENABLED, JarraipenModelImpl.FINDER_CACHE_ENABLED, JarraipenImpl.class, FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findByJarraituaId", new String[] { Long.class.getName(), "java.lang.Integer", "java.lang.Integer", "com.liferay.portal.kernel.util.OrderByComparator" }); public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_JARRAITUAID = new FinderPath(JarraipenModelImpl.ENTITY_CACHE_ENABLED, JarraipenModelImpl.FINDER_CACHE_ENABLED, JarraipenImpl.class, FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findByJarraituaId", new String[] { Long.class.getName() }, JarraipenModelImpl.JARRAITUAID_COLUMN_BITMASK); public static final FinderPath FINDER_PATH_COUNT_BY_JARRAITUAID = new FinderPath(JarraipenModelImpl.ENTITY_CACHE_ENABLED, JarraipenModelImpl.FINDER_CACHE_ENABLED, Long.class, FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByJarraituaId", new String[] { Long.class.getName() }); public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_ALL = new FinderPath(JarraipenModelImpl.ENTITY_CACHE_ENABLED, JarraipenModelImpl.FINDER_CACHE_ENABLED, JarraipenImpl.class, FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findAll", new String[0]); public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL = new FinderPath(JarraipenModelImpl.ENTITY_CACHE_ENABLED, JarraipenModelImpl.FINDER_CACHE_ENABLED, JarraipenImpl.class, FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findAll", new String[0]); public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(JarraipenModelImpl.ENTITY_CACHE_ENABLED, JarraipenModelImpl.FINDER_CACHE_ENABLED, Long.class, FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countAll", new String[0]); /** * Caches the jarraipen in the entity cache if it is enabled. * * @param jarraipen the jarraipen */ public void cacheResult(Jarraipen jarraipen) { EntityCacheUtil.putResult(JarraipenModelImpl.ENTITY_CACHE_ENABLED, JarraipenImpl.class, jarraipen.getPrimaryKey(), jarraipen); jarraipen.resetOriginalValues(); } /** * Caches the jarraipens in the entity cache if it is enabled. * * @param jarraipens the jarraipens */ public void cacheResult(List<Jarraipen> jarraipens) { for (Jarraipen jarraipen : jarraipens) { if (EntityCacheUtil.getResult( JarraipenModelImpl.ENTITY_CACHE_ENABLED, JarraipenImpl.class, jarraipen.getPrimaryKey()) == null) { cacheResult(jarraipen); } else { jarraipen.resetOriginalValues(); } } } /** * Clears the cache for all jarraipens. * * <p> * The {@link com.liferay.portal.kernel.dao.orm.EntityCache} and {@link com.liferay.portal.kernel.dao.orm.FinderCache} are both cleared by this method. * </p> */ @Override public void clearCache() { if (_HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE) { CacheRegistryUtil.clear(JarraipenImpl.class.getName()); } EntityCacheUtil.clearCache(JarraipenImpl.class.getName()); FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY); FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION); FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION); } /** * Clears the cache for the jarraipen. * * <p> * The {@link com.liferay.portal.kernel.dao.orm.EntityCache} and {@link com.liferay.portal.kernel.dao.orm.FinderCache} are both cleared by this method. * </p> */ @Override public void clearCache(Jarraipen jarraipen) { EntityCacheUtil.removeResult(JarraipenModelImpl.ENTITY_CACHE_ENABLED, JarraipenImpl.class, jarraipen.getPrimaryKey()); FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION); FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION); } @Override public void clearCache(List<Jarraipen> jarraipens) { FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION); FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION); for (Jarraipen jarraipen : jarraipens) { EntityCacheUtil.removeResult(JarraipenModelImpl.ENTITY_CACHE_ENABLED, JarraipenImpl.class, jarraipen.getPrimaryKey()); } } /** * Creates a new jarraipen with the primary key. Does not add the jarraipen to the database. * * @param jarraipenId the primary key for the new jarraipen * @return the new jarraipen */ public Jarraipen create(long jarraipenId) { Jarraipen jarraipen = new JarraipenImpl(); jarraipen.setNew(true); jarraipen.setPrimaryKey(jarraipenId); return jarraipen; } /** * Removes the jarraipen with the primary key from the database. Also notifies the appropriate model listeners. * * @param jarraipenId the primary key of the jarraipen * @return the jarraipen that was removed * @throws net.sareweb.txotx.NoSuchJarraipenException if a jarraipen with the primary key could not be found * @throws SystemException if a system exception occurred */ public Jarraipen remove(long jarraipenId) throws NoSuchJarraipenException, SystemException { return remove(Long.valueOf(jarraipenId)); } /** * Removes the jarraipen with the primary key from the database. Also notifies the appropriate model listeners. * * @param primaryKey the primary key of the jarraipen * @return the jarraipen that was removed * @throws net.sareweb.txotx.NoSuchJarraipenException if a jarraipen with the primary key could not be found * @throws SystemException if a system exception occurred */ @Override public Jarraipen remove(Serializable primaryKey) throws NoSuchJarraipenException, SystemException { Session session = null; try { session = openSession(); Jarraipen jarraipen = (Jarraipen)session.get(JarraipenImpl.class, primaryKey); if (jarraipen == null) { if (_log.isWarnEnabled()) { _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey); } throw new NoSuchJarraipenException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey); } return remove(jarraipen); } catch (NoSuchJarraipenException nsee) { throw nsee; } catch (Exception e) { throw processException(e); } finally { closeSession(session); } } @Override protected Jarraipen removeImpl(Jarraipen jarraipen) throws SystemException { jarraipen = toUnwrappedModel(jarraipen); Session session = null; try { session = openSession(); BatchSessionUtil.delete(session, jarraipen); } catch (Exception e) { throw processException(e); } finally { closeSession(session); } clearCache(jarraipen); return jarraipen; } @Override public Jarraipen updateImpl(net.sareweb.txotx.model.Jarraipen jarraipen, boolean merge) throws SystemException { jarraipen = toUnwrappedModel(jarraipen); boolean isNew = jarraipen.isNew(); JarraipenModelImpl jarraipenModelImpl = (JarraipenModelImpl)jarraipen; Session session = null; try { session = openSession(); BatchSessionUtil.update(session, jarraipen, merge); jarraipen.setNew(false); } catch (Exception e) { throw processException(e); } finally { closeSession(session); } FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION); if (isNew || !JarraipenModelImpl.COLUMN_BITMASK_ENABLED) { FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION); } else { if ((jarraipenModelImpl.getColumnBitmask() & FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_JARRAITZAILEUSERID.getColumnBitmask()) != 0) { Object[] args = new Object[] { Long.valueOf(jarraipenModelImpl.getOriginalJarraitzaileUserId()) }; FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_JARRAITZAILEUSERID, args); FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_JARRAITZAILEUSERID, args); args = new Object[] { Long.valueOf(jarraipenModelImpl.getJarraitzaileUserId()) }; FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_JARRAITZAILEUSERID, args); FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_JARRAITZAILEUSERID, args); } if ((jarraipenModelImpl.getColumnBitmask() & FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_JARRAITUAID.getColumnBitmask()) != 0) { Object[] args = new Object[] { Long.valueOf(jarraipenModelImpl.getOriginalJarraituaId()) }; FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_JARRAITUAID, args); FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_JARRAITUAID, args); args = new Object[] { Long.valueOf(jarraipenModelImpl.getJarraituaId()) }; FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_JARRAITUAID, args); FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_JARRAITUAID, args); } } EntityCacheUtil.putResult(JarraipenModelImpl.ENTITY_CACHE_ENABLED, JarraipenImpl.class, jarraipen.getPrimaryKey(), jarraipen); return jarraipen; } protected Jarraipen toUnwrappedModel(Jarraipen jarraipen) { if (jarraipen instanceof JarraipenImpl) { return jarraipen; } JarraipenImpl jarraipenImpl = new JarraipenImpl(); jarraipenImpl.setNew(jarraipen.isNew()); jarraipenImpl.setPrimaryKey(jarraipen.getPrimaryKey()); jarraipenImpl.setJarraipenId(jarraipen.getJarraipenId()); jarraipenImpl.setJarraitzaileUserId(jarraipen.getJarraitzaileUserId()); jarraipenImpl.setJarraituaId(jarraipen.getJarraituaId()); jarraipenImpl.setJarraipenMota(jarraipen.getJarraipenMota()); jarraipenImpl.setCreateDate(jarraipen.getCreateDate()); return jarraipenImpl; } /** * Returns the jarraipen with the primary key or throws a {@link com.liferay.portal.NoSuchModelException} if it could not be found. * * @param primaryKey the primary key of the jarraipen * @return the jarraipen * @throws com.liferay.portal.NoSuchModelException if a jarraipen with the primary key could not be found * @throws SystemException if a system exception occurred */ @Override public Jarraipen findByPrimaryKey(Serializable primaryKey) throws NoSuchModelException, SystemException { return findByPrimaryKey(((Long)primaryKey).longValue()); } /** * Returns the jarraipen with the primary key or throws a {@link net.sareweb.txotx.NoSuchJarraipenException} if it could not be found. * * @param jarraipenId the primary key of the jarraipen * @return the jarraipen * @throws net.sareweb.txotx.NoSuchJarraipenException if a jarraipen with the primary key could not be found * @throws SystemException if a system exception occurred */ public Jarraipen findByPrimaryKey(long jarraipenId) throws NoSuchJarraipenException, SystemException { Jarraipen jarraipen = fetchByPrimaryKey(jarraipenId); if (jarraipen == null) { if (_log.isWarnEnabled()) { _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + jarraipenId); } throw new NoSuchJarraipenException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + jarraipenId); } return jarraipen; } /** * Returns the jarraipen with the primary key or returns <code>null</code> if it could not be found. * * @param primaryKey the primary key of the jarraipen * @return the jarraipen, or <code>null</code> if a jarraipen with the primary key could not be found * @throws SystemException if a system exception occurred */ @Override public Jarraipen fetchByPrimaryKey(Serializable primaryKey) throws SystemException { return fetchByPrimaryKey(((Long)primaryKey).longValue()); } /** * Returns the jarraipen with the primary key or returns <code>null</code> if it could not be found. * * @param jarraipenId the primary key of the jarraipen * @return the jarraipen, or <code>null</code> if a jarraipen with the primary key could not be found * @throws SystemException if a system exception occurred */ public Jarraipen fetchByPrimaryKey(long jarraipenId) throws SystemException { Jarraipen jarraipen = (Jarraipen)EntityCacheUtil.getResult(JarraipenModelImpl.ENTITY_CACHE_ENABLED, JarraipenImpl.class, jarraipenId); if (jarraipen == _nullJarraipen) { return null; } if (jarraipen == null) { Session session = null; boolean hasException = false; try { session = openSession(); jarraipen = (Jarraipen)session.get(JarraipenImpl.class, Long.valueOf(jarraipenId)); } catch (Exception e) { hasException = true; throw processException(e); } finally { if (jarraipen != null) { cacheResult(jarraipen); } else if (!hasException) { EntityCacheUtil.putResult(JarraipenModelImpl.ENTITY_CACHE_ENABLED, JarraipenImpl.class, jarraipenId, _nullJarraipen); } closeSession(session); } } return jarraipen; } /** * Returns all the jarraipens where jarraitzaileUserId = &#63;. * * @param jarraitzaileUserId the jarraitzaile user ID * @return the matching jarraipens * @throws SystemException if a system exception occurred */ public List<Jarraipen> findByJarraitzaileUserId(long jarraitzaileUserId) throws SystemException { return findByJarraitzaileUserId(jarraitzaileUserId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); } /** * Returns a range of all the jarraipens where jarraitzaileUserId = &#63;. * * <p> * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. * </p> * * @param jarraitzaileUserId the jarraitzaile user ID * @param start the lower bound of the range of jarraipens * @param end the upper bound of the range of jarraipens (not inclusive) * @return the range of matching jarraipens * @throws SystemException if a system exception occurred */ public List<Jarraipen> findByJarraitzaileUserId(long jarraitzaileUserId, int start, int end) throws SystemException { return findByJarraitzaileUserId(jarraitzaileUserId, start, end, null); } /** * Returns an ordered range of all the jarraipens where jarraitzaileUserId = &#63;. * * <p> * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. * </p> * * @param jarraitzaileUserId the jarraitzaile user ID * @param start the lower bound of the range of jarraipens * @param end the upper bound of the range of jarraipens (not inclusive) * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) * @return the ordered range of matching jarraipens * @throws SystemException if a system exception occurred */ public List<Jarraipen> findByJarraitzaileUserId(long jarraitzaileUserId, int start, int end, OrderByComparator orderByComparator) throws SystemException { FinderPath finderPath = null; Object[] finderArgs = null; if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) && (orderByComparator == null)) { finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_JARRAITZAILEUSERID; finderArgs = new Object[] { jarraitzaileUserId }; } else { finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_JARRAITZAILEUSERID; finderArgs = new Object[] { jarraitzaileUserId, start, end, orderByComparator }; } List<Jarraipen> list = (List<Jarraipen>)FinderCacheUtil.getResult(finderPath, finderArgs, this); if ((list != null) && !list.isEmpty()) { for (Jarraipen jarraipen : list) { if ((jarraitzaileUserId != jarraipen.getJarraitzaileUserId())) { list = null; break; } } } if (list == null) { StringBundler query = null; if (orderByComparator != null) { query = new StringBundler(3 + (orderByComparator.getOrderByFields().length * 3)); } else { query = new StringBundler(3); } query.append(_SQL_SELECT_JARRAIPEN_WHERE); query.append(_FINDER_COLUMN_JARRAITZAILEUSERID_JARRAITZAILEUSERID_2); if (orderByComparator != null) { appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, orderByComparator); } else { query.append(JarraipenModelImpl.ORDER_BY_JPQL); } String sql = query.toString(); Session session = null; try { session = openSession(); Query q = session.createQuery(sql); QueryPos qPos = QueryPos.getInstance(q); qPos.add(jarraitzaileUserId); list = (List<Jarraipen>)QueryUtil.list(q, getDialect(), start, end); } catch (Exception e) { throw processException(e); } finally { if (list == null) { FinderCacheUtil.removeResult(finderPath, finderArgs); } else { cacheResult(list); FinderCacheUtil.putResult(finderPath, finderArgs, list); } closeSession(session); } } return list; } /** * Returns the first jarraipen in the ordered set where jarraitzaileUserId = &#63;. * * @param jarraitzaileUserId the jarraitzaile user ID * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) * @return the first matching jarraipen * @throws net.sareweb.txotx.NoSuchJarraipenException if a matching jarraipen could not be found * @throws SystemException if a system exception occurred */ public Jarraipen findByJarraitzaileUserId_First(long jarraitzaileUserId, OrderByComparator orderByComparator) throws NoSuchJarraipenException, SystemException { Jarraipen jarraipen = fetchByJarraitzaileUserId_First(jarraitzaileUserId, orderByComparator); if (jarraipen != null) { return jarraipen; } StringBundler msg = new StringBundler(4); msg.append(_NO_SUCH_ENTITY_WITH_KEY); msg.append("jarraitzaileUserId="); msg.append(jarraitzaileUserId); msg.append(StringPool.CLOSE_CURLY_BRACE); throw new NoSuchJarraipenException(msg.toString()); } /** * Returns the first jarraipen in the ordered set where jarraitzaileUserId = &#63;. * * @param jarraitzaileUserId the jarraitzaile user ID * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) * @return the first matching jarraipen, or <code>null</code> if a matching jarraipen could not be found * @throws SystemException if a system exception occurred */ public Jarraipen fetchByJarraitzaileUserId_First(long jarraitzaileUserId, OrderByComparator orderByComparator) throws SystemException { List<Jarraipen> list = findByJarraitzaileUserId(jarraitzaileUserId, 0, 1, orderByComparator); if (!list.isEmpty()) { return list.get(0); } return null; } /** * Returns the last jarraipen in the ordered set where jarraitzaileUserId = &#63;. * * @param jarraitzaileUserId the jarraitzaile user ID * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) * @return the last matching jarraipen * @throws net.sareweb.txotx.NoSuchJarraipenException if a matching jarraipen could not be found * @throws SystemException if a system exception occurred */ public Jarraipen findByJarraitzaileUserId_Last(long jarraitzaileUserId, OrderByComparator orderByComparator) throws NoSuchJarraipenException, SystemException { Jarraipen jarraipen = fetchByJarraitzaileUserId_Last(jarraitzaileUserId, orderByComparator); if (jarraipen != null) { return jarraipen; } StringBundler msg = new StringBundler(4); msg.append(_NO_SUCH_ENTITY_WITH_KEY); msg.append("jarraitzaileUserId="); msg.append(jarraitzaileUserId); msg.append(StringPool.CLOSE_CURLY_BRACE); throw new NoSuchJarraipenException(msg.toString()); } /** * Returns the last jarraipen in the ordered set where jarraitzaileUserId = &#63;. * * @param jarraitzaileUserId the jarraitzaile user ID * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) * @return the last matching jarraipen, or <code>null</code> if a matching jarraipen could not be found * @throws SystemException if a system exception occurred */ public Jarraipen fetchByJarraitzaileUserId_Last(long jarraitzaileUserId, OrderByComparator orderByComparator) throws SystemException { int count = countByJarraitzaileUserId(jarraitzaileUserId); List<Jarraipen> list = findByJarraitzaileUserId(jarraitzaileUserId, count - 1, count, orderByComparator); if (!list.isEmpty()) { return list.get(0); } return null; } /** * Returns the jarraipens before and after the current jarraipen in the ordered set where jarraitzaileUserId = &#63;. * * @param jarraipenId the primary key of the current jarraipen * @param jarraitzaileUserId the jarraitzaile user ID * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) * @return the previous, current, and next jarraipen * @throws net.sareweb.txotx.NoSuchJarraipenException if a jarraipen with the primary key could not be found * @throws SystemException if a system exception occurred */ public Jarraipen[] findByJarraitzaileUserId_PrevAndNext(long jarraipenId, long jarraitzaileUserId, OrderByComparator orderByComparator) throws NoSuchJarraipenException, SystemException { Jarraipen jarraipen = findByPrimaryKey(jarraipenId); Session session = null; try { session = openSession(); Jarraipen[] array = new JarraipenImpl[3]; array[0] = getByJarraitzaileUserId_PrevAndNext(session, jarraipen, jarraitzaileUserId, orderByComparator, true); array[1] = jarraipen; array[2] = getByJarraitzaileUserId_PrevAndNext(session, jarraipen, jarraitzaileUserId, orderByComparator, false); return array; } catch (Exception e) { throw processException(e); } finally { closeSession(session); } } protected Jarraipen getByJarraitzaileUserId_PrevAndNext(Session session, Jarraipen jarraipen, long jarraitzaileUserId, OrderByComparator orderByComparator, boolean previous) { StringBundler query = null; if (orderByComparator != null) { query = new StringBundler(6 + (orderByComparator.getOrderByFields().length * 6)); } else { query = new StringBundler(3); } query.append(_SQL_SELECT_JARRAIPEN_WHERE); query.append(_FINDER_COLUMN_JARRAITZAILEUSERID_JARRAITZAILEUSERID_2); if (orderByComparator != null) { String[] orderByConditionFields = orderByComparator.getOrderByConditionFields(); if (orderByConditionFields.length > 0) { query.append(WHERE_AND); } for (int i = 0; i < orderByConditionFields.length; i++) { query.append(_ORDER_BY_ENTITY_ALIAS); query.append(orderByConditionFields[i]); if ((i + 1) < orderByConditionFields.length) { if (orderByComparator.isAscending() ^ previous) { query.append(WHERE_GREATER_THAN_HAS_NEXT); } else { query.append(WHERE_LESSER_THAN_HAS_NEXT); } } else { if (orderByComparator.isAscending() ^ previous) { query.append(WHERE_GREATER_THAN); } else { query.append(WHERE_LESSER_THAN); } } } query.append(ORDER_BY_CLAUSE); String[] orderByFields = orderByComparator.getOrderByFields(); for (int i = 0; i < orderByFields.length; i++) { query.append(_ORDER_BY_ENTITY_ALIAS); query.append(orderByFields[i]); if ((i + 1) < orderByFields.length) { if (orderByComparator.isAscending() ^ previous) { query.append(ORDER_BY_ASC_HAS_NEXT); } else { query.append(ORDER_BY_DESC_HAS_NEXT); } } else { if (orderByComparator.isAscending() ^ previous) { query.append(ORDER_BY_ASC); } else { query.append(ORDER_BY_DESC); } } } } else { query.append(JarraipenModelImpl.ORDER_BY_JPQL); } String sql = query.toString(); Query q = session.createQuery(sql); q.setFirstResult(0); q.setMaxResults(2); QueryPos qPos = QueryPos.getInstance(q); qPos.add(jarraitzaileUserId); if (orderByComparator != null) { Object[] values = orderByComparator.getOrderByConditionValues(jarraipen); for (Object value : values) { qPos.add(value); } } List<Jarraipen> list = q.list(); if (list.size() == 2) { return list.get(1); } else { return null; } } /** * Returns all the jarraipens where jarraituaId = &#63;. * * @param jarraituaId the jarraitua ID * @return the matching jarraipens * @throws SystemException if a system exception occurred */ public List<Jarraipen> findByJarraituaId(long jarraituaId) throws SystemException { return findByJarraituaId(jarraituaId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); } /** * Returns a range of all the jarraipens where jarraituaId = &#63;. * * <p> * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. * </p> * * @param jarraituaId the jarraitua ID * @param start the lower bound of the range of jarraipens * @param end the upper bound of the range of jarraipens (not inclusive) * @return the range of matching jarraipens * @throws SystemException if a system exception occurred */ public List<Jarraipen> findByJarraituaId(long jarraituaId, int start, int end) throws SystemException { return findByJarraituaId(jarraituaId, start, end, null); } /** * Returns an ordered range of all the jarraipens where jarraituaId = &#63;. * * <p> * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. * </p> * * @param jarraituaId the jarraitua ID * @param start the lower bound of the range of jarraipens * @param end the upper bound of the range of jarraipens (not inclusive) * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) * @return the ordered range of matching jarraipens * @throws SystemException if a system exception occurred */ public List<Jarraipen> findByJarraituaId(long jarraituaId, int start, int end, OrderByComparator orderByComparator) throws SystemException { FinderPath finderPath = null; Object[] finderArgs = null; if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) && (orderByComparator == null)) { finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_JARRAITUAID; finderArgs = new Object[] { jarraituaId }; } else { finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_JARRAITUAID; finderArgs = new Object[] { jarraituaId, start, end, orderByComparator }; } List<Jarraipen> list = (List<Jarraipen>)FinderCacheUtil.getResult(finderPath, finderArgs, this); if ((list != null) && !list.isEmpty()) { for (Jarraipen jarraipen : list) { if ((jarraituaId != jarraipen.getJarraituaId())) { list = null; break; } } } if (list == null) { StringBundler query = null; if (orderByComparator != null) { query = new StringBundler(3 + (orderByComparator.getOrderByFields().length * 3)); } else { query = new StringBundler(3); } query.append(_SQL_SELECT_JARRAIPEN_WHERE); query.append(_FINDER_COLUMN_JARRAITUAID_JARRAITUAID_2); if (orderByComparator != null) { appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, orderByComparator); } else { query.append(JarraipenModelImpl.ORDER_BY_JPQL); } String sql = query.toString(); Session session = null; try { session = openSession(); Query q = session.createQuery(sql); QueryPos qPos = QueryPos.getInstance(q); qPos.add(jarraituaId); list = (List<Jarraipen>)QueryUtil.list(q, getDialect(), start, end); } catch (Exception e) { throw processException(e); } finally { if (list == null) { FinderCacheUtil.removeResult(finderPath, finderArgs); } else { cacheResult(list); FinderCacheUtil.putResult(finderPath, finderArgs, list); } closeSession(session); } } return list; } /** * Returns the first jarraipen in the ordered set where jarraituaId = &#63;. * * @param jarraituaId the jarraitua ID * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) * @return the first matching jarraipen * @throws net.sareweb.txotx.NoSuchJarraipenException if a matching jarraipen could not be found * @throws SystemException if a system exception occurred */ public Jarraipen findByJarraituaId_First(long jarraituaId, OrderByComparator orderByComparator) throws NoSuchJarraipenException, SystemException { Jarraipen jarraipen = fetchByJarraituaId_First(jarraituaId, orderByComparator); if (jarraipen != null) { return jarraipen; } StringBundler msg = new StringBundler(4); msg.append(_NO_SUCH_ENTITY_WITH_KEY); msg.append("jarraituaId="); msg.append(jarraituaId); msg.append(StringPool.CLOSE_CURLY_BRACE); throw new NoSuchJarraipenException(msg.toString()); } /** * Returns the first jarraipen in the ordered set where jarraituaId = &#63;. * * @param jarraituaId the jarraitua ID * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) * @return the first matching jarraipen, or <code>null</code> if a matching jarraipen could not be found * @throws SystemException if a system exception occurred */ public Jarraipen fetchByJarraituaId_First(long jarraituaId, OrderByComparator orderByComparator) throws SystemException { List<Jarraipen> list = findByJarraituaId(jarraituaId, 0, 1, orderByComparator); if (!list.isEmpty()) { return list.get(0); } return null; } /** * Returns the last jarraipen in the ordered set where jarraituaId = &#63;. * * @param jarraituaId the jarraitua ID * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) * @return the last matching jarraipen * @throws net.sareweb.txotx.NoSuchJarraipenException if a matching jarraipen could not be found * @throws SystemException if a system exception occurred */ public Jarraipen findByJarraituaId_Last(long jarraituaId, OrderByComparator orderByComparator) throws NoSuchJarraipenException, SystemException { Jarraipen jarraipen = fetchByJarraituaId_Last(jarraituaId, orderByComparator); if (jarraipen != null) { return jarraipen; } StringBundler msg = new StringBundler(4); msg.append(_NO_SUCH_ENTITY_WITH_KEY); msg.append("jarraituaId="); msg.append(jarraituaId); msg.append(StringPool.CLOSE_CURLY_BRACE); throw new NoSuchJarraipenException(msg.toString()); } /** * Returns the last jarraipen in the ordered set where jarraituaId = &#63;. * * @param jarraituaId the jarraitua ID * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) * @return the last matching jarraipen, or <code>null</code> if a matching jarraipen could not be found * @throws SystemException if a system exception occurred */ public Jarraipen fetchByJarraituaId_Last(long jarraituaId, OrderByComparator orderByComparator) throws SystemException { int count = countByJarraituaId(jarraituaId); List<Jarraipen> list = findByJarraituaId(jarraituaId, count - 1, count, orderByComparator); if (!list.isEmpty()) { return list.get(0); } return null; } /** * Returns the jarraipens before and after the current jarraipen in the ordered set where jarraituaId = &#63;. * * @param jarraipenId the primary key of the current jarraipen * @param jarraituaId the jarraitua ID * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) * @return the previous, current, and next jarraipen * @throws net.sareweb.txotx.NoSuchJarraipenException if a jarraipen with the primary key could not be found * @throws SystemException if a system exception occurred */ public Jarraipen[] findByJarraituaId_PrevAndNext(long jarraipenId, long jarraituaId, OrderByComparator orderByComparator) throws NoSuchJarraipenException, SystemException { Jarraipen jarraipen = findByPrimaryKey(jarraipenId); Session session = null; try { session = openSession(); Jarraipen[] array = new JarraipenImpl[3]; array[0] = getByJarraituaId_PrevAndNext(session, jarraipen, jarraituaId, orderByComparator, true); array[1] = jarraipen; array[2] = getByJarraituaId_PrevAndNext(session, jarraipen, jarraituaId, orderByComparator, false); return array; } catch (Exception e) { throw processException(e); } finally { closeSession(session); } } protected Jarraipen getByJarraituaId_PrevAndNext(Session session, Jarraipen jarraipen, long jarraituaId, OrderByComparator orderByComparator, boolean previous) { StringBundler query = null; if (orderByComparator != null) { query = new StringBundler(6 + (orderByComparator.getOrderByFields().length * 6)); } else { query = new StringBundler(3); } query.append(_SQL_SELECT_JARRAIPEN_WHERE); query.append(_FINDER_COLUMN_JARRAITUAID_JARRAITUAID_2); if (orderByComparator != null) { String[] orderByConditionFields = orderByComparator.getOrderByConditionFields(); if (orderByConditionFields.length > 0) { query.append(WHERE_AND); } for (int i = 0; i < orderByConditionFields.length; i++) { query.append(_ORDER_BY_ENTITY_ALIAS); query.append(orderByConditionFields[i]); if ((i + 1) < orderByConditionFields.length) { if (orderByComparator.isAscending() ^ previous) { query.append(WHERE_GREATER_THAN_HAS_NEXT); } else { query.append(WHERE_LESSER_THAN_HAS_NEXT); } } else { if (orderByComparator.isAscending() ^ previous) { query.append(WHERE_GREATER_THAN); } else { query.append(WHERE_LESSER_THAN); } } } query.append(ORDER_BY_CLAUSE); String[] orderByFields = orderByComparator.getOrderByFields(); for (int i = 0; i < orderByFields.length; i++) { query.append(_ORDER_BY_ENTITY_ALIAS); query.append(orderByFields[i]); if ((i + 1) < orderByFields.length) { if (orderByComparator.isAscending() ^ previous) { query.append(ORDER_BY_ASC_HAS_NEXT); } else { query.append(ORDER_BY_DESC_HAS_NEXT); } } else { if (orderByComparator.isAscending() ^ previous) { query.append(ORDER_BY_ASC); } else { query.append(ORDER_BY_DESC); } } } } else { query.append(JarraipenModelImpl.ORDER_BY_JPQL); } String sql = query.toString(); Query q = session.createQuery(sql); q.setFirstResult(0); q.setMaxResults(2); QueryPos qPos = QueryPos.getInstance(q); qPos.add(jarraituaId); if (orderByComparator != null) { Object[] values = orderByComparator.getOrderByConditionValues(jarraipen); for (Object value : values) { qPos.add(value); } } List<Jarraipen> list = q.list(); if (list.size() == 2) { return list.get(1); } else { return null; } } /** * Returns all the jarraipens. * * @return the jarraipens * @throws SystemException if a system exception occurred */ public List<Jarraipen> findAll() throws SystemException { return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); } /** * Returns a range of all the jarraipens. * * <p> * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. * </p> * * @param start the lower bound of the range of jarraipens * @param end the upper bound of the range of jarraipens (not inclusive) * @return the range of jarraipens * @throws SystemException if a system exception occurred */ public List<Jarraipen> findAll(int start, int end) throws SystemException { return findAll(start, end, null); } /** * Returns an ordered range of all the jarraipens. * * <p> * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. * </p> * * @param start the lower bound of the range of jarraipens * @param end the upper bound of the range of jarraipens (not inclusive) * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) * @return the ordered range of jarraipens * @throws SystemException if a system exception occurred */ public List<Jarraipen> findAll(int start, int end, OrderByComparator orderByComparator) throws SystemException { FinderPath finderPath = null; Object[] finderArgs = new Object[] { start, end, orderByComparator }; if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) && (orderByComparator == null)) { finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL; finderArgs = FINDER_ARGS_EMPTY; } else { finderPath = FINDER_PATH_WITH_PAGINATION_FIND_ALL; finderArgs = new Object[] { start, end, orderByComparator }; } List<Jarraipen> list = (List<Jarraipen>)FinderCacheUtil.getResult(finderPath, finderArgs, this); if (list == null) { StringBundler query = null; String sql = null; if (orderByComparator != null) { query = new StringBundler(2 + (orderByComparator.getOrderByFields().length * 3)); query.append(_SQL_SELECT_JARRAIPEN); appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, orderByComparator); sql = query.toString(); } else { sql = _SQL_SELECT_JARRAIPEN.concat(JarraipenModelImpl.ORDER_BY_JPQL); } Session session = null; try { session = openSession(); Query q = session.createQuery(sql); if (orderByComparator == null) { list = (List<Jarraipen>)QueryUtil.list(q, getDialect(), start, end, false); Collections.sort(list); } else { list = (List<Jarraipen>)QueryUtil.list(q, getDialect(), start, end); } } catch (Exception e) { throw processException(e); } finally { if (list == null) { FinderCacheUtil.removeResult(finderPath, finderArgs); } else { cacheResult(list); FinderCacheUtil.putResult(finderPath, finderArgs, list); } closeSession(session); } } return list; } /** * Removes all the jarraipens where jarraitzaileUserId = &#63; from the database. * * @param jarraitzaileUserId the jarraitzaile user ID * @throws SystemException if a system exception occurred */ public void removeByJarraitzaileUserId(long jarraitzaileUserId) throws SystemException { for (Jarraipen jarraipen : findByJarraitzaileUserId(jarraitzaileUserId)) { remove(jarraipen); } } /** * Removes all the jarraipens where jarraituaId = &#63; from the database. * * @param jarraituaId the jarraitua ID * @throws SystemException if a system exception occurred */ public void removeByJarraituaId(long jarraituaId) throws SystemException { for (Jarraipen jarraipen : findByJarraituaId(jarraituaId)) { remove(jarraipen); } } /** * Removes all the jarraipens from the database. * * @throws SystemException if a system exception occurred */ public void removeAll() throws SystemException { for (Jarraipen jarraipen : findAll()) { remove(jarraipen); } } /** * Returns the number of jarraipens where jarraitzaileUserId = &#63;. * * @param jarraitzaileUserId the jarraitzaile user ID * @return the number of matching jarraipens * @throws SystemException if a system exception occurred */ public int countByJarraitzaileUserId(long jarraitzaileUserId) throws SystemException { Object[] finderArgs = new Object[] { jarraitzaileUserId }; Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_JARRAITZAILEUSERID, finderArgs, this); if (count == null) { StringBundler query = new StringBundler(2); query.append(_SQL_COUNT_JARRAIPEN_WHERE); query.append(_FINDER_COLUMN_JARRAITZAILEUSERID_JARRAITZAILEUSERID_2); String sql = query.toString(); Session session = null; try { session = openSession(); Query q = session.createQuery(sql); QueryPos qPos = QueryPos.getInstance(q); qPos.add(jarraitzaileUserId); count = (Long)q.uniqueResult(); } catch (Exception e) { throw processException(e); } finally { if (count == null) { count = Long.valueOf(0); } FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_JARRAITZAILEUSERID, finderArgs, count); closeSession(session); } } return count.intValue(); } /** * Returns the number of jarraipens where jarraituaId = &#63;. * * @param jarraituaId the jarraitua ID * @return the number of matching jarraipens * @throws SystemException if a system exception occurred */ public int countByJarraituaId(long jarraituaId) throws SystemException { Object[] finderArgs = new Object[] { jarraituaId }; Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_JARRAITUAID, finderArgs, this); if (count == null) { StringBundler query = new StringBundler(2); query.append(_SQL_COUNT_JARRAIPEN_WHERE); query.append(_FINDER_COLUMN_JARRAITUAID_JARRAITUAID_2); String sql = query.toString(); Session session = null; try { session = openSession(); Query q = session.createQuery(sql); QueryPos qPos = QueryPos.getInstance(q); qPos.add(jarraituaId); count = (Long)q.uniqueResult(); } catch (Exception e) { throw processException(e); } finally { if (count == null) { count = Long.valueOf(0); } FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_JARRAITUAID, finderArgs, count); closeSession(session); } } return count.intValue(); } /** * Returns the number of jarraipens. * * @return the number of jarraipens * @throws SystemException if a system exception occurred */ public int countAll() throws SystemException { Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL, FINDER_ARGS_EMPTY, this); if (count == null) { Session session = null; try { session = openSession(); Query q = session.createQuery(_SQL_COUNT_JARRAIPEN); count = (Long)q.uniqueResult(); } catch (Exception e) { throw processException(e); } finally { if (count == null) { count = Long.valueOf(0); } FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL, FINDER_ARGS_EMPTY, count); closeSession(session); } } return count.intValue(); } /** * Initializes the jarraipen persistence. */ public void afterPropertiesSet() { String[] listenerClassNames = StringUtil.split(GetterUtil.getString( com.liferay.util.service.ServiceProps.get( "value.object.listener.net.sareweb.txotx.model.Jarraipen"))); if (listenerClassNames.length > 0) { try { List<ModelListener<Jarraipen>> listenersList = new ArrayList<ModelListener<Jarraipen>>(); for (String listenerClassName : listenerClassNames) { listenersList.add((ModelListener<Jarraipen>)InstanceFactory.newInstance( listenerClassName)); } listeners = listenersList.toArray(new ModelListener[listenersList.size()]); } catch (Exception e) { _log.error(e); } } } public void destroy() { EntityCacheUtil.removeCache(JarraipenImpl.class.getName()); FinderCacheUtil.removeCache(FINDER_CLASS_NAME_ENTITY); FinderCacheUtil.removeCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION); } @BeanReference(type = APKVersionPersistence.class) protected APKVersionPersistence apkVersionPersistence; @BeanReference(type = GertaeraPersistence.class) protected GertaeraPersistence gertaeraPersistence; @BeanReference(type = GoogleDevicePersistence.class) protected GoogleDevicePersistence googleDevicePersistence; @BeanReference(type = JarraipenPersistence.class) protected JarraipenPersistence jarraipenPersistence; @BeanReference(type = OharraPersistence.class) protected OharraPersistence oharraPersistence; @BeanReference(type = SagardoEgunPersistence.class) protected SagardoEgunPersistence sagardoEgunPersistence; @BeanReference(type = SagardotegiPersistence.class) protected SagardotegiPersistence sagardotegiPersistence; @BeanReference(type = SailkapenaPersistence.class) protected SailkapenaPersistence sailkapenaPersistence; @BeanReference(type = ResourcePersistence.class) protected ResourcePersistence resourcePersistence; @BeanReference(type = UserPersistence.class) protected UserPersistence userPersistence; private static final String _SQL_SELECT_JARRAIPEN = "SELECT jarraipen FROM Jarraipen jarraipen"; private static final String _SQL_SELECT_JARRAIPEN_WHERE = "SELECT jarraipen FROM Jarraipen jarraipen WHERE "; private static final String _SQL_COUNT_JARRAIPEN = "SELECT COUNT(jarraipen) FROM Jarraipen jarraipen"; private static final String _SQL_COUNT_JARRAIPEN_WHERE = "SELECT COUNT(jarraipen) FROM Jarraipen jarraipen WHERE "; private static final String _FINDER_COLUMN_JARRAITZAILEUSERID_JARRAITZAILEUSERID_2 = "jarraipen.jarraitzaileUserId = ?"; private static final String _FINDER_COLUMN_JARRAITUAID_JARRAITUAID_2 = "jarraipen.jarraituaId = ?"; private static final String _ORDER_BY_ENTITY_ALIAS = "jarraipen."; private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No Jarraipen exists with the primary key "; private static final String _NO_SUCH_ENTITY_WITH_KEY = "No Jarraipen exists with the key {"; private static final boolean _HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE = GetterUtil.getBoolean(PropsUtil.get( PropsKeys.HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE)); private static Log _log = LogFactoryUtil.getLog(JarraipenPersistenceImpl.class); private static Jarraipen _nullJarraipen = new JarraipenImpl() { @Override public Object clone() { return this; } @Override public CacheModel<Jarraipen> toCacheModel() { return _nullJarraipenCacheModel; } }; private static CacheModel<Jarraipen> _nullJarraipenCacheModel = new CacheModel<Jarraipen>() { public Jarraipen toEntityModel() { return _nullJarraipen; } }; }
[ "galdos.aritz@gmail.com" ]
galdos.aritz@gmail.com
a10299b8abc25a5fd09e0c8e1e015828bc688fe6
98726e588ee57deb371154be66cffc956f54ca53
/service/service_cmn/src/main/java/com/syt/yygh/cmn/config/CmnConfig.java
9d5f045c44e9489901a237e3a5d5b9e5f6543dde
[]
no_license
wangd1/yygh_parent
08ef29b12fb87095ee676ae136eb32b2235f7287
4005a7e86a5dbb0001012d9d538fd27ff83db7c2
refs/heads/master
2023-04-05T10:41:10.211529
2021-04-17T08:06:36
2021-04-17T08:06:36
346,733,426
1
0
null
null
null
null
UTF-8
Java
false
false
518
java
package com.syt.yygh.cmn.config; import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; import org.mybatis.spring.annotation.MapperScan; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; /** * @Author: wangdi * @Date: 2021/3/11 */ @Configuration @MapperScan("com.syt.yygh.cmn.mapper") public class CmnConfig { @Bean public PaginationInterceptor paginationInterceptor(){ return new PaginationInterceptor(); } }
[ "wangdi1208i@gmail.com" ]
wangdi1208i@gmail.com