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
ed0beb15f56a6e1d5339eca74adf59eaa6c7cf1b
9b79132c4c5566ac8c2ca6f40f5882f32636b5ca
/src/main/java/wisdom21/model/system/mapper/UserMapper.java
89e945277dd863cbd17160df80581f60de53e769
[]
no_license
wisdom-21/book-redis-mybatis_plus
c37d7540a3f795778d121c2e8e3d56f3405e74d2
1c152c21ae1bbcdc73c42a76853d0dd5cfea352d
refs/heads/master
2022-07-01T05:16:57.433791
2019-08-21T02:10:31
2019-08-21T02:10:31
203,487,823
1
0
null
2022-06-21T01:42:42
2019-08-21T02:10:22
Java
UTF-8
Java
false
false
261
java
package wisdom21.model.system.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import wisdom21.model.system.entity.UserEntity; import org.apache.ibatis.annotations.Mapper; @Mapper public interface UserMapper extends BaseMapper<UserEntity> { }
[ "wisdom_lhz@163.com" ]
wisdom_lhz@163.com
e956c5454f013195b7ab9a9a5a04012d2339b258
18119aca76dcfae6478a37fd51f0cc8e6798e158
/app/src/main/java/sjtu/iiot/wi_fi_scanner_iiot/SuperWiFi.java
05b5a14f0ee75b148c7678b95123dbf131820d92
[ "MIT" ]
permissive
dtfdsz/Wifi-positioning
95abf8edab735ff9e483b504a6267b70db5dfbf6
10219014e3335c6c2922a03372c65d029c207ab0
refs/heads/master
2022-05-30T00:32:54.175510
2020-04-29T16:11:27
2020-04-29T16:11:27
259,974,240
0
0
null
null
null
null
UTF-8
Java
false
false
9,779
java
package sjtu.iiot.wi_fi_scanner_iiot; /***************************************************************************************************************** * Created by HelloShine on 2019-3-24. * ***************************************************************************************************************/ import java.io.File; import java.io.IOException; import java.io.RandomAccessFile; import java.sql.Date; import java.text.SimpleDateFormat; import java.util.Iterator; import java.util.List; import java.util.Vector; import android.content.Context; import android.net.wifi.ScanResult; import android.net.wifi.WifiManager; import android.util.Log; //Log can be utilized for debug. public class SuperWiFi extends MainActivity{ /***************************************************************************************************************** * When you run the APP in your mobile phone, you can utilize the following code for debug: * Log.d("TEST_INFO","Your Own String Type Content Here"); * You can also generate the String via ("String" + int/double value). for example, "CurTime " + 20 = "CurTime 20" * ***************************************************************************************************************/ //private String FileLabelName = "YourNameHere";// Define the file Name private String FileLabelName="xystest"; /***************************************************************************************************************** * You can define the Wi-Fi SSID to be measured in FileNameGroup, more than 2 SSIDs are OK. * It is noting that multiple Wi-Fi APs might share the same SSID such as SJTU. * ***************************************************************************************************************/ //private String FileNameGroup[] = {"SJTU","IIoT-434"}; private String FileNameGroup[]={"xie","CMCC-nGKE","@PHICOMM_87","ChinaNet-5cDf", "liaozeming","yxb","ylylzx","HUAWEI-QJZ7AF","wuguangming"}; private int TestTime = 10;//Number of measurement private int ScanningTime = 1000;//Wait for (?) ms for next scan private int NumberOfWiFi = FileNameGroup.length; // RSS_Value_Record and RSS_Measurement_Number_Record are used to record RSSI values private int[] RSS_Value_Record = new int[NumberOfWiFi]; private int[] RSS_Measurement_Number_Record = new int[NumberOfWiFi]; private WifiManager mWiFiManager = null; private Vector<String> scanned = null; boolean isScanning = false; public SuperWiFi(Context context) { this.mWiFiManager = (WifiManager)context.getSystemService(Context.WIFI_SERVICE); this.scanned = new Vector<String>(); } private void startScan()//The start of scanning { this.isScanning = true; Thread scanThread = new Thread(new Runnable() { public void run() { scanned.clear();//Clear last result for(int index = 1;index <= NumberOfWiFi; index++){ RSS_Value_Record[index - 1] = 0; RSS_Measurement_Number_Record[index - 1] = 1; } int CurTestTime = 1; //Record the test time and write into the SD card SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss"); Date curDate = new Date(System.currentTimeMillis()); //Get the current time String CurTimeString = formatter.format(curDate); for(int index = 1;index <= NumberOfWiFi; index++){ write2file(FileLabelName + "-" + FileNameGroup[index - 1] + ".txt","Test_ID: " + testID + " TestTime: " + CurTimeString + " BEGIN\r\n"); } //Scan for a certain times while(CurTestTime++ <= TestTime) performScan(); for(int index = 1;index <= NumberOfWiFi; index++){//Record the average of the result scanned.add(FileLabelName + "-" + FileNameGroup[index - 1] + " = " + RSS_Value_Record[index - 1]/ RSS_Measurement_Number_Record[index - 1] + "\r\n"); } /***************************************************************************************************************** You can insert your own code here for localization. * ***************************************************************************************************************/ for(int index = 1;index <= NumberOfWiFi; index++){//Mark the end of the test in the file write2file(FileLabelName + "-" + FileNameGroup[index - 1] + ".txt","testID:"+testID+"END\r\n"); } isScanning=false; } }); scanThread.start(); } /*public void scanAndRecordPos() { this.isScanning = true; Thread scanAndPosThread = new Thread(new Runnable() { public void run() { scanned.clear(); write2file(FileLabelName + ".txt", "ID" + recordID+ "\r\n"); //String tmpstr1=Double.toString(x); //String tmpstr2=Double.toString(y); write2file(FileLabelName + ".txt", posx + "\r\n"); write2file(FileLabelName + ".txt", posy+ "\r\n"); for (int index = 1;index <= NumberOfWiFi; index++) { RSS_Value_Record[index - 1] = 0; RSS_Measurement_Number_Record[index - 1] = 1; } int CurTestTime = 1; while(CurTestTime++ <= TestTime) performScanMod(); for (int index = 1;index <= NumberOfWiFi; index++) {//Record the average of the result scanned.add(FileLabelName + "-" + FileNameGroup[index - 1] + " = " + RSS_Value_Record[index - 1] / RSS_Measurement_Number_Record[index - 1] + "\r\n"); write2file(FileLabelName + ".txt",RSS_Value_Record[index - 1] / RSS_Measurement_Number_Record[index - 1] + "\r\n"); } isScanning=false; } }); scanAndPosThread .start(); }*/ private void performScan()//The realization of the test { if(mWiFiManager == null) return; try { if(!mWiFiManager.isWifiEnabled()) { mWiFiManager.setWifiEnabled(true); } mWiFiManager.startScan();//Start to scan try { Thread.sleep(ScanningTime); } catch (InterruptedException e) { e.printStackTrace(); } this.scanned.clear(); List<ScanResult> sr = mWiFiManager.getScanResults(); Iterator<ScanResult> it = sr.iterator(); while(it.hasNext()) { ScanResult ap = it.next(); for(int index = 1;index <= FileNameGroup.length; index++){ if (ap.SSID.equals(FileNameGroup[index - 1])){//Write the result to the file RSS_Value_Record[index-1] = RSS_Value_Record[index-1] + ap.level; RSS_Measurement_Number_Record[index - 1]++; write2file(FileLabelName + "-" + FileNameGroup[index - 1] + ".txt",ap.level+"\r\n"); } } } } catch (Exception e) { this.isScanning = false; this.scanned.clear(); } } /*private void performScanMod() { if(mWiFiManager == null) return; try { if(!mWiFiManager.isWifiEnabled()) { mWiFiManager.setWifiEnabled(true); } mWiFiManager.startScan();//Start to scan try { Thread.sleep(ScanningTime); } catch (InterruptedException e) { e.printStackTrace(); } this.scanned.clear(); List<ScanResult> sr = mWiFiManager.getScanResults(); Iterator<ScanResult> it = sr.iterator(); while(it.hasNext()) { ScanResult ap = it.next(); for(int index = 1;index <= FileNameGroup.length; index++){ if (ap.SSID.equals(FileNameGroup[index - 1])){//Write the result to the file RSS_Value_Record[index-1] = RSS_Value_Record[index-1] + ap.level; RSS_Measurement_Number_Record[index - 1]++; //write2file(FileLabelName + "-" + FileNameGroup[index - 1] + ".txt",ap.level+"\r\n"); } } } } catch (Exception e) { this.isScanning = false; this.scanned.clear(); } }*/ public void ScanRss(){ startScan(); } public boolean isscan(){ return isScanning; } public Vector<String> getRSSlist(){ return scanned; } private void write2file(String filename, String a){//Write to the SD card try { File file = new File("/sdcard/"+filename); if (!file.exists()){ file.createNewFile();} // Open a random filestream by Read&Write RandomAccessFile randomFile = new RandomAccessFile("/sdcard/"+filename, "rw"); // The length of the file(byte) long fileLength = randomFile.length(); // Put the writebyte to the end of the file randomFile.seek(fileLength); randomFile.writeBytes(a); randomFile.close(); } catch (IOException e) { e.printStackTrace(); } } }
[ "2391054028@qq.com" ]
2391054028@qq.com
9c13ff1deb8ee82f3493729e17b0f25c96883f31
f22a74a944a19127354dc3e73ae306e86ed587c5
/tools-redis-client/src/main/java/pers/zyc/tools/redis/client/request/set/SDiff.java
b3207ca2f7e47cca47decb22c13892ec6d4b8090
[]
no_license
zhangyanc/tools
c4524a612ecf8764377fd25038be00b33d0b75da
a8180bbe62c6faa71d0d38f96cb1b096e88ee4b0
refs/heads/master
2021-07-01T05:19:18.049650
2019-05-07T09:33:25
2019-05-07T09:33:25
111,371,279
0
0
null
null
null
null
UTF-8
Java
false
false
797
java
package pers.zyc.tools.redis.client.request.set; import pers.zyc.tools.redis.client.request.AutoCastRequest; import pers.zyc.tools.redis.client.util.ByteUtil; import java.util.Set; /** * SDIFF key [key ...] * </p> * * ่ฟ”ๅ›žไธ€ไธช้›†ๅˆ็š„ๅ…จ้ƒจๆˆๅ‘˜๏ผŒ่ฏฅ้›†ๅˆๆ˜ฏๆ‰€ๆœ‰็ป™ๅฎš้›†ๅˆไน‹้—ด็š„ๅทฎ้›†ใ€‚ * ไธๅญ˜ๅœจ็š„ key ่ขซ่ง†ไธบ็ฉบ้›†ใ€‚ * </p> * * <ul> * <li>ๆ—ถ้—ดๅคๆ‚ๅบฆ: O(N)๏ผŒN ๆ˜ฏๆ‰€ๆœ‰็ป™ๅฎš้›†ๅˆ็š„ๆˆๅ‘˜ๆ•ฐ้‡ไน‹ๅ’Œใ€‚</li> * <li>Redis็‰ˆๆœฌ่ฆๆฑ‚: >=1.0.0</li> * <li>่ฟ”ๅ›žๅ€ผ: ๅทฎ้›†ๆˆๅ‘˜็š„ๅˆ—่กจใ€‚</li> * </ul> * * @author zhangyancheng */ public class SDiff extends AutoCastRequest<Set<String>> { public SDiff(String key, String... keys) { bulks.add(ByteUtil.toByteArray(key)); for (String k : keys) { bulks.add(ByteUtil.toByteArray(k)); } } }
[ "zhangyancheng@jd.com" ]
zhangyancheng@jd.com
7e106c313705f5a16aa778676a9843f32932090f
1ef2aa31d1f65679ca5778f47da87223702f9e96
/app/src/main/java/com/guodong/sun/guodong/entity/zhihu/ZhihuDailyStory.java
cbc704230805a8b8d5a55731faa0724cc1851ae8
[ "Apache-2.0" ]
permissive
yuanhongtao/guodong
c35816957ee4244fec34d9955945da8c1a2fc11e
3554e93a073cbaee564ec40104724e888be21744
refs/heads/master
2021-01-22T19:09:01.281312
2017-03-03T05:20:07
2017-03-03T05:20:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,068
java
package com.guodong.sun.guodong.entity.zhihu; import java.util.ArrayList; /** * Created by Administrator on 2016/10/12. */ public class ZhihuDailyStory { private String body; private String image_source; private String title; private String image; private String share_url; private ArrayList<String> js; private String ga_prefix; private ArrayList<String> images; private int type; private int id; private ArrayList<String> css; public String getBody() { return body; } public void setBody(String body) { this.body = body; } public String getImage_source() { return image_source; } public void setImage_source(String image_source) { this.image_source = image_source; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getImage() { return image; } public void setImage(String image) { this.image = image; } public String getShare_url() { return share_url; } public void setShare_url(String share_url) { this.share_url = share_url; } public ArrayList<String> getJs() { return js; } public void setJs(ArrayList<String> js) { this.js = js; } public String getGa_prefix() { return ga_prefix; } public void setGa_prefix(String ga_prefix) { this.ga_prefix = ga_prefix; } public ArrayList<String> getImages() { return images; } public void setImages(ArrayList<String> images) { this.images = images; } public int getType() { return type; } public void setType(int type) { this.type = type; } public int getId() { return id; } public void setId(int id) { this.id = id; } public ArrayList<String> getCss() { return css; } public void setCss(ArrayList<String> css) { this.css = css; } }
[ "sun33919135@gmail.com" ]
sun33919135@gmail.com
0e7e64038656c62cb9fb46a7a1d58eae052f550e
473b76b1043df2f09214f8c335d4359d3a8151e0
/benchmark/bigclonebenchdata_partial/1205207.java
637545d5e6077c7d05f6526569a505c982d51cb7
[]
no_license
whatafree/JCoffee
08dc47f79f8369af32e755de01c52d9a8479d44c
fa7194635a5bd48259d325e5b0a190780a53c55f
refs/heads/master
2022-11-16T01:58:04.254688
2020-07-13T20:11:17
2020-07-13T20:11:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,003
java
class c1205207 { @SuppressWarnings("deprecation") private void loadClassFilesFromJar() { IPackageFragmentRoot packageFragmentRoot = (IPackageFragmentRoot) getJavaElement(); File jarFile = packageFragmentRoot.getResource().getLocation().toFile(); try { URL url = jarFile.toURL(); URLConnection u = url.openConnection(); ZipInputStream inputStream = new ZipInputStream(u.getInputStream()); ZipEntry entry = inputStream.getNextEntry(); while (null != entry) { if (entry.getName().endsWith(".class")) { ClassParser parser = new ClassParser(inputStream, entry.getName()); Repository.addClass(parser.parse()); } entry = inputStream.getNextEntry(); } } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } }
[ "piyush16066@iiitd.ac.in" ]
piyush16066@iiitd.ac.in
62270ed6e0732cb7a1c46ee9da028a9fef67d8d5
745615ed46e9a961fd27e39387f2019549980bca
/Ivalice/src/com/games/abyssal/Presentation/Views/AchievementsView.java
a3c68b93bdb8762fa2a845817007ec927be9f11a
[]
no_license
xv500i/Ivalice
a2362f0b2b958dded8189127a6dc7d28f869307c
9350236877c029cd0e16870f2148f3f9ee260919
refs/heads/master
2021-01-10T22:05:24.625902
2014-08-25T20:48:45
2014-08-25T20:48:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
727
java
package com.games.abyssal.Presentation.Views; import com.games.abyssal.Presentation.Controllers.AchievementsController; import com.games.abyssal.Presentation.Models.AchievementsModel; public class AchievementsView extends View { public AchievementsController controller; public AchievementsModel model; public AchievementsView(InputController input, AchievementsController controller, AchievementsModel model) { super(input); this.model = model; this.controller = controller; } @Override public void update(long msec) { } @Override public void render() { } public void onAchievementClicked(Long id){ controller.onViewAchievementsDetail(id); // notify ui } }
[ "alex@alex-PC" ]
alex@alex-PC
e9dd0cda35dd90e802598beb86485ce36c93cee5
1420ba90b0617caef56cd4dbb385b22924f001eb
/tour-android/app/src/main/java/cn/xmzt/www/nim/im/chatroom/fragment/tab/MasterTabFragment.java
416f73bfb56024d6a988941d1992965a43bdfb9a
[]
no_license
similar718/tour_p
7a4dbf5267b2bb119887791b0a09416ac6071642
2bb766983fe397c90437608a3dbee482ffda7ad0
refs/heads/master
2020-11-26T06:32:22.172843
2019-12-20T03:30:59
2019-12-20T03:30:59
228,989,138
0
0
null
null
null
null
UTF-8
Java
false
false
651
java
package cn.xmzt.www.nim.im.chatroom.fragment.tab; import cn.xmzt.www.R; import cn.xmzt.www.nim.im.chatroom.fragment.MasterFragment; /** * ไธปๆ’ญๅŸบ็ฑปfragment * Created by hzxuwen on 2015/12/14. */ public class MasterTabFragment extends ChatRoomTabFragment { private MasterFragment fragment; @Override protected void onInit() { fragment = (MasterFragment) getActivity().getSupportFragmentManager().findFragmentById(R.id.master_fragment); } @Override public void onCurrent() { super.onCurrent(); if (fragment != null) { fragment.onCurrent(); } } }
[ "1170214556@qq.com" ]
1170214556@qq.com
204d5d6ad115e4487abc5c229be7b2c1af32dd47
ac275d882ddf8e4038e5871856cf06d507a96f95
/newideasforoldcode/projects/src/specifictype/Person.java
ad18e19393e4e8bb20bd2dff0bdd7a9531bae1dc
[]
no_license
HamletDRC/presentations
a263a5fbed87e8af7f208a201c020e4d1de0985a
cf27751e3f024a48d537be6c22e084698cd703ac
refs/heads/master
2020-05-18T12:30:57.550583
2016-08-24T07:35:45
2016-08-24T07:35:45
761,411
5
1
null
2017-11-29T13:57:18
2010-07-07T09:01:24
HTML
UTF-8
Java
false
false
261
java
package specifictype; public class Person { boolean validateAddress(Person p) { return true; } boolean validateAddress(Address a) { return true; } boolean validateAddress(String a) { return true; } private static class Address { } }
[ "hamletdrc@gmail.com" ]
hamletdrc@gmail.com
32068d2f816a6e9efa0c7fa04eb7fc417f93c034
7c6e1b0f61ac2da8427970b21f631c60cfe28256
/app/src/main/java/com/massky/greenlandvland/di/module/NewsMainFragmentModule.java
c0a8174b08912c57d05777bbdb974e3683fa1fc7
[]
no_license
androidzhangyu/GreenLandVLand
2ffe293146292c33d7849b297636c0e5909a6c0f
a51f20e00d60f34bc33716e21e41a84c9a067b19
refs/heads/master
2022-04-24T16:23:49.141922
2020-04-23T02:44:33
2020-04-23T02:44:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
567
java
package com.massky.greenlandvland.di.module; import com.massky.greenlandvland.di.scope.FragmentScope; import com.massky.greenlandvland.module.news.main.NewsMainContract; import dagger.Module; import dagger.Provides; /** * Created by chenxz on 2017/12/10. */ @Module public class NewsMainFragmentModule { private NewsMainContract.View view; public NewsMainFragmentModule(NewsMainContract.View view) { this.view = view; } @FragmentScope @Provides NewsMainContract.View provideNewsMainView() { return this.view; } }
[ "zhu@gmail.com" ]
zhu@gmail.com
61ece4213585c297481744c8f8ed6faf8ea80fad
64f0a73f1f35078d94b1bc229c1ce6e6de565a5f
/dataset/Top APKs Java Files/com.xharma.chatbin-com-xharma-chatbin-frags-OtherFragment.java
0cc05ca1fd18b072fe6fd93827518a535699324c
[ "MIT" ]
permissive
S2-group/mobilesoft-2020-iam-replication-package
40d466184b995d7d0a9ae6e238f35ecfb249ccf0
600d790aaea7f1ca663d9c187df3c8760c63eacd
refs/heads/master
2021-02-15T21:04:20.350121
2020-10-05T12:48:52
2020-10-05T12:48:52
244,930,541
2
2
null
null
null
null
UTF-8
Java
false
false
9,208
java
package com.xharma.chatbin.frags; import android.content.DialogInterface; import android.content.DialogInterface.OnClickListener; import android.content.Intent; import android.content.pm.ApplicationInfo; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.os.Handler; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; import android.support.v4.widget.SwipeRefreshLayout; import android.support.v4.widget.SwipeRefreshLayout.OnRefreshListener; import android.support.v7.app.AlertDialog.Builder; import android.util.Log; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ListView; import android.widget.TextView; import android.widget.Toast; import com.xharma.chatbin.activity.AdminSettingsActivity; import com.xharma.chatbin.activity.OtherChatActivity; import com.xharma.chatbin.adapter.ChatFragListAdapter; import com.xharma.chatbin.common.CommonMethods; import com.xharma.chatbin.common.PrefManager; import com.xharma.chatbin.common.SQLiteHelper; import com.xharma.chatbin.entity.ChatEntity; import com.xharma.chatbin.service.NotificationService; import java.io.PrintStream; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.HashMap; import java.util.List; import java.util.Map; public class OtherFragment extends Fragment implements SwipeRefreshLayout.OnRefreshListener { private ChatFragListAdapter adapter; private Map<String, Drawable> appMap; String blank = "Click on floating icon (+) to add app"; Boolean blankFlag; private ChatEntity chatEntity; private CommonMethods commonMethods; private String from = null; private ListView list; private ArrayList<String> modelList; private HashMap<String, byte[]> picMap; private PrefManager prefManager; private SQLiteHelper sqLiteHelper; SwipeRefreshLayout swipeLayout; private TextView tempText; public OtherFragment() {} private void alertClear() { AlertDialog.Builder localBuilder = new AlertDialog.Builder(getActivity(), 2131689644); localBuilder.setTitle("Do you want to clear all messages?"); localBuilder.setNegativeButton("cancel", new DialogInterface.OnClickListener() { public void onClick(DialogInterface paramAnonymousDialogInterface, int paramAnonymousInt) { paramAnonymousDialogInterface.dismiss(); } }); localBuilder.setPositiveButton("Ok", new DialogInterface.OnClickListener() { public void onClick(DialogInterface paramAnonymousDialogInterface, int paramAnonymousInt) { OtherFragment.this.sqLiteHelper.clearOAllRecords(); OtherFragment.this.refreshList("clear"); } }); localBuilder.show(); } public void onCreate(Bundle paramBundle) { super.onCreate(paramBundle); setHasOptionsMenu(true); setRetainInstance(true); } public void onCreateOptionsMenu(Menu paramMenu, MenuInflater paramMenuInflater) { super.onCreateOptionsMenu(paramMenu, paramMenuInflater); getActivity().getMenuInflater().inflate(2131492865, paramMenu); getActivity().getMenuInflater().inflate(2131492867, paramMenu); } public View onCreateView(LayoutInflater paramLayoutInflater, ViewGroup paramViewGroup, Bundle paramBundle) { paramLayoutInflater = paramLayoutInflater.inflate(2131427403, paramViewGroup, false); this.modelList = new ArrayList(); this.blankFlag = Boolean.valueOf(false); this.sqLiteHelper = new SQLiteHelper(getActivity()); this.commonMethods = new CommonMethods(); this.chatEntity = new ChatEntity(); this.prefManager = new PrefManager(getActivity()); this.tempText = ((TextView)paramLayoutInflater.findViewById(2131296553)); this.picMap = new HashMap(); this.list = ((ListView)paramLayoutInflater.findViewById(2131296441)); this.swipeLayout = ((SwipeRefreshLayout)paramLayoutInflater.findViewById(2131296548)); this.swipeLayout.setOnRefreshListener(this); this.swipeLayout.setColorScheme(new int[] { 17170459, 17170452, 17170456, 17170454 }); this.appMap = new HashMap(); paramViewGroup = getActivity().getPackageManager().getInstalledPackages(0); int i = 0; while (i < paramViewGroup.size()) { paramBundle = (PackageInfo)paramViewGroup.get(i); if ((0x1 & paramBundle.applicationInfo.flags) == 0) { String str = paramBundle.applicationInfo.packageName; this.appMap.put(str, paramBundle.applicationInfo.loadIcon(getActivity().getPackageManager())); } i += 1; } this.modelList = this.sqLiteHelper.getOSenderDetails(); this.picMap = this.sqLiteHelper.getOPicMap(); if ((this.modelList != null) && (this.modelList.size() != 0)) { this.tempText.setVisibility(8); this.blankFlag = Boolean.valueOf(false); } else { this.tempText.setText(this.blank); this.blankFlag = Boolean.valueOf(true); } this.adapter = new ChatFragListAdapter(getActivity(), this.modelList, this.picMap, this.appMap); this.list.setAdapter(this.adapter); this.list.setOnItemClickListener(new AdapterView.OnItemClickListener() { public void onItemClick(AdapterView<?> paramAnonymousAdapterView, View paramAnonymousView, int paramAnonymousInt, long paramAnonymousLong) { if (!OtherFragment.this.blankFlag.booleanValue()) { paramAnonymousView = new Intent(OtherFragment.this.getActivity(), OtherChatActivity.class); if (((String)paramAnonymousAdapterView.getItemAtPosition(paramAnonymousInt) != null) && (!"".equals((String)paramAnonymousAdapterView.getItemAtPosition(paramAnonymousInt)))) { paramAnonymousView.putExtra("senderName", (String)paramAnonymousAdapterView.getItemAtPosition(paramAnonymousInt)); paramAnonymousView.putExtra("groupFlag", OtherFragment.this.sqLiteHelper.getGroupFlag((String)paramAnonymousAdapterView.getItemAtPosition(paramAnonymousInt))); } OtherFragment.this.startActivity(paramAnonymousView); return; } Toast.makeText(OtherFragment.this.getActivity(), "Chat history not available", 0).show(); } }); return paramLayoutInflater; } public boolean onOptionsItemSelected(MenuItem paramMenuItem) { int i = paramMenuItem.getItemId(); if (i != 2131296287) { switch (i) { default: return super.onOptionsItemSelected(paramMenuItem); case 2131296301: startActivity(new Intent(getActivity(), AdminSettingsActivity.class)); return true; } try { refreshList("refresh"); return true; } catch (Exception paramMenuItem) { Calendar localCalendar = Calendar.getInstance(); Object localObject = System.out; StringBuilder localStringBuilder = new StringBuilder(); localStringBuilder.append("Current time => "); localStringBuilder.append(localCalendar.getTime()); ((PrintStream)localObject).println(localStringBuilder.toString()); localObject = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss"); this.sqLiteHelper.insertExceptionRecord(paramMenuItem.toString(), ((SimpleDateFormat)localObject).format(localCalendar.getTime())); return true; } } alertClear(); return true; } public void onRefresh() { Log.d("Swipe", "Refreshing Number"); refreshList("refresh"); } public void refreshList(final String paramString) { this.swipeLayout.setRefreshing(true); new Handler().postDelayed(new Runnable() { public void run() { OtherFragment.this.refreshMainMethod(paramString); } }, 1000L); } public void refreshMainMethod(String paramString) { Object localObject = this.sqLiteHelper.getOSenderDetails(); this.picMap = this.sqLiteHelper.getOPicMap(); if ((localObject != null) && (((ArrayList)localObject).size() != 0)) { this.tempText.setVisibility(8); this.blankFlag = Boolean.valueOf(false); } else { this.tempText.setText(this.blank); this.blankFlag = Boolean.valueOf(true); } this.adapter = new ChatFragListAdapter(getActivity(), (ArrayList)localObject, this.picMap, this.appMap); this.list.setAdapter(this.adapter); this.swipeLayout.setRefreshing(false); localObject = new Intent(getActivity(), NotificationService.class); getActivity().startService((Intent)localObject); if ("main".equals(paramString)) { return; } if ((!"clear".equals(paramString)) && (!"noti".equals(paramString))) { Toast.makeText(getActivity(), "List has been updated successfully", 0).show(); return; } if (!"noti".equals(paramString)) { Toast.makeText(getActivity(), "Chat messages deleted successfully", 0).show(); } } }
[ "ibrahimkanj@outlook.com" ]
ibrahimkanj@outlook.com
0eb4790877a097d67906d81837c9e05defe8c220
b2bb210d0d5c9b831b1f37dabc04f80b4a2b8c61
/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/exceptions/MsoIOException.java
eafb033e4be55f64fbe1baa86fc512b0ed6e148b
[ "Apache-2.0" ]
permissive
dmellos/archive-mso
477924d893a80e3e072a3acb1e89da762d2e24fb
fd02ad4cc7f03cfbe01dba5a1e564bed63e69a11
refs/heads/master
2023-06-09T10:12:25.129613
2017-06-06T15:16:42
2017-06-06T15:16:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,672
java
/*- * ============LICENSE_START======================================================= * OPENECOMP - MSO * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * 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. * ============LICENSE_END========================================================= */ package org.openecomp.mso.openstack.exceptions; /** * I/O exception */ public class MsoIOException extends MsoException { /** * Serialization id. */ private static final long serialVersionUID = 6752445132721635760L; /** * Basic constructor with message * @param message the error message */ public MsoIOException (String message) { super(message); super.category = MsoExceptionCategory.IO; } /** * Constructor to wrap a nested exception * @param message the error message * @param t the cause */ public MsoIOException (String message, Throwable t) { super (message, t); super.category = MsoExceptionCategory.IO; } }
[ "cc697w@intl.att.com" ]
cc697w@intl.att.com
5a412945f2650c0196ecd096cb6c441bca51e9ff
d44d9f05d9657f358dbae6dd32b9aa20f58173b5
/src/main/java/com/soyeb/flutter/AcResource.java
f2cc7636d41a65f84914ed07ee9cf07a6d54ca07
[]
no_license
Soyeb189/flutter
02d0f16ff4ca103620542fd0432561ba05c28583
67f65449bd527ff2ca900f76e81064c61194e7c0
refs/heads/master
2022-11-04T17:56:10.202295
2020-06-23T04:43:21
2020-06-23T04:43:21
268,154,869
0
0
null
null
null
null
UTF-8
Java
false
false
904
java
package com.soyeb.flutter; import java.util.HashMap; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RestController; @RestController public class AcResource { @Autowired private AcRepository acRepo; @Autowired private AcService acService; @PostMapping("/createStatment") public HashMap<String, String> saveStatment(@ModelAttribute("acstat") AcStatment ac){ acService.save(ac); HashMap<String, String> map = new HashMap<String, String>(); map.put("Status", "Success"); map.put("Code", "1"); return map; } @GetMapping("/ac_statments") public List<AcStatment> retriveAllStat(){ return acRepo.findAll(); } }
[ "muktadir189@gmai.com" ]
muktadir189@gmai.com
bbb5f18ebf8fe57a5f596ac804d7587a5023384b
dfd61893c86a4764e962d01642dfa1e7b07cf713
/WebApplication/DP_singleton_thread/src/dp_singleton_thread/DP_singleton_thread.java
51344afa5e8921efa94fe5e7dd6cedd718f76849
[]
no_license
SothernyKosal/Web-Application-Lessons-Code
e95e763bdff3d229854fa3a78694dedd55ca055c
ce3fb18adb787cb3f700ea54e52ddcccaf7e795c
refs/heads/master
2022-04-23T17:56:13.783604
2020-05-04T18:35:40
2020-05-04T18:35:40
261,257,521
0
0
null
null
null
null
UTF-8
Java
false
false
744
java
package dp_singleton_thread; public class DP_singleton_thread { static singleton_thread s1 = null; static singleton_thread s2 = null; public static void main(String[] args) { Thread t1 = new Thread(new Runnable(){ @Override public void run(){ s1 = singleton_thread.getObj(); } }); Thread t2 = new Thread(new Runnable(){ public void run(){ s1 = singleton_thread.getObj(); } }); t1.start(); t2.start(); try{ t1.join(); t2.join(); } catch(Exception e){ System.out.println(e); } } }
[ "kosalsotherny18@kit.edu.kh" ]
kosalsotherny18@kit.edu.kh
da0ac1578f8f89820775efbd44d7384cbc58c309
18026fc9c1b8011d65279cad34444fb723cf35f2
/jpa-samples/src/main/java/com/libqa/sample/domain/entity/User.java
14b45f1fa9881805ceb02be69db2114284e842b2
[ "MIT" ]
permissive
gliderwiki/springboot-multi-samples
1b63fcd9300c0e1d4adfe17300520080fbfaa852
1cac1fddb4d4c21e188fdf126a2eba12457655cc
refs/heads/master
2021-07-15T05:38:40.263241
2020-06-25T02:11:25
2020-06-25T02:11:25
174,906,814
0
1
null
null
null
null
UTF-8
Java
false
false
819
java
package com.libqa.sample.domain.entity; import lombok.Getter; import lombok.Setter; import javax.persistence.*; import java.time.LocalDateTime; import java.util.Date; @Getter @Setter @Entity @Table(name = "user", catalog = "test") public class User { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "id") private Integer id; @Column(name = "user_id") private String userId; @Column(name = "email") private String email; @Column(name = "user_password") private String userPassword; @Column(name = "created_at") private LocalDateTime createdAt; @Column(name = "last_accessed_at") private LocalDateTime lastAccessedAt; public User(String userId, String email) { this.userId = userId; this.email = email; } }
[ "edell.lee@kakaocorp.com" ]
edell.lee@kakaocorp.com
964f56667d7fc9a0e854ab9b8e5f9bd955131847
3cc483e0723fbc1930b8ca7d7e0ca9801d39b519
/CapitalAccount/src/com/chinasoft/cto/capitalAccount/filter/CharsetFillter.java
8dd926345398e397bfa1d1a0466511d29f5443d5
[]
no_license
wj1738304132/javaAccount
f6b083ed57d513a847f8f74adbf7ad7d5a668cc6
00dca8f0c5b2caae234d91c79dac34fdf3c58990
refs/heads/master
2020-04-09T06:31:42.094940
2018-12-10T03:40:01
2018-12-10T03:40:01
160,116,715
0
0
null
null
null
null
UTF-8
Java
false
false
966
java
package com.chinasoft.cto.capitalAccount.filter; import java.io.IOException; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.annotation.WebFilter; @WebFilter("/*") public class CharsetFillter implements Filter{ @Override public void init(FilterConfig filterConfig) throws ServletException { // TODO Auto-generated method stub } @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { request.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8"); response.setContentType("text/html;charset=utf-8"); chain.doFilter(request, response); } @Override public void destroy() { // TODO Auto-generated method stub } }
[ "ๆจ็ฟŠ@DESKTOP-GB2U2OP.lan" ]
ๆจ็ฟŠ@DESKTOP-GB2U2OP.lan
bc6ed8d3cfdbf9530d21b2046158d9f1940b1e7d
7fe03ccba97c13b217528f42444b8da679ad8662
/chess/app/pieces/Bishop.java
bb86c9c852ddceaed7a3e8362b34f887af80f701
[ "Apache-2.0" ]
permissive
RsknCankov/chess
785527894d575dfc6c1701442650c162f9821a0e
a1883bc466738356a9433e096accc924d975e63b
refs/heads/master
2021-01-10T15:32:44.716923
2016-02-21T19:20:22
2016-02-21T19:20:22
47,073,446
1
0
null
null
null
null
UTF-8
Java
false
false
784
java
package pieces; import java.util.ArrayList; import java.util.List; import models.Color; import models.Game; public class Bishop extends Piece { public Bishop(Game game, Color color, int currRow, int currColumn) { super(game, color, currRow, currColumn); } @Override public List<Move> getPossibleMoves(int toRow, int toColumn) { int dx[] = {-1, 1, 1, -1}; int dy[] = {1, 1, -1, -1}; List<Move> moves = new ArrayList<>(); for(int i=0; i<dx.length; ++i){ moves.add(new SimpleMove(dx[i], dy[i], toRow, toColumn, 8, this)); } return moves; } @Override public Piece clone() { return new Bishop(getGame(), color, currentRow, currentColumn); } @Override public int getId() { return 2; } @Override public String getName() { return "Bishop"; } }
[ "stanislav.ivanov1993@gmail.com" ]
stanislav.ivanov1993@gmail.com
a81e72f266523ce4d2625be9b3ddf56f96236890
342f15cce8c8d1b7f2fa7061da4730019fc3881e
/src/main/java/da/springframework/spring5webapp/models/Publisher.java
5d70c010e918a277196f212adfcfdcc4e12bd360
[]
no_license
ctavera/spring5webapp
60cb2138a3cfadd9f7761cf7d853d4d641721f44
eb2e088ab615845eefd3a9befa5256c65ec40c4a
refs/heads/master
2023-01-28T13:48:06.191897
2020-12-03T16:15:04
2020-12-03T16:15:04
317,979,889
0
0
null
null
null
null
UTF-8
Java
false
false
2,459
java
package da.springframework.spring5webapp.models; import javax.persistence.*; import java.util.HashSet; import java.util.Set; @Entity public class Publisher { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; private String name; private String addressLine1; private String city; private String state; private String zip; @OneToMany @JoinColumn(name = "publisher_id") private Set<Book> books = new HashSet<>(); public Publisher() { } public Publisher(String name, String addressLine1, String city, String state, String zip) { this.name = name; this.addressLine1 = addressLine1; this.city = city; this.state = state; this.zip = zip; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getAddressLine1() { return addressLine1; } public void setAddressLine1(String addressLine1) { this.addressLine1 = addressLine1; } public String getCity() { return city; } public void setCity(String city) { this.city = city; } public String getState() { return state; } public void setState(String state) { this.state = state; } public String getZip() { return zip; } public void setZip(String zip) { this.zip = zip; } public Set<Book> getBooks() { return books; } public void setBooks(Set<Book> books) { this.books = books; } @Override public String toString() { return "Publisher{" + "id=" + id + ", name='" + name + '\'' + ", addressLine1='" + addressLine1 + '\'' + ", city='" + city + '\'' + ", state='" + state + '\'' + ", zip='" + zip + '\'' + '}'; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Publisher publisher = (Publisher) o; return id != null ? id.equals(publisher.id) : publisher.id == null; } @Override public int hashCode() { return id != null ? id.hashCode() : 0; } }
[ "christian.tavera@grupoargos.com.mx" ]
christian.tavera@grupoargos.com.mx
d15eb9a1391d2cadc02370b5c9b89ddfe6a7f398
c5c59b368ade508b64306f5294355680be32acbf
/app/src/main/java/com/github/jjarfi/sibntt/MainActivity.java
c76a6ea1f3adeb89e219d6d978e07d70bd6956c8
[]
no_license
jjarfi/client-ntt
e36edaf2352fabf95e5f06e066357cb2243ec028
2475a5abe618a6d840144a81b643cf54d776eb99
refs/heads/master
2021-01-02T10:26:42.825475
2020-02-14T13:23:04
2020-02-14T13:23:04
239,577,809
2
0
null
null
null
null
UTF-8
Java
false
false
2,529
java
package com.github.jjarfi.sibntt; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; import android.app.AlertDialog; import android.content.Context; import android.content.Intent; import android.graphics.Typeface; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.os.Bundle; import android.os.Handler; import android.view.View; import android.widget.TextView; import dmax.dialog.SpotsDialog; import uk.co.chrisjenx.calligraphy.CalligraphyConfig; public class MainActivity extends AppCompatActivity { private TextView tvSlogan, tvjudul; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); //Notes : add this code before setContentView CalligraphyConfig.initDefault(new CalligraphyConfig.Builder() .setDefaultFontPath("font/NABILA.TTF") .setFontAttrId(R.attr.fontPath) .build()); setContentView(R.layout.activity_main); initViews(); checkConnection(); } private void initViews() { tvSlogan = findViewById(R.id.tvSlogan); tvjudul = findViewById(R.id.tvJudul); Typeface face = Typeface.createFromAsset(getAssets(), "font/NABILA.TTF"); tvSlogan.setTypeface(face); tvjudul.setTypeface(face); } public boolean isConnect() { ConnectivityManager manager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo networkInfo = manager.getActiveNetworkInfo(); boolean isAvailable = false; if (networkInfo != null && networkInfo.isConnected()) { isAvailable = true; } return isAvailable; } private void checkConnection() { if (!isConnect()) { final AlertDialog loding = new SpotsDialog.Builder().setContext(MainActivity.this).build(); loding.show(); loding.setMessage("Mohon menunggu"); loding.setCancelable(false); } else { new Handler().postDelayed(new Runnable() { @Override public void run() { startActivity(new Intent(MainActivity.this, HomeActivity.class)); finish(); } }, 2000); } } }
[ "pacelinux@gmail.com" ]
pacelinux@gmail.com
05b2697f82523328e129b6242453330795b1efb6
68c7b693508e4f0c8141c52b534a9d0e0e70dd7d
/IOStream/src/com/feng/fileio/FileReaderAndWriter.java
e0650a66484c73e7b0b81c255cfd649c2e72d854
[]
no_license
fenggbinn/javaSenior
65a01115321c8e3d5fe63b6bcdcb7e6a620c6295
e4d799ebbcf5518490f70a7a7d6a3876d78473c5
refs/heads/master
2023-06-02T05:21:04.698874
2021-06-19T13:33:28
2021-06-19T13:33:28
369,764,068
0
0
null
null
null
null
UTF-8
Java
false
false
1,050
java
package com.feng.fileio; import org.junit.Test; import java.io.File; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; public class FileReaderAndWriter { @Test public void test1(){ FileReader fr = null; FileWriter fw = null; try { fr = new FileReader(new File("hi.txt")); fw = new FileWriter(new File("writerTest2.txt")); //ๆ™ฎ้€šๆ–‡ไปถๅฏไปฅไฝฟ็”จchar[]ๅญ—็ฌฆๅญ˜ๅ‚จ char[] cbuffer = new char[1024]; int len; while ((len=fr.read(cbuffer))!=-1){ String str = new String(cbuffer); fw.write(str); } } catch (IOException e) { e.printStackTrace(); } finally { try { if (fr!=null){ fr.close(); } if (fw!=null){ fw.close(); } } catch (IOException e) { e.printStackTrace(); } } } }
[ "wen@feng.com" ]
wen@feng.com
5b38fd49510cd6d3155ecab2a5b948b82e10e380
0f8e2a932678247a25d3358ed29dd80096655e19
/app/src/main/java/com/example/matheus/casadocodigocomlibs/fragments/AutorDetalheFragment.java
eea35de7705abca6828b88f19762bf3663674b37
[]
no_license
MathBrandino/CasaDoCodigo59
917bc6bd22320963ffc27979aac8ea6230d43f22
f9e0b2f5e5c89a7316b9e3e17326767a470ffb9a
refs/heads/master
2020-05-21T19:51:10.016054
2017-05-25T22:37:26
2017-05-25T22:37:26
62,263,545
1
0
null
null
null
null
UTF-8
Java
false
false
1,623
java
package com.example.matheus.casadocodigocomlibs.fragments; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.example.matheus.casadocodigocomlibs.R; import com.example.matheus.casadocodigocomlibs.adapter.AutoresAdapter; import com.example.matheus.casadocodigocomlibs.infra.Infra; import com.example.matheus.casadocodigocomlibs.model.Autor; import java.util.ArrayList; import butterknife.BindView; import butterknife.ButterKnife; /** * Created by matheus on 05/07/16. */ public class AutorDetalheFragment extends Fragment { @BindView(R.id.lista_autores) RecyclerView listaAutores; ArrayList<Autor> autores; @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.autor_detalhe_fragment, container, false); ButterKnife.bind(this, view); autores = (ArrayList<Autor>) getArguments().getSerializable("autores"); listaAutores.setLayoutManager(new LinearLayoutManager(getContext())); listaAutores.setAdapter(new AutoresAdapter(autores)); return view; } @Override public void onResume() { super.onResume(); Infra.colocaBotaoVoltar((AppCompatActivity) getActivity()); } }
[ "m.v.brandino@gmail.com" ]
m.v.brandino@gmail.com
d48df86494c2ce70e05e6bc64adc8c7f077daab9
9e9cc69c6c06f8357615ecc820ad291b5a2e4732
/app/src/main/java/com/lizhi/demo/chaoshidemo/view/CustomGridView.java
8bf7c071bb21f0144bc9e986a38963d46b85b1d4
[]
no_license
lz421421/JustLittleDemo
03071a1bb68350cbcf01b291588fc9eb96e12751
393b128aa1661e6680b4e658391b9f8eed8f36d3
refs/heads/master
2020-04-17T12:27:42.232945
2017-05-05T09:37:13
2017-05-05T09:37:13
66,338,313
1
0
null
null
null
null
UTF-8
Java
false
false
695
java
package com.lizhi.demo.chaoshidemo.view; import android.content.Context; import android.util.AttributeSet; import android.widget.GridView; public class CustomGridView extends GridView { public CustomGridView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public CustomGridView(Context context, AttributeSet attrs) { super(context, attrs); } public CustomGridView(Context context) { super(context); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST); super.onMeasure(widthMeasureSpec, expandSpec); } }
[ "lizhi01@zhanghetianxia.com" ]
lizhi01@zhanghetianxia.com
0fc990579d21b5f037f3495b0963432b759e6018
df8a7ef35ff28506053e4729b029c8d7a80587cd
/src/main/java/com/joymain/ng/webapp/controller/JmiMemberProfileFormController.java
4dd124af20e72a2ffe914fe8ecd1248f09d4b352
[]
no_license
lshowbiz/agnt_qt
101a5b3cabd0e1ff9135155ac87a602997a9eff5
789c2439308adaa5371d5bbb8a0f71a295395006
refs/heads/master
2022-12-11T10:13:18.791876
2019-10-02T01:01:57
2019-10-02T01:01:57
212,161,344
0
1
null
2022-12-05T23:28:41
2019-10-01T17:46:56
Java
UTF-8
Java
false
false
2,776
java
package com.joymain.ng.webapp.controller; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.stereotype.Controller; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.servlet.ModelAndView; import com.joymain.ng.model.JmiMember; import com.joymain.ng.model.JsysUser; import com.joymain.ng.service.JalStateProvinceManager; import com.joymain.ng.service.JmiMemberManager; import com.joymain.ng.util.LocaleUtil; import com.joymain.ng.util.StringUtil; @Controller @RequestMapping("/jmiMemberProfileform*") public class JmiMemberProfileFormController extends BaseFormController { private JmiMemberManager jmiMemberManager = null; @Autowired public void setJmiMemberManager(JmiMemberManager jmiMemberManager) { this.jmiMemberManager = jmiMemberManager; } @Autowired public JalStateProvinceManager jalStateProvinceManager; public JmiMemberProfileFormController() { setCancelView("redirect:jmiMembers"); setSuccessView("redirect:jmiMembers"); } @RequestMapping(method = RequestMethod.GET) public void showForm() { } @ModelAttribute("jmiMember") private JmiMember getJmiMember(HttpServletRequest request){ JsysUser defSysUser=(JsysUser)SecurityContextHolder.getContext().getAuthentication().getPrincipal(); List alStateProvinces=jalStateProvinceManager.getJalStateProvinceByCountryCode("CN"); request.setAttribute("alStateProvinces", alStateProvinces); if(StringUtil.getCheckIsUnlimitUser(defSysUser.getUserCode())){ request.setAttribute("bankViewUnLimit", "bankViewUnLimit"); } JmiMember jmiMember=null; jmiMember = jmiMemberManager.get(defSysUser.getUserCode()); return jmiMember; } @RequestMapping(method=RequestMethod.POST) public ModelAndView onSubmit(JmiMember jmiMember, BindingResult errors, HttpServletRequest request, HttpServletResponse response) throws Exception{ ModelAndView mav = new ModelAndView(); try { this.saveMessage(request, LocaleUtil.getLocalText("sys.message.updateSuccess")); return new ModelAndView(""); } catch (Exception e) { e.printStackTrace(); this.saveMessage(request, LocaleUtil.getLocalText(e.getMessage())); } return mav; } }
[ "727736571@qq.com" ]
727736571@qq.com
6d6635b04ff0783a463a91840a986644a69df048
c743ec417c6a45af5af661a5afe3b3ed47055e9f
/src/main/java/com/github/arteam/itunes/ITunesLibraryProvider.java
44652e60a2a21ff056d4de418f4b015b513b97d1
[]
no_license
arteam/airplay-gateway
0263f5d8125f72e5f2174d2755e96459e96b36e6
b8ec8b8feb733cbc9377745b7e19d31e6adf7efc
refs/heads/master
2022-08-15T01:13:47.924596
2022-06-02T13:40:48
2022-06-02T13:40:48
10,942,882
1
2
null
2021-08-11T22:53:14
2013-06-25T15:50:51
Java
UTF-8
Java
false
false
2,548
java
package com.github.arteam.itunes; import com.google.inject.*; import org.apache.log4j.Logger; import org.xml.sax.XMLReader; import com.github.arteam.itunes.data.ITunesLibrary; import com.github.arteam.itunes.parser.ITunesLibraryParser; import org.jetbrains.annotations.NotNull; import org.xml.sax.SAXException; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; /** * Date: 30.04.13 * Time: 11:53 * Provider for ITunes Library * * @author Artem Prigoda */ @Singleton public class ITunesLibraryProvider { private static final Logger log = Logger.getLogger(ITunesLibraryProvider.class); @Inject private ItunesLibraryFinder itunesLibraryFinder; @NotNull public ITunesLibrary get(@NotNull String itunesLibraryFilePath) { ITunesLibrary iTunesLibrary = new ITunesLibrary(); // Create Injector and bind iTunesLibrary to request scope Injector injector = Guice.createInjector(new ITunesModule(iTunesLibrary)); ITunesLibraryParser parser = injector.getInstance(ITunesLibraryParser.class); log.info("Path to library " + itunesLibraryFilePath); parser.parse(itunesLibraryFilePath); log.info(iTunesLibrary); return iTunesLibrary; } @NotNull public ITunesLibrary get() { String libraryPath = itunesLibraryFinder.findLibrary(); if (libraryPath == null) { throw new IllegalStateException("Unable find ITunes library"); } return get(libraryPath); } private static class ITunesModule extends AbstractModule { final ITunesLibrary iTunesLibrary; private ITunesModule(ITunesLibrary iTunesLibrary) { this.iTunesLibrary = iTunesLibrary; } @Override protected void configure() { } @Provides @Singleton public ITunesLibrary getITunesLibrary() { return iTunesLibrary; } // Create SAX parser @Provides public SAXParser saxParser() throws ParserConfigurationException, SAXException { SAXParserFactory spf = SAXParserFactory.newInstance(); spf.setValidating(false); SAXParser saxParser = spf.newSAXParser(); XMLReader parser = saxParser.getXMLReader(); // Ignore the DTD declaration parser.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); return saxParser; } } }
[ "arteamon@gmail.com" ]
arteamon@gmail.com
f70ea9d6c1d35561830f1f0ccb01a144f07fe12e
8708a0cc7b9f2e0b0d1349af7a54fb3b02106109
/03_stacks_and_queues/src/Exercise_03.java
ba4fd830341612c9e936b00f0ef3634e894a3b13
[]
no_license
Cvqtko/Java-Advanced-2020
d69dea40257835acf70669bfd672ed1765b9cdec
cfa4e61d7c76ee3614e859c901a8c8eb57b12640
refs/heads/master
2021-02-08T16:52:12.130836
2020-03-09T17:33:46
2020-03-09T17:33:46
244,172,285
0
0
null
null
null
null
UTF-8
Java
false
false
494
java
import java.util.ArrayDeque; import java.util.Scanner; public class Exercise_03 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int number = Integer.parseInt(scanner.nextLine()); scanner.close(); ArrayDeque<Integer> stack = new ArrayDeque<>(); while (number > 0) { int remainder = number % 2; stack.push(remainder); number = number / 2; } while (!stack.isEmpty()) { System.out.print(stack.pop()); } } }
[ "Kiril@KirilPC" ]
Kiril@KirilPC
14c8aff1855ad1acf2e5ea16827be77c9cd19b78
860f3d3ced42a6f118db33e02d9eb9b5dfa82b81
/app/src/main/java/cn/invonate/ygoa3/httpUtil/HttpUtil4.java
4c965c373aa1965d873b0033709001ece7fe5caa
[]
no_license
zhanght86/OA3.0
e784ce853112cc1507e2e0c62dfbf24980464a57
9bf548df7bc087edab16ab7bc51937ca27c1e746
refs/heads/master
2020-06-12T04:04:21.872613
2018-08-02T01:09:55
2018-08-02T01:09:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,898
java
package cn.invonate.ygoa3.httpUtil; import android.content.Context; import android.util.Log; import java.util.concurrent.TimeUnit; import okhttp3.OkHttpClient; import okhttp3.logging.HttpLoggingInterceptor; import retrofit2.Retrofit; import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory; import retrofit2.converter.fastjson.FastJsonConverterFactory; import rx.Observable; import rx.Subscriber; import rx.android.schedulers.AndroidSchedulers; import rx.schedulers.Schedulers; public class HttpUtil4 { public static final String BASE_URL = "http://192.168.1.34/"; private HttpService httpService; private static HttpUtil4 INSTANCE; private HttpUtil4(Context context, boolean isSaveCookie) { Retrofit retrofit = new Retrofit.Builder() .baseUrl(BASE_URL) .client(getOkHttpClient(context, isSaveCookie)) .addConverterFactory(FastJsonConverterFactory.create()) .addCallAdapterFactory(RxJavaCallAdapterFactory.create()) .build(); httpService = retrofit.create(HttpService.class); } private OkHttpClient getOkHttpClient(Context context, boolean isSaveCookie) { //ๆ—ฅๅฟ—ๆ˜พ็คบ็บงๅˆซ HttpLoggingInterceptor.Level level = HttpLoggingInterceptor.Level.BASIC; //ๆ–ฐๅปบlogๆ‹ฆๆˆชๅ™จ HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor(new HttpLoggingInterceptor.Logger() { @Override public void log(String message) { Log.d("lyy", "OkHttp====Message:" + message); } }); loggingInterceptor.setLevel(level); //ๅฎšๅˆถOkHttp int DEFAULT_TIMEOUT = 50; OkHttpClient.Builder httpClientBuilder = new OkHttpClient.Builder() .connectTimeout(DEFAULT_TIMEOUT, TimeUnit.SECONDS);//่ฎพ็ฝฎ่ถ…ๆ—ถๆ—ถ้—ด; if (isSaveCookie) { httpClientBuilder.interceptors().add(new ReceivedCookiesInterceptor(context)); } if (!isSaveCookie) { httpClientBuilder.interceptors().add(new AddCookiesInterceptor(context)); } //OkHttp่ฟ›่กŒๆทปๅŠ ๆ‹ฆๆˆชๅ™จloggingInterceptor httpClientBuilder.addInterceptor(loggingInterceptor); return httpClientBuilder.build(); } public static HttpUtil4 getInstance(Context context, boolean isSaveCookie) { INSTANCE = new HttpUtil4(context, isSaveCookie); return INSTANCE; } /** * ็ปŸไธ€้…็ฝฎ่ง‚ๅฏŸ่€… * * @param o * @param <T> */ private <T> void toSubscribe(Observable<T> o, Subscriber<T> s) { o.subscribeOn(Schedulers.io()) .unsubscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(s); } /** * ่Žทๅ–้›†ๅ›ข้€š่ฎฏๅฝ•้ƒจ้—จ * * @param subscriber * @param pk */ public void getDepart(Subscriber subscriber, String pk) { Observable observable = httpService.getDepart(pk); toSubscribe(observable, subscriber); } /** * ่Žทๅ–้ƒจ้—จ็š„็ปŸ่ฎกไฟกๆฏ * * @param subscriber * @param pk */ public void getDepartInfo(Subscriber subscriber, String pk) { Observable observable = httpService.getDepartInfo(pk); toSubscribe(observable, subscriber); } /** * ่Žทๅ–้ƒจ้—จๆˆๅ‘˜ๅˆ—่กจ * * @param subscriber * @param pk */ public void getEmpList(Subscriber subscriber, String pk) { Observable observable = httpService.getEmpList(pk); toSubscribe(observable, subscriber); } /** * ่Žทๅ–ไธชไบบไฟกๆฏ * * @param subscriber * @param code */ public void getEmpInfo(Subscriber subscriber, String code) { Observable observable = httpService.getEmpInfo(code); toSubscribe(observable, subscriber); } }
[ "1084664238@qq.com" ]
1084664238@qq.com
b7eebe32aad29322c6cf917912299103668e6489
59a7d985917bf4b1473c26d577840107dea673b1
/market/src/main/java/com/zeus/market/Tools.java
b65ec7261778c2f9eed7d99d50814d7c70ea9565
[]
no_license
zeuscoder/Bookcase
0bfdef1a7b68df4654bf4ed1859ed6ad6a60cdc7
8c7f901928ee360304d02fb25f77c24203fc9a24
refs/heads/master
2021-01-10T01:46:16.587440
2016-02-03T05:53:41
2016-02-03T05:53:41
43,372,504
1
0
null
null
null
null
UTF-8
Java
false
false
727
java
package com.zeus.market; import android.util.SparseArray; import android.view.View; /** * Created by zeus_coder on 2015/11/18. */ public class Tools { static class ViewHolder { public static <T extends View> T get(View view, int id) { SparseArray<View> viewHolder = (SparseArray<View>) view.getTag(); if (viewHolder == null) { viewHolder = new SparseArray<View>(); view.setTag(viewHolder); } View childView = viewHolder.get(id); if (childView == null) { childView = view.findViewById(id); viewHolder.put(id, childView); } return (T) childView; } } }
[ "1309170466@qq.com" ]
1309170466@qq.com
06822b31632f1f1378ba6680c5b847c7b7ce73fb
dde08abbf6095a9b544e3c3557f41d3ce7019a1d
/ๆ–น่ฟ่ฟ+ssm21/src/main/java/cn/itcast/controller/UserController.java
ba992a8e5a02824f226a62f3cc3aa097fc6cad40
[]
no_license
756146464/Voller
ca267a1dbcc727d391778246377cbdad2a9bca57
4f42eaef6e9a310446f3d23eb2a7b62e893cccca
refs/heads/master
2022-12-23T09:58:27.038654
2020-01-29T04:03:26
2020-01-29T04:03:26
234,017,861
0
2
null
2022-12-16T00:37:43
2020-01-15T06:53:48
Java
UTF-8
Java
false
false
1,011
java
package cn.itcast.controller; import cn.itcast.domain.User; import cn.itcast.service.UserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import javax.servlet.http.HttpSession; /** * @Author: Summer * @Time: 2020/1/19 11:37 */ @Controller @RequestMapping("/user") public class UserController { @Autowired private UserService userService; @RequestMapping("/login") public String login(User user, Model model,HttpSession session) { User existUser = userService.findUser(user); System.out.println(user); System.out.println(existUser); if(existUser != null){ session.setAttribute("user",existUser); return "redirect:/book/findAll"; }else { model.addAttribute("error", "็”จๆˆทๅๆˆ–ๅฏ†็ ้”™่ฏฏ!"); return "login"; } } }
[ "1596257630@qq.com" ]
1596257630@qq.com
890fa979d56aead83b23409cc1bc429db6d98258
34c4cb83e4a14eb18a59349bb18998b9b04d53cc
/ql/src/java/org/apache/hadoop/hive/ql/plan/SMBJoinDesc.java
4762408a7d4ab2eb0a36c07a3709c0b5b46ebb1c
[ "Apache-2.0", "BSD-3-Clause", "JSON", "MIT", "LicenseRef-scancode-unknown-license-reference", "GPL-1.0-or-later" ]
permissive
bigo-sg/spark-hive1.2.1
86d0c6035173f81290db9db052261010ddc7c788
ec22b1e199e61303d43ff9a56a4e42670825539f
refs/heads/master
2022-10-12T08:25:30.517408
2019-07-29T15:36:24
2019-07-29T15:36:24
197,581,516
0
1
Apache-2.0
2022-10-05T00:10:09
2019-07-18T12:20:26
Java
UTF-8
Java
false
false
2,118
java
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements.See the NOTICE file * distributed with this work for additional information * regarding copyright ownership.The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License.You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.hadoop.hive.ql.plan; import java.io.Serializable; import java.util.HashMap; import java.util.Map; import org.apache.hadoop.hive.ql.exec.DummyStoreOperator; import org.apache.hadoop.hive.ql.plan.Explain.Level; @Explain(displayName = "Sorted Merge Bucket Map Join Operator", explainLevels = { Level.USER, Level.DEFAULT, Level.EXTENDED }) public class SMBJoinDesc extends MapJoinDesc implements Serializable { private static final long serialVersionUID = 1L; private MapredLocalWork localWork; // keep a mapping from tag to the fetch operator alias private HashMap<Byte, String> tagToAlias; private Map<String, DummyStoreOperator> aliasToSink; public SMBJoinDesc(MapJoinDesc conf) { super(conf); } public SMBJoinDesc() { } public MapredLocalWork getLocalWork() { return localWork; } public void setLocalWork(MapredLocalWork localWork) { this.localWork = localWork; } public HashMap<Byte, String> getTagToAlias() { return tagToAlias; } public void setTagToAlias(HashMap<Byte, String> tagToAlias) { this.tagToAlias = tagToAlias; } public Map<String, DummyStoreOperator> getAliasToSink() { return aliasToSink; } public void setAliasToSink(Map<String, DummyStoreOperator> aliasToSink) { this.aliasToSink = aliasToSink; } }
[ "wangqian8@bigo.sg" ]
wangqian8@bigo.sg
eee313bffae21fb579281a54c73aa71090e7e14e
ab59063ff2ae941b876324070d8f8e8165cef960
/chunking_text_file/40authors/pengrad/master/InlineQueryResultVenue.java
a23532a24b00c4703bf7b083e03112696babf19a
[]
no_license
gpoorvi92/author_class
f7c26f46f1ca9608a8c98fb18fc74a544cf99c36
b079ef0a477a2868140d77c4b32c317d4492725e
refs/heads/master
2020-04-01T18:01:54.665333
2018-12-10T14:55:11
2018-12-10T14:55:11
153,466,983
1
0
null
2018-10-17T14:44:56
2018-10-17T14:03:04
Java
UTF-8
Java
false
false
1,234
java
package com.pengrad.telegrambot.model.request; /** * Stas Parshin * 06 May 2016 */ public class InlineQueryResultVenue extends InlineQueryResult<InlineQueryResultVenue> { private float latitude; private float longitude; private String title; private String address; private String foursquare_id; private String thumb_url; private Integer thumb_width; private Integer thumb_height; public InlineQueryResultVenue(String id, float latitude, float longitude, String title, String address) { super("venue", id); this.latitude = latitude; this.longitude = longitude; this.title = title; this.address = address; } public InlineQueryResultVenue foursquareId(String foursquareId) { this.foursquare_id = foursquareId; return this; } public InlineQueryResultVenue thumbUrl(String thumbUrl) { this.thumb_url = thumbUrl; return this; } public InlineQueryResultVenue thumbWidth(Integer thumbWidth) { this.thumb_width = thumbWidth; return this; } public InlineQueryResultVenue thumbHeight(Integer thumbHeight) { this.thumb_height = thumbHeight; return this; } }
[ "gpoorvi92@gmail.com" ]
gpoorvi92@gmail.com
9cb69e9cc3c1faafb802add231e9e0c64bff49fa
780ea3e340b57f11fb86ecee5b6c52d680c1842d
/core/src/main/java/net/xgs/commons/searcher/ClassSearcher.java
fa926b51bf78c98020a0bfd903a7ff6087dbbc80
[]
no_license
WKINGT/agricultrue
cbbce8d16d906b7ff0bdc4ee92fc5d113b8ab38f
81adfa2f4f1fa6ca4b6a31802b13e80f8e26b48e
refs/heads/master
2020-03-26T03:27:32.873633
2017-09-28T10:34:17
2017-09-28T10:34:17
144,456,880
1
0
null
null
null
null
UTF-8
Java
false
false
2,241
java
package net.xgs.commons.searcher; import java.io.IOException; import java.lang.annotation.Annotation; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; import com.jfinal.log.Log; import net.xgs.commons.utils.ClassUtils; @SuppressWarnings("unchecked") public class ClassSearcher { private static final Log log = Log.getLog(ClassSearcher.class); public static Set<Class<?>> getClasses(List<String> packageNames, Class<? extends Annotation> annotation) { String[] pkgs = packageNames.toArray(new String[packageNames.size()]); return getClasses(pkgs, annotation); } public static Set<Class<?>> getClasses(List<String> packageNames, Class<? extends Annotation>[] annotations) { String[] pkgs = packageNames.toArray(new String[packageNames.size()]); return getClasses(pkgs, annotations); } public static Set<Class<?>> getClasses(String[] packageNames, Class<? extends Annotation>... annotations) { final AnnotationReader reader = new AnnotationReader(); for (Class<? extends Annotation> annotation : annotations) { reader.addAnnotation(annotation); } final Set<Class<?>> classes = new LinkedHashSet<Class<?>>(); FileSearcher finder = new FileSearcher() { @Override public void visitFileEntry(FileEntry file) { if (file.isJavaClass()) { try { if (reader.isAnnotationed(file.getInputStream())) { addClass(file.getQualifiedJavaName()); } } catch (IOException e) { throw new RuntimeException(e); } } } private void addClass(String qualifiedClassName) { try { Class<?> klass = ClassUtils.loadClass(qualifiedClassName); classes.add(klass); } catch (Throwable e) { log.warn("Class load error.", e); } } }; finder.lookupClasspath(packageNames); return classes; } }
[ "1582293004@qq.com" ]
1582293004@qq.com
b3cbe119f7f9117ae5342030b657b32bc110537d
ec046fd34613182a12392e1f999149670f931e44
/src/handler/page/pos/UpdatePOS2.java
b0945bd7c47d7c2d681967cbc2c2d6f755a8c59e
[]
no_license
jjjjjuniiiii/seunghye
ff8a1cc9ed199450346093bbeeedad99b3133ae1
93bd308fdf65cf46fac9221dc82f864de9c1de41
refs/heads/master
2021-01-08T14:51:33.734714
2020-02-21T05:09:49
2020-02-21T05:09:49
242,059,206
0
0
null
null
null
null
UTF-8
Java
false
false
3,438
java
package handler.page.pos; import java.sql.Date; import java.text.ParseException; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import controller.CommandHandler; import dao.POSDAO; public class UpdatePOS2 implements CommandHandler { @Override public String process(HttpServletRequest req, HttpServletResponse res) throws Exception { // TODO Auto-generated method stub //Fixed Form์˜ ์ž…๋ ฅ ๊ฐ’ ๋ฐ›์•„์˜ค๊ธฐ int sequence = Integer.parseInt(req.getParameter("input0")); String large_category = req.getParameter("box1"); String small_category = req.getParameter("box2"); String system = req.getParameter("box3"); String using = req.getParameter("input1")==null?"":req.getParameter("input1"); String host_name = req.getParameter("input2")==null?"":req.getParameter("input2"); String manufacturer = req.getParameter("input3")==null?"":req.getParameter("input3"); String model_name = req.getParameter("input4")==null?"":req.getParameter("input4"); String specification = req.getParameter("input5")==null?"":req.getParameter("input5"); int purchase_num = 0; try { purchase_num = Integer.parseInt(req.getParameter("input6")); }catch(Exception e) { } String install_name = req.getParameter("input7")==null?"":req.getParameter("input7"); int install_num = 0; try { install_num = Integer.parseInt(req.getParameter("input8")); }catch(Exception e) { } Date start_date = null; try{ start_date = Date.valueOf(req.getParameter("input9")==null?"":req.getParameter("input9")); }catch(Exception e) { } String deterioration = req.getParameter("input10")==null?"":req.getParameter("input10"); int start_money = 0; try { start_money = Integer.parseInt(req.getParameter("input11")); }catch(Exception e) { } String place = req.getParameter("input12")==null?"":req.getParameter("input12"); String location = req.getParameter("input13")==null?"":req.getParameter("input13"); String status_progress = req.getParameter("input14")==null?"":req.getParameter("input14"); String contract_term = req.getParameter("input15")==null?"":req.getParameter("input15"); int month_money = 0; try { month_money = Integer.parseInt(req.getParameter("input16")); }catch(Exception e) { } String status_use = req.getParameter("input17")==null?"":req.getParameter("input17"); String disuse_or_recycling = req.getParameter("input18")==null?"":req.getParameter("input18"); String reason_disuse = req.getParameter("input19")==null?"":req.getParameter("input19"); String note = req.getParameter("input20")==null?"":req.getParameter("input20"); String unification = req.getParameter("input21")==null?"":req.getParameter("input21"); String EOS_end_date = req.getParameter("input22")==null?"":req.getParameter("input22"); POSDAO updateDAO = POSDAO.getInstance(); updateDAO.updatePOS2(sequence, large_category, small_category, system, using, host_name, manufacturer, model_name, specification, purchase_num, install_name, install_num, start_date, deterioration, start_money, place, location, status_progress, contract_term, month_money, status_use, disuse_or_recycling, reason_disuse, note, unification, EOS_end_date); res.sendRedirect(req.getContextPath()+"/page/user/pos2"); return null; } }
[ "user@DESKTOP-O5QMG5N" ]
user@DESKTOP-O5QMG5N
bf97d41ca84bb62c4f4c30f16cdd837f615492a6
b90ff6aedaf14b67a183e4f8eb54d8dca79cfbbc
/app/src/main/java/com/find/dog/utils/MyManger.java
2ffae6c6b082271f8973dd995dcc209d86e8f655
[]
no_license
zhang3371289/FindDog
5d5df1a1a737c3efb0f432ca67a965bdaf8dcb03
39228921ab3eddb3bd41e4eb6405d4d8f3ba1174
refs/heads/master
2020-12-02T06:45:32.206039
2017-08-28T01:49:49
2017-08-28T01:49:49
95,671,392
1
0
null
null
null
null
UTF-8
Java
false
false
11,298
java
package com.find.dog.utils; import android.content.Context; import android.content.SharedPreferences; import android.text.TextUtils; import com.find.dog.data.UserInfo; import com.find.dog.data.UserPetInfo; import com.find.dog.main.MyApplication; import java.util.ArrayList; /** * Created by zhangzhongwei on 2017/6/29. */ public class MyManger { public static final String BASE = "http://zhaogou.applinzi.com/";//ๆญฃๅผ็Žฏๅขƒ private static final String user_islogin = "user_islogin"; private static final String user_name = "user_name"; private static final String user_adress = "user_adress"; private static final String user_phone = "user_phone"; private static final String user_pay_number = "user_pay_number"; private static final String user_pay_type = "user_pay_type"; private static final String pic_Status_size = "pic_Status_size"; private static final String pic_Status_ = "pic_Status_"; private static final String issue_money = "issue_money"; private static final String pet_describ = "pet_describ"; private static final String pet_QRCode = "pet_QRCode"; private static final String pet_lost_time = "pet_lost_time"; private static final String pet_type = "pet_type"; private static final String qiniu_token = "qiniu_token"; /** * ไฟๅญ˜็™ปๅฝ•ๆ˜ฏๅฆ * @param b */ public static void saveLogin(boolean b){ SharedPreferences sharedPreferences = MyApplication.getInstance().getSharedPreferences("user", Context.MODE_PRIVATE); //็งๆœ‰ๆ•ฐๆฎ SharedPreferences.Editor editor = sharedPreferences.edit();//่Žทๅ–็ผ–่พ‘ๅ™จ editor.putBoolean(user_islogin,b).commit(); } public static boolean isLogin() { SharedPreferences sharedPreferences = MyApplication.getInstance().getSharedPreferences("user", Context.MODE_PRIVATE); //็งๆœ‰ๆ•ฐๆฎ boolean is_login = sharedPreferences.getBoolean(user_islogin,false); return is_login; } /** * ไฟๅญ˜ ไบŒ็ปด็  * @param code */ public static void saveQRCode(String code){ SharedPreferences sharedPreferences = MyApplication.getInstance().getSharedPreferences("user", Context.MODE_PRIVATE); //็งๆœ‰ๆ•ฐๆฎ SharedPreferences.Editor editor = sharedPreferences.edit();//่Žทๅ–็ผ–่พ‘ๅ™จ editor.putString(pet_QRCode,code).commit(); } public static String getQRCode() { SharedPreferences sharedPreferences = MyApplication.getInstance().getSharedPreferences("user", Context.MODE_PRIVATE); //็งๆœ‰ๆ•ฐๆฎ String code = sharedPreferences.getString(pet_QRCode,""); return code; } /** * ไฟๅญ˜ ไธƒ็‰›token * @param token */ public static void saveQiNiuToken(String token){ SharedPreferences sharedPreferences = MyApplication.getInstance().getSharedPreferences("user", Context.MODE_PRIVATE); //็งๆœ‰ๆ•ฐๆฎ SharedPreferences.Editor editor = sharedPreferences.edit();//่Žทๅ–็ผ–่พ‘ๅ™จ editor.putString(qiniu_token,token).commit(); } public static String getQiNiuToken() { SharedPreferences sharedPreferences = MyApplication.getInstance().getSharedPreferences("user", Context.MODE_PRIVATE); //็งๆœ‰ๆ•ฐๆฎ String code = sharedPreferences.getString(qiniu_token,""); return code; } /** * ไฟๅญ˜ ๆ‚ฌ่ต้‡‘้ข * @param money */ public static void saveMoney(String money){ SharedPreferences sharedPreferences = MyApplication.getInstance().getSharedPreferences("user", Context.MODE_PRIVATE); //็งๆœ‰ๆ•ฐๆฎ SharedPreferences.Editor editor = sharedPreferences.edit();//่Žทๅ–็ผ–่พ‘ๅ™จ editor.putString(issue_money,money).commit(); } public static String getMoney() { SharedPreferences sharedPreferences = MyApplication.getInstance().getSharedPreferences("user", Context.MODE_PRIVATE); //็งๆœ‰ๆ•ฐๆฎ String money = sharedPreferences.getString(issue_money,""); return money; } /** * ไฟๅญ˜ ๆ่ฟฐ * @param describ */ public static void saveDescrib(String describ){ SharedPreferences sharedPreferences = MyApplication.getInstance().getSharedPreferences("user", Context.MODE_PRIVATE); //็งๆœ‰ๆ•ฐๆฎ SharedPreferences.Editor editor = sharedPreferences.edit();//่Žทๅ–็ผ–่พ‘ๅ™จ editor.putString(pet_describ,describ).commit(); } public static String getDescrib() { SharedPreferences sharedPreferences = MyApplication.getInstance().getSharedPreferences("user", Context.MODE_PRIVATE); //็งๆœ‰ๆ•ฐๆฎ String describ = sharedPreferences.getString(pet_describ,""); return describ; } /** * ไฟๅญ˜ ็œๅธ‚ๅŒบ */ public static void saveCity(String province,String city,String district){ SharedPreferences sharedPreferences = MyApplication.getInstance().getSharedPreferences("user", Context.MODE_PRIVATE); //็งๆœ‰ๆ•ฐๆฎ SharedPreferences.Editor editor = sharedPreferences.edit();//่Žทๅ–็ผ–่พ‘ๅ™จ editor.putString("province",province); editor.putString("city",city); editor.putString("district",district); editor.commit(); } public static String getCity(int position,String normal) { SharedPreferences sharedPreferences = MyApplication.getInstance().getSharedPreferences("user", Context.MODE_PRIVATE); //็งๆœ‰ๆ•ฐๆฎ String code = ""; switch (position){ case 1: code = sharedPreferences.getString("province",normal); break; case 2: code = sharedPreferences.getString("city",normal); break; case 3: code = sharedPreferences.getString("district",normal); break; } return code; } /** * ไฟๅญ˜ ็”จๆˆทไฟกๆฏ * @param info */ public static void saveUserInfo(UserInfo info) { SharedPreferences sharedPreferences = MyApplication.getInstance().getSharedPreferences("user", Context.MODE_PRIVATE); //็งๆœ‰ๆ•ฐๆฎ SharedPreferences.Editor editor = sharedPreferences.edit();//่Žทๅ–็ผ–่พ‘ๅ™จ if(info == null){ editor.putString(user_name, ""); editor.putString(user_adress, ""); editor.putString(user_phone, ""); editor.putString(user_pay_number, ""); editor.putInt(user_pay_type, 0); }else { if(!TextUtils.isEmpty(info.getName())){ editor.putString(user_name, info.getName()); } if(!TextUtils.isEmpty(info.getAdress())){ editor.putString(user_adress, info.getAdress()); } if(!TextUtils.isEmpty(info.getPhone())){ editor.putString(user_phone, info.getPhone()); } if(!TextUtils.isEmpty(info.getPayNumber())){ editor.putString(user_pay_number, info.getPayNumber()); } if(info.getPayType() != 0){ editor.putInt(user_pay_type, info.getPayType()); } } editor.commit();//ๆไบคไฟฎๆ”น } public static UserInfo getUserInfo() { SharedPreferences sharedPreferences = MyApplication.getInstance().getSharedPreferences("user", Context.MODE_PRIVATE); //็งๆœ‰ๆ•ฐๆฎ UserInfo info = new UserInfo(); info.setName(sharedPreferences.getString(user_name, "")); info.setAdress(sharedPreferences.getString(user_adress, "")); info.setPhone(sharedPreferences.getString(user_phone,"")); info.setPayNumber(sharedPreferences.getString(user_pay_number,"")); info.setPayType(sharedPreferences.getInt(user_pay_type,0)); return info; } /** * ไฟๅญ˜ ๅ‘็Žฐ้กต ๅฎ ็‰ฉไฟกๆฏ * @param info */ public static void savePetInfo(UserPetInfo info) { SharedPreferences sharedPreferences = MyApplication.getInstance().getSharedPreferences("pet", Context.MODE_PRIVATE); //็งๆœ‰ๆ•ฐๆฎ SharedPreferences.Editor editor = sharedPreferences.edit();//่Žทๅ–็ผ–่พ‘ๅ™จ if(info == null){ editor.putString(user_name, ""); editor.putString(user_adress, ""); editor.putString(user_phone, ""); editor.putString(user_pay_number, ""); editor.putString(pet_lost_time, ""); editor.putString(pet_type, ""); editor.putString(pet_describ, ""); }else { if(!TextUtils.isEmpty(info.getPatName())){ editor.putString(user_name, info.getPatName()); } if(!TextUtils.isEmpty(info.getLoseAddress())){ editor.putString(user_adress, info.getLoseAddress()); } if(!TextUtils.isEmpty(info.getMasterPhone())){ editor.putString(user_phone, info.getMasterPhone()); } if(!TextUtils.isEmpty(info.getReward())){ editor.putString(user_pay_number, info.getReward()); } if(!TextUtils.isEmpty(info.getLoseDate())){ editor.putString(pet_lost_time, info.getLoseDate()); } if(!TextUtils.isEmpty(info.getState())){ editor.putString(pet_type, info.getState()); } if(!TextUtils.isEmpty(info.getDescrib())){ editor.putString(pet_describ, info.getDescrib()); } } editor.commit();//ๆไบคไฟฎๆ”น } public static UserPetInfo getPetInfo() { SharedPreferences sharedPreferences = MyApplication.getInstance().getSharedPreferences("pet", Context.MODE_PRIVATE); //็งๆœ‰ๆ•ฐๆฎ UserPetInfo info = new UserPetInfo(); info.setPatName(sharedPreferences.getString(user_name, "")); info.setLoseAddress(sharedPreferences.getString(user_adress, "")); info.setMasterPhone(sharedPreferences.getString(user_phone,"")); info.setReward(sharedPreferences.getString(user_pay_number,"")); info.setLoseDate(sharedPreferences.getString(pet_lost_time,"")); info.setState(sharedPreferences.getString(pet_type,"")); info.setDescrib(sharedPreferences.getString(pet_describ,"")); return info; } /** * ไฟๅญ˜ ๅ›พ็‰‡ๆ•ฐ็ป„ * @param list */ public static void savePicsArray(ArrayList<String> list) { SharedPreferences sharedPreferences = MyApplication.getInstance().getSharedPreferences("user", Context.MODE_PRIVATE); //็งๆœ‰ๆ•ฐๆฎ SharedPreferences.Editor mEdit1= sharedPreferences.edit(); mEdit1.putInt(pic_Status_size,list.size()); for(int i=0;i<list.size();i++) { mEdit1.remove(pic_Status_ + i); mEdit1.putString(pic_Status_ + i, list.get(i)); } mEdit1.commit(); } public static ArrayList<String> loadPicsArray() { SharedPreferences sharedPreferences = MyApplication.getInstance().getSharedPreferences("user", Context.MODE_PRIVATE); //็งๆœ‰ๆ•ฐๆฎ ArrayList<String> list = new ArrayList<>(); list.clear(); int size = sharedPreferences.getInt(pic_Status_size, 0); for(int i=0;i<size;i++) { list.add(sharedPreferences.getString(pic_Status_ + i, null)); } return list; } }
[ "zhang3371289@163.com" ]
zhang3371289@163.com
925ebbb0d24cf65bcaf596c6e7a23e0290430d09
6b6168b7999a7fc9e371f88364f767db4ee93810
/java/examples/basemq/src/test/Server.java
f63b6435209c62edb8d58689528684d3406b1227
[]
no_license
demonxjj/TCE
8425fde97997577e259d5e73b3fb5720198e1045
9962e5cebc44b49451e227a3a7b62a8a50649bb2
refs/heads/master
2020-02-26T17:15:19.706355
2016-09-04T17:34:07
2016-09-04T17:34:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
604
java
package test; //import tce.*; //import javax.xml.parsers.*; //import org.w3c.dom.*; //import java.io.*; //import java.nio.*; //import java.util.*; import tce.*; import test.Server_delegate; import test.*; import java.util.*; public class Server extends RpcServant{ //# -- INTERFACE -- public Server(){ super(); this.delegate = new Server_delegate(this); } public String echo(String text,RpcContext ctx){ return ""; } public void timeout(Integer secs,RpcContext ctx){ } public void heartbeat(String hello,RpcContext ctx){ } public void bidirection(RpcContext ctx){ } }
[ "24509826@qq.com" ]
24509826@qq.com
c1e6458a6d81eb5889ca7897cb9313a2d1a56d96
d2abfdbf9f2aa6a0f4deb9e876dbb179261abb1e
/src/main/java/com/gestionssii/dao/ExamsDaoImpl.java
564cbd0061a203f314235da5301b7d92d4cf08cd
[]
no_license
saadibe/gestionSSII
67278171a28f5990da563442e34c71e4aeb5c018
6400b15069d371f1798150d718e77a82e67a6ef1
refs/heads/master
2021-01-22T02:58:59.994910
2017-05-24T16:51:52
2017-05-24T16:51:52
81,088,578
0
0
null
null
null
null
UTF-8
Java
false
false
1,743
java
package com.gestionssii.dao; import java.util.List; import org.hibernate.SessionFactory; import org.hibernate.annotations.Cascade; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; import com.gestionssii.model.Categorie; import com.gestionssii.model.Exams; import com.gestionssii.model.Question; import com.gestionssii.model.Reponse; @Repository public class ExamsDaoImpl implements ExamsDao { @Autowired private SessionFactory sessionFactory; public List<Exams> getAllExams() throws Exception { return sessionFactory.getCurrentSession().createQuery("From Exams").list(); } public Exams getExamById(int idExam) throws Exception { return (Exams) sessionFactory.getCurrentSession().get(Exams.class, idExam); } public Exams addExam(Exams exam) throws Exception { sessionFactory.getCurrentSession().saveOrUpdate(exam); return exam; } public void deleteExam(Exams exam) { sessionFactory.getCurrentSession().delete(exam); } public Question addQuestion(Question question, int idExam, int idCategorie) throws Exception { Exams exam = (Exams) sessionFactory.getCurrentSession().get(Exams.class, idExam); Categorie categorie =(Categorie) sessionFactory.getCurrentSession().get(Categorie.class, idCategorie); question.setCategorie(categorie); question.setExams(exam); sessionFactory.getCurrentSession().saveOrUpdate(question); return question; } @Override public Reponse addReponse(Reponse reponse, int idQuestion) { Question question = (Question) sessionFactory.getCurrentSession().get(Question.class, idQuestion); reponse.setQuestion(question); sessionFactory.getCurrentSession().saveOrUpdate(reponse); return reponse; } }
[ "saadibechiring@gmail.com" ]
saadibechiring@gmail.com
bbb84ad9dd79e587e5b380c5d06ad9bfafac1578
58c46c1d1f790977901c69d51a79ab1e74207d57
/src/main/java/com/tansha/library/bookshelf/BookshelfApplication.java
1ad1443fdb891bfaa5d85b32614a8404411edf15
[]
no_license
habeep/bookshelf
cc07f711e030d36131599f1b07177e7847e00505
7abd9ad3544977de0073902aac30e33b2e14b5d6
refs/heads/master
2020-09-21T21:16:02.024712
2019-11-29T23:27:01
2019-11-29T23:27:01
224,933,104
0
0
null
null
null
null
UTF-8
Java
false
false
702
java
package com.tansha.library.bookshelf; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; @SpringBootApplication public class BookshelfApplication extends SpringBootServletInitializer { public static void main(String[] args) { SpringApplication.run(BookshelfApplication.class, args); } @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { // TODO Auto-generated method stub return builder.sources(BookshelfApplication.class); } }
[ "habeep2k1@gmail.com" ]
habeep2k1@gmail.com
6267c207442e98df1f83f9ca3646d74a9670d14c
994f08ca934feb15123c2b02099e2da4d953f84d
/shop-wechat-service/src/main/java/com/wy/shop/mq/RabbitOrderReciver.java
bf0e93c56e9667922c36a299ca2517d64831eaaa
[]
no_license
live0717/shop-wechat
fb0b9ebf8f811c42b438e656b892386fa3a671ad
27460a905590d9516d7de17a2c12222ba46c1f36
refs/heads/main
2023-02-06T07:09:38.936302
2020-12-26T03:29:49
2020-12-26T03:29:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,032
java
package com.wy.shop.mq; import com.rabbitmq.client.Channel; import java.util.Map; import org.springframework.amqp.rabbit.annotation.Exchange; import org.springframework.amqp.rabbit.annotation.Queue; import org.springframework.amqp.rabbit.annotation.QueueBinding; import org.springframework.amqp.rabbit.annotation.RabbitHandler; import org.springframework.amqp.rabbit.annotation.RabbitListener; import org.springframework.messaging.handler.annotation.Headers; import org.springframework.stereotype.Component; /** * @author wangyibo */ @Component public class RabbitOrderReciver { //้…็ฝฎ็›‘ๅฌ็š„ๅ“ชไธ€ไธช้˜Ÿๅˆ—๏ผŒๅŒๆ—ถๅœจๆฒกๆœ‰queueๅ’Œexchange็š„ๆƒ…ๅ†ตไธ‹ไผšๅŽปๅˆ›ๅปบๅนถๅปบ็ซ‹็ป‘ๅฎšๅ…ณ็ณป @RabbitListener(bindings = @QueueBinding( value = @Queue(value = MqConfig.ORDER_DIRECT_QUEUE), exchange = @Exchange(name=MqConfig.ORDER_DIRECT_EXCHANGE), key = "order.*" ) ) @RabbitHandler public void onMessage(String orderStr) { System.out.println(orderStr); } }
[ "2424080395@qq.com" ]
2424080395@qq.com
6833feedf08c70211a4dcb6f453a342e848b62eb
b59b48ce6c6e002a48513f796656ba325dd59dcf
/Web_Five/src/com/web_five/dto/orderListDto.java
01815564259ea445380877d81fbaa6173fbcbbc2
[]
no_license
boram611/Jsp
386e7b2230cc9b5f38f0db545cd3c15e966c3050
d35cc2d5fe01937b61d0e7356db53f4c2ba6c486
refs/heads/master
2023-04-05T00:05:59.153207
2021-03-26T05:32:57
2021-03-26T05:32:57
349,409,048
0
0
null
null
null
null
UTF-8
Java
false
false
1,981
java
package com.web_five.dto; public class orderListDto { String user_userId; String ordNo; String ordDate; String prdName; int ordQty; String ordDelivery; int prdPrice; int total; String prdNo; //์ƒ์„ฑ์ž public orderListDto() { } public orderListDto(String ordNo, String prdName, int prdPrice, int ordQty, String ordDate, String ordDelivery, String prdNo, int total) { super(); this.ordNo = ordNo; this.prdName = prdName; this.prdPrice = prdPrice; this.ordQty = ordQty; this.ordDate = ordDate; this.ordDelivery = ordDelivery; this.prdNo = prdNo; this.total = total; } public String getPrdNo() { return prdNo; } public void setPrdNo(String prdNo) { this.prdNo = prdNo; } public orderListDto(int total) { super(); this.total = total; } public String getUser_userId() { return user_userId; } public void setUser_userId(String user_userId) { this.user_userId = user_userId; } public String getOrdNo() { return ordNo; } public void setOrdNo(String ordNo) { this.ordNo = ordNo; } public String getOrdDate() { return ordDate; } public void setOrdDate(String ordDate) { this.ordDate = ordDate; } public String getPrdName() { return prdName; } public void setPrdName(String prdName) { this.prdName = prdName; } public int getOrdQty() { return ordQty; } public void setOrdQty(int ordQty) { this.ordQty = ordQty; } public String getOrdDelivery() { return ordDelivery; } public void setOrdDelivery(String ordDelivery) { this.ordDelivery = ordDelivery; } public int getPrdPrice() { return prdPrice; } public void setPrdPrice(int prdPrice) { this.prdPrice = prdPrice; } public int getTotal() { return total; } public void setTotal(int total) { this.total = total; } }
[ "3017129@naver.com" ]
3017129@naver.com
d1dc05ce5562c54e0aa1147d2bd8ae255d0cd31f
9474744c160c9c68197807d9dce53ea6a27c7fdf
/src/main/java/com/mobian/controller/UserController.java
b0c74927d99e344390fc1820c4e6b912e906810a
[]
no_license
xuwenming/ethealth
d250a104c5149516bacafb1731b9dc3455aeac4d
ff7238c2ed280927f8ec4f40d0a97673e54d45f4
refs/heads/master
2022-12-21T22:49:56.544654
2021-01-08T03:00:40
2021-01-08T03:00:40
109,663,512
0
0
null
2022-12-16T02:00:34
2017-11-06T07:47:41
Java
UTF-8
Java
false
false
11,047
java
package com.mobian.controller; import java.util.List; import java.util.Map; import java.util.UUID; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import com.mobian.listener.Application; import com.mobian.pageModel.DataGrid; import com.mobian.pageModel.SessionInfo; import com.mobian.pageModel.User; import com.mobian.service.ResourceServiceI; import com.mobian.service.RoleServiceI; import com.mobian.service.UserServiceI; import com.mobian.util.ConfigUtil; import com.mobian.pageModel.Json; import com.mobian.pageModel.PageHelper; import com.mobian.util.RSAUtil; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import com.alibaba.fastjson.JSON; /** * ็”จๆˆทๆŽงๅˆถๅ™จ * * @author John * */ @Controller @RequestMapping("/userController") public class UserController extends BaseController { @Autowired private UserServiceI userService; @Autowired private RoleServiceI roleService; @Autowired private ResourceServiceI resourceService; /** * ็”จๆˆท็™ปๅฝ• * * @param user * ็”จๆˆทๅฏน่ฑก * @param session * @param request * @return */ @ResponseBody @RequestMapping("/login") public Json login(User user, HttpSession session, HttpServletRequest request) { Json j = new Json(); String privateKey = (String)session.getAttribute(RSAUtil.PRIVATE_KEY); user.setName(RSAUtil.decryptByPravite(user.getName(),privateKey)); user.setPwd(RSAUtil.decryptByPravite(user.getPwd(), privateKey)); User u = userService.login(user); if (u != null) { j.setSuccess(true); j.setMsg("็™ป้™†ๆˆๅŠŸ๏ผ"); SessionInfo sessionInfo = new SessionInfo(); BeanUtils.copyProperties(u, sessionInfo); // sessionInfo.setIp(IpUtil.getIpAddr(request)); sessionInfo.setResourceList(userService.resourceList(u.getId())); sessionInfo.setRoleIds(userService.getIncludeRole(u.getId()).getRoleIds()); session.setAttribute(ConfigUtil.getSessionInfoName(), sessionInfo); j.setObj(sessionInfo); } else { j.setMsg("็”จๆˆทๅๆˆ–ๅฏ†็ ้”™่ฏฏ๏ผ"); } return j; } /** * ่Žทๅ–RSAๅ…ฌ้’ฅๆŽฅๅฃ */ @RequestMapping("/getPublicKey") @ResponseBody public Json getPublicKey(HttpSession session) { Json j = new Json(); try { Map<String,String> keyMap = RSAUtil.generateKeyPair(); String publicKey = keyMap.get("publicKey"); session.setAttribute(RSAUtil.PRIVATE_KEY, keyMap.get(RSAUtil.PRIVATE_KEY)); j.setSuccess(true); j.setMsg("่Žทๅ–RSAๅ…ฌ้’ฅๆŽฅๅฃๆˆๅŠŸ๏ผ"); j.setObj(publicKey); } catch (Exception e) { j.setMsg(Application.getString(EX_0001)); logger.error("่Žทๅ–RSAๅ…ฌ้’ฅๆŽฅๅฃๅผ‚ๅธธ", e); } return j; } /** * ็”จๆˆทๆณจๅ†Œ * * @param user * ็”จๆˆทๅฏน่ฑก * @return */ @ResponseBody @RequestMapping("/reg") public Json reg(User user) { Json j = new Json(); try { userService.reg(user); j.setSuccess(true); j.setMsg("ๆณจๅ†ŒๆˆๅŠŸ๏ผๆ–ฐๆณจๅ†Œ็š„็”จๆˆทๆฒกๆœ‰ไปปไฝ•ๆƒ้™๏ผŒ่ฏท่ฎฉ็ฎก็†ๅ‘˜่ต‹ไบˆๆƒ้™ๅŽๅ†ไฝฟ็”จๆœฌ็ณป็ปŸ๏ผ"); j.setObj(user); } catch (Exception e) { // e.printStackTrace(); j.setMsg(e.getMessage()); } return j; } /** * ้€€ๅ‡บ็™ปๅฝ• * * @param session * @return */ @ResponseBody @RequestMapping("/logout") public Json logout(HttpSession session) { Json j = new Json(); if (session != null) { session.invalidate(); } j.setSuccess(true); j.setMsg("ๆณจ้”€ๆˆๅŠŸ๏ผ"); return j; } /** * ่ทณ่ฝฌๅˆฐ็”จๆˆท็ฎก็†้กต้ข * * @return */ @RequestMapping("/manager") public String manager() { return "/admin/user"; } /** * ่Žทๅ–็”จๆˆทๆ•ฐๆฎ่กจๆ ผ * * @param user * @return */ @RequestMapping("/dataGrid") @ResponseBody public DataGrid dataGrid(User user, PageHelper ph) { return userService.dataGrid(user, ph); } /** * ่ทณ่ฝฌๅˆฐๆทปๅŠ ็”จๆˆท้กต้ข * * @param request * @return */ @RequestMapping("/addPage") public String addPage(HttpServletRequest request) { User u = new User(); u.setId(UUID.randomUUID().toString()); request.setAttribute("user", u); return "/admin/userAdd"; } /** * ๆทปๅŠ ็”จๆˆท * * @return */ @RequestMapping("/add") @ResponseBody public Json add(User user) { Json j = new Json(); try { userService.add(user); j.setSuccess(true); j.setMsg("ๆทปๅŠ ๆˆๅŠŸ๏ผ"); j.setObj(user); } catch (Exception e) { // e.printStackTrace(); j.setMsg(e.getMessage()); } return j; } /** * ่ทณ่ฝฌๅˆฐ็”จๆˆทไฟฎๆ”น้กต้ข * * @return */ @RequestMapping("/editPage") public String editPage(HttpServletRequest request, String id) { User u = userService.getIncludeRole(id); request.setAttribute("user", u); return "/admin/userEdit"; } /** * ไฟฎๆ”น็”จๆˆท * * @param user * @return */ @RequestMapping("/edit") @ResponseBody public Json edit(User user) { Json j = new Json(); try { userService.edit(user); j.setSuccess(true); j.setMsg("็ผ–่พ‘ๆˆๅŠŸ๏ผ"); j.setObj(user); } catch (Exception e) { // e.printStackTrace(); j.setMsg(e.getMessage()); } return j; } /** * ๅˆ ้™ค็”จๆˆท * * @param id * @return */ @RequestMapping("/delete") @ResponseBody public Json delete(String id, HttpSession session) { SessionInfo sessionInfo = (SessionInfo) session.getAttribute(ConfigUtil.getSessionInfoName()); Json j = new Json(); if (id != null && !id.equalsIgnoreCase(sessionInfo.getId())) {// ไธ่ƒฝๅˆ ้™ค่‡ชๅทฑ userService.delete(id); } j.setMsg("ๅˆ ้™คๆˆๅŠŸ๏ผ"); j.setSuccess(true); return j; } /** * ๆ‰น้‡ๅˆ ้™ค็”จๆˆท * * @param ids * ('0','1','2') * @return */ @RequestMapping("/batchDelete") @ResponseBody public Json batchDelete(String ids, HttpSession session) { Json j = new Json(); if (ids != null && ids.length() > 0) { for (String id : ids.split(",")) { if (id != null) { this.delete(id, session); } } } j.setMsg("ๆ‰น้‡ๅˆ ้™คๆˆๅŠŸ๏ผ"); j.setSuccess(true); return j; } /** ** * ๆ‰น้‡ๅไบบๆ˜Žๆ˜Ÿ * * @param ids * ('0','1','2') * @return * @throws Exception */ @RequestMapping("/batchUpateToStar") @ResponseBody public Json batchUpateToStar(String ids, HttpSession session) throws Exception { Json j = new Json(); if (ids != null && ids.length() > 0) { for (String id : ids.split(",")) { if (id != null) { User user = userService.getIncludeRole(id); if(user.getIsStar()==null||user.getIsStar()==false){ user.setIsStar(true); }else{ user.setIsStar(false); } userService.edit(user); } } } j.setMsg("ๆ‰น้‡ๆˆๅŠŸ๏ผ"); j.setSuccess(true); return j; } /** ** * ๆ‰น้‡่พพไบบ * * @param ids * ('0','1','2') * @return * @throws Exception */ @RequestMapping("/batchUpateToTarento") @ResponseBody public Json batchUpateToTarento(String ids, HttpSession session) throws Exception { Json j = new Json(); if (ids != null && ids.length() > 0) { for (String id : ids.split(",")) { if (id != null) { User user = userService.getIncludeRole(id); if(user.getIsTarento()==null||user.getIsTarento()==false){ user.setIsTarento(true); }else{ user.setIsTarento(false); } userService.edit(user); } } } j.setMsg("ๆ‰น้‡ๆˆๅŠŸ๏ผ"); j.setSuccess(true); return j; } /** * ่ทณ่ฝฌๅˆฐ็”จๆˆทๆŽˆๆƒ้กต้ข * * @return */ @RequestMapping("/grantPage") public String grantPage(String ids, HttpServletRequest request) { request.setAttribute("ids", ids); if (ids != null && !ids.equalsIgnoreCase("") && ids.indexOf(",") == -1) { User u = userService.getIncludeRole(ids); request.setAttribute("user", u); } return "/admin/userGrant"; } /** * ็”จๆˆทๆŽˆๆƒ * * @param ids * @return */ @RequestMapping("/grant") @ResponseBody public Json grant(String ids, User user) { Json j = new Json(); userService.grant(ids, user); j.setSuccess(true); j.setMsg("ๆŽˆๆƒๆˆๅŠŸ๏ผ"); return j; } /** * ่ทณ่ฝฌๅˆฐ็ผ–่พ‘็”จๆˆทๅฏ†็ ้กต้ข * * @param id * @param request * @return */ @RequestMapping("/editPwdPage") public String editPwdPage(String id, HttpServletRequest request) { User u = userService.getIncludeRole(id); request.setAttribute("user", u); return "/admin/userEditPwd"; } /** * ็ผ–่พ‘็”จๆˆทๅฏ†็  * * @param user * @return */ @RequestMapping("/editPwd") @ResponseBody public Json editPwd(User user) { Json j = new Json(); userService.editPwd(user); j.setSuccess(true); j.setMsg("็ผ–่พ‘ๆˆๅŠŸ๏ผ"); return j; } /** * ่ทณ่ฝฌๅˆฐ็ผ–่พ‘่‡ชๅทฑ็š„ๅฏ†็ ้กต้ข * * @return */ @RequestMapping("/editCurrentUserPwdPage") public String editCurrentUserPwdPage() { return "/user/userEditPwd"; } /** * ไฟฎๆ”น่‡ชๅทฑ็š„ๅฏ†็  * * @param session * @param pwd * @return */ @RequestMapping("/editCurrentUserPwd") @ResponseBody public Json editCurrentUserPwd(HttpSession session, String oldPwd, String pwd) { Json j = new Json(); if (session != null) { SessionInfo sessionInfo = (SessionInfo) session.getAttribute(ConfigUtil.getSessionInfoName()); if (sessionInfo != null) { if (userService.editCurrentUserPwd(sessionInfo, oldPwd, pwd)) { j.setSuccess(true); j.setMsg("็ผ–่พ‘ๅฏ†็ ๆˆๅŠŸ๏ผŒไธ‹ๆฌก็™ปๅฝ•็”Ÿๆ•ˆ๏ผ"); } else { j.setMsg("ๅŽŸๅฏ†็ ้”™่ฏฏ๏ผ"); } } else { j.setMsg("็™ปๅฝ•่ถ…ๆ—ถ๏ผŒ่ฏท้‡ๆ–ฐ็™ปๅฝ•๏ผ"); } } else { j.setMsg("็™ปๅฝ•่ถ…ๆ—ถ๏ผŒ่ฏท้‡ๆ–ฐ็™ปๅฝ•๏ผ"); } return j; } /** * ่ทณ่ฝฌๅˆฐๆ˜พ็คบ็”จๆˆท่ง’่‰ฒ้กต้ข * * @return */ @RequestMapping("/currentUserRolePage") public String currentUserRolePage(HttpServletRequest request, HttpSession session) { SessionInfo sessionInfo = (SessionInfo) session.getAttribute(ConfigUtil.getSessionInfoName()); request.setAttribute("userRoles", JSON.toJSONString(roleService.tree(sessionInfo))); return "/user/userRole"; } /** * ่ทณ่ฝฌๅˆฐๆ˜พ็คบ็”จๆˆทๆƒ้™้กต้ข * * @return */ @RequestMapping("/currentUserResourcePage") public String currentUserResourcePage(HttpServletRequest request, HttpSession session) { SessionInfo sessionInfo = (SessionInfo) session.getAttribute(ConfigUtil.getSessionInfoName()); request.setAttribute("userResources", JSON.toJSONString(resourceService.allTree(sessionInfo))); return "/user/userResource"; } /** * ็”จๆˆท็™ปๅฝ•ๆ—ถ็š„autocomplete * * @param q * ๅ‚ๆ•ฐ * @return */ @RequestMapping("/loginCombobox") @ResponseBody public List<User> loginCombobox(String q) { return userService.loginCombobox(q); } /** * ็”จๆˆท็™ปๅฝ•ๆ—ถ็š„combogrid * * @param q * @param ph * @return */ @RequestMapping("/loginCombogrid") @ResponseBody public DataGrid loginCombogrid(String q, PageHelper ph) { return userService.loginCombogrid(q, ph); } }
[ "252429711@qq.com" ]
252429711@qq.com
527dcb24279123590ac89f82af643e89c4e2d73e
7982fc2265d831f6ee19a0512306c6cbb534ed77
/Chapter/src/main/java/com/course/testng/groups/Group1.java
6bf147f7508475a3b1061bc88289b7a0d38ae385
[]
no_license
belindacpp/AutoTest
8dbc38e23286de5472c02efb8f81c45acba76267
61b277c09f4cd7332808d3437fb383c626461447
refs/heads/master
2020-04-08T21:42:06.953786
2018-12-10T13:39:44
2018-12-10T13:39:44
159,754,922
0
0
null
null
null
null
UTF-8
Java
false
false
272
java
package com.course.testng.groups; import org.testng.annotations.Test; @Test(groups = "teacher") public class Group1 { public void teachaer1(){ System.out.println("teacher1"); } public void teachaer2(){ System.out.println("teacher2"); } }
[ "aibm2321@qq.com" ]
aibm2321@qq.com
f049e43a4e0d2d9b06972a5fff4a86c7550a868d
7ff35c88e9c484271cf5d1bca430eba0e3e9de43
/src/main/java/net/javaguides/springmvc/aas/controller/AASHelloWorldController.java
cad92b9431dc8c44181bd1f76b8a76a702ff6a94
[]
no_license
ieomon324/springmvc-context-test
68439702b17347eefffcfcab6a5c5c8a9d77ac88
6e950bd861bc3de4f68362ad88accbdbdb32a939
refs/heads/master
2022-04-14T07:38:30.027018
2020-04-13T05:14:29
2020-04-13T05:14:29
255,053,995
0
0
null
null
null
null
UTF-8
Java
false
false
728
java
package net.javaguides.springmvc.aas.controller; import java.time.LocalDateTime; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import net.javaguides.springmvc.helloworld.model.HelloWorld; /** * @author Ramesh Fadatare */ @Controller @RequestMapping("/aas/*") public class AASHelloWorldController { @RequestMapping("/hello") public String handler(Model model) { HelloWorld helloWorld = new HelloWorld(); helloWorld.setMessage("Hello World Example Using Spring MVC 5!!!"); helloWorld.setDateTime(LocalDateTime.now().toString()); model.addAttribute("helloWorld", helloWorld); return "aas/helloworld"; } }
[ "ieomon324@gmail.com" ]
ieomon324@gmail.com
232238b4b8dc07f626c2164f295999cfd8b3330e
25729cf0666fb83f0c9b7553cd647b6c33968886
/src/main/java/com/opendata/common/util/KeywordFilter.java
c455677eb3832c701cff9e685ca5244fdab69469
[]
no_license
545473750/zswxglxt
1b55f94d8c0c8c0de47a0180406cdcdacc2ff756
2a7b7aeba7981bd723f99db400c99d0decb6de43
refs/heads/master
2020-04-23T15:42:36.490753
2014-08-11T00:08:39
2014-08-11T00:08:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,032
java
package com.opendata.common.util; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; /** * @title KeywordFilter * @description TODO * @author * @date 2014-4-17 * @version 1.0 */ public class KeywordFilter { /** ๆ•ๆ„Ÿ่ฏ้›†ๅˆ * {ๆณ•={isEnd=0, ่ฝฎ={isEnd=1}}, ไธญ={isEnd=0, ๅ›ฝ={isEnd=0, ไบบ={isEnd=1}, ็”ท={isEnd=0, ไบบ={isEnd=1}}}}} * */ private HashMap keysMap = new HashMap(); /** * ๆทปๅŠ ๆ•ๆ„Ÿ่ฏ * @param keywords */ public void addKeywords(List<String> keywords) { for (int i = 0; i < keywords.size(); i++) { String key = keywords.get(i).trim(); HashMap nowhash = keysMap;//ๅˆๅง‹ไปŽๆœ€ๅค–ๅฑ‚้ๅކ for (int j = 0; j < key.length(); j++) { char word = key.charAt(j); Object wordMap = nowhash.get(word); if (wordMap != null) { nowhash = (HashMap) wordMap; } else { HashMap<String, String> newWordHash = new HashMap<String, String>(); newWordHash.put("isEnd", "0"); nowhash.put(word, newWordHash); nowhash = newWordHash; } if (j == key.length() - 1) { nowhash.put("isEnd", "1"); } } } } /** * ๆฃ€ๆŸฅไธ€ไธชๅญ—็ฌฆไธฒไปŽbeginไฝ็ฝฎ่ตทๅผ€ๅง‹ๆ˜ฏๅฆๆœ‰keyword็ฌฆๅˆ๏ผŒ * ๅฆ‚ๆžœๆฒกๆœ‰๏ผŒๅˆ™่ฟ”ๅ›ž0 * ๅฆ‚ๆžœๆœ‰็ฌฆๅˆ็š„keywordๅ€ผ๏ผŒ็ปง็ปญ้ๅކ๏ผŒ็›ด่‡ณ้‡ๅˆฐisEnd = 1๏ผŒ่ฟ”ๅ›žๅŒน้…็š„keyword็š„้•ฟๅบฆ๏ผŒ */ private int checkKeyWords(String txt, int begin) { HashMap nowhash = keysMap; int res = 0; for (int i = begin; i < txt.length(); i++) { char word = txt.charAt(i); Object wordMap = nowhash.get(word);//ๅพ—ๅˆฐ่ฏฅๅญ—็ฌฆๅฏนๅบ”็š„HashMap if (wordMap == null) { return 0;//ๅฆ‚ๆžœ่ฏฅๅญ—็ฌฆๆฒกๆœ‰ๅฏนๅบ”็š„HashMap๏ผŒreturn 0 } res++;//ๅฆ‚ๆžœ่ฏฅๅญ—็ฌฆๅฏนๅบ”็š„HashMapไธไธบnull๏ผŒ่ฏดๆ˜ŽๅŒน้…ๅˆฐไบ†ไธ€ไธชๅญ—็ฌฆ๏ผŒ+1 nowhash = (HashMap) wordMap;//ๅฐ†้ๅކ็š„HashMapๆŒ‡ๅ‘่ฏฅๅญ—็ฌฆๅฏนๅบ”็š„HashMap if (((String) nowhash.get("isEnd")).equals("1")) {//ๅฆ‚ๆžœ่ฏฅๅญ—็ฌฆไธบๆ•ๆ„Ÿ่ฏ็š„็ป“ๆŸๅญ—็ฌฆ๏ผŒ็›ดๆŽฅ่ฟ”ๅ›ž return res; } else { continue; } } return res; } /** * ๅˆคๆ–ญtxtไธญๆ˜ฏๅฆๆœ‰ๅ…ณ้”ฎๅญ— */ public boolean isContentKeyWords(String txt) { for (int i = 0; i < txt.length(); i++) { int len = checkKeyWords(txt, i); if (len > 0) { return true; } } return false; } /** * ่ฟ”ๅ›žtxtไธญๅ…ณ้”ฎๅญ—็š„ๅˆ—่กจ */ public List<String> getTxtKeyWords(String txt) { List<String> list = new ArrayList<String>(); int l = txt.length(); for (int i = 0; i < l;) { int len = checkKeyWords(txt, i); if (len > 0) { String tt = txt.substring(i, i + len); list.add(tt); i += len; } else { i++; } } return list; } /** * ๅˆๅง‹ๅŒ–ๆ•ๆ„Ÿ่ฏๅˆ—่กจ * */ public void initfiltercode() { List<String> keywords = new ArrayList<String>(); keywords.add("ไธญๅ›ฝไบบ"); keywords.add("ไธญๅ›ฝ็”ทไบบ"); keywords.add("ๆณ•่ฝฎ"); this.addKeywords(keywords); } public static void main(String[] args) throws IOException { KeywordFilter filter = new KeywordFilter(); filter.initfiltercode(); String txt = "ๅ“ˆๅ“ˆ๏ผŒๅๅ€’ๆ˜ฏ ๆณ•่ฝฎ็ƒญ่ˆžๅŠŸ๏ผŒไธญๅ›ฝไบบ,"; boolean boo = filter.isContentKeyWords(txt); System.out.println(boo); List<String> set = filter.getTxtKeyWords(txt); System.out.println("ๅŒ…ๅซ็š„ๆ•ๆ„Ÿ่ฏๅฆ‚ไธ‹๏ผš" + set); } }
[ "545473750@qq.com" ]
545473750@qq.com
380caa6f00c93d3a753fa69995ef761918e5b369
2292c9784ec33b60d019ac77518b4aafdea687e3
/newenergy-db/src/main/java/newenergy/db/constant/SafeConstant.java
67c1262a6edbb4b9dc891054511dfdf7259a9d76
[]
no_license
kekeyouxing/newenergy-master
9c3bd68ae9b19ff1af4b6a262d1d5eb7901989c0
2e09e24e65607fbce8973d67c9556848e2ed5ee6
refs/heads/dev
2022-07-23T20:14:03.359722
2019-06-12T08:03:03
2019-06-12T08:03:03
195,808,891
0
0
null
2019-11-02T22:28:42
2019-07-08T12:37:09
Java
UTF-8
Java
false
false
207
java
package newenergy.db.constant; /** * Created by HUST Corey on 2019-04-17. */ public class SafeConstant { public static final Integer SAFE_ALIVE = 0; public static final Integer SAFE_DELETE = 1; }
[ "714676641@qq.com" ]
714676641@qq.com
b1800fc876f643ba601f80c9e36c066286b4afcd
c7187a08a4cb522e4f08541c0bf06a7e1bf34243
/src/com/github/browep/fpt/model/FPTStorable.java
16bf652b5b3b14a3ba3b011aef950597db586b26
[]
no_license
browep/fpt
94e8e1a711f9074d5c1e1979ce958ecd0ba98216
96d337e4b06d7692a3df775f77d33f67f5bc84e5
refs/heads/master
2021-01-19T21:29:40.365903
2013-04-30T03:27:57
2013-04-30T03:27:57
1,438,153
2
0
null
null
null
null
UTF-8
Java
false
false
1,510
java
package com.github.browep.fpt.model; import android.os.Parcel; import com.github.browep.nosql.Storable; import com.github.browep.fpt.util.Log; import org.json.JSONException; import java.io.IOException; import java.util.*; /** * Created by IntelliJ IDEA. * User: paul * Date: 3/6/11 * Time: 1:03 PM * To change this template use File | Settings | File Templates. */ public abstract class FPTStorable extends Storable { public FPTStorable(String data) throws IOException, JSONException { super(data); } public FPTStorable(){ super(); } @Override public List<String> getIndexBys() { List<String> indexes = new LinkedList<String>(); Map<String, String> propsToIndex = new HashMap<String, String>(); propsToIndex.put("status", "incomplete"); for (Map.Entry<String, String> entry : propsToIndex.entrySet()) indexes.add(toIndexPath(entry.getKey(), entry.getValue())); return indexes; } public int describeContents() { return 0; } public void writeToParcel(Parcel parcel, int i) { try { parcel.writeInt(getType()); parcel.writeLong(getCreated().getTime()); parcel.writeLong(getModified().getTime()); parcel.writeString(serialize()); } catch (IOException e) { Log.e("", e); } } public static String toIndexPathFormat(String name, String value){ return name + "_" + value; } }
[ "brower.paul@gmail.com" ]
brower.paul@gmail.com
31b2c8204c949e96119b4b01719f2ac60cc85859
ae63683a5c10dbf856f2f13e48b3cfb90032ebbb
/src/Assignments/Sep10/PainterPartition.java
ec7434a8feec06267c819911e0dff6a0fe4a9f25
[]
no_license
frankenstein32/Crux11Aug2019PP
050400288aab738c9c3cfbfb9bc21d05fc019e57
17dea9cb34634995736ea571b86f2325b2c34b44
refs/heads/master
2020-12-19T14:37:43.658270
2020-01-23T09:39:08
2020-01-23T09:39:08
205,080,482
0
0
null
2019-08-29T04:29:50
2019-08-29T04:29:50
null
UTF-8
Java
false
false
1,162
java
package Assignments.Sep10; import java.util.Scanner; /** * @author Garima Chhikara * @email garima.chhikara@codingblocks.com * @date 10-Sep-2019 * */ public class PainterPartition { public static void main(String[] args) { Scanner scn = new Scanner(System.in); int nop = scn.nextInt(); int nob = scn.nextInt(); int[] arr = new int[nob]; for (int i = 0; i < arr.length; i++) { arr[i] = scn.nextInt(); } int lo = 0; int hi = 0; for (int val : arr) { hi += val; } int finalAns = 0; while (lo <= hi) { int mid = (lo + hi) / 2; if (isItPossible(nop, nob, arr, mid)) { finalAns = mid; hi = mid - 1; } else { lo = mid + 1; } } System.out.println(finalAns); } private static boolean isItPossible(int nop, int nob, int[] arr, int mid) { int painters = 1; int time = 0; int i = 0; // i denotes which book is already read while (i < arr.length) { if (time + arr[i] <= mid) { time = time + arr[i]; i++; } else { // you were not able to read the book painters++; time = 0; if (painters > nop) { return false; } } } return true; } }
[ "garimachhikara128@gmail.com" ]
garimachhikara128@gmail.com
63d7fcd6f5dcfc41c7894988bb5758862c9c0ee3
8553ac63b4654549142e7ead9dc614cd4406a6ae
/src/cn/xurk/xms/service/PurchaseService.java
a750503a4dd8256b197ef9c5b80b62b90ab2bcfc
[]
no_license
xurk0922/xms
cf2a5e6b9ff07d48d733e8baacad4bc219894466
0fadaad078a8e1ec8bf3c3a50f234ea0018bdb1c
refs/heads/master
2021-01-18T02:46:27.370352
2016-09-16T15:27:04
2016-09-16T15:27:04
68,391,590
2
0
null
null
null
null
UTF-8
Java
false
false
561
java
package cn.xurk.xms.service; import java.util.List; import cn.xurk.xms.entity.Purchase; import cn.xurk.xms.utils.jqgrid.JqGridHandler; import cn.xurk.xms.utils.jqgrid.JqGridPage; public interface PurchaseService extends BaseService<Purchase, Long> { /** ๅˆ†้กตๆŸฅ่ฏข */ public JqGridPage<Purchase> findPage(JqGridHandler gridHandler); /** ๆŸฅ่ฏข,ๅธฆๆ—ถ้—ด๏ผŒๅธฆๅˆ†ๅ…ฌๅธ */ public List<Purchase> findAll(String start, String end, Long filialeId); /** ๆŸฅ่ฏข,ๅธฆๆ—ถ้—ด */ public List<Purchase> findAll(String start, String end); }
[ "xurk0922@163.com" ]
xurk0922@163.com
99aeef9836f03cb70f6ab168306271a3fa31c1b9
1a6e7906e5815133c86d8c8dc216269fdb8d2ca9
/QRShare/src/fr/fchantrel/makeitday/activity/LRProsActivity.java
7401a5ec3c4ac60f290b1fa8a633cb88b9aa2531
[]
no_license
fchantrel/MakeItDay-QRShare
8a57eb785ba47c6d6cd5032275304ce621846254
a6c8d9be145821bdb6fbea4023801ea80416146e
refs/heads/master
2021-01-19T05:19:37.802433
2013-12-11T16:03:51
2013-12-11T16:03:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,200
java
/** * */ package fr.fchantrel.makeitday.activity; import java.util.Iterator; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import android.app.Activity; import android.app.ProgressDialog; import android.content.Intent; import android.os.AsyncTask; import android.os.Bundle; import android.widget.TextView; import fr.fchantrel.makeitday.R; import fr.fchantrel.makeitday.json.JSONParser; /** * @author FredASI * */ public class LRProsActivity extends Activity { private final String EXTRA_DATA = "extra_data"; private String url = "www.pagesjaunes.fr"; // JSON Node Names private static final String TAG_LAST_MODIFICATION = "lastmodification"; private static final String TAG_HISTO_SEARCH = "pjmyhistosearch"; private static final String TAG_TABLEAU_RECHERCHE = "t"; private static final String TAG_TABLEAU_PROS = "pro"; private static final String TAG_OU = "o"; private static final String TAG_QUOI = "q"; private static final String TAG_TIMESTAMP = "d"; private static final String TAG_ID = "id"; JSONObject reponseJSONStorage = null; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.liste_reponse); // On rรฉcupรจre les donnรฉes de l'activity prรฉcรฉdente Intent intent = getIntent(); TextView textView1 = (TextView) findViewById(R.id.text_display1); if (intent != null) { String urlAPIJSON = intent.getStringExtra(EXTRA_DATA); // loginDisplay.setText(intent.getStringExtra(EXTRA_LOGIN)); textView1.setText(urlAPIJSON); url = urlAPIJSON; // on lance l'AsyncTask qui va interroger le ws-rest new JSONParse().execute(); } } private class JSONParse extends AsyncTask<String, String, JSONObject> { private ProgressDialog pDialog; @Override protected void onPreExecute() { super.onPreExecute(); pDialog = new ProgressDialog(LRProsActivity.this); pDialog.setMessage("Getting Data ..."); pDialog.setIndeterminate(false); pDialog.setCancelable(true); pDialog.show(); } @Override protected JSONObject doInBackground(String... args) { JSONParser jParser = new JSONParser(); // Getting JSON from URL JSONObject json = jParser.getJSONFromUrl(url); return json; } @Override protected void onPostExecute(JSONObject json) { pDialog.dismiss(); try { StringBuilder tempChaineAffichee = new StringBuilder( "Reponse : "); // Getting JSON Object reponseJSONStorage = json.getJSONObject("pjmyhistosearch"); JSONArray tabRecherche = reponseJSONStorage.getJSONArray(TAG_TABLEAU_RECHERCHE); for (int i = 0; i < tabRecherche.length(); i++) { JSONObject currentLRElement = tabRecherche.getJSONObject(i); String quoi = currentLRElement.getString(TAG_QUOI); String ou = currentLRElement.getString(TAG_OU); tempChaineAffichee.append("Quoi:"); tempChaineAffichee.append(currentLRElement.getString(TAG_QUOI)); tempChaineAffichee.append(" / Ou:"); tempChaineAffichee.append(currentLRElement.getString(TAG_OU)); tempChaineAffichee.append(" / pros:"); if(currentLRElement.has(TAG_TABLEAU_PROS)){ JSONArray tabPro = currentLRElement.getJSONArray(TAG_TABLEAU_PROS); for (int j = 0; j < tabPro.length(); j++) { if(j != 0){ tempChaineAffichee.append("/"); } JSONObject currentProElement = tabPro.getJSONObject(j); JSONObject currentJSONDataPro = currentProElement.getJSONObject(TAG_TIMESTAMP); String currentIdPro = currentJSONDataPro.getString(TAG_ID); //String currentIdPro = currentProElement.getString(TAG_TIMESTAMP); tempChaineAffichee.append(currentIdPro); } // fin du for tabPro } tempChaineAffichee.append(" / "); } // fin du for tabRecherche // On met dans la textView la reponse formatee TextView textView2 = (TextView) findViewById(R.id.text_display2); textView2.setText(tempChaineAffichee); } catch (JSONException e) { e.printStackTrace(); } } } }
[ "fchantrel@FredASI-THINK.asi-rennes.fr" ]
fchantrel@FredASI-THINK.asi-rennes.fr
379d942e136ebaa829a0c9ac1695ad7312a4acb8
c4faf92837f3c163be4f0089adfbc60828b7fce3
/src/by/it/rogov/calc/Test02_04.java
26a26ade38dbb7a337564c57d7576bb681a6c480
[]
no_license
AlexandrRogov/JD2018-04-11
f3407f240f0dcfa76d4a56346c40e606f49764bb
4597619c75cbf8e5b35ed72ad5808413502b57e2
refs/heads/master
2020-03-15T11:50:33.268173
2018-07-05T23:21:10
2018-07-05T23:21:10
132,129,820
0
1
null
2018-05-04T11:09:42
2018-05-04T11:09:41
null
UTF-8
Java
false
false
2,141
java
package by.it.rogov.calc; import org.junit.Test; import static org.junit.Assert.*; public class Test02_04 { Parser parser = new Parser(); @Test public void calcA1() throws Exception { Var var = parser.calc("A=2+5.3"); double res = Double.parseDouble(var.toString()); assertEquals("ะžัˆะธะฑะบะฐ", 7.3, res, 1e-20); System.err.println("expected: 7.3 actual:" + res); } @Test public void calcA2() throws Exception { Var var = parser.calc("B=A*3.5"); double res = Double.parseDouble(var.toString()); assertEquals("ะžัˆะธะฑะบะฐ", 25.55, res, 1e-20); System.err.println("expected: 25.55 actual:" + res); } @Test public void calcA3() throws Exception { Var var = parser.calc("B1=B+0.11*-5"); double res = Double.parseDouble(var.toString()); assertEquals("ะžัˆะธะฑะบะฐ", 25, res, 1e-20); System.err.println("expected: 25 actual:" + res); } @Test public void calcA4() throws Exception { Var var = parser.calc("B2=A/2-1"); double res = Double.parseDouble(var.toString()); assertEquals("ะžัˆะธะฑะบะฐ", 2.65, res, 1e-20); System.err.println("expected: 2.65 actual:" + res); } @Test public void calcB1() throws Exception { Var var = parser.calc("C=B+(A*2)"); double res = Double.parseDouble(var.toString()); assertEquals("ะžัˆะธะฑะบะฐ", 40.15, res, 1e-20); System.err.println("expected: 40.15 actual:" + res); } @Test public void calcB2() throws Exception { Var var = parser.calc("D=((C-0.15)-20)/(7-5)"); double res = Double.parseDouble(var.toString()); assertEquals("ะžัˆะธะฑะบะฐ", 10, res, 1e-20); System.err.println("expected: 10 actual:" + res); } // @Test // public void calcB3() throws Exception { // // Var var = parser.calc("E={2,3}*(D/2)"); // Var res = Double.parseDouble(var.toString()); // assertEquals("ะžัˆะธะฑะบะฐ", {5.0,15.0}, res, 1e-20); // System.err.println("expected: {5,15} actual:" + res); // } }
[ "rohaualexandr@gmail.com" ]
rohaualexandr@gmail.com
7a5dbb511b2b374ea9a6e5a83c4280d80fc2a67d
6898781239faf7f5c3d7db18bed6917e76e5f1b6
/Daily/app/src/main/java/desperado/com/daily/data/exception/DiskException.java
7017e253a084fda58dd18c49b982982d3a0d1100
[]
no_license
cristianoro7/Daily
8479fe388bcc703841ecd3c38c47ae5519884552
7077247e3be56ce2bf093ccf25bd42dbf29b5127
refs/heads/master
2021-04-28T22:31:09.602819
2017-03-02T04:41:50
2017-03-02T04:41:50
77,720,645
1
0
null
null
null
null
UTF-8
Java
false
false
241
java
package desperado.com.daily.data.exception; /** * Created by desperado on 17-1-31. * ็กฌ็›˜้”™่ฏฏ */ public class DiskException extends Exception { public DiskException(String detailMessage) { super(detailMessage); } }
[ "424494431@qq.com" ]
424494431@qq.com
476be50dc3c5caf45ed4d8027de76386f63e3d5d
c455a746f29c6af3e7a6494844b40c3f954769a3
/ShoppingMall_frontend/src/main/java/com/cafe24/mall/vo/SmallCategoryVo.java
9628902dc841ae4056cc25c08bacb5b4384043cb
[]
no_license
skok1025/ShoppingMall
6de996969199d536847852689ae1f32e5c4735f2
44dfa865c309bbc861efccb8cd6faf08e5a9aa1f
refs/heads/master
2022-12-23T18:09:51.518214
2021-12-17T01:51:02
2021-12-17T01:51:02
196,100,128
7
1
null
2022-12-16T08:32:12
2019-07-10T00:00:34
Java
UTF-8
Java
false
false
999
java
package com.cafe24.mall.vo; import org.hibernate.validator.constraints.Length; public class SmallCategoryVo { private Long no; @Length(max = 10) private String name; private Long bigcategoryNo; private int presult; public SmallCategoryVo() { } public SmallCategoryVo(String name) { this.name = name; } public int getPresult() { return presult; } public void setPresult(int presult) { this.presult = presult; } public Long getNo() { return no; } public void setNo(Long no) { this.no = no; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Long getBigcategoryNo() { return bigcategoryNo; } public void setBigcategoryNo(Long bigcategoryNo) { this.bigcategoryNo = bigcategoryNo; } @Override public String toString() { return "SmallCategoryVo [no=" + no + ", name=" + name + ", bigcategoryNo=" + bigcategoryNo + "]"; } }
[ "skok1025@naver.com" ]
skok1025@naver.com
3300f6b8deef7e69b435f02b704be1134a263c68
bc54a3408bca6794ea2771374bdf411c2bb7e104
/onmyway/resources/com/yonyouhealth/uaph/framework/web/comm/DateUtil.java
248dea4f996d77900ba2ae0779194af443c5baf9
[]
no_license
loveq2016/blue-cloud
335629a5dca5adf6196f9f1945ef8bc17d44daa1
f330a195d2b1f602d18ce6c78c2cf738c48aefc2
refs/heads/master
2021-01-18T15:35:45.130249
2012-10-05T17:55:58
2012-10-05T17:55:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,087
java
package com.yonyouhealth.uaph.framework.web.comm; import java.sql.Timestamp; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; public class DateUtil { public static final String[] dateFormat = { "yyyy-MM-dd hh:mm:ss", "yyyy-MM-dd HH:mm:ss.SSSS", "yyyy-MM-dd", "yyyyๅนดMMๆœˆddๆ—ฅ hhๆ—ถmmๅˆ†ss็ง’", "yyyyๅนดMMๆœˆddๆ—ฅ" }; public static final String[] dateRegex = { "[1|2][0-9][0-9]{2}-[0|1][0-9]-[0-3][0-9] [0-2][0-9]:[0-5][0-9]:[0-5][0-9]", "[1|2][0-9][0-9]{2}-[0|1][0-9]-[0-3][0-9] [0-2][0-9]:[0-5][0-9]:[0-5][0-9].[0-9]{1,4}", "[1|2][0-9][0-9]{2}-[0|1][0-9]-[0-3][0-9]", "[1|2][0-9][0-9]{2}ๅนด[0|1][0-9]ๆœˆ[0-3][0-9]ๆ—ฅ [0-2][0-9]ๆ—ถ[0-5][0-9]ๅˆ†[0-5][0-9]็ง’", "[1|2][0-9][0-9]{2}ๅนด[0|1][0-9]ๆœˆ[0-3][0-9]ๆ—ฅ" }; public static java.sql.Date parseToDate(String paramString) { for (int i = 0; i < dateRegex.length; ++i) { if (!paramString.matches(dateRegex[i])) continue; SimpleDateFormat localSimpleDateFormat = new SimpleDateFormat(dateFormat[i]); try { java.sql.Date localDate = new java.sql.Date(localSimpleDateFormat.parse(paramString).getTime()); return localDate; } catch (ParseException localParseException) { throw new RuntimeException("ๅญ—็ฌฆไธฒ่ฝฌๆขๆ—ฅๆœŸๅ‡บ้”™๏ผ" + paramString); } } throw new RuntimeException("่พ“ๅ…ฅ็š„ๅญ—็ฌฆไธฒไธๅˆๆณ•๏ผ่ฏทๆฃ€ๆŸฅใ€‚" + paramString); } public static Timestamp parseToTimestamp(String paramString) { return new Timestamp(parseToDate(paramString).getTime()); } public static Calendar parseToCalendar(String paramString) { Calendar localCalendar = Calendar.getInstance(); localCalendar.setTimeInMillis(parseToDate(paramString).getTime()); return localCalendar; } public static String dateToStr(Object paramObject) { if (paramObject == null) return ""; SimpleDateFormat localSimpleDateFormat = new SimpleDateFormat(dateFormat[1]); Object localObject; if (paramObject instanceof Calendar) { localObject = (Calendar)paramObject; return localSimpleDateFormat.format(new java.util.Date(((Calendar)localObject).getTimeInMillis())); } if (paramObject instanceof Timestamp) { localObject = (Timestamp)paramObject; return localSimpleDateFormat.format(new java.util.Date(((Timestamp)localObject).getTime())); } if (paramObject instanceof java.util.Date) { localObject = (java.util.Date)paramObject; return localSimpleDateFormat.format((java.util.Date)localObject); } return (String)paramObject.toString(); } public static enum MilliSecond { S, SS, SSS, SSSS; } public static enum Second { s, ss; } public static enum Minute { m, mm; } public static enum Hour { h, hh; } public static enum Day { d, dd; } public static enum Month { M, MM; } public static enum DataYear { yy, yyyy; } }
[ "hanlu0808@gmail.com" ]
hanlu0808@gmail.com
f7042dc5c427ae592bd9ee8f30c0fd8c2bb5608f
af5386f30db32fa5a0373020539faf54d9687a90
/lib/src/main/java/com/bolyartech/scram_sasl/client/ScramClientFunctionalityImpl.java
f0ad62f1b37a3e26e5f5ec63c7a1058272d9a16e
[ "Apache-2.0" ]
permissive
ShaileshSurya/scram-sasl
fb644db0d1b89ba3c77d187df5fc3dfdb9001a71
5f3d1cbf71e534170c9f28fcee7fa8ec6bf77291
refs/heads/master
2023-04-11T01:37:17.941482
2021-04-18T07:01:33
2021-04-18T07:01:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,884
java
/* * Copyright 2016 Ognyan Bankov * <p> * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * 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.bolyartech.scram_sasl.client; import com.bolyartech.scram_sasl.common.Base64; import com.bolyartech.scram_sasl.common.ScramException; import com.bolyartech.scram_sasl.common.ScramUtils; import com.bolyartech.scram_sasl.common.StringPrep; import java.nio.charset.Charset; import java.security.InvalidKeyException; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.Arrays; import java.util.UUID; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * Provides building blocks for creating SCRAM authentication client */ @SuppressWarnings("unused") public class ScramClientFunctionalityImpl implements ScramClientFunctionality { private static final Pattern SERVER_FIRST_MESSAGE = Pattern.compile("r=([^,]*),s=([^,]*),i=(.*)$"); private static final Pattern SERVER_FINAL_MESSAGE = Pattern.compile("v=([^,]*)$"); private static final String GS2_HEADER = "n,,"; private static final Charset ASCII = Charset.forName("ASCII"); private final String mDigestName; private final String mHmacName; private final String mClientNonce; private String mClientFirstMessageBare; private boolean mIsSuccessful = false; private byte[] mSaltedPassword; private String mAuthMessage; private State mState = State.INITIAL; /** * Create new ScramClientFunctionalityImpl * @param digestName Digest to be used * @param hmacName HMAC to be used */ public ScramClientFunctionalityImpl(String digestName, String hmacName) { this(digestName, hmacName, UUID.randomUUID().toString()); } /** * Create new ScramClientFunctionalityImpl * @param digestName Digest to be used * @param hmacName HMAC to be used * @param clientNonce Client nonce to be used */ public ScramClientFunctionalityImpl(String digestName, String hmacName, String clientNonce) { if (ScramUtils.isNullOrEmpty(digestName)) { throw new NullPointerException("digestName cannot be null or empty"); } if (ScramUtils.isNullOrEmpty(hmacName)) { throw new NullPointerException("hmacName cannot be null or empty"); } if (ScramUtils.isNullOrEmpty(clientNonce)) { throw new NullPointerException("clientNonce cannot be null or empty"); } mDigestName = digestName; mHmacName = hmacName; mClientNonce = clientNonce; } /** * Prepares first client message * * You may want to use {@link StringPrep#isContainingProhibitedCharacters(String)} in order to check if the * username contains only valid characters * @param username Username * @return prepared first message * @throws ScramException if <code>username</code> contains prohibited characters */ @Override public String prepareFirstMessage(String username) throws ScramException { if (mState != State.INITIAL) { throw new IllegalStateException("You can call this method only once"); } try { mClientFirstMessageBare = "n=" + StringPrep.prepAsQueryString(username) + ",r=" + mClientNonce; mState = State.FIRST_PREPARED; return GS2_HEADER + mClientFirstMessageBare; } catch (StringPrep.StringPrepError e) { mState = State.ENDED; throw new ScramException("Username contains prohibited character"); } } @Override public String prepareFinalMessage(String password, String serverFirstMessage) throws ScramException { if (mState != State.FIRST_PREPARED) { throw new IllegalStateException("You can call this method once only after " + "calling prepareFirstMessage()"); } Matcher m = SERVER_FIRST_MESSAGE.matcher(serverFirstMessage); if (!m.matches()) { mState = State.ENDED; return null; } String nonce = m.group(1); if (!nonce.startsWith(mClientNonce)) { mState = State.ENDED; return null; } String salt = m.group(2); String iterationCountString = m.group(3); int iterations = Integer.parseInt(iterationCountString); if (iterations <= 0) { mState = State.ENDED; return null; } try { mSaltedPassword = ScramUtils.generateSaltedPassword(password, Base64.decode(salt), iterations, mHmacName); String clientFinalMessageWithoutProof = "c=" + Base64.encodeBytes(GS2_HEADER.getBytes(ASCII) , Base64.DONT_BREAK_LINES) + ",r=" + nonce; mAuthMessage = mClientFirstMessageBare + "," + serverFirstMessage + "," + clientFinalMessageWithoutProof; byte[] clientKey = ScramUtils.computeHmac(mSaltedPassword, mHmacName, "Client Key"); byte[] storedKey = MessageDigest.getInstance(mDigestName).digest(clientKey); byte[] clientSignature = ScramUtils.computeHmac(storedKey, mHmacName, mAuthMessage); byte[] clientProof = clientKey.clone(); for (int i = 0; i < clientProof.length; i++) { clientProof[i] ^= clientSignature[i]; } mState = State.FINAL_PREPARED; return clientFinalMessageWithoutProof + ",p=" + Base64.encodeBytes(clientProof, Base64.DONT_BREAK_LINES); } catch (InvalidKeyException | NoSuchAlgorithmException e) { mState = State.ENDED; throw new ScramException(e); } } @Override public boolean checkServerFinalMessage(String serverFinalMessage) throws ScramException { if (mState != State.FINAL_PREPARED) { throw new IllegalStateException("You can call this method only once after " + "calling prepareFinalMessage()"); } Matcher m = SERVER_FINAL_MESSAGE.matcher(serverFinalMessage); if (!m.matches()) { mState = State.ENDED; return false; } byte[] serverSignature = Base64.decode(m.group(1)); mState = State.ENDED; mIsSuccessful = Arrays.equals(serverSignature, getExpectedServerSignature()); return mIsSuccessful; } @Override public boolean isSuccessful() { if (mState == State.ENDED) { return mIsSuccessful; } else { throw new IllegalStateException("You cannot call this method before authentication is ended. " + "Use isEnded() to check that"); } } @Override public boolean isEnded() { return mState == State.ENDED; } @Override public State getState() { return mState; } private byte[] getExpectedServerSignature() throws ScramException { try { byte[] serverKey = ScramUtils.computeHmac(mSaltedPassword, mHmacName, "Server Key"); return ScramUtils.computeHmac(serverKey, mHmacName, mAuthMessage); } catch (InvalidKeyException | NoSuchAlgorithmException e) { mState = State.ENDED; throw new ScramException(e); } } }
[ "ogibankov@gmail.com" ]
ogibankov@gmail.com
653eaf4d8bc132360c6dd7e64e700c5da7795b52
88d0ab14d4eef9cadfc71fb03451ecfc179930f7
/app/src/main/java/com/example/tugas1_layout1918057/MainActivity2.java
cab04574cc6c35803580a2eacb5182bfac1ea047
[]
no_license
chjenniel1919/tgs1_mobile1918057
4d6440cb555c85b41e5f1eb9e1f9d08c06e04d80
9b2f360ef7c27433e65af82bbe6b6d9f08c0b8a9
refs/heads/main
2023-08-27T19:14:51.324016
2021-10-17T20:15:28
2021-10-17T20:15:28
418,244,645
0
0
null
null
null
null
UTF-8
Java
false
false
353
java
package com.example.tugas1_layout1918057; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; public class MainActivity2 extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.layout.activity_main); } }
[ "jennilaksita.jl@gmail.com" ]
jennilaksita.jl@gmail.com
61d83421cd403bdff64b252c5418dfab3817f78f
34df9168274d9814b11cd99b38df740edba0b42e
/src/_0B_Applet/SimpleBanner.java
6d74e4c64bf541b50362591c108f8ffbef87ebaf
[]
no_license
SinoshK/Java_Wyklad
781dba7835cb6e142daf8a003f0a67226c1dbbc4
016735e9c6050dc40efbe0d475da0066d64017c5
refs/heads/master
2020-04-06T20:23:30.536027
2019-01-27T18:23:25
2019-01-27T18:23:25
157,770,868
0
0
null
2018-11-15T20:49:15
2018-11-15T20:49:15
null
UTF-8
Java
false
false
976
java
package _0B_Applet; // Przyklad odล›wieลผania okna import java.awt.*; import java.applet.*; public class SimpleBanner extends Applet implements Runnable { String msg = " To jest bardzo duzy banner "; Thread t = null; int state; boolean stopFlag; // ustaw kolory public void init() { setBackground(Color.cyan); setForeground(Color.red); state = 0; } public void start() { t = new Thread(this); stopFlag = false; t.start(); } // cialo watku public void run() { char ch; // wyswietl banner for (;;) { try { repaint(); state += 1; Thread.sleep(250); ch = msg.charAt(0); msg = msg.substring(1, msg.length()); msg += ch; if (stopFlag) break; } catch (InterruptedException e) { } } } // zatrzymaj aplet, baner tez public void stop() { stopFlag = true; t = null; } // wyswietl banner public void paint(Graphics g) { g.drawString(msg, 50, 30); showStatus("Banner po raz: " + state); } }
[ "t.borzyszkowski@gmail.com" ]
t.borzyszkowski@gmail.com
f3e1e172af56cb0ec4a487e175753f838a14f99d
9553fcb50a878190fed70af4c6cf08f4a521da3f
/Lazaro_Cuenca_Poyatos/src/main/java/org/mvpigs/commandpattern/pedidos/PedidoNacional.java
c3a108ced02552aff4887837b8db2ed904dcdc03
[]
no_license
cuencaLZ/Examen-final-Programaci-n
2f45c386b9f2ee29adb1aba02c309b293e1c0904
f663e681ebf171190f872ed3cb4bd6375feb22b5
refs/heads/master
2020-03-19T11:56:23.653933
2018-06-07T15:28:12
2018-06-07T15:28:12
136,486,864
0
0
null
null
null
null
UTF-8
Java
false
false
78
java
package org.mvpigs.commandpattern.pedidos; public class PedidoNacional { }
[ "lazaro.cuenca8@gmail.com" ]
lazaro.cuenca8@gmail.com
33f16a5be110db11fa5fb7a78fe7c09779253ecb
6483756e3b17ab7783bb515cb5d63d3b10a62373
/PilaOperaciones/src/pilaoperaciones/Conversion.java
3d2cf405318d3cc2a301df52fd11150692e3e2a1
[]
no_license
AngelJadan/Varias-practicas-de-java
185fe91fa5413949d9cfb01ffca2badb551a1142
f1d1f32130e30dd69c38ce838177621df6b61c79
refs/heads/main
2023-08-22T23:08:40.394902
2021-10-14T19:44:16
2021-10-14T19:44:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,080
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package pilaoperaciones; import java.sql.Array; import java.util.Scanner; import java.util.Stack; /** * * @author Angel */ public class Conversion { Scanner l = new Scanner(System.in); Stack< String> PilaEntrada = new Stack< String>(); //Pila entrada Stack< String> Operadores = new Stack< String>(); //Pila temporal para operadores Stack< String> Salida = new Stack< String>(); //Pila salida String datos; public Conversion() { ingresoDatos(); infijoPrefijo(); imprimir(); } public void ingresoDatos() { System.out.println("Ingrese la expresion"); datos =l.nextLine(); } public void infijoPrefijo() { String[] arrayInfix = datos.split(" "); for (int i = arrayInfix.length - 1; i >= 0; i--) { PilaEntrada.push(arrayInfix[i]); System.out.println(arrayInfix[i]); } for (int i = 0; i < arrayInfix.length; i++) { if (arrayInfix[i] != "+" || arrayInfix[i] != "-" || arrayInfix[i] != "/" || arrayInfix[i] != "*") { Salida.push(arrayInfix[i]); } else { if (arrayInfix[i] == "-") { if (Salida.peek() != arrayInfix[i]) { Operadores.push(arrayInfix[i]); System.out.println(arrayInfix[i]); } else { Salida.push(Operadores.peek()); Salida.push(arrayInfix[i]); System.out.println(arrayInfix[i]); } } if (arrayInfix[i] == "*") { if (Salida.peek() != arrayInfix[i]) { Operadores.push(arrayInfix[i]); System.out.println(arrayInfix[i]); } else { Salida.push(Operadores.peek()); Salida.push(arrayInfix[i]); System.out.println(arrayInfix[i]); } } if (arrayInfix[i] == "/") { if (Salida.peek() != arrayInfix[i]) { Operadores.push(arrayInfix[i]); System.out.println(arrayInfix[i]); } else { Salida.push(Operadores.peek()); Salida.push(arrayInfix[i]); System.out.println(arrayInfix[i]); } } } } for (int i = 0; i < arrayInfix.length; i++) { int n=Integer.parseInt(arrayInfix[i]); System.out.println("Resultado: "+n); } } public void imprimir() { System.out.println(PilaEntrada); System.out.println(Salida); System.out.println(Operadores); } }
[ "angel.jadan12@gmail.com" ]
angel.jadan12@gmail.com
ccba527bddb506947cfad121c714be518ac31df5
e8ff84ea02e29295499f3c229353906300fa6c40
/CodeFuture/1-Test/Java/Source_NJPB/branch/code/njpb-business/target/generated-sources/annotations/com/avp/mem/njpb/entity/workorder/ObjWorkOrderFaultType_.java
ebd194cf74959393a1fd5341f0c8a1786c4b240f
[]
no_license
dayunxiang/gitDocTrack
541adccfff04834cb699298f67079d76fb86347e
837ce6d833665f11ac60e47d07bfb6056200f8c4
refs/heads/master
2021-01-06T23:20:15.924779
2018-08-28T01:42:14
2018-08-28T01:42:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
670
java
package com.avp.mem.njpb.entity.workorder; import javax.annotation.Generated; import javax.persistence.metamodel.SingularAttribute; import javax.persistence.metamodel.StaticMetamodel; @Generated(value = "org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor") @StaticMetamodel(ObjWorkOrderFaultType.class) public abstract class ObjWorkOrderFaultType_ extends com.avp.mem.njpb.api.entity.EntityBase_ { public static volatile SingularAttribute<ObjWorkOrderFaultType, Integer> replaceCount; public static volatile SingularAttribute<ObjWorkOrderFaultType, Integer> faultTypeId; public static volatile SingularAttribute<ObjWorkOrderFaultType, Integer> workOrderId; }
[ "pengwei940613@163.com" ]
pengwei940613@163.com
25fae6edc19806c6d3d672a38842257adbcae8d5
cde54e586b02e18020c83003f2edfecd08feb64d
/android_core_components/src/org/ros/android/view/visualization/shape/GoalShape.java
edebf6f4c99eaa090c4d04234301233fadbf97db
[]
no_license
rosjava/android_core
2c70995256ffe9f2fd7a2ecbe070cea7214edb73
8493ebd2f4a6aba8c03eccc3125491c11e2b0375
refs/heads/kinetic
2021-05-25T09:20:56.724952
2020-11-26T20:14:44
2020-11-26T20:14:44
7,416,278
147
166
null
2021-11-18T13:55:25
2013-01-03T01:43:15
Java
UTF-8
Java
false
false
1,002
java
/* * Copyright (C) 2011 Google 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.ros.android.view.visualization.shape; import org.ros.android.view.visualization.Color; /** * Represents the robot's current goal pose. * * @author damonkohler@google.com (Damon Kohler) */ public class GoalShape extends MetricSpacePoseShape { private static final Color COLOR = Color.fromHexAndAlpha("03d5c9", 0.3f); public GoalShape() { super(); setColor(COLOR); } }
[ "damonkohler@google.com" ]
damonkohler@google.com
4f4ea3d88ac4225fdc9fbeb308c4634c72ea615d
410c4362a7d3cc3ca3c7eef852602a95665623f4
/src/com/wemall/manage/seller/action/seller_informationAction.java
b6a28815bc56a5d141d2473e6fbb002381f08614
[]
no_license
King-Pan/Druglots
a83f2d774f04e7376ffeb649c50377c8bc2050ae
db7a0a9c83dc93a55de7641a6647b910d6bbd658
refs/heads/master
2020-06-29T01:07:13.291713
2019-08-03T16:08:14
2019-08-03T16:08:14
200,394,080
0
0
null
null
null
null
UTF-8
Java
false
false
3,875
java
package com.wemall.manage.seller.action; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.wemall.core.annotation.SecurityMapping; import com.wemall.core.domain.virtual.SysMap; import com.wemall.core.mv.JModelAndView; import com.wemall.core.query.PageList; import com.wemall.core.query.support.IPageList; import com.wemall.core.security.support.SecurityUserHolder; import com.wemall.core.tools.CommUtil; import com.wemall.core.tools.HttpClass; import com.wemall.foundation.domain.Authentication; import com.wemall.foundation.domain.InvoiceRecord; import com.wemall.foundation.domain.query.RefundLogQueryObject; import com.wemall.foundation.service.AuthenticationService; import com.wemall.foundation.service.IRefundLogService; import com.wemall.foundation.service.ISysConfigService; import com.wemall.foundation.service.IUserConfigService; /** * ๅ–ๅฎถ่ฎขๅ•ๅ‘็ฅจ่ฎฐๅฝ•ๆŸฅ่ฏข * @author Administrator * */ @Controller public class seller_informationAction { @Autowired private ISysConfigService configService; @Autowired private IUserConfigService userConfigService; @Autowired private IRefundLogService refundLogService; @Autowired private AuthenticationService authenticationService; @SecurityMapping(display = false, rsequence = 0, title = "ๅ–ๅฎถ่ฎขๅ•ๅ‘็ฅจๅˆ—่กจ", value = "/seller/seller_information.htm*", rtype = "seller", rname = "ๅ–ๅฎถ่ฎขๅ•ๅ‘็ฅจๅˆ—่กจ", rcode = "refund_seller", rgroup = "ๅฎขๆˆทๆœๅŠก") @RequestMapping({"/seller/seller_information.htm"}) public ModelAndView refund(HttpServletRequest request, HttpServletResponse response, String currentPage){ ModelAndView mv = new JModelAndView( "user/default/usercenter/seller_in.html", this.configService .getSysConfig(), this.userConfigService.getUserConfig(), 0, request, response); HttpClass hc = new HttpClass(); if (currentPage==null || currentPage=="") { currentPage="1"; } try { String username = SecurityUserHolder.getCurrentUser().getStore().getStore_ower(); String Load = hc.load("http://127.0.0.1:8081/ssm_project/selefenyemai", "currentPage="+currentPage+"&"+"username="+username); PageList pList= JSON.parseObject(Load, PageList.class); //ไปŽๅฐ่ฃ…็š„ๅˆ†้กต่Žทๅ–Result็š„jsonๆ•ฐ็ป„ List<JSONObject> jsons=pList.getResult(); List<InvoiceRecord> list= new ArrayList<>(); Map map = new HashMap(); //ๅพ—ๅˆฐๆŸฅ่ฏข็ป“ๆžœ้ๅކๅพ—ๅˆฐไนฐๅฎถๅ็งฐ๏ผŒๅŽป้ฆ–่ฅ่ฎค่ฏ่กจๅŽป่Žทๅ–ไผไธšๅ็งฐ for (JSONObject json : jsons) { InvoiceRecord invoiceRecord1=JSON.parseObject(JSONObject.toJSONString(json),InvoiceRecord.class); map.clear(); map.put("userName", invoiceRecord1.getBuyname()); List<Authentication> auths=this.authenticationService.query("select obj from Authentication obj where obj.userName=:userName", map, -1, -1); invoiceRecord1.setAuth(auths.get(0).getEnterpriseName()); list.add(invoiceRecord1); } pList.setResult(list); CommUtil.saveIPageList2ModelAndView("seller_information.htm", "", "", pList, mv); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } return mv; } }
[ "pwpw1218@gmail.com" ]
pwpw1218@gmail.com
709bae92aaa821f871f81effc12e2a56266df786
6b0d327852ee44c68f644803f05aaaac37cc6720
/onlineLearn-common/src/main/java/com/lsfly/base/GenericService.java
e04364b04f3c8f24a27ce6e5de77c6923940e70c
[]
no_license
2993277254/onLineLearn
34daead1c46598c5a58342cfb6d39389309eab5c
49523845d9522a4e22aab647cbb5dc4fcdb50b0f
refs/heads/master
2022-12-11T13:54:26.952549
2019-08-11T16:02:20
2019-08-11T16:02:20
199,986,560
0
1
null
2022-12-05T23:31:57
2019-08-01T05:57:48
HTML
UTF-8
Java
false
false
1,517
java
package com.lsfly.base; import com.lsfly.mybatis.ResultPage; import java.util.List; import java.util.Map; /** * ๆ‰€ๆœ‰่‡ชๅฎšไน‰Service็š„้กถ็บงๆŽฅๅฃ,ๅฐ่ฃ…ๅธธ็”จ็š„ๅขžๅˆ ๆŸฅๆ”นๆ“ไฝœ * <p/> * Model : ไปฃ่กจๆ•ฐๆฎๅบ“ไธญ็š„่กจ ๆ˜ ๅฐ„็š„Javaๅฏน่ฑก็ฑปๅž‹ */ public interface GenericService<Model> { /** * ๆ’ๅ…ฅๅฏน่ฑก * @param model ๅฏน่ฑก * @return */ int insertSelective(Model model); /** * ไฟฎๆ”นๅฏน่ฑก * @param modelๅฏน่ฑก * @return */ int updateSelective(Model model); int updateByPrimaryKeySelective(Model record); Model selectByPrimaryKey(String id); /** * ๆ’ๅ…ฅๅฏน่ฑก * * @param model ๅฏน่ฑก */ int insert(Model model); /** * ๆ›ดๆ–ฐๅฏน่ฑก * * @param model ๅฏน่ฑก */ int update(Model model); /** * ๆ‰นๆฌกๅˆ ้™ค * @param ids ไธป้”ฎ * @return */ int delete(Map<String, Object> ids); /** * ้€š่ฟ‡ไธป้”ฎ, ๅˆ ้™คๅฏน่ฑก * * @param id ไธป้”ฎ */ int delete(String id); /** * ้€š่ฟ‡ไธป้”ฎ, ๆŸฅ่ฏขๅฏน่ฑก * * @param id ไธป้”ฎ * @return model ๅฏน่ฑก */ Model selectById(String id); /** * ๆŸฅ่ฏขๅ•ไธชๅฏน่ฑก * * @return ๅฏน่ฑก */ Model selectOne(); /** * ๆŸฅ่ฏขๅคšไธชๅฏน่ฑก * * @return ๅฏน่ฑก้›†ๅˆ */ List<Model> selectList(); /** * ่Žทๅ–ๅคšๆก่ฎฐๅฝ• * @param Map * @return */ List<Model> findListByMapAndPage(Map<String, Object> map, ResultPage<?> resultPage); }
[ "2993277254@qq.com" ]
2993277254@qq.com
69b659849a27077c8572445c705a56443b2feb8f
8de02c99688c15963194edd9f3611c0923d3693f
/ehome-paymentServer/src/main/java/com/busi/payment/unionpay/sdk/HttpClient.java
83c3e9007b1e19af8e1e8733711e048c39a9cf18
[]
no_license
yunjiayuan/ehome
5e6bf4b3e2b826b4fe3dd90ef2bb1a9469d47369
477c890bf35dbf076183a409414c08a336ad2c26
refs/heads/master
2022-06-23T03:29:21.472836
2021-08-10T06:22:21
2021-08-10T06:22:21
143,674,834
2
4
null
2022-06-17T01:56:27
2018-08-06T04:05:12
Java
UTF-8
Java
false
false
8,393
java
/** * * Licensed Property to China UnionPay Co., Ltd. * * (C) Copyright of China UnionPay Co., Ltd. 2010 * All Rights Reserved. * * * Modification History: * ============================================================================= * Author Date Description * ------------ ---------- --------------------------------------------------- * xshu 2014-05-28 HTTP้€šไฟกๅทฅๅ…ท็ฑป * ============================================================================= */ package com.busi.payment.unionpay.sdk; import java.io.BufferedReader; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintStream; import java.io.UnsupportedEncodingException; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.ProtocolException; import java.net.URISyntaxException; import java.net.URL; import java.net.URLConnection; import java.net.URLEncoder; import java.util.Map; import java.util.Map.Entry; import javax.net.ssl.HttpsURLConnection; import com.busi.payment.unionpay.sdk.BaseHttpSSLSocketFactory.TrustAnyHostnameVerifier; public class HttpClient { /** * ็›ฎๆ ‡ๅœฐๅ€ */ private URL url; /** * ้€šไฟก่ฟžๆŽฅ่ถ…ๆ—ถๆ—ถ้—ด */ private int connectionTimeout; /** * ้€šไฟก่ฏป่ถ…ๆ—ถๆ—ถ้—ด */ private int readTimeOut; /** * ้€šไฟก็ป“ๆžœ */ private String result; /** * ่Žทๅ–้€šไฟก็ป“ๆžœ * @return */ public String getResult() { return result; } /** * ่ฎพ็ฝฎ้€šไฟก็ป“ๆžœ * @param result */ public void setResult(String result) { this.result = result; } /** * ๆž„้€ ๅ‡ฝๆ•ฐ * @param url ็›ฎๆ ‡ๅœฐๅ€ * @param connectionTimeout HTTP่ฟžๆŽฅ่ถ…ๆ—ถๆ—ถ้—ด * @param readTimeOut HTTP่ฏปๅ†™่ถ…ๆ—ถๆ—ถ้—ด */ public HttpClient(String url, int connectionTimeout, int readTimeOut) { try { this.url = new URL(url); this.connectionTimeout = connectionTimeout; this.readTimeOut = readTimeOut; } catch (MalformedURLException e) { LogUtil.writeErrorLog(e.getMessage(), e); } } /** * ๅ‘้€ไฟกๆฏๅˆฐๆœๅŠก็ซฏ * @param data * @param encoding * @return * @throws Exception */ public int send(Map<String, String> data, String encoding) throws Exception { try { HttpURLConnection httpURLConnection = createConnection(encoding); if(null == httpURLConnection){ throw new Exception("ๅˆ›ๅปบ่”ๆŽฅๅคฑ่ดฅ"); } String sendData = this.getRequestParamString(data, encoding); LogUtil.writeLog("่ฏทๆฑ‚ๆŠฅๆ–‡:[" + sendData + "]"); this.requestServer(httpURLConnection, sendData, encoding); this.result = this.response(httpURLConnection, encoding); LogUtil.writeLog("ๅŒๆญฅ่ฟ”ๅ›žๆŠฅๆ–‡:[" + result + "]"); return httpURLConnection.getResponseCode(); } catch (Exception e) { throw e; } } /** * ๅ‘้€ไฟกๆฏๅˆฐๆœๅŠก็ซฏ GETๆ–นๅผ * @param data * @param encoding * @return * @throws Exception */ public int sendGet(String encoding) throws Exception { try { HttpURLConnection httpURLConnection = createConnectionGet(encoding); if(null == httpURLConnection){ throw new Exception("ๅˆ›ๅปบ่”ๆŽฅๅคฑ่ดฅ"); } this.result = this.response(httpURLConnection, encoding); LogUtil.writeLog("ๅŒๆญฅ่ฟ”ๅ›žๆŠฅๆ–‡:[" + result + "]"); return httpURLConnection.getResponseCode(); } catch (Exception e) { throw e; } } /** * HTTP Postๅ‘้€ๆถˆๆฏ * * @param connection * @param message * @throws IOException */ private void requestServer(final URLConnection connection, String message, String encoder) throws Exception { PrintStream out = null; try { connection.connect(); out = new PrintStream(connection.getOutputStream(), false, encoder); out.print(message); out.flush(); } catch (Exception e) { throw e; } finally { if (null != out) { out.close(); } } } /** * ๆ˜พ็คบResponseๆถˆๆฏ * * @param connection * @param CharsetName * @return * @throws URISyntaxException * @throws IOException */ private String response(final HttpURLConnection connection, String encoding) throws URISyntaxException, IOException, Exception { InputStream in = null; StringBuilder sb = new StringBuilder(1024); BufferedReader br = null; try { if (200 == connection.getResponseCode()) { in = connection.getInputStream(); sb.append(new String(read(in), encoding)); } else { in = connection.getErrorStream(); sb.append(new String(read(in), encoding)); } LogUtil.writeLog("HTTP Return Status-Code:[" + connection.getResponseCode() + "]"); return sb.toString(); } catch (Exception e) { throw e; } finally { if (null != br) { br.close(); } if (null != in) { in.close(); } if (null != connection) { connection.disconnect(); } } } public static byte[] read(InputStream in) throws IOException { byte[] buf = new byte[1024]; int length = 0; ByteArrayOutputStream bout = new ByteArrayOutputStream(); while ((length = in.read(buf, 0, buf.length)) > 0) { bout.write(buf, 0, length); } bout.flush(); return bout.toByteArray(); } /** * ๅˆ›ๅปบ่ฟžๆŽฅ * * @return * @throws ProtocolException */ private HttpURLConnection createConnection(String encoding) throws ProtocolException { HttpURLConnection httpURLConnection = null; try { httpURLConnection = (HttpURLConnection) url.openConnection(); } catch (IOException e) { LogUtil.writeErrorLog(e.getMessage(), e); return null; } httpURLConnection.setConnectTimeout(this.connectionTimeout);// ่ฟžๆŽฅ่ถ…ๆ—ถๆ—ถ้—ด httpURLConnection.setReadTimeout(this.readTimeOut);// ่ฏปๅ–็ป“ๆžœ่ถ…ๆ—ถๆ—ถ้—ด httpURLConnection.setDoInput(true); // ๅฏ่ฏป httpURLConnection.setDoOutput(true); // ๅฏๅ†™ httpURLConnection.setUseCaches(false);// ๅ–ๆถˆ็ผ“ๅญ˜ httpURLConnection.setRequestProperty("Content-type", "application/x-www-form-urlencoded;charset=" + encoding); httpURLConnection.setRequestMethod("POST"); if ("https".equalsIgnoreCase(url.getProtocol())) { HttpsURLConnection husn = (HttpsURLConnection) httpURLConnection; husn.setSSLSocketFactory(new BaseHttpSSLSocketFactory()); husn.setHostnameVerifier(new TrustAnyHostnameVerifier());//่งฃๅ†ณ็”ฑไบŽๆœๅŠกๅ™จ่ฏไนฆ้—ฎ้ข˜ๅฏผ่‡ดHTTPSๆ— ๆณ•่ฎฟ้—ฎ็š„ๆƒ…ๅ†ต return husn; } return httpURLConnection; } /** * ๅˆ›ๅปบ่ฟžๆŽฅ * * @return * @throws ProtocolException */ private HttpURLConnection createConnectionGet(String encoding) throws ProtocolException { HttpURLConnection httpURLConnection = null; try { httpURLConnection = (HttpURLConnection) url.openConnection(); } catch (IOException e) { LogUtil.writeErrorLog(e.getMessage(), e); return null; } httpURLConnection.setConnectTimeout(this.connectionTimeout);// ่ฟžๆŽฅ่ถ…ๆ—ถๆ—ถ้—ด httpURLConnection.setReadTimeout(this.readTimeOut);// ่ฏปๅ–็ป“ๆžœ่ถ…ๆ—ถๆ—ถ้—ด httpURLConnection.setUseCaches(false);// ๅ–ๆถˆ็ผ“ๅญ˜ httpURLConnection.setRequestProperty("Content-type", "application/x-www-form-urlencoded;charset=" + encoding); httpURLConnection.setRequestMethod("GET"); if ("https".equalsIgnoreCase(url.getProtocol())) { HttpsURLConnection husn = (HttpsURLConnection) httpURLConnection; husn.setSSLSocketFactory(new BaseHttpSSLSocketFactory()); husn.setHostnameVerifier(new TrustAnyHostnameVerifier());//่งฃๅ†ณ็”ฑไบŽๆœๅŠกๅ™จ่ฏไนฆ้—ฎ้ข˜ๅฏผ่‡ดHTTPSๆ— ๆณ•่ฎฟ้—ฎ็š„ๆƒ…ๅ†ต return husn; } return httpURLConnection; } /** * ๅฐ†Mapๅญ˜ๅ‚จ็š„ๅฏน่ฑก๏ผŒ่ฝฌๆขไธบkey=value&key=value็š„ๅญ—็ฌฆ * * @param requestParam * @param coder * @return */ private String getRequestParamString(Map<String, String> requestParam, String coder) { if (null == coder || "".equals(coder)) { coder = "UTF-8"; } StringBuffer sf = new StringBuffer(""); String reqstr = ""; if (null != requestParam && 0 != requestParam.size()) { for (Entry<String, String> en : requestParam.entrySet()) { try { sf.append(en.getKey() + "=" + (null == en.getValue() || "".equals(en.getValue()) ? "" : URLEncoder .encode(en.getValue(), coder)) + "&"); } catch (UnsupportedEncodingException e) { LogUtil.writeErrorLog(e.getMessage(), e); return ""; } } reqstr = sf.substring(0, sf.length() - 1); } LogUtil.writeLog("่ฏทๆฑ‚ๆŠฅๆ–‡(ๅทฒๅš่ฟ‡URLEncode็ผ–็ ):[" + reqstr + "]"); return reqstr; } }
[ "552440192@qq.com" ]
552440192@qq.com
4cd0775fdaa28f8c3034c41e885dc6b1e7fe0365
ee6746ad4177f818113f56faf03a13c4079cf7c4
/Maps-Assignment 7/src/eg/edu/alexu/csd/datastructure/maze/cs49/MazeSolver.java
504afc313dae8e8173ca9f6ea6119ef3454c42f0
[]
no_license
El-Begawy/DS-1
ba240672f53088c84d561d19a3b54d6ddd59c501
203aa6e9227f83735e430a7155145c9b6e079862
refs/heads/master
2020-04-27T11:55:22.292890
2020-02-15T15:43:37
2020-02-15T15:43:37
174,314,447
0
0
null
2019-04-25T20:57:43
2019-03-07T09:34:15
HTML
UTF-8
Java
false
false
5,975
java
package eg.edu.alexu.csd.datastructure.maze.cs49; import java.awt.Point; import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; public class MazeSolver implements IMazeSolver { private int n; private int m; private Point S = new Point(); private class Node { Node father; Point coords; } private int[][] Pather(Node ref) { Node tempnode = ref; int size; for(size = 0; ref != null; ref = ref.father) { ++size; } int[][] path = new int[size][2]; int i = size - 1; for(ref = tempnode; ref != null; ref = ref.father) { Point temp = ref.coords; path[i][0] = temp.y; path[i--][1] = temp.x; } return path; } private char[][] prepare(File maze) { Scanner sc; try { sc = new Scanner(maze); } catch (FileNotFoundException E) { throw new RuntimeException("File not found"); } boolean Existence = false , Startup = false; n = sc.nextInt(); m = sc.nextInt(); char[][] Map = new char[n][m]; for(int i = 0; i < n; ++i) { String x = sc.next(); if(x.length() != m) throw new RuntimeException("Incorrect width"); for(int j = 0; j < m; ++j) { Map[i][j] = x.charAt(j); if (Map[i][j] == 'S') { Startup = true; S.y = i; S.x = j; } if (Map[i][j] == 'E') { Existence = true; } } } if(!Existence || !Startup) throw new RuntimeException("Map doesn't have an exit or a start"); return Map; } public int[][] solveBFS(File maze) { char[][] Map = prepare(maze); LinkedQueue Nodes = new LinkedQueue(); Point T = S; Node current = new Node(); current.coords = S; boolean[][] Visited = new boolean[n][m]; Nodes.enqueue(current); boolean success = false; while(!Nodes.isEmpty()) { current = (Node)Nodes.dequeue(); T = current.coords; Visited[T.y][T.x] = true; if (Map[T.y][T.x] == 'E') { success = true; break; } Node temp2; Point temp; if (T.y + 1 < n && Map[T.y + 1][T.x] != '#' && !Visited[T.y + 1][T.x]) { temp2 = new Node(); temp = new Point(); temp.y = T.y + 1; temp.x = T.x; temp2.coords = temp; temp2.father = current; Nodes.enqueue(temp2); } if (T.y - 1 >= 0 && Map[T.y - 1][T.x] != '#' && !Visited[T.y - 1][T.x]) { temp2 = new Node(); temp = new Point(); temp.y = T.y - 1; temp.x = T.x; temp2.coords = temp; temp2.father = current; Nodes.enqueue(temp2); } if (T.x + 1 < m && Map[T.y][T.x + 1] != '#' && !Visited[T.y][T.x + 1]) { temp2 = new Node(); temp = new Point(); temp.y = T.y; temp.x = T.x + 1; temp2.coords = temp; temp2.father = current; Nodes.enqueue(temp2); } if (T.x - 1 >= 0 && Map[T.y][T.x - 1] != '#' && !Visited[T.y][T.x - 1]) { temp2 = new Node(); temp = new Point(); temp.y = T.y; temp.x = T.x - 1; temp2.coords = temp; temp2.father = current; Nodes.enqueue(temp2); } } if (success) { int[][] path = Pather(current); return path; } else { return null; } } public int[][] solveDFS(File maze) { char[][] Map = prepare(maze); Stack Nodes = new Stack(); Point T = S; Node current = new Node(); current.coords = S; boolean[][] Visited = new boolean[n][m]; Nodes.push(current); boolean success = false; while(!Nodes.isEmpty()) { current = (Node)Nodes.pop(); T = current.coords; Visited[T.y][T.x] = true; if (Map[T.y][T.x] == 'E') { success = true; break; } Node temp2 = new Node(); Point temp = new Point(); if (T.y + 1 < n && Map[T.y + 1][T.x] != '#' && !Visited[T.y + 1][T.x]) { temp.y = T.y + 1; temp.x = T.x; temp2.coords = temp; temp2.father = current; Nodes.push(temp2); } if (T.y - 1 >= 0 && Map[T.y - 1][T.x] != '#' && !Visited[T.y - 1][T.x]) { temp.y = T.y - 1; temp.x = T.x; temp2.coords = temp; temp2.father = current; Nodes.push(temp2); } if (T.x + 1 < m && Map[T.y][T.x + 1] != '#' && !Visited[T.y][T.x + 1]) { temp.y = T.y; temp.x = T.x + 1; temp2.coords = temp; temp2.father = current; Nodes.push(temp2); } if (T.x - 1 >= 0 && Map[T.y][T.x - 1] != '#' && !Visited[T.y][T.x - 1]) { temp.y = T.y; temp.x = T.x - 1; temp2.coords = temp; temp2.father = current; Nodes.push(temp2); } } if (success) { int[][] path = Pather(current); return path; } else { return null; } } }
[ "45739074+El-Begawy@users.noreply.github.com" ]
45739074+El-Begawy@users.noreply.github.com
d489a18a0f9d733ce12fd8243d1fc4cec8541d70
753244933fc4465b0047821aea81c311738e1732
/core/target/java-D no-inline/ts5/src/thx/Floats.java
e1e9b6a0cdec23d9b0cd09663d451c745e5fc618
[ "MIT" ]
permissive
mboussaa/HXvariability
abfaba5452fecb1b83bc595dc3ed942a126510b8
ea32b15347766b6e414569b19cbc113d344a56d9
refs/heads/master
2021-01-01T17:45:54.656971
2017-07-26T01:27:49
2017-07-26T01:27:49
98,127,672
0
0
null
null
null
null
UTF-8
Java
false
true
15,446
java
// Generated by Haxe 3.3.0 package thx; import haxe.root.*; @SuppressWarnings(value={"rawtypes", "unchecked"}) public class Floats extends haxe.lang.HxObject { static { //line 7 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" thx.Floats.TOLERANCE = 10e-5; //line 11 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" thx.Floats.EPSILON = 1e-9; //line 13 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" thx.Floats.pattern_parse = new haxe.root.EReg("^(\\+|-)?\\d+(\\.\\d+)?(e-?\\d+)?$", ""); //line 245 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" thx.Floats.order = ((haxe.lang.Function) (thx._Ord.Ord_Impl_.fromIntComparison(((haxe.lang.Function) (new haxe.lang.Closure(thx.Floats.class, "compare")) ))) ); //line 248 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" java.lang.Object __temp_stmt2 = null; //line 248 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" { //line 248 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" haxe.lang.Function __temp_odecl1 = ( (( thx.Floats_Anon_248__Fun.__hx_current != null )) ? (thx.Floats_Anon_248__Fun.__hx_current) : (thx.Floats_Anon_248__Fun.__hx_current = ((thx.Floats_Anon_248__Fun) (new thx.Floats_Anon_248__Fun()) )) ); //line 248 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" __temp_stmt2 = new haxe.lang.DynamicObject(new java.lang.String[]{"append"}, new java.lang.Object[]{__temp_odecl1}, new java.lang.String[]{"zero"}, new double[]{((double) (0.0) )}); } //line 247 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" thx.Floats.monoid = ((java.lang.Object) (__temp_stmt2) ); } public Floats(haxe.lang.EmptyObject empty) { } public Floats() { //line 6 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" thx.Floats.__hx_ctor_thx_Floats(this); } public static void __hx_ctor_thx_Floats(thx.Floats __temp_me83) { } public static double TOLERANCE; public static double EPSILON; public static haxe.root.EReg pattern_parse; public static double angleDifference(double a, double b, java.lang.Object turn) { //line 18 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" java.lang.Object __temp_turn74 = ( (haxe.lang.Runtime.eq(turn, null)) ? (((java.lang.Object) (360.0) )) : (turn) ); //line 19 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" double r = ( ((double) ((( b - a ))) ) % ((double) (haxe.lang.Runtime.toDouble(__temp_turn74)) ) ); //line 20 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" if (( r < 0 )) { //line 21 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" r = ((double) (haxe.lang.Runtime.toDouble(haxe.lang.Runtime.plus(r, __temp_turn74))) ); } //line 22 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" if (( r > ( ((double) (haxe.lang.Runtime.toDouble(__temp_turn74)) ) / ((double) (2) ) ) )) { //line 23 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" r = ( ((double) (r) ) - ((double) (haxe.lang.Runtime.toDouble(__temp_turn74)) ) ); } //line 24 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return r; } public static double ceilTo(double f, int decimals) { //line 31 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" double p = java.lang.Math.pow(((double) (10) ), ((double) (decimals) )); //line 32 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return ( java.lang.Math.ceil(( f * p )) / p ); } public static boolean canParse(java.lang.String s) { //line 39 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return thx.Floats.pattern_parse.match(s); } public static double clamp(double v, double min, double max) { //line 51 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" if (( v < min )) { //line 51 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return min; } else { //line 51 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" if (( v > max )) { //line 51 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return max; } else { //line 51 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return v; } } } public static double clampSym(double v, double max) { //line 58 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return thx.Floats.clamp(v, - (max) , max); } public static int compare(double a, double b) { //line 64 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" if (( a < b )) { //line 64 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return -1; } else { //line 64 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" if (( a > b )) { //line 64 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return 1; } else { //line 64 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return 0; } } } public static double floorTo(double f, int decimals) { //line 70 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" double p = java.lang.Math.pow(((double) (10) ), ((double) (decimals) )); //line 71 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return ( java.lang.Math.floor(( f * p )) / p ); } public static double interpolate(double f, double a, double b) { //line 78 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return ( ( (( b - a )) * f ) + a ); } public static double interpolateAngle(double f, double a, double b, java.lang.Object turn) { //line 86 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" double __temp_turn75 = ( (haxe.lang.Runtime.eq(turn, null)) ? (((double) (360) )) : (((double) (haxe.lang.Runtime.toDouble(turn)) )) ); //line 86 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return thx.Floats.wrapCircular(thx.Floats.interpolate(f, a, ( a + thx.Floats.angleDifference(a, b, __temp_turn75) )), __temp_turn75); } public static double interpolateAngleWidest(double f, double a, double b, java.lang.Object turn) { //line 94 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" double __temp_turn76 = ( (haxe.lang.Runtime.eq(turn, null)) ? (((double) (360) )) : (((double) (haxe.lang.Runtime.toDouble(turn)) )) ); //line 94 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return thx.Floats.wrapCircular(( thx.Floats.interpolateAngle(f, a, b, __temp_turn76) - ( __temp_turn76 / 2 ) ), __temp_turn76); } public static double interpolateAngleCW(double f, double a, double b, java.lang.Object turn) { //line 100 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" double __temp_turn77 = ( (haxe.lang.Runtime.eq(turn, null)) ? (((double) (360) )) : (((double) (haxe.lang.Runtime.toDouble(turn)) )) ); //line 101 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" a = thx.Floats.wrapCircular(a, __temp_turn77); //line 102 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" b = thx.Floats.wrapCircular(b, __temp_turn77); //line 103 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" if (( b < a )) { //line 104 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" b += __temp_turn77; } //line 105 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return thx.Floats.wrapCircular(thx.Floats.interpolate(f, a, b), __temp_turn77); } public static double interpolateAngleCCW(double f, double a, double b, java.lang.Object turn) { //line 111 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" double __temp_turn78 = ( (haxe.lang.Runtime.eq(turn, null)) ? (((double) (360) )) : (((double) (haxe.lang.Runtime.toDouble(turn)) )) ); //line 112 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" a = thx.Floats.wrapCircular(a, __temp_turn78); //line 113 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" b = thx.Floats.wrapCircular(b, __temp_turn78); //line 114 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" if (( b > a )) { //line 115 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" b -= __temp_turn78; } //line 116 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return thx.Floats.wrapCircular(thx.Floats.interpolate(f, a, b), __temp_turn78); } public static <T> T max(T a, T b) { //line 123 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" if (( haxe.lang.Runtime.compare(a, b) > 0 )) { //line 123 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return a; } else { //line 123 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return b; } } public static <T> T min(T a, T b) { //line 129 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" if (( haxe.lang.Runtime.compare(a, b) < 0 )) { //line 129 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return a; } else { //line 129 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return b; } } public static boolean nearEquals(double a, double b, java.lang.Object tollerance) { //line 136 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" java.lang.Object __temp_tollerance79 = ( (haxe.lang.Runtime.eq(tollerance, null)) ? (((java.lang.Object) (1e-9) )) : (tollerance) ); //line 137 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" if (haxe.lang.Runtime.isFinite(a)) { //line 139 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" if ( ! (haxe.lang.Runtime.isFinite(b)) ) { //line 140 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return false; } //line 142 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return ( haxe.lang.Runtime.compare(java.lang.Math.abs(( a - b )), __temp_tollerance79) <= 0 ); } //line 144 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" if (java.lang.Double.isNaN(a)) { //line 145 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return java.lang.Double.isNaN(b); } //line 146 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" if (java.lang.Double.isNaN(b)) { //line 147 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return false; } //line 148 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" if ( ! (haxe.lang.Runtime.isFinite(b)) ) { //line 149 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return ( ( a > 0 ) == ( b > 0 ) ); } //line 151 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return false; } public static boolean nearEqualAngles(double a, double b, java.lang.Object turn, java.lang.Object tollerance) { //line 161 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" java.lang.Object __temp_tollerance81 = ( (haxe.lang.Runtime.eq(tollerance, null)) ? (((java.lang.Object) (1e-9) )) : (tollerance) ); //line 161 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" java.lang.Object __temp_turn80 = ( (haxe.lang.Runtime.eq(turn, null)) ? (((java.lang.Object) (360.0) )) : (turn) ); //line 161 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return ( haxe.lang.Runtime.compare(java.lang.Math.abs(thx.Floats.angleDifference(a, b, __temp_turn80)), __temp_tollerance81) <= 0 ); } public static boolean nearZero(double n, java.lang.Object tollerance) { //line 168 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" java.lang.Object __temp_tollerance82 = ( (haxe.lang.Runtime.eq(tollerance, null)) ? (((java.lang.Object) (1e-9) )) : (tollerance) ); //line 168 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return ( haxe.lang.Runtime.compare(java.lang.Math.abs(n), __temp_tollerance82) <= 0 ); } public static double normalize(double v) { //line 174 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return thx.Floats.clamp(v, ((double) (0) ), ((double) (1) )); } public static double parse(java.lang.String s) { //line 180 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" if (haxe.lang.Runtime.valEq(haxe.lang.StringExt.substring(s, 0, 1), "+")) { //line 181 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" s = haxe.lang.StringExt.substring(s, 1, null); } //line 182 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return haxe.root.Std.parseFloat(s); } public static double root(double base, double index) { //line 189 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return java.lang.Math.pow(base, ( 1 / index )); } public static double roundTo(double f, int decimals) { //line 195 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" double p = java.lang.Math.pow(((double) (10) ), ((double) (decimals) )); //line 196 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return ( java.lang.Math.floor(( ( f * p ) + 0.5 )) / p ); } public static <T> int sign(T value) { //line 203 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" if (( haxe.lang.Runtime.compare(value, 0) < 0 )) { //line 203 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return -1; } else { //line 203 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return 1; } } public static java.lang.String toString(double v) { //line 206 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return ( "" + haxe.lang.Runtime.toString(v) ); } public static double toFloat(java.lang.String s) { //line 212 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return thx.Floats.parse(s); } public static int trunc(double value) { //line 215 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" if (( value < 0.0 )) { //line 215 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return ((int) (java.lang.Math.ceil(value)) ); } else { //line 215 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return ((int) (java.lang.Math.floor(value)) ); } } public static double ftrunc(double value) { //line 218 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" if (( value < 0.0 )) { //line 218 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return java.lang.Math.ceil(value); } else { //line 218 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return java.lang.Math.floor(value); } } public static double wrap(double v, double min, double max) { //line 227 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" double range = ( ( max - min ) + 1 ); //line 228 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" if (( v < min )) { //line 228 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" v += ( range * (( ( (( min - v )) / range ) + 1 )) ); } //line 229 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return ( min + ( (( v - min )) % range ) ); } public static double wrapCircular(double v, double max) { //line 236 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" v %= max; //line 237 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" if (( v < 0 )) { //line 238 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" v += max; } //line 239 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return v; } public static haxe.lang.Function order; public static java.lang.Object monoid; public static java.lang.Object __hx_createEmpty() { //line 6 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return new thx.Floats(haxe.lang.EmptyObject.EMPTY); } public static java.lang.Object __hx_create(haxe.root.Array arr) { //line 6 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Floats.hx" return new thx.Floats(); } }
[ "mohamed.boussaa@inria.fr" ]
mohamed.boussaa@inria.fr
edc39b288b7d7925dc86806b97a6d5e11fbded22
7991248e6bccacd46a5673638a4e089c8ff72a79
/storage/common/src/main/java/org/artifactory/model/xstream/fs/InternalFolderInfo.java
6bcf427cb2ff079b2e8d4cb19fd0520316c88150
[]
no_license
theoriginalshaheedra/artifactory-oss
69b7f6274cb35c79db3a3cd613302de2ae019b31
415df9a9467fee9663850b4b8b4ee5bd4c23adeb
refs/heads/master
2023-04-23T15:48:36.923648
2021-05-05T06:15:24
2021-05-05T06:15:24
364,455,815
1
0
null
2021-05-05T07:11:40
2021-05-05T03:57:33
Java
UTF-8
Java
false
false
1,095
java
/* * * Artifactory is a binaries repository manager. * Copyright (C) 2018 JFrog Ltd. * * Artifactory is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Artifactory 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with Artifactory. If not, see <http://www.gnu.org/licenses/>. * */ package org.artifactory.model.xstream.fs; import org.artifactory.fs.MutableFolderInfo; /** * @author Yoav Landman */ public interface InternalFolderInfo extends InternalItemInfo, MutableFolderInfo { void setAdditionalInfo(FolderAdditionalInfo additionalInfo); @Override FolderAdditionalInfo getAdditionalInfo(); }
[ "david.monichi@gmail.com" ]
david.monichi@gmail.com
4e9c3938c0212f3455a2a31510bc20f327d124ff
1537097a198c02d82f44fcfb53439f713471451b
/src/main/java/com/skilldistillery/film/dao/FilmDAO.java
188dd6625a0195714ede8b91645c5bbdfa1d4dd4
[]
no_license
tjteruel/SpringMVCFilmCRUD
53681c79e56965b39edf8253e836e3e73082b581
fcfd422d0debb02770bf67da43a282a2afecfdb5
refs/heads/master
2021-03-20T03:20:58.472706
2020-03-16T16:52:25
2020-03-16T16:52:25
247,170,793
0
0
null
null
null
null
UTF-8
Java
false
false
504
java
package com.skilldistillery.film.dao; import java.sql.SQLException; import java.util.List; import com.skilldistillery.film.entities.Actor; import com.skilldistillery.film.entities.Film; public interface FilmDAO { public Film findFilmById(int filmId) throws SQLException; public Actor findActorById(int actorId); public List<Actor> findActorsByFilmId(int filmId); public List<Film> findFilmByKeyword(String keyword); boolean deleteFilm(int filmId); public boolean updateFilm(Film film); }
[ "timteruel@Administrators-MacBook-Pro.local" ]
timteruel@Administrators-MacBook-Pro.local
27152802bec7ddbd377f63bb823058399b530183
7405c95f3178292b1fdb157d8e55f29731622b63
/app/src/androidTest/java/com/example/castle/uimodern/ApplicationTest.java
12e91b07e9b33814f5bdd20071a7b94195befc9b
[]
no_license
rumeldutta/UIModern
dbe166ec3ff52adbe40b0a06d08cc56d3eee254c
ef63b71fe0ddcc660a037ed24c484434d91f564a
refs/heads/master
2016-09-06T02:32:24.523397
2015-08-27T17:29:54
2015-08-27T17:29:54
41,501,374
0
0
null
null
null
null
UTF-8
Java
false
false
358
java
package com.example.castle.uimodern; 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); } }
[ "rumeldutta@gmail.com" ]
rumeldutta@gmail.com
3ca535189cfe3208acfb1a06df40ebc355396888
7a7df066a6bb3fb4bb1a24cf1307308cd670b279
/src/TrabalhoFinal/Cliente.java
e484961ce5b0397d2791c81eb040a4679792c3e4
[]
no_license
brm12/TrabalhoFinalPOO
6c2a9f139c3e1fdbf1f03b67567ad5decec6e548
984bc1c939264526ee34fd9139fad1849a364e2e
refs/heads/master
2020-02-26T13:15:50.245284
2014-11-23T19:36:01
2014-11-23T19:36:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
264
java
package TrabalhoFinal; public class Cliente extends Pessoa { private int codigoCliente; public void setCodigoCliente(int codigoCliente){ this.codigoCliente=codigoCliente; } public int getCodigoCliente(){ return this.codigoCliente; } }
[ "weryquessantosdasilva@MacBook-Pro-de-Weryques.local" ]
weryquessantosdasilva@MacBook-Pro-de-Weryques.local
a7b9f043c617e9dc2f6f23200d54b0bf77f45562
f885d5c7169291492c17b2c95a3bafe8be1ad56c
/dojooverflow/src/main/java/com/ashley/dojooverflow/repositories/AnswerRepo.java
4d3e7ede191a18ea967d69e0835e8ad9869de871
[]
no_license
ashcastillo76/javapractice
463bf3cd6d2b7dcc7a173018bd5fdb880e9ec883
b2e4f72210d97472632c087f223500d95cff2232
refs/heads/main
2023-06-13T04:51:41.332709
2021-06-30T22:03:14
2021-06-30T22:03:14
374,809,054
0
0
null
null
null
null
UTF-8
Java
false
false
273
java
package com.ashley.dojooverflow.repositories; import java.util.List; import org.springframework.data.repository.CrudRepository; import com.ashley.dojooverflow.models.Answer; public interface AnswerRepo extends CrudRepository<Answer, Long> { List<Answer> findAll(); }
[ "ashcastillo76@gmail.com" ]
ashcastillo76@gmail.com
f393e43f31e3b10dd339f1311b30ee0769119028
da93cabeabcb2ec3e803d34c5e09759dd004d05f
/stream/src/main/java/org/springframework/cloud/sample/stream/controller/SendingController.java
f94942053cc9fdf492cd5d23c4fcbe9490b13a88
[]
no_license
barryTT/spring-cloud-sample
39f39f1660d5ddc0a5504ac6b129dcfa9de7b94d
db77c3f02074a14e58f1fdc7d47646dcbce814b8
refs/heads/master
2021-07-30T11:30:47.603463
2017-05-04T03:22:38
2017-05-04T03:22:38
86,687,978
3
0
null
null
null
null
UTF-8
Java
false
false
2,232
java
package org.springframework.cloud.sample.stream.controller; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cloud.stream.annotation.EnableBinding; import org.springframework.cloud.stream.messaging.Source; import org.springframework.messaging.support.MessageBuilder; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.util.LinkedHashMap; import java.util.Map; @RestController @EnableBinding(Source.class) public class SendingController { @Autowired private Source source; @RequestMapping("/send") public String sendMessage(@RequestParam String message) { source.output().send(MessageBuilder.withPayload(message).build()); return "OK"; } @RequestMapping("/test") public String sendMessage() { ObjectMapper objectMapper = new ObjectMapper(); Map<String, Object> message = new LinkedHashMap<>(); Map<String, Object> data = new LinkedHashMap<>(); message.put("send_time", System.currentTimeMillis()); message.put("data", data); data.put("company_id", 1); data.put("user_id", 351); data.put("staff_id", 62); data.put("name", "ๅ•ๆด‹"); data.put("mobile", "18443167555"); data.put("company", "ๅ›ฝ็พŽไบ’่”็ฝ‘็”Ÿๆ€๏ผˆๅˆ†ไบซ๏ผ‰็ง‘ๆŠ€ๅ…ฌๅธ"); data.put("platForm", "web"); data.put("version", "other"); message.put("action", "CREATE"); message.put("type", "oa.user"); try { for (int i = 0; i < 1000; i++) { data.put("registerTime", System.currentTimeMillis()); source.output().send(MessageBuilder.withPayload(objectMapper.writeValueAsString(message)).build()); } } catch (JsonProcessingException e) { e.printStackTrace(); } return "OK"; } }
[ "gang.db@gmail.com" ]
gang.db@gmail.com
3db17f0090bb3d8032f31353a4b12126dc814b8b
fcf313fd4a677947d799f27f2e1ae7a16ca7bd89
/app/src/main/java/com/cdelgado/mimartillocom/GestorSesiones.java
14520c69b6eee2f0ee1f23c229a52fc8dc5163eb
[]
no_license
cdelg4do/mimartillo-android
d5b9f2eab129b009b4c8ccda6bf87172c04218ec
2628d335ac51819b684cd354cfb6ddef4d18fe08
refs/heads/master
2021-01-19T17:24:27.259296
2017-05-04T00:56:53
2017-05-04T00:56:53
59,529,499
0
0
null
null
null
null
UTF-8
Java
false
false
7,513
java
package com.cdelgado.mimartillocom; import java.util.HashMap; import android.content.Context; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; public class GestorSesiones { public static enum TipoUsuario { PARTICULAR, PROFESIONAL } /* public static enum estadoCredenciales { OK, INVALID, EXPIRED, DISABLED, NONEXISTENT, UNKNOWN } */ private static final int acceso_preferencias = Context.MODE_PRIVATE; // Modo de Shared Preferences private SharedPreferences prefUsuario; // Shared Preferences del usuario (particular o profesional) private Editor editorUsuario; // Editor para las Shared Preferences del usuario private SharedPreferences prefGeneral; // Shared Preferences generales (configuraciรณn del cliente, independiente del tipo de usuario) private Editor editorGeneral; // Editor para las Shared Preferences generales private Context contexto; // Contexto private static String PREFERENCIAS_USUARIO; // Indica el nombre de la colecciรณn de preferencias a utilizar por el usuario public static final String PREFERENCIAS_GENERAL = "Preferencias_general"; // Indica el nombre de la colecciรณn de preferencias generales // Posibles valores para el nombre de la colecciรณn de preferencias de usuario public static final String PREF_PARTICULAR = "Preferencias_particular"; public static final String PREF_PROFESIONAL = "Preferencias_profesional"; // Claves para acceder a los valores de las preferencias de usuario public static final String KEY_NOMBRE = "nombre"; public static final String KEY_EMAIL = "email"; public static final String KEY_USUARIO = "id_usuario"; public static final String KEY_SESION = "id_sesion"; public static final String KEY_AVATAR = "avatar"; private static final String SESION_GUARDADA = "hay_sesion"; // Claves para acceder a los valores de las preferencias generales public static final String KEY_HTTPS = "usar_https"; public static final String TEMP_DATA = "temp"; // Constructor public GestorSesiones(Context c, TipoUsuario tipo) { this.contexto = c; // Determinar el tipo de usuario para las preferencias de usuario switch (tipo) { case PARTICULAR: PREFERENCIAS_USUARIO = PREF_PARTICULAR; break; case PROFESIONAL: PREFERENCIAS_USUARIO = PREF_PROFESIONAL; break; } prefUsuario = contexto.getSharedPreferences(PREFERENCIAS_USUARIO, acceso_preferencias); editorUsuario = prefUsuario.edit(); // Preferencias generales prefGeneral = contexto.getSharedPreferences(PREFERENCIAS_GENERAL, acceso_preferencias); editorGeneral = prefGeneral.edit(); } // Guardar un inicio de sesion public void guardarSesion(String nombre, String email, String usuario, String sesion, String imagen_base64) { editorUsuario.putString(KEY_NOMBRE, nombre); editorUsuario.putString(KEY_EMAIL, email); editorUsuario.putString(KEY_USUARIO, usuario); editorUsuario.putString(KEY_SESION, sesion); editorUsuario.putString(KEY_AVATAR, imagen_base64); editorUsuario.putBoolean(SESION_GUARDADA, true); editorUsuario.commit(); } // Actualizar los datos de una sesiรณn (nombre) // siempre y cuando ya existiera una sesiรณn que actualizar public void actualizarDatos(String nombre) { if ( prefUsuario.getBoolean(SESION_GUARDADA,false) ) { editorUsuario.putString(KEY_NOMBRE, nombre); editorUsuario.commit(); } } // Actualizar los datos de una sesiรณn (nombre y email) // siempre y cuando ya existiera una sesiรณn que actualizar public void actualizarDatos(String nombre, String email) { if ( prefUsuario.getBoolean(SESION_GUARDADA,false) ) { editorUsuario.putString(KEY_NOMBRE, nombre); editorUsuario.putString(KEY_EMAIL, email); editorUsuario.commit(); } } // Actualizar los datos de una sesiรณn (nombre, email y avatar) // siempre y cuando ya existiera una sesiรณn que actualizar public void actualizarDatos(String nombre, String email, String imagen_base64) { if ( prefUsuario.getBoolean(SESION_GUARDADA,false) ) { editorUsuario.putString(KEY_NOMBRE, nombre); editorUsuario.putString(KEY_EMAIL, email); editorUsuario.putString(KEY_AVATAR, imagen_base64); editorUsuario.commit(); } } // Actualizar la preferencia del protocolo de comunicaciรณn // (es un ajuste general, se actualiza aunque no haya una sesiรณn guardada) public void setConexionSegura(boolean conexionSegura) { editorGeneral.putBoolean(KEY_HTTPS, conexionSegura); editorGeneral.commit(); } // Guardar un string como dato temporal en los ajustes generales // (รบtil para pasar informaciรณn que no puede ser pasada a travรฉs de un intent por ser demasiado grande) public void setDatosTemporales(String datos) { editorGeneral.putString(TEMP_DATA, datos); editorGeneral.commit(); } // Eliminar los datos temporales (si los hubiera) de las preferencias generales public void removeDatosTemporales() { editorGeneral.remove(TEMP_DATA); editorGeneral.commit(); } // Obtener los datos temporales (si los hubiera) de las preferencias generales // Si no hay datos temporales almacenados, devuelve null public String getDatosTemporales() { return prefGeneral.getString(TEMP_DATA, null); } // Obtener los datos de la sesion almacenados // (incluye tanto preferencias de usuario como preferencas generales) public HashMap<String, String> getDatosSesion() { HashMap<String, String> datos = new HashMap<String, String>(); datos.put(KEY_NOMBRE, prefUsuario.getString(KEY_NOMBRE, null)); datos.put(KEY_EMAIL, prefUsuario.getString(KEY_EMAIL, null)); datos.put(KEY_USUARIO, prefUsuario.getString(KEY_USUARIO, null)); datos.put(KEY_SESION, prefUsuario.getString(KEY_SESION, null)); datos.put(KEY_AVATAR, prefUsuario.getString(KEY_AVATAR, null)); datos.put(KEY_HTTPS, Boolean.toString( usarConexionSegura() )); return datos; } // Cerrar una sesion (elimina todos los datos de la sesiรณn del usuario de las Shared Preferences) public void destruirSesion() { editorUsuario.clear(); editorUsuario.commit(); } // Indica si hay almacenados datos de una sesion en las preferencias de usuario public boolean hayDatosSesion() { return prefUsuario.getBoolean(SESION_GUARDADA,false); } // Indica si se debe usar una conexiรณn segura para las conexiones con el servidor // Serรก false solo si el campo KEY_HTTPS existe en las pref. generales y su valor es false. // En caso contrario (el campo KEY_HTTPS aรบn no existe, o existe y es true), serรก true. // (de este modo, en la primera ejecuciรณn de la aplicaciรณn se usarรก una conexiรณn segura por defecto) public boolean usarConexionSegura() { return prefGeneral.getBoolean(KEY_HTTPS, true); } }
[ "carlos.delgado.andres@gmail.com" ]
carlos.delgado.andres@gmail.com
bb3f77a1bf402dcba7c4f72f1eed4d6efb7db15e
ec8c4624c329e1b62b6b5161623d3b4846e2da37
/src/main/java/dom/DomRecipient.java
a765bcf6dbb5c8b4b7766f33517123aa36590be7
[]
no_license
DashaMihai/Project
f7e1c49c6baa94386b9f7f3a63252b7861715ac2
a1e41a3ff6913ea6140050268fa12ee38b8796b5
refs/heads/master
2020-03-29T06:35:12.714909
2018-09-20T15:49:05
2018-09-20T15:49:05
149,631,544
0
0
null
null
null
null
UTF-8
Java
false
false
1,366
java
package dom; import java.io.FileNotFoundException; import java.util.ArrayList; import java.util.List; import javax.xml.stream.XMLStreamException; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import model.Recipients; public class DomRecipient { public List<Recipients> parse(Document document) throws FileNotFoundException, XMLStreamException { NodeList nodeList = document.getElementsByTagName("Recipient"); List<Recipients> recipients = new ArrayList<Recipients>(); for (int i = 0; i < nodeList.getLength(); i++) { recipients.add(getRecipient(nodeList.item(i))); } return recipients; } private static Recipients getRecipient(Node node) { NamedNodeMap attributes = node.getAttributes(); Node nameAttrib = attributes.getNamedItem("id"); String id = nameAttrib.getNodeValue(); Recipients recipient = new Recipients(); Element element = (Element) node; recipient.setId(Integer.parseInt(id)); recipient.setEmail(getTagValue("email", element)); recipient.setText(getTagValue("text", element)); return recipient; } private static String getTagValue(String tag, Element element) { NodeList nodeList = element.getElementsByTagName(tag).item(0).getChildNodes(); Node node = nodeList.item(0); return node.getNodeValue(); } }
[ "dashamihai@mail.ru" ]
dashamihai@mail.ru
b138f384782d84963f2f58ed27725a630af7fe0d
02f32ad00592d197ccc9bc613873510dd7ef6901
/src/generatedTest/java/modules/classmanager/domain/StudentTest.java
35a66a568873acdbee0727733cf2136d15dc3948
[]
no_license
simonberry2003/danceschool
12f0948dc29dc9d894fb23448f1349f9ffcf6d6c
1596bf3d170648ef1b76fadaa1927cd67d6b8efe
refs/heads/master
2020-03-10T13:01:57.907734
2018-04-18T09:59:53
2018-04-18T09:59:53
129,390,592
0
0
null
null
null
null
UTF-8
Java
false
false
517
java
package modules.classmanager.domain; import modules.classmanager.util.StudentFactory; import util.AbstractDomainTest; /** * Generated - local changes will be overwritten. * Extend {@link AbstractDomainTest} to create your own tests for this document. */ public class StudentTest extends AbstractDomainTest<Student> { private StudentFactory factory; @Override protected Student getBean() throws Exception { if (factory == null) { factory = new StudentFactory(); } return factory.getInstance(); } }
[ "simon_berry2003@yahoo.com" ]
simon_berry2003@yahoo.com
183beeeece2ed610760cb4c4a3bbf1aa3abd9d08
a16824ff4f99950854a634d40541539d36f75de0
/app/src/main/java/com/github/guignol/indrah/model/CacheRepository.java
9c0f1a105c41138a3775146e2e120b937dd8734d
[ "MIT" ]
permissive
guignol/indrah
60b2243c6622592453857757a76f5f95b6f231dc
0ec8f8e916c83a2811dff57969345314ee55dfb7
refs/heads/main
2023-02-27T17:30:53.523394
2021-02-01T12:16:43
2021-02-01T12:16:43
331,927,024
0
0
null
null
null
null
UTF-8
Java
false
false
2,212
java
package com.github.guignol.indrah.model; import org.jetbrains.annotations.NotNull; import java.lang.ref.SoftReference; import java.util.HashMap; import java.util.Map; import java.util.WeakHashMap; import java.util.concurrent.Executor; import java.util.concurrent.Executors; import java.util.function.Consumer; public class CacheRepository<KEY, VALUE> { private final Map<KEY, SoftReference<VALUE>> cache = new HashMap<>(); private final Map<KEY, Loader2<KEY, VALUE>> loading = new WeakHashMap<>(); private final MultiMap<KEY, Consumer<VALUE>> waiting = new MultiMap<>(); private final Executor executor = Executors.newSingleThreadExecutor(); public void load(@NotNull KEY key, @NotNull Consumer<VALUE> consumer, @NotNull Loader2<KEY, VALUE> otherwise, @NotNull String from) { executor.execute(() -> { final SoftReference<VALUE> reference = cache.get(key); final VALUE data; if (reference != null && (data = reference.get()) != null) { System.out.println(key + " : use image cached โ–กโ–กโ–ก from " + from); // ใ‚ญใƒฃใƒƒใ‚ทใƒฅใ‚ใ‚Š consumer.accept(data); } else { if (this.loading.get(key) == null) { System.out.println(key + " : use image created โ– โ– โ–  from " + from); //ใƒ‡ใƒผใ‚ฟใ‚’ๅ–ๅพ— this.loading.put(key, otherwise); otherwise.load(key, saveFor(key).andThen(consumer)); } else { System.out.println(key + " : waiting image created ... from " + from); // ๅŒใ˜ใ‚ญใƒผใฎใƒ‡ใƒผใ‚ฟๅ–ๅพ—ไธญใชใฎใงๅพ…ใค waiting.put(key, consumer); } } }); } private Consumer<VALUE> saveFor(KEY key) { return value -> executor.execute(() -> { cache.put(key, new SoftReference<>(value)); waiting.forEach(key, waiter -> waiter.accept(value)); waiting.clear(key); loading.remove(key); }); } }
[ "17764785+guignol@users.noreply.github.com" ]
17764785+guignol@users.noreply.github.com
fe90c7ea68689fdfc0884da13413e6f4b8e69984
32888a74ac0dafd5814e2927550a4137720189e3
/src/main/java/com/onegravity/rteditor/RTEditText.java
b5826b958b2635046c9dec18f7d0473b01e77f27
[]
no_license
yaman/rteditor
0ab5f74b0775a4c0f2ac7f7c5bad19a80b422c40
92cd04ef2121a5f68de83859e1b2a2d6d9125a5d
refs/heads/master
2020-12-02T02:57:35.815588
2020-01-31T14:57:04
2020-01-31T14:57:04
230,864,246
0
0
null
null
null
null
UTF-8
Java
false
false
23,102
java
/* * Copyright 2015 Emanuel Moecklin * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.onegravity.rteditor; import android.content.Context; import android.graphics.Rect; import android.os.Parcel; import android.os.Parcelable; import android.text.Editable; import android.text.SpanWatcher; import android.text.Spannable; import android.text.Spanned; import android.text.TextWatcher; import android.text.style.ParagraphStyle; import android.util.AttributeSet; import android.widget.EditText; import android.widget.TextView; import com.onegravity.rteditor.api.RTMediaFactory; import com.onegravity.rteditor.api.format.RTEditable; import com.onegravity.rteditor.api.format.RTFormat; import com.onegravity.rteditor.api.format.RTHtml; import com.onegravity.rteditor.api.format.RTPlainText; import com.onegravity.rteditor.api.format.RTText; import com.onegravity.rteditor.api.media.RTAudio; import com.onegravity.rteditor.api.media.RTImage; import com.onegravity.rteditor.api.media.RTMedia; import com.onegravity.rteditor.api.media.RTVideo; import com.onegravity.rteditor.effects.Effect; import com.onegravity.rteditor.effects.Effects; import com.onegravity.rteditor.spans.LinkSpan; import com.onegravity.rteditor.spans.LinkSpan.LinkSpanListener; import com.onegravity.rteditor.spans.MediaSpan; import com.onegravity.rteditor.spans.RTSpan; import com.onegravity.rteditor.utils.Paragraph; import com.onegravity.rteditor.utils.RTLayout; import com.onegravity.rteditor.utils.Selection; import java.util.ArrayList; import java.util.HashSet; import java.util.Set; /** * The actual rich text editor (extending android.widget.EditText). */ public class RTEditText extends EditText implements TextWatcher, SpanWatcher, LinkSpanListener { // don't allow any formatting in text mode private boolean mUseRTFormatting = true; // for performance reasons we compute a new layout only if the text has changed private boolean mLayoutChanged; private RTLayout mRTLayout; // don't call this mLayout because TextView has a mLayout too (no shadowing as both are private but still...) // while onSaveInstanceState() is running, don't modify any spans private boolean mIsSaving; /// while selection is changing don't apply any effects private boolean mIsSelectionChanging = false; // text has changed private boolean mTextChanged; // this indicates whether text is selected or not -> ignore window focus changes (by spinners) private boolean mTextSelected; private RTEditTextListener mListener; private RTMediaFactory<RTImage, RTAudio, RTVideo> mMediaFactory; // used to check if selection has changed private int mOldSelStart = -1; private int mOldSelEnd = -1; // we don't want to call Effects.cleanupParagraphs() if the paragraphs are already up to date private boolean mParagraphsAreUp2Date; // while Effects.cleanupParagraphs() is called, we ignore changes that would alter mParagraphsAreUp2Date private boolean mIgnoreParagraphChanges; /* Used for the undo / redo functions */ // if True then text changes are not registered for undo/redo // we need this during the actual undo/redo operation (or an undo would create a change event itself) private boolean mIgnoreTextChanges; private int mSelStartBefore; // selection start before text changed private int mSelEndBefore; // selection end before text changed private String mOldText; // old text before it changed private String mNewText; // new text after it changed (needed in afterTextChanged to see if the text has changed) private Spannable mOldSpannable; // undo/redo // we need to keep track of the media for this editor to be able to clean up after we're done private Set<RTMedia> mOriginalMedia = new HashSet<RTMedia>(); private Set<RTMedia> mAddedMedia = new HashSet<RTMedia>(); // ****************************************** Lifecycle Methods ******************************************* public RTEditText(Context context) { super(context); init(); } public RTEditText(Context context, AttributeSet attrs) { super(context, attrs); init(); } public RTEditText(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); init(); } private void init() { addTextChangedListener(this); // we need this or links won't be clickable setMovementMethod(RTEditorMovementMethod.getInstance()); } /** * @param isSaved True if the text is saved, False if it's dismissed */ void onDestroy(boolean isSaved) { // make sure all obsolete MediaSpan files are removed from the file system: // - when saving the text delete the MediaSpan if it was deleted // - when dismissing the text delete the MediaSpan if it was deleted and not saved before // collect all media the editor contains currently Set<RTMedia> mCurrentMedia = new HashSet<RTMedia>(); Spannable text = getText(); for (MediaSpan span : text.getSpans(0, text.length(), MediaSpan.class)) { mCurrentMedia.add(span.getMedia()); } // now delete all those that aren't needed any longer Set<RTMedia> mMedia2Delete = isSaved ? mOriginalMedia : mCurrentMedia; mMedia2Delete.addAll(mAddedMedia); Set<RTMedia> mMedia2Keep = isSaved ? mCurrentMedia : mOriginalMedia; for (RTMedia media : mMedia2Delete) { if (!mMedia2Keep.contains(media)) { media.remove(); } } } /** * Needs to be called if a media is added to the editor. * Important to be able to delete obsolete media once we're done editing. */ void onAddMedia(RTMedia media) { mAddedMedia.add(media); } /** * This needs to be called before anything else because we need the media * factory. * * @param listener The RTEditTextListener (the RTManager) * @param mediaFactory The RTMediaFactory */ void register(RTEditTextListener listener, RTMediaFactory<RTImage, RTAudio, RTVideo> mediaFactory) { mListener = listener; mMediaFactory = mediaFactory; } /** * Usually called from the RTManager.onDestroy() method */ void unregister() { mListener = null; mMediaFactory = null; } /** * Return all paragraphs as as array of selection objects */ public ArrayList<Paragraph> getParagraphs() { return getRTLayout().getParagraphs(); } /** * Find the start and end of the paragraph(s) encompassing the current selection. * A paragraph spans from one \n (exclusive) to the next one (inclusive) */ public Selection getParagraphsInSelection() { RTLayout layout = getRTLayout(); Selection selection = new Selection(this); int firstLine = layout.getLineForOffset(selection.start()); int end = selection.isEmpty() ? selection.end() : selection.end() - 1; int lastLine = layout.getLineForOffset(end); return new Selection(layout.getLineStart(firstLine), layout.getLineEnd(lastLine)); } private RTLayout getRTLayout() { synchronized (this) { if (mRTLayout == null || mLayoutChanged) { mRTLayout = new RTLayout(getText()); mLayoutChanged = false; } } return mRTLayout; } /** * This method returns the Selection which makes sure that selection start is <= selection end. * Note: getSelectionStart()/getSelectionEnd() refer to the order in which text was selected. */ Selection getSelection() { int selStart = getSelectionStart(); int selEnd = getSelectionEnd(); return new Selection(selStart, selEnd); } /** * @return the selected text (needed when creating links) */ String getSelectedText() { Spannable text = getText(); Selection sel = getSelection(); if (sel.start() >= 0 && sel.end() >= 0 && sel.end() <= text.length()) { return text.subSequence(sel.start(), sel.end()).toString(); } return null; } public Spannable cloneSpannable() { CharSequence text = super.getText(); return new ClonedSpannableString(text != null ? text : ""); } // ****************************************** Set/Get Text Methods ******************************************* /** * Sets the edit mode to plain or rich text. The text will be converted * automatically to rich/plain text if autoConvert is True. * * @param useRTFormatting True if the edit mode should be rich text, False if the edit * mode should be plain text * @param autoConvert Automatically convert the content to plain or rich text if * this is True */ public void setRichTextEditing(boolean useRTFormatting, boolean autoConvert) { assertRegistration(); if (useRTFormatting != mUseRTFormatting) { mUseRTFormatting = useRTFormatting; if (autoConvert) { RTFormat targetFormat = useRTFormatting ? RTFormat.PLAIN_TEXT : RTFormat.HTML; setText(getRichText(targetFormat)); } if (mListener != null) { mListener.onRichTextEditingChanged(this, mUseRTFormatting); } } } /** * Sets the edit mode to plain or rich text and updates the content at the * same time. The caller needs to make sure the content matches the correct * format (if you pass in html code as plain text the editor will show the * html code). * * @param useRTFormatting True if the edit mode should be rich text, False if the edit * mode should be plain text * @param content The new content */ public void setRichTextEditing(boolean useRTFormatting, String content) { assertRegistration(); if (useRTFormatting != mUseRTFormatting) { mUseRTFormatting = useRTFormatting; if (mListener != null) { mListener.onRichTextEditingChanged(this, mUseRTFormatting); } } RTText rtText = useRTFormatting ? new RTHtml<RTImage, RTAudio, RTVideo>(RTFormat.HTML, content) : new RTPlainText(content); setText(rtText); } /** * Set the text for this editor. * <p> * It will convert the text from rich text to plain text if the editor's * mode is set to use plain text. or to a spanned text (only supported * formatting) if the editor's mode is set to use rich text * <p> * We need to prevent onSelectionChanged() to do anything as long as * setText() hasn't finished because the Layout doesn't seem to update * before setText has finished but onSelectionChanged will still be called * during setText and will receive the out-dated Layout which doesn't allow * us to apply styles and such. */ public void setText(RTText rtText) { assertRegistration(); if (rtText.getFormat() instanceof RTFormat.Html) { if (mUseRTFormatting) { RTText rtSpanned = rtText.convertTo(RTFormat.SPANNED, mMediaFactory); super.setText(rtSpanned.getText(), TextView.BufferType.EDITABLE); addSpanWatcher(); // collect all current media Spannable text = getText(); for (MediaSpan span : text.getSpans(0, text.length(), MediaSpan.class)) { mOriginalMedia.add(span.getMedia()); } Effects.cleanupParagraphs(this); } else { RTText rtPlainText = rtText.convertTo(RTFormat.PLAIN_TEXT, mMediaFactory); super.setText(rtPlainText.getText()); } } else if (rtText.getFormat() instanceof RTFormat.PlainText) { CharSequence text = rtText.getText(); super.setText(text == null ? "" : text.toString()); } onSelectionChanged(0, 0); } public boolean usesRTFormatting() { return mUseRTFormatting; } /** * Returns the content of this editor as a String. The caller is responsible * to call only formats that are supported by RTEditable (which is the rich * text editor's format and always the source format). * * @param format The RTFormat the text should be converted to. * @throws UnsupportedOperationException if the target format isn't supported. */ public String getText(RTFormat format) { return getRichText(format).getText().toString(); } /** * Same as "String getText(RTFormat format)" but this method returns the * RTText instead of just the actual text. */ public RTText getRichText(RTFormat format) { /** * MediaFactory is not used in our project * so it can be null and registration can be ignored */ //assertRegistration(); RTEditable rtEditable = new RTEditable(this); return rtEditable.convertTo(format, mMediaFactory); } private void assertRegistration() { if (mMediaFactory == null) { throw new IllegalStateException("The RTMediaFactory is null. Please make sure to register the editor at the RTManager before using it."); } } // ****************************************** TextWatcher / SpanWatcher ******************************************* public boolean hasChanged() { return mTextChanged; } public void resetHasChanged() { mTextChanged = false; setParagraphsAreUp2Date(false); } /** * Ignore changes that would trigger a RTEditTextListener.onTextChanged() * method call. We need this during the actual undo/redo operation (or an * undo would create a change event itself). */ synchronized void ignoreTextChanges() { mIgnoreTextChanges = true; } /** * If changes happen call RTEditTextListener.onTextChanged(). * This is needed for the undo/redo functionality. */ synchronized void registerTextChanges() { mIgnoreTextChanges = false; } @Override /* TextWatcher */ public synchronized void beforeTextChanged(CharSequence s, int start, int count, int after) { // we use a String to get a static copy of the CharSequence (the CharSequence changes when the text changes...) String oldText = mOldText == null ? "" : mOldText; if (!mIgnoreTextChanges && !s.toString().equals(oldText)) { mSelStartBefore = getSelectionStart(); mSelEndBefore = getSelectionEnd(); mOldText = s.toString(); mNewText = mOldText; mOldSpannable = cloneSpannable(); } mLayoutChanged = true; } @Override /* TextWatcher */ public synchronized void onTextChanged(CharSequence s, int start, int before, int count) { mLayoutChanged = true; } @Override /* TextWatcher */ public synchronized void afterTextChanged(Editable s) { String theText = s.toString(); String newText = mNewText == null ? "" : mNewText; if (mListener != null && !mIgnoreTextChanges && !newText.equals(theText)) { Spannable newSpannable = cloneSpannable(); mListener.onTextChanged(this, mOldSpannable, newSpannable, mSelStartBefore, mSelEndBefore, getSelectionStart(), getSelectionEnd()); mNewText = theText; } mLayoutChanged = true; mTextChanged = true; setParagraphsAreUp2Date(false); addSpanWatcher(); } @Override /* SpanWatcher */ public void onSpanAdded(Spannable text, Object what, int start, int end) { mTextChanged = true; if (what instanceof RTSpan && what instanceof ParagraphStyle) { setParagraphsAreUp2Date(false); } } @Override /* SpanWatcher */ public void onSpanChanged(Spannable text, Object what, int ostart, int oend, int nstart, int nend) { mTextChanged = true; if (what instanceof RTSpan && what instanceof ParagraphStyle) { setParagraphsAreUp2Date(false); } } @Override /* SpanWatcher */ public void onSpanRemoved(Spannable text, Object what, int start, int end) { mTextChanged = true; if (what instanceof RTSpan && what instanceof ParagraphStyle) { setParagraphsAreUp2Date(false); } } /** * Add a SpanWatcher for the Changeable implementation */ private void addSpanWatcher() { Spannable spannable = getText(); if (spannable.getSpans(0, spannable.length(), getClass()) != null) { spannable.setSpan(this, 0, spannable.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE); } } synchronized private void setParagraphsAreUp2Date(boolean value) { if (! mIgnoreParagraphChanges) { mParagraphsAreUp2Date = value; } } // ****************************************** Listener Methods ******************************************* @Override public void onWindowFocusChanged(boolean hasWindowFocus) { // if text is selected we ignore a loss of focus to prevent Android from terminating // text selection when one of the spinners opens (text size, color, bg color) if (!mUseRTFormatting || hasWindowFocus || !mTextSelected) { super.onWindowFocusChanged(hasWindowFocus); } } @Override protected void onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect) { super.onFocusChanged(focused, direction, previouslyFocusedRect); if (mUseRTFormatting && mListener != null) { mListener.onFocusChanged(this, focused); } } @Override public Parcelable onSaveInstanceState() { return super.onSaveInstanceState(); /* mIsSaving = true; Parcelable superState = super.onSaveInstanceState(); String content = getText(mUseRTFormatting ? RTFormat.HTML : RTFormat.PLAIN_TEXT); SavedState savedState = new SavedState(superState, mUseRTFormatting, content); mIsSaving = false; return savedState; */ } @Override public void onRestoreInstanceState(Parcelable state) { super.onRestoreInstanceState(null); /* if(state instanceof SavedState) { SavedState savedState = (SavedState)state; super.onRestoreInstanceState(savedState.getSuperState()); setRichTextEditing(savedState.useRTFormatting(), savedState.getContent()); } else { super.onRestoreInstanceState(state); } if (mListener != null) { mListener.onRestoredInstanceState(this); } */ } private static class SavedState extends BaseSavedState { private String mContent; private boolean mUseRTFormatting; SavedState(Parcelable superState, boolean useRTFormatting, String content) { super(superState); mUseRTFormatting = useRTFormatting; mContent = content; } private String getContent() { return mContent; } private boolean useRTFormatting() { return mUseRTFormatting; } private SavedState(Parcel in) { super(in); mUseRTFormatting = in.readInt() == 1; mContent = in.readString(); } @Override public void writeToParcel(Parcel out, int flags) { super.writeToParcel(out, flags); out.writeInt(mUseRTFormatting ? 1 : 0); out.writeString(mContent); } public static final Parcelable.Creator<SavedState> CREATOR = new Parcelable.Creator<SavedState>() { public SavedState createFromParcel(Parcel in) { return new SavedState(in); } public SavedState[] newArray(int size) { return new SavedState[size]; } }; } @Override protected void onSelectionChanged(int start, int end) { if (mOldSelStart != start || mOldSelEnd != end) { mOldSelStart = start; mOldSelEnd = end; mTextSelected = (end > start); super.onSelectionChanged(start, end); if (mUseRTFormatting) { if (!mIsSaving && !mParagraphsAreUp2Date) { mIgnoreParagraphChanges = true; Effects.cleanupParagraphs(this); mIgnoreParagraphChanges = false; setParagraphsAreUp2Date(true); } if (mListener != null) { mIsSelectionChanging = true; mListener.onSelectionChanged(this, start, end); mIsSelectionChanging = false; } } } } /** * Call this to have an effect applied to the current selection. * You get the Effect object via the static data members (e.g., RTEditText.BOLD). * The value for most effects is a Boolean, indicating whether to add or remove the effect. */ public <V extends Object, C extends RTSpan<V>> void applyEffect(Effect<V, C> effect, V value) { if (mUseRTFormatting && !mIsSelectionChanging && !mIsSaving) { Spannable oldSpannable = mIgnoreTextChanges ? null : cloneSpannable(); effect.applyToSelection(this, value); synchronized (this) { if (mListener != null && !mIgnoreTextChanges) { Spannable newSpannable = cloneSpannable(); mListener.onTextChanged(this, oldSpannable, newSpannable, getSelectionStart(), getSelectionEnd(), getSelectionStart(), getSelectionEnd()); } mLayoutChanged = true; } } } @Override /* LinkSpanListener */ public void onClick(LinkSpan linkSpan) { if (mUseRTFormatting && mListener != null) { mListener.onClick(this, linkSpan); } } }
[ "abdulkadiryaman@gmail.com" ]
abdulkadiryaman@gmail.com
16dd02915e68acc09f9c9d019b0f0030d67b3082
77a3c0854c698bde2ec4cbecf35af04405b7403a
/app/src/main/java/info/chitanka/app/ui/AuthorBooksActivity.java
1687ddef778d8ac641a196299882ba0eed29ef96
[]
no_license
chitanka/android
49726b2496512a3e11b9df40589feb440748f39d
ae50e2529ba98b06d7e62f006f80f304fa12387d
refs/heads/master
2020-03-28T08:55:20.833357
2019-06-08T04:32:34
2019-06-08T04:32:34
53,433,155
4
1
null
2019-06-08T06:05:57
2016-03-08T17:53:48
Java
UTF-8
Java
false
false
2,151
java
package info.chitanka.app.ui; import android.annotation.TargetApi; import android.content.Intent; import android.os.Build; import android.os.Bundle; import androidx.fragment.app.Fragment; import androidx.appcompat.widget.Toolbar; import java.util.HashMap; import javax.inject.Inject; import info.chitanka.app.Constants; import info.chitanka.app.R; import info.chitanka.app.TrackingConstants; import info.chitanka.app.components.AnalyticsService; import info.chitanka.app.di.HasComponent; import info.chitanka.app.di.presenters.DaggerPresenterComponent; import info.chitanka.app.di.presenters.PresenterComponent; import info.chitanka.app.di.presenters.PresenterModule; import info.chitanka.app.ui.fragments.books.AuthorBooksFragment; public class AuthorBooksActivity extends BaseActivity implements HasComponent<PresenterComponent> { private PresenterComponent presenterComponent; @Inject AnalyticsService analyticsService; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_author_books); Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); setupActionBar(); presenterComponent = DaggerPresenterComponent.builder().applicationComponent(getApplicationComponent()).presenterModule(new PresenterModule()).build(); getComponent().inject(this); Intent intent = getIntent(); String title = intent.getStringExtra(Constants.EXTRA_TITLE); String slug = intent.getStringExtra(Constants.EXTRA_SLUG); Fragment fragment = AuthorBooksFragment.newInstance(slug); getSupportFragmentManager().beginTransaction().replace(R.id.container, fragment).commit(); setTitle(title); analyticsService.logEvent(TrackingConstants.VIEW_AUTHOR_BOOKS, new HashMap<String, String>() {{ put("authorName", title);}}); } @Override public PresenterComponent getComponent() { return presenterComponent; } private void setupActionBar() { getSupportActionBar().setDisplayHomeAsUpEnabled(true); } }
[ "gmirchev90@gmail.com" ]
gmirchev90@gmail.com
d2f2560b96a909622692fa6ec693c4693af953ff
e04a5b6cb22682e24804c2f9af4fed2e59012e00
/finalproject/src/by/epam/finance/dao/DBSerialize.java
c112a6af5bfb69fa811b01f938a1f253103d45f1
[]
no_license
Aprotosevich/Unit05
8032af36862c0aa143fb9c257e684e8c1e6758ca
8a43ee510ec0ac8727888f23b47a953354a6fc12
refs/heads/master
2020-08-29T07:49:28.286512
2019-10-28T18:11:25
2019-10-28T18:11:25
217,973,499
0
0
null
null
null
null
UTF-8
Java
false
false
986
java
package by.epam.finance.dao; import by.epam.finance.bean.User; import java.io.*; public class DBSerialize { private String filePath = "src\\resources\\"; public DBSerialize(String fileName){ this.filePath = filePath + fileName + ".dat"; } public boolean save(Object obj) throws DaoException { try (ObjectOutputStream objectOutputStream = new ObjectOutputStream(new FileOutputStream(filePath))) { objectOutputStream.writeObject(obj); return true; } catch (Exception e) { e.printStackTrace(); return false; } } public User takeUserByLogin(String login) throws DaoException { try { ObjectInputStream objectInputStream = new ObjectInputStream(new FileInputStream(filePath)); User user = (User)objectInputStream.readObject(); return user; } catch (Exception e) { throw new DaoException(); } } }
[ "antony.protosevich@gmail.com" ]
antony.protosevich@gmail.com
e82ef866f441c04732eec8429ea8808c32f0893e
6453f46aae77991f63cea29fa6007b9ff16f858a
/Backend/Vendas/src/test/java/br/edu/up/jpa/OfertaEspecialProdutoTest.java
2f6fd374ff46d40bdd97010d0f7b32235e1b97fb
[]
no_license
johnneto/adventureworks
d23c75cd32d61feabf6b580f22e5c7089c89c501
cd9be0aae55bacb957d4fd030336fc327bcb35d1
refs/heads/master
2020-03-31T19:07:11.647360
2018-10-10T23:02:08
2018-10-10T23:02:08
152,485,607
0
1
null
null
null
null
UTF-8
Java
false
false
592
java
package br.edu.up.jpa; import java.text.ParseException; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; import br.edu.up.jpa.repository.*; @RunWith(SpringRunner.class) @SpringBootTest(classes=Vendasv3.class) public class OfertaEspecialProdutoTest { @Autowired OfertaEspecialProdutoRepository OfertaEspecialProdutoRepository; @Test public void contextLoads() throws ParseException { } }
[ "jocaeneto@hotmail.com" ]
jocaeneto@hotmail.com
2efb2fa21d55ef6201cd0818ad48035416141165
69cf6aca894aa98df793b7ad90ff12eb62793427
/facetime-mgr/src/main/java/com/facetime/mgr/bean/DataDirForm.java
1e2579d2481dce8b50c6aa6969b0ead9d6e6a4ba
[ "MIT" ]
permissive
luckyufei/facetime
4bec8a729f42942d189b550b489714799775a087
f8301b4a0f3b633a417ea24456a4caaee9e6793f
refs/heads/master
2022-03-28T10:37:37.919416
2016-03-11T11:07:37
2016-03-11T11:07:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,599
java
package com.facetime.mgr.bean; import com.facetime.mgr.common.BaseForm; public class DataDirForm extends BaseForm { private static final long serialVersionUID = 1L; private String childnum; private String id; private String idList; private String key; private String note; private String noteEn; private String order; private String parentid; private String mark; private String value; /** Default empty constructor. */ public DataDirForm() { } public String getChildnum() { return childnum; } public String getId() { return id; } public String getIdList() { return idList; } public String getKey() { return key; } public String getMark() { return mark; } public String getNote() { return note; } public String getNoteEn() { return noteEn; } public String getOrder() { return order; } public String getParentid() { return parentid; } public String getValue() { return value; } public void setChildnum(String childnum) { this.childnum = childnum; } public void setId(String id) { this.id = id; } public void setIdList(String idList) { this.idList = idList; } public void setKey(String key) { this.key = key; } public void setMark(String mark) { this.mark = mark; } public void setNote(String note) { this.note = note; } public void setNoteEn(String noteEn) { this.noteEn = noteEn; } public void setOrder(String order) { this.order = order; } public void setParentid(String parentid) { this.parentid = parentid; } public void setValue(String value) { this.value = value; } }
[ "googleyufei@qq.com" ]
googleyufei@qq.com
1a5a9194f5a5d68cb4558ac8a84de01606f3e91a
43c1b9ea9f0d31a28819351f025d3626e814cf5b
/src/main/java/com/coinsdaq/web/repository/jpa/AssetRepository.java
274c28f6ee4044b917b551d02b7203a50d0e5636
[]
no_license
cjschoi/web
df09f44e3b0d4fe07f41317413b930851cd45bb7
2808cc8a80a039859e56e35d1ef8fa4b71938b8d
refs/heads/master
2021-09-05T09:20:06.982752
2018-01-26T01:32:23
2018-01-26T01:32:23
118,747,273
0
0
null
null
null
null
UTF-8
Java
false
false
367
java
package com.coinsdaq.web.repository.jpa; import com.coinsdaq.web.domain.Asset; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; /** * Spring Data JPA repository for the Asset entity. */ @SuppressWarnings("unused") @Repository public interface AssetRepository extends JpaRepository<Asset, Long> { }
[ "onggijang@gmail.com" ]
onggijang@gmail.com
9eba79ab4d4c762fa6627dff3fe17f998b0e8211
f4ad76446094fc59093ff0c5d6b46b47f52acf85
/src/com/jiajie/jiajieproject/utils/ToastUtil.java
cd8855c4884f75e09bf9f3c340182cd7a96f8979
[]
no_license
wangleinumber1/ECSchina
c2a557b19d1b20749518950cc5326cc48b375941
d9895827de585a00096f476453dd7b0857fc8637
refs/heads/master
2021-01-19T11:52:57.530568
2017-01-13T06:40:37
2017-01-13T06:40:37
82,269,678
2
0
null
null
null
null
UTF-8
Java
false
false
2,770
java
package com.jiajie.jiajieproject.utils; import android.content.Context; import android.os.Looper; import android.view.Gravity; import android.widget.Toast; import com.jiajie.jiajieproject.YmallApplication; public class ToastUtil { private static Toast toast = null; /** * ๆ็คบไฟกๆฏ */ public static void showToast(Context context, int textID, boolean isLongTime) { /* * if (isLongTime) { toast = Toast.makeText(context, textID, * Toast.LENGTH_LONG); } else { toast = Toast.makeText(context, textID, * Toast.LENGTH_SHORT); } */ if (toast == null) { toast = Toast.makeText(context, textID, isLongTime ? Toast.LENGTH_LONG : Toast.LENGTH_SHORT); } else { toast.setText(textID); toast.setDuration(isLongTime ? Toast.LENGTH_LONG : Toast.LENGTH_SHORT); } final int y = DisplayUtil.getDeviceWidthHeight()[1] / 8; YokaLog.d("ToastUtil", "showToast yๅ็งป้‡ is " + y); toast.setGravity(Gravity.BOTTOM, 0, y); toast.show(); } public static void showToast(Context context, String Message) { toast = Toast.makeText(context, Message, Toast.LENGTH_SHORT); final int y = DisplayUtil.getDeviceWidthHeight()[1] / 8; YokaLog.d("ToastUtil", "showToast yๅ็งป้‡ is " + y); toast.setGravity(Gravity.BOTTOM, 0, y); toast.show(); } /** * ๆ็คบไฟกๆฏ textIDๅ’Œtextๅช่ƒฝไผ ๅ…ถ1 */ public static void showToast(final Context context, final int textID, final String text, final boolean isLongTime) { final String textStr; // final int y = // DisplayUtil.getDeviceWidthHeight()[1]/8;//ScreenUtil.getHeight(context)/8; // YokaLog.d("ToastUtil", "showToast yๅ็งป้‡ is "+y); if (Looper.myLooper() != Looper.getMainLooper()) { YmallApplication.mContext.runOnUiThread(new Runnable() { @Override public void run() { show(context, textID, text, isLongTime, 0); } }); } else { show(context, textID, text, isLongTime, 0); } } private static void show(final Context context, final int textID, final String text, final boolean isLongTime, final int y) { if (StringUtil.checkStr(text)) { if (toast == null) { toast = Toast.makeText(context, text, isLongTime ? Toast.LENGTH_LONG : Toast.LENGTH_SHORT); } else { toast.setText(text); toast.setDuration(isLongTime ? Toast.LENGTH_LONG : Toast.LENGTH_SHORT); } } else { if (toast == null) { toast = Toast.makeText(context, textID, isLongTime ? Toast.LENGTH_LONG : Toast.LENGTH_SHORT); } else { toast.setText(textID); toast.setDuration(isLongTime ? Toast.LENGTH_LONG : Toast.LENGTH_SHORT); } } toast.setGravity(Gravity.BOTTOM, 0, y); toast.show(); } }
[ "wang.lei@ecschina.com" ]
wang.lei@ecschina.com
a28085b2b74daf32415920d13e33e01c8859a241
ec8d588b125ddbcf688e68d2490ce3f62a2de06b
/product-svc/src/main/java/com/bbby/poc/product/response/Doc.java
4dd5edae8a7b90a8ba81cc8d4d70a66fdee2fcd5
[]
no_license
ankurj1/promotion-poc
5456aed8c4a81674a4e153e09d13f1a52ab3c444
e79ee5dee0c4114aa0b7cd909df341a06a646db8
refs/heads/master
2020-03-27T23:24:40.112807
2018-09-28T04:23:52
2018-09-28T04:23:52
147,315,110
0
3
null
2018-09-28T07:11:06
2018-09-04T08:41:52
Java
UTF-8
Java
false
false
13,548
java
package com.bbby.poc.product.response; import java.util.HashMap; import java.util.List; import java.util.Map; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ "PRODUCT_ID", "SITE_ID", "DISPLAY_NAME", "PRICE_RANGE_DESCRIP", "COLLECTION_FLAG", "SWATCH_FLAG", "ROLLUP_TYPE_CODE", "INTL_RESTRICTED", "SCENE7_URL", "SEO_URL", "BRAND", "MEDIUM_IMAGE_ID", "VERT_IMAGE_ID", "RATINGS", "REVIEWS", "INCART_FLAG", "MX_INCART_FLAG", "LOW_PRICE", "LOW_PRICE_MX", "HIGH_PRICE", "HIGH_PRICE_MX", "PRICE_RANGE_STRING", "PRICE_RANGE_STRING_MX", "L3_ID", "SKU_ID", "CUSTOMIZATION_OFFERED_FLAG", "PERSONALIZATION_TYPE", "LTL_FLAG", "id", "SKU_FOR_SWATCH", "ATTRIBUTES_JSON", "PRICING_LABEL_CODE", "WAS_LOW_PRICE", "SALE_PRICE_RANGE_STRING", "MX_PRICING_LABEL_CODE", "WAS_LOW_PRICE_MX", "SALE_PRICE_RANGE_STRING_MX" }) public class Doc { @JsonProperty("PRODUCT_ID") private String pRODUCTID; @JsonProperty("SITE_ID") private List<String> sITEID = null; @JsonProperty("DISPLAY_NAME") private String dISPLAYNAME; @JsonProperty("PRICE_RANGE_DESCRIP") private String pRICERANGEDESCRIP; @JsonProperty("COLLECTION_FLAG") private String cOLLECTIONFLAG; @JsonProperty("SWATCH_FLAG") private String sWATCHFLAG; @JsonProperty("ROLLUP_TYPE_CODE") private String rOLLUPTYPECODE; @JsonProperty("INTL_RESTRICTED") private String iNTLRESTRICTED; @JsonProperty("SCENE7_URL") private String sCENE7URL; @JsonProperty("SEO_URL") private String sEOURL; @JsonProperty("BRAND") private String bRAND; @JsonProperty("MEDIUM_IMAGE_ID") private String mEDIUMIMAGEID; @JsonProperty("VERT_IMAGE_ID") private String vERTIMAGEID; @JsonProperty("RATINGS") private Double rATINGS; @JsonProperty("REVIEWS") private Integer rEVIEWS; @JsonProperty("INCART_FLAG") private String iNCARTFLAG; @JsonProperty("MX_INCART_FLAG") private String mXINCARTFLAG; @JsonProperty("LOW_PRICE") private Double lOWPRICE; @JsonProperty("LOW_PRICE_MX") private Integer lOWPRICEMX; @JsonProperty("HIGH_PRICE") private Double hIGHPRICE; @JsonProperty("HIGH_PRICE_MX") private Integer hIGHPRICEMX; @JsonProperty("PRICE_RANGE_STRING") private String pRICERANGESTRING; @JsonProperty("PRICE_RANGE_STRING_MX") private String pRICERANGESTRINGMX; @JsonProperty("L3_ID") private List<String> l3ID = null; @JsonProperty("SKU_ID") private List<String> sKUID = null; @JsonProperty("CUSTOMIZATION_OFFERED_FLAG") private List<String> cUSTOMIZATIONOFFEREDFLAG = null; @JsonProperty("PERSONALIZATION_TYPE") private List<String> pERSONALIZATIONTYPE = null; @JsonProperty("LTL_FLAG") private List<String> lTLFLAG = null; @JsonProperty("id") private String id; @JsonProperty("SKU_FOR_SWATCH") private List<String> sKUFORSWATCH = null; @JsonProperty("ATTRIBUTES_JSON") private List<String> aTTRIBUTESJSON = null; @JsonProperty("PRICING_LABEL_CODE") private String pRICINGLABELCODE; @JsonProperty("WAS_LOW_PRICE") private String wASLOWPRICE; @JsonProperty("SALE_PRICE_RANGE_STRING") private String sALEPRICERANGESTRING; @JsonProperty("MX_PRICING_LABEL_CODE") private String mXPRICINGLABELCODE; @JsonProperty("WAS_LOW_PRICE_MX") private String wASLOWPRICEMX; @JsonProperty("SALE_PRICE_RANGE_STRING_MX") private String sALEPRICERANGESTRINGMX; @JsonIgnore private Map<String, Object> additionalProperties = new HashMap<String, Object>(); @JsonProperty("PRODUCT_ID") public String getPRODUCTID() { return pRODUCTID; } @JsonProperty("PRODUCT_ID") public void setPRODUCTID(String pRODUCTID) { this.pRODUCTID = pRODUCTID; } @JsonProperty("SITE_ID") public List<String> getSITEID() { return sITEID; } @JsonProperty("SITE_ID") public void setSITEID(List<String> sITEID) { this.sITEID = sITEID; } @JsonProperty("DISPLAY_NAME") public String getDISPLAYNAME() { return dISPLAYNAME; } @JsonProperty("DISPLAY_NAME") public void setDISPLAYNAME(String dISPLAYNAME) { this.dISPLAYNAME = dISPLAYNAME; } @JsonProperty("PRICE_RANGE_DESCRIP") public String getPRICERANGEDESCRIP() { return pRICERANGEDESCRIP; } @JsonProperty("PRICE_RANGE_DESCRIP") public void setPRICERANGEDESCRIP(String pRICERANGEDESCRIP) { this.pRICERANGEDESCRIP = pRICERANGEDESCRIP; } @JsonProperty("COLLECTION_FLAG") public String getCOLLECTIONFLAG() { return cOLLECTIONFLAG; } @JsonProperty("COLLECTION_FLAG") public void setCOLLECTIONFLAG(String cOLLECTIONFLAG) { this.cOLLECTIONFLAG = cOLLECTIONFLAG; } @JsonProperty("SWATCH_FLAG") public String getSWATCHFLAG() { return sWATCHFLAG; } @JsonProperty("SWATCH_FLAG") public void setSWATCHFLAG(String sWATCHFLAG) { this.sWATCHFLAG = sWATCHFLAG; } @JsonProperty("ROLLUP_TYPE_CODE") public String getROLLUPTYPECODE() { return rOLLUPTYPECODE; } @JsonProperty("ROLLUP_TYPE_CODE") public void setROLLUPTYPECODE(String rOLLUPTYPECODE) { this.rOLLUPTYPECODE = rOLLUPTYPECODE; } @JsonProperty("INTL_RESTRICTED") public String getINTLRESTRICTED() { return iNTLRESTRICTED; } @JsonProperty("INTL_RESTRICTED") public void setINTLRESTRICTED(String iNTLRESTRICTED) { this.iNTLRESTRICTED = iNTLRESTRICTED; } @JsonProperty("SCENE7_URL") public String getSCENE7URL() { return sCENE7URL; } @JsonProperty("SCENE7_URL") public void setSCENE7URL(String sCENE7URL) { this.sCENE7URL = sCENE7URL; } @JsonProperty("SEO_URL") public String getSEOURL() { return sEOURL; } @JsonProperty("SEO_URL") public void setSEOURL(String sEOURL) { this.sEOURL = sEOURL; } @JsonProperty("BRAND") public String getBRAND() { return bRAND; } @JsonProperty("BRAND") public void setBRAND(String bRAND) { this.bRAND = bRAND; } @JsonProperty("MEDIUM_IMAGE_ID") public String getMEDIUMIMAGEID() { return mEDIUMIMAGEID; } @JsonProperty("MEDIUM_IMAGE_ID") public void setMEDIUMIMAGEID(String mEDIUMIMAGEID) { this.mEDIUMIMAGEID = mEDIUMIMAGEID; } @JsonProperty("VERT_IMAGE_ID") public String getVERTIMAGEID() { return vERTIMAGEID; } @JsonProperty("VERT_IMAGE_ID") public void setVERTIMAGEID(String vERTIMAGEID) { this.vERTIMAGEID = vERTIMAGEID; } @JsonProperty("RATINGS") public Double getRATINGS() { return rATINGS; } @JsonProperty("RATINGS") public void setRATINGS(Double rATINGS) { this.rATINGS = rATINGS; } @JsonProperty("REVIEWS") public Integer getREVIEWS() { return rEVIEWS; } @JsonProperty("REVIEWS") public void setREVIEWS(Integer rEVIEWS) { this.rEVIEWS = rEVIEWS; } @JsonProperty("INCART_FLAG") public String getINCARTFLAG() { return iNCARTFLAG; } @JsonProperty("INCART_FLAG") public void setINCARTFLAG(String iNCARTFLAG) { this.iNCARTFLAG = iNCARTFLAG; } @JsonProperty("MX_INCART_FLAG") public String getMXINCARTFLAG() { return mXINCARTFLAG; } @JsonProperty("MX_INCART_FLAG") public void setMXINCARTFLAG(String mXINCARTFLAG) { this.mXINCARTFLAG = mXINCARTFLAG; } @JsonProperty("LOW_PRICE") public Double getLOWPRICE() { return lOWPRICE; } @JsonProperty("LOW_PRICE") public void setLOWPRICE(Double lOWPRICE) { this.lOWPRICE = lOWPRICE; } @JsonProperty("LOW_PRICE_MX") public Integer getLOWPRICEMX() { return lOWPRICEMX; } @JsonProperty("LOW_PRICE_MX") public void setLOWPRICEMX(Integer lOWPRICEMX) { this.lOWPRICEMX = lOWPRICEMX; } @JsonProperty("HIGH_PRICE") public Double getHIGHPRICE() { return hIGHPRICE; } @JsonProperty("HIGH_PRICE") public void setHIGHPRICE(Double hIGHPRICE) { this.hIGHPRICE = hIGHPRICE; } @JsonProperty("HIGH_PRICE_MX") public Integer getHIGHPRICEMX() { return hIGHPRICEMX; } @JsonProperty("HIGH_PRICE_MX") public void setHIGHPRICEMX(Integer hIGHPRICEMX) { this.hIGHPRICEMX = hIGHPRICEMX; } @JsonProperty("PRICE_RANGE_STRING") public String getPRICERANGESTRING() { return pRICERANGESTRING; } @JsonProperty("PRICE_RANGE_STRING") public void setPRICERANGESTRING(String pRICERANGESTRING) { this.pRICERANGESTRING = pRICERANGESTRING; } @JsonProperty("PRICE_RANGE_STRING_MX") public String getPRICERANGESTRINGMX() { return pRICERANGESTRINGMX; } @JsonProperty("PRICE_RANGE_STRING_MX") public void setPRICERANGESTRINGMX(String pRICERANGESTRINGMX) { this.pRICERANGESTRINGMX = pRICERANGESTRINGMX; } @JsonProperty("L3_ID") public List<String> getL3ID() { return l3ID; } @JsonProperty("L3_ID") public void setL3ID(List<String> l3ID) { this.l3ID = l3ID; } @JsonProperty("SKU_ID") public List<String> getSKUID() { return sKUID; } @JsonProperty("SKU_ID") public void setSKUID(List<String> sKUID) { this.sKUID = sKUID; } @JsonProperty("CUSTOMIZATION_OFFERED_FLAG") public List<String> getCUSTOMIZATIONOFFEREDFLAG() { return cUSTOMIZATIONOFFEREDFLAG; } @JsonProperty("CUSTOMIZATION_OFFERED_FLAG") public void setCUSTOMIZATIONOFFEREDFLAG(List<String> cUSTOMIZATIONOFFEREDFLAG) { this.cUSTOMIZATIONOFFEREDFLAG = cUSTOMIZATIONOFFEREDFLAG; } @JsonProperty("PERSONALIZATION_TYPE") public List<String> getPERSONALIZATIONTYPE() { return pERSONALIZATIONTYPE; } @JsonProperty("PERSONALIZATION_TYPE") public void setPERSONALIZATIONTYPE(List<String> pERSONALIZATIONTYPE) { this.pERSONALIZATIONTYPE = pERSONALIZATIONTYPE; } @JsonProperty("LTL_FLAG") public List<String> getLTLFLAG() { return lTLFLAG; } @JsonProperty("LTL_FLAG") public void setLTLFLAG(List<String> lTLFLAG) { this.lTLFLAG = lTLFLAG; } @JsonProperty("id") public String getId() { return id; } @JsonProperty("id") public void setId(String id) { this.id = id; } @JsonProperty("SKU_FOR_SWATCH") public List<String> getSKUFORSWATCH() { return sKUFORSWATCH; } @JsonProperty("SKU_FOR_SWATCH") public void setSKUFORSWATCH(List<String> sKUFORSWATCH) { this.sKUFORSWATCH = sKUFORSWATCH; } @JsonProperty("ATTRIBUTES_JSON") public List<String> getATTRIBUTESJSON() { return aTTRIBUTESJSON; } @JsonProperty("ATTRIBUTES_JSON") public void setATTRIBUTESJSON(List<String> aTTRIBUTESJSON) { this.aTTRIBUTESJSON = aTTRIBUTESJSON; } @JsonProperty("PRICING_LABEL_CODE") public String getPRICINGLABELCODE() { return pRICINGLABELCODE; } @JsonProperty("PRICING_LABEL_CODE") public void setPRICINGLABELCODE(String pRICINGLABELCODE) { this.pRICINGLABELCODE = pRICINGLABELCODE; } @JsonProperty("WAS_LOW_PRICE") public String getWASLOWPRICE() { return wASLOWPRICE; } @JsonProperty("WAS_LOW_PRICE") public void setWASLOWPRICE(String wASLOWPRICE) { this.wASLOWPRICE = wASLOWPRICE; } @JsonProperty("SALE_PRICE_RANGE_STRING") public String getSALEPRICERANGESTRING() { return sALEPRICERANGESTRING; } @JsonProperty("SALE_PRICE_RANGE_STRING") public void setSALEPRICERANGESTRING(String sALEPRICERANGESTRING) { this.sALEPRICERANGESTRING = sALEPRICERANGESTRING; } @JsonProperty("MX_PRICING_LABEL_CODE") public String getMXPRICINGLABELCODE() { return mXPRICINGLABELCODE; } @JsonProperty("MX_PRICING_LABEL_CODE") public void setMXPRICINGLABELCODE(String mXPRICINGLABELCODE) { this.mXPRICINGLABELCODE = mXPRICINGLABELCODE; } @JsonProperty("WAS_LOW_PRICE_MX") public String getWASLOWPRICEMX() { return wASLOWPRICEMX; } @JsonProperty("WAS_LOW_PRICE_MX") public void setWASLOWPRICEMX(String wASLOWPRICEMX) { this.wASLOWPRICEMX = wASLOWPRICEMX; } @JsonProperty("SALE_PRICE_RANGE_STRING_MX") public String getSALEPRICERANGESTRINGMX() { return sALEPRICERANGESTRINGMX; } @JsonProperty("SALE_PRICE_RANGE_STRING_MX") public void setSALEPRICERANGESTRINGMX(String sALEPRICERANGESTRINGMX) { this.sALEPRICERANGESTRINGMX = sALEPRICERANGESTRINGMX; } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } @JsonAnySetter public void setAdditionalProperty(String name, Object value) { this.additionalProperties.put(name, value); } }
[ "aj0784@WL2781-0044042.bbby.corp.int" ]
aj0784@WL2781-0044042.bbby.corp.int
d9a1eeff13733ae4f01b355f66b715aa5855d228
8c29865d680d179302f80e2f411867f5dde4033d
/src/main/java/ru/eds2809/dnevnik/controllers/UserRestController.java
ecafccc24c2a6320984223e72981c6d430d97cfa
[]
no_license
eds2809/dnevnikBackJava
f65f52291d505248ff5f4b397f3c7283769108d1
98857f3d7b73a6e43af5a9886dcbbf07b78ceffb
refs/heads/main
2023-03-06T06:21:16.638689
2021-02-13T19:02:49
2021-02-13T19:02:49
333,419,496
0
0
null
null
null
null
UTF-8
Java
false
false
1,491
java
package ru.eds2809.dnevnik.controllers; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.*; import ru.eds2809.dnevnik.exeptions.NotFoundUserExeption; import ru.eds2809.dnevnik.models.User; import ru.eds2809.dnevnik.models.UserRole; import ru.eds2809.dnevnik.repositories.UserRepository; import java.util.List; @Slf4j @RestController @RequestMapping("user") public class UserRestController { private final UserRepository userRepository; public UserRestController(UserRepository userRepository) { this.userRepository = userRepository; } @GetMapping("/{id}") public User getPupilById(@PathVariable Long id) throws Throwable { return userRepository.findById(id) .orElseThrow(() -> new NotFoundUserExeption("ะŸะพะปัŒะทะพะฒะฐั‚ะตะปัŒ ะฟะพ ะดะฐะฝะฝะพะผัƒ id ะฝะต ะฝะฐะนะดะตะฝ")); } @PostMapping("/auth") public User auth(@RequestParam String login, @RequestParam String password) throws NotFoundUserExeption { log.info("ะ—ะฐะฟั€ะพั ะฝะฐ ะฐะฒั‚ะพั€ะธะทะฐั†ะธัŽ ะฟั€ะพะปัŒะทะพะฒะฐั‚ะตะปั {}", login); return userRepository.findUserByLoginAndPassword(login, password) .orElseThrow(() -> new NotFoundUserExeption("ะŸะพะปัŒะทะพะฒะฐั‚ะตะปัŒ ั ัƒะบะฐะทะฐะฝั‹ะผ ะปะพะณะธะฝะพะผ ะธ/ะธะปะธ ะฟะฐั€ะพะปะตะผ ะฝะต ะฝะฐะนะดะตะฝ")); } @GetMapping("/all") public List<User> getAllUsers() { return userRepository.findAllByRole(UserRole.PUPIL_ROLE); } }
[ "DSeEgorov@sberbak.ru" ]
DSeEgorov@sberbak.ru
3ba4d5192ef1b98e58ce94b9eace819ff2c95450
876429b8333f15b3c1ecc8704d7d20676d39363e
/bcCommunicator/src/main/java/bc/bcCommunicator/Model/Messages/Response/UsernameOkResponse.java
8055b645aea85f8594677e8e9fe01d8b48ff19f6
[]
no_license
defacto2k15/bcCommunicator
fa395d5e391c70c98811b742f0fe53b5508bab69
48ff4a5fa538b98f765d0e9a4fd787fb19dd18bd
refs/heads/master
2021-01-21T14:04:32.038798
2016-05-25T13:00:28
2016-05-25T13:00:28
53,136,712
0
0
null
null
null
null
UTF-8
Java
false
false
1,728
java
package bc.bcCommunicator.Model.Messages.Response; import bc.bcCommunicator.Model.BasicTypes.Username; import bc.bcCommunicator.Model.Messages.MessageField; import bc.bcCommunicator.Model.Messages.CreatingFromRecievedString.IFieldsContainer; import bc.bcCommunicator.Model.Messages.Handling.AbstractMessageHandler; import bc.bcCommunicator.Model.Messages.MessageFieldValues.UsernameMessageFieldValue; import bc.internetMessageProxy.ConnectionId; // TODO: Auto-generated Javadoc /** * The Class UsernameOkResponse. */ public class UsernameOkResponse extends AbstractResponse implements IUsernameOkResponse { /** * Instantiates a new username ok response. * * @param username the username * @throws Exception the exception */ public UsernameOkResponse( Username username ) throws Exception{ addField(username); addField(ResponseMessageType.UsernameOk); } /** * Instantiates a new username ok response. * * @param container the container * @throws Exception the exception */ public UsernameOkResponse( IFieldsContainer container) throws Exception{ this(container.getFieldValue(UsernameMessageFieldValue.class).getUsername()); } /* (non-Javadoc) * @see bc.bcCommunicator.Model.Messages.AbstractMessage#chooseHandler(bc.bcCommunicator.Model.Messages.Handling.AbstractMessageHandler, bc.internetMessageProxy.ConnectionId) */ @Override public void chooseHandler( AbstractMessageHandler handler, ConnectionId id) throws Exception{ handler.handle(this, id); } /* (non-Javadoc) * @see bc.bcCommunicator.Model.Messages.Response.IUsernameOkResponse#getUsername() */ public Username getUsername(){ return new Username( fieldsInMessage.get(MessageField.USERNAME_FIELD) ); } }
[ "defacto2k15@gmail.com" ]
defacto2k15@gmail.com
9b2784415f4488cdb735ab685c329763d49c30dd
b6d853857fcc88112aff3fce5f710e5f5bf70ace
/Android/app/src/main/java/com/arun/api/Model/CollectionPoint.java
531adbe9548bf1f68c9df800581cd4ebd4c7e8a9
[]
no_license
ArunNishanthan/Stationery-Store-Inventory-System
bac346e695f2510c9046d9e5ec65c4bb4a189459
9ff9e1c6bfaa8e70bb8fce132c97409547b68e85
refs/heads/master
2023-03-17T01:21:23.269654
2020-03-22T18:21:56
2020-03-22T18:21:56
249,243,529
0
0
null
null
null
null
UTF-8
Java
false
false
647
java
package com.arun.api.Model; public class CollectionPoint { int CollectionPointId; String Place; String CollectionDate; public int getCollectionPointId() { return CollectionPointId; } public void setCollectionPointId(int collectionPointId) { CollectionPointId = collectionPointId; } public String getPlace() { return Place; } public void setPlace(String place) { Place = place; } public String getCollectionDate() { return CollectionDate; } public void setCollectionDate(String collectionDate) { CollectionDate = collectionDate; } }
[ "arunn@EDITH" ]
arunn@EDITH
2eb3edfb9b31b9d2032ad30bf7c7f96eef83c55f
0ba616730fd0cf4df54787378f2850857206d921
/src/main/java/com/kuzminski/repository/OrderRepository.java
b3877ebd3f0db9ce91db4c69916563c097517822
[]
no_license
Yury6720/fp11
45f9ffbfd673af3ec4025076569a41eda2f83953
43019d6480cb62c8642f9c25fce9f9b4514fbe9b
refs/heads/v2
2023-04-08T21:10:52.411729
2020-05-02T23:49:07
2020-05-02T23:49:07
260,796,137
0
0
null
2021-04-26T20:14:24
2020-05-02T23:50:31
Java
UTF-8
Java
false
false
491
java
package com.kuzminski.repository; import com.kuzminski.domain.Order; import com.kuzminski.domain.User; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.repository.CrudRepository; import org.springframework.stereotype.Repository; import java.util.List; import java.util.Optional; @Repository public interface OrderRepository extends JpaRepository<Order, Long> { //CrudRepository<Order, Long> { List<Order> findOrdersByUser (User user); }
[ "kuzminskij5683415@gmail.com" ]
kuzminskij5683415@gmail.com
6d2bf8f2448a8e7e0983120603ae2e579e18ce37
a7e0488a42a781a30c5e418d451064898d4717c1
/nest-plus-demo/src/main/java/com/zhaofujun/nest/demo/DemoApplication.java
094b6c090f88b261cb06c7eba56c14321450a076
[]
no_license
455586841/nest-plus
89056f9b6e37b1fe687b58cce72a6348557a9e9d
1e1ef483635595ae4ea87e629694352ae6542986
refs/heads/master
2023-06-14T21:56:39.595522
2021-07-12T10:15:07
2021-07-12T10:15:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
724
java
package com.zhaofujun.nest.demo; import com.zhaofujun.nest.utils.LockUtils; import org.springframework.beans.BeansException; import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; import org.springframework.data.jpa.repository.config.EnableJpaRepositories; @SpringBootApplication @EnableJpaRepositories public class DemoApplication { public static int[] i = {0}; public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); } }
[ "jovezhao@foxmail.com" ]
jovezhao@foxmail.com
164f59f62871f424734d79c1c530b089b4ff9fef
c3f1731d40c225c0ac161ce72e6bcacaa22c6a58
/src/com/application/webserver/SocktMsgUtil.java
8e2cf9e87d5682e0e71dd378afaaf56387f83bc5
[]
no_license
uwitec/tig-panel-web
f67e27361b94d4db6d7882255e836b6958a85fd0
568a335dd8249e0f7f613d7f7ab8440350a57756
refs/heads/master
2021-01-22T22:35:52.690847
2012-12-20T05:11:30
2012-12-20T05:11:30
40,966,521
0
0
null
null
null
null
UTF-8
Java
false
false
1,182
java
package com.application.webserver; public class SocktMsgUtil { //่Žทๅพ—4ไฝ็š„ๆŠฅๆ–‡้•ฟๅบฆ public static String getMsgLength(String msg){ String msg_len = String.valueOf(msg.length()); msg_len = StringUtil.leftString(msg_len,"0",4); return msg_len; } //้ชŒ่ฏๆŠฅๆ–‡็š„้•ฟๅบฆ public static boolean valMsgLength(String msg){ try{ int msg_len = msg.length(); if(msg_len<4){ return false; } String msgLenHead = msg.substring(0, 4); int msgLenHead_int = Integer.valueOf(msgLenHead); if(msg_len==msgLenHead_int+2){ return true; }else{ return false; } }catch(Exception e){ return false; } } /** * ๅ‚ๆ•ฐ๏ผšๆŠฅๆ–‡ไฝ“ * ่ฟ”ๅ›ž๏ผšๆŠฅๆ–‡็ฑปๅž‹ * ๆœ‰้”™ๅฐฑ่ฟ”ๅ›ž0000*/ public static String valMsgHead(String msg){ String returnValue = "0000"; try{ String version = msg.substring(4, 6); if(!(version.equals("10"))){ return "0000"; } returnValue = msg.substring(6, 10); }catch(Exception e){ return "0000"; } return returnValue; } /** * ๅŠŸ่ƒฝ๏ผš่ฐƒ่ฏ•็”จmainๆ–นๆณ• */ public static void main(String[] args) throws Exception { } }
[ "missfay.lu@gmail.com" ]
missfay.lu@gmail.com
e4cfd3176eb05e41be76ca760446c798b1683833
57b1358bbd0d4d1569fb02a0c0153fd5147517f6
/JSD1511 JDBC/src/day04/EmpDao.java
9f0e50264df62373c9fa8feb13d886688eb493cb
[]
no_license
asunwei/javaLearning
4862474addd6cd5c59d4a261ba5525d80622be9d
6aea6631370a958840326ea1e3e27c341eb7e989
refs/heads/master
2021-01-17T17:11:05.628258
2017-06-27T11:06:52
2017-06-27T11:06:52
68,434,232
0
0
null
null
null
null
GB18030
Java
false
false
263
java
package day04; import java.util.List; /* * ๅฃฐๆ˜Žๅ‘˜ๅทฅๅฏน่ฑก็š„CRUDๆ–นๆณ• * ่ฐƒ็”จDao * Emp e=new Emp(5,"TOM") * */ public interface EmpDao { void add(Emp emp); void delete(Emp emp); void update(Emp emp); List<Emp>findAll(); Emp fingById(int id); }
[ "993525033@qq.com" ]
993525033@qq.com
cfd77f66fb204bafc31d1bcb0945061bef971963
1116f8c690a94dadd4b6351e274b91d3b1933ba2
/src/main/java/ru/job4j/map/NonUniqueString.java
2a1f7081fc4040ac5ea461d29a18c58fd397000a
[]
no_license
SoharevSt/job4j_tracker
8ecb68586db8ff1cac3ef4ea6da6565a99058df4
8996c236c25d9a967de2309e4c1515ab2ab1aa69
refs/heads/master
2023-04-13T03:02:01.482635
2021-04-28T12:49:56
2021-04-28T12:49:56
348,980,572
0
0
null
2021-03-18T07:30:14
2021-03-18T07:30:13
null
UTF-8
Java
false
false
439
java
package ru.job4j.map; import java.util.HashMap; import java.util.Map; public class NonUniqueString { public static Map<String, Boolean> checkData(String[] strings) { Map<String, Boolean> map = new HashMap<>(); for (String s : strings) { if (map.containsKey(s)) { map.put(s, true); } else { map.put(s, false); } } return map; } }
[ "devsoharev@yandex.by" ]
devsoharev@yandex.by
e12e462cf1776c15392471ed03db6a577d67bdff
96d18c1ea531929442593e366ae8de0cc01f3fdf
/api/src/test/java/org/hyperledger/connector/GRPCClientTest.java
6d8514061ffd2dfda0e8b9dc0325b9e77746b45d
[ "MIT", "Apache-2.0" ]
permissive
gabre/fabric-api
18999ee7020fc3042b8c5795b3c62a9a9a0afae4
516cee8d49269662702bd5aa87ef087280370eb8
refs/heads/master
2021-01-14T08:46:18.445646
2016-05-24T14:44:54
2016-05-24T14:44:54
59,824,838
0
0
null
2016-05-27T09:59:45
2016-05-27T09:59:45
null
UTF-8
Java
false
false
2,124
java
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.hyperledger.connector; import org.hyperledger.api.HLAPIException; import org.hyperledger.api.HLAPITransaction; import org.hyperledger.common.*; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; public class GRPCClientTest { private static final Logger log = LoggerFactory.getLogger(GRPCClientTest.class); GRPCClient client; @Before public void setUp() { client = new GRPCClient("localhost", 30303, 31315); } @Test public void testGetBlockHeight() throws HLAPIException { int height = client.getChainHeight(); log.debug("testGetBlockHeight height=" + height); assertTrue(height > 0); } @Test public void getNonExistingTransaction() throws HLAPIException { HLAPITransaction res = client.getTransaction(TID.INVALID); assertTrue(res == null); } @Test public void sendTransaction() throws HLAPIException, InterruptedException { Transaction tx = new Transaction(TID.INVALID, new byte[100]); int originalHeight = client.getChainHeight(); client.sendTransaction(tx); Thread.sleep(1500); HLAPITransaction res = client.getTransaction(tx.getID()); assertEquals(tx, res); int newHeight = client.getChainHeight(); assertTrue(newHeight == originalHeight + 1); } }
[ "tamas.blummer@digitalasset.com" ]
tamas.blummer@digitalasset.com
681b18b5dd8e0b557afd985efe3fd9f5ac5c2668
d527ab1bf9162a5ee520214ef4baa67e850786ca
/Sistemas-Distribuidos/Produtor-Consumidor-Multithreaded/ProdutorConsumidor.java
e268fbd4dd7d7eaa24f52fbebf8ae92331ab1129
[]
no_license
fernandesitalo/Faculdade
9357b3a18a2d842cf74709c4a1fb75d2d7306927
8bbec3c121dbd830b66bc3d5ca2d43ca30741f8d
refs/heads/master
2021-01-05T00:41:55.080120
2020-02-16T18:39:46
2020-02-16T18:39:46
240,817,978
4
0
null
null
null
null
UTF-8
Java
false
false
2,144
java
import java.util.Random; import java.util.concurrent.BlockingQueue; // para concorrencia import java.util.concurrent.ArrayBlockingQueue; // para concorrencia class ProdutorConsumidor { static class Produtor extends Thread { int id; BlockingQueue<Integer> queue; Produtor(int id, BlockingQueue<Integer> queue) { // construtor this.id = id; this.queue = queue; } @Override // sobreescrevendo ! public void run() { Random random = new Random(); while (true) { try { System.out.printf(":::::::PRODUTOR %d PRODUZIU E VAI COLOCAR NA FILA!\n", id); queue.put(id); System.out.printf(":::::::PRODUTOR %d COLOCOU NA FILA!\n", id); int tempoMs = 1000 + random.nextInt(4000); Thread.sleep(tempoMs); } catch (InterruptedException e) { e.printStackTrace(); } } } } static class Consumidor extends Thread { int id; BlockingQueue<Integer> queue; Consumidor(int id, BlockingQueue<Integer> queue) { // construtor this.id = id; this.queue = queue; } @Override // sobreescrita public void run() { Random random = new Random(); while (true) { try { System.out.printf(" >>>>>>>> Consumidor %d vai pegar um item da fila!\n", id); int x = queue.take(); System.out.printf(" >>>>>>>> Consumidor %d pegou um item do produtor %d!\n", id, x); int tempoMs = 1000 + random.nextInt(4000); Thread.sleep(tempoMs); } catch (InterruptedException e) { e.printStackTrace(); } } } } public static void main(String[] args) { final int n = 3; BlockingQueue<Integer> queue = new ArrayBlockingQueue<Integer>(10); Produtor[] produtor = new Produtor[n]; Consumidor[] consumidor = new Consumidor[n]; for (int i = 0; i < n; ++i) { produtor[i] = new Produtor(i + 1, queue); produtor[i].start(); } for (int i = 0; i < n; ++i) { consumidor[i] = new Consumidor(i + 1, queue); consumidor[i].start(); } } }
[ "italofernandes.fg@gmail.com" ]
italofernandes.fg@gmail.com
44d617bdd3617c5deffd2250321816856ff001cf
4635da3011cb67f804b5cdd5af7bfeeda81418d0
/src/main/java/cn/zhibanxia/zbxserver/service/impl/RecycleRequestServiceImpl.java
695038245f8b32155c0db793af6ff7dfe0bf7a97
[]
no_license
zhibanxia/zbx-server
47f232dd2df845d9d4c22a981fa998695be2ffb0
34996dfd113322af3e0856e7bf2fc219982cbeff
refs/heads/master
2020-03-26T03:22:32.529283
2019-05-19T07:30:35
2019-05-19T07:30:35
144,453,003
0
0
null
2019-05-19T07:30:36
2018-08-12T09:13:11
Java
UTF-8
Java
false
false
2,917
java
package cn.zhibanxia.zbxserver.service.impl; import cn.zhibanxia.zbxserver.bo.ListRecycleRequestBo; import cn.zhibanxia.zbxserver.dao.RecycleRequestDao; import cn.zhibanxia.zbxserver.dao.UserAddressDao; import cn.zhibanxia.zbxserver.entity.RecycleRequestEntity; import cn.zhibanxia.zbxserver.entity.UserAddressEntity; import cn.zhibanxia.zbxserver.service.NotifyHuishouService; import cn.zhibanxia.zbxserver.service.RecycleRequestService; import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.Date; import java.util.List; import java.util.stream.Collectors; /** * Created by zzy on 2018/10/04 22:16 */ @Service public class RecycleRequestServiceImpl implements RecycleRequestService { @Autowired private RecycleRequestDao recycleRequestDao; @Autowired private UserAddressDao userAddressDao; @Autowired private NotifyHuishouService notifyHuishouService; @Override public Long create(RecycleRequestEntity recycleRequestEntity) { Long id = recycleRequestDao.insert(recycleRequestEntity); if (recycleRequestEntity.getComplexId() != null) { List<UserAddressEntity> userAddressEntityList = userAddressDao.findByComplexId(recycleRequestEntity.getComplexId()); if (CollectionUtils.isNotEmpty(userAddressEntityList)) { List<Long> huishouUids = userAddressEntityList.stream().map(UserAddressEntity::getUserId).collect(Collectors.toList()); notifyHuishouService.notifyHuishou(recycleRequestEntity, huishouUids); } } return id; } @Override public List<RecycleRequestEntity> list(ListRecycleRequestBo listRecycleRequestBo) { return recycleRequestDao.list(listRecycleRequestBo); } @Override public Integer count(ListRecycleRequestBo listRecycleRequestBo) { return recycleRequestDao.count(listRecycleRequestBo); } @Override public RecycleRequestEntity find(Long id) { return recycleRequestDao.findById(id); } @Override public boolean confirmRecycleRequest(Long id, Long recycleUserId) { return recycleRequestDao.confirmRecycle(id, recycleUserId); } @Override public boolean completeRecycleRequest(Long id) { return recycleRequestDao.completeRecycle(id); } @Override public boolean delete(Long id) { return recycleRequestDao.delete(id); } @Override public boolean update(RecycleRequestEntity entity) { return recycleRequestDao.update(entity); } @Override public List<RecycleRequestEntity> selectRecomm(Date startTime) { return recycleRequestDao.selectRecomm(startTime); } @Override public boolean updateRecommed(Long id) { return recycleRequestDao.updateRecommed(id); } }
[ "zhuzhiyong@duiba.com.cn" ]
zhuzhiyong@duiba.com.cn
d61aa11efa55f81d31b51ce02662ec29584526b3
37d1d73ec78f69e395dbb921002fa439d90e7450
/HeadFirstJava/src/main/java/patterns/factory/simple_factory/ClamPizza.java
e92dfdaff9cde82c79f0c6ee7a6d073eb7d04379
[]
no_license
SChepinog/CodeExamples
ad891d84329be75f571e5b280380e26e85323f26
3997dd73d6953c029879b8916ba45e1ee41555b6
refs/heads/master
2023-03-08T12:36:14.181317
2023-02-25T11:40:29
2023-02-25T11:40:29
241,859,007
0
0
null
null
null
null
UTF-8
Java
false
false
83
java
package patterns.factory.simple_factory; public class ClamPizza extends Pizza { }
[ "s.chepinoga@dreamkas.ru" ]
s.chepinoga@dreamkas.ru
e12640688394c6db956eeb011226cb1c820631bc
8075adf5c6286120290a8871496b8c3ad92fff98
/com.hybridFramework/src/main/java/com/utility/ActionUtility.java
94537ed634af4be43e12e8ce7a2fe53f9f0cd4f0
[]
no_license
rahulsanap0146/HybridFrameWork
cace0e02dc21eeeecfbf1757fa936253893c6555
a28975fb67591333eff26617fdb5767a31563d31
refs/heads/master
2023-08-25T17:51:57.734593
2021-10-24T08:33:02
2021-10-24T08:33:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
819
java
package com.utility; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.interactions.Actions; import com.base.BaseClass; public class ActionUtility extends BaseClass { private WebDriver driver; public void typeIn(WebElement element,String text){ element.sendKeys(text); } public void click(WebElement element){ element.click(); } public void dragAndDrop(WebElement source,WebElement target){ Actions acts= new Actions(driver); acts.dragAndDrop(source, target).perform(); } public WebElement getElement(String locType,String locValue){ if(locType.equals("xpath")) return driver.findElement(By.xpath(locValue)); if(locType.equals("id")) return driver.findElement(By.id(locValue)); return null; } }
[ "rahulsanap777@gmail.com" ]
rahulsanap777@gmail.com
db6b14d710a2daa45c555529876cfad0131e232f
cedde0eb09d399aaf494e355ee5de9382c0d5883
/app/src/main/java/com/edgar/yurihome/adapters/ChapterListAdapter.java
6402c1bde9a069791027890f2445eeb7e3ac839d
[]
no_license
Hifairlady/YuriHome
4b6b027d11ead449186b48ea6d46a65e258eb8cb
93386a307c117f93f7d99c820c949dc37c9dee07
refs/heads/master
2022-12-30T11:12:57.036742
2020-10-21T19:54:11
2020-10-21T19:54:11
281,014,507
0
0
null
null
null
null
UTF-8
Java
false
false
6,839
java
package com.edgar.yurihome.adapters; import android.content.Context; import android.content.Intent; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; import com.edgar.yurihome.R; import com.edgar.yurihome.beans.ComicDetailsBean; import com.edgar.yurihome.scenarios.ChapterFullListActivity; import com.edgar.yurihome.scenarios.ComicReaderActivity; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.Collections; import java.util.List; public class ChapterListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { private static final int SHORT_LIST_LIMIT_NUM = 9; public static final int SORT_ORDER_ASC = 0; public static final int SORT_ORDER_DESC = 1; private Context mContext; private ArrayList<ComicDetailsBean.ChaptersBean.DataBean> shortDataList = new ArrayList<>(); private ArrayList<ComicDetailsBean.ChaptersBean.DataBean> fullDataList = new ArrayList<>(); private int lastChapterId; private boolean isCurOrderAsc = false; private boolean viewFullList = false; private int comicId; private String comicName, chapterLongTitle, chapterPartTitle; private long chapterUpdateTime; public ChapterListAdapter(Context mContext, List<ComicDetailsBean.ChaptersBean.DataBean> dataList, int lastChapterId, boolean fullList, int comicId, String comicName, String chapterPartTitle) { this.mContext = mContext; this.fullDataList = new ArrayList<>(dataList); this.lastChapterId = lastChapterId; this.viewFullList = fullList; this.comicId = comicId; this.comicName = comicName; this.chapterPartTitle = chapterPartTitle; initData(); } @NonNull @Override public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { View view = LayoutInflater.from(mContext).inflate(R.layout.item_layout_chapter_list, parent, false); return new ChapterHolder(view); } @Override public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, final int position) { final ComicDetailsBean.ChaptersBean.DataBean dataBean = shortDataList.get(position); ChapterHolder mHolder = (ChapterHolder) holder; if (dataBean.getItemType() == ComicDetailsBean.ChaptersBean.DataBean.MORE_ITEM_TYPE) { mHolder.btnChapterItem.setText("..."); } else { mHolder.btnChapterItem.setText(dataBean.getChapterTitle()); } if (lastChapterId == dataBean.getChapterId()) { mHolder.tvNewLabel.setVisibility(View.VISIBLE); } else { mHolder.tvNewLabel.setVisibility(View.GONE); } mHolder.btnChapterItem.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { chapterUpdateTime = dataBean.getUpdatetime(); chapterLongTitle = chapterPartTitle + "/" + dataBean.getChapterTitle(); if (dataBean.getItemType() == ComicDetailsBean.ChaptersBean.DataBean.MORE_ITEM_TYPE) { Intent intent = new Intent(mContext, ChapterFullListActivity.class); intent.putExtra("FULL_DATA_LIST_JSON", getFullListJson()); intent.putExtra("LAST_CHAPTER_ID", lastChapterId); intent.putExtra("COMIC_ID", comicId); intent.putExtra("COMIC_NAME", comicName); intent.putExtra("CHAPTER_ID", dataBean.getChapterId()); intent.putExtra("CHAPTER_UPDATE_TIME", chapterUpdateTime); intent.putExtra("CHAPTER_PART_TITLE", chapterPartTitle); mContext.startActivity(intent); } else { Intent readerIntent = new Intent(mContext, ComicReaderActivity.class); readerIntent.putExtra("COMIC_ID", comicId); readerIntent.putExtra("COMIC_NAME", comicName); readerIntent.putExtra("CHAPTER_ID", dataBean.getChapterId()); readerIntent.putExtra("CHAPTER_UPDATE_TIME", chapterUpdateTime); readerIntent.putExtra("CHAPTER_LONG_TITLE", chapterLongTitle); readerIntent.putExtra("FULL_CHAPTER_LIST_JSON", getFullListJson()); readerIntent.putExtra("CUR_CHAPTER_POSITION", position); int order = isCurOrderAsc ? SORT_ORDER_ASC : SORT_ORDER_DESC; readerIntent.putExtra("SORT_ORDER", order); readerIntent.putExtra("LAST_CHAPTER_ID", lastChapterId); mContext.startActivity(readerIntent); } } }); } @Override public int getItemCount() { return (shortDataList == null ? 0 : shortDataList.size()); } public void switchOrder(int order) { if (order == SORT_ORDER_ASC && !isCurOrderAsc) { isCurOrderAsc = true; Collections.reverse(fullDataList); initData(); notifyDataSetChanged(); } if (order == SORT_ORDER_DESC && isCurOrderAsc) { isCurOrderAsc = false; Collections.reverse(fullDataList); initData(); notifyDataSetChanged(); } } private void initData() { if (fullDataList.size() > SHORT_LIST_LIMIT_NUM && !viewFullList) { List<ComicDetailsBean.ChaptersBean.DataBean> tempBeans = fullDataList.subList(0, SHORT_LIST_LIMIT_NUM - 1); shortDataList = new ArrayList<>(tempBeans); ComicDetailsBean.ChaptersBean.DataBean temp = new ComicDetailsBean.ChaptersBean.DataBean(ComicDetailsBean.ChaptersBean.DataBean.MORE_ITEM_TYPE); shortDataList.add(shortDataList.size(), temp); } else { shortDataList = new ArrayList<>(fullDataList); } } public String getFullListJson() { String jsonString; Gson gson = new Gson(); Type type = new TypeToken<ArrayList<ComicDetailsBean.ChaptersBean.DataBean>>() { }.getType(); jsonString = gson.toJson(fullDataList, type); return jsonString; } private class ChapterHolder extends RecyclerView.ViewHolder { private TextView btnChapterItem; private TextView tvNewLabel; public ChapterHolder(@NonNull View itemView) { super(itemView); btnChapterItem = itemView.findViewById(R.id.btn_chapter_item); tvNewLabel = itemView.findViewById(R.id.tv_chapter_new_label); } } }
[ "1452192394@qq.com" ]
1452192394@qq.com
9adcd67466e90d773c1aa5a5b0f7d94896f274bf
9d1ae2086020a4e1430dc992dc99648ed5369365
/src/main/java/com/ejoylot/util/FeignConfig.java
97c47fbbb535a3dde53826f9917583a9504071cd
[]
no_license
lovelycola/ejoylot-web-server
aafb33659d8d5960db3b60c3913fb8573ebd6d52
05bbc5cc6ca8a4087f08025d798b09b98018b3c5
refs/heads/master
2020-03-15T23:56:40.986398
2018-05-10T08:14:58
2018-05-10T08:14:58
132,404,063
0
0
null
null
null
null
UTF-8
Java
false
false
579
java
package com.ejoylot.util; //import feign.Retryer; import feign.Retryer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import java.util.concurrent.TimeUnit; /** * Copyright (c) 2018 ZheJiang Ejoylot Technology Co., Ltd. All rights reserved. * Project: ejoylot-api-server * Package: com.ejoylot.util * Date: 18-5-5 * User: dennis */ @Configuration public class FeignConfig { @Bean public Retryer feigRetryer(){ return new Retryer.Default(100, TimeUnit.SECONDS.toMillis(1L),5); } }
[ "59253640@qq.com" ]
59253640@qq.com
6aee802ad3952578608d8493b79bcddd99f2fcd0
8e22b23ca7ea6c0b8a92afb5c841e1be6d421a7a
/src/main/java/Week4/London/VisitLondon.java
170d5e78d5a4c82e2190de7db2c92b7d12b0078b
[]
no_license
JordyLambertPXL/Java-Advanced
eb819b7223c2c3da6723578cd473f82c8af62e7f
c5509b98dd7ffb4fe40192d5a1be3a82e4b8918f
refs/heads/master
2020-08-19T04:43:44.132658
2019-10-17T20:39:19
2019-10-17T20:39:19
215,879,287
0
0
null
null
null
null
UTF-8
Java
false
false
800
java
package Week4.London; import Week4.Robbery.Knapsack; import Week4.Robbery.KnapsackUtil; public class VisitLondon { public static void main(String[] args) { Knapsack<Attraction> knapsack = new Knapsack<>(2); LondonAttractions attractions = new LondonAttractions(); attractions.add(new Attraction("Westminster Abbey", 0.5, 7)); attractions.add(new Attraction("Globe Theater", 0.5, 6)); attractions.add(new Attraction("National Gallery", 1, 9)); attractions.add(new Attraction("British Museum", 2, 9)); attractions.add(new Attraction("St. Paul's Cathedral", 0.5, 8)); KnapsackUtil.fill(knapsack, attractions); for (Attraction attraction : knapsack.getItems()){ System.out.println(attraction); } } }
[ "11800015@student.pxl.be" ]
11800015@student.pxl.be
bb290ab4db3301e572663f444b94dc59fb5b3405
f54322f5f149a00b1a87bd61ade0df2ef7877f45
/SwordToOffer/src/main/java/p4_reConstructBinaryTree/Solution.java
11e27112ad2eaf6dc3f38f2275f8ee73b6fdb208
[]
no_license
hongye612430/DAS
cf5c72000e951472280f458f2f9d143267c32fc6
7f9946d3f45c76dd0fc3005abf055a98061a8355
refs/heads/master
2020-06-19T00:18:32.594641
2019-07-07T13:16:47
2019-07-07T13:16:47
196,502,424
1
0
null
2019-07-12T03:28:36
2019-07-12T03:28:36
null
UTF-8
Java
false
false
357
java
package p4_reConstructBinaryTree; /** * ้‡ๅปบไบŒๅ‰ๆ ‘ */ public class Solution { /** * ไบŒๅ‰ๆ ‘่Š‚็‚น็ฑป */ private class TreeNode { int val; TreeNode left; TreeNode right; TreeNode(int x) { val = x; } } public TreeNode reConstructBinaryTree(int [] pre, int [] in) { return null; } }
[ "741494582@qq.com" ]
741494582@qq.com
a99b0acd669a8ac696d4f5407efadd316bcd6058
bb476d733fd606bcdc2ea2d3962fb57654cb92ba
/kickstart-platform/src/main/java/platform/webservice/ui/html/ASIDE.java
92e11ef034e7873ad44fbcd39f3f00820b8beb8c
[]
no_license
FullStackNet/kickstart
9e2a5ec795e86f4db9089d2dee84abc4d3b1ab19
eea95dcef054db66e620e98a079fa1a6aab802f5
refs/heads/master
2021-05-16T17:32:37.594867
2018-01-10T17:52:11
2018-01-10T17:52:11
100,499,456
1
0
null
null
null
null
UTF-8
Java
false
false
383
java
package platform.webservice.ui.html; public class ASIDE extends BaseHTMLComponent{ public ASIDE() { super(); } public ASIDE(String id,String className) { super(id,className); } public ASIDE(String id, String name,String className) { super(id,name,className); } @Override public String getTag() { // TODO Auto-generated method stub return "aside"; } }
[ "im.aditya0689@gmail.com" ]
im.aditya0689@gmail.com
94c7bc6d37732d4d4b8013b01b6aa3a82a873a81
3247360ea20edce37f6f2ab727a403644bd44497
/bitcamp-java-application4-server/v56_5/src/main/java/com/eomcs/lms/Servlet/FooterServlet.java
003e339506857a55d48810f2587b7d0049fbb82b
[]
no_license
choitaehoon1998/bitcamp-java-20190527
57b1774d50f245b0b77016f0ae541710233010b6
2450c3042642df3eae2fc896e12c376c7d27b048
refs/heads/master
2020-06-13T20:17:08.537015
2019-10-15T12:30:20
2019-10-15T12:30:20
194,775,340
0
0
null
2020-04-30T11:45:18
2019-07-02T02:41:02
Java
UTF-8
Java
false
false
1,135
java
package com.eomcs.lms.Servlet; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; // ์—ญํ™œ : // => ํ™”๋ฉด ํ•˜๋‹จ์— ์ œ์ž‘์ž์™€ ์‚ฌ์ดํŠธ์˜ ์†Œ์œ ์ฃผ ์ •๋ณด์„ ์ถœ๋ ฅํ•œ๋‹ค . @WebServlet("/footer") public class FooterServlet extends HttpServlet { private static final long serialVersionUID = 1L; @Override protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { //์ธํด๋ฃจ๋”ฉ ์„œ๋ธ”๋ฆฟ์—์„œ๋Š” setContentType()์„ ํ˜ธ์ถœํ•ด๋ด์•ผ ์†Œ์šฉ ์—†๋‹ค // ์ด์„œ๋ธ”๋ฆฟ์„ ์š”์ฒญํ•˜๋Š” ์ชฝ์—์„œ ์ฒ˜๋ฆฌํ•ด์•ผํ•œ๋‹ค . //response.setContentType("text/html;charset=UTF-8"); PrintWriter out = response.getWriter(); out.println("<div id='footer'>"); out.println(" &copy; 2019"); out.println(" <span>๋น„ํŠธ์บ ํ”„, ์ž๋ฐ”130๊ธฐ</span>"); out.println("</div>"); } }
[ "hugebigdream@gmail.com" ]
hugebigdream@gmail.com
4e9fb6f3253d6821babc911042497406ce97a9fe
ddddc9f26ad713801a4ff125fd67bf38136be82e
/src/main/java/com/scottxuan/create/single/hungrysingle/Singleton.java
3044552e636cefaa78fd6c75e1297e2fd65bb10e
[]
no_license
scottxuan/design-mode
dc2b5abc91f21f15b77c7bde430510ab421c2739
d901dc2c6afa4d2e63e16926a666fc5b09735f06
refs/heads/master
2022-12-20T20:37:41.029607
2020-09-24T09:27:21
2020-09-24T09:27:21
257,780,759
0
0
null
null
null
null
UTF-8
Java
false
false
342
java
package com.scottxuan.create.single.hungrysingle; /** * @author : zhaoxuan */ public class Singleton { private static final Singleton singleton = new Singleton(); private Singleton() { System.out.println("้ฅฟๆฑ‰ๅผๅ•ไพ‹ๆจกๅผๅˆๅง‹ๅŒ–"); } public static Singleton getInstance(){ return singleton; } }
[ "zhaoxuan@jueeyaoair.com" ]
zhaoxuan@jueeyaoair.com