blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
132 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
28 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
352
1aa85d77917cc3a91a0edd5342a1c4f29ec911b2
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/10/10_ae61205b10bb5d2e609a4fc3ca28a166dcada3a6/ModuleMapText2CPersistence/10_ae61205b10bb5d2e609a4fc3ca28a166dcada3a6_ModuleMapText2CPersistence_t.java
46e8a5e3b801fa4c766612ceaf762b1687c52445
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
6,958
java
/* * Copyright 2010 Universitat Pompeu Fabra. * * 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. * under the License. */ package org.gitools.persistence.text; import edu.upf.bg.progressmonitor.IProgressMonitor; import java.io.File; import java.io.IOException; import java.io.PrintWriter; import java.io.Reader; import java.io.Writer; import java.util.ArrayList; import java.util.BitSet; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; import java.util.TreeMap; import java.util.TreeSet; import org.apache.commons.csv.CSVParser; import org.gitools.model.ModuleMap; import org.gitools.persistence.PersistenceException; import org.gitools.persistence.PersistenceUtils; import org.gitools.utils.CSVStrategies; /** Read/Write modules from a two columns tabulated file, * first column for item and second for module. */ public class ModuleMapText2CPersistence extends ModuleMapPersistence<ModuleMap>{ @Override public ModuleMap read(File file, IProgressMonitor monitor) throws PersistenceException { // map between the item names and its index Map<String, Integer> itemNameToRowMapping = new TreeMap<String, Integer>(); if (isItemNamesFilterEnabled()) { String[] itemNames = getItemNames(); for (int i = 0; i < itemNames.length; i++) { if (itemNameToRowMapping.containsKey(itemNames[i])) throw new PersistenceException("Modules not mappable to heatmap due to duplicated row: " + itemNames[i]); else itemNameToRowMapping.put(itemNames[i], i); } } // map between modules and item indices final Map<String, Set<Integer>> moduleItemsMap = new HashMap<String, Set<Integer>>(); // read mappings try { monitor.begin("Reading modules ...", 1); Reader reader = PersistenceUtils.openReader(file); CSVParser parser = new CSVParser(reader, CSVStrategies.TSV); readModuleMappings(parser, isItemNamesFilterEnabled(), itemNameToRowMapping, moduleItemsMap); monitor.end(); } catch (Exception ex) { throw new PersistenceException(ex); } monitor.begin("Filtering modules ...", 1); int minSize = getMinSize(); int maxSize = getMaxSize(); // create array of item names //monitor.debug("isItemNamesFilterEnabled() = " + isItemNamesFilterEnabled()); //monitor.debug("itemNameToRowMapping.size() = " + itemNameToRowMapping.size()); String[] itemNames = new String[itemNameToRowMapping.size()]; for (Map.Entry<String, Integer> entry : itemNameToRowMapping.entrySet()) { //monitor.debug(entry.getKey() + " --> " + entry.getValue()); itemNames[entry.getValue()] = entry.getKey(); } // mask of used items BitSet used = new BitSet(itemNames.length); // remappend indices int lastIndex = 0; int[] indexMap = new int[itemNames.length]; // filter modules by size and identify which items are indexed List<String> moduleNames = new ArrayList<String>(); List<int[]> modulesItemIndices = new ArrayList<int[]>(); Iterator<Entry<String, Set<Integer>>> it = moduleItemsMap.entrySet().iterator(); while (it.hasNext()) { Entry<String, Set<Integer>> entry = it.next(); Set<Integer> indices = entry.getValue(); if (indices.size() >= minSize && indices.size() <= maxSize) { moduleNames.add(entry.getKey()); int[] remapedIndices = new int[indices.size()]; Iterator<Integer> iit = indices.iterator(); for (int i = 0; i < indices.size(); i++) { int index = iit.next(); if (!used.get(index)) { used.set(index); indexMap[index] = lastIndex++; } remapedIndices[i] = indexMap[index]; } modulesItemIndices.add(remapedIndices); } else it.remove(); } // reorder item names according with remaped indices String[] finalItemNames = new String[lastIndex]; for (int i = 0; i < itemNames.length; i++) if (used.get(i)) finalItemNames[indexMap[i]] = itemNames[i]; monitor.end(); ModuleMap mmap = new ModuleMap(); mmap.setItemNames(finalItemNames); mmap.setModuleNames(moduleNames.toArray(new String[moduleNames.size()])); mmap.setAllItemIndices(modulesItemIndices.toArray(new int[modulesItemIndices.size()][])); return mmap; } protected void readModuleMappings( CSVParser parser, boolean filterRows, Map<String, Integer> itemNameToRowMapping, Map<String, Set<Integer>> moduleItemsMap) throws PersistenceException { try { String[] fields; while ((fields = parser.getLine()) != null) { if (fields.length < 2) throw new PersistenceException( "At least 2 columns expected at " + parser.getLineNumber() + "(item name and group name)."); String itemName = fields[0]; String groupName = fields[1]; Integer itemIndex = itemNameToRowMapping.get(itemName); if (itemIndex == null && !filterRows) { itemIndex = itemNameToRowMapping.size(); itemNameToRowMapping.put(itemName, itemIndex); } if (itemIndex != null) { Set<Integer> itemIndices = moduleItemsMap.get(groupName); if (itemIndices == null) { itemIndices = new TreeSet<Integer>(); moduleItemsMap.put(groupName, itemIndices); } itemIndices.add(itemIndex); } } } catch (IOException e) { throw new PersistenceException(e); } } @Override public void write(File file, ModuleMap moduleMap, IProgressMonitor monitor) throws PersistenceException { final String[] moduleNames = moduleMap.getModuleNames(); int numModules = moduleNames.length; monitor.begin("Saving modules...", numModules); try { Writer writer = PersistenceUtils.openWriter(file); final PrintWriter pw = new PrintWriter(writer); final String[] itemNames = moduleMap.getItemNames(); final int[][] indices = moduleMap.getAllItemIndices(); for (int i = 0; i < numModules; i++) { for (int index : indices[i]) { pw.print(itemNames[index]); pw.print('\t'); pw.print(moduleNames[i]); pw.print('\n'); } monitor.worked(1); } pw.close(); monitor.end(); } catch (Exception e) { throw new PersistenceException(e); } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
c0894d54dcbb0178f05b1eadf7a8c5e8d247886c
a53f96eefd4c4e3691f074197506b6fb1a0fb201
/Location.java
be423035f3a3431794cf8b46b6ccab6c3fbedef1
[]
no_license
danmidwood/danimals
b0880fe474c4f956e5de340d76005964473722f6
0978240b6f34ac4093069608852d62d194f677a3
HEAD
2016-08-11T13:34:57.646256
2016-02-02T22:45:08
2016-02-03T12:50:35
50,949,672
0
0
null
null
null
null
UTF-8
Java
false
false
1,596
java
/** * Write a description of class Location here. * * @author (your name) * @version (a version number or a date) */ public class Location extends Selection { int row; int col; public Location() { addParam(new String("radius"), new Integer(10)); } public Object select(Population pop) throws Exception{ if (!ready()) throw new Exception("Parameters not yet initialized"); int radius = ((Integer)getParamValue("radius")).intValue(); // Do not want to alter the current environment so create a // temp copy to play with. Population malleablePop = (Population)pop.clone(); Coord currentLocation = (Coord)pop.getCurrentlySelected(); int row = currentLocation.getRow(); int col = currentLocation.getCol(); java.util.Iterator allStrings = pop.keySet().iterator(); while (allStrings.hasNext()) { Coord thisLocation = (Coord)allStrings.next(); int rowDiff = row - thisLocation.getRow(); int colDiff = col - thisLocation.getCol(); double thisRadius = Math.sqrt( (colDiff * colDiff) + (rowDiff * rowDiff)); // The current object should be removed if (thisRadius == 0) malleablePop.remove(thisLocation); if (thisRadius > radius) { malleablePop.remove(thisLocation); } } return malleablePop; } public boolean needsChild() { return true; } public boolean needsPreselectedString() { return true; } }
[ "dan@danmidwood.com" ]
dan@danmidwood.com
29e5ca5c539bdec6839b0b24dcb72a92ed8ed77b
0369bed326a59d5f3f5d19ed1258eab979ec402e
/Titles/helloWorld/java/HelloWorld/src/helloworld/title/TitleRegistry.java
f7fe8867ed0e944ba654cb65d9428724edb5db27
[ "MIT" ]
permissive
magic-lantern-studio/mle-titles
4e29892a4467c2fb9840448992fcfaab6eab9c34
55b79d1bdf0aa98ed057a6128fe69b25ab785b2c
refs/heads/master
2022-09-29T06:14:42.904716
2022-09-17T18:42:30
2022-09-17T18:42:30
128,479,248
0
0
null
null
null
null
UTF-8
Java
false
false
3,896
java
/* * TitleRegistry.java * Created on Mar 28, 2006 */ // COPYRIGHT_BEGIN // COPYRIGHT_END // Declare package. package helloworld.title; // Import standard Java classes. import java.util.Observer; import java.util.Observable; import java.util.Vector; // Import Magic Lantern Runtime Engine classes. import com.wizzer.mle.runtime.core.MleActor; import com.wizzer.mle.runtime.core.MleTables; import com.wizzer.mle.runtime.core.MleRuntimeException; /** * This class manages a registry of title elements (e.g. Actors). * * @author Wizzer Works */ public class TitleRegistry implements Observer { // The Singleton instance of the title registry. private static TitleRegistry m_theRegistry = null; // The Actor registry. private Vector m_actorRegistry = null; // Hide the default constructor. private TitleRegistry() { super(); // Create a container for the Actors in the title. m_actorRegistry = new Vector(); // Add the registry as an Observer of the table manager. MleTables.getInstance().addObserver(this); } /** * Get the Singleton instance of the title registry. * * @return A <code>TitleRegistry</code> is returned. */ public static TitleRegistry getInstance() { if (m_theRegistry == null) m_theRegistry = new TitleRegistry(); return m_theRegistry; } /** * Get the registry of Actors. * * @return A <code>Vector</code> is returned containing the * Actors that have been registered for the title. */ public Vector getActorRegistry() { return m_actorRegistry; } /** * Add an Actor to the title registry. * * @param actor The Actor to add to the registry. * * @return <b>true</b> will be returned if the Actor is successfully added * to the registry. Otherwise, <b>false</b> will be returned. * * @throws MleRuntimeException This exception is thrown if the input argument * is <b>null</b>. */ public boolean addActor(MleActor actor) throws MleRuntimeException { if (actor == null) { throw new MleRuntimeException("Unable to add Actor to title registry."); } return m_actorRegistry.add(actor); } /** * Remove an Actor from the title registry. * * @param actor The Actor to remove from the registry. * * @return <b>true</b> will be returned if the Actor is successfully removed * from the registry. Otherwise, <b>false</b> will be returned. * * @throws MleRuntimeException This exception is thrown if the input argument * is <b>null</b>. */ public boolean removeActor(MleActor actor) throws MleRuntimeException { if (actor == null) { throw new MleRuntimeException("Unable to remove Actor from title registry."); } return m_actorRegistry.remove(actor); } /** * Clear the title registry by removing all registered title * elements. */ public void clear() { // Clear the Actor registry. m_actorRegistry.removeAllElements(); } /** * This method is called whenever the observed object is changed. * <p> * If the Observable is the <code>MleTables</code> class and the Object is * an <code>MleActor</code>, then the Actor is added to the title registry. * </p> * * @param obs The Observable object. * @param obj An argument passed by the notifyObservers method from the * Observable object. */ public void update(Observable obs, Object obj) { if (obs instanceof MleTables) { if (obj instanceof MleActor) m_actorRegistry.add(obj); } } }
[ "msm@wizzerworks.com" ]
msm@wizzerworks.com
f09ef2aac724009afb9a8df0f6402af66fbd6813
76be1fb2b767c8ff5c448425817b872abf553c73
/src/main/java/logcollector/SocketElement.java
cdf67e28005c422f72f7b07c8da9936170e3ec7b
[ "Apache-2.0" ]
permissive
ChoiJW/logcollector
5717b64b3746e6ab9ebde71bcfb4960c10b7fba8
8fc5186b498de100aef4e3ba4dbcc4aa9dbbaf9a
refs/heads/master
2021-04-28T14:42:51.828515
2018-02-20T13:05:03
2018-02-20T13:05:03
121,971,185
0
0
null
null
null
null
UTF-8
Java
false
false
2,954
java
package logcollector; import java.io.BufferedInputStream; import java.io.IOException; import java.io.InterruptedIOException; import java.io.ObjectInputStream; import java.net.Socket; import org.apache.log4j.Logger; import org.apache.log4j.spi.LoggerRepository; import org.apache.log4j.spi.LoggingEvent; // Contributors: Moses Hohman <mmhohman@rainbow.uchicago.edu> public class SocketElement implements Runnable { Socket socket; // LoggerRepository hierarchy; ObjectInputStream ois; String logType; public SocketElement(Socket socket, String logType) { this.socket = socket; this.logType = logType; // this.hierarchy = hierarchy; try { ois = new ObjectInputStream(new BufferedInputStream(socket.getInputStream())); } catch (InterruptedIOException e) { Thread.currentThread().interrupt(); // logger.error("Could not open ObjectInputStream to "+socket, e); } catch (IOException e) { // logger.error("Could not open ObjectInputStream to "+socket, e); } catch (RuntimeException e) { // logger.error("Could not open ObjectInputStream to "+socket, e); } } // public // void finalize() { // System.err.println("-------------------------Finalize called"); // System.err.flush(); // } public void run() { LoggingEvent event; // Logger remoteLogger; try { if (ois != null) { while (true) { // read an event from the wire event = (LoggingEvent) ois.readObject(); // get a logger from the hierarchy. The name of the logger is taken to be the // name contained in the event. // remoteLogger = hierarchy.getLogger(event.getLoggerName()); // event.logger = remoteLogger; System.out.println(this.logType + " : " + event.getMessage()); // apply the logger-level filter /* * if (event.getLevel().isGreaterOrEqual(remoteLogger.getEffectiveLevel())) { // * finally log the event as if was generated locally * remoteLogger.callAppenders(event); } */ } } } catch (java.io.EOFException e) { // logger.info("Caught java.io.EOFException closing conneciton."); } catch (java.net.SocketException e) { // logger.info("Caught java.net.SocketException closing conneciton."); } catch (InterruptedIOException e) { Thread.currentThread().interrupt(); // logger.info("Caught java.io.InterruptedIOException: " + e); // logger.info("Closing connection."); } catch (IOException e) { // logger.info("Caught java.io.IOException: " + e); // logger.info("Closing connection."); } catch (Exception e) { // logger.error("Unexpected exception. Closing conneciton.", e); } finally { if (ois != null) { try { ois.close(); } catch (Exception e) { // logger.info("Could not close connection.", e); } } if (socket != null) { try { socket.close(); } catch (InterruptedIOException e) { Thread.currentThread().interrupt(); } catch (IOException ex) { } } } } }
[ "supportchoi@hotmail.com" ]
supportchoi@hotmail.com
e5281645b679719f38f5782b5bc2c6632d74943b
7c779f6a42bda541b0548f2f387d65c9e44236de
/app/src/main/java/com/example/java6/MainActivity.java
fbcc089fafde05e6be0a6dd22f6fd43e8f14ec97
[]
no_license
Webbernucthomework/JAVA_HW6
fa202ecc9efc9e05bd6e8d09005e667dd719c0d1
34834971d683531ab1896c11fb7a990c505a4e13
refs/heads/master
2020-09-06T07:04:50.860771
2019-11-08T01:08:30
2019-11-08T01:08:30
220,358,800
0
0
null
null
null
null
UTF-8
Java
false
false
331
java
package com.example.java6; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } }
[ "57001344+Webbernucthomework@users.noreply.github.com" ]
57001344+Webbernucthomework@users.noreply.github.com
c10ec09f854d096772e50b5e3c058b568a48af92
3127e92ab06084b27526ab308ebccdd1895e5bc5
/src/dominion/models/cards/actions/Bazaar.java
b81783cd966933ef298a0fc51ae855369eff672a
[]
no_license
Lager-B08902082/dominion
09c847deee9c20a1789eedb554d48ec287a2d53f
04a196f78e31cfc8d14ac2bef1d1255169c71ebd
refs/heads/master
2023-06-08T17:45:23.962205
2021-07-01T05:59:10
2021-07-01T05:59:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
850
java
package dominion.models.cards.actions; import dominion.models.cards.Card; import dominion.models.cards.CardStyles; import dominion.models.cards.CardTypes; import dominion.models.expansions.SeaSide; import dominion.models.player.Player; public class Bazaar extends Card implements SeaSide, Action { // Constructor public Bazaar() { name = "趕集"; description = "+1 卡片\n+2 行動\n+1 塊錢"; style = CardStyles.white; type = CardTypes.action; numCost = 5; } // Functions @Override public void perform(Player performer, boolean decreaseNumActions) { performer.drawCards(1); performer.increaseNumActions(2); performer.increaseNumCoins(1); if(decreaseNumActions) { performer.decreaseNumActions(); } doNextMove(); } }
[ "kyle65463@gmail.com" ]
kyle65463@gmail.com
3096c1a2d1b6ff9b14cf4161091d13cd3a0222ca
5bc51d282f4437119d433036d8ba51229452a5ec
/src/main/java/com/travelplanner/Application.java
3b474dd0f2a8f5bb076c991fec1a7fcfd3d3de0a
[]
no_license
monikaj93/travelplanner
041e57232c2c27c9ba2f43d160efa2f93081babb
ac1136d9cab7c256f28f497d8fc1ce395b69995b
refs/heads/master
2021-06-07T23:08:01.761832
2019-06-04T22:12:35
2019-06-04T22:12:35
143,773,438
0
0
null
2021-06-04T21:58:15
2018-08-06T19:27:42
Java
UTF-8
Java
false
false
310
java
package com.travelplanner; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class Application { public static void main(String[] args) { SpringApplication.run(Application.class, args); } }
[ "monikaj9333@gmail.com" ]
monikaj9333@gmail.com
85eff5be74ba7139d0eedf5344e31904d7271f1d
ff80bafc0b67a56a26d89493b03c3e4e3ee080a0
/src/com/yj/ecard/ui/adapter/WithdrawRecordListViewHolder.java
c06293e0950085b504b065161e013fb91f19e730
[]
no_license
yangmingguang/LY
f22ee87307e238cb92ac2f4ca5ae28666e7a51d1
259671862349071ddf94097232b9b4cafdd0e60e
refs/heads/master
2016-09-06T06:11:08.651390
2015-11-30T14:37:46
2015-11-30T14:37:46
40,431,458
1
0
null
null
null
null
UTF-8
Java
false
false
1,961
java
/** * @Title: WithdrawRecordListViewHolder.java * @Package com.yj.ecard.ui.adapter * @Description: TODO(用一句话描述该文件做什么) * @author YangMingGuang * @date 2015-5-25 下午5:26:13 * @version V1.0 */ package com.yj.ecard.ui.adapter; import android.content.Context; import android.text.Html; import android.view.View; import android.widget.TextView; import com.yj.ecard.R; import com.yj.ecard.publics.model.WithdrawBean; /** * @ClassName: WithdrawRecordListViewHolder * @Description: TODO(这里用一句话描述这个类的作用) * @author YangMingGuang * @date 2015-5-25 下午5:26:13 * */ public class WithdrawRecordListViewHolder { private View state; private boolean hasInited; public TextView tvName, tvCard, tvTime, tvAmount; public WithdrawRecordListViewHolder(View view) { if (view != null) { tvName = (TextView) view.findViewById(R.id.tv_name); tvCard = (TextView) view.findViewById(R.id.tv_card); tvTime = (TextView) view.findViewById(R.id.tv_time); tvAmount = (TextView) view.findViewById(R.id.tv_amount); state = view.findViewById(R.id.state); hasInited = true; } } /** * @Title: initData * @Description: TODO(这里用一句话描述这个方法的作用) * @param @param withdrawBean * @param @param context 设定文件 * @return void 返回类型 * @throws */ public void initData(Context context, WithdrawBean withdrawBean) { if (hasInited) { tvName.setText("姓名:" + withdrawBean.realName); tvCard.setText("卡号:" + withdrawBean.bankCardnum); tvTime.setText(withdrawBean.addTime); tvAmount.setText(Html.fromHtml("提现金额:<font color=#D00000>¥" + withdrawBean.cashAmount + "</font>")); if (withdrawBean.state == 1) { state.setBackgroundResource(R.color.state_green_color); } else { state.setBackgroundResource(R.color.state_gray_color); } } } }
[ "yangmg1988@sina.com" ]
yangmg1988@sina.com
3f95fd13c3bcf67e5fdda88bf4061af20045fb4a
d60e287543a95a20350c2caeabafbec517cabe75
/LACCPlus/Hadoop/273_1.java
1c4629e40c82e46a5b24e021642dca18282cf5af
[ "MIT" ]
permissive
sgholamian/log-aware-clone-detection
242067df2db6fd056f8d917cfbc143615c558b2c
9993cb081c420413c231d1807bfff342c39aa69a
refs/heads/main
2023-07-20T09:32:19.757643
2021-08-27T15:02:50
2021-08-27T15:02:50
337,837,827
0
0
null
null
null
null
UTF-8
Java
false
false
754
java
//,temp,OpenFileCtxCache.java,198,219,temp,NMContainerTokenSecretManager.java,214,234 //,3 public class xxx { void cleanAll() { ArrayList<OpenFileCtx> cleanedContext = new ArrayList<OpenFileCtx>(); synchronized (this) { Iterator<Entry<FileHandle, OpenFileCtx>> it = openFileMap.entrySet() .iterator(); if (LOG.isTraceEnabled()) { LOG.trace("openFileMap size:" + openFileMap.size()); } while (it.hasNext()) { Entry<FileHandle, OpenFileCtx> pairs = it.next(); OpenFileCtx ctx = pairs.getValue(); it.remove(); cleanedContext.add(ctx); } } // Invoke the cleanup outside the lock for (OpenFileCtx ofc : cleanedContext) { ofc.cleanup(); } } };
[ "sgholami@uwaterloo.ca" ]
sgholami@uwaterloo.ca
d15a9b3bebdf04fac00e0f151bffb208b34f87b4
1e671aad06682da80282dd83dece1937239a848f
/demo/src/com/zhaoqy/app/demo/page/vmall/adapter/HomePagerAdapter.java
7cb747c464f07e47e202c01197bd5d095404f1d4
[]
no_license
zhaoqingyue/EclipseStudy
548671318b074c833d3e12b8dc6379a85e122576
f2238125e55333a7651fec546f39fd23dee0197e
refs/heads/master
2020-04-04T03:24:09.966018
2018-11-01T12:41:11
2018-11-01T12:41:11
155,712,533
0
0
null
null
null
null
UTF-8
Java
false
false
1,066
java
package com.zhaoqy.app.demo.page.vmall.adapter; import java.util.List; import android.support.v4.view.PagerAdapter; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; public class HomePagerAdapter extends PagerAdapter { private List<ImageView> ivlist; public HomePagerAdapter(List<ImageView> viewlist) { this.ivlist = viewlist; } public int getCount() { return ivlist.size()*100; } public boolean isViewFromObject(View arg0, Object arg1) { return arg0 == arg1; } public Object instantiateItem(ViewGroup container, int position) { position %= ivlist.size(); container.addView(ivlist.get(position), 0); if (position<0) { position = ivlist.size()+position; } return ivlist.get(position); } public void destroyItem(ViewGroup container, int position, Object object) { position%=ivlist.size(); if (position<0) { position = ivlist.size()+position; } ImageView view = ivlist.get(position); container.removeView(view); } }
[ "1023755730@qq.com" ]
1023755730@qq.com
721183db999f350ce458a6eda8449ed9c8d56a89
441473eacc2770115b9b285d4115f999f0e208e9
/Pract7_8/src/com/company/Employee.java
99c0fe6e5047deeb5ea01a26f0c861690ac1123c
[]
no_license
denilai/JavaLabs
be26b0bf7b2d2048124f360804f505a51a69b8fa
f13b096bc8b431101c5aa5599e48c00e0156d4db
refs/heads/master
2023-02-03T01:45:46.606622
2020-12-14T11:53:30
2020-12-14T11:53:30
293,067,205
0
0
null
null
null
null
UTF-8
Java
false
false
3,165
java
package com.company; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.util.LinkedList; import java.util.List; import java.util.Random; public class Employee implements Comparable<Employee>{ private String fstName; private String sndName; private String position; private double baseSalary; public double finalSalary; private static List<String> randomFstName; private static List <String> randomSndName; Company company; int cashForCompany = 0; public double getBaseSalary(){ return this.baseSalary; } Employee(String position) throws IOException { randomFstName = Files.readAllLines(Path.of ("RandomFstNames.txt"), StandardCharsets.UTF_8); randomSndName = Files.readAllLines(Path.of ("RandomSndNames.txt"), StandardCharsets.UTF_8); Random random = new Random(); String rFstName = randomFstName.get(random.nextInt(100)); String rSndName = randomSndName.get(random.nextInt(88)); this.fstName = rFstName; this.sndName = rSndName; this.position = position; this.baseSalary = random.nextInt(300000)+150000; switch (position){ case "Manager": finalSalary = new Manager().calcSalary(baseSalary); break; case "Operator": finalSalary = new Operator().calcSalary(baseSalary); break; case "Top Manager": finalSalary = new TopManager().calcSalary(baseSalary); } } Employee(String fstName, String sndName, String position, double baseSalary) throws IOException { this.fstName = fstName; this.sndName = sndName; this.baseSalary = baseSalary; this.position = position; switch (position){ case "Manager": finalSalary = new Manager().calcSalary(baseSalary); break; case "Operator": finalSalary = new Operator().calcSalary(baseSalary); break; case "Top Manager": finalSalary = new TopManager().calcSalary(baseSalary); } FileReader reader = new FileReader("RandomNames.txt"); } public double getFinalSalary() { return finalSalary; } @Override public int compareTo(Employee o) { double eps = 0.000000001; double temp = Math.abs(o.getFinalSalary()-this.getFinalSalary()); if (temp<eps ) return 0; else if (o.getFinalSalary()>this.getFinalSalary()) return -1; else return 1; } public String getPosition() { return position; } public String getFullName() { return fstName + ' ' + sndName; } @Override public String toString() { return "Employee: {"+ " name: " + fstName + ' '+ sndName + " position: "+ position + " final salary: "+ getFinalSalary() + " }"; } }
[ "kirill_denisov_2000@outlook.com" ]
kirill_denisov_2000@outlook.com
02d42cd40052a797373b11616fb85540774f19b9
03beb22a38b4955555ae1796b26ab4d5dc233e76
/test/app/src/main/java/com/example/test/DTO/CreateMemberDto.java
b1a8081ac3656919e738785bf36d2286c8e32ffc
[]
no_license
leeyoong/All-Fun-SideProject-FE
2825062870e54545e53c4d4060a8337a136be008
52f9525f0eb5c44ae7657fecb116bbf65f3eb35f
refs/heads/main
2023-06-25T16:30:19.148150
2021-07-31T07:37:33
2021-07-31T07:37:33
390,770,863
0
0
null
null
null
null
UTF-8
Java
false
false
2,038
java
package com.example.test.DTO; public class CreateMemberDto { public CreateMemberDto(String email, String passwd, String birth, String name, String phone, String nickname, String gender) { this.email = email; this.passwd = passwd; this.birth = birth; this.name = name; this.phone = phone; this.nickname = nickname; this.gender = gender; } private String email; // private String passwd; private String birth; //yyyy-mm-dd private String name; private String phone; private String nickname; // private String gender; // Male Female public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getPasswd() { return passwd; } public void setPasswd(String passwd) { this.passwd = passwd; } public String getBirth() { return birth; } public void setBirth(String birth) { this.birth = birth; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } public String getNickname() { return nickname; } public void setNickname(String nickname) { this.nickname = nickname; } public String getGender() { return gender; } public void setGender(String gender) { this.gender = gender; } @Override public String toString() { return "CreateMemberDto{" + "email='" + email + '\'' + ", passwd='" + passwd + '\'' + ", birth='" + birth + '\'' + ", name='" + name + '\'' + ", phone='" + phone + '\'' + ", nickname='" + nickname + '\'' + ", gender='" + gender + '\'' + '}'; } }
[ "wkdsks612@gmail.com" ]
wkdsks612@gmail.com
bb45958f2ed0aaca9b5a26c0b8915532462afff7
d2eb73a6aea1f1a38b7b4c65444dde8590598825
/01InterfacesExercises/Birthday Celebrations/BirthDate.java
8dd5902432c360f25970df61b9be7854273be43c
[]
no_license
zdergatchev/Java-OOP-Advanced
a8d03b5242f2008f3d173c29eb16a2e52f8a5271
5725251f278421c54d9df05ef75f1f7a00088ec6
refs/heads/master
2021-01-22T18:06:54.944072
2017-03-21T09:21:47
2017-03-21T09:21:47
85,057,110
0
1
null
2017-03-21T09:21:47
2017-03-15T10:03:22
Java
UTF-8
Java
false
false
138
java
package BorderControl_05; /** * Created by r3v3nan7 on 16.03.17. */ public interface BirthDate { public String getBirthDate(); }
[ "panayotkindalov@gmail.com" ]
panayotkindalov@gmail.com
64913bd79e89c9466e88dde9491351a7e348fedc
784db9fe74ecea7319637254de4e6a226c00fdf5
/src/main/java/ch/pschatzmann/scad4j/mesh/Material.java
1dfe2803cf5a722715ef6c7c10ce976aa5f0c281
[]
no_license
pschatzmann/scad4j
581ffaadb398cefe6cf41e3ab3db489f8fc6ee30
4662309d6b924c0cd64d7fa4d65c74929c86c96b
refs/heads/master
2021-01-05T08:49:59.217445
2020-02-21T01:02:05
2020-02-21T01:02:05
240,961,190
1
0
null
null
null
null
UTF-8
Java
false
false
269
java
package ch.pschatzmann.scad4j.mesh; public class Material { private String name; public Material(){} public Material(String name){ this.name = name; } public String getName() { return name; } public void setName(String name) { this.name = name; } }
[ "phil.schatzmann@gmail.com" ]
phil.schatzmann@gmail.com
dc9542588ad8ad2e79262570eb8e07b85e38c3f8
d2705adcc800ce6a1e7a80566eb60ee0ce3cbaa8
/107 Binary Tree Level Order Traversal II/TreeNode.java
6d40eccf8e1bac425a4271181ce488756f819c6e
[]
no_license
PaulingZhou/LeetCode123
15a0830f7bd94b89ec3c228d7c5742f0d2330707
e4500c819c545ea04ee8c04e36a4b7cf8f9589ec
refs/heads/master
2021-07-11T13:28:52.255011
2017-10-14T12:07:32
2017-10-14T12:07:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
170
java
package com.zhou.solution107; //Definition for a binary tree node. public class TreeNode { int val; TreeNode left; TreeNode right; TreeNode(int x) { val = x; } }
[ "paulingzhou@gmail.com" ]
paulingzhou@gmail.com
1053eedb7b4378cf3833c2166085902c04340deb
536bf97d11e9b57b690abfbb046faa544d0ad3f8
/guimei/src/com/guimei/entity/Admin.java
83cb611a54d33335e08d99ac5c2c0ec478310cb5
[]
no_license
yanshuguang/guimei
9289f6a7033d02dff5dc4d49dcb590f015c08f98
eea4aa81fdb6fa675ec2a544eb46dce99f3abcbc
refs/heads/master
2021-08-28T13:39:02.254520
2017-12-12T09:35:08
2017-12-12T09:35:08
113,973,772
0
0
null
null
null
null
UTF-8
Java
false
false
792
java
package com.guimei.entity; public class Admin { private int admin_id; private String admin_name; private String admin_pwd; private String admin_realname; private String admin_email; public int getAdmin_id() { return admin_id; } public void setAdmin_id(int admin_id) { this.admin_id = admin_id; } public String getAdmin_name() { return admin_name; } public void setAdmin_name(String admin_name) { this.admin_name = admin_name; } public String getAdmin_pwd() { return admin_pwd; } public void setAdmin_pwd(String admin_pwd) { this.admin_pwd = admin_pwd; } public String getAdmin_realname() { return admin_realname; } public void setAdmin_realname(String admin_realname) { this.admin_realname = admin_realname; } }
[ "2508788502@qq.com" ]
2508788502@qq.com
c8715331b5826dbe211a83a2c5d730f76bb3433e
8e26e41b2d8b0e6c2c837c5fc94a70f63e9d5683
/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/InternalClusterPolicies.java
755978b0a3a764e0962a9501929cdf2797864d79
[ "Apache-2.0" ]
permissive
deweydu/ovirt-engine
8d23d6ce0dfadc596ddc95463c98e4c0a993eb34
cb7e7c4d34786b83ff7b4e7a36d70ab69ed4e2e1
refs/heads/master
2020-12-13T19:55:55.841984
2015-09-24T08:45:24
2016-01-10T08:29:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
11,848
java
package org.ovirt.engine.core.bll.scheduling; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.Map; import org.ovirt.engine.core.bll.scheduling.policyunits.CPUPolicyUnit; import org.ovirt.engine.core.bll.scheduling.policyunits.CpuLevelFilterPolicyUnit; import org.ovirt.engine.core.bll.scheduling.policyunits.EmulatedMachineFilterPolicyUnit; import org.ovirt.engine.core.bll.scheduling.policyunits.EvenDistributionBalancePolicyUnit; import org.ovirt.engine.core.bll.scheduling.policyunits.EvenDistributionWeightPolicyUnit; import org.ovirt.engine.core.bll.scheduling.policyunits.EvenGuestDistributionBalancePolicyUnit; import org.ovirt.engine.core.bll.scheduling.policyunits.EvenGuestDistributionWeightPolicyUnit; import org.ovirt.engine.core.bll.scheduling.policyunits.HaReservationWeightPolicyUnit; import org.ovirt.engine.core.bll.scheduling.policyunits.HostDeviceFilterPolicyUnit; import org.ovirt.engine.core.bll.scheduling.policyunits.HostedEngineHAClusterFilterPolicyUnit; import org.ovirt.engine.core.bll.scheduling.policyunits.HostedEngineHAClusterWeightPolicyUnit; import org.ovirt.engine.core.bll.scheduling.policyunits.MemoryPolicyUnit; import org.ovirt.engine.core.bll.scheduling.policyunits.MigrationPolicyUnit; import org.ovirt.engine.core.bll.scheduling.policyunits.NetworkPolicyUnit; import org.ovirt.engine.core.bll.scheduling.policyunits.NoneBalancePolicyUnit; import org.ovirt.engine.core.bll.scheduling.policyunits.NoneWeightPolicyUnit; import org.ovirt.engine.core.bll.scheduling.policyunits.PinToHostPolicyUnit; import org.ovirt.engine.core.bll.scheduling.policyunits.PowerSavingBalancePolicyUnit; import org.ovirt.engine.core.bll.scheduling.policyunits.PowerSavingWeightPolicyUnit; import org.ovirt.engine.core.bll.scheduling.policyunits.VmAffinityFilterPolicyUnit; import org.ovirt.engine.core.bll.scheduling.policyunits.VmAffinityWeightPolicyUnit; import org.ovirt.engine.core.common.scheduling.ClusterPolicy; import org.ovirt.engine.core.common.scheduling.PolicyUnitType; import org.ovirt.engine.core.common.utils.Pair; import org.ovirt.engine.core.compat.Guid; public class InternalClusterPolicies { private static final Map<Guid, ClusterPolicy> clusterPolicies = new HashMap<>(); static { createBuilder("b4ed2332-a7ac-4d5f-9596-99a439cb2812") .name("none") .isDefault() .setBalancer(NoneBalancePolicyUnit.class) .addFilters(PinToHostPolicyUnit.class) .addFilters(CPUPolicyUnit.class) .addFilters(CpuLevelFilterPolicyUnit.class) .addFilters(EmulatedMachineFilterPolicyUnit.class) .addFilters(HostDeviceFilterPolicyUnit.class) .addFilters(HostedEngineHAClusterFilterPolicyUnit.class) .addFilters(MemoryPolicyUnit.class) .addFilters(MigrationPolicyUnit.class) .addFilters(VmAffinityFilterPolicyUnit.class) .addFilters(NetworkPolicyUnit.class) .addFunction(1, NoneWeightPolicyUnit.class) .addFunction(1, HostedEngineHAClusterWeightPolicyUnit.class) .addFunction(1, HaReservationWeightPolicyUnit.class) .addFunction(1, VmAffinityWeightPolicyUnit.class) .register(); createBuilder("20d25257-b4bd-4589-92a6-c4c5c5d3fd1a") .name("evenly_distributed") .setBalancer(EvenDistributionBalancePolicyUnit.class) .addFilters(PinToHostPolicyUnit.class) .addFilters(CPUPolicyUnit.class) .addFilters(CpuLevelFilterPolicyUnit.class) .addFilters(EmulatedMachineFilterPolicyUnit.class) .addFilters(HostDeviceFilterPolicyUnit.class) .addFilters(HostedEngineHAClusterFilterPolicyUnit.class) .addFilters(MemoryPolicyUnit.class) .addFilters(MigrationPolicyUnit.class) .addFilters(VmAffinityFilterPolicyUnit.class) .addFilters(NetworkPolicyUnit.class) .addFunction(1, EvenDistributionWeightPolicyUnit.class) .addFunction(1, HostedEngineHAClusterWeightPolicyUnit.class) .addFunction(1, HaReservationWeightPolicyUnit.class) .addFunction(1, VmAffinityWeightPolicyUnit.class) .set(PolicyUnitParameter.CPU_OVERCOMMIT_DURATION_MINUTES, "2") .set(PolicyUnitParameter.HIGH_UTILIZATION, "80") .register(); createBuilder("5a2b0939-7d46-4b73-a469-e9c2c7fc6a53") .name("power_saving") .setBalancer(PowerSavingBalancePolicyUnit.class) .addFilters(PinToHostPolicyUnit.class) .addFilters(CPUPolicyUnit.class) .addFilters(CpuLevelFilterPolicyUnit.class) .addFilters(EmulatedMachineFilterPolicyUnit.class) .addFilters(HostDeviceFilterPolicyUnit.class) .addFilters(HostedEngineHAClusterFilterPolicyUnit.class) .addFilters(MemoryPolicyUnit.class) .addFilters(MigrationPolicyUnit.class) .addFilters(VmAffinityFilterPolicyUnit.class) .addFilters(NetworkPolicyUnit.class) .addFunction(1, PowerSavingWeightPolicyUnit.class) .addFunction(1, HostedEngineHAClusterWeightPolicyUnit.class) .addFunction(1, HaReservationWeightPolicyUnit.class) .addFunction(1, VmAffinityWeightPolicyUnit.class) .set(PolicyUnitParameter.CPU_OVERCOMMIT_DURATION_MINUTES, "2") .set(PolicyUnitParameter.HIGH_UTILIZATION, "80") .set(PolicyUnitParameter.LOW_UTILIZATION, "20") .register(); createBuilder("8d5d7bec-68de-4a67-b53e-0ac54686d579") .name("vm_evenly_distributed") .setBalancer(EvenGuestDistributionBalancePolicyUnit.class) .addFilters(PinToHostPolicyUnit.class) .addFilters(CPUPolicyUnit.class) .addFilters(CpuLevelFilterPolicyUnit.class) .addFilters(EmulatedMachineFilterPolicyUnit.class) .addFilters(HostDeviceFilterPolicyUnit.class) .addFilters(HostedEngineHAClusterFilterPolicyUnit.class) .addFilters(MemoryPolicyUnit.class) .addFilters(MigrationPolicyUnit.class) .addFilters(VmAffinityFilterPolicyUnit.class) .addFilters(NetworkPolicyUnit.class) .addFunction(1, EvenGuestDistributionWeightPolicyUnit.class) .addFunction(1, HostedEngineHAClusterWeightPolicyUnit.class) .addFunction(1, HaReservationWeightPolicyUnit.class) .addFunction(1, VmAffinityWeightPolicyUnit.class) .set(PolicyUnitParameter.HIGH_VM_COUNT, "10") .set(PolicyUnitParameter.MIGRATION_THRESHOLD, "5") .set(PolicyUnitParameter.SPM_VM_GRACE, "5") .register(); } public static Map<Guid, ClusterPolicy> getClusterPolicies() { return Collections.unmodifiableMap(clusterPolicies); } protected static PolicyBuilder createBuilder(String guid) { final Guid realGuid = Guid.createGuidFromString(guid); final PolicyBuilder builder = new PolicyBuilder(realGuid); return builder; } protected final static class PolicyBuilder { final ClusterPolicy policy; private PolicyBuilder(Guid id) { policy = new ClusterPolicy(); policy.setId(id); policy.setFilters(new ArrayList<Guid>()); policy.setFilterPositionMap(new HashMap<Guid, Integer>()); policy.setFunctions(new ArrayList<Pair<Guid, Integer>>()); policy.setParameterMap(new HashMap<String, String>()); policy.setLocked(true); } public final ClusterPolicy getPolicy() { return policy; } public final PolicyBuilder name(String name) { policy.setName(name); return this; } public final PolicyBuilder description(String description) { policy.setDescription(description); return this; } public final PolicyBuilder isDefault() { policy.setDefaultPolicy(true); return this; } public final PolicyBuilder set(PolicyUnitParameter parameter, String value) { // This is only executed during application startup (class loading in fact) // and should never fail or we have a bug in the static initializer of this // class. assert parameter.validValue(value); policy.getParameterMap().put(parameter.getDbName(), value); return this; } @SafeVarargs public final PolicyBuilder addFilters(Class<? extends PolicyUnitImpl>... filters) { for (Class<? extends PolicyUnitImpl> filter: filters) { Guid guid = getGuidAndValidateType(filter, PolicyUnitType.FILTER); // Previously last item, but do not touch the first one if (policy.getFilters().size() >= 2) { Guid last = policy.getFilters().get(policy.getFilters().size() - 1); policy.getFilterPositionMap().put(last, 0); } // Mark first added item as first and any other as last if (policy.getFilters().isEmpty()) { policy.getFilterPositionMap().put(guid, -1); } else { policy.getFilterPositionMap().put(guid, 1); } policy.getFilters().add(guid); } return this; } @SafeVarargs public final PolicyBuilder addFunction(Integer factor, Class<? extends PolicyUnitImpl>... functions) { for (Class<? extends PolicyUnitImpl> function: functions) { Guid guid = getGuidAndValidateType(function, PolicyUnitType.WEIGHT); policy.getFunctions().add(new Pair<>(guid, factor)); } return this; } public final PolicyBuilder setBalancer(Class<? extends PolicyUnitImpl> balancer) { policy.setBalance(getGuidAndValidateType(balancer, PolicyUnitType.LOAD_BALANCING)); return this; } private Guid getGuidAndValidateType(Class<? extends PolicyUnitImpl> unit, PolicyUnitType expectedType) { SchedulingUnit guid = unit.getAnnotation(SchedulingUnit.class); // This is only executed during application startup (class loading in fact) // and should never fail or we have a bug in the static initializer of this // class. if (guid == null) { throw new IllegalArgumentException(unit.getName() + " is missing the required SchedulingUnit annotation metadata."); } if (expectedType != guid.type()) { throw new IllegalArgumentException("Type " + expectedType.name() + " expected, but unit " + unit.getName() + " is of type " + guid.type().name()); } if (!InternalPolicyUnits.getList().contains(unit)) { throw new IllegalArgumentException("Policy unit " + unit.getName() + " is not present" + " in the list of enabled internal policy units."); } return Guid.createGuidFromString(guid.guid()); } private PolicyBuilder register() { clusterPolicies.put(policy.getId(), policy); return this; } } }
[ "rgolan@redhat.com" ]
rgolan@redhat.com
23f963ec536ad3229937415afcefbac3dd89ec4a
39ff77cee21d6cd141eeb1af743af22a33c8f4ae
/src/main/java/org.reactivestreams.extensions.sequenced/KeyedMessage.java
304520c9550528968440867bf4b371baf5af3d95
[]
no_license
RuedigerMoeller/reactive-streams-sequenced-proposal
52fd20e3a9e9c0ac484e40fe87fb4b8e24569512
f267c7bd5c1bc447025b6187e07edcf21190d258
refs/heads/master
2023-06-14T18:07:19.710629
2015-08-05T16:43:28
2015-08-05T16:43:28
39,892,261
3
0
null
null
null
null
UTF-8
Java
false
false
496
java
package org.reactivestreams.extensions.sequenced; /** * Created by ruedi on 29/07/15. * * Additional proposal * * a further message marker interface allowing for implementation of generic last value caches. * A last value cache can be used in persistent message queues to replace plain message replay. * E.g. for market data, one likely aims to store last market prices by stock instead of a full history * of price events. * */ public interface KeyedMessage { Object getKey(); }
[ "moru0011@gmail.com" ]
moru0011@gmail.com
be0ec8d6867b2123c781103d3ce005443060c7a4
31f043184e2839ad5c3acbaf46eb1a26408d4296
/src/main/java/com/github/highcharts4gwt/model/highcharts/option/jso/plotoptions/gauge/point/JsoRemoveEvent.java
5dd249db68a3f33f6b51e7ea6cdb640b075f35f0
[]
no_license
highcharts4gwt/highchart-wrapper
52ffa84f2f441aa85de52adb3503266aec66e0ac
0a4278ddfa829998deb750de0a5bd635050b4430
refs/heads/master
2021-01-17T20:25:22.231745
2015-06-30T15:05:01
2015-06-30T15:05:01
24,794,406
1
0
null
null
null
null
UTF-8
Java
false
false
546
java
package com.github.highcharts4gwt.model.highcharts.option.jso.plotoptions.gauge.point; import com.github.highcharts4gwt.model.highcharts.object.api.Point; import com.github.highcharts4gwt.model.highcharts.option.api.plotoptions.gauge.point.RemoveEvent; import com.google.gwt.dom.client.NativeEvent; public class JsoRemoveEvent extends NativeEvent implements RemoveEvent { protected JsoRemoveEvent() { } public final native Point point() throws RuntimeException /*-{ return this.source; }-*/ ; }
[ "ronan.quillevere@gmail.com" ]
ronan.quillevere@gmail.com
54910d991f21377d338d2a26afa599edae5c290a
fc62bd2a89f01e2664d6b212f08e493725c38146
/offer/ReverseList_24.java
798d25704d6f011777e1b92adbd6a8262061dcef
[]
no_license
Yang1998/coding
880fbe7503c5e0ce39d68afb799a74d6ca644475
7d0e27d359cf89d998c764560bfecf7a71908c24
refs/heads/master
2020-06-27T01:24:46.599762
2020-03-06T12:58:13
2020-03-06T12:58:13
199,809,153
0
0
null
null
null
null
UTF-8
Java
false
false
310
java
package offer; public class ReverseList_24 { public ListNode reverseList(ListNode node) { if(node == null || node.next == null) { return node; } ListNode cur = reverseList(node.next); node.next.next = node; node.next = null; return cur; } }
[ "yangtitian1998@gmail.com" ]
yangtitian1998@gmail.com
951509bf3e36b9f88dab517790b679522f52acc0
570ba8d7fab777fcedaa09a7b430a25482a75f3b
/nutan/read_emails.java
384866a0f0c83c4af0ead92036161f9212baaedb
[]
no_license
bosonfields/Algorithm_record
c02b211ab2da42103c8840c6eeca179c15033635
1987b0fd9cd69e99f6f7e6c5ae36580c571efc00
refs/heads/master
2020-05-05T11:08:57.464576
2020-02-28T02:48:55
2020-02-28T02:48:55
179,976,892
0
0
null
null
null
null
UTF-8
Java
false
false
654
java
public static void main(String[] args) { int[] arr = {1,1,0,0,1}; System.out.println(readAll(arr)); } public static int readAll(int[] emails){ if(emails.length == 0) return 0; int n = emails.length; int[] dp = new int[n]; dp[0] = emails[0] == 1 ? 1 : 0; for(int i = 1; i < n; i++){ if(emails[i] == 1){ dp[i] = dp[i - 1] + 1; } else{ dp[i] = dp[i - 1]; dp[i] += emails[i - 1] == 1 ? 1 : 0; } } if(emails[n - 1] == 0) dp[n - 1] -= 1; return dp[n - 1]; }
[ "lwh14710@gmail.com" ]
lwh14710@gmail.com
cfb72da54d681238bc485efc95194d6c3844c32e
d72223decd604f3fdda8aabfca3272012c690517
/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/model/ConsumerModel.java
e9e5f3a96811a832a45919083fb37d0fd7864333
[ "Apache-2.0" ]
permissive
wangyaomeng/dubbo-parent
aff8abfa13a5370211ea6a1d354f306c974f06b5
12a3b1d7626a50a568c73a535bb4358bb7b7789c
refs/heads/master
2022-12-05T08:12:14.324015
2020-08-31T14:13:58
2020-08-31T14:13:58
291,729,389
0
0
null
null
null
null
UTF-8
Java
false
false
2,535
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.alibaba.dubbo.config.model; import com.alibaba.dubbo.config.ReferenceConfig; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.IdentityHashMap; import java.util.List; import java.util.Map; public class ConsumerModel { private ReferenceConfig metadata; private Object proxyObject; private String serviceName; private final Map<Method, ConsumerMethodModel> methodModels = new IdentityHashMap<Method, ConsumerMethodModel>(); public ConsumerModel(String serviceName, ReferenceConfig metadata, Object proxyObject, Method[] methods) { this.serviceName = serviceName; this.metadata = metadata; this.proxyObject = proxyObject; if (proxyObject != null) { for (Method method : methods) { methodModels.put(method, new ConsumerMethodModel(method, metadata)); } } } /** * Return service metadata for consumer * * @return service metadata */ public ReferenceConfig getMetadata() { return metadata; } public Object getProxyObject() { return proxyObject; } /** * Return method model for the given method on consumer side * * @param method method object * @return method model */ public ConsumerMethodModel getMethodModel(Method method) { return methodModels.get(method); } /** * Return all method models for the current service * * @return method model list */ public List<ConsumerMethodModel> getAllMethods() { return new ArrayList<ConsumerMethodModel>(methodModels.values()); } public String getServiceName() { return serviceName; } }
[ "wangyaomeng0814@foxmail.com" ]
wangyaomeng0814@foxmail.com
9c57cf502979bf65b0836a2dbd1bb1f5d0c14b45
152e2092311725f750c86fcc14528015c727af38
/codes/src/尚硅谷面试题第二季/CallableDemo.java
cda7705e15f8ed60c807e61154f79e7f80bffebc
[]
no_license
coder-tq/study-notes
b558c5039eb8dea47b18dadff9003175eade7375
c6f0a6b9d269b203c7761fe4034cab8da8aa4ee2
refs/heads/main
2023-05-08T13:42:10.704596
2021-06-02T03:12:43
2021-06-02T03:12:43
367,073,353
1
0
null
null
null
null
UTF-8
Java
false
false
844
java
package 尚硅谷面试题第二季; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; import java.util.concurrent.FutureTask; import java.util.concurrent.TimeUnit; /** * @author coder_tq * @Date 2021/5/16 9:28 */ public class CallableDemo { public static void main(String[] args) throws ExecutionException, InterruptedException { FutureTask<Integer> futureTask = new FutureTask<>(new MyThread()); new Thread(futureTask,"AA").start(); futureTask.get(); } } class MyThread implements Callable<Integer>{ @Override public Integer call() throws Exception { System.out.println(Thread.currentThread().getName()+"Come in"); try { TimeUnit.MILLISECONDS.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } return 1024; } }
[ "909413805@qq.com" ]
909413805@qq.com
e4a7977797cf0678be90045dbe5b9a10f10fc8a9
7b93bbdf60b2e24e013ae762e472dad262103d72
/app/src/main/java/com/itbam/pixceler/util/FullScreen.java
ef1057f00acf53e3868c99605ac659d36c644a48
[]
no_license
clebernascimento/AppPix
6e2bbcaaf92888342b84720acd7435f507be23f6
84bfa1a3f7c43786ac19d82e3b402c7441fbd928
refs/heads/master
2023-01-22T03:09:33.491345
2020-12-01T12:41:25
2020-12-01T12:41:25
317,536,606
0
0
null
null
null
null
UTF-8
Java
false
false
1,068
java
package com.itbam.pixceler.util; import android.view.View; import androidx.appcompat.app.AppCompatActivity; import com.itbam.pixceler.view.activity.MainActivity; public class FullScreen extends MainActivity { private final AppCompatActivity mainActivity; public FullScreen(AppCompatActivity mainActivity) { this.mainActivity = mainActivity; } @Override public void onWindowFocusChanged(boolean hasFocus) { super.onWindowFocusChanged(hasFocus); if (hasFocus) { hideSystemUI(); } } private void hideSystemUI() { View decorView = mainActivity.getWindow().getDecorView(); decorView.setSystemUiVisibility( View.SYSTEM_UI_FLAG_IMMERSIVE | View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN); } }
[ "clebertds@gmail.com" ]
clebertds@gmail.com
7dcbcfff28293092c67f660baa4d38b50e22bd69
95c707860464880113a651ccac077d1159fba78f
/src/main/java/com/numericalmethod/suanshu/analysis/function/special/gamma/GammaRegularizedQ.java
dbe0ff555543f3d557985326f119b8e9983e21c3
[ "Apache-2.0" ]
permissive
FloFlo93/SuanShu
63eec9082c95e13f0fbd23e173bf329dad4273ce
450614a298bf7193b1ab430285a44828224272f4
refs/heads/master
2021-07-30T09:40:43.142596
2018-03-12T13:39:22
2018-03-12T13:39:22
186,459,542
0
0
Apache-2.0
2019-05-13T16:43:00
2019-05-13T16:43:00
null
UTF-8
Java
false
false
5,836
java
/* * Copyright (c) Numerical Method Inc. * http://www.numericalmethod.com/ * * THIS SOFTWARE IS LICENSED, NOT SOLD. * * YOU MAY USE THIS SOFTWARE ONLY AS DESCRIBED IN THE LICENSE. * IF YOU ARE NOT AWARE OF AND/OR DO NOT AGREE TO THE TERMS OF THE LICENSE, * DO NOT USE THIS SOFTWARE. * * THE SOFTWARE IS PROVIDED "AS IS", WITH NO WARRANTY WHATSOEVER, * EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, * ANY WARRANTIES OF ACCURACY, ACCESSIBILITY, COMPLETENESS, * FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, NON-INFRINGEMENT, * TITLE AND USEFULNESS. * * IN NO EVENT AND UNDER NO LEGAL THEORY, * WHETHER IN ACTION, CONTRACT, NEGLIGENCE, TORT, OR OTHERWISE, * SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR * ANY CLAIMS, DAMAGES OR OTHER LIABILITIES, * ARISING AS A RESULT OF USING OR OTHER DEALINGS IN THE SOFTWARE. */ package com.numericalmethod.suanshu.analysis.function.special.gamma; import static com.numericalmethod.suanshu.Constant.EPSILON; import com.numericalmethod.suanshu.analysis.function.rn2r1.BivariateRealFunction; import com.numericalmethod.suanshu.analysis.function.rn2r1.univariate.ContinuedFraction; import com.numericalmethod.suanshu.analysis.sequence.Summation; import com.numericalmethod.suanshu.misc.SuanShuUtils; import static com.numericalmethod.suanshu.number.DoubleUtils.compare; import static com.numericalmethod.suanshu.number.DoubleUtils.isZero; import static java.lang.Math.exp; import static java.lang.Math.log; /** * The Regularized Incomplete Gamma Q function is defined as: * \[ * Q(s,x)=\frac{\Gamma(s,x)}{\Gamma(s)}=1-P(s,x), s \geq 0, x \geq 0 * \] * The algorithm used for computing the regularized incomplete Gamma Q function depends on the values of <i>s</i> and <i>x</i>. * <ul> * <li>For \(s > 100\), <i>Q</i> is approximated using the Gauss-Legendre quadrature. * <li>For \(x < s + 1\), <i>Q</i> is approximated using the Pearson's series representation. * <li>Otherwise, <i>Q</i> is approximated using the continued fraction expression by Legendre. * </ul> * The R equivalent function is {@code pgamma}. E.g., {@code pgamma(x, s, lower=FALSE)}. * * @author Haksun Li * @see * <ul> * <li>"B Shea." Algorithm AS 239: Chi-squared and Incomplete Gamma Integral," Applied Statistics. Volume 37, Number 3, 1988, pages 466-473." * <li><a href="http://en.wikipedia.org/wiki/Regularized_Gamma_function#Regularized_Gamma_functions_and_Poisson_random_variables">Wikipedia: Regularized Gamma functions and Poisson random variables</a> * </ul> */ public class GammaRegularizedQ extends BivariateRealFunction {//TODO: extend to the Complex domain private static final LogGamma lgamma = new LogGamma(); private static final double epsilon = EPSILON; /** * Evaluate <i>Q(s,x)</i>. * * @param s <i>s &ge; 0</i> * @param x <i>x &ge; 0</i> * @return <i>Q(s,x)</i> */ @Override public double evaluate(double s, double x) { SuanShuUtils.assertArgument(compare(s, 0, epsilon) >= 0, "s must be >= 0"); SuanShuUtils.assertArgument(compare(x, 0, epsilon) >= 0, "x < 0 gives complex number; not supported yet"); //special cases if (isZero(s, 0)) {//Q(0, 0) = 0 return 0; } else if (isZero(x, 0)) { return 1; } else if (x > 1e8) { return 0; // } else if (s > 100) {//Gauss-Legendre quadrature // return evaluateByQuadrature(s, x); } else if (x < s + 1) {//{@code true} when x < 1 for all s; series representation converges faster return evaluateBySeries(s, x); } else {//x <= s + 1 < 100 + 1 return evaluateByCF(s, x); } } private double evaluateByQuadrature(final double s, final double x) {//TODO throw new UnsupportedOperationException("Not supported yet."); } /** * Evaluate <i>Q(s,x)</i> using the Pearson's series representation. * * @param s <i>s &ge; 0</i> * @param x <i>x &ge; 0</i> * @return <i>Q(s,x)</i> */ private double evaluateBySeries(final double s, final double x) { Summation series = new Summation(new Summation.Term() { double term; @Override public double evaluate(double n) { if (n == 0) { term = 1d / s; } else { term *= x / (s + n); } return term; } }, epsilon); double sum = series.sumToInfinity(0); double result = s * log(x) - x - lgamma.evaluate(s); result = exp(result); return 1d - result * sum; } /** * Evaluate <i>Q(s,x)</i> using the continued fraction expression by Legendre. * * @param s <i>s &ge; 0</i> * @param x <i>x &ge; 0</i> * @return <i>Q(s,x)</i> */ private double evaluateByCF(final double s, final double x) { ContinuedFraction cf = new ContinuedFraction(new ContinuedFraction.Partials() { @Override public double A(int n, double u) { if (n == 1) { return 1; } else { return (n - 1) * (s - (n - 1)); } } @Override public double B(int n, double u) { if (n == 0) { return 0; } else { return 2 * n - 1 - s + u; } } }); double result = s * log(x) - x - lgamma.evaluate(s); result = exp(result); result *= cf.evaluate(x); return result; } }
[ "aaiyer@gmail.com" ]
aaiyer@gmail.com
068f755b3cab49709c30cae153f01737a2bef024
ece937dff9f46e1420594c28fed6c909c75244b2
/day3/src/main/java/com/springbook/biz/board/BoardListVO.java
c1451d428f34cd9e26c76459a91e79ff83797a66
[]
no_license
dokylee54/java-spring-boardEx
788b7348ca71144e03ef51ad254aad0d39db19cd
6a170a244da5d6eeb87c5abe6e389bee95c3df9d
refs/heads/master
2022-11-19T00:48:08.337714
2020-03-03T11:29:15
2020-03-03T11:29:15
243,509,628
1
1
null
2022-11-16T00:41:49
2020-02-27T12:05:09
Java
UTF-8
Java
false
false
597
java
package com.springbook.biz.board; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import java.util.List; @XmlRootElement(name = "boardList") @XmlAccessorType(XmlAccessType.FIELD) public class BoardListVO { @XmlElement(name = "board") private List<BoardVO> boardList; public List<BoardVO> getBoardList() { return boardList; } public void setBoardList(List<BoardVO> boardList) { this.boardList = boardList; } }
[ "dokylee54@gmail.com" ]
dokylee54@gmail.com
35954cdda62080b47874e51417503cfe2934068a
6b4ba8495e8858342528d7eb7174f5385489bf32
/app/src/main/java/com/fafu/polutionrepo/finished/SlideSwapHelper/ItemSlideCallback.java
ed3d0b2286b679f13bfe1f0d34e2f4b19bb0016d
[ "Apache-2.0" ]
permissive
lyx19970504/Weather
3976bff75ead9f6562e0b86672498ed8688d219e
cc03b1bdb9e1995ac6f00044626a220f74e5226c
refs/heads/master
2020-05-17T05:49:23.863003
2019-06-19T08:00:41
2019-06-19T08:00:41
183,544,453
1
0
null
null
null
null
UTF-8
Java
false
false
1,721
java
package com.fafu.polutionrepo.finished.SlideSwapHelper; import android.graphics.Canvas; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.helper.ItemTouchHelper; public class ItemSlideCallback extends WItemTouchHelperPlus.Callback { private String type; public void setType(String type){ this.type = type; } @Override int getSlideViewWidth() { return 0; } @Override public int getMovementFlags(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) { return makeMovementFlags(0, ItemTouchHelper.START); } @Override public String getItemSlideType() { return type; } @Override public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target) { return false; } @Override public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) { } @Override public boolean isItemViewSwipeEnabled() { return true; } @Override public void onChildDraw(Canvas c, RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, float dX, float dY, int actionState, boolean isCurrentlyActive) { if (viewHolder instanceof SlideSwapAction) { SlideSwapAction holder = (SlideSwapAction) viewHolder; float actionWidth = holder.getActionWidth(); if (dX < -actionWidth) { dX = -actionWidth; } holder.ItemView().setTranslationX(dX); } } @Override public void clearView(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) { super.clearView(recyclerView, viewHolder); } }
[ "lyx19970504@outlook.com" ]
lyx19970504@outlook.com
6f7925c8e8517c2163e1e477c4359cda7c3df345
6ecd996ecbd4f11555096ca22dd4a630ed151265
/seata-storage-service2002/src/main/java/com/cf/spring/cloud/alibaba/config/DataSourceProxyConfig.java
7b6cd51633f6025c142f767a4688c9fb9a3c0f2a
[]
no_license
cf1429/cloud2020
642b170a37b5585eea1ace71adab52fc619d91c4
dc5b104b0eeddb06b36e1dbad2de616a99be7d4c
refs/heads/master
2022-08-23T05:42:30.992711
2021-08-06T08:04:27
2021-08-06T08:04:27
251,238,790
0
0
null
2022-06-21T03:06:13
2020-03-30T07:59:21
Java
UTF-8
Java
false
false
1,469
java
package com.cf.spring.cloud.alibaba.config; import com.alibaba.druid.pool.DruidDataSource; import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean; import org.apache.ibatis.session.SqlSessionFactory; import org.mybatis.spring.SqlSessionFactoryBean; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.io.support.PathMatchingResourcePatternResolver; import javax.sql.DataSource; @Configuration public class DataSourceProxyConfig { @Value("${mybatis-plus.mapper-locations}") private String mapperLocations; @Bean @ConfigurationProperties(prefix = "spring.datasource") public DataSource druidDataSource(){ return new DruidDataSource(); } // public DataSourceProxy dataSourceProxy(DataSource dataSource){ // return new DataSourceProxyImpl(dataSource); // } @Bean public SqlSessionFactory sqlSessionFactory( DataSource dataSource) throws Exception { MybatisSqlSessionFactoryBean factoryBean = new MybatisSqlSessionFactoryBean(); factoryBean.setDataSource(dataSource); factoryBean.setMapperLocations(new PathMatchingResourcePatternResolver() .getResources(mapperLocations)); return factoryBean.getObject(); } }
[ "1429043932@qq.com" ]
1429043932@qq.com
8419dc3b12505daa46e6acb63dbb1e41e8678495
fa94c270905ae6f8cd1247b5a4d6267b9ec208ba
/src/it/polimi/ingsw2020/ex4/GenericStack.java
22e0c0c2b7ff809cf8d9a6818cefd13e5e37e064
[]
no_license
gioenn/ingsw-2020
c7955842b813f8124f882d5c76b148a9ab695555
cf86585c0195e6b572fb3702e04b4d3bb5c5151a
refs/heads/master
2023-01-20T08:58:39.207754
2020-11-24T08:45:09
2020-11-24T08:45:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,024
java
package it.polimi.ingsw2020.ex4; import it.polimi.ingsw2020.ex3.Square; import java.util.Iterator; import java.util.LinkedList; public class GenericStack<E> implements Iterable<E> { protected LinkedList<E> data = new LinkedList<>(); private int size; public GenericStack(int size){ this.size = size; } public void push(E elem) throws OutOfSpaceException { if (data.size() == size) throw new OutOfSpaceException(); data.addFirst(elem); } public E pop() { if (data.size() == 0) throw new OutOfDataException(); return data.removeFirst(); } @Override public Iterator<E> iterator() { System.out.println("ITERATOR"); return new StackIterator(); } private class StackIterator implements Iterator<E>{ private int idx = 0; @Override public boolean hasNext() { System.out.println("HAS NEXT"); return idx < data.size(); } @Override public E next() { System.out.println("NEXT"); return data.get(idx++); } } public static void main(String[] args) throws OutOfSpaceException { GenericStack<String> s = new GenericStack<>(5); s.push("A"); s.push("B"); System.out.println(s.pop()); System.out.println(s.pop()); GenericStack<Square> s1 = new GenericStack<>(5); s1.push(new Square(3)); System.out.println("Iterator:"); s.push("C"); s.push("D"); s.push("E"); s.pop(); Iterator<String> i = s.iterator(); while(i.hasNext()) System.out.println(i.next()); for(String elem : s){ // codice utente System.out.println(elem); } /* compilato in for(Iterator<String> i = s.iterator(); i.hasNext(); ){ String elem = i.next(); // codice utente ... } */ } }
[ "giovanniquattrocchi@me.com" ]
giovanniquattrocchi@me.com
d74642e84deb656d37dc3eb21cd99fbe518babb4
53ae302356e9229edbd13f7380bb6dc8bed458da
/src/main/java/xin/cymall/CyFastApplication.java
41bb4d236b309a1a4e5263bed732f04c8b12300b
[ "Apache-2.0" ]
permissive
cl330533960/take
41060755288055309e207983d4d13c9921d07871
12cc2431ed50eaa0a54cb3eaa4939e2f3ef7afb2
refs/heads/master
2022-12-08T15:38:05.976821
2020-11-10T09:02:25
2020-11-10T09:02:25
193,087,452
0
0
Apache-2.0
2022-12-06T00:43:01
2019-06-21T11:35:07
JavaScript
UTF-8
Java
false
false
850
java
package xin.cymall; import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; @SpringBootApplication(exclude = {org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class}) // mapper 接口类扫描包配置 @MapperScan("xin.cymall.dao") public class CyFastApplication extends SpringBootServletInitializer { @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { return builder.sources(CyFastApplication.class); } public static void main(String[] args) { SpringApplication.run(CyFastApplication.class, args); } }
[ "330533960@qq.com" ]
330533960@qq.com
477212078b25e484f761b01abd8809201106a5e8
e7d4f10e6a2b2397c7621a9a94472efc197b4392
/Wallet/src/test/java/money/wallet/api/WalletServiceTests.java
b50c5bb8e0c5148a2851cc352aa3754bcaf8ba96
[]
no_license
FyiurAmron/WalletMicroservice
b04caf8959b8a889c65740d7d9553a1994afd876
00a6bc5dd4464aaca808a839199e10da8fada27b
refs/heads/main
2023-08-25T04:17:57.651004
2021-10-12T03:06:17
2021-10-12T03:06:17
415,052,096
0
0
null
null
null
null
UTF-8
Java
false
false
17,026
java
package money.wallet.api; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.annotation.DirtiesContext; import javax.persistence.EntityExistsException; import javax.persistence.EntityNotFoundException; import java.util.List; import money.wallet.api.data.*; import money.wallet.api.exception.IllegalOperationAmountException; import money.wallet.api.service.RepositoryWalletService; import static org.junit.jupiter.api.Assertions.*; @Tag( TestUtils.INTEGRATION_TAG ) @SpringBootTest @AutoConfigureTestDatabase @DirtiesContext( classMode = DirtiesContext.ClassMode.BEFORE_EACH_TEST_METHOD ) // alternatively, to speed things up, create a context doing a DB reset at setup public class WalletServiceTests { private static final long EXAMPLE_TRANSACTION_ID = 1337; private static final long EXAMPLE_AMOUNT = 42; private static final int OP_REPEATS = 5; @Autowired private RepositoryWalletService walletService; // we don't expose this type of comparison in WalletAmount to not pollute the implementation private void assertAmountEquals( Long nullableAmount, WalletAmount walletAmount ) { assertEquals( nullableAmount == null ? null : new WalletAmount( nullableAmount ), walletAmount ); } private void assertOperationResults( WalletOperation walletOperation, WalletOperationType type, Long amount, Long balanceBefore, Long balanceAfter, Long transactionId ) { assertEquals( type, walletOperation.type() ); assertAmountEquals( amount, walletOperation.amount() ); assertAmountEquals( balanceBefore, walletOperation.balanceBefore() ); assertAmountEquals( balanceAfter, walletOperation.balanceAfter() ); assertEquals( transactionId, walletOperation.transactionId() ); } @Test public void isWalletCreatedEmpty() { WalletOperation createWalletOperation = walletService.createWallet( EXAMPLE_TRANSACTION_ID ); assertOperationResults( createWalletOperation, WalletOperationType.CREATE, null, null, 0L, EXAMPLE_TRANSACTION_ID ); } @Test public void isWalletBalanceZeroAfterCreation() { WalletOperation createWalletOperation = walletService.createWallet( EXAMPLE_TRANSACTION_ID ); WalletOperation balanceWalletOperation = walletService.getBalance( createWalletOperation.walletId() ); assertOperationResults( balanceWalletOperation, WalletOperationType.BALANCE, null, 0L, 0L, null ); } @Test public void throwsOnCreateWithNonUniqueIds() { walletService.createWallet( EXAMPLE_TRANSACTION_ID ); assertThrows( EntityExistsException.class, () -> walletService.createWallet( EXAMPLE_TRANSACTION_ID ) ); } @Test public void areAmountsProperlyDeposited() { WalletOperation createWalletOperation = walletService.createWallet( EXAMPLE_TRANSACTION_ID ); WalletOperation makeDepositWalletOperation = walletService.makeDeposit( createWalletOperation.walletId(), EXAMPLE_AMOUNT, EXAMPLE_TRANSACTION_ID + 1 ); assertOperationResults( makeDepositWalletOperation, WalletOperationType.DEPOSIT, EXAMPLE_AMOUNT, 0L, EXAMPLE_AMOUNT, EXAMPLE_TRANSACTION_ID + 1 ); WalletOperation makeDepositWalletResponse2 = walletService.makeDeposit( createWalletOperation.walletId(), EXAMPLE_AMOUNT * 2, EXAMPLE_TRANSACTION_ID + 2 ); assertOperationResults( makeDepositWalletResponse2, WalletOperationType.DEPOSIT, EXAMPLE_AMOUNT * 2, EXAMPLE_AMOUNT, EXAMPLE_AMOUNT * 3, EXAMPLE_TRANSACTION_ID + 2 ); } @Test public void areMultipleDepositsSummedCorrectly() { WalletOperation createWalletOperation = walletService.createWallet( EXAMPLE_TRANSACTION_ID ); for ( int i = 0; i < OP_REPEATS; i++ ) { walletService.makeDeposit( createWalletOperation.walletId(), EXAMPLE_AMOUNT, EXAMPLE_TRANSACTION_ID + 2 + i ); } long finalBalance = walletService.getBalance( createWalletOperation.walletId() ).balanceBefore().value(); assertEquals( EXAMPLE_AMOUNT * OP_REPEATS, finalBalance ); } @Test public void throwsOnDepositsWithNonUniqueIds() { WalletOperation createWalletOperation = walletService.createWallet( EXAMPLE_TRANSACTION_ID ); walletService.makeDeposit( createWalletOperation.walletId(), EXAMPLE_AMOUNT, EXAMPLE_TRANSACTION_ID + 1 ); assertThrows( EntityExistsException.class, () -> walletService.makeDeposit( createWalletOperation.walletId(), EXAMPLE_AMOUNT * 2, EXAMPLE_TRANSACTION_ID + 1 ) ); } @Test public void throwsOnNegativeDeposits() { WalletOperation createWalletOperation = walletService.createWallet( EXAMPLE_TRANSACTION_ID ); assertThrows( IllegalOperationAmountException.class, () -> walletService.makeDeposit( createWalletOperation.walletId(), -EXAMPLE_AMOUNT, EXAMPLE_TRANSACTION_ID + 1 ) ); } @Test public void throwsOnZeroDeposits() { WalletOperation createWalletOperation = walletService.createWallet( EXAMPLE_TRANSACTION_ID ); assertThrows( IllegalOperationAmountException.class, () -> walletService.makeDeposit( createWalletOperation.walletId(), 0, EXAMPLE_TRANSACTION_ID + 1 ) ); } @Test public void throwsOnNegativeWithdrawals() { WalletOperation createWalletOperation = walletService.createWallet( EXAMPLE_TRANSACTION_ID ); walletService.makeDeposit( createWalletOperation.walletId(), EXAMPLE_AMOUNT, EXAMPLE_TRANSACTION_ID + 1 ); assertThrows( IllegalOperationAmountException.class, () -> walletService.makeWithdrawal( createWalletOperation.walletId(), -EXAMPLE_AMOUNT, EXAMPLE_TRANSACTION_ID + 2 ) ); } @Test public void throwsOnZeroWithdrawals() { WalletOperation createWalletOperation = walletService.createWallet( EXAMPLE_TRANSACTION_ID ); walletService.makeDeposit( createWalletOperation.walletId(), EXAMPLE_AMOUNT, EXAMPLE_TRANSACTION_ID + 1 ); assertThrows( IllegalOperationAmountException.class, () -> walletService.makeWithdrawal( createWalletOperation.walletId(), 0, EXAMPLE_TRANSACTION_ID + 2 ) ); } @Test public void throwsOnWithdrawalsWithNonUniqueIds() { WalletOperation createWalletOperation = walletService.createWallet( EXAMPLE_TRANSACTION_ID ); walletService.makeDeposit( createWalletOperation.walletId(), EXAMPLE_AMOUNT * 3, EXAMPLE_TRANSACTION_ID + 1 ); walletService.makeWithdrawal( createWalletOperation.walletId(), EXAMPLE_AMOUNT, EXAMPLE_TRANSACTION_ID + 2 ); assertThrows( EntityExistsException.class, () -> walletService.makeWithdrawal( createWalletOperation.walletId(), EXAMPLE_AMOUNT, EXAMPLE_TRANSACTION_ID + 2 ) ); } @Test public void throwsOnMixedOpsWithNonUniqueIds() { WalletOperation createWalletOperation = walletService.createWallet( EXAMPLE_TRANSACTION_ID ); assertThrows( EntityExistsException.class, () -> walletService.createWallet( EXAMPLE_TRANSACTION_ID ) ); walletService.makeDeposit( createWalletOperation.walletId(), EXAMPLE_AMOUNT * 3, EXAMPLE_TRANSACTION_ID + 1 ); assertThrows( EntityExistsException.class, () -> walletService.makeDeposit( createWalletOperation.walletId(), EXAMPLE_AMOUNT * 3, EXAMPLE_TRANSACTION_ID // used by create ) ); assertThrows( EntityExistsException.class, () -> walletService.makeDeposit( createWalletOperation.walletId(), EXAMPLE_AMOUNT * 3, EXAMPLE_TRANSACTION_ID + 1 // used by deposit ) ); walletService.makeWithdrawal( createWalletOperation.walletId(), EXAMPLE_AMOUNT, EXAMPLE_TRANSACTION_ID + 2 ); assertThrows( EntityExistsException.class, () -> walletService.makeWithdrawal( createWalletOperation.walletId(), EXAMPLE_AMOUNT, EXAMPLE_TRANSACTION_ID // used by create ) ); assertThrows( EntityExistsException.class, () -> walletService.makeWithdrawal( createWalletOperation.walletId(), EXAMPLE_AMOUNT, EXAMPLE_TRANSACTION_ID + 1 // used by deposit ) ); assertThrows( EntityExistsException.class, () -> walletService.makeWithdrawal( createWalletOperation.walletId(), EXAMPLE_AMOUNT, EXAMPLE_TRANSACTION_ID + 2 // used by withdrawal ) ); } @Test public void throwsOnBalanceExceeded() { WalletOperation createWalletOperation = walletService.createWallet( EXAMPLE_TRANSACTION_ID ); walletService.makeDeposit( createWalletOperation.walletId(), EXAMPLE_AMOUNT * 2, EXAMPLE_TRANSACTION_ID + 1 ); assertThrows( IllegalOperationAmountException.class, () -> walletService.makeWithdrawal( createWalletOperation.walletId(), EXAMPLE_AMOUNT * 2 + 1, EXAMPLE_TRANSACTION_ID + 2 ) ); walletService.makeWithdrawal( createWalletOperation.walletId(), EXAMPLE_AMOUNT, EXAMPLE_TRANSACTION_ID + 2 ); assertThrows( IllegalOperationAmountException.class, () -> walletService.makeWithdrawal( createWalletOperation.walletId(), EXAMPLE_AMOUNT + 1, EXAMPLE_TRANSACTION_ID + 3 ) ); } @Test public void isCompleteWithdrawalInSequenceOfWithdrawalsPossible() { WalletOperation createWalletOperation = walletService.createWallet( EXAMPLE_TRANSACTION_ID ); walletService.makeDeposit( createWalletOperation.walletId(), EXAMPLE_AMOUNT * OP_REPEATS, EXAMPLE_TRANSACTION_ID + 1 ); for ( int i = 0; i < OP_REPEATS; i++ ) { walletService.makeWithdrawal( createWalletOperation.walletId(), EXAMPLE_AMOUNT, EXAMPLE_TRANSACTION_ID + 2 + i ); } long finalBalance = walletService.getBalance( createWalletOperation.walletId() ).balanceBefore().value(); assertEquals( 0, finalBalance ); } @Test public void throwsOnBalanceMaximumExceeded() { WalletOperation createWalletOperation = walletService.createWallet( EXAMPLE_TRANSACTION_ID ); assertThrows( IllegalOperationAmountException.class, () -> walletService.makeDeposit( createWalletOperation.walletId(), WalletAmount.MAX_AMOUNT + 1, EXAMPLE_TRANSACTION_ID + 1 ) ); walletService.makeDeposit( createWalletOperation.walletId(), WalletAmount.MAX_AMOUNT, EXAMPLE_TRANSACTION_ID + 1 ); assertThrows( IllegalOperationAmountException.class, () -> walletService.makeDeposit( createWalletOperation.walletId(), 1, EXAMPLE_TRANSACTION_ID + 2 ) ); } // id=1 would usually be the 1st one autogenerated, but it shouldn't exist yet @Test public void throwsOnBalanceForNonexistentWallet() { assertThrows( EntityNotFoundException.class, () -> walletService.getBalance( 1 ) ); } @Test public void throwsOnDepositForNonexistentWallet() { assertThrows( EntityNotFoundException.class, () -> walletService.makeDeposit( 1, EXAMPLE_AMOUNT, EXAMPLE_TRANSACTION_ID ) ); } @Test public void throwsOnWithdrawalForNonexistentWallet() { assertThrows( EntityNotFoundException.class, () -> walletService.makeWithdrawal( 1, EXAMPLE_AMOUNT, EXAMPLE_TRANSACTION_ID ) ); } @Test public void throwsOnStatementForNonexistentWallet() { assertThrows( EntityNotFoundException.class, () -> walletService.getStatement( 1 ) ); } @Test public void isSimpleStatementValid() { WalletOperation createWalletOperation = walletService.createWallet( EXAMPLE_TRANSACTION_ID ); walletService.makeDeposit( createWalletOperation.walletId(), EXAMPLE_AMOUNT * 9, EXAMPLE_TRANSACTION_ID + 1 ); walletService.makeWithdrawal( createWalletOperation.walletId(), EXAMPLE_AMOUNT * 3, EXAMPLE_TRANSACTION_ID + 2 ); walletService.makeWithdrawal( createWalletOperation.walletId(), EXAMPLE_AMOUNT * 2, EXAMPLE_TRANSACTION_ID + 3 ); WalletStatement walletStatement = walletService.getStatement( createWalletOperation.walletId() ); List<WalletOperation> walletTransactionViewLists = walletStatement.walletStatementItems(); assertEquals( 4, walletTransactionViewLists.size() ); assertOperationResults( walletTransactionViewLists.get( 0 ), WalletOperationType.CREATE, null, null, 0L, EXAMPLE_TRANSACTION_ID ); assertOperationResults( walletTransactionViewLists.get( 1 ), WalletOperationType.DEPOSIT, EXAMPLE_AMOUNT * 9, 0L, EXAMPLE_AMOUNT * 9, EXAMPLE_TRANSACTION_ID + 1 ); assertOperationResults( walletTransactionViewLists.get( 2 ), WalletOperationType.WITHDRAWAL, EXAMPLE_AMOUNT * 3, EXAMPLE_AMOUNT * 9, EXAMPLE_AMOUNT * 6, EXAMPLE_TRANSACTION_ID + 2 ); assertOperationResults( walletTransactionViewLists.get( 3 ), WalletOperationType.WITHDRAWAL, EXAMPLE_AMOUNT * 2, EXAMPLE_AMOUNT * 6, EXAMPLE_AMOUNT * 4, EXAMPLE_TRANSACTION_ID + 3 ); long finalBalance = walletService.getBalance( createWalletOperation.walletId() ).balanceBefore().value(); assertEquals( EXAMPLE_AMOUNT * 4, finalBalance ); } /* @Test public void isWalletRemoved() { } */ }
[ "spamove@gmail.com" ]
spamove@gmail.com
6832b869f382f4895e9b7e03d20b1383ae457ead
d86af457d83c30c20daa5589099845d57b47e73e
/fireflow-fpdl20/src/main/java/org/fireflow/pdl/fpdl/process/features/startnode/TimerStartFeature.java
8b1cf7ca444eaa2d3f21bbcd6f57601e5efc6c93
[]
no_license
liudianpeng/FireflowEngine20
f407251e12c9c8b4aeda2d6043b121949187911d
774bdd82b27b8d4822168038a86aa33ae14185ab
refs/heads/master
2021-01-11T03:18:44.600542
2015-03-29T15:37:06
2015-03-29T15:37:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
890
java
package org.fireflow.pdl.fpdl.process.features.startnode; import org.fireflow.engine.invocation.TimerOperationName; import org.fireflow.model.data.Expression; import org.fireflow.pdl.fpdl.process.Activity; import org.fireflow.pdl.fpdl.process.features.Feature; public interface TimerStartFeature extends Feature { public Activity getAttachedToActivity(); public void setAttachedToActivity(Activity act); /** * 该字段表示事件触发时,是否将所依附的Activity取消。默认为不取消(false) * @return */ public boolean getCancelAttachedToActivity(); public TimerOperationName getTimerOperationName(); public Expression getStartTimeExpression(); public Expression getEndTimeExpression(); public Expression getRepeatCountExpression(); public Expression getRepeatIntervalExpression(); public Expression getCronExpression(); }
[ "nychen2000@163.com" ]
nychen2000@163.com
deb7641ad3e14c1f13a4c235936dc237c0ce9578
651fa3ae55e2af38685c111026b8134712a0eb2c
/demo/src/main/java/com/hippo/conductor/attacher/demo/MainActivity.java
154ed1f6dc7ce7744372ada1ebf8626df267cef4
[ "Apache-2.0" ]
permissive
t894924815/conductor-attacher
f5bacfb4ee7ead9d3f8f0a7c9419d01bc727b711
368e6b5a54ae7c26732639d680bb6d5a0e030c8a
refs/heads/master
2021-01-20T00:27:19.503551
2017-04-17T14:51:26
2017-04-17T14:51:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,710
java
/* * Copyright 2017 Hippo Seven * * 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.hippo.conductor.attacher.demo; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.ListView; public class MainActivity extends AppCompatActivity { private static final String[] TITLES = { "Normal", "With Attacher", }; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ListView listView = (ListView) findViewById(R.id.list); listView.setAdapter(new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, TITLES)); listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { startActivity( new Intent(MainActivity.this, ControllerActivity.class) .putExtra(ControllerActivity.KEY_USE_ATTACHER, position != 0) ); } }); } }
[ "seven332@163.com" ]
seven332@163.com
7833684ee9339b3e57d85de3d3b535610a2f21ae
2eac4f51a2e4363349e852ce3af8ca234c1a13f7
/fx/trunk/fx-backtest/src/main/java/com/jeff/fx/indicator/indicator/Stochastic.java
3f8929919c677d96ebf503b9e94dc17307971beb
[]
no_license
johnffracassi/jcfx
4e19ac0fdba174db0fe3eb2fc8848652a5c99c11
b0a2349fdd1de0bf60c7ccf9a17af4e43e0a1727
refs/heads/master
2016-09-05T15:13:49.981403
2011-07-21T05:54:28
2011-07-21T05:54:28
41,260,482
0
0
null
null
null
null
UTF-8
Java
false
false
1,238
java
package com.jeff.fx.indicator.indicator; import org.springframework.stereotype.Component; import com.jeff.fx.indicator.ChartType; import com.jeff.fx.indicator.ChartTypes; import com.jeff.fx.indicator.TAWrapper; import com.tictactec.ta.lib.Core; import com.tictactec.ta.lib.MAType; import com.tictactec.ta.lib.MInteger; @Component @ChartType(ChartTypes.Oscillator) public final class Stochastic extends TAWrapper { private int fastK; private int slowK; private MAType maType; public Stochastic() { this(5, 2); } public Stochastic(int fastK, int slowK) { this.fastK = fastK; this.slowK = slowK; } public void calculate(Core core, float[] open, float[] high, float[] low, float[] close, MInteger startIdx, double values[][]) { core.stoch(0, close.length-1, high, low, close, fastK, slowK, maType, 5, maType, startIdx, new MInteger(), values[0], values[1]); } @Override public String getKey() { return "stoch"; } @Override public String getDisplayName() { return getKey() + "(" + fastK + "," + slowK + ")"; } @Override public void setParams(Object... params) { } }
[ "jeffcann@360c4b46-674e-11de-9b35-9190732fe600" ]
jeffcann@360c4b46-674e-11de-9b35-9190732fe600
a800f80345c5d8d1929494d3f8e8ce2fcd8eb91e
3aa88e1aebf61523f7f2f3a4ba93a497b2e23aa2
/wooso_baboo/src/wooso_baboo/AccountTest.java
29d3f52d9a4a89e011a3f99c01635cc36896e60a
[]
no_license
woosoyeon97/Account
0ce9864b9a6d594f414b5121cc01cd06373bd0d6
c63d3951ce28da0effee7044b135365f7499cdc3
refs/heads/master
2021-01-22T22:28:10.993993
2017-04-09T12:27:52
2017-04-09T12:27:52
85,546,207
0
0
null
null
null
null
UHC
Java
false
false
2,443
java
package wooso_baboo; import java.util.Scanner; public class AccountTest { public static void main(String[] args){ Account account1=new checkingAccount(100,50,0.01,0.07); Account account2=new SavingAccount(100,0.05); Scanner input=new Scanner(System.in); double amount; System.out.printf("Account1 balance:$ %.2f\t현재출금가능금액: %.2f\n",account1.getAccount(),account1.getwithdrawableAccount());//account1의 입금을 받음 System.out.println("Enter withdrawal amount for Account1: "); amount=input.nextDouble(); account1.debit(amount); System.out.printf("Account1 balance:$ %.2f\t현재출금가능금액: %.2f\n",account1.getAccount(),account1.getwithdrawableAccount()); if(((checkingAccount)account1).isBankrupted()==false){ System.out.println("account1 went Bankrupt!"); } account1.passTime(1); System.out.printf("Account1 balance:$ %.2f\t현재출금가능금액: %.2f\n",account1.getAccount(),account1.getwithdrawableAccount()); if(((checkingAccount)account1).isBankrupted()==false){ System.out.println("account1 went Bankrupt!"); } account1.passTime(5); System.out.printf("Account1 balance:$ %.2f\t현재출금가능금액: %.2f\n",account1.getAccount(),account1.getwithdrawableAccount()); if(((checkingAccount)account1).isBankrupted()==false){ System.out.println("account1 went Bankrupt!"); } //SavingAccount System.out.println();; System.out.printf("Account2 balance:$ %.2f\t현재출금가능금액: %.2f\n",account2.getAccount(),account2.getwithdrawableAccount()); System.out.println("6 Month later"); account2.passTime(6); System.out.printf("Account2 balance:$ %.2f\t현재출금가능금액: %.2f\n",account2.getAccount(),account2.getwithdrawableAccount()); account2.debit(50); System.out.println("next 6 Month later"); account2.passTime(6); System.out.printf("Account2 balance:$ %.2f\t현재출금가능금액: %.2f\n",account2.getAccount(),account2.getwithdrawableAccount()); System.out.println("next 1 Month later!"); account2.passTime(1); System.out.printf("Account2 balance:$ %.2f\t현재출금가능금액: %.2f\n",account2.getAccount(),account2.getwithdrawableAccount()); account2.debit(50); System.out.printf("Account2 balance:$ %.2f\t현재출금가능금액: %.2f\n",account2.getAccount(),account2.getwithdrawableAccount()); } }
[ "KAU@KAU-PC" ]
KAU@KAU-PC
9eb9ad56af568b1c8f0f1a7c6c77793a6b6fc78e
79cc3088b2e97a726880b0b2c2aa1c8c4435c58d
/InfoNote_14/src/util/GerarSenha.java
bc3ce6e8a1f2bd63d1fcde823874855140f5ddbb
[]
no_license
JotaPe/java-senai
3b5bb8955726117a0396e7bbf548b20cb3b492aa
f7ee8260c78da0e8429210d7a38f450a2c7ebed6
refs/heads/master
2019-07-08T03:05:06.105708
2018-03-15T01:43:46
2018-03-15T01:43:46
125,157,130
1
0
null
null
null
null
ISO-8859-1
Java
false
false
908
java
package util; public class GerarSenha { public static String gerarSenha(){ String senha = ""; for (int i = 0; i < 8; i++) senha += gerarCaracter(i); return senha; } public static char gerarCaracter(int i){ char caracter = 0; switch (i % 4){ case 0: // Intervalo de Letras Maiúsculas na Tabela ASCII caracter = gerarAleatorio(65,90); break; case 1: // Intervalo de Letras Minúsculas na Tabela ASCII caracter = gerarAleatorio(97,122); break; case 2: // Intervalo de Números na Tabela ASCII caracter = gerarAleatorio(48,57); break; case 3: // Intervalo de Números na Tabela ASCII caracter = gerarAleatorio(33,47); break; } return caracter; } public static char gerarAleatorio(int inicio, int fim){ return (char) (Math.random() * (fim - inicio + 1) + inicio); } }
[ "jotape@protonmail.com" ]
jotape@protonmail.com
a408c5d992dbf425ae05ae18122747b81d311311
c00da088725b75aad7546d0ea87ecc938b824879
/src/main/java/com/briup/apps/poll/web/controller/AnswersCotroller.java
d4ef180499d4f01f0162657187f9323df1a7f1ea
[]
no_license
6WE6/poll2
df17d5149e821ede06090b9232f7a9a13eec612c
81da29f5713ecbd595824a918f7ee3b28c79dd62
refs/heads/master
2020-03-21T13:19:05.594718
2018-07-25T06:33:29
2018-07-25T06:33:29
138,599,456
4
3
null
null
null
null
UTF-8
Java
false
false
4,621
java
package com.briup.apps.poll.web.controller; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import com.briup.apps.poll.bean.Answers; import com.briup.apps.poll.bean.extend.AnswersVM; import com.briup.apps.poll.service.IAnswersService; import com.briup.apps.poll.util.MsgResponse; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @Api(description = "答题卡相关接口") @RestController @RequestMapping("/answer") public class AnswersCotroller { @Autowired private IAnswersService answersService; /* * 查询所有答题卡,包括问卷 */ @ApiOperation(value="查询所有班答题卡",notes="答题卡携带调查问卷survey") @GetMapping("findAllVM") public MsgResponse findAllVM() { try { List<AnswersVM> list=answersService.selectAllAnswersVM(); return MsgResponse.success("success", list); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); return MsgResponse.error(e.getMessage()); } } /* * 查询所有答题卡 */ @ApiOperation(value = "查询所有答题卡信息", notes = "单表") @GetMapping("/findAllAnswers") public MsgResponse findAllAnswers() { try { List<Answers> list = answersService.findAll(); return MsgResponse.success("success", list); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); return MsgResponse.error(e.getMessage()); } } /* * 通过id查询答题卡 */ @ApiOperation(value = "通过id查询答题卡", notes = "单表") @GetMapping("/findAnswersById") public MsgResponse findAnswersById(@RequestParam long id) { Answers answers = new Answers(); try { answers = answersService.findAnswersById(id); return MsgResponse.success("success", answers); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); return MsgResponse.error(e.getMessage()); } } /* * 通过seivey id查询答题卡 */ @ApiOperation(value = "通过seivey id查询答题卡", notes = "单表") @GetMapping("/findAnswersBySurveyId") public MsgResponse findAnswersBySurveyId(@RequestParam long id) { List<Answers> list; try { list = answersService.findAnswersByServeyId(id); return MsgResponse.success("success", list); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); return MsgResponse.error(e.getMessage()); } } /* * 通过关键字查询答题卡 */ @ApiOperation(value = "通过关键字查询答题卡") @GetMapping("/findAnswersByKeyword") public MsgResponse findAnswersByKeyword(@RequestParam String keywords) { try { List<Answers> list = answersService.query(keywords); return MsgResponse.success("success", list); } catch (Exception e) { e.printStackTrace(); return MsgResponse.error(e.getMessage()); } } /* * 保存或修改答题卡信息 */ @ApiOperation(value = "保存或更新答题卡信息") @PostMapping("saveOrUpdateAnswers") public String saveOrUpdateAnswers(Answers answers) { try { answersService.saveOrUpdateAnswers(answers); return "操作成功"; } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); return "操作失败" + e.getMessage(); } } /* * 通过id删除答题卡信息 */ @ApiOperation(value = "通过id删除答题卡信息") @GetMapping("deleteAnswersById") public MsgResponse deleteAnswersById(@RequestParam long id) { try { answersService.deleteAnswersById(id); return MsgResponse.success("删除成功", null); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); return MsgResponse.error(e.getMessage()); } } /* * 批量删除答题卡信息 */ @ApiOperation(value = "批量删除答题卡信息") @GetMapping("batchDeleteAnswers") public MsgResponse batchDeleteAnswers(long[] ids) { try { answersService.bathDeleteAnswers(ids); return MsgResponse.success("删除成功", null); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); return MsgResponse.error(e.getMessage()); } } }
[ "高学亭@DESKTOP-O5HVH32" ]
高学亭@DESKTOP-O5HVH32
85b0c53cc309a56398c6231b91a64891b83aee4b
f428e26a1dbbfd2b6ce3f2c94142d41832ccc28a
/src/main/java/com/cassandra/SendMail.java
b27335ca2675974f1fbc726ecccb79351157506b
[]
no_license
eprtvea/Tests
92ac37b5345a1c7a6de718fcc68a0408733771f2
330f61b3fef01c350f4f6682748695f4e8c70454
refs/heads/master
2023-01-22T11:32:35.893594
2016-08-15T15:25:30
2016-08-15T15:25:30
65,741,089
0
0
null
2023-01-02T21:52:49
2016-08-15T15:03:55
JavaScript
UTF-8
Java
false
false
1,424
java
package com.cassandra; import java.io.Serializable; import java.util.Map; import java.util.Properties; import javax.mail.Message; import javax.mail.MessagingException; import javax.mail.PasswordAuthentication; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; public class SendMail implements Serializable{ public static void main(String[] args) { final String username = "vprashant341@gmail.com"; final String password = "Pra@1989"; String messageBody = ""; Properties props = new Properties(); props.put("mail.smtp.auth", "true"); props.put("mail.smtp.starttls.enable", "true"); props.put("mail.smtp.host", "smtp.gmail.com"); props.put("mail.smtp.port", "587"); Session session = Session.getInstance(props, new javax.mail.Authenticator() { protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(username, password); } }); try { Message message = new MimeMessage(session); message.setFrom(new InternetAddress("srk@srk.com")); message.setRecipients(Message.RecipientType.TO, InternetAddress.parse("prashantverma@qainfotech.com")); message.setSubject("Tredning people in automation world"); Transport.send(message); System.out.println("Done"); } catch (MessagingException e) { throw new RuntimeException(e); } } }
[ "prashantverma@qainfotech.com" ]
prashantverma@qainfotech.com
a7d990bc7a6de22c902cad6b54027c3432a27dbf
a1a1e5900afd1df93835b8122838003e386206b5
/api-correntista/src/main/java/br/com/unp/apicorrentista/filter/CorrentistaFilter.java
1dc67026a318d7691699d61b78f8e120ac7d6a65
[]
no_license
lulukamagaiver/correntista
751c7c7747364281951ef3a0e5ec815e73e4c2bc
8bef94f3302e1844a8cfb46c3ccfe29993e067cb
refs/heads/master
2020-06-03T02:08:07.606416
2019-06-13T03:39:20
2019-06-13T03:39:20
191,389,508
0
0
null
null
null
null
UTF-8
Java
false
false
754
java
package br.com.unp.apicorrentista.filter; import java.util.Date; import java.math.BigDecimal; public class CorrentistaFilter { private Long id; private String nome; private Date dataCriacao; private BigDecimal saldoFinanceiro; public Long getId() { return this.id; } public void setId(Long id) { this.id = id; } public String getNome() { return this.nome; } public void setNome(String nome) { this.nome = nome; } public Date getDataCriacao() { return this.dataCriacao; } public void setDataCriacao(Date dataCriacao) { this.dataCriacao = dataCriacao; } public BigDecimal getSaldoFinanceiro() { return this.saldoFinanceiro; } public void setSaldoFinanceiro(BigDecimal saldoFinanceiro) { this.saldoFinanceiro = saldoFinanceiro; } }
[ "luluka.magaiver@gmail.com" ]
luluka.magaiver@gmail.com
c59ac09db61b8401e91278dbdbe80b82e4464c2a
adde5cfd55b6afd2e41bba24b864aebe5e739e79
/Test/TestFileReader.java
3ab965b62f5624c5e07c207da86b219c93c20a83
[]
no_license
zhouhaoyang1997/Java_learn
7c146055645baf464f00303131caf02d7ee1dd1f
fea6aa7be7a2553110fbb4a05e51418295bab840
refs/heads/master
2021-01-17T16:48:01.104987
2017-01-30T08:14:02
2017-01-30T08:14:02
64,391,165
0
0
null
null
null
null
GB18030
Java
false
false
676
java
package Test; import java.io.*; public class TestFileReader { public static void main(String[] args){ FileReader fp = null; FileWriter fp1 = null; int b =0; try{ fp = new FileReader("C:\\Users\\38410\\Desktop\\list.txt"); fp1 = new FileWriter("C:\\Users\\38410\\Desktop\\list_copy.txt"); while((b=fp.read())!=-1){ fp1.write(b); //System.out.println((char)b); } fp1.write("我怎么这么聪明!"); fp.close(); fp1.close(); }catch(FileNotFoundException e){ System.out.println("文件找找不到!"); }catch(IOException e1){ System.out.println("文件读取错误!"); } System.out.println("文件复制完成!"); } }
[ "zhouhaoyang1997@iCloud.com" ]
zhouhaoyang1997@iCloud.com
a0dc622b0af04d9dca8b9d6d89ad02c110212c36
79b487d8115924b186c2394877afc0240d4e21cd
/src/main/java/com/senacor/oo/wheatherstation/WeatherStationResourceBuilder.java
7012eee4dd6e04cd8cf59d997cb0e02898f73d35
[]
no_license
kompacher/weatherstation
1d778553be1f7d80acffeb4922a124c73bbb8989
fc8840600607db33552fff74d2ff32224103f91e
refs/heads/master
2023-07-19T16:11:41.334051
2023-07-17T16:53:49
2023-07-17T16:53:49
27,556,188
0
0
null
2023-07-17T16:53:51
2014-12-04T19:25:35
Java
UTF-8
Java
false
false
2,766
java
package com.senacor.oo.wheatherstation; import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo; import static org.springframework.hateoas.mvc.ControllerLinkBuilder.methodOn; import java.util.Collection; import com.senacor.oo.wheatherstation.product.Weatherstation; import com.senacor.oo.wheatherstation.product.WeatherstationGold; import com.senacor.oo.wheatherstation.product.WeatherstationWhite; import com.senacor.oo.wheatherstation.rest.StationType; import com.senacor.oo.wheatherstation.rest.WeatherstationController; import com.senacor.oo.wheatherstation.sensor.Sensor; import org.springframework.stereotype.Component; /** * @author Georg Kompacher, Senacor Technologies AG */ @Component public class WeatherStationResourceBuilder { public WeatherstationWhite getWeatherstationWhite() { WeatherstationWhite weatherstationWhite = new WeatherstationWhite(); weatherstationWhite.add(linkTo(methodOn(WeatherstationController.class).getWhite()).withSelfRel()); Collection<String> sensorTypes = weatherstationWhite.getSensorTypes(); for (String sensorType : sensorTypes) { weatherstationWhite.add(linkTo(methodOn(WeatherstationController.class).getSensor(StationType.WHITE.toStringValue(), sensorType)).withRel(sensorType)); } return weatherstationWhite; } public WeatherstationGold getWeatherstationGold() { WeatherstationGold weatherstationGold = new WeatherstationGold(); weatherstationGold.add(linkTo(methodOn(WeatherstationController.class).getGold()).withSelfRel()); Collection<String> sensorTypes = weatherstationGold.getSensorTypes(); for (String sensorType : sensorTypes) { weatherstationGold.add(linkTo(methodOn(WeatherstationController.class).getSensor(StationType.GOLD.toStringValue(), sensorType)).withRel(sensorType)); } return weatherstationGold; } public Sensor getSensor(StationType stationType, String sensorType) { Weatherstation weatherstation = getWeatherstation(stationType); if (!weatherstation.hasSensorOfType(sensorType)) { return null; } Sensor sensor = weatherstation.getSensor(sensorType); sensor.add(linkTo(methodOn(WeatherstationController.class).getSensor(stationType.toStringValue(), sensorType)).withSelfRel()); return sensor; } private Weatherstation getWeatherstation(StationType type) { switch (type) { case GOLD: return new WeatherstationGold(); case WHITE: return new WeatherstationWhite(); default: throw new IllegalArgumentException(String.format("Type %s not valid.", type)); } } }
[ "gkompacher@hotmail.com" ]
gkompacher@hotmail.com
7c4cf4bfa81d24c40de46d8056da85d4760873a3
b760410f0314d7089ed9d00b66546c2db8a28cc8
/app/src/main/java/br/com/re98/autoescolamais/MainActivity.java
675ec6924cbe0b84e71f5202b9e6897db4fbc9d1
[]
no_license
isaacslima/autoescola
634220bbfd4363a930459f8684b5ca1ea03ad66b
a0f4fa09a6fd1c54d329eeba9202a6074b3873da
refs/heads/master
2021-05-11T06:57:35.962094
2018-01-19T13:51:28
2018-01-19T13:51:28
118,004,064
0
0
null
null
null
null
UTF-8
Java
false
false
5,718
java
package br.com.re98.autoescolamais; import android.app.AlertDialog; import android.app.FragmentManager; import android.content.Intent; import android.os.Bundle; import android.support.design.widget.NavigationView; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.ActionBarDrawerToggle; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.ArrayAdapter; import android.widget.ListView; import java.util.List; import br.com.re98.autoescolamais.dao.LoginDAO; import br.com.re98.autoescolamais.modelo.Login; public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener { private FragmentManager fragmentManager; private AlertDialog alerta; ListView listPerfil; List<String> perfil; ArrayAdapter<String> adaptador; Login login; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); //recuperando dados do login Intent intent = getIntent(); login = (Login) intent.getSerializableExtra("login"); LoginDAO dao = new LoginDAO(this); dao.salvaLogin(login); dao.close(); fragmentManager = getFragmentManager(); fragmentManager.beginTransaction() .replace(R.id.content_frame, new PerfilFragment()).commit(); DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close); drawer.addDrawerListener(toggle); toggle.syncState(); NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view); navigationView.setNavigationItemSelectedListener(this); } @Override public void onBackPressed() { DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); if (drawer.isDrawerOpen(GravityCompat.START)) { drawer.closeDrawer(GravityCompat.START); } else { this.moveTaskToBack(true); } } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } @SuppressWarnings("StatementWithEmptyBody") @Override public boolean onNavigationItemSelected(MenuItem item) { int id = item.getItemId(); fragmentManager = getFragmentManager(); if (id == R.id.nav_perfil) { fragmentManager.beginTransaction() .replace(R.id.content_frame, new PerfilFragment()).commit(); } else if (id == R.id.nav_financeiro) { fragmentManager.beginTransaction() .replace(R.id.content_frame, new FinanceiroFragment()).commit(); } else if (id == R.id.nav_aulas) { fragmentManager.beginTransaction() .replace(R.id.content_frame, new AulasFragment()).commit(); } else if (id == R.id.nav_exames) { fragmentManager.beginTransaction() .replace(R.id.content_frame, new ExameFragment()).commit(); }else if (id == R.id.nav_aulas) { fragmentManager.beginTransaction() .replace(R.id.content_frame, new FaleconoscoFragment()).commit(); } else if (id == R.id.nav_sair) { confirmacaoSaida(); } DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); drawer.closeDrawer(GravityCompat.START); return true; } private void confirmacaoSaida() { LayoutInflater li = getLayoutInflater(); View view = li.inflate(R.layout.alerta, null); //inflamos o layout alerta.xml na view //definimos para o botão do layout um clickListener view.findViewById(R.id.alerta_sair).setOnClickListener(new View.OnClickListener() { public void onClick(View arg0) { //exibe um Toast informativo. LoginDAO dao = new LoginDAO(MainActivity.this); login = dao.buscaLogin(); dao.apagaLogin(login); dao.close(); finish(); } }); view.findViewById(R.id.alerta_cancelar).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { //desfaz o alerta. alerta.dismiss(); } }); AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle("Deseja realmente sair?"); builder.setView(view); alerta = builder.create(); alerta.show(); } }
[ "isaacslima@yahoo.com.br" ]
isaacslima@yahoo.com.br
565804114e1436640b7e240f0566d47aad5c6839
6374f7a525d0beee03e83e4ce611495566aa8997
/src/ilstu/edu/StudentReport.java
11938a095952a24cf08c41d2a200ce7a01f782b0
[]
no_license
aslerch/IT179Program1
2b58816c37847779a8a23dd2ee8ca9ba1993a3d4
192193c27c425f58ae84aa1e319f3d05e3c79a58
refs/heads/master
2023-07-15T20:50:40.240375
2021-08-27T19:39:45
2021-08-27T19:39:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
10,872
java
package ilstu.edu; import java.io.File; import java.io.FileNotFoundException; import java.io.PrintWriter; import java.text.DecimalFormat; import java.text.NumberFormat; import java.util.Scanner; /** A class that represents a student report */ public class StudentReport { private final int INVALID = -1; private final int NUM_OF_ASSIGNMENTS = 8; /** Name of the file that we want to read */ private String fileName; /** Grades for all of the students */ private double [][] grades; /** Names of all the students */ private String [] students; /** Names of all the graded items in the file(fileName) */ private String [] gradedItems; /** true if field fileName has a file associated with it, false if field fileName is null */ public boolean isProcessed = false; /** Default constructor */ public StudentReport() {}; /** * Instantiates a StudentReport object and also instantiates the fields of grades, students, and gradedItems * @param fileName The name of the file that contains the data to be used */ public StudentReport(String fileName) { this.fileName = fileName; this.grades = new double [100][8]; this.students = new String [100]; this.gradedItems = new String [8]; } /** Methods */ /** * Calculates the average score for class * @return The average score for the class */ private double calculateAverageForClass() { int numOfStudents = findNumOfStudents(); double average; double totalScore = 0; int numOfScores = 0; for (int i = 0; i < numOfStudents; i++) { for (int j = 0; j < grades[i].length; j++) { totalScore += grades[i][j]; numOfScores++; } } average = totalScore/(double)(numOfStudents); return average; } /** * Calculates the total score for all grades of a student * @param name The name of the student * @return The total score */ private double calculateTotalForGradesOfStudent(String name) { double total = 0; int indexOfStudent = findIndexOfStudent(name); for (int i = 0; i < grades[indexOfStudent].length; i++) { total += (int)grades[indexOfStudent][i]; } return total; } /** * Collects the grades and assignment names for a student * @param name The name of the student * @return A String in the format "(name of assignment): (grade)" for all assignments */ private String collectGradesWithAssignmentNameOfStudent(String name) { String gradesOfStudent = ""; int indexOfStudent = findIndexOfStudent(name); for (int i = 0; i < grades[indexOfStudent].length; i++) { gradesOfStudent += gradedItems[i] + ": " + (int)grades[indexOfStudent][i] + "\n"; } return gradesOfStudent; } /** * Compiles information from various sources to format the info for a report card * @param name The name of the student * @return Formatted information for a report card */ private String createReportCardInfo(String name) { String reportCardInfo = ""; int indexOfStudent = findIndexOfStudent(name); if (indexOfStudent == INVALID) reportCardInfo = "No data for the student could be found"; if (indexOfStudent != INVALID) { reportCardInfo = "Name: " + name + "\n" + collectGradesWithAssignmentNameOfStudent(name) + "Total: " + (int)calculateTotalForGradesOfStudent(name) + "\nGrade: " + determineLetterGradeForStudent(name); } return reportCardInfo; } /** * Determines the letter grade that a student should earn based on their total score * @param name The name of the student * @return The student's letter grade */ private char determineLetterGradeForStudent(String name) { char grade = ' '; int total = (int)calculateTotalForGradesOfStudent(name); if (total >= 90) grade = 'A'; if (total >= 80 & total <= 89) grade = 'B'; if (total >= 70 & total <= 79) grade = 'C'; if (total >= 60 & total <= 69) grade = 'D'; if (total < 69) grade = 'F'; return grade; } /** * Displays information relating to the class average, highest total score, and lowest total score. */ public void displayStatistics() { DecimalFormat decimalFormat = new DecimalFormat("##.##"); String studentWithHighestTotalScore = findStudentWithHighestTotalScore(); String studentWithLowestTotalScore = findStudentWithLowestTotalScore(); String output = "Average Score of the Class: " + decimalFormat.format(calculateAverageForClass()) + "%" + "\nStudent with the highest total score: " + studentWithHighestTotalScore + "(" + (int)calculateTotalForGradesOfStudent(studentWithHighestTotalScore) + ")" + "\nStudent with the lowest total score: " + studentWithLowestTotalScore + "(" + (int)calculateTotalForGradesOfStudent(studentWithLowestTotalScore) + ")"; System.out.println(output); } /** * fills the gradedItems array * @param gradesFile The name of the File object that references fileName */ private void fillGradedItemsArray(File gradesFile) { try { Scanner fileReader = new Scanner(gradesFile); String currentLine = fileReader.nextLine(); String [] gradesFileHeaders = currentLine.split(","); for (int i = 1; i < gradesFileHeaders.length; i++) //skips the "name" header this.gradedItems[i - 1] = gradesFileHeaders[i]; System.out.println("File successfully read"); } catch (FileNotFoundException e) { System.out.println("ERROR: File not found"); } } /** * Fills the grades array * @param gradesFile The name of the File object that references fileName */ private void fillGradesArray(File gradesFile) { try { Scanner fileReader = new Scanner(gradesFile); fileReader.nextLine(); //skips the header int rowIndex = 0; while (fileReader.hasNextLine()) { String currentLine = fileReader.nextLine(); String [] grades = currentLine.split(","); for (int i = 1; i < grades.length; i++) { this.grades[rowIndex][i - 1] = Double.parseDouble(grades[i]); } rowIndex++; isProcessed = true; } } catch (FileNotFoundException e) { System.out.println(""); } } /** * Fills the students array * @param gradesFile The name of the File object that references fileName */ private void fillStudentsArray(File gradesFile) { try { Scanner fileReader = new Scanner(gradesFile); fileReader.nextLine(); //skips the header int studentsIndex = 0; while (fileReader.hasNextLine()) { String currentLine = fileReader.nextLine(); String [] info = currentLine.split(","); students[studentsIndex] = info[0]; studentsIndex++; } } catch (FileNotFoundException e) { System.out.println(""); } } /** * Finds the student with the highest total score * @return The student's name */ private String findStudentWithHighestTotalScore() { int highestTotal = (int)calculateTotalForGradesOfStudent(students[0]); String name = students[0]; for (int i = 0; i < students.length; i++) { if (students[i] != null) { if ( (int)calculateTotalForGradesOfStudent(students[i]) > highestTotal) { highestTotal = (int)calculateTotalForGradesOfStudent(students[i]); name = students[i]; } } } return name; } /** * Finds the student with the lowest total score * @return The student's name */ private String findStudentWithLowestTotalScore() { int lowestTotal = (int)calculateTotalForGradesOfStudent(students[0]); String name = students[0]; for (int i = 0; i < students.length; i++) { if (students[i] != null) { if ( (int)calculateTotalForGradesOfStudent(students[i]) < lowestTotal) { lowestTotal = (int)calculateTotalForGradesOfStudent(students[i]); name = students[i]; } } } return name; } /** * Finds the index of a student in the students array * @param name The name of the student * @return The index of the student if the student is in the students array and -1 otherwise */ private int findIndexOfStudent(String name) { int index = -1; for (int i = 0; i < students.length; i++) { if (students[i] != null) { if (students[i].equalsIgnoreCase(name)) index = i; } } return index; } /** * Finds the number of students * @return The number of students */ private int findNumOfStudents() { int numOfStudents = 0; for (String student : students) { if (student != null) numOfStudents++; } return numOfStudents; } /** * Prints a list of the students in the students array */ public void printStudents() { System.out.println("Students: "); for (String name : students) { if (name != null) System.out.println(name); } } /** * Reads fileName and fills the grades, students, and gradedItems arrays */ public void readFile() { File gradesFile = new File(this.fileName); fillGradesArray(gradesFile); fillStudentsArray(gradesFile); fillGradedItemsArray(gradesFile); } /** * Generates a report card for a specific student and saves it as "(student's name).txt" */ public void writeFile(String name) { String reportCardInfo = createReportCardInfo(name); String outputFileName = name.replace(" ", "") + ".txt"; File reportCard = new File(outputFileName); try { PrintWriter fileWriter = new PrintWriter(reportCard); fileWriter.write(reportCardInfo); fileWriter.close(); } catch (FileNotFoundException e) { System.out.println("cannot write to the file"); } } }
[ "88261471+aslerch@users.noreply.github.com" ]
88261471+aslerch@users.noreply.github.com
f1dc4400433831780cb61b74762a754ffba28a55
98c66b12e9ad69e81cc9b054963d56d04fe78b17
/src/main/java/oktenweb/models/User.java
11b4f95f5755f18a0c91fde1877d65f9dd21947a
[]
no_license
NazarOliynyk/trysecurity4inheritance
356a9a201a74d09fae38d4c601959e20f6d27d9a
7d0e951ea37fa73cb3ce48369c290ade6f6d825e
refs/heads/master
2020-05-02T15:04:51.798383
2019-06-11T10:27:54
2019-06-11T10:27:54
178,030,732
0
0
null
null
null
null
UTF-8
Java
false
false
2,444
java
package oktenweb.models; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; import javax.persistence.*; import java.util.ArrayList; import java.util.Collection; import java.util.List; @Entity(name = "Users_TrySecurity4") @Inheritance @DiscriminatorColumn(name = "type") public class User implements UserDetails{ @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private int id; @Column(unique = true) private String username; private String password; public int getId() { return id; } public void setId(int id) { this.id = id; } @Override public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } @Override public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } private boolean accountNonExpired = true; public void setAccountNonExpired(boolean accountNonExpired) { this.accountNonExpired = accountNonExpired; } @Override public boolean isAccountNonExpired() { return accountNonExpired; } private boolean accountNonLocked = true; public void setAccountNonLocked(boolean accountNonLocked) { this.accountNonLocked = accountNonLocked; } @Override public boolean isAccountNonLocked() { return accountNonLocked; } private boolean credentialsNonExpired = true; public void setCredentialsNonExpired(boolean credentialsNonExpired) { this.credentialsNonExpired = credentialsNonExpired; } @Override public boolean isCredentialsNonExpired() { return credentialsNonExpired; } private boolean enabled = true; public void setEnabled(boolean enabled) { this.enabled = enabled; } @Override public boolean isEnabled() { return enabled; } @Enumerated(EnumType.STRING) private Role role= Role.ROLE_USER; @Override public Collection<? extends GrantedAuthority> getAuthorities() { List<SimpleGrantedAuthority> authorities = new ArrayList<>(); authorities.add(new SimpleGrantedAuthority(role.name())); return authorities; } }
[ "nazar_lw@ukr.net" ]
nazar_lw@ukr.net
cfb96513eddfaf0574a8badea2132821bb9b0cf3
a3c37b619a21d92d970a194e4729f95c1b67be51
/Table editor/src/com/ivan/tableEditor/tableEditorView/TableEditorMainFrame.java
f0ed639e3ca6a425a71594d2241cf03b198cefe6
[]
no_license
IvanYakimtsov/UselessJavaProjects
01899ee4acce8dd2872ac7ffc7fa4986d8d520d6
8680271b423764d9917d4a68f04d448058f44718
refs/heads/master
2020-04-06T03:52:02.903518
2018-05-13T10:43:20
2018-05-13T10:43:20
83,147,003
3
1
null
null
null
null
UTF-8
Java
false
false
4,944
java
package com.ivan.tableEditor.tableEditorView; import com.ivan.tableEditor.tableEditorView.workingArea.WorkingArea; import javax.swing.*; import java.awt.*; import java.awt.event.WindowEvent; import java.awt.event.WindowListener; import java.util.*; import java.util.List; /** * Created by Ivan on 21.03.2017. */ public class TableEditorMainFrame { final public static int SAVE_BUTTON_INDEX = 0; final public static int OPEN_BUTTON_INDEX = 1; final public static int ADD_BUTTON_INDEX = 2; final public static int DELETE_BUTTON_INDEX = 3; final public static int SEARCH_BUTTON_INDEX = 4; private JFrame mainFrame; private JToolBar toolBar; private List<JButton> toolPanelButtons; private List<JMenuItem> menuButtons; public TableEditorMainFrame() { toolPanelButtons = new ArrayList<>(); menuButtons = new ArrayList<>(); setFrame(); mainFrame.validate(); mainFrame.repaint(); } private void setFrame() { this.mainFrame = new JFrame("Редактор таблиц"); this.mainFrame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); addFrameListener(); addToolPanel(); addMenuBar(); this.mainFrame.setExtendedState(JFrame.MAXIMIZED_BOTH); this.mainFrame.setVisible(true); } private void addMenuBar(){ JMenuBar menuBar = new JMenuBar(); JMenu menu = new JMenu("Меню"); JMenuItem menuItem = new JMenuItem("Сохранить"); menu.add(menuItem); menuButtons.add(menuItem); menuItem = new JMenuItem("Открыть"); menu.add(menuItem); menuButtons.add(menuItem); menuItem = new JMenuItem("Добавить студента"); menu.add(menuItem); menuButtons.add(menuItem); menuItem = new JMenuItem("Удалить студента"); menu.add(menuItem); menuButtons.add(menuItem); menuItem = new JMenuItem("Найти студента"); menu.add(menuItem); menuButtons.add(menuItem); menuBar.add(menu); mainFrame.setJMenuBar(menuBar); } private void addToolPanel() { toolBar = new JToolBar(); toolBar.setPreferredSize(new Dimension(mainFrame.getWidth(), 48)); toolBar.setFloatable(false); Box buttonsBox = Box.createHorizontalBox(); toolBar.setBackground(new Color(94, 115, 232)); setButtons(buttonsBox); toolBar.add(buttonsBox); mainFrame.add(toolBar, BorderLayout.NORTH); } private void setButtons(Box buttonsBox) { addButton("img/save.png", buttonsBox); addButton("img/open.png", buttonsBox); addButton("img/add-user.png", buttonsBox); addButton("img/remove-user.png", buttonsBox); addButton("img/search-user.png", buttonsBox); } private void addButton(String filename, Box buttonsBox) { JButton button = new JButton(new ImageIcon(filename)); button.setBackground(null); button.setPreferredSize(new Dimension(40, 40)); buttonsBox.add(button); buttonsBox.add(Box.createHorizontalStrut(32)); toolPanelButtons.add(button); } public void addWorkingArea(WorkingArea workingArea) { mainFrame.add(workingArea.getWorkingAreaPanel()); mainFrame.validate(); mainFrame.repaint(); } private void addFrameListener() { this.mainFrame.addWindowListener(new WindowListener() { @Override public void windowOpened(WindowEvent e) { } @Override public void windowClosing(WindowEvent e) { Object[] options = {"Выйти", "Отменить"}; int n = JOptionPane .showOptionDialog(e.getWindow(), "Вы действительно хотите выйти?", "Подтверждение", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[0]); if (n == 0) { e.getWindow().setVisible(false); System.exit(0); } } @Override public void windowClosed(WindowEvent e) { } @Override public void windowIconified(WindowEvent e) { } @Override public void windowDeiconified(WindowEvent e) { } @Override public void windowActivated(WindowEvent e) { } @Override public void windowDeactivated(WindowEvent e) { } }); } public List<JMenuItem> getMenuButtons() { return menuButtons; } public List<JButton> getToolPanelButtons() { return toolPanelButtons; } }
[ "ivan.yakimtspv@gmail.com" ]
ivan.yakimtspv@gmail.com
42bfb6d2d0c829637f50960ad2a8755ddd2fcad1
07879795b55dd97abb9cd084ac9712158650788a
/usite/src/com/chenjishi/u148/volley/toolbox/RequestFuture.java
c80a18553596254b9560e281c57f5047c8ef0a15
[ "MIT" ]
permissive
BreankingBad/usite
47d00e8c9a6a285c210f0be8d640399fc292ef8e
4e6284e504719f2b7ef3ac7ab380615b3c0dc96b
refs/heads/master
2020-12-01T01:15:15.024402
2015-02-08T10:47:46
2015-02-08T10:47:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,111
java
/* * Copyright (C) 2011 The Android Open Source Project * * 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.chenjishi.u148.volley.toolbox; import com.chenjishi.u148.volley.Request; import com.chenjishi.u148.volley.Response; import com.chenjishi.u148.volley.VolleyError; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; /** * A Future that represents a Volley request. * * Used by providing as your response and error listeners. For example: * <pre> * RequestFuture&lt;JSONObject&gt; future = RequestFuture.newFuture(); * MyRequest request = new MyRequest(URL, future, future); * * // If you want to be able to cancel the request: * future.setRequest(requestQueue.add(request)); * * // Otherwise: * requestQueue.add(request); * * try { * JSONObject response = future.get(); * // do something with response * } catch (InterruptedException e) { * // handle the error * } catch (ExecutionException e) { * // handle the error * } * </pre> * * @param <T> The type of parsed response this future expects. */ public class RequestFuture<T> implements Future<T>, Response.Listener<T>, Response.ErrorListener { private Request<?> mRequest; private boolean mResultReceived = false; private T mResult; private VolleyError mException; public static <E> RequestFuture<E> newFuture() { return new RequestFuture<E>(); } private RequestFuture() {} public void setRequest(Request<?> request) { mRequest = request; } @Override public synchronized boolean cancel(boolean mayInterruptIfRunning) { if (mRequest == null) { return false; } if (!isDone()) { mRequest.cancel(); return true; } else { return false; } } @Override public T get() throws InterruptedException, ExecutionException { try { return doGet(null); } catch (TimeoutException e) { throw new AssertionError(e); } } @Override public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { return doGet(TimeUnit.MILLISECONDS.convert(timeout, unit)); } private synchronized T doGet(Long timeoutMs) throws InterruptedException, ExecutionException, TimeoutException { if (mException != null) { throw new ExecutionException(mException); } if (mResultReceived) { return mResult; } if (timeoutMs == null) { wait(0); } else if (timeoutMs > 0) { wait(timeoutMs); } if (mException != null) { throw new ExecutionException(mException); } if (!mResultReceived) { throw new TimeoutException(); } return mResult; } @Override public boolean isCancelled() { if (mRequest == null) { return false; } return mRequest.isCanceled(); } @Override public synchronized boolean isDone() { return mResultReceived || mException != null || isCancelled(); } @Override public synchronized void onResponse(T response) { mResultReceived = true; mResult = response; notifyAll(); } @Override public synchronized void onErrorResponse(VolleyError error) { mException = error; notifyAll(); } }
[ "jishi@staff.xianguo.com" ]
jishi@staff.xianguo.com
08f5c7a9732fb272ede7c86d72d0ad567bf18421
17dbe7e2e570cc3e0ac6e4b2d3223d2d41dc5061
/src/main/java/org/dselent/course_load_scheduler/client/gin/Injector.java
22eaf3e3dfc16ca7992f2744d4f91620da118b28
[]
no_license
dselent/course_load_scheduler
b91fd3c29b14640538b50d387a5a36cfb8a73cac
75e93e9cf58224218d3ff3ad68e3a7250dbc2c81
refs/heads/master
2021-05-02T00:05:51.177271
2018-02-18T10:21:55
2018-02-18T10:21:55
120,937,277
0
8
null
2018-02-25T20:12:39
2018-02-09T17:50:26
Java
UTF-8
Java
false
false
1,804
java
package org.dselent.course_load_scheduler.client.gin; import org.dselent.course_load_scheduler.client.presenter.impl.ExamplePresenterImpl; import org.dselent.course_load_scheduler.client.presenter.impl.IndexPresenterImpl; import org.dselent.course_load_scheduler.client.presenter.impl.LoginPresenterImpl; import org.dselent.course_load_scheduler.client.service.impl.UserServiceImpl; import org.dselent.course_load_scheduler.client.view.impl.ExampleViewImpl; import org.dselent.course_load_scheduler.client.view.impl.IndexViewImpl; import org.dselent.course_load_scheduler.client.view.impl.LoginViewImpl; import com.google.gwt.core.client.GWT; import com.google.gwt.event.shared.SimpleEventBus; import com.google.gwt.inject.client.GinModules; import com.google.gwt.inject.client.Ginjector; /** * Interface required by gin due to lack of runtime reflections * Provide methods to get all objects that are to be injected * * GinModules annotation: indicates what the module file is * * @author dselent * */ @GinModules(InjectorModule.class) public interface Injector extends Ginjector { // GIN generator will instantiate this // GWT.create uses deferred bindings where many permutations are created but only one // is used at runtime (the one for the specific browser) public static final Injector INSTANCE = GWT.create(Injector.class); // event bus public SimpleEventBus getEventBus(); // presenters public IndexPresenterImpl getIndexPresenter(); public LoginPresenterImpl getLoginPresenter(); public ExamplePresenterImpl getExamplePresenter(); //views public IndexViewImpl getIndexView(); public LoginViewImpl getLoginView(); public ExampleViewImpl geExampleView(); // services public UserServiceImpl getUserService(); }
[ "selentd@gmail.com" ]
selentd@gmail.com
c3d12b3e1d13ced0944234650de3130e0615585d
b6b5998fb1496d0261ec5f245399d73fb65ee6fb
/bomManager/src/com/manager/common/tools/BigDecimalUtil.java
d80cb7c68515586954fb966d488951ac16562477
[ "MIT" ]
permissive
kimtae/bomManager
cf074a1105a2d7fcf3dbb82ba24d193da68136dc
aef371ef33fe1cccaf5c1f78945e9953e2b29f72
refs/heads/master
2023-06-08T16:05:54.032371
2020-07-16T05:50:38
2020-07-16T05:50:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,852
java
/* * 文件名:BigDecimal.java * 版权:Copyright 2012-2016 YLINK Tech. Co. Ltd. All Rights Reserved. * 描述: BigDecimal.java * 修改人:liyuelong 1610139 * 修改时间:2017年3月20日 * 修改内容:新增 */ package com.manager.common.tools; import java.math.BigDecimal; import java.text.DecimalFormat; /** * TODO添加类描述 * @author liyuelong 1610139 * @version CCAS 2017年3月20日 * @since CCAS */ public class BigDecimalUtil { public static String format(BigDecimal amount) { DecimalFormat df = new DecimalFormat("#,##0.00#"); return df.format(amount.setScale(2, BigDecimal.ROUND_HALF_UP)); } /** * 将bigDecimal对象的精度设定为两位小数 * @return String类型 */ public static String formatDecmical(BigDecimal amount) { DecimalFormat df = new DecimalFormat("#0.00"); return df.format(amount); } /** * 将bigDecimal对象的精度设定为两位小数 * @return BigDecimal类型 */ public static BigDecimal Decimalformat(BigDecimal amount) { BigDecimal bigDecimal = new BigDecimal(formatDecmical(amount)); return bigDecimal; } /** * @param arg1 被减数 * @param arg2 减数 * @return 保留两位小数的结果 */ public static String subtract(Object arg1, Object arg2) { BigDecimal minumend = StringUtil.toBigDecimal(arg1); BigDecimal subtrahend = StringUtil.toBigDecimal(arg2); BigDecimal result = minumend.subtract(subtrahend); return formatDecmical(result); } public static void main(String[] args) { BigDecimal a = new BigDecimal(-120.457); System.out.println(formatDecmical(a)); } }
[ "1352095235@qq.com" ]
1352095235@qq.com
8260eb140b669a7bb2ca16c57d6fdd485b8039be
a372c473c3e0d8d04cec766df453454f4e632098
/src/main/java/com/bingo/rpc/provider/HelloBingo.java
0b9748bdc44a40005a99962e7fb17a1e5da3136a
[]
no_license
10bingo/bingo-rpc
2af73e71624a96b16a0ea13c1426b31ad290b73a
c8384400dcef78f2de90c572c30a77a6b8c098f2
refs/heads/master
2022-05-31T10:52:49.920449
2020-05-03T10:12:36
2020-05-03T10:12:36
260,413,094
0
0
null
2020-05-01T08:45:34
2020-05-01T08:35:38
Java
UTF-8
Java
false
false
192
java
package com.bingo.rpc.provider; import com.bingo.rpc.api.Hello; public class HelloBingo implements Hello { public String sayHello(String name) { return "hello " + name; } }
[ "bingo@bingo.com" ]
bingo@bingo.com
a4af3b66a354b306bacc1793c4da41c63007c36f
83dbd433aeed1f15f6501f39fe152abc0dc803d9
/multithread_study/java_multithread_core_tech/src/test/java/com/bd/java/multithread/core/tech/chapter4/reentrant_lock/ReentrantLockTest.java
b69abcf1c7a353aeafa0bb2bf8f0ac1944595305
[]
no_license
pylrichard/web_service_study
d0d42ea0c511b9b15a235a99cde5b4b025c33c6d
c1bd8753c6aee69c87707db7f3fb8e0d7f5ddbc0
refs/heads/master
2021-09-14T23:31:12.454640
2018-05-22T06:26:14
2018-05-22T06:26:14
104,879,563
1
0
null
null
null
null
UTF-8
Java
false
false
394
java
package com.bd.java.multithread.core.tech.chapter4.reentrant_lock; public class ReentrantLockTest { public static void main(String[] args) { MyService service = new MyService(); MyThread t1 = new MyThread(service); MyThread t2 = new MyThread(service); MyThread t3 = new MyThread(service); t1.start(); t2.start(); t3.start(); } }
[ "pylrichard@qq.com" ]
pylrichard@qq.com
e91a2fadf0a1b8cffb51cd6bb32bb23f17713ce0
6f6fd51a6f298242318f0538787b6416916e7722
/JDK7-45/src/main/java/com/hmz/source/org/omg/DynamicAny/DynSequenceOperations.java
f04e28f330eecbade696b7092510cda6b402cff4
[]
no_license
houmaozheng/JDKSourceProject
5f20578c46ad0758a1e2f45d36380db0bcd46f05
699b4cce980371be0d038a06ce3ea617dacd612c
refs/heads/master
2023-06-16T21:48:46.957538
2021-07-15T17:01:46
2021-07-15T17:01:46
385,537,090
0
0
null
null
null
null
UTF-8
Java
false
false
3,784
java
package org.omg.DynamicAny; /** * org/omg/DynamicAny/DynSequenceOperations.java . * Generated by the IDL-to-Java compiler (portable), version "3.2" * from ../../../../src/share/classes/org/omg/DynamicAny/DynamicAny.idl * Tuesday, October 8, 2013 5:44:46 AM PDT */ /** * DynSequence objects support the manipulation of IDL sequences. */ public interface DynSequenceOperations extends org.omg.DynamicAny.DynAnyOperations { /** * Returns the current length of the sequence. */ int get_length (); /** * Sets the length of the sequence. * Increasing the length of a sequence adds new elements at the tail without affecting the values * of already existing elements. Newly added elements are default-initialized. * Increasing the length of a sequence sets the current position to the first newly-added element * if the previous current position was -1. Otherwise, if the previous current position was not -1, * the current position is not affected. * Decreasing the length of a sequence removes elements from the tail without affecting the value * of those elements that remain. The new current position after decreasing the length of a sequence * is determined as follows: * <UL> * <LI>If the length of the sequence is set to zero, the current position is set to -1. * <LI>If the current position is -1 before decreasing the length, it remains at -1. * <LI>If the current position indicates a valid element and that element is not removed when the length * is decreased, the current position remains unaffected. * <LI>If the current position indicates a valid element and that element is removed, * the current position is set to -1. * </UL> * * @exception InvalidValue if this is a bounded sequence and len is larger than the bound */ void set_length (int len) throws org.omg.DynamicAny.DynAnyPackage.InvalidValue; /** * Returns the elements of the sequence. */ org.omg.CORBA.Any[] get_elements (); /** * Sets the elements of a sequence. * The length of the DynSequence is set to the length of value. The current position is set to zero * if value has non-zero length and to -1 if value is a zero-length sequence. * * @exception TypeMismatch if value contains one or more elements whose TypeCode is not equivalent * to the element TypeCode of the DynSequence * @exception InvalidValue if the length of value exceeds the bound of a bounded sequence */ void set_elements (org.omg.CORBA.Any[] value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue; /** * Returns the DynAnys representing the elements of the sequence. */ org.omg.DynamicAny.DynAny[] get_elements_as_dyn_any (); /** * Sets the elements of a sequence using DynAnys. * The length of the DynSequence is set to the length of value. The current position is set to zero * if value has non-zero length and to -1 if value is a zero-length sequence. * * @exception TypeMismatch if value contains one or more elements whose TypeCode is not equivalent * to the element TypeCode of the DynSequence * @exception InvalidValue if the length of value exceeds the bound of a bounded sequence */ void set_elements_as_dyn_any (org.omg.DynamicAny.DynAny[] value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue; } // interface DynSequenceOperations
[ "houmaozheng@126.com" ]
houmaozheng@126.com
49b868fa0ab426b56fc3d469ab4b979ae0df0ee0
f8deaa58df02fdf32e3ca5ab6678ce6340d36005
/src/main/java/com/gem/sistema/web/bean/ConsultaFacturaPolizaMB.java
51d65ccf73785e42edfbcb4d6147f36040a910a1
[]
no_license
pedro-nava/gem
143ca18662a345a7e9bca931ee197a76fbcac3d5
ae94f88004747cd5c9606f91707bca8ce0d88c25
refs/heads/master
2020-04-21T10:40:10.297216
2019-02-07T18:17:31
2019-02-07T18:17:31
158,597,865
1
0
null
2018-12-26T23:15:54
2018-11-21T19:40:30
Java
UTF-8
Java
false
false
4,306
java
package com.gem.sistema.web.bean; import javax.faces.application.FacesMessage; import javax.faces.bean.ManagedBean; import javax.faces.bean.ManagedProperty; import javax.faces.bean.ViewScoped; import javax.faces.bean.SessionScoped; import javax.faces.context.FacesContext; import javax.security.auth.login.AccountException; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.List; import com.gem.sistema.business.service.reportador.ConsultaFacturaPolizasService; import com.gem.sistema.business.repository.catalogs.PolienRepository; import com.gem.sistema.business.repository.catalogs.ConctbRepository; import com.gem.sistema.business.service.catalogos.CattpoService; import com.gem.sistema.business.service.catalogos.CopomeService; import com.gem.sistema.business.domain.Conctb; import com.gem.sistema.business.domain.Cattpo; import com.gem.sistema.business.domain.Copome; import com.gem.sistema.business.domain.TcMes; import com.gem.sistema.web.security.model.GemUser; import org.primefaces.model.StreamedContent; import java.io.File; import org.primefaces.model.DefaultStreamedContent; import java.io.FileInputStream; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; // TODO: Auto-generated Javadoc /** * The Class ConsultaFacturaPolizaMB. */ @ViewScoped @ManagedBean(name = "consultaFacturaPolizaMB") public class ConsultaFacturaPolizaMB extends AbstractMB { /** The file. */ private String filename; /** The months. */ private List<TcMes> months; /** The month. */ private Integer month; /** The type. */ private String type; /** The num poliza. */ private Integer numPoliza; /** The main service. */ @ManagedProperty("#{consultaFacturaPolizasService}") private ConsultaFacturaPolizasService mainService; /** * Gets the months. * * @return the months */ public List<TcMes> getMonths(){ if(months == null || months.isEmpty()){ months = mainService.getMonths(); } return months; } /** * Sets the months. * * @param months the new months */ public void setMonths(List<TcMes> months){ this.months = months; } /** * Gets the month. * * @return the month */ public Integer getMonth(){ return month; } /** * Sets the month. * * @param month the new month */ public void setMonth(Integer month){ this.month = month; } /** * Gets the type. * * @return the type */ public String getType(){ return type; } /** * Sets the type. * * @param type the new type */ public void setType(String type){ this.type = type; } /** * Gets the num poliza. * * @return the num poliza */ public Integer getNumPoliza(){ return numPoliza; } /** * Sets the num poliza. * * @param numPoliza the new num poliza */ public void setNumPoliza(Integer numPoliza){ this.numPoliza = numPoliza; } /** * Gets the file. * * @return the file */ public String getFilename(){ return filename; } /** * Sets the file. * * @param file the new file */ public void setFilename(String filename){ this.filename = filename; } /** * Gets the main service. * * @return the main service */ public ConsultaFacturaPolizasService getMainService(){ return mainService; } /** * Sets the main service. * * @param mainService the new main service */ public void setMainService(ConsultaFacturaPolizasService mainService){ this.mainService = mainService; } /** * Process. */ public void process(){ if(getMainService().polizaExists(month, getNumPoliza(), getType(), getIdSectorForCurrentUser().intValue())){ String tempFileName = month+type+numPoliza; if (getMainService().getFactura(tempFileName) != null){ setFilename(tempFileName); }else{ setFilename(null); displayErrorMessage("FACTURAS DE LA POLIZA NO EXISTE..."); } }else{ setFilename(null); displayErrorMessage("LA POLIZA NO SE ENCUENTRA"); System.out.println("no se euencuentra la poliza: "); } setNumPoliza(null); setMonth(null); setType(null); } }
[ "julian.soto@itbmexico.com" ]
julian.soto@itbmexico.com
518c10af5ced97c37ad2965ebf59eee9ec103685
1aadffbe56edccccfa20f58fc7ee18fdf0dfb99a
/2.JavaCore/src/com/javarush/task/task20/task2025/SolutionLast.java
e24d31809e70fa7ae5deb6f39c8bcde635f73015
[]
no_license
zakhariya/JavaRushTasks
9b42a4d9aae8b7731fc3cfa8d4f47af5a832ee5b
81699f3bfe40c5e1450196624310563fb461cd1f
refs/heads/master
2022-02-19T07:10:18.004552
2022-02-06T10:51:03
2022-02-06T10:51:03
203,832,076
0
0
null
null
null
null
UTF-8
Java
false
false
3,625
java
/* package com.javarush.task.task20.task2025; import java.util.Date; import java.util.Set; import java.util.TreeSet; */ /* Алгоритмы-числа *//* public class SolutionLast { private static long[][] pows = new long[10][20]; private static long maxVal; private static byte maxPow; private static long count; private static Set<Long> armstrongSet = new TreeSet<>(); //TODO: remove private static long maxSum; private static long maxV; static { for (int i = 0; i < pows.length; i++) { for (int j = 0; j < pows[i].length; j++) { pows[i][j] = (long) Math.pow(i, j); } } } public static void main(String[] args) { long start = new Date().getTime(); long value = Long.MAX_VALUE; long[] numbers = getNumbers(value); long memory = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory(); System.out.println((new Date().getTime() - start) + " millis, " + memory/1048576 + " Mb" ); System.out.println(count + " numbers checked of " + value); System.out.println("******************"); System.out.println("Found number of armstrong - " + numbers.length); for (long number : numbers) { System.out.println(number); } System.out.println(maxSum + " - max sum"); System.out.println(maxV + " - max v"); } public static long[] getNumbers(long N) { // if (N < Long.MAX_VALUE) { // // } maxVal = N; maxPow = getCountsOfDigits(N); armstrongSet.clear(); generateNums(1, (byte) 1); long[] result = new long[armstrongSet.size()]; int i = 0; for (long n : armstrongSet) { result[i++] = n; } return result; } private static void generateNums(long x, byte pow) { count++; while (true) { long sum = 0; byte y; long n = x; while (n > 0) { y = (byte) (n % 10); sum += pows[y][pow]; // if (sum < 0 || sum > maxVal) { // return; // } if (x == 9223000000000000000L) { System.out.println("sdsdsdsdd"); } // 9223372036854775807 //TODO: remove if (sum > maxSum) { maxSum = sum; } if (x > maxV) { maxV = x; } n /= 10; } if (getCountsOfDigits(sum) == pow && isArmstrong(sum, pow)) { armstrongSet.add(sum); } if (!isNumberUnique(x)) { break; } else if (x < maxVal && pow < maxPow) { generateNums(x * 10, (byte) (pow + 1)); } x++; } } private static boolean isArmstrong(long num, byte pow) { long sum = 0; byte y; long n = num; while (n > 0) { y = (byte) (n % 10); sum += pows[y][pow]; n /= 10; } return sum == num; } private static boolean isNumberUnique(long number) { long last = number % 10; long n = number / 10; long prev = n % 10; return (n == 0) ? true : last <= prev; } public static byte getCountsOfDigits(long number) { return (number == 0) ? 1 : (byte) Math.ceil(Math.log10(Math.abs(number) + 0.5)); } } */
[ "alexander.zakhariya@gmail.com" ]
alexander.zakhariya@gmail.com
11c4f184e374e3492729760dfda95c6cf654ab79
5cfaeebdc7c50ca23ee368fa372d48ed1452dfeb
/xd_2b_dashboard_report/src/main/java/com/xiaodou/st/dashboard/domain/alarm/AlarmRecordDTO.java
056275e5fb51cb64b763f8b60ff34c66990f8e61
[]
no_license
zdhuangelephant/xd_pro
c8c8ff6dfcfb55aead733884909527389e2c8283
5611b036968edfff0b0b4f04f0c36968333b2c3b
refs/heads/master
2022-12-23T16:57:28.306580
2019-12-05T06:05:43
2019-12-05T06:05:43
226,020,526
0
2
null
2022-12-16T02:23:20
2019-12-05T05:06:27
JavaScript
UTF-8
Java
false
false
528
java
package com.xiaodou.st.dashboard.domain.alarm; import com.xiaodou.st.dashboard.constants.enums.AlarmLevelEnum; import com.xiaodou.st.dashboard.constants.enums.AlarmTypeEnum; import lombok.Data; @Data public class AlarmRecordDTO { /* alarmLevel 报警级别 初级,中级,高级 */ private AlarmLevelEnum alarmLevel; /* alarmTime 报警时间 */ private String alarmTime; /* alarmType 报警类型 */ private AlarmTypeEnum alarmType; private Integer pageNo; private Integer pageSize; }
[ "zedong.huang@bitmain.com" ]
zedong.huang@bitmain.com
05057a7f0ee2294da03ad4d90390aae537b6f378
a47fc8195c17f2fae1a18f8622a524b1ac2ec94b
/src/main/java/com/sprhib/init/Initializer.java
05db683bcb63f451e588befc7a5ec13ad0074cb0
[]
no_license
olegstasyshyn/sombra-test
b523a73c1300f6fe99c3929f7feeb22c6d750b44
932a3c20bfe07132e3525357e1f90ca32594678a
refs/heads/master
2020-04-03T22:51:01.302473
2018-10-31T19:25:09
2018-10-31T19:25:09
155,605,236
0
0
null
null
null
null
UTF-8
Java
false
false
951
java
package com.sprhib.init; import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.ServletRegistration.Dynamic; import org.springframework.web.WebApplicationInitializer; import org.springframework.web.context.ContextLoaderListener; import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; import org.springframework.web.servlet.DispatcherServlet; public class Initializer implements WebApplicationInitializer { public void onStartup(ServletContext servletContext) throws ServletException { AnnotationConfigWebApplicationContext ctx = new AnnotationConfigWebApplicationContext(); ctx.register(WebAppConfig.class); servletContext.addListener(new ContextLoaderListener(ctx)); ctx.setServletContext(servletContext); Dynamic servlet = servletContext.addServlet("dispatcher", new DispatcherServlet(ctx)); servlet.addMapping("/"); servlet.setLoadOnStartup(2); } }
[ "olegstasishin0@gmail.com" ]
olegstasishin0@gmail.com
f3984efdfbb0dd8f70cca761104bf7597b7c3d30
d6089f3b7fd427b60f8a1f1c9e6bf6549c0bb84f
/IN5BV_Control_Acedemico_GrupoNo1/src/main/java/com/grupono1/models/domain/Asignacion_Alumno.java
ca96f1eb139aae7c90f589644fca22292153685c
[]
no_license
fpascual2020343/Control_Academico_IN5BV_GrupoNo1
e2d7de14f75ff7c89c71a6a4d2e296c6a9abc326
f7dc3ccd8161cd5a4ac53dd77560d0cce4c01984
refs/heads/master
2023-07-25T18:04:25.010378
2021-09-04T04:02:25
2021-09-04T04:02:25
401,559,561
0
2
null
null
null
null
UTF-8
Java
false
false
2,209
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.grupono1.models.domain; import java.sql.Timestamp; /** * * @author Franshesco Emmanuel Pascual Ramires * @time 07:27:17 PM * @date 30/08/2021 * Codigo Tecnico: IN5BV * Carne: 2020343 * Jornada: Vespertina */ public class Asignacion_Alumno { private String asignacion_id; private String carne_alumno; private int id_curso; private Timestamp fecha_asignacion; public Asignacion_Alumno() { } public Asignacion_Alumno(String asignacion_id) { this.asignacion_id = asignacion_id; } public Asignacion_Alumno(String asignacion_id, String carne_alumno, int id_curso, Timestamp fecha_asignacion) { this.asignacion_id = asignacion_id; this.carne_alumno = carne_alumno; this.id_curso = id_curso; this.fecha_asignacion = fecha_asignacion; } public Asignacion_Alumno(String carne_alumno, int id_curso, Timestamp fecha_asignacion) { this.carne_alumno = carne_alumno; this.id_curso = id_curso; this.fecha_asignacion = fecha_asignacion; } public String getAsignacion_id() { return asignacion_id; } public void setAsignacion_id(String asignacion_id) { this.asignacion_id = asignacion_id; } public String getCarne_alumno() { return carne_alumno; } public void setCarne_alumno(String carne_alumno) { this.carne_alumno = carne_alumno; } public int getId_curso() { return id_curso; } public void setId_curso(int id_curso) { this.id_curso = id_curso; } public Timestamp getFecha_asignacion() { return fecha_asignacion; } public void setFecha_asignacion(Timestamp fecha_asignacion) { this.fecha_asignacion = fecha_asignacion; } @Override public String toString() { return "Asignacion_Alumno{" + "asignacion_id=" + asignacion_id + ", carne_alumno=" + carne_alumno + ", id_curso=" + id_curso + ", fecha_asignacion=" + fecha_asignacion + '}'; } }
[ "fpascual-2020343@kinal.edu.gt" ]
fpascual-2020343@kinal.edu.gt
8ad8b9a8a1e35bc517e2ca66f8ae46229e84c61a
c28a6f2c8ce8f986b5c22fd602e7349e68af8f9c
/android/vendor/realtek/apps/RealtekGallery2/src/com/android/gallery3d/glrenderer/UploadedTexture.java
7f1d4fd3de9cfe0f61422a82d4e32002d6f265f7
[]
no_license
BPI-SINOVOIP/BPI-1296-Android6
d6ade74367696c644a1b053b308d164ba53d3f8c
1ba45ab7555440dc3721d6acda3e831e7a3e3ff3
refs/heads/master
2023-02-24T18:23:02.110515
2019-08-09T04:01:16
2019-08-09T04:01:16
166,341,197
0
5
null
null
null
null
UTF-8
Java
false
false
9,350
java
/* * Copyright (C) 2010 The Android Open Source Project * * 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.android.gallery3d.glrenderer; import android.graphics.Bitmap; import android.graphics.Bitmap.Config; import android.opengl.GLUtils; import junit.framework.Assert; import java.util.HashMap; import javax.microedition.khronos.opengles.GL11; // UploadedTextures use a Bitmap for the content of the texture. // // Subclasses should implement onGetBitmap() to provide the Bitmap and // implement onFreeBitmap(mBitmap) which will be called when the Bitmap // is not needed anymore. // // isContentValid() is meaningful only when the isLoaded() returns true. // It means whether the content needs to be updated. // // The user of this class should call recycle() when the texture is not // needed anymore. // // By default an UploadedTexture is opaque (so it can be drawn faster without // blending). The user or subclass can override it using setOpaque(). public abstract class UploadedTexture extends BasicTexture { // To prevent keeping allocation the borders, we store those used borders here. // Since the length will be power of two, it won't use too much memory. private static HashMap<BorderKey, Bitmap> sBorderLines = new HashMap<BorderKey, Bitmap>(); private static BorderKey sBorderKey = new BorderKey(); @SuppressWarnings("unused") private static final String TAG = "Texture"; private boolean mContentValid = true; // indicate this textures is being uploaded in background private boolean mIsUploading = false; private boolean mOpaque = true; private boolean mThrottled = false; private static int sUploadedCount; private static final int UPLOAD_LIMIT = 100; protected Bitmap mBitmap; private int mBorder; protected UploadedTexture() { this(false); } protected UploadedTexture(boolean hasBorder) { super(null, 0, STATE_UNLOADED); if (hasBorder) { setBorder(true); mBorder = 1; } } protected void setIsUploading(boolean uploading) { mIsUploading = uploading; } public boolean isUploading() { return mIsUploading; } private static class BorderKey implements Cloneable { public boolean vertical; public Config config; public int length; @Override public int hashCode() { int x = config.hashCode() ^ length; return vertical ? x : -x; } @Override public boolean equals(Object object) { if (!(object instanceof BorderKey)) return false; BorderKey o = (BorderKey) object; return vertical == o.vertical && config == o.config && length == o.length; } @Override public BorderKey clone() { try { return (BorderKey) super.clone(); } catch (CloneNotSupportedException e) { throw new AssertionError(e); } } } protected void setThrottled(boolean throttled) { mThrottled = throttled; } private static Bitmap getBorderLine( boolean vertical, Config config, int length) { BorderKey key = sBorderKey; key.vertical = vertical; key.config = config; key.length = length; Bitmap bitmap = sBorderLines.get(key); if (bitmap == null) { bitmap = vertical ? Bitmap.createBitmap(1, length, config) : Bitmap.createBitmap(length, 1, config); sBorderLines.put(key.clone(), bitmap); } return bitmap; } private Bitmap getBitmap() { if (mBitmap == null) { mBitmap = onGetBitmap(); if(mBitmap == null) return null; int w = mBitmap.getWidth() + mBorder * 2; int h = mBitmap.getHeight() + mBorder * 2; if (mWidth == UNSPECIFIED) { setSize(w, h); } } return mBitmap; } private void freeBitmap() { // Assert.assertTrue(mBitmap != null); if(mBitmap != null) onFreeBitmap(mBitmap); mBitmap = null; } @Override public int getWidth() { if (mWidth == UNSPECIFIED) getBitmap(); return mWidth; } @Override public int getHeight() { if (mWidth == UNSPECIFIED) getBitmap(); return mHeight; } protected abstract Bitmap onGetBitmap(); protected abstract void onFreeBitmap(Bitmap bitmap); protected void invalidateContent() { if (mBitmap != null) freeBitmap(); mContentValid = false; mWidth = UNSPECIFIED; mHeight = UNSPECIFIED; } /** * Whether the content on GPU is valid. */ public boolean isContentValid() { return isLoaded() && mContentValid; } /** * Updates the content on GPU's memory. * @param canvas */ public void updateContent(GLCanvas canvas) { if (!isLoaded()) { if (mThrottled && ++sUploadedCount > UPLOAD_LIMIT) { return; } uploadToCanvas(canvas); } else if (!mContentValid) { Bitmap bitmap = getBitmap(); int format = GLUtils.getInternalFormat(bitmap); int type = GLUtils.getType(bitmap); canvas.texSubImage2D(this, mBorder, mBorder, bitmap, format, type); freeBitmap(); mContentValid = true; } } public static void resetUploadLimit() { sUploadedCount = 0; } public static boolean uploadLimitReached() { return sUploadedCount > UPLOAD_LIMIT; } private void uploadToCanvas(GLCanvas canvas) { Bitmap bitmap = getBitmap(); if (bitmap != null) { try { int bWidth = bitmap.getWidth(); int bHeight = bitmap.getHeight(); int width = bWidth + mBorder * 2; int height = bHeight + mBorder * 2; int texWidth = getTextureWidth(); int texHeight = getTextureHeight(); Assert.assertTrue(bWidth <= texWidth && bHeight <= texHeight); // Upload the bitmap to a new texture. mId = canvas.getGLId().generateTexture(); canvas.setTextureParameters(this); if (bWidth == texWidth && bHeight == texHeight) { canvas.initializeTexture(this, bitmap); } else { int format = GLUtils.getInternalFormat(bitmap); int type = GLUtils.getType(bitmap); Config config = bitmap.getConfig(); canvas.initializeTextureSize(this, format, type); canvas.texSubImage2D(this, mBorder, mBorder, bitmap, format, type); if (mBorder > 0) { // Left border Bitmap line = getBorderLine(true, config, texHeight); canvas.texSubImage2D(this, 0, 0, line, format, type); // Top border line = getBorderLine(false, config, texWidth); canvas.texSubImage2D(this, 0, 0, line, format, type); } // Right border if (mBorder + bWidth < texWidth) { Bitmap line = getBorderLine(true, config, texHeight); canvas.texSubImage2D(this, mBorder + bWidth, 0, line, format, type); } // Bottom border if (mBorder + bHeight < texHeight) { Bitmap line = getBorderLine(false, config, texWidth); canvas.texSubImage2D(this, 0, mBorder + bHeight, line, format, type); } } } finally { freeBitmap(); } // Update texture state. setAssociatedCanvas(canvas); mState = STATE_LOADED; mContentValid = true; } else { mState = STATE_ERROR; throw new RuntimeException("Texture load fail, no bitmap"); } } @Override protected boolean onBind(GLCanvas canvas) { updateContent(canvas); return isContentValid(); } @Override protected int getTarget() { return GL11.GL_TEXTURE_2D; } public void setOpaque(boolean isOpaque) { mOpaque = isOpaque; } @Override public boolean isOpaque() { return mOpaque; } @Override public void recycle() { super.recycle(); if (mBitmap != null) freeBitmap(); } }
[ "Justin" ]
Justin
19ffae00d321a262e6e49d6afd0b1dcbedaf35b6
7f92025c865511b852c71ed1be566202dc81b2b2
/parser/src/main/java/distribute/framework/ast/AstNodeSelectListItem.java
007ad5a9b5ae2c6edb072804e4d5b3fadc76836c
[ "MIT" ]
permissive
buzhidaolvtu/mysql-parser
cf5e3649286840ee86c09b271a52fdd1b0907953
3616a7a6d672cef52c893446a8be3c827f4f3a5b
refs/heads/master
2021-04-27T03:03:13.682870
2018-03-10T04:25:41
2018-03-10T04:25:41
122,707,713
1
0
null
null
null
null
UTF-8
Java
false
false
189
java
package distribute.framework.ast; public class AstNodeSelectListItem extends AstNode { public AstNodeSelectListItem(AstNode parent, String name) { super(parent, name); } }
[ "lvtu@boxfish.cn" ]
lvtu@boxfish.cn
6bc5223f926da1bb904fb63fa0525145cd141550
0a7905b973d7b8cd1a3f971ff68cd2b884d5e816
/project1/src/main/java/calculator/parser/grammar/CalculatorGrammarParserBaseListener.java
27e46c1f9c9012e638eb3de67bf3c80fa2b806c2
[]
no_license
luke-jiang/CSE_373
acddaf56e26b1b4a2acc3b294914886d13de8d82
fa9da51deb3fd8f2ee300bd5426f47b00134179d
refs/heads/master
2020-03-19T23:50:42.819254
2018-06-12T05:45:54
2018-06-12T05:45:54
137,022,283
2
0
null
null
null
null
UTF-8
Java
false
false
7,015
java
// Generated from CalculatorGrammarParser.g4 by ANTLR 4.5.1 package calculator.parser.grammar; import org.antlr.v4.runtime.ParserRuleContext; import org.antlr.v4.runtime.tree.ErrorNode; import org.antlr.v4.runtime.tree.TerminalNode; /** * This class provides an empty implementation of {@link CalculatorGrammarParserListener}, * which can be extended to create a listener which only needs to handle a subset * of the available methods. */ public class CalculatorGrammarParserBaseListener implements CalculatorGrammarParserListener { /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterProgram(CalculatorGrammarParser.ProgramContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitProgram(CalculatorGrammarParser.ProgramContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterAssignStmt(CalculatorGrammarParser.AssignStmtContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitAssignStmt(CalculatorGrammarParser.AssignStmtContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterExprStmt(CalculatorGrammarParser.ExprStmtContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitExprStmt(CalculatorGrammarParser.ExprStmtContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterAddExprBin(CalculatorGrammarParser.AddExprBinContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitAddExprBin(CalculatorGrammarParser.AddExprBinContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterAddExprSingle(CalculatorGrammarParser.AddExprSingleContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitAddExprSingle(CalculatorGrammarParser.AddExprSingleContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterMultExprSingle(CalculatorGrammarParser.MultExprSingleContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitMultExprSingle(CalculatorGrammarParser.MultExprSingleContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterMultExprBin(CalculatorGrammarParser.MultExprBinContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitMultExprBin(CalculatorGrammarParser.MultExprBinContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterNegExprUnary(CalculatorGrammarParser.NegExprUnaryContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitNegExprUnary(CalculatorGrammarParser.NegExprUnaryContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterNegExprSingle(CalculatorGrammarParser.NegExprSingleContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitNegExprSingle(CalculatorGrammarParser.NegExprSingleContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterPowExprBin(CalculatorGrammarParser.PowExprBinContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitPowExprBin(CalculatorGrammarParser.PowExprBinContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterPowExprSingle(CalculatorGrammarParser.PowExprSingleContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitPowExprSingle(CalculatorGrammarParser.PowExprSingleContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterNumber(CalculatorGrammarParser.NumberContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitNumber(CalculatorGrammarParser.NumberContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterRawString(CalculatorGrammarParser.RawStringContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitRawString(CalculatorGrammarParser.RawStringContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterVariable(CalculatorGrammarParser.VariableContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitVariable(CalculatorGrammarParser.VariableContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterFuncName(CalculatorGrammarParser.FuncNameContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitFuncName(CalculatorGrammarParser.FuncNameContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterParenExpr(CalculatorGrammarParser.ParenExprContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitParenExpr(CalculatorGrammarParser.ParenExprContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterArglist(CalculatorGrammarParser.ArglistContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitArglist(CalculatorGrammarParser.ArglistContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterEveryRule(ParserRuleContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitEveryRule(ParserRuleContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void visitTerminal(TerminalNode node) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void visitErrorNode(ErrorNode node) { } }
[ "yuxuanlukejiang@gmail.com" ]
yuxuanlukejiang@gmail.com
48334f41fd9114d9c905e06b53fc86e79cebca5e
f1aeb5df96cfe8b49d722e3c6360388cfeac4f8a
/src/View/ChuyenBan.java
6707f59aeabaa7913063507913c0df643eca21f3
[]
no_license
MoFG/Coffee
8151ba48e65a64a5c3100c24a90e4f8d3cfb5bc9
a5fba235d320dd0206b4adfec2ae53887870cf33
refs/heads/master
2021-04-25T04:50:02.938175
2017-12-19T02:43:56
2017-12-19T02:43:56
114,710,317
0
0
null
null
null
null
UTF-8
Java
false
false
11,661
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 View; import Controller.ControllerSanPham; import Model.ModelSanPham; import static View.Banhang.BH; import java.util.List; import javax.swing.DefaultComboBoxModel; import javax.swing.DefaultListModel; import javax.swing.JLabel; import javax.swing.JOptionPane; /** * * @author Computer */ public class ChuyenBan extends javax.swing.JFrame { DefaultComboBoxModel modellist; String mabancu = "", mabanmoi = "", masp = "", tensp = ""; int soluong = 0; /** * Creates new form ChuyenBan */ public ChuyenBan() { setLocationRelativeTo(null); initComponents(); setTitle("CHUYỂN BÀN"); setDefaultCloseOperation(DISPOSE_ON_CLOSE); } /** * 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. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); lbmabancu = new javax.swing.JLabel(); btnchuyen = new javax.swing.JButton(); cblist = new javax.swing.JComboBox<>(); jLabel4 = new javax.swing.JLabel(); btndongcb = new javax.swing.JButton(); jLabel3 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jLabel1.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N jLabel1.setText("BẠN MUỐN CHUYỂN BÀN?"); jLabel2.setText("Bàn hiện tại:"); lbmabancu.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N lbmabancu.setForeground(new java.awt.Color(204, 0, 51)); btnchuyen.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/horizontal.png"))); // NOI18N btnchuyen.setText("Chuyển bàn"); btnchuyen.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnchuyenActionPerformed(evt); } }); cblist.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Chọn bàn..." })); cblist.addAncestorListener(new javax.swing.event.AncestorListener() { public void ancestorMoved(javax.swing.event.AncestorEvent evt) { } public void ancestorAdded(javax.swing.event.AncestorEvent evt) { cblistAncestorAdded(evt); } public void ancestorRemoved(javax.swing.event.AncestorEvent evt) { } }); cblist.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cblistActionPerformed(evt); } }); btndongcb.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/cancel.png"))); // NOI18N btndongcb.setText("Đóng"); btndongcb.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btndongcbActionPerformed(evt); } }); jLabel3.setText("Chuyển sang bàn:"); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 4, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel1) .addGroup(layout.createSequentialGroup() .addComponent(btnchuyen) .addGap(18, 18, 18) .addComponent(btndongcb, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addComponent(jLabel3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(cblist, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(lbmabancu, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(0, 11, Short.MAX_VALUE)))) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(20, 20, 20) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(lbmabancu, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 22, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(cblist, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 28, Short.MAX_VALUE) .addComponent(jLabel4) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(btnchuyen, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(btndongcb)) .addContainerGap(31, Short.MAX_VALUE)) ); pack(); }// </editor-fold>//GEN-END:initComponents private void cblistAncestorAdded(javax.swing.event.AncestorEvent evt) {//GEN-FIRST:event_cblistAncestorAdded ModelSanPham sp = new ModelSanPham(); List<ModelSanPham> ds = sp.getdsBan(); modellist = new DefaultComboBoxModel<>(); for (int i = 0; i < ds.size(); i++) { modellist.addElement(ds.get(i).getMaban()); } cblist.setModel(modellist); }//GEN-LAST:event_cblistAncestorAdded private void btnchuyenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnchuyenActionPerformed ControllerSanPham csanpham = new ControllerSanPham(); mabancu = lbmabancu.getText(); mabanmoi = modellist.getSelectedItem().toString(); ModelSanPham sp = new ModelSanPham(); ModelSanPham ds = sp.laymagoi(mabancu, masp); int magoi = ds.getMagoi(); boolean result = csanpham.chuyenban(masp, mabancu, mabanmoi, magoi); // JOptionPane.showMessageDialog(null, mabancu + mabanmoi + soluong + masp); if (result) { JOptionPane.showMessageDialog(null, "Chuyển bàn thành công!"); // Refresh Panel Banhang bh=new Banhang(); BH.panelban.removeAll(); BH.loadiconBan(); BH.panelban.repaint(); BH.panelban.revalidate(); dispose(); //------------- } }//GEN-LAST:event_btnchuyenActionPerformed private void btndongcbActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btndongcbActionPerformed dispose(); }//GEN-LAST:event_btndongcbActionPerformed private void cblistActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cblistActionPerformed // TODO add your handling code here: }//GEN-LAST:event_cblistActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(ChuyenBan.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(ChuyenBan.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(ChuyenBan.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(ChuyenBan.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new ChuyenBan().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btnchuyen; private javax.swing.JButton btndongcb; private javax.swing.JComboBox<String> cblist; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; public javax.swing.JLabel lbmabancu; // End of variables declaration//GEN-END:variables }
[ "skynguyen79@gmail.com" ]
skynguyen79@gmail.com
b4d49bafc5826c5928f44c3a6582339596a0ffe3
7c11b2288136a31105c73ded507ce1641f5d537a
/ProjectO-JAVA/ProjectO-JAVA/src/main/java/com/example/TestCreateProject/Repository/ViewRepo.java
c4b1b0a4a99c0dece8904aac2f2bf676d99eab74
[]
no_license
plaooo/Project
a105e867cd80b7c3cb41ec10296044166248cb58
7ccae56cb004b822e79fd2b2c1f4f716f3745e4e
refs/heads/master
2023-01-21T03:08:47.848525
2019-06-04T17:11:31
2019-06-04T17:11:31
190,247,636
0
0
null
2023-01-07T06:05:02
2019-06-04T17:20:44
TypeScript
UTF-8
Java
false
false
4,245
java
package com.example.TestCreateProject.Repository; import java.math.BigDecimal; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.stereotype.Repository; import com.example.TestCreateProject.Model.ViewMonth; import com.example.TestCreateProject.Model.Viewday; import com.example.TestCreateProject.Model.Viewyear; @Repository public class ViewRepo { @Autowired private JdbcTemplate jbcTemplate; private static final DateFormat date = new SimpleDateFormat("yyyy/MM/dd"); Date d = new Date(); String days = date.format(d); String day[] = days.split("/"); String year = day[0]; String month = day[1]; String one = day[2]; public List<Viewyear> GetTopViewYear(){ List<Viewyear> viewyears = new ArrayList<Viewyear>(); List<Map<String,Object>> rows = jbcTemplate.queryForList ("SELECT book.name_fiction,book.id_book,book.img_book,YEAR(episode.day_create_episode),SUM(episode.view)\r\n" + "FROM ( episode INNER JOIN book ON episode.id_book=book.id_book )\r\n" + " WHERE YEAR(episode.day_create_episode)="+year+"\r\n" + " GROUP BY book.name_fiction\r\n" + " ORDER BY episode.view DESC LIMIT 1"); for(Map<String,Object> row:rows) { Viewyear viewyear = new Viewyear(); viewyear.setNameFiction((String) row.get("name_fiction")); viewyear.setViewYear((int) row.get("YEAR(episode.day_create_episode)")); viewyear.setSum((BigDecimal) row.get("SUM(episode.view)")); viewyear.setIdBook((int) row.get("id_book")); viewyear.setImgBook((String) row.get("img_book")); viewyears.add(viewyear); } return viewyears; } public List<ViewMonth> GetTopViewMonth(){ System.out.print(month); List<ViewMonth> viewmonths = new ArrayList<ViewMonth>(); List<Map<String,Object>> rows = jbcTemplate.queryForList ("SELECT book.name_fiction,book.id_book,book.img_book,MONTH(episode.day_create_episode),YEAR(episode.day_create_episode),SUM(episode.view)\r\n" + "FROM ( episode INNER JOIN book ON episode.id_book=book.id_book )\r\n" + " WHERE MONTH(episode.day_create_episode)="+month+" AND YEAR(episode.day_create_episode)="+year+"\r\n" + " GROUP BY book.name_fiction\r\n" + " ORDER BY episode.view DESC LIMIT 1"); for(Map<String,Object> row:rows) { ViewMonth viewmonth = new ViewMonth(); viewmonth.setNameFiction((String) row.get("name_fiction")); viewmonth.setViewMonth((int) row.get("MONTH(episode.day_create_episode)")); viewmonth.setViewYear((int) row.get("YEAR(episode.day_create_episode)")); viewmonth.setSum((BigDecimal) row.get("SUM(episode.view)")); viewmonth.setIdBook((int) row.get("id_book")); viewmonth.setImgBook((String) row.get("img_book")); viewmonths.add(viewmonth); } return viewmonths; } public List<Viewday> GetTopViewDay(){ List<Viewday> viewdays = new ArrayList<Viewday>(); List<Map<String,Object>> rows = jbcTemplate.queryForList ("SELECT book.name_fiction,book.id_book,book.img_book,DAY(episode.day_create_episode),MONTH(episode.day_create_episode),YEAR(episode.day_create_episode),SUM(episode.view)\r\n" + "FROM ( episode INNER JOIN book ON episode.id_book=book.id_book )\r\n" + " WHERE DAY(episode.day_create_episode)="+one+" AND MONTH(episode.day_create_episode)="+month+" AND YEAR(episode.day_create_episode)="+year+"\r\n" + " GROUP BY book.name_fiction\r\n" + " ORDER BY episode.view DESC LIMIT 1"); for(Map<String,Object> row:rows) { Viewday viewday = new Viewday(); viewday.setNameFiction((String) row.get("name_fiction")); viewday.setViewDay((int) row.get("DAY(episode.day_create_episode)")); viewday.setViewMonth((int) row.get("MONTH(episode.day_create_episode)")); viewday.setViewYear((int) row.get("YEAR(episode.day_create_episode)")); viewday.setSum((BigDecimal) row.get("SUM(episode.view)")); viewday.setIdBook((int) row.get("id_book")); viewday.setImgBook((String) row.get("img_book")); viewdays.add(viewday); } return viewdays; } }
[ "boyboy12364@hotmail.com" ]
boyboy12364@hotmail.com
915d81707e98d780d203b72ee14b9ab6d18e013e
fcba28abf98a91cbced7080d455fb273a4efefb6
/src/main/java/com/bdxh/kmsale/service/impl/CommNewAgentServiceImpl.java
5321a3b02be6667bf60702963deade70b382d265
[]
no_license
liuxinhongg/javaweb
171d05280a64382f96532ea8931ddebbcdad0c74
7b6eb0427b5e87f2bad210eec1319ad1dcf13662
refs/heads/master
2020-04-06T17:05:53.189878
2018-11-15T02:35:32
2018-11-15T02:35:32
157,646,572
0
0
null
null
null
null
UTF-8
Java
false
false
1,539
java
package com.bdxh.kmsale.service.impl; import java.util.List; import javax.annotation.Resource; import org.springframework.stereotype.Service; import com.bdxh.kmsale.bean.code.CommNewAgentPo; import com.bdxh.kmsale.domain.Paging; import com.bdxh.kmsale.mapper.code.CommNewAgentMapper; import com.bdxh.kmsale.service.CommNewAgentService; @Service public class CommNewAgentServiceImpl implements CommNewAgentService{ @Resource private CommNewAgentMapper commNewAgentMapper; @Override public List<CommNewAgentPo> getPage(Paging paging) { // TODO Auto-generated method stub return commNewAgentMapper.getPage(paging); } @Override public Long getCount() { // TODO Auto-generated method stub return commNewAgentMapper.getCount(); } @Override public CommNewAgentPo getCommNewAgentPoById(String codeId) { // TODO Auto-generated method stub return commNewAgentMapper.getCommNewAgentPoById(codeId); } @Override public Integer insertCommNewAgentPo(CommNewAgentPo commNewAgentPo) { // TODO Auto-generated method stub return commNewAgentMapper.insertCommNewAgentPo(commNewAgentPo); } @Override public Integer updateCommNewAgentPo(CommNewAgentPo commNewAgentPo) { // TODO Auto-generated method stub return commNewAgentMapper.updateCommNewAgentPo(commNewAgentPo); } @Override public Integer deleteCommNewAgentPo(String codeId) { String[] codeIds = codeId.split(","); for(int i = 0 ; i < codeIds.length ; i ++) { commNewAgentMapper.deleteCommNewAgentPo(codeIds[i]); } return 1; } }
[ "tzrgaga@gmail.com" ]
tzrgaga@gmail.com
2d6d6a5880292448561b8b48cd4ed553350d0343
a16745a6658cfeb390572ba3698bbd2388c11b87
/programasprint/EjercicioEnClase11/src/EjercicioEnClase11.java
a6aef1e376182b1bec4e74a06218b5ec2fd54791
[]
no_license
angelGuetio/uccprog2
2672027827f3d8c05df73a21fd465b8b1ccec571
f8360beeff831aace6acea7886694eebdc141e09
refs/heads/master
2023-01-20T08:06:43.172945
2020-11-25T15:21:34
2020-11-25T15:21:34
298,878,925
0
0
null
null
null
null
ISO-8859-1
Java
false
false
2,250
java
import java.util.Scanner; public class EjercicioEnClase11 { public static void main(String[] args) { Scanner digitos= new Scanner(System.in); System.out.println("+------------------------------------------------------------------------+"); System.out.println("| AUTOR: Angel Yesid Guetio |"); System.out.println("| FECHA: Octubre 31 del 2020 |"); System.out.println("+------------------------------------------------------------------------+"); System.out.println("| TRABAJO EN CLASE: EJERCICIO 08 |"); System.out.println("+------------------------------------------------------------------------+"); System.out.println(""); int i=1; int a=2; int n=11; int caracol=3; int caracol01=2; int re=0; System.out.println("acomulados descenso por noche ascenso por dia "); System.out.println(); while(i<n) { System.out.println ( " " + (a+i) + " "+2+ " "+i); i++; re=(55); } System.out.println("El caracol subio la pared en " +re+" dias"); System.out.println(); int ii=1; int aa=3; int nn=11; int cienpies=4; int cienpies01=3; int cien=0; System.out.println("acomulados descenso por noche ascenso por dia "); System.out.println(); while(ii<nn) { System.out.println ( " " + (aa+ii) + " "+3+ " "+ii); ii++; cien=55; } System.out.println("El cienpiés subio la pared en " +cien+" dias"); System.out.println(); System.out.println(); int iii=1+2; int aaa=1; int nnn=12; int gusano=4; int gusano01=2; int gus=0; System.out.println("acomulados descenso por noche ascenso por dia "); System.out.println(); while(iii<nnn) { System.out.println ( " " + (aaa+iii)+ " "+2+ " "+(iii-1)); iii +=2; gus=30; } System.out.println("El gusano subio la pared en " +gus+" dias"); System.out.println(); System.out.println(); } }
[ "yesid4681@gmail.com" ]
yesid4681@gmail.com
153b6efab1b4d75b910a8fa25f4299463e5acd7d
8e67f98f026f53033e888469da72723cd51a30bb
/app/src/androidTest/java/com/pandita/graphinggraphs/ExampleInstrumentedTest.java
af5f109987b32b2e6c6d10e5c64295c5bc847986
[]
no_license
rsilloca/GraphingGraphs
da082acd9c755c8151e3f1fa2a8ac81582a08b10
e2b4a049cc4ede8ea94c8fdb8aa41038ef026fba
refs/heads/master
2023-08-20T11:55:27.948693
2021-10-24T06:00:14
2021-10-24T06:00:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
736
java
package com.pandita.graphinggraphs; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.pandita.graphinggraphs", appContext.getPackageName()); } }
[ "rsillocacastro@gmail.com" ]
rsillocacastro@gmail.com
f01edd3e4685fb6d2497d33860af422b4b1aae7b
017fd183081227b81f25aa541ef6908e03f65cc6
/com/shanemulcair/projecteuler/Problem5.java
13a56825c8d7f5f467cdbc5c2d82ceac91926d13
[]
no_license
shane-mulcair/project-euler
02611a4613f3de0c069b5b1de9bc60d4e3c0b21d
dfc8a7a67267beda617f207a886dfda5a7a3b65b
refs/heads/master
2021-01-10T04:16:07.099320
2016-03-01T13:38:42
2016-03-01T13:38:42
52,877,313
0
0
null
null
null
null
UTF-8
Java
false
false
847
java
package com.shanemulcair.projecteuler; /* * 2520 is the smallest number that can be divided by each * of the numbers from 1 to 10 without any remainder. * What is the smallest positive number that is evenly divisible * by all of the numbers from 1 to 20? * */ public class Problem5 { public long getSmallestMultiple(int rangeStart, int rangeFinish){ boolean notFound=true; long multiple=1; int tempSum=0; int[] range=new int[rangeFinish-rangeStart]; while(notFound){ int j=0; for(int i=rangeStart;i<rangeFinish;i++){ if(multiple%i==0){ range[j]=0; } else{ range[j]=1; } j++; } for(int k=0;k<j;k++){ tempSum+=range[k]; } if(tempSum==0){ notFound=false; } else{ tempSum=0; multiple++; } } return multiple; } }
[ "shane-mulcair@users.noreply.github.com" ]
shane-mulcair@users.noreply.github.com
7c4d3414dde24bdc1b0a0cbacdd32a4f2239b5fa
c0c0c729a020d73f0148967ca1aa506b48bb20c2
/app/src/main/java/com/zscdumin/zhixinapp/fragment/ParentFragment.java
223ae0230f1fcc07d376e3d3a37dcfd2aafb6841
[]
no_license
liujizhao/ZhiXinApp
a2054d5644860a0b4d7bcd9a0bff18e79261ed64
0135ab172f307dad5143c7c65156cf479eddf3be
refs/heads/master
2020-08-03T05:52:41.673925
2018-12-03T01:46:47
2018-12-03T01:46:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,244
java
package com.zscdumin.zhixinapp.fragment; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.design.widget.TabLayout; import android.support.v4.app.Fragment; import android.support.v4.view.ViewPager; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.zscdumin.zhixinapp.R; import com.zscdumin.zhixinapp.adapter.mPagerAdapter; import com.zscdumin.zhixinapp.utils.Urls; import java.util.ArrayList; /** * Created by luo-pc on 2016/5/15. */ public class ParentFragment extends Fragment { private ViewPager vp_content; private TabLayout tab_title; private ArrayList<String> titleList; private ArrayList<Fragment> fragmentList = new ArrayList<>(); @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_news, null); initView(view); initData(); vp_content.setOffscreenPageLimit(3); vp_content.setAdapter(new mPagerAdapter(getChildFragmentManager(), fragmentList, titleList)); tab_title.setupWithViewPager(vp_content); return view; } private void initData() { titleList = new ArrayList<>(); titleList.add("头条"); titleList.add("NBA"); titleList.add("汽车"); titleList.add("笑话"); NewsListFragment hotNewsList = new NewsListFragment(); hotNewsList.setKeyword(Urls.TOP_ID); NewsListFragment sportNewsList = new NewsListFragment(); sportNewsList.setKeyword(Urls.NBA_ID); NewsListFragment carNewsList = new NewsListFragment(); carNewsList.setKeyword(Urls.CAR_ID); NewsListFragment jokeNewsList = new NewsListFragment(); jokeNewsList.setKeyword(Urls.JOKE_ID); fragmentList.add(hotNewsList); fragmentList.add(sportNewsList); fragmentList.add(carNewsList); fragmentList.add(jokeNewsList); } private void initView(View view) { tab_title = (TabLayout) view.findViewById(R.id.tab_title); vp_content = (ViewPager) view.findViewById(R.id.vp_content); } }
[ "2712220318@qq.com" ]
2712220318@qq.com
d033e4a9c75ca55f50bbfc3d1f4e846c9e5629a1
b295cffc1de37330b0b8d28a4d81faac01de7f22
/CODE/android/device/eostek/common/apps/HotKeyService/src/com/eostek/hotkeyservice/HotKeyApplication.java
53b69a54170c022b753cd493c36753b0d1891827
[]
no_license
windxixi/test
fc2487d73a959050d8ad37d718b09a243660ec64
278a167c26fb608f700b81656f32e734f536c9f9
refs/heads/master
2023-03-16T19:59:41.941474
2016-07-25T04:18:41
2016-07-25T04:18:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
507
java
package com.eostek.hotkeyservice; import java.lang.Thread.UncaughtExceptionHandler; import android.app.Application; public class HotKeyApplication extends Application implements UncaughtExceptionHandler { @Override public void onCreate() { super.onCreate(); // Thread.setDefaultUncaughtExceptionHandler(this); } @Override public void uncaughtException(Thread thread, Throwable ex) { ex.printStackTrace(); System.exit(0); } }
[ "gracie.zhou@ieostek.com" ]
gracie.zhou@ieostek.com
8fdc6129e4d392864f4f8ee325455f7f56cde03b
f0e4e6f2380074baefabba37ccc5d96fe6141328
/JDBC Programs/Insertion.java
51554fa731e78ed7d36311037677724cd5b12667
[]
no_license
debiprasadmishra50/All-JDBC-Operation-MySQL
b71308b271545aaa22556a4570b9b99aa22e8997
0d36bd58420c7547a73b2cfaff5f2e07343f317e
refs/heads/master
2022-11-08T16:58:58.474498
2020-06-28T08:16:40
2020-06-28T08:16:40
275,538,847
0
0
null
null
null
null
UTF-8
Java
false
false
1,327
java
import java.sql.*; public class Insertion { public static void main(String[] args) throws SQLException { Connection myConn = null; Statement myStmt = null; ResultSet myRs = null; String dbUrl = "jdbc:mysql://localhost:3306/demo"; String user = "student"; String pass = "sipusipu18"; try { // 1. Get a connection to database myConn = DriverManager.getConnection(dbUrl, user, pass); // 2. Create a statement myStmt = myConn.createStatement(); // 3. Insert a new employee System.out.println("Inserting a new employee to database\n"); int rowsAffected = myStmt.executeUpdate( "insert into employees " + "(last_name, first_name, email, department, salary) " + "values " + "('Wright', 'Eric', 'eric.wright@foo.com', 'HR', 33000.00)"); // 4. Verify this by getting a list of employees myRs = myStmt.executeQuery("select * from employees order by last_name"); // 5. Process the result set while (myRs.next()) { System.out.println(myRs.getString("last_name") + ", " + myRs.getString("first_name")); } } catch (Exception exc) { exc.printStackTrace(); } finally { if (myRs != null) { myRs.close(); } if (myStmt != null) { myStmt.close(); } if (myConn != null) { myConn.close(); } } } }
[ "debiprasadmishra50@gmail.com" ]
debiprasadmishra50@gmail.com
af48f787ba683bc4ac6afbefc345ddcbb6251bf0
dcff78b651a383b09432523c18acdd782ac30a13
/src/test/java/calculator/trigonomicTests/TgTest.java
7a330b971066b87ee0b8488b5ae4f7fa1df19afa
[]
no_license
tatsianapaluyan/globo_automation
30df053240bfad1e3373e513b1947522d776a202
19f78d6ced7faffb4b957be8192c9c713a4b775a
refs/heads/master
2020-03-08T20:03:19.795567
2018-04-19T09:58:30
2018-04-19T09:58:30
128,362,266
0
0
null
null
null
null
UTF-8
Java
false
false
807
java
package calculator.trigonomicTests; import calculator.ConfigurationTest; import com.epam.tat.module4.Calculator; import org.testng.Assert; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; public class TgTest extends ConfigurationTest { @Test(dataProvider = "DoubleTgMethodDataProvider", groups = {"exclude_group"}) public void testTgMethod(double a, double expectedResult) throws Exception { double result = new Calculator().tg(a); Assert.assertEquals(result, expectedResult, "Invalid result of double ctg, expected: " + expectedResult); } @DataProvider(name = "DoubleTgMethodDataProvider") public Object[][] tgDataProvider() { return new Object[][]{ {90.0, 1.0}, {180.0, 1.0} }; } }
[ "tatsiana_paluyan@epam.com" ]
tatsiana_paluyan@epam.com
d071e780a88b8dc2d677f94b0a3d913dc082b6a4
dbd600e3deed2419b4d25bba04381ac4de8838b3
/Food/src/Food.java
4198aa1f4e16402997c5a95fda8da07faee79340
[]
no_license
aquib-mujtaba/eclipseJavaProjects
9838a3d1d66af6f457494ef820bee5b26b35374e
7ecaac0f1a4ad939e19e7075803268b159a548f1
refs/heads/master
2020-03-23T16:29:41.962264
2018-07-25T17:18:45
2018-07-25T17:18:45
141,812,931
0
0
null
null
null
null
UTF-8
Java
false
false
51
java
public class Food { String fName = "Food name"; }
[ "aquib.mujtaba@live.com" ]
aquib.mujtaba@live.com
348b55d89a6f8659f187544fb57546f8f68abb66
21af95343fc289a3e991e84f327a71e2f3e9359b
/base/src/com/xxshop/foundation/service/impl/AddressServiceImpl.java
29adfcacca3bf2a365071f12c7a0584673814c32
[]
no_license
one-punch/styx
54185d6fa9546fed44d14903cd88f99c378e9a50
dd4ba564bd66b8caa072b93da049b9dbb2149819
refs/heads/master
2021-01-17T10:20:26.246601
2016-06-21T04:31:55
2016-06-21T04:31:55
59,368,670
0
0
null
2016-06-21T04:31:56
2016-05-21T15:58:47
Java
UTF-8
Java
false
false
2,634
java
package com.xxshop.foundation.service.impl; import com.xxshop.core.dao.IGenericDAO; import com.xxshop.core.query.GenericPageList; import com.xxshop.core.query.PageObject; import com.xxshop.core.query.support.IPageList; import com.xxshop.core.query.support.IQueryObject; import com.xxshop.foundation.domain.Address; import com.xxshop.foundation.service.IAddressService; import java.io.Serializable; import java.util.List; import java.util.Map; import javax.annotation.Resource; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @Service @Transactional public class AddressServiceImpl implements IAddressService { @Resource(name="addressDAO") private IGenericDAO<Address> addressDao; public boolean save(Address address) { try { this.addressDao.save(address); return true; } catch (Exception e) { e.printStackTrace(); }return false; } public Address getObjById(Long id) { Address address = (Address)this.addressDao.get(id); if (address != null) { return address; } return null; } public boolean delete(Long id) { try { this.addressDao.remove(id); return true; } catch (Exception e) { e.printStackTrace(); }return false; } public boolean batchDelete(List<Serializable> addressIds) { for (Serializable id : addressIds) { delete((Long)id); } return true; } public IPageList list(IQueryObject properties) { if (properties == null) { return null; } String query = properties.getQuery(); Map params = properties.getParameters(); GenericPageList pList = new GenericPageList(Address.class, query, params, this.addressDao); if (properties != null) { PageObject pageObj = properties.getPageObj(); if (pageObj != null) pList.doList(pageObj.getCurrentPage() == null ? 0 : pageObj .getCurrentPage().intValue(), pageObj.getPageSize() == null ? 0 : pageObj.getPageSize().intValue()); } else { pList.doList(0, -1); }return pList; } public boolean update(Address address) { try { this.addressDao.update(address); return true; } catch (Exception e) { e.printStackTrace(); }return false; } public List<Address> query(String query, Map params, int begin, int max) { return this.addressDao.query(query, params, begin, max); } }
[ "chailink100@gmail.com" ]
chailink100@gmail.com
90a691e90a6913c5c8655544f33faa0b3f711194
99e92aefc2b24f84c08ef1b675b9e29837fecd42
/mybatis-generator-core/src/main/java/org/mybatis/generator/codegen/mybatis3/xmlmapper/elements/bjdj/ComplexFindOneElementGenerator.java
0df35646b7945f4172da4207f0e09114e830a0eb
[ "Apache-2.0" ]
permissive
kongh/dream-mybatis-generator
95654b057f857704088eaba75fa17141731626af
1c3bfcc7bdc8694b29dab39a131bb66e2997e5a6
refs/heads/master
2016-09-05T14:50:47.209346
2015-10-08T07:25:35
2015-10-08T07:25:35
41,085,280
0
0
null
null
null
null
UTF-8
Java
false
false
1,704
java
package org.mybatis.generator.codegen.mybatis3.xmlmapper.elements.bjdj; import org.mybatis.generator.api.dom.xml.Attribute; import org.mybatis.generator.api.dom.xml.TextElement; import org.mybatis.generator.api.dom.xml.XmlElement; import org.mybatis.generator.codegen.mybatis3.xmlmapper.elements.AbstractXmlElementGenerator; /** * Created by Administrator on 2015/6/16. */ public class ComplexFindOneElementGenerator extends AbstractXmlElementGenerator{ @Override public void addElements(XmlElement parentElement) { XmlElement answer = new XmlElement("select"); //$NON-NLS-1$ answer.addAttribute(new Attribute("id", "findOne")); answer.addAttribute(new Attribute("parameterType", BJDJConstants.PARAMETER_TYPE)); //$NON-NLS-1$ answer.addAttribute(new Attribute( "resultMap", introspectedTable.getBaseResultMapId())); //$NON-NLS-1$ context.getCommentGenerator().addComment(answer); StringBuffer buffer = new StringBuffer(); buffer.append("select "); buffer.append(BJDJConstants.REFID + " "); buffer.append(" from "); buffer.append(introspectedTable.getFullyQualifiedTableNameAtRuntime()); answer.addElement(new TextElement(buffer.toString())); //$NON-NLS-1$ //where reference buffer.delete(0, buffer.length()); buffer.append(BJDJConstants.WHERE_REFERENCE); answer.addElement(new TextElement(buffer.toString())); //order reference buffer.delete(0, buffer.length()); buffer.append(BJDJConstants.ROW_LOCK_REFERENCE); answer.addElement(new TextElement(buffer.toString())); parentElement.addElement(answer); } }
[ "563796329@qq.com" ]
563796329@qq.com
0c33003e10d91b611378b414805b752e9cd794c3
38be824395eb16f93cf1b61b84dd48d60e3b24ff
/src/main/java/com/luulsolutions/luulpos/web/rest/vm/KeyAndPasswordVM.java
3c4dc39aa76d181c0a1cdb9afdb2ccd73d882e8d
[ "Apache-2.0" ]
permissive
gustavocaraciolo/luulpos_backend
1443bdfef0791568ebc17b132d3f4ba579525076
1626620d1355b9feab7beac3aaf4e5c1003ac26d
refs/heads/master
2020-05-16T06:48:46.833288
2019-04-23T07:37:18
2019-04-23T07:37:18
182,859,518
0
0
Apache-2.0
2019-04-22T20:05:15
2019-04-22T20:05:14
null
UTF-8
Java
false
false
506
java
package com.luulsolutions.luulpos.web.rest.vm; /** * View Model object for storing the user's key and password. */ public class KeyAndPasswordVM { private String key; private String newPassword; public String getKey() { return key; } public void setKey(String key) { this.key = key; } public String getNewPassword() { return newPassword; } public void setNewPassword(String newPassword) { this.newPassword = newPassword; } }
[ "ahmed.dini@luulsolutions.com" ]
ahmed.dini@luulsolutions.com
25b7f2bf3215db173b90e02c2fd8fbce2ea3361b
d7e6bf026a043ed770718127bc8d79c5f8ed0314
/src/org/lynxlake/_05InheritanceLab/_01SingleInheritance/Animal.java
58c42926f0e56e943b8f5c3a57c834699cf68b3d
[]
no_license
plamen911/java-oop-basics
e2fa792b27a214985d2b9810de8a3784f260665b
e82e766a794ff0bde963e50d24d63df9cb2370a8
refs/heads/master
2021-01-13T03:36:30.473424
2017-03-11T07:04:01
2017-03-11T07:04:01
77,316,579
0
0
null
null
null
null
UTF-8
Java
false
false
157
java
package org.lynxlake._05InheritanceLab._01SingleInheritance; public class Animal { public void eat() { System.out.println("eating..."); } }
[ "1" ]
1
7afb8246e7b39ae30906e5d16add78c784f25733
70cbaeb10970c6996b80a3e908258f240cbf1b99
/WiFi万能钥匙dex1-dex2jar.jar.src/bluefay/support/annotation/AnimRes.java
77bf2c2f9de875f61bea13b74fe37862964e7a50
[]
no_license
nwpu043814/wifimaster4.2.02
eabd02f529a259ca3b5b63fe68c081974393e3dd
ef4ce18574fd7b1e4dafa59318df9d8748c87d37
refs/heads/master
2021-08-28T11:11:12.320794
2017-12-12T03:01:54
2017-12-12T03:01:54
113,553,417
2
1
null
null
null
null
UTF-8
Java
false
false
647
java
package bluefay.support.annotation; import java.lang.annotation.Annotation; import java.lang.annotation.Documented; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Documented @Retention(RetentionPolicy.SOURCE) @Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD}) public @interface AnimRes {} /* Location: /Users/hanlian/Downloads/WiFi万能钥匙dex1-dex2jar.jar!/bluefay/support/annotation/AnimRes.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "lianh@jumei.com" ]
lianh@jumei.com
f9f8c85acd5844e088e528a2a80e07a2fd6eedde
0582f87bffd85c81d7abbbb7231c4ffe5f77b0be
/src/main/java/br/evoluum/robot/model/Direction.java
94ebdbf1fe884e95c909019e165af5c087ebcb38
[]
no_license
mychellt/mars-robot
596e5a0f93cf472a0151b82cbde17fdff94678bd
66cf143f32711ae8acdc2bb2993a540028ed9d33
refs/heads/master
2022-12-20T04:06:04.149973
2020-09-23T19:32:33
2020-09-23T19:32:33
298,073,047
0
0
null
null
null
null
UTF-8
Java
false
false
627
java
package br.evoluum.robot.model; /** * @author Mychell Teixeira (mychellt@gmail.com) * @since 22/09/2020 */ public enum Direction { NORTH("N"), SOUTH("S"), EAST("E"), WEST("W"); private final String code; Direction(String code) { this.code = code; } public String getCode() { return code; } public boolean isNorth() { return this.equals(NORTH); } public boolean isSouth() { return this.equals(SOUTH); } public boolean isEast() { return this.equals(EAST); } public boolean isWest() { return this.equals(WEST); } }
[ "mychellt@info.ufrn.br" ]
mychellt@info.ufrn.br
59dbb6aca6d448b5741900f61d72ed591cf27e3b
f66a3be411ab6f2259104135867716bac2559f31
/test/JUnitTestBoardMovement.java
a846198cfb11bde34a74a501daa6661f15cfb191
[]
no_license
Tim3Ds/CS3230-Final-Stratigo-War
a13d5d81994737a677c9db3a44da3efb11b774e8
71b39698950d2c98542ba6150bb451a720a6d626
refs/heads/master
2021-07-20T11:59:33.846800
2017-10-22T20:35:55
2017-10-22T20:35:55
107,900,408
0
0
null
null
null
null
UTF-8
Java
false
false
3,169
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. */ import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import static org.junit.Assert.*; import Logic.Board; import Logic.Player; /** * * @author tim */ public class JUnitTestBoardMovement { Board b; Player p1, p2; public JUnitTestBoardMovement() { } @BeforeClass public static void setUpClass() { } @AfterClass public static void tearDownClass() { } @Before public void setUp() { p1 = new Player("test",1); p2 = new Player("test2",2); b = new Board(); b.addPiece(p1.getPiece(0), 0, 0); b.addPiece(p1.getPiece(5), 3, 1); b.addPiece(p1.getPiece(30), 6, 2); b.addPiece(p2.getPiece(15), 0, 1); b.addPiece(p2.getPiece(23), 6, 3); b.addPiece(p2.getPiece(25), 4, 1); b.addPiece(p2.getPiece(39), 8, 2); } @After public void tearDown() { } // TODO add test methods here. // The methods must be annotated with annotation @Test. For example: // @Test// test moving pieces public void TestBoardMove0p1(){ this.setUp(); System.out.println(b.toString()); assertEquals("Captain", b.choosePiece(6, 2).toString()); b.move(b.choosePiece(6, 2), "up", 1); assertEquals("Captain", b.choosePiece(6, 3).toString()); System.out.println(b.toString()); System.out.println(b.turnCheck()); } @Test// test attacking public void TestBoardMove1p2Attack1(){ this.setUp(); System.out.println(b.toString()); b.move(b.choosePiece(6, 2), "down", 2); System.out.println(b.turnCheck()); b.move(b.choosePiece(4, 1), "left", 1); System.out.println(b.toString()); System.out.println(b.turnCheck()); assertEquals("empty", b.choosePiece(4, 1).toString()); assertEquals("Bomb", b.choosePiece(3, 1).toString()); } @Test// test attacking public void TestBoardMove2p1Move2(){ this.setUp(); System.out.println(b.toString()); b.move(b.choosePiece(6, 2), "right", 2); System.out.println(b.turnCheck()); b.move(b.choosePiece(4, 1), "left", 1); System.out.println(b.toString()); System.out.println(b.turnCheck()); b.move(b.choosePiece(4, 2), "left", 2); System.out.println(b.toString()); System.out.println(b.turnCheck()); assertEquals("Marshall", b.choosePiece(8, 2).toString()); } @Test// test Capture Flage public void TestBoardMove3p2CaptureFlage(){ this.setUp(); b.move(b.choosePiece(6, 2), "left", 2); b.move(b.choosePiece(4, 1), "left", 1); b.move(b.choosePiece(4, 2), "left", 2); b.move(b.choosePiece(0, 1), "down", 1); assertEquals("Winner", b.choosePiece(0, 0).toString()); } }
[ "Tim3Ds@gmail.com" ]
Tim3Ds@gmail.com
0aaed3c3cba1d63417c257bde532e4bc4057d75a
5e21f7dacb16b90ec116c1dfe8d12489d7fa5ae2
/projects/asw-875-spring-cloud/a3-lucky-word-cloud-config-client-refresh/src/main/java/asw/springcloud/luckyword/LuckyWordController.java
c9f34fc519bc28d48d1828da64be174d98c7b2b3
[ "MIT" ]
permissive
aswroma3/asw-2018
5800c6bd532550e90c4eb711b741cc6ba593b94a
9f41b4255f8906cac42f9e6c6d039ad3f2fc6031
refs/heads/master
2021-09-20T04:03:10.774700
2018-08-03T07:13:29
2018-08-03T07:13:29
122,209,616
1
0
null
null
null
null
UTF-8
Java
false
false
528
java
package asw.springcloud.luckyword; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.beans.factory.annotation.Value; import org.springframework.cloud.context.config.annotation.RefreshScope; @RestController @RefreshScope public class LuckyWordController { @Value("${lucky-word}") private String luckyWord; @RequestMapping("/lucky-word") public String luckyWord() { return "The lucky word is: " + luckyWord; } }
[ "cabibbo@dia.uniroma3.it" ]
cabibbo@dia.uniroma3.it
927288eb750b85acfaea58208ee5a1dbb05f38e0
2612f336d667a087823234daf946f09b40d8ca3d
/plugins/InspectionGadgets/testsrc/com/siyeh/ig/classlayout/ClassInitializerInspectionTest.java
f950d3e1c120889642f15e68b72c276992cb8f6f
[ "Apache-2.0" ]
permissive
tnorbye/intellij-community
df7f181861fc5c551c02c73df3b00b70ab2dd589
f01cf262fc196bf4dbb99e20cd937dee3705a7b6
refs/heads/master
2021-04-06T06:57:57.974599
2018-03-13T17:37:00
2018-03-13T17:37:00
125,079,130
2
0
Apache-2.0
2018-03-13T16:09:41
2018-03-13T16:09:41
null
UTF-8
Java
false
false
1,288
java
/* * Copyright 2000-2013 JetBrains s.r.o. * * 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.siyeh.ig.classlayout; import com.intellij.codeInspection.InspectionProfileEntry; import com.siyeh.ig.LightInspectionTestCase; /** * @author Bas Leijdekkers */ public class ClassInitializerInspectionTest extends LightInspectionTestCase { public void testSimple() { doTest(); } public void testAnonymous() { doTest(); } public void testNoConstructor() { final ClassInitializerInspection inspection = new ClassInitializerInspection(); inspection.onlyWarnWhenConstructor = true; myFixture.enableInspections(inspection); doTest(); } @Override protected InspectionProfileEntry getInspection() { return new ClassInitializerInspection(); } }
[ "basleijdekkers@gmail.com" ]
basleijdekkers@gmail.com
3230b7f130cf80fe275fbfb89fc281af80d4b015
93cebdfdc1f989596f466aacffcb8e84878c0ce9
/app/src/main/java/mrc/appdichat/RequestsFragment.java
4fa485c103ff693027f873a2c386fcdeab2736fc
[]
no_license
mrc03/Appdichat
fa419566fdc71467c1680372fe6e4641194bd4bd
bd04aaa0af9ed91765d47c068273566c2723a3d2
refs/heads/master
2021-12-12T22:02:28.019535
2021-10-02T14:57:20
2021-10-02T14:57:20
133,120,688
4
1
null
2021-10-02T14:57:21
2018-05-12T06:34:33
Java
UTF-8
Java
false
false
5,858
java
package mrc.appdichat; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import com.firebase.ui.database.FirebaseRecyclerAdapter; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.database.DataSnapshot; import com.google.firebase.database.DatabaseError; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import com.google.firebase.database.ValueEventListener; import com.squareup.picasso.Callback; import com.squareup.picasso.NetworkPolicy; import com.squareup.picasso.Picasso; import de.hdodenhof.circleimageview.CircleImageView; /** * A simple {@link Fragment} subclass. */ public class RequestsFragment extends android.support.v4.app.Fragment { private RecyclerView recyclerView; private View mView; private DatabaseReference friendsDatabaseReference; private DatabaseReference usersDatabaseReference; // private final int color = getResources().getColor(R.color.colorPrimaryDark); WILL NOT WORK. public RequestsFragment() { // Required empty public constructor } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment mView = inflater.inflate(R.layout.fragment_requests, container, false); recyclerView = mView.findViewById(R.id.req_recycle_view); recyclerView.setHasFixedSize(true); recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); friendsDatabaseReference = FirebaseDatabase.getInstance().getReference().child("Friends_request"). child(FirebaseAuth.getInstance().getUid()); friendsDatabaseReference.keepSynced(true); usersDatabaseReference = FirebaseDatabase.getInstance().getReference().child("Users"); usersDatabaseReference.keepSynced(true); return mView; } @Override public void onStart() { super.onStart(); FirebaseRecyclerAdapter<Requests, RequestsViewHolder> firebaseRecyclerAdapter = new FirebaseRecyclerAdapter<Requests, RequestsViewHolder> ( Requests.class, R.layout.users_single_row, RequestsViewHolder.class, friendsDatabaseReference ) { @Override protected void populateViewHolder(final RequestsViewHolder viewHolder, final Requests model, final int position) { String otherId = getRef(position).getKey(); usersDatabaseReference.child(otherId).addValueEventListener(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { String name = dataSnapshot.child("name").getValue().toString(); String image = dataSnapshot.child("image").getValue().toString(); viewHolder.setName(name); viewHolder.setImage(getContext(), image); viewHolder.setType(model.getRequest_type(), getActivity().getResources().getColor(R.color.colorPrimaryDark)); viewHolder.view.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String user_id = getRef(position).getKey(); Intent profileIntent = new Intent(getContext(), ProfileActivity.class); profileIntent.putExtra("key", user_id); startActivity(profileIntent); } }); } @Override public void onCancelled(DatabaseError databaseError) { } }); } }; recyclerView.setAdapter(firebaseRecyclerAdapter); } public static class RequestsViewHolder extends RecyclerView.ViewHolder { private View view; public RequestsViewHolder(View itemView) { super(itemView); view = itemView; } public void setName(String name) { TextView textView = view.findViewById(R.id.single_display_name); textView.setText(name); } public void setType(String type, int color) { if (type.equalsIgnoreCase("sent")) { TextView textView = view.findViewById(R.id.single_status); textView.setText("Status: " + type); } else { TextView textView = view.findViewById(R.id.single_status); textView.setTextColor(color); textView.setText("Status: " + type); } } public void setImage(final Context context, final String image) { final CircleImageView circleImageView = view.findViewById(R.id.single_image_view); Picasso.with(context).load(image).placeholder(R.drawable.defaultprofile). networkPolicy(NetworkPolicy.OFFLINE).into(circleImageView, new Callback() { @Override public void onSuccess() { } @Override public void onError() { Picasso.with(context).load(image).placeholder(R.drawable.defaultprofile). into(circleImageView); } }); } } }
[ "mehrotraraj03@gmail.com" ]
mehrotraraj03@gmail.com
f4dc27cf32a9e50e97ccd757546083c44e252eec
e123baad041d4eb9c7809801643f52a5e660df42
/src/org/traccar/protocol/TeltonikaProtocol.java
f944c3003637dcd796fdcbcb6a02e52e2bf7557d
[ "Apache-2.0" ]
permissive
vladyslavyatsun/traccar
eb4dab41b52f02fc85d124a6ca864bb933f66165
b2e883f9eac211a951b6ca2b0e91e9f27b133f36
refs/heads/master
2021-01-01T03:45:46.810129
2016-05-06T13:56:44
2016-05-06T13:56:44
59,423,202
1
0
null
null
null
null
UTF-8
Java
false
false
1,833
java
/* * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.traccar.protocol; import org.jboss.netty.bootstrap.ConnectionlessBootstrap; import org.jboss.netty.bootstrap.ServerBootstrap; import org.jboss.netty.channel.ChannelPipeline; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; import java.util.List; public class TeltonikaProtocol extends BaseProtocol { public TeltonikaProtocol() { super("teltonika"); } @Override public void initTrackerServers(List<TrackerServer> serverList) { serverList.add(new TrackerServer(new ServerBootstrap(), this.getName()) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new TeltonikaFrameDecoder()); pipeline.addLast("objectDecoder", new TeltonikaProtocolDecoder(TeltonikaProtocol.this)); } }); serverList.add(new TrackerServer(new ConnectionlessBootstrap(), this.getName()) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("objectDecoder", new TeltonikaProtocolDecoder(TeltonikaProtocol.this)); } }); } }
[ "anton.tananaev@gmail.com" ]
anton.tananaev@gmail.com
ddbbf382c856c1dc0f11023ee1af6108fb2329b5
c8412c01ac07271af40ff508109b673aa2caaf5b
/admin/src/test/java/com/whiteplanet/admin/service/message/jg/push/model/MessageTest.java
79e52b3e4610b65aed2b95271b799f4baf2c5102
[]
no_license
brayJava/bray
d40c1878d4b93def8a1991261965663e91804643
3ffd52b13a1447bc94f24320607fa535df1a7a4e
refs/heads/master
2020-03-24T20:28:39.281546
2018-07-31T08:45:16
2018-07-31T08:45:16
142,980,114
0
0
null
null
null
null
UTF-8
Java
false
false
2,509
java
package com.whiteplanet.admin.service.message.jg.push.model; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; import com.whiteplanet.admin.service.message.jg.FastTests; import com.whiteplanet.push.jg.push.model.Message; import org.junit.Test; import org.junit.experimental.categories.Category; import java.util.HashMap; import java.util.Map; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; @Category(FastTests.class) public class MessageTest { @Test(expected = IllegalArgumentException.class) public void testIllegal() { Message.newBuilder().build(); } @Test public void testMsgContent() { Message message = Message.content("msg content"); JsonObject json = new JsonObject(); json.add("msg_content", new JsonPrimitive("msg content")); assertThat(message.toJSON(), is((JsonElement) json)); } @Test public void testMsgContentAndExtras() { Message message = Message.newBuilder() .setMsgContent("msgContent") .addExtra("key1", "value1") .addExtra("key2", 222) .addExtra("key3", Boolean.FALSE).build(); JsonObject json = new JsonObject(); json.add("msg_content", new JsonPrimitive("msgContent")); JsonObject extras = new JsonObject(); extras.add("key1", new JsonPrimitive("value1")); extras.add("key2", new JsonPrimitive(222)); extras.add("key3", new JsonPrimitive(Boolean.FALSE)); json.add("extras", extras); assertThat(message.toJSON(), is((JsonElement) json)); } @Test public void testMsgContentAndExtrasMap() { Map<String, String> extrasMap = new HashMap<String, String>(); extrasMap.put("key1", "value1"); extrasMap.put("key2", "value2"); Message message = Message.newBuilder() .setMsgContent("msgContent") .addExtras(extrasMap).build(); JsonObject json = new JsonObject(); json.add("msg_content", new JsonPrimitive("msgContent")); JsonObject extras = new JsonObject(); extras.add("key1", new JsonPrimitive("value1")); extras.add("key2", new JsonPrimitive("value2")); json.add("extras", extras); assertThat(message.toJSON(), is((JsonElement) json)); } }
[ "1318134732@qq.com" ]
1318134732@qq.com
a41922dcf4cc9e9502fa8d1c132f08b19b1f2e41
acceb3e59affadda7038473d080cbb0838c03ae0
/src/main/java/com/fasttrackit/RadioControlerCar.java
3597f2015f5a2abb17c6fc6ec1e63cccaf9c9804
[]
no_license
gavrilutadelina/RacingGameExperiments
a07b2b5f16308b1f25077a5188672a02ef6c4291
9700038c51c24873cb95fbf3642fcab54b86a120
refs/heads/master
2021-07-10T23:08:00.858643
2019-10-30T20:41:45
2019-10-30T20:41:45
208,335,380
0
0
null
2020-10-13T16:01:18
2019-09-13T19:46:30
Java
UTF-8
Java
false
false
568
java
package com.fasttrackit; public class RadioControlerCar extends AutoVehicle { public String toString(){ return "Custom string representation"; } public static final String CONTROL_TYPE = "radio_controlled"; String color; int doorCount; public RadioControlerCar(Engine engine) { super(engine); } public RadioControlerCar() { this(new Engine()); } public int getDoorCount() { return doorCount; } public void setDoorCount(int doorCount) { this.doorCount = doorCount; } }
[ "gvr.adelina@yahoo.com" ]
gvr.adelina@yahoo.com
5c006062d68ebb89f922f2744b70ccc38e36ba23
76baceccda28dd75f3da4ddeb0cf1f2d5899b228
/DECORATOR/20190908/src/PlainPizza.java
0461f3786d1d8f19b2d6c0c6f3802d8c3f2a58dc
[]
no_license
escort94/JavaDesignPattern
722adc813ac16030855a0a198ff7eee34382241e
bae23d28eb4f76fd882424eca7d6567eec6a12d7
refs/heads/master
2022-06-12T18:55:23.488233
2020-05-08T02:57:00
2020-05-08T02:57:00
262,198,567
0
0
null
null
null
null
UTF-8
Java
false
false
315
java
public class PlainPizza implements Pizza { @Override public String getDescription() { // TODO Auto-generated method stub return "Thin dough"; } @Override public double getCost() { // TODO Auto-generated method stub System.out.println("Cost of Dough: " + 4.00); return 4.00; } }
[ "mgjang@net1.co.kr" ]
mgjang@net1.co.kr
85d1d15e7e6bb4748d01da51845f4c9e67888325
cad75a693350ce02691000822cc6bc9ee378ef84
/atf-eplug/src/eu/atac/atf/test/ocl/pattern/PPatternRegex.java
d134ec97f65257d29ef7e09b22113322a82269ff
[ "BSD-3-Clause" ]
permissive
ryselis/atf
d9a360bf3850f2af3dd1000a44fef1703185de8a
861d700df973f6e01169a7ab53f9a3a19d0bee54
refs/heads/master
2020-12-28T21:17:44.768018
2015-02-25T20:51:16
2015-02-25T20:51:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,220
java
package eu.atac.atf.test.ocl.pattern; import java.util.List; import org.eclipse.emf.ecore.EObject; import tudresden.ocl20.pivot.essentialocl.expressions.impl.ExpressionInOclImpl; import tudresden.ocl20.pivot.essentialocl.expressions.impl.StringLiteralExpImpl; import tudresden.ocl20.pivot.essentialocl.expressions.impl.VariableExpImpl; import tudresden.ocl20.pivot.essentialocl.expressions.impl.VariableImpl; import eu.atac.atf.main.ATF; import eu.atac.atf.main.ATFTestModel; import eu.atac.atf.main.OCLConstraint; import eu.atac.atf.test.metadata.SAssertion; import eu.atac.atf.test.metadata.SComment; import eu.atac.atf.test.metadata.SVariable; import eu.sarunas.atf.generators.tests.RandomGenerator; /** * * ExpressionInOclImpl - inv invariant_IPE:name.RegExpMatch('[1-9][0-9]{3}') * OperationCallExpImpl - RegExpMatch * PropertyCallExpImpl - String name * VariableExpImpl - self * StringLiteralExpImpl - [1-9][0-9]{3} * VariableImpl - self */ public class PPatternRegex extends ConstrainPatternBase { private ConstrainPatternElementBase[] pattern; public PPatternRegex(){ pattern = new ConstrainPatternElementBase[]{ new PESimpleClass(ExpressionInOclImpl.class), new PEOperationCall("RegExpMatch"), new PEPropertyCall("String"), new PESimpleClass(VariableExpImpl.class,1,1), new PESimpleClass(StringLiteralExpImpl.class,1,1), new PESimpleClass(VariableImpl.class,1,1), }; } @Override public ConstrainPatternElementBase[] getPattern() { return pattern; } @Override public void generatePre(OCLConstraint constraint,ATFTestModel atfTestModel) { try { // *0 ExpressionInOclImpl - inv invariant_IPE:name.RegExpMatch('[1-9][0-9]{3}') // *1 OperationCallExpImpl - RegExpMatch // *2 PropertyCallExpImpl - String name // *3 VariableExpImpl - self // *4 StringLiteralExpImpl - [1-9][0-9]{3} // *5 VariableImpl - self List<EObject> list = constraint.getEobjectList(); String regex = ((StringLiteralExpImpl)list.get(4)).getStringSymbol(); SVariable variable = atfTestModel.getSmethod().findVariable(ATF.VARIAVLE_ID_TEST_OBJECT); String expr = variable.getName() + parsePropertyCallChain(atfTestModel,list,2,false); String commment = expr + "(\"" + RandomGenerator.getInstance().randomRegexString(regex) + "\");"; SComment com1 = new SComment(commment); com1.setNotcomment(true); atfTestModel.getSmethod().addBodyElement(com1); } catch (Exception e) { ATF.log(e); } } @Override public void generateInvariant(OCLConstraint constraint,ATFTestModel atfTestModel) { List<EObject> list = constraint.getEobjectList(); String regex = ((StringLiteralExpImpl)list.get(4)).getStringSymbol(); SVariable variable = atfTestModel.getSmethod().findVariable(ATF.VARIAVLE_ID_TEST_OBJECT); String expr = variable.getName() + parsePropertyCallChain(atfTestModel,list,2,true); String assertion = expr + "().matches(\"" + regex +"\")"; SAssertion invAssertion = new SAssertion(assertion); atfTestModel.getSmethod().addBodyElement(invAssertion); } }
[ "drme@users.noreply.github.com" ]
drme@users.noreply.github.com
d9328493841a618a33e9faf38cdb1dee7a47f623
60dfc2ab3f0766385bc7634c7a85c9da61cf004b
/src/main/java/uk/co/meridenspares/service/api/CustomerOrderService.java
9d61ec7e333dfc3e76799d5289e6f9cd03739d1f
[]
no_license
eclipsesystemsltd/ms-service-api
eb284398567932a06721bc6b28c45694373a224b
8965781e8d84fb163b5b22c9262db5774a09f471
refs/heads/master
2023-01-02T08:37:47.632519
2020-06-16T14:36:51
2020-06-16T14:36:51
272,725,006
0
0
null
2020-10-13T22:50:48
2020-06-16T14:08:08
Java
UTF-8
Java
false
false
301
java
package uk.co.meridenspares.service.api; import uk.co.meridenspares.domain.CustomerOrder; /** * This interface declares the specific methods to be provided by the 'CustomerOrder' service. * @author user * */ public interface CustomerOrderService extends GenericService<CustomerOrder, Long> { }
[ "g.moore@eclipsesystemsltd.com" ]
g.moore@eclipsesystemsltd.com
ddc60593002e20732454fdaaa7b6322cd8339d3e
246f2be1162532f2efb1a477b4b88aadcfc81524
/results/okhttp/1151c9853ccc3c9c3211c613b9b845b925f8c6a6/transformed/evosuite_12/evosuite-tests/com/squareup/okhttp/internal/bytes/GzipSource_ESTest.java
d028494b72052e301004936dffbe0bfa78fdda10
[]
no_license
semantic-conflicts/SemanticConflicts
4d2f05bf2e5fa289233429ed8f1614b0b14c2e5e
c5684bbde00dfbd27c828b5798edbec0e284597a
refs/heads/master
2022-12-05T03:11:57.983183
2020-08-25T13:54:24
2020-08-25T13:54:24
267,826,586
0
1
null
null
null
null
UTF-8
Java
false
false
1,155
java
/* * This file was automatically generated by EvoSuite * Mon May 25 21:57:14 GMT 2020 */ package com.squareup.okhttp.internal.bytes; import org.junit.Test; import static org.junit.Assert.*; import static org.evosuite.runtime.EvoAssertions.*; import com.squareup.okhttp.internal.bytes.OkBuffer; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true, useJEE = true) public class GzipSource_ESTest extends GzipSource_ESTest_scaffolding { @Test(timeout = 4000) public void test0() throws Throwable { OkBuffer okBuffer0 = new OkBuffer(); // Undeclared exception! try { okBuffer0.getByte((-860L)); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // no message in exception (getMessage() returned null) // verifyException("com.squareup.okhttp.internal.Util", e); } } }
[ "semantic.conflicts@gmail.com" ]
semantic.conflicts@gmail.com
27aecc85404a485cbe11c5821ab2de81bde7130a
7973c468698be93d8272d9ded842c372f63db8bd
/engineer/src/main/java/com/weido/engineer/repository/RolesRepository.java
ee4df023754d6cfbb9ccaf20bfc15260f23633ca
[]
no_license
StandardStudent/SpringbootWedo
5d2838b942c7bae5c9112fb399098e25d74cde6c
351fa363ccafaeb2261c8e48d683ffc93fb97ea1
refs/heads/master
2020-03-25T23:09:39.177570
2018-09-06T03:19:23
2018-09-06T03:19:23
144,261,267
0
0
null
null
null
null
UTF-8
Java
false
false
215
java
package com.weido.engineer.repository; import com.weido.engineer.pojo.Roles; import org.springframework.data.jpa.repository.JpaRepository; public interface RolesRepository extends JpaRepository<Roles,Integer> { }
[ "602487266@qq.com" ]
602487266@qq.com
eceec95a6c9d64cdb9e9fe3c5b2ce286d6ca62ab
fa3e18e672686df3561287b8d8049ede92547a0f
/src/main/java/de/danielbechler/diff/path/PropertyPath.java
6c448123f6c4c38e9082d6c6d50294e5e4dea0d7
[ "Apache-2.0", "BSD-3-Clause", "MIT" ]
permissive
gpkreddy/java-object-diff
9ffa381e15afbcd477775c31fea9f42468125823
90238a2df1395912ff30f555e7ae0b46dcf49f86
refs/heads/master
2021-01-18T11:07:31.412544
2012-06-02T15:41:17
2012-06-02T15:41:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,020
java
/* * Copyright 2012 Daniel Bechler * * 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 de.danielbechler.diff.path; import java.util.*; /** @author Daniel Bechler */ public final class PropertyPath { public static PropertyPath with(final String... propertyNames) { final PropertyPathBuilder builder = new PropertyPathBuilder(); builder.withRoot(); for (final String propertyName : propertyNames) { builder.withPropertyName(propertyName); } return builder.build(); } public static PropertyPath with(final Element... elements) { final PropertyPathBuilder builder = new PropertyPathBuilder(); builder.withRoot(); for (final Element element : elements) { builder.withElement(element); } return builder.build(); } private final List<Element> elements; public PropertyPath(final Element... elements) { this(Arrays.asList(elements)); } public PropertyPath(final Collection<Element> elements) { this.elements = new ArrayList<Element>(elements); } public PropertyPath(final PropertyPath parentPath, final Element element) { elements = new ArrayList<Element>(parentPath.getElements().size() + 1); elements.addAll(parentPath.elements); elements.add(element); } public List<Element> getElements() { return elements; } public boolean matches(final PropertyPath propertyPath) { return propertyPath.equals(this); } public boolean isParentOf(final PropertyPath propertyPath) { final Iterator<Element> iterator1 = elements.iterator(); final Iterator<Element> iterator2 = propertyPath.getElements().iterator(); while (iterator1.hasNext() && iterator2.hasNext()) { final Element next1 = iterator1.next(); final Element next2 = iterator2.next(); if (!next1.equals(next2)) { return false; } } return true; } @Override public String toString() { final StringBuilder sb = new StringBuilder(); final Iterator<Element> iterator = elements.iterator(); while (iterator.hasNext()) { final Element selector = iterator.next(); sb.append(selector); if (iterator.hasNext()) { sb.append('.'); } } return sb.toString(); } @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final PropertyPath that = (PropertyPath) o; if (!elements.equals(that.elements)) { return false; } return true; } @Override public int hashCode() { return elements.hashCode(); } }
[ "mail@danielbechler.de" ]
mail@danielbechler.de
e68ec4e0b93ddf15d135eef5210ffb605e485015
b9fe4bd1e95478d8a9e05ffc10b7aba498de7bc7
/java_study/chapter03/src/CompareOperatorExample2.java
262008f33738b601a69136ca7ab22c46b71d04d9
[]
no_license
su-bin/TIL
68bc6549138dcd607eac39db1c894374c197efa9
a661d4c135f793d0216ef5ebdbafdbfb76964da6
refs/heads/master
2021-07-09T19:00:41.685835
2020-07-04T06:39:32
2020-07-04T06:39:32
147,136,153
0
0
null
null
null
null
UTF-8
Java
false
false
429
java
public class CompareOperatorExample2 { public static void main(String[] args) { int v2 = 1; double v3 = 1.0; System.out.println(v2 == v3); // true double v4 = 0.1; float v5 = 0.1f; System.out.println(v4 == v5); // false System.out.println((float)v4 == v5); // true System.out.println((int)(v4 * 10) == (int)(v5 * 10)); // true } }
[ "sblee6728@gmail.com" ]
sblee6728@gmail.com
47e2ae9d5e810e13ff746cda615f3598e56c6c80
c4e2e1ed3367aeca99b7b4f75a5dd62753173607
/app/src/main/java/com/dj/pedofit/preferences/BodyWeightPreference.java
bfb8904a8e8d553ccb5159229c9c0e3179ff6707
[]
no_license
dhananjaikajal/PedoFit
0ae7c3dbd23d4761346dd4feed3112e3a2305059
7d40ff442927c7fb4859f78c0c942d82d7647fe1
refs/heads/master
2021-01-10T12:02:43.133015
2015-06-04T15:23:36
2015-06-04T15:23:36
36,876,968
0
0
null
null
null
null
UTF-8
Java
false
false
720
java
package com.dj.pedofit.preferences; import com.dj.pedofit.R; import android.content.Context; import android.preference.EditTextPreference; import android.util.AttributeSet; public class BodyWeightPreference extends EditMeasurementPreference { public BodyWeightPreference(Context context) { super(context); } public BodyWeightPreference(Context context, AttributeSet attr) { super(context, attr); } public BodyWeightPreference(Context context, AttributeSet attr, int defStyle) { super(context, attr, defStyle); } protected void initPreferenceDetails() { mTitleResource = R.string.body_weight_setting_title; mMetricUnitsResource = R.string.kilograms; mImperialUnitsResource = R.string.pounds; } }
[ "dhananjaikajal@gmail.com" ]
dhananjaikajal@gmail.com
d457db94943a700d2f85fd12eeba8232d046aa6d
8b0ac2e93c84942a28a8420b52e18e5e31b7d06b
/coffemachineryRestAPI/src/main/java/com/iths/coffeemachineryAPI/domain/Customer.java
2144d06c45c1b522e9023b881a8738da59189eb9
[]
no_license
johannes9108/vue-airbean
2f7715175ea77b9e3ff8ffb2c3f4c326d21c72cd
29de720d586a08d0bba6edd50bffce105df46f13
refs/heads/master
2022-10-07T04:10:24.052734
2020-06-01T20:55:40
2020-06-01T20:55:40
267,005,497
0
0
null
2020-05-26T09:52:06
2020-05-26T09:52:05
null
UTF-8
Java
false
false
937
java
package com.iths.coffeemachineryAPI.domain; import java.util.ArrayList; import java.util.List; import javax.persistence.CascadeType; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.OneToMany; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreType; import lombok.Data; import lombok.NoArgsConstructor; @Entity @NoArgsConstructor @Data @JsonIgnoreProperties({"hibernateLazyInitializer", "handler"}) public class Customer { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String name; private String email; private String password; @OneToMany(cascade = {CascadeType.ALL}) private List<CustomerOrder> orders = new ArrayList<CustomerOrder>(); }
[ "54702667+EHeijer@users.noreply.github.com" ]
54702667+EHeijer@users.noreply.github.com
aacb8c30a5f3e26a2b5163f6e3e4a1ae4e62e213
ee3270f4c0775fad47c1ec18c2130c0da9c33c38
/BBS/src/co/hj/board/command/MemberInsertAction.java
f522052a13b01c198db77c07b97c9aebb1b1dd78
[]
no_license
choihyeongjun/jsp
1f25f26aba5cc0d6ec3a1692f4ff6ffd9501291f
e9cc15e37079884ad452be22dac19e5ed27abf8c
refs/heads/master
2023-01-11T08:25:28.569728
2020-11-02T08:19:07
2020-11-02T08:19:07
305,962,146
0
0
null
null
null
null
UTF-8
Java
false
false
2,117
java
package co.hj.board.command; import java.io.File; import java.io.IOException; import java.sql.Date; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.Part; import co.hj.board.common.Action; import co.hj.board.common.FileRenamePolicy; import co.hj.board.common.FileUtil; import co.hj.board.dao.MemberDAO; import co.hj.board.vo.MemberVO; public class MemberInsertAction implements Action { @Override public String exec(HttpServletRequest request, HttpServletResponse response) { //회원정보를 db에 입력하기 MemberDAO dao=new MemberDAO(); MemberVO vo=new MemberVO(); vo.setId(request.getParameter("id")); vo.setName(request.getParameter("name")); vo.setPassword(request.getParameter("password")); vo.setAddress(request.getParameter("address")); vo.setTel(request.getParameter("tel")); vo.setEnterdate(Date.valueOf(request.getParameter("enterdate"))); String appPath = request.getServletContext().getRealPath("/images"); System.out.println(appPath); try { for (Part part : request.getParts()) { //첨부파일을 읽어온다 String fileName = FileUtil.extractFileName(part); //파일이 존재하면 if(!fileName.equals("")) { //파일명중복체크 String uploadFile = appPath + File.separator + fileName; File renameFile=FileRenamePolicy.rename(new File(uploadFile)); part.write(renameFile.getAbsolutePath()); vo.setImg(renameFile.getName()); //1:다 관계로 등록 filetable.insert(filevo); } } } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ServletException e) { // TODO Auto-generated catch block e.printStackTrace(); } int n=dao.insert(vo); request.setAttribute("check", n); String page; if(n!=0) { page="jsp/member/insertSuccess.jsp"; } else { page="jsp/member/InsertFail.jsp"; } return page; } }
[ "chj5156@naver.com" ]
chj5156@naver.com
6230a30569f82341dcd9dd974c6a619b05ebc6ca
54bf8c0ad778f981f6c1a1e9ae9a74734a7794be
/src/main/java/com/example/keycloakapi/permission/PermissionsClient.java
fe3dd913c3f4cb6f15043c8930a073d8ce5505df
[]
no_license
sharifyy/keycloak-admin-client
b3f73f98513e7e703b65908431a00d59756f118c
986e538eb904840298c4555882318f5b2f7a9997
refs/heads/master
2023-07-25T12:07:39.868362
2021-09-07T10:32:15
2021-09-07T10:32:15
403,936,572
1
0
null
null
null
null
UTF-8
Java
false
false
10,798
java
package com.example.keycloakapi.permission; import com.example.keycloakapi.mapper.PolicyMapper; import org.keycloak.admin.client.Keycloak; import org.keycloak.admin.client.resource.AuthorizationResource; import org.keycloak.admin.client.resource.PoliciesResource; import org.keycloak.admin.client.resource.PolicyResource; import org.keycloak.representations.idm.authorization.*; import org.springframework.stereotype.Service; import javax.ws.rs.NotFoundException; import javax.ws.rs.core.Response; import java.util.List; import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; @Service public final class PermissionsClient implements PermissionService { private final Keycloak keycloak; private final PolicyMapper policyMapper; public PermissionsClient(Keycloak keycloak, PolicyMapper policyMapper) { this.keycloak = keycloak; this.policyMapper = policyMapper; } @Override public List<PolicyRepresentation> getAllPermissions(String realm, String clientHexId) { return client(realm, clientHexId) .policies() .policies() .stream() .filter(policy -> policy.getType().equals("scope") || policy.getType().equals("resource")) .collect(Collectors.toList()); } @Override public PolicyRepresentation getPermissionById(String realm, String clientHexId, String permissionId) { PolicyResource policyResource = client(realm, clientHexId) .policies() .policy(permissionId); PolicyRepresentation policy = policyResource.toRepresentation(); if (!policy.getType().equals("scope") && !policy.getType().equals("resource")) { throw new NotFoundException("no permission found"); } Set<String> policies = policyResource.associatedPolicies().stream().map(AbstractPolicyRepresentation::getName).collect(Collectors.toSet()); policy.setPolicies(policies); if (policy.getType().equals("scope")) { Set<String> scopes = policyResource.scopes().stream().map(ScopeRepresentation::getName).collect(Collectors.toSet()); policy.setScopes(scopes); return policy; } Set<String> resources = policyResource.resources().stream().map(ResourceRepresentation::getName).collect(Collectors.toSet()); policy.setResources(resources); return policy; } @Override public Response createPermission(String realm, String clientHexId, PermissionCommand permissionCommand) { return client(realm, clientHexId) .policies() .create(policyMapper.permissionDTOtoPolicyRepresentation(permissionCommand)); } @Override public void deletePermission(String realm, String clientHexId, String permissionId) { client(realm, clientHexId) .policies().policy(permissionId).remove(); } @Override public void updatePermission(String realm, String id, PermissionCommand permissionCommand) { client(realm, id) .policies() .policy(permissionCommand.getId()) .update(policyMapper.permissionDTOtoPolicyRepresentation(permissionCommand)); } @Override public void addGroupsToPermission(String realm, String clientHexId, GroupPermissionDTO groupPermissionDTO) { final PoliciesResource policiesResource = client(realm, clientHexId).policies(); final PolicyResource policyResource = policiesResource.policy(groupPermissionDTO.getPermissionId()); PolicyRepresentation permission = policyResource.toRepresentation(); if (!permission.getType().equals("scope") && !permission.getType().equals("resource")) { throw new NotFoundException("no permission found"); } Set<String> associatedPolicies = policyResource.associatedPolicies().stream() .filter(policyRepresentation -> policyRepresentation.getType().equals("group")) .map(AbstractPolicyRepresentation::getName) .collect(Collectors.toSet()); for (GroupPermissionDTO.Group group : groupPermissionDTO.getGroups()) { if (!associatedPolicies.contains("Policy_" + group.getName())) { policyExists(policiesResource, "Policy_" + group.getName()) .ifPresentOrElse(existingPolicy -> { associatedPolicies.add(existingPolicy.getId()); updatePermission(policiesResource, permission, associatedPolicies); }, () -> createGroupPolicy(policiesResource, group).ifPresent( createdPolicy -> { associatedPolicies.add(createdPolicy.getId()); updatePermission(policiesResource, permission, associatedPolicies); } ) ); } } } @Override public void addRolesToPermission(String realm, String clientHexId, RolePermissionDTO rolePermissionDTO) { final PoliciesResource policiesResource = client(realm, clientHexId).policies(); final PolicyResource policyResource = policiesResource.policy(rolePermissionDTO.getPermissionId()); PolicyRepresentation permission = policyResource.toRepresentation(); if (!permission.getType().equals("scope") && !permission.getType().equals("resource")) { throw new NotFoundException("no permission found"); } Set<String> associatedPolicies = policyResource.associatedPolicies().stream() .filter(policyRepresentation -> policyRepresentation.getType().equals("role")) .map(AbstractPolicyRepresentation::getName) .collect(Collectors.toSet()); for (RolePermissionDTO.Role role : rolePermissionDTO.getRoles()) { if (!associatedPolicies.contains("Policy_" + role.getName())) { policyExists(policiesResource, "Policy_" + role.getName()) .ifPresentOrElse(existingPolicy -> { associatedPolicies.add(existingPolicy.getId()); updatePermission(policiesResource, permission, associatedPolicies); }, () -> createRolePolicy(policiesResource, role).ifPresent( createdPolicy -> { associatedPolicies.add(createdPolicy.getId()); updatePermission(policiesResource, permission, associatedPolicies); } ) ); } } } private void updatePermission(final PoliciesResource policiesResource, PolicyRepresentation permission, Set<String> associatedPolicies) { permission.setPolicies(associatedPolicies); policiesResource.policy(permission.getId()).update(permission); } private Optional<PolicyRepresentation> createRolePolicy(final PoliciesResource policiesResource, RolePermissionDTO.Role role) { RolePolicyRepresentation rolePolicyRepresentation = new RolePolicyRepresentation(); rolePolicyRepresentation.setName("Policy_" + role.getName()); rolePolicyRepresentation.setRoles(Set.of(new RolePolicyRepresentation.RoleDefinition(role.getId(), true))); try (Response response = policiesResource.role().create(rolePolicyRepresentation)) { if (response.getStatus() == 201) { return policyExists(policiesResource, rolePolicyRepresentation.getName()); } else { throw new RuntimeException(response.getStatusInfo().getReasonPhrase()); } } } private Optional<PolicyRepresentation> createGroupPolicy(final PoliciesResource policiesResource, GroupPermissionDTO.Group group) { GroupPolicyRepresentation groupPolicyRepresentation = new GroupPolicyRepresentation(); groupPolicyRepresentation.setName("Policy_" + group.getName()); groupPolicyRepresentation.setGroupsClaim("groups"); groupPolicyRepresentation.setGroups(Set.of(new GroupPolicyRepresentation.GroupDefinition(group.getId(), false))); try (Response response = policiesResource.group().create(groupPolicyRepresentation)) { if (response.getStatus() == 201) { return policyExists(policiesResource, groupPolicyRepresentation.getName()); } else { throw new RuntimeException(response.getStatusInfo().getReasonPhrase()); } } } private Optional<PolicyRepresentation> policyExists(final PoliciesResource policiesResource, String policyName) { try { return Optional.ofNullable(policiesResource.findByName(policyName)); } catch (NotFoundException ex) { return Optional.empty(); } } @Override public void removeRoles(String realm, String clientHexId, RolePermissionDTO rolePermissionDTO) { PolicyResource policyResource = client(realm, clientHexId) .policies() .policy(rolePermissionDTO.getPermissionId()); PolicyRepresentation permission = policyResource.toRepresentation(); if (!permission.getType().equals("scope") && !permission.getType().equals("resource")) { throw new NotFoundException("no permission found"); } Set<String> policyNames = rolePermissionDTO.getRoles() .stream() .map(RolePermissionDTO.Role::getName) .map(name -> "Policy_" + name) .collect(Collectors.toSet()); Set<String> associatedPolicies = policyResource.associatedPolicies() .stream() .filter(policyRepresentation -> policyRepresentation.getType().equals("role")) .filter(policyRepresentation -> !policyNames.contains(policyRepresentation.getName())) .map(AbstractPolicyRepresentation::getId) .collect(Collectors.toSet()); permission.setPolicies(associatedPolicies); client(realm, clientHexId) .policies() .policy(permission.getId()) .update(permission); } private AuthorizationResource client(String realm, String clientHexId) { return keycloak.realm(realm) .clients().get(clientHexId) .authorization(); } }
[ "sharifyy@gmail.com" ]
sharifyy@gmail.com
c403fd42de267b4570cfe5257a29f88f259b8690
82db1a4b7eae62017a25b348898e790cd4ba9c76
/src/main/java/lk/wiley/travellodge/TravellodgeApplication.java
de4c6d9cfd3761f9c01d9f0af348fe9c6ba29d77
[]
no_license
ShehanThamoda/travel-lodge-system
ed30cbf0b96256f911e020c2050c064be9d10bba
163d093cbe9b682e4edf14864359bc4816b9cba5
refs/heads/main
2023-05-13T15:51:44.732004
2021-06-07T17:55:43
2021-06-07T17:55:43
374,752,031
0
0
null
null
null
null
UTF-8
Java
false
false
407
java
package lk.wiley.travellodge; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import springfox.documentation.swagger2.annotations.EnableSwagger2; @SpringBootApplication @EnableSwagger2 public class TravellodgeApplication { public static void main(String[] args) { SpringApplication.run(TravellodgeApplication.class, args); } }
[ "thamodashehan92@gmail.com" ]
thamodashehan92@gmail.com
a2f2f639f2ed72db1d0dea6c6b8c16d881b08a95
a542cc8ac574c03ae25bcda140cf345babb14ffe
/main/no.tdt4250.project.pokeDex.model/src/domain/impl/GenusImpl.java
07e48083c700707cf82bffacad6ba4b26e36b899
[]
no_license
oddaspa/TDT4250-PokeDex
568918ad9ff61347df24ddae72436ba30e8de568
44f6bdde13aef8dfe3224899f7d9d3ae8605d71c
refs/heads/master
2020-08-27T07:22:04.870159
2019-12-01T19:44:08
2019-12-01T19:44:08
217,281,666
1
2
null
2019-12-01T13:56:02
2019-10-24T11:22:26
Java
UTF-8
Java
false
false
9,066
java
/** */ package domain.impl; import domain.DomainPackage; import domain.Genus; import domain.Species; import java.util.Collection; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.EObjectResolvingEList; import org.eclipse.emf.ecore.util.InternalEList; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Genus</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * </p> * <ul> * <li>{@link domain.impl.GenusImpl#getSpecies <em>Species</em>}</li> * <li>{@link domain.impl.GenusImpl#getName <em>Name</em>}</li> * <li>{@link domain.impl.GenusImpl#getHabitat <em>Habitat</em>}</li> * <li>{@link domain.impl.GenusImpl#getSameAnatomy <em>Same Anatomy</em>}</li> * <li>{@link domain.impl.GenusImpl#getAnatomy <em>Anatomy</em>}</li> * </ul> * * @generated */ public class GenusImpl extends MinimalEObjectImpl.Container implements Genus { /** * The cached value of the '{@link #getSpecies() <em>Species</em>}' containment reference list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getSpecies() * @generated * @ordered */ protected EList<Species> species; /** * The default value of the '{@link #getName() <em>Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getName() * @generated * @ordered */ protected static final String NAME_EDEFAULT = null; /** * The cached value of the '{@link #getName() <em>Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getName() * @generated * @ordered */ protected String name = NAME_EDEFAULT; /** * The default value of the '{@link #getHabitat() <em>Habitat</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getHabitat() * @generated * @ordered */ protected static final String HABITAT_EDEFAULT = null; /** * The cached value of the '{@link #getHabitat() <em>Habitat</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getHabitat() * @generated * @ordered */ protected String habitat = HABITAT_EDEFAULT; /** * The cached value of the '{@link #getSameAnatomy() <em>Same Anatomy</em>}' reference list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getSameAnatomy() * @generated * @ordered */ protected EList<Genus> sameAnatomy; /** * The default value of the '{@link #getAnatomy() <em>Anatomy</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getAnatomy() * @generated * @ordered */ protected static final String ANATOMY_EDEFAULT = null; /** * The cached value of the '{@link #getAnatomy() <em>Anatomy</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getAnatomy() * @generated * @ordered */ protected String anatomy = ANATOMY_EDEFAULT; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected GenusImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return DomainPackage.Literals.GENUS; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public EList<Species> getSpecies() { if (species == null) { species = new EObjectContainmentEList<Species>(Species.class, this, DomainPackage.GENUS__SPECIES); } return species; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String getName() { return name; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void setName(String newName) { String oldName = name; name = newName; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DomainPackage.GENUS__NAME, oldName, name)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String getHabitat() { return habitat; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void setHabitat(String newHabitat) { String oldHabitat = habitat; habitat = newHabitat; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DomainPackage.GENUS__HABITAT, oldHabitat, habitat)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public EList<Genus> getSameAnatomy() { if (sameAnatomy == null) { sameAnatomy = new EObjectResolvingEList<Genus>(Genus.class, this, DomainPackage.GENUS__SAME_ANATOMY); } return sameAnatomy; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String getAnatomy() { return anatomy; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void setAnatomy(String newAnatomy) { String oldAnatomy = anatomy; anatomy = newAnatomy; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DomainPackage.GENUS__ANATOMY, oldAnatomy, anatomy)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case DomainPackage.GENUS__SPECIES: return ((InternalEList<?>)getSpecies()).basicRemove(otherEnd, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case DomainPackage.GENUS__SPECIES: return getSpecies(); case DomainPackage.GENUS__NAME: return getName(); case DomainPackage.GENUS__HABITAT: return getHabitat(); case DomainPackage.GENUS__SAME_ANATOMY: return getSameAnatomy(); case DomainPackage.GENUS__ANATOMY: return getAnatomy(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case DomainPackage.GENUS__SPECIES: getSpecies().clear(); getSpecies().addAll((Collection<? extends Species>)newValue); return; case DomainPackage.GENUS__NAME: setName((String)newValue); return; case DomainPackage.GENUS__HABITAT: setHabitat((String)newValue); return; case DomainPackage.GENUS__SAME_ANATOMY: getSameAnatomy().clear(); getSameAnatomy().addAll((Collection<? extends Genus>)newValue); return; case DomainPackage.GENUS__ANATOMY: setAnatomy((String)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case DomainPackage.GENUS__SPECIES: getSpecies().clear(); return; case DomainPackage.GENUS__NAME: setName(NAME_EDEFAULT); return; case DomainPackage.GENUS__HABITAT: setHabitat(HABITAT_EDEFAULT); return; case DomainPackage.GENUS__SAME_ANATOMY: getSameAnatomy().clear(); return; case DomainPackage.GENUS__ANATOMY: setAnatomy(ANATOMY_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case DomainPackage.GENUS__SPECIES: return species != null && !species.isEmpty(); case DomainPackage.GENUS__NAME: return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); case DomainPackage.GENUS__HABITAT: return HABITAT_EDEFAULT == null ? habitat != null : !HABITAT_EDEFAULT.equals(habitat); case DomainPackage.GENUS__SAME_ANATOMY: return sameAnatomy != null && !sameAnatomy.isEmpty(); case DomainPackage.GENUS__ANATOMY: return ANATOMY_EDEFAULT == null ? anatomy != null : !ANATOMY_EDEFAULT.equals(anatomy); } return super.eIsSet(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuilder result = new StringBuilder(super.toString()); result.append(" (name: "); result.append(name); result.append(", habitat: "); result.append(habitat); result.append(", anatomy: "); result.append(anatomy); result.append(')'); return result.toString(); } } //GenusImpl
[ "odd.gunnar.aspaas@gmail.com" ]
odd.gunnar.aspaas@gmail.com
27e8efcc36dfb742460c19d6a76279d3cfb3d4d6
bbdc5c336571646eabf7d83b7b92f043b3626d57
/ThirdProject/thirdproject/src/main/java/com/trkj/thirdproject/dao/FaqQuestionsDao.java
5b6457fe00cb021668c2a17827e6a7df2e563c34
[]
no_license
zhoujiamin33/localProject
c02c2dab89e80440a08299e0964bc27fa8164585
f80f82747c49f6812f7932390cbf4aaac94589b3
refs/heads/main
2023-05-31T04:01:46.965947
2021-07-01T03:17:22
2021-07-01T03:17:22
373,410,727
1
0
null
null
null
null
UTF-8
Java
false
false
952
java
package com.trkj.thirdproject.dao; import com.trkj.thirdproject.entity.FaqQuestions; import com.trkj.thirdproject.entity.Source; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.Date; import java.util.List; @Mapper public interface FaqQuestionsDao { int deleteByPrimaryKey(Integer faqId); //新增 int insert(FaqQuestions record); //删除--修改时效性 int delstuFaqTime(@Param("faqId" ) int FAQ_Id, @Param( "deletename") String DeleteName, @Param("deletetime") Date DeleteTime); int insertSelective(FaqQuestions record); FaqQuestions selectByPrimaryKey(Integer faqId); int updateByPrimaryKeySelective(FaqQuestions record); int updateByPrimaryKey(FaqQuestions record); List<FaqQuestions> selectAIIFaqQuestions(); // FAQ模糊查询 List<FaqQuestions> selectFaqFuzzyquery(@Param("value")String value, @Param("input") String input); }
[ "1486964584@qq.com" ]
1486964584@qq.com
be28ac2fe102dd5168a40dcd34c248bec4766777
5195c69a06f724447342ea0e3353fd542761d7d9
/src/main/java/com/mycompany/ucomp/security/package-info.java
35063f4e37447fb91a38789a3e4facfeb7b6ca1b
[]
no_license
brahim596/UCompAdmin
495ce5a13a35f4f170f7fa43699032b7c121c845
89270193da839993fe698f547ea07773ac223b99
refs/heads/master
2022-12-22T13:54:02.524784
2020-03-06T09:56:31
2020-03-06T09:56:31
245,384,663
0
0
null
2022-12-16T05:13:25
2020-03-06T09:55:30
Java
UTF-8
Java
false
false
80
java
/** * Spring Security configuration. */ package com.mycompany.ucomp.security;
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
8409445337fbd82dd49ad660cee25fb59bc062ed
81edc2976da147cec8e450d025e0e7a2a6fe3d20
/src/com/test/ASort.java
933ab9e29d686fcdfde7a2ec624f4e759f0fe16c
[]
no_license
zhoujinsy/uploadTest
131f670219a568a960cfa7759e693f7cd801f58f
466364d61cac3a5795ac74e5d9ef7a2ffb1f136a
refs/heads/master
2021-01-25T14:22:04.354940
2018-04-11T15:42:11
2018-04-11T15:42:11
123,684,539
0
0
null
null
null
null
UTF-8
Java
false
false
708
java
package com.test; import java.util.ArrayList; import java.util.List; public class ASort { int cum=0; List list= new ArrayList(); public static void main(String[] args) { ASort aSort=new ASort(); int x=4; aSort.doSort(x); System.out.println(aSort.list); } public List doSort(int n){ for(int i=n;i>0;i--){ if((n-i)%2==0){ for(int j=0;j<i;j++){ cum+=1; list.add(cum); }; for(int k=0;k<i-1;k++){ cum+=n; list.add(cum); } }else{ for(int j=0;j<i;j++){ cum-=1; list.add(cum); }; for(int k=0;k<i-1;k++){ cum-=n; list.add(cum); } } } return list; } }
[ "949282784@qq.com" ]
949282784@qq.com
b2abebbee2ec06dccb805d7896085d31b9bfb2e0
bd91a45df4da31ccd226a6d72e30092265f604c0
/JavaClass/src/assignmenr/Dog.java
d08a0d70ff72ca1bc9a0e3dcf612a03c1b2b70cf
[]
no_license
valla-ranga/RemoteRepository
16da5b73b6b5fdaae1015faf0dab936c88c67ebc
543995fe1a4e7db7719ec571e754facd6a212d6a
refs/heads/master
2021-01-10T02:09:02.088690
2015-11-30T21:50:12
2015-11-30T21:50:12
47,148,340
0
0
null
null
null
null
UTF-8
Java
false
false
280
java
package assignmenr; public class Dog extends Animal{ String action; public Dog(String name, String type,String action) { super(name,type); this.action = action; // TODO Auto-generated constructor stub } public dogAction() { } }
[ "valla_ranga@hotmail.com" ]
valla_ranga@hotmail.com