blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2 values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 132 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 3 9.45M | extension stringclasses 28 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6eb6539d44e3a8640c36d5b0c70dcc30b40bf073 | 030536fadef8c600fbf4138f7b4ef111c858b983 | /android/app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r/android/support/drawerlayout/R.java | ea4769faec255c710e67db5836e843921395929f | [] | no_license | Rajesharya600/Jitsi | 750f66b750314da6254c72a1642f8d24a6e5241f | 59ddf489ea8b2fce36f1eba17ec4ac78afd4ec82 | refs/heads/master | 2020-04-15T16:16:06.357223 | 2019-01-09T09:14:44 | 2019-01-09T09:14:44 | 164,827,803 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 10,459 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* gradle plugin from the resource data it found. It
* should not be modified by hand.
*/
package android.support.drawerlayout;
public final class R {
private R() {}
public static final class attr {
private attr() {}
public static final int alpha = 0x7f02002a;
public static final int font = 0x7f02007d;
public static final int fontProviderAuthority = 0x7f02007f;
public static final int fontProviderCerts = 0x7f020080;
public static final int fontProviderFetchStrategy = 0x7f020081;
public static final int fontProviderFetchTimeout = 0x7f020082;
public static final int fontProviderPackage = 0x7f020083;
public static final int fontProviderQuery = 0x7f020084;
public static final int fontStyle = 0x7f020085;
public static final int fontVariationSettings = 0x7f020086;
public static final int fontWeight = 0x7f020087;
public static final int ttcIndex = 0x7f020128;
}
public static final class color {
private color() {}
public static final int notification_action_color_filter = 0x7f04004f;
public static final int notification_icon_bg_color = 0x7f040050;
public static final int ripple_material_light = 0x7f04005b;
public static final int secondary_text_default_material_light = 0x7f04005d;
}
public static final class dimen {
private dimen() {}
public static final int compat_button_inset_horizontal_material = 0x7f05004b;
public static final int compat_button_inset_vertical_material = 0x7f05004c;
public static final int compat_button_padding_horizontal_material = 0x7f05004d;
public static final int compat_button_padding_vertical_material = 0x7f05004e;
public static final int compat_control_corner_material = 0x7f05004f;
public static final int compat_notification_large_icon_max_height = 0x7f050050;
public static final int compat_notification_large_icon_max_width = 0x7f050051;
public static final int notification_action_icon_size = 0x7f050069;
public static final int notification_action_text_size = 0x7f05006a;
public static final int notification_big_circle_margin = 0x7f05006b;
public static final int notification_content_margin_start = 0x7f05006c;
public static final int notification_large_icon_height = 0x7f05006d;
public static final int notification_large_icon_width = 0x7f05006e;
public static final int notification_main_column_padding_top = 0x7f05006f;
public static final int notification_media_narrow_margin = 0x7f050070;
public static final int notification_right_icon_size = 0x7f050071;
public static final int notification_right_side_padding_top = 0x7f050072;
public static final int notification_small_icon_background_padding = 0x7f050073;
public static final int notification_small_icon_size_as_large = 0x7f050074;
public static final int notification_subtext_size = 0x7f050075;
public static final int notification_top_pad = 0x7f050076;
public static final int notification_top_pad_large_text = 0x7f050077;
}
public static final class drawable {
private drawable() {}
public static final int notification_action_background = 0x7f06006e;
public static final int notification_bg = 0x7f06006f;
public static final int notification_bg_low = 0x7f060070;
public static final int notification_bg_low_normal = 0x7f060071;
public static final int notification_bg_low_pressed = 0x7f060072;
public static final int notification_bg_normal = 0x7f060073;
public static final int notification_bg_normal_pressed = 0x7f060074;
public static final int notification_icon_background = 0x7f060075;
public static final int notification_template_icon_bg = 0x7f060076;
public static final int notification_template_icon_low_bg = 0x7f060077;
public static final int notification_tile_bg = 0x7f060078;
public static final int notify_panel_notification_icon_bg = 0x7f060079;
}
public static final class id {
private id() {}
public static final int action_container = 0x7f070010;
public static final int action_divider = 0x7f070012;
public static final int action_image = 0x7f070013;
public static final int action_text = 0x7f070019;
public static final int actions = 0x7f07001a;
public static final int async = 0x7f070022;
public static final int blocking = 0x7f070025;
public static final int chronometer = 0x7f070030;
public static final int forever = 0x7f07004a;
public static final int icon = 0x7f07004f;
public static final int icon_group = 0x7f070050;
public static final int info = 0x7f070054;
public static final int italic = 0x7f070055;
public static final int line1 = 0x7f070062;
public static final int line3 = 0x7f070063;
public static final int normal = 0x7f07006c;
public static final int notification_background = 0x7f07006d;
public static final int notification_main_column = 0x7f07006e;
public static final int notification_main_column_container = 0x7f07006f;
public static final int right_icon = 0x7f070076;
public static final int right_side = 0x7f070077;
public static final int tag_transition_group = 0x7f0700a0;
public static final int tag_unhandled_key_event_manager = 0x7f0700a1;
public static final int tag_unhandled_key_listeners = 0x7f0700a2;
public static final int text = 0x7f0700a3;
public static final int text2 = 0x7f0700a4;
public static final int time = 0x7f0700a7;
public static final int title = 0x7f0700a8;
}
public static final class integer {
private integer() {}
public static final int status_bar_notification_info_maxnum = 0x7f080005;
}
public static final class layout {
private layout() {}
public static final int notification_action = 0x7f090023;
public static final int notification_action_tombstone = 0x7f090024;
public static final int notification_template_custom_big = 0x7f09002b;
public static final int notification_template_icon_group = 0x7f09002c;
public static final int notification_template_part_chronometer = 0x7f090030;
public static final int notification_template_part_time = 0x7f090031;
}
public static final class string {
private string() {}
public static final int status_bar_notification_info_overflow = 0x7f0b0079;
}
public static final class style {
private style() {}
public static final int TextAppearance_Compat_Notification = 0x7f0c00f7;
public static final int TextAppearance_Compat_Notification_Info = 0x7f0c00f8;
public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0c00fa;
public static final int TextAppearance_Compat_Notification_Time = 0x7f0c00fd;
public static final int TextAppearance_Compat_Notification_Title = 0x7f0c00ff;
public static final int Widget_Compat_NotificationActionContainer = 0x7f0c0170;
public static final int Widget_Compat_NotificationActionText = 0x7f0c0171;
}
public static final class styleable {
private styleable() {}
public static final int[] ColorStateListItem = { 0x10101a5, 0x101031f, 0x7f02002a };
public static final int ColorStateListItem_android_color = 0;
public static final int ColorStateListItem_android_alpha = 1;
public static final int ColorStateListItem_alpha = 2;
public static final int[] FontFamily = { 0x7f02007f, 0x7f020080, 0x7f020081, 0x7f020082, 0x7f020083, 0x7f020084 };
public static final int FontFamily_fontProviderAuthority = 0;
public static final int FontFamily_fontProviderCerts = 1;
public static final int FontFamily_fontProviderFetchStrategy = 2;
public static final int FontFamily_fontProviderFetchTimeout = 3;
public static final int FontFamily_fontProviderPackage = 4;
public static final int FontFamily_fontProviderQuery = 5;
public static final int[] FontFamilyFont = { 0x1010532, 0x1010533, 0x101053f, 0x101056f, 0x1010570, 0x7f02007d, 0x7f020085, 0x7f020086, 0x7f020087, 0x7f020128 };
public static final int FontFamilyFont_android_font = 0;
public static final int FontFamilyFont_android_fontWeight = 1;
public static final int FontFamilyFont_android_fontStyle = 2;
public static final int FontFamilyFont_android_ttcIndex = 3;
public static final int FontFamilyFont_android_fontVariationSettings = 4;
public static final int FontFamilyFont_font = 5;
public static final int FontFamilyFont_fontStyle = 6;
public static final int FontFamilyFont_fontVariationSettings = 7;
public static final int FontFamilyFont_fontWeight = 8;
public static final int FontFamilyFont_ttcIndex = 9;
public static final int[] GradientColor = { 0x101019d, 0x101019e, 0x10101a1, 0x10101a2, 0x10101a3, 0x10101a4, 0x1010201, 0x101020b, 0x1010510, 0x1010511, 0x1010512, 0x1010513 };
public static final int GradientColor_android_startColor = 0;
public static final int GradientColor_android_endColor = 1;
public static final int GradientColor_android_type = 2;
public static final int GradientColor_android_centerX = 3;
public static final int GradientColor_android_centerY = 4;
public static final int GradientColor_android_gradientRadius = 5;
public static final int GradientColor_android_tileMode = 6;
public static final int GradientColor_android_centerColor = 7;
public static final int GradientColor_android_startX = 8;
public static final int GradientColor_android_startY = 9;
public static final int GradientColor_android_endX = 10;
public static final int GradientColor_android_endY = 11;
public static final int[] GradientColorItem = { 0x10101a5, 0x1010514 };
public static final int GradientColorItem_android_color = 0;
public static final int GradientColorItem_android_offset = 1;
}
}
| [
"user@ios2-3.local"
] | user@ios2-3.local |
accf297e6e52cfd50999a05d4aa99b5fadff177e | a0ba76853f6905231e432dfe33bbb4581713777e | /planning.systemadaptation.editor/src/main/java/org/iobserve/planning/systemadaptation/presentation/systemadaptationActionBarContributor.java | ae807b88bf579306d5e9e85e018b3f1b3cdc15e9 | [
"Apache-2.0"
] | permissive | research-iobserve/iobserve-analysis | 5fb71f1e41d8a69c6bdb3e8267849550594bc756 | a5f9f79a9f5108c7d3786bb18b91dc73b34d4a4c | refs/heads/master | 2021-04-12T01:52:58.445672 | 2020-02-19T15:58:43 | 2020-02-19T15:58:43 | 51,083,005 | 8 | 1 | Apache-2.0 | 2020-02-19T15:58:44 | 2016-02-04T15:00:16 | Java | UTF-8 | Java | false | false | 14,222 | java | /**
*/
package org.iobserve.planning.systemadaptation.presentation;
import java.util.ArrayList;
import java.util.Collection;
import org.eclipse.emf.common.ui.viewer.IViewerProvider;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.domain.IEditingDomainProvider;
import org.eclipse.emf.edit.ui.action.ControlAction;
import org.eclipse.emf.edit.ui.action.CreateChildAction;
import org.eclipse.emf.edit.ui.action.CreateSiblingAction;
import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;
import org.eclipse.emf.edit.ui.action.LoadResourceAction;
import org.eclipse.emf.edit.ui.action.ValidateAction;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IContributionItem;
import org.eclipse.jface.action.IContributionManager;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.action.SubContributionItem;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.PartInitException;
import org.iobserve.systemadaptation.changegroup.presentation.systemadaptationEditorPlugin;
/**
* This is the action bar contributor for the systemadaptation model editor.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class systemadaptationActionBarContributor
extends EditingDomainActionBarContributor
implements ISelectionChangedListener {
/**
* This keeps track of the active editor.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected IEditorPart activeEditorPart;
/**
* This keeps track of the current selection provider.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ISelectionProvider selectionProvider;
/**
* This action opens the Properties view.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected IAction showPropertiesViewAction =
new Action(systemadaptationEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) {
@Override
public void run() {
try {
getPage().showView("org.eclipse.ui.views.PropertySheet");
}
catch (PartInitException exception) {
systemadaptationEditorPlugin.INSTANCE.log(exception);
}
}
};
/**
* This action refreshes the viewer of the current editor if the editor
* implements {@link org.eclipse.emf.common.ui.viewer.IViewerProvider}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected IAction refreshViewerAction =
new Action(systemadaptationEditorPlugin.INSTANCE.getString("_UI_RefreshViewer_menu_item")) {
@Override
public boolean isEnabled() {
return activeEditorPart instanceof IViewerProvider;
}
@Override
public void run() {
if (activeEditorPart instanceof IViewerProvider) {
Viewer viewer = ((IViewerProvider)activeEditorPart).getViewer();
if (viewer != null) {
viewer.refresh();
}
}
}
};
/**
* This will contain one {@link org.eclipse.emf.edit.ui.action.CreateChildAction} corresponding to each descriptor
* generated for the current selection by the item provider.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected Collection<IAction> createChildActions;
/**
* This is the menu manager into which menu contribution items should be added for CreateChild actions.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected IMenuManager createChildMenuManager;
/**
* This will contain one {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} corresponding to each descriptor
* generated for the current selection by the item provider.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected Collection<IAction> createSiblingActions;
/**
* This is the menu manager into which menu contribution items should be added for CreateSibling actions.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected IMenuManager createSiblingMenuManager;
/**
* This creates an instance of the contributor.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public systemadaptationActionBarContributor() {
super(ADDITIONS_LAST_STYLE);
loadResourceAction = new LoadResourceAction();
validateAction = new ValidateAction();
controlAction = new ControlAction();
}
/**
* This adds Separators for editor additions to the tool bar.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void contributeToToolBar(IToolBarManager toolBarManager) {
toolBarManager.add(new Separator("systemadaptation-settings"));
toolBarManager.add(new Separator("systemadaptation-additions"));
}
/**
* This adds to the menu bar a menu and some separators for editor additions,
* as well as the sub-menus for object creation items.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void contributeToMenu(IMenuManager menuManager) {
super.contributeToMenu(menuManager);
IMenuManager submenuManager = new MenuManager(systemadaptationEditorPlugin.INSTANCE.getString("_UI_systemadaptationEditor_menu"), "org.iobserve.planning.systemadaptationMenuID");
menuManager.insertAfter("additions", submenuManager);
submenuManager.add(new Separator("settings"));
submenuManager.add(new Separator("actions"));
submenuManager.add(new Separator("additions"));
submenuManager.add(new Separator("additions-end"));
// Prepare for CreateChild item addition or removal.
//
createChildMenuManager = new MenuManager(systemadaptationEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
submenuManager.insertBefore("additions", createChildMenuManager);
// Prepare for CreateSibling item addition or removal.
//
createSiblingMenuManager = new MenuManager(systemadaptationEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
submenuManager.insertBefore("additions", createSiblingMenuManager);
// Force an update because Eclipse hides empty menus now.
//
submenuManager.addMenuListener
(new IMenuListener() {
public void menuAboutToShow(IMenuManager menuManager) {
menuManager.updateAll(true);
}
});
addGlobalActions(submenuManager);
}
/**
* When the active editor changes, this remembers the change and registers with it as a selection provider.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setActiveEditor(IEditorPart part) {
super.setActiveEditor(part);
activeEditorPart = part;
// Switch to the new selection provider.
//
if (selectionProvider != null) {
selectionProvider.removeSelectionChangedListener(this);
}
if (part == null) {
selectionProvider = null;
}
else {
selectionProvider = part.getSite().getSelectionProvider();
selectionProvider.addSelectionChangedListener(this);
// Fake a selection changed event to update the menus.
//
if (selectionProvider.getSelection() != null) {
selectionChanged(new SelectionChangedEvent(selectionProvider, selectionProvider.getSelection()));
}
}
}
/**
* This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener},
* handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings
* that can be added to the selected object and updating the menus accordingly.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void selectionChanged(SelectionChangedEvent event) {
// Remove any menu items for old selection.
//
if (createChildMenuManager != null) {
depopulateManager(createChildMenuManager, createChildActions);
}
if (createSiblingMenuManager != null) {
depopulateManager(createSiblingMenuManager, createSiblingActions);
}
// Query the new selection for appropriate new child/sibling descriptors
//
Collection<?> newChildDescriptors = null;
Collection<?> newSiblingDescriptors = null;
ISelection selection = event.getSelection();
if (selection instanceof IStructuredSelection && ((IStructuredSelection)selection).size() == 1) {
Object object = ((IStructuredSelection)selection).getFirstElement();
EditingDomain domain = ((IEditingDomainProvider)activeEditorPart).getEditingDomain();
newChildDescriptors = domain.getNewChildDescriptors(object, null);
newSiblingDescriptors = domain.getNewChildDescriptors(null, object);
}
// Generate actions for selection; populate and redraw the menus.
//
createChildActions = generateCreateChildActions(newChildDescriptors, selection);
createSiblingActions = generateCreateSiblingActions(newSiblingDescriptors, selection);
if (createChildMenuManager != null) {
populateManager(createChildMenuManager, createChildActions, null);
createChildMenuManager.update(true);
}
if (createSiblingMenuManager != null) {
populateManager(createSiblingMenuManager, createSiblingActions, null);
createSiblingMenuManager.update(true);
}
}
/**
* This generates a {@link org.eclipse.emf.edit.ui.action.CreateChildAction} for each object in <code>descriptors</code>,
* and returns the collection of these actions.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected Collection<IAction> generateCreateChildActions(Collection<?> descriptors, ISelection selection) {
Collection<IAction> actions = new ArrayList<IAction>();
if (descriptors != null) {
for (Object descriptor : descriptors) {
actions.add(new CreateChildAction(activeEditorPart, selection, descriptor));
}
}
return actions;
}
/**
* This generates a {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} for each object in <code>descriptors</code>,
* and returns the collection of these actions.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected Collection<IAction> generateCreateSiblingActions(Collection<?> descriptors, ISelection selection) {
Collection<IAction> actions = new ArrayList<IAction>();
if (descriptors != null) {
for (Object descriptor : descriptors) {
actions.add(new CreateSiblingAction(activeEditorPart, selection, descriptor));
}
}
return actions;
}
/**
* This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.ActionContributionItem}s
* based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection,
* by inserting them before the specified contribution item <code>contributionID</code>.
* If <code>contributionID</code> is <code>null</code>, they are simply added.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void populateManager(IContributionManager manager, Collection<? extends IAction> actions, String contributionID) {
if (actions != null) {
for (IAction action : actions) {
if (contributionID != null) {
manager.insertBefore(contributionID, action);
}
else {
manager.add(action);
}
}
}
}
/**
* This removes from the specified <code>manager</code> all {@link org.eclipse.jface.action.ActionContributionItem}s
* based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void depopulateManager(IContributionManager manager, Collection<? extends IAction> actions) {
if (actions != null) {
IContributionItem[] items = manager.getItems();
for (int i = 0; i < items.length; i++) {
// Look into SubContributionItems
//
IContributionItem contributionItem = items[i];
while (contributionItem instanceof SubContributionItem) {
contributionItem = ((SubContributionItem)contributionItem).getInnerItem();
}
// Delete the ActionContributionItems with matching action.
//
if (contributionItem instanceof ActionContributionItem) {
IAction action = ((ActionContributionItem)contributionItem).getAction();
if (actions.contains(action)) {
manager.remove(contributionItem);
}
}
}
}
}
/**
* This populates the pop-up menu before it appears.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void menuAboutToShow(IMenuManager menuManager) {
super.menuAboutToShow(menuManager);
MenuManager submenuManager = null;
submenuManager = new MenuManager(systemadaptationEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
populateManager(submenuManager, createChildActions, null);
menuManager.insertBefore("edit", submenuManager);
submenuManager = new MenuManager(systemadaptationEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
populateManager(submenuManager, createSiblingActions, null);
menuManager.insertBefore("edit", submenuManager);
}
/**
* This inserts global actions before the "additions-end" separator.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected void addGlobalActions(IMenuManager menuManager) {
menuManager.insertAfter("additions-end", new Separator("ui-actions"));
menuManager.insertAfter("ui-actions", showPropertiesViewAction);
refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());
menuManager.insertAfter("ui-actions", refreshViewerAction);
super.addGlobalActions(menuManager);
}
/**
* This ensures that a delete action will clean up all references to deleted objects.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected boolean removeAllReferencesOnDelete() {
return true;
}
}
| [
"t.poeppke@gmx.de"
] | t.poeppke@gmx.de |
a257e81a02c6fc36ac343dbca98340a77d3c369b | bd563d5ef2a6652c530e9e07724dcd5e2e982f99 | /app/src/test/java/com/shen/okcoin/ExampleUnitTest.java | 0f0a35975417fe44fce0058fdbf883e5efbdd000 | [] | no_license | AdorkDean/OKCoin | 0194f27cf523922d7ab55baa9e7b1f30e04717f7 | 75b66838769d7ffbf7c72d82d80e1e5f6f9e65c0 | refs/heads/master | 2020-03-12T20:30:46.131484 | 2017-09-13T09:08:33 | 2017-09-13T09:08:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 308 | java | package com.shen.okcoin;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"shenwangqang88@163.com"
] | shenwangqang88@163.com |
97700536772801a7abd718a21c653cbab97a20da | d21f021d818aab19dc2dd28ab2af95a596535edb | /app/src/main/java/com/example/mybankapplication/cleancode/loginScreen/HomeActivity.java | 46722d6f537b5d9df7c85c6aee130dd05acaaf48 | [] | no_license | crescent7272/MyBankApplication2 | ccd044b2d8b78b199462004790b799f6902beb51 | 1cb667df3433ce8a5dab3f0514c0a04c25997258 | refs/heads/master | 2022-11-07T07:06:50.400253 | 2020-06-22T08:40:24 | 2020-06-22T08:40:24 | 270,701,104 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,220 | java | package com.example.mybankapplication.cleancode.loginScreen;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import com.example.mybankapplication.R;
import com.example.mybankapplication.cleancode.util.Utils;
public class HomeActivity extends AppCompatActivity implements HomeActivityInput {
private EditText username;
private EditText password;
public static SharedPreferences sharedPreferences;
public HomeInteractorInput output;
public HomeRouter router;
HomeWorker worker;
public static String TAG = HomeActivity.class.getSimpleName();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Utils.setLightStatusBar(this);
sharedPreferences = getPreferences(Context.MODE_PRIVATE);
HomeConfigurator.INSTANCE.configure(this);
username = findViewById(R.id.username);
password = findViewById(R.id.password);
Button login = findViewById(R.id.login);
fetchMetaData();
login.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(Utils.isValidUsername(username.getText().toString()) && Utils.isValidPassword(password.getText().toString()) ) {
LoginRequestModel loginRequestModel = new LoginRequestModel(username.getText().toString(), password.getText().toString());
output.fetchHomeMetaData(loginRequestModel);
}
else
{
Toast.makeText(HomeActivity.this, "Username and/or password is invalid!", Toast.LENGTH_SHORT).show();
}
}
}
);
}
public void fetchMetaData() {
String username = sharedPreferences.getString(getString(R.string.username),"");
String password = sharedPreferences.getString(getString(R.string.password),"");
this.username.setText(username);
this.password.setText(password);
}
@Override
public void displayHomeMetaData( LoginResponseModel loginResponseModel ) {
Log.e(TAG, "displayHomeMetaData() called = ");
sharedPreferences.edit().
putString(getString(R.string.username), username.getText().toString())
.apply();
sharedPreferences.edit().
putString(getString(R.string.password), password.getText().toString())
.apply();
if(loginResponseModel.getUserAccount() != null && loginResponseModel.getUserAccount().getName() != null && !loginResponseModel.getUserAccount().getName().equals("") ) {
Toast.makeText(this, "Login is successfull!", Toast.LENGTH_SHORT).show();
router.passDataToNextScene(loginResponseModel);
}
else
Toast.makeText(this, "Login is failed!", Toast.LENGTH_SHORT).show();
}
}
| [
"ruveyda72@gmail.com"
] | ruveyda72@gmail.com |
d8a646eb15f354f142c6f0e9bf2130408215162a | f2cf3d95e2775683b169c04a83be8f68811cafeb | /gulimall-user/src/main/java/com/atguigu/gulimall/user/controller/UserLoginLogController.java | d314ff5705d18ee3d35a83500bab3902930abda4 | [
"Apache-2.0"
] | permissive | sharonchen0427/gulimall | eab24535642ff8da2471e6439b336f8cc64addbc | fea6e90491c51d7b3edffec3ccfa3656578b18b6 | refs/heads/main | 2023-06-23T01:22:29.414695 | 2021-06-30T02:13:28 | 2021-06-30T02:13:28 | 317,004,573 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,364 | java | package com.atguigu.gulimall.user.controller;
import java.util.Arrays;
import java.util.Map;
//import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.atguigu.gulimall.user.entity.UserLoginLogEntity;
import com.atguigu.gulimall.user.service.UserLoginLogService;
import com.atguigu.common.utils.PageUtils;
import com.atguigu.common.utils.R;
/**
* 用户登陆记录表
*
* @author chensharon
* @email chensharon0427@gmail.com
* @date 2021-01-04 15:37:54
*/
@RestController
@RequestMapping("user/userloginlog")
public class UserLoginLogController {
@Autowired
private UserLoginLogService userLoginLogService;
/**
* 列表
*/
@RequestMapping("/list")
//@RequiresPermissions("user:userloginlog:list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = userLoginLogService.queryPage(params);
return R.ok().put("page", page);
}
/**
* 信息
*/
@RequestMapping("/info/{id}")
//@RequiresPermissions("user:userloginlog:info")
public R info(@PathVariable("id") Long id){
UserLoginLogEntity userLoginLog = userLoginLogService.getById(id);
return R.ok().put("userLoginLog", userLoginLog);
}
/**
* 保存
*/
@RequestMapping("/save")
//@RequiresPermissions("user:userloginlog:save")
public R save(@RequestBody UserLoginLogEntity userLoginLog){
userLoginLogService.save(userLoginLog);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
//@RequiresPermissions("user:userloginlog:update")
public R update(@RequestBody UserLoginLogEntity userLoginLog){
userLoginLogService.updateById(userLoginLog);
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
//@RequiresPermissions("user:userloginlog:delete")
public R delete(@RequestBody Long[] ids){
userLoginLogService.removeByIds(Arrays.asList(ids));
return R.ok();
}
}
| [
"-chensharon0427@gmail.com"
] | -chensharon0427@gmail.com |
1cecddec410dadb03026415ca8d97829f9535027 | d531b3eb76df2e4774c8f3c89c0ed73e33ae67a2 | /src/com/company/java_07_ch_34_vi_01_main.java | 6be6926e4066c80d9ef8bedac4b159e43737319c | [] | no_license | Shajidur-Rahman/Java | 9d3cc6397933cc85083d6eac40a0fd4ff384aa6e | 7724fd304c1affef67c5f061476691b799e5bd98 | refs/heads/main | 2023-08-05T08:26:34.714439 | 2021-09-19T09:19:31 | 2021-09-19T09:23:32 | 376,331,456 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 642 | java | package com.company;
import java.util.Scanner;
public class java_07_ch_34_vi_01_main {
static void factorial(int a){
int result = 1;
if (a==0 || a==1){
System.out.println("The factorial of "+ a + " is " + 1);
}
else {
for (int x = 1; x <= a; x++){
result = x * result;
}
System.out.println("The factorial of "+ a + " is " + result);
}
}
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("Give me the number : ");
int num = input.nextInt();
factorial(num);
}
}
| [
"shajidurrahmansaad10@gmail.com"
] | shajidurrahmansaad10@gmail.com |
46c0dea70aac3c773f492d6cb727a658fa85ffc8 | dfc0ffcccaec220d60be1ed89a3927c4bcc6a08f | /src/test/java/com/jing/_24/SequenceOfBSTTest.java | c77c05dc8525421d8cce94ffb9d5da8fb9b1f5a8 | [] | no_license | dogeByte/sword-to-offer | 446149cf5047bd80f8bb5db20b334e2351408e45 | 7445afa57cdc7b03622aa43f86dcf189b3df70b6 | refs/heads/master | 2021-06-16T23:53:56.688480 | 2017-05-22T00:53:46 | 2017-05-22T00:53:46 | 86,459,729 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,238 | java | package com.jing._24;
import org.junit.Assert;
import org.junit.Test;
public class SequenceOfBSTTest {
// 完全二叉树
@Test
public void testVerify_Complete() {
Integer[] postorder = { 5, 7, 6, 9, 11, 10, 8 };
Assert.assertTrue(SequenceOfBST.verify(postorder));
}
// 没有左子节点的二叉树
@Test
public void testVerify_NoLeft() {
Integer[] postorder = { 1, 2, 3, 4 };
Assert.assertTrue(SequenceOfBST.verify(postorder));
}
// 没有右子节点的二叉树
@Test
public void testVerify_NoRight() {
Integer[] postorder = { 4, 3, 2, 1 };
Assert.assertTrue(SequenceOfBST.verify(postorder));
}
// 只有根节点的二叉树
@Test
public void testVerify_Sole() {
Integer[] postorder = { 1 };
Assert.assertTrue(SequenceOfBST.verify(postorder));
}
// 后序遍历序列不对应任何一棵二叉搜索树
@Test
public void testVerify_False() {
Integer[] postorder = { 7, 4, 5, 6 };
Assert.assertFalse(SequenceOfBST.verify(postorder));
}
// 空指针
@Test
public void testVerify_Null() {
Assert.assertFalse(SequenceOfBST.verify(null));
}
}
| [
"jing620139@gmail.com"
] | jing620139@gmail.com |
fae01cdb3bca908788113298c1c0b15fac7b9fc4 | 3e1c8d81e169277e4ddd774f67bc9e335e80b524 | /src/main/java/DrummerMC/Extra_Stuff/Parts/PartBase.java | 80c9080b55550dc2ff3dbb6324a6f6cd1cc36c10 | [
"MIT"
] | permissive | DrummerMC/Extra-Stuff | 960af712c315d972fa9f830cffb700fb71f64ffb | 7a37c55daf973d8932088aba4547c6fda2a14c47 | refs/heads/master | 2021-01-19T13:52:39.804297 | 2014-08-19T11:25:00 | 2014-08-19T11:25:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,422 | java | package DrummerMC.Extra_Stuff.Parts;
import io.netty.buffer.ByteBuf;
import java.io.IOException;
import java.util.List;
import java.util.Random;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.common.Optional.Interface;
import cpw.mods.fml.common.network.ByteBufUtils;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.IIcon;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import DrummerMC.Extra_Stuff.Extra_Stuff;
import DrummerMC.Extra_Stuff.Api.Grid.IEnergyGrid;
import DrummerMC.Extra_Stuff.Api.Grid.IEnergyStorageGrid;
import DrummerMC.Extra_Stuff.Api.Util.EnergyType;
import appeng.api.AEApi;
import appeng.api.config.Actionable;
import appeng.api.networking.IGridHost;
import appeng.api.networking.IGridNode;
import appeng.api.parts.BusSupport;
import appeng.api.parts.IPart;
import appeng.api.parts.IPartCollsionHelper;
import appeng.api.parts.IPartHost;
import appeng.api.parts.IPartRenderHelper;
import appeng.api.parts.PartItemStack;
import appeng.api.util.AECableType;
import appeng.api.util.DimensionalCoord;
@Optional.InterfaceList(value = { @Interface(iface = "appeng.api.parts.IPart", modid = "appliedenergistics2"),
@Interface(iface = "appeng.api.networking.IGridHost", modid = "appliedenergistics2")})
public class PartBase implements IPart, IGridHost{
IGridNode node = null;
public TileEntity tile;
public ForgeDirection side = ForgeDirection.UNKNOWN;
public IPartHost host;
public PartGridBlock block;
@Optional.Method(modid = "appliedenergistics2")
@Override
public ItemStack getItemStack(PartItemStack type) {
return new ItemStack(Extra_Stuff.partItem);
}
@Optional.Method(modid = "appliedenergistics2")
@SideOnly(Side.CLIENT)
@Override
public void renderInventory(IPartRenderHelper rh, RenderBlocks renderer) {
rh.setTexture(Blocks.stone.getIcon(0, 0));
rh.setBounds(2, 2, 14, 14, 14, 16);
rh.renderInventoryBox(renderer);
}
@Optional.Method(modid = "appliedenergistics2")
@SideOnly(Side.CLIENT)
@Override
public void renderStatic(int x, int y, int z, IPartRenderHelper rh,
RenderBlocks renderer) {
rh.setTexture(Blocks.stone.getIcon(0, 0));
rh.setBounds(2, 2, 14, 14, 14, 16);
rh.renderBlock(x, y, z, renderer);
}
@Optional.Method(modid = "appliedenergistics2")
@SideOnly(Side.CLIENT)
@Override
public void renderDynamic(double x, double y, double z,
IPartRenderHelper rh, RenderBlocks renderer) {
}
@Optional.Method(modid = "appliedenergistics2")
@Override
public boolean requireDynamicRender() {
// TODO Auto-generated method stub
return false;
}
@Optional.Method(modid = "appliedenergistics2")
@Override
public boolean isSolid() {
// TODO Auto-generated method stub
return false;
}
@Optional.Method(modid = "appliedenergistics2")
@Override
public boolean canConnectRedstone() {
// TODO Auto-generated method stub
return false;
}
@Optional.Method(modid = "appliedenergistics2")
@Override
public void writeToNBT(NBTTagCompound data) {
// TODO Auto-generated method stub
}
@Optional.Method(modid = "appliedenergistics2")
@Override
public void readFromNBT(NBTTagCompound data) {
// TODO Auto-generated method stub
}
@Optional.Method(modid = "appliedenergistics2")
@Override
public int getLightLevel() {
return 5;
}
@Optional.Method(modid = "appliedenergistics2")
@Override
public boolean isLadder(EntityLivingBase entity) {
return false;
}
@Optional.Method(modid = "appliedenergistics2")
@Override
public void onNeighborChanged() {
}
@Optional.Method(modid = "appliedenergistics2")
@Override
public int isProvidingStrongPower() {
return 0;
}
@Optional.Method(modid = "appliedenergistics2")
@Override
public int isProvidingWeakPower() {
return 0;
}
@Optional.Method(modid = "appliedenergistics2")
@Override
public void writeToStream(ByteBuf data) throws IOException {
NBTTagCompound tag = new NBTTagCompound();
this.writeToNBT(tag);
ByteBufUtils.writeTag(data, tag);
}
@Optional.Method(modid = "appliedenergistics2")
@Override
public boolean readFromStream(ByteBuf data) throws IOException {
try{
this.readFromNBT(ByteBufUtils.readTag(data));
}catch(Exception e){
e.printStackTrace();
return false;
}
return true;
}
@Optional.Method(modid = "appliedenergistics2")
@Override
public IGridNode getGridNode() {
if(this.node == null){
try{
this.node = AEApi.instance().createGridNode(block);
this.node.updateState();
}catch(Exception e){
return null;
}
}
return node;
}
@Optional.Method(modid = "appliedenergistics2")
@Override
public void onEntityCollision(Entity entity) {
}
@Optional.Method(modid = "appliedenergistics2")
@Override
public void removeFromWorld() {
if(this.getGridNode() != null)
this.getGridNode().destroy();
}
@Optional.Method(modid = "appliedenergistics2")
@Override
public void addToWorld() {
this.block = new PartGridBlock(this);
}
@Optional.Method(modid = "appliedenergistics2")
@Override
public IGridNode getExternalFacingNode() {
// TODO Auto-generated method stub
return null;
}
@Optional.Method(modid = "appliedenergistics2")
@Override
public void setPartHostInfo(ForgeDirection side, IPartHost host, TileEntity tile) {
this.host = host;
this.tile = tile;
this.side = side;
}
@Optional.Method(modid = "appliedenergistics2")
@Override
public void getBoxes(IPartCollsionHelper bch) {
bch.addBox(2, 2, 14, 14, 14, 16);
}
@Optional.Method(modid = "appliedenergistics2")
@Override
public boolean onActivate(EntityPlayer player, Vec3 pos) {
if(player.worldObj.isRemote)
return false;
IEnergyStorageGrid g = this.getGridNode().getGrid().getCache(IEnergyStorageGrid.class);
String energy = ""+g.getEnergy(EnergyType.MJ, "default");
player.addChatMessage(new ChatComponentText(energy));
System.out.println(energy);
return false;
}
@Optional.Method(modid = "appliedenergistics2")
@Override
public boolean onShiftActivate(EntityPlayer player, Vec3 pos) {
// TODO Auto-generated method stub
return false;
}
@Optional.Method(modid = "appliedenergistics2")
@Override
public void getDrops(List<ItemStack> drops, boolean wrenched) {
// TODO Auto-generated method stub
}
@Optional.Method(modid = "appliedenergistics2")
@Override
public int cableConnectionRenderTo() {
// TODO Auto-generated method stub
return 2;
}
@Optional.Method(modid = "appliedenergistics2")
@Override
public void randomDisplayTick(World world, int x, int y, int z, Random r) {
// TODO Auto-generated method stub
}
@Optional.Method(modid = "appliedenergistics2")
@Override
public void onPlacement(EntityPlayer player, ItemStack held,
ForgeDirection side) {
// TODO Auto-generated method stub
}
@Optional.Method(modid = "appliedenergistics2")
@Override
public boolean canBePlacedOn(BusSupport what) {
if(what == BusSupport.DENSE_CABLE)
return false;
return true;
}
@Optional.Method(modid = "appliedenergistics2")
@Override
public IGridNode getGridNode(ForgeDirection dir) {
return this.getGridNode();
}
@Optional.Method(modid = "appliedenergistics2")
@Override
public AECableType getCableConnectionType(ForgeDirection dir) {
return AECableType.SMART;
}
@Optional.Method(modid = "appliedenergistics2")
@Override
public void securityBreak() {
}
@Optional.Method(modid = "appliedenergistics2")
public DimensionalCoord getLocation() {
return new DimensionalCoord(tile);
}
@Optional.Method(modid = "appliedenergistics2")
@Override
public IIcon getBreakingTexture() {
// TODO Auto-generated method stub
return null;
}
} | [
"drummermods@icloud.com"
] | drummermods@icloud.com |
642fc1f3e8843d69904c46b675a0e3b386d565a3 | abacee1ea227ef66cbc7c19f325347f0db4a59d4 | /KanMeiTu/app/src/main/java/com/ixuea/courses/kanmeitu/domain/response/ListResponse.java | d51bddf1b5508411c9a323d6a1dd4bd9fc7e2cc4 | [] | no_license | catshan/my-example | 6a021c7fe954a994d9524c0baece7f1a33e536c7 | 079a17876a665962cbf1344f2479476450cfaec7 | refs/heads/master | 2020-09-07T09:44:51.225898 | 2019-11-10T07:36:26 | 2019-11-10T07:36:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 312 | java | package com.ixuea.courses.kanmeitu.domain.response;
import java.util.List;
/**
* Created by smile on 02/03/2019.
*/
public class ListResponse<T> {
private List<T> data;
public List<T> getData() {
return data;
}
public void setData(List<T> data) {
this.data = data;
}
}
| [
"1150482916@qq.com"
] | 1150482916@qq.com |
5e1b2650ba3efd3679a1e2c4b65637c51939c674 | d82acd125fb7d6570e58a522ed1b8f28af11123a | /ui/data/RD findbugs/model/src/edu/umd/cs/findbugs/ba/AbstractBlockOrder.java | c31855fd290bb711ffa8b024528be1fd6cf72f13 | [
"Apache-2.0"
] | permissive | fetteradler/Getaviz | dba3323060d3bca81d2d93a2c1a19444ca406e16 | 9e80d842312f55b798044c069a1ef297e64da86f | refs/heads/master | 2020-03-22T11:34:46.963754 | 2018-08-29T14:19:09 | 2018-08-29T14:19:09 | 139,980,787 | 0 | 0 | Apache-2.0 | 2018-07-06T12:16:17 | 2018-07-06T12:16:17 | null | UTF-8 | Java | false | false | 2,306 | java | /*
* Bytecode Analysis Framework
* Copyright (C) 2003,2004 University of Maryland
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package edu.umd.cs.findbugs.ba;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Iterator;
/**
* Abstract base class for BlockOrder variants. It allows the subclass to
* specify just a Comparator for BasicBlocks, and handles the work of doing the
* sorting and providing Iterators.
*
* @see BlockOrder
*/
public abstract class AbstractBlockOrder implements BlockOrder {
private final ArrayList<BasicBlock> blockList;
private final Comparator<BasicBlock> comparator;
public AbstractBlockOrder(CFG cfg, Comparator<BasicBlock> comparator) {
this.comparator = comparator;
// Put the blocks in an array
int numBlocks = cfg.getNumBasicBlocks(), count = 0;
BasicBlock[] blocks = new BasicBlock[numBlocks];
for (Iterator<BasicBlock> i = cfg.blockIterator(); i.hasNext();) {
blocks[count++] = i.next();
}
assert count == numBlocks;
// Sort the blocks according to the comparator
Arrays.sort(blocks, comparator);
// Put the ordered blocks into an array list
blockList = new ArrayList<BasicBlock>(numBlocks);
for (int i = 0; i < numBlocks; ++i)
blockList.add(blocks[i]);
}
public Iterator<BasicBlock> blockIterator() {
return blockList.iterator();
}
public int compare(BasicBlock b1, BasicBlock b2) {
return comparator.compare(b1, b2);
}
}
// vim:ts=4
| [
"david.baum@uni-leipzig.de"
] | david.baum@uni-leipzig.de |
6a7dd6aa6c70e1fb2aae0a32ffe6ad798b90aca3 | a8c5b7b04eace88b19b5a41a45f1fb030df393e3 | /projects/financial/src/main/java/com/opengamma/financial/analytics/model/bond/BondAccruedInterestFromCleanPriceFunction.java | edac900db429e1d16674602b886ef6fd3b521e10 | [
"Apache-2.0"
] | permissive | McLeodMoores/starling | 3f6cfe89cacfd4332bad4861f6c5d4648046519c | 7ae0689e06704f78fd9497f8ddb57ee82974a9c8 | refs/heads/master | 2022-12-04T14:02:00.480211 | 2020-04-28T17:22:44 | 2020-04-28T17:22:44 | 46,577,620 | 4 | 4 | Apache-2.0 | 2022-11-24T07:26:39 | 2015-11-20T17:48:10 | Java | UTF-8 | Java | false | false | 1,064 | java | /**
* Copyright (C) 2011 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.financial.analytics.model.bond;
import com.opengamma.analytics.financial.interestrate.InstrumentDerivativeVisitorAdapter;
import com.opengamma.analytics.financial.interestrate.bond.calculator.AccruedInterestFromCleanPriceCalculator;
import com.opengamma.engine.value.ValueRequirementNames;
/**
* Calculates the accrued interest from bond yield.
* @deprecated The parent of this class is deprecated.
* Use {@link com.opengamma.financial.analytics.model.bondcleanprice.BondAccruedInterestFromCleanPriceFunction}
*/
@Deprecated
public class BondAccruedInterestFromCleanPriceFunction extends BondFromCleanPriceFunction {
@Override
protected InstrumentDerivativeVisitorAdapter<Double, Double> getCalculator() {
return AccruedInterestFromCleanPriceCalculator.getInstance();
}
@Override
protected String getValueRequirementName() {
return ValueRequirementNames.ACCRUED_INTEREST;
}
}
| [
"jim.moores@gmail.com"
] | jim.moores@gmail.com |
66cca6fcd55c2a9891bf0fdfd0bbd34a6629e05e | 072e5e07c495afe68cf1694445c026664658b887 | /src/com/dcdzsoft/business/mb/MBGetInboxPackage.java | 21fb5011f7b758f91e6f753df11d13f5796831e0 | [] | no_license | P79N6A/work-dbs-manager | 084e8d341d5f84ca43cd1aa20f701e68206e2a6d | 932009426659ccb10f578f73879960975306d276 | refs/heads/master | 2021-09-29T13:13:23.092146 | 2018-11-24T13:29:12 | 2018-11-24T13:29:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,957 | java | package com.dcdzsoft.business.mb;
import javax.sql.RowSet;
import com.dcdzsoft.EduException;
import com.dcdzsoft.sda.db.*;
import com.dcdzsoft.util.*;
import com.dcdzsoft.dto.function.*;
import com.dcdzsoft.dto.business.*;
import com.dcdzsoft.dao.*;
import com.dcdzsoft.dao.common.*;
import com.dcdzsoft.constant.*;
import com.dcdzsoft.business.ActionBean;
import com.dcdzsoft.businessproxy.PushBusinessProxy;
/**
* <p>Title: 智能自助包裹柜系统</p>
* <p>Description: 获取设备在箱包裹信息 </p>
* <p>Copyright: Copyright (c) 2004</p>
* <p>Company: dcdzsoft</p>
* @author 王中立
* @version 1.0
*/
public class MBGetInboxPackage extends ActionBean {
public int doBusiness(InParamMBGetInboxPackage in) throws EduException {
utilDAO = this.getUtilDAO();
commonDAO = this.getCommonDAO();
dbSession = this.getCurrentDBSession();
int result = 0;
//1. 验证输入参数是否有效,如果无效返回-1。
if (StringUtils.isEmpty(in.OperID)
|| StringUtils.isEmpty(in.TerminalNo))
throw new EduException(ErrorCode.ERR_PARMERR);
//2. 调用CommonDAO.isOnline(操作员编号)判断操作员是否在线。
OPOperOnline operOnline = commonDAO.isOnline(in.OperID);
//3. 调用UtilDAO.getCurrentDateTime()获得系统日期时间。
java.sql.Timestamp sysDateTime = utilDAO.getCurrentDateTime();
in.AutoFlag = "0";
///推送到设备端
PushBusinessProxy.doBusiness(in);
// 调用CommonDAO.addOperatorLog(OperID,功能编号,系统日期时间,“”)
OPOperatorLog log = new OPOperatorLog();
log.OperID = in.OperID;
log.FunctionID = in.getFunctionID();
log.OccurTime = sysDateTime;
log.StationAddr = operOnline.LoginIPAddr;
log.Remark = in.TerminalNo;
commonDAO.addOperatorLog(log);
return result;
}
}
| [
"zhengxiaoyong@hzdongcheng.com"
] | zhengxiaoyong@hzdongcheng.com |
bd8cc3aa495a2d335457e86434d05128a95d1277 | fa10591ac72d1c18145e96e028a0ebd0fd443a34 | /src/com/gannon/bytecode/controlflowgraph/CNode.java | 7f9988714f4c3f878b81ffd031ac737e28516e90 | [] | no_license | ssraza/JVMForTriangle | 3a9a87ab5dde9370b7fa02f473f1c28816f858f2 | 21866a94e24de581c45caf2c1268c046c4731bb7 | refs/heads/master | 2021-01-13T02:18:08.189546 | 2013-11-26T20:22:27 | 2013-11-26T20:22:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,421 | java | package com.gannon.bytecode.controlflowgraph;
import java.awt.Color;
import java.util.ArrayList;
public class CNode {
private final int id;
private String methodName;
private String className;
private CBlock block;
private Color color;
public Color getColor() {
return color;
}
public CNode(int id) {
super();
this.id = id;
}
public CNode(final int id, CBlock blcok, Color color) {
super();
this.id = id;
this.block = blcok;
this.color = color;
}
public CNode(final int id, String methodName, String className,CBlock blcok, Color color) {
super();
this.id = id;
this.methodName = methodName;
this.className = className;
this.block = blcok;
this.color = color;
}
public int getId() {
return id;
}
public String getMethodName(){
return this.methodName;
}
public CBlock getBlock() {
return block;
}
@Override
public String toString() {
return "CNode [id=" + id + " Method Name= " + methodName + "Class Name= " + className + "], block [id=" + block.getId() + "]";
}
public void setBlock(CBlock blcok) {
this.block = blcok;
}
public boolean hasIfStatement(){
return block.hasIfStatement();
}
public boolean hasInvoke() {
return block.hasInvoke();
}
/*
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + id;
result = prime * result
+ ((methodName == null) ? 0 : methodName.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
CNode other = (CNode) obj;
if (id != other.id)
return false;
if (methodName == null) {
if (other.methodName != null)
return false;
} else if (!methodName.equals(other.methodName))
return false;
return true;
}
*/
public static CNode retreaveNode(ArrayList<CNode> nodes, int id, String methodName, String className, CBlock blcok){
for (CNode node: nodes){
if (node.id == id && node.methodName == methodName && node.className == className){
return node;
}
}
return null;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ ((className == null) ? 0 : className.hashCode());
result = prime * result + id;
result = prime * result
+ ((methodName == null) ? 0 : methodName.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
CNode other = (CNode) obj;
if (className == null) {
if (other.className != null)
return false;
} else if (!className.equals(other.className))
return false;
if (id != other.id)
return false;
if (methodName == null) {
if (other.methodName != null)
return false;
} else if (!methodName.equals(other.methodName))
return false;
return true;
}
public static boolean nodeExists(ArrayList<CNode> nodes, int id, String methodName, String className, CBlock blcok){
for (CNode node: nodes){
if (node.id == id && node.methodName == methodName && node.methodName == className){
return true;
}
}
return false;
}
}
| [
"raza@Aqeel-Raza-Syeds-MacBook-Pro.local"
] | raza@Aqeel-Raza-Syeds-MacBook-Pro.local |
faab56af354ed60fe4c381cc25feb7f3fe776036 | 23b6d6971a66cf057d1846e3b9523f2ad4e05f61 | /MLMN-Statistics/src/vn/com/vhc/vmsc2/statistics/web/controller/WkRouteCoreReportController.java | 2546c2dab5b7d598c46e36b0d55ddb695f9278a8 | [] | no_license | vhctrungnq/mlmn | 943f5a44f24625cfac0edc06a0d1b114f808dfb8 | d3ba1f6eebe2e38cdc8053f470f0b99931085629 | refs/heads/master | 2020-03-22T13:48:30.767393 | 2018-07-08T05:14:12 | 2018-07-08T05:14:12 | 140,132,808 | 0 | 1 | null | 2018-07-08T05:29:27 | 2018-07-08T02:57:06 | Java | UTF-8 | Java | false | false | 6,709 | java | package vn.com.vhc.vmsc2.statistics.web.controller;
import java.util.Calendar;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import vn.com.vhc.vmsc2.statistics.dao.WkBscCoreDAO;
import vn.com.vhc.vmsc2.statistics.dao.WkMscQosDAO;
import vn.com.vhc.vmsc2.statistics.dao.WkRouteCoreDAO;
import vn.com.vhc.vmsc2.statistics.dao.WkRouteCoreReportDAO;
import vn.com.vhc.vmsc2.statistics.domain.WkBscCore;
import vn.com.vhc.vmsc2.statistics.domain.WkMscQos;
import vn.com.vhc.vmsc2.statistics.domain.WkRouteCore;
import vn.com.vhc.vmsc2.statistics.domain.WkRouteCoreReport;
import vn.com.vhc.vmsc2.statistics.web.utils.Helper;
@Controller
@RequestMapping("/report/core/route/wk/*")
public class WkRouteCoreReportController extends BaseController {
@Autowired
private WkBscCoreDAO wkBscCoreDao;
@Autowired
private WkMscQosDAO wkMscQosDao;
@Autowired
private WkRouteCoreDAO wkRouteCoreDao;
@Autowired
private WkRouteCoreReportDAO wkRouteCoreReportDao;
@RequestMapping("detail")
public String showReport(@RequestParam(required = true) String fromNode, @RequestParam(required = true) String toNode,
@RequestParam(required = false) String week,@RequestParam(required = false) String year, ModelMap model, HttpServletRequest request) {
Calendar now = Calendar.getInstance();
now.setFirstDayOfWeek(Calendar.MONDAY);
if (week == null)
week = String.valueOf(now.get(Calendar.WEEK_OF_YEAR) - 2);
if (year == null)
year = String.valueOf(now.get(Calendar.YEAR));
Map<String, String> fromNodeMap = null;
Map<String, String> toNodeMap = null;
if (isMsc(fromNode)) {
fromNodeMap = mscNodeMap(week,year, fromNode);
} else if (isBsc(fromNode)) {
fromNodeMap = bscNodeMap(week,year, fromNode);
}
if (isMsc(toNode)) {
toNodeMap = mscNodeMap(week,year, toNode);
} else if (isBsc(toNode)) {
toNodeMap = bscNodeMap(week, year, toNode);
}
List<WkRouteCore> wkRouteCores = wkRouteCoreDao.filter(week,year, fromNode, toNode);
WkRouteCoreReport wkRouteCoreReport = wkRouteCoreReportDao.selectByPrimaryKey(fromNode, toNode, Integer.parseInt(week), Integer.parseInt(year));
model.addAttribute("wkRouteCoreReport", wkRouteCoreReport);
model.addAttribute("week", week);
model.addAttribute("year", year);
model.addAttribute("fromNode", fromNode);
model.addAttribute("toNode", toNode);
model.addAttribute("fromNodeMap", fromNodeMap);
model.addAttribute("toNodeMap", toNodeMap);
model.addAttribute("wkRouteCores", wkRouteCores);
return "wkRouteCoreReportDetailList";
}
private boolean isMsc(String node) {
return node.charAt(0) == 'M';
}
private boolean isBsc(String node) {
return node.charAt(0) == 'B';
}
private Map<String, String> mscNodeMap(String week,String year, String node) {
Map<String, String> mscNodeMap = new LinkedHashMap<String, String>();
WkMscQos wkMscQos = wkMscQosDao.selectByPrimaryKey(node, Integer.parseInt(week),Integer.parseInt( year));
if (wkMscQos == null)
wkMscQos = new WkMscQos();
mscNodeMap.put("%", "N/A");
mscNodeMap.put("MCSSR (%)",
"<a href=\"/VMSC2-Statistics/report/core/msc/wk.htm?mscid=" + node + "&week=" + Integer.parseInt(week) +"&year=" + Integer.parseInt(year) + "#mcssr\">" + Helper.float2String(wkMscQos.getMcssr()) + "%</a>");
mscNodeMap.put("LUSR (%)", "<a href=\"/VMSC2-Statistics/report/core/msc/wk.htm?mscid=" + node + "&week=" + Integer.parseInt(week) +"&year=" + Integer.parseInt(year) + "#lusr\">" + Helper.float2String(wkMscQos.getLusr())
+ "%</a>");
mscNodeMap.put("PSR (%)", "<a href=\"/VMSC2-Statistics/report/core/msc/wk.htm?mscid=" + node + "&week=" + Integer.parseInt(week) +"&year=" + Integer.parseInt(year) + "#psr\">" + Helper.float2String(wkMscQos.getPsr())
+ "%</a>");
mscNodeMap.put("HSR (%)", "<a href=\"/VMSC2-Statistics/report/core/msc/wk.htm?mscid=" + node + "&week=" + Integer.parseInt(week) +"&year=" + Integer.parseInt(year) +"#hsr\">" + Helper.float2String(wkMscQos.getHsr())
+ "%</a>");
mscNodeMap.put("SMSSR (%)",
"<a href=\"/VMSC2-Statistics/report/core/msc/wk.htm?mscid=" + node + "&week=" + Integer.parseInt(week) +"&year=" + Integer.parseInt(year) + "#smssr\">" + Helper.float2String(wkMscQos.getSmssr()) + "%</a>");
mscNodeMap.put("AUSR (%)", "<a href=\"/VMSC2-Statistics/report/core/msc/wk.htm?mscid=" + node + "&week=" + Integer.parseInt(week) +"&year=" + Integer.parseInt(year) +"#ausr\">" + Helper.float2String(wkMscQos.getAusr())
+ "%</a>");
mscNodeMap.put("ECCR (%)", "N/A");
return mscNodeMap;
}
private Map<String, String> bscNodeMap(String week,String year, String node) {
Map<String, String> bscNodeMap = new LinkedHashMap<String, String>();
WkBscCore wkBscCore = wkBscCoreDao.selectByPrimaryKey(node, Integer.parseInt(week), Integer.parseInt(year));
if (wkBscCore == null)
wkBscCore = new WkBscCore();
bscNodeMap.put("%", "N/A");
bscNodeMap.put("CSSR (%)", "<a href=\"/VMSC2-Statistics/report/core/bsc/wk.htm?bscid=" + node + "&week=" + Integer.parseInt(week) +"&year=" + Integer.parseInt(year) +"#cssr\">" + Helper.float2String(wkBscCore.getCssr())
+ "%</a>");
bscNodeMap.put("PSR (%)", "<a href=\"/VMSC2-Statistics/report/core/bsc/wk.htm?bscid=" + node +"&week=" + Integer.parseInt(week) +"&year=" + Integer.parseInt(year) + "#psr\">" + Helper.float2String(wkBscCore.getPsr())
+ "%</a>");
bscNodeMap.put("DCRS (%)", "<a href=\"/VMSC2-Statistics/report/core/bsc/wk.htm?bscid=" + node + "&week=" + Integer.parseInt(week) +"&year=" + Integer.parseInt(year) + "#dcrs\">" + Helper.float2String(wkBscCore.getDcrs())
+ "%</a>");
bscNodeMap.put("DCRT (%)", "<a href=\"/VMSC2-Statistics/report/core/bsc/wk.htm?bscid=" + node + "&week=" + Integer.parseInt(week) +"&year=" + Integer.parseInt(year) + "#dcrt\">" + Helper.float2String(wkBscCore.getDcrt())
+ "%</a>");
bscNodeMap.put("TRAUCR (%)",
"<a href=\"/VMSC2-Statistics/report/core/bsc/wk.htm?bscid=" + node + "&week=" + Integer.parseInt(week) +"&year=" + Integer.parseInt(year) +"#traucr\">" + Helper.float2String(wkBscCore.getTraucr()) + "%</a>");
bscNodeMap.put("HSR (%)", "<a href=\"/VMSC2-Statistics/report/core/bsc/wk.htm?bscid=" + node + "&week=" + Integer.parseInt(week) +"&year=" + Integer.parseInt(year) + "#hsr\">" +Helper.float2String(wkBscCore.getHsr())
+ "%</a>");
return bscNodeMap;
}
}
| [
"trungnq@vhc.com.vn"
] | trungnq@vhc.com.vn |
b9ae8646e731c9410bacb767b55571eb330b134b | 5a25994a012f787fa4e2a72ba12c4640441fbc65 | /shop-api/src/test/java/shop/api/ShopApiApplicationTests.java | abbda0a9d67019e3e7fd83aba5534e7186c648c7 | [] | no_license | aodebiao/shop-project | a40c3ab6c93f171eccafae75248205067a4507ed | 0e58de8477e988f5168d11426a266556eb4481fe | refs/heads/master | 2023-03-11T18:30:06.914382 | 2021-03-05T00:46:15 | 2021-03-05T00:46:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 210 | java | package shop.api;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class ShopApiApplicationTests {
@Test
void contextLoads() {
}
}
| [
"582829957@qq.com"
] | 582829957@qq.com |
a97a0eec11dec84a07ead3483b091c60e46ed562 | 1c05cf4a86e7497ee7048339120ee76c1f7864a3 | /org.tgi.hmrc/src/org/tgi/model/SystemIDs_Tgi.java | 286b639f0bd8282bf3603afd0d9287b9dd86c8c2 | [] | no_license | a42niem/UK-VAT-Declaration | f038a28e67a761c42d13b64484ffa346b41e3e50 | b71267f120b00d0f38204e4be194c88aebfd0a6d | refs/heads/master | 2023-05-26T09:50:54.173000 | 2021-04-19T08:52:20 | 2021-04-19T08:52:20 | 242,127,170 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 121 | java | package org.tgi.model;
public class SystemIDs_Tgi {
public static final String XXR_VAT_RETURN_REFERENCE_ID = null;
}
| [
"d.niemeyer@action42.de"
] | d.niemeyer@action42.de |
8acd562a9248f8607eb5ba9725eac712b266cbd5 | d759c3dd56d7b86d6451299b2553fbdf23736248 | /src/mazerunner/Graphics/SpriteSheet.java | ac54512fef7a22742c14eb6dfc31a24b4c09bfd5 | [
"MIT"
] | permissive | wasif31/GameProject-250-Java-Maze-Runner | 9813173f3ed681de7612d0e21a781408123d6cca | bdb901b965185a171bba02665ae0cbef22c20404 | refs/heads/master | 2020-03-26T11:04:12.961255 | 2019-09-22T19:04:22 | 2019-09-22T19:04:22 | 144,826,650 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 336 | java |
package mazerunner.Graphics;
import java.awt.image.BufferedImage;
public class SpriteSheet {
public BufferedImage sheet;
public SpriteSheet(BufferedImage sheet) {
this.sheet=sheet;
}
public BufferedImage crop(int x,int y,int width,int height) {
return sheet.getSubimage(x, y, width, height);
}
}
| [
"42389076+wasif31@users.noreply.github.com"
] | 42389076+wasif31@users.noreply.github.com |
12ccd1411d43cc15dd61159cded82a3e8177c76d | 08278e121ff4322ab2f6164f54201839f301b190 | /src/test/java/utils/screenshot/ScreenshotListener.java | c64723a851dd1ce2e2a67805a9aa8f71cafb030e | [] | no_license | Exy0088/selenium_example | ff7337c6f53cf92f76ad1b63730ef6b3c74f19b7 | bed1eff11e7185c7ebd66635cee231e3b61d1b59 | refs/heads/master | 2020-03-24T06:39:00.473804 | 2018-08-09T05:08:16 | 2018-08-09T05:08:16 | 142,536,087 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,196 | java | package utils.screenshot;
import base.driver.BaseDriver;
import org.apache.velocity.runtime.directive.Foreach;
import org.openqa.selenium.WebDriver;
import org.testng.ITestResult;
import org.testng.TestListenerAdapter;
import test.CaseBase;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
/**
* Created by cdyoue on 2018/7/12.
*/
public class ScreenshotListener extends TestListenerAdapter {
private ScreenShot screenShot;
@Override
public void onTestFailure(ITestResult tr){
// BaseDriver driver = null;
// Object instance = tr.getInstance();
// Class<?> clazz = instance.getClass();
// try {
// Method method = clazz.getMethod("getDriver", null);
// driver = ( BaseDriver)method.invoke(instance, null);
// } catch (NoSuchMethodException e) {
// e.printStackTrace();
// } catch (IllegalAccessException e) {
// e.printStackTrace();
// } catch (InvocationTargetException e) {
// e.printStackTrace();
// }
// screenShot = new ScreenShot(driver);
// screenShot.takeScreenshot();
}
}
| [
"hezhaowei@youedata.com"
] | hezhaowei@youedata.com |
e35463adc425b1a93f577d1cb488d160a236d026 | d4d1bb87a2993759fbc3f308f30c0af023a4bb0a | /android/app/src/main/java/com/asksteve/MainApplication.java | ccb49d5cbfa6258470376292b9fb4c1254aeaa51 | [] | no_license | pjay79/asksteve | 9eaf0a639e30a3cdb46731e8d6544a93454f2dce | 4962e1acb0bb2bef4e36e3f78afc37c2b2a22eb7 | refs/heads/master | 2020-04-06T16:40:52.820026 | 2018-12-02T12:16:46 | 2018-12-02T12:16:46 | 157,629,700 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,413 | java | package com.asksteve;
import android.app.Application;
import com.facebook.react.ReactApplication;
import org.devio.rn.splashscreen.SplashScreenReactPackage;
import com.oblador.vectoricons.VectorIconsPackage;
import com.auth0.react.A0Auth0Package;
import com.lugg.ReactNativeConfig.ReactNativeConfigPackage;
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(),
new SplashScreenReactPackage(),
new VectorIconsPackage(),
new A0Auth0Package(),
new ReactNativeConfigPackage()
);
}
@Override
protected String getJSMainModuleName() {
return "index";
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
}
}
| [
"praveen.jayarajan@gmail.com"
] | praveen.jayarajan@gmail.com |
b2d32c1622e4d27604ee133d874003b2b80ac2f9 | e0ce65ca68416abe67d41f340e13d7d7dcec8e0f | /src/main/java/org/trypticon/luceneupgrader/lucene5/internal/lucene/codecs/lucene49/Lucene49DocValuesConsumer.java | 3ff5f1df230b2c12cb8ba9e358d59b69c9a99cf9 | [
"Apache-2.0"
] | permissive | arandomgal/lucene-one-stop-index-upgrader | 943264c22e6cadfef13116f41766f7d5fb2d3a7c | 4c8b35dcda9e57f0507de48d8519e9c31cb8efb6 | refs/heads/main | 2023-06-07T04:18:20.805332 | 2021-07-05T22:28:46 | 2021-07-05T22:28:46 | 383,277,257 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 16,956 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.trypticon.luceneupgrader.lucene5.internal.lucene.codecs.lucene49;
import java.io.Closeable; // javadocs
import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import org.trypticon.luceneupgrader.lucene5.internal.lucene.codecs.CodecUtil;
import org.trypticon.luceneupgrader.lucene5.internal.lucene.codecs.DocValuesConsumer;
import org.trypticon.luceneupgrader.lucene5.internal.lucene.index.DocValuesType;
import org.trypticon.luceneupgrader.lucene5.internal.lucene.index.FieldInfo;
import org.trypticon.luceneupgrader.lucene5.internal.lucene.index.IndexFileNames;
import org.trypticon.luceneupgrader.lucene5.internal.lucene.index.SegmentWriteState;
import org.trypticon.luceneupgrader.lucene5.internal.lucene.store.IndexOutput;
import org.trypticon.luceneupgrader.lucene5.internal.lucene.store.RAMOutputStream;
import org.trypticon.luceneupgrader.lucene5.internal.lucene.util.BytesRef;
import org.trypticon.luceneupgrader.lucene5.internal.lucene.util.BytesRefBuilder;
import org.trypticon.luceneupgrader.lucene5.internal.lucene.util.IOUtils;
import org.trypticon.luceneupgrader.lucene5.internal.lucene.util.MathUtil;
import org.trypticon.luceneupgrader.lucene5.internal.lucene.util.StringHelper;
import org.trypticon.luceneupgrader.lucene5.internal.lucene.util.packed.DirectWriter;
import org.trypticon.luceneupgrader.lucene5.internal.lucene.util.packed.MonotonicBlockPackedWriter;
import org.trypticon.luceneupgrader.lucene5.internal.lucene.util.packed.PackedInts;
@Deprecated
class Lucene49DocValuesConsumer extends DocValuesConsumer implements Closeable {
static final int BLOCK_SIZE = 16384;
static final int ADDRESS_INTERVAL = 16;
public static final int DELTA_COMPRESSED = 0;
public static final int GCD_COMPRESSED = 1;
public static final int TABLE_COMPRESSED = 2;
public static final int MONOTONIC_COMPRESSED = 3;
public static final int BINARY_FIXED_UNCOMPRESSED = 0;
public static final int BINARY_VARIABLE_UNCOMPRESSED = 1;
public static final int BINARY_PREFIX_COMPRESSED = 2;
public static final int SORTED_WITH_ADDRESSES = 0;
public static final int SORTED_SINGLE_VALUED = 1;
IndexOutput data, meta;
final int maxDoc;
public Lucene49DocValuesConsumer(SegmentWriteState state, String dataCodec, String dataExtension, String metaCodec, String metaExtension) throws IOException {
boolean success = false;
try {
String dataName = IndexFileNames.segmentFileName(state.segmentInfo.name, state.segmentSuffix, dataExtension);
data = state.directory.createOutput(dataName, state.context);
CodecUtil.writeHeader(data, dataCodec, Lucene49DocValuesFormat.VERSION_CURRENT);
String metaName = IndexFileNames.segmentFileName(state.segmentInfo.name, state.segmentSuffix, metaExtension);
meta = state.directory.createOutput(metaName, state.context);
CodecUtil.writeHeader(meta, metaCodec, Lucene49DocValuesFormat.VERSION_CURRENT);
maxDoc = state.segmentInfo.maxDoc();
success = true;
} finally {
if (!success) {
IOUtils.closeWhileHandlingException(this);
}
}
}
@Override
public void addNumericField(FieldInfo field, Iterable<Number> values) throws IOException {
checkCanWrite(field);
addNumericField(field, values, true);
}
void addNumericField(FieldInfo field, Iterable<Number> values, boolean optimizeStorage) throws IOException {
long count = 0;
long minValue = Long.MAX_VALUE;
long maxValue = Long.MIN_VALUE;
long gcd = 0;
boolean missing = false;
// TODO: more efficient?
HashSet<Long> uniqueValues = null;
if (optimizeStorage) {
uniqueValues = new HashSet<>();
for (Number nv : values) {
final long v;
if (nv == null) {
v = 0;
missing = true;
} else {
v = nv.longValue();
}
if (gcd != 1) {
if (v < Long.MIN_VALUE / 2 || v > Long.MAX_VALUE / 2) {
// in that case v - minValue might overflow and make the GCD computation return
// wrong results. Since these extreme values are unlikely, we just discard
// GCD computation for them
gcd = 1;
} else if (count != 0) { // minValue needs to be set first
gcd = MathUtil.gcd(gcd, v - minValue);
}
}
minValue = Math.min(minValue, v);
maxValue = Math.max(maxValue, v);
if (uniqueValues != null) {
if (uniqueValues.add(v)) {
if (uniqueValues.size() > 256) {
uniqueValues = null;
}
}
}
++count;
}
} else {
for (Number nv : values) {
long v = nv.longValue();
minValue = Math.min(minValue, v);
maxValue = Math.max(maxValue, v);
++count;
}
}
final long delta = maxValue - minValue;
final int deltaBitsRequired = DirectWriter.unsignedBitsRequired(delta);
final int tableBitsRequired = uniqueValues == null
? Integer.MAX_VALUE
: DirectWriter.bitsRequired(uniqueValues.size() - 1);
final int format;
if (uniqueValues != null && tableBitsRequired < deltaBitsRequired) {
format = TABLE_COMPRESSED;
} else if (gcd != 0 && gcd != 1) {
final long gcdDelta = (maxValue - minValue) / gcd;
final long gcdBitsRequired = DirectWriter.unsignedBitsRequired(gcdDelta);
format = gcdBitsRequired < deltaBitsRequired ? GCD_COMPRESSED : DELTA_COMPRESSED;
} else {
format = DELTA_COMPRESSED;
}
meta.writeVInt(field.number);
meta.writeByte(Lucene49DocValuesFormat.NUMERIC);
meta.writeVInt(format);
if (missing) {
meta.writeLong(data.getFilePointer());
writeMissingBitset(values);
} else {
meta.writeLong(-1L);
}
meta.writeLong(data.getFilePointer());
meta.writeVLong(count);
switch (format) {
case GCD_COMPRESSED:
meta.writeLong(minValue);
meta.writeLong(gcd);
final long maxDelta = (maxValue - minValue) / gcd;
final int bits = DirectWriter.unsignedBitsRequired(maxDelta);
meta.writeVInt(bits);
final DirectWriter quotientWriter = DirectWriter.getInstance(data, count, bits);
for (Number nv : values) {
long value = nv == null ? 0 : nv.longValue();
quotientWriter.add((value - minValue) / gcd);
}
quotientWriter.finish();
break;
case DELTA_COMPRESSED:
final long minDelta = delta < 0 ? 0 : minValue;
meta.writeLong(minDelta);
meta.writeVInt(deltaBitsRequired);
final DirectWriter writer = DirectWriter.getInstance(data, count, deltaBitsRequired);
for (Number nv : values) {
long v = nv == null ? 0 : nv.longValue();
writer.add(v - minDelta);
}
writer.finish();
break;
case TABLE_COMPRESSED:
final Long[] decode = uniqueValues.toArray(new Long[uniqueValues.size()]);
Arrays.sort(decode);
final HashMap<Long,Integer> encode = new HashMap<>();
meta.writeVInt(decode.length);
for (int i = 0; i < decode.length; i++) {
meta.writeLong(decode[i]);
encode.put(decode[i], i);
}
meta.writeVInt(tableBitsRequired);
final DirectWriter ordsWriter = DirectWriter.getInstance(data, count, tableBitsRequired);
for (Number nv : values) {
ordsWriter.add(encode.get(nv == null ? 0 : nv.longValue()));
}
ordsWriter.finish();
break;
default:
throw new AssertionError();
}
meta.writeLong(data.getFilePointer());
}
// TODO: in some cases representing missing with minValue-1 wouldn't take up additional space and so on,
// but this is very simple, and algorithms only check this for values of 0 anyway (doesnt slow down normal decode)
void writeMissingBitset(Iterable<?> values) throws IOException {
byte bits = 0;
int count = 0;
for (Object v : values) {
if (count == 8) {
data.writeByte(bits);
count = 0;
bits = 0;
}
if (v != null) {
bits |= 1 << (count & 7);
}
count++;
}
if (count > 0) {
data.writeByte(bits);
}
}
@Override
public void addBinaryField(FieldInfo field, Iterable<BytesRef> values) throws IOException {
checkCanWrite(field);
// write the byte[] data
meta.writeVInt(field.number);
meta.writeByte(Lucene49DocValuesFormat.BINARY);
int minLength = Integer.MAX_VALUE;
int maxLength = Integer.MIN_VALUE;
final long startFP = data.getFilePointer();
long count = 0;
boolean missing = false;
for(BytesRef v : values) {
final int length;
if (v == null) {
length = 0;
missing = true;
} else {
length = v.length;
}
minLength = Math.min(minLength, length);
maxLength = Math.max(maxLength, length);
if (v != null) {
data.writeBytes(v.bytes, v.offset, v.length);
}
count++;
}
meta.writeVInt(minLength == maxLength ? BINARY_FIXED_UNCOMPRESSED : BINARY_VARIABLE_UNCOMPRESSED);
if (missing) {
meta.writeLong(data.getFilePointer());
writeMissingBitset(values);
} else {
meta.writeLong(-1L);
}
meta.writeVInt(minLength);
meta.writeVInt(maxLength);
meta.writeVLong(count);
meta.writeLong(startFP);
// if minLength == maxLength, its a fixed-length byte[], we are done (the addresses are implicit)
// otherwise, we need to record the length fields...
if (minLength != maxLength) {
meta.writeLong(data.getFilePointer());
meta.writeVInt(PackedInts.VERSION_CURRENT);
meta.writeVInt(BLOCK_SIZE);
final MonotonicBlockPackedWriter writer = new MonotonicBlockPackedWriter(data, BLOCK_SIZE);
long addr = 0;
writer.add(addr);
for (BytesRef v : values) {
if (v != null) {
addr += v.length;
}
writer.add(addr);
}
writer.finish();
}
}
private void addTermsDict(FieldInfo field, final Iterable<BytesRef> values) throws IOException {
// first check if its a "fixed-length" terms dict
int minLength = Integer.MAX_VALUE;
int maxLength = Integer.MIN_VALUE;
for (BytesRef v : values) {
minLength = Math.min(minLength, v.length);
maxLength = Math.max(maxLength, v.length);
}
if (minLength == maxLength) {
// no index needed: direct addressing by mult
addBinaryField(field, values);
} else {
// header
meta.writeVInt(field.number);
meta.writeByte(Lucene49DocValuesFormat.BINARY);
meta.writeVInt(BINARY_PREFIX_COMPRESSED);
meta.writeLong(-1L);
// now write the bytes: sharing prefixes within a block
final long startFP = data.getFilePointer();
// currently, we have to store the delta from expected for every 1/nth term
// we could avoid this, but its not much and less overall RAM than the previous approach!
RAMOutputStream addressBuffer = new RAMOutputStream();
MonotonicBlockPackedWriter termAddresses = new MonotonicBlockPackedWriter(addressBuffer, BLOCK_SIZE);
BytesRefBuilder lastTerm = new BytesRefBuilder();
lastTerm.grow(Math.max(0, maxLength));
long count = 0;
for (BytesRef v : values) {
if (count % ADDRESS_INTERVAL == 0) {
termAddresses.add(data.getFilePointer() - startFP);
// force the first term in a block to be abs-encoded
lastTerm.clear();
}
// prefix-code
int sharedPrefix = StringHelper.bytesDifference(lastTerm.get(), v);
data.writeVInt(sharedPrefix);
data.writeVInt(v.length - sharedPrefix);
data.writeBytes(v.bytes, v.offset + sharedPrefix, v.length - sharedPrefix);
lastTerm.copyBytes(v);
count++;
}
final long indexStartFP = data.getFilePointer();
// write addresses of indexed terms
termAddresses.finish();
addressBuffer.writeTo(data);
addressBuffer = null;
termAddresses = null;
meta.writeVInt(minLength);
meta.writeVInt(maxLength);
meta.writeVLong(count);
meta.writeLong(startFP);
meta.writeVInt(ADDRESS_INTERVAL);
meta.writeLong(indexStartFP);
meta.writeVInt(PackedInts.VERSION_CURRENT);
meta.writeVInt(BLOCK_SIZE);
}
}
@Override
public void addSortedField(FieldInfo field, Iterable<BytesRef> values, Iterable<Number> docToOrd) throws IOException {
checkCanWrite(field);
meta.writeVInt(field.number);
meta.writeByte(Lucene49DocValuesFormat.SORTED);
addTermsDict(field, values);
addNumericField(field, docToOrd, false);
}
@Override
public void addSortedNumericField(FieldInfo field, final Iterable<Number> docToValueCount, final Iterable<Number> values) throws IOException {
checkCanWrite(field);
meta.writeVInt(field.number);
meta.writeByte(Lucene49DocValuesFormat.SORTED_NUMERIC);
if (isSingleValued(docToValueCount)) {
meta.writeVInt(SORTED_SINGLE_VALUED);
// The field is single-valued, we can encode it as NUMERIC
addNumericField(field, singletonView(docToValueCount, values, null));
} else {
meta.writeVInt(SORTED_WITH_ADDRESSES);
// write the stream of values as a numeric field
addNumericField(field, values, true);
// write the doc -> ord count as a absolute index to the stream
addAddresses(field, docToValueCount);
}
}
@Override
public void addSortedSetField(FieldInfo field, Iterable<BytesRef> values, final Iterable<Number> docToOrdCount, final Iterable<Number> ords) throws IOException {
checkCanWrite(field);
meta.writeVInt(field.number);
meta.writeByte(Lucene49DocValuesFormat.SORTED_SET);
if (isSingleValued(docToOrdCount)) {
meta.writeVInt(SORTED_SINGLE_VALUED);
// The field is single-valued, we can encode it as SORTED
addSortedField(field, values, singletonView(docToOrdCount, ords, -1L));
} else {
meta.writeVInt(SORTED_WITH_ADDRESSES);
// write the ord -> byte[] as a binary field
addTermsDict(field, values);
// write the stream of ords as a numeric field
// NOTE: we could return an iterator that delta-encodes these within a doc
addNumericField(field, ords, false);
// write the doc -> ord count as a absolute index to the stream
addAddresses(field, docToOrdCount);
}
}
// writes addressing information as MONOTONIC_COMPRESSED integer
private void addAddresses(FieldInfo field, Iterable<Number> values) throws IOException {
meta.writeVInt(field.number);
meta.writeByte(Lucene49DocValuesFormat.NUMERIC);
meta.writeVInt(MONOTONIC_COMPRESSED);
meta.writeLong(-1L);
meta.writeLong(data.getFilePointer());
meta.writeVLong(maxDoc);
meta.writeVInt(PackedInts.VERSION_CURRENT);
meta.writeVInt(BLOCK_SIZE);
final MonotonicBlockPackedWriter writer = new MonotonicBlockPackedWriter(data, BLOCK_SIZE);
long addr = 0;
writer.add(addr);
for (Number v : values) {
addr += v.longValue();
writer.add(addr);
}
writer.finish();
meta.writeLong(data.getFilePointer());
}
@Override
public void close() throws IOException {
boolean success = false;
try {
if (meta != null) {
meta.writeVInt(-1); // write EOF marker
CodecUtil.writeFooter(meta); // write checksum
}
if (data != null) {
CodecUtil.writeFooter(data); // write checksum
}
success = true;
} finally {
if (success) {
IOUtils.close(data, meta);
} else {
IOUtils.closeWhileHandlingException(data, meta);
}
meta = data = null;
}
}
void checkCanWrite(FieldInfo field) {
if ((field.getDocValuesType() == DocValuesType.NUMERIC ||
field.getDocValuesType() == DocValuesType.BINARY) &&
field.getDocValuesGen() != -1) {
// ok
} else {
throw new UnsupportedOperationException("this codec can only be used for reading");
}
}
}
| [
"ying.andrews@gmail.com"
] | ying.andrews@gmail.com |
3b035a99b582ad4a267ed46d177fd693f384e88a | ffd10d96cff7c7f09131dec750c3cb7d2d4ce30a | /jpf-regression-modified/ExSymExeSimple_true/Main.java | 4853e348623b746b707fe571c322861a4ecd8707 | [] | no_license | seemantasaha/testing-difficulty-assesment-sv-comp | 6694f40707ef3f73c98616647d8b97f2d5027273 | 70a6b13c01f3e61018bd402a8dce1e0e1d106777 | refs/heads/master | 2020-12-21T04:10:44.308849 | 2020-05-09T10:09:53 | 2020-05-09T10:09:53 | 236,301,353 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 405 | java | public class Main {
public static void testOrig(int a, int b) {
if (a > b) {
assert false;
System.out.println(">");
} else if (a == b)
System.out.println("eq");
else
System.out.println("<");
}
public static void test(int arg) {
if (arg >= 2147483647)
return;
testOrig(arg, arg + 1);
}
public static void main(String[] args) {
test(5);
}
}
| [
"seemantasaha@cs.ucsb.edu"
] | seemantasaha@cs.ucsb.edu |
905d386f8df77df5de57488779160ffa009194aa | 1bb6a868a7d7f02130b6f77427995d31a59264fe | /app/src/main/java/com/example/instagramclone/model/PixaBayPost.java | fdf3a6b168fffea8b3d56bd6b24e74b8d5e5d260 | [] | no_license | ndadashi62/InstagramClone | 8f10da9db6d0c4fe39d0a7cca4b83a6f6d1851b9 | 395b0d65f44800368d088b2c6e24de26fa734a37 | refs/heads/main | 2023-03-02T08:13:58.626400 | 2021-02-08T17:30:37 | 2021-02-08T17:30:37 | 337,153,338 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,990 | java | package com.example.instagramclone.model;
import com.google.gson.annotations.SerializedName;
public class PixaBayPost {
private int id;
private String webformatURL;
@SerializedName("user")
private String userName;
private String tags;
private int likes;
private int views;
private int comments;
private String userImageURL ;
@Override
public String toString() {
return "PixaBayPost{" +
"id=" + id +
", webformatURL='" + webformatURL + '\'' +
", userName='" + userName + '\'' +
", tags='" + tags + '\'' +
", likes=" + likes +
", views=" + views +
", comments=" + comments +
", userImageURL='" + userImageURL + '\'' +
'}';
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getWebformatURL() {
return webformatURL;
}
public void setWebformatURL(String webformatURL) {
this.webformatURL = webformatURL;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getTags() {
return tags;
}
public void setTags(String tags) {
this.tags = tags;
}
public int getLikes() {
return likes;
}
public void setLikes(int likes) {
this.likes = likes;
}
public int getViews() {
return views;
}
public void setViews(int views) {
this.views = views;
}
public int getComments() {
return comments;
}
public void setComments(int comments) {
this.comments = comments;
}
public String getUserImageURL() {
return userImageURL;
}
public void setUserImageURL(String userImageURL) {
this.userImageURL = userImageURL;
}
}
| [
"nasim.dadashi@gmail.com"
] | nasim.dadashi@gmail.com |
c1c02cbf724255e1110347764ecde4ba0b07b9f1 | 0c0bc6839b288b1207cde448db02ca3c48e96697 | /mekon-user/src/uk/ac/manchester/cs/mekon/user/app/InstanceDisplayModeSelector.java | 3b89a643d9ecdfd6e5e8223395e88c1b690f32dc | [
"MIT"
] | permissive | colin-puleston/mekon-hobo | 00781978042ef101b8275e4e7a6197cdd7db3003 | 1350e5393cae63c1be93233dcf438ea8f65bcce3 | refs/heads/master | 2023-06-11T08:49:14.268499 | 2023-05-31T16:42:54 | 2023-05-31T16:42:54 | 36,007,660 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,825 | java | /*
* The MIT License (MIT)
*
* Copyright (c) 2019 University of Manchester
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files the "Software", to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package uk.ac.manchester.cs.mekon.user.app;
import java.util.*;
import java.awt.event.*;
import javax.swing.*;
/**
* @author Colin Puleston
*/
abstract class InstanceDisplayModeSelector extends JPanel {
static private final long serialVersionUID = -1;
static private final Map<InstanceDisplayMode, String> MODE_LABELS
= new HashMap<InstanceDisplayMode, String>();
static {
MODE_LABELS.put(InstanceDisplayMode.EDIT, "Edit");
MODE_LABELS.put(InstanceDisplayMode.VIEW, "View");
MODE_LABELS.put(InstanceDisplayMode.SEMANTICS, "Semantic view");
}
private InstanceTree instanceTree;
private ModeButton selected = null;
private class ModeButton extends JRadioButton implements ActionListener {
static private final long serialVersionUID = -1;
private InstanceDisplayMode mode;
public void actionPerformed(ActionEvent e) {
if (isSelected()) {
instanceTree.setDisplayMode(mode);
selected.setSelected(false);
selected = this;
onModeUpdate();
}
else {
setSelected(true);
}
}
ModeButton(InstanceDisplayMode mode) {
super(MODE_LABELS.get(mode), startMode(mode));
this.mode = mode;
addActionListener(this);
if (startMode(mode)) {
selected = this;
}
InstanceDisplayModeSelector.this.add(this);
}
}
InstanceDisplayModeSelector(
InstanceTree instanceTree,
List<InstanceDisplayMode> selectableModes) {
this.instanceTree = instanceTree;
for (InstanceDisplayMode mode : selectableModes) {
new ModeButton(mode);
}
}
abstract void onModeUpdate();
private boolean startMode(InstanceDisplayMode mode) {
return mode == instanceTree.getDisplayMode();
}
}
| [
"colins.email@virgin.net"
] | colins.email@virgin.net |
256c9fe63d81bc4328caf470e20005c2441efffa | 1ec1b469036041936068dc18ee9218eb12601aa2 | /Tema 1/Ejercicio04.java | aa320378f87506d54ab4a359bb12878a4a73a6ba | [] | no_license | christianraulamo/ejercicio-programacion | 340c9ae39b9c92acd894567e4fe4b4a6d0113b3e | a42f487a7235f57e2a9144e146dc785a2d03208f | refs/heads/master | 2021-09-15T08:28:28.878707 | 2018-05-29T08:05:02 | 2018-05-29T08:05:02 | 105,648,672 | 6 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,093 | java | /**
* Ejercicio04
*
* @author Christian Amo
*/
public class Ejercicio04 {// Clase principal
public static void main(String[] args) {
System.out.println("Lunes Martes Miercoles jueves Viernes");
System.out.println("-----------------------------------------------------------------------");
System.out.printf("%-10s %-10s %-10s %-10s %-10s\n", "Progr", "Siste", "Progr", "Entor", "Siste");
System.out.printf("%-10s %-10s %-10s %-10s %-10s\n", "Progr", "Siste", "Progr", "Entor", "Siste");
System.out.printf("%-10s %-10s %-10s %-10s %-10s\n", "Progr", "Siste", "Progr", "Entor", "Siste");
System.out.printf("%-10s %-10s %-10s %-10s %-10s\n", "Bases", "Lengu", "Bases", "Lengu", "Forma");
System.out.printf("%-10s %-10s %-10s %-10s %-10s\n", "Bases", "Progr", "Bases", "Lengu", "Forma");
System.out.printf("%-10s %-10s %-10s %-10s %-10s\n", "Bases", "Progr", "Bases", "Lengu", "Forma");
}
}
| [
"christianraulamo24@gmail.com"
] | christianraulamo24@gmail.com |
e36587a8427f682e758efaa08ee4f08619fdca34 | cc3b3a92af34c479bb3080574b8b252db49cd8f4 | /src/main/java/fr/perioline/web/rest/PractitionerResource.java | b8ede14e55fc872e230d7038c215b7f73ebf0372 | [] | no_license | hchalouati/perioline | c03db65bb9a99558e4c9099b843df548abef34e7 | 1f342460a9b771ac20c240010c02d703c0747c6c | refs/heads/master | 2020-03-26T22:13:23.944996 | 2018-08-20T16:22:01 | 2018-08-20T16:22:01 | 145,441,994 | 0 | 1 | null | 2018-08-20T16:18:36 | 2018-08-20T16:17:03 | Java | UTF-8 | Java | false | false | 5,331 | java | package fr.perioline.web.rest;
import com.codahale.metrics.annotation.Timed;
import fr.perioline.domain.Practitioner;
import fr.perioline.service.PractitionerService;
import fr.perioline.web.rest.errors.BadRequestAlertException;
import fr.perioline.web.rest.util.HeaderUtil;
import fr.perioline.web.rest.util.PaginationUtil;
import io.github.jhipster.web.util.ResponseUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;
import java.util.Optional;
/**
* REST controller for managing Practitioner.
*/
@RestController
@RequestMapping("/api")
public class PractitionerResource {
private final Logger log = LoggerFactory.getLogger(PractitionerResource.class);
private static final String ENTITY_NAME = "practitioner";
private final PractitionerService practitionerService;
public PractitionerResource(PractitionerService practitionerService) {
this.practitionerService = practitionerService;
}
/**
* POST /practitioners : Create a new practitioner.
*
* @param practitioner the practitioner to create
* @return the ResponseEntity with status 201 (Created) and with body the new practitioner, or with status 400 (Bad Request) if the practitioner has already an ID
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PostMapping("/practitioners")
@Timed
public ResponseEntity<Practitioner> createPractitioner(@RequestBody Practitioner practitioner) throws URISyntaxException {
log.debug("REST request to save Practitioner : {}", practitioner);
if (practitioner.getId() != null) {
throw new BadRequestAlertException("A new practitioner cannot already have an ID", ENTITY_NAME, "idexists");
}
Practitioner result = practitionerService.save(practitioner);
return ResponseEntity.created(new URI("/api/practitioners/" + result.getId()))
.headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString()))
.body(result);
}
/**
* PUT /practitioners : Updates an existing practitioner.
*
* @param practitioner the practitioner to update
* @return the ResponseEntity with status 200 (OK) and with body the updated practitioner,
* or with status 400 (Bad Request) if the practitioner is not valid,
* or with status 500 (Internal Server Error) if the practitioner couldn't be updated
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PutMapping("/practitioners")
@Timed
public ResponseEntity<Practitioner> updatePractitioner(@RequestBody Practitioner practitioner) throws URISyntaxException {
log.debug("REST request to update Practitioner : {}", practitioner);
if (practitioner.getId() == null) {
throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
}
Practitioner result = practitionerService.save(practitioner);
return ResponseEntity.ok()
.headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, practitioner.getId().toString()))
.body(result);
}
/**
* GET /practitioners : get all the practitioners.
*
* @param pageable the pagination information
* @return the ResponseEntity with status 200 (OK) and the list of practitioners in body
*/
@GetMapping("/practitioners")
@Timed
public ResponseEntity<List<Practitioner>> getAllPractitioners(Pageable pageable) {
log.debug("REST request to get a page of Practitioners");
Page<Practitioner> page = practitionerService.findAll(pageable);
HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, "/api/practitioners");
return new ResponseEntity<>(page.getContent(), headers, HttpStatus.OK);
}
/**
* GET /practitioners/:id : get the "id" practitioner.
*
* @param id the id of the practitioner to retrieve
* @return the ResponseEntity with status 200 (OK) and with body the practitioner, or with status 404 (Not Found)
*/
@GetMapping("/practitioners/{id}")
@Timed
public ResponseEntity<Practitioner> getPractitioner(@PathVariable Long id) {
log.debug("REST request to get Practitioner : {}", id);
Optional<Practitioner> practitioner = practitionerService.findOne(id);
return ResponseUtil.wrapOrNotFound(practitioner);
}
/**
* DELETE /practitioners/:id : delete the "id" practitioner.
*
* @param id the id of the practitioner to delete
* @return the ResponseEntity with status 200 (OK)
*/
@DeleteMapping("/practitioners/{id}")
@Timed
public ResponseEntity<Void> deletePractitioner(@PathVariable Long id) {
log.debug("REST request to delete Practitioner : {}", id);
practitionerService.delete(id);
return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build();
}
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
475397ddb178fd44513bbe6549ee0f16a9970d0b | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/XWIKI-13096-2-3-FEMO-WeightedSum:TestLen:CallDiversity/com/xpn/xwiki/web/DownloadAction_ESTest.java | deb9d060089d5906c8e2049bd5d288fbcecfa3bc | [] | no_license | STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application | cf118b23ecb87a8bf59643e42f7556b521d1f754 | 3bb39683f9c343b8ec94890a00b8f260d158dfe3 | refs/heads/master | 2022-07-29T14:44:00.774547 | 2020-08-10T15:14:49 | 2020-08-10T15:14:49 | 285,804,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 552 | java | /*
* This file was automatically generated by EvoSuite
* Fri Apr 03 20:42:50 UTC 2020
*/
package com.xpn.xwiki.web;
import org.junit.Test;
import static org.junit.Assert.*;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true)
public class DownloadAction_ESTest extends DownloadAction_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
2dcf389e44b97eacb76b665b211f347f07269e66 | bbb5e6de47ecd22bdd568911586749156f26f91d | /lib-permission/src/main/java/com/dn/sj/lib_permission/menu/OPPO.java | 58af18ef5b9bdd79f9e1fff9d26ac147dbde8b12 | [] | no_license | s961784535/IPermission | 1dd09c041d81820be953684c90c5a8260051de92 | 946c000dc075f441e2d6e4e98e3aba8c53cfb34a | refs/heads/master | 2021-09-17T15:40:06.239786 | 2018-07-03T09:58:15 | 2018-07-03T09:58:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 682 | java | package com.dn.sj.lib_permission.menu;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.provider.Settings;
import com.dn.sj.lib_permission.menu.base.IMenu;
/**
* @date 创建时间:2018/4/18
* @description oppo 手机跳转到设置
*/
public class OPPO implements IMenu {
@Override
public Intent getMenuIntent(Context context) {
Intent intent = new Intent();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
intent.setData(Uri.fromParts("package", context.getPackageName(), null));
return intent;
}
}
| [
"961784535@qq.com"
] | 961784535@qq.com |
f7c82c6040f3e6769e16d9e3f368298ce9a4362f | 7ec1bde6754b9f7a6fae1826599797d7f95b8bda | /src/main/java/cn/com/dubbo/mapper/Employee666Mapper.java | bec460af0d22a07a780a363147517119361d2017 | [] | no_license | suxuehui/oms-provider | c28f0c172e691cf47f83e0b2013331affd8b32a0 | 0d39e9c50ceada109ba44683c7585ee523ba1dec | refs/heads/master | 2020-03-26T04:51:33.268173 | 2018-02-11T01:50:20 | 2018-02-11T01:50:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 682 | java | package cn.com.dubbo.mapper;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import cn.com.dubbo.base.BaseMapper;
import cn.com.dubbo.model.Employee;
//
//@Repository
//public interface Employee666Mapper extends BaseMapper<Employee, Integer>{
//
// Employee login(Employee emp);
//}
@Repository
//@Transactional
public interface Employee666Mapper extends BaseDaoMapper<Employee> {
Employee login666(Employee emp);
public void insertSelective666(Employee emp);
public void insertSelective777(Employee emp);
public void insertSelective888(Employee emp);
} | [
"qiechangsheng@huimin100.cn"
] | qiechangsheng@huimin100.cn |
63217575c5673e7979ae5ef879d48d4a5753b07c | 20552cae16ac9017a3cd65ebe163dcdff1497fed | /src/main/java/TutoIntegre2/Tuto2/CodeMort.java | beb81cca365177ea2751e4539feb7f6f3cd80b19 | [] | no_license | LucB77/GenieLogiciel | 30b8446e9c3ec4367b661912b5bc3668ac651e2a | 62c1648d5893441a37beec61467e67a17e041a97 | refs/heads/master | 2021-06-18T04:24:51.054724 | 2016-11-18T14:20:27 | 2016-11-18T14:20:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 108 | java | package TutoIntegre2.Tuto2;
public class CodeMort {
public String mort;
public void mort(){
}
}
| [
"luc0152@0.51.81.50"
] | luc0152@0.51.81.50 |
bca0c1dc9d520faa207dbcf0a7a2c325bd19dd79 | 6b2a8dd202fdce77c971c412717e305e1caaac51 | /solutions_5631989306621952_1/java/enosair/A.java | 6d39f867a68ac763c642ed9612b9373bf2e0c54d | [] | no_license | alexandraback/datacollection | 0bc67a9ace00abbc843f4912562f3a064992e0e9 | 076a7bc7693f3abf07bfdbdac838cb4ef65ccfcf | refs/heads/master | 2021-01-24T18:27:24.417992 | 2017-05-23T09:23:38 | 2017-05-23T09:23:38 | 84,313,442 | 2 | 4 | null | null | null | null | UTF-8 | Java | false | false | 1,005 | java | import java.io.*;
import java.util.Scanner;
public class A {
public static void main(String [] args) throws IOException {
//Scanner s = new Scanner(new BufferedReader(new FileReader("A-small-attempt0.in")));
Scanner s = new Scanner(new BufferedReader(new FileReader("A-large.in")));
// Scanner s = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
int ncase = s.nextInt();
for (int i = 1; i <= ncase; i++) {
String str = s.next();
System.out.printf("Case #%d: %s\n", i, solve(str));
}
s.close();
}
public static String solve(String S) {
if ( S.length() == 1 ) return S;
String rv = Character.toString( S.charAt(0) );
for (int i = 1; i < S.length(); i++) {
if ( S.charAt(i) >= rv.charAt(0) )
rv = S.charAt(i) + rv;
else
rv += S.charAt(i);
}
return rv;
}
}
| [
"alexandra1.back@gmail.com"
] | alexandra1.back@gmail.com |
bbaa2df645637b849a59e9abf4a2814fbf8897e9 | b4e65cf070e930c7839a01d03198961959514ac8 | /ClassClientProject/src/com/luciocossio/classclient/activities/BaseClientActivity.java | f8e308e864af089806a6bee596e9d196d5a8beed | [] | no_license | LucioC/class_share_client | 23c92b86de3c6283a780bcb0e269c0e62016e170 | caef15f84bffcc4a9ae57d7ddba4ea6d77be8842 | refs/heads/master | 2016-09-06T02:20:31.663685 | 2014-03-16T21:01:46 | 2014-03-16T21:01:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,100 | java | package com.luciocossio.classclient.activities;
import com.luciocossio.classclient.PresentationClient;
import com.luciocossio.classclient.http.RESTApacheClient;
import com.luciocossio.classclient.http.RESTJsonClient;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.view.Window;
public class BaseClientActivity extends Activity {
protected ProgressDialog dialog;
protected PresentationClient presentationClient;
protected String serverUrl;
public BaseClientActivity() {
super();
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
Intent intent = getIntent();
serverUrl = intent.getStringExtra(CommonVariables.ServerAddress);
dialog = new ProgressDialog(this);
initializePresentationClient();
}
protected void initializePresentationClient() {
RESTJsonClient jsonClient = new RESTApacheClient();
presentationClient = new PresentationClient(jsonClient, serverUrl);
}
} | [
"lucio.cossio@gmail.com"
] | lucio.cossio@gmail.com |
1a4eced8fb1bc2c2b0b0a25013250eee2d1a63f6 | da57c6194565f06ca66ed49077658ea00b56e0c0 | /cms-admin/src/main/java/com/ai/cms/live/controller/ScheduleImportUpdateController.java | b0a70e66d73882160aefb2e065480f0a61e2e139 | [] | no_license | lengweiping1983/ai-cms | 78d1020088566d89a4fc3004874e2a0ae5e91d21 | a45fbecec12886467b49045ac80c6027a409f82d | refs/heads/master | 2020-03-09T23:23:11.149563 | 2018-05-03T04:38:02 | 2018-05-03T04:38:02 | 129,056,910 | 3 | 4 | null | null | null | null | UTF-8 | Java | false | false | 4,285 | java | package com.ai.cms.live.controller;
import com.ai.AdminGlobal;
import com.ai.cms.config.entity.Cp;
import com.ai.cms.config.repository.CpRepository;
import com.ai.cms.live.entity.ScheduleImportUpdate;
import com.ai.cms.live.entity.ScheduleImportUpdateLog;
import com.ai.cms.live.repository.ScheduleImportUpdateRepository;
import com.ai.cms.live.service.ScheduleImportUpdateService;
import com.ai.common.bean.BaseResult;
import com.ai.common.bean.PageInfo;
import com.ai.common.controller.AbstractImageController;
import com.ai.common.enums.MediaImportTypeEnum;
import com.ai.common.enums.ItemTypeEnum;
import com.ai.common.enums.YesNoEnum;
import com.ai.common.excel.ImportExcel;
import com.ai.common.exception.ServiceException;
import com.ai.common.jpa.PropertyFilter;
import com.ai.common.jpa.SpecificationUtils;
import com.ai.env.handler.OperationLogAnnotation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
@Controller
@RequestMapping(value = {"/scheduleimport/scheduleImportUpdate"})
public class ScheduleImportUpdateController extends AbstractImageController {
@Autowired
private CpRepository cpRepository;
@Autowired
private ScheduleImportUpdateRepository scheduleRepository;
@Autowired
private ScheduleImportUpdateService scheduleImportUpdateService;
@RequestMapping(value = {""})
public String list(Model model, HttpServletRequest request,
PageInfo pageInfo) {
if (StringUtils.isEmpty(pageInfo.getOrder())) {
pageInfo.setOrder("-createTime");
}
List<PropertyFilter> filters = getPropertyFilters(request);
PropertyFilter pf = new PropertyFilter("siteCode__EQ_S",
AdminGlobal.getSiteCode());
filters.add(pf);
Specification<ScheduleImportUpdate> specification = SpecificationUtils
.getSpecification(filters);
Page<ScheduleImportUpdate> page = find(specification, pageInfo,
scheduleRepository);
model.addAttribute("page", page);
List<Cp> cpList = cpRepository.findAll();
model.addAttribute("cpList", cpList);
model.addAttribute("typeEnum", MediaImportTypeEnum.values());
model.addAttribute("yesNoEnum", YesNoEnum.values());
return "scheduleimport/scheduleImportUpdate/list";
}
@RequestMapping(value = {"import/{type}"}, method = RequestMethod.GET)
public String toImport(Model model, @PathVariable("type") Integer type) {
ScheduleImportUpdate scheduleImportUpdate = new ScheduleImportUpdate();
model.addAttribute("scheduleImportUpdate", scheduleImportUpdate);
model.addAttribute("yesNoEnum", YesNoEnum.values());
return "scheduleimport/scheduleImportUpdate/edit";
}
@OperationLogAnnotation(module = "直播管理", subModule = "导入节目单", action = "增加", message = "增加节目单")
@RequestMapping(value = {"import"}, method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
@ResponseBody
public BaseResult importProgram(MultipartFile file,
ScheduleImportUpdate scheduleImportUpdate) {
try {
String fileName = file.getOriginalFilename();
scheduleImportUpdate.setFileName(fileName);
scheduleImportUpdate.setSiteCode(AdminGlobal.getSiteCode());
int headerRowNum = 1;
ImportExcel importExcel = new ImportExcel(file, headerRowNum, 0);
List<ScheduleImportUpdateLog> scheduleImportUpdateLogList = importExcel
.getDataListByTitle(ScheduleImportUpdateLog.class, 0,
false, ScheduleImportUpdateLog.DEFAULT);
scheduleImportUpdateService.importSchedule(scheduleImportUpdate,
scheduleImportUpdateLogList, headerRowNum);
} catch (Exception e) {
AdminGlobal.operationLogActionResult.set("0");
throw new ServiceException("解析失败!" + e.getMessage());
}
return new BaseResult();
}
} | [
"lengweiping@joyutech.com"
] | lengweiping@joyutech.com |
293df9649ef555d69e92e1687e567bc3b2b1278d | 4ec42993293e0bca74864eb2c61ae69e248c2bb5 | /mall-order/src/main/java/com/cn/mall/order/service/RefundInfoService.java | 0b5874955ed093ccf267335a9aea2aec54899eaa | [
"Apache-2.0"
] | permissive | Advancedouh/mall-project | 45b8bbe4aa8a3514f59cf0f067c3674eaffb7c73 | cbd6e0848326bc6a2fbd6a50492f80a873945333 | refs/heads/master | 2023-08-26T15:08:03.520082 | 2021-01-14T14:30:44 | 2021-01-14T14:30:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 446 | java | package com.cn.mall.order.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.cn.mall.common.utils.PageUtils;
import com.cn.mall.order.entity.RefundInfoEntity;
import java.util.Map;
/**
* 退款信息
*
* @author duanzhf
* @email zfduan0824@163.com
* @date 2020-09-22 22:54:44
*/
public interface RefundInfoService extends IService<RefundInfoEntity> {
PageUtils queryPage(Map<String, Object> params);
}
| [
"925043897@qq.com"
] | 925043897@qq.com |
b078b95c1fc47e2605481c208792facdab97172c | a3f37b3c7221eae4e1052c622de7204372cf446c | /contractmanagement-api/src/main/java/com/liferay/cm/model/StatusSoap.java | a315252955af2bcecbb9450bf6b481621d777fe6 | [] | no_license | jverweijL/contractmanagement | 72c965353dc97ca33b791e696a4fd01dfa1902ca | 961d124f4584e0adeef81d90b1122156930886c1 | refs/heads/master | 2020-08-16T13:31:06.304193 | 2019-10-28T12:45:56 | 2019-10-28T12:45:56 | 215,506,905 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,577 | java | /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package com.liferay.cm.model;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.osgi.annotation.versioning.ProviderType;
/**
* This class is used by SOAP remote services, specifically {@link com.liferay.cm.service.http.StatusServiceSoap}.
*
* @author Brian Wing Shun Chan
* @generated
*/
@ProviderType
public class StatusSoap implements Serializable {
public static StatusSoap toSoapModel(Status model) {
StatusSoap soapModel = new StatusSoap();
soapModel.setUuid(model.getUuid());
soapModel.setStatusId(model.getStatusId());
soapModel.setGroupId(model.getGroupId());
soapModel.setCompanyId(model.getCompanyId());
soapModel.setUserId(model.getUserId());
soapModel.setUserName(model.getUserName());
soapModel.setCreateDate(model.getCreateDate());
soapModel.setModifiedDate(model.getModifiedDate());
soapModel.setModifierId(model.getModifierId());
soapModel.setModifierName(model.getModifierName());
soapModel.setName(model.getName());
soapModel.setDescription(model.getDescription());
return soapModel;
}
public static StatusSoap[] toSoapModels(Status[] models) {
StatusSoap[] soapModels = new StatusSoap[models.length];
for (int i = 0; i < models.length; i++) {
soapModels[i] = toSoapModel(models[i]);
}
return soapModels;
}
public static StatusSoap[][] toSoapModels(Status[][] models) {
StatusSoap[][] soapModels = null;
if (models.length > 0) {
soapModels = new StatusSoap[models.length][models[0].length];
}
else {
soapModels = new StatusSoap[0][0];
}
for (int i = 0; i < models.length; i++) {
soapModels[i] = toSoapModels(models[i]);
}
return soapModels;
}
public static StatusSoap[] toSoapModels(List<Status> models) {
List<StatusSoap> soapModels = new ArrayList<StatusSoap>(models.size());
for (Status model : models) {
soapModels.add(toSoapModel(model));
}
return soapModels.toArray(new StatusSoap[soapModels.size()]);
}
public StatusSoap() {
}
public long getPrimaryKey() {
return _statusId;
}
public void setPrimaryKey(long pk) {
setStatusId(pk);
}
public String getUuid() {
return _uuid;
}
public void setUuid(String uuid) {
_uuid = uuid;
}
public long getStatusId() {
return _statusId;
}
public void setStatusId(long statusId) {
_statusId = statusId;
}
public long getGroupId() {
return _groupId;
}
public void setGroupId(long groupId) {
_groupId = groupId;
}
public long getCompanyId() {
return _companyId;
}
public void setCompanyId(long companyId) {
_companyId = companyId;
}
public long getUserId() {
return _userId;
}
public void setUserId(long userId) {
_userId = userId;
}
public String getUserName() {
return _userName;
}
public void setUserName(String userName) {
_userName = userName;
}
public Date getCreateDate() {
return _createDate;
}
public void setCreateDate(Date createDate) {
_createDate = createDate;
}
public Date getModifiedDate() {
return _modifiedDate;
}
public void setModifiedDate(Date modifiedDate) {
_modifiedDate = modifiedDate;
}
public long getModifierId() {
return _modifierId;
}
public void setModifierId(long modifierId) {
_modifierId = modifierId;
}
public String getModifierName() {
return _modifierName;
}
public void setModifierName(String modifierName) {
_modifierName = modifierName;
}
public String getName() {
return _name;
}
public void setName(String name) {
_name = name;
}
public String getDescription() {
return _description;
}
public void setDescription(String description) {
_description = description;
}
private String _uuid;
private long _statusId;
private long _groupId;
private long _companyId;
private long _userId;
private String _userName;
private Date _createDate;
private Date _modifiedDate;
private long _modifierId;
private String _modifierName;
private String _name;
private String _description;
} | [
"jan.verweij@liferay.com"
] | jan.verweij@liferay.com |
a84bae7e7c7fa7150dd3b605deba3080eb198862 | 3a5985651d77a31437cfdac25e594087c27e93d6 | /ojc-core/component-common/axiondb/external/src/jxl/write/biff/WritableFormattingRecords.java | 2192a025375ead772cacc21c432595afd0bb0261 | [] | no_license | vitalif/openesb-components | a37d62133d81edb3fdc091abd5c1d72dbe2fc736 | 560910d2a1fdf31879e3d76825edf079f76812c7 | refs/heads/master | 2023-09-04T14:40:55.665415 | 2016-01-25T13:12:22 | 2016-01-25T13:12:33 | 48,222,841 | 0 | 5 | null | null | null | null | UTF-8 | Java | false | false | 6,943 | java | /*********************************************************************
*
* Copyright (C) 2002 Andrew Khan
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***************************************************************************/
package jxl.write.biff;
import common.Assert;
import jxl.biff.Fonts;
import jxl.biff.FormattingRecords;
import jxl.biff.NumFormatRecordsException;
import jxl.write.NumberFormats;
import jxl.write.WritableCellFormat;
/**
* Handles the Format and XF record indexing. The writable subclass
* instantiates the predetermined list of XF records and formats
* present in every Excel Workbook
*/
public class WritableFormattingRecords extends FormattingRecords
{
/**
* The statically defined normal style
*/
public static WritableCellFormat normalStyle;
/**
* Constructor. Instantiates the prerequisite list of formats and
* styles required by all Excel workbooks
*
* @param f the list of Fonts
* @param styles the list of style clones
*/
public WritableFormattingRecords(Fonts f, Styles styles)
{
super(f);
try
{
// Hard code all the styles
StyleXFRecord sxf = new StyleXFRecord
(styles.getArial10Pt(),NumberFormats.DEFAULT);
sxf.setLocked(true);
addStyle(sxf);
sxf = new StyleXFRecord(getFonts().getFont(1),NumberFormats.DEFAULT);
sxf.setLocked(true);
sxf.setCellOptions(0xf400);
addStyle(sxf);
sxf = new StyleXFRecord(getFonts().getFont(1),NumberFormats.DEFAULT);
sxf.setLocked(true);
sxf.setCellOptions(0xf400);
addStyle(sxf);
sxf = new StyleXFRecord(getFonts().getFont(1),NumberFormats.DEFAULT);
sxf.setLocked(true);
sxf.setCellOptions(0xf400);
addStyle(sxf);
sxf = new StyleXFRecord(getFonts().getFont(2),NumberFormats.DEFAULT);
sxf.setLocked(true);
sxf.setCellOptions(0xf400);
addStyle(sxf);
sxf = new StyleXFRecord(getFonts().getFont(3),NumberFormats.DEFAULT);
sxf.setLocked(true);
sxf.setCellOptions(0xf400);
addStyle(sxf);
sxf = new StyleXFRecord(styles.getArial10Pt(),
NumberFormats.DEFAULT);
sxf.setLocked(true);
sxf.setCellOptions(0xf400);
addStyle(sxf);
sxf = new StyleXFRecord(styles.getArial10Pt(),
NumberFormats.DEFAULT);
sxf.setLocked(true);
sxf.setCellOptions(0xf400);
addStyle(sxf);
sxf = new StyleXFRecord(styles.getArial10Pt(),
NumberFormats.DEFAULT);
sxf.setLocked(true);
sxf.setCellOptions(0xf400);
addStyle(sxf);
sxf = new StyleXFRecord(styles.getArial10Pt(),
NumberFormats.DEFAULT);
sxf.setLocked(true);
sxf.setCellOptions(0xf400);
addStyle(sxf);
sxf = new StyleXFRecord(styles.getArial10Pt(),
NumberFormats.DEFAULT);
sxf.setLocked(true);
sxf.setCellOptions(0xf400);
addStyle(sxf);
sxf = new StyleXFRecord(styles.getArial10Pt(),
NumberFormats.DEFAULT);
sxf.setLocked(true);
sxf.setCellOptions(0xf400);
addStyle(sxf);
sxf = new StyleXFRecord(styles.getArial10Pt(),
NumberFormats.DEFAULT);
sxf.setLocked(true);
sxf.setCellOptions(0xf400);
addStyle(sxf);
sxf = new StyleXFRecord(styles.getArial10Pt(),
NumberFormats.DEFAULT);
sxf.setLocked(true);
sxf.setCellOptions(0xf400);
addStyle(sxf);
sxf = new StyleXFRecord(styles.getArial10Pt(),
NumberFormats.DEFAULT);
sxf.setLocked(true);
sxf.setCellOptions(0xf400);
addStyle(sxf);
// That's the end of the built ins. Write the normal style
// cell XF here
addStyle(styles.getNormalStyle());
// Continue with "user defined" styles
sxf = new StyleXFRecord(getFonts().getFont(1),
NumberFormats.FORMAT7);
sxf.setLocked(true);
sxf.setCellOptions(0xf800);
addStyle(sxf);
sxf = new StyleXFRecord(getFonts().getFont(1),
NumberFormats.FORMAT5);
sxf.setLocked(true);
sxf.setCellOptions(0xf800);
addStyle(sxf);
sxf = new StyleXFRecord(getFonts().getFont(1),
NumberFormats.FORMAT8);
sxf.setLocked(true);
sxf.setCellOptions(0xf800);
addStyle(sxf);
sxf = new StyleXFRecord(getFonts().getFont(1),
NumberFormats.FORMAT6);
sxf.setLocked(true);
sxf.setCellOptions(0xf800);
addStyle(sxf);
sxf = new StyleXFRecord(getFonts().getFont(1),
NumberFormats.PERCENT_INTEGER);
sxf.setLocked(true);
sxf.setCellOptions(0xf800);
addStyle(sxf);
// Hard code in the pre-defined number formats for now
/*
FormatRecord fr = new FormatRecord
("\"$\"#,##0_);\\(\"$\"#,##0\\)",5);
addFormat(fr);
fr = new FormatRecord
("\"$\"#,##0_);[Red]\\(\"$\"#,##0\\)", 6);
addFormat(fr);
fr = new FormatRecord
("\"$\"#,##0.00_);\\(\"$\"#,##0.00\\)", 7);
addFormat(fr);
fr = new FormatRecord
("\"$\"#,##0.00_);[Red]\\(\"$\"#,##0.00\\)", 8);
addFormat(fr);
fr = new FormatRecord
("_(\"$\"* #,##0_);_(\"$\"* \\(#,##0\\);_(\"$\"* \"-\"_);_(@_)",
0x2a);
// outputFile.write(fr);
fr = new FormatRecord
("_(* #,##0_);_(* \\(#,##0\\);_(* \"-\"_);_(@_)",
0x2e);
// outputFile.write(fr);
fr = new FormatRecord
("_(\"$\"* #,##0.00_);_(\"$\"* \\(#,##0.00\\);_(\"$\"* \"-\"??_);_(@_)",
0x2c);
// outputFile.write(fr);
fr = new FormatRecord
("_(* #,##0.00_);_(* \\(#,##0.00\\);_(* \"-\"??_);_(@_)",
0x2b);
// outputFile.write(fr);
*/
}
catch (NumFormatRecordsException e)
{
// This should not happen yet, since we are just creating the file.
// Bomb out
Assert.verify(false, e.getMessage());
}
}
}
| [
"bitbucket@bitbucket02.private.bitbucket.org"
] | bitbucket@bitbucket02.private.bitbucket.org |
3cd22d1d66cb64d76137f8527168b9b0cac8ee9e | ecd891762f43085a4e92b5a05e8a8037a6596c21 | /basicprogram/src/overloading/Example.java | a88b3eebedcd49fa2c20fdb00649e16f2a4ad8c9 | [] | no_license | chandhnikchandran/Fundamentals-of-Programming-Using-JAVA | fe5a64870d6d2c7c16e1ad333b10c971dfda9bb9 | cc26361928224e80de87d80ab35bde15ee2208c7 | refs/heads/master | 2020-08-22T21:44:10.090268 | 2019-11-27T13:37:52 | 2019-11-27T13:37:52 | 216,482,556 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,514 | java | package overloading;
import java.util.Scanner;
public class Example {
public static void main(String[] arg)
{
Scanner s=new Scanner(System.in);
System.out.println("Enter Name:");
String name=s.next();
System.out.println("Enter Roll.no:");
String rollno=s.next();
System.out.println("Dep:");
String dep=s.next();
System.out.println("Year:");
int y=s.nextInt();
System.out.println("Enter Marks:");
System.out.println("Maths:");
int m=s.nextInt();
System.out.println("Physics:");
int p=s.nextInt();
System.out.println("Chemistry:");
int c=s.nextInt();
System.out.println("Biology:");
int b=s.nextInt();
System.out.println("English:");
int e=s.nextInt();
System.out.println("Malayalam:");
int ma=s.nextInt();
int total=0;
double avg=0.0;
Details ds=new Details();
ds.display(name,rollno,dep,y);
ds.display(m,p,c,b,e,ma);
ds.display(m,p,c,b,e,ma,total,avg);
}
}
class Details{
public void display(String name, String rollno, String dep, int y) {
// TODO Auto-generated method stub
System.out.println("*************");
System.out.println("Details :");
System.out.println("---------------");
System.out.println("Name: "+name);
System.out.println("Rollno: "+rollno);
System.out.println("Dep: "+dep);
System.out.println("Year: "+y);
}
public void display(int m, int p, int c, int b, int e, int ma, int total, double avg) {
// TODO Auto-generated method stub
System.out.println("-----------");
total=m+p+c+b+e+ma;
avg=total/6;
System.out.println("Total Mark="+total);
System.out.println("Average Mark="+avg);
if(total>450)
{
System.out.println("1st Rank");
}
else if(total>350&&total<450)
{
System.out.println("2nd Rank");
}
else if(total>250&&total<350)
{
System.out.println("3rd Rank");
}
else if(total>150&&total<250)
{
System.out.println("4th Rank");
}
else
{
System.out.println("Faild");
}
}
public void display(int m, int p, int c, int b, int e, int ma) {
// TODO Auto-generated method stub
System.out.println("***********");
System.out.println("Marks :");
System.out.println("-----------");
System.out.println("Maths: "+m);
System.out.println("Physics: "+p);
System.out.println("Chemistry: "+c);
System.out.println("Biology: "+b);
System.out.println("English: "+e);
System.out.println("Malayalam: "+ma);
}
}
| [
"User@FACE-99"
] | User@FACE-99 |
244ab34840bb06a176439085a587bfaad5701d3f | f361b6485d25790e861f69608bd5beb6556e76e9 | /DMS-war/src/java/com/datamarket/vistas/DetalleEmpresaProspecto.java | ce2145d4d8281961e6192ef916fee3ad391c1cc3 | [] | no_license | andrespenamantilla/DMS | 65b7bfc01ebe2fed80e80210599838fcdd0d1b88 | e083e3e09e498feb44f66ac18e08c784000f82eb | refs/heads/master | 2021-05-08T01:14:17.366204 | 2017-10-21T15:28:48 | 2017-10-21T15:28:48 | 107,790,759 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,614 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.datamarket.vistas;
import com.datamarket.entidades.TbEjecutivos;
import com.datamarket.entidades.TbEmpresasProspecto;
import com.datamarket.facades.TbCiudadesFacade;
import com.datamarket.facades.TbDepartamentosFacade;
import com.datamarket.facades.TbDetalleCatalogoFacade;
import com.datamarket.facades.TbEjecutivosFacade;
import com.datamarket.facades.TbPaisesFacade;
import java.io.Serializable;
import javax.annotation.PostConstruct;
import javax.faces.view.ViewScoped;
import javax.inject.Inject;
import javax.inject.Named;
/**
*
* @author andre
*/
@Named
@ViewScoped
public class DetalleEmpresaProspecto implements Serializable {
@Inject
ObjetosSesion session;
@Inject
TbEjecutivosFacade ejecutivosFacade;
@Inject
TbPaisesFacade paisesFacade;
@Inject
TbDepartamentosFacade departamentoFacade;
@Inject
TbCiudadesFacade ciudadFacade;
@Inject
TbDetalleCatalogoFacade catalogoFacade;
private TbEmpresasProspecto empresaProspectoDetalle;
private TbEjecutivos ejecutivo;
private String nombreEjecutivo;
private String nombrePais;
private String nombreDepto;
private String nombreCiudad;
private final String camposNulos = "NO REGISTRA";
private String nombreReferencia;
private String nombreCargo;
private String nombreArea;
private String nombreSector;
@PostConstruct()
public void init() {
empresaProspectoDetalle = session.getEmpresaProspectoSesion();
ejecutivo = ejecutivosFacade.buscarPorId(empresaProspectoDetalle.getPeEjecutivo());
nombreEjecutivo = ejecutivo.getTbAdmUsuarios().getUsNombre();
nombrePais = paisesFacade.findNombreById(empresaProspectoDetalle.getPePais());
nombreDepto = departamentoFacade.findNombreById(empresaProspectoDetalle.getPePais(), empresaProspectoDetalle.getPeDepartamento());
nombreCiudad = ciudadFacade.findNombreById(empresaProspectoDetalle.getPePais(), empresaProspectoDetalle.getPeDepartamento(), empresaProspectoDetalle.getPeCiudad());
nombreReferencia = catalogoFacade.nombreCatalogoReferido(empresaProspectoDetalle.getPeReferencia());
nombreSector = catalogoFacade.nombreCatalogoSector(empresaProspectoDetalle.getPeSector());
camposNoRegistrados();
}
public void camposNoRegistrados() {
if (empresaProspectoDetalle.getPeEmail() == null) {
empresaProspectoDetalle.setPeEmail(camposNulos);
}
if (empresaProspectoDetalle.getPeSitioWeb() == null) {
empresaProspectoDetalle.setPeSitioWeb(camposNulos);
}
if (empresaProspectoDetalle.getPeNombreContacto() == null) {
empresaProspectoDetalle.setPeNombreContacto(camposNulos);
}
if (empresaProspectoDetalle.getPeApellidoContacto() == null) {
empresaProspectoDetalle.setPeApellidoContacto(camposNulos);
}
if (empresaProspectoDetalle.getPeDescripcionFuncion() == null) {
empresaProspectoDetalle.setPeDescripcionFuncion(camposNulos);
}
if (empresaProspectoDetalle.getPeArea() == null) {
nombreArea = camposNulos;
} else {
nombreArea = catalogoFacade.nombreCatalogoArea(empresaProspectoDetalle.getPeArea());
}
if (empresaProspectoDetalle.getPeCargo() == null) {
nombreCargo = camposNulos;
} else {
nombreCargo = catalogoFacade.nombreCatalogoCargo(empresaProspectoDetalle.getPeCargo());
}
}
/*Getters & Setters*/
public TbEmpresasProspecto getEmpresaProspectoDetalle() {
return empresaProspectoDetalle;
}
public void setEmpresaProspectoDetalle(TbEmpresasProspecto empresaProspectoDetalle) {
this.empresaProspectoDetalle = empresaProspectoDetalle;
}
public String getNombreEjecutivo() {
return nombreEjecutivo;
}
public void setNombreEjecutivo(String nombreEjecutivo) {
this.nombreEjecutivo = nombreEjecutivo;
}
public String getNombrePais() {
return nombrePais;
}
public void setNombrePais(String nombrePais) {
this.nombrePais = nombrePais;
}
public String getNombreDepto() {
return nombreDepto;
}
public void setNombreDepto(String nombreDepto) {
this.nombreDepto = nombreDepto;
}
public String getNombreCiudad() {
return nombreCiudad;
}
public void setNombreCiudad(String nombreCiudad) {
this.nombreCiudad = nombreCiudad;
}
public String getNombreReferencia() {
return nombreReferencia;
}
public void setNombreReferencia(String nombreReferencia) {
this.nombreReferencia = nombreReferencia;
}
public String getNombreCargo() {
return nombreCargo;
}
public void setNombreCargo(String nombreCargo) {
this.nombreCargo = nombreCargo;
}
public String getNombreArea() {
return nombreArea;
}
public void setNombreArea(String nombreArea) {
this.nombreArea = nombreArea;
}
public String getNombreSector() {
return nombreSector;
}
public void setNombreSector(String nombreSector) {
this.nombreSector = nombreSector;
}
}
| [
"andrespenamantilla@hotmail.com"
] | andrespenamantilla@hotmail.com |
4e809816e72acf7085e21e00fcd2f64fbe353f67 | a869e33013a8d6bb80d5068b21898232487342b5 | /src/main/java/com/wongnai/interview/config/WebConfig.java | e54bf917f9c55b971d1cdc4bbad0a710b2d8b6b8 | [] | no_license | thirajade/wongnai-java-assignment | 5521438b797deff7d0c1387db9c9dba81ed52fb8 | 3719c71e9bbd7ae16e9c8995ef213a70b4846eba | refs/heads/master | 2021-06-21T06:58:15.057227 | 2019-08-29T15:24:03 | 2019-08-29T15:24:03 | 204,517,349 | 0 | 0 | null | 2021-03-31T21:43:47 | 2019-08-26T16:34:05 | Java | UTF-8 | Java | false | false | 527 | java | package com.wongnai.interview.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.validation.beanvalidation.MethodValidationPostProcessor;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class WebConfig implements WebMvcConfigurer {
@Bean
public MethodValidationPostProcessor methodValidationPostProcessor() {
return new MethodValidationPostProcessor();
}
}
| [
"thirajade.lkw@gmail.com"
] | thirajade.lkw@gmail.com |
2090eadd1f5b5e8afef9b12ff393f7abc5209af8 | 95554c84963fe7a4f1542983bf2030e2e8dd3c40 | /feign-client/src/main/java/com/aoenu/feign/service/fallback/FileFeignServiceImpl.java | 8bbe0e3010fded2512b3c9196c3354f0441a4ed7 | [] | no_license | jansure/feign-file-operation | f357529566de142d69d0e8d144d071b76adadc4a | 68a5b964df701e6b101cf61b673c57453406fce0 | refs/heads/master | 2021-11-04T20:57:05.640196 | 2019-04-28T07:11:30 | 2019-04-28T07:11:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 666 | java | package com.aoenu.feign.service.fallback;
import com.aoenu.feign.service.FileFeignService;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;
/**
* This is Description
*
* @author baoben.wu@hand-china.com
* @date 2019/04/18
*/
@Component
public class FileFeignServiceImpl implements FileFeignService {
@Override
public String uploadFiles(Long organizationId, String bucketName, MultipartFile multipartFile) {
return "fail";
}
@Override
public ResponseEntity<byte[]> downloadFile(String fileType) {
return null;
}
}
| [
"baoben.wu@hand-china.com"
] | baoben.wu@hand-china.com |
34587c627b9333d7fa114980a962e9fa6119a911 | 63699ea7af4cb30ee2be6672cfacfcd1a4e21039 | /Contacts/app/src/test/java/com/example/dellayush/contacts/ExampleUnitTest.java | afd4c5a292ce9fd441a32828740a29a9dce781fd | [] | no_license | ajaylad/BlindApp | cb11f83df81310239a4478d812c243ec36b32b3e | d52c5324034546654d51daa644e13a497f0f2abf | refs/heads/master | 2021-01-01T00:15:46.210464 | 2020-02-06T19:30:08 | 2020-02-06T19:30:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 391 | java | package com.example.dellayush.contacts;
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);
}
} | [
"ayushsatra@gmail.com"
] | ayushsatra@gmail.com |
314938fc1649b72dde4e3d2ce0a77cd6c1ce0c1a | 42585c3c8581ad090b523d68df7ed165e04249a7 | /serviceApp/src/main/java/function/UserFunctions.java | 8a402b3df998ea0a636c5bf7db8470be7f61d1e9 | [] | no_license | infoshareacademy/jjdzr2-ByczaCzarnaKawka | 38e6eca0bd2af5eaa31421b32a530133d657d0a1 | 3ab9aa917327ac05e1a65345889a2017f90e54a1 | refs/heads/develop | 2023-03-30T01:14:30.703309 | 2021-04-10T20:44:32 | 2021-04-10T20:44:32 | 305,043,550 | 0 | 0 | null | 2021-04-10T20:44:33 | 2020-10-18T07:09:03 | CSS | UTF-8 | Java | false | false | 1,054 | java | package function;
import com.infoshare.service.domain.users.UserDTO;
import com.infoshare.service.entity.UserEntity;
import java.util.function.Function;
public class UserFunctions {
// public static final Function<UserEntity, UserDTO> userEntityToUserDTO = userEntity -> new UserDTO(
// userEntity.getNickname(),
// userEntity.getMailAddress(),
// userEntity.getPassword(),
// userEntity.getBornYear(),
// userEntity.getPhoneNumber(),
// userEntity.getGender(),
// userEntity.getAddressEntity(),
// userEntity.getDisciplines()
// );
//
// public static final Function<UserDTO, UserEntity> userDTOToUserEntity = userDTO -> new UserEntity(
// userDTO.getNickname(),
// userDTO.getMailAddress(),
// userDTO.getPassword(),
// userDTO.getBornYear(),
// userDTO.getPhoneNumber(),
// userDTO.getGender(),
//
// userDTO.getAddress(),
// userDTO.getActivityList()
// );
}
| [
"mariaderfel@gmail.com"
] | mariaderfel@gmail.com |
67bbd0bba633b880180903f4bceba9d771fc2399 | db21a027aefef69adead30350d4f6d1d6195ac92 | /sample/src/main/java/com/kennyc/sample/MainActivity.java | e5f98dd871995ee60e458dd2151e0d85e4f223aa | [
"MIT"
] | permissive | sangupandi/TextDrawable | b450ec7444ccea458f2025b85b5630e786d9ce0a | 692c5327faaf7d5e53493936828e24bb557f87ce | refs/heads/master | 2021-01-16T18:04:11.793718 | 2015-08-29T22:37:29 | 2015-08-29T22:37:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,970 | java | package com.kennyc.sample;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;
import com.amulyakhare.textdrawable.TextDrawable;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TextView tv1 = (TextView) findViewById(R.id.test1);
TextView tv2 = (TextView) findViewById(R.id.test2);
TextView tv3 = (TextView) findViewById(R.id.test3);
TextView tv4 = (TextView) findViewById(R.id.test4);
TextDrawable d1 = new TextDrawable.Builder()
.setHeight(250)
.setWidth(250)
.setShape(TextDrawable.DRAWABLE_SHAPE_OVAL)
.setText("a")
.setColor(Color.BLUE)
.toUpperCase()
.build();
tv1.setCompoundDrawablesWithIntrinsicBounds(d1, null, null, null);
TextDrawable d2 = new TextDrawable.Builder()
.setHeight(250)
.setWidth(250)
.setShape(TextDrawable.DRAWABLE_SHAPE_OVAL)
.setIcon(BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher))
.build();
tv2.setCompoundDrawablesWithIntrinsicBounds(d2, null, null, null);
TextDrawable d3 = new TextDrawable.Builder()
.setHeight(250)
.setWidth(250)
.setShape(TextDrawable.DRAWABLE_SHAPE_RECT)
.setText("a")
.toUpperCase()
.build();
tv3.setCompoundDrawablesWithIntrinsicBounds(d3, null, null, null);
TextDrawable d4 = new TextDrawable.Builder()
.setHeight(250)
.setWidth(250)
.setShape(TextDrawable.DRAWABLE_SHAPE_RECT)
.setIcon(BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher))
.build();
tv4.setCompoundDrawablesWithIntrinsicBounds(d4, null, null, null);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
| [
"kennyc1012@gmail.com"
] | kennyc1012@gmail.com |
8c0b13377ff53655646c36da1f550ca0c577485d | 6c1bbba7414dfa657d05a65de2e821db0f39c81e | /gen/com/dvdsantana/dpsoptimizer/R.java | 0a3340cde9fc97582d2e5b6025f897bbbf8197a9 | [] | no_license | dvdsantana/dpsoptimizer | d0ae47bfb2691ca8cae40cacd8d780370ba49115 | ff2d99bd0107aaa48311ad1e32ce79a2cfa4ca72 | refs/heads/master | 2021-01-21T12:08:03.983582 | 2013-03-22T11:28:42 | 2013-03-22T11:28:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,639 | 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.dvdsantana.dpsoptimizer;
public final class R {
public static final class attr {
}
public static final class dimen {
/** Default screen margins, per the Android Design guidelines.
Customize dimensions originally defined in res/values/dimens.xml (such as
screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here.
*/
public static final int activity_horizontal_margin=0x7f040000;
public static final int activity_vertical_margin=0x7f040001;
public static final int editText=0x7f040002;
}
public static final class drawable {
public static final int ic_launcher=0x7f020000;
public static final int ic_launcher_gw2_logo=0x7f020001;
public static final int pattern6=0x7f020002;
}
public static final class id {
public static final int action_settings=0x7f080008;
public static final int clean=0x7f080005;
public static final int critChance=0x7f080000;
public static final int critDamage=0x7f080002;
public static final int exit=0x7f080009;
public static final int power=0x7f080001;
public static final int recommendation=0x7f080006;
public static final int results=0x7f080004;
public static final int run=0x7f080007;
public static final int statPointTradeoff=0x7f080003;
}
public static final class layout {
public static final int activity_main=0x7f030000;
}
public static final class menu {
public static final int main=0x7f070000;
}
public static final class string {
public static final int action_settings=0x7f050001;
public static final int app_name=0x7f050000;
public static final int app_tittle=0x7f050002;
public static final int calc_label=0x7f050007;
public static final int clean=0x7f050008;
public static final int critChance_label=0x7f050004;
public static final int critDamage_label=0x7f050005;
public static final int crit_power=0x7f050015;
public static final int crit_power_prec=0x7f050012;
public static final int crit_prec=0x7f050016;
public static final int damage=0x7f05000f;
public static final int damage_per_crit_chance=0x7f05000d;
public static final int damage_per_power=0x7f05000b;
public static final int damage_per_precision=0x7f05000c;
public static final int damage_stats=0x7f05000a;
public static final int exit=0x7f05001c;
public static final int more_power=0x7f050018;
public static final int more_prec=0x7f050019;
public static final int no_crit=0x7f050017;
public static final int note=0x7f05001a;
public static final int power_label=0x7f050003;
public static final int recommendation=0x7f050011;
public static final int required_field_error=0x7f050010;
public static final int results=0x7f050009;
public static final int sacrificing_power=0x7f050014;
public static final int sacrificing_prec=0x7f050013;
public static final int source=0x7f05001b;
public static final int statPointTradeoff=0x7f050006;
public static final int statPointTradeoff_per_crit_damage=0x7f05000e;
}
public static final class style {
/**
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
Base application theme for API 11+. This theme completely replaces
AppBaseTheme from res/values/styles.xml on API 11+ devices.
API 11 theme customizations can go here.
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
API 14 theme customizations can go here.
*/
public static final int AppBaseTheme=0x7f060000;
/** Application theme.
All customizations that are NOT specific to a particular API-level can go here.
*/
public static final int AppTheme=0x7f060001;
public static final int DPSTheme=0x7f060002;
}
}
| [
"dvdsantana@gmail.com"
] | dvdsantana@gmail.com |
2d09ea48920463659aa7628cc063c595f6c15024 | a531157206fc1950317e83ff6879f1e4d7008a5d | /DAW2-Semana13_Final/src/edu/cibertec/daw2/dao/impl/VentaDAOImpl.java | 8b2c96e053eb3bbf329bdc696da68a880fd8c35c | [] | no_license | pelguera/ejemplorepo | 7e1fc8a7efaa40b5fe73f5703f929d890b58c445 | 8460496560cbd5669dd2ae30958850a179ceb2a8 | refs/heads/master | 2021-03-12T22:48:38.816591 | 2014-01-29T22:17:09 | 2014-01-29T22:17:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,862 | java | package edu.cibertec.daw2.dao.impl;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Query;
import javax.persistence.TypedQuery;
import edu.cibertec.daw2.bean.BoletaDTO;
import edu.cibertec.daw2.bean.ClienteDTO;
import edu.cibertec.daw2.bean.ProductoDTO;
import edu.cibertec.daw2.dao.VentaDAO;
import edu.cibertec.daw2.entity.Boleta;
import edu.cibertec.daw2.entity.Cliente;
import edu.cibertec.daw2.entity.Producto;
import edu.cibertec.daw2.entity.ProductoHasBoleta;
import edu.cibertec.daw2.entity.ProductoHasBoletaPK;
public class VentaDAOImpl implements VentaDAO {
private EntityManagerFactory emf;
private EntityManager em;
public void setEntityManagerFactory(EntityManagerFactory emf ) {
this.emf = emf;
}
@Override
public List<BoletaDTO> obtenerVentas(BoletaDTO boleta) throws Exception {
List<BoletaDTO> lista = new ArrayList<BoletaDTO>();
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
try{
String query = "SELECT b.idboleta, b.fecha, c.idcliente, c.nombre, c.apellido FROM Boleta b LEFT JOIN b.cliente c ";
if(boleta != null){
query += " WHERE 1 = 1 ";
if(boleta.getCliente() != null && boleta.getCliente().getIdcliente() != 0)
query += " AND c.idcliente = :idcliente ";
if(boleta.getFecha() != null)
query += " AND b.fecha = :fecha ";
}
em = emf.createEntityManager();
Query q = em.createQuery(query);
if(boleta != null){
if(boleta.getCliente() != null && boleta.getCliente().getIdcliente() != 0)
q.setParameter("idcliente", boleta.getCliente().getIdcliente());
if(boleta.getFecha() != null)
q.setParameter("fecha", boleta.getFecha());
}
Iterator listaFinal = q.getResultList().iterator();
while(listaFinal.hasNext()){
BoletaDTO bolDTO = new BoletaDTO();
Object[] obj = (Object[]) listaFinal.next();
bolDTO.setIdboleta(Integer.parseInt(obj[0].toString()));
Date fecha = (Date)obj[1];
bolDTO.setFecha(fecha);
bolDTO.setFechaFormat(sdf.format(new Date(fecha.getTime())));
ClienteDTO cliDTO = new ClienteDTO();
cliDTO.setIdcliente(Integer.parseInt(obj[2].toString()));
cliDTO.setNombre(obj[3].toString());
cliDTO.setApellido(obj[4].toString());
bolDTO.setCliente(cliDTO);
lista.add(bolDTO);
}
}catch(Exception e){
e.printStackTrace();
}
return lista;
}
@Override
public void insertarVenta(BoletaDTO boleta) throws Exception {
em = emf.createEntityManager();
try{
Boleta bol = new Boleta();
bol.setFecha(boleta.getFecha());
//agregando cliente
Cliente cliente = new Cliente();
cliente = em.find(Cliente.class, boleta.getCliente().getIdcliente());
bol.setCliente(cliente);
em.getTransaction().begin();
em.persist(bol);
em.flush();
//em.getTransaction().commit();
//agregando los productos
for(ProductoDTO pro : boleta.getProductos()){
ProductoHasBoletaPK prodPK = new ProductoHasBoletaPK();
prodPK.setIdboleta(bol.getIdboleta());
prodPK.setIdproducto(pro.getIdproducto());
ProductoHasBoleta prodBol = new ProductoHasBoleta();
prodBol.setId(prodPK);
prodBol.setPrecio(pro.getPrecio());
prodBol.setStock(pro.getStock());
em.persist(prodBol);
}
em.getTransaction().commit();
em.close();
}catch(Exception e){
em.getTransaction().rollback();
e.printStackTrace();
}
}
@Override
public void actualizarVenta(BoletaDTO boleta) throws Exception {
// TODO Auto-generated method stub
}
@Override
public void eliminarVenta(BoletaDTO boleta) throws Exception {
// TODO Auto-generated method stub
}
@Override
public BoletaDTO obtenerVenta(BoletaDTO boleta) throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
public List<ClienteDTO> obtenerVentasPorCliente() throws Exception {
List<ClienteDTO> lista = new ArrayList<ClienteDTO>();
String query = "SELECT c FROM Cliente c";
try{
em = emf.createEntityManager();
TypedQuery<Cliente> q = em.createQuery(query, Cliente.class);
Iterator registro = q.getResultList().iterator();
while(registro.hasNext()){
ClienteDTO cliDTO = new ClienteDTO();
Cliente cli = (Cliente)registro.next();
cliDTO.setIdcliente(cli.getIdcliente());
cliDTO.setNombre(cli.getNombre());
cliDTO.setApellido(cli.getApellido());
String query1 = "SELECT count(b) FROM Boleta b WHERE b.cliente.idcliente = :cli";
Query q1 = em.createQuery(query1);
q1.setParameter("cli", cli.getIdcliente());
Integer cantidad = Integer.parseInt(q1.getSingleResult().toString());
cliDTO.setCantVentas(cantidad);
lista.add(cliDTO);
}
}catch(Exception e){
e.printStackTrace();
}
return lista;
}
@Override
public List<ProductoDTO> obtenerVentasPorProducto() throws Exception {
List<ProductoDTO> lista = new ArrayList<ProductoDTO>();
String query = "SELECT p FROM Producto p";
try{
em = emf.createEntityManager();
TypedQuery<Producto> q = em.createQuery(query, Producto.class);
List<Producto> data = q.getResultList();
for(Producto p :data){
ProductoDTO aux = new ProductoDTO();
aux.setIdproducto(p.getIdproducto());
aux.setNombre(p.getNombre());
String query1 =
"SELECT count(p) FROM ProductoHasBoleta p where p.id.idproducto = :par";
Query q1 = em.createQuery(query1);
q1.setParameter("par", p.getIdproducto());
Integer cantidad = Integer.parseInt(String.valueOf(q1.getSingleResult()));
aux.setCantVentas(cantidad);
lista.add(aux);
}
}catch(Exception e){
e.printStackTrace();
}
return lista;
}
}
| [
"paul.elguera@gmail.com"
] | paul.elguera@gmail.com |
9af59d3176f394abdfa9c40449a9ebb778fcd16a | 70daac72769d4ce8768aa6cd55643a457d93f9cc | /build/app/generated/not_namespaced_r_class_sources/debug/processDebugResources/r/androidx/asynclayoutinflater/R.java | 8dea686c259132da050cec1674bde9b2635212e2 | [
"MIT"
] | permissive | ThomasCX/DYNAMIC-CINEMA | bbd15df0c322a6116c8b08062cf66b83538e23bd | 2f261d83f9ef546104b8cdb904591530108ac7a3 | refs/heads/master | 2020-12-02T14:01:27.890437 | 2019-12-30T02:57:33 | 2019-12-30T02:57:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,459 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* gradle plugin from the resource data it found. It
* should not be modified by hand.
*/
package androidx.asynclayoutinflater;
public final class R {
private R() {}
public static final class attr {
private attr() {}
public static final int alpha = 0x7f010000;
public static final int font = 0x7f010002;
public static final int fontProviderAuthority = 0x7f010003;
public static final int fontProviderCerts = 0x7f010004;
public static final int fontProviderFetchStrategy = 0x7f010005;
public static final int fontProviderFetchTimeout = 0x7f010006;
public static final int fontProviderPackage = 0x7f010007;
public static final int fontProviderQuery = 0x7f010008;
public static final int fontStyle = 0x7f010009;
public static final int fontVariationSettings = 0x7f01000a;
public static final int fontWeight = 0x7f01000b;
public static final int ttcIndex = 0x7f010014;
}
public static final class color {
private color() {}
public static final int notification_action_color_filter = 0x7f020004;
public static final int notification_icon_bg_color = 0x7f020005;
public static final int ripple_material_light = 0x7f020006;
public static final int secondary_text_default_material_light = 0x7f020007;
}
public static final class dimen {
private dimen() {}
public static final int compat_button_inset_horizontal_material = 0x7f030002;
public static final int compat_button_inset_vertical_material = 0x7f030003;
public static final int compat_button_padding_horizontal_material = 0x7f030004;
public static final int compat_button_padding_vertical_material = 0x7f030005;
public static final int compat_control_corner_material = 0x7f030006;
public static final int compat_notification_large_icon_max_height = 0x7f030007;
public static final int compat_notification_large_icon_max_width = 0x7f030008;
public static final int notification_action_icon_size = 0x7f030009;
public static final int notification_action_text_size = 0x7f03000a;
public static final int notification_big_circle_margin = 0x7f03000b;
public static final int notification_content_margin_start = 0x7f03000c;
public static final int notification_large_icon_height = 0x7f03000d;
public static final int notification_large_icon_width = 0x7f03000e;
public static final int notification_main_column_padding_top = 0x7f03000f;
public static final int notification_media_narrow_margin = 0x7f030010;
public static final int notification_right_icon_size = 0x7f030011;
public static final int notification_right_side_padding_top = 0x7f030012;
public static final int notification_small_icon_background_padding = 0x7f030013;
public static final int notification_small_icon_size_as_large = 0x7f030014;
public static final int notification_subtext_size = 0x7f030015;
public static final int notification_top_pad = 0x7f030016;
public static final int notification_top_pad_large_text = 0x7f030017;
}
public static final class drawable {
private drawable() {}
public static final int notification_action_background = 0x7f040001;
public static final int notification_bg = 0x7f040002;
public static final int notification_bg_low = 0x7f040003;
public static final int notification_bg_low_normal = 0x7f040004;
public static final int notification_bg_low_pressed = 0x7f040005;
public static final int notification_bg_normal = 0x7f040006;
public static final int notification_bg_normal_pressed = 0x7f040007;
public static final int notification_icon_background = 0x7f040008;
public static final int notification_template_icon_bg = 0x7f040009;
public static final int notification_template_icon_low_bg = 0x7f04000a;
public static final int notification_tile_bg = 0x7f04000b;
public static final int notify_panel_notification_icon_bg = 0x7f04000c;
}
public static final class id {
private id() {}
public static final int action_container = 0x7f050000;
public static final int action_divider = 0x7f050001;
public static final int action_image = 0x7f050002;
public static final int action_text = 0x7f050003;
public static final int actions = 0x7f050004;
public static final int async = 0x7f050006;
public static final int blocking = 0x7f050007;
public static final int chronometer = 0x7f050011;
public static final int forever = 0x7f050018;
public static final int icon = 0x7f050019;
public static final int icon_group = 0x7f05001a;
public static final int info = 0x7f05001b;
public static final int italic = 0x7f05001c;
public static final int line1 = 0x7f05001e;
public static final int line3 = 0x7f05001f;
public static final int normal = 0x7f050021;
public static final int notification_background = 0x7f050022;
public static final int notification_main_column = 0x7f050023;
public static final int notification_main_column_container = 0x7f050024;
public static final int right_icon = 0x7f050026;
public static final int right_side = 0x7f050027;
public static final int tag_transition_group = 0x7f050029;
public static final int tag_unhandled_key_event_manager = 0x7f05002a;
public static final int tag_unhandled_key_listeners = 0x7f05002b;
public static final int text = 0x7f05002c;
public static final int text2 = 0x7f05002d;
public static final int time = 0x7f05002e;
public static final int title = 0x7f05002f;
}
public static final class integer {
private integer() {}
public static final int status_bar_notification_info_maxnum = 0x7f060000;
}
public static final class layout {
private layout() {}
public static final int notification_action = 0x7f070002;
public static final int notification_action_tombstone = 0x7f070003;
public static final int notification_template_custom_big = 0x7f070004;
public static final int notification_template_icon_group = 0x7f070005;
public static final int notification_template_part_chronometer = 0x7f070006;
public static final int notification_template_part_time = 0x7f070007;
}
public static final class string {
private string() {}
public static final int status_bar_notification_info_overflow = 0x7f090000;
}
public static final class style {
private style() {}
public static final int TextAppearance_Compat_Notification = 0x7f0a0001;
public static final int TextAppearance_Compat_Notification_Info = 0x7f0a0002;
public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0a0003;
public static final int TextAppearance_Compat_Notification_Time = 0x7f0a0004;
public static final int TextAppearance_Compat_Notification_Title = 0x7f0a0005;
public static final int Widget_Compat_NotificationActionContainer = 0x7f0a0006;
public static final int Widget_Compat_NotificationActionText = 0x7f0a0007;
}
public static final class styleable {
private styleable() {}
public static final int[] ColorStateListItem = { 0x10101a5, 0x101031f, 0x7f010000 };
public static final int ColorStateListItem_android_color = 0;
public static final int ColorStateListItem_android_alpha = 1;
public static final int ColorStateListItem_alpha = 2;
public static final int[] FontFamily = { 0x7f010003, 0x7f010004, 0x7f010005, 0x7f010006, 0x7f010007, 0x7f010008 };
public static final int FontFamily_fontProviderAuthority = 0;
public static final int FontFamily_fontProviderCerts = 1;
public static final int FontFamily_fontProviderFetchStrategy = 2;
public static final int FontFamily_fontProviderFetchTimeout = 3;
public static final int FontFamily_fontProviderPackage = 4;
public static final int FontFamily_fontProviderQuery = 5;
public static final int[] FontFamilyFont = { 0x1010532, 0x1010533, 0x101053f, 0x101056f, 0x1010570, 0x7f010002, 0x7f010009, 0x7f01000a, 0x7f01000b, 0x7f010014 };
public static final int FontFamilyFont_android_font = 0;
public static final int FontFamilyFont_android_fontWeight = 1;
public static final int FontFamilyFont_android_fontStyle = 2;
public static final int FontFamilyFont_android_ttcIndex = 3;
public static final int FontFamilyFont_android_fontVariationSettings = 4;
public static final int FontFamilyFont_font = 5;
public static final int FontFamilyFont_fontStyle = 6;
public static final int FontFamilyFont_fontVariationSettings = 7;
public static final int FontFamilyFont_fontWeight = 8;
public static final int FontFamilyFont_ttcIndex = 9;
public static final int[] GradientColor = { 0x101019d, 0x101019e, 0x10101a1, 0x10101a2, 0x10101a3, 0x10101a4, 0x1010201, 0x101020b, 0x1010510, 0x1010511, 0x1010512, 0x1010513 };
public static final int GradientColor_android_startColor = 0;
public static final int GradientColor_android_endColor = 1;
public static final int GradientColor_android_type = 2;
public static final int GradientColor_android_centerX = 3;
public static final int GradientColor_android_centerY = 4;
public static final int GradientColor_android_gradientRadius = 5;
public static final int GradientColor_android_tileMode = 6;
public static final int GradientColor_android_centerColor = 7;
public static final int GradientColor_android_startX = 8;
public static final int GradientColor_android_startY = 9;
public static final int GradientColor_android_endX = 10;
public static final int GradientColor_android_endY = 11;
public static final int[] GradientColorItem = { 0x10101a5, 0x1010514 };
public static final int GradientColorItem_android_color = 0;
public static final int GradientColorItem_android_offset = 1;
}
}
| [
"aaliyahsp@hotmail.com"
] | aaliyahsp@hotmail.com |
a0cfe3f2ab15c71309b87aa3fad51494f7228cdd | b1d8c16848e7e5e439b49d028c198e9e50a10f10 | /src/stepik/Monad2Example.java | 83dc077396c7d59d1638c5f8afa064121c4c0607 | [] | no_license | Spirited/Java8Study | a458b55dcc1f32d7519e6ed271a47d8a311fd3fa | ed6699d85fd8ac66188357d6221900346b658df5 | refs/heads/master | 2021-05-23T06:13:43.068086 | 2018-06-12T10:33:12 | 2018-06-12T10:33:12 | 94,679,845 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,179 | java | package stepik;
import java.util.Optional;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
public class Monad2Example {
public static void main(String[] args) {
final Bank bank = new Bank("010122113", Optional.ofNullable("The Great & Reliable Bank"));
final Account account = new Account(UUID.randomUUID(), Optional.ofNullable(bank), 1000L);
final User user = new User("Lesly", "Hawk", Optional.ofNullable(account));
// System.out.println(getBankNameWhereUserHasAccount(user));
//
// CompletableFuture d;
}
// private static String getBankNameWhereUserHasAccount(User user) {
// return Optional.ofNullable(user)
// .map(User::getAccount)
// .map(Account::getBank)
// .map(Bank::getName)
// .orElse("<No bank found>");
// }
}
class User {
private String firstName;
private String lastName;
private Optional<Account> account;
public User(String firstName, String lastName, Optional<Account> account) {
this.firstName = firstName;
this.lastName = lastName;
this.account = account;
}
public String getFirstName() {
return firstName;
}
public String getLastName() {
return lastName;
}
public Optional<Account> getAccount() {
return account;
}
}
class Account {
private UUID uuid;
private Optional<Bank> bank;
private long balance;
public Account(UUID uuid, Optional<Bank> bank, long balance) {
this.uuid = uuid;
this.bank = bank;
this.balance = balance;
}
public UUID getUuid() {
return uuid;
}
public Optional<Bank> getBank() {
return bank;
}
public long getBalance() {
return balance;
}
}
class Bank {
private String uniqueName;
private Optional<String> name;
public Bank(String uniqueName, Optional<String> name) {
this.uniqueName = uniqueName;
this.name = name;
}
public String getUniqueName() {
return uniqueName;
}
public Optional<String> getName() {
return name;
}
}
| [
"sergey.kompanets@nextiva.com"
] | sergey.kompanets@nextiva.com |
cfaf335b3c063a4a9b46741613053a49c6e83adf | 04e481648175f3ba4702cfd44b42795ec47ca455 | /EjerciciosLogic1RodionBondarets/src/ejercicioslogic1rodionbondarets/EjerciciosLogic1RodionBondarets.java | d935545c91d1f37f224400eca746b4ea188b6282 | [] | no_license | Rodionx/java_calculadora2021 | 3d5ad61b0975a48019495ceb9f9cfe095b343e72 | 9ee90bb0eeb52ab47cd137a18e5634c847d2b754 | refs/heads/master | 2023-03-04T02:09:51.728190 | 2021-02-03T22:51:08 | 2021-02-03T22:51:08 | 329,872,094 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 19,211 | 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 ejercicioslogic1rodionbondarets;
/**
*
* @author xp
*/
public class EjerciciosLogic1RodionBondarets {
public boolean cigarparty(int cigars, boolean isWeekend){
if(isWeekend && cigars >= 40){
return true;
}
if(cigars >= 40 && cigars <= 60){
return true;
}
return false;
}
public int dateFashion(int you, int date){
if(you <= 2 || date <= 2){
return 0;
}
if(you >= 8 || date >= 8){
return 2;
}
return 1;
}
public boolean squirrelPlay(int temp, boolean isSummer) {
if(isSummer == false && temp >= 60 && temp <= 90 ){
return true;
}
if(isSummer == true && temp >= 60 && temp <= 100){
return true;
}
return false;
}
public int caughtSpeeding(int speed, boolean isBirthday) {
if(isBirthday == false && speed <= 60){
return 0;
}
if(isBirthday == false && speed >= 61 && speed <= 80){
return 1;
}
if(isBirthday == false && speed > 81){
return 2;
}
if(isBirthday == true && speed <= 65){
return 0;
}
if(isBirthday == true && speed >= 66 && speed <= 85){
return 1;
}
if(isBirthday == true && speed > 85){
return 2;
}
return -1;
}
public int sortaSum(int a, int b){
int result = a+b;
if(result >=10 && result <=19 ){
return 20;
}
return result;
}
public String alarmClock(int day, boolean vacation) {
if(vacation == true && day >= 1 && day <= 5){
return "10:00";
}
if(vacation == false && day == 0 || vacation == false && day == 6){
return"10:00";
}
if(vacation == true && day == 0 || true && day == 6){
return"off";
}
return "7:00";
}
public boolean love6(int a, int b) {
if(a == 6 || b == 6 || a+b == 6 || Math.abs(a-b) == 6){
return true;
}
return false;
}
public boolean in1To10(int n, boolean outsideMode) {
//Si el outsidemode esta en true y n sea menor que uno y mallor que 10 devuelve true.
if(outsideMode == true && (n <= 1 || n >= 10)){
return true;
}
//Si ousidemode esta en false y n valga de 1 a 10 devuelve true.
if(outsideMode == false && n >= 1 && n <= 10){
return true;
}
//En cualquier otro caso devuelve false.
return false;
}
public boolean specialEleven(int n) {
//Si el resto de n entre 11 da 0 o 1 devuelve true.
if(n % 11 == 0 || n % 11 == 1){
return true;
}
//En cualquier otro caso devuelve false.
return false;
}
public boolean more20(int n) {
//Si el resto de n entre 20 es 1 0 2 devuelve true.
if(n % 20 == 1 || n % 20 == 2){
return true;
}
//En cualquier otro caso devuelve false.
return false;
}
public boolean old35(int n) {
//Si el resto de n entre 5 y el de n entre 3 es el mismo devuelve false.
if(n % 3 == n % 5){
return false;
}
//Si el resto de n entre 3 o n entre 5 es 0 pero no los 2 a la vez devuelve true.
if(n % 3 == 0 || n % 5 == 0){
return true;
}
//En cualquier otro caso devuelve false.
return false;
}
public boolean less20(int n) {
//Si n + 1 o + 2 entre 20 da de resto 0 devuelvuelve true.
if((n +1) % 20 == 0 || (n +2) % 20 == 0 ){
return true;
}
//En cualquier otro caso devuelve false.
return false;
}
public boolean nearTen(int num) {
//Si num +2, +1, -2 o el solo dividido entre 10 da de resto 0 devuelve true.
if((num + 2) % 10 == 0 || (num + 1) % 10 == 0 || (num - 2) % 10 == 0 || (num - 1) % 10 == 0 || num % 10 == 0 ){
return true;
}
//En cualquier otro caso devuelve false.
return false;
}
public int teenSum(int a, int b) {
//Si a o b valen entre 13 y 19 devuelve 19.
if(a >= 13 && a <= 19 || b >= 13 && b <=19){
return 19;
}
//En cualquier otro caso devuelve el resultado de la suma de a y b.
return a+b;
}
public boolean answerCell(boolean isMorning, boolean isMom, boolean isAsleep) {
//Si esta durmiendo no coge el telefono.
if(isAsleep == true){
return false;
}
//Si es por la mañana y no es su madre no coge el telefono.
if(isMorning == true && isMom == false){
return false;
}
//En cualquier otro caso si lo coge
return true;
}
public int teaParty(int tea, int candy) {
//Si menos de 5 dulces o tes sera una fiesta mala.
if(tea < 5 || candy < 5){
return 0;
}
//Si hay mas del doble de tes o dulces la fiesta sera muy buena.
if(tea >= candy * 2 || candy >= tea * 2){
return 2;
}
//En cualquier otro caso la fiesta sera buena a secas.
return 1;
}
public String fizzString(String str) {
//Si el string empieza por f y termina en b decuelve FizzBuzz.
if(str.startsWith("f") && str.endsWith("b")){
return "FizzBuzz";
}
//Si el string empieza por f devuelve Fizz.
if(str.startsWith("f")){
return "Fizz";
}
//Si termina por b devuelve buzz.
if(str.endsWith("b")){
return "Buzz";
}
//En cualquier otro caso devuelve el string.
return str;
}
public String fizzString2(int n) {
//Si el resto de n entre 5 y entre 3 es 0(son pares) devuelve FizzBuzz.
if(n%3==0 && n%5==0 ){
return "FizzBuzz!";
}
//Si solo el resto de 3 es 0 (es par) devuelve Fizz.
if(n % 3 == 0){
return "Fizz!";
}
//Si solo es multiplo de 5 devuelve Buzz.
if(n % 5 == 0){
return "Buzz!";
}
//En cualquier otro caso se devuelve el valor de n con una exclamacion.
return n+ "!";
}
public boolean twoAsOne(int a, int b, int c) {
//Si la suma de 2 ints da como resultado igual que el tercer int devuelve true.
if(a+b==c || c+b==a || c+a==b){
return true;
}
//En cualquier otro caso devuelve false.
return false;
}
public boolean inOrder(int a, int b, int c, boolean bOk) {
//Si bOk esta en false y b es mayor que a y c es mayor que b devuelve true.
if(bOk == false && b > a && c > b){
return true;
}
//Si bOk esta en true b no tiene que ser mayor que a para devolver true.
if(bOk == true && c > b){
return true;
}
//En cualquier otro caso devuelve false.
return false;
}
public boolean inOrderEqual(int a, int b, int c, boolean equalOk) {
//Si equalOk esta en true los numeros pueden ser mayores o iguales de forma ascendente.
if(equalOk == true && (a <= b && b <= c)){
return true;
}
//Si equalOK esta en false deben ser mayores de forma ascendente para devolver true.
if(equalOk == false && a < b && b < c){
return true;
}
//En cualquier otro caso se devuelve false.
return false;
}
public boolean lastDigit(int a, int b, int c) {
//Creamos un int para cada uno de los restos de los ints a,b y c.
int ra = a % 10;
int rb = b % 10;
int rc = c % 10;
//Si alguno de los restos son iguales devuelve true.
if(ra == rb || rb == rc || ra == rc){
return true;
}
//En cualquier otro caso devuelve false.
return false;
}
public boolean lessBy10(int a, int b, int c) {
//Si algun int es igual a 10 o alguna resta de 2 posibles ints da igual o mayor que 10 devuelve true.
if(a - b >= 10 || b - c >= 10 || c - a >=10 || b - a >= 10 || c - b >= 10 || a - c >= 10 || b - a >= 10){
return true;
}
//En cualquier otro caso devuelve false.
return false;
}
public int withoutDoubles(int die1, int die2, boolean noDoubles) {
//Si noDoubles vale true y die1 es igual a 6 devuelve el valor de die1 + 1.
if(noDoubles == true && die1 == 6){
return die1 + 1;
}
//Si noDoubles vale true y los 2 dados son iguales devuelve la suma de los dados mas 1.
if(noDoubles == true && die1 == die2){
return die1+die2+1;
}
//En cualquier otro caso devuelve la suma de los 2 dados.
return die1+die2;
}
public int maxMod5(int a, int b) {
//Si los 2 valores son iguales devuelve 0.
if(a == b){
return 0;
}
//Si los restos de los 2 ints entre 5 da 0 se ejecuta el siguiente if.
if((a % 5) == (b % 5)){
//Este if devuelve
if(a > b ){
return b;
}
return a;
}
//Y este tambien devuelve el mas pequeño.
if(a > b){
return a;
}
if(b > a){
return b;
}
return a;
}
public int redTicket(int a, int b, int c) {
//Si todos los ints valen 2 devuelve 10.
if(a == b && b == c && a == 2){
return 10;
}
//Si todos son iguales y no valen 2 dvuelve 5.
if(a == b && b == c){
return 5;
}
//Si ninguno es igual devuelve 1.
if(a != b && c != a){
return 1;
}
//En cualquier otro caso devuelve 0.
return 0;
}
public int greenTicket(int a, int b, int c) {
//Si todos los ints son iguales devuelve 20.
if(a == b && b == c){
return 20;
}
//Si 2 ints son iguales devuelve 10.
if(a == b || b == c || c == a){
return 10;
}
//Si ninguno son iguales devuelve 0.
if(a != b && b != a){
return 0;
}
//En cualquier otro caso devuelve 1.
return 1;
}
public int blueTicket(int a, int b, int c) {
//Creamos un int para cada suma entre a, b y c.
int ab = a + b;
int bc = b + c;
int ac = c + a;
//Si alguna de las sumas da 10.
if(ab == 10 || bc == 10 || ac == 10){
return 10;
}
//Si alguna suma es mayor que diez devuelve 5.
if(ab - 10 == bc || ab - 10 == ac){
return 5;
}
//En cualquier otro caso devuelve 0.
return 0;
}
public boolean shareDigit(int a, int b) {
//Creamos variables con la division y los restos de a y b.
int primeroa = a / 10;
int segundoa = a % 10;
int primerob = b / 10;
int segundob = b % 10;
//Si alguno coincide devuelve true.
if(primeroa == primerob || primeroa == segundob || primerob == segundoa || segundoa == segundob){
return true;
}
//En cualquier otro caso devuelve false.
return false;
}
public int sumLimit(int a, int b) {
//Creamos un String con la longitud de a y de la suma de a y b.
String digitosa = String.valueOf(a);
String digitosab = String.valueOf(a + b);
//Si la longitud de a y la suma de a+b son iguales devuelve a+b
if(digitosab.length() == digitosa.length()){
return a + b;
}
//En el caso contrario solo devurelve a.
return a;
}
public int loneSum(int a, int b, int c) {
//Si los 3 son iguales devuelve 0.
if(a == b && b == c){
return 0;
}
//Si a y b son iguales devuelve c.
if(a == b){
return c;
}
//Si b y c son iguales devuelve a.
if(b == c){
return a;
}
//Si c y a son iguales devuelve b.
if(c == a){
return b;
}
//En cualquier otro caso devuelve la suma de los 3.
return a+b+c;
}
public int luckySum(int a, int b, int c) {
//Si a es igual a 13 devuelve 0.
if(a == 13){
return 0;
}
//Si b es igual a 13 devuelve a.
if(b == 13){
return a;
}
//Si c es igual a 13 devuelve a + b.
if(c == 13){
return a+b;
}
//En cualquier otro caso devuelve la suma de los 3.
return a+b+c;
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
//Creamos un objeto de la clase en la que estamos(Ejerciciosbasicosjava).
EjerciciosLogic1RodionBondarets ejercicio = new EjerciciosLogic1RodionBondarets();
//cigarparty
System.out.println("Ejercicio 1 cigarparty:");
System.out.println(ejercicio.cigarparty(30, false));
System.out.println(ejercicio.cigarparty(50, false));
System.out.println(ejercicio.cigarparty(70, true));
//dateFAshion
System.out.println("Ejercicio 2 dateFashion:");
System.out.println(ejercicio.dateFashion(5,10));
System.out.println(ejercicio.dateFashion(5,2));
System.out.println(ejercicio.dateFashion(5,5));
//squirrelPlay
System.out.println("Ejercicio 3 squirrelPlay");
System.out.println(ejercicio.squirrelPlay(70,false));
System.out.println(ejercicio.squirrelPlay(95,false));
System.out.println(ejercicio.squirrelPlay(95,true));
//caughtSpeeding
System.out.println("Ejercicio 4 caughtSpeeding");
System.out.println(ejercicio.caughtSpeeding(60,false));
System.out.println(ejercicio.caughtSpeeding(65,false));
System.out.println(ejercicio.caughtSpeeding(65,true));
//sortaSum
System.out.println("Ejercicio 5 sortaSum");
System.out.println(ejercicio.sortaSum(3,4));
System.out.println(ejercicio.sortaSum(9,4));
System.out.println(ejercicio.sortaSum(10,11));
//alarmClock
System.out.println("Ejercicio 6 alarmClock");
System.out.println(ejercicio.alarmClock(1,false));
System.out.println(ejercicio.alarmClock(5,false));
System.out.println(ejercicio.alarmClock(0,false));
//love6
System.out.println("Ejercicio 7 love6");
System.out.println(ejercicio.love6(6, 4));
System.out.println(ejercicio.love6(4, 5));
System.out.println(ejercicio.love6(1, 5));
//in1To10
System.out.println("in1To10");
System.out.println(ejercicio.in1To10(5, false));
System.out.println(ejercicio.in1To10(11, false));
System.out.println(ejercicio.in1To10(11, true));
//specialEleven
System.out.println("specialEleven");
System.out.println(ejercicio.specialEleven(22));
System.out.println(ejercicio.specialEleven(23));
System.out.println(ejercicio.specialEleven(24));
//more20
System.out.println("more20");
System.out.println(ejercicio.more20(20));
System.out.println(ejercicio.more20(21));
System.out.println(ejercicio.more20(22));
//old35
System.out.println("old35");
System.out.println(ejercicio.old35(3));
System.out.println(ejercicio.old35(10));
System.out.println(ejercicio.old35(15));
//less20
System.out.println("less20");
System.out.println(ejercicio.less20(18));
System.out.println(ejercicio.less20(19));
System.out.println(ejercicio.less20(20));
//nearTen
System.out.println("nearTen");
System.out.println(ejercicio.nearTen(12));
System.out.println(ejercicio.nearTen(17));
System.out.println(ejercicio.nearTen(19));
//teenSum
System.out.println("teenSum");
System.out.println(ejercicio.teenSum(3,4));
System.out.println(ejercicio.teenSum(10,13));
System.out.println(ejercicio.teenSum(13,2));
//answerCell
System.out.println("answerCell");
System.out.println(ejercicio.answerCell(false,false,false));
System.out.println(ejercicio.answerCell(false,false,true));
System.out.println(ejercicio.answerCell(true,false,false));
//teaParty
System.out.println("teaParty");
System.out.println(ejercicio.teaParty(6,8));
System.out.println(ejercicio.teaParty(3,8));
System.out.println(ejercicio.teaParty(20,6));
//fizzString
System.out.println("fizzString");
System.out.println(ejercicio.fizzString("fig"));
System.out.println(ejercicio.fizzString("dib"));
System.out.println(ejercicio.fizzString("fib"));
//fizzString2
System.out.println("ffizzString2");
System.out.println(ejercicio.fizzString2(1));
System.out.println(ejercicio.fizzString2(2));
System.out.println(ejercicio.fizzString2(3));
//twoAsOne
System.out.println("twoAsOne");
System.out.println(ejercicio.twoAsOne(1,2,3));
System.out.println(ejercicio.twoAsOne(3,1,2));
System.out.println(ejercicio.twoAsOne(3,2,2));
//inOrder
System.out.println("inOrder");
System.out.println(ejercicio.inOrder(1,2,4,false));
System.out.println(ejercicio.inOrder(3,2,1,false));
System.out.println(ejercicio.inOrder(1,1,2,true));
//inOrderEqual
System.out.println("inOrderEqual");
System.out.println(ejercicio.inOrderEqual(2,5,11,false));
System.out.println(ejercicio.inOrderEqual(5,7,6,false));
System.out.println(ejercicio.inOrderEqual(5,5,7,true));
//lastDigit
System.out.println("lastDigit");
System.out.println(ejercicio.lastDigit(23,19,13));
System.out.println(ejercicio.lastDigit(23,19,12));
System.out.println(ejercicio.lastDigit(23,19,3));
//lessBy10
System.out.println("lessBy10");
System.out.println(ejercicio.lessBy10(1,7,11));
System.out.println(ejercicio.lessBy10(1,7,10));
System.out.println(ejercicio.lessBy10(11,1,7));
//withoutDoubles
System.out.println("withoutDoubles");
System.out.println(ejercicio.withoutDoubles(2,3,true));
System.out.println(ejercicio.withoutDoubles(3,3,true));
System.out.println(ejercicio.withoutDoubles(3,3,false));
//maxMod5
System.out.println("maxMod5");
System.out.println(ejercicio.maxMod5(2,3));
System.out.println(ejercicio.maxMod5(6,2));
System.out.println(ejercicio.maxMod5(3,2));
//redTicket
System.out.println("redTicket");
System.out.println(ejercicio.redTicket(2,2,2));
System.out.println(ejercicio.redTicket(2,2,1));
System.out.println(ejercicio.redTicket(0,0,0));
//greenTicket
System.out.println("greenTicket");
System.out.println(ejercicio.greenTicket(1,2,3));
System.out.println(ejercicio.greenTicket(2,2,2));
System.out.println(ejercicio.greenTicket(1,1,2));
//blueTicket
System.out.println("blueTicket");
System.out.println(ejercicio.blueTicket(9,1,0));
System.out.println(ejercicio.blueTicket(9,2,0));
System.out.println(ejercicio.blueTicket(6,1,4));
//shareDigit
System.out.println("sumLimit");
System.out.println(ejercicio.sumLimit(2,3));
System.out.println(ejercicio.sumLimit(8,3));
System.out.println(ejercicio.sumLimit(8,1));
//loneSum
System.out.println("loneSum");
System.out.println(ejercicio.loneSum(1,2,3));
System.out.println(ejercicio.loneSum(3,2,3));
System.out.println(ejercicio.loneSum(3,3,3));
//luckySum
System.out.println("loneSum");
System.out.println(ejercicio.loneSum(1,2,3));
System.out.println(ejercicio.loneSum(3,2,13));
System.out.println(ejercicio.loneSum(1,13,3));
}
} | [
"Rodion@Rodion"
] | Rodion@Rodion |
bb970246ba710a229a86db803957788b6e0cdd03 | 6b04932fb387ac5045333d05a04821bf6bec66d6 | /spring-cloud-stream-binder-kafka/src/test/java/org/springframework/cloud/stream/binder/kafka/bootstrap/MultiBinderMeterRegistryTest.java | 8d4ad35f9dd2d6e1f59c02058f104e11d3b9003a | [
"Apache-2.0",
"LicenseRef-scancode-generic-cla"
] | permissive | yuchuang12/spring-cloud-stream-binder-kafka | e339f62beeb9c920b751a5a8af62fcdde2093a53 | 73d3d796513e200175648451b6c266d99082e97a | refs/heads/master | 2020-04-30T23:07:42.600578 | 2019-03-21T16:06:18 | 2019-03-21T16:06:27 | 177,136,945 | 1 | 0 | null | 2019-03-22T12:34:09 | 2019-03-22T12:34:08 | null | UTF-8 | Java | false | false | 2,488 | java | /*
* Copyright 2019-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cloud.stream.binder.kafka.bootstrap;
import io.micrometer.core.instrument.MeterRegistry;
import org.junit.ClassRule;
import org.junit.Test;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.messaging.Sink;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.kafka.test.rule.KafkaEmbedded;
import static org.assertj.core.api.Assertions.assertThat;
/**
* @author Soby Chacko
*/
public class MultiBinderMeterRegistryTest {
@ClassRule
public static KafkaEmbedded embeddedKafka = new KafkaEmbedded(1, true, 10);
@Test
public void testMetricsWorkWithMultiBinders() {
ConfigurableApplicationContext applicationContext = new SpringApplicationBuilder(
SimpleApplication.class).web(WebApplicationType.NONE).run(
"--spring.cloud.stream.bindings.input.destination=foo",
"--spring.cloud.stream.bindings.input.binder=inbound",
"--spring.cloud.stream.bindings.input.group=testGroupabc",
"--spring.cloud.stream.binders.inbound.type=kafka",
"--spring.cloud.stream.binders.inbound.environment"
+ ".spring.cloud.stream.kafka.binder.brokers" + "="
+ embeddedKafka.getBrokersAsString());
final MeterRegistry meterRegistry = applicationContext.getBean(MeterRegistry.class);
assertThat(meterRegistry).isNotNull();
assertThat(meterRegistry.get("spring.cloud.stream.binder.kafka.offset")
.tag("group", "testGroupabc")
.tag("topic", "foo").gauge().value()).isNotNull();
applicationContext.close();
}
@SpringBootApplication
@EnableBinding(Sink.class)
static class SimpleApplication {
}
}
| [
"ozhurakousky@pivotal.io"
] | ozhurakousky@pivotal.io |
c97d1812731226f930b661a5a163633ebf8da2be | 643d701fc59bf663dd8ec809576521147d54c313 | /src/main/java/gwt/jelement/svg/SVGLength.java | c60e22977b81872275f2e358c3119f067604cfef | [
"MIT"
] | permissive | gwt-jelement/gwt-jelement | 8e8cca46b778ed1146a2efd8be996a358f974b44 | f28303d85f16cefa1fc067ccb6f0b610cdf942f4 | refs/heads/master | 2021-01-01T17:03:07.607472 | 2018-01-16T15:46:44 | 2018-01-16T15:46:44 | 97,984,978 | 6 | 5 | null | null | null | null | UTF-8 | Java | false | false | 2,394 | java | /*
* Copyright 2017 Abed Tony BenBrahim <tony.benrahim@10xdev.com>
* and Gwt-JElement project contributors.
*
* 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 gwt.jelement.svg;
import gwt.jelement.core.IsObject;
import jsinterop.annotations.*;
@JsType(namespace = JsPackage.GLOBAL, name="SVGLength", isNative = true)
public class SVGLength implements IsObject {
public static short SVG_LENGTHTYPE_UNKNOWN; /* 0 */
public static short SVG_LENGTHTYPE_NUMBER; /* 1 */
public static short SVG_LENGTHTYPE_PERCENTAGE; /* 2 */
public static short SVG_LENGTHTYPE_EMS; /* 3 */
public static short SVG_LENGTHTYPE_EXS; /* 4 */
public static short SVG_LENGTHTYPE_PX; /* 5 */
public static short SVG_LENGTHTYPE_CM; /* 6 */
public static short SVG_LENGTHTYPE_MM; /* 7 */
public static short SVG_LENGTHTYPE_IN; /* 8 */
public static short SVG_LENGTHTYPE_PT; /* 9 */
public static short SVG_LENGTHTYPE_PC; /* 10 */
@JsProperty(name="unitType")
public native short getUnitType();
@JsProperty(name="value")
public native double getValue();
@JsProperty(name="value")
public native void setValue(double value);
@JsProperty(name="valueInSpecifiedUnits")
public native double getValueInSpecifiedUnits();
@JsProperty(name="valueInSpecifiedUnits")
public native void setValueInSpecifiedUnits(double valueInSpecifiedUnits);
@JsProperty(name="valueAsString")
public native String getValueAsString();
@JsProperty(name="valueAsString")
public native void setValueAsString(String valueAsString);
@JsMethod(name = "convertToSpecifiedUnits")
public native void convertToSpecifiedUnits(short unitType);
@JsMethod(name = "newValueSpecifiedUnits")
public native void newValueSpecifiedUnits(short unitType, double valueInSpecifiedUnits);
}
| [
"tony.benbrahim@gmail.com"
] | tony.benbrahim@gmail.com |
720b0780c113ee8f5df576c88408026c1b72bcc9 | 87748975e2fd5e0c6e639436d6d543055decf097 | /src/main/java/com/elisrs/repository/TexturatroncoRepository.java | 10db267a775ce4a60f2a52390ab1b968d1c30375 | [] | no_license | Liaelis/Web-Garden | 9898056c34ef9cc510c6e29e5965ea1ab82c67ba | b021ee59986a9bacbadfaddc3c4676cdbb8c9795 | refs/heads/master | 2022-12-03T14:13:32.659352 | 2020-08-21T14:42:50 | 2020-08-21T14:42:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 226 | java | package com.elisrs.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import com.elisrs.enty.Texturatronco;
public interface TexturatroncoRepository extends JpaRepository<Texturatronco, Integer> {
}
| [
"er.paisagista@gmail.com"
] | er.paisagista@gmail.com |
450a577217f865279aa40f156c4faf60ddd46564 | ae325aaac6c09d337eabe78b34a4c3e28b20167e | /src/tetris/app/Gra.java | dbbac5d054419668e2632285be007057e1f05b93 | [] | no_license | s21161/Tetris | 1239608afd597a7475f2d8fcf69d9414c1b71bc2 | 994129efbcb2f4d1c77986ea25d96d1c0a62eb1e | refs/heads/master | 2022-10-22T02:24:59.727342 | 2020-06-12T23:04:32 | 2020-06-12T23:04:32 | 271,900,170 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 197 | java | package tetris.app;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class Gra implements ActionListener{
public void actionPerformed(ActionEvent e) {
}
} | [
"boniekfacyx@gmail.com"
] | boniekfacyx@gmail.com |
167f0fe93386b9f302a3a455e3ac7b51ca4d79f1 | 055c1319b9362f194da6f25e0abb5ab2fa56a48a | /src/main/java/sk/pds/semestralka/SemestralkaApplication.java | 63798acd60f997c2c5fadacf46fc4018f2a4f5ec | [] | no_license | martingranak/semka | 1a3529b4b6b8761ff33140327f013fcba52c89fd | b5abd0b40ad3dec6f74ad725bf74a58ea9473c03 | refs/heads/master | 2020-04-13T16:00:10.274381 | 2019-01-09T07:08:28 | 2019-01-09T07:08:28 | 163,309,356 | 0 | 0 | null | 2019-01-08T17:48:51 | 2018-12-27T15:23:11 | Java | UTF-8 | Java | false | false | 475 | java | package sk.pds.semestralka;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import sk.pds.semestralka.model.Person;
import java.util.List;
@SpringBootApplication
@MapperScan("sk.pds.semestralka.mapper")
public class SemestralkaApplication {
public static void main(String[] args) {
SpringApplication.run(SemestralkaApplication.class, args);
}
}
| [
"granak3b@gmail.com"
] | granak3b@gmail.com |
9eb65535af640526b48ef732335ee3ef61be1fef | 20059c7e0d529c5bfb296e98f3d984a696c9e966 | /common/src/main/java/com/serenegiant/utils/ThreadPool.java | 0078da3c190baaaca586acd4277dfc5f392e0cd3 | [
"Apache-2.0"
] | permissive | pocketfpv/libcommon | 96ec5693c25793a7d1094d049ec7284c697aa8f6 | c5839d68581028dae530681f0a27c38b700f3871 | refs/heads/master | 2021-01-23T13:08:30.634537 | 2019-01-25T01:55:09 | 2019-01-25T01:55:09 | 93,223,526 | 0 | 0 | Apache-2.0 | 2019-01-25T01:55:10 | 2017-06-03T04:32:28 | Java | UTF-8 | Java | false | false | 1,885 | java | package com.serenegiant.utils;
/*
* libcommon
* utility/helper classes for myself
*
* Copyright (c) 2014-2018 saki t_saki@serenegiant.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import androidx.annotation.NonNull;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
public class ThreadPool {
// for thread pool
private static final int CORE_POOL_SIZE = 4; // initial/minimum threads
private static final int MAX_POOL_SIZE = 32; // maximum threads
private static final int KEEP_ALIVE_TIME = 10; // time periods while keep the idle thread
private static final ThreadPoolExecutor EXECUTOR
= new ThreadPoolExecutor(CORE_POOL_SIZE, MAX_POOL_SIZE, KEEP_ALIVE_TIME,
TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>());
static {
EXECUTOR.allowCoreThreadTimeOut(true); // this makes core threads can terminate
}
public static void preStartAllCoreThreads() {
// in many case, calling createBitmapCache method means start the new query
// and need to prepare to run asynchronous tasks
EXECUTOR.prestartAllCoreThreads();
}
public static void queueEvent(@NonNull final Runnable command) {
EXECUTOR.execute(command);
}
public static boolean removeEvent(@NonNull final Runnable command) {
return EXECUTOR.remove(command);
}
}
| [
"saki4510t@gmail.com"
] | saki4510t@gmail.com |
648619fbeef2d4ea7a4d3702a28d1f315780f4e8 | 7efa8352afe041bda68470471150f8318a43e641 | /app/src/main/java/com/fup/jennyferlopez/proyectokitetkiwe/activities/PantallaFinalActivity.java | 0638c3440528bde01f3ae9a39662dc6793f22738 | [] | no_license | jlopez19/KitetKiweRegistro | c1ebec538d08c6c78f82ff429a6f0a2a8b8e62cf | f2fe2ea18850eab5a374f3b2cefae2bcf59a0b8e | refs/heads/master | 2020-03-27T09:30:36.724565 | 2018-08-27T20:24:05 | 2018-08-27T20:24:05 | 146,347,678 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 433 | java | package com.fup.jennyferlopez.proyectokitetkiwe.activities;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import com.fup.jennyferlopez.proyectokitetkiwe.R;
public class PantallaFinalActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_pantalla_final);
}
}
| [
"jlo_1923@hotmail.com"
] | jlo_1923@hotmail.com |
4bed55c6513e32124c28d03c4d81e9bf51d898ab | bd62b66d15fdd96957c669e24ce599921d7b64b7 | /codes_and_references/DataStructureAndAlogorithm/Cs1102/programming practises/CS 1102 Practice/cs1102lab09ex2/Anagram.java | 059f6437bed3c2776a8902b4dab99821a9386c91 | [] | no_license | meowmeowwei/gitCPP | 4a5ff0af2f8f9d41782356d2de06c21544e8b5d4 | f54e375280ee83a8055f3749ba066c503901285b | refs/heads/master | 2021-07-11T10:01:34.518453 | 2021-04-02T04:49:48 | 2021-04-02T04:49:48 | 49,119,940 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,807 | java | ///////////////////////////////////////////////////
/////
///// LogName: u0706987
///// FullName: Cao Hoang Dang
///// CreationDate: 2008-10-27 17:21:17
/////
///////////////////////////////////////////////////
/*
*Name: Cao Hoang Dang
*Matric No.: U076987J
*Program: CS1102
*/
import java.io.*;
import java.util.*;
public class Anagram
{
public static void main(String args[]) throws IOException
{
//input 2 words to test
Scanner sc= new Scanner(System.in);
String word1,word2;
boolean isAnagram;
word1= sc.next();
word2=sc.next();
//put 2 words into vectors
Vector wordV1= new Vector(word1.length());
for(int i=0;i<word1.length();i++){
wordV1.add(i,word1.charAt(i));
}
Vector wordV2=new Vector(word2.length());
for(int i=0;i<word2.length();i++){
wordV2.add(i,word2.charAt(i));
}
//test whether 2 words are anagrams
if(word1.length()!=word2.length()){
isAnagram=false;
}
else{
isAnagram=true;
int j=0;
for(int i=0;i<wordV1.size();i++){
while((wordV1.elementAt(i)!=wordV2.elementAt(j))&&(j<wordV2.size())){
j++;
}
if (wordV1.elementAt(i)==wordV2.elementAt(j)){
wordV1.removeElementAt(i);
wordV2.removeElementAt(j);
j=0;
}
if (j==wordV2.size()){
isAnagram=false;
break;
}
}
}
if(isAnagram==true){
System.out.println("Yes");
}
else{
System.out.println("No");
}
}
}
| [
"sun_wei_9@msn.com"
] | sun_wei_9@msn.com |
4c9c9296959d2e44f5d6edf2bbe771d24b3e00d6 | ade3f05acfcef7e235845380d8940fa4933a4e99 | /app/src/main/java/com/example/HealthyCampus/module/Find/Recipes/ClassifierCamera/CameraPreview.java | a08f92aa1b9975bbcb52d396d7362446451ef335 | [] | no_license | Zhangguangte/HealthyCampus | 4c84ab2370d3445214b80dfdef98cdf34976d3f3 | 709b911be59358ea8fe45cfea7de316242e3f284 | refs/heads/master | 2020-07-03T12:37:54.570272 | 2020-01-10T17:04:36 | 2020-01-10T17:04:36 | 201,905,865 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,586 | java | package com.example.HealthyCampus.module.Find.Recipes.ClassifierCamera;
import android.content.Context;
import android.os.Build;
import android.util.AttributeSet;
import android.util.Log;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import com.example.HealthyCampus.common.utils.CameraUtils;
import com.orhanobut.logger.Logger;
import java.io.IOException;
public class CameraPreview extends SurfaceView implements SurfaceHolder.Callback {
private SurfaceHolder mHolder;
public CameraPreview(Context context) {
super(context);
init();
}
public CameraPreview(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
public CameraPreview(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init();
}
private void init() {
mHolder = getHolder();
mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
mHolder.addCallback(this);
}
@Override
public void surfaceCreated(SurfaceHolder holder) {
CameraUtils.openFrontalCamera(CameraUtils.DESIRED_PREVIEW_FPS);
Log.e("ClassifierCame:" + "123456", "qqqqqqqqqqqqqqqq");
}
@Override
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
CameraUtils.startPreviewDisplay(holder);
Log.e("ClassifierCame:" + "123456", "ssssssssssssssssss");
}
@Override
public void surfaceDestroyed(SurfaceHolder holder) {
CameraUtils.releaseCamera();
}
}
| [
"741737219@qq.com"
] | 741737219@qq.com |
32d5b88e46257ddca4153a9b67215ced825cd344 | 0eaa15aac3e6ced4c6d304fe7b793af2585ba56a | /quiz/src/quiz30/VoteRun.java | feb17cd54f64cf589073a1465f7b5a075caef0f8 | [] | no_license | JaeHyun-Ban/GB_java | c9505e9ffdb58cc30081b8467af7441b68e8e739 | 6601f01c2419a2543a2ba74841d87ac2e1ae6359 | refs/heads/master | 2023-01-01T10:04:56.160762 | 2020-10-26T03:38:52 | 2020-10-26T03:38:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,568 | java | package quiz30;
import java.util.Random;
import org.xml.sax.Locator;
public class VoteRun implements Runnable {
Random ran = new Random(); //랜덤 숫자
int sum = 0;
String star = ""; //별 개수 누적용
@Override
public void run() {
String location = Thread.currentThread().getName(); //이름
while (true) {
//한바퀴 회전시 랜덤수 생성
int num = ran.nextInt(15);
sum += num; //누적
if (sum < 100) { //개표율이 100 미만일 시
for(int i = 1; i <= num; i++) {
star += "*";
}
System.out.println(location + "의 개표율" + sum + "%:" + star);//같은 줄에 출력시키기 위해 한 작업임
try { //출력시간
Thread.sleep(1000);
} catch (Exception e) {
e.printStackTrace();
}
}else {//개표율이 100을 초과한 경우 -> 다시 sum을 100으로 변경
sum = 100;
star = ""; //초기화
for(int i = 1; i <= sum; i++) {
star += "*";
}
System.out.println(location + "의 개표율" + sum + "%:" + star);
break;
}
try {
Thread.sleep(1000);
} catch (Exception e) {
// TODO: handle exception
}
}
sum = 0;
System.out.println(location + "의 투표가 종료 되었습니다.");
}
//별을 찍고 있는 도중에 독립적으로 먼저 실행될 수 있다.(속도의 문제)
//상속문 안에 작성 시 반복되는게 출력보다 느림
// String star(int sum) {
// for(int i = 0; i < sum; i++) {
// star += "*";
// }
// return star;
// }
}
| [
"wogus0008@gmail.com"
] | wogus0008@gmail.com |
f01bde4649742acbfd5720045ca2f8e924637372 | c6bdc86605df7a03bd77a1ea6e3abd49c6b5eeb5 | /sources/com/google/zxing/multi/qrcode/detector/MultiFinderPatternFinder.java | b05fa3fcce1debbf844b1eff3f1c7dbaaf185688 | [] | no_license | vince-lynch/bozzys-padlock-hackiot | 9918481243489a558f7f8075b89409ee80fcc8c7 | 9e237f0e77045215d23a774b981c4d9915add06e | refs/heads/master | 2021-01-01T22:27:00.847944 | 2020-02-09T20:39:03 | 2020-02-09T20:39:03 | 239,369,941 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,172 | java | package com.google.zxing.multi.qrcode.detector;
import com.google.zxing.DecodeHintType;
import com.google.zxing.NotFoundException;
import com.google.zxing.ResultPoint;
import com.google.zxing.ResultPointCallback;
import com.google.zxing.common.BitMatrix;
import com.google.zxing.qrcode.detector.FinderPattern;
import com.google.zxing.qrcode.detector.FinderPatternFinder;
import com.google.zxing.qrcode.detector.FinderPatternInfo;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
final class MultiFinderPatternFinder extends FinderPatternFinder {
private static final float DIFF_MODSIZE_CUTOFF = 0.5f;
private static final float DIFF_MODSIZE_CUTOFF_PERCENT = 0.05f;
private static final FinderPatternInfo[] EMPTY_RESULT_ARRAY = new FinderPatternInfo[0];
private static final float MAX_MODULE_COUNT_PER_EDGE = 180.0f;
private static final float MIN_MODULE_COUNT_PER_EDGE = 9.0f;
private static final class ModuleSizeComparator implements Comparator<FinderPattern>, Serializable {
private ModuleSizeComparator() {
}
/* synthetic */ ModuleSizeComparator(ModuleSizeComparator moduleSizeComparator) {
this();
}
public int compare(FinderPattern finderPattern, FinderPattern finderPattern2) {
double estimatedModuleSize = (double) (finderPattern2.getEstimatedModuleSize() - finderPattern.getEstimatedModuleSize());
if (estimatedModuleSize < 0.0d) {
return -1;
}
return estimatedModuleSize > 0.0d ? 1 : 0;
}
}
MultiFinderPatternFinder(BitMatrix bitMatrix) {
super(bitMatrix);
}
MultiFinderPatternFinder(BitMatrix bitMatrix, ResultPointCallback resultPointCallback) {
super(bitMatrix, resultPointCallback);
}
private FinderPattern[][] selectMutipleBestPatterns() throws NotFoundException {
List possibleCenters = getPossibleCenters();
int size = possibleCenters.size();
int i = 3;
if (size >= 3) {
char c = 0;
if (size == 3) {
return new FinderPattern[][]{new FinderPattern[]{(FinderPattern) possibleCenters.get(0), (FinderPattern) possibleCenters.get(1), (FinderPattern) possibleCenters.get(2)}};
}
Collections.sort(possibleCenters, new ModuleSizeComparator(null));
ArrayList arrayList = new ArrayList();
for (int i2 = 0; i2 < size - 2; i2++) {
FinderPattern finderPattern = (FinderPattern) possibleCenters.get(i2);
if (finderPattern != null) {
for (int i3 = i2 + 1; i3 < size - 1; i3++) {
FinderPattern finderPattern2 = (FinderPattern) possibleCenters.get(i3);
if (finderPattern2 != null) {
float estimatedModuleSize = (finderPattern.getEstimatedModuleSize() - finderPattern2.getEstimatedModuleSize()) / Math.min(finderPattern.getEstimatedModuleSize(), finderPattern2.getEstimatedModuleSize());
float abs = Math.abs(finderPattern.getEstimatedModuleSize() - finderPattern2.getEstimatedModuleSize());
float f = DIFF_MODSIZE_CUTOFF;
int i4 = (abs > DIFF_MODSIZE_CUTOFF ? 1 : (abs == DIFF_MODSIZE_CUTOFF ? 0 : -1));
float f2 = DIFF_MODSIZE_CUTOFF_PERCENT;
if (i4 > 0 && estimatedModuleSize >= DIFF_MODSIZE_CUTOFF_PERCENT) {
break;
}
int i5 = i3 + 1;
while (i5 < size) {
FinderPattern finderPattern3 = (FinderPattern) possibleCenters.get(i5);
if (finderPattern3 != null) {
float estimatedModuleSize2 = (finderPattern2.getEstimatedModuleSize() - finderPattern3.getEstimatedModuleSize()) / Math.min(finderPattern2.getEstimatedModuleSize(), finderPattern3.getEstimatedModuleSize());
if (Math.abs(finderPattern2.getEstimatedModuleSize() - finderPattern3.getEstimatedModuleSize()) > f && estimatedModuleSize2 >= f2) {
break;
}
FinderPattern[] finderPatternArr = new FinderPattern[i];
finderPatternArr[c] = finderPattern;
finderPatternArr[1] = finderPattern2;
finderPatternArr[2] = finderPattern3;
ResultPoint.orderBestPatterns(finderPatternArr);
FinderPatternInfo finderPatternInfo = new FinderPatternInfo(finderPatternArr);
float distance = ResultPoint.distance(finderPatternInfo.getTopLeft(), finderPatternInfo.getBottomLeft());
float distance2 = ResultPoint.distance(finderPatternInfo.getTopRight(), finderPatternInfo.getBottomLeft());
float distance3 = ResultPoint.distance(finderPatternInfo.getTopLeft(), finderPatternInfo.getTopRight());
float estimatedModuleSize3 = (distance + distance3) / (finderPattern.getEstimatedModuleSize() * 2.0f);
if (estimatedModuleSize3 <= MAX_MODULE_COUNT_PER_EDGE && estimatedModuleSize3 >= MIN_MODULE_COUNT_PER_EDGE && Math.abs((distance - distance3) / Math.min(distance, distance3)) < 0.1f) {
float sqrt = (float) Math.sqrt((double) ((distance * distance) + (distance3 * distance3)));
if (Math.abs((distance2 - sqrt) / Math.min(distance2, sqrt)) < 0.1f) {
arrayList.add(finderPatternArr);
}
}
}
i5++;
i = 3;
c = 0;
f = DIFF_MODSIZE_CUTOFF;
f2 = DIFF_MODSIZE_CUTOFF_PERCENT;
}
}
}
}
}
if (!arrayList.isEmpty()) {
return (FinderPattern[][]) arrayList.toArray(new FinderPattern[arrayList.size()][]);
}
throw NotFoundException.getNotFoundInstance();
}
throw NotFoundException.getNotFoundInstance();
}
public FinderPatternInfo[] findMulti(Map<DecodeHintType, ?> map) throws NotFoundException {
boolean z = map != null && map.containsKey(DecodeHintType.TRY_HARDER);
boolean z2 = map != null && map.containsKey(DecodeHintType.PURE_BARCODE);
BitMatrix image = getImage();
int height = image.getHeight();
int width = image.getWidth();
int i = (int) ((((float) height) / 228.0f) * 3.0f);
if (i < 3 || z) {
i = 3;
}
int[] iArr = new int[5];
for (int i2 = i - 1; i2 < height; i2 += i) {
iArr[0] = 0;
iArr[1] = 0;
iArr[2] = 0;
iArr[3] = 0;
iArr[4] = 0;
int i3 = 0;
for (int i4 = 0; i4 < width; i4++) {
if (image.get(i4, i2)) {
if ((i3 & 1) == 1) {
i3++;
}
iArr[i3] = iArr[i3] + 1;
} else if ((i3 & 1) != 0) {
iArr[i3] = iArr[i3] + 1;
} else if (i3 != 4) {
i3++;
iArr[i3] = iArr[i3] + 1;
} else if (!foundPatternCross(iArr) || !handlePossibleCenter(iArr, i2, i4, z2)) {
iArr[0] = iArr[2];
iArr[1] = iArr[3];
iArr[2] = iArr[4];
iArr[3] = 1;
iArr[4] = 0;
i3 = 3;
} else {
iArr[0] = 0;
iArr[1] = 0;
iArr[2] = 0;
iArr[3] = 0;
iArr[4] = 0;
i3 = 0;
}
}
if (foundPatternCross(iArr)) {
handlePossibleCenter(iArr, i2, width, z2);
}
}
FinderPattern[][] selectMutipleBestPatterns = selectMutipleBestPatterns();
ArrayList arrayList = new ArrayList();
for (FinderPattern[] finderPatternArr : selectMutipleBestPatterns) {
ResultPoint.orderBestPatterns(finderPatternArr);
arrayList.add(new FinderPatternInfo(finderPatternArr));
}
if (arrayList.isEmpty()) {
return EMPTY_RESULT_ARRAY;
}
return (FinderPatternInfo[]) arrayList.toArray(new FinderPatternInfo[arrayList.size()]);
}
}
| [
"autovincelynch@gmail.com"
] | autovincelynch@gmail.com |
74c543371c80feecb5246a2a5d62232397322bed | 22abd60cfadca17360b82616136525fd7526b8a1 | /src/main/java/pl/mis/glycemicloadcalculator/mapper/MultipleProductsRequest.java | 82d83bfc581e26f2988a15b14c97244eea55e465 | [] | no_license | mon-sliw/GlycemicLoadCalculator | de4e83cc761c65c6cc6f0e50219dcfce5105c8ab | 4ad39eb48046a07ee7e7d0053d13847cf3e48e35 | refs/heads/master | 2023-05-09T23:20:38.241356 | 2021-05-30T15:04:47 | 2021-05-30T15:04:47 | 364,669,553 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 179 | java | package pl.mis.glycemicloadcalculator.mapper;
import lombok.Data;
import java.util.List;
@Data
public class MultipleProductsRequest {
List<OneProductRequest> products;
}
| [
"nika.1993@interia.pl"
] | nika.1993@interia.pl |
74baaaa0251ef62e52a91ae69119ecd60d41deab | 12f51fae235cff2b20e11506399d99851c682d97 | /src/test/java/com/codedifferently/bankaccountlab/CheckingAccountTest.java | 50d9f0cee6bf8c36aabda6e16304647555045162 | [] | no_license | lavendermistyco/StayReady09-AccountManager | f4fa8b51c648aec73a37bd2420f58227b2c9c117 | eaede57461f8c7928918daeedd34694988fd38f5 | refs/heads/master | 2022-11-23T21:47:25.419684 | 2020-08-03T04:13:01 | 2020-08-03T04:13:01 | 280,483,144 | 0 | 0 | null | 2020-07-17T17:15:02 | 2020-07-17T17:15:01 | null | UTF-8 | Java | false | false | 585 | java | package com.codedifferently.bankaccountlab;
import org.junit.Test;
import org.junit.Assert;
public class CheckingAccountTest {
CheckingAccount check = new CheckingAccount(99, "Bob", 9864, 23.0);
@Test
public void depositTest(){
Double expected = 750.00;
check.deposit(250.0);
Double actual = check.getBalance();
Assert.assertEquals(expected, actual);
}
@Test
public void withdrawalTest(){
Double expected = 250.00;
check.withdrawal(250.0);
Double actual = check.getBalance();
Assert.assertEquals(expected, actual);
}
} | [
"fwilkins@terpmail.umd.edu"
] | fwilkins@terpmail.umd.edu |
75148de2578aae9a7e2805a0ae91a4e64b16c876 | 6803987319036e73f92429e357aa3ab8b49c3392 | /struts2/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/velocity/components/DojoAbstractDirective.java | d46a09c551694a878f1419134d36bf7a32427d38 | [] | no_license | oliverswan/OpenSourceReading | 8705eac278c3b73426f6d08fc41d14e245b3b97c | 30f5ae445dc1ca64b071dc2f5d3bb5b963a5e705 | refs/heads/master | 2022-10-27T20:34:16.228853 | 2012-11-03T01:18:13 | 2012-11-03T01:18:13 | 5,302,570 | 0 | 1 | null | 2022-10-04T23:36:00 | 2012-08-05T10:19:28 | Java | UTF-8 | Java | false | false | 1,236 | java | /*
* $Id: DojoAbstractDirective.java 651946 2008-04-27 13:41:38Z apetrelli $
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.dojo.views.velocity.components;
import org.apache.struts2.views.velocity.components.AbstractDirective;
/**
* Overwrite name prefix
*
*/
public abstract class DojoAbstractDirective extends AbstractDirective {
public String getName() {
return "sx" + getBeanName();
}
}
| [
"li.fu@agree.com.cn"
] | li.fu@agree.com.cn |
6143eb04806c0f90278f66a8e5a6b1139f802abe | bb4633e5bee242d05c1a5a6c5d6899d0f9e787e2 | /hercules-protocol/src/main/java/ru/kontur/vostok/hercules/protocol/Sizes.java | e4fdd453db94ae8fcbefaa4c0128f2197adff621 | [
"MIT"
] | permissive | vostok/hercules | 3390b63497fc2b6807cd1ee1050bb1cc33b3ed3e | a34350ff31ed043e95ccc641dd5ed04607d915fb | refs/heads/master | 2023-06-24T15:46:59.184702 | 2023-03-02T05:27:27 | 2023-03-02T05:27:27 | 160,483,178 | 42 | 10 | MIT | 2023-06-20T16:36:20 | 2018-12-05T08:10:06 | Java | UTF-8 | Java | false | false | 550 | java | package ru.kontur.vostok.hercules.protocol;
/**
* Define size in bytes for data types and auxiliary structures.
*
* @author Gregory Koshelev
*/
public class Sizes {
private static final int SIZE_OF_STRING_LENGTH = Type.INTEGER.size;
/**
* Size of string length.
*
* @return size of string length
*/
private static int sizeOfStringLength() {
return SIZE_OF_STRING_LENGTH;
}
public static int sizeOfString(byte[] data) {
return sizeOfStringLength() + Type.BYTE.size * data.length;
}
}
| [
"gnkoshelev@gmail.com"
] | gnkoshelev@gmail.com |
662d94cc2877ccc8a82ea68def20ac430929da48 | 35e46a270d1de548763c161c0dac554282a33d9d | /CFEC-DevR3/cfec.service/src/main/java/bo/gob/sin/sre/fac/cfec/servicedomain/IUtilitarios.java | 56657710b114cb94acb2ed12c9a0122740788b42 | [] | no_license | cruz-victor/ServiciosSOAPyRESTJavaSpringBoot | e817e16c8518b3135a26d7ad7f6b0deb8066fe42 | f04a2b40b118d2d34269c4f954537025b67b3784 | refs/heads/master | 2023-01-07T11:09:30.758600 | 2020-11-15T14:01:08 | 2020-11-15T14:01:08 | 312,744,182 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,645 | java | package bo.gob.sin.sre.fac.cfec.servicedomain;
import java.awt.image.BufferedImage;
import java.util.List;
import bo.gob.sin.sre.fac.cfec.dto.XmlRecepcionGenericoDto;
public interface IUtilitarios {
/**
* @autor edwin.coro
* @descripción decodifica archivo enviado en servicio SOAP
* @param pArchivo archivo recibido en servicio SOAP en formato string
* @return archivo xml en formato String, null si existe error
* @fecha 12/11/2018
*/
public String decodificarArchivo(String pArchivo);
/**
* @autor edwin.coro
* @descripción metodo que descomprime paquete y obtiene un listado con los
* archivos xml que contenga el paquete
* @param compressed
* @return obtiene listado de documentos fiscales en formato xml
* @fecha 15/11/2018
*/
public List<String> decompressLoteFacturas(byte[] compressed);
/**
* @param <T>
* @autor edwin.coro
* @descripción mapea facturea de archivo xml a estructura dto
* (cabecera/detalle)
* @param vXmlFactura factura en formato xml
* @param pDto dto que contiene cabecera detalle de la factura
* @return null si existio error, object con mapeo realizado
* @fecha 13/11/2018
*/
public <T> T mapearXmlToDto(String pXmlFactura, Class<?> pObjetoDto);
/**
* @autor reynaldo chambi
* @descripción
* @param Encode
* @return
* @fecha 13/12/2018
*/
public String codificarToBase64(String pArchivo);
/**
* @autor edwin.coro
* @descripción metodo que compara si un archivo xml cumple la estructura de un
* archivo xsd
* @param pArchivoXml archivo xml en formato string
* @param nombreArchivoXsd nombre del archivo xsd (dichos archivos deben estar
* en el mismo repositorio que la clase IUtilitarios)
* @return true si es valido, caso contrario false,
* @fecha 14/12/2018
*/
public boolean validarXmlXsd(String pArchivoXml, String nombreArchivoXsd);
/**
* @autor edwin.coro
* @descripción obtiene cadena xml exceptuando tag signature, a partir de un
* documento fiscal electronico
* @param pArchivoXml documento fiscal electronico en formato xml
* @return cadena en formato xml (quitando tag signature)
* @fecha 06/05/2019
*/
public String formatearSignature(String pArchivoXml);
/**
* @autor edwin.coro
* @descripción decodifica cadena codificada en base 64
* @param pArchivo cadena codificada en base 64
* @return cadena decodificada
* @fecha 06/05/2019
*/
public String decodificarToBase64(String pArchivo);
/**
* @autor edwin.coro
* @descripción valida una cadena en formato xml contra un archivo xsd
* @param archivoXml cadena en formato xml
* @param nombreArchivoXsd nombre del archivo xsd con el que se validara el
* archivo xml
* @return lista con codigo de error si xml no cumple estructura de archivo xsd
* @fecha 06/05/2019
*/
public List<Integer> validarFacturaXml(String archivoXml, String nombreArchivoXsd);
/**
* @autor edwin.coro
* @descripción metodo que compara si un archivo xml cumple la estructura de un
* archivo xsd y lista la descripcion de los errores
* correspondientes
* @param pArchivoXml archivo xml en formato string
* @param nombreArchivoXsd nombre del archivo xsd (dichos archivos deben estar
* en el mismo repositorio que la clase IUtilitarios)
* @return lista de descripcion de errores.
* @fecha 08/05/2019
*/
public List<String> obtenerErroresXmlXsd(String pArchivoXml, String nombreArchivoXsd);
/**
* @autor freddy yuca
* @descripción metodo que obtiene los string de archivos codificados desde una
* ruta local de una factura xml
* @param pRuta archivo xml de la factura
* @return lista de cadenas, archivo codificado y sha.
* @fecha 24/05/2019
*/
public List<String> obtenerArchivosEnvio(String pRuta);
/**
* @autor junior.flores
* @descripción Método que realiza la inserción de los log para la certificación
* de sistemas
* @param pXmlRecGenDto archivo en formato xml pListaErrores Listado de los
* codigos de los errores luego de la validación
* @fecha 04/06/2019
*/
public void registrarLogCertificacionSistemas(XmlRecepcionGenericoDto pXmlRecGenDto, List<Integer> pListaErrores);
public BufferedImage generarImagenQR(String pUrl, String pCuf, Long pNitEmisor, Integer pNumeroFactura);
/**
* @autor reynaldo.chambi
* @descripción conteo de cantidad de archivos
* @fecha 27/09/2019
*/
public int obtenerCantidadPaquete(String pArchivo);
} | [
"cruz.gomez.victor@gmail.com"
] | cruz.gomez.victor@gmail.com |
993c8c9299551742b44e3d8957afe4993e25f21f | c91086e1f0a162a9a13ec845a357605a88837d47 | /src/main/java/cn/xcloude/QRCodeNews/serviceImpl/NewsServiceImpl.java | 98da469cddfa8c501ff845d46b66f822c39f1c54 | [
"Apache-2.0"
] | permissive | xiongshengjie/QRCodeNews | 22fde5791df309fa40d698a603c4c9c1ce36dc25 | 7cbb93a95a81b9c879b7ac960431d650a70aa4b8 | refs/heads/master | 2023-04-17T04:43:04.985037 | 2023-04-08T04:39:50 | 2023-04-08T04:39:50 | 117,482,411 | 0 | 0 | Apache-2.0 | 2023-02-22T03:37:38 | 2018-01-15T01:28:36 | Java | UTF-8 | Java | false | false | 7,086 | java | package cn.xcloude.QRCodeNews.serviceImpl;
import cn.xcloude.QRCodeNews.constant.Api;
import cn.xcloude.QRCodeNews.constant.Constants;
import cn.xcloude.QRCodeNews.entity.News;
import cn.xcloude.QRCodeNews.mapper.NewsMapper;
import cn.xcloude.QRCodeNews.service.NewsService;
import cn.xcloude.QRCodeNews.utils.FileUploadUtils;
import cn.xcloude.QRCodeNews.utils.HtmlUtil;
import cn.xcloude.QRCodeNews.utils.IdUtils;
import com.github.pagehelper.PageHelper;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.io.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static cn.xcloude.QRCodeNews.constant.Api.SERVER_ERROR_MESSAGE;
/**
* @author XiongShengjie
* @date 2018/1/15 下午 3:11
*/
@Service("newsService")
public class NewsServiceImpl implements NewsService {
private Logger log = LoggerFactory.getLogger(NewsServiceImpl.class);
@Autowired
private NewsMapper newsMapper;
public Map<String, Object> publishNews(MultipartFile[] files, String title, String author, String category, String html, HttpServletRequest request) {
Map<String, Object> result = new HashMap<>();
StringBuilder allImgUrlBuilder = new StringBuilder();
// 根据日期得到目录
String randomDir = FileUploadUtils.generateRandomDir();
if (files != null && files.length > 0) {
Document doc = Jsoup.parseBodyFragment(html);
Element element = doc.body();
Elements elements = element.getElementsByTag("img");
// 图片存储父目录
String imgurlParent = "img" + randomDir;
File parentDir = new File(request.getServletContext().getRealPath(imgurlParent));
// 验证目录是否存在,如果不存在,创建出来
if (!parentDir.exists()) {
parentDir.mkdirs();
}
for (MultipartFile file : files) {
boolean flag = false;
String fileName = file.getOriginalFilename();
// 得到随机名称
String randomName = FileUploadUtils.generateRandonFileName(fileName);
String imgurl = imgurlParent + "/" + randomName;
for (Element imgNode : elements) {
String src = imgNode.attr("src");
if (fileName.equals(src.substring(src.lastIndexOf('/') + 1, src.length()))) {
imgNode.attr("src", Constants.baseUrl + "/" + imgurl);
elements.remove(element);
flag = true;
}
}
if(flag) {
allImgUrlBuilder.append(Constants.baseUrl + "/" + imgurl + "|");
File diskFile = new File(parentDir + "/" + randomName);
try {
file.transferTo(diskFile);
} catch (IOException e) {
log.error("图片上传IO异常:" + e);
result.put(Api.STATUS, Api.SERVER_ERROR);
result.put(Api.MESSAGE, SERVER_ERROR_MESSAGE);
return result;
}
}
}
html = doc.body().toString();
}
String htmlParent = "html" + randomDir;
String randomHtml = HtmlUtil.randomHtmlFileName();
File parentDir = new File(request.getServletContext().getRealPath(htmlParent));
if (!parentDir.exists()) {
parentDir.mkdirs();
}
File diskFile = new File(parentDir + "/" + randomHtml);
try (
FileOutputStream fos = new FileOutputStream(diskFile);
OutputStreamWriter osw = new OutputStreamWriter(fos, "UTF-8");
) {
osw.write(HtmlUtil.buildHtml(html, title));
} catch (UnsupportedEncodingException e) {
log.error("编码异常:" + e);
} catch (FileNotFoundException e) {
log.error("文件写入NotFound异常:" + e);
result.put(Api.STATUS, Api.SERVER_ERROR);
result.put(Api.MESSAGE, SERVER_ERROR_MESSAGE);
return result;
} catch (IOException e) {
log.error("文件写入IO异常:" + e);
result.put(Api.STATUS, Api.SERVER_ERROR);
result.put(Api.MESSAGE, SERVER_ERROR_MESSAGE);
return result;
}
String allImgUrl = allImgUrlBuilder.toString();
String id = IdUtils.getUUID();
News recordNew = new News(id, title, Constants.baseUrl + "/" + htmlParent + "/" + randomHtml, author, allImgUrl, Integer.parseInt(category));
newsMapper.insertSelective(recordNew);
result.put(Api.STATUS, Api.SUCCESS);
result.put(Api.MESSAGE, "发布成功");
result.put("result", recordNew);
return result;
}
@Override
public Map<String, Object> listNews(int category, int pageNum, int pageCount) {
PageHelper.startPage(pageNum, pageCount);
List<News> news = newsMapper.selectByCategoryPage(category);
Map<String, Object> result = new HashMap<>();
result.put(Api.STATUS, Api.SUCCESS);
result.put(Api.MESSAGE, "获取成功");
result.put("result", news);
return result;
}
@Override
public Map<String, Object> getNewsById(String id) {
Map<String,Object> result = new HashMap<>();
News news = newsMapper.selectByPrimaryKey(id);
if(news == null){
result.put(Api.STATUS,Api.NO_NEWS_ERROR);
result.put(Api.MESSAGE,"查无此文");
return result;
}
result.put(Api.STATUS,Api.SUCCESS);
result.put(Api.MESSAGE,"获取成功");
result.put("result",news);
return result;
}
@Override
public Map<String, Object> listNewsByUser(String userId, int pageNum, int pageCount) {
PageHelper.startPage(pageNum, pageCount);
List<News> list = newsMapper.selectByUserPage(userId);
Map<String,Object> result = new HashMap<>();
result.put(Api.STATUS, Api.SUCCESS);
result.put(Api.MESSAGE, "获取成功");
result.put("result", list);
return result;
}
@Override
public Map<String, Object> delNews(String id) {
int flag = newsMapper.deleteByPrimaryKey(id);
Map<String,Object> result = new HashMap<>();
if(flag > 0){
result.put(Api.STATUS, Api.SUCCESS);
result.put(Api.MESSAGE, "删除成功");
return result;
}else {
result.put(Api.STATUS, Api.ERROR);
result.put(Api.MESSAGE, "删除失败");
return result;
}
}
}
| [
"1145421439@qq.com"
] | 1145421439@qq.com |
69112cf233b8f8e3e768aeadddb2d38b8d99460a | d49f5de576d96beff5d172ce922a140a1305cf5d | /Oblig4_Datakom_Sikkerhet/src/VerSig.java | 123e22a5bd134626561e573563dd19755fb26c14 | [] | no_license | d1cte/Oblig4_ITE1806 | 0c8bddecf7ce58dc5ddb7692515844264017cce3 | e1fdb79c078837649979fa56c587587ccbff691f | refs/heads/master | 2020-06-18T03:04:53.204306 | 2016-11-29T02:04:48 | 2016-11-29T02:04:48 | 74,956,227 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,812 | java | import java.io.*;
import java.security.*;
class VerSig {
static String keystoreName = "friendskeystore";
static KeyStore keystore;
static char[] keystorePassword;
static String certificateAlias;
static java.security.cert.Certificate certificate;
static PublicKey publicKey;
public static void main(String[] args) {
if (args.length != 4) {
System.out.println("Usage: VerSig " + "certificateAlias " + "password " + "signaturefile " + "datafile");
}
else try {
certificateAlias = args[0];
keystorePassword = args[1].toCharArray();
String signatureFile = args[2];
String dataFile = args[3];
inputKeystore();
setCertificateAndPublicKey();
byte[] signatureToVerify = inputSignatureBytes(signatureFile);
// Initialize signature object for verification
Signature signature = Signature.getInstance("SHA256withRSA", "SunRsaSign");
signature.initVerify(publicKey);
boolean verifies = verifySignatureWithData(signature, signatureToVerify, dataFile);
System.out.println("signature verifies: " + verifies);
} catch (Exception e) {
System.err.println("Caught exception " + e.toString());
}
}
public static void inputKeystore() throws Exception {
keystore = KeyStore.getInstance("JKS");
FileInputStream keystoreFis = new FileInputStream(keystoreName);
BufferedInputStream keystoreBufin = new BufferedInputStream(keystoreFis);
keystore.load(keystoreBufin, keystorePassword);
}
public static void setCertificateAndPublicKey() throws Exception {
certificate = keystore.getCertificate(certificateAlias);
publicKey = certificate.getPublicKey();
}
public static byte[] inputSignatureBytes(String signatureFile) throws Exception {
// Input signature bytes
FileInputStream signatureFis = new FileInputStream(signatureFile);
byte[] signatureToVerify = new byte[signatureFis.available()];
signatureFis.read(signatureToVerify);
signatureFis.close();
return signatureToVerify;
}
public static boolean verifySignatureWithData(Signature signature, byte[] signatureToVerify, String dataFile) throws Exception {
// Supply the Signature Object with the Data to be verified
FileInputStream datafis = new FileInputStream(dataFile);
BufferedInputStream bufin = new BufferedInputStream(datafis);
byte[] buffer = new byte[1024];
int len;
while (bufin.available() != 0) {
len = bufin.read(buffer);
signature.update(buffer, 0, len);
};
bufin.close();
// Verify the signature
return signature.verify(signatureToVerify);
}
} | [
"bka049@post.uit.no"
] | bka049@post.uit.no |
02fa4ea41540b6dc04709b2e5bf841c474666793 | 74b6018e594e5cba71d3e26ef70884c92abde0c0 | /mmstudio/src/main/java/org/micromanager/internal/utils/SortFunctionObjects.java | d44a7e0a3c0a048241386b8a41a45d5ef8310a1b | [
"BSD-3-Clause"
] | permissive | lwxGitHub123/micro-manager | 4b5caec8f25de2b7a9e92e7883eecc026fdc08b9 | a945fdf550ba880744b5b3695fa2c559505f735b | refs/heads/main | 2023-06-24T13:00:29.082165 | 2021-07-29T07:24:13 | 2021-07-29T07:24:13 | 382,203,845 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,447 | java | package org.micromanager.internal.utils;
import java.text.ParseException;
import java.util.Comparator;
public final class SortFunctionObjects
{
/* comparators for GUI ordering of numeric strings
* *
*/
// Comparators for sorting of the possible values
public static class IntStringComp implements Comparator<String>{
@Override
public int compare(String strA, String strB)
{
int valA = 0;
int valB = 0;
try {
valA = NumberUtils.coreStringToInt(strA);
valB = NumberUtils.coreStringToInt(strB);
} catch (ParseException e) {
ReportingUtils.logError(e);
}
return valA - valB;
}
}
public static class DoubleStringComp implements Comparator<String>{
@Override
public int compare(String strA, String strB)
{
double valA = 0.;
double valB = 0.;
try {
valA = NumberUtils.coreStringToDouble(strA);
valB = NumberUtils.coreStringToDouble(strB);
} catch (ParseException e) {
ReportingUtils.logError(e);
}
return Double.compare(valA, valB);
}
}
public static class NumericPrefixStringComp implements Comparator<String>{
private int NumericPrefix( String str0){
int ret = 0;
int ii;
for (ii= 0; ii < str0.length(); ++ii ){
if( !Character.isDigit(str0.charAt(ii))) break;
}
if( 0 < ii)
ret = Integer.valueOf(str0.substring(0,ii));
return ret;
}
@Override
public int compare(String strA, String strB) {
return NumericPrefix(strA) - NumericPrefix(strB) ;
}
}
}
| [
"test@test.com"
] | test@test.com |
2183028f0bd71c00f2a5518a0fb5311ba202d104 | bad08ce4b707f8d479a6f9d6562f90d397042df7 | /Zookeeper/ZooKeeper-Watcher机制.java | 6b6608038363873bcdad11ddaf94d7e63f3f741b | [] | no_license | lengyue1024/notes | 93bf4ec614cbde69341bc7e4decad169a608ff39 | 549358063da05057654811a352ae408e48498f25 | refs/heads/master | 2020-04-29T07:14:45.482919 | 2019-03-16T07:51:26 | 2019-03-16T07:51:26 | 175,945,339 | 2 | 0 | null | 2019-03-16T08:19:53 | 2019-03-16T08:19:52 | null | GB18030 | Java | false | false | 2,303 | java |
--------------------------------
Watcher 机制 |
--------------------------------
# ZK提供了一种订阅发布的功能 Watcher
* 一对多,多个订阅监听一个主题,当主题有变化,会通知到所有的订阅者
# ZK的事件
节点的创建
节点的修改
节点的删除
子节点变化
# Watcher机制的过程
1,客户端向服务端注册Watcher
2,服务端事件发生触发Watcher
3,客户端回调Watcher得到触发事件情况
# Wather机制特点
* 一次性触发
* 事件发生 触发监听,一个 watcher event 就会被送到设置监听的客户端
* 这种效果是一次性的,后续再次发生相同的事件,不会再次触发
* 事件封装
* ZK使用WatcherEvent对象来封装服务端事件并传递
* WatcheEvent 包含了每一个事件的三个基本属性
KeeperState 通知状态
@Deprecated
Unknown (-1),
Disconnected (0),
@Deprecated
NoSyncConnected (1),
SyncConnected (3),
AuthFailed (4),
ConnectedReadOnly (5),
SaslAuthenticated(6),
Expired (-112);
EventType 事件类型
None (-1),
NodeCreated (1),
NodeDeleted (2),
NodeDataChanged (3),
NodeChildrenChanged (4);
Path 节点路径
* event异步发送
* Watcher通知事件从服务端发送到客户端是异步的
* 先注册再触发
* 客户端必须先在服务端注册了监听,才能收到服务端的事件触发通知
# 通知状态和事件类型
SyncConnected
|-None
* 客户端与服务端成功建立连接
|-NodeCreated
* 监听的节点被创建
|-NodeDeleted
* 监听的节点被删除
|-NodeDataChanged
* 监听节点的数据发生修改
|-NodeChildrenChanged
* 监听节点的子节点发生改变
Disconnected
|-None
* 客户端与Zookeeper服务端断开连接
Expired
|-None
* 会话超时
* 通常也会收到 SessionExpiredException 异常
AuthFailed
|-None
* 一般有两种情况
1,使用错误的 schema 进行权限校验
2,SASL 权限检查失败
* 同时也会收到 AuthFailedException
* 连接状态事件(EventType=None,Path=null),不需要客户端主动注册
* 客户端只要有需要,直接处理即可
| [
"747692844@qq.com"
] | 747692844@qq.com |
68ab2c4f8353b301037826dd17fa6be7b0452bb4 | 758d8f1aa025e4ac07c0688b0e5c1057a6ee7251 | /Recipes/src/main/java/com/recipe/se/recipes/domain/seller/Seller.java | 887b4d2c0c678c750fae85148b9e32dfa2673ee4 | [] | no_license | ShwetaVishalSingh/RecipeRepo | 1df25909d04dd6c7795f3a676f15bdb902af0ecf | 6e98d322b5d444f8697494f98d1f5abbb6865cfd | refs/heads/master | 2021-01-06T20:12:28.391699 | 2020-10-13T12:06:26 | 2020-10-13T12:06:26 | 241,474,673 | 0 | 0 | null | 2020-06-02T21:11:52 | 2020-02-18T21:48:24 | Java | UTF-8 | Java | false | false | 2,975 | java | package com.recipe.se.recipes.domain.seller;
import com.recipe.se.recipes.infrastructure.seller.SellerDetails;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "SELLER")
public class Seller {
@Id
@Column(name = "ID")
private String id;
@Column(name = "NAME", nullable = false)
private String name;
@Column(name = "CITY", nullable = false)
private String city;
@Column(name = "ADDRESS", nullable = false)
private String address;
@Column(name = "STATE", nullable = false)
private String state;
@Column(name = "POSTAL_CODE", nullable = false)
private String postalCode;
@Column(name = "IMAGE", nullable = false)
private String image;
@Column(name = "PHONE", nullable = false)
private String phone;
@Column(name = "EMAIL", nullable = false)
private String email;
public Seller() {
}
public Seller(String id, String name, String city, String address, String state, String postalCode, String image, String phone, String email) {
this.id = id;
this.name = name;
this.city = city;
this.address = address;
this.state = state;
this.postalCode = postalCode;
this.image = image;
this.phone = phone;
this.email = email;
}
public static Seller convertToSeller(SellerDetails sellerDetails) {
return new Seller(sellerDetails.getId(),sellerDetails.getName(),sellerDetails.getCity(),sellerDetails.getAddress(),sellerDetails.getState(),sellerDetails.getPostalCode(),
sellerDetails.getImage(),sellerDetails.getPhone(),sellerDetails.getEmail());
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getPostalCode() {
return postalCode;
}
public void setPostalCode(String postalCode) {
this.postalCode = postalCode;
}
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
}
| [
"vishal.n.singh@ica.se"
] | vishal.n.singh@ica.se |
b7b8ccefb0d6bf112a89551fe9115d1608305d1e | 7e8a3349cbbf0dc64a9680a142edb14467e48d5c | /mvc-library/src/main/java/otus/deryagina/spring/library/data/mvc/LibraryMvcApplication.java | 3019f16ff4d6d28f51d13187a65489ed27d1b5e2 | [] | no_license | MadinaDeryagina/otus-library | 9830999057716eff58812023d88e4c6c19216e79 | 0a5a3e34152f81b340187ebd7e2d0b0732e618c0 | refs/heads/master | 2020-09-11T19:09:53.947181 | 2020-04-13T06:43:35 | 2020-04-13T06:43:35 | 222,162,168 | 0 | 0 | null | 2020-04-13T06:43:36 | 2019-11-16T21:35:20 | Java | UTF-8 | Java | false | false | 350 | java | package otus.deryagina.spring.library.data.mvc;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class LibraryMvcApplication {
public static void main(String[] args) {
SpringApplication.run(LibraryMvcApplication.class, args);
}
}
| [
"madina.deryagina@yandex.ru"
] | madina.deryagina@yandex.ru |
6e0e3508436eb449ac3a30b31236d4a4b83689fa | 3ec740784b754780b6083fc6cde6d87904ebc8ab | /tm-tool/textmapper/tests/org/textmapper/tool/bootstrap/b/SampleBLexer.java | db2e56a85b63fba64a4266c9a04016b4109c7cd8 | [
"Apache-2.0"
] | permissive | takamori/textmapper | b83da7f30c43868e16de18aea7e21e456ceb3803 | 3c9ec01f17db9f9e3d3914c984f8ccd4496913fb | refs/heads/master | 2020-04-02T10:03:39.409821 | 2018-10-23T13:18:03 | 2018-10-23T13:18:03 | 154,322,486 | 0 | 0 | null | 2018-10-23T12:15:59 | 2018-10-23T12:15:58 | null | UTF-8 | Java | false | false | 9,447 | java | /**
* Copyright 2002-2017 Evgeny Gryaznov
*
* 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.textmapper.tool.bootstrap.b;
import java.io.IOException;
import java.io.Reader;
import java.text.MessageFormat;
import java.util.HashMap;
import java.util.Map;
public class SampleBLexer {
public static class Span {
public Object value;
public int symbol;
public int state;
public int offset;
public int endoffset;
}
public interface Tokens {
int Unavailable_ = -1;
int eoi = 0;
int identifier = 1;
int _skip = 2;
int Lclass = 3;
int Lextends = 4;
int Lbrace = 5;
int Rbrace = 6;
int Lparen = 7;
int Rparen = 8;
int Linterface = 9;
int Lenum = 10;
int error = 11;
int numeric = 12;
int octal = 13;
int decimal = 14;
int eleven = 15;
int _skipSoftKW = 16;
}
public interface ErrorReporter {
void error(String message, int offset, int endoffset);
}
public static final int TOKEN_SIZE = 2048;
private Reader stream;
final private ErrorReporter reporter;
private CharSequence input;
private int tokenOffset;
private int l;
private int charOffset;
private int chr;
private int state;
private int tokenLine;
private int currLine;
private int currOffset;
public SampleBLexer(CharSequence input, ErrorReporter reporter) throws IOException {
this.reporter = reporter;
reset(input);
}
public void reset(CharSequence input) throws IOException {
this.state = 0;
tokenLine = currLine = 1;
currOffset = 0;
this.input = input;
tokenOffset = l = 0;
charOffset = l;
chr = l < input.length() ? input.charAt(l++) : -1;
if (chr >= Character.MIN_HIGH_SURROGATE && chr <= Character.MAX_HIGH_SURROGATE && l < input.length() &&
Character.isLowSurrogate(input.charAt(l))) {
chr = Character.toCodePoint((char) chr, input.charAt(l++));
}
}
protected void advance() {
if (chr == -1) return;
currOffset += l - charOffset;
if (chr == '\n') {
currLine++;
}
charOffset = l;
chr = l < input.length() ? input.charAt(l++) : -1;
if (chr >= Character.MIN_HIGH_SURROGATE && chr <= Character.MAX_HIGH_SURROGATE && l < input.length() &&
Character.isLowSurrogate(input.charAt(l))) {
chr = Character.toCodePoint((char) chr, input.charAt(l++));
}
}
public int getState() {
return state;
}
public void setState(int state) {
this.state = state;
}
public int getTokenLine() {
return tokenLine;
}
public int getLine() {
return currLine;
}
public void setLine(int currLine) {
this.currLine = currLine;
}
public int getOffset() {
return currOffset;
}
public void setOffset(int currOffset) {
this.currOffset = currOffset;
}
public String tokenText() {
return input.subSequence(tokenOffset, charOffset).toString();
}
public int tokenSize() {
return charOffset - tokenOffset;
}
private static final short tmCharClass[] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 12, 12, 1, 1, 12, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
12, 1, 1, 1, 1, 1, 1, 1, 6, 7, 1, 1, 1, 1, 1, 1,
2, 11, 11, 11, 11, 11, 11, 11, 9, 9, 1, 1, 1, 1, 1, 1,
1, 10, 10, 10, 10, 10, 10, 8, 8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 1, 1, 1, 1, 8,
1, 10, 10, 10, 10, 10, 10, 8, 8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8, 3, 8, 8, 4, 1, 5
};
private static final int[] tmRuleSymbol = unpack_int(17,
"\uffff\uffff\0\0\1\0\14\0\15\0\16\0\2\0\3\0\4\0\5\0\6\0\7\0\10\0\11\0\12\0\17\0\20" +
"\0");
private static final int tmClassesCount = 13;
private static final short[] tmGoto = unpack_vc_short(169,
"\1\ufffe\1\uffff\1\11\1\10\1\7\1\6\1\5\1\4\1\10\1\2\1\10\1\2\1\1\14\ufff9\1\1\2\uffff" +
"\1\3\6\uffff\1\3\1\uffff\1\3\1\uffff\2\ufffa\1\3\6\ufffa\1\3\1\ufffa\1\3\1\ufffa" +
"\15\ufff3\15\ufff4\15\ufff5\15\ufff6\2\ufffd\2\10\4\ufffd\4\10\1\ufffd\2\uffff\1" +
"\14\1\12\7\uffff\1\14\3\uffff\1\13\6\uffff\3\13\1\uffff\2\ufffc\1\13\6\ufffc\3\13" +
"\1\ufffc\2\ufffb\1\14\10\ufffb\1\14\1\ufffb");
private static short[] unpack_vc_short(int size, String... st) {
short[] res = new short[size];
int t = 0;
int count = 0;
for (String s : st) {
int slen = s.length();
for (int i = 0; i < slen; ) {
count = i > 0 || count == 0 ? s.charAt(i++) : count;
if (i < slen) {
short val = (short) s.charAt(i++);
while (count-- > 0) res[t++] = val;
}
}
}
assert res.length == t;
return res;
}
private static int mapCharacter(int chr) {
if (chr >= 0 && chr < 126) return tmCharClass[chr];
return chr == -1 ? 0 : 1;
}
public Span next() throws IOException {
Span token = new Span();
int state;
tokenloop:
do {
token.offset = currOffset;
tokenLine = currLine;
tokenOffset = charOffset;
for (state = this.state; state >= 0; ) {
state = tmGoto[state * tmClassesCount + mapCharacter(chr)];
if (state == -1 && chr == -1) {
token.endoffset = currOffset;
token.symbol = 0;
token.value = null;
reporter.error("Unexpected end of input reached", token.offset, token.endoffset);
token.offset = currOffset;
break tokenloop;
}
if (state >= -1 && chr != -1) {
currOffset += l - charOffset;
if (chr == '\n') {
currLine++;
}
charOffset = l;
chr = l < input.length() ? input.charAt(l++) : -1;
if (chr >= Character.MIN_HIGH_SURROGATE && chr <= Character.MAX_HIGH_SURROGATE && l < input.length() &&
Character.isLowSurrogate(input.charAt(l))) {
chr = Character.toCodePoint((char) chr, input.charAt(l++));
}
}
}
token.endoffset = currOffset;
token.symbol = tmRuleSymbol[-1 - state];
token.value = null;
if (token.symbol == -1) {
reporter.error(MessageFormat.format("invalid token at line {0}: `{1}`, skipped", currLine, tokenText()), token.offset, token.endoffset);
}
} while (token.symbol == -1 || !createToken(token, -1 - state));
return token;
}
protected int charAt(int i) {
if (i == 0) return chr;
i += l - 1;
int res = i < input.length() ? input.charAt(i++) : -1;
if (res >= Character.MIN_HIGH_SURROGATE && res <= Character.MAX_HIGH_SURROGATE && i < input.length() &&
Character.isLowSurrogate(input.charAt(i))) {
res = Character.toCodePoint((char) res, input.charAt(i++));
}
return res;
}
protected boolean createToken(Span token, int ruleIndex) throws IOException {
boolean spaceToken = false;
switch (ruleIndex) {
case 2:
return createIdentifierToken(token, ruleIndex);
case 3:
return createNumericToken(token, ruleIndex);
case 4:
return createOctalToken(token, ruleIndex);
case 5:
return createDecimalToken(token, ruleIndex);
case 6: // _skip: /[\n\t\r ]+/
spaceToken = true;
break;
}
return !(spaceToken);
}
private static Map<String,Integer> subTokensOfIdentifier = new HashMap<>();
static {
subTokensOfIdentifier.put("class", 7);
subTokensOfIdentifier.put("extends", 8);
subTokensOfIdentifier.put("interface", 13);
subTokensOfIdentifier.put("enum", 14);
subTokensOfIdentifier.put("xyzzz", 16);
}
protected boolean createIdentifierToken(Span token, int ruleIndex) {
Integer replacement = subTokensOfIdentifier.get(tokenText());
if (replacement != null) {
ruleIndex = replacement;
token.symbol = tmRuleSymbol[ruleIndex];
}
boolean spaceToken = false;
switch(ruleIndex) {
case 7: // class
{ token.value = "class"; }
break;
case 13: // interface
{ token.value = "interface"; }
break;
case 14: // enum
{ token.value = new Object(); }
break;
case 8: // extends (soft)
case 16: // xyzzz (soft)
case 2: // <default>
{ token.value = tokenText(); }
break;
}
return !(spaceToken);
}
protected boolean createNumericToken(Span token, int ruleIndex) {
return true;
}
protected boolean createOctalToken(Span token, int ruleIndex) {
boolean spaceToken = false;
switch(ruleIndex) {
case 4: // <default>
{ token.value = Integer.parseInt(tokenText(), 8); }
break;
}
return !(spaceToken);
}
private static Map<String,Integer> subTokensOfDecimal = new HashMap<>();
static {
subTokensOfDecimal.put("11", 15);
}
protected boolean createDecimalToken(Span token, int ruleIndex) {
Integer replacement = subTokensOfDecimal.get(tokenText());
if (replacement != null) {
ruleIndex = replacement;
token.symbol = tmRuleSymbol[ruleIndex];
}
boolean spaceToken = false;
switch(ruleIndex) {
case 15: // 11
{ token.value = 11; }
break;
}
return !(spaceToken);
}
/* package */ static int[] unpack_int(int size, String... st) {
int[] res = new int[size];
boolean second = false;
char first = 0;
int t = 0;
for (String s : st) {
int slen = s.length();
for (int i = 0; i < slen; i++) {
if (second) {
res[t++] = (s.charAt(i) << 16) + first;
} else {
first = s.charAt(i);
}
second = !second;
}
}
assert !second;
assert res.length == t;
return res;
}
}
| [
"egryaznov@gmail.com"
] | egryaznov@gmail.com |
f4fb511de30ca12d2f194bacbe7e857e64794021 | 81e2e6606e13188d9f0478d5a5f8f9708628fb2f | /src/main/java/com/github/arcticgrille/mixin/LivingEntityMixin.java | f5efa6eeedea33b4530b1649bee7c245e24f1c5c | [
"Unlicense"
] | permissive | ArcticGrille/ElephantMod | 097483071ea89c894073e7541a8f0a8340200e5c | 3f9fadbc467116a0d2c0fb409baff74a83ae1f44 | refs/heads/master | 2022-11-19T20:48:37.610938 | 2020-07-20T06:46:15 | 2020-07-20T06:46:15 | 279,745,954 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 665 | java | package com.github.arcticgrille.mixin;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.LivingEntity;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(LivingEntity.class)
public abstract class LivingEntityMixin extends Entity
{
public LivingEntityMixin(EntityType<?> type, World world)
{
super(type, world);
}
@Inject(at = @At("HEAD"), method = "tick")
public void tick(CallbackInfo info)
{}
}
| [
"poptartking86@gmail.com"
] | poptartking86@gmail.com |
73c0523f82de4aaeaea044752cb549af6114cdfa | e3e22b8352cc74ec83b99e5b4c3eaf4b2d55c440 | /src/main/java/net/mcbbs/lh_lshen/chronicler/events/ClientEventHandler.java | aa2d9819ee6e7798084c4fc9f29dff03f6c3325b | [] | no_license | DragonGodSUN/Chronicler | 5cd68010150dd2beddf079295e99ca5a97d7e53c | e405089d3f8e9fdbdf0f6d9761fe2e973451e41c | refs/heads/main | 2023-07-03T18:50:35.702857 | 2021-08-02T11:08:39 | 2021-08-02T11:08:39 | 363,873,716 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,201 | java | package net.mcbbs.lh_lshen.chronicler.events;
import net.mcbbs.lh_lshen.chronicler.ItemRegistry;
import net.mcbbs.lh_lshen.chronicler.inventory.gui.ChroniclerGUI;
import net.mcbbs.lh_lshen.chronicler.items.ItemRecorder;
import net.minecraft.client.gui.ScreenManager;
import net.minecraft.item.ItemModelsProperties;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD,value = Dist.CLIENT)
public class ClientEventHandler {
@SubscribeEvent
public static void onClientSetupEvent(FMLClientSetupEvent event) {
event.enqueueWork(()->{
ScreenManager.register(CommonEventHandler.containerTypeChronicler, ChroniclerGUI::new);
});
event.enqueueWork(ClientEventHandler::registerPropertyOverride);
}
public static void registerPropertyOverride() {
ItemModelsProperties.register(ItemRegistry.recorder.get(), new ResourceLocation("type"), ItemRecorder::getTypePropertyOverride);
}
}
| [
"642038132@qq.com"
] | 642038132@qq.com |
64932a843d8947583420933b04f2d2fa92929d49 | e57ce1aefab740467b2a1f146a2df99032152cde | /src/main/java/com/pet/model/ProductDTO.java | 1a92d1ecf4a3e3c671796e2145cd7f591ac985a8 | [] | no_license | byvenom/webTeamProject1 | 52aa485742d20fa8de3e5694af8553ff7c677f92 | 4439ae42dd31e954a80906868f06b0bbd345390f | refs/heads/master | 2022-12-25T05:39:04.618049 | 2019-12-01T10:56:12 | 2019-12-01T10:56:12 | 225,145,886 | 0 | 0 | null | 2022-12-16T01:00:32 | 2019-12-01T10:52:34 | Java | UTF-8 | Java | false | false | 1,146 | java | package com.pet.model;
public class ProductDTO {
private int no;
private String name;
private int price;
private String sup;
private int cate;
private int pop;
private String image;
private int num;
private String regdate;
public int getNo() {
return no;
}
public void setNo(int no) {
this.no = no;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getPrice() {
return price;
}
public void setPrice(int price) {
this.price = price;
}
public String getSup() {
return sup;
}
public void setSup(String sup) {
this.sup = sup;
}
public int getCate() {
return cate;
}
public void setCate(int cate) {
this.cate = cate;
}
public int getPop() {
return pop;
}
public void setPop(int pop) {
this.pop = pop;
}
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;
}
public int getNum() {
return num;
}
public void setNum(int num) {
this.num = num;
}
public String getRegdate() {
return regdate;
}
public void setRegdate(String regdate) {
this.regdate = regdate;
}
}
| [
"zmdk5650@gmail.com"
] | zmdk5650@gmail.com |
b69b1d3ef3473b13e68a33f810976b0fdc9cc15d | b66bdee811ed0eaea0b221fea851f59dd41e66ec | /src/com/urbanairship/analytics/CustomEvent.java | 9e16ae6c40f3dcbbcb2e1a8b155f68fcc3a4a7ae | [] | no_license | reverseengineeringer/com.grubhub.android | 3006a82613df5f0183e28c5e599ae5119f99d8da | 5f035a4c036c9793483d0f2350aec2997989f0bb | refs/heads/master | 2021-01-10T05:08:31.437366 | 2016-03-19T20:41:23 | 2016-03-19T20:41:23 | 54,286,207 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,606 | java | package com.urbanairship.analytics;
import com.urbanairship.Logger;
import com.urbanairship.UAirship;
import com.urbanairship.push.PushManager;
import com.urbanairship.util.UAStringUtil;
import java.math.BigDecimal;
import org.json.JSONException;
import org.json.JSONObject;
public class CustomEvent
extends Event
{
public static final String CONVERSION_SEND_ID = "conversion_send_id";
public static final String EVENT_NAME = "event_name";
public static final String EVENT_VALUE = "event_value";
public static final String INTERACTION_ID = "interaction_id";
public static final String INTERACTION_TYPE = "interaction_type";
public static final String LAST_RECEIVED_SEND_ID = "last_received_send_id";
private static final int MAX_CHARACTER_LENGTH = 255;
private static final BigDecimal MAX_VALUE = new BigDecimal(Integer.MAX_VALUE);
public static final String MCRAP_TRANSACTION_TYPE = "ua_mcrap";
private static final BigDecimal MIN_VALUE = new BigDecimal(Integer.MIN_VALUE);
public static final String TRANSACTION_ID = "transaction_id";
private static final String TYPE = "custom_event";
private String eventName;
private Long eventValue;
private String interactionId;
private String interactionType;
private String sendId;
private String transactionId;
protected final JSONObject getEventData()
{
JSONObject localJSONObject = new JSONObject();
String str = UAirship.shared().getAnalytics().getConversionSendId();
try
{
localJSONObject.putOpt("event_name", eventName);
localJSONObject.putOpt("event_value", eventValue);
localJSONObject.putOpt("interaction_id", interactionId);
localJSONObject.putOpt("interaction_type", interactionType);
localJSONObject.putOpt("transaction_id", transactionId);
if (!UAStringUtil.isEmpty(sendId))
{
localJSONObject.putOpt("conversion_send_id", sendId);
return localJSONObject;
}
if (str != null)
{
localJSONObject.putOpt("conversion_send_id", str);
return localJSONObject;
}
}
catch (JSONException localJSONException)
{
Logger.error("CustomEvent - Error constructing JSON data.", localJSONException);
return localJSONObject;
}
localJSONObject.putOpt("last_received_send_id", UAirship.shared().getPushManager().getLastReceivedSendId());
return localJSONObject;
}
public final String getType()
{
return "custom_event";
}
}
/* Location:
* Qualified Name: com.urbanairship.analytics.CustomEvent
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"reverseengineeringer@hackeradmin.com"
] | reverseengineeringer@hackeradmin.com |
961fe3044cb34b824aab37da29411eecb32cba40 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/31/31_41eb7d88a883f38b0253d5138890302dab86fc98/PluginInfo/31_41eb7d88a883f38b0253d5138890302dab86fc98_PluginInfo_s.java | edd08aef650bad79e9d7129fe2198ca61300061b | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 17,267 | java | /*
File: PluginInfo.java
Copyright (c) 2006, 2007, The Cytoscape Consortium (www.cytoscape.org)
The Cytoscape Consortium is:
- Institute for Systems Biology
- University of California San Diego
- Memorial Sloan-Kettering Cancer Center
- Institut Pasteur
- Agilent Technologies
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2.1 of the License, or
any later version.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and
documentation provided hereunder is on an "as is" basis, and the
Institute for Systems Biology and the Whitehead Institute
have no obligations to provide maintenance, support,
updates, enhancements or modifications. In no event shall the
Institute for Systems Biology and the Whitehead Institute
be liable to any party for direct, indirect, special,
incidental or consequential damages, including lost profits, arising
out of the use of this software and its documentation, even if the
Institute for Systems Biology and the Whitehead Institute
have been advised of the possibility of such damage. See
the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this library; if not, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
package cytoscape.plugin;
import cytoscape.CytoscapeInit;
import cytoscape.util.URLUtil;
import java.util.ArrayList;
import java.util.List;
import java.net.URL;
/**
* @author skillcoy Object describes a plugin
*/
public class PluginInfo {
/**
* Jar and Zip files currently supported
*
* @author skillcoy
*
*/
public enum FileType {
JAR("jar"), ZIP("zip");
private String typeText;
private FileType(String type) {
typeText = type;
}
public String toString() {
return typeText;
}
}
private String releaseDate;
private FileType fileType;
private String uniqueID;
private String pluginClassName;
private String pluginName;
private List<AuthorInfo> authors;
private License license;
private String pluginDescription;
private String pluginVersion;
private String cytoscapeVersion;
private String pluginUrl;
private String projectUrl;
private String downloadUrl;
private String pluginCategory;
private String versionMatch = "^\\d+\\.\\d+";
private String versionSplit = "\\.";
private List<String> pluginFiles;
private boolean licenseRequired = false;
protected String enclosingJar;
protected String installLocation;
/**
* Initializes a PluginInfo object with the following defaults:
* setName("Unknown"); setDescription("No pluginDescription");
* setPluginVersion("0.1"); setCytoscapeVersion(
* cytoscape.cytoscapeVersion.version ); setCategory("Uncategorized");
* setProjectUrl(CytoscapeInit.getProperties().getProperty("defaultPluginUrl"));
*/
public PluginInfo() {
init();
}
/**
* See PluginInfo()
*
* @param UniqueID
* Additionally this sets the unique identifier that will be used
* to find a new version of the plugin at the given project url.
*/
public PluginInfo(String UniqueID) {
uniqueID = UniqueID;
init();
}
/*
* Sets all the fields that are required to a default value in case it is
* not called
*/
private void init() {
pluginFiles = new ArrayList<String>();
authors = new ArrayList<AuthorInfo>();
setName("Unknown");
setDescription("No description");
setPluginVersion(0.1);
setCytoscapeVersion(cytoscape.CytoscapeVersion.version);
setCategory(Category.NONE);
setProjectUrl(CytoscapeInit.getProperties().getProperty("defaultPluginUrl"));
setPluginClassName("");
}
/* SET */
/**
* Sets name of plugin. This will be displayed to users.
*
* @param name
*/
public void setName(String name) {
pluginName = name;
}
/**
* Sets the release date of a plugin. Displayed to users;
* @param date
*/
public void setReleaseDate(String date) {
releaseDate = date;
}
/**
* Sets the plugin class name. Used for tracking plugins.
*
* @param className
*/
protected void setPluginClassName(String className) {
pluginClassName = className;
}
/**
* Sets a description of the plugin. This will be displayed to users.
*
* @param description
*/
public void setDescription(String description) {
pluginDescription = description;
}
/**
* Sets the version of the plugin. Defaults to 0.1
*
* @param version
* String version with format \d+.\d+
* @throws NumberFormatException
* If the string version is of a format other than \d+.\d+
*/
public void setPluginVersion(double Version) throws NumberFormatException {
String version = Double.toString(Version);
if (versionOk(version, true)) {
pluginVersion = version;
} else {
throw new NumberFormatException(
"Bad plugin version '" + version + "'. Plugin version numbers must be in the format: \\d+.\\d+");
}
}
/**
* Sets the Cytoscape version this plugin is compatible with.
*
* @param version
*/
public void setCytoscapeVersion(String version)
throws NumberFormatException {
if (versionOk(version, false)) {
cytoscapeVersion = version;
} else {
throw new NumberFormatException(
"Cytoscape version numbers must be in the format: \\d+.\\d+ optional to add: .\\d+-[a-z]");
}
}
/**
* pluginUrl this plugin was downloaded from. It is presumed this can be
* used for update later.
* @param url
*/
protected void setUrl(String url) {
pluginUrl = url;
}
/**
* Sets the url of a site describing this plugin project
* @param url
*/
public void setProjectUrl(String url) {
projectUrl = url;
}
/**
* URL for the xml file describing all plugins from any given project
* (ex. http://cytoscape.org/plugins/plugin.xml)
*
* @param url
*/
protected void setDownloadUrl(String url) {
downloadUrl = url;
}
/**
* Jar or Zip are currently supported. Use PluginInfo.JAR or PluginInfo.ZIP.
* This will only be set by the PluginManager generally and can only be set once
* as an object's file type will not change.
* @param type
*/
protected void setFiletype(FileType type) {
if (fileType == null)
fileType = type;
}
/**
* Sets a list of files (prefer full paths) installed with this plugin.
* Includes the jar file.
* @param list
*/
protected void setFileList(List<String> list) {
pluginFiles = list;
}
/**
* Sets a category for the plugin. Defaults to "Uncategorized"
*
* @param category
*/
public void setCategory(String category) {
pluginCategory = category;
}
/**
* Sets the category for the plugin using the enum PluginInfo.Category
*
* @param catName
*/
public void setCategory(Category catName) {
pluginCategory = catName.getCategoryText();
}
/**
* Adds a file to the list of installed files.
*
* @param fileName
*/
protected void addFileName(String fileName) {
if (!pluginFiles.contains(fileName))
pluginFiles.add(fileName);
}
/**
* Adds an author to the list of authors.
*
* @param authorName
* @param institution
*/
public void addAuthor(String authorName, String institution) {
authors.add(new AuthorInfo(authorName, institution));
}
/**
* Clears author list.
*/
public void clearAuthorList() {
authors.clear();
}
/**
* Sets the license information for the plugin. Not required.
*
* @param java.net.URL
* object where license can be downloaded from.
*/
public void setLicense(URL url) {
license = new License(url);
}
/**
* Sets the license information for the plugin. Not required.
*
* @param Text
* string of license.
* @param alwaysRequired
* If the user expects the license to be required for both
* install and update at all times (true) or only at install
* (false)
*/
public void setLicense(String licenseText, boolean alwaysRequired) {
license = new License(licenseText);
licenseRequired = alwaysRequired;
}
// this just checks the plugin version and the cytoscape version
private boolean versionOk(String version, boolean plugin) {
// \d+.\+d ok
String Match = versionMatch;
String Split = versionSplit;
if (plugin) {
Match = Match + "$";
} else { // cytoscape version
Match = Match + "(\\.\\d+)?$";
Split = "\\.|-";
}
if (!version.matches(Match)) {
return false;
}
String[] SplitVersion = version.split(Split);
int max = 2;
if (!plugin) {
max = 3; // cytoscape version numbers
// if there's a fourth is must be alpha
if (SplitVersion.length == 4) {
if (!SplitVersion[3].matches("[a-z]+")) {
return false;
}
}
}
// can't be longer than the accepted version types
if (SplitVersion.length > max) {
return false;
}
// must be digets
for (int i = 0; i < max && i < SplitVersion.length; i++) {
if (!SplitVersion[i].matches("\\d+")) {
return false;
}
}
return true;
}
/**
* This is meant to only get set by the PluginManager. It can only
* be set once as the install location can't move.
*
* @param Loc
*/
protected void setInstallLocation(String Loc) {
if (installLocation == null)
installLocation = Loc;
}
/* GET */
/**
* Gets the full install path for this plugin. Should look like
* <HOME_DIR>/.cytoscape/<cytoscape_version>/plugins/<pluginName-pluginVersion>
*/
public java.io.File getPluginDirectory() {
java.io.File PluginDir = new java.io.File(
PluginManager.getPluginManager().getPluginManageDirectory(),
this.getName()+"-"+this.getPluginVersion());
return PluginDir;
}
/**
* @return String of the installation location for the plugin and all of it's files.
* Generally this is .cytoscape/[cytoscape version]/plugins/PluginName-version
*/
public String getInstallLocation() {
return installLocation;
}
public String getReleaseDate() {
return releaseDate;
}
/**
* @return The text of the license for this plugin if available.
*/
public String getLicenseText() {
if (license != null)
return license.getLicense();
else
return null;
}
/**
* @return If the license is always required to be accepted for installs and
* updates this returns true. If it only is required at install time
* (never at update) returns false.
*/
public boolean isLicenseRequired() {
return licenseRequired;
}
/**
* @return The unique id for this object.
*/
public String getID() {
return uniqueID;
}
/**
* @return FileType of file type for plugin. PluginInfo.JAR or
* PluginInfo.ZIP
*/
public FileType getFileType() {
return fileType;
}
/**
* @return pluginName of plugin
*/
public String getName() {
return pluginName;
}
/**
* @return Java class name
*/
public String getPluginClassName() {
return pluginClassName;
}
/**
* @return List of authors.
*/
public List<AuthorInfo> getAuthors() {
return authors;
}
/**
* @return Plugin pluginDescription.
*/
public String getDescription() {
return pluginDescription;
}
/**
* @return Plugin version.
*/
public String getPluginVersion() {
return pluginVersion;
}
/**
* @return Compatible Cytoscape version
*/
public String getCytoscapeVersion() {
return cytoscapeVersion;
}
/**
* @return Url to download plugin from
*/
public String getUrl() {
return pluginUrl;
}
/**
*
* @return Url that points to a site describing this plugin project
*/
public String getProjectUrl() {
return projectUrl;
}
/**
* @return Url that returns the document of available plugins this plugin
* came from. Example http://cytoscape.org/plugins/all_plugins.xml
*/
public String getDownloadUrl() {
return downloadUrl;
}
/**
* @return Plugin category.
*/
public String getCategory() {
return pluginCategory;
}
/**
* @return List of files installed with this plugin (includes plugin jar
* file).
*/
public List<String> getFileList() {
return pluginFiles;
}
/**
* @return Returns String of plugin name and version
*/
public String toString() {
return getName() + " " + getPluginVersion();
}
/**
* Compare the version of the object to the given object.
*
* @param New
* Potentially newer PluginInfo object
* @return true if given version is newer
*/
public boolean isNewerPluginVersion(PluginInfo New) {
String[] CurrentVersion = getPluginVersion().split(versionSplit);
String[] NewVersion = New.getPluginVersion().split(versionSplit);
int CurrentMajor = Integer.valueOf(CurrentVersion[0]).intValue();
int NewMajor = Integer.valueOf(NewVersion[0]).intValue();
int CurrentMinor = Integer.valueOf(CurrentVersion[1]).intValue();
int NewMinor = Integer.valueOf(NewVersion[1]).intValue();
if ( (CurrentMajor > NewMajor ||
(CurrentMajor == NewMajor && CurrentMinor >= NewMinor)) ) {
return false;
}
return true;
}
/**
*
* @return true if the plugin is compatible with the current Cytoscape
* version major.minor (bugfix is only checked if the plugin
* specifies a bugfix version)
*/
public boolean isCytoscapeVersionCurrent() {
String[] CyVersion = cytoscape.CytoscapeVersion.version
.split(versionSplit);
String[] PlVersion = getCytoscapeVersion().split(versionSplit);
for (int i = 0; i < PlVersion.length; i++) {
if (Integer.valueOf(CyVersion[i]).intValue() != Integer.valueOf(
PlVersion[i]).intValue())
return false;
}
return true;
}
// yea, it's ugly...styles taken from cytoscape website
public String htmlOutput() {
String Html = "<html><style type='text/css'>";
Html += "body,th,td,div,p,h1,h2,li,dt,dd ";
Html += "{ font-family: Tahoma, \"Gill Sans\", Arial, sans-serif; }";
Html += "body { margin: 0px; color: #333333; background-color: #ffffff; }";
Html += "#indent { padding-left: 30px; }";
Html += "ul {list-style-type: none}";
Html += "</style><body>";
Html += "<b>" + getName() + "</b><p>";
Html += "<b>Version:</b> " + getPluginVersion() + "<p>";
Html += "<b>Category:</b> " + getCategory() + "<p>";
Html += "<b>Description:</b><br>" + getDescription() + "<p>";
if (getReleaseDate() != null && getReleaseDate().length() > 0) {
Html += "<b>Release Date:</b> " + getReleaseDate() + "<p>";
}
Html += "<b>Released By:</b><br><ul>";
for (AuthorInfo ai : getAuthors()) {
Html += "<li>" + ai.getAuthor() + ", " + ai.getInstitution()
+ "<br>";
}
Html += "</ul>";
Html += "</font></body></html>";
return Html;
}
/**
* Describes an author for a given plugin.
*
* @author skillcoy
*/
public class AuthorInfo {
private String authorName;
private String institutionName;
public AuthorInfo(String Name, String Institution) {
authorName = Name;
institutionName = Institution;
}
public String getAuthor() {
return authorName;
}
public String getInstitution() {
return institutionName;
}
}
/**
* Fetches and keeps a plugin license if one is available.
*/
public class License {
private java.net.URL url;
private String text;
public License(java.net.URL Url) {
url = Url;
}
public License(String LicenseText) {
text = LicenseText;
}
/**
* Get the license text as a string. Will download from url if License
* was not initialized with text string.
*
* @return String
*/
public String getLicense() {
if (text == null) {
try {
text = URLUtil.download(url);
} catch (java.io.IOException E) {
E.printStackTrace();
}
}
return text;
}
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
89056cb72e1fe9508aa827e253edbb92b8f6924f | 1f7f6c871238511212c163bd6d50f6ad7954052b | /src/main/java/com/example/domain/Product.java | 746821aa9f86a6536d5f00b71653c8e7f095801a | [] | no_license | sudhirshettym/Spring-Boot-Rest-Cassandra | a2cf7b6e40859ee93a01aa48c1443248ab8d131b | 14f2737ca8b597aa75af2e70240274acb15cd815 | refs/heads/master | 2020-03-22T07:50:54.325359 | 2018-07-04T15:27:03 | 2018-07-04T15:27:03 | 139,728,460 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 756 | java | package com.example.domain;
import org.springframework.data.cassandra.core.mapping.Table;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.UUID;
@Table("products")
public class Product implements Serializable {
private UUID id;
private String description;
private BigDecimal price;
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public BigDecimal getPrice() {
return price;
}
public void setPrice(BigDecimal price) {
this.price = price;
}
}
| [
"sudhirshettym13@gmail.com"
] | sudhirshettym13@gmail.com |
bb1eac46afb8d6efea387ff55c339ae55f9b0e96 | d9944599ef2ff519e546683ce9e8b48880bc0b65 | /environmentmods-processor/src/main/java/com/brunodles/environmentsmods/processor/ModsProcessor.java | 6f9e0ff497a60502057c0c8c297e60bf374af75a | [
"MIT"
] | permissive | brunodles/EnvironmentMods | b61e6f5d5a5c66b52955bfbc33e8aafb6ddc9e45 | a8e1346ca46e00f5ebaac16020286fe29a8f6d42 | refs/heads/master | 2020-01-23T22:06:42.643512 | 2017-12-30T16:57:25 | 2017-12-30T16:57:25 | 74,611,110 | 1 | 0 | null | 2017-03-21T14:04:47 | 2016-11-23T20:21:35 | Java | UTF-8 | Java | false | false | 5,635 | java | package com.brunodles.environmentsmods.processor;
import com.brunodles.environmentmods.annotation.ModFor;
import com.brunodles.environmentmods.annotation.Moddable;
import com.brunodles.annotationprocessorhelper.ProcessorBase;
import com.brunodles.annotationprocessorhelper.SupportedAnnotations;
import com.squareup.javapoet.ClassName;
import com.squareup.javapoet.JavaFile;
import com.squareup.javapoet.MethodSpec;
import com.squareup.javapoet.TypeSpec;
import javax.annotation.processing.RoundEnvironment;
import javax.lang.model.element.Element;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.Modifier;
import javax.lang.model.element.TypeElement;
import javax.lang.model.type.ExecutableType;
import javax.lang.model.type.MirroredTypeException;
import javax.lang.model.type.TypeMirror;
import java.io.IOException;
import java.util.List;
import java.util.Set;
@SupportedAnnotations({Moddable.class, ModFor.class})
@com.google.auto.service.AutoService(javax.annotation.processing.Processor.class)
public class ModsProcessor extends ProcessorBase {
private static final String TAG = "ModsProcessor";
@Override
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
HashCollection<TypeMirror, ExecutableElement> classes = findAnnotations(annotations, roundEnv);
for (TypeMirror target : classes.keySet()) {
TypeSpec modClass = createModClass(classes, target);
writeModClass(target, modClass);
}
return true;
}
private HashCollection<TypeMirror, ExecutableElement> findAnnotations(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
HashCollection<TypeMirror, ExecutableElement> classes = new HashCollection<>();
for (TypeElement annotation : annotations)
for (Element element : roundEnv.getElementsAnnotatedWith(annotation)) {
ModFor modFor = element.getAnnotation(ModFor.class);
if (modFor != null)
classes.add(getTarget(modFor), (ExecutableElement) element);
Moddable moddable = element.getAnnotation(Moddable.class);
if (moddable != null)
classes.add(element.asType());
}
return classes;
}
private TypeSpec createModClass(HashCollection<TypeMirror, ExecutableElement> classes, TypeMirror target) {
TypeElement targetElement = asTypeElement(target);
MethodSpec.Builder applyBuilder = MethodSpec.methodBuilder("apply")
.addModifiers(Modifier.PUBLIC, Modifier.STATIC)
.returns(void.class)
.addParameter(ClassName.get(target), "target");
for (ExecutableElement element : classes.getValues(target))
applyBuilder.addStatement(invoke(target, element));
return TypeSpec.classBuilder(getModClassName(targetElement))
.addModifiers(Modifier.PUBLIC, Modifier.FINAL)
.addMethod(applyBuilder.build())
.build();
}
private void writeModClass(TypeMirror target, TypeSpec modClass) {
TypeElement targetElement = asTypeElement(target);
JavaFile javaFile = JavaFile.builder(packageFrom(targetElement), modClass)
.build();
try {
javaFile.writeTo(processingEnv.getFiler());
} catch (IOException e) {
fatalError(TAG, "Failed to write a mod class for " + targetElement.getSimpleName() + "\n " + e.getMessage());
}
}
private ClassName getModClassName(TypeElement targetElement) {
return ClassName.get(packageFrom(targetElement), targetElement.getSimpleName() + "Mods");
}
private String packageFrom(TypeElement element) {
String name = element.getQualifiedName().toString();
return name.substring(0, name.lastIndexOf("."));
}
private String invoke(TypeMirror target, ExecutableElement element) {
String methodName = element.getSimpleName().toString();
TypeElement methodClass = asTypeElement(element.getEnclosingElement().asType());
Set<Modifier> modifiers = element.getModifiers();
if (!modifiers.contains(Modifier.STATIC)) {
fatalError(TAG, "The method \"" + methodName + "\" on the class \""
+ methodClass.getSimpleName().toString() +
"\" annotated with @ModFor is not static. Make it static to be runnable.");
}
if (!modifiers.contains(Modifier.PUBLIC)) {
fatalError(TAG, "The method \"" + methodName + "\" on the class \""
+ methodClass.getSimpleName().toString() +
"\" annotated with @ModFor is not public. Make it public to be runnable.");
}
StringBuilder fullMethodNameBuilder = new StringBuilder(methodClass.getQualifiedName().toString());
fullMethodNameBuilder.append(".")
.append(methodName)
.append("(");
ExecutableType exec = (ExecutableType) element.asType();
List<? extends TypeMirror> parameters = exec.getParameterTypes();
if ((parameters.size() == 1)
&& (target.equals(parameters.get(0))))
fullMethodNameBuilder.append("target");
fullMethodNameBuilder.append(")");
return fullMethodNameBuilder.toString();
}
private static TypeMirror getTarget(ModFor annotation) {
try {
annotation.value();
} catch (MirroredTypeException mte) {
return mte.getTypeMirror();
}
return null;
}
}
| [
"dlimaun@gmail.com"
] | dlimaun@gmail.com |
8484c5fa698dd6d646696b67f3765b9313942e97 | 60f8492f08abf9b9628ada7474875be9d77843aa | /src/main/java/command/payments/UpdatePaymentsCommand.java | 9f0299fa627257b74c09b6e3edf02c87c81cf0e6 | [] | no_license | mohan5v5988/mirchi | 091625452d57e342f3ed59a6733735d0e227363f | 1bd655bf9b41c6cb35001c84ef7902e8eb2b89e5 | refs/heads/master | 2021-01-23T12:10:37.937765 | 2015-04-07T02:17:42 | 2015-04-07T02:17:42 | 31,091,691 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 808 | java | package command.payments;
import java.net.URISyntaxException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import model.Payments;
import connectionprovider.ConnectionProvider;
public class UpdatePaymentsCommand {
public String execute(Payments p) {
try {
Connection connection = ConnectionProvider.getConnection();
PreparedStatement stmt = connection
.prepareStatement("UPDATE PAYMENTS SET nid=?,date=?,amount=? WHERE id=?");
stmt.setString(1, p.getNid());
stmt.setDate(2, java.sql.Date.valueOf(p.getDate()));
stmt.setDouble(3, p.dbAmount());
stmt.setInt(4, p.getId());
stmt.executeUpdate();
} catch (URISyntaxException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
}
return "-1";
}
}
| [
"mohan5v5988@gmail.com"
] | mohan5v5988@gmail.com |
86a915b3e3c78c5227f639e185923962e27a087c | 6593bfbd936d61d438ed2e74ece6192a25542ff1 | /startcode/src/main/java/nl/han/ica/icss/checker/exceptions/UnexpectedSyntaxException.java | 5f340a7418d46f91342c15146098f0ae307f7b7d | [] | no_license | max1e/antlr-css-compiler | 45acb645b21bad284bd9b419dae841c86cd441c6 | bae1a77a5ecd28a0ad1ca35c040ff3762a51874d | refs/heads/master | 2022-12-27T14:28:14.475817 | 2020-10-16T08:54:24 | 2020-10-16T08:54:24 | 303,350,368 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 113 | java | package nl.han.ica.icss.checker.exceptions;
public class UnexpectedSyntaxException extends RuntimeException {
}
| [
"47426263+max1e@users.noreply.github.com"
] | 47426263+max1e@users.noreply.github.com |
d9291f8b60e8fd0bb5cf2eb0061170e88a9b07fa | c3f2fcf8a6bee46374935fa74049e114da9c9ced | /src/main/java/com/diffplug/gradle/eclipse/EclipseProjectPlugin.java | d4e411e24262ed569af48777383fa81c74b27fc4 | [
"Apache-2.0"
] | permissive | hannjos/goomph | 9383ba5c8ab4238fe13e97630914f19648bee370 | ece1af71d3dff2458a8b353bfa37f497710f1656 | refs/heads/master | 2020-04-21T17:02:21.969813 | 2019-02-06T21:31:01 | 2019-02-06T21:31:01 | 162,709,974 | 0 | 0 | Apache-2.0 | 2019-02-08T10:59:15 | 2018-12-21T12:09:30 | Java | UTF-8 | Java | false | false | 1,419 | java | /*
* Copyright 2016 DiffPlug
*
* 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.diffplug.gradle.eclipse;
import java.util.function.Consumer;
import org.gradle.api.Project;
import org.gradle.plugins.ide.eclipse.EclipsePlugin;
import org.gradle.plugins.ide.eclipse.model.EclipseModel;
import com.diffplug.gradle.ProjectPlugin;
/** Utility for gradle plugins which modify the eclipse model. */
class EclipseProjectPlugin {
/** Applies the EclipsePlugin and provides the eclipse model for modification. */
public static void modifyEclipseProject(Project project, Consumer<EclipseModel> modifier) {
// make sure the eclipse plugin has been applied
ProjectPlugin.getPlugin(project, EclipsePlugin.class);
// exclude the build folder
project.afterEvaluate(p -> {
EclipseModel eclipseModel = p.getExtensions().getByType(EclipseModel.class);
modifier.accept(eclipseModel);
});
}
}
| [
"ned.twigg@diffplug.com"
] | ned.twigg@diffplug.com |
4b59f25c9ed1d507318d11fdb18b82a3b7201d46 | 5d4f1bffcb8b136ded46c12529be273cf5925df3 | /campaign-rule-server/src/main/java/com/decider/exception/PublishException.java | 4db2bc430810e69c6a78cc549f07d09a24f24180 | [] | no_license | fcuenca4/campaign-rule-server | 054d3ab6d0b3ddd7a5910a09a522cd8d8e464808 | 10aefbfeb599a953eb0db1913f6bf9053d5b16f5 | refs/heads/master | 2020-04-22T04:52:16.518740 | 2019-02-25T00:38:00 | 2019-02-25T00:38:00 | 170,137,776 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 172 | java | package com.decider.exception;
public class PublishException extends Exception {
public PublishException(String publish_error) {
super(publish_error);
}
}
| [
"francisco.cuenca@mercadolibre.com"
] | francisco.cuenca@mercadolibre.com |
649074207cef0e0a93931ec9125f16622450e88d | 9c6ccf09d448290c47ccf71446992ba2726bd849 | /app/src/main/java/com/hackstrangely/hackstrangely/hackstrangely/hackstrangely/hackstrangely/hackstrangely/helpinghand/payment/provider/PaymentBaseClassHelper.java | cd3c5e5fd82f40a878c181417b83928af79a2228 | [] | no_license | Vrihas123/Social-Welfare | aea30cddfe3ce83d8c50671252149cba2081e750 | e3fbf0a02212d515a138a9719f1df89a7b1faf3f | refs/heads/master | 2021-09-09T16:41:36.811326 | 2018-03-18T06:03:54 | 2018-03-18T06:03:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 621 | java | package com.hackstrangely.hackstrangely.hackstrangely.hackstrangely.hackstrangely.hackstrangely.helpinghand.payment.provider;
import com.hackstrangely.hackstrangely.hackstrangely.hackstrangely.hackstrangely.hackstrangely.helpinghand.payment.PaymentCallback;
import com.hackstrangely.hackstrangely.hackstrangely.hackstrangely.hackstrangely.hackstrangely.helpinghand.register.RegisterCallback;
/**
* Created by samveg on 28/9/17.
*/
public interface PaymentBaseClassHelper {
void registerData(String firstname, String mobile, String email, String amount, String access_token, PaymentCallback paymentCallback);
}
| [
"vrihas007@gmail.com"
] | vrihas007@gmail.com |
2a31f5b9fc8db8633a81616343411abf03e20668 | b2adc96a8f6f1d6b65b663691434336759a5545f | /src/main/java/org/silnith/parser/html5/lexical/state/ScriptDataEndTagNameState.java | 662f643ca1fc3a90c1befd3bcd49fc19982deaca | [] | no_license | silnith-org/html5-parser | 0e5794cf733ef92d3e3ed349a15d9bc5c2a59236 | b5610e7a1fa8e5d1a29c055ce232a149f940f26b | refs/heads/development | 2021-01-19T03:30:33.067501 | 2020-03-25T17:04:42 | 2020-03-25T17:04:42 | 50,066,369 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,496 | java | package org.silnith.parser.html5.lexical.state;
import static org.silnith.parser.util.UnicodeCodePoints.CHARACTER_TABULATION;
import static org.silnith.parser.util.UnicodeCodePoints.FORM_FEED;
import static org.silnith.parser.util.UnicodeCodePoints.GREATER_THAN_SIGN;
import static org.silnith.parser.util.UnicodeCodePoints.LINE_FEED;
import static org.silnith.parser.util.UnicodeCodePoints.SOLIDUS;
import static org.silnith.parser.util.UnicodeCodePoints.SPACE;
import java.io.IOException;
import java.util.List;
import org.silnith.parser.html5.lexical.Tokenizer;
import org.silnith.parser.html5.lexical.token.CharacterToken;
import org.silnith.parser.html5.lexical.token.TagToken;
import org.silnith.parser.html5.lexical.token.Token;
/**
* Applies the script data end tag name state logic.
* <p>
* Consume the next input character:
* <dl>
* <dt>"tab" (U+0009)
* <dt>"LF" (U+000A)
* <dt>"FF" (U+000C)
* <dt>U+0020 SPACE
* <dd>If the current end tag token is an appropriate end tag token, then switch to the before attribute name state. Otherwise, treat it as per the "anything else" entry below.
* <dt>"/" (U+002F)
* <dd>If the current end tag token is an appropriate end tag token, then switch to the self-closing start tag state. Otherwise, treat it as per the "anything else" entry below.
* <dt>">" (U+003E)
* <dd>If the current end tag token is an appropriate end tag token, then switch to the data state and emit the current tag token. Otherwise, treat it as per the "anything else" entry below.
* <dt>Uppercase ASCII letter
* <dd>Append the lowercase version of the current input character (add 0x0020 to the character's code point) to the current tag token's tag name. Append the current input character to the temporary buffer.
* <dt>Lowercase ASCII letter
* <dd>Append the current input character to the current tag token's tag name. Append the current input character to the temporary buffer.
* <dt>Anything else
* <dd>Switch to the script data state. Emit a U+003C LESS-THAN SIGN character token, a U+002F SOLIDUS character token, and a character token for each of the characters in the temporary buffer (in the order they were added to the buffer). Reconsume the current input character.
* </dl>
*
* @see org.silnith.parser.html5.lexical.Tokenizer.State#SCRIPT_DATA_END_TAG_NAME
* @see <a href="https://www.w3.org/TR/2014/REC-html5-20141028/syntax.html#script-data-end-tag-name-state">8.2.4.19 Script data end tag name state</a>
* @author <a href="mailto:silnith@gmail.com">Kent Rosenkoetter</a>
*/
public class ScriptDataEndTagNameState extends TokenizerState {
public ScriptDataEndTagNameState(final Tokenizer tokenizer) {
super(tokenizer);
}
@Override
public int getMaxPushback() {
return 1;
}
@Override
public List<Token> getNextTokens() throws IOException {
final int ch = consume();
switch (ch) {
case CHARACTER_TABULATION: // fall through
case LINE_FEED: // fall through
case FORM_FEED: // fall through
case SPACE: {
if (isAppropriateEndTag()) {
setTokenizerState(Tokenizer.State.BEFORE_ATTRIBUTE_NAME);
return NOTHING;
} else {
return defaultCase(ch);
}
} // break;
case SOLIDUS: {
if (isAppropriateEndTag()) {
setTokenizerState(Tokenizer.State.SELF_CLOSING_START_TAG);
return NOTHING;
} else {
return defaultCase(ch);
}
} // break;
case GREATER_THAN_SIGN: {
if (isAppropriateEndTag()) {
setTokenizerState(Tokenizer.State.DATA);
final TagToken pendingToken = clearPendingTag();
return one(pendingToken);
} else {
return defaultCase(ch);
}
} // break;
case 'A': // fall through
case 'B': // fall through
case 'C': // fall through
case 'D': // fall through
case 'E': // fall through
case 'F': // fall through
case 'G': // fall through
case 'H': // fall through
case 'I': // fall through
case 'J': // fall through
case 'K': // fall through
case 'L': // fall through
case 'M': // fall through
case 'N': // fall through
case 'O': // fall through
case 'P': // fall through
case 'Q': // fall through
case 'R': // fall through
case 'S': // fall through
case 'T': // fall through
case 'U': // fall through
case 'V': // fall through
case 'W': // fall through
case 'X': // fall through
case 'Y': // fall through
case 'Z': {
appendToTagName(toLower((char) ch));
appendToTemporaryBuffer((char) ch);
return NOTHING;
} // break;
case 'a': // fall through
case 'b': // fall through
case 'c': // fall through
case 'd': // fall through
case 'e': // fall through
case 'f': // fall through
case 'g': // fall through
case 'h': // fall through
case 'i': // fall through
case 'j': // fall through
case 'k': // fall through
case 'l': // fall through
case 'm': // fall through
case 'n': // fall through
case 'o': // fall through
case 'p': // fall through
case 'q': // fall through
case 'r': // fall through
case 's': // fall through
case 't': // fall through
case 'u': // fall through
case 'v': // fall through
case 'w': // fall through
case 'x': // fall through
case 'y': // fall through
case 'z': {
appendToTagName((char) ch);
appendToTemporaryBuffer((char) ch);
return NOTHING;
} // break;
default: {
return defaultCase(ch);
} // break;
}
}
private List<Token> defaultCase(final int ch) throws IOException {
unconsume(ch);
setTokenizerState(Tokenizer.State.DATA);
final String content = "</" + clearTemporaryBuffer();
return CharacterToken.toTokens(content);
}
}
| [
"silnith@gmail.com"
] | silnith@gmail.com |
e24d410aae284795acf22ec7af266161c5140336 | 7224e81ecbe5c7233c3db4d2be249ee517c34072 | /lexuncomm/app/src/main/java/io/cordova/lexuncompany/view/QrCodeScanActivity.java | be33fe99d105800cef03ef52c618f8dd48aa0e88 | [] | no_license | libin1993/jingbaoliankong | bbb4e9311db321c282d569747ed053c5beaefef1 | c51d4bd569209e5ea8a08ec42b270767547fbec5 | refs/heads/master | 2020-07-11T18:22:28.039508 | 2019-10-14T09:25:52 | 2019-10-14T09:25:52 | 204,613,282 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,804 | java | package io.cordova.lexuncompany.view;
import android.app.Activity;
import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.os.Vibrator;
import android.support.v7.app.AppCompatActivity;
import cn.bingoogolapple.photopicker.activity.BGAPhotoPickerActivity;
import cn.bingoogolapple.qrcode.core.QRCodeView;
import io.cordova.lexuncompany.R;
import io.cordova.lexuncompany.databinding.ActivityQrcodeScanBinding;
import io.cordova.lexuncompany.inter.QrCodeScanInter;
public class QrCodeScanActivity extends AppCompatActivity implements QRCodeView.Delegate {
private static final int REQUEST_CODE_CHOOSE_QRCODE_FROM_GALLERY = 666;
private ActivityQrcodeScanBinding mBinding;
private static QrCodeScanInter mQrCodeScanInter; //在AndroidForJSUnits中使用
private String mCallBack;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mBinding = DataBindingUtil.setContentView(this, R.layout.activity_qrcode_scan);
mBinding.zxingview.setDelegate(this);
mCallBack = super.getIntent().getStringExtra("callBack");
setListener();
}
/**
* 在AndroidForJSUnits中动态设置扫描结果监听类
*
* @param qrCodeScanInter
*/
public static void setQrCodeScanInter(QrCodeScanInter qrCodeScanInter) {
mQrCodeScanInter = qrCodeScanInter;
}
private void setListener() {
mBinding.checkboxOpenLight.setOnCheckedChangeListener((compoundButton, b) -> {
turnFlashLightOff();
if (b) {
turnFlashlightOn();
}
});
mBinding.textBtnRight.setOnClickListener(view -> {
Intent photoPickerIntent = new BGAPhotoPickerActivity.IntentBuilder(this)
.cameraFileDir(null)
.maxChooseCount(1)
.selectedPhotos(null)
.pauseOnScroll(false)
.build();
startActivityForResult(photoPickerIntent, REQUEST_CODE_CHOOSE_QRCODE_FROM_GALLERY);
});
mBinding.imgBtnBackComm.setOnClickListener(v -> finish());
}
@Override
protected void onStart() {
super.onStart();
mBinding.zxingview.startCamera(); // 打开后置摄像头开始预览,但是并未开始识别
mBinding.zxingview.startSpotAndShowRect(); // 显示扫描框,并开始识别
}
@Override
protected void onStop() {
mBinding.zxingview.stopCamera(); // 关闭摄像头预览,并且隐藏扫描框
super.onStop();
}
@Override
protected void onDestroy() {
mBinding.zxingview.onDestroy(); // 销毁二维码扫描控件
super.onDestroy();
}
/**
* 打开闪关灯
*/
private void turnFlashlightOn() {
mBinding.checkboxOpenLight.setText("关灯");
mBinding.zxingview.openFlashlight();
}
/**
* 关闭闪关灯
*/
private void turnFlashLightOff() {
mBinding.checkboxOpenLight.setText("开灯");
mBinding.zxingview.closeFlashlight();
}
private void vibrate() {
Vibrator vibrator = (Vibrator) getSystemService(VIBRATOR_SERVICE);
vibrator.vibrate(200);
}
@Override
public void onScanQRCodeSuccess(String result) {
vibrate();
Intent intent = new Intent();
intent.putExtra("result", result);
this.setResult(RESULT_OK, intent);
//如果QrCodeScan不为空,这执行相关回调,同时销毁对象,防止内存堆积
if (mQrCodeScanInter != null) {
mQrCodeScanInter.getQrCodeScanResult(mCallBack, result);
mQrCodeScanInter = null;
}
finish();
}
@Override
public void onCameraAmbientBrightnessChanged(boolean isDark) {
// 这里是通过修改提示文案来展示环境是否过暗的状态,接入方也可以根据 isDark 的值来实现其他交互效果
if (isDark) {
mBinding.checkboxOpenLight.setChecked(true);
}
}
@Override
public void onScanQRCodeOpenCameraError() {
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
mBinding.zxingview.startSpotAndShowRect(); // 显示扫描框,并开始识别
if (resultCode == Activity.RESULT_OK && requestCode == REQUEST_CODE_CHOOSE_QRCODE_FROM_GALLERY) {
final String picturePath = BGAPhotoPickerActivity.getSelectedPhotos(data).get(0);
// 本来就用到 QRCodeView 时可直接调 QRCodeView 的方法,走通用的回调
mBinding.zxingview.decodeQRCode(picturePath);
}
}
} | [
"1993911441@qq.com"
] | 1993911441@qq.com |
1a2306c8875fa871554b9631019ae7f6d303509e | e84f4f2faf2aad5e650ef36a5fe5882fc0590b99 | /src/main/java/com/sunil/collections/questions/array/LargestSmallest.java | b2137e245d0063f2ba253a3c4142193d82df2728 | [] | no_license | sunilpes/DSAndAlgorithms | 0f82e9fe85d93c382e9e3edbca280f11c3ad70ea | a2e0b9ac40eb448c0d5bdf7313f2f17cc1fb1eb9 | refs/heads/master | 2021-08-06T08:30:45.234068 | 2021-07-21T13:08:55 | 2021-07-21T13:08:55 | 236,436,286 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 850 | java | package com.sunil.collections.questions.array;
/**
* Question:
* How do you find the largest and smallest number in an unsorted integer array?
*
*/
public class LargestSmallest {
public static void printLargestSmallest(int[] numbers) {
int largest = Integer.MIN_VALUE;
int smallest = Integer.MAX_VALUE;
for (int num: numbers) {
if (num > largest) {
largest = num;
} else if (num < smallest) {
smallest = num;
}
}
System.out.println(String.format(String.format("smallest: %d", smallest)));
System.out.println(String.format(String.format("largest: %d", largest)));
}
public static void main(String[] args) {
printLargestSmallest(new int[]{-2,-3,-5,0,12,234,789897,232, -110, 567, Integer.MAX_VALUE});
}
}
| [
"sunil.slvphsn@gmail.com"
] | sunil.slvphsn@gmail.com |
f01c01b331c69d4e164e37a737fd463896bb2a3a | 2b4f4b41e8a28a5024d41223b2876c87ee1eaa1a | /Eis-portlet/docroot/WEB-INF/service/com/idetronic/eis/service/LibraryLocalService.java | 8f9367c0ec81f610067943f99d77487b0e203f2b | [] | no_license | merbauraya/lportal6.2 | 48bb99e5b6b937fce6e20e5c76303c4982bcad02 | e7446107fd793a8ab557b4748f3214a83dbe6ce6 | refs/heads/master | 2021-01-21T19:51:52.682108 | 2017-08-08T14:42:38 | 2017-08-08T14:42:38 | 92,167,957 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,604 | java | /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package com.idetronic.eis.service;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.search.IndexableType;
import com.liferay.portal.kernel.transaction.Isolation;
import com.liferay.portal.kernel.transaction.Propagation;
import com.liferay.portal.kernel.transaction.Transactional;
import com.liferay.portal.service.BaseLocalService;
import com.liferay.portal.service.InvokableLocalService;
import com.liferay.portal.service.PersistedModelLocalService;
/**
* Provides the local service interface for Library. Methods of this
* service will not have security checks based on the propagated JAAS
* credentials because this service can only be accessed from within the same
* VM.
*
* @author Mazlan Mat
* @see LibraryLocalServiceUtil
* @see com.idetronic.eis.service.base.LibraryLocalServiceBaseImpl
* @see com.idetronic.eis.service.impl.LibraryLocalServiceImpl
* @generated
*/
@Transactional(isolation = Isolation.PORTAL, rollbackFor = {
PortalException.class, SystemException.class})
public interface LibraryLocalService extends BaseLocalService,
InvokableLocalService, PersistedModelLocalService {
/*
* NOTE FOR DEVELOPERS:
*
* Never modify or reference this interface directly. Always use {@link LibraryLocalServiceUtil} to access the library local service. Add custom service methods to {@link com.idetronic.eis.service.impl.LibraryLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
*/
/**
* Adds the library to the database. Also notifies the appropriate model listeners.
*
* @param library the library
* @return the library that was added
* @throws SystemException if a system exception occurred
*/
@com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX)
public com.idetronic.eis.model.Library addLibrary(
com.idetronic.eis.model.Library library)
throws com.liferay.portal.kernel.exception.SystemException;
/**
* Creates a new library with the primary key. Does not add the library to the database.
*
* @param libraryId the primary key for the new library
* @return the new library
*/
public com.idetronic.eis.model.Library createLibrary(long libraryId);
/**
* Deletes the library with the primary key from the database. Also notifies the appropriate model listeners.
*
* @param libraryId the primary key of the library
* @return the library that was removed
* @throws PortalException if a library with the primary key could not be found
* @throws SystemException if a system exception occurred
*/
@com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE)
public com.idetronic.eis.model.Library deleteLibrary(long libraryId)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException;
/**
* Deletes the library from the database. Also notifies the appropriate model listeners.
*
* @param library the library
* @return the library that was removed
* @throws SystemException if a system exception occurred
*/
@com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE)
public com.idetronic.eis.model.Library deleteLibrary(
com.idetronic.eis.model.Library library)
throws com.liferay.portal.kernel.exception.SystemException;
public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery();
/**
* Performs a dynamic query on the database and returns the matching rows.
*
* @param dynamicQuery the dynamic query
* @return the matching rows
* @throws SystemException if a system exception occurred
*/
@SuppressWarnings("rawtypes")
public java.util.List dynamicQuery(
com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
throws com.liferay.portal.kernel.exception.SystemException;
/**
* Performs a dynamic query on the database and returns a range of the matching rows.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.idetronic.eis.model.impl.LibraryModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
* </p>
*
* @param dynamicQuery the dynamic query
* @param start the lower bound of the range of model instances
* @param end the upper bound of the range of model instances (not inclusive)
* @return the range of matching rows
* @throws SystemException if a system exception occurred
*/
@SuppressWarnings("rawtypes")
public java.util.List dynamicQuery(
com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
int end) throws com.liferay.portal.kernel.exception.SystemException;
/**
* Performs a dynamic query on the database and returns an ordered range of the matching rows.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.idetronic.eis.model.impl.LibraryModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
* </p>
*
* @param dynamicQuery the dynamic query
* @param start the lower bound of the range of model instances
* @param end the upper bound of the range of model instances (not inclusive)
* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
* @return the ordered range of matching rows
* @throws SystemException if a system exception occurred
*/
@SuppressWarnings("rawtypes")
public java.util.List dynamicQuery(
com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
int end,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException;
/**
* Returns the number of rows that match the dynamic query.
*
* @param dynamicQuery the dynamic query
* @return the number of rows that match the dynamic query
* @throws SystemException if a system exception occurred
*/
public long dynamicQueryCount(
com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
throws com.liferay.portal.kernel.exception.SystemException;
/**
* Returns the number of rows that match the dynamic query.
*
* @param dynamicQuery the dynamic query
* @param projection the projection to apply to the query
* @return the number of rows that match the dynamic query
* @throws SystemException if a system exception occurred
*/
public long dynamicQueryCount(
com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
com.liferay.portal.kernel.dao.orm.Projection projection)
throws com.liferay.portal.kernel.exception.SystemException;
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public com.idetronic.eis.model.Library fetchLibrary(long libraryId)
throws com.liferay.portal.kernel.exception.SystemException;
/**
* Returns the library with the primary key.
*
* @param libraryId the primary key of the library
* @return the library
* @throws PortalException if a library with the primary key could not be found
* @throws SystemException if a system exception occurred
*/
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public com.idetronic.eis.model.Library getLibrary(long libraryId)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException;
@Override
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public com.liferay.portal.model.PersistedModel getPersistedModel(
java.io.Serializable primaryKeyObj)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException;
/**
* Returns a range of all the libraries.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.idetronic.eis.model.impl.LibraryModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
* </p>
*
* @param start the lower bound of the range of libraries
* @param end the upper bound of the range of libraries (not inclusive)
* @return the range of libraries
* @throws SystemException if a system exception occurred
*/
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public java.util.List<com.idetronic.eis.model.Library> getLibraries(
int start, int end)
throws com.liferay.portal.kernel.exception.SystemException;
/**
* Returns the number of libraries.
*
* @return the number of libraries
* @throws SystemException if a system exception occurred
*/
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public int getLibrariesCount()
throws com.liferay.portal.kernel.exception.SystemException;
/**
* Updates the library in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
*
* @param library the library
* @return the library that was updated
* @throws SystemException if a system exception occurred
*/
@com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX)
public com.idetronic.eis.model.Library updateLibrary(
com.idetronic.eis.model.Library library)
throws com.liferay.portal.kernel.exception.SystemException;
/**
* Returns the Spring bean ID for this bean.
*
* @return the Spring bean ID for this bean
*/
public java.lang.String getBeanIdentifier();
/**
* Sets the Spring bean ID for this bean.
*
* @param beanIdentifier the Spring bean ID for this bean
*/
public void setBeanIdentifier(java.lang.String beanIdentifier);
@Override
public java.lang.Object invokeMethod(java.lang.String name,
java.lang.String[] parameterTypes, java.lang.Object[] arguments)
throws java.lang.Throwable;
public com.idetronic.eis.model.Library add(long libraryTypeId,
java.lang.String libraryCode, java.lang.String name, long stateId,
com.liferay.portal.service.ServiceContext serviceContext)
throws com.liferay.portal.kernel.exception.SystemException;
public java.util.List<com.idetronic.eis.model.Library> findByState(
long stateId, int start, int end)
throws com.liferay.portal.kernel.exception.SystemException;
public com.idetronic.eis.model.Library findByName(java.lang.String name)
throws com.idetronic.eis.NoSuchLibraryException,
com.liferay.portal.kernel.exception.SystemException;
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public boolean isMissingIRItemData(long libraryId, java.lang.String period);
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public boolean isMissingPrintedItemData(long libraryId,
java.lang.String period);
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public boolean isMissingPositionData(long libraryId, java.lang.String period);
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public boolean isMissingVisitorData(long libraryId, java.lang.String period);
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public boolean isMissingSeatingData(long libraryId, java.lang.String period);
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public boolean isMissingMembershipData(long libraryId,
java.lang.String period);
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public boolean isMissingNonPrintedItemData(long libraryId,
java.lang.String period);
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public boolean isMissingLoanData(long libraryId, java.lang.String period);
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public boolean isMissingExpenseData(long libraryId, java.lang.String period);
} | [
"mazlan.mat@gmail.com"
] | mazlan.mat@gmail.com |
36d01253176f854e6a39723fc6419560106db9c6 | ea9ad729772f5c09a603ba1cee4e6ab0a49129aa | /src/gui/ControllerGui.java | bc3e97fdc9f65f0a38ffc132c9a54df58d8ac6ce | [] | no_license | PavlovicAndrej/IJA | bd3ebc0a90d68194b6b504df103281eef6b69388 | db8724c01e47e8ebdeaf68f20f5bf900bf21ff24 | refs/heads/master | 2023-02-21T11:53:26.071313 | 2020-10-05T10:41:10 | 2020-10-05T10:41:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,325 | java | package gui;
import javafx.application.Platform;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.Pane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Shape;
import model.*;
import java.time.DateTimeException;
import java.time.LocalTime;
import java.util.*;
import java.time.temporal.ChronoField;
/**
* Class representing controller which handles user interface.
*
* @author Andrej Pavlovič <xpavlo14@stud.fit.vutbr.cz>
* @author Daša Nosková <xnosko05@stud.fit.vutbr.cz>
*/
public class ControllerGui {
@FXML
public AnchorPane content;
@FXML
private TextField setTime, changeTimeSpeed, TextFieldTraffic;
@FXML
private TextArea clock;
@FXML
private Pane canvas;
private final List<BusGui> busElements = new ArrayList<>();
private int longestPathLength = 0;
private DataHolder holder;
private Street selectedStreet = null;
private Timer timer;
private LocalTime time = LocalTime.now();
private static int zoomInXth = 0;
/**
* Method sets time to time entered by user.
*/
@FXML
private void onTimeChange() {
try {
time = LocalTime.parse(setTime.getText());
}
catch(DateTimeException ex) {
setTime.clear();
setTime.replaceSelection("Invalid time");
}
showTime();
this.resetBuses();
}
/**
* Method fast-forwards time.
*/
@FXML
public void onTimeChangeSpeed() {
try {
float scale = Float.parseFloat(changeTimeSpeed.getText());
timer.cancel();
startTime(scale);
}
catch (IllegalArgumentException e) {
changeTimeSpeed.replaceSelection("Must be a positive number.");
}
}
/**
* This method is called whenever user confirm set traffic button
*/
@FXML
public void onTrafficSet() {
try {
int traffic = Integer.parseInt(TextFieldTraffic.getText());
if ( this.selectedStreet == null ) {
TextFieldTraffic.replaceSelection("Street not selected.");
}
else {
this.selectedStreet.setTraffic(traffic);
this.resetBuses();
}
}
catch (IllegalArgumentException e) {
TextFieldTraffic.replaceSelection("Must be a positive integer number.");
}
}
/**
* Method sets street as selected on mouseclick.
* @param street Clicked on street.
*/
private void setSelectedStreet(StreetGui street) {
//Creating the mouse event handler
EventHandler<MouseEvent> eventHandler = new EventHandler<MouseEvent>() {
@Override
public void handle(MouseEvent e) {
try {
removeLines();
selectedStreet = street.getStreet();
street.getGUI().get(0).setStroke(Color.GOLD);
}
catch (IndexOutOfBoundsException exception) {
System.out.println("INDEX OUT OF BOUNDS");
}
}
};
//Adding event Filter
street.getGUI().get(0).addEventFilter(MouseEvent.MOUSE_CLICKED, eventHandler);
}
/**
* Method shows time.
*/
@FXML
public void showTime(){
clock.clear();
clock.setText(LocalTime.of(time.getHour(),time.getMinute(),time.getSecond()).toString());
}
/**
* Method zooms in and out the map.
*/
@FXML
private void onZoom(KeyEvent event) {
event.consume();
if ( event.getEventType() == KeyEvent.KEY_PRESSED) {
KeyCode code = event.getCode();
if (code == KeyCode.ADD || code == KeyCode.UP) {
zoomInXth++;
content.setScaleX(1.1 * content.getScaleX());
content.setScaleY(1.1 * content.getScaleY());
}
else if (code == KeyCode.SUBTRACT || code == KeyCode.DOWN) {
zoomInXth--;
content.setScaleX(0.9 * content.getScaleX());
content.setScaleY(0.9 * content.getScaleY());
}
// move the object
if (zoomInXth > 0) {
content.setTranslateX(100* zoomInXth);
content.setTranslateY(100* zoomInXth);
}
else {
content.setTranslateX(0);
content.setTranslateY(0);
}
content.layout();
}
}
/**
* Sets Buses elements to gui
*
* @param elements buses elements
*/
private void setBusElements(List<BusGui> elements){
for (BusGui busGui : elements) {
content.getChildren().addAll(busGui.getGUI());
}
}
/**
* sets basic map elements (streets, stops) to gui
*/
public void setMapBase() {
List<Drawable> elements = new ArrayList<>();
/* create street elements */
for (Street street : holder.getStreets()) {
StreetGui streetGui = new StreetGui(street.getStart(), street.getEnd(), street);
setSelectedStreet(streetGui);
elements.add(streetGui);
}
/* create stop elements */
for (Stop stop : holder.getStops()) {
elements.add(new StopGui(stop.getId(), stop.getCoordinate()));
}
/* set basic elements to gui */
for (Drawable drawable : elements) {
content.getChildren().addAll(drawable.getGUI());
}
}
/**
* Method unsets selected street.
*/
private void unsetSelectedStreet() {
try {
if ( this.selectedStreet.getTraffic() == 0 ) {
selectedStreet.getStreetGui().getGUI().get(0).setStroke(Color.SILVER);
}
else {
selectedStreet.getStreetGui().getGUI().get(0).setStroke(Color.RED);
}
selectedStreet = null;
}
catch (NullPointerException e) {
//no street to unselect
}
}
/**
* Method removes highlighted path of selected bus on mouse-click.
*/
public void removeLines(MouseEvent event) {
event.consume();
if (event.getEventType() == MouseEvent.MOUSE_CLICKED) {
removeLines();
unsetSelectedStreet();
}
}
/**
* Method removes highlighted path of selected bus.
*/
public void removeLines() {
canvas.getChildren().clear();
for (Drawable element : this.busElements) {
for (int i = 0; i < element.getGUI().size(); i++) {
Shape el = element.getGUI().get(i);
if (el.getTypeSelector().equals("Line")) {
el.setStroke(Color.TRANSPARENT);
}
}
}
}
/**
* Method starts timer and activates buses.
* @param scale Time speed.
*/
public void startTime(float scale) {
timer = new Timer(false);
timer.scheduleAtFixedRate(new TimerTask() {
@Override
public void run() {
Platform.runLater(() -> {
time = time.plusSeconds(1);
for (BusGui busGui : busElements) {
busGui.update();
showItinerary(busGui);
}
showTime();
activateBuses();
deactivateBuses();
});
}
}, 0, (long)(1000/scale));
for ( model.Line line : holder.getLines() ) {
if ( this.longestPathLength < line.getPathLength() ) {
this.longestPathLength = line.getPathLength();
}
}
}
/**
* Activate buses if local time reached their start time
*/
private void activateBuses() {
List<BusGui> elements = new ArrayList<>();
for (model.Line line : this.holder.getLines()) {
if ( line.getBusesTimes().contains(time.get(ChronoField.MINUTE_OF_DAY)) && time.get(ChronoField.SECOND_OF_MINUTE) == 1 ) {
/* bus is starting right now */
elements.add(new BusGui(line, 1, new Path(createPathCoords(line), line),time.toSecondOfDay()));
}
}
if ( ! elements.isEmpty() ) {
this.busElements.addAll(elements);
this.setBusElements(elements);
}
}
/**
* Method creates path for line.
* @param line Line for which to create path.
* @return List of coordinates representing path.
*/
public List<Coordinate> createPathCoords(model.Line line) {
List<Stop> StopsLine = line.getStops();
List<Coordinate> pathCoords = new ArrayList<>();
List<Street> StreetLine = line.getStreets();
pathCoords.add(StopsLine.get(0).getCoordinate()); //first stop
for (Street str : StreetLine) {
// if its last street in Line, get only beginning of street
if (str.equals(StreetLine.get(StreetLine.size() - 1))) {
pathCoords.add(str.getStart());
continue;
}
//if its first street in line get only end of street
if (str.equals(StreetLine.get(0))) {
pathCoords.add(str.getEnd());
continue;
}
pathCoords.add(str.getStart());
pathCoords.add(str.getEnd());
}
pathCoords.add(StopsLine.get(StopsLine.size() - 1).getCoordinate()); //last stop
return pathCoords;
}
/**
* Deactivate buses if local time reached their end time
*/
private void deactivateBuses() {
List<BusGui> busesToRemove = new ArrayList<>();
for ( BusGui busGui : this.busElements ) {
if (busGui.getDistance() > busGui.getPath().getPathSize()) {
/* bus finished */
for (int i = 0; i < busGui.getGUI().size()-1; i++) {
if (busGui.getGUI().get(i+1).getTypeSelector().equals("Line"))
busGui.getGUI().get(i+1).setStroke(Color.TRANSPARENT);
}
busesToRemove.add(busGui);
content.getChildren().remove(busGui.getGUI().get(0));
}
}
this.busElements.removeAll(busesToRemove);
}
/**
* Activate buses if some sort of time jump is made in application (first start, time change, ..)
*
* Will activate all buses already on road, that means local time is somewhere between their start and end time
*
* @param offset if offset is equal to zero, method is activating buses from range midnight to actual time, if greater than zero, method is activating buses from range (midnight - offset) to midnight
*/
public void activateActiveBuses (int offset) {
final int SECOND_BEFORE_MIDNIGHT = 86399;
List<BusGui> elements = new ArrayList<>();
for ( model.Line line : this.holder.getLines() ) {
for ( int busTime : line.getBusesTimes() ) {
if ( busTime * 60 > (offset == 0 ? this.time.toSecondOfDay() : SECOND_BEFORE_MIDNIGHT) - line.getPathLength() + offset && busTime * 60 < (offset == 0 ? this.time.toSecondOfDay() : SECOND_BEFORE_MIDNIGHT) ) {
/* bus is active on road right now */
// create new bus and initialize his position as his starting position
BusGui busGui = new BusGui(line, 1, new Path(createPathCoords(line), line), time.toSecondOfDay());
elements.add(busGui);
for ( int i = busTime * 60 ; i <= (offset == 0 ? this.time.toSecondOfDay() : SECOND_BEFORE_MIDNIGHT + offset); i++ ) {
/* catch up bus position from his starting position to actual time position */
busGui.update();
}
busGui.updateDeparture();
}
}
}
this.busElements.addAll(elements);
this.setBusElements(elements);
}
/**
* Method shows itinerary of the bus on mouse-click on the bus.
* @param busGui Clicked on bus.
*/
private void showItinerary(BusGui busGui) {
Itinerary it = busGui.getItinerary();
//Creating the mouse event handler
EventHandler<MouseEvent> eventHandler = new EventHandler<MouseEvent>() {
@Override
public void handle(MouseEvent e) {
try {
removeLines();
canvas = it.createItinerary(canvas);
canvas.setVisible(true);
for (int i = 0; i < (busGui.getPath().getGUI().size()); i++) {
busGui.getGUI().get(i).setStroke(busGui.getLine().getColor());
}
}
catch (IndexOutOfBoundsException exception) {
//System.out.println("INDEX OUT OF BOUNDS");
}
}
};
//Adding event Filter
busGui.getGUI().get(0).addEventFilter(MouseEvent.MOUSE_CLICKED, eventHandler);
}
/**
* Deactivate all buses and paint them again with new information, used if data dictating bus position were changed
*/
public void resetBuses() {
/* deactivate all buses */
for ( BusGui busGui : this.busElements ) {
content.getChildren().remove(busGui.getGUI().get(0));
}
this.busElements.clear();
/* activate all buses */
this.activateActiveBuses(0);
/* Activate buses before midnight if time was set close after midnight and not all buses starting before midnight already finished */
if ( this.time.toSecondOfDay() - this.longestPathLength < 0) {
this.activateActiveBuses(this.time.toSecondOfDay());
}
}
/**
* Setter for 'holder'
*
* @param holder data holder
*/
public void setHolder(DataHolder holder) {
this.holder = holder;
}
} | [
"xpavlo14@stud.fit.vutbr.cz"
] | xpavlo14@stud.fit.vutbr.cz |
0eb0891d8eeb04c99982de0922d4b7a21e23fc26 | af0048b7c1fddba3059ae44cd2f21c22ce185b27 | /springframework/src/main/java/org/springframework/aop/support/RegexpMethodPointcutAdvisor.java | 8665819094a23dc679ee0ac03dbf29eb639da1e5 | [] | no_license | P79N6A/whatever | 4b51658fc536887c870d21b0c198738ed0d1b980 | 6a5356148e5252bdeb940b45d5bbeb003af2f572 | refs/heads/master | 2020-07-02T19:58:14.366752 | 2019-08-10T14:45:17 | 2019-08-10T14:45:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,880 | java | package org.springframework.aop.support;
import org.aopalliance.aop.Advice;
import org.springframework.aop.Pointcut;
import org.springframework.lang.Nullable;
import org.springframework.util.ObjectUtils;
import java.io.Serializable;
@SuppressWarnings("serial")
public class RegexpMethodPointcutAdvisor extends AbstractGenericPointcutAdvisor {
@Nullable
private String[] patterns;
@Nullable
private AbstractRegexpMethodPointcut pointcut;
private final Object pointcutMonitor = new SerializableMonitor();
public RegexpMethodPointcutAdvisor() {
}
public RegexpMethodPointcutAdvisor(Advice advice) {
setAdvice(advice);
}
public RegexpMethodPointcutAdvisor(String pattern, Advice advice) {
setPattern(pattern);
setAdvice(advice);
}
public RegexpMethodPointcutAdvisor(String[] patterns, Advice advice) {
setPatterns(patterns);
setAdvice(advice);
}
public void setPattern(String pattern) {
setPatterns(pattern);
}
public void setPatterns(String... patterns) {
this.patterns = patterns;
}
@Override
public Pointcut getPointcut() {
synchronized (this.pointcutMonitor) {
if (this.pointcut == null) {
this.pointcut = createPointcut();
if (this.patterns != null) {
this.pointcut.setPatterns(this.patterns);
}
}
return this.pointcut;
}
}
protected AbstractRegexpMethodPointcut createPointcut() {
return new JdkRegexpMethodPointcut();
}
@Override
public String toString() {
return getClass().getName() + ": advice [" + getAdvice() + "], pointcut patterns " + ObjectUtils.nullSafeToString(this.patterns);
}
private static class SerializableMonitor implements Serializable {
}
}
| [
"heavenlystate@163.com"
] | heavenlystate@163.com |
54d8aff64eec04893145a4c824c2f25471672568 | d8da4ce81fd1de454cc3d29b00c1cf7f6ed936bd | /src/main/java/pancakesort.java | 0b4c100bdeaf6a5d8576ddd5b63a76192b31765f | [] | no_license | STllll/LeetCode | d302d0ba6dbc9d8ee43bc3bb5d83538f241c5717 | e28c498b4da7452d1c409d3fc2527bb683c924c4 | refs/heads/master | 2021-07-19T18:32:57.855976 | 2020-07-17T03:01:36 | 2020-07-17T03:01:36 | 194,067,910 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,394 | java | import java.util.ArrayList;
import java.util.List;
public class pancakesort {
public static void main(String[] args){
int[] number = new int[]{10,5,1,6,3,8,2,4,7,9};
System.out.println(pancake(number));
}
public static List<Integer> pancake(int[] A) {
int n = A.length;
List<Integer> list = new ArrayList<>();
if(issorted(A)) return list;
while(!issorted(A)) {
int index = findMax(A,list.size() / 2);
list.add(index + 1);
swap(A, index + 1);
swap(A, n);
list.add(n--);
}
return list;
}
public static boolean issorted(int[] num) {
for(int i = 0; i < num.length - 1; i++) {
if(num[i] > num[i + 1]) return false;
}
return true;
}
public static int findMax(int[] num, int size) {
int index = 0;
int max = 0;
for(int i = 0; i < num.length - size; i++) {
if(num[i] > max ) {
max = num[i];
index = i;
}
}
return index;
}
public static void swap(int[] num, int i) {
for (int j = 0; j <= i / 2; j++) {
int temp = num[i - 1];
num[i - 1] = num[j];
num[j] = temp;
i--;
}
}
}
| [
"leo.shen@dbappsecurity.com.cn"
] | leo.shen@dbappsecurity.com.cn |
efe471fe888a111d424bf3512760e55dab8f0425 | a72f90a9139329be9f37db065947a3bfe47543a2 | /src/com/wenbin/base/thread/CountDownLatchDemo.java | 841a670217d8451579371964d323d7c5d318c073 | [] | no_license | wenbin8/PractiseCode | 2a571f1e2d7271761251c4688937583b5a5b9bce | ae2412796f0649fbb7210ba7d4e8f7bb4ae5b880 | refs/heads/master | 2022-01-30T19:00:47.371967 | 2019-06-14T05:54:50 | 2019-06-14T05:54:50 | 104,832,771 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,155 | java | package com.wenbin.base.thread;
import java.util.concurrent.CountDownLatch;
/**
* @Auther: wenbin
* @Date: 2019/4/3 17:25
* @Description:
*/
public class CountDownLatchDemo {
public static void main(String[] args) throws InterruptedException {
CountDownLatch countDownLatch = new CountDownLatch(3);
new Thread(()->{
countDownLatch.countDown();
}, "t1").start();
new Thread(()->{
try {
Thread.sleep(30000);
} catch (InterruptedException e) {
e.printStackTrace();
}
countDownLatch.countDown();
}, "t2").start();
new Thread(()->{
countDownLatch.countDown();
}, "t3").start();
new Thread(()->{
try {
countDownLatch.await();
System.out.println("t4 唤醒");
} catch (InterruptedException e) {
e.printStackTrace();
}
}, "t4").start();
countDownLatch.await();
System.out.println("main 唤醒");
// 唤醒顺序 t2唤醒main main唤醒t4 t2->main->t4
}
}
| [
"dongwenbin@jindanlicai.com"
] | dongwenbin@jindanlicai.com |
10d86c013c30e949baf6cdbb6b2bcd3fd51b6271 | 3b2b23b6078d3f7d96ff924ce66a265c10c95ac2 | /app/src/test/java/com/huirong/authguidesdk/ExampleUnitTest.java | 722ad9f4b0eddc617751293b28ed9f753a746ae1 | [] | no_license | huirong628/authguidesdk | 49b408effcfe1cb51beb8118e312faed03d87b05 | b5e05f72b77c88e1956b5a1adad9df6c2fbd63fb | refs/heads/master | 2021-01-12T06:32:05.034589 | 2016-12-28T08:47:04 | 2016-12-28T08:47:04 | 77,378,054 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 402 | java | package com.huirong.authguidesdk;
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);
}
} | [
"mrzhang628@gmail.com"
] | mrzhang628@gmail.com |
d1a50fd34fc0d16d72c7b759226db48bd39f207d | 929c4a99340c526367e7ab0f928d6510104bfeed | /src/main/java/io/renren/modules/app/entity/ScoreLevelEnum.java | f02473cb24099703c2b31c6b838fa29cad58eae7 | [
"Apache-2.0"
] | permissive | xukaka/leifeng | ffc61cc401c4fbf399aa7c661efe40bff9872431 | 693fbbc56ebc2b1ccfaebf9088e18a80477fb145 | refs/heads/master | 2022-07-19T01:23:20.522761 | 2019-07-23T10:18:15 | 2019-07-23T10:18:15 | 179,056,100 | 0 | 1 | Apache-2.0 | 2022-06-21T01:02:11 | 2019-04-02T10:41:55 | JavaScript | UTF-8 | Java | false | false | 382 | java | package io.renren.modules.app.entity;
public enum ScoreLevelEnum {
oneStar(1),
twoStar(2),
threeStar(3),
fourStar(4),
fiveStar(5);
private int score;
ScoreLevelEnum(int score) {
this.score = score;
}
public int getScore() {
return score;
}
public void setScore(int score) {
this.score = score;
}
}
| [
"1139963253@qq.com"
] | 1139963253@qq.com |
4a8df5f27a896a3694eb9f2387d5348a466d5732 | 613759b1e1e94de1b82c03e071967a02241c7799 | /src/main/java/com/capg/censusanalyser/StateCensusAnalyser.java | 9b0226bb916872105d3fadbb9219d94ae93362f7 | [] | no_license | bhargavmln/Indian-Census-Analyser | 2e6d48fd7e99e91761ebc9cc50fed54e4f616800 | a729fa4da7904c253d7309638870306c95a312f4 | refs/heads/master | 2023-01-04T10:08:16.550051 | 2020-10-26T18:44:08 | 2020-10-26T18:44:08 | 307,162,141 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,345 | java | package com.capg.censusanalyser;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
import com.google.gson.Gson;
public class StateCensusAnalyser {
public StateCensusAnalyser() {
}
public int loadIndiaCensusData(String STATE_CSV_DATA) throws CensusAnalyserException {
return new CSVStateCensus().loadIndiaCensusData(STATE_CSV_DATA).size();
}
public int loadIndianStateCode(String STATE_CODE_DATA) throws CensusAnalyserException {
return new CSVStates().loadIndianStateCode(STATE_CODE_DATA).size();
}
public String getStateWiseSortedCensusData(String STATE_CENSUS_DATA) throws CensusAnalyserException {
List<StateCensusData> stateCensusList = new CSVStateCensus().loadIndiaCensusData(STATE_CENSUS_DATA);
List<StateCensusData> sortedStateCensusList = stateCensusList.stream()
.sorted(Comparator.comparing(StateCensusData::getState)).collect(Collectors.toList());
String sortedStateList = new Gson().toJson(sortedStateCensusList);
return sortedStateList;
}
public String getStateCodeWiseSortedData(String STATE_CODE_DATA) throws CensusAnalyserException {
List<StateCodeData> stateCodeList = new CSVStates().loadIndianStateCode(STATE_CODE_DATA);
List<StateCodeData> sortedStateList = stateCodeList.stream()
.sorted(Comparator.comparing(StateCodeData::getStateCode)).collect(Collectors.toList());
String sortedStateCodeList = new Gson().toJson(sortedStateList);
return sortedStateCodeList;
}
public String getPopulationWiseSortedCensusData(String STATE_CENSUS_DATA) throws CensusAnalyserException {
List<StateCensusData> stateCensusList = new CSVStateCensus().loadIndiaCensusData(STATE_CENSUS_DATA);
List<StateCensusData> sortedStateCensusList = stateCensusList.stream()
.sorted(Comparator.comparing(StateCensusData::getPopulation)).collect(Collectors.toList());
int index = stateCensusList.size();
StateCensusData[] stateCensusData = new StateCensusData[index];
for (StateCensusData s : sortedStateCensusList)
stateCensusData[--index] = s;
String sortedStateList = new Gson().toJson(Arrays.asList(stateCensusData));
return sortedStateList;
}
public String getPopulationDensityWiseSortedCensusData(String STATE_CENSUS_DATA) throws CensusAnalyserException {
List<StateCensusData> stateCensusList = new CSVStateCensus().loadIndiaCensusData(STATE_CENSUS_DATA);
List<StateCensusData> sortedStateCensusList = stateCensusList.stream()
.sorted(Comparator.comparing(StateCensusData::getDensityPerSqKm).reversed())
.collect(Collectors.toList());
String sortedStateList = new Gson().toJson(sortedStateCensusList);
return sortedStateList;
}
public String getAreaWiseSortedCensusData(String STATE_CENSUS_DATA) throws CensusAnalyserException {
List<StateCensusData> stateCensusList = new CSVStateCensus().loadIndiaCensusData(STATE_CENSUS_DATA);
List<StateCensusData> sortedStateCensusList = stateCensusList.stream()
.sorted(Comparator.comparing(StateCensusData::getAreaInSqKm).reversed()).collect(Collectors.toList());
return toJson(sortedStateCensusList);
}
public List<StateCensusData> loadIndianCensuaData(String PATH) throws CensusAnalyserException {
return new CSVStateCensus().loadIndiaCensusData(PATH);
}
public <E> String toJson(List<E> list) {
return new Gson().toJson(list);
}
} | [
"bhargavmln@gmail.com"
] | bhargavmln@gmail.com |
4bd44ffe9aeb5d785f897435d7c1cbc00ffe59d5 | 62bbd2ceeb59fc713e610133f37e5fee7271e91b | /src/main/java/ua/goit/timonov/enterprise/module_6_2/view/menus/CookedDishHandler.java | 70883e61c3634ebdd82589899e4e19237a7f6018 | [] | no_license | alextimonov/GoJavaEnterprise | 7f4408cc5ad65f1c699cf8193b2098ef4d8d3502 | 56dc584ad5e3ae00933b9e96d46fa79d57756e0a | refs/heads/master | 2021-01-23T14:05:07.584488 | 2016-09-23T21:17:35 | 2016-09-23T21:17:35 | 59,581,892 | 0 | 1 | null | 2016-09-23T22:10:50 | 2016-05-24T14:47:25 | Java | UTF-8 | Java | false | false | 3,008 | java | package ua.goit.timonov.enterprise.module_6_2.view.menus;
import ua.goit.timonov.enterprise.module_6_2.controllers.CookedDishController;
import ua.goit.timonov.enterprise.module_6_2.controllers.DishController;
import ua.goit.timonov.enterprise.module_6_2.controllers.EmployeeController;
import ua.goit.timonov.enterprise.module_6_2.controllers.OrderController;
import ua.goit.timonov.enterprise.module_6_2.model.*;
import ua.goit.timonov.enterprise.module_6_2.view.console.ConsoleIO;
import java.util.List;
/**
* Handler for tasks with DB Restaurant's component CookedDish
* with implementation of methods from DbItemHandlerWithBaseMethods:
* - get from DB list of all cooked dishes
* - add new cooked dish
*/
public class CookedDishHandler extends DbItemHandlerWithBaseMethods<CookedDish> {
public static final String COOK = "cook's";
public static final String ORDER = "order's";
public static final String DISH_NAME = "dish name";
public static final String NAME = "name";
public static final String COOKED_DISH = "Cooked dish";
private CookedDishController cookedDishController;
private OrderController orderController;
private DishController dishController;
private EmployeeController employeeController;
public void setCookedDishController(CookedDishController cookedDishController) {
this.cookedDishController = cookedDishController;
}
public void setOrderController(OrderController orderController) {
this.orderController = orderController;
}
public void setDishController(DishController dishController) {
this.dishController = dishController;
}
public void setEmployeeController(EmployeeController employeeController) {
this.employeeController = employeeController;
}
/**
* Uses inherited constructor with setting component's name
*/
public CookedDishHandler() {
super(COOKED_DISH);
}
// implementation of inherited methods from DbItemHandlerWithBaseMethods
@Override
protected List<CookedDish> getAllItems() {
return cookedDishController.getAll();
}
@Override
protected void outputItemList(List<CookedDish> cookedDishes) {
ConsoleIO.outputCookedDish(cookedDishes);
}
@Override
protected String getName(CookedDish cookedDish) {
return cookedDish.getName();
}
@Override
protected CookedDish inputItem() {
int orderId = ConsoleIO.inputInteger(ORDER, ID);
String dishName = ConsoleIO.inputString(DISH_NAME, NAME);
int cookId = ConsoleIO.inputInteger(COOK, ID);
Order order = orderController.search(orderId);
Dish dish = dishController.search(dishName);
Employee cook = employeeController.search(cookId);
CookedDish cookedDish = new CookedDish(order, dish, cook);
return cookedDish;
}
@Override
protected void addItem(CookedDish newCookedDish) {
cookedDishController.add(newCookedDish);
}
}
| [
"timalex1206@gmail.com"
] | timalex1206@gmail.com |
fde467ed9fc4b23b3b3d99fb43e6cbdefb26f05b | adf90638f72e78781882d4238d0791b2438c9307 | /solr_jd/src/cn/itcast/service/ProductServiceImpl.java | 87edeb72cdd130ba5bf6aecbe678f3d8ecf2b5a3 | [
"Apache-2.0"
] | permissive | qiaochaofeng/SSM | 7d005716aeb5b81ee6318c4e6662da9f6d251d4c | 253f9ef7c2578e10d390ad7bd4b8fd409303990c | refs/heads/master | 2021-01-22T21:12:15.646865 | 2017-03-26T10:22:29 | 2017-03-26T10:22:29 | 85,401,790 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,044 | java | package cn.itcast.service;
import org.apache.solr.client.solrj.SolrQuery;
import org.apache.solr.client.solrj.SolrQuery.ORDER;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.itcast.dao.ProductDao;
import cn.itcast.pojo.ResultModel;
@Service
public class ProductServiceImpl implements ProductService {
@Autowired
private ProductDao productDao;
private static final Integer SIZE = 8;
@Override
public ResultModel queryProduct(String queryString, String catalog_name, String price, String sort, Integer page)
throws Exception {
// // 总页数
// private Long pageCount;
// // 当前页
// private long curPage;
//solr 查询对象
SolrQuery query = new SolrQuery();
//设置搜索条件
if(null != queryString && "" != queryString){
query.setQuery(queryString);
}else{
query.setQuery("*:*");
}
//设置筛选条件
if(null != catalog_name && "" != catalog_name){
query.addFilterQuery("product_catalog_name:"+catalog_name);
}
//价格
if(null != price && "" != price ){
String[] split = price.split("-");
query.addFilterQuery("product_price:["+split[0]+" TO "+split[1]+"]");
}
//设置默认搜索域
query.set("df", "product_name");
//设置排序
if(null != sort && "" != sort){
query.setSort("product_price", "1".equals(sort) ? ORDER.asc : ORDER.desc);
}
//设置分页
if(page == null){
page = 1;
}
query.setStart((page - 1) * SIZE);
query.setRows(SIZE);
//设置高亮
query.setHighlight(true);
query.addHighlightField("product_name");
query.setHighlightSimplePre("<font color = 'red'>");
query.setHighlightSimplePost("</font>");
ResultModel resultModel = productDao.queryProduct(query);
resultModel.setCurPage(page);
// 总页数
Long recordCount = resultModel.getRecordCount();
Long pageCount = recordCount / SIZE;
if(recordCount % SIZE > 0){
pageCount++;
}
resultModel.setPageCount(pageCount);
return resultModel;
}
}
| [
"chaofeng2013@sina.cn"
] | chaofeng2013@sina.cn |
4c2c9c41dcbeffca1a8d637883a5a4fbcd166aad | d82ee9707d0208a3f42a321c8dfa57699fd40329 | /MVC/src/model/EpilogueDTO.java | 44a129a228bd5affb8f0b7640f1ba60fade56349 | [] | no_license | jaeyoung49/MVCproject | 106fe31eca97268467596a891ac479da5f86baf4 | e28a90ca2a5868d30911d2444b3a64303523dea8 | refs/heads/master | 2020-12-24T08:39:50.607256 | 2016-11-15T10:33:28 | 2016-11-15T10:33:28 | 73,332,107 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,575 | java | package model;
/*a_no number not null, -- 게시글 번호
c_c_no number not null, -- 화장품 카테고리 번호
e_favorite number default 0, -- 추천수
image_path varchar2(100), -- 이미지 경로
file_name varchar2(100), -- 파일 이름
file_ext varchar2(100), -- 파일 확장자*/
public class EpilogueDTO {
private int c_c_no;
private String image_path;
private String file_name;
private String file_ext;
private int e_favorite;
private MemberDTO memberDTO;
private ArticleDTO articleDTO;
private C_Category c_category;
public EpilogueDTO() {
super();
}
public EpilogueDTO(C_Category c_category) {
super();
this.c_category = c_category;
}
public EpilogueDTO(MemberDTO memberDTO) {
super();
this.memberDTO = memberDTO;
}
public EpilogueDTO(MemberDTO memberDTO, ArticleDTO articleDTO) {
super();
this.memberDTO = memberDTO;
this.articleDTO = articleDTO;
}
public EpilogueDTO(ArticleDTO articleDTO, int c_c_no, String file_name, String file_ext) {
this.articleDTO = articleDTO;
this.c_c_no = c_c_no;
this.file_name = file_name;
this.file_ext = file_ext;
}
public EpilogueDTO(MemberDTO memberDTO, ArticleDTO articleDTO, int c_c_no, String image_path, String file_name,
String file_ext) {
super();
this.c_c_no = c_c_no;
this.image_path = image_path;
this.file_name = file_name;
this.file_ext = file_ext;
// this.e_favorite = e_favorite;
this.memberDTO = memberDTO;
this.articleDTO = articleDTO;
}
public int getC_c_no() {
return c_c_no;
}
public void setC_c_no(int c_c_no) {
this.c_c_no = c_c_no;
}
public String getImage_path() {
return image_path;
}
public void setImage_path(String image_path) {
this.image_path = image_path;
}
public String getFile_name() {
return file_name;
}
public void setFile_name(String file_name) {
this.file_name = file_name;
}
public String getFile_ext() {
return file_ext;
}
public void setFile_ext(String file_ext) {
this.file_ext = file_ext;
}
public int getE_favorite() {
return e_favorite;
}
public void setE_favorite(int e_favorite) {
this.e_favorite = e_favorite;
}
public MemberDTO getMemberDTO() {
return memberDTO;
}
public void setMemberDTO(MemberDTO memberDTO) {
this.memberDTO = memberDTO;
}
public ArticleDTO getArticleDTO() {
return articleDTO;
}
public void setArticleDTO(ArticleDTO articleDTO) {
this.articleDTO = articleDTO;
}
public C_Category getC_category() {
return c_category;
}
public void setC_category(C_Category c_category) {
this.c_category = c_category;
}
}
| [
"jaeyoung49@gmail.com"
] | jaeyoung49@gmail.com |
bf797a5feca78f142e67124651a87e532cbda724 | 5486c322d6df279f4f707c317b85fe1b24df0639 | /src/br/com/caelum/livraria/util/LogPhaseListener.java | 0a8c441d886e553ae6a41eff94633218c62f1e5b | [] | no_license | grsantosgit/jsf-livrariav2 | d64a13d1b7d5b9d68998178f90f9b2c7557e8abe | be32e32c0d5b660ba9427853d33a4404b8de81ee | refs/heads/master | 2021-01-09T05:46:33.437996 | 2017-02-03T19:50:38 | 2017-02-03T19:50:38 | 80,831,529 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 492 | java | package br.com.caelum.livraria.util;
import javax.faces.event.PhaseEvent;
import javax.faces.event.PhaseId;
import javax.faces.event.PhaseListener;
public class LogPhaseListener implements PhaseListener{
@Override
public void afterPhase(PhaseEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void beforePhase(PhaseEvent event) {
System.out.println("FASE "+ event.getPhaseId());
}
@Override
public PhaseId getPhaseId() {
return PhaseId.ANY_PHASE;
}
}
| [
"guilherme.rosa.santos@outlook.com"
] | guilherme.rosa.santos@outlook.com |
8e4ebbfc70748c6955985c20a8fcdf3d56fd95b8 | ee5774933ab13acffe5b81336fa6e060eacb1cf5 | /build/src/main/java/com/mypurecloud/sdk/v2/model/QueueConversationSocialExpressionEventTopicJourneyCustomerSession.java | 74451b6fb446f70fc6c2afd02edb91c80a763f2e | [
"MIT"
] | permissive | deerghayu/platform-client-sdk-java | d1ad7a7513da57872cae90ac7b5cd7da0be2dd25 | df466b7e231d1632ab9e669b0953b9a3289c3c34 | refs/heads/master | 2022-11-29T18:07:18.173617 | 2020-02-26T05:26:38 | 2020-02-26T05:26:38 | 238,808,182 | 0 | 0 | MIT | 2020-02-06T23:47:38 | 2020-02-06T23:47:38 | null | UTF-8 | Java | false | false | 2,600 | java | package com.mypurecloud.sdk.v2.model;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
/**
* QueueConversationSocialExpressionEventTopicJourneyCustomerSession
*/
public class QueueConversationSocialExpressionEventTopicJourneyCustomerSession implements Serializable {
private String id = null;
private String type = null;
/**
**/
public QueueConversationSocialExpressionEventTopicJourneyCustomerSession id(String id) {
this.id = id;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("id")
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
/**
**/
public QueueConversationSocialExpressionEventTopicJourneyCustomerSession type(String type) {
this.type = type;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("type")
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
QueueConversationSocialExpressionEventTopicJourneyCustomerSession queueConversationSocialExpressionEventTopicJourneyCustomerSession = (QueueConversationSocialExpressionEventTopicJourneyCustomerSession) o;
return Objects.equals(this.id, queueConversationSocialExpressionEventTopicJourneyCustomerSession.id) &&
Objects.equals(this.type, queueConversationSocialExpressionEventTopicJourneyCustomerSession.type);
}
@Override
public int hashCode() {
return Objects.hash(id, type);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class QueueConversationSocialExpressionEventTopicJourneyCustomerSession {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
| [
"purecloud-jenkins@ininica.com"
] | purecloud-jenkins@ininica.com |
635a8bd3b55985428a0f56b9e7c56be5659c8eb3 | 6cd7dfd4baf9da1b883997a708ac47d63841b356 | /Amazing Numbers/task/src/numbers/Main.java | 65262076a9307702e9f4c78ed786d1fb0e510ca0 | [] | no_license | trading-software/Amazing-Numbers | 5470db121751e40b60280d36fbf0723ecbb537af | 727ba923cdc1ac0959ee2af09f321391e099807f | refs/heads/main | 2023-06-22T15:47:42.087367 | 2021-07-27T09:44:42 | 2021-07-27T09:44:42 | 388,724,765 | 0 | 0 | null | 2021-07-27T09:44:43 | 2021-07-23T08:03:01 | null | UTF-8 | Java | false | false | 5,341 | java | package numbers;
import java.util.Scanner;
public class Main {
static Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
//menu();
IO.start();
}
private static void menu() {
System.out.println("Welcome to Amazing Numbers!\n" +
"\n" +
"Supported requests:\n" +
"- enter a natural number to know its properties;\n" +
"- enter two natural numbers to obtain the properties of the list:\n" +
" * the first parameter represents a starting number;\n" +
" * the second parameters show how many consecutive numbers are to be processed;\n" +
"- two natural numbers and a property to search for;\n" +
"- separate the parameters with one space;\n" +
"- enter 0 to exit.\n");
loop();
}
private static void loop() {
long n;
do {
long[] inputArray = new long[0];
try {
inputArray = input();
} catch (IllegalArgumentException e) {
System.out.println(e.getMessage());
loop();
break;
}
n = inputArray[1];
long numOfNums = inputArray[0];
if (numOfNums == -1) {
if (n < 0) {
System.out.println("The first parameter should be a natural number or zero.");
} else {
printProperties(n);
}
} else { // range input
for (long i = n; i < n + numOfNums; i++) {
// printPropertiesInLine(i);
}
}
} while (n != 0);
System.out.println("Goodbye!");
}
private static long[] input() throws IllegalArgumentException {
System.out.println("Enter a request:");
String line = sc.nextLine();
if (isDoubleInput(line)) {
String[] splitted = line.split(" ");
long n = Long.parseLong(splitted[0]);
long numOfNums = Long.parseLong(splitted[1]);
if (numOfNums < 1)
throw new IllegalArgumentException("second parameter should be a natural number");
return new long[]{numOfNums, n};
} else {
long n = Long.parseLong(line);
return new long[]{-1, n};
}
}
private static boolean containsAnyCommand(String line) {
String[] commands = new String[] { "EVEN", "ODD", "BUZZ", "DUCK", "PALINDROMIC", "GAPFUL", "SPY"};
for (int i = 0; i < commands.length; i++) {
if (line.contains(commands[i])) {
return true;
}
}
return false;
}
private static boolean isDoubleInput(String str) {
return str.contains(" ");
}
private static void printProperties(long n) {
System.out.println("Properties of " + n);
System.out.println("even: " + isEven(n));
System.out.println("odd: " + !isEven(n));
System.out.println("buzz: " + isBuzz(n));
System.out.println("duck: " + isDuck(n));
System.out.println("palindromic: " + isPalindromic(n));
System.out.println("gapful: " + isGapful(n));
System.out.println("spy: " + isSpy(n));
System.out.println();
}
private static boolean isSpy(long n) {
String str = "" + n;
long sum = 0;
long product = 1;
for (int i = 0; i < str.length(); i++) {
long value = (long) str.charAt(i) - 48;
sum += value;
product *= value;
}
return sum == product;
}
private static boolean isGapful(long n) {
String str = "" + n;
if (str.length() < 3) {
return false;
} else {
char first = str.charAt(0);
char last = str.charAt(str.length() - 1);
String fl = "" + first + last;
long fll = Long.parseLong(fl);
if (n % fll != 0)
return false;
}
return true;
}
private static boolean isPalindromic(long n) {
StringBuilder sb = new StringBuilder("" + n);
String s1 = sb.toString();
sb.reverse(); // StringBuilder is mutable
String s2 = sb.toString();
return s1.equals(s2);
}
private static boolean isDuck(long n) {
return (""+n).contains("0");
}
private static void explanation(long n) {
System.out.println("Explanation:");
if (n % 7 != 0 && n % 10 != 7) {
System.out.println(n + " is neither divisible by 7 nor does it end with 7.");
} else if (n % 7 == 0 && n % 10 != 7) {
System.out.println(n + " is divisible by 7");
} else if (n % 7 != 0 && n % 10 == 7) {
System.out.println(n + " ends with 7");
} else if (isBuzz(n)) {
System.out.println(n + " is divisible by 7 and ends with 7");
}
}
private static boolean isBuzz(long n) {
if (n % 7 == 0 || n % 10 == 7)
return true;
else return false;
}
private static boolean isNatural(long n) {
return n > 0;
}
private static boolean isEven(long n) {
return n % 2 == 0;
}
}
| [
"pavvel100@gmail.com"
] | pavvel100@gmail.com |
da1438d1622606f1e44fd20736646c6a36411aee | 33d3cbb273ba35effb44e8e11cb0b9b0e6969463 | /src/com/lti/casestudyday1/App.java | f6a24fe3e9390e32be04a7fbe79d54708d4f529a | [] | no_license | Ketki-cmd/LTI | 52f086861ec6c7ea9783fc9aac8e014ab3f2bcdf | 86f547696d6bf45c967df4e72dacd514ed6c1ce9 | refs/heads/master | 2023-02-23T23:49:24.967164 | 2021-01-09T07:05:44 | 2021-01-09T07:05:44 | 328,093,086 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,639 | java | package com.lti.casestudyday1;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class App {
public void Scenario1()
{
Student s1=new Student(1,"Aditi","12-10-2000");
Student s2=new Student(2,"Aryan","01-02-1999");
Student s3=new Student(3,"Snehal","18-11-2001");
Student s4=new Student(4,"Neha","21-05-1998");
new Info().display(s1);
new Info().display(s2);
new Info().display(s3);
new Info().display(s4);
Course c1=new Course(101,"c","60 min",5000);
Course c2=new Course(102,"java","90 min",10000);
new Info().display(c1);
new Info().display(c2);
}
public void Scenario2()
{
Info in=new Info();
List<Student> li=new ArrayList<Student>();
li.add(new Student(1,"Aditi","12-10-2000"));
li.add(new Student(2,"Aryan","01-02-1999"));
li.add(new Student(3,"Snehal","18-11-2001"));
li.add(new Student(4,"Neha","21-05-1998"));
for(int i=0;i<li.size();i++)
{
in.display(li.get(i));
}
}
public void Scenario3()
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter the no. of entries:");
int num=sc.nextInt();
Student[] Student=new Student[num];
for(int i=0;i<num;i++)
{
Student[] Stu=new Student[i];
System.out.println("Enter id:");
int id=sc.nextInt();
Stu[i].setId(id);
System.out.println("Enter name:");
String name=sc.next();
Stu[i].setName(name);
System.out.println("Enter dob:");
String dob=sc.next();
Stu[i].setDateofbirth(dob);
}
}
public static void main(String args[])
{
App a=new App();
// a.Scenario1();
a.Scenario2();
// a.Scenario3();
}
}
| [
"emailaddress"
] | emailaddress |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.