blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
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
689M
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
131 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
32 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
313
46a5a73547d03adff1d1e54b9b16672706b536f2
790c6d2905a16e1ea6b05a9003653ed2f814e7de
/Level UP and IP/Array/Arrays 3/WiggleSort.java
48e8a0b654fcebbc84cd6c59bf9a21a936cc306b
[]
no_license
VishalDutt1998/DSA-1
85f37a3142551b3477af60e4300b2e22996464fa
c4ad9ce914272046dab226cda970bd90c83d3d89
refs/heads/master
2023-08-28T20:24:45.041711
2021-10-18T16:09:36
2021-10-18T16:09:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
500
java
// https://www.lintcode.com/problem/wiggle-sort/description // Lintcode 508 // import java.io.*; import java.util.*; public class WiggleSort { public static void main(String[] args) { Scanner scn = new Scanner(System.in); int n = scn.nextInt(); int[] arr = new int[n]; for(int i=0;i<n;i++){ arr[i] = scn.nextInt(); } // wiggleSort(arr); scn.close(); } // public static void wiggleSort(int[] arr){ // } }
789724467fb596e17a5da77b9c57eddd2274bab8
47940db5776d347dc09a5e69c5bc19a25a81ab6a
/app/src/main/java/com/example/hearthstoneapi/retrofit/model/BasicItem.java
8e2be5658e85a30616fa13d9476d20191d135f17
[]
no_license
KaasiSerrano/HearthstoneAPI
3819d0a7859e2c407d6d9279945300c73c118571
15fc959d16c672da43133ca8bd4ae65b184f6916
refs/heads/master
2020-05-03T06:11:28.894343
2019-04-09T23:19:57
2019-04-09T23:19:57
178,467,013
0
0
null
null
null
null
UTF-8
Java
false
false
6,312
java
package com.example.hearthstoneapi.retrofit.model; import com.google.gson.annotations.SerializedName; import java.util.List; public class BasicItem { @SerializedName("img") private String img; @SerializedName("cost") private int cost; @SerializedName("collectible") private boolean collectible; @SerializedName("artist") private String artist; @SerializedName("dbfId") private String dbfId; @SerializedName("type") private String type; @SerializedName("howToGetGold") private String howToGetGold; @SerializedName("locale") private String locale; @SerializedName("flavor") private String flavor; @SerializedName("playerClass") private String playerClass; @SerializedName("cardSet") private String cardSet; @SerializedName("cardId") private String cardId; @SerializedName("faction") private String faction; @SerializedName("name") private String name; @SerializedName("imgGold") private String imgGold; @SerializedName("howToGet") private String howToGet; @SerializedName("text") private String text; @SerializedName("rarity") private String rarity; @SerializedName("health") private int health; @SerializedName("mechanics") private List<MechanicsItem> mechanics; @SerializedName("attack") private int attack; @SerializedName("race") private String race; @SerializedName("durability") private int durability; public String getImg() { return img; } public void setImg(String img) { this.img = img; } public int getCost() { return cost; } public void setCost(int cost) { this.cost = cost; } public boolean isCollectible() { return collectible; } public void setCollectible(boolean collectible) { this.collectible = collectible; } public String getArtist() { return artist; } public void setArtist(String artist) { this.artist = artist; } public String getDbfId() { return dbfId; } public void setDbfId(String dbfId) { this.dbfId = dbfId; } public String getType() { return type; } public void setType(String type) { this.type = type; } public String getHowToGetGold() { return howToGetGold; } public void setHowToGetGold(String howToGetGold) { this.howToGetGold = howToGetGold; } public String getLocale() { return locale; } public void setLocale(String locale) { this.locale = locale; } public String getFlavor() { return flavor; } public void setFlavor(String flavor) { this.flavor = flavor; } public String getPlayerClass() { return playerClass; } public void setPlayerClass(String playerClass) { this.playerClass = playerClass; } public String getCardSet() { return cardSet; } public void setCardSet(String cardSet) { this.cardSet = cardSet; } public String getCardId() { return cardId; } public void setCardId(String cardId) { this.cardId = cardId; } public String getFaction() { return faction; } public void setFaction(String faction) { this.faction = faction; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getImgGold() { return imgGold; } public void setImgGold(String imgGold) { this.imgGold = imgGold; } public String getHowToGet() { return howToGet; } public void setHowToGet(String howToGet) { this.howToGet = howToGet; } public String getText() { return text; } public void setText(String text) { this.text = text; } public String getRarity() { return rarity; } public void setRarity(String rarity) { this.rarity = rarity; } public int getHealth() { return health; } public void setHealth(int health) { this.health = health; } public List<MechanicsItem> getMechanics() { return mechanics; } public void setMechanics(List<MechanicsItem> mechanics) { this.mechanics = mechanics; } public int getAttack() { return attack; } public void setAttack(int attack) { this.attack = attack; } public String getRace() { return race; } public void setRace(String race) { this.race = race; } public int getDurability() { return durability; } public void setDurability(int durability) { this.durability = durability; } @Override public String toString() { return "BasicItem{" + "img = '" + img + '\'' + ",cost = '" + cost + '\'' + ",collectible = '" + collectible + '\'' + ",artist = '" + artist + '\'' + ",dbfId = '" + dbfId + '\'' + ",type = '" + type + '\'' + ",howToGetGold = '" + howToGetGold + '\'' + ",locale = '" + locale + '\'' + ",flavor = '" + flavor + '\'' + ",playerClass = '" + playerClass + '\'' + ",cardSet = '" + cardSet + '\'' + ",cardId = '" + cardId + '\'' + ",faction = '" + faction + '\'' + ",name = '" + name + '\'' + ",imgGold = '" + imgGold + '\'' + ",howToGet = '" + howToGet + '\'' + ",text = '" + text + '\'' + ",rarity = '" + rarity + '\'' + ",health = '" + health + '\'' + ",mechanics = '" + mechanics + '\'' + ",attack = '" + attack + '\'' + ",race = '" + race + '\'' + ",durability = '" + durability + '\'' + "}"; } }
6f62f8f2926d2283315ccd7f4cd7e83e359468cc
52fb476ba4bc9e5665a77c793a8946c02c9dc5f7
/service-admin/src/main/java/cn/tjmj/serviceadmin/util/CookieUtil.java
f9ccefefad3e1dcca13e2e5739145c84f3e7867a
[]
no_license
wl123954822/shopping-admin
fe7ff83643d924bf568187d468180231dc2835ed
56609c41b0e0b730e4091ae297f7fcc103efc490
refs/heads/master
2020-04-06T19:13:38.798600
2018-11-15T15:11:59
2018-11-15T15:11:59
157,730,536
3
0
null
null
null
null
UTF-8
Java
false
false
1,478
java
package cn.tjmj.serviceadmin.util; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.HashMap; import java.util.Map; /** * ${DESCRIPTION} * * @author wanglei * @create 2017-12-21 9:50 */ public class CookieUtil { /** * 设置cookie * @param response * @param name * @param value */ public static void set(HttpServletResponse response,String name ,String value){ Cookie cookie = new Cookie(name,value); cookie.setPath("/"); cookie.setMaxAge(7200); response.addCookie(cookie); } /** * 获取cookie * @param request * @param name * @return */ public static Cookie get(HttpServletRequest request,String name){ Map<String, Cookie> cookieMap = readCookieMap(request); if (cookieMap.containsKey(name)) { return cookieMap.get(name); }else { return null; } } /** * 将cookie封装成Map * @param request * @return */ private static Map<String, Cookie> readCookieMap(HttpServletRequest request) { Map<String, Cookie> cookieMap = new HashMap<>(); Cookie[] cookies = request.getCookies(); if (cookies != null) { for (Cookie cookie: cookies) { cookieMap.put(cookie.getName(), cookie); } } return cookieMap; } }
ed7b96a6523b598879d532b83a9d4556ca54bda0
96d60b969c526fef7cf2f47d6d968be98122a902
/week03/netty-gateway/src/main/java/com/loodeer/gateway/inbound/HttpInboundServer.java
2558962dde92a318e7ed4eb7516cb04e5b39b9b0
[]
no_license
loodeer/java-training-camp-homework
d9bfb37a5c04e3384c68245515e7981dab9851b7
d0b73649be76e2a430532b9d1e8e5d9085db806b
refs/heads/main
2023-07-18T08:33:40.104420
2021-08-22T08:50:27
2021-08-22T08:50:27
379,324,544
0
0
null
null
null
null
UTF-8
Java
false
false
2,185
java
package com.loodeer.gateway.inbound; import io.netty.bootstrap.ServerBootstrap; import io.netty.buffer.PooledByteBufAllocator; import io.netty.channel.Channel; import io.netty.channel.ChannelOption; import io.netty.channel.epoll.EpollChannelOption; import io.netty.channel.nio.NioEventLoopGroup; import io.netty.channel.socket.nio.NioServerSocketChannel; import io.netty.handler.logging.LogLevel; import io.netty.handler.logging.LoggingHandler; import java.util.List; /** * @author luzuheng * @since 2021-07-11 16:50 */ public class HttpInboundServer { private final int port; private final List<String> proxyServers; public HttpInboundServer(int port, List<String> proxyServers) { this.port = port; this.proxyServers = proxyServers; } public void run() throws InterruptedException { NioEventLoopGroup bossGroup = new NioEventLoopGroup(1); NioEventLoopGroup workerGroup = new NioEventLoopGroup(16); try { ServerBootstrap b = new ServerBootstrap(); b.option(ChannelOption.SO_BACKLOG, 128) .childOption(ChannelOption.TCP_NODELAY, true) .childOption(ChannelOption.SO_KEEPALIVE, true) .childOption(ChannelOption.SO_REUSEADDR, true) .childOption(ChannelOption.SO_RCVBUF, 32 * 1024) .childOption(ChannelOption.SO_SNDBUF, 32 * 1024) .childOption(EpollChannelOption.SO_REUSEPORT, true) .childOption(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT); b.group(bossGroup, workerGroup) .channel(NioServerSocketChannel.class) .handler(new LoggingHandler(LogLevel.INFO)) .childHandler(new HttpInboundInitializer(this.proxyServers)); Channel channel = b.bind(port).sync().channel(); System.out.println("开启 netty http 服务器,监听地址和端口为 http://127.0.0.1:" + port + "/"); channel.closeFuture().sync(); } finally { bossGroup.shutdownGracefully(); workerGroup.shutdownGracefully(); } } }
61c0c6a5a912e6bc8c62c20f68d712bbc9e31420
7b9f417fc79bf4a0fb9394da6a336ff3271a706b
/app/src/main/java/br/com/brsantiago/refund/util/Connectivity.java
8d6f62160cab327a8ab124f506fc61787c3c26a4
[]
no_license
brsanthiago/Caiubi
ddc3e9ce23b8878f8adb2725120c98b4e4c44447
239bf66dd7c351159f4cbf672f5b1222f2462a8a
refs/heads/master
2021-06-09T20:13:00.767589
2017-01-27T01:59:42
2017-01-27T01:59:42
79,966,711
0
0
null
null
null
null
UTF-8
Java
false
false
3,627
java
package br.com.brsantiago.refund.util; import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.telephony.TelephonyManager; /** * Check device's network connectivity and speed * @author emil http://stackoverflow.com/users/220710/emil * */ public class Connectivity { /** * Get the network info * @param context * @return */ public static NetworkInfo getNetworkInfo(Context context){ ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); return cm.getActiveNetworkInfo(); } /** * Check if there is any connectivity * @param context * @return */ public static boolean isConnected(Context context){ NetworkInfo info = Connectivity.getNetworkInfo(context); return (info != null && info.isConnected()); } /** * Check if there is any connectivity to a Wifi network * @param context * @return */ public static boolean isConnectedWifi(Context context){ NetworkInfo info = Connectivity.getNetworkInfo(context); return (info != null && info.isConnected() && info.getType() == ConnectivityManager.TYPE_WIFI); } /** * Check if there is any connectivity to a mobile network * @param context * @return */ public static boolean isConnectedMobile(Context context){ NetworkInfo info = Connectivity.getNetworkInfo(context); return (info != null && info.isConnected() && info.getType() == ConnectivityManager.TYPE_MOBILE); } /** * Check if there is fast connectivity * @param context * @return */ public static boolean isConnectedFast(Context context){ NetworkInfo info = Connectivity.getNetworkInfo(context); return (info != null && info.isConnected() && Connectivity.isConnectionFast(info.getType(),info.getSubtype())); } /** * Check if the connection is fast * @param type * @param subType * @return */ public static boolean isConnectionFast(int type, int subType){ if(type== ConnectivityManager.TYPE_WIFI){ return true; }else if(type== ConnectivityManager.TYPE_MOBILE){ switch(subType){ case TelephonyManager.NETWORK_TYPE_1xRTT: return false; // ~ 50-100 kbps case TelephonyManager.NETWORK_TYPE_CDMA: return false; // ~ 14-64 kbps case TelephonyManager.NETWORK_TYPE_EDGE: return false; // ~ 50-100 kbps case TelephonyManager.NETWORK_TYPE_EVDO_0: return true; // ~ 400-1000 kbps case TelephonyManager.NETWORK_TYPE_EVDO_A: return true; // ~ 600-1400 kbps case TelephonyManager.NETWORK_TYPE_GPRS: return false; // ~ 100 kbps case TelephonyManager.NETWORK_TYPE_HSDPA: return true; // ~ 2-14 Mbps case TelephonyManager.NETWORK_TYPE_HSPA: return true; // ~ 700-1700 kbps case TelephonyManager.NETWORK_TYPE_HSUPA: return true; // ~ 1-23 Mbps case TelephonyManager.NETWORK_TYPE_UMTS: return true; // ~ 400-7000 kbps /* * Above API level 7, make sure to set android:targetSdkVersion * to appropriate level to use these */ case TelephonyManager.NETWORK_TYPE_EHRPD: // API level 11 return true; // ~ 1-2 Mbps case TelephonyManager.NETWORK_TYPE_EVDO_B: // API level 9 return true; // ~ 5 Mbps case TelephonyManager.NETWORK_TYPE_HSPAP: // API level 13 return true; // ~ 10-20 Mbps case TelephonyManager.NETWORK_TYPE_IDEN: // API level 8 return false; // ~25 kbps case TelephonyManager.NETWORK_TYPE_LTE: // API level 11 return true; // ~ 10+ Mbps // Unknown case TelephonyManager.NETWORK_TYPE_UNKNOWN: default: return false; } }else{ return false; } } }
6efc2b2db79e1eeb69ec261dae70f0cbb7048ba4
175f96b2938673c161aa32f8002dd6f25cfdcb6c
/src/puzzle/Board.java
036f4f47509b885ed7ac2681f53d423745804fa9
[]
no_license
smiya10/Puzzle
b65e2aa2d829e7e3ed21dde47198a841b7486d22
d73c35048796205337b4e20e20cf067a9c37d9db
refs/heads/master
2021-01-10T03:34:01.901321
2015-10-07T03:31:17
2015-10-07T03:31:17
43,725,912
0
0
null
null
null
null
UTF-8
Java
false
false
2,633
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 puzzle; /** * * @author Syd */ public class Board { final int MAX_ROW = 5; //this and following set bounds of board final int MAX_COL = 5; Position[][] _board = new Position[5][5];//array of positions private static Board _instance = null;//instance of board private Board() { zeroBoard();//construct } public static Board getInstance() { //Singleton pattern, creates single global board if(_instance == null) _instance = new Board(); return _instance; } private void zeroBoard(){ for(int i = 0; i < MAX_ROW; i++){ for(int j = 0; j < MAX_COL; j++){ _board[i][j] = Position.Empty;//fills board w/ empty pegs } } } public Board initializeBoard(int row, int col) { for (int i = 0; i < MAX_ROW; i++){ for (int j = 0; j < MAX_COL - i; j++){ _board[i][j] = new Position(i, j);//creates valid positions in staggered array } } setPegs(); //sets pegs in triangle array removePeg(row, col);//creates empty peg at user-set element return getInstance();//returns modified board } private void setPegs(){ for(int i = 0; i < MAX_ROW; i++){ for(int j = 0; j < MAX_COL; j++){ if(!Position.isNullOrEmpty(_board[i][j])) _board[i][j].setPeg(new Peg()); } } } public void printBoard(){ for(int i = 0; i < MAX_ROW; i++){ for(int j = 0; j < MAX_COL; j++){ if(!Position.isNullOrEmpty(_board[i][j])) System.out.println(_board[i][j].toString()); } } } public void removePeg(int row, int column) throws Exception{ positionAt(row, column).removePeg(); } public Position positionAt(int row, int col) throws Exception { if(row < 0 || row == MAX_ROW) throw new Exception("Row: " + row + " is out of bounds"); if(col < 0 || col == MAX_COL) throw new Exception("Col: " + col + " is out of bounds"); return _board[row][col]; } public void start(int x, int y) throws Exception { positionAt(x, y).getPeg().jump(); } }
fe5d0828d9fd83d5ceac8de7ebc97da554585c02
4115ba77c54030efec062057edf5ae6f981d1a52
/src/main/java/cn/edu/njust/dev/ses/main/filter/SessionLoginFilter.java
9d699b5c6981a6a48276a6d58bf915a0e773be94
[]
no_license
mike0228/SPM
d5e3c463776030c699c720f7926f1e48c832e9d8
df9f514cf32eefe96b355917868072a94cd5fc47
refs/heads/master
2022-07-16T18:49:34.544443
2019-12-25T00:19:53
2019-12-25T00:19:53
226,887,462
4
2
null
2022-06-29T17:50:10
2019-12-09T14:12:40
Java
UTF-8
Java
false
false
1,164
java
package cn.edu.njust.dev.ses.main.filter; import cn.edu.njust.dev.ses.main.service.AccountManagementService; import org.springframework.web.filter.OncePerRequestFilter; import javax.servlet.FilterChain; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; public class SessionLoginFilter extends OncePerRequestFilter { private final AccountManagementService accountManagementService; public SessionLoginFilter(AccountManagementService accountManagement){ this.accountManagementService = accountManagement; } @Override protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { if(request.getSession().getAttribute("logged_in_as") == null && request.getSession().getAttribute("quick_validate_performed") == null) { accountManagementService.quickValidate(request); request.getSession().setAttribute("quick_validate_performed", true); } filterChain.doFilter(request, response); } }
7d61edbef9d3ba91f355ba013b280e08623fc146
03267b742fbe0e91f7b347dd8b1130a2d99fb536
/mcs.base/src/main/java/com/masscustsoft/model/DateRange.java
e0210f64dcd063c5874a205f65579ff48322ddd0
[]
no_license
masscustsoft/mcs-engine-java
c5edca3bd3d081f01323ebb63b230e857b367fb1
3b66d94fbd6de6efee1f0775a3339fa608fe2eef
refs/heads/master
2021-06-15T18:02:53.988138
2017-04-10T01:24:11
2017-04-10T01:24:11
82,700,571
0
0
null
null
null
null
UTF-8
Java
false
false
7,583
java
package com.masscustsoft.model; import java.sql.Date; import java.util.Calendar; import com.masscustsoft.api.AutoInc; import com.masscustsoft.api.FullText; import com.masscustsoft.api.IndexKey; import com.masscustsoft.api.NumIndex; import com.masscustsoft.api.PrimaryKey; import com.masscustsoft.api.SQLTable; import com.masscustsoft.util.LightUtil; @SQLTable("DateRanges") public class DateRange extends Entity { @IndexKey @PrimaryKey String ownerId; @NumIndex @PrimaryKey @AutoInc Integer sequenceId; String rangeType; //AlignToToday, AlignToWeekDay, AlignToMonthDay, Custom @FullText String name; Date fromDate,toDate; String fromWeekDay, fromMonthDay, fromMonth; int fromOffset=-1,toOffset=0; /*@Override public boolean afterSearch(IDataService data, List list) throws Exception { if (list.size()<=1){ //there's a *ADDNEW* for this one { DateRange d=new DateRange(); d.setOwnerId(LightUtil.getUserId()); d.setName("{\"en\":\"Today\",\"zh_CN\":\"今天\"}"); d.setRangeType("AlignToToday"); d.setFromOffset(0); d.setToOffset(1); dataService.insertBean(d); } { DateRange d=new DateRange(); d.setOwnerId(ServerUtil.getUserId()); d.setName("{\"en\":\"Yesterday\",\"zh_CN\":\"昨天\"}"); d.setRangeType("AlignToToday"); d.setFromOffset(-1); d.setToOffset(0); dataService.insertBean(d); } { DateRange d=new DateRange(); d.setOwnerId(ServerUtil.getUserId()); d.setName("{\"en\":\"This Week\",\"zh_CN\":\"本周\"}"); d.setRangeType("AlignToWeekDay"); d.setFromWeekDay("Mon"); d.setFromOffset(0); d.setToOffset(1); dataService.insertBean(d); } { DateRange d=new DateRange(); d.setOwnerId(ServerUtil.getUserId()); d.setName("{\"en\":\"Last Week\",\"zh_CN\":\"上周\"}"); d.setRangeType("AlignToWeekDay"); d.setFromWeekDay("Mon"); d.setFromOffset(-1); d.setToOffset(0); dataService.insertBean(d); } { DateRange d=new DateRange(); d.setOwnerId(ServerUtil.getUserId()); d.setName("{\"en\":\"This Month\",\"zh_CN\":\"本月\"}"); d.setRangeType("AlignToMonthDay"); d.setFromMonthDay("01"); d.setFromOffset(0); d.setToOffset(1); dataService.insertBean(d); } { DateRange d=new DateRange(); d.setOwnerId(ServerUtil.getUserId()); d.setName("{\"en\":\"Last Month\",\"zh_CN\":\"上月\"}"); d.setRangeType("AlignToMonthDay"); d.setFromMonthDay("01"); d.setFromOffset(-1); d.setToOffset(0); dataService.insertBean(d); } { DateRange d=new DateRange(); d.setOwnerId(ServerUtil.getUserId()); d.setName("{\"en\":\"This Year\",\"zh_CN\":\"今年\"}"); d.setRangeType("AlignToYearDay"); d.setFromMonthDay("01"); d.setFromMonth("Jan"); d.setFromOffset(0); d.setToOffset(1); dataService.insertBean(d); } { DateRange d=new DateRange(); d.setOwnerId(ServerUtil.getUserId()); d.setName("{\"en\":\"Last Year\",\"zh_CN\":\"去年\"}"); d.setRangeType("AlignToYearDay"); d.setFromMonthDay("01"); d.setFromMonth("Jan"); d.setFromOffset(-1); d.setToOffset(0); dataService.insertBean(d); } return true; //ask to reload } return false; }*/ public Date getFrom() throws Exception{ Calendar c=LightUtil.getShortCalendar(); if (rangeType.equals("AlignToToday")){ c.add(Calendar.DATE, fromOffset); return LightUtil.shortDate(c); } if (rangeType.equals("AlignToWeekDay")){ c.set(Calendar.DAY_OF_WEEK, "Sun".equals(fromWeekDay)?Calendar.SUNDAY:"Mon".equals(fromWeekDay)?Calendar.MONDAY:"Tue".equals(fromWeekDay)?Calendar.TUESDAY:"Wed".equals(fromWeekDay)?Calendar.WEDNESDAY:"Thu".equals(fromWeekDay)?Calendar.THURSDAY:"Fri".equals(fromWeekDay)?Calendar.FRIDAY:Calendar.SATURDAY); c.add(Calendar.DATE, 7*fromOffset); return LightUtil.shortDate(c); } if (rangeType.equals("AlignToMonthDay")){ c.add(Calendar.MONTH, fromOffset); if (fromMonthDay.equals("Lastdayofmonth")){ c.set(Calendar.DAY_OF_MONTH, 1); c.add(Calendar.MONTH, 1); c.add(Calendar.DATE, -1); } else{ int day=LightUtil.decodeInt(fromMonthDay); c.set(Calendar.DAY_OF_MONTH, day); } return LightUtil.shortDate(c); } if (rangeType.equals("AlignToYearDay")){ c.set(Calendar.MONTH, "Jan".equals(fromMonth)?Calendar.JANUARY:"Feb".equals(fromMonth)?Calendar.FEBRUARY:"Mar".equals(fromMonth)?Calendar.MARCH:"Apr".equals(fromMonth)?Calendar.APRIL :"May".equals(fromMonth)?Calendar.MAY:"Jun".equals(fromMonth)?Calendar.JUNE:"Jul".equals(fromMonth)?Calendar.JULY:"Aug".equals(fromMonth)?Calendar.AUGUST :"Sep".equals(fromMonth)?Calendar.SEPTEMBER:"Oct".equals(fromMonth)?Calendar.OCTOBER:"Nov".equals(fromMonth)?Calendar.NOVEMBER:Calendar.DECEMBER); c.add(Calendar.YEAR, fromOffset); if (fromMonthDay.equals("Lastdayofmonth")){ c.set(Calendar.DAY_OF_MONTH, 1); c.add(Calendar.MONTH, 1); c.add(Calendar.DATE, -1); } else{ int day=LightUtil.decodeInt(fromMonthDay); c.set(Calendar.DAY_OF_MONTH, day); } return LightUtil.shortDate(c); } return fromDate; } public Date getTo(Date from) throws Exception{ Calendar c=LightUtil.getShortCalendar(); if (from!=null) c.setTime(from); if (rangeType.equals("AlignToToday")){ c.add(Calendar.DATE, toOffset-fromOffset-1); return LightUtil.shortDate(c); } if (rangeType.equals("AlignToWeekDay")){ c.add(Calendar.DATE, 7*(toOffset-fromOffset)-1); return LightUtil.shortDate(c); } if (rangeType.equals("AlignToMonthDay")){ c.add(Calendar.MONTH, toOffset-fromOffset); c.add(Calendar.DATE,-1); return LightUtil.shortDate(c); } if (rangeType.equals("AlignToYearDay")){ c.add(Calendar.YEAR, toOffset-fromOffset); c.add(Calendar.DATE,-1); return LightUtil.shortDate(c); } return toDate; } public String getOwnerId() { return ownerId; } public void setOwnerId(String ownerId) { this.ownerId = ownerId; } public String getRangeType() { return rangeType; } public void setRangeType(String rangeType) { this.rangeType = rangeType; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Date getFromDate() { return fromDate; } public void setFromDate(Date fromDate) { this.fromDate = fromDate; } public Date getToDate() { return toDate; } public void setToDate(Date toDate) { this.toDate = toDate; } public Integer getSequenceId() { return sequenceId; } public void setSequenceId(Integer sequenceId) { this.sequenceId = sequenceId; } public String getFromWeekDay() { return fromWeekDay; } public void setFromWeekDay(String fromWeekDay) { this.fromWeekDay = fromWeekDay; } public String getFromMonthDay() { return fromMonthDay; } public void setFromMonthDay(String fromMonthDay) { this.fromMonthDay = fromMonthDay; } public int getFromOffset() { return fromOffset; } public void setFromOffset(int fromOffset) { this.fromOffset = fromOffset; } public int getToOffset() { return toOffset; } public void setToOffset(int toOffset) { this.toOffset = toOffset; } public String getFromMonth() { return fromMonth; } public void setFromMonth(String fromMonth) { this.fromMonth = fromMonth; } }
08dacef62004858730f0a0ffe6656ffdc547d1e7
e53cbd74390d5ba411aa11bfc0507d7c8991b344
/src/com/everything/twitter/events/ResultsReceivedEvent.java
404010ad948adf0da83da13374951e1af8def006
[]
no_license
eladgel/TwitterNew
8ec08622f68019a74daf7489a263c3f7c53e3d1b
a6cd873bad1a96fd31fcda4ec75097a272ee2dd0
refs/heads/master
2020-05-20T04:10:38.135720
2013-07-12T17:27:13
2013-07-12T17:27:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
363
java
package com.everything.twitter.events; import twitter4j.QueryResult; //import com.base.fufinder.enums.itemearchType; public class ResultsReceivedEvent{ QueryResult mItem; public ResultsReceivedEvent(QueryResult item) { setItem(item); } public QueryResult getItem() { return mItem; } public void setItem(QueryResult item) { mItem = item; } }
9a2969ba4e333bc8a26dde3ab55ae3fa5b1f16e9
42277e19adfb620aadc391868050af44bf8b060f
/app/src/main/java/com/ljcs/cxwl/ui/activity/other/component/FamilyRegisterComponent.java
6705a5b8a60c49a2d8f27720116f6e5d1b523c09
[]
no_license
18670819116/goufang
4da367cfba931ed2942e075e74707577bb3e1422
080b0776b6846924a47b3cfe39be5c4dd564f6ec
refs/heads/master
2020-03-24T18:05:33.172926
2018-07-30T11:13:59
2018-07-30T11:13:59
142,882,425
1
1
null
2018-07-30T13:53:34
2018-07-30T13:53:34
null
UTF-8
Java
false
false
676
java
package com.ljcs.cxwl.ui.activity.other.component; import com.ljcs.cxwl.application.AppComponent; import com.ljcs.cxwl.ui.activity.base.ActivityScope; import com.ljcs.cxwl.ui.activity.other.FamilyRegisterActivity; import com.ljcs.cxwl.ui.activity.other.module.FamilyRegisterModule; import dagger.Component; /** * @author xlei * @Package com.ljcs.cxwl.ui.activity.other * @Description: The component for FamilyRegisterActivity * @date 2018/06/27 17:51:07 */ @ActivityScope @Component(dependencies = AppComponent.class, modules = FamilyRegisterModule.class) public interface FamilyRegisterComponent { FamilyRegisterActivity inject(FamilyRegisterActivity Activity); }
7ad483f1af946d375c47091d0211f12efb64ec4c
8d9514fe4c6d2503243fcf8c915332fc4ea615e6
/spring5/sp5-chap07/src/main/java/spring5/domain/ExeTimeAspect.java
ecb7f512c977bdfaca658045633384544fda93a8
[]
no_license
fucct/spring5
3e8b40cecee86f9f01106f96cd6395e37c495bab
f4b993276ad418f95d9d8aa202eabdbbef1fe416
refs/heads/master
2022-05-28T21:14:51.217959
2020-04-26T09:39:17
2020-04-26T09:39:17
256,487,590
1
0
null
null
null
null
UTF-8
Java
false
false
1,030
java
package spring5.domain; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.Signature; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Pointcut; import org.springframework.core.annotation.Order; import java.util.Arrays; @Aspect @Order(2) public class ExeTimeAspect { @Pointcut("execution(public * spring5.domain.chap07..*(..))") private void publicTarget() { } @Around("publicTarget()") public Object measure(ProceedingJoinPoint joinPoint) throws Throwable { long start = System.nanoTime(); try { Object result = joinPoint.proceed(); return result; } finally { long finish = System.nanoTime(); Signature sig = joinPoint.getSignature(); System.out.printf("%s.%s(%s) 실행 시간 : %d ns\n", joinPoint.getTarget().getClass().getSimpleName(), sig.getName(), Arrays.toString(joinPoint.getArgs()), (finish - start)); } } }
6bf6c6a7a752b7e0f919d61d7923385fde802dc8
09adaad00fd9f4a3ad4ad07dc9c0971732ee466d
/src/test/java/seleniumTests/PKBQuartz.java
5f0e9d7e8de9d3addd4c67f12ad97d9d9b5486dd
[]
no_license
navekumarreddy94/CucumberFramework
41eef01f9599c1725ee2b169792373dbf2f244ab
0d33f5d1ce5e851d6f0a6bb21df2fb30b0c64005
refs/heads/master
2023-01-24T07:28:15.801061
2023-01-10T17:01:34
2023-01-10T17:01:34
230,424,445
1
0
null
2021-04-26T19:49:41
2019-12-27T10:32:09
Java
UTF-8
Java
false
false
3,494
java
package seleniumTests; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.util.Scanner; public class PKBQuartz { static StringBuilder sbword = new StringBuilder(); static String dirname = null; static File[] filenames = null; static Scanner sc = new Scanner(System.in); public static void main(String args[]) throws FileNotFoundException, IOException{ boolean fileread = ReadFiles(); sbword = null; System.exit(0); } private static boolean ReadFiles() throws FileNotFoundException, IOException{ System.out.println("Enter the location of folder:"); File file = new File("C:\\Facts\\Trunk\\quartz\\tests\\Set_Time\\SQL Files"); filenames = file.listFiles(); String line = null; for(File file1 : filenames ){ System.out.println("File name" + file1.toString()); sbword.setLength(0); BufferedReader br = new BufferedReader(new FileReader(file1)); line = br.readLine(); while(line != null){ System.out.println(line); sbword.append(line).append("\r\n"); line = br.readLine(); } ReplaceLines(); WriteToFile(file1.toString()); } return true; } private static void ReplaceLines(){ System.out.println("sbword contains :" + sbword.toString()); //System.out.println("Enter the word to replace from each of the files:"); //String from = sc.nextLine(); //System.out.println("Enter the new word"); //String To = sc.nextLine(); //StringBuilder sbword = new StringBuilder(stbuff); /* ReplaceAll(sbword,"from","from <MSSQL>PKBQuartz.<END MSSQL>"); ReplaceAll(sbword,"FROM","FROM <MSSQL>PKBQuartz.<END MSSQL>"); ReplaceAll(sbword,"Insert into","INSERT INTO <MSSQL>PKBQuartz.<END MSSQL>"); ReplaceAll(sbword,"INSERT INTO","INSERT INTO <MSSQL>PKBQuartz.<END MSSQL>"); ReplaceAll(sbword,"update","update <MSSQL>PKBQuartz.<END MSSQL>"); ReplaceAll(sbword,"insert into","insert into <MSSQL>PKBQuartz.<END MSSQL>"); */ // ReplaceAll(sbword,"<MSSQL>PKBQuartz.<END MSSQL><MSSQL>PKBQuartz.<END MSSQL>","<MSSQL>PKBQuartz.<END MSSQL>"); // ReplaceAll(sbword,"<MSSQL>PKBQuartz.<END MSSQL><MSSQL>pkbquartz.<END MSSQL>","<MSSQL>PKBQuartz.<END MSSQL>"); // ReplaceAll(sbword,"dim_last_update <MSSQL>PKBQuartz.<END MSSQL>","dim_last_update "); ReplaceAll(sbword,"<END MSSQL> ","<END MSSQL>"); //String inputString="FROM <MSSQL>pkbfoundation.<END MSSQL>"; //inputString.replaceAll("<MSSQL>pkbfoundation.<END MSSQL> ", ""); } private static void ReplaceAll(StringBuilder builder, String from, String to){ int index = builder.indexOf(from); while(index != -1){ builder.replace(index, index + from.length(), to); index += to.length(); index = builder.indexOf(from,index); } } private static void WriteToFile(String filename) throws IOException{ try{ File file1 = new File(filename); BufferedWriter bufwriter = new BufferedWriter(new FileWriter(file1)); bufwriter.write(sbword.toString()); bufwriter.close(); }catch(Exception e){ System.out.println("Error occured while attempting to write to file: " + e.getMessage()); } } }
eff33b6e6ade47eec0548537e095f4c3a9b7b785
16a8589357484cac2a8a025a197ef6ceb8e0c773
/GuardKiKi/src/main/java/com/pg/pgguardkiki/tools/view/BaseImageView.java
8d2a2ec19c7583b6fdb007dbeb629f89360feb48
[]
no_license
zhangzijian86/PGGuardKiKi
2d6cdf56a0d4e69d530341e9ab221f5d4db2df31
ce45fab76751ea65b4c2eb7ff87e7a5cd1bf8e87
refs/heads/master
2020-04-10T21:57:23.151069
2016-11-14T07:23:00
2016-11-14T07:23:00
62,059,772
0
0
null
null
null
null
UTF-8
Java
false
false
3,290
java
package com.pg.pgguardkiki.tools.view; import android.annotation.SuppressLint; import android.content.Context; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.PorterDuff; import android.graphics.PorterDuffXfermode; import android.graphics.Xfermode; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.widget.ImageView; import java.lang.ref.WeakReference; public abstract class BaseImageView extends ImageView { protected Context mContext; private static final Xfermode sXfermode = new PorterDuffXfermode(PorterDuff.Mode.DST_IN); private Bitmap mMaskBitmap; private Paint mPaint; private WeakReference<Bitmap> mWeakBitmap; public BaseImageView(Context context) { super(context); sharedConstructor(context); } public BaseImageView(Context context, AttributeSet attrs) { super(context, attrs); sharedConstructor(context); } public BaseImageView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); sharedConstructor(context); } private void sharedConstructor(Context context) { mContext = context; mPaint = new Paint(Paint.ANTI_ALIAS_FLAG); } public void invalidate() { mWeakBitmap = null; if (mMaskBitmap != null) { mMaskBitmap.recycle(); } super.invalidate(); } @SuppressLint("DrawAllocation") @Override protected void onDraw(Canvas canvas) { if (!isInEditMode()) { int i = canvas.saveLayer(0.0f, 0.0f, getWidth(), getHeight(), null, Canvas.ALL_SAVE_FLAG); try { Bitmap bitmap = mWeakBitmap != null ? mWeakBitmap.get() : null; if (bitmap == null || bitmap.isRecycled()) { Drawable drawable = getDrawable(); if (drawable != null) { bitmap = Bitmap.createBitmap(getWidth(),getHeight(), Bitmap.Config.ARGB_8888); Canvas bitmapCanvas = new Canvas(bitmap); drawable.setBounds(0, 0, getWidth(), getHeight()); drawable.draw(bitmapCanvas); if (mMaskBitmap == null || mMaskBitmap.isRecycled()) { mMaskBitmap = getBitmap(); } mPaint.reset(); mPaint.setFilterBitmap(false); mPaint.setXfermode(sXfermode); bitmapCanvas.drawBitmap(mMaskBitmap, 0.0f, 0.0f, mPaint); mWeakBitmap = new WeakReference<Bitmap>(bitmap); } } if (bitmap != null) { mPaint.setXfermode(null); canvas.drawBitmap(bitmap, 0.0f, 0.0f, mPaint); return; } } catch (Exception e) { System.gc(); } finally { canvas.restoreToCount(i); } } else { super.onDraw(canvas); } } public abstract Bitmap getBitmap(); }
a4df527a0c69800078cedd06a55fda08f252eac2
6c4b3ce3e12c5a8ceda91006dfaceddbcd5908aa
/com/afrisoftech/hr/ContractMgmtntfr.java
02a0f4b71ac7497d293c8d8949f579df0baafcab
[]
no_license
josefloso/FunsoftHMIS
a34bcc6f88c15e85069804814ecef1f9738d7576
0ba481260737382e57ac2c674acd03e00e9dde90
refs/heads/master
2021-01-15T22:20:32.504511
2015-12-01T07:02:42
2015-12-01T07:02:42
50,920,224
1
0
null
2016-02-02T12:49:53
2016-02-02T12:49:53
null
UTF-8
Java
false
false
29,461
java
/* * PolicyAdministrationIntfr.java * * Created on January 27, 2005, 4:07 PM */ package com.afrisoftech.hr; /** * * @author Administrator */ public class ContractMgmtntfr extends javax.swing.JInternalFrame { java.sql.Connection connectDB = null; javax.swing.table.TableModel tableModel = null; javax.swing.JSpinner beginDateSpinner = null; javax.swing.JSpinner endDateSpinner = null; org.netbeans.lib.sql.pool.PooledConnectionSource pConnDB = null; /** Creates new form DefaultInternalFrame */ public ContractMgmtntfr(java.sql.Connection connDb, org.netbeans.lib.sql.pool.PooledConnectionSource pconnDB) { connectDB = connDb; pConnDB = pconnDB; initComponents(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ private void initComponents() {//GEN-BEGIN:initComponents java.awt.GridBagConstraints gridBagConstraints; jTextField1 = new javax.swing.JTextField(); buttonGroup1 = new javax.swing.ButtonGroup(); try { nBCachedRowSet1 = new org.netbeans.lib.sql.NBCachedRowSet(); } catch (java.sql.SQLException e1) { e1.printStackTrace(); } try { nBCachedRowSet2 = new org.netbeans.lib.sql.NBCachedRowSet(); } catch (java.sql.SQLException e1) { e1.printStackTrace(); } try { nBCachedRowSet3 = new org.netbeans.lib.sql.NBCachedRowSet(); } catch (java.sql.SQLException e1) { e1.printStackTrace(); } try { nBCachedRowSet4 = new org.netbeans.lib.sql.NBCachedRowSet(); } catch (java.sql.SQLException e1) { e1.printStackTrace(); } try { nBCachedRowSet5 = new org.netbeans.lib.sql.NBCachedRowSet(); } catch (java.sql.SQLException e1) { e1.printStackTrace(); } mainpanel = new javax.swing.JPanel(); datapanel02 = new javax.swing.JPanel(); insertbtm = new javax.swing.JButton(); selectbtm = new javax.swing.JButton(); deletebtn = new javax.swing.JButton(); updatebtn = new javax.swing.JButton(); closebtn = new javax.swing.JButton(); editpanel2 = new javax.swing.JPanel(); newbtn = new javax.swing.JButton(); cancelbtn = new javax.swing.JButton(); editbtn = new javax.swing.JButton(); helppanel2 = new javax.swing.JPanel(); helpbtn = new javax.swing.JButton(); subMainPanel311 = new javax.swing.JPanel(); jPanel1211 = new javax.swing.JPanel(); jLabel3111 = new javax.swing.JLabel(); jLabel4111 = new javax.swing.JLabel(); jLabel6111 = new javax.swing.JLabel(); jLabel7111 = new javax.swing.JLabel(); jComboBox124 = new javax.swing.JComboBox(); jComboBox121 = new javax.swing.JComboBox(); jLabel31111 = new javax.swing.JLabel(); jLabel31112 = new javax.swing.JLabel(); jTextField40 = new javax.swing.JTextField(); jLabel311111 = new javax.swing.JLabel(); jLabel3111121 = new javax.swing.JLabel(); jComboBox123 = new javax.swing.JComboBox(); jComboBox125 = new javax.swing.JComboBox(); jCheckBox1 = new javax.swing.JCheckBox(); jCheckBox2 = new javax.swing.JCheckBox(); datePicker1 = new com.afrisoftech.lib.DatePicker(); datePicker11 = new com.afrisoftech.lib.DatePicker(); jComboBox122 = new javax.swing.JComboBox(); jLabel311113 = new javax.swing.JLabel(); fieldsPanel3111 = new javax.swing.JPanel(); facilityidLbl11111 = new javax.swing.JLabel(); facilityidLbl11411 = new javax.swing.JLabel(); facilityidLbl11611 = new javax.swing.JLabel(); facilitynameLbl11111 = new javax.swing.JLabel(); jTextField41 = new javax.swing.JTextField(); jTextField43 = new javax.swing.JTextField(); jTextField42 = new javax.swing.JTextField(); jScrollPane3 = new javax.swing.JScrollPane(); jTextArea2 = new javax.swing.JTextArea(); jCheckBox21 = new javax.swing.JCheckBox(); datePicker111 = new com.afrisoftech.lib.DatePicker(); facilityidLbl116111 = new javax.swing.JLabel(); jTextField44 = new javax.swing.JTextField(); jTextField1.setText("jTextField1"); nBCachedRowSet1.setCommand("select DISTINCT UPPER (department_name) as name FROM hr.hr_department ORDER BY name"); nBCachedRowSet1.setConnectionSource(pConnDB); nBCachedRowSet2.setCommand("select DISTINCT UPPER (designation) as design FROM hr.hr_job_designation ORDER BY design"); nBCachedRowSet2.setConnectionSource(pConnDB); nBCachedRowSet3.setCommand("select DISTINCT UPPER (res_name) as resource FROM hr.hr_resource_acctype ORDER BY resource"); nBCachedRowSet3.setConnectionSource(pConnDB); nBCachedRowSet4.setCommand("SELECT DISTINCT staff_id FROM hr.hr_staffresume_fileinfo ORDER BY staff_id"); nBCachedRowSet4.setConnectionSource(pConnDB); nBCachedRowSet5.setCommand("SELECT DISTINCT section FROM hr.hr_sections ORDER BY section"); nBCachedRowSet5.setConnectionSource(pConnDB); setClosable(true); setIconifiable(true); setMaximizable(true); setResizable(true); setTitle("CONTRACT MANAGEMENT"); setVisible(true); mainpanel.setLayout(new java.awt.GridBagLayout()); mainpanel.setBorder(new javax.swing.border.TitledBorder("")); datapanel02.setLayout(new java.awt.GridBagLayout()); datapanel02.setBorder(new javax.swing.border.MatteBorder(null)); insertbtm.setText("Insert"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; datapanel02.add(insertbtm, gridBagConstraints); selectbtm.setText("Select"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; datapanel02.add(selectbtm, gridBagConstraints); deletebtn.setText("Delete"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; datapanel02.add(deletebtn, gridBagConstraints); updatebtn.setText("Update"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; datapanel02.add(updatebtn, gridBagConstraints); closebtn.setText("Close"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; datapanel02.add(closebtn, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.ipadx = 10; gridBagConstraints.ipady = 11; gridBagConstraints.weightx = 10.0; gridBagConstraints.weighty = 1.0; mainpanel.add(datapanel02, gridBagConstraints); editpanel2.setLayout(new java.awt.GridBagLayout()); editpanel2.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0))); newbtn.setText("New"); newbtn.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { newbtnActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; editpanel2.add(newbtn, gridBagConstraints); cancelbtn.setText("Cancel"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; editpanel2.add(cancelbtn, gridBagConstraints); editbtn.setText("Edit"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; editpanel2.add(editbtn, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 10.0; gridBagConstraints.weighty = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 3); mainpanel.add(editpanel2, gridBagConstraints); helppanel2.setLayout(new java.awt.GridBagLayout()); helppanel2.setBorder(new javax.swing.border.TitledBorder("")); helpbtn.setText("Help"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; helppanel2.add(helpbtn, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.ipady = 24; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 3); mainpanel.add(helppanel2, gridBagConstraints); subMainPanel311.setLayout(new java.awt.GridBagLayout()); subMainPanel311.setBorder(new javax.swing.border.TitledBorder("")); jPanel1211.setLayout(new java.awt.GridBagLayout()); jPanel1211.setBorder(new javax.swing.border.TitledBorder("Enter the Required Info")); jLabel3111.setText("Contract ID"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; jPanel1211.add(jLabel3111, gridBagConstraints); jLabel4111.setText("Designation"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; jPanel1211.add(jLabel4111, gridBagConstraints); jLabel6111.setText("Department "); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; jPanel1211.add(jLabel6111, gridBagConstraints); jLabel7111.setText("Section"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; jPanel1211.add(jLabel7111, gridBagConstraints); jComboBox124.setModel(new org.netbeans.lib.sql.models.ComboBoxModel (nBCachedRowSet4, "staff_id", null, null, null)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; jPanel1211.add(jComboBox124, gridBagConstraints); jComboBox121.setModel(new org.netbeans.lib.sql.models.ComboBoxModel (nBCachedRowSet1, "name", null, null, null)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; jPanel1211.add(jComboBox121, gridBagConstraints); jLabel31111.setText("Access Control pass Status"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 4; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; jPanel1211.add(jLabel31111, gridBagConstraints); jLabel31112.setText("Contractor/Staff ID"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 0; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; jPanel1211.add(jLabel31112, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; jPanel1211.add(jTextField40, gridBagConstraints); jLabel311111.setText("Expected Expiry date"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 2; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; jPanel1211.add(jLabel311111, gridBagConstraints); jLabel3111121.setText("Begin Date"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 3; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; jPanel1211.add(jLabel3111121, gridBagConstraints); jComboBox123.setFont(new java.awt.Font("Dialog", 0, 12)); jComboBox123.setModel(new org.netbeans.lib.sql.models.ComboBoxModel (nBCachedRowSet3, "resource", null, null, null)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 3; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; jPanel1211.add(jComboBox123, gridBagConstraints); jComboBox125.setModel(new org.netbeans.lib.sql.models.ComboBoxModel (nBCachedRowSet5, "section", null, null, null)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; jPanel1211.add(jComboBox125, gridBagConstraints); jCheckBox1.setText("Invalid"); buttonGroup1.add(jCheckBox1); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 4; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; jPanel1211.add(jCheckBox1, gridBagConstraints); jCheckBox2.setText("Valid"); buttonGroup1.add(jCheckBox2); jCheckBox2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jCheckBox2ActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 4; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; jPanel1211.add(jCheckBox2, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 2; gridBagConstraints.gridwidth = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; jPanel1211.add(datePicker1, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 3; gridBagConstraints.gridwidth = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; jPanel1211.add(datePicker11, gridBagConstraints); jComboBox122.setModel(new org.netbeans.lib.sql.models.ComboBoxModel (nBCachedRowSet2, "design", null, null, null)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; jPanel1211.add(jComboBox122, gridBagConstraints); jLabel311113.setText("Access Control pass ID"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 3; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; jPanel1211.add(jLabel311113, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; subMainPanel311.add(jPanel1211, gridBagConstraints); fieldsPanel3111.setLayout(new java.awt.GridBagLayout()); fieldsPanel3111.setBorder(new javax.swing.border.TitledBorder("More Details")); facilityidLbl11111.setText("Final Dues For Payment"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; fieldsPanel3111.add(facilityidLbl11111, gridBagConstraints); facilityidLbl11411.setText("Date of Final Payment"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 2; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; fieldsPanel3111.add(facilityidLbl11411, gridBagConstraints); facilityidLbl11611.setText("Final payment Amount"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; fieldsPanel3111.add(facilityidLbl11611, gridBagConstraints); facilitynameLbl11111.setText("Contractual Amount"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; fieldsPanel3111.add(facilitynameLbl11111, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; fieldsPanel3111.add(jTextField41, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; fieldsPanel3111.add(jTextField43, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; fieldsPanel3111.add(jTextField42, gridBagConstraints); jScrollPane3.setViewportBorder(new javax.swing.border.TitledBorder("Requirements for Contract")); jScrollPane3.setViewportView(jTextArea2); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 3; gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 50.0; fieldsPanel3111.add(jScrollPane3, gridBagConstraints); jCheckBox21.setText("Renewable"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; gridBagConstraints.gridwidth = 2; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; fieldsPanel3111.add(jCheckBox21, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; fieldsPanel3111.add(datePicker111, gridBagConstraints); facilityidLbl116111.setText("Monthly payment"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 0; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; fieldsPanel3111.add(facilityidLbl116111, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; fieldsPanel3111.add(jTextField44, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.ipady = 50; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 50.0; subMainPanel311.add(fieldsPanel3111, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 20.0; gridBagConstraints.weighty = 1.0; mainpanel.add(subMainPanel311, gridBagConstraints); getContentPane().add(mainpanel, java.awt.BorderLayout.CENTER); setBounds(0, 0, 630, 412); }//GEN-END:initComponents private void jCheckBox2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox2ActionPerformed /*if (this.jCheckBox1.isSelected()){ selectedchbx = jCheckBox2.getText(); } else{ selectedchbx = jCheckBox1.getText(); } */ // Add your handling code here: }//GEN-LAST:event_jCheckBox2ActionPerformed private void newbtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newbtnActionPerformed String selectedchkbx; String selectedchkbx1; if (this.jCheckBox1.isSelected()){ selectedchkbx = jCheckBox1.getText(); } else{ // if (this.jCheckBox3.isSelected()) selectedchkbx = jCheckBox2.getText(); } try { connectDB.setAutoCommit(false); java.sql.PreparedStatement pstmt = connectDB.prepareStatement("insert into hr.hr_contract_mgt (contract_id,dept,designation,pass_id,pass_status,staff_id,section,expiry_date,begin_date,contractL_amt,final_dues,renewable,monthly_pmt,final_pmt,final_pmt_date,client_reqts) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"); pstmt.setObject(1,jTextField40.getText()); pstmt.setObject(2,jComboBox121.getSelectedItem().toString()); pstmt.setObject(3,jComboBox122.getSelectedItem().toString()); pstmt.setObject(4,jComboBox123.getSelectedItem().toString()); pstmt.setObject(5,selectedchkbx); pstmt.setObject(6,jComboBox124.getSelectedItem().toString()); pstmt.setObject(7,jComboBox125.getSelectedItem().toString()); pstmt.setObject(8,datePicker1.getDate()); pstmt.setObject(9,datePicker11.getDate()); pstmt.setObject(10,jTextField41.getText()); pstmt.setObject(11,jTextField42.getText()); pstmt.setObject(12,jCheckBox21.getText()); pstmt.setObject(13,jTextField44.getText()); pstmt.setObject(14,jTextField43.getText()); pstmt.setObject(15,datePicker111.getDate()); pstmt.setObject(16,jTextArea2.getText()); pstmt.executeUpdate(); connectDB.commit(); connectDB.setAutoCommit(true); javax.swing.JOptionPane.showMessageDialog(this, "Data saved successfully","Confirmation Message",javax.swing.JOptionPane.INFORMATION_MESSAGE); } catch(java.sql.SQLException sq){ javax.swing.JOptionPane.showMessageDialog(this, sq.getMessage(),"Error Message!",javax.swing.JOptionPane.ERROR_MESSAGE); try { connectDB.rollback(); }catch (java.sql.SQLException sql){ javax.swing.JOptionPane.showMessageDialog(this,sql.getMessage(),"Error Message!",javax.swing.JOptionPane.ERROR_MESSAGE); } } // Add your handling code here: }//GEN-LAST:event_newbtnActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JTextField jTextField44; private javax.swing.JComboBox jComboBox125; private javax.swing.JTextArea jTextArea2; private javax.swing.JLabel facilitynameLbl11111; private javax.swing.JComboBox jComboBox124; private javax.swing.JLabel jLabel311113; private javax.swing.JLabel facilityidLbl116111; private javax.swing.JTextField jTextField41; private javax.swing.JCheckBox jCheckBox21; private javax.swing.JButton insertbtm; private javax.swing.JLabel jLabel6111; private javax.swing.JPanel subMainPanel311; private javax.swing.JPanel datapanel02; private javax.swing.JLabel jLabel31112; private javax.swing.JLabel facilityidLbl11411; private javax.swing.JButton helpbtn; private javax.swing.JButton updatebtn; private javax.swing.JLabel jLabel311111; private javax.swing.JButton editbtn; private javax.swing.JTextField jTextField42; private org.netbeans.lib.sql.NBCachedRowSet nBCachedRowSet1; private javax.swing.JButton cancelbtn; private javax.swing.JLabel jLabel3111; private javax.swing.JCheckBox jCheckBox2; private javax.swing.JLabel jLabel7111; private javax.swing.JTextField jTextField43; private javax.swing.JTextField jTextField1; private com.afrisoftech.lib.DatePicker datePicker111; private javax.swing.JButton selectbtm; private org.netbeans.lib.sql.NBCachedRowSet nBCachedRowSet2; private javax.swing.JPanel mainpanel; private org.netbeans.lib.sql.NBCachedRowSet nBCachedRowSet5; private javax.swing.JComboBox jComboBox122; private javax.swing.JLabel jLabel3111121; private javax.swing.JTextField jTextField40; private org.netbeans.lib.sql.NBCachedRowSet nBCachedRowSet4; private javax.swing.JButton newbtn; private javax.swing.JComboBox jComboBox121; private javax.swing.JLabel jLabel31111; private javax.swing.JButton deletebtn; private javax.swing.JPanel editpanel2; private javax.swing.JPanel fieldsPanel3111; private org.netbeans.lib.sql.NBCachedRowSet nBCachedRowSet3; private javax.swing.JLabel facilityidLbl11611; private javax.swing.ButtonGroup buttonGroup1; private javax.swing.JPanel jPanel1211; private javax.swing.JLabel jLabel4111; private javax.swing.JComboBox jComboBox123; private com.afrisoftech.lib.DatePicker datePicker1; private javax.swing.JScrollPane jScrollPane3; private javax.swing.JButton closebtn; private javax.swing.JCheckBox jCheckBox1; private javax.swing.JLabel facilityidLbl11111; private com.afrisoftech.lib.DatePicker datePicker11; private javax.swing.JPanel helppanel2; // End of variables declaration//GEN-END:variables }
[ "Charles@Funsoft" ]
Charles@Funsoft
7192770ede2c6d983aa99653957b4fd3a5338bd0
6cfae3d1a77e8750ad1d8e0fe6727ddf05eb35de
/Prac Test 01/Xy080.java
b85c920c623a3f186848c6386c5c17373f2c8bba
[]
no_license
silverbowen/ITSE-2321-OOP-Java
b01a7daa721433f1e7f372f6a199a3f7c0790127
c804eab6957bed1a4c6bfed8c103a06709ec9757
refs/heads/master
2021-01-10T03:51:34.831859
2015-07-09T16:39:43
2015-07-09T16:39:43
36,509,999
1
0
null
null
null
null
UTF-8
Java
false
false
846
java
public class Xy080{ public static void main( String args[]){ new Worker().doOverLoad(); }//end main() }//end class definition class Worker{ public void doOverLoad(){ int x = 3; // even though x is an int, Java will double y = 4.2; // implicitly recast it to a float or double // (in this case a float) System.out.print(square(x) + " "); System.out.print(square(y)); System.out.println(); }//end doOverLoad() public float square(float y){ System.out.print("float "); return y*y; }//end square() public double square(double y){ System.out.print("double "); return y*y; }//end square() }// end class /* This works fine, because Java can implicitely * convert int (or floats) to doubles. * But not doubles to ints or floats! * */
09fba0914d640a6008ebb5fafd06188d9d4b505b
b91abb4c8e8a564297a5d672d0a35651e5049825
/src/main/java/com/hdbandit/architecture_test/repositories/TaskRepository.java
cdd0195413583059946bbd665cb8b1afdd08ef54
[]
no_license
HDBandit/architecture-test
7b021565b82b822e7f84e48e9c9aa93bf34fa2d7
11f8fbd7bbde2ab5f3a2c16b11d07c419094c421
refs/heads/master
2021-01-10T17:43:58.986939
2015-12-27T14:32:00
2015-12-27T14:32:00
48,647,276
0
0
null
null
null
null
UTF-8
Java
false
false
235
java
package com.hdbandit.architecture_test.repositories; import com.hdbandit.architecture_test.model.Task; import org.springframework.data.repository.CrudRepository; public interface TaskRepository extends CrudRepository<Task, Long> { }
de9cac6987dd57a3c7025ee21ddcb6e1ae09675e
6f4ab7364be09f0ad38764e802c96499381fa0a2
/Compilers-5/controlFlowClasses/previousInstructionNodes.java
9823d3f47b186bb8e9292644c51173f70a13de39
[]
no_license
JoHNNyB92/Compilers
16292a76b129cc2df7dcf6f18a7457f9bb0da95e
eb9aa57c297a833f2f921c2027eae7972372b6ef
refs/heads/master
2020-07-03T11:49:36.101541
2019-09-25T12:03:10
2019-09-25T12:03:10
201,896,247
1
0
null
null
null
null
UTF-8
Java
false
false
125
java
package controlFlowClasses; public class previousInstructionNodes { instructionNode previous; int noOfPreviousNodes; }
de92b1b4e22ae7e7dc70ac577865c4e3d0ae17df
f274bd5dfa0418e0e9f11f29cfec65c6390a6005
/src/main/java/banking/model/BankAccount.java
6505d2f14f574c6c84d5654d8cf39785945d9deb
[]
no_license
MarkSzentmiklosi/netBank
d7ec1e412b3cad99621e71c4c72578845e5e5868
b52183b55565855082e642f3a52c64005a30a9c7
refs/heads/master
2020-03-31T20:57:18.504054
2018-10-11T08:35:46
2018-10-11T08:35:46
152,561,758
0
0
null
null
null
null
UTF-8
Java
false
false
1,084
java
package banking.model; import org.hibernate.annotations.Cascade; import javax.persistence.*; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; @Entity public class BankAccount { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private long accountID; private BigDecimal balance; @OneToMany(mappedBy = "bankAccount") @Cascade(org.hibernate.annotations.CascadeType.ALL) private List<Transaction> transactionHistory; { balance = BigDecimal.ZERO; transactionHistory = new ArrayList<Transaction>(); } public BankAccount() { } public long getAccountID() { return accountID; } public BigDecimal getBalance() { return balance; } public void setBalance(BigDecimal balance) { this.balance = balance; } public List<Transaction> getTransactionHistory() { return transactionHistory; } public void setTransactionHistory(List<Transaction> transactionHistory) { this.transactionHistory = transactionHistory; } }
adfef54197adee14f53f05ac1a08cd67574555e7
db76f9cb53b2673e09efe0cd0ff97873964e810e
/Selenium1/src/com/abc/demo/KeyboardEvent2.java
df9d0ebec87d510363fcf3927edc0d2da160788f
[]
no_license
Satish8046/Selenium-Basic-Programs
4708a8a7878d0b278a74ce27c030504511468e38
d5167ace01c2bf08efbfdc23ddbf3b1518939ca1
refs/heads/master
2020-04-09T04:24:40.410108
2018-12-02T07:11:03
2018-12-02T07:11:03
160,021,814
0
0
null
null
null
null
UTF-8
Java
false
false
882
java
package com.abc.demo; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.Keys; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.interactions.Actions; public class KeyboardEvent2 { public static void main(String[] args) { String url="https://www.google.com/"; WebDriver driver=new ChromeDriver(); driver.manage().window().maximize(); driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS); driver.get(url); WebElement text=driver.findElement(By.name("q")); Actions a=new Actions(driver); a.moveToElement(text).click().build().perform(); a.keyDown(Keys.SHIFT).sendKeys("ABC for technology & training").build().perform(); a.sendKeys(Keys.ENTER).build().perform(); } }
873afa4cf022d73885c9d880bf64c5d418130455
c368bda1271cb5fbb4e3b9fda45ecac7ce14fb27
/generated/gov/nih/nci/cadsr/domain/DataElementConcept.java
44e0fc14e2531700a73aacdd2a9da2b9e3ef6dbc
[]
no_license
joshmilind/cacoresystem
3ca393e65123ec20703d99c00325ef65a320ba32
18a7a5a22c77179f0a629a23038a76935cac4c5f
refs/heads/master
2021-01-19T23:32:55.480149
2017-04-21T13:55:32
2017-04-21T13:55:32
88,277,428
0
0
null
null
null
null
UTF-8
Java
false
false
9,678
java
package gov.nih.nci.cadsr.domain; import gov.nih.nci.cadsr.domain.*; import gov.nih.nci.system.applicationservice.*; import gov.nih.nci.common.util.HQLCriteria; import java.util.*; import org.apache.log4j.Logger; /** * <!-- LICENSE_TEXT_START --> * <!-- LICENSE_TEXT_END --> */ /** * A concept that can be represented in the form of a data element, described independently of any particular * representation. (ISO 11179) * */ public class DataElementConcept extends gov.nih.nci.cadsr.domain.AdministeredComponent implements java.io.Serializable { private static final long serialVersionUID = 1234567890L; private gov.nih.nci.cadsr.domain.Property property; public gov.nih.nci.cadsr.domain.Property getProperty() { if(property==null || property.getClass().getName().indexOf('$')>0) { try { String idString = (Class.forName("java.lang.String").isInstance(getId()))? "'"+ getId() + "'" : ""+getId(); String hql = "select child from gov.nih.nci.cadsr.domain.Property as child where child.id in (select parent.property.id from gov.nih.nci.cadsr.domain.DataElementConcept as parent where parent.id="+idString+")"; HQLCriteria hqlCriteria = new HQLCriteria(hql); ApplicationService applicationService = ApplicationServiceProvider.getApplicationService(); java.util.List resultList = applicationService.query(hqlCriteria,"gov.nih.nci.cadsr.domain.Property"); if (resultList!=null && resultList.size()>0) property = (gov.nih.nci.cadsr.domain.Property)resultList.get(0); else property = null; } catch(Exception ex) { Logger log = Logger.getLogger(DataElementConcept.class.getName()); log.error("DataElementConcept:getProperty throws exception ... ...",ex); } } return property; } public void setProperty(gov.nih.nci.cadsr.domain.Property property) { this.property = property; } private gov.nih.nci.cadsr.domain.ConceptualDomain conceptualDomain; public gov.nih.nci.cadsr.domain.ConceptualDomain getConceptualDomain() { if(conceptualDomain==null || conceptualDomain.getClass().getName().indexOf('$')>0) { try { String idString = (Class.forName("java.lang.String").isInstance(getId()))? "'"+ getId() + "'" : ""+getId(); String hql = "select child from gov.nih.nci.cadsr.domain.ConceptualDomain as child where child.id in (select parent.conceptualDomain.id from gov.nih.nci.cadsr.domain.DataElementConcept as parent where parent.id="+idString+")"; HQLCriteria hqlCriteria = new HQLCriteria(hql); ApplicationService applicationService = ApplicationServiceProvider.getApplicationService(); java.util.List resultList = applicationService.query(hqlCriteria,"gov.nih.nci.cadsr.domain.ConceptualDomain"); if (resultList!=null && resultList.size()>0) conceptualDomain = (gov.nih.nci.cadsr.domain.ConceptualDomain)resultList.get(0); else conceptualDomain = null; } catch(Exception ex) { Logger log = Logger.getLogger(DataElementConcept.class.getName()); log.error("DataElementConcept:getConceptualDomain throws exception ... ...",ex); } } return conceptualDomain; } public void setConceptualDomain(gov.nih.nci.cadsr.domain.ConceptualDomain conceptualDomain) { this.conceptualDomain = conceptualDomain; } private java.util.Collection dataElementCollection = new java.util.HashSet(); public java.util.Collection getDataElementCollection() { if (dataElementCollection==null || dataElementCollection.getClass().getName().indexOf("PersistentSet")>0) { try { String idString = (Class.forName("java.lang.String").isInstance(getId()))? "'"+ getId() + "'" : ""+getId(); String hql = "select child from gov.nih.nci.cadsr.domain.DataElement as child, gov.nih.nci.cadsr.domain.DataElementConcept as parent where child in elements(parent.dataElementCollection) and parent.id="+idString; HQLCriteria hqlCriteria = new HQLCriteria(hql); ApplicationService applicationService = ApplicationServiceProvider.getApplicationService(); java.util.List resultList = applicationService.query(hqlCriteria,"gov.nih.nci.cadsr.domain.DataElement"); dataElementCollection = resultList; } catch(Exception ex) { Logger log = Logger.getLogger(DataElementConcept.class.getName()); log.error("DataElementConcept:getDataElementCollection throws exception ... ...",ex); } } return dataElementCollection; } public void setDataElementCollection(java.util.Collection dataElementCollection) { this.dataElementCollection = dataElementCollection; } private java.util.Collection childDataElementConceptRelationshipCollection = new java.util.HashSet(); public java.util.Collection getChildDataElementConceptRelationshipCollection() { if (childDataElementConceptRelationshipCollection==null || childDataElementConceptRelationshipCollection.getClass().getName().indexOf("PersistentSet")>0) { try { String idString = (Class.forName("java.lang.String").isInstance(getId()))? "'"+ getId() + "'" : ""+getId(); String hql = "select child from gov.nih.nci.cadsr.domain.DataElementConceptRelationship as child, gov.nih.nci.cadsr.domain.DataElementConcept as parent where child in elements(parent.childDataElementConceptRelationshipCollection) and parent.id="+idString; HQLCriteria hqlCriteria = new HQLCriteria(hql); ApplicationService applicationService = ApplicationServiceProvider.getApplicationService(); java.util.List resultList = applicationService.query(hqlCriteria,"gov.nih.nci.cadsr.domain.DataElementConceptRelationship"); childDataElementConceptRelationshipCollection = resultList; } catch(Exception ex) { Logger log = Logger.getLogger(DataElementConcept.class.getName()); log.error("DataElementConcept:getChildDataElementConceptRelationshipCollection throws exception ... ...",ex); } } return childDataElementConceptRelationshipCollection; } public void setChildDataElementConceptRelationshipCollection(java.util.Collection childDataElementConceptRelationshipCollection) { this.childDataElementConceptRelationshipCollection = childDataElementConceptRelationshipCollection; } private gov.nih.nci.cadsr.domain.ObjectClass objectClass; public gov.nih.nci.cadsr.domain.ObjectClass getObjectClass() { if(objectClass==null || objectClass.getClass().getName().indexOf('$')>0) { try { String idString = (Class.forName("java.lang.String").isInstance(getId()))? "'"+ getId() + "'" : ""+getId(); String hql = "select child from gov.nih.nci.cadsr.domain.ObjectClass as child where child.id in (select parent.objectClass.id from gov.nih.nci.cadsr.domain.DataElementConcept as parent where parent.id="+idString+")"; HQLCriteria hqlCriteria = new HQLCriteria(hql); ApplicationService applicationService = ApplicationServiceProvider.getApplicationService(); java.util.List resultList = applicationService.query(hqlCriteria,"gov.nih.nci.cadsr.domain.ObjectClass"); if (resultList!=null && resultList.size()>0) objectClass = (gov.nih.nci.cadsr.domain.ObjectClass)resultList.get(0); else objectClass = null; } catch(Exception ex) { Logger log = Logger.getLogger(DataElementConcept.class.getName()); log.error("DataElementConcept:getObjectClass throws exception ... ...",ex); } } return objectClass; } public void setObjectClass(gov.nih.nci.cadsr.domain.ObjectClass objectClass) { this.objectClass = objectClass; } private java.util.Collection parentDataElementConceptRelationshipCollection = new java.util.HashSet(); public java.util.Collection getParentDataElementConceptRelationshipCollection() { if (parentDataElementConceptRelationshipCollection==null || parentDataElementConceptRelationshipCollection.getClass().getName().indexOf("PersistentSet")>0) { try { String idString = (Class.forName("java.lang.String").isInstance(getId()))? "'"+ getId() + "'" : ""+getId(); String hql = "select child from gov.nih.nci.cadsr.domain.DataElementConceptRelationship as child, gov.nih.nci.cadsr.domain.DataElementConcept as parent where child in elements(parent.parentDataElementConceptRelationshipCollection) and parent.id="+idString; HQLCriteria hqlCriteria = new HQLCriteria(hql); ApplicationService applicationService = ApplicationServiceProvider.getApplicationService(); java.util.List resultList = applicationService.query(hqlCriteria,"gov.nih.nci.cadsr.domain.DataElementConceptRelationship"); parentDataElementConceptRelationshipCollection = resultList; } catch(Exception ex) { Logger log = Logger.getLogger(DataElementConcept.class.getName()); log.error("DataElementConcept:getParentDataElementConceptRelationshipCollection throws exception ... ...",ex); } } return parentDataElementConceptRelationshipCollection; } public void setParentDataElementConceptRelationshipCollection(java.util.Collection parentDataElementConceptRelationshipCollection) { this.parentDataElementConceptRelationshipCollection = parentDataElementConceptRelationshipCollection; } public boolean equals(Object obj) { boolean eq = false; if(obj instanceof DataElementConcept) { DataElementConcept c =(DataElementConcept)obj; String thisId = getId(); if(thisId != null && thisId.equals(c.getId())) eq = true; } return eq; } public int hashCode() { int h = 0; if(getId() != null) h += getId().hashCode(); return h; } }
5f6cfc5f45c33c1494e774986cdcd6b1fc6411ea
114df2f81d1eea7686b62db2211d9e076b276534
/src/com/design/dao/impl/CouponsDAOImpl.java
2ec89f6c3242d9e428f3c00b80c75ca4ae302c76
[]
no_license
Jayce2018/design
fab4955ee3b7d817a1d010590788ae2df61c4b06
f1efb914d9af045d9cb22f5df6c77664cc7c6bce
refs/heads/master
2020-03-15T15:39:55.215194
2018-05-05T05:02:53
2018-05-05T05:02:53
132,217,257
0
0
null
null
null
null
GB18030
Java
false
false
1,178
java
package com.design.dao.impl; import java.util.List; import org.hibernate.Query; import org.hibernate.Session; import org.hibernate.SessionFactory; import com.design.dao.CouponsDAO; import com.design.entity.Coupons; public class CouponsDAOImpl implements CouponsDAO{ SessionFactory sessionFactory; public void setSessionFactory(SessionFactory sessionFactory){ this.sessionFactory=sessionFactory; } @Override public void addCoupons(Coupons condition) { // 增加奖券 System.out.println("CouponsDAOImpl_addCoupons:"+condition.getType()+' '+condition.getAmount()+' '+condition.getCustomerid()); Session session = sessionFactory.getCurrentSession(); session.save(condition); } @Override public List<Coupons> findCouponsByCustomerid(Coupons condition) { //查询某id的商家全部奖券 Session session = sessionFactory.getCurrentSession(); String hql=null; hql="from Coupons where customerid='"+condition.getCustomerid()+"'"; System.out.println("CouponsDAOIpml:"+hql); Query query = session.createQuery(hql); //System.out.println("LoginDAOIpml:"+3); List<Coupons> list = query.list(); return list; } }
2456967d204064dc57eeef06424fdaedc21ab49b
ac0f6e99379bcc48301beb18374bac14b568d73c
/Software2G/src/com/software2g/pruebaJSF/EjemploJSFController.java
5ea71ef5f129473bd9da18b4448e939d871b7a0f
[]
no_license
torvicgomez/software2g
8ce0e7ee49b786a65ad1c3284f4a28c43abf0200
f5325c3a9e3fb17c753dc3d6fdd5d0d422c9f757
refs/heads/master
2020-12-24T14:46:10.924430
2015-08-23T19:16:14
2015-08-23T19:16:14
41,489,960
0
0
null
null
null
null
UTF-8
Java
false
false
2,408
java
package com.software2g.pruebaJSF; import java.util.List; import javax.annotation.PostConstruct; import javax.ejb.EJB; import javax.faces.bean.ManagedBean; import javax.faces.bean.SessionScoped; import com.software2g.vo.Procedimiento; import com.software2g.vo.Tipoespecialidad; @ManagedBean @SessionScoped public class EjemploJSFController { @EJB CustomerDAO customerDAO; @EJB PurchaseOrderDAO purchaseOrderDAO; String cadenaBusqueda; List<Procedimiento> listaClientes; Procedimiento clienteActual; List<Tipoespecialidad> listaPedidosClienteActual; Tipoespecialidad pedidoActual; public String getCadenaBusqueda() {return cadenaBusqueda;} public void setCadenaBusqueda(String cadenaBusqueda) {this.cadenaBusqueda = cadenaBusqueda;} public List<Procedimiento> getListaClientes() {return listaClientes;} public void setListaClientes(List<Procedimiento> listaClientes) {this.listaClientes = listaClientes;} public Procedimiento getClienteActual() {return clienteActual;} public void setClienteActual(Procedimiento clienteActual) {this.clienteActual = clienteActual;} public List<Tipoespecialidad> getListaPedidosClienteActual() {return listaPedidosClienteActual;} public void setListaPedidosClienteActual(List<Tipoespecialidad> listaPedidosClienteActual) {this.listaPedidosClienteActual = listaPedidosClienteActual;} public Tipoespecialidad getPedidoActual() {return pedidoActual;} public void setPedidoActual(Tipoespecialidad pedidoActual) {this.pedidoActual = pedidoActual;} @PostConstruct public void inicializar(){ listaClientes = customerDAO.buscarTodos(); clienteActual = listaClientes.get(0); listaPedidosClienteActual = purchaseOrderDAO.buscarPorCliente(clienteActual.getPrtoId()); pedidoActual = null; } public String doVerPedidos(Procedimiento cliente) { clienteActual = cliente; listaPedidosClienteActual = purchaseOrderDAO.buscarPorCliente(cliente.getPrtoId()); return "detalleCliente"; } public String doBuscarCliente(){ listaClientes = customerDAO.buscarPorNombre(cadenaBusqueda); clienteActual = listaClientes.get(0); return "index"; } public String doNuevoCliente(){ clienteActual = new Procedimiento(); listaPedidosClienteActual = null; return "nuevoCliente"; } public String doGuardarCliente(){ customerDAO.crear(clienteActual); return "index"; } }
65725fc5ec83601e2784e8e41473b37320434250
3006e24733791782163321fcebe12dcba12a2545
/ITTALENTS/Lesson_22_Threads_Collection/src/store/DemoMS.java
f302ac47e604f8d7115d6c7677402aff56f54510
[]
no_license
BorisTodorovGichev/ITTHomework
d2f80e877fe4655a321f81dc1d56d5794b389047
fdb895c2e874d15d748f24309250bfa5821989eb
refs/heads/master
2021-05-30T19:16:10.221276
2016-03-18T16:12:32
2016-03-18T16:12:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,181
java
package store; public class DemoMS { public static void main(String[] args) { MusicStore temp=new MusicStore("Rock", 5000); IMusicStore rock = temp; Thread rockT=new Thread(temp); Sup sup = new Sup(); Thread supT=new Thread(sup); rock.setSup(sup); sup.SetMusicStore(temp); supT.start(); rockT.start(); // rock.printAllByType(); // System.out.println(rock.getMoney()); // rock.printAllByName(); // rock.printAllByPriceAsc(); // rock.printAllByPriceDesc(); // rock.printInventory(); // System.out.println(rock.getMoney()); // rock.sellInstrument("guitar", 7); // rock.sellInstrument("arpha", 5); // rock.sellInstrument("drum", 1); // rock.sellInstrument("guitar", 5); // rock.sellInstrument("electrik violin", 1); // rock.sellInstrument("sintezator", 1); // rock.sellInstrument("bass guitar",4); // rock.sellInstrument("akordeon", 1); // rock.printInventory(); // rock.prinatAllSales(); // rock.printGeneratedIncome(); // rock.showMostSoldInstrument(); // rock.showLeastSoldInstrument(); // rock.mostWantedType(); // rock.mostLucrativeType(); // supplierThread.start(); // rockThread.start(); } }
68099020afc0dde092b44b01e4681ee10aab047c
e71d310ef438fc25956955e05257711a0347e6f6
/XYZReader/src/main/java/com/example/xyzreader/ui/ArticleDetailActivity.java
5410140d1de2bf214fa15c08a039905a3c3b20f8
[]
no_license
dicarobinho/XYZ-Reader
e54ffe8a5798e1a1bd174cf49a0e9ba76a6b4785
2417c1428fb3499925a0dc292e47d76b102f5aec
refs/heads/master
2022-06-08T12:11:03.580479
2020-04-29T12:52:04
2020-04-29T12:52:04
259,922,214
0
0
null
null
null
null
UTF-8
Java
false
false
3,351
java
package com.example.xyzreader.ui; import android.os.Bundle; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentActivity; import androidx.lifecycle.ViewModelProvider; import androidx.viewpager.widget.ViewPager; import androidx.viewpager2.adapter.FragmentStateAdapter; import androidx.viewpager2.widget.ViewPager2; import com.example.xyzreader.ArticleDetailActivityViewModel; import com.example.xyzreader.databinding.ActivityArticleDetailBinding; import com.example.xyzreader.utils.Constants; /** * An activity representing a single Article detail screen, letting you swipe between articles. */ public class ArticleDetailActivity extends AppCompatActivity { ActivityArticleDetailBinding binding; ArticleDetailActivityViewModel mViewModel; private static int selectedArticleIndex; private static int adapterItemsNumber; MyPagerAdapter mPagerAdapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); binding = ActivityArticleDetailBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); mViewModel = new ViewModelProvider(this).get(ArticleDetailActivityViewModel.class); if (getIntent() != null && getIntent().hasExtra(Constants.ITEMS_LIST_KEY) && getIntent().hasExtra(Constants.ADAPTER_ITEM_COUNT_KEY)) { selectedArticleIndex = getIntent().getIntExtra(Constants.ITEMS_LIST_KEY, -1); adapterItemsNumber = getIntent().getIntExtra(Constants.ADAPTER_ITEM_COUNT_KEY, -1); setupMyPagerAdapter(); } binding.viewPager.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() { public void onPageScrollStateChanged(int state) { super.onPageScrollStateChanged(state); binding.actionUp.animate() .alpha((state == ViewPager.SCROLL_STATE_IDLE) ? 1f : 0f) .setDuration(300); } public void onPageSelected(int position) { updateUpButtonPosition(); } }); binding.actionUp.setOnClickListener(view -> onBackPressed()); } private void updateUpButtonPosition() { int upButtonNormalBottom = binding.actionUp.getHeight(); int mSelectedItemUpButtonFloor = Integer.MAX_VALUE; binding.actionUp.setTranslationY(Math.min(mSelectedItemUpButtonFloor - upButtonNormalBottom, 0)); } private void setupMyPagerAdapter() { mPagerAdapter = new MyPagerAdapter(ArticleDetailActivity.this); binding.viewPager.setAdapter(mPagerAdapter); binding.viewPager.setCurrentItem(selectedArticleIndex - 1, false); binding.viewPager.setOffscreenPageLimit(adapterItemsNumber); } private static class MyPagerAdapter extends FragmentStateAdapter { MyPagerAdapter(@NonNull FragmentActivity fragmentActivity) { super(fragmentActivity); } @NonNull @Override public Fragment createFragment(int position) { return ArticleDetailFragment.newInstance(position); } @Override public int getItemCount() { return adapterItemsNumber; } } }
7bf3addc054b50ec93a466ed66436c4b66e88ae8
7033d33d0ce820499b58da1d1f86f47e311fd0e1
/org/lwjgl/opengl/ARBMultiDrawIndirect.java
9bfe2aeb2667124aac6731ad69c3b0ad2caa2050
[ "MIT" ]
permissive
gabrielvicenteYT/melon-client-src
1d3f1f65c5a3bf1b6bc3e1cb32a05bf1dd56ee62
e0bf34546ada3afa32443dab838b8ce12ce6aaf8
refs/heads/master
2023-04-04T05:47:35.053136
2021-04-19T18:34:36
2021-04-19T18:34:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,568
java
package org.lwjgl.opengl; import java.nio.*; public final class ARBMultiDrawIndirect { private ARBMultiDrawIndirect() { } public static void glMultiDrawArraysIndirect(final int mode, final ByteBuffer indirect, final int primcount, final int stride) { GL43.glMultiDrawArraysIndirect(mode, indirect, primcount, stride); } public static void glMultiDrawArraysIndirect(final int mode, final long indirect_buffer_offset, final int primcount, final int stride) { GL43.glMultiDrawArraysIndirect(mode, indirect_buffer_offset, primcount, stride); } public static void glMultiDrawArraysIndirect(final int mode, final IntBuffer indirect, final int primcount, final int stride) { GL43.glMultiDrawArraysIndirect(mode, indirect, primcount, stride); } public static void glMultiDrawElementsIndirect(final int mode, final int type, final ByteBuffer indirect, final int primcount, final int stride) { GL43.glMultiDrawElementsIndirect(mode, type, indirect, primcount, stride); } public static void glMultiDrawElementsIndirect(final int mode, final int type, final long indirect_buffer_offset, final int primcount, final int stride) { GL43.glMultiDrawElementsIndirect(mode, type, indirect_buffer_offset, primcount, stride); } public static void glMultiDrawElementsIndirect(final int mode, final int type, final IntBuffer indirect, final int primcount, final int stride) { GL43.glMultiDrawElementsIndirect(mode, type, indirect, primcount, stride); } }
4f726e694e00d6741f4ce894cb226019ce902a4f
554f7be76549038e9711c5fdb0d424cf56c4995b
/src/main/com/vasty/greatstudy/designpattern/command/headfirst/lightdemo/LightOnCommand.java
dc020b01a7bf03a44650084d8bfbd5e33a7d7ad8
[]
no_license
PlumpMath/designpattern-136
0ec53f2533c0def686ea28cd5f71ad7820ff94b6
c8527cde416c227cb46368bb68fb98becfa49e3a
refs/heads/master
2021-01-20T09:36:37.611363
2016-03-03T11:28:17
2016-03-03T11:28:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
370
java
package com.vasty.greatstudy.designpattern.command.headfirst.lightdemo; /** * 具体的命令: 电亮点灯 * Created by ZhuangYanHao on 2016/1/15. */ public class LightOnCommand implements ICommand { Light light; public LightOnCommand(Light light) { this.light = light; } @Override public void execute() { light.on(); } }
a91cd2c5e7039c0108a2b0a7f6f23314d81f250c
5c4f4b6dcbbdc97d71c1853989bf6bf07be21674
/app/src/main/java/com/thomas/video/widget/SuperVideo.java
e5244ece038741b66928c0be958552b59b183ada
[]
no_license
Jvr0771/SuperVideo
31a3a2cf6b6e63d55a19d97a592db5cbb6e79273
28b1339a8993a5df49632e53b2828910962200f5
refs/heads/master
2022-06-17T21:22:34.874599
2020-05-18T06:05:22
2020-05-18T06:05:22
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,549
java
package com.thomas.video.widget; import android.content.Context; import android.media.AudioManager; import android.util.AttributeSet; import android.view.View; import android.view.WindowManager; import com.thomas.video.R; import com.thomas.video.helper.DialogHelper; import cn.jzvd.JZDataSource; import cn.jzvd.JZMediaInterface; import cn.jzvd.JZUtils; import cn.jzvd.JzvdStd; /** * @author Thomas * @describe 功能超全的播放器 * @date 2019/8/16 * @updatelog * @since */ public class SuperVideo extends JzvdStd { public interface onStartListener { void onStart(); } private onStartListener onStartListener; public void setOnStartListener(SuperVideo.onStartListener onStartListener) { this.onStartListener = onStartListener; } public SuperVideo(Context context) { super(context); } public SuperVideo(Context context, AttributeSet attrs) { super(context, attrs); } @Override public void init(Context context) { super.init(context); SAVE_PROGRESS = true; bottomProgressBar.setVisibility(GONE); } @Override public void startVideo() { if (screen == SCREEN_FULLSCREEN) { JZMediaInterface.SAVED_SURFACE = null; addTextureView(); AudioManager mAudioManager = (AudioManager) getContext().getSystemService(Context.AUDIO_SERVICE); mAudioManager.requestAudioFocus(onAudioFocusChangeListener, AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN_TRANSIENT); JZUtils.scanForActivity(getContext()).getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); onStatePreparing(); } else { super.startVideo(); } if (onStartListener != null) { onStartListener.onStart(); } } @Override public void setUp(JZDataSource jzDataSource, int screen, Class mediaInterfaceClass) { super.setUp(jzDataSource, screen, mediaInterfaceClass); //设置全屏状态下才显示标题 if (this.screen == SCREEN_FULLSCREEN) { titleTextView.setVisibility(View.VISIBLE); } else { titleTextView.setVisibility(View.INVISIBLE); } } @Override public void gotoScreenFullscreen() { super.gotoScreenFullscreen(); titleTextView.setVisibility(View.VISIBLE); } @Override public void gotoScreenNormal() { super.gotoScreenNormal(); titleTextView.setVisibility(View.INVISIBLE); } @Override public void onStateAutoComplete() { super.onStateAutoComplete(); gotoScreenNormal(); } @Override public void setAllControlsVisiblity(int topCon, int bottomCon, int startBtn, int loadingPro, int thumbImg, int bottomPro, int retryLayout) { topContainer.setVisibility(topCon); bottomContainer.setVisibility(bottomCon); startButton.setVisibility(startBtn); loadingProgressBar.setVisibility(loadingPro); posterImageView.setVisibility(thumbImg); bottomProgressBar.setVisibility(GONE); mRetryLayout.setVisibility(retryLayout); } @Override public void dissmissControlView() { if (state != STATE_NORMAL && state != STATE_ERROR && state != STATE_AUTO_COMPLETE) { post(() -> { bottomContainer.setVisibility(View.INVISIBLE); topContainer.setVisibility(View.INVISIBLE); startButton.setVisibility(View.INVISIBLE); if (clarityPopWindow != null) { clarityPopWindow.dismiss(); } if (screen != SCREEN_TINY) { bottomProgressBar.setVisibility(View.GONE); } }); } } @Override public void showWifiDialog() { DialogHelper.showDialogCenter("提示", getResources().getString(R.string.tips_not_wifi), getResources().getString(R.string.tips_not_wifi_cancel), getResources().getString(R.string.tips_not_wifi_confirm), new NormalDialog.OnDialogListener() { @Override public void onCancel() { clearFloatScreen(); } @Override public void onSure() { startVideo(); WIFI_TIP_DIALOG_SHOWED = true; } }); } }
[ "tff123" ]
tff123
7d2bc702fc4c0978c4b588a4d197f37b098e1b1e
ef0c1514e9af6de3ba4a20e0d01de7cc3a915188
/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/ContainerRegistryManager.java
3f6c4d748d6e5f7c9c3ef91884c53caa210efd33
[ "MIT", "LicenseRef-scancode-warranty-disclaimer", "LicenseRef-scancode-unknown-license-reference", "LGPL-2.1-or-later", "CC0-1.0", "BSD-3-Clause", "UPL-1.0", "Apache-2.0", "LicenseRef-scancode-public-domain", "BSD-2-Clause", "LicenseRef-scancode-generic-cla" ]
permissive
Azure/azure-sdk-for-java
0902d584b42d3654b4ce65b1dad8409f18ddf4bc
789bdc6c065dc44ce9b8b630e2f2e5896b2a7616
refs/heads/main
2023-09-04T09:36:35.821969
2023-09-02T01:53:56
2023-09-02T01:53:56
2,928,948
2,027
2,084
MIT
2023-09-14T21:37:15
2011-12-06T23:33:56
Java
UTF-8
Java
false
false
6,014
java
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. package com.azure.resourcemanager.containerregistry; import com.azure.core.credential.TokenCredential; import com.azure.core.http.HttpPipeline; import com.azure.resourcemanager.containerregistry.fluent.ContainerRegistryManagementClient; import com.azure.resourcemanager.containerregistry.implementation.ContainerRegistryManagementClientBuilder; import com.azure.resourcemanager.containerregistry.implementation.RegistriesImpl; import com.azure.resourcemanager.containerregistry.implementation.RegistryTaskRunsImpl; import com.azure.resourcemanager.containerregistry.implementation.RegistryTasksImpl; import com.azure.resourcemanager.containerregistry.models.Registries; import com.azure.resourcemanager.containerregistry.models.RegistryTaskRuns; import com.azure.resourcemanager.containerregistry.models.RegistryTasks; import com.azure.resourcemanager.resources.fluentcore.arm.AzureConfigurable; import com.azure.resourcemanager.resources.fluentcore.arm.implementation.AzureConfigurableImpl; import com.azure.resourcemanager.resources.fluentcore.arm.Manager; import com.azure.core.management.profile.AzureProfile; import com.azure.resourcemanager.resources.fluentcore.utils.HttpPipelineProvider; import com.azure.resourcemanager.storage.StorageManager; import java.util.Objects; /** Entry point to Azure container registry management. */ public final class ContainerRegistryManager extends Manager<ContainerRegistryManagementClient> { // The service managers private RegistriesImpl registries; private final StorageManager storageManager; private RegistryTasksImpl tasks; private RegistryTaskRunsImpl registryTaskRuns; /** * Get a Configurable instance that can be used to create ContainerRegistryManager with optional configuration. * * @return Configurable */ public static Configurable configure() { return new ContainerRegistryManager.ConfigurableImpl(); } /** * Creates an instance of ContainerRegistryManager that exposes Registry resource management API entry points. * * @param credential the credential to use * @param profile the profile to use * @return the ContainerRegistryManager */ public static ContainerRegistryManager authenticate(TokenCredential credential, AzureProfile profile) { Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); return authenticate(HttpPipelineProvider.buildHttpPipeline(credential, profile), profile); } /** * Creates an instance of ContainerRegistryManager that exposes Registry resource management API entry points. * * @param httpPipeline the HttpPipeline to be used for API calls. * @param profile the profile to use * @return the ContainerRegistryManager */ public static ContainerRegistryManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); return new ContainerRegistryManager(httpPipeline, profile); } /** The interface allowing configurations to be set. */ public interface Configurable extends AzureConfigurable<Configurable> { /** * Creates an instance of ContainerRegistryManager that exposes Registry resource management API entry points. * * @param credential the credential to use * @param profile the profile to use * @return the ContainerRegistryManager */ ContainerRegistryManager authenticate(TokenCredential credential, AzureProfile profile); } /** The implementation for Configurable interface. */ private static final class ConfigurableImpl extends AzureConfigurableImpl<Configurable> implements Configurable { @Override public ContainerRegistryManager authenticate(TokenCredential credential, AzureProfile profile) { return ContainerRegistryManager.authenticate(buildHttpPipeline(credential, profile), profile); } } /** * Creates a ContainerRegistryManager. * * @param httpPipeline the HttpPipeline used to authenticate through ContainerRegistryManager. * @param profile the profile to use */ private ContainerRegistryManager(HttpPipeline httpPipeline, AzureProfile profile) { super( httpPipeline, profile, new ContainerRegistryManagementClientBuilder() .pipeline(httpPipeline) .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) .subscriptionId(profile.getSubscriptionId()) .buildClient()); storageManager = StorageManager.authenticate(httpPipeline, profile); } /** @return the availability set resource management API entry point */ public Registries containerRegistries() { if (this.registries == null) { this.registries = new RegistriesImpl(this, this.storageManager); } return this.registries; } /** * Gets the current instance of ContainerRegistryManager's tasks. * * @return the tasks of the current instance of ContainerRegistryManager. */ public RegistryTasks containerRegistryTasks() { if (this.tasks == null) { this.tasks = new RegistryTasksImpl(this); } return this.tasks; } /** * Gets the current instance of ContainerRegistryManager's registry task runs. * * @return the registry task runs of the current instance of ContainerRegistryManager. */ public RegistryTaskRuns registryTaskRuns() { if (this.registryTaskRuns == null) { this.registryTaskRuns = new RegistryTaskRunsImpl(this); } return this.registryTaskRuns; } }
917d554c35ff9f4c2beb4e1768b5a50767fabd24
a03b08fee1079a171063da05e5600e8f7c210c4b
/red5/src/org/red5/server/messaging/IPipe.java
3cc5efcd6ac17b404bd2cf53063d154a5b0ff348
[ "Apache-2.0" ]
permissive
kaltura/server-bin-linux-64bit
ae35434fba4f754185b22ba79c3e56de35d7c0b1
51dd2d7b768b0064c9e53e0d8cfd8d81b26c8884
refs/heads/master
2021-01-01T18:43:20.488250
2019-07-24T07:51:54
2019-07-24T07:51:54
10,905,968
2
2
null
2020-11-16T18:11:05
2013-06-24T11:10:25
HTML
UTF-8
Java
false
false
1,576
java
/* * RED5 Open Source Flash Server - http://code.google.com/p/red5/ * * Copyright 2006-2012 by respective authors (see below). 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. */ package org.red5.server.messaging; /** * A pipe is an object that connects message providers and * message consumers. Its main function is to transport messages * in kind of ways it provides. * * Pipes fire events as they go, these events are common way to work with pipes for * higher level parts of server. * * @author The Red5 Project ([email protected]) * @author Steven Gong ([email protected]) */ public interface IPipe extends IMessageInput, IMessageOutput { /** * Add connection event listener to pipe * @param listener Connection event listener */ void addPipeConnectionListener(IPipeConnectionListener listener); /** * Add connection event listener to pipe * @param listener Connection event listener */ void removePipeConnectionListener(IPipeConnectionListener listener); }
[ "tantan@6b8eccd3-e8c5-4e7d-8186-e12b5326b719" ]
tantan@6b8eccd3-e8c5-4e7d-8186-e12b5326b719
b97fa7b1519bca18d42c4284a9de4de8c76c6b97
4f249503d67d79eb613cbe85be501d4f2f024abe
/app/src/main/java/extra4it/fahmy/com/rentei/RegistrationServices.java
f4f6ba8824fc70b107aba0236b9b95c2f5400596
[]
no_license
AhmedFehmee/Renti
7dee6e9299b5d1c4cbd68808a798dea8d6a8dba9
d1db81f464192761767421c1db8c2ac4948e51c6
refs/heads/master
2020-03-19T18:13:51.365749
2018-06-10T10:45:00
2018-06-10T10:45:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,537
java
package extra4it.fahmy.com.rentei; import android.app.IntentService; import android.content.Intent; import android.content.SharedPreferences; import android.support.design.widget.Snackbar; import android.support.v4.content.LocalBroadcastManager; import android.util.Log; import com.google.firebase.iid.FirebaseInstanceId; import extra4it.fahmy.com.rentei.Model.TokenModel; import extra4it.fahmy.com.rentei.R; import extra4it.fahmy.com.rentei.Rest.ApiClient; import extra4it.fahmy.com.rentei.Rest.ApiInterface; import retrofit2.Call; import retrofit2.Callback; import static android.content.ContentValues.TAG; /** * Created by abdelmageed on 18/06/16. */ public class RegistrationServices extends IntentService { SharedPreferences.Editor prefEditor; public static final String mypreference = "mypref"; public static final String REGISTRATION_COMPLETE = "RegistrationComplete"; public static final String REGISTRATION_ERROR = "RegistrationError"; SharedPreferences preferences; private String token; private String refreshed; String userId; String MY_PREFS_NAME = "UserFile"; SharedPreferences.Editor editor; SharedPreferences prefs; ApiInterface apiService; public RegistrationServices() { super("RegistrationService"); } @Override protected void onHandleIntent(Intent intent) { // get Default Shard Preferences // get token from Firebase token = FirebaseInstanceId.getInstance().getToken(); // check if intent is null or not if it isn't null we will ger refreshed value and // if its true we will override token_sent value to false and apply if (intent.getExtras() != null) { refreshed = intent.getExtras().getString("Token_Shared"); //MainApp.mSharedPreferences.edit().putString(Constants.Device_Token_Shared,refreshed).commit(); } else { //MainApp.mSharedPreferences.edit().putString(Constants.Device_Token_Shared,token).commit(); } registerGCM(); } public void registerGCM() { Intent registrationComplete = null; //InstanceID instanceID = InstanceID.getInstance(this); Log.d("DAMN", token + " "); registrationComplete = new Intent(REGISTRATION_COMPLETE); registrationComplete.putExtra("token", token); sendTokenToServer(token); registrationComplete = new Intent(REGISTRATION_ERROR); LocalBroadcastManager.getInstance(this).sendBroadcast(registrationComplete); } public void sendTokenToServer(final String token) { // userId = cn.getId(); sendTokenService(); } private void sendTokenService() { prefs = getSharedPreferences("UserFile", MODE_PRIVATE); final String userId = prefs.getString("id", null); apiService = ApiClient.getClient(ApiInterface.class); Call<TokenModel> call = apiService.refreshToken(userId,"android",token); call.enqueue(new Callback<TokenModel>() { @Override public void onResponse(Call<TokenModel> call, retrofit2.Response<TokenModel> response) { if (response.body() != null) { Log.i("tokennnn" , " " + response.body().getStatus() + "//"+userId); } } @Override public void onFailure(Call<TokenModel> call, Throwable t) { // Log error here since request failed Log.e(TAG, t.toString()); } }); } }
fce0a800c3446f10d58348c2db4ff6f74c8a8490
4f78466511a44d3742169e8ecdc312a6e7a0a126
/sechub-shared-kernel/src/main/java/com/daimler/sechub/sharedkernel/validation/EmailValidation.java
c79d933d1057f4f2e04dabf7c28bc915ec437045
[ "MIT" ]
permissive
jonico/sechub
670999fb2cc035f26e1611f180a8abdeea33f255
f74f6a7e64f9ef011592733d034845ef7fe7f369
refs/heads/develop
2020-09-18T18:23:45.711783
2019-11-22T08:32:03
2019-11-22T08:57:08
224,164,065
0
0
MIT
2019-11-26T10:26:47
2019-11-26T10:26:46
null
UTF-8
Java
false
false
117
java
package com.daimler.sechub.sharedkernel.validation; public interface EmailValidation extends Validation<String>{ }
44d5b25cd55de9efbe9f73a398def25fea1973e8
d1a41e539c7525206048cc2acfcd8b14576909e8
/app/src/main/java/com/app/incidentreporter/utils/AppUtility.java
5badf7aa3dd4c7144e7cf89f8c199d240d861038
[]
no_license
mishaelharry/IncidentReporter
909d1a74a8a97d0e7f80a3ad08cadcff939ddfd0
031d63631825b459739222e1ba74c7aafbc3a771
refs/heads/master
2021-04-28T20:30:49.736307
2018-02-20T06:17:26
2018-02-20T06:19:18
121,927,365
0
0
null
null
null
null
UTF-8
Java
false
false
637
java
package com.app.incidentreporter.utils; import android.content.Context; import android.content.DialogInterface; import android.net.ConnectivityManager; import android.net.NetworkInfo; import com.app.incidentreporter.R; /** * Created by Mishael on 1/31/2018. */ public class AppUtility { public static boolean isNetworkAvailable(Context context) { ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo(); return activeNetworkInfo != null; } }
964cab252e5e70b13fc03a9762b9be1059dfd434
409db806d744af6cd1cb762918304a237de64957
/workspace/Harjutused/src/ptk2/TimedComputation.java
9689022a18c0c512c700315ffef8b85b0fdb514f
[]
no_license
karinagu/ItkJava
91390abd865c46ceb89d87bb0c51ec5af59764a5
338efdd29f84820e917733a18b08620cf558f3ea
refs/heads/master
2021-01-10T08:46:26.528831
2016-02-04T19:11:39
2016-02-04T19:11:39
45,061,037
0
0
null
null
null
null
UTF-8
Java
false
false
1,545
java
package ptk2; public class TimedComputation {public static void main(String[] args) { long startTime; // Starting time of program, in milliseconds. long endTime; // Time when computations are done, in milliseconds. double time; // Time difference, in seconds. startTime = System.currentTimeMillis(); double width, height, hypotenuse; // sides of a triangle width = 42.0; height = 17.0; hypotenuse = Math.sqrt( width*width + height*height ); System.out.print("A triangle with sides 42 and 17 has hypotenuse "); System.out.println(hypotenuse); System.out.println("\nMathematically, sin(x)*sin(x) + " + "cos(x)*cos(x) - 1 should be 0."); System.out.println("Let's check this for x = 1:"); System.out.print(" sin(1)*sin(1) + cos(1)*cos(1) - 1 is "); System.out.println( Math.sin(1)*Math.sin(1) + Math.cos(1)*Math.cos(1) - 1 ); System.out.println("(There can be round-off errors when" + " computing with real numbers!)"); System.out.print("\nHere is a random number: "); System.out.println( Math.random() ); System.out.print("The value of Math.PI is "); System.out.println( Math.PI ); endTime = System.currentTimeMillis(); time = (endTime - startTime) / 1000.0; System.out.print("\nRun time in seconds was: "); System.out.println(time); } // end main() } // end class TimedComputation
af3882a528f5f50f0b78d384bacac0b5f5d10ffa
d9c333a436fc8d24a791ac9beb3363dffaed3871
/src/Generics/TestGeneric.java
5e42b41353e71dda28044a0431cf64f686ab630e
[]
no_license
aisenkim15/java2_2ndClass
d2c37cdc58072c0f910e3072f3caca031b5966f1
4b6f6ee9fbb0aa60f0e3c53423c854f2997f578e
refs/heads/master
2020-06-18T16:37:43.017516
2019-07-30T10:35:56
2019-07-30T10:35:56
196,367,124
0
0
null
null
null
null
UTF-8
Java
false
false
603
java
package Generics; public class TestGeneric { public static void main(String[] args) { Box<Integer> intBox = new Box<>(); Box<String> stringBox = new Box<>(); stringBox.set("What ever"); Box rawBox = stringBox; System.out.println(rawBox.get()); Box newBox = new Box(); newBox.set(123); Box<Integer> newerBox = newBox; System.out.println(newerBox); } } class Box<T> { private T t; public void set(T t) { this.t = t; } public T get() { return this.t; } }
6117e9685b45c5f678d64e1c0318ea1838f21189
cdb046325b8dfd12a28983f34c9d9d0139bbfb0e
/jpl/test/ch05/ex01/AttrTest.java
7dee0ad20e4316dbae49b605fd2f80465078607f
[]
no_license
kodaisato551/java-learning
7c854c3090091e77e085c67b66613276e7e13f2a
2f0d535504a9093424cce60e6a1e1b22ac90cf8b
refs/heads/master
2021-06-16T18:46:51.516227
2021-05-21T02:38:22
2021-05-21T02:38:22
199,952,190
0
0
null
null
null
null
UTF-8
Java
false
false
797
java
package ch05.ex01; import static org.hamcrest.CoreMatchers.*; import static org.junit.Assert.*; import org.junit.Test; public class AttrTest { @Test public void testAttrString() { Attr target = new Attr("name"); assertThat(target.getName(), is("name")); } @Test public void testAttrStringObject() { Attr target = new Attr("name", "value"); assertThat(target.getName(), is("name")); assertThat(target.getValue(), is((Object) "value")); } @Test public void testSetValue() { Attr target = new Attr(""); Object obj = new Object(); target.setValue(obj); assertThat(target.getValue(), is(obj)); } @Test public void testToString() { Attr target = new Attr("name", "value"); assertThat(target.toString(), is("name='value'")); } }
fae85dc0cef58fa59b7779743d7bb872a41ccc3f
2b76b27c893be5a1cfc5eb1c0f70a101219e3467
/afx6/src/main/java/com/alcatelsbell/nms/db/components/service/ResContext.java
2b4484b912e7db2b0325be79d20b46b6ba544bcf
[]
no_license
puppyriver/message6
8d575d97907c42ecc2c2a397db132a97b36c6c4d
625e6e22b4130cf0036cfe3ad1c5a0ac82c8b762
refs/heads/master
2021-05-03T22:31:18.003057
2017-01-24T13:21:26
2017-01-24T13:21:26
71,609,051
0
0
null
null
null
null
UTF-8
Java
false
false
1,129
java
package com.alcatelsbell.nms.db.components.service; import com.alcatelsbell.nms.common.SpringContext; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; /** * User: Ronnie.Chen * Date: 11-8-26 */ public class ResContext extends JPAContext{ private static EntityManagerFactory resemf; protected static EntityManagerFactory getEntityManagerFactory() { if (resemf == null) { resemf = (EntityManagerFactory)SpringContext.getInstance().getApplicationContext().getBean("resEntityManagerFactory"); } return resemf; } public static void main(String[] args) { String[] locations = {"appserver-spring.xml"}; ApplicationContext ctx = new ClassPathXmlApplicationContext(locations); EntityManagerFactory factory = getEntityManagerFactory(); factory.getMetamodel().getEntities(); EntityManager em = factory.createEntityManager(); JPAContext context = JPAContext.prepareContext(); } }
593d24498ef52a9043ab84e996804a06b1a1c68e
d5a1e7c5a1a3f227b6f629c9d1549a1c869cb75f
/app/src/main/java/com/hhx7/im/sefu/awesomeloginui/model/MyDaysData.java
dcd3409a865dd7f1db5a41d374b3436c75bf6d8d
[]
no_license
hhx7/IM
fb196073696f757b9281372cdf50424786bbb8fc
a95470a89d797211feb1d342697d4bc108d6cd58
refs/heads/master
2020-03-20T19:58:26.048516
2019-02-17T06:46:30
2019-02-17T06:46:30
100,715,757
0
0
null
null
null
null
UTF-8
Java
false
false
618
java
package com.hhx7.im.sefu.awesomeloginui.model; public class MyDaysData { public static String[] dayArray = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"}; public static String[] dateArray = {"7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"}; // public static Integer[] drawableArray = {R.drawable.ic_chat_bubble_black_24dp, R.drawable.ic_map_black_24dp, R.drawable.ic_help_black_24dp, // R.drawable.ic_settings_black_24dp}; public static Integer[] id_ = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}; }
7c5f7a700cfbf2c92f0a1e5a51f9557ea49afb47
d1a6d1e511df6db8d8dd0912526e3875c7e1797d
/genny_JavaWithoutLambdas/applicationModule/src/test/java/applicationModulepackageJava4/Foo773Test.java
d85c6a7ce726ff12f049b027400c30d8c9b9c948
[]
no_license
NikitaKozlov/generated-project-for-desugaring
0bc1443ab3ddc84cd289331c726761585766aea7
81506b3711004185070ca4bb9a93482b70011d36
refs/heads/master
2020-03-20T00:35:06.996525
2018-06-12T09:30:37
2018-06-12T09:30:37
137,049,317
0
0
null
null
null
null
UTF-8
Java
false
false
481
java
package applicationModulepackageJava4; import org.junit.Test; public class Foo773Test { @Test public void testFoo0() { new Foo773().foo0(); } @Test public void testFoo1() { new Foo773().foo1(); } @Test public void testFoo2() { new Foo773().foo2(); } @Test public void testFoo3() { new Foo773().foo3(); } @Test public void testFoo4() { new Foo773().foo4(); } @Test public void testFoo5() { new Foo773().foo5(); } }
d9c3fccd74140a3a2e96d820dbe91f1723fa4701
1ab0472de2a93b978c10de258391614024f149f5
/data/src/main/java/com/wishes/data/DataApplication.java
e7be7d0d02198853a3dbe9fcb80cc1b5763eda1e
[]
no_license
BestWishes/engine
8aebb6634e01356c066b80a5181c73f26553ab8e
1dd3a4d7070aa88b9053e16072c4720b4e9d81de
refs/heads/master
2019-06-29T06:58:45.815884
2018-03-16T10:21:59
2018-03-16T10:21:59
102,066,392
0
0
null
null
null
null
UTF-8
Java
false
false
585
java
package com.wishes.data; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.context.annotation.Configuration; @SpringBootApplication @EnableDiscoveryClient @EnableAutoConfiguration @Configuration public class DataApplication { public static void main(String[] args) { SpringApplication.run(DataApplication.class, args); } }
966365d4ced41bbb836edf32e318292664bfb8de
22a8c41442174cf317878be4c9b191d6f86c8ec4
/src/main/java/controllers/freelancer/Profile.java
951c639631d52d2a93159776351920c14a212600
[]
no_license
skuarch/admin
0e15e1eb7ff223c988c8e5d84c2ed5515ce550fc
a27b5939eba0765825a0b9c359302a8e0cafb69f
refs/heads/master
2021-01-13T01:30:15.953994
2015-08-16T15:14:04
2015-08-16T15:14:04
35,173,051
0
0
null
null
null
null
UTF-8
Java
false
false
1,533
java
package controllers.freelancer; import controllers.application.BaseController; import java.util.Locale; import javax.servlet.http.HttpSession; import model.beans.PersonBasicInformation; import model.util.HandlerExceptionUtil; import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.MessageSource; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; /** * * @author skuarch */ @Controller public class Profile extends BaseController { private static final Logger logger = Logger.getLogger(Profile.class); @Autowired private HttpSession session; @Autowired MessageSource messageSource; private PersonBasicInformation personBasicInformation = null; //========================================================================== @RequestMapping(value = {"/profile", "profile"}) public ModelAndView profile(Locale locale) { ModelAndView mav = new ModelAndView("freelancer/profile"); try { personBasicInformation = (PersonBasicInformation) session.getAttribute("personBasicInformation"); mav.addObject("personBasicInformation", personBasicInformation); } catch (Exception e) { HandlerExceptionUtil.alert(mav, messageSource, e, logger, locale); } return mav; } }
31514e1815dd928b3e52e189e987c6ced968a803
759571e73d44d857616f7fcd8b226bf2d7150239
/VacuumPilot/target/generated-sources/r/com/gamedesign/vacuumpilot/R.java
334eaa48a8b4277e33a76b9f966a3821e12720b5
[]
no_license
umarazhar/VacuumPilot
fdf0e00dd07339e22eeddcea77284d2121c9ffc7
f9499731ebd0f89af5c25faa5081c319a24cfd6b
refs/heads/master
2020-04-11T10:50:42.661720
2015-04-09T04:18:01
2015-04-09T04:18:01
30,905,721
0
0
null
null
null
null
UTF-8
Java
false
false
11,093
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * aapt tool from the resource data it found. It * should not be modified by hand. */ package com.gamedesign.vacuumpilot; public final class R { public static final class attr { } public static final class color { public static final int blue=0x7f040000; public static final int grey05=0x7f040002; public static final int orange1=0x7f040001; } public static final class dimen { /** Example customization of dimensions originally defined in res/values/dimens.xml (such as screen margins) for screens with more than 820dp of available width. This would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). */ public static final int activity_horizontal_margin=0x7f050003; /** Default screen margins, per the Android Design guidelines. */ public static final int element_default_margin=0x7f050000; public static final int minimum_element_height=0x7f050002; public static final int minimum_element_width=0x7f050001; } public static final class drawable { public static final int airplane1=0x7f020000; public static final int balloon1=0x7f020001; public static final int balloon2=0x7f020002; public static final int balloon3=0x7f020003; public static final int balloon4=0x7f020004; public static final int balloon_bg=0x7f020005; public static final int blackhole1=0x7f020006; public static final int blackhole10=0x7f020007; public static final int blackhole11=0x7f020008; public static final int blackhole12=0x7f020009; public static final int blackhole13=0x7f02000a; public static final int blackhole14=0x7f02000b; public static final int blackhole15=0x7f02000c; public static final int blackhole16=0x7f02000d; public static final int blackhole17=0x7f02000e; public static final int blackhole18=0x7f02000f; public static final int blackhole2=0x7f020010; public static final int blackhole3=0x7f020011; public static final int blackhole4=0x7f020012; public static final int blackhole5=0x7f020013; public static final int blackhole6=0x7f020014; public static final int blackhole7=0x7f020015; public static final int blackhole8=0x7f020016; public static final int blackhole9=0x7f020017; public static final int button_default_bg=0x7f020018; public static final int damaged_airplane=0x7f020019; public static final int edittext_bottom_bg=0x7f02001a; public static final int edittext_default_bg=0x7f02001b; public static final int edittext_top_bg=0x7f02001c; public static final int email=0x7f02001d; public static final int explosion1=0x7f02001e; public static final int explosion10=0x7f02001f; public static final int explosion11=0x7f020020; public static final int explosion12=0x7f020021; public static final int explosion13=0x7f020022; public static final int explosion14=0x7f020023; public static final int explosion15=0x7f020024; public static final int explosion16=0x7f020025; public static final int explosion17=0x7f020026; public static final int explosion18=0x7f020027; public static final int explosion19=0x7f020028; public static final int explosion2=0x7f020029; public static final int explosion20=0x7f02002a; public static final int explosion21=0x7f02002b; public static final int explosion22=0x7f02002c; public static final int explosion23=0x7f02002d; public static final int explosion24=0x7f02002e; public static final int explosion25=0x7f02002f; public static final int explosion26=0x7f020030; public static final int explosion27=0x7f020031; public static final int explosion28=0x7f020032; public static final int explosion29=0x7f020033; public static final int explosion3=0x7f020034; public static final int explosion30=0x7f020035; public static final int explosion31=0x7f020036; public static final int explosion32=0x7f020037; public static final int explosion33=0x7f020038; public static final int explosion34=0x7f020039; public static final int explosion35=0x7f02003a; public static final int explosion36=0x7f02003b; public static final int explosion37=0x7f02003c; public static final int explosion38=0x7f02003d; public static final int explosion39=0x7f02003e; public static final int explosion4=0x7f02003f; public static final int explosion40=0x7f020040; public static final int explosion41=0x7f020041; public static final int explosion42=0x7f020042; public static final int explosion43=0x7f020043; public static final int explosion44=0x7f020044; public static final int explosion45=0x7f020045; public static final int explosion46=0x7f020046; public static final int explosion47=0x7f020047; public static final int explosion48=0x7f020048; public static final int explosion49=0x7f020049; public static final int explosion5=0x7f02004a; public static final int explosion50=0x7f02004b; public static final int explosion51=0x7f02004c; public static final int explosion52=0x7f02004d; public static final int explosion53=0x7f02004e; public static final int explosion54=0x7f02004f; public static final int explosion55=0x7f020050; public static final int explosion56=0x7f020051; public static final int explosion57=0x7f020052; public static final int explosion58=0x7f020053; public static final int explosion59=0x7f020054; public static final int explosion6=0x7f020055; public static final int explosion60=0x7f020056; public static final int explosion61=0x7f020057; public static final int explosion62=0x7f020058; public static final int explosion63=0x7f020059; public static final int explosion64=0x7f02005a; public static final int explosion65=0x7f02005b; public static final int explosion66=0x7f02005c; public static final int explosion67=0x7f02005d; public static final int explosion68=0x7f02005e; public static final int explosion69=0x7f02005f; public static final int explosion7=0x7f020060; public static final int explosion70=0x7f020061; public static final int explosion71=0x7f020062; public static final int explosion72=0x7f020063; public static final int explosion73=0x7f020064; public static final int explosion74=0x7f020065; public static final int explosion75=0x7f020066; public static final int explosion76=0x7f020067; public static final int explosion77=0x7f020068; public static final int explosion78=0x7f020069; public static final int explosion79=0x7f02006a; public static final int explosion8=0x7f02006b; public static final int explosion80=0x7f02006c; public static final int explosion81=0x7f02006d; public static final int explosion9=0x7f02006e; public static final int ic_launcher=0x7f02006f; public static final int invincible1=0x7f020070; public static final int invincible2=0x7f020071; public static final int invincible3=0x7f020072; public static final int invincible4=0x7f020073; public static final int invincible5=0x7f020074; public static final int invincible6=0x7f020075; public static final int invincible7=0x7f020076; public static final int invincible8=0x7f020077; public static final int invincible_airplane=0x7f020078; public static final int linearlayout_bg=0x7f020079; public static final int mainactivitywallpaper=0x7f02007a; public static final int mainbackground=0x7f02007b; public static final int notification_icon=0x7f02007c; public static final int password=0x7f02007d; public static final int sat1=0x7f02007e; public static final int sat10=0x7f02007f; public static final int sat11=0x7f020080; public static final int sat12=0x7f020081; public static final int sat13=0x7f020082; public static final int sat14=0x7f020083; public static final int sat15=0x7f020084; public static final int sat16=0x7f020085; public static final int sat17=0x7f020086; public static final int sat18=0x7f020087; public static final int sat2=0x7f020088; public static final int sat3=0x7f020089; public static final int sat4=0x7f02008a; public static final int sat5=0x7f02008b; public static final int sat6=0x7f02008c; public static final int sat7=0x7f02008d; public static final int sat8=0x7f02008e; public static final int sat9=0x7f02008f; public static final int studylink_icon=0x7f020090; public static final int user=0x7f020091; public static final int vacuumpilot_icon=0x7f020092; } public static final class id { public static final int title1=0x7f080000; public static final int title2=0x7f080001; } public static final class layout { public static final int activity_main=0x7f030000; } public static final class string { public static final int app_name=0x7f060000; } public static final class style { /** Base application theme, dependent on API level. This theme is replaced by AppBaseTheme from res/values-vXX/styles.xml on newer devices. Theme customizations available in newer API levels can go in res/values-vXX/styles.xml, while customizations related to backward-compatibility can go here. Base application theme for API 11+. This theme completely replaces AppBaseTheme from res/values/styles.xml on API 11+ devices. API 11 theme customizations can go here. Base application theme for API 14+. This theme completely replaces AppBaseTheme from BOTH res/values/styles.xml and res/values-v11/styles.xml on API 14+ devices. API 14 theme customizations can go here. */ public static final int AppBaseTheme=0x7f070000; /** Application theme. All customizations that are NOT specific to a particular API-level can go here. */ public static final int AppTheme=0x7f070001; /** the theme applied to the application or activity */ public static final int CustomActionBarTheme=0x7f070003; public static final int Divider=0x7f070002; /** ActionBar styles */ public static final int MyActionBar=0x7f070004; } }
47bf1a6bc5e388a812520c25f4c69939898c2402
8db0bb2d912b9939856849cd637f79ee26ee5415
/Idol/src/main/java/pl/idol/knif/Scizors.java
64a2e6346441b6d5744d91ae70222705c286f983
[]
no_license
idzik/idol
27d82f6a25b8a8d30aab175f76bcdae6ed346cc8
93730b562f666d71f1496d75345ad39ce4cef529
refs/heads/master
2020-12-24T15:31:49.481871
2015-07-13T11:47:00
2015-07-13T11:47:00
38,874,795
0
0
null
null
null
null
UTF-8
Java
false
false
143
java
package pl.idol.knif; public class Scizors implements Knif { public void flight() { System.out.println("long and high"); } }
[ "Piotrek@Piotrek-Pc" ]
Piotrek@Piotrek-Pc
4ed5c64354d3612d1da89741115a769a47dba389
0b3b3105e724c021ea8bdc6bae4d6c2b059fb478
/JavaAcademyProjects/ChessTest/src/main/java/meh/Knight.java
9f1a76b3e5c33d33d74bcc80da3577d94034f984
[]
no_license
Koolgee0/Project-Work
ff0874bc17294c21c3fe9ca1cfa9886a4be64e71
726f1ad9dab9d709b3ed3f19d64aac895407ba4e
refs/heads/master
2022-07-08T02:34:38.260195
2020-03-02T21:32:26
2020-03-02T21:32:26
242,202,621
0
0
null
2022-06-21T02:54:15
2020-02-21T18:15:22
Java
UTF-8
Java
false
false
1,537
java
package meh; public class Knight extends ChessPiece { public Knight(String owner, ChessLocation initialLocation, ChessGame game) { super(owner, initialLocation, game); if (owner.equalsIgnoreCase("player1")) { id = '\u265E'; } else if (owner.equalsIgnoreCase("player2")) { id = '\u2658'; } } @Override public boolean moveTo(ChessLocation location) { if (Math.abs(chessLocation.getRow() - location.getRow()) == 2 && Math.abs(chessLocation.getCol() - location.getCol()) == 1) { return super.moveTo(location); } else if (Math.abs(chessLocation.getRow() - location.getRow()) == 1 && Math.abs(chessLocation.getCol() - location.getCol()) == 2) { return super.moveTo(location); } return false; } @Override protected void updateThreateningLocation() { int[] rowMoves = {-2, -1, 1, 2, -2, -1, 1, 2}; int[] colMoves = {1, 2, 2, 1, -1, -2, -2, -1}; threateningLocations.clear(); for (int i = 0; i < 8; i++) { ChessLocation location = new ChessLocation(rowMoves[i], colMoves[i]); if (ChessBoard.locationInBounds(location)) { ChessPiece piece = chessGame.getChessBoard().getPieceAt(location); if (piece != null && !piece.getOwner().equals(owner)) { threateningLocations.add(location); } } } } }
9d4155b49596484eaf73a6ca8d7d82b358f115aa
f246bb285419a6f3468df7df0b3129aab7cb0439
/src/jdbc/ExcuteDML.java
4b307cc7c5bbc6d5e36efb001c0931a2b0e4c03f
[]
no_license
Youssef1231/Mydemo
cdf58b7147e80f8407dd7b6971dae1134a03ccdf
d1f731ac32a34bae283c24d8d58e9dc35639a6f4
refs/heads/master
2020-03-10T07:35:41.552672
2018-05-20T09:44:20
2018-05-20T09:44:20
129,266,278
0
0
null
null
null
null
UTF-8
Java
false
false
1,228
java
package jdbc; import java.io.FileInputStream; import java.sql.Connection; import java.sql.DriverManager; import java.sql.Statement; import java.util.Properties; public class ExcuteDML { private String driver; private String url; private String user; private String pass; public void initParam(String paramFile) throws Exception { Properties props = new Properties(); props.load(new FileInputStream(paramFile)); driver = props.getProperty("driver"); url = props.getProperty("url"); user = props.getProperty("user"); pass = props.getProperty("pass"); } public int insertData(String sql)throws Exception { Class.forName(driver); try ( Connection conn = DriverManager.getConnection(url, user, pass); Statement stmt = conn.createStatement() ) { return stmt.executeUpdate(sql); } } public static void main(String[] args) throws Exception { ExcuteDML ed = new ExcuteDML(); ed.initParam("src/jdbc/mysql.ini"); int result = ed.insertData("insert into jdbc_test(jdbc_name,jdbc_desc)" + "select s.student_name , t.teacher_name " + "from student_table s,teacher_table t " + "where s.java_teacher=t.teacher_id;"); System.out.println("create table successfully"); } }
a9bb6682d94b57ba1d9eb3306dac98f0266647df
4cc1d2f066f6221bc2af8ee5423b93154802b0d5
/src/com/zhntd/nick/rocklite/OnlineMusicSite.java
fabc9a3b12da5738e62f4d90011bd4fe350ce629
[ "Apache-2.0" ]
permissive
YuXinZhi/RockLite
413046ac5c94714faafe1b00f501b502054b41f0
868e2221a0873a8c42142d9f207689efcfe0c33c
refs/heads/master
2020-05-23T11:16:21.544839
2016-05-24T08:54:47
2016-05-24T08:54:47
58,855,227
0
0
null
2016-05-15T10:09:03
2016-05-15T10:09:02
null
UTF-8
Java
false
false
1,516
java
package com.zhntd.nick.rocklite; import android.annotation.SuppressLint; import android.app.Activity; import android.os.Bundle; import android.view.Window; import android.webkit.WebView; import android.webkit.WebViewClient; @SuppressLint("SetJavaScriptEnabled") public class OnlineMusicSite extends Activity { private WebView mWebView; private String mUrl = ""; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.layout_online_music); } @Override protected void onStart() { mUrl = getIntent().getStringExtra("url"); mWebView = (WebView) findViewById(R.id.wb_online_music); mWebView.getSettings().setJavaScriptEnabled(true); mWebView.getSettings().setSupportZoom(true); mWebView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); mWebView.requestFocus(); mWebView.loadUrl(mUrl); mWebView.setWebViewClient(new MyWebViewClient()); super.onStart(); } class MyWebViewClient extends WebViewClient { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } } @SuppressWarnings("deprecation") @Override protected void onDestroy() { mWebView.clearHistory(); mWebView.removeAllViewsInLayout(); mWebView.clearDisappearingChildren(); mWebView.clearFocus(); mWebView.clearView(); mWebView.destroy(); super.onDestroy(); } }
[ "Ben@Ben-PC" ]
Ben@Ben-PC
e1f235f52b1e5377c70b886152a92edb121170be
6be429fc2470e1ec0b212199f6abaa29e6498a73
/src/main/java/com/charlware/taulang/Test.java
6bee775ebf6eb3988feb7e1cb8f42c08f18c1ef8
[]
no_license
charlvj/taulang
25adbad43826d6d262a867f5f7571e3a8a843763
5a8fb50bd42fdce91dc6915f1be5c4a868270be8
refs/heads/master
2022-05-02T04:25:49.630210
2022-04-15T03:20:27
2022-04-15T03:20:27
171,209,148
1
0
null
2021-11-10T00:58:25
2019-02-18T03:35:18
Java
UTF-8
Java
false
false
2,056
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.charlware.taulang; import java.io.File; import java.nio.file.Path; import java.util.List; import com.charlware.taulang.values.Value; /** * * @author charlvj */ public class Test { public static void main(String[] args) throws Exception { String code = ""; // code = "print \"What is your name? \" make \"name\" readline print [ \"Hello \" name ]"; // code = "print [ 3 \"+\" 2 \"=\" plus plus 1 2 2 ]"; // code = "repeat 5 [ print \"Hello!\" ]"; // code = "make \"counter\" 1 repeat 5 [ print [ counter newline ] make \"counter\" plus 1 counter ] print \"Done\""; // code = "make \"p\" [ 1 2 3 ] print p"; code = "to \"test.printline\" [ \"msg\" ] [ print [ msg newline ] ] test.printline \"Hello World!\" test.printline \"Yo!\""; // code = "make \"list\" [ 1 2 3 4 ] print [ \"List Size: \" listsize list newline \"Third: \" getelem list 2 ]"; Runtime runtime = new Runtime(); Interpreter interpreter = runtime.getInterpreter(); runtime.initialize(); // interpreter.interpret(code); List<Value> searchPath = runtime.getSearchPath(); // searchPath.add(new StringValue("/scratch")); String fileToRun = "scratch/todo.tau"; File file = new File( com.charlware.taulang.Runtime.class.getResource("/tau/" + fileToRun).toURI() ); // File file = new File(fileToRun); // if (!file.exists()) { // for (Value path : searchPath) { // file = new File(path.asString(), fileToRun); // if (file.exists()) { // break; // } // } // } if(file.exists()) interpreter.interpret(file.toPath()); else System.out.println("Could not find file"); } }
804380b1025402b2d7c5ef3784e2ea739df4f932
9059c748537230556b05a4ed9a66f14912174a14
/QuanLyNhanThuong/src/controllers/HomeCotroller.java
5ff296cad5429df23615e20322ace1db2c37361b
[]
no_license
tdd75/cnpmproject
c58a95f0e3deaaac70572173ec1ed4375af4563c
3c14ff95e92d13b9943701f0a6b4afd832d72b6d
refs/heads/master
2023-01-24T06:05:06.452460
2020-11-23T03:53:33
2020-11-23T03:53:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,552
java
package controllers; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import javax.swing.JLabel; import services.MysqlConnection; /** * * @author Minh */ public class HomeCotroller { private JLabel tongSoTien; private JLabel soTienDaChi; private JLabel soTienDaNhan; public HomeCotroller(JLabel tongSoTien, JLabel soTienDaChi, JLabel soTienDaNhan) { this.tongSoTien = tongSoTien; this.soTienDaChi = soTienDaChi; this.soTienDaNhan = soTienDaNhan; } //truy vấn lấy tổng số tiền, số tiền đã chi, số tiền đã nhận public void setData() { try { Connection connection = MysqlConnection.getMysqlConnection(); /*String query = "SELECT COUNT(*) AS tong FROM nhan_khau"; PreparedStatement preparedStatement = (PreparedStatement)connection.prepareStatement(query); ResultSet rs = preparedStatement.executeQuery(); while (rs.next()){ this.tongSoTien.setText(String.valueOf(rs.getInt("tong"))); } preparedStatement.close(); query = "SELECT COUNT(*) AS tong FROM ho_khau"; preparedStatement = (PreparedStatement)connection.prepareStatement(query); rs = preparedStatement.executeQuery(); while (rs.next()){ this.soTienDaChi.setText(String.valueOf(rs.getInt("tong"))); } preparedStatement.close(); query = "SELECT COUNT(*) AS tong FROM tam_tru WHERE denNgay < NOW()"; preparedStatement = (PreparedStatement)connection.prepareStatement(query); rs = preparedStatement.executeQuery(); while (rs.next()){ this.soTienDaNhan.setText(String.valueOf(rs.getInt("tong"))); } preparedStatement.close(); connection.close();*/ } catch (Exception e) { } } public JLabel getTongSoTien() { return tongSoTien; } public JLabel getSoTienDaChi() { return soTienDaChi; } public JLabel getSoTienDaNhan() { return soTienDaNhan; } public void setTongSoTien(JLabel tongSoTien) { this.tongSoTien = tongSoTien; } public void setSoTienDaChi(JLabel soTienDaChi) { this.soTienDaChi = soTienDaChi; } public void setSoTienDaNhan(JLabel soTienDaNhan) { this.soTienDaNhan = soTienDaNhan; } }
e9a57799715c96dffce8c540e397f01eace6aef9
c8768246f79b9264af97a3a7c891d09293994a44
/src/main/java/io/sisu/nng/internal/NngOptions.java
dc100a1a5812faaf127873607174cae5f6a57494
[ "MIT" ]
permissive
voutilad/nng-java
050120b21e2a12a80a31ad180b94a2c0b5e34372
c47f229f10003edec6be41d2caf1ca0036f9c53e
refs/heads/main
2023-08-22T11:54:20.526635
2021-02-17T23:39:07
2021-02-17T23:39:07
326,866,596
8
3
MIT
2023-08-03T11:09:31
2021-01-05T02:42:31
Java
UTF-8
Java
false
false
2,635
java
package io.sisu.nng.internal; public class NngOptions { // General Pipe/Dialer/Listener Options public static final String SOCKET_NAME = "socket-name"; public static final String RAW = "raw"; public static final String PROTOCOL = "protocol"; public static final String PROTOCOL_NAME = "protocol-name"; public static final String PEER = "peer"; public static final String PEER_NAME = "peer-name"; public static final String RECV_BUF = "recv-buffer"; public static final String SEND_BUF = "send-buffer"; public static final String RECV_FD = "recv-fd"; public static final String SEND_FD = "send-fd"; public static final String RECV_TIMEOUT = "recv-timeout"; public static final String SEND_TIMEOUT = "send-timeout"; public static final String LOCAL_ADDR = "local-address"; public static final String REMOTE_ADDR = "remote-address"; public static final String URL = "url"; public static final String MAX_TTL = "ttl-max"; public static final String RECV_SIZE_MAX = "recv-size-max"; public static final String RECONNECT_TIME_MIN = "reconnect-time-min"; public static final String RECONNECT_TIME_MAX = "reconnect-time-max"; // TLS Options public static final String TLS_CONFIG = "tls-config"; public static final String TLS_AUTH_MODE = "tls-authmode"; public static final String TLS_CERT_KEY_FILE = "tls-cert-key-file"; public static final String TLS_CA_FILE = "tls-ca-file"; public static final String TLS_SERVER_NAME = "tls-server-name"; public static final String TLS_IS_VERIFIED = "tls-verified"; // WebSocket Options public static final String WS_REQUEST_HEADERS = "ws:request-headers"; public static final String WS_RESPONSE_HEADERS = "ws:response-headers"; public static final String WS_REQUEST_HEADER = "ws:request-header:"; public static final String WS_RESPONSE_HEADER = "ws:response-header:"; public static final String WS_REQUEST_URI = "ws:request-uri"; public static final String WS_SEND_MAX_FRAME = "ws:txframe-max"; public static final String WS_RECV_MAX_FRAME = "ws:rxframe-max"; public static final String WS_PROTOCOL = "ws:protocol"; public static final String WS_SEND_TEXT = "ws:send-text"; public static final String WS_RECV_TEXT = "ws:recv-text"; // PubSub Options public static final String SUBSCRIBE = "sub:subscribe"; public static final String UNSUBSCRIBE = "sub:unsubscribe"; public static final String PREFER_NEW_ON_FULL = "sub:prefnew"; // Surveyor Options public static final String SURVEYOR_SURVEYTIME = "surveyor:survey-time"; }
cce9be76b3fcbc8e65c616051cb0d2e79cfb6065
4bd41c52a8a00627e647b088dc4553cf24ad6b89
/HANDIN/SEP2_RE_Code/src/controller/admin/assignShiftController.java
bac5ae6807f5ab11a3f11e5a95742305a68017a4
[]
no_license
Triesik/SEP2_RE
2f0b063da622e04b9a66e33f45a12a7b29ef0047
85b2ac36af88281df19e4ac3efb374b0c48fb74d
refs/heads/master
2020-07-06T10:33:05.883744
2019-08-16T08:47:52
2019-08-16T08:47:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
333
java
package controller.admin; import client.Client; import view.admin.assignShift.assignShiftView; public class assignShiftController { private assignShiftView view; private Client client; public assignShiftController(assignShiftView view, Client client) { this.client = client; this.view = view; } }
a07abe2fdcb57ed4e1f4008bdec644520e910773
7bee1a02d05f0bb03d29bdf9fdcf976dda69d277
/src/org/netbeans/modules/groovy/editor/completion/JavaElementHandler.java
118dbb6196895e2d9db0d65d0df66dee00b6298c
[]
no_license
Valery-Sh/Netbeans-Groovy-Editor
f852ec7d2103e1ecde3541e9977941cfd3f7eff3
4932e014b7d571cbe0422a706e29a21142052634
refs/heads/master
2021-01-19T22:29:32.386719
2012-03-07T17:54:43
2012-03-07T17:54:43
3,651,826
0
1
null
null
null
null
UTF-8
Java
false
false
15,800
java
/* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * * Copyright 2010 Oracle and/or its affiliates. All rights reserved. * * Oracle and Java are registered trademarks of Oracle and/or its affiliates. * Other names may be trademarks of their respective owners. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common * Development and Distribution License("CDDL") (collectively, the * "License"). You may not use this file except in compliance with the * License. You can obtain a copy of the License at * http://www.netbeans.org/cddl-gplv2.html * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the * specific language governing permissions and limitations under the * License. When distributing the software, include this License Header * Notice in each file and include the License file at * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the GPL Version 2 section of the License file that * accompanied this code. If applicable, add the following below the * License Header, with the fields enclosed by brackets [] replaced by * your own identifying information: * "Portions Copyrighted [year] [name of copyright owner]" * * If you wish your version of this file to be governed by only the CDDL * or only the GPL Version 2, indicate your decision by adding * "[Contributor] elects to include this software in this distribution * under the [CDDL or GPL Version 2] license." If you do not indicate a * single choice of license, a recipient has the option to distribute * your version of this file under either the CDDL, the GPL Version 2 or * to extend the choice of license to its licensees as provided above. * However, if you add GPL Version 2 code and therefore, elected the GPL * Version 2 license, then the option applies only if the new code is * made subject to such option by the copyright holder. * * Contributor(s): * * Portions Copyrighted 2008 Sun Microsystems, Inc. */ package org.netbeans.modules.groovy.editor.completion; //import org.netbeans.modules.groovy.editor.api.completion.CompletionItem; import java.io.IOException; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Set; import java.util.concurrent.CountDownLatch; import java.util.logging.Level; import java.util.logging.Logger; import javax.lang.model.element.Element; import javax.lang.model.element.ElementKind; import javax.lang.model.element.ExecutableElement; import javax.lang.model.element.TypeElement; import javax.lang.model.element.TypeParameterElement; import javax.lang.model.element.VariableElement; import javax.lang.model.type.TypeKind; import javax.lang.model.type.TypeMirror; import javax.lang.model.util.ElementFilter; import javax.lang.model.util.Elements; import javax.lang.model.util.Types; import org.netbeans.api.java.source.ClasspathInfo; import org.netbeans.api.java.source.CompilationController; import org.netbeans.api.java.source.ElementUtilities.ElementAcceptor; import org.netbeans.api.java.source.JavaSource; import org.netbeans.api.java.source.Task; import org.netbeans.modules.csl.spi.ParserResult; import org.netbeans.modules.groovy.editor.api.completion.CompletionItem; import org.netbeans.modules.groovy.editor.api.completion.GroovyCompletionHandler; import org.netbeans.modules.groovy.editor.api.completion.FieldSignature; import org.netbeans.modules.groovy.editor.api.completion.MethodSignature; import org.openide.filesystems.FileObject; /** * * @author Petr Hejl */ public final class JavaElementHandler { private static final Logger LOG = Logger.getLogger(GroovyElementHandler.class.getName()); private final ParserResult info; private JavaElementHandler(ParserResult info) { this.info = info; } public static JavaElementHandler forCompilationInfo(ParserResult info) { return new JavaElementHandler(info); } // FIXME ideally there should be something like nice CompletionRequest once public and stable // then this class could implement some common interface public Map<MethodSignature, ? extends CompletionItem> getMethods(String className, String prefix, int anchor, String[] typeParameters, boolean emphasise, Set<AccessLevel> levels, boolean nameOnly) { JavaSource javaSource = createJavaSource(); if (javaSource == null) { return Collections.emptyMap(); } CountDownLatch cnt = new CountDownLatch(1); Map<MethodSignature, CompletionItem> result = Collections.synchronizedMap(new HashMap<MethodSignature, CompletionItem>()); try { System.out.println("RRRRRRRRRRRRRRR JavaElementHandle BEFORE runUserActionTask"); javaSource.runUserActionTask(new MethodCompletionHelper(cnt, javaSource, className, typeParameters, levels, prefix, anchor, result, emphasise, nameOnly), true); } catch (IOException ex) { System.out.println("RRRRRRRRRRRRRRR JavaElementHandle ERROR"); LOG.log(Level.FINEST, "Problem in runUserActionTask : {0}", ex.getMessage()); return Collections.emptyMap(); } try { cnt.await(); } catch (InterruptedException ex) { LOG.log(Level.FINEST, "InterruptedException while waiting on latch : {0}", ex.getMessage()); return Collections.emptyMap(); } return result; } public Map<FieldSignature, ? extends CompletionItem> getFields(String className, String prefix, int anchor, boolean emphasise) { JavaSource javaSource = createJavaSource(); if (javaSource == null) { return Collections.emptyMap(); } CountDownLatch cnt = new CountDownLatch(1); Map<FieldSignature, CompletionItem> result = Collections.synchronizedMap(new HashMap<FieldSignature, CompletionItem>()); try { javaSource.runUserActionTask(new FieldCompletionHelper(cnt, javaSource, className, Collections.singleton(AccessLevel.PUBLIC), prefix, anchor, result, emphasise), true); } catch (IOException ex) { LOG.log(Level.FINEST, "Problem in runUserActionTask : {0}", ex.getMessage()); return Collections.emptyMap(); } try { cnt.await(); } catch (InterruptedException ex) { LOG.log(Level.FINEST, "InterruptedException while waiting on latch : {0}", ex.getMessage()); return Collections.emptyMap(); } return result; } private JavaSource createJavaSource() { FileObject fileObject = info.getSnapshot().getSource().getFileObject(); if (fileObject == null) { return null; } // get the JavaSource for our file. JavaSource javaSource = JavaSource.create(ClasspathInfo.create(fileObject)); if (javaSource == null) { LOG.log(Level.FINEST, "Problem retrieving JavaSource from ClassPathInfo, exiting."); return null; } return javaSource; } private static class MethodCompletionHelper implements Task<CompilationController> { private final CountDownLatch cnt; private final JavaSource javaSource; private final String className; private final String[] typeParameters; private final Set<AccessLevel> levels; private final String prefix; private final int anchor; private final boolean emphasise; private final Map<MethodSignature, CompletionItem> proposals; private final boolean nameOnly; public MethodCompletionHelper(CountDownLatch cnt, JavaSource javaSource, String className, String[] typeParameters, Set<AccessLevel> levels, String prefix, int anchor, Map<MethodSignature, CompletionItem> proposals, boolean emphasise, boolean nameOnly) { this.cnt = cnt; this.javaSource = javaSource; this.className = className; this.typeParameters = typeParameters; this.levels = levels; this.prefix = prefix; this.anchor = anchor; this.proposals = proposals; this.emphasise = emphasise; this.nameOnly = nameOnly; } public void run(CompilationController info) throws Exception { Elements elements = info.getElements(); if (elements != null) { ElementAcceptor acceptor = new ElementAcceptor() { public boolean accept(Element e, TypeMirror type) { if (e.getKind() != ElementKind.METHOD) { return false; } for (AccessLevel level : levels) { if (level.getJavaAcceptor().accept(e, type)) { return true; } } return false; } }; TypeElement te = elements.getTypeElement(className); if (te != null) { for (ExecutableElement element : ElementFilter.methodsIn(te.getEnclosedElements())) { if (!acceptor.accept(element, te.asType())) { continue; } String simpleName = element.getSimpleName().toString(); String parameterString = GroovyCompletionHandler.getParameterListForMethod(element); System.out.println("RRRRRRRRRRRRRRR MethodCompletionHandle simpleName=" + simpleName + "; parameterString=" + parameterString + "; className=" + className); // FIXME this should be more accurate TypeMirror returnType = element.getReturnType(); if (simpleName.toUpperCase(Locale.ENGLISH).startsWith(prefix.toUpperCase(Locale.ENGLISH))) { if (LOG.isLoggable(Level.FINEST)) { LOG.log(Level.FINEST, simpleName + " " + parameterString + " " + returnType.toString()); } proposals.put(getSignature(te, element, typeParameters, info.getTypes()), CompletionItem.forJavaMethod( className, simpleName, parameterString, returnType, element.getModifiers(), anchor, emphasise, nameOnly)); } } } } cnt.countDown(); } private MethodSignature getSignature(TypeElement classElement, ExecutableElement element, String[] typeParameters, Types types) { String name = element.getSimpleName().toString(); String[] parameters = new String[element.getParameters().size()]; for (int i = 0; i < parameters.length; i++) { VariableElement var = element.getParameters().get(i); TypeMirror type = var.asType(); String typeString = null; if (type.getKind() == TypeKind.TYPEVAR) { List<? extends TypeParameterElement> declaredTypeParameters = element.getTypeParameters(); if (declaredTypeParameters.isEmpty()) { declaredTypeParameters = classElement.getTypeParameters(); } int j = -1; for (TypeParameterElement typeParam : declaredTypeParameters) { j++; if (typeParam.getSimpleName().toString().equals(type.toString())) { break; } } if (j >= 0 && j < typeParameters.length) { typeString = typeParameters[j]; } else { typeString = types.erasure(type).toString(); } } else { typeString = type.toString(); } int index = typeString.indexOf('<'); if (index >= 0) { typeString = typeString.substring(0, index); } parameters[i] = typeString; } return new MethodSignature(name, parameters); } } private static class FieldCompletionHelper implements Task<CompilationController> { private final CountDownLatch cnt; private final JavaSource javaSource; private final String className; private final Set<AccessLevel> levels; private final String prefix; private final int anchor; private final boolean emphasise; private final Map<FieldSignature, CompletionItem> proposals; public FieldCompletionHelper(CountDownLatch cnt, JavaSource javaSource, String className, Set<AccessLevel> levels, String prefix, int anchor, Map<FieldSignature, CompletionItem> proposals, boolean emphasise) { this.cnt = cnt; this.javaSource = javaSource; this.className = className; this.levels = levels; this.prefix = prefix; this.anchor = anchor; this.proposals = proposals; this.emphasise = emphasise; } @Override public void run(CompilationController info) throws Exception { Elements elements = info.getElements(); if (elements != null) { ElementAcceptor acceptor = new ElementAcceptor() { @Override public boolean accept(Element e, TypeMirror type) { if (e.getKind() != ElementKind.FIELD) { return false; } for (AccessLevel level : levels) { if (level.getJavaAcceptor().accept(e, type)) { return true; } } return false; } }; TypeElement te = elements.getTypeElement(className); if (te != null) { for (VariableElement element : ElementFilter.fieldsIn(te.getEnclosedElements())) { if (!acceptor.accept(element, te.asType())) { continue; } String simpleName = element.getSimpleName().toString(); TypeMirror type = element.asType(); if (simpleName.toUpperCase(Locale.ENGLISH).startsWith(prefix.toUpperCase(Locale.ENGLISH))) { if (LOG.isLoggable(Level.FINEST)) { LOG.log(Level.FINEST, simpleName + " " + type.toString()); } proposals.put(getSignature(te, element), new CompletionItem.JavaFieldItem( className, simpleName, type, element.getModifiers(), anchor, emphasise)); } } } } cnt.countDown(); } private FieldSignature getSignature(TypeElement classElement, VariableElement element) { String name = element.getSimpleName().toString(); return new FieldSignature(name); } } }
[ "Valery@Valery-PC" ]
Valery@Valery-PC
d20a06feb7c2913b10204e2eb68820e2105d2058
32afa2df409027832cc69e0a1a8085d8fbeb8b7c
/app/src/main/java/com/crazy/firebirdtools/main/beijing/BeijingFragment.java
96f0d741977436b666cf27a3d0a7803ea21f91ba
[]
no_license
taowei00/FireBird
e33711cf0b43ad782d8575bf102761a90f44e8fc
53e54af602f8978530f3bdd3e7e5121381e610ba
refs/heads/master
2022-04-26T00:21:28.285740
2020-04-06T01:26:51
2020-04-06T01:26:51
208,973,795
1
0
null
null
null
null
UTF-8
Java
false
false
383
java
package com.crazy.firebirdtools.main.beijing; import androidx.fragment.app.Fragment; import com.crazy.firebirdtools.R; import com.crazy.firebirdtools.base.BaseFragment; import com.crazy.firebirdtools.base.ViewInject; @ViewInject(mainLayoutid = R.layout.fragment_beijing) public class BeijingFragment extends BaseFragment { @Override public void afterBindView() { } }
6ba0b917e7930bc997e18a0d341639752f84c94f
9845a9f28d6b713c4a4631d7ab927e9bf37e7b85
/src/main/java/com/icthh/xm/ms/balance/config/package-info.java
6d1f3cc3604279eec4bbb6032c0e4c0073b134a9
[ "Apache-2.0" ]
permissive
xm-online/xm-ms-balance
a4984136e3027e2846bb8b607ec886931f87fdcf
7a07d83abda2d66321577f304169cec4bdeb6a3a
refs/heads/master
2023-08-18T15:29:22.701944
2023-08-18T07:39:40
2023-08-18T07:39:40
105,270,366
9
1
Apache-2.0
2023-08-18T07:39:41
2017-09-29T12:35:47
Java
UTF-8
Java
false
false
89
java
/** * Spring Framework configuration files. */ package com.icthh.xm.ms.balance.config;
62443b2a829d17101682af404544fda77609f644
b766c0b6753f5443fd84c14e870ec316edc116bb
/java-basic/src/main/java/bitcamp/java100/ch19/ex2/Test1.java
25ad62e228e759f455f099f59a8e1100bcb6f093
[]
no_license
angelpjn/bitcamp
5a83b7493812ae5dd4a61b393743a673085b59b5
3c1fb28cda2ab15228bcaed53160aabd936df248
refs/heads/master
2021-09-06T20:31:18.846623
2018-02-11T05:23:07
2018-02-11T05:23:07
104,423,428
0
0
null
null
null
null
UTF-8
Java
false
false
329
java
package bitcamp.java100.ch19.ex2; import java.lang.annotation.Annotation; public class Test1 { public static void main(String[] args) { Annotation[] annos = MyClass.class.getAnnotations(); for (Annotation a : annos) { System.out.println(a.annotationType().getName()); } } }
18a1796a459e5710cb9dc74a22cc9f964a72127c
a85a9e7cca92b33f438d2f29b7e9d49c9905720c
/app/src/main/java/com/github/theholywaffle/teamspeak3/api/wrapper/Version.java
179affdba4e16b35f7db8ce0150e36bc5a09b35c
[ "MIT" ]
permissive
Janl1/TSQuery
78d30e8e5a51a29ae7fefdff321d182f9ed07348
9175069f1209785dd5f31764a8f6df0b8b4b4bf0
refs/heads/master
2021-09-24T05:49:49.758495
2018-10-04T07:37:43
2018-10-04T07:37:43
111,331,882
1
0
null
null
null
null
UTF-8
Java
false
false
916
java
/******************************************************************************* * Copyright (c) 2014 Bert De Geyter (https://github.com/TheHolyWaffle). * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Public License v3.0 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/gpl.html * * Contributors: * Bert De Geyter (https://github.com/TheHolyWaffle) ******************************************************************************/ package com.github.theholywaffle.teamspeak3.api.wrapper; import java.util.HashMap; public class Version extends Wrapper{ public Version(HashMap<String, String> map) { super(map); } public String getVersion(){ return get("version"); } public String getBuild(){ return get("build"); } public String getPlatform(){ return get("platform"); } }
0a7c88cbd43e0a7028e1f72e55a220953fac4da4
753d55e2f89cd6e54650167dab586e6dd96181a8
/src/main/java/net/protoprint/logisticapp/LogisticappApplication.java
03b0ddea1728cd4fd413226acaeb6a303b9f2fab
[]
no_license
atominkiss/LogisticApp
a13ae1f07f4d1ae7ee739eff130332d3b03352ce
99c35eb98ff7de9be4f7fc32797441c672e1fd4e
refs/heads/master
2021-05-23T10:23:06.376863
2020-04-05T13:29:59
2020-04-05T13:29:59
253,241,317
0
0
null
null
null
null
UTF-8
Java
false
false
329
java
package net.protoprint.logisticapp; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class LogisticappApplication { public static void main(String[] args) { SpringApplication.run(LogisticappApplication.class, args); } }
2b7f15ff3215ee8b5ac1e3e5f70f781e3524bc71
fb5452e16d2518b472470c29852a193eae0e13f2
/gameserver/src/main/java/com/junglee/db/domain/Messages.java
53339b2486d2cb9fd863af8d28798bc50e0e4866
[]
no_license
kinshuk4/KodingProbs
50af302b9eee9f8e358057360c8c16792b615830
9d060b3bbae3f8c53ec57f7b025dfe65050321a3
refs/heads/master
2022-12-05T00:55:27.018919
2018-12-13T17:13:31
2019-02-14T17:13:31
78,401,566
0
0
null
2022-11-24T05:28:29
2017-01-09T06:47:13
Java
UTF-8
Java
false
false
867
java
package com.junglee.db.domain; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name = "messages") public class Messages { @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name = "id") private Long id; @Column(name = "connection") private String connection; @Column(name = "message") private String message; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getConnection() { return connection; } public void setConnection(String connection) { this.connection = connection; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } }
e3dc66f91ed0267bc5b63477a6a87aa464d048ec
5b233337fa9124d023bae7c215f48efa5fe490b4
/src/main/java/com/reactive/io/entity/dto/ResponseDto.java
4af60f26676a2b6e4dadb53a897493408240c7c2
[]
no_license
adora-tech/springboot-reactive-starter-kit
36b7c726aef4b3f51830c62ce128832ca5308e80
42c3117d527fc9f8acf7d84d09602c23fcc50bff
refs/heads/main
2023-07-31T09:50:59.037130
2021-09-20T11:31:19
2021-09-20T11:31:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
155
java
package com.reactive.io.entity.dto; import lombok.Builder; import lombok.Getter; @Getter @Builder public class ResponseDto { private Object data; }
012c42e6db11fda3517b97bdf20b97e60c12f4b2
b4bc343d2354a47d1159d661b54d6539e21d9626
/mobile/src/main/java/com/virtualrobe/virtualrobe/virtualrobe_app/Styling_board/Cloth_selection_activity.java
2606ee88ae0caca4dba27448c0f4ba962eb883fb
[]
no_license
aneri885/Virtualrobe
12d833c42e6a6cf2a1e5b4661ef661b1ac7d216e
4f59102e9b96c5409171ad21e50eacfa2ef3c8de
refs/heads/master
2021-05-24T18:28:50.616667
2018-12-02T17:16:28
2018-12-02T17:16:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,965
java
package com.virtualrobe.virtualrobe.virtualrobe_app.Styling_board; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.RecyclerView; import android.text.Spannable; import android.text.SpannableString; import android.view.View; import android.widget.LinearLayout; import android.widget.TextView; import com.google.firebase.firestore.DocumentReference; import com.google.firebase.firestore.DocumentSnapshot; import com.google.firebase.firestore.FirebaseFirestore; import com.google.firebase.firestore.ListenerRegistration; import com.google.firebase.firestore.Query; import com.virtualrobe.virtualrobe.virtualrobe_app.R; import com.virtualrobe.virtualrobe.virtualrobe_app.Styling_board.Adapter.Selection_Adapter; import com.virtualrobe.virtualrobe.virtualrobe_app.TypefaceSpan; import com.virtualrobe.virtualrobe.virtualrobe_app.model.Clothes; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; public class Cloth_selection_activity extends AppCompatActivity implements Selection_Adapter.OnFeedSelectedListener { public static final String KEY_CATEGORY_ID = "Category_ID"; public static final String KEY_CATEGORY_NAME = "Category"; public static final String KEY_USER_ID = "User_ID"; @BindView(R.id.selected) TextView selected; @BindView(R.id.recycler_wardrobe) RecyclerView recyclerView; @BindView(R.id.view_empty) LinearLayout mEmptyView; private FirebaseFirestore mFirestore; private DocumentReference mCategoryRef; private ListenerRegistration mCategoryRegistration; private Selection_Adapter adapter; String Category_ID; String User_ID; private String Category_name; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.clothe_selection); ButterKnife.bind(this); /*get Category name*/ Category_name = getIntent().getExtras().getString(KEY_CATEGORY_NAME); if (Category_name == null) { throw new IllegalArgumentException("Must pass extra " + KEY_CATEGORY_NAME); } else { /*Set Category name and font type*/ SpannableString s = new SpannableString("Select "+Category_name); s.setSpan(new TypefaceSpan(this, "LobsterTwo-Bold.ttf"), 0, s.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); selected.setText(s); } /*get Category ID*/ Category_ID = getIntent().getExtras().getString(KEY_CATEGORY_ID); if (Category_ID == null) { throw new IllegalArgumentException("Must pass extra " + KEY_CATEGORY_ID); } // Initialize Firestore mFirestore = FirebaseFirestore.getInstance(); //get refrence to the user User_ID = getIntent().getExtras().getString(KEY_USER_ID); if (User_ID == null) { throw new IllegalArgumentException("Must pass extra " + KEY_USER_ID); } DocumentReference user = mFirestore.collection("Users").document(User_ID); // Get reference to the category mCategoryRef = user.collection("Wardrobe").document(Category_ID); // Get category items Query items_Query = mCategoryRef .collection("Category_item"); // RecyclerView adapter = new Selection_Adapter(items_Query,this){ @Override protected void onDataChanged() { if (getItemCount() == 0) { recyclerView.setVisibility(View.GONE); mEmptyView.setVisibility(View.VISIBLE); } else { recyclerView.setVisibility(View.VISIBLE); mEmptyView.setVisibility(View.GONE); } } }; GridLayoutManager layoutManager = new GridLayoutManager(this, 2); recyclerView.setLayoutManager(layoutManager); recyclerView.setAdapter(adapter); } @Override public void onfeedSelected(DocumentSnapshot cloth) { SharedPreferences preferences = getSharedPreferences("Cloth_details", Context.MODE_PRIVATE); SharedPreferences.Editor editor = preferences.edit(); final Clothes clothes = cloth.toObject(Clothes.class); if (cloth!=null){ SpannableString s = new SpannableString("1 "+Category_name+ " selected"); s.setSpan(new TypefaceSpan(this, "LobsterTwo-Bold.ttf"), 0, s.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); selected.setText(s); /*send image to styling board*/ editor.putString(Category_name+"_url",clothes.getFull_image()); editor.putString(Category_name+"_id",cloth.getId()); editor.apply(); } else { SpannableString s = new SpannableString("Select "+Category_name); s.setSpan(new TypefaceSpan(this, "LobsterTwo-Bold.ttf"), 0, s.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); selected.setText(s); /*remove image to styling board*/ editor.putString(Category_name+"url",""); editor.apply(); } } @Override public void onStart() { super.onStart(); adapter.startListening(); } @Override public void onStop() { super.onStop(); adapter.stopListening(); } @Override public void onBackPressed() { super.onBackPressed(); finish(); } @OnClick(R.id.fab) public void close(View view){ startActivity(new Intent(Cloth_selection_activity.this,Styling_activity.class)); finish(); } }
7268f23df5a488cb3410f4845f2ae48dd170b418
5fe7788c36f98f636dd9d2281a1bb6e9d3a7f7b0
/app/src/main/java/com/flymrgmail/kioskdima/BootReceiver.java
ef72e163af0a2321616a2db9d04119fce6d5bf8f
[]
no_license
flymr/KioskDima
49b7efa09011984779f9e4a9a158207c45e3f680
a94112374c6e465d0ed8cdd2c9a86b6903780b1c
refs/heads/master
2022-01-19T06:07:34.370322
2019-07-06T10:55:33
2019-07-06T10:55:33
187,028,524
0
0
null
null
null
null
UTF-8
Java
false
false
444
java
package com.flymrgmail.kioskdima; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; public class BootReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { Intent myIntent = new Intent(context, MainActivity.class); myIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(myIntent); } }
8dccd7d254c8decd149b91e50938acd61ae3f886
129b701f4a9c38a29c39cd6f99de41e769886867
/app/src/main/java/com/example/myapplication/MainActivity.java
1f814864c0d0fc0dc773535e6f5046508778ae2f
[]
no_license
cyp10/currency-converter
13a95d78d5f9f8461dac0b1b2e516eea0376b969
5d08586b59ced3b222e83d96ec700fec01cdf13f
refs/heads/master
2023-07-20T15:15:25.544514
2021-08-31T15:13:16
2021-08-31T15:13:16
401,747,340
0
0
null
null
null
null
UTF-8
Java
false
false
1,069
java
package com.example.myapplication; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; public class MainActivity extends AppCompatActivity { EditText editTextNumber; EditText editText; Button button; public void button(View view){ Log.i("this","button pressed"); Log.i("this",editTextNumber.getText().toString()); Double rupee=Double.parseDouble(editTextNumber.getText().toString()); Double dolor=rupee*74.49; Toast.makeText(this, "It is"+dolor, Toast.LENGTH_SHORT).show(); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); button=(Button) findViewById(R.id.button); editText=(EditText)findViewById(R.id.editTextTextPersonName); editTextNumber=(EditText) findViewById(R.id.editTextNumber); } }
9ae05ee58899cec136b3a67d54bfcc1dd782d639
cfe515ab46123014185e83e964089b9bf5cf8c14
/src/main/java/com/jeff/ProcessC.java
459019081d3e1c49465c714879f8097eb604e511
[]
no_license
jadkisson/collision_management
2e11a140bcae896969d9bad3af62dd5e519a96d5
d5eb68bd447bea69f396bded8b7fc018300bc5fc
refs/heads/master
2021-01-20T09:16:24.706293
2017-09-23T20:48:24
2017-09-23T20:48:24
101,588,835
1
0
null
2017-08-28T00:23:29
2017-08-28T00:23:29
null
UTF-8
Java
false
false
4,688
java
package com.jeff; import javax.sound.sampled.LineUnavailableException; import java.io.IOException; /** * CLASS ProcessC * * ProcessC takes summary data from bufferCD and determines if a collision * occurred. This implementation also creates a composite view of all * trains in the display grid to visually show all the trains in one plane and * show collisions in red (plus a beep). * All data from ProcessC is shown in the grid and logged to the console. */ public class ProcessC extends ProcessBase { private final DoubleBuffer<Object[][]> _bufferCD; private Plane _statusPlane; private Display _display; private int _second = 2; private int _collisions = 0; /** * Constructor that accepts the the bufferCD summary data * @param bufferCD * @param display * @param console */ public ProcessC(DoubleBuffer<Object[][]> bufferCD, Display display, Console console) { super(console); _bufferCD = bufferCD; _display = display; _statusPlane = display.GetStatusPlane(); } /** * Starts the ProcessA thread. Runs until bufferCD is shutdown by ProcessB. * Each time a value is pulled, updates the state of the composite view * and notes whether a collision occurred. */ @Override public void run() { ConsoleWriteLine("PROCESS C STARTED\r\n"); Object[][] state; while (!_bufferCD.isShutdown()) { state = _bufferCD.pull(); System.out.println("C pulled: " + state.length); ConsoleWriteLine("SECOND " + _second); OutputState(state); ShowState(state); _second++; } String finMsg = "DONE. " + _collisions + " collisions occurred over " + _display.Seconds + " seconds."; _display.UpdateStatus(finMsg); ConsoleWriteLine(finMsg); System.out.println("BufferCD completed"); ConsoleWait(); } /** * Accepts the summary array and writes the data to the console. * @param state */ private void OutputState(Object[][] state) { for (int plane = 0; plane < state.length; plane++) { ConsoleWriteLine(state[plane][0] + " | " + state[plane][1] + " | " + state[plane][2]); } ConsoleWriteLine(); try { _display.Refresh(); } catch (IOException e) { e.printStackTrace(); } } /** * Accepts the summary array and determines if a collision occurred. * If so, displays a red marker in the composite grid view and plays a short beep. * All information is written to the tonsole. * @param state */ private void ShowState(Object[][] state) { _statusPlane.ResetDisplay(); boolean noCollision = true; _display.UpdateStatus("Process C Second " + _second); for (int plane = 0; plane < state.length; plane++) { String marker = (String)state[plane][0]; int row = (int)state[plane][1]; int col = (int)state[plane][2]; String currentMarker = _statusPlane.GetMarker(row, col) + marker; //if marker is longer than 1 character, then two or more trains //are in one xy position. boolean collision = currentMarker.length() > 1; _statusPlane.ShowMarker(row, col, collision, currentMarker); //if collision occured, play a sound and note the collision time/position/trains //in the log as directed by the assignment. if (collision) { try { //sound class not written by team //pulled from from https://stackoverflow.com/a/6700039 SoundUtils.tone(400,50, 0.2); } catch (LineUnavailableException e) { e.printStackTrace(); } _display.UpdateStatus(", COLLISION " + currentMarker, true); ConsoleWriteLine("**** COLLISION between " + currentMarker.substring(0,1) + " and " + currentMarker.substring(1) + " ****" + "\nDetected at second " + _second + "\nOccurred at second " + (_second - 1) + ")" + "\nLocation (" + row + ", " + col + ")\r\n"); _collisions++; noCollision = false; } } if (noCollision) ConsoleWriteLine("No collision at second " + _second + "\r\n"); try { _display.Refresh(); } catch (IOException e) { e.printStackTrace(); } } }
5d5de52898aff49f9d7f8f0c3eaad8935b77f1f8
805526f6ebe9aea73b9b989f92cbd707a2dbfdd7
/Logger/app/src/androidTest/java/com/logger/DeviceInfoTest.java
f4363a3b8904477a84998a7410cd813bbb9ef853
[]
no_license
atuljava74/logger
7c91b67d832230ce2c0a33ec1642553df9d344dd
d896d6b907a4bcc7b0f2684c425719c889211eec
refs/heads/master
2020-09-13T06:13:41.107179
2019-11-19T11:19:42
2019-11-19T11:19:42
222,677,721
0
0
null
null
null
null
UTF-8
Java
false
false
1,138
java
package com.logger; import android.content.Context; import androidx.test.InstrumentationRegistry; import androidx.test.runner.AndroidJUnit4; import com.logger.device.DeviceInfo; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @RunWith(AndroidJUnit4.class) public class DeviceInfoTest { private Context appContext; private DeviceInfo deviceInfo; @Before public void init() throws Exception { appContext = InstrumentationRegistry.getTargetContext(); deviceInfo = new DeviceInfo(appContext); } @Test public void shouldLoadAllTheDeviceParameters() { assertNotNull("Device OS Version", deviceInfo.getOsVersion()); assertNotNull("Device Brand", deviceInfo.getDeviceBrand()); assertNotNull("Device Manufacturer", deviceInfo.getDeviceManufacturer()); assertNotNull("Device Model", deviceInfo.getDeviceModel()); assertNotNull("AppName", deviceInfo.getAppName()); assertNotNull("ApiLevel", deviceInfo.getApiLevel()); } }
5b6e121faf4de10f9c6d9dfcebe192459e687194
2993ae3ec5ab482a7eadc4eba81c577d44c92df6
/src/test/java/testLogin/CaseStudies.java
736e72a63ed0d3c9abe59eb133d35243d6dae4db
[]
no_license
lavishkhetan/TestCode
e971a4731cef2486c24eb759bbb46f160c2ce60a
8afadf400f5d0894c48843c56b5a4575ebab683a
refs/heads/master
2021-01-10T09:14:05.208947
2015-12-30T12:43:45
2015-12-30T12:43:45
48,800,102
0
0
null
null
null
null
UTF-8
Java
false
false
4,410
java
package testLogin; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; import org.testng.Assert; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import jxl.Sheet; import jxl.Workbook; import jxl.read.biff.BiffException; public class CaseStudies { public WebDriver driver; public WebDriverWait wait; String appURL = "http://ishirqa.com/"; String Actualtext; //Locators private By byName = By.xpath("//form[@id='applyForm']//input[@name='applyname']"); private By byEmail = By.xpath(" //form[@id='applyForm']//input[@name='applyemail']"); private By byPhoneNo = By.xpath("//form[@id='applyForm']//input[@name='applyphone']"); private By byZipCode = By.xpath("//form[@id='applyForm']//input[@name='applyzcode']"); private By byBusiness = By.xpath("//form[@id='applyForm']//input[@name='applybname']"); private By byNoOfEmp = By.xpath("///form[@id='applyForm']//input[@name='applyemp']"); private By byProdName = By.xpath("//form[@id='applyForm']//input[@name='applyproname']"); private By byWebsite = By.xpath("//form[@id='applyForm']//input[@name='website']"); private By byDescription = By.xpath("//form[@id='applyForm']/div[12]/textarea"); @BeforeClass public void testSetup() { driver=new FirefoxDriver(); driver.manage().window().maximize(); wait = new WebDriverWait(driver, 5); } @Test(priority = 1) public void caseStudies() throws InterruptedException{ driver.get("http://ishirqa.com/"); driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); JavascriptExecutor jse = (JavascriptExecutor)driver; jse.executeScript("window.scrollBy(0,2000)", ""); driver.findElement(By.id("learnmore")).click(); Thread.sleep(1000); driver.findElement(By.id("applynow")).click(); Thread.sleep(1000); } @Test(priority = 2, dataProvider="UserLogin") public void VerifyDataEntry(String userName, String emailAdd, String phoneNo, String zipCode, String businessName, String noOfEmp, String product, String websiteBlk, String describe) { driver.findElement(byName).sendKeys(userName); driver.findElement(byEmail).sendKeys(emailAdd); driver.findElement(byPhoneNo).sendKeys(phoneNo); driver.findElement(byZipCode).sendKeys(zipCode); driver.findElement(byBusiness).sendKeys(businessName); driver.findElement(byNoOfEmp).sendKeys(noOfEmp); driver.findElement(byProdName).sendKeys(product); driver.findElement(byWebsite).sendKeys(websiteBlk); driver.findElement(byDescription).sendKeys(describe); } @DataProvider(name="UserLogin") public Object[][] loginData() { Object[][] arrayObject = getExcelData("C:\\Users\\lkhetan\\workspace\\myMaven\\src\\test\\java\\testData\\DataFile.xls","Data"); return arrayObject; } public String[][] getExcelData(String DataFile, String Data) { String[][] arrayExcelData = null; try { FileInputStream fs = new FileInputStream(DataFile); Workbook wb = Workbook.getWorkbook(fs); Sheet sh = wb.getSheet(Data); int totalNoOfCols = sh.getColumns(); int totalNoOfRows = sh.getRows(); arrayExcelData = new String[totalNoOfRows-1][totalNoOfCols]; for (int i= 1 ; i < totalNoOfRows; i++) { for (int j=0; j < totalNoOfCols; j++) { arrayExcelData[i-1][j] = sh.getCell(j, i).getContents(); } } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); e.printStackTrace(); } catch (BiffException e) { e.printStackTrace(); } return arrayExcelData; } @Test(priority = 3) public void submitForm() throws InterruptedException{ driver.findElement(By.id("submitapplyForm")).click(); Thread.sleep(1000); Actualtext = driver.findElement(By.xpath("//section[@id='about']/div/div/div[1]/p")).getText(); Assert.assertEquals(Actualtext,"Our representative will contact you soon."); System.out.println("Assertion Working for Submit page"); } @AfterClass public void tearDown() { driver.quit(); } }
e4bf68c072464c9f3fab5fa714fa583478f4a8cf
941fd1799372aee3da2a01bd8021e4567f6dab77
/Chapter 7/P7.3/Bathroom.java
ee2dfa69c5be7296eb6b2ced9543380167f97aee
[]
no_license
joefedden/APCS
0a83933b03213353f9259e04d4c90612113d1865
410ace89ba25f7681d945e20eda78a887fe14609
refs/heads/master
2021-01-10T09:54:14.131939
2015-12-11T20:05:38
2015-12-11T20:05:38
46,313,429
0
0
null
null
null
null
UTF-8
Java
false
false
1,086
java
import java.util.Scanner; public class Bathroom { public static void main(String[] args) { Scanner soupy = new Scanner(System.in); System.out.println("Enter the # of stalls: "); int input = soupy.nextInt(); boolean occupied = false; int startPos = (int) Math.floor(Math.random() * input); int left = startPos; int right = input - startPos; int newPos = 0; String[] stalls = new String[input]; for (int i = 0; i < stalls.length; i++) { stalls[i] = "_"; } stalls[startPos] = "X"; for (String elements: stalls) { while(left > 0 && right < stalls.length) { if (left > right) { stalls[newPos] = "X"; newPos = left/2; left = newPos; } else { stalls[newPos] = "X"; newPos = right + (right/2); right = newPos; } } System.out.print(elements + " "); } } }
9dfcca7324531aff086af983dd0311875b9ce0ff
d57cfcc626a907b6f86aefca9648b55eb17c9015
/src/main/java/com/nowcoder/community/controller/AlphaController.java
6ff2edbcaa15821d9b8e8f2e7eeaa374686e8d84
[]
no_license
ZhangQian-doc/Discuss-Community
ff056b37d4a250c1c5c48158864c1f84a88c60f2
4150bea4fddf921b1da3bb30e25d7f4eb56a4cfd
refs/heads/master
2023-03-28T21:21:08.848209
2021-04-06T14:08:56
2021-04-06T14:08:56
355,198,238
0
0
null
null
null
null
UTF-8
Java
false
false
6,124
java
package com.nowcoder.community.controller; import com.nowcoder.community.service.AlphaService; import com.nowcoder.community.util.CommunityUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.*; import org.springframework.web.servlet.ModelAndView; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import java.io.IOException; import java.io.PrintWriter; import java.util.*; @Controller @RequestMapping("/alpha") public class AlphaController { @Autowired private AlphaService alphaService; @RequestMapping("/hello") @ResponseBody public String sayHello() { return "Hello Spring Boot."; } @RequestMapping("/data") @ResponseBody public String getData() { return alphaService.find(); } @RequestMapping("/http") public void http(HttpServletRequest request, HttpServletResponse response) { // 获取请求数据 System.out.println(request.getMethod()); System.out.println(request.getServletPath()); Enumeration<String> enumeration = request.getHeaderNames(); while (enumeration.hasMoreElements()) { String name = enumeration.nextElement(); String value = request.getHeader(name); System.out.println(name + ": " + value); } System.out.println(request.getParameter("code")); // 返回响应数据 response.setContentType("text/html;charset=utf-8"); try ( PrintWriter writer = response.getWriter(); ) { writer.write("<h1>牛客网</h1>"); } catch (IOException e) { e.printStackTrace(); } } // GET请求 // /students?current=1&limit=20 @RequestMapping(path = "/students", method = RequestMethod.GET) @ResponseBody public String getStudents( @RequestParam(name = "current", required = false, defaultValue = "1") int current, @RequestParam(name = "limit", required = false, defaultValue = "10") int limit) { System.out.println(current); System.out.println(limit); return "some students"; } // /student/123 @RequestMapping(path = "/student/{id}", method = RequestMethod.GET) @ResponseBody public String getStudent(@PathVariable("id") int id) { System.out.println(id); return "a student"; } // POST请求 @RequestMapping(path = "/student", method = RequestMethod.POST) @ResponseBody public String saveStudent(String name, int age) { System.out.println(name); System.out.println(age); return "success"; } // 响应HTML数据 @RequestMapping(path = "/teacher", method = RequestMethod.GET) public ModelAndView getTeacher() { ModelAndView mav = new ModelAndView(); mav.addObject("name", "张三"); mav.addObject("age", 30); mav.setViewName("/demo/view"); return mav; } @RequestMapping(path = "/school", method = RequestMethod.GET) public String getSchool(Model model) { model.addAttribute("name", "北京大学"); model.addAttribute("age", 80); return "/demo/view"; } // 响应JSON数据(异步请求) // Java对象 -> JSON字符串 -> JS对象 @RequestMapping(path = "/emp", method = RequestMethod.GET) @ResponseBody public Map<String, Object> getEmp() { Map<String, Object> emp = new HashMap<>(); emp.put("name", "张三"); emp.put("age", 23); emp.put("salary", 8000.00); return emp; } @RequestMapping(path = "/emps", method = RequestMethod.GET) @ResponseBody public List<Map<String, Object>> getEmps() { List<Map<String, Object>> list = new ArrayList<>(); Map<String, Object> emp = new HashMap<>(); emp.put("name", "张三"); emp.put("age", 23); emp.put("salary", 8000.00); list.add(emp); emp = new HashMap<>(); emp.put("name", "李四"); emp.put("age", 24); emp.put("salary", 9000.00); list.add(emp); emp = new HashMap<>(); emp.put("name", "王五"); emp.put("age", 25); emp.put("salary", 10000.00); list.add(emp); return list; } // cookie示例 @RequestMapping(path = "/cookie/set", method = RequestMethod.GET) @ResponseBody public String setCookie(HttpServletResponse response) { // 创建cookie Cookie cookie = new Cookie("code", CommunityUtil.generateUUID()); // 设置cookie生效的范围 cookie.setPath("/community/alpha"); // 设置cookie的生存时间 cookie.setMaxAge(60 * 10); // 发送cookie response.addCookie(cookie); return "set cookie"; } @RequestMapping(path = "/cookie/get", method = RequestMethod.GET) @ResponseBody public String getCookie(@CookieValue("code") String code) { System.out.println(code); return "get cookie"; } // session示例 @RequestMapping(path = "/session/set", method = RequestMethod.GET) @ResponseBody public String setSession(HttpSession session) { session.setAttribute("id", 1); session.setAttribute("name", "Test"); return "set session"; } @RequestMapping(path = "/session/get", method = RequestMethod.GET) @ResponseBody public String getSession(HttpSession session) { System.out.println(session.getAttribute("id")); System.out.println(session.getAttribute("name")); return "get session"; } // ajax示例 @RequestMapping(path = "/ajax", method = RequestMethod.POST) @ResponseBody public String testAjax(String name, int age) { System.out.println(name); System.out.println(age); return CommunityUtil.getJSONString(0, "操作成功!"); } }
f3cec7664c5794889a8a9967ef91b034472d9052
4c4f1e0eab5438dd16ff384662cc8df9216484c2
/Exercicio07/app/src/androidTest/java/br/pucminas/pablo/exercicio07/ExampleInstrumentedTest.java
c43855065a43c43f7971282279db7875aac8776f
[]
no_license
PabloSouzaNogueira/RepoAndroid
40b01c9300684e1bb327217379bf400e91666fb2
f6096a222fdb8e4ead5859d3c5d60942837ad511
refs/heads/master
2020-03-22T00:46:20.773828
2018-07-09T23:45:16
2018-07-09T23:45:16
139,264,548
0
1
null
null
null
null
UTF-8
Java
false
false
742
java
package br.pucminas.pablo.exercicio07; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("br.pucminas.pablo.exercicio07", appContext.getPackageName()); } }
207aeaf80a97ab67cddcd4e6d466e0b4423c4239
9f6ee2fdee0b29f317f767c73bb3a2a0a1bae9eb
/app/src/main/java/com/ballastlane/android/texasam/app/ui/main/ActivityMain.java
280090be3e19f6494f1232a46cf3e7e722ccde3d
[ "Apache-2.0" ]
permissive
Ballastlane-LLC/AndroidBaseLibrary
9fc7efb6aaffb59a3a13c5df554115a99a1b9849
7b45852160a7ef9c6ae04e7225cd14d5335b300a
refs/heads/master
2021-01-24T12:36:27.977769
2018-08-28T18:54:05
2018-08-28T18:54:05
123,138,312
0
0
null
null
null
null
UTF-8
Java
false
false
3,587
java
package com.ballastlane.android.texasam.app.ui.main; import android.arch.lifecycle.ViewModelProviders; import android.databinding.DataBindingUtil; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.design.widget.BottomNavigationView; import android.view.MenuItem; import com.ballastlane.android.baselibrary.common.base.BaseActivityInnerNavigation; import com.ballastlane.android.texasam.R; import com.ballastlane.android.texasam.app.ui.main.viewmodel.ViewModelActivityMain; import com.ballastlane.android.texasam.databinding.ActivityMainBinding; public class ActivityMain extends BaseActivityInnerNavigation { private ActivityMainBinding binding; private ViewModelActivityMain viewModel; public NavigationControllerActivityMain getNavigationControllerMain() { return (NavigationControllerActivityMain) super.getNavigationController(); } @Override protected void initVars() { setNavigationController(new NavigationControllerActivityMain(this)); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.viewModel = ViewModelProviders.of(this).get(ViewModelActivityMain.class); this.binding = DataBindingUtil.setContentView(this, R.layout.activity_main); } @Override protected void initViews() { initToolbar(); navigateToFirstFragment(); binding.bottombar.setSelectedItemId(R.id.menu_about); } @Override protected void initListeners() { binding.bottombar.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() { @Override public boolean onNavigationItemSelected(@NonNull MenuItem item) { switch (item.getItemId()) { case R.id.menu_about: navigateToFirstFragment(); return true; case R.id.menu_sessions: navigateToSecondFragment(); return true; case R.id.menu_payment: navigateToThirdFragment(); return true; case R.id.menu_account: navigateToFourthFragment(); return true; } return false; } }); } private void initToolbar() { setSupportActionBar(binding.includeToolbar.toolbar); getSupportActionBar().setTitle(getString(R.string.app_name)); } // private boolean areAllGranted(int[] grantResults) { // return grantResults.length > 1 && grantResults[0] == PackageManager.PERMISSION_GRANTED // && grantResults[1] == PackageManager.PERMISSION_GRANTED; // } // // public void showSnackbar(int stringResId) { // EventSnackbarMessage.Companion.getBuilder().withMessage(getString(stringResId)).build(); // EventBus.getDefault().post(EventSnackbarMessage.Companion.getBuilder().withMessage(getString(stringResId)).build()); // } private void navigateToFirstFragment() { getNavigationControllerMain().navigateToSection1(); } private void navigateToSecondFragment() { getNavigationControllerMain().navigateToSection2(); } private void navigateToThirdFragment() { getNavigationControllerMain().navigateToSection3(); } private void navigateToFourthFragment() { getNavigationControllerMain().navigateToSection4(); } }
b89b707964985b459e32e566a034d334a793220d
ed5159d056e98d6715357d0d14a9b3f20b764f89
/test/irvine/oeis/a199/A199210Test.java
4f2583f4729654f48102c5afc74e997c18649830
[]
no_license
flywind2/joeis
c5753169cf562939b04dd246f8a2958e97f74558
e5efd6971a0062ac99f4fae21a7c78c9f9e74fea
refs/heads/master
2020-09-13T18:34:35.080552
2019-11-19T05:40:55
2019-11-19T05:40:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
195
java
package irvine.oeis.a199; import irvine.oeis.AbstractSequenceTest; /** * Tests the corresponding class. * @author Sean A. Irvine */ public class A199210Test extends AbstractSequenceTest { }
52321fc62b6c279b966e1e2ee4463c443a8934f6
a885c9fff90c23b18e153e30bc0e2425029f8fb7
/MusicWeb/src/com/action/PageAction.java
f5793acd901eb5ef0e7529ddd90cb112de4ad100
[]
no_license
MannoLYX/OnLineMusic
659a783be929c3c6a29d5e8319f9f659b6e1c477
124112a96d598282efc769b78b52c0a994e77164
refs/heads/master
2021-01-10T16:17:13.542674
2015-10-30T03:47:00
2015-10-30T03:47:00
45,171,943
0
0
null
null
null
null
GB18030
Java
false
false
7,229
java
package com.action; import java.util.ArrayList; import java.util.List; import com.biz.CommentaryBiz; import com.biz.EmotionCategoryBiz; import com.biz.MemberUserBiz; import com.biz.MusicBiz; import com.biz.SingerBiz; import com.biz.StyleCategoryBiz; import com.biz.bizImpl.CommentaryBizImpl; import com.biz.bizImpl.EmotionCategoryBizImpl; import com.biz.bizImpl.MemberUserBizImpl; import com.biz.bizImpl.MusicBizImpl; import com.biz.bizImpl.SingerBizImpl; import com.biz.bizImpl.StyleCategoryBizImpl; import com.entity.CommentaryInfo; import com.entity.EmotionCategory; import com.entity.MemberUserRole; import com.entity.MusicInfo; import com.entity.Singer; import com.entity.StyleCategory; /** * * 2015-4-2上午8:54:37 * * MusicWeb.com.action.PageAction */ public class PageAction extends BaseAction { /** * */ private static final long serialVersionUID = 1L; /** * 总记录数 */ private int totalRecord; /** * 每页显示条数 */ private int limitPage = 5; /** * 当前页 */ private int nowPage = 1; /** * 总页数 */ private int totalPage; public int getTotalRecord() { return totalRecord; } public void setTotalRecord(int totalRecord) { this.totalRecord = totalRecord; } public int getLimitPage() { return limitPage; } public void setLimitPage(int limitPage) { this.limitPage = limitPage; } public int getNowPage() { return nowPage; } public void setNowPage(int nowPage) { this.nowPage = nowPage; } public int getTotalPage() { return totalPage; } public void setTotalPage(int totalPage) { this.totalPage = totalPage; } MemberUserBiz memberUserBiz = new MemberUserBizImpl(); /** * @return 获取某页用户信息的记录 */ public String queryMemberUserInfoByPage() { List<MemberUserRole> memberListByPage = new ArrayList<MemberUserRole>(); // 获取总记录数 totalRecord = memberUserBiz.counterByPage(); // 获取总页数 totalPage = (totalRecord + limitPage - 1) / limitPage; // 当前页处理 if (nowPage < 1) { nowPage = 1; } else if (nowPage >= totalPage) { nowPage = totalPage; } // 获得某页的记录 memberListByPage = memberUserBiz.queryMemberUserInfoByPage(nowPage, limitPage); app.setAttribute("memberListByPage", memberListByPage); int a = 0; req.setAttribute("a", a); return "queryMemberUserInfoByPage"; } MusicBiz musicBiz = new MusicBizImpl(); /** * @return 获取某页音乐的信息 */ public String queryMusicInfoByPage() { // 获取总记录数 totalRecord = musicBiz.counterByPage(); // 获取总页数 totalPage = (totalRecord + limitPage - 1) / limitPage; // 当前页处理 if (nowPage < 1) { nowPage = 1; } else if (nowPage >= totalPage) { nowPage = totalPage; } // 获得某页的记录 List<MusicInfo> MusicInfoPage = musicBiz.queryMusicInfoByPage(nowPage, limitPage); app.setAttribute("MusicInfoPage", MusicInfoPage); int a = 1; req.setAttribute("a", a); return "queryMusicInfoByPage"; } /** * @return 首页显示分页显示20首歌 */ public String queryNewMusicByNumberByPage() { // 获取总记录数 totalRecord = musicBiz.counterByPage(); if(totalRecord>20) { totalRecord = 20;// musicBiz.counterByPage(); } // 获取总页数 totalPage = (totalRecord + limitPage - 1) / limitPage; // 当前页处理 if (nowPage < 1) { nowPage = 1; } else if (nowPage >= totalPage) { nowPage = totalPage; } // 获得某页的记录 List<MusicInfo> allmusicListPage = musicBiz .queryNewMusicByNumberByPage(nowPage, limitPage); app.setAttribute("allmusicListPage", allmusicListPage); return "queryNewMusicByNumberByPage"; } SingerBiz singerBiz = new SingerBizImpl(); /** * @return 查询某页的歌手信息 */ public String querySingerInfoByPage() { // 获取总记录数 totalRecord = singerBiz.counterByPage(); // 获取总页数 totalPage = (totalRecord + limitPage - 1) / limitPage; // 当前页处理 if (nowPage < 1) { nowPage = 1; } else if (nowPage >= totalPage) { nowPage = totalPage; } // 获得某页的记录 List<Singer> SingerInfoPage = singerBiz.querySingerInfoByPage(nowPage, limitPage); app.setAttribute("SingerInfoPage", SingerInfoPage); int a = 2; req.setAttribute("a", a); return "querySingerInfoByPage"; } EmotionCategoryBiz emotionBiz = new EmotionCategoryBizImpl(); /** * @return 情感类型分类 */ public String queryEmotionCategoryInfoByPage() { // 获取总记录数 totalRecord = emotionBiz.counterByPage(); // 获取总页数 totalPage = (totalRecord + limitPage - 1) / limitPage; // 当前页处理 if (nowPage < 1) { nowPage = 1; } else if (nowPage >= totalPage) { nowPage = totalPage; } // 获得某页的记录 List<EmotionCategory> EmotionCategoryInfoPage = emotionBiz .queryEmotionCategoryInfoByPage(nowPage, limitPage); app.setAttribute("EmotionCategoryInfoPage", EmotionCategoryInfoPage); int a = 4; req.setAttribute("a", a); return "queryEmotionCategoryInfoByPage"; } StyleCategoryBiz styleBiz = new StyleCategoryBizImpl(); /** * @return 查询某页风格类型信息 */ public String queryStyleCategoryInfoByPage() { // 获取总记录数 totalRecord = styleBiz.counterByPage(); // 获取总页数 totalPage = (totalRecord + limitPage - 1) / limitPage; // 当前页处理 if (nowPage < 1) { nowPage = 1; } else if (nowPage >= totalPage) { nowPage = totalPage; } // 获得某页的记录 List<StyleCategory> StyleCategoryInfoPage = styleBiz .queryStyleCategoryInfoByPage(nowPage, limitPage); app.setAttribute("StyleCategoryInfoPage", StyleCategoryInfoPage); int a = 3; req.setAttribute("a", a); return "queryStyleCategoryInfoByPage"; } CommentaryBiz commBiz = new CommentaryBizImpl(); /** * @return 全部评论信息 */ public String queryAllCommentaryInfoByPage() { // 获取总记录数 totalRecord = commBiz.counterByPage(); // 获取总页数 totalPage = (totalRecord + limitPage - 1) / limitPage; // 当前页处理 if (nowPage < 1) { nowPage = 1; } else if (nowPage >= totalPage) { nowPage = totalPage; } // 获得某页的记录 List<CommentaryInfo> AllCommentaryInfoPage = commBiz .queryAllCommentaryInfoByPage(nowPage, limitPage); app.setAttribute("AllCommentaryInfoPage", AllCommentaryInfoPage); int a = 7; req.setAttribute("a", a); return "queryAllCommentaryInfoByPage"; } /** * @return 歌曲评论信息 */ public String queryMusicCommentaryInfoByPage() { // 获取总记录数 totalRecord = commBiz.counterByPage(); // 获取总页数 totalPage = (totalRecord + limitPage - 1) / limitPage; // 当前页处理 if (nowPage < 1) { nowPage = 1; } else if (nowPage >= totalPage) { nowPage = totalPage; } // 获得某页的记录 List<CommentaryInfo> MusicCommentaryInfoPage = commBiz .queryMusicCommentaryInfoByPage(nowPage, limitPage); app.setAttribute("MusicCommentaryInfoPage", MusicCommentaryInfoPage); int a = 5; req.setAttribute("a", a); return "queryMusicCommentaryInfoByPage"; } }
33edc91d647d365f39f4d06032100dd39d8ba3b1
ed5159d056e98d6715357d0d14a9b3f20b764f89
/src/irvine/oeis/a151/A151110.java
cc286e601a3d4a41f873a064773afa96ed16b432
[]
no_license
flywind2/joeis
c5753169cf562939b04dd246f8a2958e97f74558
e5efd6971a0062ac99f4fae21a7c78c9f9e74fea
refs/heads/master
2020-09-13T18:34:35.080552
2019-11-19T05:40:55
2019-11-19T05:40:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
587
java
package irvine.oeis.a151; // Generated by gen_seq4.pl walk23 3 5 1 222220010100111 at 2019-07-08 22:06 // DO NOT EDIT here! import irvine.oeis.WalkCubeSequence; /** * A151110 Number of walks within <code>N^3</code> (the first octant of <code>Z^3)</code> starting at <code>(0,0,0)</code> and consisting of n steps taken from <code>{(-1, -1, -1), (-1, -1, 0), (0, 1, 0), (1, 0, 0), (1, 1, 1)}</code>. * @author Georg Fischer */ public class A151110 extends WalkCubeSequence { /** Construct the sequence. */ public A151110() { super(0, 3, 5, "", 1, "222220010100111"); } }
00e3ef039c1471504d66cfb50f8b6be27ea219e5
0af8b92686a58eb0b64e319b22411432aca7a8f3
/single-large-project/src/test/java/org/gradle/test/performancenull_490/Testnull_48945.java
2188f8787972d37cf395c636b3a3c0e44fdd6f6e
[]
no_license
gradle/performance-comparisons
b0d38db37c326e0ce271abebdb3c91769b860799
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
refs/heads/master
2023-08-14T19:24:39.164276
2022-11-24T05:18:33
2022-11-24T05:18:33
80,121,268
17
15
null
2022-09-30T08:04:35
2017-01-26T14:25:33
null
UTF-8
Java
false
false
308
java
package org.gradle.test.performancenull_490; import static org.junit.Assert.*; public class Testnull_48945 { private final Productionnull_48945 production = new Productionnull_48945("value"); @org.junit.Test public void test() { assertEquals(production.getProperty(), "value"); } }
94209640a89ebee2dc7ab977f4802a8046cc91b4
383e161597e92efa1acfa5882a1f910f5f9ef553
/mesh-agent/src/main/java/com/alibaba/dubbo/performance/demo/agent/HelloController.java
18af18018ee7f759ae1c6a4e4ed53efc9fb9e617
[]
no_license
yinchengjian/Dubbo-Mesh
6428aed8f08734a20dbddde47ae2fb788647a801
dc5033dd72c1cf2a5354c93dc54fb630d1134267
refs/heads/master
2022-11-07T04:44:50.006977
2019-10-13T13:19:13
2019-10-13T13:19:13
202,560,905
4
1
null
2022-10-04T23:55:30
2019-08-15T14:56:29
Java
UTF-8
Java
false
false
4,486
java
//package com.alibaba.dubbo.performance.demo.agent; // //import com.alibaba.dubbo.performance.demo.agent.dubbo.RpcClient; //import com.alibaba.dubbo.performance.demo.agent.loadbalance.LoadBalance; //import com.alibaba.dubbo.performance.demo.agent.loadbalance.PriorityLoadBalance; //import com.alibaba.dubbo.performance.demo.agent.registry.Endpoint; //import com.alibaba.dubbo.performance.demo.agent.registry.EtcdRegistry; //import com.alibaba.dubbo.performance.demo.agent.registry.IRegistry; //import org.asynchttpclient.*; //import org.slf4j.Logger; //import org.slf4j.LoggerFactory; //import org.springframework.http.HttpStatus; //import org.springframework.http.ResponseEntity; //import org.springframework.web.bind.annotation.RequestMapping; //import org.springframework.web.bind.annotation.RequestParam; //import org.springframework.web.bind.annotation.RestController; //import org.springframework.web.context.request.async.DeferredResult; // //import java.util.List; // //@RestController //public class HelloController { // // private final Logger logger = LoggerFactory.getLogger(HelloController.class); // // private final IRegistry registry = new EtcdRegistry(System.getProperty("etcd.url")); // // private final RpcClient rpcClient = new RpcClient(registry); // private List<Endpoint> endpoints = null; // private final LoadBalance loadBalance = new PriorityLoadBalance(); // private final Object lock = new Object(); // private final AsyncHttpClient asyncHttpClient = Dsl.asyncHttpClient(); // int count = 0; // // // @RequestMapping(value = "") // public Object invoke(@RequestParam("interface") final String interfaceName, // @RequestParam("method") final String method, // @RequestParam("parameterTypesString") final String parameterTypesString, // @RequestParam("parameter") final String parameter) throws Exception { // final String type = System.getProperty("type"); // 获取type参数 // if ("consumer".equals(type)) { // return consumer(interfaceName, method, parameterTypesString, parameter); // } else if ("provider".equals(type)) { // return provider(interfaceName, method, parameterTypesString, parameter); // } else { // return "Environment variable type is needed to set to provider or consumer."; // } // } // // public byte[] provider(final String interfaceName, final String method, final String parameterTypesString, final String parameter) throws Exception { // // final Object result = rpcClient.invoke(interfaceName, method, parameterTypesString, parameter); // logger.info("provider:{}", System.getProperty("System.weight")); // logger.info("count:{}", count++); // return (byte[]) result; // } // // public DeferredResult<ResponseEntity> consumer(final String interfaceName, final String method, final String parameterTypesString, final String parameter) throws Exception { // // if (null == endpoints) { // synchronized (lock) { // if (null == endpoints) { // endpoints = registry.find("com.alibaba.dubbo.performance.demo.provider.IHelloService"); // loadBalance.initEndpoints(endpoints); // } // } // } // // // 简单的负载均衡,随机取一个 // final Endpoint endpoint = loadBalance.select(); // // final String url = "http://" + endpoint.getHost() + ":" + endpoint.getPort(); // // final Request request = Dsl.post(url).addFormParam("interface", interfaceName) // .addFormParam("method", method) // .addFormParam("parameterTypesString", parameterTypesString) // .addFormParam("parameter", parameter) // .build(); // // final DeferredResult<ResponseEntity> result = new DeferredResult(); // final ListenableFuture<Response> responseFuture = this.asyncHttpClient.executeRequest(request); // final Runnable callBack = () -> { // try { // final String value = responseFuture.get().getResponseBody().trim(); // result.setResult(new ResponseEntity(value, HttpStatus.OK)); // } catch (final Exception e) { // e.printStackTrace(); // } // }; // responseFuture.addListener(callBack, null); // return result; // // } //}
a8b475ec511aeb8086eaf15664191d73cd84b158
59ba6164c62cebd3c08b4a478d74a5442167ced1
/kafkaconnect/src/test/java/com/kafka/kafkaconnect/AppTest.java
78fef555d4609cac183f8cd45727783db29bbc81
[]
no_license
srinathalla/java
f699ea31b0ae1154fee216e073b8e8057f7da6e5
6a2219ce4ffeba586d2de500883c0b380abf2366
refs/heads/master
2022-06-12T16:04:12.726546
2020-12-23T10:21:59
2020-12-23T10:21:59
83,962,186
0
0
null
2022-05-20T21:01:44
2017-03-05T10:33:01
Java
UTF-8
Java
false
false
650
java
package com.kafka.kafkaconnect; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Unit test for simple App. */ public class AppTest extends TestCase { /** * Create the test case * * @param testName name of the test case */ public AppTest( String testName ) { super( testName ); } /** * @return the suite of tests being tested */ public static Test suite() { return new TestSuite( AppTest.class ); } /** * Rigourous Test :-) */ public void testApp() { assertTrue( true ); } }
8e83f61d7c3f2d661304f80d6366814d503b447e
4b4e0425eef8e4c478e7f3804075320e3b6068f6
/app/src/main/java/neha/example/com/campusmap/TouchListener.java
617543c7eacdc6f5fea71e28acaea647488b2aa7
[]
no_license
nehaparmarcs/Campusmap
4020338653723a504b982e5ea6fe53f2cd14e0d8
14c243488c2f4df53c92df084a39f873e14e54e9
refs/heads/master
2020-06-20T16:04:47.265448
2016-11-26T22:31:36
2016-11-26T22:31:36
74,854,104
1
0
null
null
null
null
UTF-8
Java
false
false
183
java
package neha.example.com.campusmap; /** * Created by np6023 on 10/29/16. */ public interface TouchListener { void onTouchHappened(int childId, int action, float x, float y); }
efabc8ef499f744a41233596cbafb0625925ee60
96b7ab364dcaa06a6d7c4cc7029d3992c6650bf6
/magazin/src/main/java/Angajat.java
6ad8622dfeb4afbcb484464fa2dd5838426a57e6
[]
no_license
awen10/Inf-apl
a56a3b77edf0a5430415967a355a8657b57af449
0c7b5bac085e67bb0ea455fc59d6a50059274d44
refs/heads/master
2021-04-04T10:01:58.749874
2020-05-19T10:13:47
2020-05-19T10:13:47
248,447,033
0
0
null
null
null
null
UTF-8
Java
false
false
1,277
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. */ /** * * @author adria */ public class Angajat { private final String nume; private final boolean tip;//false=vanzator ; true=administrator; private final Stoc stoc; public Angajat(String nume, boolean tip, Stoc stoc) { this.nume = nume; this.tip = tip; this.stoc = stoc; } public void AdaugareInStoc(String nume, int cantitate) { if (this.tip == false) { System.out.print("Nu este Administrator"); } else { stoc.AdaugareCantitate(nume, cantitate); } } public void AdaugareProdus(String nume, float pret, int cantitate) { if (this.tip == false) { System.out.print("Nu este Administrator"); } else { stoc.AdaugareProdus(nume, pret, cantitate); } } public void Vanzare(String nume, int cantitate) { if (tip == true) { System.out.print("Nu este Vanzator"); } else { stoc.ScadereCantitate(nume, cantitate); } } public String GetNume() { return this.nume; } }
2ecdfcc9f2dd080e9f38a69d07a50287aa8dacd3
df3d1a08df815aa5dbdc2661f5932a3fc63f14df
/Johdatus ohjelmointiin/Exercises05/E09/E09.java
3fc81582a3ae09de3ce54be568e3b415c01632d7
[]
no_license
mustasaari/School-Works
aac9fb9c9b3cc1e720474b464e4998d63a5d1828
bd199206fb80b60fdb5f6bd7c2620f2e6c1a5b5d
refs/heads/master
2020-04-19T09:21:01.974818
2019-01-29T07:28:04
2019-01-29T07:28:04
168,107,653
0
0
null
null
null
null
UTF-8
Java
false
false
377
java
import java.util.*; class E09 { public static void main(String [] args) { Scanner syote = new Scanner(System.in); System.out.println (metodi ('X',7)); } public static String metodi(char merkki, int luku) { String palaute =""; for (int i = 0; i < luku; i++) { palaute += merkki; } return palaute; } }
e4bf0931b461ed0215f178fe141e79ec749f7631
1657ce44a741738712ca92352d23fe004e56c263
/spring-boot-beatlsql/src/test/java/com/yi/beatlsql/SpringBootBeatlsqlApplicationTests.java
d838fd0e955477b8a1e43a111770324d4ce62801
[ "Apache-2.0" ]
permissive
zms1207/spring-boot-2.x-examples
f5bf68a2819bf10706ebcd081e001d78119d1bea
43c9a925a2fb986efe8b220671e4eb4573367c15
refs/heads/master
2020-05-04T06:26:01.109606
2019-04-02T02:39:18
2019-04-02T02:39:18
179,005,806
1
0
Apache-2.0
2019-04-02T05:34:01
2019-04-02T05:33:58
null
UTF-8
Java
false
false
353
java
package com.yi.beatlsql; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class SpringBootBeatlsqlApplicationTests { @Test public void contextLoads() { } }
efd53a0a2ecce5544b58d898490d7759776f0da7
486c615ccf948e7d7e7e5655a9a53e2f818c4f50
/src/test/java/com/mulanfan/shopasa/web/rest/util/PaginationUtilUnitTest.java
18bc4c2562b93d760f415544fcebb46463e06184
[]
no_license
systembugtj/mulanfan
08d75d582cdede067bf94c0891b55bf29e6183f7
874b7ffa4621594f581e64945154d738d6645eab
refs/heads/master
2020-03-08T17:03:53.454817
2018-04-05T20:10:45
2018-04-05T20:10:45
128,258,771
0
0
null
null
null
null
UTF-8
Java
false
false
8,029
java
package com.mulanfan.shopasa.web.rest.util; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import java.util.ArrayList; import java.util.List; import org.junit.Test; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.PageRequest; import org.springframework.http.HttpHeaders; /** * Tests based on parsing algorithm in app/components/util/pagination-util.service.js * * @see PaginationUtil */ public class PaginationUtilUnitTest { @Test public void generatePaginationHttpHeadersTest() { String baseUrl = "/api/_search/example"; List<String> content = new ArrayList<>(); Page<String> page = new PageImpl<>(content, new PageRequest(6, 50), 400L); HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, baseUrl); List<String> strHeaders = headers.get(HttpHeaders.LINK); assertNotNull(strHeaders); assertTrue(strHeaders.size() == 1); String headerData = strHeaders.get(0); assertTrue(headerData.split(",").length == 4); String expectedData = "</api/_search/example?page=7&size=50>; rel=\"next\"," + "</api/_search/example?page=5&size=50>; rel=\"prev\"," + "</api/_search/example?page=7&size=50>; rel=\"last\"," + "</api/_search/example?page=0&size=50>; rel=\"first\""; assertEquals(expectedData, headerData); List<String> xTotalCountHeaders = headers.get("X-Total-Count"); assertTrue(xTotalCountHeaders.size() == 1); assertTrue(Long.valueOf(xTotalCountHeaders.get(0)).equals(400L)); } @Test public void commaTest() { String baseUrl = "/api/_search/example"; List<String> content = new ArrayList<>(); Page<String> page = new PageImpl<>(content); String query = "Test1, test2"; HttpHeaders headers = PaginationUtil.generateSearchPaginationHttpHeaders(query, page, baseUrl); List<String> strHeaders = headers.get(HttpHeaders.LINK); assertNotNull(strHeaders); assertTrue(strHeaders.size() == 1); String headerData = strHeaders.get(0); assertTrue(headerData.split(",").length == 2); String expectedData = "</api/_search/example?page=0&size=0&query=Test1%2C+test2>; rel=\"last\"," + "</api/_search/example?page=0&size=0&query=Test1%2C+test2>; rel=\"first\""; assertEquals(expectedData, headerData); List<String> xTotalCountHeaders = headers.get("X-Total-Count"); assertTrue(xTotalCountHeaders.size() == 1); assertTrue(Long.valueOf(xTotalCountHeaders.get(0)).equals(0L)); } @Test public void multiplePagesTest() { String baseUrl = "/api/_search/example"; List<String> content = new ArrayList<>(); // Page 0 Page<String> page = new PageImpl<>(content, new PageRequest(0, 50),400L); String query = "Test1, test2"; HttpHeaders headers = PaginationUtil.generateSearchPaginationHttpHeaders(query, page, baseUrl); List<String> strHeaders = headers.get(HttpHeaders.LINK); assertNotNull(strHeaders); assertTrue(strHeaders.size() == 1); String headerData = strHeaders.get(0); assertTrue(headerData.split(",").length == 3); String expectedData = "</api/_search/example?page=1&size=50&query=Test1%2C+test2>; rel=\"next\"," + "</api/_search/example?page=7&size=50&query=Test1%2C+test2>; rel=\"last\"," + "</api/_search/example?page=0&size=50&query=Test1%2C+test2>; rel=\"first\""; assertEquals(expectedData, headerData); List<String> xTotalCountHeaders = headers.get("X-Total-Count"); assertTrue(xTotalCountHeaders.size() == 1); assertTrue(Long.valueOf(xTotalCountHeaders.get(0)).equals(400L)); // Page 1 page = new PageImpl<>(content,new PageRequest(1, 50),400L); query = "Test1, test2"; headers = PaginationUtil.generateSearchPaginationHttpHeaders(query, page, baseUrl); strHeaders = headers.get(HttpHeaders.LINK); assertNotNull(strHeaders); assertTrue(strHeaders.size() == 1); headerData = strHeaders.get(0); assertTrue(headerData.split(",").length == 4); expectedData = "</api/_search/example?page=2&size=50&query=Test1%2C+test2>; rel=\"next\"," + "</api/_search/example?page=0&size=50&query=Test1%2C+test2>; rel=\"prev\"," + "</api/_search/example?page=7&size=50&query=Test1%2C+test2>; rel=\"last\"," + "</api/_search/example?page=0&size=50&query=Test1%2C+test2>; rel=\"first\""; assertEquals(expectedData, headerData); xTotalCountHeaders = headers.get("X-Total-Count"); assertTrue(xTotalCountHeaders.size() == 1); assertTrue(Long.valueOf(xTotalCountHeaders.get(0)).equals(400L)); // Page 6 page = new PageImpl<>(content,new PageRequest(6, 50), 400L); headers = PaginationUtil.generateSearchPaginationHttpHeaders(query, page, baseUrl); strHeaders = headers.get(HttpHeaders.LINK); assertNotNull(strHeaders); assertTrue(strHeaders.size() == 1); headerData = strHeaders.get(0); assertTrue(headerData.split(",").length == 4); expectedData = "</api/_search/example?page=7&size=50&query=Test1%2C+test2>; rel=\"next\"," + "</api/_search/example?page=5&size=50&query=Test1%2C+test2>; rel=\"prev\"," + "</api/_search/example?page=7&size=50&query=Test1%2C+test2>; rel=\"last\"," + "</api/_search/example?page=0&size=50&query=Test1%2C+test2>; rel=\"first\""; assertEquals(expectedData, headerData); xTotalCountHeaders = headers.get("X-Total-Count"); assertTrue(xTotalCountHeaders.size() == 1); assertTrue(Long.valueOf(xTotalCountHeaders.get(0)).equals(400L)); // Page 7 page = new PageImpl<>(content,new PageRequest(7, 50),400L); headers = PaginationUtil.generateSearchPaginationHttpHeaders(query, page, baseUrl); strHeaders = headers.get(HttpHeaders.LINK); assertNotNull(strHeaders); assertTrue(strHeaders.size() == 1); headerData = strHeaders.get(0); assertTrue(headerData.split(",").length == 3); expectedData = "</api/_search/example?page=6&size=50&query=Test1%2C+test2>; rel=\"prev\"," + "</api/_search/example?page=7&size=50&query=Test1%2C+test2>; rel=\"last\"," + "</api/_search/example?page=0&size=50&query=Test1%2C+test2>; rel=\"first\""; assertEquals(expectedData, headerData); } @Test public void greaterSemicolonTest() { String baseUrl = "/api/_search/example"; List<String> content = new ArrayList<>(); Page<String> page = new PageImpl<>(content); String query = "Test>;test"; HttpHeaders headers = PaginationUtil.generateSearchPaginationHttpHeaders(query, page, baseUrl); List<String> strHeaders = headers.get(HttpHeaders.LINK); assertNotNull(strHeaders); assertTrue(strHeaders.size() == 1); String headerData = strHeaders.get(0); assertTrue(headerData.split(",").length == 2); String[] linksData = headerData.split(","); assertTrue(linksData.length == 2); assertTrue(linksData[0].split(">;").length == 2); assertTrue(linksData[1].split(">;").length == 2); String expectedData = "</api/_search/example?page=0&size=0&query=Test%3E%3Btest>; rel=\"last\"," + "</api/_search/example?page=0&size=0&query=Test%3E%3Btest>; rel=\"first\""; assertEquals(expectedData, headerData); List<String> xTotalCountHeaders = headers.get("X-Total-Count"); assertTrue(xTotalCountHeaders.size() == 1); assertTrue(Long.valueOf(xTotalCountHeaders.get(0)).equals(0L)); } }
ab1830c3d8132d4084dbf562a36f13cd978ecd39
beb9d55e73ac18c0fd3e5f42c5fec9dbbd216a14
/src/Main.java
0ee2981ed6e7487c4a7fb26b5a8e726ff77991f4
[]
no_license
dda410/algorithmEngineering
6e044a03b0a5454be4aec1ae86b72366903dc8d4
15b4ad89695871559f4c3588ca44fd3bfef322d5
refs/heads/master
2021-03-22T04:52:01.188118
2017-10-02T18:52:56
2017-10-02T18:52:56
75,117,757
0
0
null
null
null
null
UTF-8
Java
false
false
5,468
java
import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; import java.util.ArrayList; import java.util.Collections; public class Main { private static void parseArguments(String[] args) { if (args.length != 1) { System.out.println("Usage: Main <Input_file>"); System.exit(1); } } public static int getNumberOfCompounds(int comp1, int comp2, int numberOfCompounds) { int max = (comp1 < comp2) ? comp2 : comp1; return (numberOfCompounds < max) ? max : numberOfCompounds; } /* The matrix is built from the parsed input. */ public static AdjacencyMatrix buildAdjacencyMatrix(ArrayList<String []> input, int numberOfCompounds) { AdjacencyMatrix matrix = new AdjacencyMatrix(numberOfCompounds + 1); for (String [] items : input) { int row = Integer.parseInt(items [1].substring(1)); int col = Integer.parseInt(items [2].substring(1)); int cost = Integer.parseInt(items [3]); /* If a machine performs the same transformation of another * it is added only if it is cheaper than the current one. */ if (cost < matrix.getElement(row, col).getCost() ) { matrix.setElement(row, col, new MachineObject(items [0], cost, row, col)); } } return matrix; } /* Recursive function acting greedy to calculate all the possible Hamiltonian circuits and finding the cheapest once. */ public static ArrayList<MachineObject> getCheapestMachines(AdjacencyMatrix matrix, ArrayList<MachineObject> cheapestMachines, int numberOfCompounds, int row, int startingRow, int recursionDepth, ArrayList<Integer> visitedRows) { // Exit condition: an Hamiltonian circuit has been found. if (recursionDepth == numberOfCompounds) { for (int i = 0; i < numberOfCompounds; i++) { if (matrix.getElement(row, i).getCol() == startingRow && matrix.getElement(row, i).getName() != null) { cheapestMachines.add(matrix.getElement(row, i)); return cheapestMachines; } } return cheapestMachines; } /* If the recursion sub-tree of the current node has not yield to a result it is * calculated the subtree of the cheapest next link (machine).*/ for (int i = 0; i < numberOfCompounds + 1; i++) { MachineObject element = matrix.getElement(row, i); if (element.getName() == null) { return cheapestMachines; } if (! visitedRows.contains(element.getCol())) { visitedRows.add(row); cheapestMachines.add(element); cheapestMachines = getCheapestMachines(matrix, cheapestMachines, numberOfCompounds, element.getCol(), startingRow, ++recursionDepth, visitedRows); if (cheapestMachines.size() == (numberOfCompounds + 1) ) { break; } visitedRows.remove(visitedRows.size() - 1); cheapestMachines.remove(cheapestMachines.size() - 1); --recursionDepth; } } return cheapestMachines; } /* This function gets the shortest Hamiltonian circuit containing all the compounds: * equivalent to say the less expensive set of machines that can transform each given compound to another. */ public static ArrayList<MachineObject> getCheapestMachines(int numberOfCompounds, AdjacencyMatrix matrix) { ArrayList<MachineObject> cheapestMachines = new ArrayList<MachineObject> (); ArrayList<Integer> visitedNodes = new ArrayList<Integer> (); for (int i = 0; i < numberOfCompounds + 1; i++) { cheapestMachines = getCheapestMachines(matrix, cheapestMachines, numberOfCompounds, i, i, 0, visitedNodes); if (cheapestMachines.size() == numberOfCompounds + 1) { break; } } return cheapestMachines; } public static void printResult(ArrayList<MachineObject> result) { MachineObject element; int totalPrice = 0; ArrayList<Integer> machineNumbers = new ArrayList<Integer> (); // The total cost of the machines is calculated plus the machines numbers are extracted. for (int i = 0; i < result.size(); i++) { element = result.get(i); totalPrice += element.getCost(); machineNumbers.add(Integer.parseInt(element.getName().substring(1))); } System.out.println(totalPrice); Collections.sort(machineNumbers); for (int number : machineNumbers) { System.out.print(number + " "); } System.out.println(); } public static void main(String[] args) { parseArguments(args); Scanner in = null; ArrayList<String []> inputLines = new ArrayList<String []>(); int numberOfCompounds = 0; // The total number of compounds is needed to build the adjacency matrix. try { in = new Scanner(new File(args[0])); } catch (FileNotFoundException e) { System.out.println(e.getMessage()); } // Parsing the input inside the loop. while (in.hasNextLine()) { Scanner line = new Scanner(in.nextLine()); // The 4 elements composing an input line are parsed. String [] items = new String [4]; for (int i = 0; i < 4; i++) { items [i] = line.next(); } numberOfCompounds = getNumberOfCompounds(Integer.parseInt(items [1].substring(1)), Integer.parseInt(items [2].substring(1)), numberOfCompounds); // The ordered collections of the parsed input is stored in the inputLines variable. inputLines.add(items); } AdjacencyMatrix matrix = buildAdjacencyMatrix(inputLines, numberOfCompounds); matrix.orderMatrix(); ArrayList<MachineObject> result = getCheapestMachines(numberOfCompounds, matrix); if (result.size() < numberOfCompounds + 1) { System.out.println("No Hamiltonian circuit exist hence there is no possible result."); System.exit(1); } printResult(result); } }
8a883cb8229de6ba2c170dcc26b7666db9095f19
8531741dd13c09d5c506677958d4d3f4fe7ab287
/app/src/main/java/com/cf/carrecorder/bean/request/SendCodeBean.java
2a54d623563549010f52a0aca4ee46c2d12c8f1b
[]
no_license
ChengPengGao/CarRecorder
086fb31e4377b29c3790ee446e7040046d39a588
8691e44b953570c6ca2f7b610ff5e5ca49cbcd94
refs/heads/master
2020-09-28T11:06:22.113044
2020-01-15T03:25:07
2020-01-15T03:25:07
226,765,386
1
0
null
null
null
null
UTF-8
Java
false
false
312
java
package com.cf.carrecorder.bean.request; /** * @author chenxihu * @date 2019-12-01 * @email [email protected] **/ public class SendCodeBean { private String phone; public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } }
a738bdce3575a91a1859fc18afac8567e48fb255
ad01ea7afd49cf0fc220c394912465158c97668a
/pax-web-itest/pax-web-itest-container/pax-web-itest-tomcat/src/test/java/org/ops4j/pax/web/itest/tomcat/whiteboard/WhiteboardTCCLWhiteboardConfigIntegrationTest.java
3c85243047dbe260c942d164dc33c06ca6c2f21e
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
ops4j/org.ops4j.pax.web
acea94859c2d6928a1cae8f1475f255cc71b9a3d
41eb5be2e83d235005825fdbca179a2c8438b019
refs/heads/main
2023-08-30T04:36:54.143805
2023-08-17T08:33:03
2023-08-17T08:34:28
918,574
106
185
NOASSERTION
2023-09-02T05:28:34
2010-09-17T14:52:23
Java
UTF-8
Java
false
false
1,395
java
/* * Copyright 2020 OPS4J. * * 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.ops4j.pax.web.itest.tomcat.whiteboard; import org.junit.runner.RunWith; import org.ops4j.pax.exam.Configuration; import org.ops4j.pax.exam.Option; import org.ops4j.pax.exam.junit.PaxExam; import org.ops4j.pax.web.itest.container.whiteboard.AbstractWhiteboardTCCLConfigIntegrationTest; import static org.ops4j.pax.exam.OptionUtils.combine; @RunWith(PaxExam.class) public class WhiteboardTCCLWhiteboardConfigIntegrationTest extends AbstractWhiteboardTCCLConfigIntegrationTest { @Configuration public Option[] configure() { Option[] serverOptions = combine(baseConfigure(), paxWebTomcat()); Option[] cmOptions = combine(serverOptions, configAdmin()); return combine(cmOptions, paxWebExtenderWhiteboard()); } @Override protected String getTCCLType() { return "whiteboard"; } }
13b634e7f04b3f0e6d4ccf75c953cfbab85a22a8
d78ba1fad3a6a8edd8dbe5eb38c5dcbd399773b2
/PrincessPeach/src/princesspeach/PrincessPeach.java
5d0aab96e2eb79c481ea6ba1767916e5cfbb4fc6
[]
no_license
actuallyentropy/openKattis
fce82a90faef3f4984182959b7025373e161956d
87d132cc877636d8a0047ba85babd889ccf5b087
refs/heads/master
2023-06-22T20:33:57.760236
2019-04-09T19:02:34
2019-04-09T19:02:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
771
java
package princesspeach; import java.util.Scanner; public class PrincessPeach { public static void main(String[] args) { Scanner input = new Scanner(System.in); int numObstacles = input.nextInt(); boolean[] obstacles = new boolean[numObstacles]; int numCases = input.nextInt(); for(int i = 0; i < numCases; i++) { int curr = input.nextInt(); obstacles[curr] = true; } int total = 0; for(int i = 0; i < numObstacles; i++) { if(!obstacles[i]) System.out.println(i); else total++; } System.out.println("Mario got " + total + " of the dangerous obstacles."); } }
47509c22c935ef1310bef664768c652829f997c0
4d74e2d0c7999c6878f39ed78f3b1a9ddb5de45a
/src/main/java/com/meteor/grant_disbursement/error/InvalidHouseholdException.java
1e40aed6fb05fa3242ba3118753c96799ae7005c
[]
no_license
jityong/grant-disbursement
05b6ee1c2e2e8bef27177f7ad4131ecafcdac96a
2190bb54e85c3674104775f9a3e1bc9268d304dc
refs/heads/master
2023-08-14T01:41:28.084885
2021-09-13T14:54:10
2021-09-13T14:54:10
405,291,196
0
0
null
null
null
null
UTF-8
Java
false
false
299
java
package com.meteor.grant_disbursement.error; import org.springframework.web.server.ResponseStatusException; public class InvalidHouseholdException extends RuntimeException { public String message; public InvalidHouseholdException(String message) { this.message = message; } }
f46a4191271c1dccc9cc3147677f834e1f76689c
eab084584e34ec065cd115139c346180e651c1c2
/src/main/java/v1/t600/T639.java
7fcc634e145ee226bd97216a8f56da7132bf93fb
[]
no_license
zhouyuan93/leetcode
5396bd3a01ed0f127553e1e175bb1f725d1c7919
cc247bc990ad4d5aa802fc7a18a38dd46ed40a7b
refs/heads/master
2023-05-11T19:11:09.322348
2023-05-05T09:12:53
2023-05-05T09:12:53
197,735,845
0
0
null
2020-04-05T09:17:34
2019-07-19T08:38:17
Java
UTF-8
Java
false
false
1,490
java
package v1.t600; public class T639 { public static final int MOD = 1000000007; public int numDecodings(String s) { if (s.charAt(0) == '0') { return 0; } int p = 0; long x = 1; long y = 1; char c; char before = '-'; while (p < s.length()) { long res = 0; c = s.charAt(p++); if (c == '*') { res += (x * 9); if (before == '*') { res += y * 15; } else if (before == '1') { res += y * 9; } else if (before == '2') { res += y * 6; } } else if (c == '0') { if (before == '*') { res += y * 2; } else if (before == '1' || before == '2') { res += y; } else { return 0; } } else if (c > '0' && c <= '6') { res += x; if (before == '*') { res += y * 2; } else if (before == '1' || before == '2') { res += y; } } else { res += x; if (before == '1' || before == '*') { res += y; } } before = c; y = x; x = res % MOD; } return (int) x; } }
2967c848676f232f3189336afe15dabbc0499702
7da722dca4cdd6b9da27205268641e7aef4e804c
/src/main/java/com/hejinyo/core/mapper/SysResourceMapper.java
3a04e02fca798588098b11053b87fe56aa01c382
[]
no_license
HejinYo/base
efec1cec7e8ebcf2ce6c36a8925db4d34451e6dd
577c4ab75eac93aa929bf73f5d5c9dd3c0e35fb0
refs/heads/master
2021-01-12T02:18:01.214075
2017-06-06T16:04:54
2017-06-06T16:04:54
78,495,836
0
0
null
null
null
null
UTF-8
Java
false
false
470
java
package com.hejinyo.core.mapper; import com.hejinyo.core.domain.dto.SysMenu; import org.springframework.stereotype.Repository; import java.util.List; /** * @author : HejinYo [email protected] * @date : 2017/4/22 14:08 * @Description : */ @Repository public interface SysResourceMapper extends BaseMapper { /** * 根据登录名查询可用菜单 * * @param loginName * @return */ List<SysMenu> getMenuList(String loginName); }
932f1a2d9a91dfdae5542cee466cf73e4289179b
017d4a1ebf7e0026f315e912248f89bcfe8ef619
/.svn/pristine/ff/ffa17d984b79ffe6d136d375021f7839004f449a.svn-base
b78dc93ef206157f1a67fabf652dd874387a2150
[]
no_license
QiangzhenZhu/cabinet
ed8ea40daa0bbb14f6268c6292c1eda6bf3eea6a
aa1484b879a709359080ef65ac52f80694de4247
refs/heads/master
2020-03-24T13:23:43.203738
2018-07-29T08:19:46
2018-07-29T08:19:46
142,743,099
0
0
null
null
null
null
UTF-8
Java
false
false
482
package com.hzdongcheng.bll.basic.dto; import com.hzdongcheng.bll.common.IRequest; public class InParamPTVerfiyUser implements IRequest { public String FunctionID = "330201"; // 功能编号 public String TerminalNo = ""; // 设备号 public String TradeWaterNo = ""; // 交易流水号 public String CustomerID = ""; // 取件人身份标识 public String OpenBoxKey = ""; // 开箱密码 public String CompanyID = ""; // 投递公司编号 public String Remark = ""; }
a094c0e5d0730b81c6529df72b1a70c6a251ba5e
aa7c705d042fd1260152300cfa7925374b30156c
/src/main/java/com/hanfak/greedydb/core/usecases/queries/employer/QueryEmployerStreamForGivenTimestampAndFieldUsecase.java
bf751068301672ff2664f1659ca872d995e013a3
[]
no_license
hanfak/greedy-db
4fc4a5a1fc157db6c57e0601c958bc3f8a1c645b
219840602d490ac6f30037d9fd3576e1278438df
refs/heads/master
2020-04-12T09:20:39.816255
2018-12-19T07:35:29
2018-12-19T07:35:29
162,399,681
0
0
null
null
null
null
UTF-8
Java
false
false
1,068
java
package com.hanfak.greedydb.core.usecases.queries.employer; import com.hanfak.greedydb.core.usecases.EmployerStreamRepository; import java.sql.Timestamp; // TODO make more abstract, factory for repository - switch/strategy, // repository implements interface for just findFieldForGivenTimestamp // webservice calls factory which passes the correct repository into the abstract usecase // Issue, factory will new up impl of outer layer breaking dependency inversion // Or pass the stream name, to be used in the repository impl sql to set the table name, public class QueryEmployerStreamForGivenTimestampAndFieldUsecase { private EmployerStreamRepository employerStreamRepository; public QueryEmployerStreamForGivenTimestampAndFieldUsecase(EmployerStreamRepository employerStreamRepository) { this.employerStreamRepository = employerStreamRepository; } public String queryEmployerStream(Timestamp timestamp, String jsonPath) { return String.valueOf(employerStreamRepository.findFieldForGivenTimestamp(timestamp, jsonPath)); } }
c2f5ec2c78883916f60b1ba2b062dcf27b341cf0
b59499d35c59da2989d50102b88b776d434244ad
/src/main/java/com/bectran/b2b/customer/beans/AppOfficerBean.java
e04fa74f143c466ced7282cc13665c9e6cd48f98
[]
no_license
user2892/Idp
f77fa7fd996f57d2936f78218c5abd77b346db2e
b8e1822f41a2722b45d4187c47ec3781d9dbb928
refs/heads/master
2020-05-18T16:36:27.402858
2019-05-03T00:47:23
2019-05-03T00:47:23
184,530,989
0
0
null
null
null
null
UTF-8
Java
false
false
172
java
package com.bectran.b2b.customer.beans; /** * @author LOUIS IFEGUNI */ public class AppOfficerBean extends ContactPersonBaseBean { public AppOfficerBean() { } }
b4955efdbf8ad9574dd49c0c7efe8b9d5d857cc4
ea48509d44177fa42f7b172a335d0bea0b454c96
/sourcejava/okhttp/okhttp-tests/src/test/java/com/squareup/okhttp/InterceptorTest.java
46778d3a84cbc1a22d11347142c4477fabec465e
[ "Apache-2.0" ]
permissive
touchlab-lab/DoppelPoc
b2850a7a057b0f2e5955303badf92dcaf4d671ba
0d13d71a20b64c6c371c1bf6fc43bd6a69e9ea53
refs/heads/master
2021-06-09T14:57:56.642071
2016-11-30T15:50:36
2016-11-30T15:50:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
14,954
java
/* * Copyright (C) 2014 Square, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.squareup.okhttp; import com.squareup.okhttp.mockwebserver.MockResponse; import com.squareup.okhttp.mockwebserver.RecordedRequest; import com.squareup.okhttp.mockwebserver.rule.MockWebServerRule; import java.io.IOException; import java.net.URL; import java.util.Arrays; import java.util.List; import java.util.Locale; import okio.Buffer; import okio.BufferedSink; import okio.ForwardingSink; import okio.ForwardingSource; import okio.GzipSink; import okio.Okio; import okio.Sink; import okio.Source; import org.junit.Rule; import org.junit.Test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertSame; import static org.junit.Assert.fail; public final class InterceptorTest { @Rule public MockWebServerRule server = new MockWebServerRule(); private OkHttpClient client = new OkHttpClient(); private RecordingCallback callback = new RecordingCallback(); @Test public void applicationInterceptorsCanShortCircuitResponses() throws Exception { server.get().shutdown(); // Accept no connections. Request request = new Request.Builder() .url("https://localhost:1/") .build(); final Response interceptorResponse = new Response.Builder() .request(request) .protocol(Protocol.HTTP_1_1) .code(200) .message("Intercepted!") .body(ResponseBody.create(MediaType.parse("text/plain; charset=utf-8"), "abc")) .build(); client.interceptors().add(new Interceptor() { @Override public Response intercept(Chain chain) throws IOException { return interceptorResponse; } }); Response response = client.newCall(request).execute(); assertSame(interceptorResponse, response); } @Test public void networkInterceptorsCannotShortCircuitResponses() throws Exception { server.enqueue(new MockResponse().setResponseCode(500)); Interceptor interceptor = new Interceptor() { @Override public Response intercept(Chain chain) throws IOException { return new Response.Builder() .request(chain.request()) .protocol(Protocol.HTTP_1_1) .code(200) .message("Intercepted!") .body(ResponseBody.create(MediaType.parse("text/plain; charset=utf-8"), "abc")) .build(); } }; client.networkInterceptors().add(interceptor); Request request = new Request.Builder() .url(server.getUrl("/")) .build(); try { client.newCall(request).execute(); fail(); } catch (IllegalStateException expected) { assertEquals("network interceptor " + interceptor + " must call proceed() exactly once", expected.getMessage()); } } @Test public void networkInterceptorsCannotCallProceedMultipleTimes() throws Exception { server.enqueue(new MockResponse()); server.enqueue(new MockResponse()); Interceptor interceptor = new Interceptor() { @Override public Response intercept(Chain chain) throws IOException { chain.proceed(chain.request()); return chain.proceed(chain.request()); } }; client.networkInterceptors().add(interceptor); Request request = new Request.Builder() .url(server.getUrl("/")) .build(); try { client.newCall(request).execute(); fail(); } catch (IllegalStateException expected) { assertEquals("network interceptor " + interceptor + " must call proceed() exactly once", expected.getMessage()); } } @Test public void networkInterceptorsCannotChangeServerAddress() throws Exception { server.enqueue(new MockResponse().setResponseCode(500)); Interceptor interceptor = new Interceptor() { @Override public Response intercept(Chain chain) throws IOException { Address address = chain.connection().getRoute().getAddress(); String sameHost = address.getUriHost(); int differentPort = address.getUriPort() + 1; return chain.proceed(chain.request().newBuilder() .url(new URL("http://" + sameHost + ":" + differentPort + "/")) .build()); } }; client.networkInterceptors().add(interceptor); Request request = new Request.Builder() .url(server.getUrl("/")) .build(); try { client.newCall(request).execute(); fail(); } catch (IllegalStateException expected) { assertEquals("network interceptor " + interceptor + " must retain the same host and port", expected.getMessage()); } } @Test public void networkInterceptorsHaveConnectionAccess() throws Exception { server.enqueue(new MockResponse()); client.networkInterceptors().add(new Interceptor() { @Override public Response intercept(Chain chain) throws IOException { Connection connection = chain.connection(); assertNotNull(connection); return chain.proceed(chain.request()); } }); Request request = new Request.Builder() .url(server.getUrl("/")) .build(); client.newCall(request).execute(); } @Test public void networkInterceptorsObserveNetworkHeaders() throws Exception { server.enqueue(new MockResponse() .setBody(gzip("abcabcabc")) .addHeader("Content-Encoding: gzip")); client.networkInterceptors().add(new Interceptor() { @Override public Response intercept(Chain chain) throws IOException { // The network request has everything: User-Agent, Host, Accept-Encoding. Request networkRequest = chain.request(); assertNotNull(networkRequest.header("User-Agent")); assertEquals(server.get().getHostName() + ":" + server.get().getPort(), networkRequest.header("Host")); assertNotNull(networkRequest.header("Accept-Encoding")); // The network response also has everything, including the raw gzipped content. Response networkResponse = chain.proceed(networkRequest); assertEquals("gzip", networkResponse.header("Content-Encoding")); return networkResponse; } }); Request request = new Request.Builder() .url(server.getUrl("/")) .build(); // No extra headers in the application's request. assertNull(request.header("User-Agent")); assertNull(request.header("Host")); assertNull(request.header("Accept-Encoding")); // No extra headers in the application's response. Response response = client.newCall(request).execute(); assertNull(request.header("Content-Encoding")); assertEquals("abcabcabc", response.body().string()); } @Test public void applicationInterceptorsRewriteRequestToServer() throws Exception { rewriteRequestToServer(client.interceptors()); } @Test public void networkInterceptorsRewriteRequestToServer() throws Exception { rewriteRequestToServer(client.networkInterceptors()); } private void rewriteRequestToServer(List<Interceptor> interceptors) throws Exception { server.enqueue(new MockResponse()); interceptors.add(new Interceptor() { @Override public Response intercept(Chain chain) throws IOException { Request originalRequest = chain.request(); return chain.proceed(originalRequest.newBuilder() .method("POST", uppercase(originalRequest.body())) .addHeader("OkHttp-Intercepted", "yep") .build()); } }); Request request = new Request.Builder() .url(server.getUrl("/")) .addHeader("Original-Header", "foo") .method("PUT", RequestBody.create(MediaType.parse("text/plain"), "abc")) .build(); client.newCall(request).execute(); RecordedRequest recordedRequest = server.takeRequest(); assertEquals("ABC", recordedRequest.getUtf8Body()); assertEquals("foo", recordedRequest.getHeader("Original-Header")); assertEquals("yep", recordedRequest.getHeader("OkHttp-Intercepted")); assertEquals("POST", recordedRequest.getMethod()); } @Test public void applicationInterceptorsRewriteResponseFromServer() throws Exception { rewriteResponseFromServer(client.interceptors()); } @Test public void networkInterceptorsRewriteResponseFromServer() throws Exception { rewriteResponseFromServer(client.networkInterceptors()); } private void rewriteResponseFromServer(List<Interceptor> interceptors) throws Exception { server.enqueue(new MockResponse() .addHeader("Original-Header: foo") .setBody("abc")); interceptors.add(new Interceptor() { @Override public Response intercept(Chain chain) throws IOException { Response originalResponse = chain.proceed(chain.request()); return originalResponse.newBuilder() .body(uppercase(originalResponse.body())) .addHeader("OkHttp-Intercepted", "yep") .build(); } }); Request request = new Request.Builder() .url(server.getUrl("/")) .build(); Response response = client.newCall(request).execute(); assertEquals("ABC", response.body().string()); assertEquals("yep", response.header("OkHttp-Intercepted")); assertEquals("foo", response.header("Original-Header")); } @Test public void multipleApplicationInterceptors() throws Exception { multipleInterceptors(client.interceptors()); } @Test public void multipleNetworkInterceptors() throws Exception { multipleInterceptors(client.networkInterceptors()); } private void multipleInterceptors(List<Interceptor> interceptors) throws Exception { server.enqueue(new MockResponse()); interceptors.add(new Interceptor() { @Override public Response intercept(Chain chain) throws IOException { Request originalRequest = chain.request(); Response originalResponse = chain.proceed(originalRequest.newBuilder() .addHeader("Request-Interceptor", "Android") // 1. Added first. .build()); return originalResponse.newBuilder() .addHeader("Response-Interceptor", "Donut") // 4. Added last. .build(); } }); interceptors.add(new Interceptor() { @Override public Response intercept(Chain chain) throws IOException { Request originalRequest = chain.request(); Response originalResponse = chain.proceed(originalRequest.newBuilder() .addHeader("Request-Interceptor", "Bob") // 2. Added second. .build()); return originalResponse.newBuilder() .addHeader("Response-Interceptor", "Cupcake") // 3. Added third. .build(); } }); Request request = new Request.Builder() .url(server.getUrl("/")) .build(); Response response = client.newCall(request).execute(); assertEquals(Arrays.asList("Cupcake", "Donut"), response.headers("Response-Interceptor")); RecordedRequest recordedRequest = server.takeRequest(); assertEquals(Arrays.asList("Android", "Bob"), recordedRequest.getHeaders("Request-Interceptor")); } @Test public void asyncApplicationInterceptors() throws Exception { asyncInterceptors(client.interceptors()); } @Test public void asyncNetworkInterceptors() throws Exception { asyncInterceptors(client.networkInterceptors()); } private void asyncInterceptors(List<Interceptor> interceptors) throws Exception { server.enqueue(new MockResponse()); interceptors.add(new Interceptor() { @Override public Response intercept(Chain chain) throws IOException { Response originalResponse = chain.proceed(chain.request()); return originalResponse.newBuilder() .addHeader("OkHttp-Intercepted", "yep") .build(); } }); Request request = new Request.Builder() .url(server.getUrl("/")) .build(); client.newCall(request).enqueue(callback); callback.await(request.url()) .assertCode(200) .assertHeader("OkHttp-Intercepted", "yep"); } @Test public void applicationInterceptorsCanMakeMultipleRequestsToServer() throws Exception { server.enqueue(new MockResponse().setBody("a")); server.enqueue(new MockResponse().setBody("b")); client.interceptors().add(new Interceptor() { @Override public Response intercept(Chain chain) throws IOException { chain.proceed(chain.request()); return chain.proceed(chain.request()); } }); Request request = new Request.Builder() .url(server.getUrl("/")) .build(); Response response = client.newCall(request).execute(); assertEquals(response.body().string(), "b"); } private RequestBody uppercase(final RequestBody original) { return new RequestBody() { @Override public MediaType contentType() { return original.contentType(); } @Override public long contentLength() throws IOException { return original.contentLength(); } @Override public void writeTo(BufferedSink sink) throws IOException { Sink uppercase = uppercase(sink); BufferedSink bufferedSink = Okio.buffer(uppercase); original.writeTo(bufferedSink); bufferedSink.emit(); } }; } private Sink uppercase(final BufferedSink original) { return new ForwardingSink(original) { @Override public void write(Buffer source, long byteCount) throws IOException { original.writeUtf8(source.readUtf8(byteCount).toUpperCase(Locale.US)); } }; } static ResponseBody uppercase(ResponseBody original) { return ResponseBody.create(original.contentType(), original.contentLength(), Okio.buffer(uppercase(original.source()))); } private static Source uppercase(final Source original) { return new ForwardingSource(original) { @Override public long read(Buffer sink, long byteCount) throws IOException { Buffer mixedCase = new Buffer(); long count = original.read(mixedCase, byteCount); sink.writeUtf8(mixedCase.readUtf8().toUpperCase(Locale.US)); return count; } }; } private Buffer gzip(String data) throws IOException { Buffer result = new Buffer(); BufferedSink sink = Okio.buffer(new GzipSink(result)); sink.writeUtf8(data); sink.close(); return result; } }
054d45d69b252db417d937d47afd70984e6a7193
d0cba53c150247f7c109f4a3899f66b1563fdbf3
/src/net/fai/daems/FlowCoinDetailActivity.java
b46d223798b5241c41c81ad2e2840d615e4b7995
[ "MIT" ]
permissive
daemsproject/daemsAndroid
1d4b208f48ec7be59b4ef0dc3eb80306e46572c8
08bb53a9ac6f732d12f29123dcf0c1e8b8ad98a7
refs/heads/master
2020-06-14T07:15:34.078250
2017-03-11T12:21:11
2017-03-11T12:21:11
75,217,318
0
0
null
null
null
null
UTF-8
Java
false
false
3,715
java
package net.fai.daems; import java.io.File; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.List; import net.fai.daems.ActionSheet.OnActionSheetSelected; import net.fai.daems.adapter.ExpirationAdapter; import net.fai.daems.adapter.item.ExpirationItem; import net.fai.daems.constant.ViewId; import net.fai.daems.utils.DipPxUtils; import net.fai.daems.utils.QRCodeUtil; import android.content.DialogInterface; import android.content.DialogInterface.OnCancelListener; import android.content.Intent; import android.graphics.BitmapFactory; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.Button; import android.widget.ImageView; import android.widget.ListView; /** * 流量币Activity * @author Administrator * */ public class FlowCoinDetailActivity extends DaemsActivity implements OnClickListener, OnCancelListener, OnActionSheetSelected { @ViewId(R.id.btn_back) Button btnBack; @ViewId(R.id.trans_record) Button btnTransRecord; @ViewId(R.id.imgQRCode) ImageView imgQRCode; @ViewId(R.id.lvExpiration) ListView lvExpiration; private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); private int copyedPosition = -1; private ExpirationAdapter adapter; @Override public int getContentView() { return R.layout.flow_coin_detail; } @Override public void onCreateActivity(Bundle savedInstanceState) { btnTransRecord.setOnClickListener(this); adapter = new ExpirationAdapter(FlowCoinDetailActivity.this, getExpiration()); lvExpiration.setAdapter(adapter); lvExpiration.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { ActionSheet.showFlowCoinSheet(FlowCoinDetailActivity.this, FlowCoinDetailActivity.this, FlowCoinDetailActivity.this); } }); final String filePath = QRCodeUtil.getFileRoot(FlowCoinDetailActivity.this) + File.separator + "qr_" + System.currentTimeMillis() + ".jpg"; final int edgeWidth = DipPxUtils.dip2px(this, 100f); boolean success = QRCodeUtil.createQRImage("1DQe9F3agsDcr4qoTZ3Sush4e88Nv9tNxa", edgeWidth, edgeWidth, BitmapFactory.decodeResource(getResources(), R.mipmap.ic_menu_chat_off), filePath); if (success) { imgQRCode.setImageBitmap(BitmapFactory.decodeFile(filePath)); } } public void onClick(View v) { switch (v.getId()) { case R.id.btn_back: this.finish(); break; case R.id.trans_record: Intent intent1 = new Intent(FlowCoinDetailActivity.this, FlowCoinTransRecordActivity.class); startActivity(intent1); break; default: } } private List<ExpirationItem> getExpiration() { List<ExpirationItem> items = new ArrayList<ExpirationItem>(); items.add(new ExpirationItem("1小时内失效", "8888")); items.add(new ExpirationItem("2小时失效", "8888")); items.add(new ExpirationItem("3小时失效", "8888")); items.add(new ExpirationItem("4小时失效", "8888")); return items; } @Override public void onClick(int whichButton) { switch (whichButton) { case R.id.trans: Intent intent1 = new Intent(FlowCoinDetailActivity.this, FlowCoinTransActivity.class); startActivity(intent1); break; case R.id.donate: Intent intent2 = new Intent(FlowCoinDetailActivity.this, FlowCoinDonateActivity.class); startActivity(intent2); break; case R.id.action_cancel: break; } } @Override public void onCancel(DialogInterface dialog) { // TODO Auto-generated method stub } }
09ddf9c009749c427fb188ee32d98410bafbe352
1a8af68464cb28aa46e40727c12f41577aa9ddf9
/src/main/java/com/sda/website/WebsiteApplication.java
bdb07fe057fa24b8fd406ebab8197ee7522d6879
[]
no_license
HatunM/sda_website
67de3e0860cce40de17b1a9b8cfc4b061259754d
bb5235747a6ca30157065853a76d912560c635a7
refs/heads/main
2023-03-15T17:26:32.193149
2021-03-09T07:48:01
2021-03-09T07:48:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
371
java
package com.sda.website; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.stereotype.Controller; @SpringBootApplication @Controller public class WebsiteApplication { public static void main(String[] args) { SpringApplication.run(WebsiteApplication.class, args); } }
d97e9e9b1b7aca676447ced5442f78680d31eab7
ddfa10ce51ef599f155f98f34c900c7f2d4f99b2
/src/main/java/com/garwan/assignment/converters/LocalDateTimeAttributeConverter.java
0362340852970953c7e68a19dbadd258b940bdee
[]
no_license
marian-margeta/Assignment
5c807fdc9ab4b5ec5a6dff80e2cb4fec52401dcf
df8f67d3e619b2da72c08c0f455097e3e94a7513
refs/heads/master
2021-01-01T15:47:06.109847
2017-07-19T10:04:22
2017-07-19T10:04:22
97,702,011
0
0
null
null
null
null
UTF-8
Java
false
false
663
java
package com.garwan.assignment.converters; import java.sql.Timestamp; import java.time.LocalDateTime; import javax.persistence.AttributeConverter; import javax.persistence.Converter; @Converter(autoApply = true) public class LocalDateTimeAttributeConverter implements AttributeConverter<LocalDateTime, Timestamp> { @Override public Timestamp convertToDatabaseColumn(LocalDateTime locDateTime) { return (locDateTime == null ? null : Timestamp.valueOf(locDateTime)); } @Override public LocalDateTime convertToEntityAttribute(Timestamp sqlTimestamp) { return (sqlTimestamp == null ? null : sqlTimestamp.toLocalDateTime()); } }
ae8f03c5ec5cf545e52f48bbe408ea31be5634af
ef1d60554db758e63b24c1c1f5ca8ea2add83447
/src/main/java/com/bulingbuu/linked/Problem876.java
972ad5bba8663a4d8cfe18e20a189026425d10ce
[]
no_license
NineF/Atlantis
50ca6e485bd13132d05c636aae0753270c5d02b1
ca6bba0e7aa3609adbc62e4acc45696c58228cbb
refs/heads/master
2020-04-01T01:08:57.583026
2019-03-30T10:49:44
2019-03-30T10:49:44
152,728,080
0
0
null
null
null
null
UTF-8
Java
false
false
890
java
package com.bulingbuu.linked; /** * @author bulingbuu * @date 18-10-27 下午4:04 * <p> * Given a non-empty, singly linked list with head node head, return a middle node of linked list. * <p> * If there are two middle nodes, return the second middle node. */ public class Problem876 { public static void main(String[] args) { // ListNode node4 = new ListNode(5, null); ListNode node3 = new ListNode(4, null); ListNode node2 = new ListNode(3, node3); ListNode node1 = new ListNode(2, node2); ListNode head = new ListNode(1, node1); ListNode.outNode(middleNode(head)); } public static ListNode middleNode(ListNode head) { ListNode fast = head, slow = head; while (fast != null && fast.next != null) { fast = fast.next.next; slow = slow.next; } return slow; } }
612e81cd81116789fe388073b4bfc60c56eb8f53
1cb62b109c1a961857d36b0266a79682eb1a9a07
/src/Model/TblBrg.java
9d452603cb0ada4ce205524f144a928b5a426907
[]
no_license
figs24/Jual-Beli-Hasil-Pertanian
79134d814f83c86bcac50ab403396d2b4650d39c
75b44336b5747b1f332c56cfd73c6486878bc0d8
refs/heads/main
2023-05-30T08:11:37.369084
2021-06-24T05:40:23
2021-06-24T05:40:23
365,740,547
0
0
null
null
null
null
UTF-8
Java
false
false
1,412
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 Model; import java.util.List; import javax.swing.table.AbstractTableModel; /** * * @author Luis Figo */ public class TblBrg extends AbstractTableModel { List<MdBrg>lmb; public TblBrg(List<MdBrg> lmb) { this.lmb = lmb; } @Override public int getRowCount() { return lmb.size(); } @Override public int getColumnCount() { return 4; } @Override public Object getValueAt(int row, int column) { switch(column){ case 0: return lmb.get(row).getKode(); case 1: return lmb.get(row).getNama_barang(); case 2: return lmb.get(row).getJumlah(); case 3: return lmb.get(row).getHarga(); default: return null; } } @Override public String getColumnName(int column) { switch(column){ case 0: return "kode"; case 1: return "nama_barang"; case 2: return "jumlah"; case 3: return "harga"; default: return null; } } }
bcbdac6566f0e2791a456e492cbdb5e958231694
41324b615d9171f89a14f430f6e631bd0641ce82
/test/conform/org/objectweb/asm/commons/splitlarge/DataflowTest.java
ec16302e10d5f23cc41730b10dffa5b5b208bed4
[ "BSD-3-Clause" ]
permissive
VijayKrishna/asm-method-size
1b03e9817c3c53421a8eac7c17d21ee1231c8a45
5a2a58e7ba203e11e2f8c7b51e7142b68b83cedc
refs/heads/main
2023-07-01T16:19:02.309146
2013-09-26T12:12:00
2013-09-26T12:12:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,268
java
/*** * ASM tests * Copyright (c) 2000-2011 INRIA, France Telecom * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the copyright holders nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ package org.objectweb.asm.commons.splitlarge; import java.util.BitSet; import java.util.HashMap; import java.util.TreeSet; import org.objectweb.asm.*; import junit.framework.TestCase; /** * Unit tests for the data-flow analyses in the splitting code. * * @author Mike Sperber */ public class DataflowTest extends TestCase { protected ClassWriter cw; protected MethodWriter mw; private void startMethod() { this.cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES); this.cw.visit(Opcodes.V1_1, Opcodes.ACC_PUBLIC, "C", null, "java/lang/Object", null); this.mw = (MethodWriter) cw.visitMethod(Opcodes.ACC_PUBLIC, "<init>", "()V", null, null); this.mw.visitCode(); this.mw.visitVarInsn(Opcodes.ALOAD, 0); this.mw.visitMethodInsn(Opcodes.INVOKESPECIAL, "java/lang/Object", "<init>", "()V"); this.mw.visitInsn(Opcodes.RETURN); this.mw.visitMaxs(1, 1); this.mw.visitEnd(); this.mw = (MethodWriter) cw.visitMethod(Opcodes.ACC_PUBLIC, "m", "()V", null, null); this.mw.visitCode(); } private static void assertBitSet(BitSet set, int... p) { BitSet s = new BitSet(); for (int i : p) { s.set(i); } assertEquals(s, set); } private BasicBlock[] endMethod(int maxStack, int maxLocals) { this.mw.visitMaxs(0, 0); this.mw.visitEnd(); this.cw.visitEnd(); ByteVector code = mw.getCode(); TreeSet<BasicBlock> blocks = new TreeSet<BasicBlock>(); HashMap<Label, String> labelTypes = new HashMap<Label, String>(); ConstantPool constantPool = new ConstantPool(cw.getConstantPool(), cw.getConstantPoolSize()); BasicBlock.computeFlowgraph(code, mw.getFirstHandler(), new Label[code.length], constantPool, cw.thisName, maxStack, maxLocals, new FrameData[code.length + 1], 65536, blocks, new BasicBlock[code.length + 1], new Label[code.length + 2], labelTypes); BasicBlock.computeLocalsReadWrittens(code, blocks); return blocks.toArray(new BasicBlock[0]); } private void LABEL(final Label l) { this.mw.visitLabel(l); } private void ILOAD(int index) { this.mw.visitVarInsn(Opcodes.ILOAD, index); } private void ISTORE(int index) { this.mw.visitVarInsn(Opcodes.ISTORE, index); } private void NOP() { this.mw.visitInsn(Opcodes.NOP); } private void PUSH() { this.mw.visitInsn(Opcodes.ICONST_0); } private void GOTO(final Label l) { this.mw.visitJumpInsn(Opcodes.GOTO, l); } private void IFNE(final Label l) { this.mw.visitJumpInsn(Opcodes.IFNE, l); } public void test1() { Label l1 = new Label(); startMethod(); PUSH(); // 0 ISTORE(0); PUSH(); ISTORE(1); LABEL(l1); // 1 ILOAD(0); IFNE(l1); BasicBlock[] blocks = endMethod(1, 2); assertEquals(3, blocks.length); BasicBlock b0 = blocks[0]; BasicBlock b1 = blocks[1]; assertBitSet(b0.localsRead); assertBitSet(b0.localsReadTransitive); assertBitSet(b1.localsRead, 0); assertBitSet(b1.localsReadTransitive, 0); } public void test2() { Label l1 = new Label(); startMethod(); PUSH(); // 0 ISTORE(0); PUSH(); ISTORE(1); PUSH(); ISTORE(2); PUSH(); ISTORE(3); LABEL(l1); // 1 PUSH(); ISTORE(1); ILOAD(0); IFNE(l1); ILOAD(1); // 2 ISTORE(2); ILOAD(2); ISTORE(0); ILOAD(3); BasicBlock[] blocks = endMethod(1, 4); assertEquals(3, blocks.length); BasicBlock b0 = blocks[0]; BasicBlock b1 = blocks[1]; BasicBlock b2 = blocks[2]; assertBitSet(b0.localsRead); assertBitSet(b0.localsReadTransitive); assertBitSet(b1.localsRead, 0); assertBitSet(b1.localsReadTransitive, 0, 3); assertBitSet(b2.localsRead, 1, 3); assertBitSet(b2.localsReadTransitive, 1, 3); } }
9b74ef7ef0cd70d5c45b97062d0d938f23ebe965
7a4486e3bd029cec4ed93257cc7a6a6272b92ce0
/Activitylifecycle/app/src/androidTest/java/com/example/acadgild/activitylifecycle/ApplicationTest.java
6a87f98fabcebe1c376371119538c375996e1d27
[]
no_license
AcadGildAcademy/AN-2015FEB26-Sagar-Neeli
803884587980f02d89998686acae799706efae24
12bd93a6dfb9b226b3fd33ac04df7adeecabad2f
refs/heads/master
2021-01-20T12:04:10.200266
2015-05-15T19:20:14
2015-05-15T19:20:14
31,590,337
0
0
null
null
null
null
UTF-8
Java
false
false
369
java
package com.example.acadgild.activitylifecycle; 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); } }
3374cb6644de39dcfb7844473331569f4b239b57
7f17c2ad530ace1ba3467c787a3cca39c2a417bc
/core/src/main/java/io/machinecode/chainlink/core/jsl/fluent/task/FluentTask.java
8bf16c53791fd89141df337df8adee718b7f186b
[ "Apache-2.0" ]
permissive
BrentDouglas/chainlink
acc3c197a07bc199425f5458f6253c8f5a3e4c92
376e194ccdd2e6e2f1a4a4b39c7e7f0a4dd81ca3
refs/heads/master
2021-01-15T13:48:23.808562
2015-11-16T19:19:11
2015-11-16T19:19:11
17,303,791
3
0
null
null
null
null
UTF-8
Java
false
false
1,013
java
/* * Copyright 2015 Brent Douglas and other contributors * as indicated by the @author tags. 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. */ package io.machinecode.chainlink.core.jsl.fluent.task; import io.machinecode.chainlink.spi.jsl.inherit.Mergeable; import io.machinecode.chainlink.spi.jsl.task.Task; /** * @author <a href="mailto:[email protected]">Brent Douglas</a> * @since 1.0 */ public interface FluentTask<T extends FluentTask<T>> extends Mergeable<T>, Task { }
08a49b77c25bf0c89e0452772b2b5bbbd2e99aa5
fe366570b74bd9ca417c470380e3646c68d3faee
/cdap-app-templates/cdap-etl/cdap-etl-proto/src/main/java/co/cask/cdap/etl/proto/v2/ETLBatchConfig.java
c40a584c46c80aaf77cc19596c007f26825508dc
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
superchaoran/cdap
5ef459f1b1f58d01b3d8ca1fa714a4010086ad8d
e8c23ae1eb2259c5896c20da6462aa3ba48a7f67
refs/heads/develop
2020-06-28T06:13:02.283504
2016-11-22T19:00:38
2016-11-22T19:00:38
74,505,062
2
0
null
2016-11-22T19:14:16
2016-11-22T19:14:16
null
UTF-8
Java
false
false
5,405
java
/* * Copyright © 2016 Cask Data, 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 co.cask.cdap.etl.proto.v2; import co.cask.cdap.api.Resources; import co.cask.cdap.etl.api.batch.BatchSink; import co.cask.cdap.etl.api.batch.BatchSource; import co.cask.cdap.etl.proto.Connection; import co.cask.cdap.etl.proto.Engine; import com.google.common.collect.ImmutableList; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Objects; import java.util.Set; /** * ETL Batch Configuration. */ public final class ETLBatchConfig extends ETLConfig { private final Engine engine; private final String schedule; private final Resources driverResources; private final List<ETLStage> postActions; // for backwards compatibility private final List<ETLStage> actions; private ETLBatchConfig(Set<ETLStage> stages, Set<Connection> connections, List<ETLStage> postActions, Resources resources, boolean stageLoggingEnabled, Engine engine, String schedule, Resources driverResources) { super(stages, connections, resources, stageLoggingEnabled); this.postActions = ImmutableList.copyOf(postActions); this.engine = engine; this.schedule = schedule; this.driverResources = driverResources; // field only exists for backwards compatibility -- used by convertOldConfig() this.actions = null; } /** * If this has the old v1 fields (source, sinks, transforms), convert them all to stages and create a proper * v2 config. If this is already a v2 config, just returns itself. * This method is only here to support backwards compatibility. * * @return A v2 config. */ public ETLBatchConfig convertOldConfig() { if (!getStages().isEmpty()) { return this; } ETLBatchConfig.Builder builder = builder(schedule) .setEngine(engine) .setDriverResources(getDriverResources()) .addPostActions(actions == null ? new HashSet<ETLStage>() : actions); return convertStages(builder, BatchSource.PLUGIN_TYPE, BatchSink.PLUGIN_TYPE).build(); } public List<ETLStage> getPostActions() { return Collections.unmodifiableList(postActions == null ? new ArrayList<ETLStage>() : postActions); } public Engine getEngine() { return engine == null ? Engine.MAPREDUCE : engine; } public String getSchedule() { return schedule; } public Resources getDriverResources() { return driverResources == null ? new Resources() : driverResources; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } if (!super.equals(o)) { return false; } ETLBatchConfig that = (ETLBatchConfig) o; return Objects.equals(engine, that.engine) && Objects.equals(schedule, that.schedule) && Objects.equals(driverResources, that.driverResources) && Objects.equals(postActions, that.postActions) && Objects.equals(actions, that.actions); } @Override public int hashCode() { return Objects.hash(super.hashCode(), engine, schedule, driverResources, postActions, actions); } @Override public String toString() { return "ETLBatchConfig{" + "engine=" + engine + ", schedule='" + schedule + '\'' + ", driverResources=" + driverResources + ", postActions=" + postActions + "} " + super.toString(); } public static Builder builder(String schedule) { return new Builder(schedule); } /** * Builder for creating configs. */ public static class Builder extends ETLConfig.Builder<Builder> { private final String schedule; private Engine engine; private Resources driverResources; private List<ETLStage> endingActions; public Builder(String schedule) { super(); this.schedule = schedule; this.engine = Engine.MAPREDUCE; this.endingActions = new ArrayList<>(); } public Builder setEngine(Engine engine) { this.engine = engine; return this; } public Builder setDriverResources(Resources driverResources) { this.driverResources = driverResources; return this; } public Builder addPostAction(ETLStage action) { this.endingActions.add(action); return this; } public Builder addPostActions(Collection<ETLStage> actions) { this.endingActions.addAll(actions); return this; } public ETLBatchConfig build() { return new ETLBatchConfig(stages, connections, endingActions, resources, stageLoggingEnabled, engine, schedule, driverResources); } } }
990d25108c0a4a7ad4857d4ff87492292939e6cd
443deb27832ca99924bdde7bdca603feb4ce5dd5
/src/main/java/com/project/controller/AuthenticationController.java
d1797fe5f2f2c2a103979a061e20a32759c38177
[]
no_license
chrisprem11/allInOne
d943b60f8bcc68c9d7299ab73a84247179dbb7d4
db0e9e496f9a6b5ec1de54dd2d5b119869366fd3
refs/heads/master
2020-05-01T10:24:27.432034
2019-03-24T13:48:27
2019-03-24T13:48:27
177,419,928
0
0
null
null
null
null
UTF-8
Java
false
false
1,960
java
package com.project.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.Authentication; import org.springframework.security.core.AuthenticationException; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; import com.project.DTO.UserDTO; import com.project.model.AuthToken; import com.project.security.TokenProvider; import com.project.service.UserService; @CrossOrigin(origins = "*", maxAge = 3600) @RestController @RequestMapping("/token") public class AuthenticationController { @Autowired private AuthenticationManager authenticationManager; @Autowired private TokenProvider jwtTokenUtil; @SuppressWarnings("unused") @Autowired private UserService userService; @RequestMapping(value = "/generate-token", method = RequestMethod.POST) public ResponseEntity<?> register(@RequestBody UserDTO loginUser) throws AuthenticationException { final Authentication authentication = authenticationManager.authenticate( new UsernamePasswordAuthenticationToken( loginUser.getUsername(), loginUser.getPassword() ) ); SecurityContextHolder.getContext().setAuthentication(authentication); final String token = jwtTokenUtil.generateToken(authentication); return ResponseEntity.ok(new AuthToken(token)); } }
f44426f419d9e7aed7d9a1da2afc6fbfb9ecac96
943aabb08a40e59571deca6f03ace692da6cf228
/Assignment2/src/edu/nvcc/gui/OrderPanel.java
5e5270f8a19320a29695eed9990bb3364e0730d5
[]
no_license
wjdgh53/Assignment2-1
9ae409de0332b01f76de88127eaa633c7e2aa546
d46f94eee24e2b4310ef650e67bceec4fe25c4a5
refs/heads/master
2020-06-02T07:04:25.787098
2013-10-02T08:27:58
2013-10-02T08:27:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,196
java
package edu.nvcc.gui; import java.awt.Dimension; import javax.swing.DefaultComboBoxModel; import javax.swing.JButton; import javax.swing.WindowConstants; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JTextArea; import javax.swing.ListModel; import edu.nvcc.utils.ReadExcel; /** * This code was edited or generated using CloudGarden's Jigloo * SWT/Swing GUI Builder, which is free for non-commercial * use. If Jigloo is being used commercially (ie, by a corporation, * company or business for any purpose whatever) then you * should purchase a license for each developer using Jigloo. * Please visit www.cloudgarden.com for details. * Use of Jigloo implies acceptance of these licensing terms. * A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR * THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED * LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE. */ public class OrderPanel extends javax.swing.JPanel { private JList CategoryList; private JList FoodList; private JLabel recipeLabel; private JButton orderButton; private JButton finishButton; private JLabel orderLabel; private JTextArea recipeArea; private JLabel foodLabel; private JLabel categoryLabel; /** * Auto-generated main method to display this * JPanel inside a new JFrame. */ public OrderPanel() { super(); initGUI(); } private void initGUI() { try { setPreferredSize(new Dimension(1000, 800)); this.setLayout(null); { String category[] = new String[ReadPanel.restaurant.getMenuList().size()]; for(int i = 0; i < ReadPanel.restaurant.getMenuList().size(); i++) { category[i] = ReadPanel.restaurant.getMenuList().showlist(i).toString(); } ListModel jList1Model = new DefaultComboBoxModel(category); CategoryList = new JList(); this.add(CategoryList); CategoryList.setModel(jList1Model); CategoryList.setBounds(18, 176, 260, 417); System.out.println(CategoryList.getSelectedValue()); } { FoodList = new JList(); this.add(FoodList); FoodList.setBounds(298, 178, 260, 417); } { categoryLabel = new JLabel(); this.add(categoryLabel); categoryLabel.setText("Category"); categoryLabel.setBounds(85, 114, 117, 59); categoryLabel.setFont(new java.awt.Font("Segoe UI",0,28)); } { foodLabel = new JLabel(); this.add(foodLabel); foodLabel.setText("Food"); foodLabel.setBounds(388, 114, 117, 59); foodLabel.setFont(new java.awt.Font("Segoe UI",0,28)); } { recipeArea = new JTextArea(); this.add(recipeArea); recipeArea.setText("Order Item comes here"); recipeArea.setBounds(702, 173, 260, 417); } { recipeLabel = new JLabel(); this.add(recipeLabel); recipeLabel.setText("Recipe"); recipeLabel.setBounds(790, 115, 116, 59); recipeLabel.setFont(new java.awt.Font("Segoe UI",0,28)); } { orderButton = new JButton(); this.add(orderButton); orderButton.setText("Order"); orderButton.setBounds(570, 317, 121, 45); orderButton.setFont(new java.awt.Font("Segoe UI",0,20)); } { orderLabel = new JLabel(); this.add(orderLabel); orderLabel.setText("Order Here"); orderLabel.setBounds(334, 35, 234, 55); orderLabel.setFont(new java.awt.Font("Segoe UI",0,36)); } { finishButton = new JButton(); this.add(finishButton); finishButton.setText("Finish"); finishButton.setBounds(790, 680, 155, 57); finishButton.setFont(new java.awt.Font("Segoe UI",0,20)); } } catch (Exception e) { e.printStackTrace(); } String foodItem[] = new String[ReadPanel.restaurant.getFoodList().size()]; //System.out.println() if(CategoryList.getSelectedValue().equals("Steak")){ while(true){ if(ReadPanel.restaurant.getFoodList().showlist(i).getCategory().toString().equals("Steak")){ foodItem[i] = ReadPanel.restaurant.getFoodList().showlist(i).getCategory().toString(); } //foodItem[i] = ReadPanel.restaurant.getFoodList().showlist(i).getCategory().toString(); } ListModel FoodListModel = new DefaultComboBoxModel(foodItem); FoodList.setModel(FoodListModel); } } }