text
stringlengths
2
1.04M
meta
dict
small utility to construct object keys paths. [![Build Status](https://travis-ci.org/lestoni/build-object-paths.svg?branch=1.0.0)](https://travis-ci.org/lestoni/build-object-paths) [![NPM](https://nodei.co/npm/build-object-paths.png?downloads=true&stars=true)](https://nodei.co/npm/build-object-paths/) ## install ``` npm install build-object-paths ``` ## examples ```javascript var objPaths = require('build-object-paths'); var data = { level1: { level2: 2, level3: { level4: 4, level5: [1,2,3] } }, num: 156 }; console.log(objPaths(data)); ``` output ```bash $ node test.js $ [ 'level1', 'level1.level2', 'level1.level3', 'level1.level3.level4', 'level1.level3.level5', 'num' ] ``` ## API ### objPaths({}#Object) = require('build-object-paths') Pass in the Object to build paths from. ## license MIT
{ "content_hash": "14098143920be6834a6f6131b0e8b59a", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 134, "avg_line_length": 18.244897959183675, "alnum_prop": 0.6196868008948546, "repo_name": "lestoni/build-object-paths", "id": "94ad41ebed0bb71a6f8d2e343420518c5ee247ff", "size": "916", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "1176" } ], "symlink_target": "" }
namespace gfx { class Screen; } namespace views { class View; } class BaseTab; class Browser; class DraggedTabView; struct TabRendererData; class TabStrip; class TabStripModel; class TabStripSelectionModel; // TabDragController is responsible for managing the tab dragging session. When // the user presses the mouse on a tab a new TabDragController is created and // Drag() is invoked as the mouse is dragged. If the mouse is dragged far enough // TabDragController starts a drag session. The drag session is completed when // EndDrag() is invoked (or the TabDragController is destroyed). // // While dragging within a tab strip TabDragController sets the bounds of the // tabs (this is referred to as attached). When the user drags far enough such // that the tabs should be moved out of the tab strip two possible things // can happen (this state is referred to as detached): // . If |detach_into_browser_| is true then a new Browser is created and // RunMoveLoop() is invoked on the Widget to drag the browser around. This is // the default on chromeos and can be enabled on windows with a flag. // . If |detach_into_browser_| is false a small representation of the active tab // is created and that is dragged around. This mode does not run a nested // message loop. class TabDragController : public content::WebContentsDelegate, public content::NotificationObserver, public MessageLoopForUI::Observer, public views::WidgetObserver, public TabStripModelObserver { public: enum DetachBehavior { DETACHABLE, NOT_DETACHABLE }; // What should happen as the mouse is dragged within the tabstrip. enum MoveBehavior { // Only the set of visible tabs should change. This is only applicable when // using touch layout. MOVE_VISIBILE_TABS, // Typical behavior where tabs are dragged around. REORDER }; // Amount above or below the tabstrip the user has to drag before detaching. static const int kTouchVerticalDetachMagnetism; static const int kVerticalDetachMagnetism; TabDragController(); virtual ~TabDragController(); // Initializes TabDragController to drag the tabs in |tabs| originating // from |source_tabstrip|. |source_tab| is the tab that initiated the drag and // is contained in |tabs|. |mouse_offset| is the distance of the mouse // pointer from the origin of the first tab in |tabs| and |source_tab_offset| // the offset from |source_tab|. |source_tab_offset| is the horizontal distant // for a horizontal tab strip, and the vertical distance for a vertical tab // strip. |initial_selection_model| is the selection model before the drag // started and is only non-empty if |source_tab| was not initially selected. void Init(TabStrip* source_tabstrip, BaseTab* source_tab, const std::vector<BaseTab*>& tabs, const gfx::Point& mouse_offset, int source_tab_offset, const TabStripSelectionModel& initial_selection_model, DetachBehavior detach_behavior, MoveBehavior move_behavior); // Returns true if there is a drag underway and the drag is attached to // |tab_strip|. // NOTE: this returns false if the TabDragController is in the process of // finishing the drag. static bool IsAttachedTo(TabStrip* tab_strip); // Returns true if there is a drag underway. static bool IsActive(); // Sets the move behavior. Has no effect if started_drag() is true. void SetMoveBehavior(MoveBehavior behavior); MoveBehavior move_behavior() const { return move_behavior_; } // See description above fields for details on these. bool active() const { return active_; } const TabStrip* attached_tabstrip() const { return attached_tabstrip_; } // Returns true if a drag started. bool started_drag() const { return started_drag_; } // Returns true if mutating the TabStripModel. bool is_mutating() const { return is_mutating_; } // Returns true if we've detached from a tabstrip and are running a nested // move message loop. bool is_dragging_window() const { return is_dragging_window_; } // Invoked to drag to the new location, in screen coordinates. void Drag(const gfx::Point& point_in_screen); // Complete the current drag session. void EndDrag(EndDragReason reason); private: class DockDisplayer; friend class DockDisplayer; typedef std::set<gfx::NativeView> DockWindows; // Used to indicate the direction the mouse has moved when attached. static const int kMovedMouseLeft = 1 << 0; static const int kMovedMouseRight = 1 << 1; // Enumeration of the ways a drag session can end. enum EndDragType { // Drag session exited normally: the user released the mouse. NORMAL, // The drag session was canceled (alt-tab during drag, escape ...) CANCELED, // The tab (NavigationController) was destroyed during the drag. TAB_DESTROYED }; // Whether Detach() should release capture or not. enum ReleaseCapture { RELEASE_CAPTURE, DONT_RELEASE_CAPTURE, }; // Specifies what should happen when RunMoveLoop completes. enum EndRunLoopBehavior { // Indicates the drag should end. END_RUN_LOOP_STOP_DRAGGING, // Indicates the drag should continue. END_RUN_LOOP_CONTINUE_DRAGGING }; // Enumeration of the possible positions the detached tab may detach from. enum DetachPosition { DETACH_BEFORE, DETACH_AFTER, DETACH_ABOVE_OR_BELOW }; // Indicates what should happen after invoking DragBrowserToNewTabStrip(). enum DragBrowserResultType { // The caller should return immediately. This return value is used if a // nested message loop was created or we're in a nested message loop and // need to exit it. DRAG_BROWSER_RESULT_STOP, // The caller should continue. DRAG_BROWSER_RESULT_CONTINUE, }; // Stores the date associated with a single tab that is being dragged. struct TabDragData { TabDragData(); ~TabDragData(); // The TabContents being dragged. TabContents* contents; // The original content::WebContentsDelegate of |contents|, before it was // detached from the browser window. We store this so that we can forward // certain delegate notifications back to it if we can't handle them // locally. content::WebContentsDelegate* original_delegate; // This is the index of the tab in |source_tabstrip_| when the drag // began. This is used to restore the previous state if the drag is aborted. int source_model_index; // If attached this is the tab in |attached_tabstrip_|. BaseTab* attached_tab; // Is the tab pinned? bool pinned; }; typedef std::vector<TabDragData> DragData; // Sets |drag_data| from |tab|. This also registers for necessary // notifications and resets the delegate of the TabContents. void InitTabDragData(BaseTab* tab, TabDragData* drag_data); // Overridden from content::WebContentsDelegate: virtual content::WebContents* OpenURLFromTab( content::WebContents* source, const content::OpenURLParams& params) OVERRIDE; virtual void NavigationStateChanged(const content::WebContents* source, unsigned changed_flags) OVERRIDE; virtual void AddNewContents(content::WebContents* source, content::WebContents* new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, bool user_gesture, bool* was_blocked) OVERRIDE; virtual void LoadingStateChanged(content::WebContents* source) OVERRIDE; virtual bool ShouldSuppressDialogs() OVERRIDE; virtual content::JavaScriptDialogCreator* GetJavaScriptDialogCreator() OVERRIDE; // Overridden from content::NotificationObserver: virtual void Observe(int type, const content::NotificationSource& source, const content::NotificationDetails& details) OVERRIDE; // Overridden from MessageLoop::Observer: virtual base::EventStatus WillProcessEvent( const base::NativeEvent& event) OVERRIDE; virtual void DidProcessEvent(const base::NativeEvent& event) OVERRIDE; // Overriden from views::WidgetObserver: virtual void OnWidgetMoved(views::Widget* widget) OVERRIDE; // Overriden from TabStripModelObserver: virtual void TabStripEmpty() OVERRIDE; // Initialize the offset used to calculate the position to create windows // in |GetWindowCreatePoint|. This should only be invoked from |Init|. void InitWindowCreatePoint(); // Returns the point where a detached window should be created given the // current mouse position |origin|. gfx::Point GetWindowCreatePoint(const gfx::Point& origin) const; void UpdateDockInfo(const gfx::Point& point_in_screen); // Saves focus in the window that the drag initiated from. Focus will be // restored appropriately if the drag ends within this same window. void SaveFocus(); // Restore focus to the View that had focus before the drag was started, if // the drag ends within the same Window as it began. void RestoreFocus(); // Tests whether |point_in_screen| is past a minimum elasticity threshold // required to start a drag. bool CanStartDrag(const gfx::Point& point_in_screen) const; // Move the DraggedTabView according to the current mouse screen position, // potentially updating the source and other TabStrips. void ContinueDragging(const gfx::Point& point_in_screen); // Transitions dragging from |attached_tabstrip_| to |target_tabstrip|. // |target_tabstrip| is NULL if the mouse is not over a valid tab strip. See // DragBrowserResultType for details of the return type. DragBrowserResultType DragBrowserToNewTabStrip( TabStrip* target_tabstrip, const gfx::Point& point_in_screen); // Handles dragging for a touch tabstrip when the tabs are stacked. Doesn't // actually reorder the tabs in anyway, just changes what's visible. void DragActiveTabStacked(const gfx::Point& point_in_screen); // Moves the active tab to the next/previous tab. Used when the next/previous // tab is stacked. void MoveAttachedToNextStackedIndex(const gfx::Point& point_in_screen); void MoveAttachedToPreviousStackedIndex(const gfx::Point& point_in_screen); // Handles dragging tabs while the tabs are attached. void MoveAttached(const gfx::Point& point_in_screen); // Handles dragging while the tabs are detached. void MoveDetached(const gfx::Point& point_in_screen); // If necessary starts the |move_stacked_timer_|. The timer is started if // close enough to an edge with stacked tabs. void StartMoveStackedTimerIfNecessary( const gfx::Point& point_in_screen, int delay_ms); // Returns the TabStrip for the specified window, or NULL if one doesn't exist // or isn't compatible. TabStrip* GetTabStripForWindow(gfx::NativeWindow window); // Returns the compatible TabStrip to drag to at the specified point (screen // coordinates), or NULL if there is none. TabStrip* GetTargetTabStripForPoint(const gfx::Point& point_in_screen); // Returns true if |tabstrip| contains the specified point in screen // coordinates. bool DoesTabStripContain(TabStrip* tabstrip, const gfx::Point& point_in_screen) const; // Returns the DetachPosition given the specified location in screen // coordinates. DetachPosition GetDetachPosition(const gfx::Point& point_in_screen); DockInfo GetDockInfoAtPoint(const gfx::Point& point_in_screen); // Attach the dragged Tab to the specified TabStrip. void Attach(TabStrip* attached_tabstrip, const gfx::Point& point_in_screen); // Detach the dragged Tab from the current TabStrip. void Detach(ReleaseCapture release_capture); // Detaches the tabs being dragged, creates a new Browser to contain them and // runs a nested move loop. void DetachIntoNewBrowserAndRunMoveLoop(const gfx::Point& point_in_screen); // Runs a nested message loop that handles moving the current // Browser. |drag_offset| is the offset from the window origin and is used in // calculating the location of the window offset from the cursor while // dragging. void RunMoveLoop(const gfx::Point& drag_offset); // Determines the index to insert tabs at. |dragged_bounds| is the bounds of // the tabs being dragged, |start| the index of the tab to start looking from // and |delta| the amount to increment (1 or -1). int GetInsertionIndexFrom(const gfx::Rect& dragged_bounds, int start, int delta) const; // Returns the index where the dragged WebContents should be inserted into // |attached_tabstrip_| given the DraggedTabView's bounds |dragged_bounds| in // coordinates relative to |attached_tabstrip_| and has had the mirroring // transformation applied. // NOTE: this is invoked from |Attach| before the tabs have been inserted. int GetInsertionIndexForDraggedBounds(const gfx::Rect& dragged_bounds) const; // Returns true if |dragged_bounds| is close enough to the next stacked tab // so that the active tab should be dragged there. bool ShouldDragToNextStackedTab(const gfx::Rect& dragged_bounds, int index) const; // Returns true if |dragged_bounds| is close enough to the previous stacked // tab so that the active tab should be dragged there. bool ShouldDragToPreviousStackedTab(const gfx::Rect& dragged_bounds, int index) const; // Used by GetInsertionIndexForDraggedBounds() when the tabstrip is stacked. int GetInsertionIndexForDraggedBoundsStacked( const gfx::Rect& dragged_bounds) const; // Retrieve the bounds of the DraggedTabView relative to the attached // TabStrip. |tab_strip_point| is in the attached TabStrip's coordinate // system. gfx::Rect GetDraggedViewTabStripBounds(const gfx::Point& tab_strip_point); // Get the position of the dragged tab view relative to the attached tab // strip with the mirroring transform applied. gfx::Point GetAttachedDragPoint(const gfx::Point& point_in_screen); // Finds the Tabs within the specified TabStrip that corresponds to the // WebContents of the dragged tabs. Returns an empty vector if not attached. std::vector<BaseTab*> GetTabsMatchingDraggedContents(TabStrip* tabstrip); // Returns the bounds for the tabs based on the attached tab strip. The // x-coordinate of each tab is offset by |x_offset|. std::vector<gfx::Rect> CalculateBoundsForDraggedTabs(int x_offset); // Does the work for EndDrag. If we actually started a drag and |how_end| is // not TAB_DESTROYED then one of EndDrag or RevertDrag is invoked. void EndDragImpl(EndDragType how_end); // Reverts a cancelled drag operation. void RevertDrag(); // Reverts the tab at |drag_index| in |drag_data_|. void RevertDragAt(size_t drag_index); // Selects the dragged tabs in |model|. Does nothing if there are no longer // any dragged contents (as happens when a WebContents is deleted out from // under us). void ResetSelection(TabStripModel* model); // Finishes a succesful drag operation. void CompleteDrag(); // Resets the delegates of the WebContents. void ResetDelegates(); // Create the DraggedTabView. void CreateDraggedView(const std::vector<TabRendererData>& data, const std::vector<gfx::Rect>& renderer_bounds); // Returns the bounds (in screen coordinates) of the specified View. gfx::Rect GetViewScreenBounds(views::View* tabstrip) const; // Hides the frame for the window that contains the TabStrip the current // drag session was initiated from. void HideFrame(); // Closes a hidden frame at the end of a drag session. void CleanUpHiddenFrame(); void DockDisplayerDestroyed(DockDisplayer* controller); void BringWindowUnderPointToFront(const gfx::Point& point_in_screen); // Convenience for getting the TabDragData corresponding to the tab the user // started dragging. TabDragData* source_tab_drag_data() { return &(drag_data_[source_tab_index_]); } // Convenience for |source_tab_drag_data()->contents|. TabContents* source_dragged_contents() { return source_tab_drag_data()->contents; } // Returns the Widget of the currently attached TabStrip's BrowserView. views::Widget* GetAttachedBrowserWidget(); // Returns true if the tabs were originality one after the other in // |source_tabstrip_|. bool AreTabsConsecutive(); // Creates and returns a new Browser to handle the drag. Browser* CreateBrowserForDrag(TabStrip* source, const gfx::Point& point_in_screen, gfx::Point* drag_offset, std::vector<gfx::Rect>* drag_bounds); // Returns the TabStripModel for the specified tabstrip. TabStripModel* GetModel(TabStrip* tabstrip) const; // Returns the location of the cursor. This is either the location of the // mouse or the location of the current touch point. gfx::Point GetCursorScreenPoint(); // Returns the offset from the top left corner of the window to // |point_in_screen|. gfx::Point GetWindowOffset(const gfx::Point& point_in_screen); // Returns true if moving the mouse only changes the visible tabs. bool move_only() const { return (move_behavior_ == MOVE_VISIBILE_TABS) != 0; } // If true Detaching creates a new browser and enters a nested message loop. const bool detach_into_browser_; // Handles registering for notifications. content::NotificationRegistrar registrar_; // The TabStrip the drag originated from. TabStrip* source_tabstrip_; // The TabStrip the dragged Tab is currently attached to, or NULL if the // dragged Tab is detached. TabStrip* attached_tabstrip_; // The screen that this drag is associated with. Cached, because other UI // elements are NULLd at various points during the lifetime of this object. gfx::Screen* screen_; // The visual representation of the dragged Tab. scoped_ptr<DraggedTabView> view_; // The position of the mouse (in screen coordinates) at the start of the drag // operation. This is used to calculate minimum elasticity before a // DraggedTabView is constructed. gfx::Point start_point_in_screen_; // This is the offset of the mouse from the top left of the Tab where // dragging begun. This is used to ensure that the dragged view is always // positioned at the correct location during the drag, and to ensure that the // detached window is created at the right location. gfx::Point mouse_offset_; // Offset of the mouse relative to the source tab. int source_tab_offset_; // Ratio of the x-coordinate of the |source_tab_offset_| to the width of the // tab. Not used for vertical tabs. float offset_to_width_ratio_; // A hint to use when positioning new windows created by detaching Tabs. This // is the distance of the mouse from the top left of the dragged tab as if it // were the distance of the mouse from the top left of the first tab in the // attached TabStrip from the top left of the window. gfx::Point window_create_point_; // Location of the first tab in the source tabstrip in screen coordinates. // This is used to calculate window_create_point_. gfx::Point first_source_tab_point_; // The bounds of the browser window before the last Tab was detached. When // the last Tab is detached, rather than destroying the frame (which would // abort the drag session), the frame is moved off-screen. If the drag is // aborted (e.g. by the user pressing Esc, or capture being lost), the Tab is // attached to the hidden frame and the frame moved back to these bounds. gfx::Rect restore_bounds_; // The last view that had focus in the window containing |source_tab_|. This // is saved so that focus can be restored properly when a drag begins and // ends within this same window. views::View* old_focused_view_; // The position along the major axis of the mouse cursor in screen coordinates // at the time of the last re-order event. int last_move_screen_loc_; DockInfo dock_info_; DockWindows dock_windows_; std::vector<DockDisplayer*> dock_controllers_; // Timer used to bring the window under the cursor to front. If the user // stops moving the mouse for a brief time over a browser window, it is // brought to front. base::OneShotTimer<TabDragController> bring_to_front_timer_; // Timer used to move the stacked tabs. See comment aboue // StartMoveStackedTimerIfNecessary(). base::OneShotTimer<TabDragController> move_stacked_timer_; // Did the mouse move enough that we started a drag? bool started_drag_; // Is the drag active? bool active_; DragData drag_data_; // Index of the source tab in drag_data_. size_t source_tab_index_; // True until |MoveAttached| is invoked once. bool initial_move_; // The selection model before the drag started. See comment above Init() for // details. TabStripSelectionModel initial_selection_model_; // The selection model of |attached_tabstrip_| before the tabs were attached. TabStripSelectionModel selection_model_before_attach_; // Initial x-coordinates of the tabs when the drag started. Only used for // touch mode. std::vector<int> initial_tab_positions_; DetachBehavior detach_behavior_; MoveBehavior move_behavior_; // Updated as the mouse is moved when attached. Indicates whether the mouse // has ever moved to the left or right. If the tabs are ever detached this // is set to kMovedMouseRight | kMovedMouseLeft. int mouse_move_direction_; // Last location used in screen coordinates. gfx::Point last_point_in_screen_; // The following are needed when detaching into a browser // (|detach_into_browser_| is true). // See description above getter. bool is_dragging_window_; EndRunLoopBehavior end_run_loop_behavior_; // If true, we're waiting for a move loop to complete. bool waiting_for_run_loop_to_exit_; // The TabStrip to attach to after the move loop completes. TabStrip* tab_strip_to_attach_to_after_exit_; // Non-null for the duration of RunMoveLoop. views::Widget* move_loop_widget_; // If non-null set to true from destructor. bool* destroyed_; // See description above getter. bool is_mutating_; DISALLOW_COPY_AND_ASSIGN(TabDragController); }; #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_DRAG_CONTROLLER_H_
{ "content_hash": "d7c95b6f1b861b68320ab531c1c8e62d", "timestamp": "", "source": "github", "line_count": 582, "max_line_length": 80, "avg_line_length": 38.95704467353952, "alnum_prop": 0.7160499272262162, "repo_name": "junmin-zhu/chromium-rivertrail", "id": "d645b61d309a7acd9ca7e2494f9738c60a05bc98", "size": "23604", "binary": false, "copies": "1", "ref": "refs/heads/v8-binding", "path": "chrome/browser/ui/views/tabs/tab_drag_controller.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ASP", "bytes": "853" }, { "name": "AppleScript", "bytes": "6973" }, { "name": "Arduino", "bytes": "464" }, { "name": "Assembly", "bytes": "1172794" }, { "name": "Awk", "bytes": "9519" }, { "name": "C", "bytes": "75806807" }, { "name": "C#", "bytes": "1132" }, { "name": "C++", "bytes": "145161929" }, { "name": "DOT", "bytes": "1559" }, { "name": "F#", "bytes": "381" }, { "name": "Java", "bytes": "1546515" }, { "name": "JavaScript", "bytes": "18675242" }, { "name": "Logos", "bytes": "4517" }, { "name": "Matlab", "bytes": "5234" }, { "name": "Objective-C", "bytes": "6981387" }, { "name": "PHP", "bytes": "97817" }, { "name": "Perl", "bytes": "926245" }, { "name": "Python", "bytes": "8088373" }, { "name": "R", "bytes": "262" }, { "name": "Ragel in Ruby Host", "bytes": "3239" }, { "name": "Shell", "bytes": "1513486" }, { "name": "Tcl", "bytes": "277077" }, { "name": "XML", "bytes": "13493" } ], "symlink_target": "" }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "4303603463f28821cf9beda5f4278f59", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "5d49f7def0d1d21aaddbc42892a6fc2812476a25", "size": "190", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Piperales/Piperaceae/Piper/Piper amalago/Piper amalago medium/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
package com.opensymphony.xwork2.util; import java.util.Set; import java.util.regex.Pattern; /** * ValueStacks implementing this interface provide a way to remove block or allow access * to properties using regular expressions */ public interface MemberAccessValueStack { void setExcludeProperties(Set<Pattern> excludeProperties); void setAcceptProperties(Set<Pattern> acceptedProperties); }
{ "content_hash": "9933154b4e25e1156773d2502508c7ba", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 88, "avg_line_length": 29.928571428571427, "alnum_prop": 0.7684964200477327, "repo_name": "xiaguangme/struts2-src-study", "id": "da42f3f4b5a4bc9418f9765893277e35a1600819", "size": "419", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/com/opensymphony/xwork2/util/MemberAccessValueStack.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "18012" }, { "name": "Java", "bytes": "3297928" } ], "symlink_target": "" }
bash 'Install hipchat' do user 'root' group 'root' code <<-EOH echo "deb http://downloads.hipchat.com/linux/apt stable main" > /etc/apt/sources.list.d/atlassian-hipchat.list wget -O - https://www.hipchat.com/keys/hipchat-linux.key | apt-key add - apt-get -y update apt-get -y install hipchat EOH not_if { ::File.exists?('/etc/apt/sources.list.d/atlassian-hipchat.list') } end
{ "content_hash": "531efcecee95b0a9724baf91fbc5a548", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 112, "avg_line_length": 33, "alnum_prop": 0.6919191919191919, "repo_name": "mike-tr-adamson/chef-cookbooks", "id": "38d003ca7920114429070a2bd2d2aa83f955bfad", "size": "529", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "cookbooks/hipchat/recipes/default.rb", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Ruby", "bytes": "67552" }, { "name": "Shell", "bytes": "1321" } ], "symlink_target": "" }
+++ title = "Directory structure" weight = 30 +++ After running `zola init`, you should see the following structure in your directory: ```bash . ├── config.toml ├── content ├── sass ├── static ├── templates └── themes 5 directories, 1 file ``` Here's a high-level overview of each of these directories and `config.toml`. ## `config.toml` A mandatory Zola configuration file in TOML format. This file is explained in detail in the [configuration documentation](@/documentation/getting-started/configuration.md). ## `content` Contains all your markup content (mostly `.md` files). Each child directory of the `content` directory represents a [section](@/documentation/content/section.md) that contains [pages](@/documentation/content/page.md) (your `.md` files). To learn more, read the [content overview page](@/documentation/content/overview.md). ## `sass` Contains the [Sass](https://sass-lang.com) files to be compiled. Non-Sass files will be ignored. The directory structure of the `sass` folder will be preserved when copying over the compiled files; for example, a file at `sass/something/site.scss` will be compiled to `public/something/site.css`. ## `static` Contains any kind of file. All the files/directories in the `static` directory will be copied as-is to the output directory. If your static files are large, you can configure Zola to [hard link](https://en.wikipedia.org/wiki/Hard_link) them instead of copying them by setting `hard_link_static = true` in the config file. ## `templates` Contains all the [Tera](https://tera.netlify.com) templates that will be used to render your site. Have a look at the [templates documentation](@/documentation/templates/_index.md) to learn more about default templates and available variables. ## `themes` Contains themes that can be used for your site. If you are not planning to use themes, leave this directory empty. If you want to learn about themes, see the [themes documentation](@/documentation/themes/_index.md).
{ "content_hash": "b056b7f0834bd377c3b1626c23063141", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 124, "avg_line_length": 38.96078431372549, "alnum_prop": 0.7544036235530951, "repo_name": "Keats/gutenberg", "id": "c48d20a1be6062bb055570bad90953f08af3b662", "size": "2023", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/content/documentation/getting-started/directory-structure.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "180" }, { "name": "HTML", "bytes": "7764" }, { "name": "JavaScript", "bytes": "1" }, { "name": "PowerShell", "bytes": "6538" }, { "name": "Python", "bytes": "5015" }, { "name": "Rust", "bytes": "319763" }, { "name": "Shell", "bytes": "9705" } ], "symlink_target": "" }
namespace flutter { AndroidSurfaceVulkan::AndroidSurfaceVulkan() : proc_table_(fml::MakeRefCounted<vulkan::VulkanProcTable>()) {} AndroidSurfaceVulkan::~AndroidSurfaceVulkan() = default; bool AndroidSurfaceVulkan::IsValid() const { return proc_table_->HasAcquiredMandatoryProcAddresses(); } void AndroidSurfaceVulkan::TeardownOnScreenContext() { // Nothing to do. } std::unique_ptr<Surface> AndroidSurfaceVulkan::CreateGPUSurface() { if (!IsValid()) { return nullptr; } if (!native_window_ || !native_window_->IsValid()) { return nullptr; } auto vulkan_surface_android = std::make_unique<vulkan::VulkanNativeSurfaceAndroid>( native_window_->handle()); if (!vulkan_surface_android->IsValid()) { return nullptr; } auto gpu_surface = std::make_unique<GPUSurfaceVulkan>( this, std::move(vulkan_surface_android), true); if (!gpu_surface->IsValid()) { return nullptr; } return gpu_surface; } bool AndroidSurfaceVulkan::OnScreenSurfaceResize(const SkISize& size) const { return true; } bool AndroidSurfaceVulkan::ResourceContextMakeCurrent() { FML_DLOG(ERROR) << "The vulkan backend does not support resource contexts."; return false; } bool AndroidSurfaceVulkan::ResourceContextClearCurrent() { FML_DLOG(ERROR) << "The vulkan backend does not support resource contexts."; return false; } bool AndroidSurfaceVulkan::SetNativeWindow( fml::RefPtr<AndroidNativeWindow> window) { native_window_ = std::move(window); return native_window_ && native_window_->IsValid(); } ExternalViewEmbedder* AndroidSurfaceVulkan::GetExternalViewEmbedder() { return nullptr; } fml::RefPtr<vulkan::VulkanProcTable> AndroidSurfaceVulkan::vk() { return proc_table_; } } // namespace flutter
{ "content_hash": "2951d9cbee4cd6e128dc078d86f79b7e", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 78, "avg_line_length": 24.91549295774648, "alnum_prop": 0.723007348784624, "repo_name": "cdotstout/sky_engine", "id": "ffcf52ac3a31816b45b7aeb654c6d764fc354c40", "size": "2164", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "shell/platform/android/android_surface_vulkan.cc", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Assembly", "bytes": "2706" }, { "name": "C", "bytes": "304169" }, { "name": "C++", "bytes": "22877586" }, { "name": "Dart", "bytes": "1109808" }, { "name": "Groff", "bytes": "29030" }, { "name": "Java", "bytes": "769335" }, { "name": "JavaScript", "bytes": "27365" }, { "name": "Makefile", "bytes": "402" }, { "name": "Objective-C", "bytes": "136889" }, { "name": "Objective-C++", "bytes": "431930" }, { "name": "Python", "bytes": "2888339" }, { "name": "Shell", "bytes": "173354" }, { "name": "Yacc", "bytes": "31141" }, { "name": "nesC", "bytes": "18347" } ], "symlink_target": "" }
package org.bbop.apollo.web.track; import java.util.Comparator; import org.bbop.apollo.web.config.ServerConfiguration; public interface TrackNameComparator extends Comparator<ServerConfiguration.TrackConfiguration> { }
{ "content_hash": "1394142945c1f187fc8054bac4c40c2e", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 97, "avg_line_length": 24.666666666666668, "alnum_prop": 0.8423423423423423, "repo_name": "jwlin/web-apollo-dbdump", "id": "60e6a7099645cb86e4c318c198c622b10945cbb6", "size": "222", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/org/bbop/apollo/web/track/TrackNameComparator.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "584749" }, { "name": "Shell", "bytes": "586" } ], "symlink_target": "" }
Copyright (C) 2017 Jakeoid 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.*
{ "content_hash": "faffd560c99d25f0b5951c309f8fc6dd", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 78, "avg_line_length": 55.421052631578945, "alnum_prop": 0.8043684710351378, "repo_name": "jkke/random-birb", "id": "42fe11c2d4ee2b38c775618d65c1e1d88fd3e02c", "size": "1070", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "LICENSE.md", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "18252" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <title>DimensionAxis Class Reference</title> <link rel="stylesheet" type="text/css" href="../../css/jazzy.css" /> <link rel="stylesheet" type="text/css" href="../../css/highlight.css" /> <meta charset='utf-8'> <script src="../../js/jquery.min.js" defer></script> <script src="../../js/jazzy.js" defer></script> </head> <body> <a name="//apple_ref/swift/Class/DimensionAxis" class="dashAnchor"></a> <a title="DimensionAxis Class Reference"></a> <header> <div class="content-wrapper"> <p><a href="../../index.html">Xcore 1.0.0 Docs</a> (34% documented)</p> <p class="header-right"><a href="https://github.com/zmian/xcore.swift"><img src="../../img/gh.png"/>View on GitHub</a></p> <p class="header-right"><a href="dash-feed://https%3A%2F%2Fgithub%2Ecom%2Fzmian%2Fdocsets%2FXcore%2Exml"><img src="../../img/dash.png"/>Install in Dash</a></p> </div> </header> <div class="content-wrapper"> <p id="breadcrumbs"> <a href="../../index.html">Xcore Reference</a> <img id="carat" src="../../img/carat.png" /> DimensionAxis Class Reference </p> </div> <div class="content-wrapper"> <nav class="sidebar"> <ul class="nav-groups"> <li class="nav-group-name"> <a href="../../Classes.html">Classes</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a href="../../Classes/Analytics.html">Analytics</a> </li> <li class="nav-group-task"> <a href="../../Classes/AnalyticsSessionTracker.html">AnalyticsSessionTracker</a> </li> <li class="nav-group-task"> <a href="../../Classes/Anchor.html">Anchor</a> </li> <li class="nav-group-task"> <a href="../../Classes/Anchor/Axis.html">– Axis</a> </li> <li class="nav-group-task"> <a href="../../Classes/Anchor/XAxis.html">– XAxis</a> </li> <li class="nav-group-task"> <a href="../../Classes/Anchor/YAxis.html">– YAxis</a> </li> <li class="nav-group-task"> <a href="../../Classes/Anchor/DimensionAxis.html">– DimensionAxis</a> </li> <li class="nav-group-task"> <a href="../../Classes/Anchor.html#/s:5Xcore6AnchorC8SizeAxisC">– SizeAxis</a> </li> <li class="nav-group-task"> <a href="../../Classes/Anchor/EdgesAxis.html">– EdgesAxis</a> </li> <li class="nav-group-task"> <a href="../../Classes/Anchor.html#/s:5Xcore6AnchorC10CenterAxisC">– CenterAxis</a> </li> <li class="nav-group-task"> <a href="../../Classes/Anchor.html#/s:5Xcore6AnchorC9XAxisTypeO">– XAxisType</a> </li> <li class="nav-group-task"> <a href="../../Classes/Anchor.html#/s:5Xcore6AnchorC9YAxisTypeO">– YAxisType</a> </li> <li class="nav-group-task"> <a href="../../Classes/Anchor.html#/s:5Xcore6AnchorC17DimensionAxisTypeO">– DimensionAxisType</a> </li> <li class="nav-group-task"> <a href="../../Classes/Anchor.html#/s:5Xcore6AnchorC13EdgesAxisTypeO">– EdgesAxisType</a> </li> <li class="nav-group-task"> <a href="../../Classes/Anchor.html#/s:5Xcore6AnchorC14CenterAxisTypeO">– CenterAxisType</a> </li> <li class="nav-group-task"> <a href="../../Classes/AnimationRunLoop.html">AnimationRunLoop</a> </li> <li class="nav-group-task"> <a href="../../Classes/BlurView.html">BlurView</a> </li> <li class="nav-group-task"> <a href="../../Classes/CarouselView.html">CarouselView</a> </li> <li class="nav-group-task"> <a href="../../Classes/CarouselViewModel.html">CarouselViewModel</a> </li> <li class="nav-group-task"> <a href="../../Classes/Chrome.html">Chrome</a> </li> <li class="nav-group-task"> <a href="../../Classes/Chrome/Element.html">– Element</a> </li> <li class="nav-group-task"> <a href="../../Classes/Chrome/BackgroundStyle.html">– BackgroundStyle</a> </li> <li class="nav-group-task"> <a href="../../Classes/Chrome/Style.html">– Style</a> </li> <li class="nav-group-task"> <a href="../../Classes/CollectionViewCarouselLayout.html">CollectionViewCarouselLayout</a> </li> <li class="nav-group-task"> <a href="../../Classes/CollectionViewDequeueCache.html">CollectionViewDequeueCache</a> </li> <li class="nav-group-task"> <a href="../../Classes/Console.html">Console</a> </li> <li class="nav-group-task"> <a href="../../Classes/Console/LevelOptions.html">– LevelOptions</a> </li> <li class="nav-group-task"> <a href="../../Classes/Console/PrefixOptions.html">– PrefixOptions</a> </li> <li class="nav-group-task"> <a href="../../Classes/ContainerViewController.html">ContainerViewController</a> </li> <li class="nav-group-task"> <a href="../../Classes/CurrencyFormatter.html">CurrencyFormatter</a> </li> <li class="nav-group-task"> <a href="../../Classes/CustomCarouselView.html">CustomCarouselView</a> </li> <li class="nav-group-task"> <a href="../../Classes/CustomCarouselView/Style.html">– Style</a> </li> <li class="nav-group-task"> <a href="../../Classes/DatePicker.html">DatePicker</a> </li> <li class="nav-group-task"> <a href="../../Classes/DrawerScreen.html">DrawerScreen</a> </li> <li class="nav-group-task"> <a href="../../Classes/DrawerScreen/Appearance.html">– Appearance</a> </li> <li class="nav-group-task"> <a href="../../Classes/DynamicTableView.html">DynamicTableView</a> </li> <li class="nav-group-task"> <a href="../../Classes/DynamicTableViewCell.html">DynamicTableViewCell</a> </li> <li class="nav-group-task"> <a href="../../Classes/DynamicTableViewController.html">DynamicTableViewController</a> </li> <li class="nav-group-task"> <a href="../../Classes/Environment.html">Environment</a> </li> <li class="nav-group-task"> <a href="../../Classes/Environment/Kind.html">– Kind</a> </li> <li class="nav-group-task"> <a href="../../Classes/FadeAnimator.html">FadeAnimator</a> </li> <li class="nav-group-task"> <a href="../../Classes/GradientLayer.html">GradientLayer</a> </li> <li class="nav-group-task"> <a href="../../Classes/GradientView.html">GradientView</a> </li> <li class="nav-group-task"> <a href="../../Classes/HUD.html">HUD</a> </li> <li class="nav-group-task"> <a href="../../Classes/HUD/StatusBarAppearance.html">– StatusBarAppearance</a> </li> <li class="nav-group-task"> <a href="../../Classes/HUD/Duration.html">– Duration</a> </li> <li class="nav-group-task"> <a href="../../Classes/HUD/Appearance.html">– Appearance</a> </li> <li class="nav-group-task"> <a href="../../Classes/HapticFeedback.html">HapticFeedback</a> </li> <li class="nav-group-task"> <a href="../../Classes/IconLabelCollectionView.html">IconLabelCollectionView</a> </li> <li class="nav-group-task"> <a href="../../Classes/IconLabelCollectionView/Cell.html">– Cell</a> </li> <li class="nav-group-task"> <a href="../../Classes/IconLabelCollectionViewController.html">IconLabelCollectionViewController</a> </li> <li class="nav-group-task"> <a href="../../Classes/IconLabelView.html">IconLabelView</a> </li> <li class="nav-group-task"> <a href="../../Classes/InputToolbar.html">InputToolbar</a> </li> <li class="nav-group-task"> <a href="../../Classes/IntrinsicContentSizeImageView.html">IntrinsicContentSizeImageView</a> </li> <li class="nav-group-task"> <a href="../../Classes/IntrinsicContentSizeView.html">IntrinsicContentSizeView</a> </li> <li class="nav-group-task"> <a href="../../Classes/KeychainHelpers.html">KeychainHelpers</a> </li> <li class="nav-group-task"> <a href="../../Classes/LabelTextView.html">LabelTextView</a> </li> <li class="nav-group-task"> <a href="../../Classes/LinePageControl.html">LinePageControl</a> </li> <li class="nav-group-task"> <a href="../../Classes/LoadingView.html">LoadingView</a> </li> <li class="nav-group-task"> <a href="../../Classes/MarkupText.html">MarkupText</a> </li> <li class="nav-group-task"> <a href="../../Classes/MarkupText/Appearance.html">– Appearance</a> </li> <li class="nav-group-task"> <a href="../../Classes/MulticastDelegate.html">MulticastDelegate</a> </li> <li class="nav-group-task"> <a href="../../Classes/NavigationController.html">NavigationController</a> </li> <li class="nav-group-task"> <a href="../../Classes/Observers.html">Observers</a> </li> <li class="nav-group-task"> <a href="../../Classes/PageControl.html">PageControl</a> </li> <li class="nav-group-task"> <a href="../../Classes/PageNavigationController.html">PageNavigationController</a> </li> <li class="nav-group-task"> <a href="../../Classes/PassthroughStackView.html">PassthroughStackView</a> </li> <li class="nav-group-task"> <a href="../../Classes/PassthroughView.html">PassthroughView</a> </li> <li class="nav-group-task"> <a href="../../Classes/Picker.html">Picker</a> </li> <li class="nav-group-task"> <a href="../../Classes/Picker/RowModel.html">– RowModel</a> </li> <li class="nav-group-task"> <a href="../../Classes/Picker/RowView.html">– RowView</a> </li> <li class="nav-group-task"> <a href="../../Classes/PickerList.html">PickerList</a> </li> <li class="nav-group-task"> <a href="../../Classes/ProgressView.html">ProgressView</a> </li> <li class="nav-group-task"> <a href="../../Classes/ReorderTableView.html">ReorderTableView</a> </li> <li class="nav-group-task"> <a href="../../Classes/Request.html">Request</a> </li> <li class="nav-group-task"> <a href="../../Classes/Request/Method.html">– Method</a> </li> <li class="nav-group-task"> <a href="../../Classes/Request/Body.html">– Body</a> </li> <li class="nav-group-task"> <a href="../../Classes/Router.html">Router</a> </li> <li class="nav-group-task"> <a href="../../Classes/Router/Route.html">– Route</a> </li> <li class="nav-group-task"> <a href="../../Classes/Router/RouteKind.html">– RouteKind</a> </li> <li class="nav-group-task"> <a href="../../Classes/SearchBarView.html">SearchBarView</a> </li> <li class="nav-group-task"> <a href="../../Classes/SearchBarView/SeparatorPosition.html">– SeparatorPosition</a> </li> <li class="nav-group-task"> <a href="../../Classes/SeparatorView.html">SeparatorView</a> </li> <li class="nav-group-task"> <a href="../../Classes/SeparatorView/Style.html">– Style</a> </li> <li class="nav-group-task"> <a href="../../Classes/SiriShortcuts.html">SiriShortcuts</a> </li> <li class="nav-group-task"> <a href="../../Classes/SiriShortcuts/Domain.html">– Domain</a> </li> <li class="nav-group-task"> <a href="../../Classes/SiriShortcuts/Suggestions.html">– Suggestions</a> </li> <li class="nav-group-task"> <a href="../../Classes/SplitScreenViewController.html">SplitScreenViewController</a> </li> <li class="nav-group-task"> <a href="../../Classes/SwizzleManager.html">SwizzleManager</a> </li> <li class="nav-group-task"> <a href="../../Classes/SwizzleManager/SwizzleOptions.html">– SwizzleOptions</a> </li> <li class="nav-group-task"> <a href="../../Classes/TextViewController.html">TextViewController</a> </li> <li class="nav-group-task"> <a href="../../Classes/TransitionAnimator.html">TransitionAnimator</a> </li> <li class="nav-group-task"> <a href="../../Classes/TransitionContext.html">TransitionContext</a> </li> <li class="nav-group-task"> <a href="../../Classes/UserDefaultStore.html">UserDefaultStore</a> </li> <li class="nav-group-task"> <a href="../../Classes/UserDefaultsAnalyticsProvider.html">UserDefaultsAnalyticsProvider</a> </li> <li class="nav-group-task"> <a href="../../Classes/Weak.html">Weak</a> </li> <li class="nav-group-task"> <a href="../../Classes/WebViewController.html">WebViewController</a> </li> <li class="nav-group-task"> <a href="../../Classes/WebViewController/Autofill.html">– Autofill</a> </li> <li class="nav-group-task"> <a href="../../Classes/WebViewController/Style.html">– Style</a> </li> <li class="nav-group-task"> <a href="../../Classes/XCCollectionReusableView.html">XCCollectionReusableView</a> </li> <li class="nav-group-task"> <a href="../../Classes/XCCollectionView.html">XCCollectionView</a> </li> <li class="nav-group-task"> <a href="../../Classes/XCCollectionViewCell.html">XCCollectionViewCell</a> </li> <li class="nav-group-task"> <a href="../../Classes/XCCollectionViewComposedDataSource.html">XCCollectionViewComposedDataSource</a> </li> <li class="nav-group-task"> <a href="../../Classes/XCCollectionViewDataSource.html">XCCollectionViewDataSource</a> </li> <li class="nav-group-task"> <a href="../../Classes/XCCollectionViewFlowLayout.html">XCCollectionViewFlowLayout</a> </li> <li class="nav-group-task"> <a href="../../Classes/XCCollectionViewFlowLayout/Attributes.html">– Attributes</a> </li> <li class="nav-group-task"> <a href="../../Classes/XCCollectionViewFlowLayoutAdapter.html">XCCollectionViewFlowLayoutAdapter</a> </li> <li class="nav-group-task"> <a href="../../Classes/XCCollectionViewTileLayout.html">XCCollectionViewTileLayout</a> </li> <li class="nav-group-task"> <a href="../../Classes/XCCollectionViewTileLayoutAdapter.html">XCCollectionViewTileLayoutAdapter</a> </li> <li class="nav-group-task"> <a href="../../Classes/XCComposedCollectionViewController.html">XCComposedCollectionViewController</a> </li> <li class="nav-group-task"> <a href="../../Classes/XCComposedCollectionViewLayoutAdapter.html">XCComposedCollectionViewLayoutAdapter</a> </li> <li class="nav-group-task"> <a href="../../Classes/XCComposedTableViewController.html">XCComposedTableViewController</a> </li> <li class="nav-group-task"> <a href="../../Classes/XCPageViewController.html">XCPageViewController</a> </li> <li class="nav-group-task"> <a href="../../Classes/XCPageViewController/PageControlPosition.html">– PageControlPosition</a> </li> <li class="nav-group-task"> <a href="../../Classes/XCScrollViewController.html">XCScrollViewController</a> </li> <li class="nav-group-task"> <a href="../../Classes/XCTabBarController.html">XCTabBarController</a> </li> <li class="nav-group-task"> <a href="../../Classes/XCTableViewCell.html">XCTableViewCell</a> </li> <li class="nav-group-task"> <a href="../../Classes/XCTableViewComposedDataSource.html">XCTableViewComposedDataSource</a> </li> <li class="nav-group-task"> <a href="../../Classes/XCTableViewDataSource.html">XCTableViewDataSource</a> </li> <li class="nav-group-task"> <a href="../../Classes/XCToolbar.html">XCToolbar</a> </li> <li class="nav-group-task"> <a href="../../Classes/XCView.html">XCView</a> </li> <li class="nav-group-task"> <a href="../../Classes/ZoomAnimator.html">ZoomAnimator</a> </li> <li class="nav-group-task"> <a href="../../Classes/ZoomAnimatorNavigationControllerDelegate.html">ZoomAnimatorNavigationControllerDelegate</a> </li> </ul> </li> <li class="nav-group-name"> <a href="../../Global%20Variables.html">Global Variables</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a href="../../Global%20Variables.html#/s:5Xcore18isDebuggerAttachedSbvp">isDebuggerAttached</a> </li> <li class="nav-group-task"> <a href="../../Global%20Variables.html#/s:5Xcore003Bxa12CoreGraphics7CGFloatVvp">π</a> </li> </ul> </li> <li class="nav-group-name"> <a href="../../Enums.html">Enumerations</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a href="../../Enums/AnimationDirection.html">AnimationDirection</a> </li> <li class="nav-group-task"> <a href="../../Enums/AnimationState.html">AnimationState</a> </li> <li class="nav-group-task"> <a href="../../Enums/AssociationPolicy.html">AssociationPolicy</a> </li> <li class="nav-group-task"> <a href="../../Enums/Count.html">Count</a> </li> <li class="nav-group-task"> <a href="../../Enums/Currency.html">Currency</a> </li> <li class="nav-group-task"> <a href="../../Enums/Currency/Components.html">– Components</a> </li> <li class="nav-group-task"> <a href="../../Enums/Currency/SymbolsOptions.html">– SymbolsOptions</a> </li> <li class="nav-group-task"> <a href="../../Enums/Either.html">Either</a> </li> <li class="nav-group-task"> <a href="../../Enums/FeatureFlag.html">FeatureFlag</a> </li> <li class="nav-group-task"> <a href="../../Enums/FeatureFlag/Key.html">– Key</a> </li> <li class="nav-group-task"> <a href="../../Enums/GradientDirection.html">GradientDirection</a> </li> <li class="nav-group-task"> <a href="../../Enums/Handler.html">Handler</a> </li> <li class="nav-group-task"> <a href="../../Enums/Handler/Completion.html">– Completion</a> </li> <li class="nav-group-task"> <a href="../../Enums/Handler/Lifecycle.html">– Lifecycle</a> </li> <li class="nav-group-task"> <a href="../../Enums/ImageRepresentableAlignment.html">ImageRepresentableAlignment</a> </li> <li class="nav-group-task"> <a href="../../Enums/ImageSourceType.html">ImageSourceType</a> </li> <li class="nav-group-task"> <a href="../../Enums/ImageSourceType/CacheType.html">– CacheType</a> </li> <li class="nav-group-task"> <a href="../../Enums/Interstitial.html">Interstitial</a> </li> <li class="nav-group-task"> <a href="../../Enums/Interstitial/UserState.html">– UserState</a> </li> <li class="nav-group-task"> <a href="../../Enums/Interstitial/Controller.html">– Controller</a> </li> <li class="nav-group-task"> <a href="../../Enums/Interstitial/Item.html">– Item</a> </li> <li class="nav-group-task"> <a href="../../Enums/LaunchScreen.html">LaunchScreen</a> </li> <li class="nav-group-task"> <a href="../../Enums/LaunchScreen/View.html">– View</a> </li> <li class="nav-group-task"> <a href="../../Enums/LaunchScreen/ViewController.html">– ViewController</a> </li> <li class="nav-group-task"> <a href="../../Enums/ListAccessoryType.html">ListAccessoryType</a> </li> <li class="nav-group-task"> <a href="../../Enums/MultiplePromisesResolutionStrategy.html">MultiplePromisesResolutionStrategy</a> </li> <li class="nav-group-task"> <a href="../../Enums/StringSourceType.html">StringSourceType</a> </li> <li class="nav-group-task"> <a href="../../Enums/SwizzleMethodKind.html">SwizzleMethodKind</a> </li> </ul> </li> <li class="nav-group-name"> <a href="../../Extensions.html">Extensions</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a href="../../Extensions/AVAsset.html">AVAsset</a> </li> <li class="nav-group-task"> <a href="../../Extensions/AVPlayer.html">AVPlayer</a> </li> <li class="nav-group-task"> <a href="../../Extensions/AVPlayerItem.html">AVPlayerItem</a> </li> <li class="nav-group-task"> <a href="../../Extensions/Array.html">Array</a> </li> <li class="nav-group-task"> <a href="../../Extensions/Bundle.html">Bundle</a> </li> <li class="nav-group-task"> <a href="../../Extensions/CALayer.html">CALayer</a> </li> <li class="nav-group-task"> <a href="../../Extensions/CAMediaTimingFunction.html">CAMediaTimingFunction</a> </li> <li class="nav-group-task"> <a href="../../Extensions/CATransaction.html">CATransaction</a> </li> <li class="nav-group-task"> <a href="../../Extensions/CATransitionType.html">CATransitionType</a> </li> <li class="nav-group-task"> <a href="../../Extensions/CGAffineTransform.html">CGAffineTransform</a> </li> <li class="nav-group-task"> <a href="../../Extensions/CGColor.html">CGColor</a> </li> <li class="nav-group-task"> <a href="../../Extensions/CGContext.html">CGContext</a> </li> <li class="nav-group-task"> <a href="../../Extensions/CGFloat.html">CGFloat</a> </li> <li class="nav-group-task"> <a href="../../Extensions/CGRect.html">CGRect</a> </li> <li class="nav-group-task"> <a href="../../Extensions/CGSize.html">CGSize</a> </li> <li class="nav-group-task"> <a href="../../Extensions/CMTime.html">CMTime</a> </li> <li class="nav-group-task"> <a href="../../Extensions/CaseIterable.html">CaseIterable</a> </li> <li class="nav-group-task"> <a href="../../Extensions/CharacterSet.html">CharacterSet</a> </li> <li class="nav-group-task"> <a href="../../Extensions/ClosedRange.html">ClosedRange</a> </li> <li class="nav-group-task"> <a href="../../Extensions/Collection.html">Collection</a> </li> <li class="nav-group-task"> <a href="../../Extensions/Comparable.html">Comparable</a> </li> <li class="nav-group-task"> <a href="../../Extensions/Constraint.html">Constraint</a> </li> <li class="nav-group-task"> <a href="../../Extensions/ConstraintMakerEditable.html">ConstraintMakerEditable</a> </li> <li class="nav-group-task"> <a href="../../Extensions/ConstraintMakerPriortizable.html">ConstraintMakerPriortizable</a> </li> <li class="nav-group-task"> <a href="../../Extensions/ConstraintMakerRelatable.html">ConstraintMakerRelatable</a> </li> <li class="nav-group-task"> <a href="../../Extensions/ConstraintPriority.html">ConstraintPriority</a> </li> <li class="nav-group-task"> <a href="../../Extensions/Data.html">Data</a> </li> <li class="nav-group-task"> <a href="../../Extensions/Data/HexEncodingOptions.html">– HexEncodingOptions</a> </li> <li class="nav-group-task"> <a href="../../Extensions/Date.html">Date</a> </li> <li class="nav-group-task"> <a href="../../Extensions/Dictionary.html">Dictionary</a> </li> <li class="nav-group-task"> <a href="../../Extensions/Dictionary/MergingStrategy.html">– MergingStrategy</a> </li> <li class="nav-group-task"> <a href="../../Extensions/DispatchTime.html">DispatchTime</a> </li> <li class="nav-group-task"> <a href="../../Extensions/Double.html">Double</a> </li> <li class="nav-group-task"> <a href="../../Extensions/FileManager.html">FileManager</a> </li> <li class="nav-group-task"> <a href="../../Extensions/FileManager/Options.html">– Options</a> </li> <li class="nav-group-task"> <a href="../../Extensions/FixedWidthInteger.html">FixedWidthInteger</a> </li> <li class="nav-group-task"> <a href="../../Extensions/FloatingPoint.html">FloatingPoint</a> </li> <li class="nav-group-task"> <a href="../../Extensions/HTTPCookieStorage.html">HTTPCookieStorage</a> </li> <li class="nav-group-task"> <a href="../../Extensions/INBalanceAmount.html">INBalanceAmount</a> </li> <li class="nav-group-task"> <a href="../../Extensions/INCurrencyAmount.html">INCurrencyAmount</a> </li> <li class="nav-group-task"> <a href="../../Extensions/INIntent.html">INIntent</a> </li> <li class="nav-group-task"> <a href="../../Extensions/IndexPath.html">IndexPath</a> </li> <li class="nav-group-task"> <a href="../../Extensions/Int.html">Int</a> </li> <li class="nav-group-task"> <a href="../../Extensions/Locale.html">Locale</a> </li> <li class="nav-group-task"> <a href="../../Extensions/MFMailComposeViewController.html">MFMailComposeViewController</a> </li> <li class="nav-group-task"> <a href="../../Extensions/NSAttributedString.html">NSAttributedString</a> </li> <li class="nav-group-task"> <a href="../../Extensions/NSAttributedString/CaretDirection.html">– CaretDirection</a> </li> <li class="nav-group-task"> <a href="../../Extensions/NSAttributedString/BulletStyle.html">– BulletStyle</a> </li> <li class="nav-group-task"> <a href="../../Extensions/NSLayoutConstraint.html">NSLayoutConstraint</a> </li> <li class="nav-group-task"> <a href="../../Extensions/NSLayoutConstraint/Edges.html">– Edges</a> </li> <li class="nav-group-task"> <a href="../../Extensions/NSLayoutConstraint/Size.html">– Size</a> </li> <li class="nav-group-task"> <a href="../../Extensions/NSMutableAttributedString.html">NSMutableAttributedString</a> </li> <li class="nav-group-task"> <a href="../../Extensions/NSObject.html">NSObject</a> </li> <li class="nav-group-task"> <a href="../../Extensions/NSObject/LookupComparison.html">– LookupComparison</a> </li> <li class="nav-group-task"> <a href="../../Extensions/NSObjectProtocol.html">NSObjectProtocol</a> </li> <li class="nav-group-task"> <a href="../../Extensions/NSPredicate.html">NSPredicate</a> </li> <li class="nav-group-task"> <a href="../../Extensions/NSString.html">NSString</a> </li> <li class="nav-group-task"> <a href="../../Extensions/NotificationCenter.html">NotificationCenter</a> </li> <li class="nav-group-task"> <a href="../../Extensions/NotificationCenter/Event.html">– Event</a> </li> <li class="nav-group-task"> <a href="../../Extensions/Optional.html">Optional</a> </li> <li class="nav-group-task"> <a href="../../Extensions/ProcessInfo.html">ProcessInfo</a> </li> <li class="nav-group-task"> <a href="../../Extensions/ProcessInfo/Argument.html">– Argument</a> </li> <li class="nav-group-task"> <a href="../../Extensions/ProcessInfo/Arguments.html">– Arguments</a> </li> <li class="nav-group-task"> <a href="../../Extensions/Promise.html">Promise</a> </li> <li class="nav-group-task"> <a href="../../Extensions/Promise/MultiplePromisesResponse.html">– MultiplePromisesResponse</a> </li> <li class="nav-group-task"> <a href="../../Extensions/RandomAccessCollection.html">RandomAccessCollection</a> </li> <li class="nav-group-task"> <a href="../../Extensions/RangeReplaceableCollection.html">RangeReplaceableCollection</a> </li> <li class="nav-group-task"> <a href="../../Extensions/Sequence.html">Sequence</a> </li> <li class="nav-group-task"> <a href="../../Extensions/SignedInteger.html">SignedInteger</a> </li> <li class="nav-group-task"> <a href="../../Extensions/String.html">String</a> </li> <li class="nav-group-task"> <a href="../../Extensions/String/TruncationPosition.html">– TruncationPosition</a> </li> <li class="nav-group-task"> <a href="../../Extensions/StringProtocol.html">StringProtocol</a> </li> <li class="nav-group-task"> <a href="../../Extensions/TimeInterval.html">TimeInterval</a> </li> <li class="nav-group-task"> <a href="../../Extensions/TimeZone.html">TimeZone</a> </li> <li class="nav-group-task"> <a href="../../Extensions/Timer.html">Timer</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UIAlertController.html">UIAlertController</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UIApplication.html">UIApplication</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UIBarButtonItem.html">UIBarButtonItem</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UIButton.html">UIButton</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UIButton/Configuration.html">– Configuration</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UIButton/DefaultAppearance.html">– DefaultAppearance</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UICollectionReusableView.html">UICollectionReusableView</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UICollectionView.html">UICollectionView</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UICollectionView/SupplementaryViewKind.html">– SupplementaryViewKind</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UICollectionViewCell.html">UICollectionViewCell</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UICollectionViewFlowLayout.html">UICollectionViewFlowLayout</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UICollectionViewLayout.html">UICollectionViewLayout</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UIColor.html">UIColor</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UIControl.html">UIControl</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UIDatePicker.html">UIDatePicker</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UIDevice.html">UIDevice</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UIDevice/BiometryType.html">– BiometryType</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UIDevice/Capability.html">– Capability</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UIDevice/ModelType.html">– ModelType</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UIEdgeInsets.html">UIEdgeInsets</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UIFont.html">UIFont</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UIFont/Trait.html">– Trait</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UIFont/TextStyle.html">– TextStyle</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UIFont/LoaderError.html">– LoaderError</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UIFont/Typeface.html">– Typeface</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UIGestureRecognizer.html">UIGestureRecognizer</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UIImage.html">UIImage</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UIImage/Fetcher.html">– Fetcher</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UIImageView.html">UIImageView</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UILabel.html">UILabel</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UILayoutPriority.html">UILayoutPriority</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UINavigationBar.html">UINavigationBar</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UINavigationController.html">UINavigationController</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UINavigationController/AnimationStyle.html">– AnimationStyle</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UINib.html">UINib</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UIPopoverPresentationController.html">UIPopoverPresentationController</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UIRectCorner.html">UIRectCorner</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UIRefreshControl.html">UIRefreshControl</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UIResponder.html">UIResponder</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UIScrollView.html">UIScrollView</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UIScrollView/ScrollingDirection.html">– ScrollingDirection</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UISearchBar.html">UISearchBar</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UIStackView.html">UIStackView</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UITabBar.html">UITabBar</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UITabBarController.html">UITabBarController</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UITabBarController/TabItem.html">– TabItem</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UITableView.html">UITableView</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UITableViewCell.html">UITableViewCell</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UITextField.html">UITextField</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UITextView.html">UITextView</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UIToolbar.html">UIToolbar</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UIView.html">UIView</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UIViewController.html">UIViewController</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UIViewController/DefaultAppearance.html">– DefaultAppearance</a> </li> <li class="nav-group-task"> <a href="../../Extensions/UIWindow.html">UIWindow</a> </li> <li class="nav-group-task"> <a href="../../Extensions/URL.html">URL</a> </li> <li class="nav-group-task"> <a href="../../Extensions/URL/Scheme.html">– Scheme</a> </li> <li class="nav-group-task"> <a href="../../Extensions/WKWebView.html">WKWebView</a> </li> </ul> </li> <li class="nav-group-name"> <a href="../../Functions.html">Functions</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a href="../../Functions.html#/s:5Xcore2neoiySbSDyxq_SgG_ADtSHRzr0_lF">!=(_:_:)</a> </li> <li class="nav-group-task"> <a href="../../Functions.html#/s:5Xcore1poiySDyxq_GAC_ACSgtSHRzr0_lF">+(_:_:)</a> </li> <li class="nav-group-task"> <a href="../../Functions.html#/s:5Xcore1poiySDyxq_GAC_ACtSHRzr0_lF">+(_:_:)</a> </li> <li class="nav-group-task"> <a href="../../Functions.html#/s:5Xcore2peoiyySDyxq_Gz_ACtSHRzr0_lF">+=(_:_:)</a> </li> <li class="nav-group-task"> <a href="../../Functions.html#/s:5Xcore2eeoiySbSDyxq_SgG_ADtSHRzr0_lF">==(_:_:)</a> </li> <li class="nav-group-task"> <a href="../../Functions.html#/s:5Xcore2eeoiySbyXlSg_So6UIViewCtF">==(_:_:)</a> </li> <li class="nav-group-task"> <a href="../../Functions.html#/s:5Xcore5alert5title7messageySS_SStF">alert(title:message:)</a> </li> <li class="nav-group-task"> <a href="../../Functions.html#/s:5Xcore13collectionify_10parameters8callbackyyx_yq_Sgctc_SayxGySayq_Gctr0_lF">collectionify(_:parameters:callback:)</a> </li> <li class="nav-group-task"> <a href="../../Functions.html#/s:5Xcore13collectionify_10parameters8callbackyyx_yq_ctc_SayxGySayq_Gctr0_lF">collectionify(_:parameters:callback:)</a> </li> <li class="nav-group-task"> <a href="../../Functions.html#/s:5Xcore13collectionify_9splitSize10parameters8callbackyySayxG_ySayq_Gctc_SiAFyAGctr0_lF">collectionify(_:splitSize:parameters:callback:)</a> </li> <li class="nav-group-task"> <a href="../../Functions.html#/s:5Xcore8debounce5delay5queue6actionyx_q_tc8Dispatch0F12TimeIntervalO_So012OS_dispatch_D0Cyx_q_tctr0_lF">debounce(delay:queue:action:)</a> </li> <li class="nav-group-task"> <a href="../../Functions.html#/s:5Xcore8debounce5delay5queue6actionyxc8Dispatch0F12TimeIntervalO_So012OS_dispatch_D0CyxctlF">debounce(delay:queue:action:)</a> </li> <li class="nav-group-task"> <a href="../../Functions.html#/s:5Xcore8debounce5delay5queue6actionyyc8Dispatch0F12TimeIntervalO_So012OS_dispatch_D0CyyctF">debounce(delay:queue:action:)</a> </li> <li class="nav-group-task"> <a href="../../Functions.html#/s:5Xcore5delay2by_ySd_yyctF">delay(by:_:)</a> </li> <li class="nav-group-task"> <a href="../../Functions.html#/s:5Xcore10fatalError7because8function4file4lines5NeverOAA11FatalReasonV_s12StaticStringVALSutF">fatalError(because:function:file:line:)</a> </li> <li class="nav-group-task"> <a href="../../Functions.html#/s:5Xcore4join_8strategy10PromiseKit0D0CyAfAE24MultiplePromisesResponseVyx_GGSayAFySayxGGG_AA0fG18ResolutionStrategyOtlF">join(_:strategy:)</a> </li> <li class="nav-group-task"> <a href="../../Functions.html#/s:5Xcore7measure5label5blockySS_yyyXEXEtF">measure(label:block:)</a> </li> <li class="nav-group-task"> <a href="../../Functions.html#/s:5Xcore4name2ofSSyp_tF">name(of:)</a> </li> <li class="nav-group-task"> <a href="../../Functions.html#/s:5Xcore4open3url4fromy10Foundation3URLV_So16UIViewControllerCtF">open(url:from:)</a> </li> <li class="nav-group-task"> <a href="../../Functions.html#/s:5Xcore11orderedJoiny10PromiseKit0D0CySayxGGSayAGycGlF">orderedJoin(_:)</a> </li> <li class="nav-group-task"> <a href="../../Functions.html#/s:5Xcore12promiseUntil9predicate4body10retryDelay15maxRetrySeconds10PromiseKit0K0CyxGSbxc_AJycSdSitlF">promiseUntil(predicate:body:retryDelay:maxRetrySeconds:)</a> </li> <li class="nav-group-task"> <a href="../../Functions.html#/s:5Xcore1ryAA20ImageAssetIdentifierVADF">r(_:)</a> </li> <li class="nav-group-task"> <a href="../../Functions.html#/s:5Xcore7swizzle_16originalSelector08swizzledD04kindyyXlXp_10ObjectiveC0D0VAhA17SwizzleMethodKindOtF">swizzle(_:originalSelector:swizzledSelector:kind:)</a> </li> <li class="nav-group-task"> <a href="../../Functions.html#/s:5Xcore12synchronizedyxyXl_xyKXEtKlF">synchronized(_:_:)</a> </li> <li class="nav-group-task"> <a href="../../Functions.html#/s:5Xcore8throttle5delay5queue6actionyx_q_tcSd_So012OS_dispatch_D0Cyx_q_tctr0_lF">throttle(delay:queue:action:)</a> </li> <li class="nav-group-task"> <a href="../../Functions.html#/s:5Xcore8throttle5delay5queue6actionyxcSd_So012OS_dispatch_D0CyxctlF">throttle(delay:queue:action:)</a> </li> <li class="nav-group-task"> <a href="../../Functions.html#/s:5Xcore8throttle5delay5queue6actionyycSd_So012OS_dispatch_D0CyyctF">throttle(delay:queue:action:)</a> </li> <li class="nav-group-task"> <a href="../../Functions.html#/s:5Xcore11warnUnknown_4file8function4lineyyp_S2SSitF">warnUnknown(_:file:function:line:)</a> </li> </ul> </li> <li class="nav-group-name"> <a href="../../Protocols.html">Protocols</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a href="../../Protocols/AnalyticsEvent.html">AnalyticsEvent</a> </li> <li class="nav-group-task"> <a href="../../Protocols/AnalyticsProvider.html">AnalyticsProvider</a> </li> <li class="nav-group-task"> <a href="../../Protocols/Appliable.html">Appliable</a> </li> <li class="nav-group-task"> <a href="../../Protocols/CarouselAccessibilitySupport.html">CarouselAccessibilitySupport</a> </li> <li class="nav-group-task"> <a href="../../Protocols/CarouselViewCellRepresentable.html">CarouselViewCellRepresentable</a> </li> <li class="nav-group-task"> <a href="../../Protocols/CarouselViewModelRepresentable.html">CarouselViewModelRepresentable</a> </li> <li class="nav-group-task"> <a href="../../Protocols/CollectionViewLayoutRepresentable.html">CollectionViewLayoutRepresentable</a> </li> <li class="nav-group-task"> <a href="../../Protocols/Colorable.html">Colorable</a> </li> <li class="nav-group-task"> <a href="../../Protocols/Configurable.html">Configurable</a> </li> <li class="nav-group-task"> <a href="../../Protocols/ConfigurationInitializable.html">ConfigurationInitializable</a> </li> <li class="nav-group-task"> <a href="../../Protocols/ControlTargetActionBlockRepresentable.html">ControlTargetActionBlockRepresentable</a> </li> <li class="nav-group-task"> <a href="../../Protocols/CurrencySymbolsProvider.html">CurrencySymbolsProvider</a> </li> <li class="nav-group-task"> <a href="../../Protocols/DimmableLayout.html">DimmableLayout</a> </li> <li class="nav-group-task"> <a href="../../Protocols/DisplayTimestampPreferenceStorage.html">DisplayTimestampPreferenceStorage</a> </li> <li class="nav-group-task"> <a href="../../Protocols/DrawerScreenContent.html">DrawerScreenContent</a> </li> <li class="nav-group-task"> <a href="../../Protocols/EquatableByPointer.html">EquatableByPointer</a> </li> <li class="nav-group-task"> <a href="../../Protocols/ExtensibleByAssociatedObject.html">ExtensibleByAssociatedObject</a> </li> <li class="nav-group-task"> <a href="../../Protocols/FadeAnimatorBounceable.html">FadeAnimatorBounceable</a> </li> <li class="nav-group-task"> <a href="../../Protocols/FeatureFlagProvider.html">FeatureFlagProvider</a> </li> <li class="nav-group-task"> <a href="../../Protocols/ImageFetcher.html">ImageFetcher</a> </li> <li class="nav-group-task"> <a href="../../Protocols/ImageRepresentable.html">ImageRepresentable</a> </li> <li class="nav-group-task"> <a href="../../Protocols/ImageRepresentablePlugin.html">ImageRepresentablePlugin</a> </li> <li class="nav-group-task"> <a href="../../Protocols/ImageTitleDisplayable.html">ImageTitleDisplayable</a> </li> <li class="nav-group-task"> <a href="../../Protocols/ImageTransform.html">ImageTransform</a> </li> <li class="nav-group-task"> <a href="../../Protocols/InitializableByEmptyConstructor.html">InitializableByEmptyConstructor</a> </li> <li class="nav-group-task"> <a href="../../Protocols/InterstitialCompatibleViewController.html">InterstitialCompatibleViewController</a> </li> <li class="nav-group-task"> <a href="../../Protocols/KeyboardObservable.html">KeyboardObservable</a> </li> <li class="nav-group-task"> <a href="../../Protocols/ModallyPresentable.html">ModallyPresentable</a> </li> <li class="nav-group-task"> <a href="../../Protocols/MutableAppliable.html">MutableAppliable</a> </li> <li class="nav-group-task"> <a href="../../Protocols/NibInstantiable.html">NibInstantiable</a> </li> <li class="nav-group-task"> <a href="../../Protocols/NotificationObject.html">NotificationObject</a> </li> <li class="nav-group-task"> <a href="../../Protocols.html#/s:5Xcore16ObstructableViewP">ObstructableView</a> </li> <li class="nav-group-task"> <a href="../../Protocols/OptionalType.html">OptionalType</a> </li> <li class="nav-group-task"> <a href="../../Protocols/OptionsRepresentable.html">OptionsRepresentable</a> </li> <li class="nav-group-task"> <a href="../../Protocols/PickerListModel.html">PickerListModel</a> </li> <li class="nav-group-task"> <a href="../../Protocols/PickerModel.html">PickerModel</a> </li> <li class="nav-group-task"> <a href="../../Protocols.html#/s:5Xcore29PopoverPresentationSourceViewP">PopoverPresentationSourceView</a> </li> <li class="nav-group-task"> <a href="../../Protocols/PredicateRepresentable.html">PredicateRepresentable</a> </li> <li class="nav-group-task"> <a href="../../Protocols/PresentationContext.html">PresentationContext</a> </li> <li class="nav-group-task"> <a href="../../Protocols/ReorderTableViewDelegate.html">ReorderTableViewDelegate</a> </li> <li class="nav-group-task"> <a href="../../Protocols/Reusable.html">Reusable</a> </li> <li class="nav-group-task"> <a href="../../Protocols/RouteHandler.html">RouteHandler</a> </li> <li class="nav-group-task"> <a href="../../Protocols/SiriShortcutConvertible.html">SiriShortcutConvertible</a> </li> <li class="nav-group-task"> <a href="../../Protocols/SortOrderable.html">SortOrderable</a> </li> <li class="nav-group-task"> <a href="../../Protocols/StoryboardInstantiable.html">StoryboardInstantiable</a> </li> <li class="nav-group-task"> <a href="../../Protocols/StringRepresentable.html">StringRepresentable</a> </li> <li class="nav-group-task"> <a href="../../Protocols/TargetActionBlockRepresentable.html">TargetActionBlockRepresentable</a> </li> <li class="nav-group-task"> <a href="../../Protocols/TextAttributedTextRepresentable.html">TextAttributedTextRepresentable</a> </li> <li class="nav-group-task"> <a href="../../Protocols/UserInfoContainer.html">UserInfoContainer</a> </li> <li class="nav-group-task"> <a href="../../Protocols/ViewMaskable.html">ViewMaskable</a> </li> <li class="nav-group-task"> <a href="../../Protocols/XCCollectionViewDelegateTileLayout.html">XCCollectionViewDelegateTileLayout</a> </li> <li class="nav-group-task"> <a href="../../Protocols/XCCollectionViewFlowLayoutCustomizable.html">XCCollectionViewFlowLayoutCustomizable</a> </li> <li class="nav-group-task"> <a href="../../Protocols/XCCollectionViewTileLayoutCustomizable.html">XCCollectionViewTileLayoutCustomizable</a> </li> <li class="nav-group-task"> <a href="../../Protocols/XCComposedCollectionViewLayoutCompatible.html">XCComposedCollectionViewLayoutCompatible</a> </li> <li class="nav-group-task"> <a href="../../Protocols/ZoomAnimatorDestination.html">ZoomAnimatorDestination</a> </li> <li class="nav-group-task"> <a href="../../Protocols/ZoomAnimatorSource.html">ZoomAnimatorSource</a> </li> </ul> </li> <li class="nav-group-name"> <a href="../../Structs.html">Structures</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a href="../../Structs/AdaptiveURL.html">AdaptiveURL</a> </li> <li class="nav-group-task"> <a href="../../Structs/AlphaImageTransform.html">AlphaImageTransform</a> </li> <li class="nav-group-task"> <a href="../../Structs/AnyConfigurable.html">AnyConfigurable</a> </li> <li class="nav-group-task"> <a href="../../Structs/AnyEquatable.html">AnyEquatable</a> </li> <li class="nav-group-task"> <a href="../../Structs/AppAnalyticsEvent.html">AppAnalyticsEvent</a> </li> <li class="nav-group-task"> <a href="../../Structs/AppConstants.html">AppConstants</a> </li> <li class="nav-group-task"> <a href="../../Structs/ArrayIterator.html">ArrayIterator</a> </li> <li class="nav-group-task"> <a href="../../Structs/BackgroundImageTransform.html">BackgroundImageTransform</a> </li> <li class="nav-group-task"> <a href="../../Structs/BlockImageTransform.html">BlockImageTransform</a> </li> <li class="nav-group-task"> <a href="../../Structs/CellOptions.html">CellOptions</a> </li> <li class="nav-group-task"> <a href="../../Structs/Clamping.html">Clamping</a> </li> <li class="nav-group-task"> <a href="../../Structs/ColorizeImageTransform.html">ColorizeImageTransform</a> </li> <li class="nav-group-task"> <a href="../../Structs/ColorizeImageTransform/Kind.html">– Kind</a> </li> <li class="nav-group-task"> <a href="../../Structs/CompositeImageTransform.html">CompositeImageTransform</a> </li> <li class="nav-group-task"> <a href="../../Structs/Configuration.html">Configuration</a> </li> <li class="nav-group-task"> <a href="../../Structs/CornerRadiusImageTransform.html">CornerRadiusImageTransform</a> </li> <li class="nav-group-task"> <a href="../../Structs/DataSource.html">DataSource</a> </li> <li class="nav-group-task"> <a href="../../Structs/DelayedMutable.html">DelayedMutable</a> </li> <li class="nav-group-task"> <a href="../../Structs/DynamicTableModel.html">DynamicTableModel</a> </li> <li class="nav-group-task"> <a href="../../Structs/ElementPosition.html">ElementPosition</a> </li> <li class="nav-group-task"> <a href="../../Structs/FatalReason.html">FatalReason</a> </li> <li class="nav-group-task"> <a href="../../Structs/GradientImageTransform.html">GradientImageTransform</a> </li> <li class="nav-group-task"> <a href="../../Structs/HighlightedAnimationOptions.html">HighlightedAnimationOptions</a> </li> <li class="nav-group-task"> <a href="../../Structs/Identifier.html">Identifier</a> </li> <li class="nav-group-task"> <a href="../../Structs/ImageAssetIdentifier.html">ImageAssetIdentifier</a> </li> <li class="nav-group-task"> <a href="../../Structs/IndexPathCache.html">IndexPathCache</a> </li> <li class="nav-group-task"> <a href="../../Structs/JSONHelpers.html">JSONHelpers</a> </li> <li class="nav-group-task"> <a href="../../Structs/KeyboardPayload.html">KeyboardPayload</a> </li> <li class="nav-group-task"> <a href="../../Structs/LazyReset.html">LazyReset</a> </li> <li class="nav-group-task"> <a href="../../Structs/MetaStaticMember.html">MetaStaticMember</a> </li> <li class="nav-group-task"> <a href="../../Structs/Percentage.html">Percentage</a> </li> <li class="nav-group-task"> <a href="../../Structs/PresentationContextKind.html">PresentationContextKind</a> </li> <li class="nav-group-task"> <a href="../../Structs/PrintAnalyticsProvider.html">PrintAnalyticsProvider</a> </li> <li class="nav-group-task"> <a href="../../Structs/ResizeImageTransform.html">ResizeImageTransform</a> </li> <li class="nav-group-task"> <a href="../../Structs/ResizeImageTransform/ScalingMode.html">– ScalingMode</a> </li> <li class="nav-group-task"> <a href="../../Structs/Response.html">Response</a> </li> <li class="nav-group-task"> <a href="../../Structs/SafeAreaLayoutGuideOptions.html">SafeAreaLayoutGuideOptions</a> </li> <li class="nav-group-task"> <a href="../../Structs/Section.html">Section</a> </li> <li class="nav-group-task"> <a href="../../Structs/Shadow.html">Shadow</a> </li> <li class="nav-group-task"> <a href="../../Structs/StringConverter.html">StringConverter</a> </li> <li class="nav-group-task"> <a href="../../Structs/StringsFile.html">StringsFile</a> </li> <li class="nav-group-task"> <a href="../../Structs/Theme.html">Theme</a> </li> <li class="nav-group-task"> <a href="../../Structs/TintColorImageTransform.html">TintColorImageTransform</a> </li> <li class="nav-group-task"> <a href="../../Structs/Trimmed.html">Trimmed</a> </li> <li class="nav-group-task"> <a href="../../Structs/UserDefault.html">UserDefault</a> </li> <li class="nav-group-task"> <a href="../../Structs/UserInfoKey.html">UserInfoKey</a> </li> <li class="nav-group-task"> <a href="../../Structs/ValidationRule.html">ValidationRule</a> </li> <li class="nav-group-task"> <a href="../../Structs/Version.html">Version</a> </li> <li class="nav-group-task"> <a href="../../Structs/WebViewScripts.html">WebViewScripts</a> </li> <li class="nav-group-task"> <a href="../../Structs/XCComposedCollectionViewLayout.html">XCComposedCollectionViewLayout</a> </li> </ul> </li> <li class="nav-group-name"> <a href="../../Typealiases.html">Type Aliases</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a href="../../Typealiases.html#/s:5Xcore25CarouselAccessibilityItema">CarouselAccessibilityItem</a> </li> <li class="nav-group-task"> <a href="../../Typealiases.html#/s:5Xcore20CarouselViewCellTypea">CarouselViewCellType</a> </li> </ul> </li> </ul> </nav> <article class="main-content"> <section> <section class="section"> <h1>DimensionAxis</h1> <div class="declaration"> <div class="language"> <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">DimensionAxis</span> <span class="p">:</span> <span class="kt"><a href="../../Classes/Anchor/Axis.html">Axis</a></span><span class="o">&lt;</span><span class="kt"><a href="../../Classes/Anchor.html#/s:5Xcore6AnchorC17DimensionAxisTypeO">DimensionAxisType</a></span><span class="o">&gt;</span></code></pre> </div> </div> <p>Undocumented</p> </section> <section class="section task-group-section"> <div class="task-group"> <div class="task-name-container"> <a name="/GreaterThanOrEqual"></a> <a name="//apple_ref/swift/Section/GreaterThanOrEqual" class="dashAnchor"></a> <a href="#/GreaterThanOrEqual"> <h3 class="section-name">GreaterThanOrEqual</h3> </a> </div> <ul> <li class="item"> <div> <code> <a name="/s:5Xcore6AnchorC13DimensionAxisC7equalTo_4file4lineAC0D0C8ModifierCy_AC0cD4TypeO_G12CoreGraphics7CGFloatV_s12StaticStringVSutF"></a> <a name="//apple_ref/swift/Method/equalTo(_:file:line:)" class="dashAnchor"></a> <a class="token" href="#/s:5Xcore6AnchorC13DimensionAxisC7equalTo_4file4lineAC0D0C8ModifierCy_AC0cD4TypeO_G12CoreGraphics7CGFloatV_s12StaticStringVSutF">equalTo(_:file:line:)</a> </code> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Undocumented</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight swift"><code><span class="kd">@discardableResult</span> <span class="kd">open</span> <span class="kd">func</span> <span class="nf">equalTo</span><span class="p">(</span><span class="n">_</span> <span class="nv">value</span><span class="p">:</span> <span class="kt">CGFloat</span><span class="p">,</span> <span class="nv">file</span><span class="p">:</span> <span class="kt">StaticString</span> <span class="o">=</span> <span class="kd">#file</span><span class="p">,</span> <span class="nv">line</span><span class="p">:</span> <span class="kt">UInt</span> <span class="o">=</span> <span class="kd">#line</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Modifier</span></code></pre> </div> </div> <div class="slightly-smaller"> <a href="https://github.com/zmian/xcore.swift/blob/master/Sources/Cocoa/Components/Anchor/Anchor.swift#L502-L504">Show on GitHub</a> </div> </section> </div> </li> <li class="item"> <div> <code> <a name="/s:5Xcore6AnchorC13DimensionAxisC7equalTo_4file4lineAC0D0C8ModifierCy_AC0cD4TypeO_GSo6CGSizeV_s12StaticStringVSutF"></a> <a name="//apple_ref/swift/Method/equalTo(_:file:line:)" class="dashAnchor"></a> <a class="token" href="#/s:5Xcore6AnchorC13DimensionAxisC7equalTo_4file4lineAC0D0C8ModifierCy_AC0cD4TypeO_GSo6CGSizeV_s12StaticStringVSutF">equalTo(_:file:line:)</a> </code> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Undocumented</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight swift"><code><span class="kd">@discardableResult</span> <span class="kd">open</span> <span class="kd">func</span> <span class="nf">equalTo</span><span class="p">(</span><span class="n">_</span> <span class="nv">value</span><span class="p">:</span> <span class="kt">CGSize</span><span class="p">,</span> <span class="nv">file</span><span class="p">:</span> <span class="kt">StaticString</span> <span class="o">=</span> <span class="kd">#file</span><span class="p">,</span> <span class="nv">line</span><span class="p">:</span> <span class="kt">UInt</span> <span class="o">=</span> <span class="kd">#line</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Modifier</span></code></pre> </div> </div> <div class="slightly-smaller"> <a href="https://github.com/zmian/xcore.swift/blob/master/Sources/Cocoa/Components/Anchor/Anchor.swift#L507-L525">Show on GitHub</a> </div> </section> </div> </li> </ul> </div> <div class="task-group"> <div class="task-name-container"> <a name="/GreaterThanOrEqual2"></a> <a name="//apple_ref/swift/Section/GreaterThanOrEqual" class="dashAnchor"></a> <a href="#/GreaterThanOrEqual2"> <h3 class="section-name">GreaterThanOrEqual</h3> </a> </div> <ul> <li class="item"> <div> <code> <a name="/s:5Xcore6AnchorC13DimensionAxisC20greaterThanOrEqualTo_4file4lineAC0D0C8ModifierCy_AC0cD4TypeO_G12CoreGraphics7CGFloatV_s12StaticStringVSutF"></a> <a name="//apple_ref/swift/Method/greaterThanOrEqualTo(_:file:line:)" class="dashAnchor"></a> <a class="token" href="#/s:5Xcore6AnchorC13DimensionAxisC20greaterThanOrEqualTo_4file4lineAC0D0C8ModifierCy_AC0cD4TypeO_G12CoreGraphics7CGFloatV_s12StaticStringVSutF">greaterThanOrEqualTo(_:file:line:)</a> </code> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Undocumented</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight swift"><code><span class="kd">@discardableResult</span> <span class="kd">open</span> <span class="kd">func</span> <span class="nf">greaterThanOrEqualTo</span><span class="p">(</span><span class="n">_</span> <span class="nv">value</span><span class="p">:</span> <span class="kt">CGFloat</span><span class="p">,</span> <span class="nv">file</span><span class="p">:</span> <span class="kt">StaticString</span> <span class="o">=</span> <span class="kd">#file</span><span class="p">,</span> <span class="nv">line</span><span class="p">:</span> <span class="kt">UInt</span> <span class="o">=</span> <span class="kd">#line</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Modifier</span></code></pre> </div> </div> <div class="slightly-smaller"> <a href="https://github.com/zmian/xcore.swift/blob/master/Sources/Cocoa/Components/Anchor/Anchor.swift#L530-L532">Show on GitHub</a> </div> </section> </div> </li> <li class="item"> <div> <code> <a name="/s:5Xcore6AnchorC13DimensionAxisC20greaterThanOrEqualTo_4file4lineAC0D0C8ModifierCy_AC0cD4TypeO_GSo6CGSizeV_s12StaticStringVSutF"></a> <a name="//apple_ref/swift/Method/greaterThanOrEqualTo(_:file:line:)" class="dashAnchor"></a> <a class="token" href="#/s:5Xcore6AnchorC13DimensionAxisC20greaterThanOrEqualTo_4file4lineAC0D0C8ModifierCy_AC0cD4TypeO_GSo6CGSizeV_s12StaticStringVSutF">greaterThanOrEqualTo(_:file:line:)</a> </code> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Undocumented</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight swift"><code><span class="kd">@discardableResult</span> <span class="kd">open</span> <span class="kd">func</span> <span class="nf">greaterThanOrEqualTo</span><span class="p">(</span><span class="n">_</span> <span class="nv">value</span><span class="p">:</span> <span class="kt">CGSize</span><span class="p">,</span> <span class="nv">file</span><span class="p">:</span> <span class="kt">StaticString</span> <span class="o">=</span> <span class="kd">#file</span><span class="p">,</span> <span class="nv">line</span><span class="p">:</span> <span class="kt">UInt</span> <span class="o">=</span> <span class="kd">#line</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Modifier</span></code></pre> </div> </div> <div class="slightly-smaller"> <a href="https://github.com/zmian/xcore.swift/blob/master/Sources/Cocoa/Components/Anchor/Anchor.swift#L535-L553">Show on GitHub</a> </div> </section> </div> </li> </ul> </div> <div class="task-group"> <div class="task-name-container"> <a name="/GreaterThanOrEqual3"></a> <a name="//apple_ref/swift/Section/GreaterThanOrEqual" class="dashAnchor"></a> <a href="#/GreaterThanOrEqual3"> <h3 class="section-name">GreaterThanOrEqual</h3> </a> </div> <ul> <li class="item"> <div> <code> <a name="/s:5Xcore6AnchorC13DimensionAxisC17lessThanOrEqualTo_4file4lineAC0D0C8ModifierCy_AC0cD4TypeO_G12CoreGraphics7CGFloatV_s12StaticStringVSutF"></a> <a name="//apple_ref/swift/Method/lessThanOrEqualTo(_:file:line:)" class="dashAnchor"></a> <a class="token" href="#/s:5Xcore6AnchorC13DimensionAxisC17lessThanOrEqualTo_4file4lineAC0D0C8ModifierCy_AC0cD4TypeO_G12CoreGraphics7CGFloatV_s12StaticStringVSutF">lessThanOrEqualTo(_:file:line:)</a> </code> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Undocumented</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight swift"><code><span class="kd">@discardableResult</span> <span class="kd">open</span> <span class="kd">func</span> <span class="nf">lessThanOrEqualTo</span><span class="p">(</span><span class="n">_</span> <span class="nv">value</span><span class="p">:</span> <span class="kt">CGFloat</span><span class="p">,</span> <span class="nv">file</span><span class="p">:</span> <span class="kt">StaticString</span> <span class="o">=</span> <span class="kd">#file</span><span class="p">,</span> <span class="nv">line</span><span class="p">:</span> <span class="kt">UInt</span> <span class="o">=</span> <span class="kd">#line</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Modifier</span></code></pre> </div> </div> <div class="slightly-smaller"> <a href="https://github.com/zmian/xcore.swift/blob/master/Sources/Cocoa/Components/Anchor/Anchor.swift#L558-L560">Show on GitHub</a> </div> </section> </div> </li> <li class="item"> <div> <code> <a name="/s:5Xcore6AnchorC13DimensionAxisC17lessThanOrEqualTo_4file4lineAC0D0C8ModifierCy_AC0cD4TypeO_GSo6CGSizeV_s12StaticStringVSutF"></a> <a name="//apple_ref/swift/Method/lessThanOrEqualTo(_:file:line:)" class="dashAnchor"></a> <a class="token" href="#/s:5Xcore6AnchorC13DimensionAxisC17lessThanOrEqualTo_4file4lineAC0D0C8ModifierCy_AC0cD4TypeO_GSo6CGSizeV_s12StaticStringVSutF">lessThanOrEqualTo(_:file:line:)</a> </code> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Undocumented</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight swift"><code><span class="kd">@discardableResult</span> <span class="kd">open</span> <span class="kd">func</span> <span class="nf">lessThanOrEqualTo</span><span class="p">(</span><span class="n">_</span> <span class="nv">value</span><span class="p">:</span> <span class="kt">CGSize</span><span class="p">,</span> <span class="nv">file</span><span class="p">:</span> <span class="kt">StaticString</span> <span class="o">=</span> <span class="kd">#file</span><span class="p">,</span> <span class="nv">line</span><span class="p">:</span> <span class="kt">UInt</span> <span class="o">=</span> <span class="kd">#line</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Modifier</span></code></pre> </div> </div> <div class="slightly-smaller"> <a href="https://github.com/zmian/xcore.swift/blob/master/Sources/Cocoa/Components/Anchor/Anchor.swift#L563-L581">Show on GitHub</a> </div> </section> </div> </li> </ul> </div> </section> </section> <section id="footer"> <p>&copy; 2019 <a class="link" href="https://zmian.me" target="_blank" rel="external">Zeeshan</a>. All rights reserved. (Last updated: 2019-11-28)</p> <p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.12.0</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p> </section> </article> </div> </body> </div> </html>
{ "content_hash": "9a85c5f4f7d1b8af3695a03f2be7d97b", "timestamp": "", "source": "github", "line_count": 1583, "max_line_length": 665, "avg_line_length": 52.25521162349968, "alnum_prop": 0.4990570599613153, "repo_name": "zmian/xcore.swift", "id": "d410997e849b99597d3cd9c30ee8c650c0e37380", "size": "82889", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "docs/Classes/Anchor/DimensionAxis.html", "mode": "33188", "license": "mit", "language": [ { "name": "Objective-C", "bytes": "209" }, { "name": "Ruby", "bytes": "2280" }, { "name": "Shell", "bytes": "538" }, { "name": "Swift", "bytes": "1250941" } ], "symlink_target": "" }
package com.nec.harvest.repository; import com.nec.crud.CrudRepository; import com.nec.harvest.model.Division; /** * Division repository that can be used to created, removed, updated..etc * based on Inventory type. * * @author huonghv * */ public interface DivisionRepository extends CrudRepository<Division, String> { }
{ "content_hash": "dd78630a0fc723f562143a8a69523bbb", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 78, "avg_line_length": 20.75, "alnum_prop": 0.7530120481927711, "repo_name": "dangokuson/Harvest-JP", "id": "9a61946067a49813164f17d6954c13944fa50ae5", "size": "593", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "harvest/src/main/java/com/nec/harvest/repository/DivisionRepository.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "159496" }, { "name": "Java", "bytes": "1270842" }, { "name": "JavaScript", "bytes": "452672" } ], "symlink_target": "" }
import os import shutil import crayons from subprocess import check_call, check_output from .adb import commands BASEDIR = os.path.expanduser('~/.andy') def root_device(device=None): commands.wait_for_device(device) check_call(commands.adb(device) + 'root', universal_newlines=True, shell=True) check_call(commands.adb(device) + 'remount', universal_newlines=True, shell=True) commands.push(os.path.join(BASEDIR, 'binaries/su/x86/su.pie'), '/system/xbin/su', device) check_call(commands.adb(device) + 'shell chmod 0755 /system/xbin/su', universal_newlines=True, shell=True) check_call(commands.adb(device) + 'shell su --install', universal_newlines=True, shell=True) check_call(commands.adb(device) + 'shell su --daemon&', universal_newlines=True, shell=True) check_call(commands.adb(device) + 'shell setenforce 0', universal_newlines=True, shell=True) commands.reboot(device) def install_xposed(device=None): print(crayons.white('Installing Xposed framework', bold=True)) installer = { 19: 'xposed.installer_v33_36570c.apk' } api = int(commands.get_prop('ro.build.version.sdk', device)) commands.install(os.path.join(BASEDIR,'framework/xposed/installer/%s' % installer.get(api, 'xposed.installer_3.1.2.apk')), device) if api > 19: xposed_dir = 'xposed-v88-sdk%s-x86' % api commands.push(os.path.join(BASEDIR, 'framework/xposed/sdk/%s' % xposed_dir), '/data/local/tmp/', device) check_call(commands.adb(device) + 'shell chmod 0755 /data/local/tmp/%s/flash-script.sh' % xposed_dir, shell=True) check_call(commands.adb(device) + 'shell "cd /data/local/tmp/%s/ && ./flash-script.sh"' % xposed_dir, shell=True) def install_busybox(device=None): print(crayons.white('Installing Busybox', bold=True)) commands.push(os.path.join(BASEDIR, 'binaries/busybox/x86/busybox'), '/system/xbin/', device) check_call(commands.adb(device) + 'shell chmod 0755 /system/xbin/busybox', shell=True) check_call(commands.adb(device) + 'shell "cd /system/xbin/ && busybox --install /system/xbin/"', shell=True) def install_frida(device=None): print(crayons.white('Installing Frida', bold=True)) commands.push(os.path.join(BASEDIR, 'binaries/frida/x86/frida-server'), '/data/local/tmp/', device) check_call(commands.adb(device) + 'shell chmod 0755 /data/local/tmp/frida-server', shell=True) def install_apps(device=None): print(crayons.white('Installing apps', bold=True)) for (dirpath, dirnames, filenames) in os.walk(BASEDIR): folder = os.path.basename(dirpath) if folder in ['apps', 'hooks']: for f in filenames: print(crayons.white('Installing %s' % crayons.white(f, bold=True), bold=True)) commands.install(os.path.join(dirpath,f), device) def bootstrap(device=None): commands.wait_for_device(device) install_busybox(device) install_frida(device) install_apps(device) install_xposed(device) print(crayons.white('All done!', bold=True)) def start_frida(device=None): check_call(commands.adb(device) + 'shell ./data/local/tmp/frida-server -D', shell=True) def stop_frida(device=None): check_call(commands.adb(device) + 'shell pkill frida-server', shell=True)
{ "content_hash": "d6497326e4ebfe9be0a90808ab16998b", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 134, "avg_line_length": 44.93150684931507, "alnum_prop": 0.6932926829268292, "repo_name": "evmxattr/avd-root", "id": "f2ca4119d2a2628a9602d5ce86b8b18de12d6448", "size": "3280", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "cli/root.py", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "18290" } ], "symlink_target": "" }
import Route from '@ember/routing/route'; import { hash } from 'rsvp'; import { inject as service } from '@ember/service'; export default Route.extend({ globalStore: service(), model() { const { globalStore: gs } = this; return hash({ clusterTemplates: gs.findAll('clustertemplate'), clusterTemplateRevisions: gs.findAll('clustertemplaterevision'), }); } });
{ "content_hash": "5ddfb415e3a9660c435bfcaf882df818", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 70, "avg_line_length": 25.5, "alnum_prop": 0.6421568627450981, "repo_name": "lvuch/ui", "id": "4d3631305f6cd0020114ffcfff40498fb10278d7", "size": "408", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/global-admin/addon/cluster-templates/route.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "174666" }, { "name": "Dockerfile", "bytes": "196" }, { "name": "HTML", "bytes": "1415278" }, { "name": "JavaScript", "bytes": "2335968" }, { "name": "Shell", "bytes": "10901" } ], "symlink_target": "" }
ACCEPTED #### According to Index Fungorum #### Published in Annls mycol. 37(4/5): 410 (1939) #### Original name Septoria paspali Syd. ### Remarks null
{ "content_hash": "4d7cae99a9d19c2d0cca596a0ce61739", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 32, "avg_line_length": 11.846153846153847, "alnum_prop": 0.6818181818181818, "repo_name": "mdoering/backbone", "id": "5cdc00c305bc22d8a92b98632cedfeccd35f6a74", "size": "199", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Fungi/Ascomycota/Dothideomycetes/Capnodiales/Mycosphaerellaceae/Septoria/Septoria paspali/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
package com.sequenceiq.datalake.service.sdx; import java.io.IOException; import java.util.Collections; import java.util.List; import java.util.Optional; import java.util.concurrent.atomic.AtomicInteger; import javax.inject.Inject; import javax.ws.rs.NotFoundException; import javax.ws.rs.ProcessingException; import javax.ws.rs.WebApplicationException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; import com.dyngr.Polling; import com.dyngr.core.AttemptResult; import com.dyngr.core.AttemptResults; import com.sequenceiq.cloudbreak.api.endpoint.v4.common.Status; import com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.StackV4Endpoint; import com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.StackV4Request; import com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackV4Response; import com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.cluster.ClusterV4Response; import com.sequenceiq.cloudbreak.api.model.StatusKind; import com.sequenceiq.cloudbreak.auth.ThreadBasedUserCrnProvider; import com.sequenceiq.cloudbreak.auth.crn.RegionAwareInternalCrnGeneratorFactory; import com.sequenceiq.cloudbreak.common.exception.WebApplicationExceptionMessageExtractor; import com.sequenceiq.cloudbreak.common.json.JsonUtil; import com.sequenceiq.datalake.entity.DatalakeStatusEnum; import com.sequenceiq.datalake.entity.SdxCluster; import com.sequenceiq.datalake.repository.SdxClusterRepository; import com.sequenceiq.datalake.service.sdx.flowcheck.CloudbreakFlowService; import com.sequenceiq.datalake.service.sdx.status.SdxStatusService; import com.sequenceiq.environment.api.v1.environment.model.response.DetailedEnvironmentResponse; @Service public class ProvisionerService { public static final int DELETE_FAILED_RETRY_COUNT = 3; private static final Logger LOGGER = LoggerFactory.getLogger(ProvisionerService.class); @Inject private SdxClusterRepository sdxClusterRepository; @Inject private SdxService sdxService; @Inject private SdxStatusService sdxStatusService; @Inject private StackRequestManifester stackRequestManifester; @Inject private StackV4Endpoint stackV4Endpoint; @Inject private CloudbreakFlowService cloudbreakFlowService; @Inject private WebApplicationExceptionMessageExtractor webApplicationExceptionMessageExtractor; @Inject private CloudbreakPoller cloudbreakPoller; @Inject private RegionAwareInternalCrnGeneratorFactory regionAwareInternalCrnGeneratorFactory; private AttemptResult<StackV4Response> sdxCreationFailed(String statusReason) { String errorMessage = "Data Lake creation failed: " + statusReason; LOGGER.error(errorMessage); return AttemptResults.breakFor(errorMessage); } public void startStackDeletion(Long id, boolean forced) { SdxCluster sdxCluster = sdxService.getById(id); try { String initiatorUserCrn = ThreadBasedUserCrnProvider.getUserCrn(); ThreadBasedUserCrnProvider.doAsInternalActor( regionAwareInternalCrnGeneratorFactory.iam().getInternalCrnForServiceAsString(), () -> stackV4Endpoint.deleteInternal(0L, sdxCluster.getClusterName(), forced, initiatorUserCrn)); sdxStatusService.setStatusForDatalakeAndNotify( DatalakeStatusEnum.STACK_DELETION_IN_PROGRESS, List.of(sdxCluster.getClusterName()), "Datalake stack deletion in progress", sdxCluster ); } catch (NotFoundException e) { LOGGER.info("Cannot find stack on cloudbreak side {}", sdxCluster.getClusterName()); } catch (WebApplicationException e) { String errorMessage = webApplicationExceptionMessageExtractor.getErrorMessage(e); LOGGER.info("Cannot delete stack {} from cloudbreak: {}", sdxCluster.getStackId(), errorMessage, e); throw new RuntimeException("Cannot delete cluster, error happened during the operation: " + errorMessage); } catch (ProcessingException e) { LOGGER.info("Cannot delete stack {} from cloudbreak: {}", sdxCluster.getStackId(), e); throw new RuntimeException("Cannot delete cluster, error happened during the operation: " + e.getMessage()); } } public void waitCloudbreakClusterDeletion(Long id, PollingConfig pollingConfig) { SdxCluster sdxCluster = sdxService.getById(id); AtomicInteger deleteFailedCount = new AtomicInteger(1); Polling.waitPeriodly(pollingConfig.getSleepTime(), pollingConfig.getSleepTimeUnit()) .stopIfException(pollingConfig.getStopPollingIfExceptionOccurred()) .stopAfterDelay(pollingConfig.getDuration(), pollingConfig.getDurationTimeUnit()) .run(() -> { LOGGER.info("Deletion polling cloudbreak for stack status: '{}' in '{}' env", sdxCluster.getClusterName(), sdxCluster.getEnvName()); try { StackV4Response stackV4Response = ThreadBasedUserCrnProvider.doAsInternalActor( regionAwareInternalCrnGeneratorFactory.iam().getInternalCrnForServiceAsString(), () -> stackV4Endpoint .get(0L, sdxCluster.getClusterName(), Collections.emptySet(), sdxCluster.getAccountId())); LOGGER.info("Stack status of SDX {} by response from cloudbreak: {}", sdxCluster.getClusterName(), stackV4Response.getStatus().name()); LOGGER.debug("Response from cloudbreak: {}", JsonUtil.writeValueAsString(stackV4Response)); ClusterV4Response cluster = stackV4Response.getCluster(); if (cluster != null) { if (StatusKind.PROGRESS.equals(cluster.getStatus().getStatusKind())) { return AttemptResults.justContinue(); } if (Status.DELETE_FAILED.equals(cluster.getStatus())) { // it's a hack, until we implement a nice non-async terminate which can return with flowid.. // if it is implemented, please remove this if (deleteFailedCount.getAndIncrement() >= DELETE_FAILED_RETRY_COUNT) { LOGGER.error("Cluster deletion failed '" + sdxCluster.getClusterName() + "', " + stackV4Response.getCluster().getStatusReason()); return AttemptResults.breakFor( "Data Lake deletion failed '" + sdxCluster.getClusterName() + "', " + stackV4Response.getCluster().getStatusReason() ); } else { return AttemptResults.justContinue(); } } } if (Status.DELETE_FAILED.equals(stackV4Response.getStatus())) { // it's a hack, until we implement a nice non-async terminate which can return with flowid.. // if it is implemented, please remove this if (deleteFailedCount.getAndIncrement() >= DELETE_FAILED_RETRY_COUNT) { LOGGER.error("Stack deletion failed '" + sdxCluster.getClusterName() + "', " + stackV4Response.getStatusReason()); return AttemptResults.breakFor( "Data Lake deletion failed '" + sdxCluster.getClusterName() + "', " + stackV4Response.getStatusReason() ); } else { return AttemptResults.justContinue(); } } else { return AttemptResults.justContinue(); } } catch (NotFoundException e) { return AttemptResults.finishWith(null); } }); sdxStatusService.setStatusForDatalakeAndNotify(DatalakeStatusEnum.STACK_DELETED, "Datalake stack deleted", sdxCluster); } public void startStackProvisioning(Long id, DetailedEnvironmentResponse environment) { SdxCluster sdxCluster = sdxService.getById(id); LOGGER.info("Call cloudbreak with stackrequest"); try { stackRequestManifester.configureStackForSdxCluster(sdxCluster, environment); StackV4Request stackV4Request = JsonUtil.readValue(sdxCluster.getStackRequestToCloudbreak(), StackV4Request.class); Optional.ofNullable(sdxCluster.getDatabaseCrn()).ifPresent(crn -> { stackV4Request.getCluster().setDatabaseServerCrn(crn); sdxCluster.setStackRequestToCloudbreak(JsonUtil.writeValueAsStringSilent(stackV4Request)); }); StackV4Response stackV4Response; try { stackV4Response = ThreadBasedUserCrnProvider.doAsInternalActor( regionAwareInternalCrnGeneratorFactory.iam().getInternalCrnForServiceAsString(), () -> stackV4Endpoint.getByCrn(0L, sdxCluster.getCrn(), null)); } catch (NotFoundException e) { LOGGER.info("Stack does not exist on cloudbreak side, POST new cluster: {}", sdxCluster.getClusterName(), e); String initiatorUserCrn = ThreadBasedUserCrnProvider.getUserCrn(); stackV4Response = ThreadBasedUserCrnProvider.doAsInternalActor( regionAwareInternalCrnGeneratorFactory.iam().getInternalCrnForServiceAsString(), () -> stackV4Endpoint.postInternal(0L, stackV4Request, initiatorUserCrn)); } sdxCluster.setStackId(stackV4Response.getId()); sdxCluster.setStackCrn(stackV4Response.getCrn()); sdxClusterRepository.save(sdxCluster); cloudbreakFlowService.saveLastCloudbreakFlowChainId(sdxCluster, stackV4Response.getFlowIdentifier()); LOGGER.info("Sdx cluster updated"); } catch (WebApplicationException e) { String errorMessage = webApplicationExceptionMessageExtractor.getErrorMessage(e); LOGGER.info("Cannot start provisioning: {}", errorMessage, e); throw new RuntimeException("Cannot start provisioning, error happened during the operation: " + errorMessage); } catch (IOException e) { LOGGER.info("Cannot parse stackrequest to json", e); throw new RuntimeException("Cannot write stackrequest to json: " + e.getMessage()); } } public StackV4Response waitCloudbreakClusterCreation(Long id, PollingConfig pollingConfig) { SdxCluster sdxCluster = sdxService.getById(id); sdxStatusService.setStatusForDatalakeAndNotify(DatalakeStatusEnum.STACK_CREATION_IN_PROGRESS, "Datalake stack creation in progress", sdxCluster); cloudbreakPoller.pollCreateUntilAvailable(sdxCluster, pollingConfig); sdxStatusService.setStatusForDatalakeAndNotify(DatalakeStatusEnum.STACK_CREATION_FINISHED, "Stack created for Datalake", sdxCluster); return ThreadBasedUserCrnProvider.doAsInternalActor( regionAwareInternalCrnGeneratorFactory.iam().getInternalCrnForServiceAsString(), () -> stackV4Endpoint.get(0L, sdxCluster.getClusterName(), Collections.emptySet(), sdxCluster.getAccountId())); } }
{ "content_hash": "3cf7cf69561e4a94547e920f84a1254e", "timestamp": "", "source": "github", "line_count": 208, "max_line_length": 153, "avg_line_length": 57.12980769230769, "alnum_prop": 0.652192207355045, "repo_name": "hortonworks/cloudbreak", "id": "4154a3c0ebcdefd6b36e7ae68e60212e6a0b5c4b", "size": "11883", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "datalake/src/main/java/com/sequenceiq/datalake/service/sdx/ProvisionerService.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "7535" }, { "name": "Dockerfile", "bytes": "9586" }, { "name": "Fluent", "bytes": "10" }, { "name": "FreeMarker", "bytes": "395982" }, { "name": "Groovy", "bytes": "523" }, { "name": "HTML", "bytes": "9917" }, { "name": "Java", "bytes": "55250904" }, { "name": "JavaScript", "bytes": "47923" }, { "name": "Jinja", "bytes": "190660" }, { "name": "Makefile", "bytes": "8537" }, { "name": "PLpgSQL", "bytes": "1830" }, { "name": "Perl", "bytes": "17726" }, { "name": "Python", "bytes": "29898" }, { "name": "SaltStack", "bytes": "222692" }, { "name": "Scala", "bytes": "11168" }, { "name": "Shell", "bytes": "416225" } ], "symlink_target": "" }
namespace DataWings.SqlVersions.PowerShell { using DataWings.SqlVersions; using System; using System.Management.Automation; using System.Runtime.CompilerServices; [Cmdlet("Create", "Database")] public class CreateDatabaseCmdlet : Cmdlet { [CompilerGenerated] private string _databaseName; [CompilerGenerated] private string _workArea; protected override void BeginProcessing() { string str; try { Creator creator; if (this.WorkArea == null) { creator = new Creator(this.DatabaseName); } else { creator = new Creator(this.DatabaseName, this.WorkArea); } str = creator.CreateDatabaseScript(); } catch (Exception exception) { this.ReportException(exception); throw; } base.WriteObject(str); } private void ReportException(Exception e) { } [Parameter] public string DatabaseName { [CompilerGenerated] get { return this._databaseName; } [CompilerGenerated] set { this._databaseName = value; } } [Parameter] public string WorkArea { [CompilerGenerated] get { return this._workArea; } [CompilerGenerated] set { this._workArea = value; } } } }
{ "content_hash": "6c435d1ff0f31300423181a4167a9b5a", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 76, "avg_line_length": 23.6, "alnum_prop": 0.4514124293785311, "repo_name": "sheitm/DataWings", "id": "12073d562d37df87c0f65d1f5eb162adfc360f19", "size": "1770", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "DataWings.SqlVersions.PowerShell/CreateDatabaseCmdlet.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "220308" } ], "symlink_target": "" }
package edu.clemson.cs.r2jt.rewriteprover.proofsteps; import edu.clemson.cs.r2jt.rewriteprover.applications.Application; import edu.clemson.cs.r2jt.rewriteprover.model.LocalTheorem; import edu.clemson.cs.r2jt.rewriteprover.model.PerVCProverModel; import edu.clemson.cs.r2jt.rewriteprover.model.Site; import edu.clemson.cs.r2jt.rewriteprover.transformations.Transformation; import java.util.Collection; /** * * @author hamptos */ public class RemoveAntecedentStep extends AbstractProofStep { private final LocalTheorem myOriginalTheorem; private final int myOriginalIndex; public RemoveAntecedentStep(LocalTheorem originalTheorem, int originalIndex, Transformation t, Application a, Collection<Site> boundSites) { super(t, a, boundSites); myOriginalIndex = originalIndex; myOriginalTheorem = originalTheorem; } @Override public void undo(PerVCProverModel m) { m.insertConjunct(myOriginalTheorem, myOriginalIndex); } @Override public String toString() { return "Remove " + myOriginalTheorem.getAssertion(); } }
{ "content_hash": "f39c6a426839368878c61131b5d53d0f", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 72, "avg_line_length": 29.57894736842105, "alnum_prop": 0.7428825622775801, "repo_name": "mikekab/RESOLVE", "id": "56d022c1471d07a9fbac1432276e33df838088b2", "size": "1489", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/edu/clemson/cs/r2jt/rewriteprover/proofsteps/RemoveAntecedentStep.java", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ANTLR", "bytes": "29770" }, { "name": "GAP", "bytes": "184313" }, { "name": "Java", "bytes": "5048680" }, { "name": "Shell", "bytes": "3097" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using System.Linq; using proconappWrapper.DataObjects; using proconappWrapper.Models; namespace proconappService.Models { public class GameModels { #region Member private static log4net.ILog logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); enum GameStatus { COMPLETE = 0, INCOMPLETE = 1 }; public enum NotificationFilter { all, only_for_notification }; public class GameResult { public int count { get; set; } public NotificationFilter filter { get; set; } public GameResult() { this.count = 3; this.filter = NotificationFilter.all; } } public class GetPhoto { public int count { get; set; } } public class TransmitGameResults { public int id { get; set; } public string title { get; set; } public int status { get; set; } public IEnumerable<PlayerResults> result { get; set; } public long started_at { get; set; } public long finished_at { get; set; } public int[] ads { get; set; } public class PlayerResults { public TransmitGameResults.Player player { get; set; } public int score { get; set; } public int[] scores { get; set; } public bool advance { get; set; } public int rank { get; set; } } public class Player { public int id { get; set; } public string name { get; set; } public string short_name { get; set; } } } public class TransmitPhotos { public int id { get; set; } public string title { get; set; } public string original_url { get; set; } public string thumbnail_url { get; set; } public long created_at { get; set; } } #endregion public static IEnumerable<GameModels.TransmitGameResults> getGameResult(GameResult model, User user) { var db = new proconappContext(); if (model.filter == NotificationFilter.all || string.IsNullOrEmpty(user.tag)) { var dbResult = db.Game .OrderByDescending(or => or.sd) .Take(model.count); var result = getGameResult(dbResult.ToList()); return result; } else { var only4Notification = getOnly4Notification(db.Game.ToList(), user.tag.Split(',')) .OrderByDescending(or => or.sd) .Take(model.count); var result = getGameResult(only4Notification.ToList()); return result; } } public static IEnumerable<GameModels.TransmitPhotos> getPhoto(GetPhoto model) { var db = new proconappContext(); var dbResult = db.Photo .OrderByDescending(or => or.created_at) .OrderByDescending(or => or._id) .Take(model.count); var result = convertPhoto(dbResult.ToList()); return result; } #region Helper private static IEnumerable<GameModels.TransmitGameResults> getGameResult(IEnumerable<Game> games) { foreach (var item in games) { var ads = convertAds(item.ads); yield return new GameModels.TransmitGameResults() { id = item._id, title = item.gn, status = item.st, started_at = item.sd, finished_at = item.ed, ads = ads.ToArray(), result = convertPlayerResult(item.gamePlayer, ads) }; } } private static IEnumerable<int> convertAds(string ads) { if (ads == null) { yield return -1; yield break; } var array = ads.Split(','); foreach (var score in array) { int adsnum = -1; var isSuccess = Int32.TryParse(score.ToString(), out adsnum); if (!isSuccess && adsnum < 0) { yield return -1; } else { yield return adsnum; } } } private static IEnumerable<Game> getOnly4Notification(IEnumerable<Game> games, string[] ids) { foreach (var game in games) { foreach (var gamePlayer in game.gamePlayer) { if(ids.Contains(gamePlayer.pi.ToString())) { yield return game; break; } } } } private static IEnumerable<GameModels.TransmitGameResults.PlayerResults> convertPlayerResult(IEnumerable<GamePlayer> gamePlayer, IEnumerable<int> ads) { var db = new proconappContext(); foreach (var item in gamePlayer) { var advance = ads.Contains(item.pi); var dbplayer = db.Player.FirstOrDefault(pl => pl._id == item.pi); var scores = convertScores(item.scs); yield return new GameModels.TransmitGameResults.PlayerResults() { player = dbplayer != null ? new TransmitGameResults.Player() { id = dbplayer._id, name = dbplayer.name, short_name = dbplayer.short_name } : new TransmitGameResults.Player() { id = item.pi, name = "(無名)", short_name = "(無名)" }, score = scores.DefaultIfEmpty(-1).LastOrDefault(), scores = scores.ToArray(), advance = advance, rank = item.rk }; } } private static IEnumerable<int> convertScores(string scs) { if (scs == null) { yield return -1; yield break; } var array = scs.Split(','); foreach (var score in array) { int scorenum = -1; var isSuccess = Int32.TryParse(score.ToString(), out scorenum); if (!isSuccess && scorenum < 0) { yield return -1; } else { yield return scorenum; } } } private static IEnumerable<GameModels.TransmitPhotos> convertPhoto(IEnumerable<proconappWrapper.DataObjects.Photo> photos) { foreach (var item in photos) { yield return new GameModels.TransmitPhotos { id = item._id, title = item.title, created_at = UnixTime.ToUnixTime(item.created_at), original_url = item.original_url, thumbnail_url = item.thumbnail_url }; } } #endregion } }
{ "content_hash": "bd25e5130e817325fd6af688d73b7eaa", "timestamp": "", "source": "github", "line_count": 226, "max_line_length": 158, "avg_line_length": 34.64159292035398, "alnum_prop": 0.46161706475922853, "repo_name": "saga-dash/proconapp-server", "id": "afc44fc18beacd488b6d07824554763db3fe5942", "size": "7839", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "proconappService/Models/GameModels.cs", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ASP", "bytes": "215" }, { "name": "C#", "bytes": "214619" }, { "name": "CSS", "bytes": "1925" }, { "name": "HTML", "bytes": "5663" }, { "name": "JavaScript", "bytes": "11280" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content="这里是喵呜实验室提供的维基百科。"> <meta name="author" content="Songyimiao"> <link rel="shortcut icon" href="/img/icon/miaowlabs.ico"> <title>喵呜百科</title> <!-- Bootstrap core CSS --> <link href="/css/bootstrap.css" rel="stylesheet"> <!-- Custom styles for this template --> <link href="/css/docs.css" rel="stylesheet"> <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet"> <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="../../assets/js/html5shiv.js"></script> <script src="../../assets/js/respond.min.js"></script> <![endif]--> </head> <!-- NAVBAR ================================================== --> <body> <a class="sr-only" href="#content">Skip to main content</a> <!-- Docs master nav --> <header class="navbar navbar-inverse navbar-static-top" id="top" role="banner"> <div class="container"> <div class="navbar-header"> <button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".bs-navbar-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a href="/wiki.html" class="navbar-brand">喵呜百科</a> </div> <nav class="collapse navbar-collapse bs-navbar-collapse" role="navigation"> <ul class="nav navbar-nav"> <li> <a href="/wiki/Mwbalanced.html">两轮自平衡小车Mwbalanced</a> </li> <li> <a href="/wiki/Littlebuzz.html">微型四轴飞行器Littlebuzz</a> </li> </ul> <ul class="nav navbar-nav navbar-right"> <li><a href="/index.html" >返回喵呜实验室</a></li> </ul> </nav> </div> </header> <div class="wiki container"> <div class="row"> <div class="col-md-9" role="main"> {{ content }} </div> <div class="col-md-3" role="complementary"> <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm"> <ul class="sidebar-container nav bs-docs-sidenav"> <!----添加side nav的内容,由js生成----> </ul> <ul class="nav bs-docs-sidenav"> <li><a href="/wiki.html">返回</a></li> <li><a class="scrolltop">回到顶部</a></li> </ul> </nav> </div> </div> </div> <div class="container" id="cc"> <p> <a rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/deed.zh_TW"><img alt="知识共享许可协议" style="border-width:0" src="https://licensebuttons.net/l/by-nc-sa/4.0/80x15.png" /></a> 全部内容以 <a rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/deed.zh_TW">Creative Commons 署名-非商业性使用 4.0 国际 (CC BY-NC 4.0) 协议发布</a>.</p> </div> <div class="container text-right"> <a href="/wiki.html" class="btn btn-primary" role="button">返回</a> <a class="scrolltop btn btn-default" role="button">回到顶部</a> </div> <!-- FOOTER --> <footer class="bs-docs-footer" role="contentinfo"> <p class="text-muted">&copy; 20{{ site.time | date: '%y' }} {{ site.copyright }} All rights reserved. </p> </footer> <!-- 多说评论框 start --> <div class="ds-thread" </div> <!-- 多说评论框 end --> <!-- 多说公共JS代码 start (一个网页只需插入一次) --> <script type="text/javascript"> var duoshuoQuery = {short_name:"miaowlabs"}; (function() { var ds = document.createElement('script'); ds.type = 'text/javascript';ds.async = true; ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js'; ds.charset = 'UTF-8'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ds); })(); </script> <!-- 多说公共JS代码 end --> <!-- GoogleAnalytics --> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-70335512-1', 'auto'); ga('send', 'pageview'); </script> <!-- Bootstrap core JavaScript ================================================== --> <!-- Placed at the end of the document so the pages load faster --> <script src="http://cdn.bootcss.com/jquery/1.10.2/jquery.min.js"></script> <script src="/js/bootstrap.min.js"></script> <script src="/js/doc.js"></script> <!-- fancybox plugin js --> <script type="text/javascript" src="/fancybox/jquery.fancybox.pack.js?v=2.1.5"></script> <script type="text/javascript" src="/fancybox/helpers/jquery.fancybox-buttons.js?v=1.0.5"></script> <script type="text/javascript" src="/fancybox/helpers/jquery.fancybox-media.js?v=1.0.6"></script> <script type="text/javascript" src="/fancybox/helpers/jquery.fancybox-thumbs.js?v=1.0.7"></script> </body> </html>
{ "content_hash": "cd0745b6409514b5915b321459ca5479", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 193, "avg_line_length": 37.48550724637681, "alnum_prop": 0.5930794509955538, "repo_name": "MiaowLabs/miaowlabs.github.io", "id": "c22bd46adaf51c861117b662993728cd70c0cde2", "size": "5423", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "_layouts/wiki.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "97767" }, { "name": "HTML", "bytes": "1410876" }, { "name": "JavaScript", "bytes": "74902" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>abp: Not compatible</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.7.1 / abp - 8.6.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> abp <small> 8.6.0 <span class="label label-info">Not compatible</span> </small> </h1> <p><em><script>document.write(moment("2020-02-19 06:39:30 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2020-02-19 06:39:30 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base camlp5 7.11 Preprocessor-pretty-printer of OCaml conf-findutils 1 Virtual package relying on findutils conf-m4 1 Virtual package relying on m4 coq 8.7.1 Formal proof management system. num 1.3 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.09.0 The OCaml compiler (virtual package) ocaml-base-compiler 4.09.0 Official release 4.09.0 ocaml-config 1 OCaml Switch Configuration ocamlfind 1.8.1 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;Hugo.Herbelin@inria.fr&quot; homepage: &quot;https://github.com/coq-contribs/abp&quot; license: &quot;LGPL 2.1&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/ABP&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.6&quot; &amp; &lt; &quot;8.7~&quot;} ] tags: [ &quot;keyword: alternating bit protocol&quot; &quot;keyword: process calculi&quot; &quot;keyword: reactive systems&quot; &quot;keyword: co-inductive types&quot; &quot;keyword: co-induction&quot; &quot;category: Computer Science/Concurrent Systems and Protocols/Correctness of specific protocols&quot; ] authors: [ &quot;Eduardo Giménez&quot; ] bug-reports: &quot;https://github.com/coq-contribs/abp/issues&quot; dev-repo: &quot;git+https://github.com/coq-contribs/abp.git&quot; synopsis: &quot;A verification of the alternating bit protocol expressed in CBS&quot; flags: light-uninstall url { src: &quot;https://github.com/coq-contribs/abp/archive/v8.6.0.tar.gz&quot; checksum: &quot;md5=8cf5c60e71404a027f66f1e38d357e64&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-abp.8.6.0 coq.8.7.1</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.7.1). The following dependencies couldn&#39;t be met: - coq-abp -&gt; coq &lt; 8.7~ -&gt; ocaml &lt; 4.06.0 base of this switch (use `--unlock-base&#39; to force) No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-abp.8.6.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> <small>Sources are on <a href="https://github.com/coq-bench">GitHub</a>. © Guillaume Claret.</small> </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
{ "content_hash": "e7c6974365987f443c9e07f82e81ee7a", "timestamp": "", "source": "github", "line_count": 161, "max_line_length": 310, "avg_line_length": 42.19875776397515, "alnum_prop": 0.5373859287606711, "repo_name": "coq-bench/coq-bench.github.io", "id": "7b7deba5e8fe0b70d241b393b052fa78dfc50cbc", "size": "6797", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.09.0-2.0.5/released/8.7.1/abp/8.6.0.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
@implementation NSData (SHA1Digest) +(NSData *)SHA1Digest:(NSData *)input { unsigned char result[CC_SHA1_DIGEST_LENGTH]; if (CC_SHA1(input.bytes, (CC_LONG)input.length, result)) { return [[NSData alloc] initWithBytes:result length:CC_SHA1_DIGEST_LENGTH]; } else { return nil; } } -(NSData *)SHA1Digest { return [NSData SHA1Digest:self]; } +(NSString *)SHA1HexDigest:(NSData *)input { unsigned char result[CC_SHA1_DIGEST_LENGTH]; if (CC_SHA1(input.bytes, (CC_LONG)input.length, result)) { NSMutableString *ret = [NSMutableString stringWithCapacity:CC_SHA1_DIGEST_LENGTH*2]; for (int i = 0; i<CC_SHA1_DIGEST_LENGTH; i++) { [ret appendFormat:@"%02x",result[i]]; } return ret; } else { return nil; } } -(NSString *)SHA1HexDigest { return [NSData SHA1HexDigest:self]; } @end
{ "content_hash": "b413726ac5b00413e8944550511aac5d", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 92, "avg_line_length": 25.514285714285716, "alnum_prop": 0.6226203807390818, "repo_name": "siuying/PlayHKTV", "id": "e667a364a409b207e74da99435c4164c17f3dc8a", "size": "1118", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "Pods/IGDigest/IGDigest/Digest/NSData+SHA1Digest.m", "mode": "33188", "license": "mit", "language": [ { "name": "Objective-C", "bytes": "12331" }, { "name": "Ruby", "bytes": "104" } ], "symlink_target": "" }
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Index &#8212; My sample book</title> <link href="_static/css/theme.css" rel="stylesheet" /> <link href="_static/css/index.c5995385ac14fb8791e8eb36b4908be2.css" rel="stylesheet" /> <link rel="stylesheet" href="_static/vendor/fontawesome/5.13.0/css/all.min.css"> <link rel="preload" as="font" type="font/woff2" crossorigin href="_static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.woff2"> <link rel="preload" as="font" type="font/woff2" crossorigin href="_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.woff2"> <link rel="stylesheet" type="text/css" href="_static/pygments.css" /> <link rel="stylesheet" type="text/css" href="_static/sphinx-book-theme.css?digest=c3fdc42140077d1ad13ad2f1588a4309" /> <link rel="stylesheet" type="text/css" href="_static/togglebutton.css" /> <link rel="stylesheet" type="text/css" href="_static/copybutton.css" /> <link rel="stylesheet" type="text/css" href="_static/mystnb.css" /> <link rel="stylesheet" type="text/css" href="_static/sphinx-thebe.css" /> <link rel="stylesheet" type="text/css" href="_static/panels-main.c949a650a448cc0ae9fd3441c0e17fb0.css" /> <link rel="stylesheet" type="text/css" href="_static/panels-variables.06eb56fa6e07937060861dad626602ad.css" /> <link rel="preload" as="script" href="_static/js/index.1c5a1a01449ed65a7b51.js"> <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script> <script src="_static/jquery.js"></script> <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <script src="_static/togglebutton.js"></script> <script src="_static/clipboard.min.js"></script> <script src="_static/copybutton.js"></script> <script>var togglebuttonSelector = '.toggle, .admonition.dropdown, .tag_hide_input div.cell_input, .tag_hide-input div.cell_input, .tag_hide_output div.cell_output, .tag_hide-output div.cell_output, .tag_hide_cell.cell, .tag_hide-cell.cell';</script> <script src="_static/sphinx-book-theme.12a9622fbb08dcb3a2a40b2c02b83a57.js"></script> <link rel="index" title="Index" href="#" /> <link rel="search" title="Search" href="search.html" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="docsearch:language" content="en" /> </head> <body data-spy="scroll" data-target="#bd-toc-nav" data-offset="80"> <div class="container-fluid" id="banner"></div> <div class="container-xl"> <div class="row"> <div class="col-12 col-md-3 bd-sidebar site-navigation show" id="site-navigation"> <div class="navbar-brand-box"> <a class="navbar-brand text-wrap" href="index.html"> <!-- `logo` is deprecated in Sphinx 4.0, so remove this when we stop supporting 3 --> <img src="_static/logo.png" class="logo" alt="logo"> <h1 class="site-logo" id="site-title">My sample book</h1> </a> </div><form class="bd-search d-flex align-items-center" action="search.html" method="get"> <i class="icon fas fa-search"></i> <input type="search" class="form-control" name="q" id="search-input" placeholder="Search this book..." aria-label="Search this book..." autocomplete="off" > </form><nav class="bd-links" id="bd-docs-nav" aria-label="Main"> <div class="bd-toc-item active"> <ul class="nav bd-sidenav"> <li class="toctree-l1"> <a class="reference internal" href="intro.html"> Welcome to your Jupyter Book </a> </li> </ul> <ul class="nav bd-sidenav"> <li class="toctree-l1"> <a class="reference internal" href="markdown.html"> Markdown Files </a> </li> <li class="toctree-l1"> <a class="reference internal" href="notebooks.html"> Content with notebooks </a> </li> <li class="toctree-l1"> <a class="reference internal" href="content/2021-10-19%20test%20article.html"> Sample article </a> </li> <li class="toctree-l1"> <a class="reference internal" href="content/2021-10-20_thoughts_on_windows.html"> Some thoughts on Windows </a> </li> </ul> </div> </nav> <!-- To handle the deprecated key --> <div class="navbar_extra_footer"> Powered by <a href="https://jupyterbook.org">Jupyter Book</a> </div> </div> <main class="col py-md-3 pl-md-4 bd-content overflow-auto" role="main"> <div class="topbar container-xl fixed-top"> <div class="topbar-contents row"> <div class="col-12 col-md-3 bd-topbar-whitespace site-navigation show"></div> <div class="col pl-md-4 topbar-main"> <button id="navbar-toggler" class="navbar-toggler ml-0" type="button" data-toggle="collapse" data-toggle="tooltip" data-placement="bottom" data-target=".site-navigation" aria-controls="navbar-menu" aria-expanded="true" aria-label="Toggle navigation" aria-controls="site-navigation" title="Toggle navigation" data-toggle="tooltip" data-placement="left"> <i class="fas fa-bars"></i> <i class="fas fa-arrow-left"></i> <i class="fas fa-arrow-up"></i> </button> <!-- Source interaction buttons --> <div class="dropdown-buttons-trigger"> <button id="dropdown-buttons-trigger" class="btn btn-secondary topbarbtn" aria-label="Connect with source repository"><i class="fab fa-github"></i></button> <div class="dropdown-buttons sourcebuttons"> <a class="repository-button" href="https://github.com/executablebooks/jupyter-book"><button type="button" class="btn btn-secondary topbarbtn" data-toggle="tooltip" data-placement="left" title="Source repository"><i class="fab fa-github"></i>repository</button></a> <a class="issues-button" href="https://github.com/executablebooks/jupyter-book/issues/new?title=Issue%20on%20page%20%2Fgenindex.html&body=Your%20issue%20content%20here."><button type="button" class="btn btn-secondary topbarbtn" data-toggle="tooltip" data-placement="left" title="Open an issue"><i class="fas fa-lightbulb"></i>open issue</button></a> </div> </div> <!-- Full screen (wrap in <a> to have style consistency --> <a class="full-screen-button"><button type="button" class="btn btn-secondary topbarbtn" data-toggle="tooltip" data-placement="bottom" onclick="toggleFullScreen()" aria-label="Fullscreen mode" title="Fullscreen mode"><i class="fas fa-expand"></i></button></a> <!-- Launch buttons --> </div> <!-- Table of contents --> <div class="d-none d-md-block col-md-2 bd-toc show"> </div> </div> </div> <div id="main-content" class="row"> <div class="col-12 col-md-9 pl-md-3 pr-md-0"> <div> <h1 id="index">Index</h1> <div class="genindex-jumpbox"> </div> </div> <div class='prev-next-bottom'> </div> </div> </div> <footer class="footer"> <div class="container"> <p> By The Jupyter Book Community<br/> &copy; Copyright 2021.<br/> </p> </div> </footer> </main> </div> </div> <script src="_static/js/index.1c5a1a01449ed65a7b51.js"></script> </body> </html>
{ "content_hash": "7b894687f9786aedf9d9b3102edbc8a9", "timestamp": "", "source": "github", "line_count": 222, "max_line_length": 254, "avg_line_length": 34.71621621621622, "alnum_prop": 0.6182691060075256, "repo_name": "dmarx/blog", "id": "3ae11ba6b5ca755df72e7641c02a8d031f0f021c", "size": "7708", "binary": false, "copies": "1", "ref": "refs/heads/gh-pages", "path": "genindex.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "49889" }, { "name": "HTML", "bytes": "22293" }, { "name": "JavaScript", "bytes": "53186" }, { "name": "Ruby", "bytes": "2258" } ], "symlink_target": "" }
''' rauth.test_oauth ------------------ Test suite for rauth.oauth. ''' from base import RauthTestCase from rauth.oauth import (HmacSha1Signature, RsaSha1Signature, PlaintextSignature) from rauth.utils import FORM_URLENCODED # HACK: give a more informative error message if we're missing deps here try: from Crypto.PublicKey import RSA except ImportError: raise RuntimeError('PyCrypto is required to run the rauth test suite') try: stringtype = unicode # python 2 except NameError: stringtype = str # python 3 assert RSA class OAuthTestHmacSha1Case(RauthTestCase): consumer_secret = '456' access_token_secret = '654' method = 'GET' url = 'http://example.com/' oauth_params = {} req_kwargs = {'params': {'foo': 'bar'}} def test_hmacsha1_signature(self): oauth_signature = HmacSha1Signature().sign(self.consumer_secret, self.access_token_secret, self.method, self.url, self.oauth_params, self.req_kwargs) self.assertIsNotNone(oauth_signature) self.assertIsInstance(oauth_signature, stringtype) self.assertEqual(oauth_signature, 'cYzjVXCOk62KoYmJ+iCvcAcgfp8=') def test_normalize_request_parameters_params(self): # params as a dict normalized = HmacSha1Signature()\ ._normalize_request_parameters(self.oauth_params, self.req_kwargs) self.assertEqual('foo=bar', normalized) # params as a dict with URL encodable chars normalized = HmacSha1Signature()\ ._normalize_request_parameters(self.oauth_params, {'params': {'foo+bar': 'baz'}}) self.assertEqual('foo%2Bbar=baz', normalized) self.assertNotIn('+', normalized) # params and dict as dicts req_kwargs = {'params': {'a': 'b'}, 'data': {'foo': 'bar'}, 'headers': {'Content-Type': FORM_URLENCODED}} normalized = HmacSha1Signature()\ ._normalize_request_parameters({}, req_kwargs) self.assertEqual('a=b&foo=bar', normalized) def test_normalize_request_parameters_data(self): # data as a dict req_kwargs = {'data': {'foo': 'bar'}, 'headers': {'Content-Type': FORM_URLENCODED}} normalized = HmacSha1Signature()\ ._normalize_request_parameters(self.oauth_params, req_kwargs) self.assertEqual('foo=bar', normalized) # data as a dict with URL encodable chars req_kwargs = {'data': {'foo+bar': 'baz'}, 'headers': {'Content-Type': FORM_URLENCODED}} normalized = HmacSha1Signature()\ ._normalize_request_parameters({}, req_kwargs) self.assertEqual('foo%2Bbar=baz', normalized) self.assertNotIn('+', normalized) normalized = HmacSha1Signature()\ ._normalize_request_parameters(self.oauth_params, req_kwargs) self.assertEqual('foo%2Bbar=baz', normalized) self.assertNotIn('+', normalized) def test_normalize_request_parameters_whitespace(self): req_kwargs = {'data': {'foo': 'bar baz'}, 'headers': {'Content-Type': FORM_URLENCODED}} normalized = HmacSha1Signature()\ ._normalize_request_parameters(self.oauth_params, req_kwargs) self.assertEqual('foo=bar%20baz', normalized) def test_sign_utf8_encoded_string(self): # in the event a string is already UTF-8 req_kwargs = {u'params': {u'foo': u'bar'}} sig = HmacSha1Signature().sign(self.consumer_secret, self.access_token_secret, u'GET', self.url, self.oauth_params, req_kwargs) self.assertEqual('cYzjVXCOk62KoYmJ+iCvcAcgfp8=', sig) def test_sign_with_data(self): # in the event a string is already UTF-8 req_kwargs = {'data': {'foo': 'bar'}} method = 'POST' sig = HmacSha1Signature().sign(self.consumer_secret, self.access_token_secret, method, self.url, self.oauth_params, req_kwargs) self.assertEqual('JzmJUmqjdNYBJsJWbtQKXnc0W8w=', sig) def test_remove_query_string(self): # can't sign the URL with the query string so url = 'http://example.com/?foo=bar' signable_url = HmacSha1Signature()._remove_qs(url) self.assertEqual('http://example.com/', signable_url) def test_normalize_request_parameters_data_not_urlencoded(self): # not sending the 'application/x-www-form-urlencoded' header # therefore the data will not be included in the signature req_kwargs = {'data': {'foo': 'bar'}} normalized = HmacSha1Signature()\ ._normalize_request_parameters(self.oauth_params, req_kwargs) self.assertEqual('', normalized) req_kwargs = {'params': {'a': 'b'}, 'data': {'foo': 'bar'}} normalized = HmacSha1Signature()\ ._normalize_request_parameters({}, req_kwargs) self.assertEqual('a=b', normalized) def test_normalize_request_parameters_data_not_alphanumeric(self): # data is not alphanumeric (for example: Japanese) try: from urllib import unquote except ImportError: from urllib.parse import unquote # unicode req_kwargs = {u'params': {u'foo': u'こんにちは世界'}} normalized = HmacSha1Signature()\ ._normalize_request_parameters({}, req_kwargs) key, value = normalized.split('=') decoded_value = unquote(value) self.assertEqual('こんにちは世界', unquote(decoded_value)) # str req_kwargs = {'params': {'foo': 'こんにちは世界'}} normalized = HmacSha1Signature()\ ._normalize_request_parameters({}, req_kwargs) key, value = normalized.split('=') decoded_value = unquote(value) self.assertEqual('こんにちは世界', unquote(decoded_value)) class OAuthTestRsaSha1Case(RauthTestCase): private_key = '''-----BEGIN RSA PRIVATE KEY----- MIICXQIBAAKBgQDf0jdU+07T1B9erQBNS46JmvO7vsNfdNXkoEx4UwLwqsmv1wKs RvCXBVyNYnnHYVQjSDRgyviNLYSP01DXqmwKlhSN9sbjiCeswXlG2B4BdFdO687J 9ZOmeyZsb6OFlXWediqkfvDaArSPM884YB2A8rqJd2y8Hd4tSG2Ns2o7WwIDAQAB AoGBAMJ8FO54LMfuU4/d/hwsImA5z759BaGFkXLHQ4tufmiHzxdHWqA+SELCOujz /+ObFBRQYosU86MhQUYElgPAp31u6MfmNc7nPvtuy1rSYVYD05oUqeyKBCycZa9r F9+5ASNdvYF/vvAj5gQ2aOZPGsTf80hrUIDt2ebJn1yq3R1BAkEA49qUpQbKHDdJ I9CZiiptySClyxyR3++oPw1UR9vfTz0qkzExYeS59TROX+sVpcpp/LFeTV8HeDVl nUEv3xtEYQJBAPt4HDw21gRqL0W3V7xQIrCBnzttBA83y3hUpn1wRelJnnVsAUwv KtxFZPSTprDFf3eTJP5vWEYcM4CME7L0GTsCQDAg1HMDOx+4oc9Z2YSwr53jMoHz l/B4O86Nrza6f7HKFrsekfK+kHT1xnRGQL1TQw3oHSY0o2xFwx/zS/xRUyECQQDA k/ojjucVWHA9Vqwk9cWrIIleDB2YveTfkQwzciDICG4GhKD1xAVxzN8EgnKcW5ND cndZNtIGVyCF6EBJwq/zAkBjcXFUJMXXYiIzIpKJD2ZEMms2PXBkB0OxG+Yr0r4G /w3QafaS0cyRCu0z0fY52+wcn5VrHk97sLQhLMQv07ij -----END RSA PRIVATE KEY-----''' method = 'GET' url = 'http://example.com/' oauth_params = {} req_kwargs = {'params': {'foo': 'bar'}} def test_rsasha1_signature(self): oauth_signature = RsaSha1Signature().sign(self.private_key, None, self.method, self.url, self.oauth_params, self.req_kwargs) self.assertIsNotNone(oauth_signature) self.assertIsInstance(oauth_signature, stringtype) self.assertEqual(oauth_signature, 'MEnbOKBw0lWi5NvGyrABQ6tPygWiNOjGz47y8d+SQfXYrzsvK' 'kzcMgt2VGBRgKsKSdFho36TuCuP75Qe1uou6/rhHrZoSppQ+6' 'vdPSKkriGzSK3azqBacg9ZIIVy/atHPTm6BAvo+0v4ysiI9ci' '7hJbRkXL0NJVz/p0ZQKO/Jds=') def test_rsasha1_badargument(self): self.assertRaises(ValueError, RsaSha1Signature().sign, None, None, self.method, self.url, self.oauth_params, self.req_kwargs) class OAuthTestPlaintextCase(RauthTestCase): consumer_secret = '1234' access_token_secret = 'abcdef' method = 'GET' url = 'http://example.com/' oauth_params = {} req_kwargs = {'params': {'foo': 'bar'}} def test_plaintext_signature(self): oauth_signature = PlaintextSignature().sign(self.consumer_secret, self.access_token_secret, self.method, self.url, self.oauth_params, self.req_kwargs) self.assertIsNotNone(oauth_signature) self.assertIsInstance(oauth_signature, stringtype) sig = ('&'.join((self.consumer_secret, self.access_token_secret))) self.assertEqual(sig, oauth_signature) def test_no_token_secret_signature(self): oauth_signature = PlaintextSignature().sign(self.consumer_secret, None, self.method, self.url, self.oauth_params, self.req_kwargs) self.assertIsNotNone(oauth_signature) self.assertIsInstance(oauth_signature, stringtype) sig = ('&'.join((self.consumer_secret, ''))) self.assertEqual(sig, oauth_signature)
{ "content_hash": "4d9ddff0c67fb6e0b1695a2471c93a5d", "timestamp": "", "source": "github", "line_count": 239, "max_line_length": 78, "avg_line_length": 43.62343096234309, "alnum_prop": 0.5567811241127949, "repo_name": "isouzasoares/rauth", "id": "99fa2ef2b6076e7baa17c1aae7f93464b5855a65", "size": "10506", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "tests/test_oauth.py", "mode": "33188", "license": "mit", "language": [ { "name": "Makefile", "bytes": "607" }, { "name": "Python", "bytes": "108635" }, { "name": "Shell", "bytes": "1192" } ], "symlink_target": "" }
{% extends "zerver/portico.html" %} {% block title %} <title>Zulip: the best group chat for open source projects</title> {% endblock %} {% block customhead %} {{ super() }} <meta name="viewport" content="width=device-width, initial-scale=1.0"> {% stylesheet 'portico' %} {% stylesheet 'landing-page' %} {{ render_bundle('landing-page') }} {% endblock %} {% block portico_content %} {% include 'zerver/landing_nav.html' %} <div class="portico-landing apps"> <div class="main"> <div class="padded-content headline"> <h1 class="center">{% trans %}The best choice for open source projects{% endtrans %}</h1> </div> <div class="padded-content"> <div class="inner-content"> {{ 'zerver/for/open-source.md'|render_markdown_path }} </div> </div> </div> </div> {% endblock %}
{ "content_hash": "36325c113fe39d4fe21acbaef40fa482", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 101, "avg_line_length": 25.470588235294116, "alnum_prop": 0.5935334872979214, "repo_name": "jrowan/zulip", "id": "094e0efba68a1cf1e10062ddf4e6715810f1bb27", "size": "866", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "templates/zerver/for-open-source.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "400886" }, { "name": "Emacs Lisp", "bytes": "158" }, { "name": "HTML", "bytes": "470981" }, { "name": "JavaScript", "bytes": "2070164" }, { "name": "Nginx", "bytes": "1280" }, { "name": "Pascal", "bytes": "1113" }, { "name": "Perl", "bytes": "401825" }, { "name": "Puppet", "bytes": "87465" }, { "name": "Python", "bytes": "3500902" }, { "name": "Ruby", "bytes": "249744" }, { "name": "Shell", "bytes": "38344" } ], "symlink_target": "" }
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- * vim: set ts=8 sw=4 et tw=78: * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include <stdio.h> #include <stdarg.h> #include "jscntxt.h" #include "jscompartment.h" #include "jscrashformat.h" #include "jscrashreport.h" #include "jsprf.h" #include "jsprobes.h" #include "jsutil.h" #include "prmjtime.h" #include "gc/Memory.h" #include "gc/Statistics.h" #include "gc/Barrier-inl.h" namespace js { namespace gcstats { /* Except for the first and last, slices of less than 42ms are not reported. */ static const int64_t SLICE_MIN_REPORT_TIME = 42 * PRMJ_USEC_PER_MSEC; class StatisticsSerializer { typedef Vector<char, 128, SystemAllocPolicy> CharBuffer; CharBuffer buf_; bool asJSON_; bool needComma_; bool oom_; const static int MaxFieldValueLength = 128; public: enum Mode { AsJSON = true, AsText = false }; StatisticsSerializer(Mode asJSON) : buf_(), asJSON_(asJSON), needComma_(false), oom_(false) {} bool isJSON() { return asJSON_; } bool isOOM() { return oom_; } void endLine() { if (!asJSON_) { p("\n"); needComma_ = false; } } void extra(const char *str) { if (!asJSON_) { needComma_ = false; p(str); } } void appendString(const char *name, const char *value) { put(name, value, "", true); } void appendNumber(const char *name, const char *vfmt, const char *units, ...) { va_list va; va_start(va, units); append(name, vfmt, va, units); va_end(va); } void appendDecimal(const char *name, const char *units, double d) { if (asJSON_) appendNumber(name, "%d.%d", units, (int)d, (int)(d * 10.) % 10); else appendNumber(name, "%.1f", units, d); } void appendIfNonzeroMS(const char *name, double v) { if (asJSON_ || v >= 0.1) appendDecimal(name, "ms", v); } void beginObject(const char *name) { if (needComma_) pJSON(", "); if (asJSON_ && name) { putKey(name); pJSON(": "); } pJSON("{"); needComma_ = false; } void endObject() { needComma_ = false; pJSON("}"); needComma_ = true; } void beginArray(const char *name) { if (needComma_) pJSON(", "); if (asJSON_) putKey(name); pJSON(": ["); needComma_ = false; } void endArray() { needComma_ = false; pJSON("]"); needComma_ = true; } jschar *finishJSString() { char *buf = finishCString(); if (!buf) return NULL; size_t nchars = strlen(buf); jschar *out = js_pod_malloc<jschar>(nchars + 1); if (!out) { oom_ = true; js_free(buf); return NULL; } size_t outlen = nchars; bool ok = InflateStringToBuffer(NULL, buf, nchars, out, &outlen); js_free(buf); if (!ok) { oom_ = true; js_free(out); return NULL; } out[nchars] = 0; return out; } char *finishCString() { if (oom_) return NULL; buf_.append('\0'); char *buf = buf_.extractRawBuffer(); if (!buf) oom_ = true; return buf; } private: void append(const char *name, const char *vfmt, va_list va, const char *units) { char val[MaxFieldValueLength]; JS_vsnprintf(val, MaxFieldValueLength, vfmt, va); put(name, val, units, false); } void p(const char *cstr) { if (oom_) return; if (!buf_.append(cstr, strlen(cstr))) oom_ = true; } void p(const char c) { if (oom_) return; if (!buf_.append(c)) oom_ = true; } void pJSON(const char *str) { if (asJSON_) p(str); } void put(const char *name, const char *val, const char *units, bool valueIsQuoted) { if (needComma_) p(", "); needComma_ = true; putKey(name); p(": "); if (valueIsQuoted) putQuoted(val); else p(val); if (!asJSON_) p(units); } void putQuoted(const char *str) { pJSON("\""); p(str); pJSON("\""); } void putKey(const char *str) { if (!asJSON_) { p(str); return; } p("\""); const char *c = str; while (*c) { if (*c == ' ' || *c == '\t') p('_'); else if (isupper(*c)) p(tolower(*c)); else if (*c == '+') p("added_"); else if (*c == '-') p("removed_"); else if (*c != '(' && *c != ')') p(*c); c++; } p("\""); } }; /* * If this fails, then you can either delete this assertion and allow all * larger-numbered reasons to pile up in the last telemetry bucket, or switch * to GC_REASON_3 and bump the max value. */ JS_STATIC_ASSERT(gcreason::NUM_TELEMETRY_REASONS >= gcreason::NUM_REASONS); static const char * ExplainReason(gcreason::Reason reason) { switch (reason) { #define SWITCH_REASON(name) \ case gcreason::name: \ return #name; GCREASONS(SWITCH_REASON) default: JS_NOT_REACHED("bad GC reason"); return "?"; #undef SWITCH_REASON } } static double t(int64_t t) { return double(t) / PRMJ_USEC_PER_MSEC; } struct PhaseInfo { unsigned index; const char *name; }; static PhaseInfo phases[] = { { PHASE_GC_BEGIN, "Begin Callback" }, { PHASE_WAIT_BACKGROUND_THREAD, "Wait Background Thread" }, { PHASE_PURGE, "Purge" }, { PHASE_MARK, "Mark" }, { PHASE_MARK_DISCARD_CODE, "Mark Discard Code" }, { PHASE_MARK_ROOTS, "Mark Roots" }, { PHASE_MARK_TYPES, "Mark Types" }, { PHASE_MARK_DELAYED, "Mark Delayed" }, { PHASE_MARK_WEAK, "Mark Weak" }, { PHASE_MARK_GRAY, "Mark Gray" }, { PHASE_MARK_GRAY_WEAK, "Mark Gray and Weak" }, { PHASE_FINALIZE_START, "Finalize Start Callback" }, { PHASE_SWEEP, "Sweep" }, { PHASE_SWEEP_ATOMS, "Sweep Atoms" }, { PHASE_SWEEP_COMPARTMENTS, "Sweep Compartments" }, { PHASE_SWEEP_TABLES, "Sweep Tables" }, { PHASE_SWEEP_OBJECT, "Sweep Object" }, { PHASE_SWEEP_STRING, "Sweep String" }, { PHASE_SWEEP_SCRIPT, "Sweep Script" }, { PHASE_SWEEP_SHAPE, "Sweep Shape" }, { PHASE_SWEEP_DISCARD_CODE, "Sweep Discard Code" }, { PHASE_DISCARD_ANALYSIS, "Discard Analysis" }, { PHASE_DISCARD_TI, "Discard TI" }, { PHASE_FREE_TI_ARENA, "Free TI Arena" }, { PHASE_SWEEP_TYPES, "Sweep Types" }, { PHASE_CLEAR_SCRIPT_ANALYSIS, "Clear Script Analysis" }, { PHASE_FINALIZE_END, "Finalize End Callback" }, { PHASE_DESTROY, "Deallocate" }, { PHASE_GC_END, "End Callback" }, { 0, NULL } }; static void FormatPhaseTimes(StatisticsSerializer &ss, const char *name, int64_t *times) { ss.beginObject(name); for (unsigned i = 0; phases[i].name; i++) ss.appendIfNonzeroMS(phases[i].name, t(times[phases[i].index])); ss.endObject(); } void Statistics::gcDuration(int64_t *total, int64_t *maxPause) { *total = *maxPause = 0; for (SliceData *slice = slices.begin(); slice != slices.end(); slice++) { *total += slice->duration(); if (slice->duration() > *maxPause) *maxPause = slice->duration(); } } void Statistics::sccDurations(int64_t *total, int64_t *maxPause) { *total = *maxPause = 0; for (size_t i = 0; i < sccTimes.length(); i++) { *total += sccTimes[i]; *maxPause = Max(*maxPause, sccTimes[i]); } } bool Statistics::formatData(StatisticsSerializer &ss, uint64_t timestamp) { int64_t total, longest; gcDuration(&total, &longest); int64_t sccTotal, sccLongest; sccDurations(&sccTotal, &sccLongest); double mmu20 = computeMMU(20 * PRMJ_USEC_PER_MSEC); double mmu50 = computeMMU(50 * PRMJ_USEC_PER_MSEC); ss.beginObject(NULL); if (ss.isJSON()) ss.appendNumber("Timestamp", "%llu", "", (unsigned long long)timestamp); ss.appendDecimal("Total Time", "ms", t(total)); ss.appendNumber("Compartments Collected", "%d", "", collectedCount); ss.appendNumber("Total Compartments", "%d", "", compartmentCount); ss.appendNumber("MMU (20ms)", "%d", "%", int(mmu20 * 100)); ss.appendNumber("MMU (50ms)", "%d", "%", int(mmu50 * 100)); ss.appendDecimal("SCC Sweep Total", "ms", t(sccTotal)); ss.appendDecimal("SCC Sweep Max Pause", "ms", t(sccLongest)); if (slices.length() > 1 || ss.isJSON()) ss.appendDecimal("Max Pause", "ms", t(longest)); else ss.appendString("Reason", ExplainReason(slices[0].reason)); if (nonincrementalReason || ss.isJSON()) { ss.appendString("Nonincremental Reason", nonincrementalReason ? nonincrementalReason : "none"); } ss.appendNumber("Allocated", "%u", "MB", unsigned(preBytes / 1024 / 1024)); ss.appendNumber("+Chunks", "%d", "", counts[STAT_NEW_CHUNK]); ss.appendNumber("-Chunks", "%d", "", counts[STAT_DESTROY_CHUNK]); ss.endLine(); if (slices.length() > 1 || ss.isJSON()) { ss.beginArray("Slices"); for (size_t i = 0; i < slices.length(); i++) { int64_t width = slices[i].duration(); if (i != 0 && i != slices.length() - 1 && width < SLICE_MIN_REPORT_TIME && !slices[i].resetReason && !ss.isJSON()) { continue; } ss.beginObject(NULL); ss.extra(" "); ss.appendNumber("Slice", "%d", "", i); ss.appendDecimal("Pause", "", t(width)); ss.extra(" ("); ss.appendDecimal("When", "ms", t(slices[i].start - slices[0].start)); ss.appendString("Reason", ExplainReason(slices[i].reason)); if (ss.isJSON()) { ss.appendDecimal("Page Faults", "", double(slices[i].endFaults - slices[i].startFaults)); ss.appendNumber("Start Timestamp", "%llu", "", (unsigned long long)slices[i].start); ss.appendNumber("End Timestamp", "%llu", "", (unsigned long long)slices[i].end); } if (slices[i].resetReason) ss.appendString("Reset", slices[i].resetReason); ss.extra("): "); FormatPhaseTimes(ss, "Times", slices[i].phaseTimes); ss.endLine(); ss.endObject(); } ss.endArray(); } ss.extra(" Totals: "); FormatPhaseTimes(ss, "Totals", phaseTimes); ss.endObject(); return !ss.isOOM(); } jschar * Statistics::formatMessage() { StatisticsSerializer ss(StatisticsSerializer::AsText); formatData(ss, 0); return ss.finishJSString(); } jschar * Statistics::formatJSON(uint64_t timestamp) { StatisticsSerializer ss(StatisticsSerializer::AsJSON); formatData(ss, timestamp); return ss.finishJSString(); } Statistics::Statistics(JSRuntime *rt) : runtime(rt), startupTime(PRMJ_Now()), fp(NULL), fullFormat(false), gcDepth(0), collectedCount(0), compartmentCount(0), nonincrementalReason(NULL) { PodArrayZero(phaseTotals); PodArrayZero(counts); char *env = getenv("MOZ_GCTIMER"); if (!env || strcmp(env, "none") == 0) { fp = NULL; return; } if (strcmp(env, "stdout") == 0) { fullFormat = false; fp = stdout; } else if (strcmp(env, "stderr") == 0) { fullFormat = false; fp = stderr; } else { fullFormat = true; fp = fopen(env, "a"); JS_ASSERT(fp); } } Statistics::~Statistics() { if (fp) { if (fullFormat) { StatisticsSerializer ss(StatisticsSerializer::AsText); FormatPhaseTimes(ss, "", phaseTotals); char *msg = ss.finishCString(); if (msg) { fprintf(fp, "TOTALS\n%s\n\n-------\n", msg); js_free(msg); } } if (fp != stdout && fp != stderr) fclose(fp); } } void Statistics::printStats() { if (fullFormat) { StatisticsSerializer ss(StatisticsSerializer::AsText); formatData(ss, 0); char *msg = ss.finishCString(); if (msg) { fprintf(fp, "GC(T+%.3fs) %s\n", t(slices[0].start - startupTime) / 1000.0, msg); js_free(msg); } } else { int64_t total, longest; gcDuration(&total, &longest); fprintf(fp, "%f %f %f\n", t(total), t(phaseTimes[PHASE_MARK]), t(phaseTimes[PHASE_SWEEP])); } fflush(fp); } void Statistics::beginGC() { PodArrayZero(phaseStartTimes); PodArrayZero(phaseTimes); slices.clearAndFree(); sccTimes.clearAndFree(); nonincrementalReason = NULL; preBytes = runtime->gcBytes; Probes::GCStart(); } void Statistics::endGC() { Probes::GCEnd(); crash::SnapshotGCStack(); for (int i = 0; i < PHASE_LIMIT; i++) phaseTotals[i] += phaseTimes[i]; if (JSAccumulateTelemetryDataCallback cb = runtime->telemetryCallback) { int64_t total, longest; gcDuration(&total, &longest); int64_t sccTotal, sccLongest; sccDurations(&sccTotal, &sccLongest); (*cb)(JS_TELEMETRY_GC_IS_COMPARTMENTAL, collectedCount == compartmentCount ? 0 : 1); (*cb)(JS_TELEMETRY_GC_MS, t(total)); (*cb)(JS_TELEMETRY_GC_MAX_PAUSE_MS, t(longest)); (*cb)(JS_TELEMETRY_GC_MARK_MS, t(phaseTimes[PHASE_MARK])); (*cb)(JS_TELEMETRY_GC_SWEEP_MS, t(phaseTimes[PHASE_SWEEP])); (*cb)(JS_TELEMETRY_GC_MARK_ROOTS_MS, t(phaseTimes[PHASE_MARK_ROOTS])); (*cb)(JS_TELEMETRY_GC_MARK_GRAY_MS, t(phaseTimes[PHASE_MARK_GRAY])); (*cb)(JS_TELEMETRY_GC_NON_INCREMENTAL, !!nonincrementalReason); (*cb)(JS_TELEMETRY_GC_INCREMENTAL_DISABLED, !runtime->gcIncrementalEnabled); (*cb)(JS_TELEMETRY_GC_SCC_SWEEP_TOTAL_MS, t(sccTotal)); (*cb)(JS_TELEMETRY_GC_SCC_SWEEP_MAX_PAUSE_MS, t(sccLongest)); double mmu50 = computeMMU(50 * PRMJ_USEC_PER_MSEC); (*cb)(JS_TELEMETRY_GC_MMU_50, mmu50 * 100); } if (fp) printStats(); } void Statistics::beginSlice(int collectedCount, int compartmentCount, gcreason::Reason reason) { this->collectedCount = collectedCount; this->compartmentCount = compartmentCount; bool first = runtime->gcIncrementalState == gc::NO_INCREMENTAL; if (first) beginGC(); SliceData data(reason, PRMJ_Now(), gc::GetPageFaultCount()); (void) slices.append(data); /* Ignore any OOMs here. */ if (JSAccumulateTelemetryDataCallback cb = runtime->telemetryCallback) (*cb)(JS_TELEMETRY_GC_REASON, reason); // Slice callbacks should only fire for the outermost level if (++gcDepth == 1) { bool wasFullGC = collectedCount == compartmentCount; if (GCSliceCallback cb = runtime->gcSliceCallback) (*cb)(runtime, first ? GC_CYCLE_BEGIN : GC_SLICE_BEGIN, GCDescription(!wasFullGC)); } } void Statistics::endSlice() { slices.back().end = PRMJ_Now(); slices.back().endFaults = gc::GetPageFaultCount(); if (JSAccumulateTelemetryDataCallback cb = runtime->telemetryCallback) { (*cb)(JS_TELEMETRY_GC_SLICE_MS, t(slices.back().end - slices.back().start)); (*cb)(JS_TELEMETRY_GC_RESET, !!slices.back().resetReason); } bool last = runtime->gcIncrementalState == gc::NO_INCREMENTAL; if (last) endGC(); // Slice callbacks should only fire for the outermost level if (--gcDepth == 0) { bool wasFullGC = collectedCount == compartmentCount; if (GCSliceCallback cb = runtime->gcSliceCallback) (*cb)(runtime, last ? GC_CYCLE_END : GC_SLICE_END, GCDescription(!wasFullGC)); } /* Do this after the slice callback since it uses these values. */ if (last) PodArrayZero(counts); } void Statistics::beginPhase(Phase phase) { /* Guard against re-entry */ JS_ASSERT(!phaseStartTimes[phase]); phaseStartTimes[phase] = PRMJ_Now(); if (phase == gcstats::PHASE_MARK) Probes::GCStartMarkPhase(); else if (phase == gcstats::PHASE_SWEEP) Probes::GCStartSweepPhase(); } void Statistics::endPhase(Phase phase) { int64_t t = PRMJ_Now() - phaseStartTimes[phase]; slices.back().phaseTimes[phase] += t; phaseTimes[phase] += t; phaseStartTimes[phase] = 0; if (phase == gcstats::PHASE_MARK) Probes::GCEndMarkPhase(); else if (phase == gcstats::PHASE_SWEEP) Probes::GCEndSweepPhase(); } int64_t Statistics::beginSCC() { return PRMJ_Now(); } void Statistics::endSCC(unsigned scc, int64_t start) { if (scc >= sccTimes.length() && !sccTimes.resize(scc + 1)) return; sccTimes[scc] += PRMJ_Now() - start; } /* * MMU (minimum mutator utilization) is a measure of how much garbage collection * is affecting the responsiveness of the system. MMU measurements are given * with respect to a certain window size. If we report MMU(50ms) = 80%, then * that means that, for any 50ms window of time, at least 80% of the window is * devoted to the mutator. In other words, the GC is running for at most 20% of * the window, or 10ms. The GC can run multiple slices during the 50ms window * as long as the total time it spends is at most 10ms. */ double Statistics::computeMMU(int64_t window) { JS_ASSERT(!slices.empty()); int64_t gc = slices[0].end - slices[0].start; int64_t gcMax = gc; if (gc >= window) return 0.0; int startIndex = 0; for (size_t endIndex = 1; endIndex < slices.length(); endIndex++) { gc += slices[endIndex].end - slices[endIndex].start; while (slices[endIndex].end - slices[startIndex].end >= window) { gc -= slices[startIndex].end - slices[startIndex].start; startIndex++; } int64_t cur = gc; if (slices[endIndex].end - slices[startIndex].start > window) cur -= (slices[endIndex].end - slices[startIndex].start - window); if (cur > gcMax) gcMax = cur; } return double(window - gcMax) / window; } } /* namespace gcstats */ } /* namespace js */
{ "content_hash": "f84786143fcb870650096f73b9cb621e", "timestamp": "", "source": "github", "line_count": 687, "max_line_length": 100, "avg_line_length": 27.51528384279476, "alnum_prop": 0.5638787494048564, "repo_name": "wilebeast/FireFox-OS", "id": "f83f3dbc4a49b00ad9d6001293cac9cc8225eef8", "size": "18903", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "B2G/gecko/js/src/gc/Statistics.cpp", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
package com.redsharp.weather; public class Temperature { private static final Unit DEFAULT_UNIT = Unit.CELSIUS; private final Double value; private final Unit unit; public double value() { return value; } public static Temperature of(final Double value) { return new Temperature(value, DEFAULT_UNIT); } public enum Unit {CELSIUS}; public static class Builder { private Double value; private Unit unit; public Builder(Double value) { this.value = value; unit = DEFAULT_UNIT; } public Builder usingUnit(Unit unit) { this.unit = unit; return this; } public Temperature build() { return new Temperature(value, unit); } } private Temperature(Double value, Unit unit){ this.value = value; this.unit = unit; } @Override public boolean equals(final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final Temperature that = (Temperature) o; if (value != null ? !value.equals(that.value) : that.value != null) return false; return unit == that.unit; } @Override public int hashCode() { int result = value != null ? value.hashCode() : 0; result = 31 * result + (unit != null ? unit.hashCode() : 0); return result; } @Override public String toString() { return "Temperature{" + "value=" + value + ", unit=" + unit + '}'; } }
{ "content_hash": "912c9d5842d7cb38693485da218f46a2", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 89, "avg_line_length": 23.753623188405797, "alnum_prop": 0.5485051860890787, "repo_name": "saidaspen/attoday", "id": "4867a6c5f924a2d302234e21fdf09ddfb9cad7d8", "size": "1639", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/redsharp/weather/Temperature.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "10506" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:background="#282727" xmlns:android="http://schemas.android.com/apk/res/android"> <ImageView android:id="@+id/teach_cancel11" android:layout_gravity="right" android:layout_margin="10dp" android:layout_width="40dp" android:layout_height="40dp" android:src="@mipmap/btn_cancel"/> <GridLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginLeft="100dp" android:layout_marginTop="50dp" android:columnCount="2" tools:context=".ui.SpaceFloatBtnActivity"> <ImageView android:id="@+id/teach_dinner" android:layout_margin="5dp" android:layout_width="80dp" android:layout_height="80dp" android:src="@drawable/space_floatbtn_jump"/> <ImageView android:id="@+id/teach_office" android:layout_margin="5dp" android:layout_width="80dp" android:layout_height="80dp" android:src="@drawable/space_floatbtn_jump_bangong"/> <ImageView android:id="@+id/teach_art" android:layout_margin="5dp" android:layout_width="80dp" android:layout_height="80dp" android:src="@drawable/space_floatbtn_jump_art"/> <ImageView android:id="@+id/teach_hotel" android:layout_margin="5dp" android:layout_width="80dp" android:layout_height="80dp" android:src="@drawable/space_floatbtn_jump_hotel"/> <ImageView android:id="@+id/teach_life" android:layout_margin="5dp" android:layout_width="80dp" android:layout_height="80dp" android:src="@drawable/space_floatbtn_jump_life"/> <ImageView android:id="@+id/teach_public" android:layout_margin="5dp" android:layout_width="80dp" android:layout_height="80dp" android:src="@drawable/space_floatbtn_jump_public"/> <ImageView android:id="@+id/teach_retail" android:layout_margin="5dp" android:layout_width="80dp" android:layout_height="80dp" android:src="@drawable/space_floatbtn_jump_life"/> <ImageView android:id="@+id/teach_other" android:layout_margin="5dp" android:layout_width="80dp" android:layout_height="80dp" android:src="@drawable/space_floatbtn_jump_other"/> </GridLayout> </LinearLayout>
{ "content_hash": "893aed04d51dd7f831b7cdf2e227cd57", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 70, "avg_line_length": 32.58536585365854, "alnum_prop": 0.6410928143712575, "repo_name": "WonderfulFamily/HappyProject", "id": "75e324503025faa6cc5f5b89edb6ed589e1b64c0", "size": "2672", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/res/layout/activity_space_float_btn.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "342259" } ], "symlink_target": "" }
define(["can/util/can", "can/util/attr", "dojo", "can/event", "can/util/fragment", "can/util/array/each", "can/util/object/isplain", "can/util/deferred", "can/util/hashchange", "can/util/inserted"], function (can, attr) { var dojo = window.dojo; define('plugd/trigger', ['dojo'], function (dojo) { var d = dojo; var isfn = d.isFunction; var leaveRe = /mouse(enter|leave)/; var _fix = function (_, p) { return 'mouse' + (p === 'enter' ? 'over' : 'out'); }; var mix = d._mixin; // the guts of the node triggering logic: // the function accepts node (not string|node), "on"-less event name, // and an object of args to mix into the event. var realTrigger; if (d.doc.createEvent) { realTrigger = function (n, e, a) { // the sane branch var ev = d.doc.createEvent('HTMLEvents'); e = e.replace(leaveRe, _fix); // removed / inserted events should not bubble ev.initEvent(e, e === 'removed' || e === 'inserted' ? false : true, true); if (a) { mix(ev, a); } n.dispatchEvent(ev); }; } else { realTrigger = function (n, e, a) { // the janktastic branch var ev = 'on' + e, stop = false; try { // FIXME: is this worth it? for mixed-case native event support:? Opera ends up in the // createEvent path above, and also fails on _some_ native-named events. // if(lc !== e && d.indexOf(d.NodeList.events, lc) >= 0){ // // if the event is one of those listed in our NodeList list // // in lowercase form but is mixed case, throw to avoid // // fireEvent. /me sighs. http://gist.github.com/315318 // throw("janktastic"); // } var evObj = document.createEventObject(); if (e === "inserted" || e === "removed") { evObj.cancelBubble = true; } mix(evObj, a); n.fireEvent(ev, evObj); } catch (er) { // a lame duck to work with. we're probably a 'custom event' var evdata = mix({ type: e, target: n, faux: true, // HACK: [needs] added support for customStopper to _base/event.js // some tests will fail until del._stopPropagation has support. _stopper: function () { stop = this.cancelBubble; } }, a); if (isfn(n[ev])) { n[ev](evdata); } if (e === "inserted" || e === "removed") { return; } // handle bubbling of custom events, unless the event was stopped. while (!stop && n !== d.doc && n.parentNode) { n = n.parentNode; if (isfn(n[ev])) { n[ev](evdata); } } } }; } d._trigger = function (node, event, extraArgs) { if (typeof event !== 'string') { extraArgs = event; event = extraArgs.type; delete extraArgs.type; } // summary: // Helper for `dojo.trigger`, which handles the DOM cases. We should never // be here without a domNode reference and a string eventname. var n = d.byId(node), ev = event && event.slice(0, 2) === 'on' ? event.slice(2) : event; realTrigger(n, ev, extraArgs); }; d.trigger = function (obj, event, extraArgs) { // summary: // Trigger some event. It can be either a Dom Event, Custom Event, // or direct function call. // // description: // Trigger some event. It can be either a Dom Event, Custom Event, // or direct function call. NOTE: This function does not trigger // default behavior, only triggers bound event listeneres. eg: // one cannot trigger("anchorNode", "onclick") and expect the browser // to follow the href="" attribute naturally. // // obj: String|DomNode|Object|Function // An ID, or DomNode reference, from which to trigger the event. // If an Object, fire the `event` in the scope of this object, // similar to calling dojo.hitch(obj, event)(). The return value // in this case is returned from `dojo.trigger` // // event: String|Function // The name of the event to trigger. can be any DOM level 2 event // and can be in either form: "onclick" or "click" for instance. // In the object-firing case, this method can be a function or // a string version of a member function, just like `dojo.hitch`. // // extraArgs: Object? // An object to mix into the `event` object passed to any bound // listeners. Be careful not to override important members, like // `type`, or `preventDefault`. It will likely error. // // Additionally, extraArgs is moot in the object-triggering case, // as all arguments beyond the `event` are curried onto the triggered // function. // // example: // | dojo.connect(node, "onclick", function(e){ /* stuff */ }); // | // later: // | dojo.trigger(node, "onclick"); // // example: // | // or from within dojo.query: (requires dojo.NodeList) // | dojo.query("a").onclick(function(){}).trigger("onclick"); // // example: // | // fire obj.method() in scope of obj // | dojo.trigger(obj, "method"); // // example: // | // fire an anonymous function: // | dojo.trigger(d.global, function(){ /* stuff */ }); // // example: // | // fire and anonymous function in the scope of obj // | dojo.trigger(obj, function(){ this == obj; }); // // example: // | // with a connected function like: // | dojo.connect(dojo.doc, "onclick", function(e){ // | if(e && e.manuallydone){ // | console.log("this was a triggered onclick, not natural"); // | } // | }); // | // fire onclick, passing in a custom bit of info // | dojo.trigger("someId", "onclick", { manuallydone:true }); // // returns: Anything // Will not return anything in the Dom event case, but will return whatever // return value is received from the triggered event. return isfn(obj) || isfn(event) || isfn(obj[event]) ? d.hitch.apply(d, arguments)() : d._trigger.apply(d, arguments); }; d.NodeList.prototype.trigger = d.NodeList._adaptAsForEach(d._trigger); // if the node.js module is available, extend trigger into that. if (d._Node && !d._Node.prototype.trigger) { d.extend(d._Node, { trigger: function (ev, data) { // summary: // Fire some some event originating from this node. // Only available if both the `dojo.trigger` and `dojo.node` plugin // are enabled. Allows chaining as all `dojo._Node` methods do. // // ev: String // Some string event name to fire. eg: "onclick", "submit" // // data: Object // Just like `extraArgs` for `dojo.trigger`, additional data // to mix into the event object. // // example: // | // fire onlick orginiating from a node with id="someAnchorId" // | dojo.node("someAnchorId").trigger("click"); d._trigger(this, ev, data); return this; // dojo._Node } }); } return d.trigger; }); // dojo.js // --------- // _dojo node list._ // // These are pre-loaded by `steal` -> no callback. require([ 'dojo', 'dojo/query', 'plugd/trigger', 'dojo/NodeList-dom' ]); // Map string helpers. can.trim = function (s) { return s && dojo.trim(s); }; // Map array helpers. can.makeArray = function (arr) { var array = []; dojo.forEach(arr, function (item) { array.push(item); }); return array; }; can.isArray = dojo.isArray; can.inArray = function (item, arr, from) { return dojo.indexOf(arr, item, from); }; can.map = function (arr, fn) { return dojo.map(can.makeArray(arr || []), fn); }; // Map object helpers. can.extend = function (first) { if (first === true) { var args = can.makeArray(arguments); args.shift(); return dojo.mixin.apply(dojo, args); } return dojo.mixin.apply(dojo, arguments); }; can.isEmptyObject = function (object) { var prop; for (prop in object) { break; } return prop === undefined; }; // Use a version of param similar to jQuery's param that // handles nested data instead of dojo.objectToQuery which doesn't can.param = function (object) { var pairs = [], add = function (key, value) { pairs.push(encodeURIComponent(key) + '=' + encodeURIComponent(value)); }; for (var name in object) { can.buildParam(name, object[name], add); } return pairs.join('&') .replace(/%20/g, '+'); }; can.buildParam = function (prefix, obj, add) { if (can.isArray(obj)) { for (var i = 0, l = obj.length; i < l; ++i) { add(prefix + '[]', obj[i]); } } else if (dojo.isObject(obj)) { for (var name in obj) { can.buildParam(prefix + '[' + name + ']', obj[name], add); } } else { add(prefix, obj); } }; // Map function helpers. can.proxy = function (func, context) { return dojo.hitch(context, func); }; can.isFunction = function (f) { return dojo.isFunction(f); }; /** * EVENTS * * Dojo does not use the callback handler when unbinding. Instead * when binding (dojo.connect or dojo.on) an object with a remove * method is returned. * * Because of this, we have to map each callback to the "remove" * object to it can be passed to dojo.disconnect. */ // The id of the `function` to be bound, used as an expando on the `function` // so we can lookup it's `remove` object. var dojoId = 0, // Takes a node list, goes through each node // and adds events data that has a map of events to // callbackId to `remove` object. It looks like // `{click: {5: {remove: fn}}}`. dojoAddBinding = function (nodelist, ev, cb) { nodelist.forEach(function (node) { // Converting a raw select node to a node list // returns a node list of its options due to a // bug in Dojo 1.7.1, this is sovled by wrapping // it in an array. node = new dojo.NodeList(node.nodeName === 'SELECT' ? [node] : node); var events = can.data(node, 'events'); if (!events) { can.data(node, 'events', events = {}); } if (!events[ev]) { events[ev] = {}; } if (cb.__bindingsIds === undefined) { cb.__bindingsIds = dojoId++; } events[ev][cb.__bindingsIds] = node.on(ev, cb)[0]; }); }, // Removes a binding on a `nodelist` by finding // the remove object within the object's data. dojoRemoveBinding = function (nodelist, ev, cb) { nodelist.forEach(function (node) { var currentNode = new dojo.NodeList(node), events = can.data(currentNode, 'events'); if (!events) { return; } var handlers = events[ev]; if (!handlers) { return; } var handler = handlers[cb.__bindingsIds]; dojo.disconnect(handler); delete handlers[cb.__bindingsIds]; if (can.isEmptyObject(handlers)) { delete events[ev]; } }); }; can.bind = function (ev, cb) { // If we can bind to it... if (this.bind && this.bind !== can.bind) { this.bind(ev, cb); // Otherwise it's an element or `nodeList`. } else if (this.on || this.nodeType) { // Converting a raw select node to a node list // returns a node list of its options due to a // bug in Dojo 1.7.1, this is sovled by wrapping // it in an array. dojoAddBinding(new dojo.NodeList(this.nodeName === 'SELECT' ? [this] : this), ev, cb); } else if (this.addEvent) { this.addEvent(ev, cb); } else { // Make it bind-able... can.addEvent.call(this, ev, cb); } return this; }; can.unbind = function (ev, cb) { // If we can bind to it... if (this.unbind && this.unbind !== can.unbind) { this.unbind(ev, cb); } else if (this.on || this.nodeType) { dojoRemoveBinding(new dojo.NodeList(this), ev, cb); } else { // Make it bind-able... can.removeEvent.call(this, ev, cb); } return this; }; // Alias on/off to bind/unbind respectively can.on = can.bind; can.off = can.unbind; can.trigger = function (item, event, args, bubble) { if (!(item instanceof dojo.NodeList) && (item.nodeName || item === window)) { item = can.$(item); } if (item.trigger) { if (bubble === false) { if (!item[0] || item[0].nodeType === 3) { return; } // Force stop propagation by // listening to `on` and then immediately disconnecting. var connect = item.on(event, function (ev) { if (ev.stopPropagation) { ev.stopPropagation(); } ev.cancelBubble = true; if (ev._stopper) { ev._stopper(); } dojo.disconnect(connect); }); item.trigger(event, args); } else { item.trigger(event, args); } } else { if (typeof event === 'string') { event = { type: event }; } event.target = event.target || item; can.dispatch.call(item, event, can.makeArray(args)); } }; can.delegate = function (selector, ev, cb) { if (!selector) { // Dojo fails with no selector can.bind.call(this, ev, cb); } else if (this.on || this.nodeType) { dojoAddBinding(new dojo.NodeList(this), selector + ':' + ev, cb); } else if (this.delegate) { this.delegate(selector, ev, cb); } else { // make it bind-able ... can.bind.call(this, ev, cb); } return this; }; can.undelegate = function (selector, ev, cb) { if (!selector) { // Dojo fails with no selector can.unbind.call(this, ev, cb); } else if (this.on || this.nodeType) { dojoRemoveBinding(new dojo.NodeList(this), selector + ':' + ev, cb); } else if (this.undelegate) { this.undelegate(selector, ev, cb); } else { can.unbind.call(this, ev, cb); } return this; }; /** * Ajax */ var updateDeferred = function (xhr, d) { for (var prop in xhr) { if (typeof d[prop] === 'function') { d[prop] = function () { xhr[prop].apply(xhr, arguments); }; } else { d[prop] = prop[xhr]; } } }; can.ajax = function (options) { var type = can.capitalize((options.type || 'get') .toLowerCase()), method = dojo['xhr' + type]; var success = options.success, error = options.error, d = new can.Deferred(); var def = method({ url: options.url, handleAs: options.dataType, sync: !options.async, headers: options.headers, content: options.data }); def.then(function (data, ioargs) { updateDeferred(xhr, d); d.resolve(data, 'success', xhr); if (success) { success(data, 'success', xhr); } }, function (data, ioargs) { updateDeferred(xhr, d); d.reject(xhr, 'error'); error(xhr, 'error'); }); var xhr = def.ioArgs.xhr; updateDeferred(xhr, d); return d; }; // Element - get the wrapped helper. can.$ = function (selector) { if (selector === window) { return window; } if (typeof selector === 'string') { return dojo.query(selector); } else { return new dojo.NodeList(selector && selector.nodeName ? [selector] : selector); } }; can.append = function (wrapped, html) { return wrapped.forEach(function (node) { dojo.place(html, node); }); }; /** * can.data * * can.data is used to store arbitrary data on an element. * Dojo does not support this, so we implement it itself. * * The important part is to call cleanData on any elements * that are removed from the DOM. For this to happen, we * overwrite * * -dojo.empty * -dojo.destroy * -dojo.place when "replace" is used TODO!!!! * * For can.Control, we also need to trigger a non bubbling event * when an element is removed. We do this also in cleanData. */ var data = {}, uuid = can.uuid = +new Date(), exp = can.expando = 'can' + uuid; function getData(node, name) { var id = node[exp], store = id && data[id]; return name === undefined ? store || setData(node) : store && store[name]; } function setData(node, name, value) { var id = node[exp] || (node[exp] = ++uuid), store = data[id] || (data[id] = {}); if (name !== undefined) { store[name] = value; } return store; } var cleanData = function (elems) { var nodes = []; for (var i = 0, len = elems.length; i < len; i++) { if (elems[i].nodeType === 1) { nodes.push(elems[i]); } } can.trigger(new dojo.NodeList(nodes), 'removed', [], false); i = 0; for (var elem; (elem = elems[i]) !== undefined; i++) { var id = elem[exp]; delete data[id]; } }; can.data = function (wrapped, name, value) { return value === undefined ? wrapped.length === 0 ? undefined : getData(wrapped[0], name) : wrapped.forEach(function (node) { setData(node, name, value); }); }; can.cleanData = function (elem, prop) { var id = elem[exp]; delete data[id][prop]; }; // Overwrite `dojo.destroy`, `dojo.empty` and `dojo.place`. dojo.empty = function (node) { for (var c; c = node.lastChild;) { // Intentional assignment. dojo.destroy(c); } }; var destroy = dojo.destroy; dojo.destroy = function (node) { node = dojo.byId(node); // we must call clean data at one time var nodes = [node]; if (node.getElementsByTagName) { nodes.concat(can.makeArray(node.getElementsByTagName('*'))); } cleanData(nodes); return destroy.apply(dojo, arguments); }; var place = dojo.place; dojo.place = function (node, refNode, position) { if (typeof node === 'string' && /^\s*</.test(node)) { node = can.buildFragment(node); } var elems; if (node.nodeType === 11) { elems = can.makeArray(node.childNodes); } else { elems = [node]; } var ret = place.call(this, node, refNode, position); can.inserted(elems); return ret; }; can.addClass = function (wrapped, className) { return wrapped.addClass(className); }; // removes a NodeList ... but it doesn't seem like dojo's NodeList has a destroy method? can.remove = function (wrapped) { // We need to remove text nodes ourselves. var nodes = []; wrapped.forEach(function (node) { nodes.push(node); if (node.getElementsByTagName) { nodes.push.apply(nodes, can.makeArray(node.getElementsByTagName('*'))); } }); cleanData(nodes); wrapped.forEach(destroy); return wrapped; }; can.get = function (wrapped, index) { return wrapped[index]; }; can.has = function (wrapped, element) { if (dojo.isDescendant(element, wrapped[0])) { return wrapped; } else { return []; } }; // Add pipe to `dojo.Deferred`. can.extend(dojo.Deferred.prototype, { pipe: function (done, fail) { var d = new dojo.Deferred(); this.addCallback(function () { d.resolve(done.apply(this, arguments)); }); this.addErrback(function () { if (fail) { d.reject(fail.apply(this, arguments)); } else { d.reject.apply(d, arguments); } }); return d; } }); can.attr = attr; delete attr.MutationObserver; var oldOn = dojo.NodeList.prototype.on; dojo.NodeList.prototype.on = function (event) { if (event === "attributes") { this.forEach(function (node) { var el = can.$(node); can.data(el, "canHasAttributesBindings", (can.data(el, "canHasAttributesBindings") || 0) + 1); }); } var handles = oldOn.apply(this, arguments); if (event === "attributes") { var self = this; can.each(handles, function (handle, i) { var oldRemove = handle.remove; handle.remove = function () { var el = can.$(self[i]), cur = can.data(el, "canHasAttributesBindings") || 0; if (cur <= 0) { can.cleanData(self[i], "canHasAttributesBindings"); } else { can.data(el, "canHasAttributesBindings", cur - 1); } return oldRemove.call(this, arguments); }; }); } return handles; }; var oldSetAttr = dojo.setAttr; dojo.setAttr = function (node, name, value) { var oldValue = dojo.getAttr(node, name); var res = oldSetAttr.apply(this, arguments); var newValue = dojo.getAttr(node, name); if (newValue !== oldValue) { can.attr.trigger(node, name, oldValue); } return res; }; var oldRemoveAttr = dojo.removeAttr; dojo.removeAttr = function (node, name) { var oldValue = dojo.getAttr(node, name), res = oldRemoveAttr.apply(this, arguments); if (oldValue != null) { can.attr.trigger(node, name, oldValue); } return res; }; return can; });
{ "content_hash": "401f37a649e416950e8a28a30137fa9d", "timestamp": "", "source": "github", "line_count": 678, "max_line_length": 221, "avg_line_length": 29.321533923303836, "alnum_prop": 0.6050804828973843, "repo_name": "kosmonowt/food-koop", "id": "ed76a4910f3c2d9008451baf91c899c8a6fa14ce", "size": "20070", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "public/bower_components/canjs/amd-dev/can/util/dojo.js", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "361" }, { "name": "CSS", "bytes": "13102" }, { "name": "HTML", "bytes": "27708" }, { "name": "JavaScript", "bytes": "684089" }, { "name": "PHP", "bytes": "262414" } ], "symlink_target": "" }
// Copyright 2004, 2005 The Apache Software Foundation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package org.ops4j.gaderian.strategy; /** * Used by {@link TestStrategyFactory}. * * @author Howard M. Lewis Ship * @since 1.1 */ public interface ToStringStrategy { public String toString(Object o); }
{ "content_hash": "aa2052c1dfe91b997793c03686490b86", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 75, "avg_line_length": 31.73076923076923, "alnum_prop": 0.7357575757575757, "repo_name": "Abnaxos/gaderian", "id": "a1d9dd3293fe4bc11ca9679cda5581b911a45c5d", "size": "825", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "core/src/test/java/org/ops4j/gaderian/strategy/ToStringStrategy.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Groovy", "bytes": "2755" }, { "name": "Java", "bytes": "2048653" } ], "symlink_target": "" }
#include "optionsdialog.h" #include "ui_optionsdialog.h" #include "bitcoinunits.h" #include "monitoreddatamapper.h" #include "netbase.h" #include "optionsmodel.h" #include <QDir> #include <QIntValidator> #include <QLocale> #include <QMessageBox> #include <QRegExp> #include <QRegExpValidator> OptionsDialog::OptionsDialog(QWidget *parent) : QDialog(parent), ui(new Ui::OptionsDialog), model(0), mapper(0), fRestartWarningDisplayed_Proxy(false), fRestartWarningDisplayed_Lang(false), fProxyIpValid(true) { ui->setupUi(this); /* Network elements init */ #ifndef USE_UPNP ui->mapPortUpnp->setEnabled(false); #endif ui->proxyIp->setEnabled(false); ui->proxyPort->setEnabled(false); ui->proxyPort->setValidator(new QIntValidator(1, 65535, this)); ui->socksVersion->setEnabled(false); ui->socksVersion->addItem("5", 5); ui->socksVersion->addItem("4", 4); ui->socksVersion->setCurrentIndex(0); connect(ui->connectSocks, SIGNAL(toggled(bool)), ui->proxyIp, SLOT(setEnabled(bool))); connect(ui->connectSocks, SIGNAL(toggled(bool)), ui->proxyPort, SLOT(setEnabled(bool))); connect(ui->connectSocks, SIGNAL(toggled(bool)), ui->socksVersion, SLOT(setEnabled(bool))); connect(ui->connectSocks, SIGNAL(clicked(bool)), this, SLOT(showRestartWarning_Proxy())); ui->proxyIp->installEventFilter(this); /* Window elements init */ #ifdef Q_OS_MAC ui->tabWindow->setVisible(false); #endif /* Display elements init */ QDir translations(":translations"); ui->lang->addItem(QString("(") + tr("default") + QString(")"), QVariant("")); foreach(const QString &langStr, translations.entryList()) { QLocale locale(langStr); /** check if the locale name consists of 2 parts (language_country) */ if(langStr.contains("_")) { #if QT_VERSION >= 0x040800 /** display language strings as "native language - native country (locale name)", e.g. "Deutsch - Deutschland (de)" */ ui->lang->addItem(locale.nativeLanguageName() + QString(" - ") + locale.nativeCountryName() + QString(" (") + langStr + QString(")"), QVariant(langStr)); #else /** display language strings as "language - country (locale name)", e.g. "German - Germany (de)" */ ui->lang->addItem(QLocale::languageToString(locale.language()) + QString(" - ") + QLocale::countryToString(locale.country()) + QString(" (") + langStr + QString(")"), QVariant(langStr)); #endif } else { #if QT_VERSION >= 0x040800 /** display language strings as "native language (locale name)", e.g. "Deutsch (de)" */ ui->lang->addItem(locale.nativeLanguageName() + QString(" (") + langStr + QString(")"), QVariant(langStr)); #else /** display language strings as "language (locale name)", e.g. "German (de)" */ ui->lang->addItem(QLocale::languageToString(locale.language()) + QString(" (") + langStr + QString(")"), QVariant(langStr)); #endif } } ui->unit->setModel(new BitcoinUnits(this)); /* Widget-to-option mapper */ mapper = new MonitoredDataMapper(this); mapper->setSubmitPolicy(QDataWidgetMapper::ManualSubmit); mapper->setOrientation(Qt::Vertical); /* enable apply button when data modified */ connect(mapper, SIGNAL(viewModified()), this, SLOT(enableApplyButton())); /* disable apply button when new data loaded */ connect(mapper, SIGNAL(currentIndexChanged(int)), this, SLOT(disableApplyButton())); /* setup/change UI elements when proxy IP is invalid/valid */ connect(this, SIGNAL(proxyIpValid(QValidatedLineEdit *, bool)), this, SLOT(handleProxyIpValid(QValidatedLineEdit *, bool))); } OptionsDialog::~OptionsDialog() { delete ui; } void OptionsDialog::setModel(OptionsModel *model) { this->model = model; if(model) { connect(model, SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit())); mapper->setModel(model); setMapper(); mapper->toFirst(); } /* update the display unit, to not use the default ("BTC") */ updateDisplayUnit(); /* warn only when language selection changes by user action (placed here so init via mapper doesn't trigger this) */ connect(ui->lang, SIGNAL(valueChanged()), this, SLOT(showRestartWarning_Lang())); /* disable apply button after settings are loaded as there is nothing to save */ disableApplyButton(); } void OptionsDialog::setMapper() { /* Main */ mapper->addMapping(ui->transactionFee, OptionsModel::Fee); mapper->addMapping(ui->reserveBalance, OptionsModel::ReserveBalance); mapper->addMapping(ui->bitcoinAtStartup, OptionsModel::StartAtStartup); mapper->addMapping(ui->detachDatabases, OptionsModel::DetachDatabases); /* Network */ mapper->addMapping(ui->mapPortUpnp, OptionsModel::MapPortUPnP); mapper->addMapping(ui->connectSocks, OptionsModel::ProxyUse); mapper->addMapping(ui->proxyIp, OptionsModel::ProxyIP); mapper->addMapping(ui->proxyPort, OptionsModel::ProxyPort); mapper->addMapping(ui->socksVersion, OptionsModel::ProxySocksVersion); /* Window */ #ifndef Q_OS_MAC mapper->addMapping(ui->minimizeToTray, OptionsModel::MinimizeToTray); mapper->addMapping(ui->minimizeOnClose, OptionsModel::MinimizeOnClose); #endif /* Display */ mapper->addMapping(ui->lang, OptionsModel::Language); mapper->addMapping(ui->unit, OptionsModel::DisplayUnit); mapper->addMapping(ui->displayAddresses, OptionsModel::DisplayAddresses); mapper->addMapping(ui->coinControlFeatures, OptionsModel::CoinControlFeatures); } void OptionsDialog::enableApplyButton() { ui->applyButton->setEnabled(true); } void OptionsDialog::disableApplyButton() { ui->applyButton->setEnabled(false); } void OptionsDialog::enableSaveButtons() { /* prevent enabling of the save buttons when data modified, if there is an invalid proxy address present */ if(fProxyIpValid) setSaveButtonState(true); } void OptionsDialog::disableSaveButtons() { setSaveButtonState(false); } void OptionsDialog::setSaveButtonState(bool fState) { ui->applyButton->setEnabled(fState); ui->okButton->setEnabled(fState); } void OptionsDialog::on_okButton_clicked() { mapper->submit(); accept(); } void OptionsDialog::on_cancelButton_clicked() { reject(); } void OptionsDialog::on_applyButton_clicked() { mapper->submit(); disableApplyButton(); } void OptionsDialog::showRestartWarning_Proxy() { if(!fRestartWarningDisplayed_Proxy) { QMessageBox::warning(this, tr("Warning"), tr("This setting will take effect after restarting SperoCoin."), QMessageBox::Ok); fRestartWarningDisplayed_Proxy = true; } } void OptionsDialog::showRestartWarning_Lang() { if(!fRestartWarningDisplayed_Lang) { QMessageBox::warning(this, tr("Warning"), tr("This setting will take effect after restarting SperoCoin."), QMessageBox::Ok); fRestartWarningDisplayed_Lang = true; } } void OptionsDialog::updateDisplayUnit() { if(model) { /* Update transactionFee with the current unit */ ui->transactionFee->setDisplayUnit(model->getDisplayUnit()); } } void OptionsDialog::handleProxyIpValid(QValidatedLineEdit *object, bool fState) { // this is used in a check before re-enabling the save buttons fProxyIpValid = fState; if(fProxyIpValid) { enableSaveButtons(); ui->statusLabel->clear(); } else { disableSaveButtons(); object->setValid(fProxyIpValid); ui->statusLabel->setStyleSheet("QLabel { color: red; }"); ui->statusLabel->setText(tr("The supplied proxy address is invalid.")); } } bool OptionsDialog::eventFilter(QObject *object, QEvent *event) { if(event->type() == QEvent::FocusOut) { if(object == ui->proxyIp) { CService addr; /* Check proxyIp for a valid IPv4/IPv6 address and emit the proxyIpValid signal */ emit proxyIpValid(ui->proxyIp, LookupNumeric(ui->proxyIp->text().toStdString().c_str(), addr)); } } return QDialog::eventFilter(object, event); }
{ "content_hash": "0c07cb0c327f6827e165372b285c23ae", "timestamp": "", "source": "github", "line_count": 258, "max_line_length": 198, "avg_line_length": 31.94573643410853, "alnum_prop": 0.6762921620965785, "repo_name": "DigitalCoin1/DigitalCoinBRL", "id": "130e4f7c42d8ef06a8ee664a1c347e94cb526eb7", "size": "8242", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/qt/optionsdialog.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "Assembly", "bytes": "51312" }, { "name": "C", "bytes": "8339745" }, { "name": "C++", "bytes": "2950805" }, { "name": "CSS", "bytes": "1127" }, { "name": "HTML", "bytes": "50615" }, { "name": "Makefile", "bytes": "13767" }, { "name": "NSIS", "bytes": "5914" }, { "name": "Objective-C", "bytes": "858" }, { "name": "Objective-C++", "bytes": "3537" }, { "name": "Python", "bytes": "41580" }, { "name": "QMake", "bytes": "15853" }, { "name": "Roff", "bytes": "12684" }, { "name": "Shell", "bytes": "8201" } ], "symlink_target": "" }
package org.duracloud.account.app.controller; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; /** * The default view for this application * * @contributor dbernstein */ @Controller public class HomeController extends AbstractController { public static final String HOME_VIEW_ID = "home"; @RequestMapping(value = {"/index.html", "/", "", "/home.html", "/index", "/home"}) public ModelAndView home() { log.info("serving up the home page at {}", System.currentTimeMillis()); ModelAndView mav = new ModelAndView(); mav.setViewName(HOME_VIEW_ID); return mav; } @RequestMapping(value = {"/logout"}) public ModelAndView logout() { return home(); } @RequestMapping(value = {"/login"}) public String login() { return "login"; } }
{ "content_hash": "42a8a745c42cbea1a7cec6be3f3b68ec", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 86, "avg_line_length": 26.8, "alnum_prop": 0.6684434968017058, "repo_name": "duracloud/management-console", "id": "b99392acacb869f00b4a6d52e1025b4accde2efb", "size": "1156", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "account-management-app/src/main/java/org/duracloud/account/app/controller/HomeController.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "41522" }, { "name": "Java", "bytes": "639876" }, { "name": "JavaScript", "bytes": "29991" }, { "name": "Shell", "bytes": "2559" } ], "symlink_target": "" }
PASS='pass' # USER: GitHub user name USER='username' ORG=cthit repos=(hubbIT hubbIT-sniffer achieveIT bookIT playIT-grails misc auth wordpress dokument playIT-python chalmersit-wp-plugins Homestead chalmersit-rails chalmersit-account-rails CodeIT VoteIT HueIT-Rails nollkIT EatIT DreamTeamBots Hubben tv mat lounge wishlist) DATA='{ "name": "irc", "active": true, "events": [ "pull_request", "issues", "issue_comment" ], "config": { "server": "irc.chalmers.it", "port": "9999", "room": "digit-support", "nick": "GitHubBot", "ssl": "1", "message_without_join": "1", "no_colors": "0", "long_url": "0", "notice": "0" } }' for REPO in ${repos[@]}; do curl --user "$USER:$PASS" --include --request POST --data "$DATA" "https://api.github.com/repos/$ORG/$REPO/hooks" done
{ "content_hash": "12d786d3882a9bb2d0d59e3f82c4126d", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 261, "avg_line_length": 27.451612903225808, "alnum_prop": 0.6251468860164512, "repo_name": "cthit/misc", "id": "aff48bbcc44b5538fcae63470a7c0477b25c1ec6", "size": "1002", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "setup_github_irc_hook.sh", "mode": "33261", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "911" }, { "name": "Python", "bytes": "12608" }, { "name": "Ruby", "bytes": "3771" }, { "name": "Shell", "bytes": "3785" } ], "symlink_target": "" }
package org.seasar.doma.wrapper; import java.sql.Blob; import org.seasar.doma.DomaNullPointerException; /** A wrapper for the {@link Blob} class. */ public class BlobWrapper extends AbstractWrapper<Blob> { public BlobWrapper() { super(Blob.class); } public BlobWrapper(Blob value) { super(Blob.class, value); } @Override protected Blob doGetCopy() { return null; } @Override protected boolean doHasEqualValue(Object otherValue) { return false; } @Override public <R, P, Q, TH extends Throwable> R accept(WrapperVisitor<R, P, Q, TH> visitor, P p, Q q) throws TH { if (visitor == null) { throw new DomaNullPointerException("visitor"); } return visitor.visitBlobWrapper(this, p, q); } }
{ "content_hash": "b339bd35291db554f14b2e70adea46e9", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 96, "avg_line_length": 21.62857142857143, "alnum_prop": 0.6750330250990753, "repo_name": "domaframework/doma", "id": "b6ecc3a99d4d11097ee9e284bbe36b554500dc21", "size": "757", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "doma-core/src/main/java/org/seasar/doma/wrapper/BlobWrapper.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "4179496" }, { "name": "Kotlin", "bytes": "194380" } ], "symlink_target": "" }
'use strict'; angular.module('category').directive('category', [ function () { return { restrict: 'E', replace: true, controllerAs: '__', templateUrl: 'modules/category/client/templates/category.client.template.html', scope: { category: '=category', remove: '&remove', index: '=index' }, controller: ['$mdDialog', '$scope', 'CategoryService', function ($mdDialog, $scope, CategoryService) { let vm = this; let btnNames = ['rename', 'save']; let newName = $scope.category.name; vm.editText = btnNames[0]; vm.editing = false; // This will be toggled between edit and save // Button name and classes change vm.openMenu = ($mdOpenMenu, ev) => { $mdOpenMenu(ev); }; // Button's name changes vm.edit = () => { changeEditingState(); // Categories name get's sent to the DB if ($scope.category.name !== '') { if (!vm.editing && newName !== $scope.category.name) { newName = $scope.category.name; CategoryService.updateName($scope.category) .success((response) => { console.log(response); }); } } else { $scope.category.name = newName; } }; let changeEditingState = () => { vm.editing = !vm.editing; vm.editText = vm.editing ? btnNames[1] : btnNames[0]; } } ] }; } ]);
{ "content_hash": "471b1362531730498d7c23a5e4154f77", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 91, "avg_line_length": 37.44642857142857, "alnum_prop": 0.3748211731044349, "repo_name": "S00157097/GP", "id": "e294acd57683daee22440f6f792f33cfaa6f95f7", "size": "2097", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "modules/category/client/directives/category.client.directive.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "4910" }, { "name": "HTML", "bytes": "72901" }, { "name": "JavaScript", "bytes": "341314" }, { "name": "Shell", "bytes": "685" } ], "symlink_target": "" }
/* -- MAGMA (version 1.6.1) -- Univ. of Tennessee, Knoxville Univ. of California, Berkeley Univ. of Colorado, Denver @date January 2015 @generated from magma_zlapack.h normal z -> c, Fri Jan 30 19:00:06 2015 */ #ifndef MAGMA_CLAPACK_H #define MAGMA_CLAPACK_H #include "magma_types.h" #include "magma_mangling.h" #define COMPLEX #ifdef __cplusplus extern "C" { #endif /* //////////////////////////////////////////////////////////////////////////// -- BLAS and LAPACK functions (alphabetical order) */ #define blasf77_icamax FORTRAN_NAME( icamax, ICAMAX ) #define blasf77_caxpy FORTRAN_NAME( caxpy, CAXPY ) #define blasf77_ccopy FORTRAN_NAME( ccopy, CCOPY ) #define blasf77_cgemm FORTRAN_NAME( cgemm, CGEMM ) #define blasf77_cgemv FORTRAN_NAME( cgemv, CGEMV ) #define blasf77_cgerc FORTRAN_NAME( cgerc, CGERC ) #define blasf77_cgeru FORTRAN_NAME( cgeru, CGERU ) #define blasf77_chemm FORTRAN_NAME( chemm, CHEMM ) #define blasf77_chemv FORTRAN_NAME( chemv, CHEMV ) #define blasf77_cher FORTRAN_NAME( cher, CHER ) #define blasf77_cher2 FORTRAN_NAME( cher2, CHER2 ) #define blasf77_cher2k FORTRAN_NAME( cher2k, CHER2K ) #define blasf77_cherk FORTRAN_NAME( cherk, CHERK ) #define blasf77_cscal FORTRAN_NAME( cscal, CSCAL ) #define blasf77_csscal FORTRAN_NAME( csscal, CSSCAL ) #define blasf77_cswap FORTRAN_NAME( cswap, CSWAP ) #define blasf77_csymm FORTRAN_NAME( csymm, CSYMM ) #define blasf77_csyr2k FORTRAN_NAME( csyr2k, CSYR2K ) #define blasf77_csyrk FORTRAN_NAME( csyrk, CSYRK ) #define blasf77_crotg FORTRAN_NAME( crotg, CROTG ) #define blasf77_crot FORTRAN_NAME( crot, CROT ) #define blasf77_csrot FORTRAN_NAME( csrot, CSROT ) #define blasf77_ctrmm FORTRAN_NAME( ctrmm, CTRMM ) #define blasf77_ctrmv FORTRAN_NAME( ctrmv, CTRMV ) #define blasf77_ctrsm FORTRAN_NAME( ctrsm, CTRSM ) #define blasf77_ctrsv FORTRAN_NAME( ctrsv, CTRSV ) #define lapackf77_slaed2 FORTRAN_NAME( slaed2, SLAED2 ) #define lapackf77_slaed4 FORTRAN_NAME( slaed4, SLAED4 ) #define lapackf77_slaln2 FORTRAN_NAME( slaln2, SLALN2 ) #define lapackf77_slamc3 FORTRAN_NAME( slamc3, SLAMC3 ) #define lapackf77_slamrg FORTRAN_NAME( slamrg, SLAMRG ) #define lapackf77_slasrt FORTRAN_NAME( slasrt, SLASRT ) #define lapackf77_sstebz FORTRAN_NAME( sstebz, SSTEBZ ) #define lapackf77_sbdsdc FORTRAN_NAME( sbdsdc, SBDSDC ) #define lapackf77_cbdsqr FORTRAN_NAME( cbdsqr, CBDSQR ) #define lapackf77_cgebak FORTRAN_NAME( cgebak, CGEBAK ) #define lapackf77_cgebal FORTRAN_NAME( cgebal, CGEBAL ) #define lapackf77_cgebd2 FORTRAN_NAME( cgebd2, CGEBD2 ) #define lapackf77_cgebrd FORTRAN_NAME( cgebrd, CGEBRD ) #define lapackf77_cgbbrd FORTRAN_NAME( cgbbrd, CGBBRD ) #define lapackf77_cgeev FORTRAN_NAME( cgeev, CGEEV ) #define lapackf77_cgehd2 FORTRAN_NAME( cgehd2, CGEHD2 ) #define lapackf77_cgehrd FORTRAN_NAME( cgehrd, CGEHRD ) #define lapackf77_cgelqf FORTRAN_NAME( cgelqf, CGELQF ) #define lapackf77_cgels FORTRAN_NAME( cgels, CGELS ) #define lapackf77_cgeqlf FORTRAN_NAME( cgeqlf, CGEQLF ) #define lapackf77_cgeqp3 FORTRAN_NAME( cgeqp3, CGEQP3 ) #define lapackf77_cgeqrf FORTRAN_NAME( cgeqrf, CGEQRF ) #define lapackf77_cgesdd FORTRAN_NAME( cgesdd, CGESDD ) #define lapackf77_cgesv FORTRAN_NAME( cgesv, CGESV ) #define lapackf77_cgesvd FORTRAN_NAME( cgesvd, CGESVD ) #define lapackf77_cgetrf FORTRAN_NAME( cgetrf, CGETRF ) #define lapackf77_cgetri FORTRAN_NAME( cgetri, CGETRI ) #define lapackf77_cgetrs FORTRAN_NAME( cgetrs, CGETRS ) #define lapackf77_chetf2 FORTRAN_NAME( chetf2, CHETF2 ) #define lapackf77_chetrs FORTRAN_NAME( chetrs, CHETRS ) #define lapackf77_chbtrd FORTRAN_NAME( chbtrd, CHBTRD ) #define lapackf77_cheev FORTRAN_NAME( cheev, CHEEV ) #define lapackf77_cheevd FORTRAN_NAME( cheevd, CHEEVD ) #define lapackf77_cheevr FORTRAN_NAME( cheevr, CHEEVR ) #define lapackf77_cheevx FORTRAN_NAME( cheevx, CHEEVX ) #define lapackf77_chegs2 FORTRAN_NAME( chegs2, CHEGS2 ) #define lapackf77_chegst FORTRAN_NAME( chegst, CHEGST ) #define lapackf77_chegvd FORTRAN_NAME( chegvd, CHEGVD ) #define lapackf77_chesv FORTRAN_NAME( chesv, CHESV ) #define lapackf77_chetd2 FORTRAN_NAME( chetd2, CHETD2 ) #define lapackf77_chetrd FORTRAN_NAME( chetrd, CHETRD ) #define lapackf77_chetrf FORTRAN_NAME( chetrf, CHETRF ) #define lapackf77_chseqr FORTRAN_NAME( chseqr, CHSEQR ) #define lapackf77_clabrd FORTRAN_NAME( clabrd, CLABRD ) #define lapackf77_clacgv FORTRAN_NAME( clacgv, CLACGV ) #define lapackf77_clacp2 FORTRAN_NAME( clacp2, CLACP2 ) #define lapackf77_clacpy FORTRAN_NAME( clacpy, CLACPY ) #define lapackf77_clacrm FORTRAN_NAME( clacrm, CLACRM ) #define lapackf77_cladiv FORTRAN_NAME( cladiv, CLADIV ) #define lapackf77_clahef FORTRAN_NAME( clahef, CLAHEF ) #define lapackf77_clange FORTRAN_NAME( clange, CLANGE ) #define lapackf77_clanhe FORTRAN_NAME( clanhe, CLANHE ) #define lapackf77_clanht FORTRAN_NAME( clanht, CLANHT ) #define lapackf77_clansy FORTRAN_NAME( clansy, CLANSY ) #define lapackf77_clantr FORTRAN_NAME( clantr, CLANTR ) #define lapackf77_slapy3 FORTRAN_NAME( slapy3, SLAPY3 ) #define lapackf77_claqp2 FORTRAN_NAME( claqp2, CLAQP2 ) #define lapackf77_clarcm FORTRAN_NAME( clarcm, CLARCM ) #define lapackf77_clarf FORTRAN_NAME( clarf, CLARF ) #define lapackf77_clarfb FORTRAN_NAME( clarfb, CLARFB ) #define lapackf77_clarfg FORTRAN_NAME( clarfg, CLARFG ) #define lapackf77_clarft FORTRAN_NAME( clarft, CLARFT ) #define lapackf77_clarnv FORTRAN_NAME( clarnv, CLARNV ) #define lapackf77_clartg FORTRAN_NAME( clartg, CLARTG ) #define lapackf77_clascl FORTRAN_NAME( clascl, CLASCL ) #define lapackf77_claset FORTRAN_NAME( claset, CLASET ) #define lapackf77_claswp FORTRAN_NAME( claswp, CLASWP ) #define lapackf77_clatrd FORTRAN_NAME( clatrd, CLATRD ) #define lapackf77_clatrs FORTRAN_NAME( clatrs, CLATRS ) #define lapackf77_clauum FORTRAN_NAME( clauum, CLAUUM ) #define lapackf77_clavhe FORTRAN_NAME( clavhe, CLAVHE ) #define lapackf77_cposv FORTRAN_NAME( cposv, CPOSV ) #define lapackf77_cpotrf FORTRAN_NAME( cpotrf, CPOTRF ) #define lapackf77_cpotri FORTRAN_NAME( cpotri, CPOTRI ) #define lapackf77_cpotrs FORTRAN_NAME( cpotrs, CPOTRS ) #define lapackf77_cstedc FORTRAN_NAME( cstedc, CSTEDC ) #define lapackf77_cstein FORTRAN_NAME( cstein, CSTEIN ) #define lapackf77_cstemr FORTRAN_NAME( cstemr, CSTEMR ) #define lapackf77_csteqr FORTRAN_NAME( csteqr, CSTEQR ) #define lapackf77_csymv FORTRAN_NAME( csymv, CSYMV ) #define lapackf77_ctrevc FORTRAN_NAME( ctrevc, CTREVC ) #define lapackf77_ctrevc3 FORTRAN_NAME( ctrevc3, CTREVC3 ) #define lapackf77_ctrtri FORTRAN_NAME( ctrtri, CTRTRI ) #define lapackf77_cung2r FORTRAN_NAME( cung2r, CUNG2R ) #define lapackf77_cungbr FORTRAN_NAME( cungbr, CUNGBR ) #define lapackf77_cunghr FORTRAN_NAME( cunghr, CUNGHR ) #define lapackf77_cunglq FORTRAN_NAME( cunglq, CUNGLQ ) #define lapackf77_cungql FORTRAN_NAME( cungql, CUNGQL ) #define lapackf77_cungqr FORTRAN_NAME( cungqr, CUNGQR ) #define lapackf77_cungtr FORTRAN_NAME( cungtr, CUNGTR ) #define lapackf77_cunm2r FORTRAN_NAME( cunm2r, CUNM2R ) #define lapackf77_cunmbr FORTRAN_NAME( cunmbr, CUNMBR ) #define lapackf77_cunmlq FORTRAN_NAME( cunmlq, CUNMLQ ) #define lapackf77_cunmql FORTRAN_NAME( cunmql, CUNMQL ) #define lapackf77_cunmqr FORTRAN_NAME( cunmqr, CUNMQR ) #define lapackf77_cunmtr FORTRAN_NAME( cunmtr, CUNMTR ) /* testing functions (alphabetical order) */ #define lapackf77_cbdt01 FORTRAN_NAME( cbdt01, CBDT01 ) #define lapackf77_cget22 FORTRAN_NAME( cget22, CGET22 ) #define lapackf77_chet21 FORTRAN_NAME( chet21, CHET21 ) #define lapackf77_chst01 FORTRAN_NAME( chst01, CHST01 ) #define lapackf77_clarfx FORTRAN_NAME( clarfx, CLARFX ) #define lapackf77_clarfy FORTRAN_NAME( clarfy, CLARFY ) #define lapackf77_clatms FORTRAN_NAME( clatms, CLATMS ) #define lapackf77_cqpt01 FORTRAN_NAME( cqpt01, CQPT01 ) #define lapackf77_cqrt02 FORTRAN_NAME( cqrt02, CQRT02 ) #define lapackf77_cstt21 FORTRAN_NAME( cstt21, CSTT21 ) #define lapackf77_cunt01 FORTRAN_NAME( cunt01, CUNT01 ) /* * BLAS functions (alphabetical order) */ magma_int_t blasf77_icamax( const magma_int_t *n, const magmaFloatComplex *x, const magma_int_t *incx ); void blasf77_caxpy( const magma_int_t *n, const magmaFloatComplex *alpha, const magmaFloatComplex *x, const magma_int_t *incx, magmaFloatComplex *y, const magma_int_t *incy ); void blasf77_ccopy( const magma_int_t *n, const magmaFloatComplex *x, const magma_int_t *incx, magmaFloatComplex *y, const magma_int_t *incy ); void blasf77_cgemm( const char *transa, const char *transb, const magma_int_t *m, const magma_int_t *n, const magma_int_t *k, const magmaFloatComplex *alpha, const magmaFloatComplex *A, const magma_int_t *lda, const magmaFloatComplex *B, const magma_int_t *ldb, const magmaFloatComplex *beta, magmaFloatComplex *C, const magma_int_t *ldc ); void blasf77_cgemv( const char *transa, const magma_int_t *m, const magma_int_t *n, const magmaFloatComplex *alpha, const magmaFloatComplex *A, const magma_int_t *lda, const magmaFloatComplex *x, const magma_int_t *incx, const magmaFloatComplex *beta, magmaFloatComplex *y, const magma_int_t *incy ); void blasf77_cgerc( const magma_int_t *m, const magma_int_t *n, const magmaFloatComplex *alpha, const magmaFloatComplex *x, const magma_int_t *incx, const magmaFloatComplex *y, const magma_int_t *incy, magmaFloatComplex *A, const magma_int_t *lda ); void blasf77_cgeru( const magma_int_t *m, const magma_int_t *n, const magmaFloatComplex *alpha, const magmaFloatComplex *x, const magma_int_t *incx, const magmaFloatComplex *y, const magma_int_t *incy, magmaFloatComplex *A, const magma_int_t *lda ); void blasf77_chemm( const char *side, const char *uplo, const magma_int_t *m, const magma_int_t *n, const magmaFloatComplex *alpha, const magmaFloatComplex *A, const magma_int_t *lda, const magmaFloatComplex *B, const magma_int_t *ldb, const magmaFloatComplex *beta, magmaFloatComplex *C, const magma_int_t *ldc ); void blasf77_chemv( const char *uplo, const magma_int_t *n, const magmaFloatComplex *alpha, const magmaFloatComplex *A, const magma_int_t *lda, const magmaFloatComplex *x, const magma_int_t *incx, const magmaFloatComplex *beta, magmaFloatComplex *y, const magma_int_t *incy ); void blasf77_cher( const char *uplo, const magma_int_t *n, const float *alpha, const magmaFloatComplex *x, const magma_int_t *incx, magmaFloatComplex *A, const magma_int_t *lda ); void blasf77_cher2( const char *uplo, const magma_int_t *n, const magmaFloatComplex *alpha, const magmaFloatComplex *x, const magma_int_t *incx, const magmaFloatComplex *y, const magma_int_t *incy, magmaFloatComplex *A, const magma_int_t *lda ); void blasf77_cher2k( const char *uplo, const char *trans, const magma_int_t *n, const magma_int_t *k, const magmaFloatComplex *alpha, const magmaFloatComplex *A, const magma_int_t *lda, const magmaFloatComplex *B, const magma_int_t *ldb, const float *beta, magmaFloatComplex *C, const magma_int_t *ldc ); void blasf77_cherk( const char *uplo, const char *trans, const magma_int_t *n, const magma_int_t *k, const float *alpha, const magmaFloatComplex *A, const magma_int_t *lda, const float *beta, magmaFloatComplex *C, const magma_int_t *ldc ); void blasf77_cscal( const magma_int_t *n, const magmaFloatComplex *alpha, magmaFloatComplex *x, const magma_int_t *incx ); void blasf77_csscal( const magma_int_t *n, const float *alpha, magmaFloatComplex *x, const magma_int_t *incx ); void blasf77_cswap( const magma_int_t *n, magmaFloatComplex *x, const magma_int_t *incx, magmaFloatComplex *y, const magma_int_t *incy ); /* complex-symmetric (non-Hermitian) routines */ void blasf77_csymm( const char *side, const char *uplo, const magma_int_t *m, const magma_int_t *n, const magmaFloatComplex *alpha, const magmaFloatComplex *A, const magma_int_t *lda, const magmaFloatComplex *B, const magma_int_t *ldb, const magmaFloatComplex *beta, magmaFloatComplex *C, const magma_int_t *ldc ); void blasf77_csyr2k( const char *uplo, const char *trans, const magma_int_t *n, const magma_int_t *k, const magmaFloatComplex *alpha, const magmaFloatComplex *A, const magma_int_t *lda, const magmaFloatComplex *B, const magma_int_t *ldb, const magmaFloatComplex *beta, magmaFloatComplex *C, const magma_int_t *ldc ); void blasf77_csyrk( const char *uplo, const char *trans, const magma_int_t *n, const magma_int_t *k, const magmaFloatComplex *alpha, const magmaFloatComplex *A, const magma_int_t *lda, const magmaFloatComplex *beta, magmaFloatComplex *C, const magma_int_t *ldc ); void blasf77_crotg( magmaFloatComplex *ca, const magmaFloatComplex *cb, float *c, magmaFloatComplex *s ); void blasf77_crot( const magma_int_t *n, magmaFloatComplex *x, const magma_int_t *incx, magmaFloatComplex *y, const magma_int_t *incy, const float *c, const magmaFloatComplex *s ); void blasf77_csrot( const magma_int_t *n, magmaFloatComplex *x, const magma_int_t *incx, magmaFloatComplex *y, const magma_int_t *incy, const float *c, const float *s ); void blasf77_ctrmm( const char *side, const char *uplo, const char *transa, const char *diag, const magma_int_t *m, const magma_int_t *n, const magmaFloatComplex *alpha, const magmaFloatComplex *A, const magma_int_t *lda, magmaFloatComplex *B, const magma_int_t *ldb ); void blasf77_ctrmv( const char *uplo, const char *transa, const char *diag, const magma_int_t *n, const magmaFloatComplex *A, const magma_int_t *lda, magmaFloatComplex *x, const magma_int_t *incx ); void blasf77_ctrsm( const char *side, const char *uplo, const char *transa, const char *diag, const magma_int_t *m, const magma_int_t *n, const magmaFloatComplex *alpha, const magmaFloatComplex *A, const magma_int_t *lda, magmaFloatComplex *B, const magma_int_t *ldb ); void blasf77_ctrsv( const char *uplo, const char *transa, const char *diag, const magma_int_t *n, const magmaFloatComplex *A, const magma_int_t *lda, magmaFloatComplex *x, const magma_int_t *incx ); /* //////////////////////////////////////////////////////////////////////////// -- MAGMA wrappers around BLAS functions (alphabetical order) The Fortran interface for these is not portable, so we provide a C interface identical to the Fortran interface. */ float magma_cblas_scasum( magma_int_t n, const magmaFloatComplex *x, magma_int_t incx ); float magma_cblas_scnrm2( magma_int_t n, const magmaFloatComplex *x, magma_int_t incx ); magmaFloatComplex magma_cblas_cdotc( magma_int_t n, const magmaFloatComplex *x, magma_int_t incx, const magmaFloatComplex *y, magma_int_t incy ); magmaFloatComplex magma_cblas_cdotu( magma_int_t n, const magmaFloatComplex *x, magma_int_t incx, const magmaFloatComplex *y, magma_int_t incy ); /* * LAPACK functions (alphabetical order) */ #ifdef REAL void lapackf77_sbdsdc( const char *uplo, const char *compq, const magma_int_t *n, float *d, float *e, float *U, const magma_int_t *ldu, float *VT, const magma_int_t *ldvt, float *Q, magma_int_t *IQ, float *work, magma_int_t *iwork, magma_int_t *info ); #endif void lapackf77_cbdsqr( const char *uplo, const magma_int_t *n, const magma_int_t *ncvt, const magma_int_t *nru, const magma_int_t *ncc, float *d, float *e, magmaFloatComplex *Vt, const magma_int_t *ldvt, magmaFloatComplex *U, const magma_int_t *ldu, magmaFloatComplex *C, const magma_int_t *ldc, float *work, magma_int_t *info ); void lapackf77_cgebak( const char *job, const char *side, const magma_int_t *n, const magma_int_t *ilo, const magma_int_t *ihi, const float *scale, const magma_int_t *m, magmaFloatComplex *V, const magma_int_t *ldv, magma_int_t *info ); void lapackf77_cgebal( const char *job, const magma_int_t *n, magmaFloatComplex *A, const magma_int_t *lda, magma_int_t *ilo, magma_int_t *ihi, float *scale, magma_int_t *info ); void lapackf77_cgebd2( const magma_int_t *m, const magma_int_t *n, magmaFloatComplex *A, const magma_int_t *lda, float *d, float *e, magmaFloatComplex *tauq, magmaFloatComplex *taup, magmaFloatComplex *work, magma_int_t *info ); void lapackf77_cgebrd( const magma_int_t *m, const magma_int_t *n, magmaFloatComplex *A, const magma_int_t *lda, float *d, float *e, magmaFloatComplex *tauq, magmaFloatComplex *taup, magmaFloatComplex *work, const magma_int_t *lwork, magma_int_t *info ); void lapackf77_cgbbrd( const char *vect, const magma_int_t *m, const magma_int_t *n, const magma_int_t *ncc, const magma_int_t *kl, const magma_int_t *ku, magmaFloatComplex *Ab, const magma_int_t *ldab, float *d, float *e, magmaFloatComplex *Q, const magma_int_t *ldq, magmaFloatComplex *PT, const magma_int_t *ldpt, magmaFloatComplex *C, const magma_int_t *ldc, magmaFloatComplex *work, #ifdef COMPLEX float *rwork, #endif magma_int_t *info ); void lapackf77_cgeev( const char *jobvl, const char *jobvr, const magma_int_t *n, magmaFloatComplex *A, const magma_int_t *lda, #ifdef COMPLEX magmaFloatComplex *w, #else float *wr, float *wi, #endif magmaFloatComplex *Vl, const magma_int_t *ldvl, magmaFloatComplex *Vr, const magma_int_t *ldvr, magmaFloatComplex *work, const magma_int_t *lwork, #ifdef COMPLEX float *rwork, #endif magma_int_t *info ); void lapackf77_cgehd2( const magma_int_t *n, const magma_int_t *ilo, const magma_int_t *ihi, magmaFloatComplex *A, const magma_int_t *lda, magmaFloatComplex *tau, magmaFloatComplex *work, magma_int_t *info ); void lapackf77_cgehrd( const magma_int_t *n, const magma_int_t *ilo, const magma_int_t *ihi, magmaFloatComplex *A, const magma_int_t *lda, magmaFloatComplex *tau, magmaFloatComplex *work, const magma_int_t *lwork, magma_int_t *info ); void lapackf77_cgelqf( const magma_int_t *m, const magma_int_t *n, magmaFloatComplex *A, const magma_int_t *lda, magmaFloatComplex *tau, magmaFloatComplex *work, const magma_int_t *lwork, magma_int_t *info ); void lapackf77_cgels( const char *trans, const magma_int_t *m, const magma_int_t *n, const magma_int_t *nrhs, magmaFloatComplex *A, const magma_int_t *lda, magmaFloatComplex *B, const magma_int_t *ldb, magmaFloatComplex *work, const magma_int_t *lwork, magma_int_t *info ); void lapackf77_cgeqlf( const magma_int_t *m, const magma_int_t *n, magmaFloatComplex *A, const magma_int_t *lda, magmaFloatComplex *tau, magmaFloatComplex *work, const magma_int_t *lwork, magma_int_t *info ); void lapackf77_cgeqp3( const magma_int_t *m, const magma_int_t *n, magmaFloatComplex *A, const magma_int_t *lda, magma_int_t *jpvt, magmaFloatComplex *tau, magmaFloatComplex *work, const magma_int_t *lwork, #ifdef COMPLEX float *rwork, #endif magma_int_t *info ); void lapackf77_cgeqrf( const magma_int_t *m, const magma_int_t *n, magmaFloatComplex *A, const magma_int_t *lda, magmaFloatComplex *tau, magmaFloatComplex *work, const magma_int_t *lwork, magma_int_t *info ); void lapackf77_cgesdd( const char *jobz, const magma_int_t *m, const magma_int_t *n, magmaFloatComplex *A, const magma_int_t *lda, float *s, magmaFloatComplex *U, const magma_int_t *ldu, magmaFloatComplex *Vt, const magma_int_t *ldvt, magmaFloatComplex *work, const magma_int_t *lwork, #ifdef COMPLEX float *rwork, #endif magma_int_t *iwork, magma_int_t *info ); void lapackf77_cgesv( const magma_int_t *n, const magma_int_t *nrhs, magmaFloatComplex *A, const magma_int_t *lda, magma_int_t *ipiv, magmaFloatComplex *B, const magma_int_t *ldb, magma_int_t *info ); void lapackf77_cgesvd( const char *jobu, const char *jobvt, const magma_int_t *m, const magma_int_t *n, magmaFloatComplex *A, const magma_int_t *lda, float *s, magmaFloatComplex *U, const magma_int_t *ldu, magmaFloatComplex *Vt, const magma_int_t *ldvt, magmaFloatComplex *work, const magma_int_t *lwork, #ifdef COMPLEX float *rwork, #endif magma_int_t *info ); void lapackf77_cgetrf( const magma_int_t *m, const magma_int_t *n, magmaFloatComplex *A, const magma_int_t *lda, magma_int_t *ipiv, magma_int_t *info ); void lapackf77_cgetri( const magma_int_t *n, magmaFloatComplex *A, const magma_int_t *lda, const magma_int_t *ipiv, magmaFloatComplex *work, const magma_int_t *lwork, magma_int_t *info ); void lapackf77_cgetrs( const char *trans, const magma_int_t *n, const magma_int_t *nrhs, const magmaFloatComplex *A, const magma_int_t *lda, const magma_int_t *ipiv, magmaFloatComplex *B, const magma_int_t *ldb, magma_int_t *info ); void lapackf77_chetf2( const char*, magma_int_t*, magmaFloatComplex*, magma_int_t*, magma_int_t*, magma_int_t* ); void lapackf77_chetrs( const char *uplo, const magma_int_t *n, const magma_int_t *nrhs, const magmaFloatComplex *A, const magma_int_t *lda, const magma_int_t *ipiv, magmaFloatComplex *B, const magma_int_t *ldb, magma_int_t *info ); void lapackf77_chbtrd( const char *vect, const char *uplo, const magma_int_t *n, const magma_int_t *kd, magmaFloatComplex *Ab, const magma_int_t *ldab, float *d, float *e, magmaFloatComplex *Q, const magma_int_t *ldq, magmaFloatComplex *work, magma_int_t *info ); void lapackf77_cheev( const char *jobz, const char *uplo, const magma_int_t *n, magmaFloatComplex *A, const magma_int_t *lda, float *w, magmaFloatComplex *work, const magma_int_t *lwork, #ifdef COMPLEX float *rwork, #endif magma_int_t *info ); void lapackf77_cheevd( const char *jobz, const char *uplo, const magma_int_t *n, magmaFloatComplex *A, const magma_int_t *lda, float *w, magmaFloatComplex *work, const magma_int_t *lwork, #ifdef COMPLEX float *rwork, const magma_int_t *lrwork, #endif magma_int_t *iwork, const magma_int_t *liwork, magma_int_t *info ); void lapackf77_cheevr( const char *jobz, const char *range, const char *uplo, const magma_int_t *n, magmaFloatComplex *A, const magma_int_t *lda, float *vl, float *vu, magma_int_t *il, magma_int_t *iu, float *abstol, magma_int_t *m, float *w, magmaFloatComplex *z__, magma_int_t *ldz, magma_int_t *isuppz, magmaFloatComplex *work, magma_int_t *lwork, float *rwork, magma_int_t *lrwork, magma_int_t *iwork, magma_int_t *liwork, magma_int_t *info); void lapackf77_cheevx( const char *jobz, const char *range, const char *uplo, const magma_int_t *n, magmaFloatComplex *A, const magma_int_t *lda, float *vl, float *vu, magma_int_t *il, magma_int_t *iu, float *abstol, magma_int_t *m, float *w, magmaFloatComplex *z__, magma_int_t *ldz, magmaFloatComplex *work, magma_int_t *lwork, float *rwork, magma_int_t *iwork, magma_int_t *ifail, magma_int_t *info); void lapackf77_chegs2( const magma_int_t *itype, const char *uplo, const magma_int_t *n, magmaFloatComplex *A, const magma_int_t *lda, magmaFloatComplex *B, const magma_int_t *ldb, magma_int_t *info ); void lapackf77_chegst( const magma_int_t *itype, const char *uplo, const magma_int_t *n, magmaFloatComplex *A, const magma_int_t *lda, magmaFloatComplex *B, const magma_int_t *ldb, magma_int_t *info ); void lapackf77_chegvd( const magma_int_t *itype, const char *jobz, const char *uplo, const magma_int_t *n, magmaFloatComplex *A, const magma_int_t *lda, magmaFloatComplex *B, const magma_int_t *ldb, float *w, magmaFloatComplex *work, const magma_int_t *lwork, #ifdef COMPLEX float *rwork, const magma_int_t *lrwork, #endif magma_int_t *iwork, const magma_int_t *liwork, magma_int_t *info ); void lapackf77_chesv( const char *uplo, const magma_int_t *n, const magma_int_t *nrhs, magmaFloatComplex *A, const magma_int_t *lda, magma_int_t *ipiv, magmaFloatComplex *B, const magma_int_t *ldb, magmaFloatComplex *work, const magma_int_t *lwork, magma_int_t *info ); void lapackf77_chetd2( const char *uplo, const magma_int_t *n, magmaFloatComplex *A, const magma_int_t *lda, float *d, float *e, magmaFloatComplex *tau, magma_int_t *info ); void lapackf77_chetrd( const char *uplo, const magma_int_t *n, magmaFloatComplex *A, const magma_int_t *lda, float *d, float *e, magmaFloatComplex *tau, magmaFloatComplex *work, const magma_int_t *lwork, magma_int_t *info ); void lapackf77_chetrf( const char *uplo, const magma_int_t *n, magmaFloatComplex *A, const magma_int_t *lda, magma_int_t *ipiv, magmaFloatComplex *work, const magma_int_t *lwork, magma_int_t *info ); void lapackf77_chseqr( const char *job, const char *compz, const magma_int_t *n, const magma_int_t *ilo, const magma_int_t *ihi, magmaFloatComplex *H, const magma_int_t *ldh, #ifdef COMPLEX magmaFloatComplex *w, #else float *wr, float *wi, #endif magmaFloatComplex *Z, const magma_int_t *ldz, magmaFloatComplex *work, const magma_int_t *lwork, magma_int_t *info ); void lapackf77_clabrd( const magma_int_t *m, const magma_int_t *n, const magma_int_t *nb, magmaFloatComplex *A, const magma_int_t *lda, float *d, float *e, magmaFloatComplex *tauq, magmaFloatComplex *taup, magmaFloatComplex *X, const magma_int_t *ldx, magmaFloatComplex *Y, const magma_int_t *ldy ); #ifdef COMPLEX void lapackf77_clacgv( const magma_int_t *n, magmaFloatComplex *x, const magma_int_t *incx ); #endif #ifdef COMPLEX void lapackf77_clacp2( const char *uplo, const magma_int_t *m, const magma_int_t *n, const float *A, const magma_int_t *lda, magmaFloatComplex *B, const magma_int_t *ldb ); #endif void lapackf77_clacpy( const char *uplo, const magma_int_t *m, const magma_int_t *n, const magmaFloatComplex *A, const magma_int_t *lda, magmaFloatComplex *B, const magma_int_t *ldb ); #ifdef COMPLEX void lapackf77_clacrm( const magma_int_t *m, const magma_int_t *n, const magmaFloatComplex *A, const magma_int_t *lda, const float *B, const magma_int_t *ldb, magmaFloatComplex *C, const magma_int_t *ldc, float *rwork ); #endif #ifdef COMPLEX void lapackf77_cladiv( magmaFloatComplex *ret_val, magmaFloatComplex *x, magmaFloatComplex *y ); #else // REAL void lapackf77_cladiv( const float *a, const float *b, const float *c, const float *d, float *p, float *q ); #endif void lapackf77_clahef( const char *uplo, const magma_int_t *n, const magma_int_t *kn, magma_int_t *kb, magmaFloatComplex *A, const magma_int_t lda, magma_int_t *ipiv, magmaFloatComplex *work, const magma_int_t *ldwork, magma_int_t *info ); float lapackf77_clange( const char *norm, const magma_int_t *m, const magma_int_t *n, const magmaFloatComplex *A, const magma_int_t *lda, float *work ); float lapackf77_clanhe( const char *norm, const char *uplo, const magma_int_t *n, const magmaFloatComplex *A, const magma_int_t *lda, float *work ); float lapackf77_clanht( const char *norm, const magma_int_t *n, const float *d, const magmaFloatComplex *e ); float lapackf77_clansy( const char *norm, const char *uplo, const magma_int_t *n, const magmaFloatComplex *A, const magma_int_t *lda, float *work ); float lapackf77_clantr( const char *norm, const char *uplo, const char *diag, const magma_int_t *m, const magma_int_t *n, const magmaFloatComplex *A, const magma_int_t *lda, float *work ); void lapackf77_claqp2( magma_int_t *m, magma_int_t *n, magma_int_t *offset, magmaFloatComplex *a, magma_int_t *lda, magma_int_t *jpvt, magmaFloatComplex *tau, float *vn1, float *vn2, magmaFloatComplex *work ); #ifdef COMPLEX void lapackf77_clarcm( const magma_int_t *m, const magma_int_t *n, const float *A, const magma_int_t *lda, const magmaFloatComplex *B, const magma_int_t *ldb, magmaFloatComplex *C, const magma_int_t *ldc, float *rwork ); #endif void lapackf77_clarf( const char *side, const magma_int_t *m, const magma_int_t *n, magmaFloatComplex *v, const magma_int_t *incv, magmaFloatComplex *tau, magmaFloatComplex *C, const magma_int_t *ldc, magmaFloatComplex *work ); void lapackf77_clarfb( const char *side, const char *trans, const char *direct, const char *storev, const magma_int_t *m, const magma_int_t *n, const magma_int_t *k, const magmaFloatComplex *V, const magma_int_t *ldv, const magmaFloatComplex *T, const magma_int_t *ldt, magmaFloatComplex *C, const magma_int_t *ldc, magmaFloatComplex *work, const magma_int_t *ldwork ); void lapackf77_clarfg( const magma_int_t *n, magmaFloatComplex *alpha, magmaFloatComplex *x, const magma_int_t *incx, magmaFloatComplex *tau ); void lapackf77_clarft( const char *direct, const char *storev, const magma_int_t *n, const magma_int_t *k, magmaFloatComplex *V, const magma_int_t *ldv, const magmaFloatComplex *tau, magmaFloatComplex *T, const magma_int_t *ldt ); void lapackf77_clarnv( const magma_int_t *idist, magma_int_t *iseed, const magma_int_t *n, magmaFloatComplex *x ); void lapackf77_clartg( magmaFloatComplex *F, magmaFloatComplex *G, float *cs, magmaFloatComplex *SN, magmaFloatComplex *R ); void lapackf77_clascl( const char *type, const magma_int_t *kl, const magma_int_t *ku, float *cfrom, float *cto, const magma_int_t *m, const magma_int_t *n, magmaFloatComplex *A, const magma_int_t *lda, magma_int_t *info ); void lapackf77_claset( const char *uplo, const magma_int_t *m, const magma_int_t *n, const magmaFloatComplex *alpha, const magmaFloatComplex *beta, magmaFloatComplex *A, const magma_int_t *lda ); void lapackf77_claswp( const magma_int_t *n, magmaFloatComplex *A, const magma_int_t *lda, const magma_int_t *k1, const magma_int_t *k2, magma_int_t *ipiv, const magma_int_t *incx ); void lapackf77_clatrd( const char *uplo, const magma_int_t *n, const magma_int_t *nb, magmaFloatComplex *A, const magma_int_t *lda, float *e, magmaFloatComplex *tau, magmaFloatComplex *work, const magma_int_t *ldwork ); void lapackf77_clatrs( const char *uplo, const char *trans, const char *diag, const char *normin, const magma_int_t *n, const magmaFloatComplex *A, const magma_int_t *lda, magmaFloatComplex *x, float *scale, float *cnorm, magma_int_t *info ); void lapackf77_clauum( const char *uplo, const magma_int_t *n, magmaFloatComplex *A, const magma_int_t *lda, magma_int_t *info ); void lapackf77_clavhe( const char *uplo, const char *trans, const char *diag, magma_int_t *n, magma_int_t *nrhs, magmaFloatComplex *A, magma_int_t *lda, magma_int_t *ipiv, magmaFloatComplex *B, magma_int_t *ldb, magma_int_t *info ); void lapackf77_cposv( const char *uplo, const magma_int_t *n, const magma_int_t *nrhs, magmaFloatComplex *A, const magma_int_t *lda, magmaFloatComplex *B, const magma_int_t *ldb, magma_int_t *info ); void lapackf77_cpotrf( const char *uplo, const magma_int_t *n, magmaFloatComplex *A, const magma_int_t *lda, magma_int_t *info ); void lapackf77_cpotri( const char *uplo, const magma_int_t *n, magmaFloatComplex *A, const magma_int_t *lda, magma_int_t *info ); void lapackf77_cpotrs( const char *uplo, const magma_int_t *n, const magma_int_t *nrhs, const magmaFloatComplex *A, const magma_int_t *lda, magmaFloatComplex *B, const magma_int_t *ldb, magma_int_t *info ); void lapackf77_cstedc( const char *compz, const magma_int_t *n, float *d, float *e, magmaFloatComplex *Z, const magma_int_t *ldz, magmaFloatComplex *work, const magma_int_t *lwork, #ifdef COMPLEX float *rwork, const magma_int_t *lrwork, #endif magma_int_t *iwork, const magma_int_t *liwork, magma_int_t *info ); void lapackf77_cstein( const magma_int_t *n, const float *d, const float *e, const magma_int_t *m, const float *w, const magma_int_t *iblock, const magma_int_t *isplit, magmaFloatComplex *Z, const magma_int_t *ldz, float *work, magma_int_t *iwork, magma_int_t *ifailv, magma_int_t *info ); void lapackf77_cstemr( const char *jobz, const char *range, const magma_int_t *n, float *d, float *e, const float *vl, const float *vu, const magma_int_t *il, const magma_int_t *iu, magma_int_t *m, float *w, magmaFloatComplex *Z, const magma_int_t *ldz, const magma_int_t *nzc, magma_int_t *isuppz, magma_int_t *tryrac, float *work, const magma_int_t *lwork, magma_int_t *iwork, const magma_int_t *liwork, magma_int_t *info ); void lapackf77_csteqr( const char *compz, const magma_int_t *n, float *d, float *e, magmaFloatComplex *Z, const magma_int_t *ldz, float *work, magma_int_t *info ); #ifdef COMPLEX void lapackf77_csymv( const char *uplo, const magma_int_t *n, const magmaFloatComplex *alpha, const magmaFloatComplex *A, const magma_int_t *lda, const magmaFloatComplex *x, const magma_int_t *incx, const magmaFloatComplex *beta, magmaFloatComplex *y, const magma_int_t *incy ); #endif void lapackf77_ctrevc( const char *side, const char *howmny, magma_int_t *select, const magma_int_t *n, magmaFloatComplex *T, const magma_int_t *ldt, magmaFloatComplex *Vl, const magma_int_t *ldvl, magmaFloatComplex *Vr, const magma_int_t *ldvr, const magma_int_t *mm, magma_int_t *m, magmaFloatComplex *work, #ifdef COMPLEX float *rwork, #endif magma_int_t *info ); void lapackf77_ctrevc3( const char *side, const char *howmny, magma_int_t *select, const magma_int_t *n, magmaFloatComplex *T, const magma_int_t *ldt, magmaFloatComplex *VL, const magma_int_t *ldvl, magmaFloatComplex *VR, const magma_int_t *ldvr, const magma_int_t *mm, const magma_int_t *mout, magmaFloatComplex *work, const magma_int_t *lwork, #ifdef COMPLEX float *rwork, #endif magma_int_t *info ); void lapackf77_ctrtri( const char *uplo, const char *diag, const magma_int_t *n, magmaFloatComplex *A, const magma_int_t *lda, magma_int_t *info ); void lapackf77_cung2r( const magma_int_t *m, const magma_int_t *n, const magma_int_t *k, magmaFloatComplex *A, const magma_int_t *lda, const magmaFloatComplex *tau, magmaFloatComplex *work, magma_int_t *info ); void lapackf77_cungbr( const char *vect, const magma_int_t *m, const magma_int_t *n, const magma_int_t *k, magmaFloatComplex *A, const magma_int_t *lda, const magmaFloatComplex *tau, magmaFloatComplex *work, const magma_int_t *lwork, magma_int_t *info ); void lapackf77_cunghr( const magma_int_t *n, const magma_int_t *ilo, const magma_int_t *ihi, magmaFloatComplex *A, const magma_int_t *lda, const magmaFloatComplex *tau, magmaFloatComplex *work, const magma_int_t *lwork, magma_int_t *info ); void lapackf77_cunglq( const magma_int_t *m, const magma_int_t *n, const magma_int_t *k, magmaFloatComplex *A, const magma_int_t *lda, const magmaFloatComplex *tau, magmaFloatComplex *work, const magma_int_t *lwork, magma_int_t *info ); void lapackf77_cungql( const magma_int_t *m, const magma_int_t *n, const magma_int_t *k, magmaFloatComplex *A, const magma_int_t *lda, const magmaFloatComplex *tau, magmaFloatComplex *work, const magma_int_t *lwork, magma_int_t *info ); void lapackf77_cungqr( const magma_int_t *m, const magma_int_t *n, const magma_int_t *k, magmaFloatComplex *A, const magma_int_t *lda, const magmaFloatComplex *tau, magmaFloatComplex *work, const magma_int_t *lwork, magma_int_t *info ); void lapackf77_cungtr( const char *uplo, const magma_int_t *n, magmaFloatComplex *A, const magma_int_t *lda, const magmaFloatComplex *tau, magmaFloatComplex *work, const magma_int_t *lwork, magma_int_t *info ); void lapackf77_cunm2r( const char *side, const char *trans, const magma_int_t *m, const magma_int_t *n, const magma_int_t *k, const magmaFloatComplex *A, const magma_int_t *lda, const magmaFloatComplex *tau, magmaFloatComplex *C, const magma_int_t *ldc, magmaFloatComplex *work, magma_int_t *info ); void lapackf77_cunmbr( const char *vect, const char *side, const char *trans, const magma_int_t *m, const magma_int_t *n, const magma_int_t *k, const magmaFloatComplex *A, const magma_int_t *lda, const magmaFloatComplex *tau, magmaFloatComplex *C, const magma_int_t *ldc, magmaFloatComplex *work, const magma_int_t *lwork, magma_int_t *info ); void lapackf77_cunmlq( const char *side, const char *trans, const magma_int_t *m, const magma_int_t *n, const magma_int_t *k, const magmaFloatComplex *A, const magma_int_t *lda, const magmaFloatComplex *tau, magmaFloatComplex *C, const magma_int_t *ldc, magmaFloatComplex *work, const magma_int_t *lwork, magma_int_t *info ); void lapackf77_cunmql( const char *side, const char *trans, const magma_int_t *m, const magma_int_t *n, const magma_int_t *k, const magmaFloatComplex *A, const magma_int_t *lda, const magmaFloatComplex *tau, magmaFloatComplex *C, const magma_int_t *ldc, magmaFloatComplex *work, const magma_int_t *lwork, magma_int_t *info ); void lapackf77_cunmqr( const char *side, const char *trans, const magma_int_t *m, const magma_int_t *n, const magma_int_t *k, const magmaFloatComplex *A, const magma_int_t *lda, const magmaFloatComplex *tau, magmaFloatComplex *C, const magma_int_t *ldc, magmaFloatComplex *work, const magma_int_t *lwork, magma_int_t *info ); void lapackf77_cunmtr( const char *side, const char *uplo, const char *trans, const magma_int_t *m, const magma_int_t *n, const magmaFloatComplex *A, const magma_int_t *lda, const magmaFloatComplex *tau, magmaFloatComplex *C, const magma_int_t *ldc, magmaFloatComplex *work, const magma_int_t *lwork, magma_int_t *info ); /* * Real precision extras */ void lapackf77_sstebz( const char *range, const char *order, const magma_int_t *n, float *vl, float *vu, magma_int_t *il, magma_int_t *iu, float *abstol, float *d, float *e, const magma_int_t *m, const magma_int_t *nsplit, float *w, magma_int_t *iblock, magma_int_t *isplit, float *work, magma_int_t *iwork, magma_int_t *info ); void lapackf77_slaln2( const magma_int_t *ltrans, const magma_int_t *na, const magma_int_t *nw, const float *smin, const float *ca, const float *a, const magma_int_t *lda, const float *d1, const float *d2, const float *b, const magma_int_t *ldb, const float *wr, const float *wi, float *x, const magma_int_t *ldx, float *scale, float *xnorm, magma_int_t *info ); float lapackf77_slamc3( float *a, float *b ); void lapackf77_slamrg( magma_int_t *n1, magma_int_t *n2, float *a, magma_int_t *dtrd1, magma_int_t *dtrd2, magma_int_t *index ); float lapackf77_slapy3( float *x, float *y, float *z ); void lapackf77_slaed2( magma_int_t *k, magma_int_t *n, magma_int_t *cutpnt, float *d, float *q, magma_int_t *ldq, magma_int_t *indxq, float *rho, float *z, float *dlmda, float *w, float *q2, magma_int_t *indx, magma_int_t *indxc, magma_int_t *indxp, magma_int_t *coltyp, magma_int_t *info); void lapackf77_slaed4( magma_int_t *n, magma_int_t *i, float *d, float *z, float *delta, float *rho, float *dlam, magma_int_t *info ); void lapackf77_slasrt( const char *id, const magma_int_t *n, float *d, magma_int_t *info ); /* * Testing functions */ #ifdef COMPLEX void lapackf77_cbdt01( const magma_int_t *m, const magma_int_t *n, const magma_int_t *kd, magmaFloatComplex *A, const magma_int_t *lda, magmaFloatComplex *Q, const magma_int_t *ldq, float *d, float *e, magmaFloatComplex *Pt, const magma_int_t *ldpt, magmaFloatComplex *work, float *rwork, float *resid ); void lapackf77_cget22( const char *transa, const char *transe, const char *transw, const magma_int_t *n, magmaFloatComplex *A, const magma_int_t *lda, magmaFloatComplex *E, const magma_int_t *lde, magmaFloatComplex *w, magmaFloatComplex *work, float *rwork, float *result ); void lapackf77_chet21( const magma_int_t *itype, const char *uplo, const magma_int_t *n, const magma_int_t *kband, magmaFloatComplex *A, const magma_int_t *lda, float *d, float *e, magmaFloatComplex *U, const magma_int_t *ldu, magmaFloatComplex *V, const magma_int_t *ldv, magmaFloatComplex *tau, magmaFloatComplex *work, float *rwork, float *result ); void lapackf77_chst01( const magma_int_t *n, const magma_int_t *ilo, const magma_int_t *ihi, magmaFloatComplex *A, const magma_int_t *lda, magmaFloatComplex *H, const magma_int_t *ldh, magmaFloatComplex *Q, const magma_int_t *ldq, magmaFloatComplex *work, const magma_int_t *lwork, float *rwork, float *result ); void lapackf77_cstt21( const magma_int_t *n, const magma_int_t *kband, float *AD, float *AE, float *SD, float *SE, magmaFloatComplex *U, const magma_int_t *ldu, magmaFloatComplex *work, float *rwork, float *result ); void lapackf77_cunt01( const char *rowcol, const magma_int_t *m, const magma_int_t *n, magmaFloatComplex *U, const magma_int_t *ldu, magmaFloatComplex *work, const magma_int_t *lwork, float *rwork, float *resid ); #else void lapackf77_cbdt01( const magma_int_t *m, const magma_int_t *n, const magma_int_t *kd, magmaFloatComplex *A, const magma_int_t *lda, magmaFloatComplex *Q, const magma_int_t *ldq, float *d, float *e, magmaFloatComplex *Pt, const magma_int_t *ldpt, magmaFloatComplex *work, float *resid ); void lapackf77_cget22( const char *transa, const char *transe, const char *transw, const magma_int_t *n, magmaFloatComplex *A, const magma_int_t *lda, magmaFloatComplex *E, const magma_int_t *lde, magmaFloatComplex *wr, magmaFloatComplex *wi, float *work, float *result ); void lapackf77_chet21( magma_int_t *itype, const char *uplo, const magma_int_t *n, const magma_int_t *kband, magmaFloatComplex *A, const magma_int_t *lda, float *d, float *e, magmaFloatComplex *U, const magma_int_t *ldu, magmaFloatComplex *V, const magma_int_t *ldv, magmaFloatComplex *tau, magmaFloatComplex *work, float *result ); void lapackf77_chst01( const magma_int_t *n, const magma_int_t *ilo, const magma_int_t *ihi, magmaFloatComplex *A, const magma_int_t *lda, magmaFloatComplex *H, const magma_int_t *ldh, magmaFloatComplex *Q, const magma_int_t *ldq, magmaFloatComplex *work, const magma_int_t *lwork, float *result ); void lapackf77_cstt21( const magma_int_t *n, const magma_int_t *kband, float *AD, float *AE, float *SD, float *SE, magmaFloatComplex *U, const magma_int_t *ldu, magmaFloatComplex *work, float *result ); void lapackf77_cunt01( const char *rowcol, const magma_int_t *m, const magma_int_t *n, magmaFloatComplex *U, const magma_int_t *ldu, magmaFloatComplex *work, const magma_int_t *lwork, float *resid ); #endif void lapackf77_clarfy( const char *uplo, const magma_int_t *n, magmaFloatComplex *V, const magma_int_t *incv, magmaFloatComplex *tau, magmaFloatComplex *C, const magma_int_t *ldc, magmaFloatComplex *work ); void lapackf77_clarfx( const char *side, const magma_int_t *m, const magma_int_t *n, magmaFloatComplex *V, magmaFloatComplex *tau, magmaFloatComplex *C, const magma_int_t *ldc, magmaFloatComplex *work ); float lapackf77_cqpt01( const magma_int_t *m, const magma_int_t *n, const magma_int_t *k, magmaFloatComplex *A, magmaFloatComplex *Af, const magma_int_t *lda, magmaFloatComplex *tau, magma_int_t *jpvt, magmaFloatComplex *work, const magma_int_t *lwork ); void lapackf77_cqrt02( const magma_int_t *m, const magma_int_t *n, const magma_int_t *k, magmaFloatComplex *A, magmaFloatComplex *AF, magmaFloatComplex *Q, magmaFloatComplex *R, const magma_int_t *lda, magmaFloatComplex *tau, magmaFloatComplex *work, const magma_int_t *lwork, float *rwork, float *result ); void lapackf77_clatms( magma_int_t *m, magma_int_t *n, const char *dist, magma_int_t *iseed, const char *sym, float *d, magma_int_t *mode, const float *cond, const float *dmax, magma_int_t *kl, magma_int_t *ku, const char *pack, magmaFloatComplex *a, magma_int_t *lda, magmaFloatComplex *work, magma_int_t *info ); #ifdef __cplusplus } #endif #undef COMPLEX #endif /* MAGMA_CLAPACK_H */
{ "content_hash": "49c9dadf65cbc9db20ca6d1003d22fed", "timestamp": "", "source": "github", "line_count": 1209, "max_line_length": 120, "avg_line_length": 50.096774193548384, "alnum_prop": 0.5192596628527085, "repo_name": "shengren/magma-1.6.1", "id": "7b87d40aecfe6bf6ecf3f66cf8ecc4dfe6aa65b7", "size": "60567", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "include/magma_clapack.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "1297542" }, { "name": "C++", "bytes": "16293832" }, { "name": "CMake", "bytes": "9105" }, { "name": "CSS", "bytes": "3918" }, { "name": "Cuda", "bytes": "4111432" }, { "name": "FORTRAN", "bytes": "8313800" }, { "name": "Makefile", "bytes": "74059" }, { "name": "Objective-C", "bytes": "29164" }, { "name": "Perl", "bytes": "5174" }, { "name": "Python", "bytes": "103553" } ], "symlink_target": "" }
/** * Defines transforms for writing to Data sinks that implement {@link * org.apache.beam.sdk.io.hadoop.format.HadoopFormatIO} . * * @see org.apache.beam.sdk.io.hadoop.format.HadoopFormatIO */ package org.apache.beam.sdk.io.hadoop.format;
{ "content_hash": "364009f0fca7952a6452d081e206ac6d", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 69, "avg_line_length": 30.75, "alnum_prop": 0.7439024390243902, "repo_name": "mxm/incubator-beam", "id": "a7e7cdcdceacb35a5117069becf1ddde5ec79b3d", "size": "1051", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "sdks/java/io/hadoop-format/src/main/java/org/apache/beam/sdk/io/hadoop/format/package-info.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "6588581" }, { "name": "Protocol Buffer", "bytes": "1206" }, { "name": "Shell", "bytes": "3353" } ], "symlink_target": "" }
package net.automatalib.ts.output; import java.util.List; import net.automatalib.ts.DeterministicTransitionSystem; public interface DeterministicOutputTS<S, I, T, O> extends DeterministicTransitionSystem<S, I, T> { default boolean trace(Iterable<? extends I> input, List<? super O> output) { final S init = getInitialState(); return init != null && trace(init, input, output); } boolean trace(S state, Iterable<? extends I> input, List<? super O> output); }
{ "content_hash": "064fcbd2a5d3204e8268562b45c311fe", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 99, "avg_line_length": 29, "alnum_prop": 0.7038539553752535, "repo_name": "misberner/automatalib", "id": "6322db8c4c039d5ba157ece5bcda672fffaffcc7", "size": "1159", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "api/src/main/java/net/automatalib/ts/output/DeterministicOutputTS.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "1453624" }, { "name": "Shell", "bytes": "6794" } ], "symlink_target": "" }
package org.apache.tinkerpop.gremlin.structure.util.reference; import org.apache.tinkerpop.gremlin.structure.Direction; import org.apache.tinkerpop.gremlin.structure.Edge; import org.apache.tinkerpop.gremlin.structure.Element; import org.apache.tinkerpop.gremlin.structure.Property; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.apache.tinkerpop.gremlin.structure.util.StringFactory; import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; import java.util.Collections; import java.util.Iterator; /** * @author Marko A. Rodriguez (http://markorodriguez.com) */ public class ReferenceEdge extends ReferenceElement<Edge> implements Edge { private ReferenceVertex inVertex; private ReferenceVertex outVertex; private String label; private ReferenceEdge() { } public ReferenceEdge(final Edge edge) { super(edge); this.inVertex = new ReferenceVertex(edge.inVertex()); this.outVertex = new ReferenceVertex(edge.outVertex()); this.label = edge.label(); } @Override public <V> Property<V> property(final String key, final V value) { throw Element.Exceptions.propertyAdditionNotSupported(); } @Override public void remove() { throw Edge.Exceptions.edgeRemovalNotSupported(); } @Override public Iterator<Vertex> vertices(final Direction direction) { if (direction.equals(Direction.OUT)) return IteratorUtils.of(this.outVertex); else if (direction.equals(Direction.IN)) return IteratorUtils.of(this.inVertex); else return IteratorUtils.of(this.outVertex, this.inVertex); } @Override public Vertex inVertex() { return this.inVertex; } @Override public Vertex outVertex() { return this.outVertex; } @Override public <V> Iterator<Property<V>> properties(final String... propertyKeys) { return Collections.emptyIterator(); } @Override public String toString() { return StringFactory.edgeString(this); } @Override public String label() { return this.label; } }
{ "content_hash": "a3a62dfb0f9e8a8d5b0f042031beb6f6", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 79, "avg_line_length": 27.05, "alnum_prop": 0.6926987060998152, "repo_name": "RedSeal-co/incubator-tinkerpop", "id": "8484f09bf6cfe269843712ee826b61be16b87b0a", "size": "3023", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/reference/ReferenceEdge.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "4544" }, { "name": "Groovy", "bytes": "296612" }, { "name": "Java", "bytes": "5304505" }, { "name": "Python", "bytes": "1481" }, { "name": "Shell", "bytes": "16594" } ], "symlink_target": "" }
import { Component, OnInit } from '@angular/core'; @Component({ selector: 'app-comp-3877', templateUrl: './comp-3877.component.html', styleUrls: ['./comp-3877.component.css'] }) export class Comp3877Component implements OnInit { constructor() { } ngOnInit() { } }
{ "content_hash": "18a9b923475b59cacaa86763e4f8a4fe", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 50, "avg_line_length": 16.58823529411765, "alnum_prop": 0.6666666666666666, "repo_name": "angular/angular-cli-stress-test", "id": "98a8e974c11b0a3f8d820b8277feb2e9666fbf0c", "size": "484", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/app/components/comp-3877/comp-3877.component.ts", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1040888" }, { "name": "HTML", "bytes": "300322" }, { "name": "JavaScript", "bytes": "2404" }, { "name": "TypeScript", "bytes": "8535506" } ], "symlink_target": "" }
package org.elasticsearch.cloud.aws; import com.amazonaws.AmazonClientException; import com.amazonaws.AmazonWebServiceRequest; import com.amazonaws.ClientConfiguration; import com.amazonaws.auth.AWSCredentialsProvider; import com.amazonaws.auth.BasicAWSCredentials; import com.amazonaws.auth.DefaultAWSCredentialsProviderChain; import com.amazonaws.http.IdleConnectionReaper; import com.amazonaws.internal.StaticCredentialsProvider; import com.amazonaws.retry.RetryPolicy; import com.amazonaws.services.ec2.AmazonEC2; import com.amazonaws.services.ec2.AmazonEC2Client; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.cloud.aws.network.Ec2NameResolver; import org.elasticsearch.common.Randomness; import org.elasticsearch.common.Strings; import org.elasticsearch.common.component.AbstractLifecycleComponent; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.network.NetworkService; import org.elasticsearch.common.settings.Settings; import java.util.Random; /** * */ public class AwsEc2ServiceImpl extends AbstractLifecycleComponent implements AwsEc2Service { public static final String EC2_METADATA_URL = "http://169.254.169.254/latest/meta-data/"; private AmazonEC2Client client; @Inject public AwsEc2ServiceImpl(Settings settings) { super(settings); } @Override public synchronized AmazonEC2 client() { if (client != null) { return client; } this.client = new AmazonEC2Client(buildCredentials(logger, settings), buildConfiguration(logger, settings)); String endpoint = findEndpoint(logger, settings); if (endpoint != null) { client.setEndpoint(endpoint); } return this.client; } protected static AWSCredentialsProvider buildCredentials(ESLogger logger, Settings settings) { AWSCredentialsProvider credentials; String key = CLOUD_EC2.KEY_SETTING.get(settings); String secret = CLOUD_EC2.SECRET_SETTING.get(settings); if (key.isEmpty() && secret.isEmpty()) { logger.debug("Using either environment variables, system properties or instance profile credentials"); credentials = new DefaultAWSCredentialsProviderChain(); } else { logger.debug("Using basic key/secret credentials"); credentials = new StaticCredentialsProvider(new BasicAWSCredentials(key, secret)); } return credentials; } protected static ClientConfiguration buildConfiguration(ESLogger logger, Settings settings) { ClientConfiguration clientConfiguration = new ClientConfiguration(); // the response metadata cache is only there for diagnostics purposes, // but can force objects from every response to the old generation. clientConfiguration.setResponseMetadataCacheSize(0); clientConfiguration.setProtocol(CLOUD_EC2.PROTOCOL_SETTING.get(settings)); if (PROXY_HOST_SETTING.exists(settings) || CLOUD_EC2.PROXY_HOST_SETTING.exists(settings)) { String proxyHost = CLOUD_EC2.PROXY_HOST_SETTING.get(settings); Integer proxyPort = CLOUD_EC2.PROXY_PORT_SETTING.get(settings); String proxyUsername = CLOUD_EC2.PROXY_USERNAME_SETTING.get(settings); String proxyPassword = CLOUD_EC2.PROXY_PASSWORD_SETTING.get(settings); clientConfiguration .withProxyHost(proxyHost) .withProxyPort(proxyPort) .withProxyUsername(proxyUsername) .withProxyPassword(proxyPassword); } // #155: we might have 3rd party users using older EC2 API version String awsSigner = CLOUD_EC2.SIGNER_SETTING.get(settings); if (Strings.hasText(awsSigner)) { logger.debug("using AWS API signer [{}]", awsSigner); AwsSigner.configureSigner(awsSigner, clientConfiguration); } // Increase the number of retries in case of 5xx API responses final Random rand = Randomness.get(); RetryPolicy retryPolicy = new RetryPolicy( RetryPolicy.RetryCondition.NO_RETRY_CONDITION, new RetryPolicy.BackoffStrategy() { @Override public long delayBeforeNextRetry(AmazonWebServiceRequest originalRequest, AmazonClientException exception, int retriesAttempted) { // with 10 retries the max delay time is 320s/320000ms (10 * 2^5 * 1 * 1000) logger.warn("EC2 API request failed, retry again. Reason was:", exception); return 1000L * (long) (10d * Math.pow(2, retriesAttempted / 2.0d) * (1.0d + rand.nextDouble())); } }, 10, false); clientConfiguration.setRetryPolicy(retryPolicy); return clientConfiguration; } protected static String findEndpoint(ESLogger logger, Settings settings) { String endpoint = null; if (CLOUD_EC2.ENDPOINT_SETTING.exists(settings)) { endpoint = CLOUD_EC2.ENDPOINT_SETTING.get(settings); logger.debug("using explicit ec2 endpoint [{}]", endpoint); } else if (REGION_SETTING.exists(settings) || CLOUD_EC2.REGION_SETTING.exists(settings)) { final String region = CLOUD_EC2.REGION_SETTING.get(settings); switch (region) { case "us-east-1": case "us-east": endpoint = "ec2.us-east-1.amazonaws.com"; break; case "us-west": case "us-west-1": endpoint = "ec2.us-west-1.amazonaws.com"; break; case "us-west-2": endpoint = "ec2.us-west-2.amazonaws.com"; break; case "ap-southeast": case "ap-southeast-1": endpoint = "ec2.ap-southeast-1.amazonaws.com"; break; case "ap-south-1": endpoint = "ec2.ap-south-1.amazonaws.com"; break; case "us-gov-west": case "us-gov-west-1": endpoint = "ec2.us-gov-west-1.amazonaws.com"; break; case "ap-southeast-2": endpoint = "ec2.ap-southeast-2.amazonaws.com"; break; case "ap-northeast": case "ap-northeast-1": endpoint = "ec2.ap-northeast-1.amazonaws.com"; break; case "ap-northeast-2": endpoint = "ec2.ap-northeast-2.amazonaws.com"; break; case "eu-west": case "eu-west-1": endpoint = "ec2.eu-west-1.amazonaws.com"; break; case "eu-central": case "eu-central-1": endpoint = "ec2.eu-central-1.amazonaws.com"; break; case "sa-east": case "sa-east-1": endpoint = "ec2.sa-east-1.amazonaws.com"; break; case "cn-north": case "cn-north-1": endpoint = "ec2.cn-north-1.amazonaws.com.cn"; break; default: throw new IllegalArgumentException("No automatic endpoint could be derived from region [" + region + "]"); } logger.debug("using ec2 region [{}], with endpoint [{}]", region, endpoint); } return endpoint; } @Override protected void doStart() throws ElasticsearchException { } @Override protected void doStop() throws ElasticsearchException { } @Override protected void doClose() throws ElasticsearchException { if (client != null) { client.shutdown(); } // Ensure that IdleConnectionReaper is shutdown IdleConnectionReaper.shutdown(); } }
{ "content_hash": "8d5556473a786a18f4acf0ab26890e0a", "timestamp": "", "source": "github", "line_count": 202, "max_line_length": 126, "avg_line_length": 40.62871287128713, "alnum_prop": 0.6033873522602656, "repo_name": "zkidkid/elasticsearch", "id": "e35b082899e39dd36d56245972b2a9ccf7efbac0", "size": "8995", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "plugins/discovery-ec2/src/main/java/org/elasticsearch/cloud/aws/AwsEc2ServiceImpl.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Groovy", "bytes": "299" }, { "name": "Java", "bytes": "25758712" }, { "name": "Perl", "bytes": "6858" }, { "name": "Python", "bytes": "61062" }, { "name": "Ruby", "bytes": "32034" }, { "name": "Shell", "bytes": "27524" } ], "symlink_target": "" }
class CreateIncurredIncidentals < ActiveRecord::Migration[4.2] def change create_table :incurred_incidentals do |t| t.references :incidental_type, index: true t.decimal :times_modified t.text :notes t.references :rental, index: true t.timestamps null: false end end end
{ "content_hash": "fcc7ba3f012ae6adc039f60c09e6a0b2", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 62, "avg_line_length": 26.083333333333332, "alnum_prop": 0.6869009584664537, "repo_name": "umts/probable-engine", "id": "7ab8588b81db88dd389e886106c962df186afc26", "size": "313", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "db/migrate/20160219202933_create_incurred_incidentals.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "12374" }, { "name": "HTML", "bytes": "111230" }, { "name": "JavaScript", "bytes": "6578" }, { "name": "Ruby", "bytes": "288026" } ], "symlink_target": "" }
<header> <div class="container"> <div class="row"> <div class="col-sm-7"> <div class="header-content"> <div class="header-content-inner"> <h1>Guida TV, un database della televisione italiana suddiviso per categorie tematiche, estremamente intuitivo e facile da consultare!</h1> <a href="#download" class="btn btn-outline btn-xl page-scroll">Scarica Adesso!</a> </div> </div> </div> <div class="col-sm-5"> <div class="device-container"> <div class="device-mockup iphone6_plus portrait white"> <div class="device"> <div class="screen"> <!-- Demo image for screen mockup, you can put an image here, some HTML, an animation, video, or anything else! --> <img src="/img/demo-screen-1.jpg" class="img-responsive" alt=""> </div> <div class="button"> <!-- You can hook the "home button" to some JavaScript events or just remove it --> </div> </div> </div> </div> </div> </div> </div> </header>
{ "content_hash": "bd2cf7fac095f2937b3725a0ca4443e5", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 163, "avg_line_length": 48.48275862068966, "alnum_prop": 0.4388335704125178, "repo_name": "mobi-now/guidatvpage", "id": "9387e4df8f4a4dbd27a75babff88b1fb941d5ca2", "size": "1406", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "_includes/header.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "220859" }, { "name": "HTML", "bytes": "242902" }, { "name": "JavaScript", "bytes": "17870" } ], "symlink_target": "" }
ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "de849b8d26032fd71b70d0728541a12b", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.307692307692308, "alnum_prop": 0.6940298507462687, "repo_name": "mdoering/backbone", "id": "d7b765693f9d2c86d481c1e4df6f756354d2ac16", "size": "199", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Rhodophyta/Florideophyceae/Corallinales/Corallinaceae/Porolithon/Porolithon conicum/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
- [Django simple example](django_simple/my_app/honey_middleware.py) - captures basic metadata about each request coming through the django app - [Django response time example](django_response_time/my_app/honey_middleware.py) - captures response time as well as basic metadata for requests to the django app - [Django dynamic fields example](django_dynamic_fields/my_app/honey_middleware.py) - uses dynamic fields to generate values for the metric when `new_event()` is called, rather than the time of definition - [Factorial](factorial/example.py) - examples of how to use some of the features of libhoney in python, a single file that uses a factorial to generate events - [Tornado Factorial](factorial/example_tornado.py) - examples of how to use some of the features of libhoney in python, a single file that uses a factorial to generate events and sends them with Tornado async http client ## Installation Inside each example django directory: 1. `poetry install` 2. `poetry run python manage.py migrate # initialize the project` 3. `HONEYCOMB_API_KEY=api-key HONEYCOMB_DATASET=django-example poetry run python manage.py runserver` For the Factorial examples, there's no need to run the migrate step. Do only this: 1. `poetry install` 2. `HONEYCOMB_API_KEY=api-key poetry run python3 example_tornado.py` or `example.py`
{ "content_hash": "772f7c03328df2c36daea6b0fc0ca0ac", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 221, "avg_line_length": 74, "alnum_prop": 0.7837837837837838, "repo_name": "honeycombio/libhoney-py", "id": "057d47d6ee166641c023c21fe4308316765cb8c1", "size": "1345", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "examples/README.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Python", "bytes": "88366" }, { "name": "Shell", "bytes": "803" } ], "symlink_target": "" }
package net.opengis.gml.impl; import net.opengis.gml.GmlPackage; import net.opengis.gml.UnitOfMeasureType; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.EObjectImpl; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Unit Of Measure Type</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link net.opengis.gml.impl.UnitOfMeasureTypeImpl#getUom <em>Uom</em>}</li> * </ul> * </p> * * @generated */ public class UnitOfMeasureTypeImpl extends EObjectImpl implements UnitOfMeasureType { /** * The default value of the '{@link #getUom() <em>Uom</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getUom() * @generated * @ordered */ protected static final String UOM_EDEFAULT = null; /** * The cached value of the '{@link #getUom() <em>Uom</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getUom() * @generated * @ordered */ protected String uom = UOM_EDEFAULT; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected UnitOfMeasureTypeImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return GmlPackage.eINSTANCE.getUnitOfMeasureType(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getUom() { return uom; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setUom(String newUom) { String oldUom = uom; uom = newUom; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, GmlPackage.UNIT_OF_MEASURE_TYPE__UOM, oldUom, uom)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case GmlPackage.UNIT_OF_MEASURE_TYPE__UOM: return getUom(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case GmlPackage.UNIT_OF_MEASURE_TYPE__UOM: setUom((String)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case GmlPackage.UNIT_OF_MEASURE_TYPE__UOM: setUom(UOM_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case GmlPackage.UNIT_OF_MEASURE_TYPE__UOM: return UOM_EDEFAULT == null ? uom != null : !UOM_EDEFAULT.equals(uom); } return super.eIsSet(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (uom: "); result.append(uom); result.append(')'); return result.toString(); } } //UnitOfMeasureTypeImpl
{ "content_hash": "cf9e64a1b9952f1c5c287d147f3024be", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 109, "avg_line_length": 21.51875, "alnum_prop": 0.6198083067092651, "repo_name": "markus1978/citygml4emf", "id": "d463552668850900289d1e33e241206612e13136", "size": "3492", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "de.hub.citygml.emf.ecore/src/net/opengis/gml/impl/UnitOfMeasureTypeImpl.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "34817194" } ], "symlink_target": "" }
<!DOCTYPE HTML> <!-- --> <html lang="en"> <head> <!-- Force latest IE rendering engine or ChromeFrame if installed --> <!--[if IE]> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <![endif]--> <meta charset="utf-8"> <title>jQuery File Upload Demo</title> <meta name="description" content="File Upload widget with multiple file selection, drag&amp;drop support, progress bars, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads and client-side image resizing. Works with any server-side platform (PHP, Python, Ruby on Rails, Java, Node.js, Go etc.) that supports standard HTML form file uploads."> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- Bootstrap styles --> <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css"> <!-- Generic page styles --> <link rel="stylesheet" href="css/style.css"> <!-- blueimp Gallery styles --> <link rel="stylesheet" href="http://blueimp.github.io/Gallery/css/blueimp-gallery.min.css"> <!-- CSS to style the file input field as button and adjust the Bootstrap progress bars --> <link rel="stylesheet" href="css/jquery.fileupload.css"> <link rel="stylesheet" href="css/jquery.fileupload-ui.css"> <!-- CSS adjustments for browsers with JavaScript disabled --> <noscript> <link rel="stylesheet" href="css/jquery.fileupload-noscript.css"> </noscript> <noscript> <link rel="stylesheet" href="css/jquery.fileupload-ui-noscript.css"> </noscript> </head> <body> <div class="navbar navbar-default navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-fixed-top .navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="https://github.com/blueimp/jQuery-File-Upload">jQuery File Upload</a> </div> <div class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li><a href="https://github.com/blueimp/jQuery-File-Upload/tags">Download</a></li> <li><a href="https://github.com/blueimp/jQuery-File-Upload">Source Code</a></li> <li><a href="https://github.com/blueimp/jQuery-File-Upload/wiki">Documentation</a></li> <li><a href="https://blueimp.net">&copy; Sebastian Tschan</a></li> </ul> </div> </div> </div> <div class="container"> <h1>jQuery File Upload Demo</h1> <h2 class="lead">Basic Plus UI version</h2> <ul class="nav nav-tabs"> <li><a href="basic.html">Basic</a></li> <li><a href="basic-plus.html">Basic Plus</a></li> <li class="active"><a href="index.html">Basic Plus UI</a></li> <li><a href="angularjs.html">AngularJS</a></li> <li><a href="jquery-ui.html">jQuery UI</a></li> </ul> <br> <blockquote> <p>File Upload widget with multiple file selection, drag&amp;drop support, progress bars, validation and preview images, audio and video for jQuery.<br> Supports cross-domain, chunked and resumable file uploads and client-side image resizing.<br> Works with any server-side platform (PHP, Python, Ruby on Rails, Java, Node.js, Go etc.) that supports standard HTML form file uploads.</p> </blockquote> <br> <!-- The file upload form used as target for the file upload widget --> <form id="fileupload" action="//jquery-file-upload.appspot.com/" method="POST" enctype="multipart/form-data"> <!-- Redirect browsers with JavaScript disabled to the origin page --> <noscript><input type="hidden" name="redirect" value="http://blueimp.github.io/jQuery-File-Upload/"></noscript> <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload --> <div class="row fileupload-buttonbar"> <div class="col-lg-7"> <!-- The fileinput-button span is used to style the file input field as button --> <span class="btn btn-success fileinput-button"> <i class="glyphicon glyphicon-plus"></i> <span>Add files...</span> <input type="file" name="files[]" multiple> </span> <button type="submit" class="btn btn-primary start"> <i class="glyphicon glyphicon-upload"></i> <span>Start upload</span> </button> <button type="reset" class="btn btn-warning cancel"> <i class="glyphicon glyphicon-ban-circle"></i> <span>Cancel upload</span> </button> <button type="button" class="btn btn-danger delete"> <i class="glyphicon glyphicon-trash"></i> <span>Delete</span> </button> <input type="checkbox" class="toggle"> <!-- The global file processing state --> <span class="fileupload-process"></span> </div> <!-- The global progress state --> <div class="col-lg-5 fileupload-progress fade"> <!-- The global progress bar --> <div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100"> <div class="progress-bar progress-bar-success" style="width:0%;"></div> </div> <!-- The extended global progress state --> <div class="progress-extended">&nbsp;</div> </div> </div> <!-- The table listing the files available for upload/download --> <table role="presentation" class="table table-striped"> <tbody class="files"></tbody> </table> </form> <br> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">Demo Notes</h3> </div> <div class="panel-body"> <ul> <li>The maximum file size for uploads in this demo is <strong>5 MB</strong> (default file size is unlimited). </li> <li>Only image files (<strong>JPG, GIF, PNG</strong>) are allowed in this demo (by default there is no file type restriction). </li> <li>Uploaded files will be deleted automatically after <strong>5 minutes</strong> (demo setting).</li> <li>You can <strong>drag &amp; drop</strong> files from your desktop on this webpage (see <a href="https://github.com/blueimp/jQuery-File-Upload/wiki/Browser-support">Browser support</a>). </li> <li>Please refer to the <a href="https://github.com/blueimp/jQuery-File-Upload">project website</a> and <a href="https://github.com/blueimp/jQuery-File-Upload/wiki">documentation</a> for more information. </li> <li>Built with Twitter's <a href="http://twitter.github.com/bootstrap/">Bootstrap</a> CSS framework and Icons from <a href="http://glyphicons.com/">Glyphicons</a>. </li> </ul> </div> </div> </div> <!-- The blueimp Gallery widget --> <div id="blueimp-gallery" class="blueimp-gallery blueimp-gallery-controls" data-filter=":even"> <div class="slides"></div> <h3 class="title"></h3> <a class="prev">‹</a> <a class="next">›</a> <a class="close">×</a> <a class="play-pause"></a> <ol class="indicator"></ol> </div> <!-- The template to display files available for upload --> <script id="template-upload" type="text/x-tmpl"> {% for (var i=0, file; file=o.files[i]; i++) { %} <tr class="template-upload fade"> <td> <span class="preview"></span> </td> <td> <p class="name">{%=file.name%}</p> <strong class="error text-danger"></strong> </td> <td> <p class="size">Processing...</p> <div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><div class="progress-bar progress-bar-success" style="width:0%;"></div></div> </td> <td> {% if (!i && !o.options.autoUpload) { %} <button class="btn btn-primary start" disabled> <i class="glyphicon glyphicon-upload"></i> <span>Start</span> </button> {% } %} {% if (!i) { %} <button class="btn btn-warning cancel"> <i class="glyphicon glyphicon-ban-circle"></i> <span>Cancel</span> </button> {% } %} </td> </tr> {% } %} </script> <!-- The template to display files available for download --> <script id="template-download" type="text/x-tmpl"> {% for (var i=0, file; file=o.files[i]; i++) { %} <tr class="template-download fade"> <td> <span class="preview"> {% if (file.thumbnailUrl) { %} <a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" data-gallery><img src="{%=file.thumbnailUrl%}"></a> {% } %} </span> </td> <td> <p class="name"> {% if (file.url) { %} <a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" {%=file.thumbnailUrl?'data-gallery':''%}>{%=file.name%}</a> {% } else { %} <span>{%=file.name%}</span> {% } %} </p> {% if (file.error) { %} <div><span class="label label-danger">Error</span> {%=file.error%}</div> {% } %} </td> <td> <span class="size">{%=o.formatFileSize(file.size)%}</span> </td> <td> {% if (file.deleteUrl) { %} <button class="btn btn-danger delete" data-type="{%=file.deleteType%}" data-url="{%=file.deleteUrl%}"{% if (file.deleteWithCredentials) { %} data-xhr-fields='{"withCredentials":true}'{% } %}> <i class="glyphicon glyphicon-trash"></i> <span>Delete</span> </button> <input type="checkbox" name="delete" value="1" class="toggle"> {% } else { %} <button class="btn btn-warning cancel"> <i class="glyphicon glyphicon-ban-circle"></i> <span>Cancel</span> </button> {% } %} </td> </tr> {% } %} </script> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <!-- The jQuery UI widget factory, can be omitted if jQuery UI is already included --> <script src="js/vendor/jquery.ui.widget.js"></script> <!-- The Templates plugin is included to render the upload/download listings --> <script src="http://blueimp.github.io/JavaScript-Templates/js/tmpl.min.js"></script> <!-- The Load Image plugin is included for the preview images and image resizing functionality --> <script src="http://blueimp.github.io/JavaScript-Load-Image/js/load-image.min.js"></script> <!-- The Canvas to Blob plugin is included for image resizing functionality --> <script src="http://blueimp.github.io/JavaScript-Canvas-to-Blob/js/canvas-to-blob.min.js"></script> <!-- Bootstrap JS is not required, but included for the responsive demo navigation --> <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script> <!-- blueimp Gallery script --> <script src="http://blueimp.github.io/Gallery/js/jquery.blueimp-gallery.min.js"></script> <!-- The Iframe Transport is required for browsers without support for XHR file uploads --> <script src="js/jquery.iframe-transport.js"></script> <!-- The basic File Upload plugin --> <script src="js/jquery.fileupload.js"></script> <!-- The File Upload processing plugin --> <script src="js/jquery.fileupload-process.js"></script> <!-- The File Upload image preview & resize plugin --> <script src="js/jquery.fileupload-image.js"></script> <!-- The File Upload audio preview plugin --> <script src="js/jquery.fileupload-audio.js"></script> <!-- The File Upload video preview plugin --> <script src="js/jquery.fileupload-video.js"></script> <!-- The File Upload validation plugin --> <script src="js/jquery.fileupload-validate.js"></script> <!-- The File Upload user interface plugin --> <script src="js/jquery.fileupload-ui.js"></script> <!-- The main application script --> <script src="js/main.js"></script> <!-- The XDomainRequest Transport is included for cross-domain file deletion for IE 8 and IE 9 --> <!--[if (gte IE 8)&(lt IE 10)]> <script src="js/cors/jquery.xdr-transport.js"></script> <![endif]--> </body> </html>
{ "content_hash": "569358d1051dea4ff10f3d57a863c6c4", "timestamp": "", "source": "github", "line_count": 270, "max_line_length": 392, "avg_line_length": 49.007407407407406, "alnum_prop": 0.5744407496977025, "repo_name": "tanvirshuvo/abtec", "id": "1f690d3cd051a020a65592975ea990706cb43c8c", "size": "13474", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "target/ABTeC/resources/assets/file-uploader/index.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ActionScript", "bytes": "34910" }, { "name": "ApacheConf", "bytes": "2398" }, { "name": "CSS", "bytes": "1905278" }, { "name": "CoffeeScript", "bytes": "161324" }, { "name": "Go", "bytes": "27576" }, { "name": "HTML", "bytes": "10322250" }, { "name": "Java", "bytes": "305494" }, { "name": "JavaScript", "bytes": "14345880" }, { "name": "Makefile", "bytes": "794" }, { "name": "PHP", "bytes": "494038" }, { "name": "Python", "bytes": "22034" }, { "name": "Shell", "bytes": "14822" } ], "symlink_target": "" }
<!-- BEGINNING OF PRE-COMMIT-BLUEPRINT DOCS HOOK:TITLE --> # Cloud Logging Log Bucket Export blueprint <!-- END OF PRE-COMMIT-BLUEPRINT DOCS HOOK:TITLE --> <!-- BEGINNING OF PRE-COMMIT-BLUEPRINT DOCS HOOK:BODY --> A log export on an organization that sinks to Cloud Logging Log Bucket ## Setters | Name | Value | Type | Count | |-----------------|-------------------|------|-------| | bucket-locked | false | bool | 1 | | filter | | str | 0 | | location | global | str | 2 | | log-bucket-name | my-log-k8s-bucket | str | 3 | | namespace | my-namespace | str | 6 | | org-id | 123456789012 | str | 4 | | project-id | my-project-id | str | 6 | | retention-days | 30 | int | 1 | ## Sub-packages This package has no sub-packages. ## Resources | File | APIVersion | Kind | Name | Namespace | |-------------|--------------------------------------------|------------------|----------------------------|--------------| | export.yaml | serviceusage.cnrm.cloud.google.com/v1beta1 | Service | my-project-id-logbucket | my-namespace | | export.yaml | logging.cnrm.cloud.google.com/v1beta1 | LoggingLogSink | 123456789012-logbucketsink | my-namespace | | export.yaml | logging.cnrm.cloud.google.com/v1beta1 | LoggingLogBucket | my-log-k8s-bucket | my-namespace | | iam.yaml | iam.cnrm.cloud.google.com/v1beta1 | IAMPolicyMember | log-bkt-project-iam-policy | logging | ## Resource References - [IAMPolicyMember](https://cloud.google.com/config-connector/docs/reference/resource-docs/iam/iampolicymember) - [LoggingLogBucket](https://cloud.google.com/config-connector/docs/reference/resource-docs/logging/logginglogbucket) - [LoggingLogSink](https://cloud.google.com/config-connector/docs/reference/resource-docs/logging/logginglogsink) - [Service](https://cloud.google.com/config-connector/docs/reference/resource-docs/serviceusage/service) ## Usage 1. Clone the package: ```shell kpt pkg get https://github.com/GoogleCloudPlatform/blueprints.git/catalog/log-export/org/logbucket-export@${VERSION} ``` Replace `${VERSION}` with the desired repo branch or tag (for example, `main`). 1. Move into the local package: ```shell cd "./logbucket-export/" ``` 1. Edit the function config file(s): - setters.yaml 1. Execute the function pipeline ```shell kpt fn render ``` 1. Initialize the resource inventory ```shell kpt live init --namespace ${NAMESPACE}" ``` Replace `${NAMESPACE}` with the namespace in which to manage the inventory ResourceGroup (for example, `config-control`). 1. Apply the package resources to your cluster ```shell kpt live apply ``` 1. Wait for the resources to be ready ```shell kpt live status --output table --poll-until current ``` <!-- END OF PRE-COMMIT-BLUEPRINT DOCS HOOK:BODY -->
{ "content_hash": "402f36d906f1588640b9819715c06096", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 123, "avg_line_length": 38.370370370370374, "alnum_prop": 0.5923423423423423, "repo_name": "GoogleCloudPlatform/blueprints", "id": "c91fa62a005a7b36f998b8f761735185d327f897", "size": "3108", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "catalog/log-export/org/logbucket-export/README.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Go", "bytes": "7461" }, { "name": "Makefile", "bytes": "3042" }, { "name": "Shell", "bytes": "21187" } ], "symlink_target": "" }
// Copyright 2009 the Sputnik authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /** * @name: S15.2.4.7_A7; * @section: 15.2.4.7, 13.2; * @assertion: Object.prototype.propertyIsEnumerable can't be used as a constructor; * @description: Checking if creating "new Object.prototype.propertyIsEnumerable" fails; */ var FACTORY = Object.prototype.propertyIsEnumerable; try { instance = new FACTORY; $FAIL('#1: Object.prototype.propertyIsEnumerable can\'t be used as a constructor'); } catch (e) { $PRINT(e); }
{ "content_hash": "c6eb2b20a6b110441796133465b973cd", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 87, "avg_line_length": 30.789473684210527, "alnum_prop": 0.7008547008547008, "repo_name": "remobjects/script", "id": "6d3f08d3bdcfaa66d5a87866fee10e9c16bd12e3", "size": "585", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Test/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.2_Object_Objects/15.2.4_Properties_of_the_Object_Prototype_Object/15.2.4.7_Object.prototype.propertyIsEnumerable/S15.2.4.7_A7.js", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Batchfile", "bytes": "1755" }, { "name": "CSS", "bytes": "15950" }, { "name": "HTML", "bytes": "431518" }, { "name": "JavaScript", "bytes": "9852539" }, { "name": "Pascal", "bytes": "802577" }, { "name": "Python", "bytes": "29664" } ], "symlink_target": "" }
<?php namespace PHPixie\Tests\HTTPProcessors\Processor\Dispatcher\Builder; /** * @coversDefaultClass \PHPixie\HTTPProcessors\Processor\Dispatcher\Builder\Attribute */ class AttributeTest extends \PHPixie\Tests\Processors\Processor\Dispatcher\BuilderTest { protected $attributeName = 'processor'; /** * @covers ::<protected> */ public function testGetProcessorNameFor() { $dispatcherMock = $this->dispatcherMock(array( 'buildPixieProcessor' )); $processor = $this->getProcessor(); $this->method($dispatcherMock, 'buildPixieProcessor', $processor, array(), 'once'); $request = $this->getValue(); $attributes = $this->quickMock('\PHPixie\Slice\Data'); $this->method($attributes, 'get', 'pixie', array($this->attributeName)); $this->method($request, 'attributes', $attributes, array()); $this->assertSame(true, $dispatcherMock->isProcessable($request)); $result = new \stdClass(); $this->method($processor, 'process', $result, array($request)); $this->assertSame($result, $dispatcherMock->process($request)); } protected function getValue() { return $this->quickMock('\PHPixie\HTTP\Request'); } protected function dispatcherMock($methods = array()) { return $this->getMock( '\PHPixie\HTTPProcessors\Processor\Dispatcher\Builder\Attribute', $methods ); } }
{ "content_hash": "35bd0d01e273d99e6e13490dc728fdef", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 91, "avg_line_length": 30.68, "alnum_prop": 0.6101694915254238, "repo_name": "PHPixie/HTTP-Processors", "id": "00da8b8c7cced443d874b805d3fb7af596d5b5f3", "size": "1534", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/PHPixie/Tests/HTTPProcessors/Processor/Dispatcher/Builder/AttributeTest.php", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "PHP", "bytes": "23554" } ], "symlink_target": "" }
<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?> <nav id="custom-bootstrap-menu" class="navbar navbar-default"> <div class="container"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <?php echo anchor(base_url(), SYS_TITLE, array('class' => 'navbar-brand'))?> </div> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav"> <li class="active"><?php echo anchor(base_url('inicio'), 'Início'); ?></li> <li> <?php switch($this->session->type) { case USER_ADMIN: // TODO - Realizar configurações / Administrador break; case USER_TEACHER: // TODO - Criar ou Editar (Dropdown) novas atividades / Professor break; case USER_STUDENT: // TODO - Atividades pendentes do aluno (Dropdown) // echo anchor('user/activities', 'Suas Atividades'); ?> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Suas Atividades <span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">Pendentes</a></li> <li><a href="#">Em andamento</a></li> <li><a href="#">Concluidas</a></li> </ul> </li> <?php break; default : echo '<a href="#">Link</a>'; } ?> </li> <!-- <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">Action</a></li> <li><a href="#">Another action</a></li> <li><a href="#">Something else here</a></li> <li role="separator" class="divider"></li> <li><a href="#">Separated link</a></li> <li role="separator" class="divider"></li> <li><a href="#">One more separated link</a></li> </ul> </li> --> </ul> <ul class="nav navbar-nav navbar-right"> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><?php switch ($this->session->type) { case USER_ADMIN: echo '<span class="glyphicon glyphicon-star"></span>'; break; case USER_STUDENT: echo '<span class="glyphicon glyphicon-user"></span>'; break; case USER_TEACHER: echo '<span class="glyphicon glyphicon-edit"></span>'; break; } ?> <?php echo $this->session->username; ?> <span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="<?php echo base_url('user/profile'); ?>">Perfil</a></li> <li><a href="<?php echo base_url('user/notification'); ?>">Notificações</a></li> <li role="separator" class="divider"></li> <li><a href="<?php echo base_url('user/logout'); ?>">Sair</a></li> </ul> </li> </ul> </div><!-- /.navbar-collapse --> </div><!-- /.container-fluid --> </nav>
{ "content_hash": "e640603844bd3932aed4c835d10e2735", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 187, "avg_line_length": 55.9125, "alnum_prop": 0.4540576794097921, "repo_name": "Ricardo-Costa/TAREFA-DE-CASA", "id": "db6f419d5d15ed10faa866416ed1efd0890bd1bd", "size": "4478", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "application/views/templates/top_menu.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "408" }, { "name": "CSS", "bytes": "16133" }, { "name": "HTML", "bytes": "5459690" }, { "name": "JavaScript", "bytes": "52850" }, { "name": "PHP", "bytes": "1783434" } ], "symlink_target": "" }
require "resource" require "metafiles" module DiskUsageExtension def disk_usage return @disk_usage if @disk_usage compute_disk_usage @disk_usage end def file_count return @file_count if @file_count compute_disk_usage @file_count end def abv out = "" compute_disk_usage out << "#{number_readable(@file_count)} files, " if @file_count > 1 out << disk_usage_readable(@disk_usage).to_s end private def compute_disk_usage path = if symlink? resolved_path else self end if path.directory? scanned_files = Set.new @file_count = 0 @disk_usage = 0 path.find do |f| if f.directory? @disk_usage += f.lstat.size else @file_count += 1 if f.basename.to_s != ".DS_Store" # use Pathname#lstat instead of Pathname#stat to get info of symlink itself. stat = f.lstat file_id = [stat.dev, stat.ino] # count hardlinks only once. unless scanned_files.include?(file_id) @disk_usage += stat.size scanned_files.add(file_id) end end end else @file_count = 1 @disk_usage = path.lstat.size end end end # Homebrew extends Ruby's `Pathname` to make our code more readable. # @see https://ruby-doc.org/stdlib-1.8.7/libdoc/pathname/rdoc/Pathname.html Ruby's Pathname API class Pathname include DiskUsageExtension # @private BOTTLE_EXTNAME_RX = /(\.[a-z0-9_]+\.bottle\.(\d+\.)?tar\.gz)$/ # Moves a file from the original location to the {Pathname}'s. def install(*sources) sources.each do |src| case src when Resource src.stage(self) when Resource::Partial src.resource.stage { install(*src.files) } when Array if src.empty? opoo "tried to install empty array to #{self}" break end src.each { |s| install_p(s, File.basename(s)) } when Hash if src.empty? opoo "tried to install empty hash to #{self}" break end src.each { |s, new_basename| install_p(s, new_basename) } else install_p(src, File.basename(src)) end end end def install_p(src, new_basename) raise Errno::ENOENT, src.to_s unless File.symlink?(src) || File.exist?(src) src = Pathname(src) dst = join(new_basename) dst = yield(src, dst) if block_given? return unless dst mkpath # Use FileUtils.mv over File.rename to handle filesystem boundaries. If src # is a symlink, and its target is moved first, FileUtils.mv will fail: # https://bugs.ruby-lang.org/issues/7707 # In that case, use the system "mv" command. if src.symlink? raise unless Kernel.system "mv", src, dst else FileUtils.mv src, dst end end private :install_p # Creates symlinks to sources in this folder. def install_symlink(*sources) sources.each do |src| case src when Array src.each { |s| install_symlink_p(s, File.basename(s)) } when Hash src.each { |s, new_basename| install_symlink_p(s, new_basename) } else install_symlink_p(src, File.basename(src)) end end end def install_symlink_p(src, new_basename) src = Pathname(src).expand_path(self) dst = join(new_basename) mkpath FileUtils.ln_sf(src.relative_path_from(dst.parent), dst) end private :install_symlink_p if method_defined?(:write) # @private alias old_write write end # we assume this pathname object is a file obviously def write(content, *open_args) raise "Will not overwrite #{self}" if exist? dirname.mkpath open("w", *open_args) { |f| f.write(content) } end # Only appends to a file that is already created. def append_lines(content, *open_args) raise "Cannot append file that doesn't exist: #{self}" unless exist? open("a", *open_args) { |f| f.puts(content) } end unless method_defined?(:binwrite) def binwrite(contents, *open_args) open("wb", *open_args) { |f| f.write(contents) } end end unless method_defined?(:binread) def binread(*open_args) open("rb", *open_args, &:read) end end # NOTE always overwrites def atomic_write(content) require "tempfile" tf = Tempfile.new(basename.to_s, dirname) begin tf.binmode tf.write(content) begin old_stat = stat rescue Errno::ENOENT old_stat = default_stat end uid = Process.uid gid = Process.groups.delete(old_stat.gid) { Process.gid } begin tf.chown(uid, gid) tf.chmod(old_stat.mode) rescue Errno::EPERM # rubocop:disable Lint/HandleExceptions end # Close the file before renaming to prevent the error: Device or resource busy # Affects primarily NFS. tf.close File.rename(tf.path, self) ensure tf.close! end end def default_stat sentinel = parent.join(".brew.#{Process.pid}.#{rand(Time.now.to_i)}") sentinel.open("w") {} sentinel.stat ensure sentinel.unlink end private :default_stat # @private def cp_path_sub(pattern, replacement) raise "#{self} does not exist" unless exist? dst = sub(pattern, replacement) raise "#{self} is the same file as #{dst}" if self == dst if directory? dst.mkpath else dst.dirname.mkpath dst = yield(self, dst) if block_given? FileUtils.cp(self, dst) end end # @private alias extname_old extname # extended to support common double extensions def extname(path = to_s) bottle_ext = path[BOTTLE_EXTNAME_RX, 1] return bottle_ext if bottle_ext archive_ext = path[/(\.(tar|cpio|pax)\.(gz|bz2|lz|xz|Z))$/, 1] return archive_ext if archive_ext File.extname(path) end # for filetypes we support, basename without extension def stem File.basename((path = to_s), extname(path)) end # I don't trust the children.length == 0 check particularly, not to mention # it is slow to enumerate the whole directory just to see if it is empty, # instead rely on good ol' libc and the filesystem # @private def rmdir_if_possible rmdir true rescue Errno::ENOTEMPTY if (ds_store = join(".DS_Store")).exist? && children.length == 1 ds_store.unlink retry else false end rescue Errno::EACCES, Errno::ENOENT, Errno::EBUSY false end # @private def version require "version" Version.parse(basename) end # @private def compression_type case extname when ".jar", ".war" # Don't treat jars or wars as compressed return when ".gz" # If the filename ends with .gz not preceded by .tar # then we want to gunzip but not tar return :gzip_only when ".bz2" return :bzip2_only when ".lha", ".lzh" return :lha end # Get enough of the file to detect common file types # POSIX tar magic has a 257 byte offset # magic numbers stolen from /usr/share/file/magic/ case open("rb") { |f| f.read(262) } when /^PK\003\004/n then :zip when /^\037\213/n then :gzip when /^BZh/n then :bzip2 when /^\037\235/n then :compress when /^.{257}ustar/n then :tar when /^\xFD7zXZ\x00/n then :xz when /^LZIP/n then :lzip when /^Rar!/n then :rar when /^7z\xBC\xAF\x27\x1C/n then :p7zip when /^xar!/n then :xar when /^\xed\xab\xee\xdb/n then :rpm else # This code so that bad-tarballs and zips produce good error messages # when they don't unarchive properly. case extname when ".tar.gz", ".tgz", ".tar.bz2", ".tbz" then :tar when ".zip" then :zip end end end # @private def text_executable? /^#!\s*\S+/ =~ open("r") { |f| f.read(1024) } end # @private def incremental_hash(klass) digest = klass.new if digest.respond_to?(:file) digest.file(self) else buf = "" open("rb") { |f| digest << buf while f.read(16384, buf) } end digest.hexdigest end def sha256 require "digest/sha2" incremental_hash(Digest::SHA256) end def verify_checksum(expected) raise ChecksumMissingError if expected.nil? || expected.empty? actual = Checksum.new(expected.hash_type, send(expected.hash_type).downcase) raise ChecksumMismatchError.new(self, expected, actual) unless expected == actual end alias to_str to_s unless method_defined?(:to_str) def cd Dir.chdir(self) { yield self } end def subdirs children.select(&:directory?) end # @private def resolved_path symlink? ? dirname.join(readlink) : self end # @private def resolved_path_exists? link = readlink rescue ArgumentError # The link target contains NUL bytes false else dirname.join(link).exist? end # @private def make_relative_symlink(src) dirname.mkpath File.symlink(src.relative_path_from(dirname), self) end unless method_defined?(:/) def /(other) if !other.respond_to?(:to_str) && !other.respond_to?(:to_path) odisabled "Pathname#/ with #{other.class}", "a String or a Pathname" end join(other.to_s) end end # @private def ensure_writable saved_perms = nil unless writable_real? saved_perms = stat.mode FileUtils.chmod "u+rw", to_path end yield ensure chmod saved_perms if saved_perms end # @private def install_info quiet_system "/usr/bin/install-info", "--quiet", to_s, "#{dirname}/dir" end # @private def uninstall_info quiet_system "/usr/bin/install-info", "--delete", "--quiet", to_s, "#{dirname}/dir" end # Writes an exec script in this folder for each target pathname def write_exec_script(*targets) targets.flatten! if targets.empty? opoo "tried to write exec scripts to #{self} for an empty list of targets" return end mkpath targets.each do |target| target = Pathname.new(target) # allow pathnames or strings join(target.basename).write <<~EOS #!/bin/bash exec "#{target}" "$@" EOS end end # Writes an exec script that sets environment variables def write_env_script(target, env) env_export = "" env.each { |key, value| env_export += "#{key}=\"#{value}\" " } dirname.mkpath write <<~EOS #!/bin/bash #{env_export}exec "#{target}" "$@" EOS end # Writes a wrapper env script and moves all files to the dst def env_script_all_files(dst, env) dst.mkpath Pathname.glob("#{self}/*") do |file| next if file.directory? dst.install(file) new_file = dst.join(file.basename) file.write_env_script(new_file, env) end end # Writes an exec script that invokes a java jar def write_jar_script(target_jar, script_name, java_opts = "", java_version: nil) mkpath java_home = if java_version "JAVA_HOME=\"$(#{Language::Java.java_home_cmd(java_version)})\" " end join(script_name).write <<~EOS #!/bin/bash #{java_home}exec java #{java_opts} -jar #{target_jar} "$@" EOS end def install_metafiles(from = Pathname.pwd) Pathname(from).children.each do |p| next if p.directory? next unless Metafiles.copy?(p.basename.to_s) # Some software symlinks these files (see help2man.rb) filename = p.resolved_path # Some software links metafiles together, so by the time we iterate to one of them # we may have already moved it. libxml2's COPYING and Copyright are affected by this. next unless filename.exist? filename.chmod 0644 install(filename) end end def ds_store? basename.to_s == ".DS_Store" end # https://bugs.ruby-lang.org/issues/9915 if RUBY_VERSION == "2.0.0" prepend Module.new { def inspect super.force_encoding(@path.encoding) end } end def binary_executable? false end def mach_o_bundle? false end def dylib? false end end require "extend/os/pathname" # @private module ObserverPathnameExtension class << self attr_accessor :n, :d def reset_counts! @n = @d = 0 @put_verbose_trimmed_warning = false end def total n + d end def counts [n, d] end MAXIMUM_VERBOSE_OUTPUT = 100 def verbose? return ARGV.verbose? unless ENV["CI"] return false unless ARGV.verbose? if total < MAXIMUM_VERBOSE_OUTPUT true else unless @put_verbose_trimmed_warning puts "Only the first #{MAXIMUM_VERBOSE_OUTPUT} operations were output." @put_verbose_trimmed_warning = true end false end end end def unlink super puts "rm #{self}" if ObserverPathnameExtension.verbose? ObserverPathnameExtension.n += 1 end def mkpath super puts "mkdir -p #{self}" if ObserverPathnameExtension.verbose? end def rmdir super puts "rmdir #{self}" if ObserverPathnameExtension.verbose? ObserverPathnameExtension.d += 1 end def make_relative_symlink(src) super puts "ln -s #{src.relative_path_from(dirname)} #{basename}" if ObserverPathnameExtension.verbose? ObserverPathnameExtension.n += 1 end def install_info super puts "info #{self}" if ObserverPathnameExtension.verbose? end def uninstall_info super puts "uninfo #{self}" if ObserverPathnameExtension.verbose? end end
{ "content_hash": "778623ed2dca50ed6f25096cdd8c71d8", "timestamp": "", "source": "github", "line_count": 558, "max_line_length": 101, "avg_line_length": 24.381720430107528, "alnum_prop": 0.6194046306504961, "repo_name": "hanxue/linuxbrew", "id": "dfe24b788612d7b1dd2d0ce4a2885342d429ced1", "size": "13605", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "Library/Homebrew/extend/pathname.rb", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "HTML", "bytes": "10960" }, { "name": "PostScript", "bytes": "485" }, { "name": "Roff", "bytes": "68521" }, { "name": "Ruby", "bytes": "1989030" }, { "name": "Shell", "bytes": "72066" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.kie.workbench.services</groupId> <artifactId>kie-wb-common-compiler</artifactId> <version>7.57.0-SNAPSHOT</version> </parent> <artifactId>kie-wb-common-compiler-testutil</artifactId> <name>Kie Workbench - Common - Compiler - Testutil</name> <description>Kie Workbench - Common - Compiler - Testutil</description> <properties> <java.module.name>org.kie.wb.common.services.backend.compiler.testutil</java.module.name> </properties> <dependencies> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-core</artifactId> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> </dependency> <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> </dependency> </dependencies> </project>
{ "content_hash": "588902c7893dc78f524848604eebf294", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 149, "avg_line_length": 32.91304347826087, "alnum_prop": 0.6796565389696169, "repo_name": "droolsjbpm/kie-wb-common", "id": "a1f4768a768741d7c95d8c53ce62ee6229caa0de", "size": "1514", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "kie-wb-common-services/kie-wb-common-compiler/kie-wb-common-compiler-testutil/pom.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "38549" }, { "name": "FreeMarker", "bytes": "37490" }, { "name": "GAP", "bytes": "86275" }, { "name": "HTML", "bytes": "127323" }, { "name": "Java", "bytes": "19056067" } ], "symlink_target": "" }
from django.core.urlresolvers import reverse from django import http from horizon.workflows import views from mox import IsA # noqa from openstack_dashboard import api from openstack_dashboard.dashboards.project.networks import tests from openstack_dashboard.test import helpers as test INDEX_URL = reverse('horizon:admin:networks:index') class NetworkTests(test.BaseAdminViewTests): @test.create_stubs({api.neutron: ('network_list',), api.keystone: ('tenant_list',)}) def test_index(self): tenants = self.tenants.list() api.neutron.network_list(IsA(http.HttpRequest)) \ .AndReturn(self.networks.list()) api.keystone.tenant_list(IsA(http.HttpRequest))\ .AndReturn([tenants, False]) self.mox.ReplayAll() res = self.client.get(INDEX_URL) self.assertTemplateUsed(res, 'admin/networks/index.html') networks = res.context['networks_table'].data self.assertItemsEqual(networks, self.networks.list()) @test.create_stubs({api.neutron: ('network_list',)}) def test_index_network_list_exception(self): api.neutron.network_list(IsA(http.HttpRequest)) \ .AndRaise(self.exceptions.neutron) self.mox.ReplayAll() res = self.client.get(INDEX_URL) self.assertTemplateUsed(res, 'admin/networks/index.html') self.assertEqual(len(res.context['networks_table'].data), 0) self.assertMessageCount(res, error=1) @test.create_stubs({api.neutron: ('network_get', 'subnet_list', 'port_list',)}) def test_network_detail(self): network_id = self.networks.first().id api.neutron.network_get(IsA(http.HttpRequest), network_id)\ .AndReturn(self.networks.first()) api.neutron.subnet_list(IsA(http.HttpRequest), network_id=network_id)\ .AndReturn([self.subnets.first()]) api.neutron.port_list(IsA(http.HttpRequest), network_id=network_id)\ .AndReturn([self.ports.first()]) self.mox.ReplayAll() res = self.client.get(reverse('horizon:admin:networks:detail', args=[network_id])) self.assertTemplateUsed(res, 'project/networks/detail.html') subnets = res.context['subnets_table'].data ports = res.context['ports_table'].data self.assertItemsEqual(subnets, [self.subnets.first()]) self.assertItemsEqual(ports, [self.ports.first()]) @test.create_stubs({api.neutron: ('network_get', 'subnet_list', 'port_list',)}) def test_network_detail_network_exception(self): network_id = self.networks.first().id api.neutron.network_get(IsA(http.HttpRequest), network_id)\ .AndRaise(self.exceptions.neutron) api.neutron.subnet_list(IsA(http.HttpRequest), network_id=network_id)\ .AndReturn([self.subnets.first()]) api.neutron.port_list(IsA(http.HttpRequest), network_id=network_id)\ .AndReturn([self.ports.first()]) self.mox.ReplayAll() url = reverse('horizon:admin:networks:detail', args=[network_id]) res = self.client.get(url) redir_url = INDEX_URL self.assertRedirectsNoFollow(res, redir_url) @test.create_stubs({api.neutron: ('network_get', 'subnet_list', 'port_list',)}) def test_network_detail_subnet_exception(self): network_id = self.networks.first().id api.neutron.network_get(IsA(http.HttpRequest), network_id).\ AndReturn(self.networks.first()) api.neutron.subnet_list(IsA(http.HttpRequest), network_id=network_id).\ AndRaise(self.exceptions.neutron) api.neutron.port_list(IsA(http.HttpRequest), network_id=network_id).\ AndReturn([self.ports.first()]) self.mox.ReplayAll() res = self.client.get(reverse('horizon:admin:networks:detail', args=[network_id])) self.assertTemplateUsed(res, 'project/networks/detail.html') subnets = res.context['subnets_table'].data ports = res.context['ports_table'].data self.assertEqual(len(subnets), 0) self.assertItemsEqual(ports, [self.ports.first()]) @test.create_stubs({api.neutron: ('network_get', 'subnet_list', 'port_list',)}) def test_network_detail_port_exception(self): network_id = self.networks.first().id api.neutron.network_get(IsA(http.HttpRequest), network_id).\ AndReturn(self.networks.first()) api.neutron.subnet_list(IsA(http.HttpRequest), network_id=network_id).\ AndReturn([self.subnets.first()]) api.neutron.port_list(IsA(http.HttpRequest), network_id=network_id).\ AndRaise(self.exceptions.neutron) self.mox.ReplayAll() res = self.client.get(reverse('horizon:admin:networks:detail', args=[network_id])) self.assertTemplateUsed(res, 'project/networks/detail.html') subnets = res.context['subnets_table'].data ports = res.context['ports_table'].data self.assertItemsEqual(subnets, [self.subnets.first()]) self.assertEqual(len(ports), 0) @test.create_stubs({api.neutron: ('profile_list',), api.keystone: ('tenant_list',)}) def test_network_create_get(self): tenants = self.tenants.list() api.keystone.tenant_list(IsA( http.HttpRequest)).AndReturn([tenants, False]) # TODO(absubram): Remove if clause and create separate # test stubs for when profile_support is being used. # Additionally ensure those are always run even in default setting if api.neutron.is_port_profiles_supported(): net_profiles = self.net_profiles.list() api.neutron.profile_list(IsA(http.HttpRequest), 'network').AndReturn(net_profiles) self.mox.ReplayAll() url = reverse('horizon:admin:networks:create') res = self.client.get(url) self.assertTemplateUsed(res, 'admin/networks/create.html') @test.create_stubs({api.neutron: ('network_create', 'profile_list',), api.keystone: ('tenant_list',)}) def test_network_create_post(self): tenants = self.tenants.list() tenant_id = self.tenants.first().id network = self.networks.first() api.keystone.tenant_list(IsA(http.HttpRequest))\ .AndReturn([tenants, False]) params = {'name': network.name, 'tenant_id': tenant_id, 'admin_state_up': network.admin_state_up, 'router:external': True, 'shared': True} # TODO(absubram): Remove if clause and create separate # test stubs for when profile_support is being used. # Additionally ensure those are always run even in default setting if api.neutron.is_port_profiles_supported(): net_profiles = self.net_profiles.list() net_profile_id = self.net_profiles.first().id api.neutron.profile_list(IsA(http.HttpRequest), 'network').AndReturn(net_profiles) params['net_profile_id'] = net_profile_id api.neutron.network_create(IsA(http.HttpRequest), **params)\ .AndReturn(network) self.mox.ReplayAll() form_data = {'tenant_id': tenant_id, 'name': network.name, 'admin_state': network.admin_state_up, 'external': True, 'shared': True} if api.neutron.is_port_profiles_supported(): form_data['net_profile_id'] = net_profile_id url = reverse('horizon:admin:networks:create') res = self.client.post(url, form_data) self.assertNoFormErrors(res) self.assertRedirectsNoFollow(res, INDEX_URL) @test.create_stubs({api.neutron: ('network_create', 'profile_list',), api.keystone: ('tenant_list',)}) def test_network_create_post_network_exception(self): tenants = self.tenants.list() tenant_id = self.tenants.first().id network = self.networks.first() api.keystone.tenant_list(IsA(http.HttpRequest))\ .AndReturn([tenants, False]) params = {'name': network.name, 'tenant_id': tenant_id, 'admin_state_up': network.admin_state_up, 'router:external': True, 'shared': False} # TODO(absubram): Remove if clause and create separate # test stubs for when profile_support is being used. # Additionally ensure those are always run even in default setting if api.neutron.is_port_profiles_supported(): net_profiles = self.net_profiles.list() net_profile_id = self.net_profiles.first().id api.neutron.profile_list(IsA(http.HttpRequest), 'network').AndReturn(net_profiles) params['net_profile_id'] = net_profile_id api.neutron.network_create(IsA(http.HttpRequest), **params)\ .AndRaise(self.exceptions.neutron) self.mox.ReplayAll() form_data = {'tenant_id': tenant_id, 'name': network.name, 'admin_state': network.admin_state_up, 'external': True, 'shared': False} if api.neutron.is_port_profiles_supported(): form_data['net_profile_id'] = net_profile_id url = reverse('horizon:admin:networks:create') res = self.client.post(url, form_data) self.assertNoFormErrors(res) self.assertRedirectsNoFollow(res, INDEX_URL) @test.create_stubs({api.neutron: ('network_get',)}) def test_network_update_get(self): network = self.networks.first() api.neutron.network_get(IsA(http.HttpRequest), network.id)\ .AndReturn(network) self.mox.ReplayAll() url = reverse('horizon:admin:networks:update', args=[network.id]) res = self.client.get(url) self.assertTemplateUsed(res, 'admin/networks/update.html') @test.create_stubs({api.neutron: ('network_get',)}) def test_network_update_get_exception(self): network = self.networks.first() api.neutron.network_get(IsA(http.HttpRequest), network.id)\ .AndRaise(self.exceptions.neutron) self.mox.ReplayAll() url = reverse('horizon:admin:networks:update', args=[network.id]) res = self.client.get(url) redir_url = INDEX_URL self.assertRedirectsNoFollow(res, redir_url) @test.create_stubs({api.neutron: ('network_update', 'network_get',)}) def test_network_update_post(self): network = self.networks.first() params = {'name': network.name, 'shared': True, 'admin_state_up': network.admin_state_up, 'router:external': True} api.neutron.network_update(IsA(http.HttpRequest), network.id, **params)\ .AndReturn(network) api.neutron.network_get(IsA(http.HttpRequest), network.id)\ .AndReturn(network) self.mox.ReplayAll() form_data = {'network_id': network.id, 'name': network.name, 'tenant_id': network.tenant_id, 'admin_state': network.admin_state_up, 'shared': True, 'external': True} url = reverse('horizon:admin:networks:update', args=[network.id]) res = self.client.post(url, form_data) self.assertRedirectsNoFollow(res, INDEX_URL) @test.create_stubs({api.neutron: ('network_update', 'network_get',)}) def test_network_update_post_exception(self): network = self.networks.first() params = {'name': network.name, 'shared': False, 'admin_state_up': network.admin_state_up, 'router:external': False} api.neutron.network_update(IsA(http.HttpRequest), network.id, **params)\ .AndRaise(self.exceptions.neutron) api.neutron.network_get(IsA(http.HttpRequest), network.id)\ .AndReturn(network) self.mox.ReplayAll() form_data = {'network_id': network.id, 'name': network.name, 'tenant_id': network.tenant_id, 'admin_state': network.admin_state_up, 'shared': False, 'external': False} url = reverse('horizon:admin:networks:update', args=[network.id]) res = self.client.post(url, form_data) self.assertRedirectsNoFollow(res, INDEX_URL) @test.create_stubs({api.neutron: ('network_list', 'network_delete'), api.keystone: ('tenant_list',)}) def test_delete_network(self): tenants = self.tenants.list() network = self.networks.first() api.keystone.tenant_list(IsA(http.HttpRequest))\ .AndReturn([tenants, False]) api.neutron.network_list(IsA(http.HttpRequest))\ .AndReturn([network]) api.neutron.network_delete(IsA(http.HttpRequest), network.id) self.mox.ReplayAll() form_data = {'action': 'networks__delete__%s' % network.id} res = self.client.post(INDEX_URL, form_data) self.assertRedirectsNoFollow(res, INDEX_URL) @test.create_stubs({api.neutron: ('network_list', 'network_delete'), api.keystone: ('tenant_list',)}) def test_delete_network_exception(self): tenants = self.tenants.list() network = self.networks.first() api.keystone.tenant_list(IsA(http.HttpRequest))\ .AndReturn([tenants, False]) api.neutron.network_list(IsA(http.HttpRequest))\ .AndReturn([network]) api.neutron.network_delete(IsA(http.HttpRequest), network.id)\ .AndRaise(self.exceptions.neutron) self.mox.ReplayAll() form_data = {'action': 'networks__delete__%s' % network.id} res = self.client.post(INDEX_URL, form_data) self.assertRedirectsNoFollow(res, INDEX_URL) class NetworkSubnetTests(test.BaseAdminViewTests): @test.create_stubs({api.neutron: ('subnet_get',)}) def test_subnet_detail(self): subnet = self.subnets.first() api.neutron.subnet_get(IsA(http.HttpRequest), subnet.id)\ .AndReturn(self.subnets.first()) self.mox.ReplayAll() url = reverse('horizon:admin:networks:subnets:detail', args=[subnet.id]) res = self.client.get(url) self.assertTemplateUsed(res, 'project/networks/subnets/detail.html') self.assertEqual(res.context['subnet'].id, subnet.id) @test.create_stubs({api.neutron: ('subnet_get',)}) def test_subnet_detail_exception(self): subnet = self.subnets.first() api.neutron.subnet_get(IsA(http.HttpRequest), subnet.id)\ .AndRaise(self.exceptions.neutron) self.mox.ReplayAll() url = reverse('horizon:admin:networks:subnets:detail', args=[subnet.id]) res = self.client.get(url) # admin DetailView is shared with userpanel one, so # redirection URL on error is userpanel index. redir_url = reverse('horizon:project:networks:index') self.assertRedirectsNoFollow(res, redir_url) @test.create_stubs({api.neutron: ('network_get',)}) def test_subnet_create_get(self): network = self.networks.first() api.neutron.network_get(IsA(http.HttpRequest), network.id)\ .AndReturn(self.networks.first()) self.mox.ReplayAll() url = reverse('horizon:admin:networks:addsubnet', args=[network.id]) res = self.client.get(url) self.assertTemplateUsed(res, views.WorkflowView.template_name) @test.create_stubs({api.neutron: ('network_get', 'subnet_create',)}) def test_subnet_create_post(self): network = self.networks.first() subnet = self.subnets.first() api.neutron.network_get(IsA(http.HttpRequest), network.id)\ .AndReturn(self.networks.first()) api.neutron.network_get(IsA(http.HttpRequest), network.id)\ .AndReturn(self.networks.first()) api.neutron.subnet_create(IsA(http.HttpRequest), network_id=network.id, name=subnet.name, cidr=subnet.cidr, ip_version=subnet.ip_version, gateway_ip=subnet.gateway_ip, enable_dhcp=subnet.enable_dhcp, allocation_pools=subnet.allocation_pools, tenant_id=subnet.tenant_id)\ .AndReturn(subnet) self.mox.ReplayAll() form_data = tests.form_data_subnet(subnet) url = reverse('horizon:admin:networks:addsubnet', args=[subnet.network_id]) res = self.client.post(url, form_data) self.assertNoFormErrors(res) redir_url = reverse('horizon:admin:networks:detail', args=[subnet.network_id]) self.assertRedirectsNoFollow(res, redir_url) @test.create_stubs({api.neutron: ('network_get', 'subnet_create',)}) def test_subnet_create_post_network_exception(self): network = self.networks.first() subnet = self.subnets.first() api.neutron.network_get(IsA(http.HttpRequest), network.id)\ .AndRaise(self.exceptions.neutron) self.mox.ReplayAll() form_data = tests.form_data_subnet(subnet, allocation_pools=[]) url = reverse('horizon:admin:networks:addsubnet', args=[subnet.network_id]) res = self.client.post(url, form_data) self.assertNoFormErrors(res) # admin DetailView is shared with userpanel one, so # redirection URL on error is userpanel index. redir_url = reverse('horizon:project:networks:index') self.assertRedirectsNoFollow(res, redir_url) @test.create_stubs({api.neutron: ('network_get', 'subnet_create',)}) def test_subnet_create_post_subnet_exception(self): network = self.networks.first() subnet = self.subnets.first() api.neutron.network_get(IsA(http.HttpRequest), network.id)\ .AndReturn(self.networks.first()) api.neutron.network_get(IsA(http.HttpRequest), network.id)\ .AndReturn(self.networks.first()) api.neutron.subnet_create(IsA(http.HttpRequest), network_id=network.id, name=subnet.name, cidr=subnet.cidr, ip_version=subnet.ip_version, gateway_ip=subnet.gateway_ip, enable_dhcp=subnet.enable_dhcp, tenant_id=subnet.tenant_id)\ .AndRaise(self.exceptions.neutron) self.mox.ReplayAll() form_data = tests.form_data_subnet(subnet, allocation_pools=[]) url = reverse('horizon:admin:networks:addsubnet', args=[subnet.network_id]) res = self.client.post(url, form_data) redir_url = reverse('horizon:admin:networks:detail', args=[subnet.network_id]) self.assertRedirectsNoFollow(res, redir_url) @test.create_stubs({api.neutron: ('network_get',)}) def test_subnet_create_post_cidr_inconsistent(self): network = self.networks.first() subnet = self.subnets.first() api.neutron.network_get(IsA(http.HttpRequest), network.id)\ .AndReturn(self.networks.first()) self.mox.ReplayAll() # dummy IPv6 address cidr = '2001:0DB8:0:CD30:123:4567:89AB:CDEF/60' form_data = tests.form_data_subnet( subnet, cidr=cidr, allocation_pools=[]) url = reverse('horizon:admin:networks:addsubnet', args=[subnet.network_id]) res = self.client.post(url, form_data) expected_msg = 'Network Address and IP version are inconsistent.' self.assertContains(res, expected_msg) @test.create_stubs({api.neutron: ('network_get',)}) def test_subnet_create_post_gw_inconsistent(self): network = self.networks.first() subnet = self.subnets.first() api.neutron.network_get(IsA(http.HttpRequest), network.id)\ .AndReturn(self.networks.first()) self.mox.ReplayAll() # dummy IPv6 address gateway_ip = '2001:0DB8:0:CD30:123:4567:89AB:CDEF' form_data = tests.form_data_subnet(subnet, gateway_ip=gateway_ip, allocation_pools=[]) url = reverse('horizon:admin:networks:addsubnet', args=[subnet.network_id]) res = self.client.post(url, form_data) self.assertContains(res, 'Gateway IP and IP version are inconsistent.') @test.create_stubs({api.neutron: ('subnet_update', 'subnet_get',)}) def test_subnet_update_post(self): subnet = self.subnets.first() api.neutron.subnet_get(IsA(http.HttpRequest), subnet.id)\ .AndReturn(subnet) api.neutron.subnet_get(IsA(http.HttpRequest), subnet.id)\ .AndReturn(subnet) api.neutron.subnet_update(IsA(http.HttpRequest), subnet.id, name=subnet.name, enable_dhcp=subnet.enable_dhcp, dns_nameservers=[], host_routes=[])\ .AndReturn(subnet) self.mox.ReplayAll() form_data = tests.form_data_subnet(subnet, allocation_pools=[]) url = reverse('horizon:admin:networks:editsubnet', args=[subnet.network_id, subnet.id]) res = self.client.post(url, form_data) redir_url = reverse('horizon:admin:networks:detail', args=[subnet.network_id]) self.assertRedirectsNoFollow(res, redir_url) @test.create_stubs({api.neutron: ('subnet_update', 'subnet_get',)}) def test_subnet_update_post_gw_inconsistent(self): subnet = self.subnets.first() api.neutron.subnet_get(IsA(http.HttpRequest), subnet.id)\ .AndReturn(subnet) self.mox.ReplayAll() # dummy IPv6 address gateway_ip = '2001:0DB8:0:CD30:123:4567:89AB:CDEF' form_data = tests.form_data_subnet(subnet, gateway_ip=gateway_ip, allocation_pools=[]) url = reverse('horizon:admin:networks:editsubnet', args=[subnet.network_id, subnet.id]) res = self.client.post(url, form_data) self.assertContains(res, 'Gateway IP and IP version are inconsistent.') @test.create_stubs({api.neutron: ('subnet_delete', 'subnet_list', 'port_list',)}) def test_subnet_delete(self): subnet = self.subnets.first() network_id = subnet.network_id api.neutron.subnet_delete(IsA(http.HttpRequest), subnet.id) api.neutron.subnet_list(IsA(http.HttpRequest), network_id=network_id)\ .AndReturn([self.subnets.first()]) api.neutron.port_list(IsA(http.HttpRequest), network_id=network_id)\ .AndReturn([self.ports.first()]) self.mox.ReplayAll() form_data = {'action': 'subnets__delete__%s' % subnet.id} url = reverse('horizon:admin:networks:detail', args=[network_id]) res = self.client.post(url, form_data) self.assertRedirectsNoFollow(res, url) @test.create_stubs({api.neutron: ('subnet_delete', 'subnet_list', 'port_list',)}) def test_subnet_delete_exception(self): subnet = self.subnets.first() network_id = subnet.network_id api.neutron.subnet_delete(IsA(http.HttpRequest), subnet.id)\ .AndRaise(self.exceptions.neutron) api.neutron.subnet_list(IsA(http.HttpRequest), network_id=network_id)\ .AndReturn([self.subnets.first()]) api.neutron.port_list(IsA(http.HttpRequest), network_id=network_id)\ .AndReturn([self.ports.first()]) self.mox.ReplayAll() form_data = {'action': 'subnets__delete__%s' % subnet.id} url = reverse('horizon:admin:networks:detail', args=[network_id]) res = self.client.post(url, form_data) self.assertRedirectsNoFollow(res, url) class NetworkPortTests(test.BaseAdminViewTests): @test.create_stubs({api.neutron: ('port_get',)}) def test_port_detail(self): port = self.ports.first() api.neutron.port_get(IsA(http.HttpRequest), port.id)\ .AndReturn(self.ports.first()) self.mox.ReplayAll() res = self.client.get(reverse('horizon:admin:networks:ports:detail', args=[port.id])) self.assertTemplateUsed(res, 'project/networks/ports/detail.html') self.assertEqual(res.context['port'].id, port.id) @test.create_stubs({api.neutron: ('port_get',)}) def test_port_detail_exception(self): port = self.ports.first() api.neutron.port_get(IsA(http.HttpRequest), port.id)\ .AndRaise(self.exceptions.neutron) self.mox.ReplayAll() res = self.client.get(reverse('horizon:admin:networks:ports:detail', args=[port.id])) # admin DetailView is shared with userpanel one, so # redirection URL on error is userpanel index. redir_url = reverse('horizon:project:networks:index') self.assertRedirectsNoFollow(res, redir_url) @test.create_stubs({api.neutron: ('network_get',)}) def test_port_create_get(self): network = self.networks.first() api.neutron.network_get(IsA(http.HttpRequest), network.id)\ .AndReturn(self.networks.first()) self.mox.ReplayAll() url = reverse('horizon:admin:networks:addport', args=[network.id]) res = self.client.get(url) self.assertTemplateUsed(res, 'admin/networks/ports/create.html') @test.create_stubs({api.neutron: ('network_get', 'port_create')}) def test_port_create_post(self): network = self.networks.first() port = self.ports.first() api.neutron.network_get(IsA(http.HttpRequest), network.id)\ .AndReturn(self.networks.first()) api.neutron.network_get(IsA(http.HttpRequest), network.id)\ .AndReturn(self.networks.first()) api.neutron.port_create(IsA(http.HttpRequest), tenant_id=network.tenant_id, network_id=network.id, name=port.name, admin_state_up=port.admin_state_up, device_id=port.device_id, device_owner=port.device_owner)\ .AndReturn(port) self.mox.ReplayAll() form_data = {'network_id': port.network_id, 'network_name': network.name, 'name': port.name, 'admin_state': port.admin_state_up, 'device_id': port.device_id, 'device_owner': port.device_owner} url = reverse('horizon:admin:networks:addport', args=[port.network_id]) res = self.client.post(url, form_data) self.assertNoFormErrors(res) redir_url = reverse('horizon:admin:networks:detail', args=[port.network_id]) self.assertRedirectsNoFollow(res, redir_url) @test.create_stubs({api.neutron: ('network_get', 'port_create')}) def test_port_create_post_exception(self): network = self.networks.first() port = self.ports.first() api.neutron.network_get(IsA(http.HttpRequest), network.id)\ .AndReturn(self.networks.first()) api.neutron.network_get(IsA(http.HttpRequest), network.id)\ .AndReturn(self.networks.first()) api.neutron.port_create(IsA(http.HttpRequest), tenant_id=network.tenant_id, network_id=network.id, name=port.name, admin_state_up=port.admin_state_up, device_id=port.device_id, device_owner=port.device_owner)\ .AndRaise(self.exceptions.neutron) self.mox.ReplayAll() form_data = {'network_id': port.network_id, 'network_name': network.name, 'name': port.name, 'admin_state': port.admin_state_up, 'device_id': port.device_id, 'device_owner': port.device_owner} url = reverse('horizon:admin:networks:addport', args=[port.network_id]) res = self.client.post(url, form_data) self.assertNoFormErrors(res) redir_url = reverse('horizon:admin:networks:detail', args=[port.network_id]) self.assertRedirectsNoFollow(res, redir_url) @test.create_stubs({api.neutron: ('port_get',)}) def test_port_update_get(self): port = self.ports.first() api.neutron.port_get(IsA(http.HttpRequest), port.id)\ .AndReturn(port) self.mox.ReplayAll() url = reverse('horizon:admin:networks:editport', args=[port.network_id, port.id]) res = self.client.get(url) self.assertTemplateUsed(res, 'admin/networks/ports/update.html') @test.create_stubs({api.neutron: ('port_get', 'port_update')}) def test_port_update_post(self): port = self.ports.first() api.neutron.port_get(IsA(http.HttpRequest), port.id)\ .AndReturn(port) api.neutron.port_update(IsA(http.HttpRequest), port.id, name=port.name, admin_state_up=port.admin_state_up, device_id=port.device_id, device_owner=port.device_owner)\ .AndReturn(port) self.mox.ReplayAll() form_data = {'network_id': port.network_id, 'port_id': port.id, 'name': port.name, 'admin_state': port.admin_state_up, 'device_id': port.device_id, 'device_owner': port.device_owner} url = reverse('horizon:admin:networks:editport', args=[port.network_id, port.id]) res = self.client.post(url, form_data) redir_url = reverse('horizon:admin:networks:detail', args=[port.network_id]) self.assertRedirectsNoFollow(res, redir_url) @test.create_stubs({api.neutron: ('port_get', 'port_update')}) def test_port_update_post_exception(self): port = self.ports.first() api.neutron.port_get(IsA(http.HttpRequest), port.id)\ .AndReturn(port) api.neutron.port_update(IsA(http.HttpRequest), port.id, name=port.name, admin_state_up=port.admin_state_up, device_id=port.device_id, device_owner=port.device_owner)\ .AndRaise(self.exceptions.neutron) self.mox.ReplayAll() form_data = {'network_id': port.network_id, 'port_id': port.id, 'name': port.name, 'admin_state': port.admin_state_up, 'device_id': port.device_id, 'device_owner': port.device_owner} url = reverse('horizon:admin:networks:editport', args=[port.network_id, port.id]) res = self.client.post(url, form_data) redir_url = reverse('horizon:admin:networks:detail', args=[port.network_id]) self.assertRedirectsNoFollow(res, redir_url) @test.create_stubs({api.neutron: ('port_delete', 'subnet_list', 'port_list',)}) def test_port_delete(self): port = self.ports.first() network_id = port.network_id api.neutron.port_delete(IsA(http.HttpRequest), port.id) api.neutron.subnet_list(IsA(http.HttpRequest), network_id=network_id)\ .AndReturn([self.subnets.first()]) api.neutron.port_list(IsA(http.HttpRequest), network_id=network_id)\ .AndReturn([self.ports.first()]) self.mox.ReplayAll() form_data = {'action': 'ports__delete__%s' % port.id} url = reverse('horizon:admin:networks:detail', args=[network_id]) res = self.client.post(url, form_data) self.assertRedirectsNoFollow(res, url) @test.create_stubs({api.neutron: ('port_delete', 'subnet_list', 'port_list',)}) def test_port_delete_exception(self): port = self.ports.first() network_id = port.network_id api.neutron.port_delete(IsA(http.HttpRequest), port.id)\ .AndRaise(self.exceptions.neutron) api.neutron.subnet_list(IsA(http.HttpRequest), network_id=network_id)\ .AndReturn([self.subnets.first()]) api.neutron.port_list(IsA(http.HttpRequest), network_id=network_id)\ .AndReturn([self.ports.first()]) self.mox.ReplayAll() form_data = {'action': 'ports__delete__%s' % port.id} url = reverse('horizon:admin:networks:detail', args=[network_id]) res = self.client.post(url, form_data) self.assertRedirectsNoFollow(res, url)
{ "content_hash": "1de6b8e8b4a05fe8db1fa62c1b7aa43d", "timestamp": "", "source": "github", "line_count": 839, "max_line_length": 79, "avg_line_length": 42.69964243146603, "alnum_prop": 0.5560362875087229, "repo_name": "spandanb/horizon", "id": "e3635953452e4084a958e067bc1c3e98e8f734fc", "size": "36433", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "openstack_dashboard/dashboards/admin/networks/tests.py", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
#ifndef OPENCAD_H #define OPENCAD_H #define OCAD_VERSION "0.3.4" #define OCAD_VERSION_MAJOR 0 #define OCAD_VERSION_MINOR 3 #define OCAD_VERSION_REV 4 #ifndef OCAD_COMPUTE_VERSION #define OCAD_COMPUTE_VERSION(maj,min,rev) ((maj)*10000+(min)*100+rev) // maj - any, min < 99, rev < 99 #endif #define OCAD_VERSION_NUM OCAD_COMPUTE_VERSION(OCAD_VERSION_MAJOR,OCAD_VERSION_MINOR,OCAD_VERSION_REV) /* check if the current version is at least major.minor.revision */ #define CHECK_VERSION(major,minor,rev) \ (OCAD_VERSION_MAJOR > (major) || \ (OCAD_VERSION_MAJOR == (major) && OCAD_VERSION_MINOR > (minor)) || \ (OCAD_VERSION_MAJOR == (major) && OCAD_VERSION_MINOR == (minor) && OCAD_VERSION_REV >= (release))) #define DWG_VERSION_STR_SIZE 6 #ifndef OCAD_EXTERN #ifdef OCAD_STATIC #define OCAD_EXTERN extern #else # if defined (_MSC_VER) # ifdef OCAD_EXPORTS # define OCAD_EXTERN __declspec(dllexport) // extern # else # define OCAD_EXTERN __declspec(dllimport) // extern # endif # else # if defined(__GNUC__) && __GNUC__ >= 4 # define OCAD_EXTERN __attribute__((visibility("default"))) # else # define OCAD_EXTERN extern # endif # endif #endif #endif #if defined(__GNUC__) && __GNUC__ >= 4 # define OCAD_PRINT_FUNC_FORMAT( format_idx, arg_idx ) __attribute__((__format__ (__printf__, format_idx, arg_idx))) #else # define OCAD_PRINT_FUNC_FORMAT( format_idx, arg_idx ) #endif void DebugMsg(const char *, ...) OCAD_PRINT_FUNC_FORMAT (1,2); #endif // OPENCAD_H
{ "content_hash": "d6219d60b431bbd4050aa27b5d7fb2ad", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 116, "avg_line_length": 29.884615384615383, "alnum_prop": 0.6492921492921493, "repo_name": "naturalatlas/node-gdal", "id": "b2ba28dec6b6c98a369b7be3fb6165ebbbb6e72f", "size": "3209", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "deps/libgdal/gdal/ogr/ogrsf_frmts/cad/libopencad/opencad.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C++", "bytes": "498326" }, { "name": "JavaScript", "bytes": "235768" }, { "name": "Makefile", "bytes": "2034" }, { "name": "Python", "bytes": "6059" }, { "name": "Shell", "bytes": "608" } ], "symlink_target": "" }
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.apimanagement.generated; import com.azure.core.util.Context; import com.azure.resourcemanager.apimanagement.fluent.models.PortalSigninSettingsInner; /** Samples for SignInSettings CreateOrUpdate. */ public final class SignInSettingsCreateOrUpdateSamples { /* * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsPutSignIn.json */ /** * Sample code: ApiManagementPortalSettingsUpdateSignIn. * * @param manager Entry point to ApiManagementManager. */ public static void apiManagementPortalSettingsUpdateSignIn( com.azure.resourcemanager.apimanagement.ApiManagementManager manager) { manager .signInSettings() .createOrUpdateWithResponse( "rg1", "apimService1", new PortalSigninSettingsInner().withEnabled(true), "*", Context.NONE); } }
{ "content_hash": "c232eb4ddc5966e37aea0a292c8ae9ea", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 164, "avg_line_length": 41.51851851851852, "alnum_prop": 0.7448706512042819, "repo_name": "Azure/azure-sdk-for-java", "id": "c08a6b11200e4b7aaffdd8e48f98663e497da3a6", "size": "1121", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "sdk/apimanagement/azure-resourcemanager-apimanagement/src/samples/java/com/azure/resourcemanager/apimanagement/generated/SignInSettingsCreateOrUpdateSamples.java", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "8762" }, { "name": "Bicep", "bytes": "15055" }, { "name": "CSS", "bytes": "7676" }, { "name": "Dockerfile", "bytes": "2028" }, { "name": "Groovy", "bytes": "3237482" }, { "name": "HTML", "bytes": "42090" }, { "name": "Java", "bytes": "432409546" }, { "name": "JavaScript", "bytes": "36557" }, { "name": "Jupyter Notebook", "bytes": "95868" }, { "name": "PowerShell", "bytes": "737517" }, { "name": "Python", "bytes": "240542" }, { "name": "Scala", "bytes": "1143898" }, { "name": "Shell", "bytes": "18488" }, { "name": "XSLT", "bytes": "755" } ], "symlink_target": "" }
package org.slf4j.helpers; import org.slf4j.ILoggerFactory; import org.slf4j.Logger; import java.util.ArrayList; import java.util.List; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; /** * SubstituteLoggerFactory manages instances of {@link SubstituteLogger}. * * @author Ceki G&uuml;lc&uuml; * @author Chetan Mehrotra */ public class SubstituteLoggerFactory implements ILoggerFactory { final ConcurrentMap<String, SubstituteLogger> loggers = new ConcurrentHashMap<String, SubstituteLogger>(); public Logger getLogger(String name) { SubstituteLogger logger = loggers.get(name); if (logger == null) { logger = new SubstituteLogger(name); SubstituteLogger oldLogger = loggers.putIfAbsent(name, logger); if (oldLogger != null) logger = oldLogger; } return logger; } public List<String> getLoggerNames() { return new ArrayList<String>(loggers.keySet()); } public List<SubstituteLogger> getLoggers() { return new ArrayList<SubstituteLogger>(loggers.values()); } public void clear() { loggers.clear(); } }
{ "content_hash": "8a9fa10aae177b1136abc2b1101f9fcb", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 108, "avg_line_length": 26.65909090909091, "alnum_prop": 0.6973572037510657, "repo_name": "jfuentes/IRWeb", "id": "dfeca26539e1e28044ed41f0bca00f2d27b38d1b", "size": "2398", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "WebContent/WEB-INF/lib/slf4j-1.7.10/slf4j-api/src/main/java/org/slf4j/helpers/SubstituteLoggerFactory.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ApacheConf", "bytes": "182" }, { "name": "CSS", "bytes": "63402" }, { "name": "Groff", "bytes": "44472477" }, { "name": "HTML", "bytes": "9780517" }, { "name": "Java", "bytes": "1006498" }, { "name": "JavaScript", "bytes": "12808" } ], "symlink_target": "" }
/******************************************************************************* DESCRIPTION *******************************************************************************/ /** @brief VSCP persistent memory driver @file vscp_ps.c @author Andreas Merkle, http://www.blue-andi.de @section desc Description @see vscp_ps.h *******************************************************************************/ /******************************************************************************* INCLUDES *******************************************************************************/ #include "vscp_ps.h" #include "vscp_ps_access.h" /******************************************************************************* COMPILER SWITCHES *******************************************************************************/ /******************************************************************************* CONSTANTS *******************************************************************************/ /******************************************************************************* MACROS *******************************************************************************/ /******************************************************************************* TYPES AND STRUCTURES *******************************************************************************/ /******************************************************************************* PROTOTYPES *******************************************************************************/ /******************************************************************************* LOCAL VARIABLES *******************************************************************************/ /******************************************************************************* GLOBAL VARIABLES *******************************************************************************/ /******************************************************************************* GLOBAL FUNCTIONS *******************************************************************************/ /** * This function initializes the persistent memory access module. * It doesn't write anything in the persistent memory! It only initializes * the module that read/write access is possible. */ extern void vscp_ps_init(void) { /* Initialize persistent memory access driver */ vscp_ps_access_init(); return; } #if VSCP_CONFIG_BASE_IS_ENABLED( VSCP_CONFIG_BOOT_LOADER_SUPPORTED ) /** * This function reads the boot flag from persistent memory. * * @return Boot flag */ extern uint8_t vscp_ps_readBootFlag(void) { return vscp_ps_access_read8(VSCP_PS_ADDR_BOOT_FLAG); } /** * This function writes the boot flag to persistent memory. * * @param[in] bootFlag Boot flag */ extern void vscp_ps_writeBootFlag(uint8_t bootFlag) { vscp_ps_access_write8(VSCP_PS_ADDR_BOOT_FLAG, bootFlag); return; } #endif /* VSCP_CONFIG_BASE_IS_ENABLED( VSCP_CONFIG_BOOT_LOADER_SUPPORTED ) */ /** * This function reads the nickname id of the node form the persistent memory. * * @return Nickname id */ extern uint8_t vscp_ps_readNicknameId(void) { return vscp_ps_access_read8(VSCP_PS_ADDR_NICKNAME); } /** * This function writes the nickname id of the node to the persistent memory. * * @param[in] nickname Nickname id */ extern void vscp_ps_writeNicknameId(uint8_t nickname) { vscp_ps_access_write8(VSCP_PS_ADDR_NICKNAME, nickname); return; } #if VSCP_CONFIG_BASE_IS_ENABLED( VSCP_CONFIG_HEARTBEAT_SUPPORT_SEGMENT ) /** * This function reads the stored segment controller CRC from the persistent memory. * * @return Segment controller CRC */ extern uint8_t vscp_ps_readSegmentControllerCRC(void) { return vscp_ps_access_read8(VSCP_PS_ADDR_SEGMENT_CONTROLLER_CRC); } /** * This function writes the segment controller CRC to the persistent memory. * * @param[in] crc Segment controller CRC */ extern void vscp_ps_writeSegmentControllerCRC(uint8_t crc) { vscp_ps_access_write8(VSCP_PS_ADDR_SEGMENT_CONTROLLER_CRC, crc); return; } #endif /* VSCP_CONFIG_BASE_IS_ENABLED( VSCP_CONFIG_HEARTBEAT_SUPPORT_SEGMENT ) */ /** * Read the node control flags from persistent memory. * * @return Node control flags */ extern uint8_t vscp_ps_readNodeControlFlags(void) { return vscp_ps_access_read8(VSCP_PS_ADDR_NODE_CONTROL_FLAGS); } /** * Write the node control flags to persistent memory. * * @param[in] value Value to write */ extern void vscp_ps_writeNodeControlFlags(uint8_t value) { vscp_ps_access_write8(VSCP_PS_ADDR_NODE_CONTROL_FLAGS, value); return; } /** * Read byte @see index of the user id from persistent memory. * Note that index 0 is the LSB and index 4 the MSB. * * @param[in] index Index of the user id [0-4] * @return User id byte @see index */ extern uint8_t vscp_ps_readUserId(uint8_t index) { uint8_t data = 0; if (VSCP_PS_SIZE_USER_ID > index) { data = vscp_ps_access_read8(VSCP_PS_ADDR_USER_ID + index); } return data; } /** * Write byte @see index of the user id to persistent memory. * Note that index 0 is the LSB and index 4 the MSB. * * @param[in] index Index of the user id [0-4] * @param[in] value User id byte @see index */ extern void vscp_ps_writeUserId(uint8_t index, uint8_t value) { if (VSCP_PS_SIZE_USER_ID > index) { vscp_ps_access_write8(VSCP_PS_ADDR_USER_ID + index, value); } return; } #if VSCP_CONFIG_BASE_IS_ENABLED( VSCP_DEV_DATA_CONFIG_ENABLE_GUID_STORAGE_PS ) /** * Read byte @see index of the GUID from persistent memory. * Note that index 0 is the LSB and index 15 the MSB. * * @param[in] index Index of the GUID [0-15] * @return GUID byte @see index */ extern uint8_t vscp_ps_readGUID(uint8_t index) { uint8_t data = 0; if (VSCP_PS_SIZE_GUID > index) { data = vscp_ps_access_read8(VSCP_PS_ADDR_GUID + index); } return data; } /** * Write byte @see index of the GUID to persistent memory. * Note that index 0 is the LSB and index 15 the MSB. * * @param[in] index Index of the GUID [0-15] * @param[in] value GUID byte @see index */ extern void vscp_ps_writeGUID(uint8_t index, uint8_t value) { if (VSCP_PS_SIZE_GUID > index) { vscp_ps_access_write8(VSCP_PS_ADDR_GUID + index, value); } return; } #endif /* VSCP_CONFIG_BASE_IS_ENABLED( VSCP_DEV_DATA_CONFIG_ENABLE_GUID_STORAGE_PS ) */ #if VSCP_CONFIG_BASE_IS_ENABLED( VSCP_DEV_DATA_CONFIG_ENABLE_NODE_ZONE_STORAGE_PS ) /** * Read node zone from persistent memory. * * @return Node zone */ extern uint8_t vscp_ps_readNodeZone(void) { return vscp_ps_access_read8(VSCP_PS_ADDR_NODE_ZONE); } /** * Write node zone to persistent memory. * * @param[in] value Node zone */ extern void vscp_ps_writeNodeZone(uint8_t value) { vscp_ps_access_write8(VSCP_PS_ADDR_NODE_ZONE, value); return; } #endif /* VSCP_CONFIG_BASE_IS_ENABLED( VSCP_DEV_DATA_CONFIG_ENABLE_NODE_ZONE_STORAGE_PS ) */ #if VSCP_CONFIG_BASE_IS_ENABLED( VSCP_DEV_DATA_CONFIG_ENABLE_NODE_SUB_ZONE_STORAGE_PS ) /** * Read node sub zone from persistent memory. * * @return Node sub zone */ extern uint8_t vscp_ps_readNodeSubZone(void) { return vscp_ps_access_read8(VSCP_PS_ADDR_NODE_SUB_ZONE); } /** * Write node sub zone to persistent memory. * * @param[in] value Node sub zone */ extern void vscp_ps_writeNodeSubZone(uint8_t value) { vscp_ps_access_write8(VSCP_PS_ADDR_NODE_SUB_ZONE, value); return; } #endif /* VSCP_CONFIG_BASE_IS_ENABLED( VSCP_DEV_DATA_CONFIG_ENABLE_NODE_SUB_ZONE_STORAGE_PS ) */ #if VSCP_CONFIG_BASE_IS_ENABLED( VSCP_DEV_DATA_CONFIG_ENABLE_MANUFACTURER_DEV_ID_STORAGE_PS ) /** * Read the manufacturer device id from persistent memory. * Note that index 0 is the LSB and index 3 the MSB. * * @param[in] index Index of the manufacturer device id [0-3] * @return Manufacturer device id */ extern uint8_t vscp_ps_readManufacturerDevId(uint8_t index) { uint8_t value = 0; if (VSCP_PS_SIZE_MANUFACTURER_DEV_ID > index) { value = vscp_ps_access_read8(VSCP_PS_ADDR_MANUFACTURER_DEV_ID + index); } return value; } /** * Write the manufacturer device id to persistent memory. * Note that index 0 is the LSB and index 3 the MSB. * * @param[in] index Index of the manufacturer device id [0-3] * @param[in] value Manufacturer device id */ extern void vscp_ps_writeManufacturerDevId(uint8_t index, uint8_t value) { if (VSCP_PS_SIZE_MANUFACTURER_DEV_ID > index) { vscp_ps_access_write8(VSCP_PS_ADDR_MANUFACTURER_DEV_ID + index, value); } return; } #endif /* VSCP_CONFIG_BASE_IS_ENABLED( VSCP_DEV_DATA_CONFIG_ENABLE_MANUFACTURER_DEV_ID_STORAGE_PS ) */ #if VSCP_CONFIG_BASE_IS_ENABLED( VSCP_DEV_DATA_CONFIG_ENABLE_MANUFACTURER_SUB_DEV_ID_STORAGE_PS ) /** * Read the manufacturer sub device id from persistent memory. * Note that index 0 is the LSB and index 3 the MSB. * * @param[in] index Index of the manufacturer sub device id [0-3] * @return Manufacturer sub device id */ extern uint8_t vscp_ps_readManufacturerSubDevId(uint8_t index) { uint8_t value = 0; if (VSCP_PS_SIZE_MANUFACTURER_SUB_DEV_ID > index) { value = vscp_ps_access_read8(VSCP_PS_ADDR_MANUFACTURER_SUB_DEV_ID + index); } return value; } /** * Write the manufacturer sub device id to persistent memory. * Note that index 0 is the LSB and index 3 the MSB. * * @param[in] index Index of the manufacturer sub device id [0-3] * @param[in] value Manufacturer sub device id */ extern void vscp_ps_writeManufacturerSubDevId(uint8_t index, uint8_t value) { if (VSCP_PS_SIZE_MANUFACTURER_SUB_DEV_ID > index) { vscp_ps_access_write8(VSCP_PS_ADDR_MANUFACTURER_SUB_DEV_ID + index, value); } return; } #endif /* VSCP_CONFIG_BASE_IS_ENABLED( VSCP_DEV_DATA_CONFIG_ENABLE_MANUFACTURER_SUB_DEV_ID_STORAGE_PS ) */ #if VSCP_CONFIG_BASE_IS_ENABLED( VSCP_DEV_DATA_CONFIG_ENABLE_MDF_URL_STORAGE_PS ) /** * Read the MDF URL from persistent memory. * * @param[in] index Index * @return MDF URL value */ extern uint8_t vscp_ps_readMdfUrl(uint8_t index) { uint8_t value = 0; if (VSCP_PS_SIZE_MDF_URL > index) { value = vscp_ps_access_read8(VSCP_PS_ADDR_MDF_URL + index); } return value; } /** * Write the manufacturer sub device id to persistent memory. * Note that index 0 is the LSB and index 3 the MSB. * * @param[in] index Index * @param[in] value MDF URL value */ extern void vscp_ps_writeMdfUrl(uint8_t index, uint8_t value) { if (VSCP_PS_SIZE_MDF_URL > index) { vscp_ps_access_write8(VSCP_PS_ADDR_MDF_URL + index, value); } return; } #endif /* VSCP_CONFIG_BASE_IS_ENABLED( VSCP_DEV_DATA_CONFIG_ENABLE_MDF_URL_STORAGE_PS ) */ #if VSCP_CONFIG_BASE_IS_ENABLED( VSCP_DEV_DATA_CONFIG_ENABLE_STD_DEV_FAMILY_CODE_STORAGE_PS ) /** * Read the standard device family code from persistent memory. * Note that index 0 is the LSB and index 3 the MSB. * * @param[in] index Index of the standard device family code [0-3] * @return Standard device family code */ extern uint8_t vscp_ps_readStdDevFamilyCode(uint8_t index) { uint8_t value = 0; if (VSCP_PS_SIZE_STD_DEV_FAMILY_CODE > index) { value = vscp_ps_access_read8(VSCP_PS_ADDR_STD_DEV_FAMILY_CODE + index); } return value; } /** * Write the standard device family code to persistent memory. * Note that index 0 is the LSB and index 3 the MSB. * * @param[in] index Index of the standard device family code [0-3] * @param[in] value Standard device family code */ extern void vscp_ps_writeStdDevFamilyCode(uint8_t index, uint8_t value) { if (VSCP_PS_SIZE_STD_DEV_FAMILY_CODE > index) { vscp_ps_access_write8(VSCP_PS_ADDR_STD_DEV_FAMILY_CODE + index, value); } return; } #endif /* VSCP_CONFIG_BASE_IS_ENABLED( VSCP_DEV_DATA_CONFIG_ENABLE_STD_DEV_FAMILY_CODE_STORAGE_PS ) */ #if VSCP_CONFIG_BASE_IS_ENABLED( VSCP_DEV_DATA_CONFIG_ENABLE_STD_DEV_TYPE_STORAGE_PS ) /** * Read the standard device type from persistent memory. * Note that index 0 is the LSB and index 3 the MSB. * * @param[in] index Index of the standard device type [0-3] * @return Standard device type */ extern uint8_t vscp_ps_readStdDevType(uint8_t index) { uint8_t value = 0; if (VSCP_PS_SIZE_STD_DEV_TYPE > index) { value = vscp_ps_access_read8(VSCP_PS_ADDR_STD_DEV_TYPE + index); } return value; } /** * Write the standard device type to persistent memory. * Note that index 0 is the LSB and index 3 the MSB. * * @param[in] index Index of the standard device type [0-3] * @param[in] value Standard device type */ extern void vscp_ps_writeStdDevType(uint8_t index, uint8_t value) { if (VSCP_PS_SIZE_STD_DEV_TYPE > index) { vscp_ps_access_write8(VSCP_PS_ADDR_STD_DEV_TYPE + index, value); } return; } #endif /* VSCP_CONFIG_BASE_IS_ENABLED( VSCP_DEV_DATA_CONFIG_ENABLE_STD_DEV_TYPE_STORAGE_PS ) */ #if VSCP_CONFIG_BASE_IS_ENABLED( VSCP_CONFIG_ENABLE_LOGGER ) /** * Read the log id (stream id) from persistent memory. * * @return Log id */ extern uint8_t vscp_ps_readLogId(void) { return vscp_ps_access_read8(VSCP_PS_ADDR_LOG_ID); } /** * Write the log id (stream id) to persistent memory. * * @param[in] value Log id */ extern void vscp_ps_writeLogId(uint8_t value) { vscp_ps_access_write8(VSCP_PS_ADDR_LOG_ID, value); return; } #endif /* VSCP_CONFIG_BASE_IS_ENABLED( VSCP_CONFIG_ENABLE_LOGGER ) */ #if VSCP_CONFIG_BASE_IS_ENABLED( VSCP_CONFIG_ENABLE_DM ) /** * Read the decision matrix from persistent memory. * * @param[in] index Decision matrix index * @return Value */ extern uint8_t vscp_ps_readDM(uint16_t index) { uint8_t value = 0; if (VSCP_PS_SIZE_DM > index) { value = vscp_ps_access_read8(VSCP_PS_ADDR_DM + index); } return value; } /** * Write the decision matrix to persistent memory. * * @param[in] index Decision matrix index * @param[in] value Decision matrix value */ extern void vscp_ps_writeDM(uint16_t index, uint8_t value) { if (VSCP_PS_SIZE_DM > index) { vscp_ps_access_write8(VSCP_PS_ADDR_DM + index, value); } return; } #if VSCP_CONFIG_BASE_IS_ENABLED( VSCP_CONFIG_ENABLE_DM_EXTENSION ) /** * Read the decision matrix extension from persistent memory. * * @param[in] index Decision matrix extension index * @return Value */ extern uint8_t vscp_ps_readDMExtension(uint16_t index) { uint8_t value = 0; if (VSCP_PS_SIZE_DM_EXTENSION > index) { value = vscp_ps_access_read8(VSCP_PS_ADDR_DM_EXTENSION + index); } return value; } /** * Write the decision matrix extension to persistent memory. * * @param[in] index Decision matrix extension index * @param[in] value Decision matrix extension value */ extern void vscp_ps_writeDMExtension(uint16_t index, uint8_t value) { if (VSCP_PS_SIZE_DM_EXTENSION > index) { vscp_ps_access_write8(VSCP_PS_ADDR_DM_EXTENSION + index, value); } return; } #endif /* VSCP_CONFIG_BASE_IS_ENABLED( VSCP_CONFIG_ENABLE_DM_EXTENSION ) */ #endif /* VSCP_CONFIG_BASE_IS_ENABLED( VSCP_CONFIG_ENABLE_DM ) */ #if VSCP_CONFIG_BASE_IS_ENABLED( VSCP_CONFIG_ENABLE_DM_NEXT_GENERATION ) /** * Read the decision matrix next generation from persistent memory. * * @param[in] index Decision matrix next generation index * @return Value */ extern uint8_t vscp_ps_readDMNextGeneration(uint16_t index) { uint8_t value = 0; if (VSCP_PS_SIZE_DM_NEXT_GENERATION > index) { value = vscp_ps_access_read8(VSCP_PS_ADDR_DM_NEXT_GENERATION + index); } return value; } /** * Write the decision matrix next generation to persistent memory. * * @param[in] index Decision matrix next generation index * @param[in] value Value */ extern void vscp_ps_writeDMNextGeneration(uint16_t index, uint8_t value) { if (VSCP_PS_SIZE_DM_NEXT_GENERATION > index) { vscp_ps_access_write8(VSCP_PS_ADDR_DM_NEXT_GENERATION + index, value); } return; } #endif /* VSCP_CONFIG_BASE_IS_ENABLED( VSCP_CONFIG_ENABLE_DM_NEXT_GENERATION ) */ /******************************************************************************* LOCAL FUNCTIONS *******************************************************************************/
{ "content_hash": "1adec79b378daaf08523afac4049ecb1", "timestamp": "", "source": "github", "line_count": 625, "max_line_length": 107, "avg_line_length": 27.5056, "alnum_prop": 0.5751265196905357, "repo_name": "grodansparadis/vscp-arduino", "id": "f1c76470008468528512f4eed036f006ce225cc3", "size": "18417", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "VSCP/src/framework/vscp_ps.c", "mode": "33188", "license": "mit", "language": [ { "name": "Arduino", "bytes": "18636" }, { "name": "C", "bytes": "517755" }, { "name": "C++", "bytes": "53486" } ], "symlink_target": "" }
<h2 id="lifetimes">Lifetimes</h2> <h3><a href="#why-lifetimes" name="why-lifetimes"> Why lifetimes? </a></h3> Lifetimes are Rust's answer to the question of memory safety. They allow Rust to ensure memory safety without the performance costs of garbage collection. They are based on a variety of academic work, which can be found in the [Rust book](https://doc.rust-lang.org/stable/book/bibliography.html#type-system). <h3><a href="#why-is-the-lifetime-syntax-the-way-it-is" name="why-is-the-lifetime-syntax-the-way-it-is"> Why is the lifetime syntax the way it is? </a></h3> The `'a` syntax comes from the ML family of programming languages, where `'a` is used to indicate a generic type parameter. For Rust, the syntax had to be something that was unambiguous, noticeable, and fit nicely in a type declaration right alongside traits and references. Alternative syntaxes have been discussed, but no alternative syntax has been demonstrated to be clearly better. <h3><a href="#how-do-i-return-a-borrow-to-something-i-created-from-a-function" name="how-do-i-return-a-borrow-to-something-i-created-from-a-function"> How do I return a borrow to something I created from a function? </a></h3> You need to ensure that the borrowed item will outlive the function. This can be done by binding the output lifetime to some input lifetime like so: ```rust type Pool = TypedArena<Thing>; // (the lifetime below is only written explicitly for // expository purposes; it can be omitted via the // elision rules described in a later FAQ entry) fn create_borrowed<'a>(pool: &'a Pool, x: i32, y: i32) -> &'a Thing { pool.alloc(Thing { x: x, y: y }) } ``` An alternative is to eliminate the references entirely by returning an owning type like [`String`][String]: ```rust fn happy_birthday(name: &str, age: i64) -> String { format!("Hello {}! You're {} years old!", name, age) } ``` This approach is simpler, but often results in unnecessary allocations. <h3><a href="#when-are-lifetimes-required-to-be-explicit" name="when-are-lifetimes-required-to-be-explicit"> Why do some references have lifetimes, like <code>&amp;'a T</code>, and some do not, like <code>&amp;T</code>? </a></h3> In fact, *all* reference types have a lifetime, but most of the time you do not have to write it explicitly. The rules are as follows: 1. Within a function body, you never have to write a lifetime explicitly; the correct value should always be inferred. 2. Within a function *signature* (for example, in the types of its arguments, or its return type), you *may* have to write a lifetime explicitly. Lifetimes there use a simple defaulting scheme called ["lifetime elision"](https://doc.rust-lang.org/book/lifetimes.html#lifetime-elision), which consists of the following three rules: - Each elided lifetime in a function’s arguments becomes a distinct lifetime parameter. - If there is exactly one input lifetime, elided or not, that lifetime is assigned to all elided lifetimes in the return values of that function. - If there are multiple input lifetimes, but one of them is &self or &mut self, the lifetime of self is assigned to all elided output lifetimes. 3. Finally, in a `struct` or `enum` definition, all lifetimes must be explicitly declared. If these rules result in compilation errors, the Rust compiler will provide an error message indicating the error caused, and suggesting a potential solution based on which step of the inference process caused the error. <h3><a href="#how-can-rust-guarantee-no-null-pointers" name="how-can-rust-guarantee-no-null-pointers"> How can Rust guarantee "no null pointers" and "no dangling pointers"? </a></h3> The only way to construct a value of type `&Foo` or `&mut Foo` is to specify an existing value of type `Foo` that the reference points to. The reference "borrows" the original value for a given region of code (the lifetime of the reference), and the value being borrowed from cannot be moved or destroyed for the duration of the borrow. <h3><a href="#how-do-i-express-the-absense-of-a-value-without-null" name="how-do-i-express-the-absense-of-a-value-without-null"> How do I express the absence of a value without <code>null</code>? </a></h3> You can do that with the [`Option`][Option] type, which can either be `Some(T)` or `None`. `Some(T)` indicates that a value of type `T` is contained within, while `None` indicates the absence of a value.
{ "content_hash": "10442e43dcfee9bad80a492e94dfadb0", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 386, "avg_line_length": 56.0625, "alnum_prop": 0.7375696767001115, "repo_name": "AndrewBrinker/rust-faq", "id": "fe1b27492797e0fc4fe9d191b306fa8af2f912af", "size": "4487", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "faq/lifetimes.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Shell", "bytes": "560" } ], "symlink_target": "" }
package javax.print.attribute; /** * <code>DocAttributeSet</code> specifies an attribute set which only * allows printing attributes of type * {@link javax.print.attribute.DocAttribute}. * <p> * The methods {@link #add(Attribute)} and {@link #addAll(AttributeSet)} are * respecified in this interface to indicate that only * <code>DocAttribute</code> instances are allowed in this set. * </p> * * @author Michael Koch (konqueror@gmx.de) */ public interface DocAttributeSet extends AttributeSet { /** * Adds the specified attribute value to this attribute set * if it is not already present. * * This operation removes any existing attribute of the same category * before adding the given attribute. * * @param attribute the attribute to add. * @return <code>true</code> if the set is changed, false otherwise. * @throws ClassCastException if attribute is not of type * <code>DocAttribute</code>. * @throws NullPointerException if the attribute is <code>null</code>. * @throws UnmodifiableSetException if the set does not support modification. */ boolean add (Attribute attribute); /** * Adds all of the elements in the specified set to this attribute set. * * @param attributes the set of attributes to add. * @return <code>true</code> if the set is changed, false otherwise. * @throws ClassCastException if one of the attributes is not of type * <code>DocAttribute</code>. * @throws UnmodifiableSetException if the set does not support modification. * * @see #add(Attribute) */ boolean addAll (AttributeSet attributes); }
{ "content_hash": "dd32ca1b0bfc2b82eda292156dc21682", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 79, "avg_line_length": 34.361702127659576, "alnum_prop": 0.7145510835913312, "repo_name": "the-linix-project/linix-kernel-source", "id": "35a2676b1971eb59de319d16f1859c083d40ba4c", "size": "3356", "binary": false, "copies": "153", "ref": "refs/heads/master", "path": "gccsrc/gcc-4.7.2/libjava/classpath/javax/print/attribute/DocAttributeSet.java", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Ada", "bytes": "38139979" }, { "name": "Assembly", "bytes": "3723477" }, { "name": "Awk", "bytes": "83739" }, { "name": "C", "bytes": "103607293" }, { "name": "C#", "bytes": "55726" }, { "name": "C++", "bytes": "38577421" }, { "name": "CLIPS", "bytes": "6933" }, { "name": "CSS", "bytes": "32588" }, { "name": "Emacs Lisp", "bytes": "13451" }, { "name": "FORTRAN", "bytes": "4294984" }, { "name": "GAP", "bytes": "13089" }, { "name": "Go", "bytes": "11277335" }, { "name": "Haskell", "bytes": "2415" }, { "name": "Java", "bytes": "45298678" }, { "name": "JavaScript", "bytes": "6265" }, { "name": "Matlab", "bytes": "56" }, { "name": "OCaml", "bytes": "148372" }, { "name": "Objective-C", "bytes": "995127" }, { "name": "Objective-C++", "bytes": "436045" }, { "name": "PHP", "bytes": "12361" }, { "name": "Pascal", "bytes": "40318" }, { "name": "Perl", "bytes": "358808" }, { "name": "Python", "bytes": "60178" }, { "name": "SAS", "bytes": "1711" }, { "name": "Scilab", "bytes": "258457" }, { "name": "Shell", "bytes": "2610907" }, { "name": "Tcl", "bytes": "17983" }, { "name": "TeX", "bytes": "1455571" }, { "name": "XSLT", "bytes": "156419" } ], "symlink_target": "" }
package org.apache.lucene.queryParser.standard.config; import org.apache.lucene.queryParser.core.config.QueryConfigHandler; import org.apache.lucene.queryParser.standard.processors.PhraseSlopQueryNodeProcessor; import org.apache.lucene.util.AttributeImpl; /** * This attribute is used by {@link PhraseSlopQueryNodeProcessor} processor and * must be defined in the {@link QueryConfigHandler}. This attribute tells the * processor what is the default phrase slop when no slop is defined in a * phrase. <br/> * * @see org.apache.lucene.queryParser.standard.config.DefaultOperatorAttribute */ public class DefaultPhraseSlopAttributeImpl extends AttributeImpl implements DefaultPhraseSlopAttribute { private static final long serialVersionUID = -2104763012527049527L; private int defaultPhraseSlop = 0; public DefaultPhraseSlopAttributeImpl() { defaultPhraseSlop = 0; //default value in 2.4 } public void setDefaultPhraseSlop(int defaultPhraseSlop) { this.defaultPhraseSlop = defaultPhraseSlop; } public int getDefaultPhraseSlop() { return this.defaultPhraseSlop; } @Override public void clear() { throw new UnsupportedOperationException(); } @Override public void copyTo(AttributeImpl target) { throw new UnsupportedOperationException(); } @Override public boolean equals(Object other) { if (other instanceof DefaultPhraseSlopAttributeImpl && ((DefaultPhraseSlopAttributeImpl) other).defaultPhraseSlop == this.defaultPhraseSlop) { return true; } return false; } @Override public int hashCode() { return Integer.valueOf(this.defaultPhraseSlop).hashCode(); } @Override public String toString() { return "<defaultPhraseSlop defaultPhraseSlop=" + this.defaultPhraseSlop + "/>"; } }
{ "content_hash": "b943ed8dcd0449f10e1968bee34e5b69", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 98, "avg_line_length": 25.549295774647888, "alnum_prop": 0.7497243660418964, "repo_name": "tokee/lucene", "id": "1f0ee2bf6c7d7d0249eaf8736ba69adc8e8446ea", "size": "2616", "binary": false, "copies": "1", "ref": "refs/heads/lucene_3_0_exposed", "path": "contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/config/DefaultPhraseSlopAttributeImpl.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "10292301" }, { "name": "JavaScript", "bytes": "43988" }, { "name": "Perl", "bytes": "46472" }, { "name": "Shell", "bytes": "1044" } ], "symlink_target": "" }
package ru.temsky.ipgeo.service; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import ru.temsky.ipgeo.IP; @Component public class WhoisIPGeoBase implements Whois { private final PageParser pageParserJsoup; @Autowired public WhoisIPGeoBase(PageParser pageParserJsoup) { this.pageParserJsoup = pageParserJsoup; } @Override public void whois(IP ip) { if (ip.getProvider().equals("RESERVED") || ip.getCountry().isEmpty() || !ip.getCity().isEmpty()) return; String source = pageParserJsoup.parse("http://www.ipgeobase.ru:7020/geo?ip=" + ip.getAddress()); Pattern pattern = Pattern.compile("<city>(.*?)</city>", Pattern.CASE_INSENSITIVE); Matcher matcher = pattern.matcher(source); if (matcher.find()) { String city = matcher.group(1); ip.setCity(city); } } }
{ "content_hash": "5be16f61744c1f2c97154dc4d3486a5b", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 98, "avg_line_length": 27.11764705882353, "alnum_prop": 0.7386117136659436, "repo_name": "temsky/IPGeoParser", "id": "4eeecca67ec884ee7f23ed9183f15eecf2838a30", "size": "922", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "IPGeoParser/src/main/java/ru/temsky/ipgeo/service/WhoisIPGeoBase.java", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "360" }, { "name": "HTML", "bytes": "6713" }, { "name": "Java", "bytes": "28147" } ], "symlink_target": "" }
<link rel="stylesheet" href="${syntaxHighlighterURL}/styles/github.css"> <script type="text/javascript" src="${syntaxHighlighterURL}/highlight.pack.js"></script> <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script> <script>hljs.initHighlightingOnLoad();</script>
{ "content_hash": "797b0599e30a38b9f8b5df31112153e4", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 88, "avg_line_length": 46.666666666666664, "alnum_prop": 0.7464285714285714, "repo_name": "deepmind/torch-dokx", "id": "6e8fd350fa9395e94a59258484504ee6a1613d55", "size": "280", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "templates/syntaxNoMathJax.html", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CMake", "bytes": "1249" }, { "name": "CSS", "bytes": "58157" }, { "name": "HTML", "bytes": "9294" }, { "name": "JavaScript", "bytes": "818" }, { "name": "Lua", "bytes": "123690" }, { "name": "Python", "bytes": "10746" } ], "symlink_target": "" }
module Tilia module DavAcl module Xml module Request # PrincipalSearchPropertySetReport request parser. # # This class parses the {DAV:}principal-search-property-set REPORT, as defined # in: # # https://tools.ietf.org/html/rfc3744#section-9.5 # # @copyright Copyright (C) 2007-2015 fruux GmbH (https://fruux.com/). # @author Evert Pot (http://evertpot.com/) # @license http://sabre.io/license/ Modified BSD License class PrincipalSearchPropertySetReport include Tilia::Xml::XmlDeserializable # The deserialize method is called during xml parsing. # # This method is called statictly, this is because in theory this method # may be used as a type of constructor, or factory method. # # Often you want to return an instance of the current class, but you are # free to return other data as well. # # You are responsible for advancing the reader to the next element. Not # doing anything will result in a never-ending loop. # # If you just want to skip parsing for this element altogether, you can # just call reader.next # # reader.parse_inner_tree will parse the entire sub-tree, and advance to # the next element. # # @param Reader reader # @return mixed def self.xml_deserialize(reader) fail Dav::Exception::BadRequest, 'The {DAV:}principal-search-property-set element must be empty' unless reader.empty_element? # The element is actually empty, so there's not much to do. reader.next new end end end end end end
{ "content_hash": "299b8e02a097020999ba56a199d35cc4", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 137, "avg_line_length": 36.816326530612244, "alnum_prop": 0.6003325942350333, "repo_name": "tilia/tilia-dav", "id": "645c34f59928d63c915bf660563ca928d71f97a0", "size": "1804", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/tilia/dav_acl/xml/request/principal_search_property_set_report.rb", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "17084" }, { "name": "Ruby", "bytes": "1797621" } ], "symlink_target": "" }
/* DO NOT EDIT THIS FILE - it is machine generated */ #include <jni.h> /* Header for class org_apache_hadoop_hbase_jni_CallbackHandlers */ #ifndef _Included_org_apache_hadoop_hbase_jni_CallbackHandlers #define _Included_org_apache_hadoop_hbase_jni_CallbackHandlers #ifdef __cplusplus extern "C" { #endif /* * Class: org_apache_hadoop_hbase_jni_CallbackHandlers * Method: mutationCallBack * Signature: (Ljava/lang/Throwable;JJJLjava/lang/Object;J)V */ JNIEXPORT void JNICALL Java_org_apache_hadoop_hbase_jni_CallbackHandlers_mutationCallBack (JNIEnv *, jclass, jthrowable, jlong, jlong, jlong, jobject, jlong); /* * Class: org_apache_hadoop_hbase_jni_CallbackHandlers * Method: getCallBack * Signature: (Ljava/lang/Throwable;JJJLjava/lang/Object;J)V */ JNIEXPORT void JNICALL Java_org_apache_hadoop_hbase_jni_CallbackHandlers_getCallBack (JNIEnv *, jclass, jthrowable, jlong, jlong, jlong, jobject, jlong); /* * Class: org_apache_hadoop_hbase_jni_CallbackHandlers * Method: clientFlushCallBack * Signature: (Ljava/lang/Throwable;JJJ)V */ JNIEXPORT void JNICALL Java_org_apache_hadoop_hbase_jni_CallbackHandlers_clientFlushCallBack (JNIEnv *, jclass, jthrowable, jlong, jlong, jlong); /* * Class: org_apache_hadoop_hbase_jni_CallbackHandlers * Method: clientCloseCallBack * Signature: (Ljava/lang/Throwable;JJJ)V */ JNIEXPORT void JNICALL Java_org_apache_hadoop_hbase_jni_CallbackHandlers_clientCloseCallBack (JNIEnv *, jclass, jthrowable, jlong, jlong, jlong); /* * Class: org_apache_hadoop_hbase_jni_CallbackHandlers * Method: scannerCloseCallBack * Signature: (Ljava/lang/Throwable;JJJ)V */ JNIEXPORT void JNICALL Java_org_apache_hadoop_hbase_jni_CallbackHandlers_scannerCloseCallBack (JNIEnv *, jclass, jthrowable, jlong, jlong, jlong); /* * Class: org_apache_hadoop_hbase_jni_CallbackHandlers * Method: scanNextCallBack * Signature: (Ljava/lang/Throwable;JJ[Ljava/lang/Object;IJ)V */ JNIEXPORT void JNICALL Java_org_apache_hadoop_hbase_jni_CallbackHandlers_scanNextCallBack (JNIEnv *, jclass, jthrowable, jlong, jlong, jobjectArray, jint, jlong); #ifdef __cplusplus } #endif #endif
{ "content_hash": "118d73d2106f2d0f32426764140a5c04", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 93, "avg_line_length": 35.016129032258064, "alnum_prop": 0.7521879318286504, "repo_name": "mapr/libhbase", "id": "8052ef8c69a2bf306f6c18837cc56c36f159d81f", "size": "2954", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/main/native/generated/org_apache_hadoop_hbase_jni_CallbackHandlers.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "71211" }, { "name": "C++", "bytes": "275275" }, { "name": "Java", "bytes": "36980" }, { "name": "Shell", "bytes": "2980" } ], "symlink_target": "" }
package com.jwetherell.quick_response_code.qrcode; import com.google.zxing.BarcodeFormat; import com.google.zxing.BinaryBitmap; import com.google.zxing.ChecksumException; import com.google.zxing.DecodeHintType; import com.google.zxing.FormatException; import com.google.zxing.NotFoundException; import com.google.zxing.Reader; import com.google.zxing.Result; import com.google.zxing.ResultMetadataType; import com.google.zxing.ResultPoint; import com.google.zxing.common.BitMatrix; import com.google.zxing.common.DecoderResult; import com.google.zxing.common.DetectorResult; import com.jwetherell.quick_response_code.qrcode.decoder.Decoder; import com.jwetherell.quick_response_code.qrcode.detector.Detector; import java.util.List; import java.util.Map; /** * This implementation can detect and decode QR Codes in an image. * * @author Sean Owen */ public class QRCodeReader implements Reader { private static final ResultPoint[] NO_POINTS = new ResultPoint[0]; private final Decoder decoder = new Decoder(); protected Decoder getDecoder() { return decoder; } /** * Locates and decodes a QR code in an image. * * @return a String representing the content encoded by the QR code * @throws com.google.zxing.NotFoundException * if a QR code cannot be found * @throws com.google.zxing.FormatException * if a QR code cannot be decoded * @throws com.google.zxing.ChecksumException * if error correction fails */ @Override public Result decode(BinaryBitmap image) throws NotFoundException, ChecksumException, FormatException { return decode(image, null); } @Override public Result decode(BinaryBitmap image, Map<DecodeHintType, ?> hints) throws NotFoundException, ChecksumException, FormatException { DecoderResult decoderResult; ResultPoint[] points; if (hints != null && hints.containsKey(DecodeHintType.PURE_BARCODE)) { BitMatrix bits = extractPureBits(image.getBlackMatrix()); decoderResult = decoder.decode(bits, hints); points = NO_POINTS; } else { DetectorResult detectorResult = new Detector(image.getBlackMatrix()).detect(hints); decoderResult = decoder.decode(detectorResult.getBits(), hints); points = detectorResult.getPoints(); } Result result = new Result(decoderResult.getText(), decoderResult.getRawBytes(), points, BarcodeFormat.QR_CODE); List<byte[]> byteSegments = decoderResult.getByteSegments(); if (byteSegments != null) { result.putMetadata(ResultMetadataType.BYTE_SEGMENTS, byteSegments); } String ecLevel = decoderResult.getECLevel(); if (ecLevel != null) { result.putMetadata(ResultMetadataType.ERROR_CORRECTION_LEVEL, ecLevel); } return result; } @Override public void reset() { // do nothing } /** * This method detects a code in a "pure" image -- that is, pure monochrome * image which contains only an unrotated, unskewed, image of a code, with * some white border around it. This is a specialized method that works * exceptionally fast in this special case. * * @see com.google.zxing.pdf417.PDF417Reader#extractPureBits(com.google.zxing.common.BitMatrix) * @see com.google.zxing.datamatrix.DataMatrixReader#extractPureBits(com.google.zxing.common.BitMatrix) */ private static BitMatrix extractPureBits(BitMatrix image) throws NotFoundException { int[] leftTopBlack = image.getTopLeftOnBit(); int[] rightBottomBlack = image.getBottomRightOnBit(); if (leftTopBlack == null || rightBottomBlack == null) { throw NotFoundException.getNotFoundInstance(); } int moduleSize = moduleSize(leftTopBlack, image); int top = leftTopBlack[1]; int bottom = rightBottomBlack[1]; int left = leftTopBlack[0]; int right = rightBottomBlack[0]; if (bottom - top != right - left) { // Special case, where bottom-right module wasn't black so we found // something else in // the last row // Assume it's a square, so use height as the width right = left + (bottom - top); } int matrixWidth = (right - left + 1) / moduleSize; int matrixHeight = (bottom - top + 1) / moduleSize; if (matrixWidth <= 0 || matrixHeight <= 0) { throw NotFoundException.getNotFoundInstance(); } if (matrixHeight != matrixWidth) { // Only possibly decode square regions throw NotFoundException.getNotFoundInstance(); } // Push in the "border" by half the module width so that we start // sampling in the middle of the module. Just in case the image is a // little off, this will help recover. int nudge = moduleSize >> 1; top += nudge; left += nudge; // Now just read off the bits BitMatrix bits = new BitMatrix(matrixWidth, matrixHeight); for (int y = 0; y < matrixHeight; y++) { int iOffset = top + y * moduleSize; for (int x = 0; x < matrixWidth; x++) { if (image.get(left + x * moduleSize, iOffset)) { bits.set(x, y); } } } return bits; } private static int moduleSize(int[] leftTopBlack, BitMatrix image) throws NotFoundException { int height = image.getHeight(); int width = image.getWidth(); int x = leftTopBlack[0]; int y = leftTopBlack[1]; while (x < width && y < height && image.get(x, y)) { x++; y++; } if (x == width || y == height) { throw NotFoundException.getNotFoundInstance(); } int moduleSize = x - leftTopBlack[0]; if (moduleSize == 0) { throw NotFoundException.getNotFoundInstance(); } return moduleSize; } }
{ "content_hash": "59615d709444e1008caa9dca4ff79c17", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 137, "avg_line_length": 36.44047619047619, "alnum_prop": 0.634923227703365, "repo_name": "amin10/songus", "id": "45e0306b9bd3e67c976a037374a899e12554fb40", "size": "6717", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Songus/app/src/main/java/com/jwetherell/quick_response_code/qrcode/QRCodeReader.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "518968" } ], "symlink_target": "" }
namespace moduler { namespace pcontainer { template <typename Container, typename Content> std::pair<bool,typename Container::const_iterator> find(const Container &container, const Content *const element) noexcept { const auto iterator(std::find_if(container.cbegin(), container.cend(), [element](const Content *node) { return *node == *element; })); return{ iterator != container.cend(),iterator }; } template <typename Container, typename Content> bool add_if_not_exists(Container &container, Content *const element) { const auto result(find(container, element)); if (!result.first) { container.push_back(element); return true; } return false; } } ModuleConnection::~ModuleConnection() { } bool ModuleConnection::hasModule(const ModuleHandle *const requiredModule) const noexcept { return pcontainer::find(m_dest, requiredModule).first; } bool ModuleConnection::addRequiredModule(ModuleHandle * requiredModule) { if (!pcontainer::add_if_not_exists(m_dest, requiredModule)) { m_modulerPrivate->incrementModuleReferenceCounter(requiredModule); return true; } return false; } }
{ "content_hash": "44c9a150e3712bbae70c1554f75e0e74", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 124, "avg_line_length": 26.88372093023256, "alnum_prop": 0.722318339100346, "repo_name": "LeDYoM/sgh", "id": "0c1827c124ae7ac41c5f6e6ca9106acea0a750fb", "size": "1268", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "moduler/moduleconnection.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "576" }, { "name": "C++", "bytes": "1158712" }, { "name": "CMake", "bytes": "38952" } ], "symlink_target": "" }
package psidev.psi.mi.jami.xml.io.writer.elements.impl.extended; import junit.framework.Assert; import org.junit.Test; import psidev.psi.mi.jami.model.Experiment; import psidev.psi.mi.jami.model.Organism; import psidev.psi.mi.jami.model.impl.DefaultAlias; import psidev.psi.mi.jami.model.impl.DefaultCvTerm; import psidev.psi.mi.jami.model.impl.DefaultExperiment; import psidev.psi.mi.jami.model.impl.DefaultPublication; import psidev.psi.mi.jami.xml.cache.PsiXmlObjectCache; import psidev.psi.mi.jami.xml.cache.InMemoryIdentityObjectCache; import psidev.psi.mi.jami.xml.io.writer.elements.impl.AbstractXmlWriterTest; import psidev.psi.mi.jami.xml.model.extension.HostOrganism; import javax.xml.stream.XMLStreamException; import java.io.IOException; /** * Unit tester for XmlHostOrganismWriter * * @author Marine Dumousseau (marine@ebi.ac.uk) * @version $Id$ * @since <pre>21/11/13</pre> */ public class XmlHostOrganismWriterTest extends AbstractXmlWriterTest { private String organism = "<hostOrganism ncbiTaxId=\"9606\"/>"; private String organismShortName = "<hostOrganism ncbiTaxId=\"9606\">\n" + " <names>\n" + " <shortLabel>human</shortLabel>\n"+ " </names>\n"+ "</hostOrganism>"; private String organismFullName = "<hostOrganism ncbiTaxId=\"9606\">\n" + " <names>\n" + " <shortLabel>human</shortLabel>\n"+ " <fullName>Homo Sapiens</fullName>\n"+ " </names>\n"+ "</hostOrganism>"; private String organismAliases = "<hostOrganism ncbiTaxId=\"9606\">\n" + " <names>\n" + " <shortLabel>human</shortLabel>\n"+ " <alias type=\"synonym\">homo sapiens</alias>\n"+ " <alias type=\"test\">test name</alias>\n"+ " </names>\n"+ "</hostOrganism>"; private String organismCelltype = "<hostOrganism ncbiTaxId=\"9606\">\n" + " <names>\n" + " <shortLabel>human</shortLabel>\n"+ " </names>\n"+ " <cellType>\n" + " <names>\n" + " <shortLabel>293t</shortLabel>\n"+ " </names>\n"+ " </cellType>\n"+ "</hostOrganism>"; private String organismTissue = "<hostOrganism ncbiTaxId=\"9606\">\n" + " <names>\n" + " <shortLabel>human</shortLabel>\n"+ " </names>\n"+ " <tissue>\n" + " <names>\n" + " <shortLabel>embryo</shortLabel>\n"+ " </names>\n"+ " </tissue>\n"+ "</hostOrganism>"; private String organismCompartment = "<hostOrganism ncbiTaxId=\"9606\">\n" + " <names>\n" + " <shortLabel>human</shortLabel>\n"+ " </names>\n"+ " <compartment>\n" + " <names>\n" + " <shortLabel>cytosol</shortLabel>\n"+ " </names>\n"+ " </compartment>\n"+ "</hostOrganism>"; private String organismExperiments = "<hostOrganism ncbiTaxId=\"9606\">\n" + " <names>\n" + " <shortLabel>human</shortLabel>\n"+ " </names>\n"+ " <experimentRefList>\n" + " <experimentRef>1</experimentRef>\n"+ " <experimentRef>2</experimentRef>\n"+ " </experimentRefList>\n"+ "</hostOrganism>"; private String organismExperiments2 = "<hostOrganism ncbiTaxId=\"9606\">\n" + " <names>\n" + " <shortLabel>human</shortLabel>\n"+ " </names>\n"+ " <experimentRefList>\n" + " <experimentRef>2</experimentRef>\n"+ " <experimentRef>3</experimentRef>\n"+ " </experimentRefList>\n"+ "</hostOrganism>"; private PsiXmlObjectCache elementCache = new InMemoryIdentityObjectCache(); @Test public void test_write_organism_no_name() throws XMLStreamException, IOException { Organism organism = new HostOrganism(9606); XmlHostOrganismWriter writer = new XmlHostOrganismWriter(createStreamWriter(), this.elementCache); writer.write(organism); streamWriter.flush(); Assert.assertEquals(this.organism, output.toString()); } @Test public void test_write_organism_shortName() throws XMLStreamException, IOException { Organism organism = new HostOrganism(9606, "human"); XmlHostOrganismWriter writer = new XmlHostOrganismWriter(createStreamWriter(), this.elementCache); writer.write(organism); streamWriter.flush(); Assert.assertEquals(this.organismShortName, output.toString()); } @Test public void test_write_organism_fullName() throws XMLStreamException, IOException { Organism organism = new HostOrganism(9606, "human", "Homo Sapiens"); XmlHostOrganismWriter writer = new XmlHostOrganismWriter(createStreamWriter(), this.elementCache); writer.write(organism); streamWriter.flush(); Assert.assertEquals(this.organismFullName, output.toString()); } @Test public void test_write_organism_aliases() throws XMLStreamException, IOException { Organism organism = new HostOrganism(9606, "human"); organism.getAliases().add(new DefaultAlias(new DefaultCvTerm("synonym"), "homo sapiens")); organism.getAliases().add(new DefaultAlias(new DefaultCvTerm("test"), "test name")); XmlHostOrganismWriter writer = new XmlHostOrganismWriter(createStreamWriter(), this.elementCache); writer.write(organism); streamWriter.flush(); Assert.assertEquals(this.organismAliases, output.toString()); } @Test public void test_write_organism_celltype() throws XMLStreamException, IOException { Organism organism = new HostOrganism(9606, "human"); organism.setCellType(new DefaultCvTerm("293t")); XmlHostOrganismWriter writer = new XmlHostOrganismWriter(createStreamWriter(), this.elementCache); writer.write(organism); streamWriter.flush(); Assert.assertEquals(this.organismCelltype, output.toString()); } @Test public void test_write_organism_tissue() throws XMLStreamException, IOException { Organism organism = new HostOrganism(9606, "human"); organism.setTissue(new DefaultCvTerm("embryo")); XmlHostOrganismWriter writer = new XmlHostOrganismWriter(createStreamWriter(), this.elementCache); writer.write(organism); streamWriter.flush(); Assert.assertEquals(this.organismTissue, output.toString()); } @Test public void test_write_organism_compartment() throws XMLStreamException, IOException { Organism organism = new HostOrganism(9606, "human"); organism.setCompartment(new DefaultCvTerm("cytosol")); XmlHostOrganismWriter writer = new XmlHostOrganismWriter(createStreamWriter(), this.elementCache); writer.write(organism); streamWriter.flush(); Assert.assertEquals(this.organismCompartment, output.toString()); } @Test public void test_write_organism_experiments() throws XMLStreamException, IOException { HostOrganism organism = new HostOrganism(9606, "human"); organism.getExperiments().add(new DefaultExperiment(new DefaultPublication("P12345"))); organism.getExperiments().add(new DefaultExperiment(new DefaultPublication("P123456"))); this.elementCache.clear(); XmlHostOrganismWriter writer = new XmlHostOrganismWriter(createStreamWriter(), this.elementCache); writer.write(organism); streamWriter.flush(); Assert.assertEquals(this.organismExperiments, output.toString()); } @Test public void test_write_organism_experimentsRegistered() throws XMLStreamException, IOException { HostOrganism organism = new HostOrganism(9606, "human"); Experiment exp1 = new DefaultExperiment(new DefaultPublication("P12345")); Experiment exp2 = new DefaultExperiment(new DefaultPublication("P123456")); organism.getExperiments().add(exp1); organism.getExperiments().add(exp2); this.elementCache.clear(); this.elementCache.extractIdForExperiment(new DefaultExperiment(new DefaultPublication("P1234"))); this.elementCache.extractIdForExperiment(exp1); this.elementCache.extractIdForExperiment(exp2); XmlHostOrganismWriter writer = new XmlHostOrganismWriter(createStreamWriter(), this.elementCache); writer.write(organism); streamWriter.flush(); Assert.assertEquals(this.organismExperiments2, output.toString()); } }
{ "content_hash": "b543c94a1b85979ac2258d4493b96b6d", "timestamp": "", "source": "github", "line_count": 211, "max_line_length": 106, "avg_line_length": 41.540284360189574, "alnum_prop": 0.6381061038220194, "repo_name": "MICommunity/psi-jami", "id": "0f99b72ad14cac49d977a34dccd7fb4ff179310a", "size": "8765", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "jami-xml/src/test/java/psidev/psi/mi/jami/xml/io/writer/elements/impl/extended/XmlHostOrganismWriterTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "3953" }, { "name": "HTML", "bytes": "2996" }, { "name": "Java", "bytes": "20488264" }, { "name": "JavaScript", "bytes": "22224" }, { "name": "XSLT", "bytes": "25595" } ], "symlink_target": "" }
var logicDemo = angular.module('logicDemo', []); logicDemo.controller('TestCtrl', function($scope) { $scope.buildIndexer = function(n) { var output = []; for (var i = 0; i < n; i++) { output.push(i); } return output; }; $scope.buildErrors = function(n) { var output = []; for (var i = 0; i < n; i++) { output.push(''); } return output; }; $scope.questionData = { language: logicProofData.BASE_STUDENT_LANGUAGE, vocabulary: DEFAULT_VOCABULARY, mistake_table: [[], [], [], []], general_messages: logicProofData.BASE_GENERAL_MESSAGES }; $scope.proofString = ( 'from P\u2227Q we have P\nfrom P\u2227Q we have Q\nfrom Q and P we have ' + 'Q\u2227P'); $scope.displayMessage = function(message, line) { $scope.proofError = ''; for (var i = 0; i < line; i++) { $scope.proofError += ' \n'; } var pointer = 0; while (pointer < message.length) { var nextSpace = message.slice(pointer, pointer + 70).lastIndexOf(' '); var breakPoint = ( (nextSpace <= 0 || pointer + 70 >= message.length) ? 70 : nextSpace + 1); $scope.proofError += ( message.slice(pointer, pointer + breakPoint) + '\n'); pointer += breakPoint; } }; $scope.editProof = function() { $scope.checkSuccess = false; if ($scope.proofString.slice(-1) === '\n') { var questionInstance = logicProofStudent.buildInstance( $scope.questionData); try { logicProofStudent.validateProof($scope.proofString, questionInstance); } catch (err) { $scope.displayMessage(err.message, err.line); } } else { $scope.proofError = ''; } }; $scope.submitProof = function() { var questionInstance = logicProofStudent.buildInstance( $scope.questionData); try { var proof = logicProofStudent.buildProof( $scope.proofString, questionInstance); logicProofStudent.checkProof(proof, questionInstance); $scope.proofError = ''; $scope.checkSuccess = true; } catch (err) { $scope.displayMessage(err.message, err.line); $scope.checkSuccess = false; } }; // LOCAL CHECK (for testing only) $scope.doLocalCheck = function() { questionInstance = logicProofStudent.buildInstance($scope.questionData); proof = logicProofStudent.buildProof($scope.proofString, questionInstance); $scope.localCheck = 'mistake not found'; var parameters = { proof: proof, assumptions: questionInstance.assumptions, target: questionInstance.results[0] }; for (var i = 0; i < questionInstance.mistake_table.length; i++) { for (var j = 0; j < questionInstance.mistake_table[i].entries.length; j++) { var mistake = questionInstance.mistake_table[i].entries[j]; if (mistake.name === $scope.mistakeName) { $scope.localCheck = logicProofStudent.evaluate( mistake.occurs, { n: parseInt($scope.line) }, questionInstance.control_model, parameters, {}); } } } }; // QUESTION $scope.assumptionsString = 'P\u2227Q'; $scope.targetString = 'Q\u2227P'; $scope.submitQuestion = function() { $scope.checkError = ''; $scope.checkSuccess = false; $scope.buildError = ''; $scope.buildSuccess = false; $scope.questionError = ''; try { var attempt = logicProofTeacher.buildQuestion( $scope.assumptionsString, $scope.targetString, $scope.questionData.vocabulary); $scope.questionData.assumptions = attempt.assumptions; $scope.questionData.results = attempt.results; $scope.questionData.language.operators = attempt.operators; $scope.questionSuccess = true; $scope.assumptionsDisplay = logicProofShared.displayExpressionArray( $scope.questionData.assumptions, $scope.questionData.language.operators); $scope.targetDisplay = logicProofShared.displayExpression( $scope.questionData.results[0], $scope.questionData.language.operators); } catch (err) { $scope.questionError = err.message; $scope.questionSuccess = false; } }; $scope.submitQuestion(); // LINE TEMPLATES $scope.lineTemplateStrings = DEFAULT_LINE_TEMPLATE_STRINGS; $scope.lineTemplateIndexer = $scope.buildIndexer( $scope.lineTemplateStrings.length); $scope.submitLineTemplates = function() { $scope.checkError = ''; $scope.checkSuccess = false; $scope.buildError = ''; $scope.buildSuccess = false; try { $scope.questionData.line_templates = ( logicProofTeacher2.buildLineTemplateTable( $scope.lineTemplateStrings, $scope.questionData.vocabulary)); $scope.lineTemplateSuccess = true; $scope.LineTemplateErrors = $scope.buildErrors( $scope.lineTemplateStrings.length); } catch (err) { $scope.LineTemplateErrors = err; $scope.lineTemplateSuccess = false; } }; $scope.submitLineTemplates(); // MISTAKE TABLE $scope.mistakeStrings = [{ name: 'layout', entries: DEFAULT_LAYOUT_MISTAKE_STRINGS }, { name: 'variables', entries: DEFAULT_VARIABLE_MISTAKE_STRINGS }, { name: 'logic', entries: DEFAULT_LOGIC_MISTAKE_STRINGS }, { name: 'target', entries: DEFAULT_TARGET_MISTAKE_STRINGS }]; $scope.mistakeIndexer = $scope.buildIndexer($scope.mistakeStrings.length); $scope.mistakeSectionIndexer = []; $scope.mistakeSuccess = []; $scope.mistakeErrors = []; for (var i = 0; i < $scope.mistakeStrings.length; i++) { $scope.mistakeSectionIndexer.push( $scope.buildIndexer($scope.mistakeStrings[i].entries.length)); $scope.mistakeSuccess.push(true); $scope.mistakeErrors.push([]); } $scope.submitMistakes = function(sectionNumber) { $scope.checkError = ''; $scope.checkSuccess = false; $scope.buildError = ''; $scope.buildSuccess = false; try { $scope.questionData.mistake_table[sectionNumber] = ( logicProofTeacher2.buildMistakeSection( $scope.mistakeStrings[sectionNumber].name, $scope.mistakeStrings[sectionNumber].entries, $scope.questionData.control_functions)); $scope.mistakeSuccess[sectionNumber] = true; $scope.mistakeErrors[sectionNumber] = $scope.buildErrors( $scope.mistakeStrings[sectionNumber].entries.length); } catch (err) { $scope.mistakeSuccess[sectionNumber] = false; $scope.mistakeErrors[sectionNumber] = err; } }; // CONTROL FUNCTIONS $scope.controlFunctionStrings = DEFAULT_CONTROL_FUNCTION_STRINGS; $scope.controlFunctionIndexer = $scope.buildIndexer( $scope.controlFunctionStrings.length); $scope.submitControlFunctions = function() { $scope.checkError = ''; $scope.checkSuccess = false; $scope.buildError = ''; $scope.buildSuccess = false; $scope.controlFunctionErrors = $scope.buildErrors( $scope.controlFunctionStrings.length); try { $scope.questionData.control_functions = ( logicProofTeacher2.buildControlFunctionTable( $scope.controlFunctionStrings)); $scope.controlFunctionSuccess = true; } catch (err) { $scope.controlFunctionErrors[err.line] = err.message; $scope.controlFunctionSuccess = false; } }; $scope.submitControlFunctions(); // Mistake sections depend on control functions so we build them after. for (var i = 0; i < $scope.mistakeStrings.length; i++) { $scope.submitMistakes(i); } $scope.REPLACEMENT_PAIRS = [{ old: '\u2227', // eslint-disable quote-props 'new': '\\u2227' }, { old: '\u2228', 'new': '\\u2228' }, { old: '\u2200', 'new': '\\u2200' }, { old: '\u2203', 'new': '\\u2203' }, { old: '\u2208', 'new': '\\u2208' // eslint-enable quote-props }]; // JSON.stringify will display '\u2227' from strings.js as '∧'. We do not // want to write unicode in generatedDefaultData.js so we convert to '\\u2227' // which JSON.stringify will display as '\u2227'. $scope.replaceUnicode = function(input) { var output = input; for (var i = 0; i < $scope.REPLACEMENT_PAIRS.length; i++) { // We use this as .replace() only replaces one instance. output = output.split($scope.REPLACEMENT_PAIRS[i].old).join( $scope.REPLACEMENT_PAIRS[i]['new']); } return output; }; // JAVASCRIPT CONSTRUCTION $scope.requestJavascript = function() { if ($scope.questionSuccess && $scope.lineTemplateSuccess && $scope.mistakeSuccess[0] && $scope.mistakeSuccess[1] && $scope.mistakeSuccess[2] && $scope.mistakeSuccess[3] && $scope.controlFunctionSuccess) { var docStart = 'LOGIC_PROOF_DEFAULT_QUESTION_DATA = {' + 'assumptions: [],' + 'results: [],' + 'language: logicProofData.BASE_STUDENT_LANGUAGE,' + 'general_messages: logicProofData.BASE_GENERAL_MESSAGES,'; document.write(docStart + $scope.replaceUnicode( JSON.stringify({ line_templates: $scope.questionData.line_templates, vocabulary: $scope.questionData.vocabulary, mistake_table: $scope.questionData.mistake_table, control_functions: $scope.questionData.control_functions })).substring(1)); } }; });
{ "content_hash": "eea3fd814a381223eaae57497952d1d1", "timestamp": "", "source": "github", "line_count": 288, "max_line_length": 80, "avg_line_length": 32.486111111111114, "alnum_prop": 0.6383069687900812, "repo_name": "MAKOSCAFEE/oppia", "id": "5d958acffc2c951a388d361e63b1ae53663da437", "size": "9976", "binary": false, "copies": "4", "ref": "refs/heads/develop", "path": "extensions/interactions/LogicProof/static/js/tools/demonstration.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "101321" }, { "name": "HTML", "bytes": "900382" }, { "name": "JavaScript", "bytes": "2922781" }, { "name": "Python", "bytes": "3701239" }, { "name": "Shell", "bytes": "47818" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_21) on Sat Dec 06 16:46:46 GMT 2014 --> <title>Uses of Class eu.virtuenergy.users.UserDAO</title> <meta name="date" content="2014-12-06"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class eu.virtuenergy.users.UserDAO"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../eu/virtuenergy/users/UserDAO.html" title="class in eu.virtuenergy.users">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../index.html?eu/virtuenergy/users/class-use/UserDAO.html" target="_top">Frames</a></li> <li><a href="UserDAO.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class eu.virtuenergy.users.UserDAO" class="title">Uses of Class<br>eu.virtuenergy.users.UserDAO</h2> </div> <div class="classUseContainer">No usage of eu.virtuenergy.users.UserDAO</div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../eu/virtuenergy/users/UserDAO.html" title="class in eu.virtuenergy.users">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../index.html?eu/virtuenergy/users/class-use/UserDAO.html" target="_top">Frames</a></li> <li><a href="UserDAO.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
{ "content_hash": "f230c420cd98fff5dbff7e630c72ef68", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 119, "avg_line_length": 35.02608695652174, "alnum_prop": 0.6102284011916584, "repo_name": "nishinokai/cloud6", "id": "1a6b8ba09f719edbace49d81ab36b9c8e3fd259c", "size": "4028", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "VirtualCloud/doc/eu/virtuenergy/users/class-use/UserDAO.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "135702" }, { "name": "Java", "bytes": "111710" }, { "name": "JavaScript", "bytes": "682860" } ], "symlink_target": "" }
import {Options} from './options'; import {Svg} from './svg'; export class Illusion extends Svg { options:any; draw():void { throw new Error('Not implemented'); } constructor(options:Options, svg?:any) { this.options = options; super(svg, options.size, options.size, options.margin, options.background, options.clip); this.id = options['id']; } }
{ "content_hash": "2450364cfde791699682416e607cd39b", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 97, "avg_line_length": 25.125, "alnum_prop": 0.6194029850746269, "repo_name": "darosh/oil", "id": "da72fea96c4e863f10d8f4801c899479aeea5e72", "size": "402", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/illusion.ts", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1749" }, { "name": "HTML", "bytes": "5774" }, { "name": "JavaScript", "bytes": "6011" }, { "name": "TypeScript", "bytes": "32497" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Windows.UI.Xaml; namespace Windows.UI.Interactivity { /// <summary> /// Represents a collection of actions with a shared AssociatedObject and provides change notifications to its contents when that AssociatedObject changes. /// /// </summary> public class TriggerActionCollection : AttachableCollection<TriggerAction> { /// <summary> /// Initializes a new instance of the <see cref="T:System.Windows.Interactivity.TriggerActionCollection"/> class. /// /// </summary> /// /// <remarks> /// Internal, because this should not be inherited outside this assembly. /// </remarks> internal TriggerActionCollection() { } protected override void AttachInternal(FrameworkElement frameworkElement) { base.AttachInternal(frameworkElement); if (this.AssociatedObject == null) { if (!Windows.ApplicationModel.DesignMode.DesignModeEnabled) { this.AssociatedObject = frameworkElement; } this.OnAttached(); } } /// <summary> /// Called immediately after the collection is attached to an AssociatedObject. /// /// </summary> protected override void OnAttached() { foreach (TriggerAction triggerAction in this) { triggerAction.Attach(this.AssociatedObject); } } /// <summary> /// Called when the collection is being detached from its AssociatedObject, but before it has actually occurred. /// /// </summary> protected override void OnDetaching() { foreach (TriggerAction triggerAction in this) { triggerAction.Detach(); } } /// <summary> /// Called when a new item is added to the collection. /// /// </summary> /// <param name="item">The new item.</param> internal override void ItemAdded(TriggerAction item) { if (item.IsHosted) { throw new InvalidOperationException("Cannot Host TriggerAction Multiple Times"); } if (this.AssociatedObject != null) { item.Attach(this.AssociatedObject); } item.IsHosted = true; } /// <summary> /// Called when an item is removed from the collection. /// /// </summary> /// <param name="item">The removed item.</param> internal override void ItemRemoved(TriggerAction item) { if (((IAttachedObject)item).AssociatedObject != null) { item.Detach(); } item.IsHosted = false; } } }
{ "content_hash": "12ba699842049150e9868d780d182f90", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 159, "avg_line_length": 31.185567010309278, "alnum_prop": 0.5494214876033058, "repo_name": "jlaanstra/Windows.UI.Interactivity", "id": "099e2eb6bb9afb32e41c89cf575cb9ded21aa28d", "size": "3027", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Windows.UI.Interactivity/TriggerActionCollection.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "197283" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.example.administrator.part1.activity.LearnTransitionActivity"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <android.support.v7.widget.CardView android:id="@+id/cv_1" xmlns:card_view="http://schemas.android.com/apk/res-auto" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:elevation="10dp" android:layout_margin="5dp" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_margin="10dp" android:gravity="center" android:text="分 解 动 画" android:textSize="30sp"/> </android.support.v7.widget.CardView> <android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:elevation="10dp" android:layout_margin="5dp" android:id="@+id/cv_2" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_margin="10dp" android:gravity="center" android:text="滑 动 动 画" android:textSize="30sp"/> </android.support.v7.widget.CardView> <android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:elevation="10dp" android:layout_margin="5dp" android:id="@+id/cv_3" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_margin="10dp" android:gravity="center" android:text="淡 出 动 画" android:textSize="30sp"/> </android.support.v7.widget.CardView> </LinearLayout> </RelativeLayout>
{ "content_hash": "e448eafad74425761e15904c47686db3", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 85, "avg_line_length": 37.64, "alnum_prop": 0.5674814027630181, "repo_name": "Jenior/-Material-Design", "id": "dd0ad0aaf9113d8673ff0f245289174a062bbb90", "size": "2847", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Part1/app/src/main/res/layout/activity_learn_transition.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "35511" } ], "symlink_target": "" }
package com.bvmiste.vision16.Eventactivity; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import com.bvmiste.vision16.R; public class mech3 extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_mech3); } }
{ "content_hash": "a200e7e76333b7501ef1aefafaa5d98c", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 56, "avg_line_length": 24.866666666666667, "alnum_prop": 0.7613941018766756, "repo_name": "Team-ISTE/Fusion-Android-App", "id": "ce2fcddcac1e11f02e3a0c3896c389e2779d6457", "size": "373", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/java/com/bvmiste/vision16/Eventactivity/mech3.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "81854" } ], "symlink_target": "" }
layout: model title: English BertForTokenClassification Cased model (from camilag) author: John Snow Labs name: bert_pos_bertimbau_finetuned_pos_accelerate_7 date: 2022-08-02 tags: [bert, pos, part_of_speech, open_source, en] task: Part of Speech Tagging language: en edition: Spark NLP 4.1.0 spark_version: 3.0 supported: true annotator: BertForTokenClassification article_header: type: cover use_language_switcher: "Python-Scala-Java" --- ## Description Pretrained BertForTokenClassification model, adapted from Hugging Face and curated to provide scalability and production-readiness using Spark NLP. `bertimbau-finetuned-pos-accelerate-7` is a English model originally trained by `camilag`. {:.btn-box} <button class="button button-orange" disabled>Live Demo</button> <button class="button button-orange" disabled>Open in Colab</button> [Download](https://s3.amazonaws.com/auxdata.johnsnowlabs.com/public/models/bert_pos_bertimbau_finetuned_pos_accelerate_7_en_4.1.0_3.0_1659460058564.zip){:.button.button-orange.button-orange-trans.arr.button-icon} ## How to use <div class="tabs-box" markdown="1"> {% include programmingLanguageSelectScalaPythonNLU.html %} ```python documentAssembler = DocumentAssembler() \ .setInputCol("text") \ .setOutputCol("document") sentenceDetector = SentenceDetectorDLModel.pretrained("sentence_detector_dl", "xx")\ .setInputCols(["document"])\ .setOutputCol("sentence") tokenizer = Tokenizer() \ .setInputCols("sentence") \ .setOutputCol("token") tokenClassifier = BertForTokenClassification.pretrained("bert_pos_bertimbau_finetuned_pos_accelerate_7","en") \ .setInputCols(["sentence", "token"]) \ .setOutputCol("pos") pipeline = Pipeline(stages=[documentAssembler, sentenceDetector, tokenizer, tokenClassifier]) data = spark.createDataFrame([["PUT YOUR STRING HERE"]]).toDF("text") result = pipeline.fit(data).transform(data) ``` ```scala val documentAssembler = new DocumentAssembler() .setInputCol("text") .setOutputCol("document") val sentenceDetector = SentenceDetectorDLModel.pretrained("sentence_detector_dl", "xx") .setInputCols(Array("document")) .setOutputCol("sentence") val tokenizer = new Tokenizer() .setInputCols(Array("sentence")) .setOutputCol("token") val tokenClassifier = BertForTokenClassification.pretrained("bert_pos_bertimbau_finetuned_pos_accelerate_7","en") .setInputCols(Array("sentence", "token")) .setOutputCol("pos") val pipeline = new Pipeline().setStages(Array(documentAssembler,sentenceDetector, tokenizer, tokenClassifier)) val data = Seq("PUT YOUR STRING HERE").toDF("text") val result = pipeline.fit(data).transform(data) ``` </div> {:.model-param} ## Model Information {:.table-model} |---|---| |Model Name:|bert_pos_bertimbau_finetuned_pos_accelerate_7| |Compatibility:|Spark NLP 4.1.0+| |License:|Open Source| |Edition:|Official| |Input Labels:|[document, token]| |Output Labels:|[ner]| |Language:|en| |Size:|406.5 MB| |Case sensitive:|true| |Max sentence length:|128| ## References - https://huggingface.co/camilag/bertimbau-finetuned-pos-accelerate-7
{ "content_hash": "8ce13ea1d31c8b4be99f32442a91dfc4", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 238, "avg_line_length": 31.828282828282827, "alnum_prop": 0.7394477943509997, "repo_name": "JohnSnowLabs/spark-nlp", "id": "e80134d6b3183c39d9d07e9f39dcad37b2c25d9b", "size": "3155", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/_posts/gadde5300/2022-08-02-bert_pos_bertimbau_finetuned_pos_accelerate_7_en_3_0.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "14452" }, { "name": "Java", "bytes": "223289" }, { "name": "Makefile", "bytes": "819" }, { "name": "Python", "bytes": "1694517" }, { "name": "Scala", "bytes": "4116435" }, { "name": "Shell", "bytes": "5286" } ], "symlink_target": "" }
FROM balenalib/asus-tinker-board-alpine:3.15-build ENV NODE_VERSION 17.6.0 ENV YARN_VERSION 1.22.4 # Install dependencies RUN apk add --no-cache libgcc libstdc++ libuv \ && apk add --no-cache libssl1.0 || apk add --no-cache libssl1.1 RUN for key in \ 6A010C5166006599AA17F08146C2130DFD2497F5 \ ; do \ gpg --keyserver pgp.mit.edu --recv-keys "$key" || \ gpg --keyserver keyserver.pgp.com --recv-keys "$key" || \ gpg --keyserver keyserver.ubuntu.com --recv-keys "$key" ; \ done \ && curl -SLO "http://resin-packages.s3.amazonaws.com/node/v$NODE_VERSION/node-v$NODE_VERSION-linux-alpine-armv7hf.tar.gz" \ && echo "2af933c590e00bedee53c57e3956c273cfdcbb233dcdb3ec355f9e3a1f2e65c6 node-v$NODE_VERSION-linux-alpine-armv7hf.tar.gz" | sha256sum -c - \ && tar -xzf "node-v$NODE_VERSION-linux-alpine-armv7hf.tar.gz" -C /usr/local --strip-components=1 \ && rm "node-v$NODE_VERSION-linux-alpine-armv7hf.tar.gz" \ && curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \ && curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \ && gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \ && mkdir -p /opt/yarn \ && tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/yarn --strip-components=1 \ && ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn \ && ln -s /opt/yarn/bin/yarn /usr/local/bin/yarnpkg \ && rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \ && npm config set unsafe-perm true -g --unsafe-perm \ && rm -rf /tmp/* CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"] RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/test-stack@node.sh" \ && echo "Running test-stack@node" \ && chmod +x test-stack@node.sh \ && bash test-stack@node.sh \ && rm -rf test-stack@node.sh RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo $'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v7 \nOS: Alpine Linux 3.15 \nVariant: build variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nNode.js v17.6.0, Yarn v1.22.4 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info RUN echo $'#!/bin/bash\nbalena-info\nbusybox ln -sf /bin/busybox /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \ && chmod +x /bin/sh-shim \ && ln -f /bin/sh /bin/sh.real \ && ln -f /bin/sh-shim /bin/sh
{ "content_hash": "da6d6b864fb8208458bf015dbc160838", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 698, "avg_line_length": 65.22222222222223, "alnum_prop": 0.7114139693356047, "repo_name": "resin-io-library/base-images", "id": "15040eddce9125503770db7fbd7643d3a8ea7fae", "size": "2956", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "balena-base-images/node/asus-tinker-board/alpine/3.15/17.6.0/build/Dockerfile", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "71234697" }, { "name": "JavaScript", "bytes": "13096" }, { "name": "Shell", "bytes": "12051936" }, { "name": "Smarty", "bytes": "59789" } ], "symlink_target": "" }
'use strict'; var argv = require('yargs').argv; var os = require('os'); var jetpack = require('fs-jetpack'); module.exports.os = function () { switch (os.platform()) { case 'darwin': return 'osx'; case 'linux': return 'linux'; case 'win32': return 'windows'; default: return 'unsupported'; } }; module.exports.replace = function (str, patterns) { Object.keys(patterns).forEach(function (pattern) { var matcher = new RegExp('{{' + pattern + '}}', 'g'); str = str.replace(matcher, patterns[pattern]); }); return str; }; module.exports.getElectronVersion = function () { var manifest = jetpack.read(__dirname + '/../package.json', 'json'); return manifest.devDependencies['electron'].substring(1); };
{ "content_hash": "368c15357bd5c8cb8904df2f20c381e4", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 70, "avg_line_length": 24.64516129032258, "alnum_prop": 0.6230366492146597, "repo_name": "Storj/driveshare-gui", "id": "7100f517c90bf63cfdbc9e0318f53714b87d1294", "size": "764", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "tasks/utils.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "5362" }, { "name": "HTML", "bytes": "11766" }, { "name": "JavaScript", "bytes": "123664" }, { "name": "NSIS", "bytes": "3832" }, { "name": "Shell", "bytes": "98" } ], "symlink_target": "" }
namespace Honeycomb { namespace Object { class GameObjectFactory { public: /// <summary> /// Gets the singleton instance of the Game Object Factory. /// </summary> /// <returns> /// The reference to the instance of the Game Object Factory. /// </returns> static GameObjectFactory& getFactory(); /// <summary> /// Builds a new Ambient Light Game Object. The Game Object will have /// the name "Ambient Light" and will have Transform and Ambient Light /// components attached to it. /// </summary> /// <returns> /// The pointer to the new Ambient Light Object. /// </returns> std::unique_ptr<Honeycomb::Object::GameObject> newAmbientLight(); /// <summary> /// Builds a new Camera Game Object. The Game Object will have the name /// "Camera" and will have Transform and Camera Controller components /// attached to it. /// </summary> /// <returns> /// The pointer to the new Camera Object. /// </returns> std::unique_ptr<Honeycomb::Object::GameObject> newCamera(); /// <summary> /// Builds a new Cone Game Object. The Game Object will have the name /// "Cone" and will have the Transform and Mesh Renderer components /// attached to it. The mesh and material data for the Cone will come /// from the cone model file. /// </summary> /// <returns> /// The pointer to the Cone Object. /// </returns> std::unique_ptr<Honeycomb::Object::GameObject> newCone(); /// <summary> /// Builds a new Directional Light Game Object. The Game Object will /// have the name "Directional Light" and will have the Transform and /// Directional Light components attached to it. /// </summary> /// <returns> /// The pointer to the Directional Light Object. /// </returns> std::unique_ptr<Honeycomb::Object::GameObject> newDirectionalLight(); /// <summary> /// Builds a new Cube Game Object. The Game Object will have the name /// "Cube" and will have the Transform and Mesh Renderer components /// attached to it. The mesh and material data for the Cube will come /// from the cube model file. /// </summary> /// <returns> /// The pointer to the Cube Object. /// </returns> std::unique_ptr<Honeycomb::Object::GameObject> newCube(); /// <summary> /// Creates a new Game Object from the specified Model. /// </summary> /// <param name="model"> /// The model, from which the Game Object should be made. /// </param> /// <returns> /// The unique pointer to the cloned Game Object of the model. /// </returns> std::unique_ptr<Honeycomb::Object::GameObject> newGameObject(const Honeycomb::Geometry::Model &model); /// <summary> /// Builds a new Icosphere Game Object. The Game Object will have the /// name "Icosphere" and will have the Transform and Mesh Renderer /// components attached to it. The mesh and material data for the /// Icosphere will come from the icosphere model file. /// </summary> /// <returns> /// The pointer to the Icosphere Object. /// </returns> std::unique_ptr<Honeycomb::Object::GameObject> newIcosphere(); /// <summary> /// Builds a new Plane Game Object. The Game Object will have the /// name "Plane" and will have the Transform and Mesh Renderer /// components attached to it. The mesh and material data for the /// Plane will come from the plane model file. /// </summary> /// <returns> /// The pointer to the Plane Object. /// </returns> std::unique_ptr<Honeycomb::Object::GameObject> newPlane(); /// <summary> /// Builds a new Point Light Game Object. The Game Object will have the /// name "Point Light" and will have the Transform and Point Light /// components attached to it. /// </summary> /// <returns> /// The pointer to the Point Light Object. /// </returns> std::unique_ptr<Honeycomb::Object::GameObject> newPointLight(); /// <summary> /// Builds a new Sphere Game Object. The Game Object will have the /// name "Sphere" and will have the Transform and Mesh Renderer /// components attached to it. The mesh and material data for the /// Sphere will come from the sphere model file. /// </summary> /// <returns> /// The pointer to the Sphere Object. /// </returns> std::unique_ptr<Honeycomb::Object::GameObject> newSphere(); /// <summary> /// Builds a new Spot Light Game Object. The Game Object will have the /// name "Spot Light" and will have the Transform and Spot Light /// components attached to it. /// </summary> /// <returns> /// The pointer to the Spot Light Object. /// </returns> std::unique_ptr<Honeycomb::Object::GameObject> newSpotLight(); /// <summary> /// Builds a new Suzanne Game Object. The Game Object will have the /// name "Suzanne" and will have the Transform and Mesh Renderer /// components attached to it. The mesh and material data for the /// Suzanne will come from the suzanne model file. /// </summary> /// <returns> /// The pointer to the Sphere Object. /// </returns> std::unique_ptr<Honeycomb::Object::GameObject> newSuzanne(); private: /// <summary> /// Helper method for loading in default models. This creates an object /// clone from the specified model and then fetches the child of the /// specified name and deparents it from the RootNode. The independent /// child is then returned. /// </summary> /// <param name="model"> /// The model from which the Game Object is to be cloned. /// </param> /// <param name="name"> /// The name of the child of the RootNode. /// </param> /// <returns> /// The unique pointer to the imported Game Object clone. /// </returns> std::unique_ptr<GameObject> newDefaultImport( const Honeycomb::Geometry::Model &model, const std::string &name); }; } } #endif
{ "content_hash": "2577affd46391f7dce95eaf675a565c6", "timestamp": "", "source": "github", "line_count": 161, "max_line_length": 73, "avg_line_length": 35.78260869565217, "alnum_prop": 0.6670716889428918, "repo_name": "antverdovsky/Honeycomb-Game-Engine", "id": "99b4b9f569149921b9c43205ad28a488d407278f", "size": "5891", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Honeycomb GE/include/object/GameObjectFactory.h", "mode": "33188", "license": "mit", "language": [ { "name": "C++", "bytes": "623731" }, { "name": "CMake", "bytes": "8678" }, { "name": "GLSL", "bytes": "74314" }, { "name": "Shell", "bytes": "314" } ], "symlink_target": "" }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="X-UA-Compatible" content="IE=Edge" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>pymatgen.entries.exp_entries &#8212; pymatgen 2018.3.14 documentation</title> <link rel="stylesheet" href="../../../_static/proBlue.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> <script type="text/javascript" src="../../../_static/documentation_options.js"></script> <script type="text/javascript" src="../../../_static/jquery.js"></script> <script type="text/javascript" src="../../../_static/underscore.js"></script> <script type="text/javascript" src="../../../_static/doctools.js"></script> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> <link rel="shortcut icon" href="../../../_static/favicon.ico"/> <link rel="index" title="Index" href="../../../genindex.html" /> <link rel="search" title="Search" href="../../../search.html" /> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-33990148-1']); _gaq.push(['_trackPageview']); </script> </head><body> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../../../genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="../../../py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="nav-item nav-item-0"><a href="../../../index.html">pymatgen 2018.3.14 documentation</a> &#187;</li> <li class="nav-item nav-item-1"><a href="../../index.html" >Module code</a> &#187;</li> <li class="nav-item nav-item-2"><a href="../../pymatgen.html" accesskey="U">pymatgen</a> &#187;</li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body" role="main"> <h1>Source code for pymatgen.entries.exp_entries</h1><div class="highlight"><pre> <span></span><span class="c1"># coding: utf-8</span> <span class="c1"># Copyright (c) Pymatgen Development Team.</span> <span class="c1"># Distributed under the terms of the MIT License.</span> <span class="kn">from</span> <span class="nn">__future__</span> <span class="k">import</span> <span class="n">division</span><span class="p">,</span> <span class="n">unicode_literals</span> <span class="sd">&quot;&quot;&quot;</span> <span class="sd">This module defines Entry classes for containing experimental data.</span> <span class="sd">&quot;&quot;&quot;</span> <span class="n">__author__</span> <span class="o">=</span> <span class="s2">&quot;Shyue Ping Ong&quot;</span> <span class="n">__copyright__</span> <span class="o">=</span> <span class="s2">&quot;Copyright 2012, The Materials Project&quot;</span> <span class="n">__version__</span> <span class="o">=</span> <span class="s2">&quot;0.1&quot;</span> <span class="n">__maintainer__</span> <span class="o">=</span> <span class="s2">&quot;Shyue Ping Ong&quot;</span> <span class="n">__email__</span> <span class="o">=</span> <span class="s2">&quot;shyuep@gmail.com&quot;</span> <span class="n">__date__</span> <span class="o">=</span> <span class="s2">&quot;Jun 27, 2012&quot;</span> <span class="kn">from</span> <span class="nn">pymatgen.analysis.phase_diagram</span> <span class="k">import</span> <span class="n">PDEntry</span> <span class="kn">from</span> <span class="nn">pymatgen.core.composition</span> <span class="k">import</span> <span class="n">Composition</span> <span class="kn">from</span> <span class="nn">monty.json</span> <span class="k">import</span> <span class="n">MSONable</span> <span class="kn">from</span> <span class="nn">pymatgen.analysis.thermochemistry</span> <span class="k">import</span> <span class="n">ThermoData</span> <div class="viewcode-block" id="ExpEntry"><a class="viewcode-back" href="../../../pymatgen.entries.exp_entries.html#pymatgen.entries.exp_entries.ExpEntry">[docs]</a><span class="k">class</span> <span class="nc">ExpEntry</span><span class="p">(</span><span class="n">PDEntry</span><span class="p">,</span> <span class="n">MSONable</span><span class="p">):</span> <span class="sd">&quot;&quot;&quot;</span> <span class="sd"> An lightweight ExpEntry object containing experimental data for a</span> <span class="sd"> composition for many purposes. Extends a PDEntry so that it can be used for</span> <span class="sd"> phase diagram generation and reaction calculation.</span> <span class="sd"> Current version works only with solid phases and at 298K. Further</span> <span class="sd"> extensions for temperature dependence are planned.</span> <span class="sd"> Args:</span> <span class="sd"> composition: Composition of the entry. For flexibility, this can take</span> <span class="sd"> the form of all the typical input taken by a Composition, including</span> <span class="sd"> a {symbol: amt} dict, a string formula, and others.</span> <span class="sd"> thermodata: A sequence of ThermoData associated with the entry.</span> <span class="sd"> temperature: A temperature for the entry in Kelvin. Defaults to 298K.</span> <span class="sd"> &quot;&quot;&quot;</span> <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">composition</span><span class="p">,</span> <span class="n">thermodata</span><span class="p">,</span> <span class="n">temperature</span><span class="o">=</span><span class="mi">298</span><span class="p">):</span> <span class="n">comp</span> <span class="o">=</span> <span class="n">Composition</span><span class="p">(</span><span class="n">composition</span><span class="p">)</span> <span class="bp">self</span><span class="o">.</span><span class="n">_thermodata</span> <span class="o">=</span> <span class="n">thermodata</span> <span class="n">found</span> <span class="o">=</span> <span class="kc">False</span> <span class="n">enthalpy</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="s2">&quot;inf&quot;</span><span class="p">)</span> <span class="k">for</span> <span class="n">data</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_thermodata</span><span class="p">:</span> <span class="k">if</span> <span class="n">data</span><span class="o">.</span><span class="n">type</span> <span class="o">==</span> <span class="s2">&quot;fH&quot;</span> <span class="ow">and</span> <span class="n">data</span><span class="o">.</span><span class="n">value</span> <span class="o">&lt;</span> <span class="n">enthalpy</span> <span class="ow">and</span> \ <span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">phaseinfo</span> <span class="o">!=</span> <span class="s2">&quot;gas&quot;</span> <span class="ow">and</span> <span class="n">data</span><span class="o">.</span><span class="n">phaseinfo</span> <span class="o">!=</span> <span class="s2">&quot;liquid&quot;</span><span class="p">):</span> <span class="n">enthalpy</span> <span class="o">=</span> <span class="n">data</span><span class="o">.</span><span class="n">value</span> <span class="n">found</span> <span class="o">=</span> <span class="kc">True</span> <span class="k">if</span> <span class="ow">not</span> <span class="n">found</span><span class="p">:</span> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">&quot;List of Thermodata does not contain enthalpy &quot;</span> <span class="s2">&quot;values.&quot;</span><span class="p">)</span> <span class="bp">self</span><span class="o">.</span><span class="n">temperature</span> <span class="o">=</span> <span class="n">temperature</span> <span class="nb">super</span><span class="p">(</span><span class="n">ExpEntry</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">comp</span><span class="p">,</span> <span class="n">enthalpy</span><span class="p">)</span> <span class="k">def</span> <span class="nf">__repr__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> <span class="k">return</span> <span class="s2">&quot;ExpEntry </span><span class="si">{}</span><span class="s2">, Energy = </span><span class="si">{:.4f}</span><span class="s2">&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">composition</span><span class="o">.</span><span class="n">formula</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">energy</span><span class="p">)</span> <span class="k">def</span> <span class="nf">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="fm">__repr__</span><span class="p">()</span> <div class="viewcode-block" id="ExpEntry.from_dict"><a class="viewcode-back" href="../../../pymatgen.entries.exp_entries.html#pymatgen.entries.exp_entries.ExpEntry.from_dict">[docs]</a> <span class="nd">@classmethod</span> <span class="k">def</span> <span class="nf">from_dict</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">d</span><span class="p">):</span> <span class="n">thermodata</span> <span class="o">=</span> <span class="p">[</span><span class="n">ThermoData</span><span class="o">.</span><span class="n">from_dict</span><span class="p">(</span><span class="n">td</span><span class="p">)</span> <span class="k">for</span> <span class="n">td</span> <span class="ow">in</span> <span class="n">d</span><span class="p">[</span><span class="s2">&quot;thermodata&quot;</span><span class="p">]]</span></div> <span class="k">return</span> <span class="bp">cls</span><span class="p">(</span><span class="n">d</span><span class="p">[</span><span class="s2">&quot;composition&quot;</span><span class="p">],</span> <span class="n">thermodata</span><span class="p">,</span> <span class="n">d</span><span class="p">[</span><span class="s2">&quot;temperature&quot;</span><span class="p">])</span> <div class="viewcode-block" id="ExpEntry.as_dict"><a class="viewcode-back" href="../../../pymatgen.entries.exp_entries.html#pymatgen.entries.exp_entries.ExpEntry.as_dict">[docs]</a> <span class="k">def</span> <span class="nf">as_dict</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> <span class="k">return</span> <span class="p">{</span><span class="s2">&quot;@module&quot;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="o">.</span><span class="vm">__module__</span><span class="p">,</span> <span class="s2">&quot;@class&quot;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="o">.</span><span class="vm">__name__</span><span class="p">,</span> <span class="s2">&quot;thermodata&quot;</span><span class="p">:</span> <span class="p">[</span><span class="n">td</span><span class="o">.</span><span class="n">as_dict</span><span class="p">()</span> <span class="k">for</span> <span class="n">td</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_thermodata</span><span class="p">],</span> <span class="s2">&quot;composition&quot;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">composition</span><span class="o">.</span><span class="n">as_dict</span><span class="p">(),</span></div></div> <span class="s2">&quot;temperature&quot;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">temperature</span><span class="p">}</span> </pre></div> </div> </div> </div> <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> <div class="sphinxsidebarwrapper"> <div id="searchbox" style="display: none" role="search"> <h3>Quick search</h3> <div class="searchformwrapper"> <form class="search" action="../../../search.html" method="get"> <input type="text" name="q" /> <input type="submit" value="Go" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> </div> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../../../genindex.html" title="General Index" >index</a></li> <li class="right" > <a href="../../../py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="nav-item nav-item-0"><a href="../../../index.html">pymatgen 2018.3.14 documentation</a> &#187;</li> <li class="nav-item nav-item-1"><a href="../../index.html" >Module code</a> &#187;</li> <li class="nav-item nav-item-2"><a href="../../pymatgen.html" >pymatgen</a> &#187;</li> </ul> </div> <div class="footer" role="contentinfo"> &#169; Copyright 2011, Pymatgen Development Team. Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.1. </div> <div class="footer">This page uses <a href="http://analytics.google.com/"> Google Analytics</a> to collect statistics. You can disable it by blocking the JavaScript coming from www.google-analytics.com. <script type="text/javascript"> (function() { var ga = document.createElement('script'); ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; ga.setAttribute('async', 'true'); document.documentElement.firstChild.appendChild(ga); })(); </script> </div> </body> </html>
{ "content_hash": "57f28355d79bcfa742e70020187fe064", "timestamp": "", "source": "github", "line_count": 181, "max_line_length": 459, "avg_line_length": 83.08839779005525, "alnum_prop": 0.6172617860230069, "repo_name": "czhengsci/pymatgen", "id": "51111da7076a21987b6aa456de0713a52d10c228", "size": "15040", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/_modules/pymatgen/entries/exp_entries.html", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "5938" }, { "name": "CSS", "bytes": "7550" }, { "name": "Common Lisp", "bytes": "3029065" }, { "name": "HTML", "bytes": "827" }, { "name": "Makefile", "bytes": "5573" }, { "name": "Perl", "bytes": "229104" }, { "name": "Propeller Spin", "bytes": "4026362" }, { "name": "Python", "bytes": "6706935" }, { "name": "Roff", "bytes": "1135003" } ], "symlink_target": "" }
#!/bin/sh -e # Copyright (c) 2015 The crouton Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # Monitors a web-based CSV queue for autotest requests, runs the test, and # uploads the status and results. # Example CSV contents (must be fully quoted, no double-quotes in content): # "Timestamp","Repository","Branch","Additional parameters","Run type" # "2013/10/16 8:24:52 PM GMT","dnschneid/crouton","master","","FULL" set -e APPLICATION="${0##*/}" SCRIPTDIR="`readlink -f "\`dirname "$0"\`/.."`" # Poll queue file every x seconds POLLINTERVAL=10 # Full sync status at least every x seconds LOGUPLOADINTERVAL=60 # After the end of a test, try to fetch results for x seconds FETCHTIMEOUT=300 # Archive every hour, files older than 7 days ARCHIVEINTERVAL=3600 ARCHIVEMAXAGE=7 # Archive status file when it gets too long ARCHIVEMAXLINES=1000 QUEUEURL='' RSYNCBASEOPTIONS='-aP' RSYNCRSH='ssh' RSYNCOPTIONS='' # Persistent storage directory LOCALROOT="$SCRIPTDIR/test/daemon" UPLOADROOT="$HOME" AUTOTESTGIT="https://chromium.googlesource.com/chromiumos/third_party/autotest" TESTINGSSHKEYURL="https://chromium.googlesource.com/chromiumos/chromite/+/master/ssh_keys/testing_rsa" MIRRORENV="" # Maximum test run time (minutes): 24 hours MAXTESTRUNTIME="$((24*60))" GSAUTOTEST="gs://chromeos-autotest-results" USAGE="$APPLICATION [options] -q QUEUEURL Runs a daemon that polls a CSV on the internet for tests to run, and uploads status and results to some destination via scp. Options: -e MIRRORENV key=value pair to pass to tests to setup default mirrors. Can be specified multiple times. -l LOCALROOT Local persistent log directory -q QUEUEURL Queue URL to poll for new test requests. Must be specified. -r RSYNCOPT Special options to pass to rsync in addition to $RSYNCBASEOPTIONS Default: ${RSYNCOPTIONS:-"(nothing)"} -s RSYNCRSH rsh command to use for rsync. Default: $RSYNCRSH -u UPLOADROOT Base rsync-compatible URL directory to upload to. Must exist. Default: $UPLOADROOT" # Common functions . "$SCRIPTDIR/installer/functions" # Process arguments while getopts 'e:l:q:r:s:u:' f; do case "$f" in e) MIRRORENV="$OPTARG;$MIRRORENV";; l) LOCALROOT="$OPTARG";; q) QUEUEURL="$OPTARG";; r) RSYNCOPTIONS="$OPTARG";; s) RSYNCRSH="$OPTARG";; u) UPLOADROOT="$OPTARG";; \?) error 2 "$USAGE";; esac done shift "$((OPTIND-1))" if [ -z "$QUEUEURL" -o "$#" != 0 ]; then error 2 "$USAGE" fi # No double-quotes in MIRRORENV if [ "${MIRRORENV#*\"}" != "$MIRRORENV" ]; then error 2 "$USAGE" fi # Find a board name from a given host name # Also creates a host info file, that is used by findrelease findboard() { local host="$1" local hostinfo="$HOSTINFO/$host" local hostinfonew="$HOSTINFO/$host.new" if echo ' echo echo "HWID=`crossystem hwid`" cat /etc/lsb-release ' | ssh "root@${host}.cros" $DUTSSHOPTIONS > "$hostinfonew"; then mv "$hostinfonew" "$hostinfo" fi if [ ! -s "$hostinfo" ]; then echo "Cannot fetch host info, and no cache" 1>&2 return 1 fi sed -n 's/^CHROMEOS_RELEASE_BOARD=//p' "$hostinfo" } # Find a release/build name from host, board and channel findrelease() { local host="$1" local channel="$2" local board="`findboard "$host"`" local hostinfo="$HOSTINFO/$host" local appidtype="RELEASE" if [ "$channel" = "canary" ]; then appidtype="CANARY" fi local appid="`sed -n "s/^CHROMEOS_${appidtype}_APPID=//p" "$hostinfo"`" local hwid="`sed -n 's/^HWID=//p' "$hostinfo"`" tee /dev/stderr<<EOF | curl -d @- https://tools.google.com/service/update2 \ | sed -n 's/.*<action[^>]*ChromeOSVersion="\([^"]*\)"[^>]*ChromeVersion="\([0-9]*\)\..*/R\2-\1/p' <?xml version="1.0" encoding="UTF-8"?> <request protocol="3.0" version="ChromeOSUpdateEngine-0.1.0.0" updaterversion="ChromeOSUpdateEngine-0.1.0.0"> <os version="Indy" platform="Chrome OS"></os> <app appid="${appid}" version="0.0.0" track="${channel}-channel" lang="en-US" board="${board}" hardware_class="${hwid}" delta_okay="false" fw_version="" ec_version="" installdate="2800" > <updatecheck targetversionprefix=""></updatecheck> <event eventtype="3" eventresult="2" previousversion=""></event> </app> </request> EOF } lastfullsync=0 lastarchivesync=0 forceupdate= # Sync status directory # Passing a parameter will sync that specific file only syncstatus() { local file="$1" local extraoptions="" if [ -z "$file" ]; then extraoptions="--exclude archive --delete" local time="`date '+%s'`" # Auto-archive if [ "$((lastarchivesync+ARCHIVEINTERVAL))" -lt "$time" ]; then ( cd $STATUSROOT mkdir -p "archive" find -maxdepth 1 -type d -mtime +"$ARCHIVEMAXAGE" \ -regex '\./[-0-9]*_[-0-9]*_.*' | while read -r dir; do dest="archive/${dir##*/}.tar.bz2" rm -f "$dest" tar -caf "$dest" "${dir#./}" rm -rf "$dir" done # Only keep ARCHIVEMAXLINES lines of status count="`cat status | wc -l`" if [ "$count" -gt "$ARCHIVEMAXLINES" ]; then cut="$((count-ARCHIVEMAXLINES/2))" cut1="$((cut+1))" head -n "$cut" status >> archive/status tail -n +"$cut1" status > status.tmp mv status.tmp status # TODO: We probably want to compress archive/status fi ) syncstatus "archive/" forceupdate=y lastarchivesync="$time" fi if [ -z "$forceupdate" ]; then if [ "$((lastfullsync+LOGUPLOADINTERVAL))" -gt "$time" ]; then echo "Skipping sync (throttling)..." 1>&2 return fi else forceupdate= fi lastfullsync="$time" fi echo "Syncing $file" 1>&2 rsync $RSYNCBASEOPTIONS $RSYNCOPTIONS $extraoptions -e "$RSYNCRSH" \ "$STATUSROOT/$file" "$UPLOADROOT/$file" >/dev/null 2>&1 echo "Done" 1>&2 } log() { timestamp="`TZ= date +"%Y-%m-%d %H:%M:%S.%N"`" echo "$timestamp:$@" | tee -a "$STATUSROOT/status" 1>&2 syncstatus status } # Temporary files TMPROOT="`mktemp -d --tmpdir='/tmp' 'crouton-autotest.XXX'`" addtrap "rm -rf --one-file-system '$TMPROOT'" LASTFILE="$TMPROOT/last" echo "2 `date '+%s'`" > "$LASTFILE" HOSTINFO="$TMPROOT/hostinfo" mkdir -p "$HOSTINFO" # Stateful files, kept between runs mkdir -p "$LOCALROOT" # status directory: synced via rsync STATUSROOT="$LOCALROOT/status" mkdir -p "$STATUSROOT" log "crouton autotest daemon starting..." echo "Fetching latest autotest..." 1>&2 AUTOTESTROOT="$LOCALROOT/autotest.git" if [ -d "$AUTOTESTROOT/.git" ]; then ( cd "$AUTOTESTROOT" git fetch git reset --hard origin/master >/dev/null ) else rm -rf "$AUTOTESTROOT" git clone "$AUTOTESTGIT" "$AUTOTESTROOT" fi PATH="$AUTOTESTROOT/cli:$PATH" echo "Checking if gsutil is installed..." 1>&2 gsutil version echo "Fetching testing ssh keys..." 1>&2 SSHKEY="$LOCALROOT/testing_rsa" wget "$TESTINGSSHKEYURL?format=TEXT" -O- | base64 -d > "$SSHKEY" chmod 0600 "$SSHKEY" # ssh control directory mkdir -p "$TMPROOT/ssh" # ssh options for the DUTs DUTSSHOPTIONS="-o ConnectTimeout=30 -o IdentityFile=$SSHKEY \ -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \ -o ControlPath=$TMPROOT/ssh/%h \ -o ControlMaster=auto -o ControlPersist=10m" syncstatus while sleep "$POLLINTERVAL"; do read -r lastline last < "$LASTFILE" # Grab the queue, skip to the next interesting line, convert field # boundaries into pipe characters, and then parse the result. # Any line still containing a double-quote after parsing is ignored (wget -qO- "$QUEUEURL" && echo) | tail -n"+$lastline" \ | sed 's/^"//; s/","/|/g; s/"$//; s/.*".*//' | { while IFS='|' read -r date repo branch params run _; do if [ -z "$date" ]; then continue fi lastline="$(($lastline+1))" # Convert to UNIX time and skip if it's an old request date="`date '+%s' --date="$date"`" if [ "$date" -le "$last" ]; then continue fi last="$date" # Validate the other fields branch="${branch%%/*}" gituser="${repo%%/*}" repo="${repo##*/}" if [ "$branch" = "*RELOAD" ]; then log "Daemon: Reloading..." exit 99 fi date="`date -u '+%Y-%m-%d_%H-%M-%S' --date="@$date"`" paramsstr="${params:+"_"}`echo "$params" | tr ' [:punct:]' '_-'`" tname="${date}_${gituser}_${repo}_$branch$paramsstr" curtestroot="$STATUSROOT/$tname" # By default, try all channels and match string in "run" channels="stable beta dev canary" # If run is a predefined string, set channels and match everything if [ "${run#SHORT}" != "$run" ]; then channels="default" run="-" elif [ "${run#FULL+CANARY}" != "$run" ]; then channels="stable beta dev canary" run="-" elif [ "${run#FULL}" != "$run" ]; then channels="stable beta dev" run="-" fi mkdir -p "$curtestroot" log "$tname *: Dispatching (channels=$channels)" hostlist="`atest host list -w cautotest \ -N -b pool:crouton --unlocked || true`" if [ -z "$hostlist" ]; then log "$tname *: Failed to retrieve host list" continue fi for host in $hostlist; do if [ "$channels" = "default" ]; then # Use atest labels to select which channels to run tests on hostchannels="`atest host list --parse "$host" | \ sed -n 's/.*|Labels=\([^|]*\).*/\1/p' | \ tr ',' '\n' | sed -n 's/ *crouton://p'`" if [ -z "$hostchannels" ]; then log "ERROR: No default channel configured for $host." continue fi else hostchannels="$channels" fi for channel in $hostchannels; do # Abbreviation of host name (one letter, one number) hostshort="`echo "$host" \ | sed -e 's/-*\([a-z]\)[a-z]*/\1/g'`" # Find board name board="`findboard "$host" || true`" if [ -z "$board" ]; then log "$tname $hostshort: ERROR cannot find board name!" continue fi hostfull="$hostshort-$board-$channel" # Check if hostfull matches any of the run strings match= for r in $run; do if [ "$hostfull" != "${hostfull#*$r}" ]; then match=y break fi done if [ -z "$match" ]; then echo "No match for $hostfull ($run)." continue fi # Find release image release="`findrelease "$host" "$channel" || true`" if [ -z "$release" ]; then log "$tname $hostfull: ERROR cannot find release name!" continue fi curtesthostroot="$curtestroot/$hostfull" if [ -d "$curtesthostroot" ]; then log "$tname $hostfull: Already started" continue fi mkdir -p "$curtesthostroot" # Generate control file sed -e "s|###REPO###|$gituser/$repo|" \ -e "s|###BRANCH###|$branch|" \ -e "s|###RUNARGS###|$params|" \ -e "s|###ENV###|$MIRRORENV|" \ $SCRIPTDIR/test/autotest_control.template \ > "$curtesthostroot/control" echo "$host" > "$curtesthostroot/host" # Run test with atest ret= ( set -x atest job create -m "$host" -w cautotest \ -f "$curtesthostroot/control" \ -d "cros-version:${board}-release/$release" \ -B always --max_runtime="$MAXTESTRUNTIME" \ "$tname-$hostfull" ) > "$curtesthostroot/atest" 2>&1 || ret=$? if [ -z "$ret" ]; then cat "$curtesthostroot/atest" | tr '\n' ' ' | \ sed -e 's/^.*(id[^0-9]*\([0-9]*\)).*$/\1/' \ > "$curtesthostroot/jobid" else log "$tname $hostfull: Create job failed" fi forceupdate=y done # channel done # host syncstatus done echo "$lastline $last" > "$LASTFILE" } # Check status of running tests for curtestroot in "$STATUSROOT"/*; do if [ ! -d "$curtestroot" ]; then continue fi curtestupdated= curtest="${curtestroot#$STATUSROOT/}" for curtesthostroot in "$curtestroot"/*; do curtesthost="${curtesthostroot#$curtestroot/}" curtesthostresult="$curtesthostroot/results" # If jobid file exists, test is running, or results have not been # fetched yet if [ -f "$curtesthostroot/jobid" ]; then jobid="`cat "$curtesthostroot/jobid"`" host="`cat "$curtesthostroot/host" || true`" newstatusfile="$curtesthostroot/newstatus" statusfile="$curtesthostroot/status" if ! atest job list --parse "$jobid" > "$newstatusfile"; then log "$curtest $curtesthost: Cannot get status." continue fi status="`awk 'BEGIN {RS="|";FS="="} $1~/^Status/{print $2}' \ "$newstatusfile"`" if ! diff -q "$newstatusfile" "$statusfile" >/dev/null 2>&1; then log "$curtest $curtesthost: $status" curtestupdated=y mv "$newstatusfile" "$statusfile" else rm -f "$newstatusfile" fi # If status is Running, rsync from the host. Move the current # results dir away, then use rsync --link-dest, so that partial # files are used, but old files deleted if [ "$status" = "Running" -a -n "$host" ]; then rm -rf "$curtesthostresult.old" mkdir -p "$curtesthostresult" mv -T "$curtesthostresult" "$curtesthostresult.old" mkdir -p "$curtesthostresult" for path in "status.log" "debug/" \ "platform_Crouton/debug/platform_Crouton." \ "platform_Crouton/results/"; do rsync -e "ssh $DUTSSHOPTIONS" -aP \ --link-dest="$curtesthostresult.old/" \ "root@${host}.cros:/usr/local/autotest/results/default/${path}*" \ "$curtesthostresult/" || true done rm -rf "$curtesthostresult.old" curtestupdated=y fi # FIXME: Any more final statuses? # Actually, partial Aborted tests end up as Completed # Not sure about Failed... if [ "$status" = "Aborted" -o "$status" = "Failed" \ -o "$status" = "Completed" ]; then # Get user name user="`awk 'BEGIN{ RS="|"; FS="=" } $1~/^Owner/{print $2}' "$statusfile"`" # It may take a while for the files to be transfered, retry # for at most FETCHTIMEOUT seconds, as, sometimes, no file # ever appears (Aborted tests, for example) if ! root="`gsutil ls "$GSAUTOTEST/$jobid-$user"`"; then echo "Cannot fetch $jobid-$user..." 1>&2 time="`date '+%s'`" statustimefile="$curtesthostroot/statustime" if [ ! -f "$statustimefile" ]; then echo $time > "$statustimefile" continue fi statustime="`cat "$statustimefile"`" if [ "$((statustime+FETCHTIMEOUT))" -gt "$time" ]; then continue fi status2="NO_DATA" else # Ensure results are fully re-fetched rm -rf "$curtesthostresult" "$curtesthostresult.old" mkdir -p "$curtesthostresult" for path in "status.log" "debug/" \ "platform_Crouton/debug/platform_Crouton." \ "platform_Crouton/results/"; do # FIXME: Can we prevent partial fetches??? gsutil cp "${root}${path}*" "$curtesthostresult" \ > /dev/null 2>&1 || true done status2="`awk '($1 == "END") && \ ($3 == "platform_Crouton") \ { print $2 }' \ "$curtesthostresult/status.log"`" fi log "$curtest $curtesthost: $status ${status2:="UNKNOWN"}" sed -i -e "s;\$;|Status2=$status2|;" "$statusfile" rm $curtesthostroot/jobid curtestupdated=y fi fi done # Update summary ( cd "$curtestroot" for dir in *; do if [ -f "$dir/status" ]; then awk ' BEGIN{ RS="|"; FS="=" } { data[$1] = $2 } END{ print "'"$dir"'(" data["Id"] "): " \ data["Status Counts"] " " \ data["Status2"] } ' "$dir/status" fi done > "$TMPROOT/newstatus" if ! diff -q "$TMPROOT/newstatus" status >/dev/null 2>&1; then mv "$TMPROOT/newstatus" status forceupdate=y curtestupdated=y else rm -f "$TMPROOT/newstatus" fi if [ -n "$curtestupdated" ]; then "$SCRIPTDIR"/test/genreport.sh > status.html fi ) done # Display host status atest host list --parse -w cautotest -b pool:crouton \ > "$STATUSROOT/newhoststatus" if ! diff -q "$STATUSROOT/newhoststatus" \ "$STATUSROOT/hoststatus" >/dev/null 2>&1; then mv "$STATUSROOT/newhoststatus" "$STATUSROOT/hoststatus" forceupdate=y else rm -f "$STATUSROOT/newhoststatus" fi atest host list -w cautotest -b pool:crouton \ > "$STATUSROOT/hoststatus.txt" syncstatus done
{ "content_hash": "4a49e4a1aadd1899d8472e31df056f27", "timestamp": "", "source": "github", "line_count": 546, "max_line_length": 105, "avg_line_length": 37.50915750915751, "alnum_prop": 0.49296875, "repo_name": "DanDanBu/crouton", "id": "783a214bee00ed276a582dedc7b3fb25a37ef5dd", "size": "20480", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/daemon.sh", "mode": "33261", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "88131" }, { "name": "C++", "bytes": "47991" }, { "name": "HTML", "bytes": "7685" }, { "name": "JavaScript", "bytes": "38341" }, { "name": "Makefile", "bytes": "4015" }, { "name": "Python", "bytes": "584" }, { "name": "Scheme", "bytes": "1206" }, { "name": "Shell", "bytes": "391085" } ], "symlink_target": "" }
import MenuIcon from './MenuIcon'; export default { Menu: MenuIcon, };
{ "content_hash": "79d9ed9dd1d2b7186a9b9e9b8133ab49", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 34, "avg_line_length": 14.8, "alnum_prop": 0.6891891891891891, "repo_name": "entria/entria-components", "id": "5704cf8bb268b6bc179f67e56dac0a08ca368315", "size": "74", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/components/animatedIcons/index.js", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "114" }, { "name": "JavaScript", "bytes": "39069" } ], "symlink_target": "" }
FROM balenalib/armv7hf-fedora:34-build LABEL io.balena.device-type="orangepi-plus2" RUN dnf install -y \ less \ nano \ net-tools \ usbutils \ gnupg \ i2c-tools \ && dnf clean all RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo $'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v7 \nOS: Fedora 34 \nVariant: build variant \nDefault variable(s): UDEV=off \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info RUN echo $'#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \ && chmod +x /bin/sh-shim \ && cp /bin/sh /bin/sh.real \ && mv /bin/sh-shim /bin/sh
{ "content_hash": "d35c3b48a9ccd4fd01fb17f1c5feac46", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 610, "avg_line_length": 55.666666666666664, "alnum_prop": 0.7035928143712575, "repo_name": "resin-io-library/base-images", "id": "9747aa0efc801e36df3afbea2235f4689d48ffab", "size": "1002", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "balena-base-images/device-base/orangepi-plus2/fedora/34/build/Dockerfile", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "71234697" }, { "name": "JavaScript", "bytes": "13096" }, { "name": "Shell", "bytes": "12051936" }, { "name": "Smarty", "bytes": "59789" } ], "symlink_target": "" }
<?php namespace Granule\DataBind; class TypeDeclaration extends Type { /** @var bool */ private $nullable; /** @var bool */ private $inArray; protected function __construct(string $name, bool $nullable = false, bool $inArray = false) { parent::__construct($name); $this->nullable = $nullable; $this->inArray = $inArray; } public static function fromSignature(string $signature): TypeDeclaration { $nullable = substr($signature, 0, 1) === '?'; $signature = $nullable ? substr($signature, 1) : $signature; $inArray = substr($signature, -2) === '[]'; $signature = $inArray ? substr($signature, 0, -2) : $signature; return new self($signature, $nullable, $inArray); } public static function fromReflection(\ReflectionType $reflection): TypeDeclaration { return new self( $reflection->getName(), $reflection->allowsNull() ); } public static function fromName(string $name): TypeDeclaration { return new self($name); } public function withName(string $newName): TypeDeclaration { return new self($newName, $this->isNullable(), $this->isInArray() ); } public function isNullable(): bool { return $this->nullable; } public function isInArray(): bool { return $this->inArray; } public function getDeclaration(): string { $signature = $this->getName(); if ($this->isInArray()) { $signature = sprintf('%s[]', $signature); } if ($this->isNullable()) { $signature = sprintf('?%s', $signature); } return $signature; } }
{ "content_hash": "9e492ee52975a58ba5a6d4e9601e8662", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 97, "avg_line_length": 26.753846153846155, "alnum_prop": 0.569867740080506, "repo_name": "granulephp/data-bind", "id": "66a48ac777429b82ee74498ba85971cf9ae42d19", "size": "2876", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/TypeDeclaration.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "87295" } ], "symlink_target": "" }
// # Task automation for Ghost // // Run various tasks when developing for and working with Ghost. // // **Usage instructions:** can be found in the [Custom Tasks](#custom%20tasks) section or by running `grunt --help`. // // **Debug tip:** If you have any problems with any Grunt tasks, try running them with the `--verbose` command var _ = require('lodash'), colors = require('colors'), fs = require('fs-extra'), moment = require('moment'), getTopContribs = require('top-gh-contribs'), path = require('path'), Promise = require('bluebird'), request = require('request'), escapeChar = process.platform.match(/^win/) ? '^' : '\\', cwd = process.cwd().replace(/( |\(|\))/g, escapeChar + '$1'), buildDirectory = path.resolve(cwd, '.build'), distDirectory = path.resolve(cwd, '.dist'), mochaPath = path.resolve(cwd + '/node_modules/grunt-mocha-cli/node_modules/mocha/bin/mocha'), // ## Build File Patterns // A list of files and patterns to include when creating a release zip. // This is read from the `.npmignore` file and all patterns are inverted as the `.npmignore` // file defines what to ignore, whereas we want to define what to include. buildGlob = (function () { /*jslint stupid:true */ return fs.readFileSync('.npmignore', {encoding: 'utf8'}).split('\n').map(function (pattern) { if (pattern[0] === '!') { return pattern.substr(1); } return '!' + pattern; }); }()), // ## List of files we want to lint through jshint and jscs to make sure // they conform to our desired code styles. lintFiles = { // Linting files for server side or shared javascript code. server: { files: { src: [ '*.js', '!config*.js', // note: i added this, do we want this linted? 'core/*.js', 'core/server/**/*.js', 'core/shared/**/*.js', '!core/shared/vendor/**/*.js' ] } }, // Linting files for client side javascript code. client: { files: { src: [ 'core/client/**/*.js', '!core/client/docs/js/*.js', '!core/client/assets/vendor/**/*.js', '!core/client/tpl/**/*.js' ] } }, clientTests: { files: { src: [ 'core/test/client/**/*.js' ] } }, // Linting files for test code. test: { files: { src: [ 'core/test/**/*.js', '!core/test/client/**/*.js' ] } } }, // ## Grunt configuration configureGrunt = function (grunt) { // *This is not useful but required for jshint* colors.setTheme({silly: 'rainbow'}); // #### Load all grunt tasks // // Find all of the task which start with `grunt-` and load them, rather than explicitly declaring them all require('matchdep').filterDev(['grunt-*', '!grunt-cli']).forEach(grunt.loadNpmTasks); var cfg = { // #### Common paths used by tasks paths: { build: buildDirectory, releaseBuild: path.join(buildDirectory, 'release'), dist: distDirectory, releaseDist: path.join(distDirectory, 'release') }, // Standard build type, for when we have nightlies again. buildType: 'Build', // Load package.json so that we can create correctly versioned releases. pkg: grunt.file.readJSON('package.json'), // ### grunt-contrib-watch // Watch files and livereload in the browser during development. // See the [grunt dev](#live%20reload) task for how this is used. watch: { shared: { files: ['core/shared/**/*.js'], tasks: ['concat:dev'] }, emberTemplates: { files: ['core/client/**/*.hbs'], tasks: ['emberTemplates:dev'] }, ember: { files: ['core/client/**/*.js', 'core/test/client/**/*.js'], tasks: ['clean:tmp', 'transpile', 'concat_sourcemap:dev', 'concat_sourcemap:tests'] }, sass: { files: [ 'core/client/assets/sass/**/*.scss' ], tasks: ['css'] }, livereload: { files: [ 'content/themes/casper/assets/css/*.css', 'content/themes/casper/assets/js/*.js', 'core/client/assets/css/*.css', 'core/built/scripts/*.js' ], options: { livereload: true } }, express: { files: ['core/server.js', 'core/server/**/*.js'], tasks: ['express:dev'], options: { // **Note:** Without this option specified express won't be reloaded nospawn: true } } }, // ### grunt-express-server // Start a Ghost expess server for use in development and testing express: { options: { script: 'index.js', output: 'Ghost is running' }, dev: { options: {} }, test: { options: { node_env: 'testing' } } }, // ### grunt-contrib-jshint // Linting rules, run as part of `grunt validate`. See [grunt validate](#validate) and its subtasks for // more information. jshint: (function () { return _.merge({ server: { options: { jshintrc: '.jshintrc' } }, client: { options: { jshintrc: 'core/client/.jshintrc' } }, clientTests: { options: { jshintrc: 'core/test/client/.jshintrc' } }, test: { options: { jshintrc: 'core/test/.jshintrc' } } }, lintFiles); })(), // ### grunt-jscs // Code style rules, run as part of `grunt validate`. See [grunt validate](#validate) and its subtasks for // more information. jscs: (function () { var jscsConfig = _.merge({ server: { options: { config: '.jscsrc' } }, client: { options: { config: '.jscsrc', esnext: true, disallowObjectController: true } }, clientTests: { options: { config: '.jscsrc', esnext: true, disallowObjectController: true } }, test: { options: { config: '.jscsrc' } } }, lintFiles); return jscsConfig; })(), // ### grunt-mocha-cli // Configuration for the mocha test runner, used to run unit, integration and route tests as part of // `grunt validate`. See [grunt validate](#validate) and its sub tasks for more information. mochacli: { options: { ui: 'bdd', reporter: grunt.option('reporter') || 'spec', timeout: '15000', save: grunt.option('reporter-output') }, // #### All Unit tests unit: { src: [ 'core/test/unit/**/*_spec.js' ] }, // ##### Groups of unit tests server: { src: ['core/test/unit/**/server*_spec.js'] }, helpers: { src: ['core/test/unit/server_helpers/*_spec.js'] }, showdown: { src: ['core/test/unit/**/showdown*_spec.js'] }, perm: { src: ['core/test/unit/**/permissions_spec.js'] }, migrate: { src: [ 'core/test/unit/**/export_spec.js', 'core/test/unit/**/import_spec.js' ] }, storage: { src: ['core/test/unit/**/storage*_spec.js'] }, // #### All Integration tests integration: { src: [ 'core/test/integration/**/model*_spec.js', 'core/test/integration/**/api*_spec.js', 'core/test/integration/*_spec.js' ] }, // ##### Model integration tests model: { src: ['core/test/integration/**/model*_spec.js'] }, // ##### API integration tests api: { src: ['core/test/integration/**/api*_spec.js'] }, // #### All Route tests routes: { src: [ 'core/test/functional/routes/**/*_test.js' ] }, // #### All Module tests module: { src: [ 'core/test/functional/module/**/*_test.js' ] } }, // ### grunt-shell // Command line tools where it's easier to run a command directly than configure a grunt plugin shell: { // #### Run bower install // Used as part of `grunt init`. See the section on [Building Assets](#building%20assets) for more // information. bower: { command: path.resolve(cwd + '/node_modules/.bin/bower --allow-root install'), options: { stdout: true, stdin: false } }, testem: { command: path.resolve(cwd + '/node_modules/.bin/testem ci -f core/test/client/testem.json'), options: { stdout: true, stdin: false } }, test: { command: function (test) { return 'node ' + mochaPath + ' --timeout=15000 --ui=bdd --reporter=spec core/test/' + test; } }, // #### Generate coverage report // See the `grunt test-coverage` task in the section on [Testing](#testing) for more information. coverage: { command: 'node ' + mochaPath + ' --timeout 15000 --reporter html-cov > coverage.html ' + path.resolve(cwd + '/core/test/blanket_coverage.js') } }, // ### grunt-sass // compile sass to css sass: { compress: { options: { outputStyle: 'compressed', sourceMap: true }, files: [ {dest: path.resolve('core/client/assets/css/<%= pkg.name %>.min.css'), src: path.resolve('core/client/assets/sass/screen.scss')}, {dest: path.resolve('core/client/docs/dist/css/<%= pkg.name %>.min.css'), src: path.resolve('core/client/assets/sass/screen.scss')} ] } }, // ### grunt-autoprefixer // Autoprefix all the things, for the last 2 versions of major browsers autoprefixer: { options: { silent: true, // suppress logging map: true, // Use and update the sourcemap browsers: ['last 2 versions', '> 1%', 'Explorer 10'] }, ghost: { src: 'core/client/assets/css/<%= pkg.name %>.min.css', dest: 'core/client/assets/css/<%= pkg.name %>.min.css' }, docs: { src: 'core/client/docs/dist/css/<%= pkg.name %>.min.css', dest: 'core/client/docs/dist/css/<%= pkg.name %>.min.css' } }, // ### grunt-ember-templates // Compiles handlebar templates for ember emberTemplates: { dev: { options: { templateCompilerPath: 'bower_components/ember/ember-template-compiler.js', handlebarsPath: 'bower_components/handlebars/handlebars.js', templateNamespace: 'HTMLBars', templateBasePath: /core\/client\//, templateFileExtensions: /\.hbs/, templateRegistration: function (name, template) { return grunt.config.process('define(\'ghost/') + name + '\', [\'exports\'], function(__exports__){ __exports__[\'default\'] = ' + template + '; });'; } }, files: { 'core/built/scripts/templates-dev.js': 'core/client/templates/**/*.hbs' } }, prod: { options: { templateCompilerPath: 'bower_components/ember/ember-template-compiler.js', handlebarsPath: 'bower_components/handlebars/handlebars.js', templateNamespace: 'HTMLBars', templateBasePath: /core\/client\//, templateFileExtensions: /\.hbs/, templateRegistration: function (name, template) { return grunt.config.process('define(\'ghost/') + name + '\', [\'exports\'], function(__exports__){ __exports__[\'default\'] = ' + template + '; });'; } }, files: { 'core/built/scripts/templates.js': 'core/client/templates/**/*.hbs' } } }, // ### grunt-es6-module-transpiler // Compiles Ember es6 modules transpile: { client: { type: 'amd', moduleName: function (path) { return 'ghost/' + path; }, files: [{ expand: true, cwd: 'core/client/', src: ['**/*.js', '!loader.js', '!config-*.js'], dest: '.tmp/ember-transpiled/' }] }, tests: { type: 'amd', moduleName: function (path) { return 'ghost/tests/' + path; }, files: [{ expand: true, cwd: 'core/test/client/', src: ['**/*.js'], dest: '.tmp/ember-tests-transpiled/' }] } }, // ### grunt-concat-sourcemap // Concatenates transpiled ember app concat_sourcemap: { dev: { src: ['.tmp/ember-transpiled/**/*.js', 'core/client/loader.js'], dest: 'core/built/scripts/ghost-dev.js', options: { sourcesContent: true } }, tests: { src: ['.tmp/ember-tests-transpiled/**/*.js'], dest: 'core/built/scripts/ghost-tests.js', options: { sourcesContent: true } }, prod: { src: ['.tmp/ember-transpiled/**/*.js', 'core/built/scripts/templates.js', 'core/client/loader.js'], dest: 'core/built/scripts/ghost.js', options: { sourcesContent: true } } }, // ### grunt-docker // Generate documentation from code docker: { docs: { dest: 'docs', src: ['.'], options: { onlyUpdated: true, exclude: 'node_modules,.git,.tmp,bower_components,content,*built,*test,*doc*,*vendor,' + 'config.js,coverage.html,.travis.yml,*.min.css,screen.css', extras: ['fileSearch'] } } }, // ### grunt-contrib-clean // Clean up files as part of other tasks clean: { built: { src: [ 'core/built/**', 'core/client/assets/img/contributors/**', 'core/client/templates/-contributors.hbs' ] }, release: { src: ['<%= paths.releaseBuild %>/**'] }, css: { src: [ 'core/client/assets/css/**', 'core/client/docs/dist/css/**' ] }, test: { src: ['content/data/ghost-test.db'] }, tmp: { src: ['.tmp/**'] } }, // ### grunt-contrib-copy // Copy files into their correct locations as part of building assets, or creating release zips copy: { dev: { files: [{ cwd: 'bower_components/jquery/dist/', src: 'jquery.js', dest: 'core/built/public/', expand: true }, { src: 'core/client/config-dev.js', dest: 'core/client/config.js' }] }, prod: { files: [{ cwd: 'bower_components/jquery/dist/', src: 'jquery.js', dest: 'core/built/public/', expand: true }, { src: 'core/client/config-prod.js', dest: 'core/client/config.js' }] }, release: { files: [{ cwd: 'bower_components/jquery/dist/', src: 'jquery.js', dest: 'core/built/public/', expand: true }, { src: 'core/client/config-prod.js', dest: 'core/client/config.js' }, { expand: true, src: buildGlob, dest: '<%= paths.releaseBuild %>/' }] } }, // ### grunt-contrib-compress // Zip up files for builds / releases compress: { release: { options: { archive: '<%= paths.releaseDist %>/Ghost-<%= pkg.version %>.zip' }, expand: true, cwd: '<%= paths.releaseBuild %>/', src: ['**'] } }, // ### grunt-contrib-concat // concatenate multiple JS files into a single file ready for use concat: { dev: { nonull: true, dest: 'core/built/scripts/vendor-dev.js', src: [ 'bower_components/loader.js/loader.js', 'bower_components/jquery/dist/jquery.js', 'bower_components/ember/ember.debug.js', 'bower_components/ember-data/ember-data.js', 'bower_components/ember-resolver/dist/ember-resolver.js', 'bower_components/ic-ajax/dist/globals/main.js', 'bower_components/ember-load-initializers/ember-load-initializers.js', 'bower_components/validator-js/validator.js', 'bower_components/codemirror/lib/codemirror.js', 'bower_components/codemirror/addon/mode/overlay.js', 'bower_components/codemirror/mode/markdown/markdown.js', 'bower_components/codemirror/mode/gfm/gfm.js', 'bower_components/showdown-ghost/src/showdown.js', 'bower_components/moment/moment.js', 'bower_components/keymaster/keymaster.js', 'bower_components/device/lib/device.js', 'bower_components/jquery-ui/ui/jquery-ui.js', 'bower_components/jquery-file-upload/js/jquery.fileupload.js', 'bower_components/fastclick/lib/fastclick.js', 'bower_components/nprogress/nprogress.js', 'bower_components/ember-simple-auth/simple-auth.js', 'bower_components/ember-simple-auth/simple-auth-oauth2.js', 'bower_components/google-caja/html-css-sanitizer-bundle.js', 'bower_components/nanoscroller/bin/javascripts/jquery.nanoscroller.js', 'core/shared/lib/showdown/extensions/ghostimagepreview.js', 'core/shared/lib/showdown/extensions/ghostgfm.js', 'core/shared/lib/showdown/extensions/ghostfootnotes.js', 'core/shared/lib/showdown/extensions/ghosthighlight.js' ] }, prod: { nonull: true, dest: 'core/built/scripts/vendor.js', src: [ 'bower_components/loader.js/loader.js', 'bower_components/jquery/dist/jquery.js', 'bower_components/ember/ember.prod.js', 'bower_components/ember-data/ember-data.prod.js', 'bower_components/ember-resolver/dist/ember-resolver.js', 'bower_components/ic-ajax/dist/globals/main.js', 'bower_components/ember-load-initializers/ember-load-initializers.js', 'bower_components/validator-js/validator.js', 'bower_components/codemirror/lib/codemirror.js', 'bower_components/codemirror/addon/mode/overlay.js', 'bower_components/codemirror/mode/markdown/markdown.js', 'bower_components/codemirror/mode/gfm/gfm.js', 'bower_components/showdown-ghost/src/showdown.js', 'bower_components/moment/moment.js', 'bower_components/keymaster/keymaster.js', 'bower_components/device/lib/device.js', 'bower_components/jquery-ui/ui/jquery-ui.js', 'bower_components/jquery-file-upload/js/jquery.fileupload.js', 'bower_components/fastclick/lib/fastclick.js', 'bower_components/nprogress/nprogress.js', 'bower_components/ember-simple-auth/simple-auth.js', 'bower_components/ember-simple-auth/simple-auth-oauth2.js', 'bower_components/google-caja/html-css-sanitizer-bundle.js', 'bower_components/nanoscroller/bin/javascripts/jquery.nanoscroller.js', 'core/shared/lib/showdown/extensions/ghostimagepreview.js', 'core/shared/lib/showdown/extensions/ghostgfm.js', 'core/shared/lib/showdown/extensions/ghostfootnotes.js', 'core/shared/lib/showdown/extensions/ghosthighlight.js' ] } }, // ### grunt-contrib-uglify // Minify concatenated javascript files ready for production uglify: { prod: { options: { sourceMap: true }, files: { 'core/built/public/jquery.min.js': 'core/built/public/jquery.js', 'core/built/scripts/vendor.min.js': 'core/built/scripts/vendor.js', 'core/built/scripts/ghost.min.js': 'core/built/scripts/ghost.js' } }, release: { options: { sourceMap: false }, files: { 'core/built/public/jquery.min.js': 'core/built/public/jquery.js', 'core/built/scripts/vendor.min.js': 'core/built/scripts/vendor.js', 'core/built/scripts/ghost.min.js': 'core/built/scripts/ghost.js' } } }, // ### grunt-update-submodules // Grunt task to update git submodules update_submodules: { default: { options: { params: '--init' } } } }; // Load the configuration grunt.initConfig(cfg); // ## Utilities // // ### Spawn Casper.js // Custom test runner for our Casper.js functional tests // This really ought to be refactored into a separate grunt task module grunt.registerTask('spawnCasperJS', function (target) { target = _.contains(['client', 'setup'], target) ? target + '/' : undefined; var done = this.async(), options = ['host', 'noPort', 'port', 'email', 'password'], args = ['test'] .concat(grunt.option('target') || target || ['client/']) .concat(['--includes=base.js', '--log-level=debug', '--port=2369']); // Forward parameters from grunt to casperjs _.each(options, function processOption(option) { if (grunt.option(option)) { args.push('--' + option + '=' + grunt.option(option)); } }); if (grunt.option('fail-fast')) { args.push('--fail-fast'); } // Show concise logs in Travis as ours are getting too long if (grunt.option('concise') || process.env.TRAVIS) { args.push('--concise'); } else { args.push('--verbose'); } grunt.util.spawn({ cmd: 'casperjs', args: args, opts: { cwd: path.resolve('core/test/functional'), stdio: 'inherit' } }, function (error, result, code) { /*jshint unused:false*/ if (error) { grunt.fail.fatal(result.stdout); } grunt.log.writeln(result.stdout); done(); }); }); // # Custom Tasks // Ghost has a number of useful tasks that we use every day in development. Tasks marked as *Utility* are used // by grunt to perform current actions, but isn't useful to developers. // // Skip ahead to the section on: // // * [Building assets](#building%20assets): // `grunt init`, `grunt` & `grunt prod` or live reload with `grunt dev` // * [Testing](#testing): // `grunt validate`, the `grunt test-*` sub-tasks or generate a coverage report with `grunt test-coverage`. // ### Help // Run `grunt help` on the commandline to get a print out of the available tasks and details of // what each one does along with any available options. This is an alias for `grunt --help` grunt.registerTask('help', 'Outputs help information if you type `grunt help` instead of `grunt --help`', function () { console.log('Type `grunt --help` to get the details of available grunt tasks, ' + 'or alternatively visit https://github.com/TryGhost/Ghost/wiki/Grunt-Toolkit'); }); // ### Documentation // Run `grunt docs` to generate annotated source code using the documentation described in the code comments. grunt.registerTask('docs', 'Generate Docs', ['docker']); // ## Testing // Ghost has an extensive set of test suites. The following section documents the various types of tests // and how to run them. // // TLDR; run `grunt validate` // #### Set Test Env *(Utility Task)* // Set the NODE_ENV to 'testing' unless the environment is already set to TRAVIS. // This ensures that the tests get run under the correct environment, using the correct database, and // that they work as expected. Trying to run tests with no ENV set will throw an error to do with `client`. grunt.registerTask('setTestEnv', 'Use "testing" Ghost config; unless we are running on travis (then show queries for debugging)', function () { process.env.NODE_ENV = process.env.TRAVIS ? process.env.NODE_ENV : 'testing'; cfg.express.test.options.node_env = process.env.NODE_ENV; }); // #### Ensure Config *(Utility Task)* // Make sure that we have a `config.js` file when running tests // Ghost requires a `config.js` file to specify the database settings etc. Ghost comes with an example file: // `config.example.js` which is copied and renamed to `config.js` by the bootstrap process grunt.registerTask('ensureConfig', function () { var config = require('./core/server/config'), done = this.async(); config.load().then(function () { done(); }).catch(function (err) { grunt.fail.fatal(err.stack); }); }); // #### Reset Database to "New" state *(Utility Task)* // Drops all database tables and then runs the migration process to put the database // in a "new" state. grunt.registerTask('cleanDatabase', function () { var done = this.async(), models = require('./core/server/models'), migration = require('./core/server/data/migration'); migration.reset().then(function () { return models.init(); }).then(function () { return migration.init(); }).then(function () { done(); }).catch(function (err) { grunt.fail.fatal(err.stack); }); }); grunt.registerTask('test', function (test) { if (!test) { grunt.log.write('no test provided'); } grunt.task.run('setTestEnv', 'shell:test:' + test); }); // ### Validate // **Main testing task** // // `grunt validate` will build, lint and test your local Ghost codebase. // // `grunt validate` is one of the most important and useful grunt tasks that we have available to use. It // manages the build of your environment and then calls `grunt test` // // `grunt validate` is called by `npm test` and is used by Travis. grunt.registerTask('validate', 'Run tests and lint code', ['init', 'test-all']); // ### Test // **Main testing task** // // `grunt test` will lint and test your pre-built local Ghost codebase. // // `grunt test` runs jshint and jscs as well as the 4 test suites. See the individual sub tasks below for // details of each of the test suites. // grunt.registerTask('test-all', 'Run tests and lint code', ['jshint', 'jscs', 'test-routes', 'test-module', 'test-unit', 'test-integration', 'test-functional', 'shell:testem']); // ### Lint // // `grunt lint` will run the linter and the code style checker so you can make sure your code is pretty grunt.registerTask('lint', 'Run the code style checks and linter', ['jshint', 'jscs']); // ### Unit Tests *(sub task)* // `grunt test-unit` will run just the unit tests // // Provided you already have a `config.js` file, you can run individual sections from // [mochacli](#grunt-mocha-cli) by running: // // `NODE_ENV=testing grunt mochacli:section` // // If you need to run an individual unit test file, you can do so, providing you have mocha installed globally // by using a command in the form: // // `NODE_ENV=testing mocha --timeout=15000 --ui=bdd --reporter=spec core/test/unit/config_spec.js` // // Unit tests are run with [mocha](http://mochajs.org/) using // [should](https://github.com/visionmedia/should.js) to describe the tests in a highly readable style. // Unit tests do **not** touch the database. // A coverage report can be generated for these tests using the `grunt test-coverage` task. grunt.registerTask('test-unit', 'Run unit tests (mocha)', ['clean:test', 'setTestEnv', 'ensureConfig', 'mochacli:unit']); // ### Integration tests *(sub task)* // `grunt test-integration` will run just the integration tests // // Provided you already have a `config.js` file, you can run just the model integration tests by running: // // `NODE_ENV=testing grunt mochacli:model` // // Or just the api integration tests by running: // // `NODE_ENV=testing grunt mochacli:api` // // Integration tests are run with [mocha](http://mochajs.org/) using // [should](https://github.com/visionmedia/should.js) to describe the tests in a highly readable style. // Integration tests are different to the unit tests because they make requests to the database. // // If you need to run an individual integration test file you can do so, providing you have mocha installed // globally, by using a command in the form (replace path to api_tags_spec.js with the test file you want to // run): // // `NODE_ENV=testing mocha --timeout=15000 --ui=bdd --reporter=spec core/test/integration/api/api_tags_spec.js` // // Their purpose is to test that both the api and models behave as expected when the database layer is involved. // These tests are run against sqlite3, mysql and pg on travis and ensure that differences between the databases // don't cause bugs. At present, pg often fails and is not officially supported. // // A coverage report can be generated for these tests using the `grunt test-coverage` task. grunt.registerTask('test-integration', 'Run integration tests (mocha + db access)', ['clean:test', 'setTestEnv', 'ensureConfig', 'mochacli:integration']); // ### Route tests *(sub task)* // `grunt test-routes` will run just the route tests // // If you need to run an individual route test file, you can do so, providing you have a `config.js` file and // mocha installed globally by using a command in the form: // // `NODE_ENV=testing mocha --timeout=15000 --ui=bdd --reporter=spec core/test/functional/routes/admin_test.js` // // Route tests are run with [mocha](http://mochajs.org/) using // [should](https://github.com/visionmedia/should.js) and [supertest](https://github.com/visionmedia/supertest) // to describe and create the tests. // // Supertest enables us to describe requests that we want to make, and also describe the response we expect to // receive back. It works directly with express, so we don't have to run a server to run the tests. // // The purpose of the route tests is to ensure that all of the routes (pages, and API requests) in Ghost // are working as expected, including checking the headers and status codes received. It is very easy and // quick to test many permutations of routes / urls in the system. grunt.registerTask('test-routes', 'Run functional route tests (mocha)', ['clean:test', 'setTestEnv', 'ensureConfig', 'mochacli:routes']); // ### Module tests *(sub task)* // `grunt test-module` will run just the module tests // // The purpose of the module tests is to ensure that Ghost can be used as an npm module and exposes all // required methods to interact with it. grunt.registerTask('test-module', 'Run functional module tests (mocha)', ['clean:test', 'setTestEnv', 'ensureConfig', 'mochacli:module']); // ### Functional tests for the setup process // `grunt test-functional-setup will run just the functional tests for the setup page. // // Setup only works with a brand new database, so it needs to run isolated from the rest of // the functional tests. grunt.registerTask('test-functional-setup', 'Run functional tests for setup', ['clean:test', 'setTestEnv', 'ensureConfig', 'cleanDatabase', 'express:test', 'spawnCasperJS:setup', 'express:test:stop'] ); // ### Functional tests *(sub task)* // `grunt test-functional` will run just the functional tests // // You can use the `--target` argument to run any individual test file, or the admin or frontend tests: // // `grunt test-functional --target=client/editor_test.js` - run just the editor tests // // `grunt test-functional --target=client/` - run all of the tests in the client directory // // Functional tests are run with [phantom.js](http://phantomjs.org/) and defined using the testing api from // [casper.js](http://docs.casperjs.org/en/latest/testing.html). // // An express server is started with the testing environment set, and then a headless phantom.js browser is // used to make requests to that server. The Casper.js API then allows us to describe the elements and // interactions we expect to appear on the page. // // The purpose of the functional tests is to ensure that Ghost is working as is expected from a user perspective // including buttons and other important interactions in the admin UI. grunt.registerTask('test-functional', 'Run functional interface tests (CasperJS)', ['clean:test', 'setTestEnv', 'ensureConfig', 'cleanDatabase', 'express:test', 'spawnCasperJS', 'express:test:stop', 'test-functional-setup'] ); // ### Coverage // `grunt test-coverage` will generate a report for the Unit and Integration Tests. // // This is not currently done as part of CI or any build, but is a tool we have available to keep an eye on how // well the unit and integration tests are covering the code base. // Ghost does not have a minimum coverage level - we're more interested in ensuring important and useful areas // of the codebase are covered, than that the whole codebase is covered to a particular level. // // Key areas for coverage are: helpers and theme elements, apps / GDK, the api and model layers. grunt.registerTask('test-coverage', 'Generate unit and integration (mocha) tests coverage report', ['clean:test', 'setTestEnv', 'ensureConfig', 'shell:coverage']); // ## Building assets // // Ghost's GitHub repository contains the un-built source code for Ghost. If you're looking for the already // built release zips, you can get these from the [release page](https://github.com/TryGhost/Ghost/releases) on // GitHub or from https://ghost.org/download. These zip files are created using the [grunt release](#release) // task. // // If you want to work on Ghost core, or you want to use the source files from GitHub, then you have to build // the Ghost assets in order to make them work. // // There are a number of grunt tasks available to help with this. Firstly after fetching an updated version of // the Ghost codebase, after running `npm install`, you will need to run [grunt init](#init%20assets). // // For production blogs you will need to run [grunt prod](#production%20assets). // // For updating assets during development, the tasks [grunt](#default%20asset%20build) and // [grunt dev](#live%20reload) are available. // // #### Master Warning *(Utility Task)* // Warns git users not ot use the `master` branch in production. // `master` is an unstable branch and shouldn't be used in production as you run the risk of ending up with a // database in an unrecoverable state. Instead there is a branch called `stable` which is the equivalent of the // release zip for git users. grunt.registerTask('master-warn', 'Outputs a warning to runners of grunt prod, that master shouldn\'t be used for live blogs', function () { console.log('>', 'Always two there are, no more, no less. A master and a'.red, 'stable'.red.bold + '.'.red); console.log('Use the', 'stable'.bold, 'branch for live blogs.', 'Never'.bold, 'master!'); }); // ### Ember Build *(Utility Task)* // All tasks related to building the Ember client code including transpiling ES6 modules and building templates grunt.registerTask('emberBuildDev', 'Build Ember JS & templates for development', ['clean:tmp', 'buildAboutPage', 'emberTemplates:dev', 'transpile', 'concat_sourcemap:dev', 'concat_sourcemap:tests']); // ### Ember Build *(Utility Task)* // All tasks related to building the Ember client code including transpiling ES6 modules and building templates grunt.registerTask('emberBuildProd', 'Build Ember JS & templates for production', ['clean:tmp', 'buildAboutPage', 'emberTemplates:prod', 'transpile', 'concat_sourcemap:prod']); // ### CSS Build *(Utility Task)* // Build the CSS files from the SCSS files grunt.registerTask('css', 'Build Client CSS', ['sass', 'autoprefixer']); // ### Build About Page *(Utility Task)* // Builds the github contributors partial template used on the Settings/About page, // and downloads the avatar for each of the users. // Run by any task that compiles the ember assets (emberBuildDev, emberBuildProd) // or manually via `grunt buildAboutPage`. // Change which version you're working against by setting the "releaseTag" below. // // Only builds if the contributors template does not exist. // To force a build regardless, supply the --force option. // `grunt buildAboutPage --force` grunt.registerTask('buildAboutPage', 'Compile assets for the About Ghost page', function () { var done = this.async(), templatePath = 'core/client/templates/-contributors.hbs', imagePath = 'core/client/assets/img/contributors/', ninetyDaysAgo = Date.now() - (1000 * 60 * 60 * 24 * 90), oauthKey = process.env.GITHUB_OAUTH_KEY; if (fs.existsSync(templatePath) && !grunt.option('force')) { grunt.log.writeln('Contributors template already exists.'); grunt.log.writeln('Skipped'.bold); return done(); } grunt.verbose.writeln('Downloading release and contributor information from GitHub'); return Promise.join( Promise.promisify(fs.mkdirs)(imagePath), getTopContribs({ user: 'tryghost', repo: 'ghost', oauthKey: oauthKey, releaseDate: ninetyDaysAgo, count: 20, retry: true }) ).then(function (results) { var contributors = results[1], contributorTemplate = '<li>\n <a href="<%githubUrl%>" title="<%name%>">\n' + ' <img src="{{gh-path "admin" "/img/contributors"}}/<%name%>" alt="<%name%>">\n' + ' </a>\n</li>', downloadImagePromise = function (url, name) { return new Promise(function (resolve, reject) { request(url) .pipe(fs.createWriteStream(imagePath + name)) .on('close', resolve) .on('error', reject); }); }; grunt.verbose.writeln('Creating contributors template.'); grunt.file.write(templatePath, // Map contributors to the template. _.map(contributors, function (contributor) { return contributorTemplate .replace(/<%githubUrl%>/g, contributor.githubUrl) .replace(/<%name%>/g, contributor.name); }).join('\n') ); grunt.verbose.writeln('Downloading images for top contributors'); return Promise.all(_.map(contributors, function (contributor) { return downloadImagePromise(contributor.avatarUrl + '&s=60', contributor.name); })); }).then(done).catch(function (error) { grunt.log.error(error); if (error.http_status) { grunt.log.writeln('GitHub API request returned status: ' + error.http_status); } if (error.ratelimit_limit) { grunt.log.writeln('Rate limit data: limit: %d, remaining: %d, reset: %s', error.ratelimit_limit, error.ratelimit_remaining, moment.unix(error.ratelimit_reset).fromNow()); } done(false); }); }); // ### Init assets // `grunt init` - will run an initial asset build for you // // Grunt init runs `bower install` as well as the standard asset build tasks which occur when you run just // `grunt`. This fetches the latest client side dependencies, and moves them into their proper homes. // // This task is very important, and should always be run and when fetching down an updated code base just after // running `npm install`. // // `bower` does have some quirks, such as not running as root. If you have problems please try running // `grunt init --verbose` to see if there are any errors. grunt.registerTask('init', 'Prepare the project for development', ['shell:bower', 'update_submodules', 'default']); // ### Production assets // `grunt prod` - will build the minified assets used in production. // // It is otherwise the same as running `grunt`, but is only used when running Ghost in the `production` env. grunt.registerTask('prod', 'Build JS & templates for production', ['concat:prod', 'copy:prod', 'emberBuildProd', 'uglify:prod', 'master-warn']); // ### Default asset build // `grunt` - default grunt task // // Compiles concatenates javascript files for the admin UI into a handful of files instead // of many files, and makes sure the bower dependencies are in the right place. grunt.registerTask('default', 'Build JS & templates for development', ['concat:dev', 'copy:dev', 'css', 'emberBuildDev']); // ### Live reload // `grunt dev` - build assets on the fly whilst developing // // If you want Ghost to live reload for you whilst you're developing, you can do this by running `grunt dev`. // This works hand-in-hand with the [livereload](http://livereload.com/) chrome extension. // // `grunt dev` manages starting an express server and restarting the server whenever core files change (which // require a server restart for the changes to take effect) and also manage reloading the browser whenever // frontend code changes. // // Note that the current implementation of watch only works with casper, not other themes. grunt.registerTask('dev', 'Dev Mode; watch files and restart server on changes', ['default', 'express:dev', 'watch']); grunt.registerTask('server', 'Dev Mode; watch files and restart server on changes', ['init', 'express:dev', 'watch']); // ### Release // Run `grunt release` to create a Ghost release zip file. // Uses the files specified by `.npmignore` to know what should and should not be included. // Runs the asset generation tasks for both development and production so that the release can be used in // either environment, and packages all the files up into a zip. grunt.registerTask('release', 'Release task - creates a final built zip\n' + ' - Do our standard build steps \n' + ' - Copy files to release-folder/#/#{version} directory\n' + ' - Clean out unnecessary files (travis, .git*, etc)\n' + ' - Zip files in release-folder to dist-folder/#{version} directory', ['init', 'concat:prod', 'copy:prod', 'emberBuildProd', 'uglify:release', 'clean:release', 'copy:release', 'compress:release']); }; // Export the configuration module.exports = configureGrunt;
{ "content_hash": "0a84f45c0ead5134dc5d12e097f3ff0e", "timestamp": "", "source": "github", "line_count": 1157, "max_line_length": 190, "avg_line_length": 45.48746758859119, "alnum_prop": 0.49056603773584906, "repo_name": "myvm/ghsrc", "id": "54125fb13c5023a1a5c0af4e9b88356b996eccea", "size": "52629", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Gruntfile.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "188552" }, { "name": "JavaScript", "bytes": "1876492" }, { "name": "XSLT", "bytes": "7177" } ], "symlink_target": "" }
package org.optaplanner.examples.tennis.domain; import org.optaplanner.core.api.domain.entity.PlanningEntity; import org.optaplanner.core.api.domain.entity.PlanningPin; import org.optaplanner.core.api.domain.variable.PlanningVariable; import org.optaplanner.examples.common.domain.AbstractPersistable; import com.thoughtworks.xstream.annotations.XStreamAlias; @PlanningEntity() @XStreamAlias("TennisTeamAssignment") public class TeamAssignment extends AbstractPersistable { private Day day; private int indexInDay; private boolean pinned; // planning variable private Team team; public TeamAssignment() { } public TeamAssignment(long id, Day day, int indexInDay) { super(id); this.day = day; this.indexInDay = indexInDay; } public Day getDay() { return day; } public void setDay(Day day) { this.day = day; } public int getIndexInDay() { return indexInDay; } public void setIndexInDay(int indexInDay) { this.indexInDay = indexInDay; } @PlanningPin public boolean isPinned() { return pinned; } public void setPinned(boolean pinned) { this.pinned = pinned; } @PlanningVariable(valueRangeProviderRefs = { "teamRange" }) public Team getTeam() { return team; } public void setTeam(Team team) { this.team = team; } @Override public String toString() { return "Day-" + day.getDateIndex() + "(" + indexInDay + ")"; } }
{ "content_hash": "4dc91b28abc1efe35610188bb84788a0", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 68, "avg_line_length": 22.36231884057971, "alnum_prop": 0.6591056383668179, "repo_name": "tkobayas/optaplanner", "id": "231ad3cef6452cf07a3a2350a86a85fa84eb9c52", "size": "1543", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "optaplanner-examples/src/main/java/org/optaplanner/examples/tennis/domain/TeamAssignment.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "2540" }, { "name": "CSS", "bytes": "32771" }, { "name": "FreeMarker", "bytes": "116587" }, { "name": "Groovy", "bytes": "20273" }, { "name": "HTML", "bytes": "3966" }, { "name": "Java", "bytes": "11961620" }, { "name": "JavaScript", "bytes": "304742" }, { "name": "Shell", "bytes": "5984" }, { "name": "XSLT", "bytes": "775" } ], "symlink_target": "" }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "8e8a6144168d36129405e56801eb0c2b", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "65f590b3ffab790e0e80b7cadad6878b2fe1942c", "size": "166", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Gentianales/Rubiaceae/Otocalyx/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
import com.bya.remote.HelloWorld; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.remoting.caucho.HessianProxyFactoryBean; /** * Created by bqct_bya on 2017/6/11. */ public class App { public static void main(String[] args) { try { ApplicationContext app= new ClassPathXmlApplicationContext("classpath:spring-application.xml"); // HessianProxyFactoryBean hessionService= (HessianProxyFactoryBean) app.getBean("helloService"); // "helloService",HessianProxyFactoryBean.class HelloWorld helloWorld=(HelloWorld) app.getBean("helloService"); helloWorld.sayHello("baozi"); }catch (Exception e){ e.printStackTrace(); } } }
{ "content_hash": "9d03c03d52aec20cee291194ff2a673d", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 104, "avg_line_length": 35.608695652173914, "alnum_prop": 0.7191697191697192, "repo_name": "baoyongan/java-examples", "id": "dc1a38b1d099f06df44f86942dbde56e853b1c05", "size": "819", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "java-eg-hession-client/src/main/java/App.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "424" }, { "name": "Java", "bytes": "834962" } ], "symlink_target": "" }
// Copyright 2007 The Closure Library Authors. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS-IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. /** * @fileoverview Gauge UI component, using browser vector graphics. * @see ../demos/gauge.html */ goog.provide('goog.ui.Gauge'); goog.provide('goog.ui.GaugeColoredRange'); goog.require('goog.dom'); goog.require('goog.dom.a11y'); goog.require('goog.fx.Animation'); goog.require('goog.fx.easing'); goog.require('goog.graphics'); goog.require('goog.graphics.Font'); goog.require('goog.graphics.SolidFill'); goog.require('goog.ui.Component'); goog.require('goog.ui.GaugeTheme'); /** * Information on how to decorate a range in the gauge. * This is an internal-only class. * @param {number} fromValue The range start (minimal) value. * @param {number} toValue The range end (maximal) value. * @param {string} backgroundColor Color to fill the range background with. * @constructor */ goog.ui.GaugeColoredRange = function(fromValue, toValue, backgroundColor) { /** * The range start (minimal) value. * @type {number} */ this.fromValue = fromValue; /** * The range end (maximal) value. * @type {number} */ this.toValue = toValue; /** * Color to fill the range background with. * @type {string} */ this.backgroundColor = backgroundColor; }; /** * A UI component that displays a gauge. * A gauge displayes a current value within a round axis that represents a * given range. * The gauge is built from an external border, and internal border inside it, * ticks and labels inside the internal border, and a needle that points to * the current value. * @param {number} width The width in pixels. * @param {number} height The height in pixels. * @param {goog.dom.DomHelper=} opt_domHelper The DOM helper object for the * document we want to render in. * @constructor * @extends {goog.ui.Component} */ goog.ui.Gauge = function(width, height, opt_domHelper) { goog.ui.Component.call(this, opt_domHelper); /** * The width in pixels of this component. * @type {number} * @private */ this.width_ = width; /** * The height in pixels of this component. * @type {number} * @private */ this.height_ = height; /** * The underlying graphics. * @type {goog.graphics.AbstractGraphics} * @private */ this.graphics_ = goog.graphics.createGraphics(width, height, null, null, opt_domHelper); /** * Colors to paint the background of certain ranges (optional). * @type {Array.<goog.ui.GaugeColoredRange>} * @private */ this.rangeColors_ = []; }; goog.inherits(goog.ui.Gauge, goog.ui.Component); /** * Constant for a background color for a gauge area. */ goog.ui.Gauge.RED = '#ffc0c0'; /** * Constant for a background color for a gauge area. */ goog.ui.Gauge.GREEN = '#c0ffc0'; /** * Constant for a background color for a gauge area. */ goog.ui.Gauge.YELLOW = '#ffffa0'; /** * The radius of the entire gauge from the canvas size. * @type {number} */ goog.ui.Gauge.FACTOR_RADIUS_FROM_SIZE = 0.45; /** * The ratio of internal gauge radius from entire radius. * The remaining area is the border around the gauge. * @type {number} */ goog.ui.Gauge.FACTOR_MAIN_AREA = 0.9; /** * The ratio of the colored background area for value ranges. * The colored area width is computed as * InternalRadius * (1 - FACTOR_COLOR_RADIUS) * @type {number} */ goog.ui.Gauge.FACTOR_COLOR_RADIUS = 0.75; /** * The ratio of the major ticks length start position, from the radius. * The major ticks length width is computed as * InternalRadius * (1 - FACTOR_MAJOR_TICKS) * @type {number} */ goog.ui.Gauge.FACTOR_MAJOR_TICKS = 0.8; /** * The ratio of the minor ticks length start position, from the radius. * The minor ticks length width is computed as * InternalRadius * (1 - FACTOR_MINOR_TICKS) * @type {number} */ goog.ui.Gauge.FACTOR_MINOR_TICKS = 0.9; /** * The length of the needle front (value facing) from the internal radius. * The needle front is the part of the needle that points to the value. * @type {number} */ goog.ui.Gauge.FACTOR_NEEDLE_FRONT = 0.95; /** * The length of the needle back relative to the internal radius. * The needle back is the part of the needle that points away from the value. * @type {number} */ goog.ui.Gauge.FACTOR_NEEDLE_BACK = 0.3; /** * The width of the needle front at the hinge. * This is the width of the curve control point, the actual width is * computed by the curve itself. * @type {number} */ goog.ui.Gauge.FACTOR_NEEDLE_WIDTH = 0.07; /** * The width (radius) of the needle hinge from the gauge radius. * @type {number} */ goog.ui.Gauge.FACTOR_NEEDLE_HINGE = 0.15; /** * The title font size (height) for titles relative to the internal radius. * @type {number} */ goog.ui.Gauge.FACTOR_TITLE_FONT_SIZE = 0.16; /** * The offset of the title from the center, relative to the internal radius. * @type {number} */ goog.ui.Gauge.FACTOR_TITLE_OFFSET = 0.35; /** * The formatted value font size (height) relative to the internal radius. * @type {number} */ goog.ui.Gauge.FACTOR_VALUE_FONT_SIZE = 0.18; /** * The title font size (height) for tick labels relative to the internal radius. * @type {number} */ goog.ui.Gauge.FACTOR_TICK_LABEL_FONT_SIZE = 0.14; /** * The offset of the formatted value down from the center, relative to the * internal radius. * @type {number} */ goog.ui.Gauge.FACTOR_VALUE_OFFSET = 0.75; /** * The font name for title text. * @type {string} */ goog.ui.Gauge.TITLE_FONT_NAME = 'arial'; /** * The maximal size of a step the needle can move (percent from size of range). * If the needle needs to move more, it will be moved in animated steps, to * show a smooth transition between values. * @type {number} */ goog.ui.Gauge.NEEDLE_MOVE_MAX_STEP = 0.02; /** * Time in miliseconds for animating a move of the value pointer. * @type {number} */ goog.ui.Gauge.NEEDLE_MOVE_TIME = 400; /** * Tolerance factor for how much values can exceed the range (being too * low or too high). The value is presented as a position (percentage). * @type {number} */ goog.ui.Gauge.MAX_EXCEED_POSITION_POSITION = 0.02; /** * The minimal value that can be displayed. * @private * @type {number} */ goog.ui.Gauge.prototype.minValue_ = 0; /** * The maximal value that can be displayed. * @private * @type {number} */ goog.ui.Gauge.prototype.maxValue_ = 100; /** * The number of major tick sections. * @private * @type {number} */ goog.ui.Gauge.prototype.majorTicks_ = 5; /** * The number of minor tick sections in each major tick section. * @private * @type {number} */ goog.ui.Gauge.prototype.minorTicks_ = 2; /** * The current value that needs to be displayed in the gauge. * @private * @type {number} */ goog.ui.Gauge.prototype.value_ = 0; /** * The current value formatted into a String. * @private * @type {?string} */ goog.ui.Gauge.prototype.formattedValue_ = null; /** * The current colors theme. * @private * @type {goog.ui.GaugeTheme?} */ goog.ui.Gauge.prototype.theme_ = null; /** * Title to display above the gauge center. * @private * @type {?string} */ goog.ui.Gauge.prototype.titleTop_ = null; /** * Title to display below the gauge center. * @private * @type {?string} */ goog.ui.Gauge.prototype.titleBottom_ = null; /** * Font to use for drawing titles. * If null (default), computed dynamically with a size relative to the * gauge radius. * @private * @type {goog.graphics.Font?} */ goog.ui.Gauge.prototype.titleFont_ = null; /** * Font to use for drawing the formatted value. * If null (default), computed dynamically with a size relative to the * gauge radius. * @private * @type {goog.graphics.Font?} */ goog.ui.Gauge.prototype.valueFont_ = null; /** * Font to use for drawing tick labels. * If null (default), computed dynamically with a size relative to the * gauge radius. * @private * @type {goog.graphics.Font?} */ goog.ui.Gauge.prototype.tickLabelFont_ = null; /** * The size in angles of the gauge axis area. * @private * @type {number} */ goog.ui.Gauge.prototype.angleSpan_ = 270; /** * The radius for drawing the needle. * Computed on full redraw, and used on every animation step of moving * the needle. * @type {number} * @private */ goog.ui.Gauge.prototype.needleRadius_ = 0; /** * The group elemnt of the needle. Contains all elements that change when the * gauge value changes. * @type {goog.graphics.GroupElement?} * @private */ goog.ui.Gauge.prototype.needleGroup_ = null; /** * The current position (0-1) of the visible needle. * Initially set to null to prevent animation on first opening of the gauge. * @type {?number} * @private */ goog.ui.Gauge.prototype.needleValuePosition_ = null; /** * Text labels to display by major tick marks. * @type {Array.<string>?} * @private */ goog.ui.Gauge.prototype.majorTickLabels_ = null; /** * Animation object while needle is being moved (animated). * @type {goog.fx.Animation?} * @private */ goog.ui.Gauge.prototype.animation_ = null; /** * @return {number} The minimum value of the range. */ goog.ui.Gauge.prototype.getMinimum = function() { return this.minValue_; }; /** * Sets the minimum value of the range * @param {number} min The minimum value of the range. */ goog.ui.Gauge.prototype.setMinimum = function(min) { this.minValue_ = min; if (this.getElement()) { goog.dom.a11y.setState(this.getElement(), 'valuemin', min); } }; /** * @return {number} The maximum value of the range. */ goog.ui.Gauge.prototype.getMaximum = function() { return this.maxValue_; }; /** * Sets the maximum number of the range * @param {number} max The maximum value of the range. */ goog.ui.Gauge.prototype.setMaximum = function(max) { this.maxValue_ = max; if (this.getElement()) { goog.dom.a11y.setState(this.getElement(), 'valuemax', max); } }; /** * Sets the current value range displayed by the gauge. * @param {number} value The current value for the gauge. This value * determines the position of the needle of the gauge. * @param {string=} opt_formattedValue The string value to show in the gauge. * If not specified, no string value will be displayed. */ goog.ui.Gauge.prototype.setValue = function(value, opt_formattedValue) { this.value_ = value; this.formattedValue_ = opt_formattedValue || null; this.stopAnimation_(); // Stop the active animation if exists // Compute desired value position (normalize value to range 0-1) var valuePosition = this.valueToRangePosition_(value); if (this.needleValuePosition_ == null) { // No animation on initial display this.needleValuePosition_ = valuePosition; this.drawValue_(); } else { // Animate move this.animation_ = new goog.fx.Animation([this.needleValuePosition_], [valuePosition], goog.ui.Gauge.NEEDLE_MOVE_TIME, goog.fx.easing.inAndOut); var events = [goog.fx.Animation.EventType.BEGIN, goog.fx.Animation.EventType.ANIMATE, goog.fx.Animation.EventType.END]; goog.events.listen(this.animation_, events, this.onAnimate_, false, this); goog.events.listen(this.animation_, goog.fx.Animation.EventType.END, this.onAnimateEnd_, false, this); // Start animation this.animation_.play(false); } if (this.getElement()) { goog.dom.a11y.setState(this.getElement(), 'valuenow', this.value_); } }; /** * Sets the number of major tick sections and minor tick sections. * @param {number} majorUnits The number of major tick sections. * @param {number} minorUnits The number of minor tick sections for each major * tick section. */ goog.ui.Gauge.prototype.setTicks = function(majorUnits, minorUnits) { this.majorTicks_ = Math.max(1, majorUnits); this.minorTicks_ = Math.max(1, minorUnits); this.draw_(); }; /** * Sets the labels of the major ticks. * @param {Array.<string>} tickLabels A text label for each major tick value. */ goog.ui.Gauge.prototype.setMajorTickLabels = function(tickLabels) { this.majorTickLabels_ = tickLabels; this.draw_(); }; /** * Sets the top title of the gauge. * The top title is displayed above the center. * @param {string} text The top title text. */ goog.ui.Gauge.prototype.setTitleTop = function(text) { this.titleTop_ = text; this.draw_(); }; /** * Sets the bottom title of the gauge. * The top title is displayed below the center. * @param {string} text The bottom title text. */ goog.ui.Gauge.prototype.setTitleBottom = function(text) { this.titleBottom_ = text; this.draw_(); }; /** * Sets the font for displaying top and bottom titles. * @param {goog.graphics.Font} font The font for titles. */ goog.ui.Gauge.prototype.setTitleFont = function(font) { this.titleFont_ = font; this.draw_(); }; /** * Sets the font for displaying the formatted value. * @param {goog.graphics.Font} font The font for displaying the value. */ goog.ui.Gauge.prototype.setValueFont = function(font) { this.valueFont_ = font; this.drawValue_(); }; /** * Sets the color theme for drawing the gauge. * @param {goog.ui.GaugeTheme} theme The color theme to use. */ goog.ui.Gauge.prototype.setTheme = function(theme) { this.theme_ = theme; this.draw_(); }; /** * Set the background color for a range of values on the gauge. * @param {number} fromValue The lower (start) value of the colored range. * @param {number} toValue The higher (end) value of the colored range. * @param {string} color The color name to paint the range with. For example * 'red', '#ffcc00' or constants like goog.ui.Gauge.RED. */ goog.ui.Gauge.prototype.addBackgroundColor = function(fromValue, toValue, color) { this.rangeColors_.push( new goog.ui.GaugeColoredRange(fromValue, toValue, color)); this.draw_(); }; /** * Creates the DOM representation of the graphics area. */ goog.ui.Gauge.prototype.createDom = function() { this.setElementInternal(this.getDomHelper().createDom( 'div', goog.getCssName('goog-gauge'), this.graphics_.getElement())); }; /** * Clears the entire graphics area. * @private */ goog.ui.Gauge.prototype.clear_ = function() { this.graphics_.clear(); this.needleGroup_ = null; }; /** * Redraw the entire gauge. * @private */ goog.ui.Gauge.prototype.draw_ = function() { if (!this.isInDocument()) { return; } this.clear_(); var x, y; var size = Math.min(this.width_, this.height_); var r = Math.round(goog.ui.Gauge.FACTOR_RADIUS_FROM_SIZE * size); var cx = this.width_ / 2; var cy = this.height_ / 2; var theme = this.theme_; if (!theme) { // Lazy allocation of default theme, common to all instances theme = goog.ui.Gauge.prototype.theme_ = new goog.ui.GaugeTheme(); } // Draw main circle frame around gauge var graphics = this.graphics_; var stroke = this.theme_.getExternalBorderStroke(); var fill = theme.getExternalBorderFill(cx, cy, r); graphics.drawCircle(cx, cy, r, stroke, fill); r -= stroke.getWidth(); r = Math.round(r * goog.ui.Gauge.FACTOR_MAIN_AREA); stroke = theme.getInternalBorderStroke(); fill = theme.getInternalBorderFill(cx, cy, r); graphics.drawCircle(cx, cy, r, stroke, fill); r -= stroke.getWidth() * 2; // Draw Background with external and internal borders var rBackgroundInternal = r * goog.ui.Gauge.FACTOR_COLOR_RADIUS; for (var i = 0; i < this.rangeColors_.length; i++) { var rangeColor = this.rangeColors_[i]; var fromValue = rangeColor.fromValue; var toValue = rangeColor.toValue; var path = graphics.createPath(); var fromAngle = this.valueToAngle_(fromValue); var toAngle = this.valueToAngle_(toValue); path.arc(cx, cy, r, r, fromAngle, toAngle - fromAngle, false); path.arc(cx, cy, rBackgroundInternal, rBackgroundInternal, toAngle, fromAngle - toAngle, true); path.close(); fill = new goog.graphics.SolidFill(rangeColor.backgroundColor); graphics.drawPath(path, null, fill); } // Draw titles if (this.titleTop_ || this.titleBottom_) { var font = this.titleFont_; if (!font) { // Lazy creation of font var fontSize = Math.round(r * goog.ui.Gauge.FACTOR_TITLE_FONT_SIZE); font = new goog.graphics.Font( fontSize, goog.ui.Gauge.TITLE_FONT_NAME); this.titleFont_ = font; } fill = new goog.graphics.SolidFill(theme.getTitleColor()); if (this.titleTop_) { y = cy - Math.round(r * goog.ui.Gauge.FACTOR_TITLE_OFFSET); graphics.drawTextOnLine(this.titleTop_, 0, y, this.width_, y, 'center', font, null, fill); } if (this.titleBottom_) { y = cy + Math.round(r * goog.ui.Gauge.FACTOR_TITLE_OFFSET); graphics.drawTextOnLine(this.titleBottom_, 0, y, this.width_, y, 'center', font, null, fill); } } // Draw tick marks var majorTicks = this.majorTicks_; var minorTicks = this.minorTicks_; var rMajorTickInternal = r * goog.ui.Gauge.FACTOR_MAJOR_TICKS; var rMinorTickInternal = r * goog.ui.Gauge.FACTOR_MINOR_TICKS; var ticks = majorTicks * minorTicks; var valueRange = this.maxValue_ - this.minValue_; var tickValueSpan = valueRange / ticks; var majorTicksPath = graphics.createPath(); var minorTicksPath = graphics.createPath(); var tickLabelFill = new goog.graphics.SolidFill(theme.getTickLabelColor()); var tickLabelFont = this.tickLabelFont_; if (!tickLabelFont) { tickLabelFont = new goog.graphics.Font( Math.round(r * goog.ui.Gauge.FACTOR_TICK_LABEL_FONT_SIZE), goog.ui.Gauge.TITLE_FONT_NAME); } var tickLabelFontSize = tickLabelFont.size; for (var i = 0; i <= ticks; i++) { var angle = this.valueToAngle_(i * tickValueSpan + this.minValue_); var isMajorTick = i % minorTicks == 0; var rInternal = isMajorTick ? rMajorTickInternal : rMinorTickInternal; var path = isMajorTick ? majorTicksPath : minorTicksPath; x = cx + goog.math.angleDx(angle, rInternal); y = cy + goog.math.angleDy(angle, rInternal); path.moveTo(x, y); x = cx + goog.math.angleDx(angle, r); y = cy + goog.math.angleDy(angle, r); path.lineTo(x, y); // Draw the tick's label for major ticks if (isMajorTick && this.majorTickLabels_) { var tickIndex = Math.floor(i / minorTicks); var label = this.majorTickLabels_[tickIndex]; if (label) { x = cx + goog.math.angleDx(angle, rInternal - tickLabelFontSize / 2); y = cy + goog.math.angleDy(angle, rInternal - tickLabelFontSize / 2); var x1, x2; var align = 'center'; if (angle > 280 || angle < 90) { align = 'right'; x1 = 0; x2 = x; } else if (angle >= 90 && angle < 260) { align = 'left'; x1 = x; x2 = this.width_; } else { // Values around top (angle 260-280) are centered around point var dw = Math.min(x, this.width_ - x); // Nearest side border x1 = x - dw; x2 = x + dw; y += Math.round(tickLabelFontSize / 4); // Movea bit down } graphics.drawTextOnLine(label, x1, y, x2, y, align, tickLabelFont, null, tickLabelFill); } } } stroke = theme.getMinorTickStroke(); graphics.drawPath(minorTicksPath, stroke, null); stroke = theme.getMajorTickStroke(); graphics.drawPath(majorTicksPath, stroke, null); // Draw the needle and the value label. Stop animation when doing // full redraw and jump to the final value position. this.stopAnimation_(); this.valuePosition_ = this.valueToRangePosition_(this.value); this.needleRadius_ = r; this.drawValue_(); }; /** * Handle animation events while the hand is moving. * @param {goog.fx.AnimationEvent} e The event. * @private */ goog.ui.Gauge.prototype.onAnimate_ = function(e) { this.needleValuePosition_ = e.x; this.drawValue_(); }; /** * Handle animation events when hand move is complete. * @private */ goog.ui.Gauge.prototype.onAnimateEnd_ = function() { this.stopAnimation_(); }; /** * Stop the current animation, if it is active. * @private */ goog.ui.Gauge.prototype.stopAnimation_ = function() { if (this.animation_) { goog.events.removeAll(this.animation_); this.animation_.stop(false); this.animation_ = null; } }; /** * Convert a value to the position in the range. The returned position * is a value between 0 and 1, where 0 indicates the lowest range value, * 1 is the highest range, and any value in between is proportional * to mapping the range to (0-1). * If the value is not within the range, the returned value may be a bit * lower than 0, or a bit higher than 1. This is done so that values out * of range will be displayed just a bit outside of the gauge axis. * @param {number} value The value to convert. * @private * @return {number} The range position. */ goog.ui.Gauge.prototype.valueToRangePosition_ = function(value) { var valueRange = this.maxValue_ - this.minValue_; var valuePct = (value - this.minValue_) / valueRange; // 0 to 1 // If value is out of range, trim it not to be too much out of range valuePct = Math.max(valuePct, -goog.ui.Gauge.MAX_EXCEED_POSITION_POSITION); valuePct = Math.min(valuePct, 1 + goog.ui.Gauge.MAX_EXCEED_POSITION_POSITION); return valuePct; }; /** * Convert a value to an angle based on the value range and angle span * @param {number} value The value. * @return {number} The angle where this value is located on the round * axis, based on the range and angle span. * @private */ goog.ui.Gauge.prototype.valueToAngle_ = function(value) { var valuePct = this.valueToRangePosition_(value); return this.valuePositionToAngle_(valuePct); }; /** * Convert a value-position (percent in the range) to an angle based on * the angle span. A value-position is a value that has been proportinally * adjusted to a value betwwen 0-1, proportionaly to the range. * @param {number} valuePct The value. * @return {number} The angle where this value is located on the round * axis, based on the range and angle span. * @private */ goog.ui.Gauge.prototype.valuePositionToAngle_ = function(valuePct) { var startAngle = goog.math.standardAngle((360 - this.angleSpan_) / 2 + 90); return this.angleSpan_ * valuePct + startAngle; }; /** * Draw the elements that depend on the current value (the needle and * the formatted value). This function is called whenever a value is changed * or when the entire gauge is redrawn. * @private */ goog.ui.Gauge.prototype.drawValue_ = function() { if (!this.isInDocument()) { return; } var r = this.needleRadius_; var graphics = this.graphics_; var theme = this.theme_; var cx = this.width_ / 2; var cy = this.height_ / 2; var angle = this.valuePositionToAngle_( /** @type {number} */(this.needleValuePosition_)); // Compute the needle path var frontRadius = Math.round(r * goog.ui.Gauge.FACTOR_NEEDLE_FRONT); var backRadius = Math.round(r * goog.ui.Gauge.FACTOR_NEEDLE_BACK); var frontDx = goog.math.angleDx(angle, frontRadius); var frontDy = goog.math.angleDy(angle, frontRadius); var backDx = goog.math.angleDx(angle, backRadius); var backDy = goog.math.angleDy(angle, backRadius); var angleRight = goog.math.standardAngle(angle + 90); var distanceControlPointBase = r * goog.ui.Gauge.FACTOR_NEEDLE_WIDTH; var controlPointMidDx = goog.math.angleDx(angleRight, distanceControlPointBase); var controlPointMidDy = goog.math.angleDy(angleRight, distanceControlPointBase); var path = graphics.createPath(); path.moveTo(cx + frontDx, cy + frontDy); path.curveTo(cx + controlPointMidDx, cy + controlPointMidDy, cx - backDx + (controlPointMidDx / 2), cy - backDy + (controlPointMidDy / 2), cx - backDx, cy - backDy); path.curveTo(cx - backDx - (controlPointMidDx / 2), cy - backDy - (controlPointMidDy / 2), cx - controlPointMidDx, cy - controlPointMidDy, cx + frontDx, cy + frontDy); // Draw the needle hinge var rh = Math.round(r * goog.ui.Gauge.FACTOR_NEEDLE_HINGE); // Clean previous needle var needleGroup = this.needleGroup_; if (needleGroup) { needleGroup.clear(); } else { needleGroup = this.needleGroup_ = graphics.createGroup(); } // Draw current formatted value if provided. if (this.formattedValue_) { var font = this.valueFont_; if (!font) { var fontSize = Math.round(r * goog.ui.Gauge.FACTOR_VALUE_FONT_SIZE); font = new goog.graphics.Font(fontSize, goog.ui.Gauge.TITLE_FONT_NAME); font.bold = true; this.valueFont_ = font; } var fill = new goog.graphics.SolidFill(theme.getValueColor()); var y = cy + Math.round(r * goog.ui.Gauge.FACTOR_VALUE_OFFSET); graphics.drawTextOnLine(this.formattedValue_, 0, y, this.width_, y, 'center', font, null, fill, needleGroup); } // Draw the needle var stroke = theme.getNeedleStroke(); var fill = theme.getNeedleFill(cx, cy, rh); graphics.drawPath(path, stroke, fill, needleGroup); stroke = theme.getHingeStroke(); fill = theme.getHingeFill(cx, cy, rh); graphics.drawCircle(cx, cy, rh, stroke, fill, needleGroup); }; /** * Redraws the entire gauge. * Should be called after theme colors have been changed. */ goog.ui.Gauge.prototype.redraw = function() { this.draw_(); }; /** * Called when the component is added to the DOM. * Overrides {@link goog.ui.Component#enterDocument}. */ goog.ui.Gauge.prototype.enterDocument = function() { goog.ui.Gauge.superClass_.enterDocument.call(this); // set roles and states var el = this.getElement(); goog.dom.a11y.setRole(el, 'progressbar'); goog.dom.a11y.setState(el, 'live', 'polite'); goog.dom.a11y.setState(el, 'valuemin', this.minValue_); goog.dom.a11y.setState(el, 'valuemax', this.maxValue_); goog.dom.a11y.setState(el, 'valuenow', this.value_); this.draw_(); }; /** * Called when the component is removed from the DOM. * Overrides {@link goog.ui.Component#exitDocument}. */ goog.ui.Gauge.prototype.exitDocument = function() { goog.ui.Gauge.superClass_.exitDocument.call(this); this.stopAnimation_(); }; /** @inheritDoc */ goog.ui.Gauge.prototype.disposeInternal = function() { this.stopAnimation_(); this.graphics_.dispose(); delete this.graphics_; delete this.needleGroup_; delete this.theme_; delete this.rangeColors_; goog.ui.Gauge.superClass_.disposeInternal.call(this); };
{ "content_hash": "c89ad80811d7ae2e434fa664d7ba5d71", "timestamp": "", "source": "github", "line_count": 997, "max_line_length": 80, "avg_line_length": 27.155466399197593, "alnum_prop": 0.6755558838738273, "repo_name": "olegshnitko/closure-library", "id": "dc845bd856070627036a810b5c8d27e697d0f454", "size": "27074", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "closure/goog/ui/gauge.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "JavaScript", "bytes": "8206753" }, { "name": "Python", "bytes": "56838" } ], "symlink_target": "" }
using namespace std; char TextFile::buffer[MAX]; char *MESSAGE_READY = "Welcome to TextBuddy. %s is ready for use.\n"; char *TEXT_LINE = "%d. %s\n"; char *TEXT_LINE_SELF_INDEX = "%s\n"; TextFile::TextFile(void) { } TextFile::~TextFile(void) { } // getters // ----------------------------- string TextFile::name() const { return fileName; } string TextFile::getTextAtRow(int _row) const { return texts[_row - 1]; } int TextFile::size() const { return texts.size(); } vector<string> TextFile::getTexts() { return texts; } vector<string> TextFile::getPositiveSearch() { return listOfSearchPositives; } // vector<string> (texts) manipulation // ----------------------------- void TextFile::addNew(string input) { texts.push_back(input); //appendLastRowToFile(); } void TextFile::removeRow(int row) { vector<string>::iterator requestedRow = texts.begin(); for (int i = 0; i < row - 1; ++i, ++requestedRow) {}; texts.erase(requestedRow); saveTextToFile(); } void TextFile::clearText() { texts.clear(); saveTextToFile(); } void TextFile::sortRowsAlphabetically() { sort(texts.begin(), texts.end()); } void TextFile::searchFor(string input) { listOfSearchPositives.clear(); for (int i = 1; i <= (int)texts.size(); ++i) { string textInThisRow = texts[i - 1]; if (textDoesContainInput(textInThisRow, input)) { string textInThisRowWithIndex = to_string(i) + ". " + textInThisRow; listOfSearchPositives.push_back(textInThisRowWithIndex); } } displayBySelfIndexing(&listOfSearchPositives); } // fstream (file) manipulation // ---------------------------- void TextFile::willBeNamed(char* inputFile) { fileName = inputFile; clearText(); announceTextFileReadyWithName(fileName); } void TextFile::saveTextToFile() { file.open(fileName, ios::trunc); for (int row = 1; row <= (int)texts.size(); ++row) { sprintf_s(buffer, TEXT_LINE, row, texts[row - 1].c_str()); file << (string)buffer; } file.close(); } void TextFile::appendLastRowToFile() { file.open(fileName, ios::app); int row = texts.size(); sprintf_s(buffer, TEXT_LINE, row, texts[row - 1].c_str()); file << (string)buffer; file.close(); } void TextFile::display(){ for (int row = 1; row <= (int)texts.size(); ++row) { sprintf_s(buffer, TEXT_LINE, row, texts[row - 1].c_str()); cout << (string)buffer; } } void TextFile::displayBySelfIndexing(vector<string>* texts) { for (int row = 1; row <= (int)texts->size(); ++row) { sprintf_s(buffer, TEXT_LINE_SELF_INDEX, texts->at(row - 1).c_str()); cout << (string)buffer; } } // confirm message void TextFile::announceTextFileReadyWithName(string fileName) const { sprintf_s(buffer, MESSAGE_READY, fileName.c_str()); cout << (string)buffer; } // Others bool TextFile::textDoesContainInput(string text, string input) { int searchValue = text.find(input); if (searchValue < 0) { return false; } return true; }
{ "content_hash": "9822dbc9508f083d392d7935acd509f3", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 71, "avg_line_length": 22.022900763358777, "alnum_prop": 0.6582322357019064, "repo_name": "jjwujiajun/TextBuddy-TodoList", "id": "c432cd978afc810281c69f8d4f4c9523fdfcc352", "size": "3046", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "TextBuddy/TextFile.cpp", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
/** * @file * Defines message handling functions. */ /* Purpose: (Contains functions that can be used for error handling within the Chup Comm System.) */ #ifndef MESSAGE_HANDLER_HH #define MESSAGE_HANDLER_HH // System includes #include <cstdarg> /** * Contains free functions pertaining to handling messages of * various levels of severity. */ namespace MessageHandler { /** * Terminate due to some fatal error. * Note that this is a variable arguments function ala printf. * The format parameter specifies the format. Subsequent arguments * specify the content. * @param file The source file in which the error occurred, * typically \_\_FILE\_\_ * @param line The line number at which the error occurred, * typically \_\_LINE\_\_ * @param msg_code Message ID * @param format Message format */ void fail ( const char * file, unsigned int line, const char * msg_code, const char * format, ...); /** * Indicate that a serious but non-fatal error has occurred. * Note that this is a variable arguments function ala printf. * The format parameter specifies the format. Subsequent arguments * specify the content. * @param file The source file in which the error occurred, * typically \_\_FILE\_\_ * @param line The line number at which the error occurred, * typically \_\_LINE\_\_ * @param msg_code Message ID * @param format Message format */ void error ( const char * file, unsigned int line, const char * msg_code, const char * format, ...); /** * Indicate that a lesser problem has occurred. * Note that this is a variable arguments function ala printf. * The format parameter specifies the format. Subsequent arguments * specify the content. * @param file The source file in which the error occurred, * typically \_\_FILE\_\_ * @param line The line number at which the error occurred, * typically \_\_LINE\_\_ * @param msg_code Message ID * @param format Message format */ void warn ( const char * file, unsigned int line, const char * msg_code, const char * format, ...); } #endif
{ "content_hash": "501100e2562b26b9e36a5c7cdf1a182f", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 80, "avg_line_length": 28.839506172839506, "alnum_prop": 0.6185787671232876, "repo_name": "mike-moore/ProtobuffSerial", "id": "b7f5cb30a13a331d0e63ab636c3c0f963d6086a0", "size": "2336", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "rcvr/MessageHandler.h", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "435" }, { "name": "C", "bytes": "102406" }, { "name": "C++", "bytes": "94231" }, { "name": "CMake", "bytes": "10024" }, { "name": "Makefile", "bytes": "2934" }, { "name": "Protocol Buffer", "bytes": "40629" }, { "name": "Python", "bytes": "63285" }, { "name": "Shell", "bytes": "456" } ], "symlink_target": "" }
function CBIG_VonmisesSeriesClustering_fix_bessel_randnum_bsxfun(mesh_name, mask, num_clusters, output_file, profile1, profile2, num_smooth, num_tries, normalize, max_iter, no_silhouette) % CBIG_VonmisesSeriesClustering_fix_bessel_randnum_bsxfun(mesh_name, mask, num_clusters, output_file, profile1, profile2, num_smooth, num_tries, normalize, max_iter) % % Von Mises-Fisher clustering on surface data. % % Input arguments: % - mesh_name : e.g. 'fsaverage5' % - mask : e.g. 'cortex' if mesh_name is 'fsaverage*'; % otherwise, pass in empty string or 'NONE' % - num_clusters : number of clusters % - output_file : output file name % - profile1 : group average profile on left hemisphere for data in % fsaverage* space; % or group average profile on entire % cortex for data in fs_LR_32k space. % - profile2 : group average profile on right hemisphere for data % in fsaverage* space; % it is not useful for data in fs_LR_32k space. You % can pass in empty string or 'NONE'. % - num_smooth : how many times that smoothing is performed. It is % only used when mesh_name is 'fsaverage*' % - num_tries : number of difference random initialization % - normailize : 0 or 1, whether z-normalization is performed across vertices % - max_iter : maximum number of iterations for one random initialization % - no_silhouette : if 1 is passed in for this flag, silhouette step % will be skipped. Default is 0, meaning silhouette % step will be performed when num_clusters>1 and data % are in fsaverage* space. % % Written by CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md if(~isempty(strfind(mesh_name, 'fsaverage'))) lambda = 500; % function direcClus_fix_bessel_bxfun() treats 0 as not specified, lambda will be set as its default (500) elseif(strcmp(mesh_name, 'fs_LR_32k')) lambda = 650; % For data in fs_LR_32k space, lambda is set to be 650 else error('Unknown mesh name.') end if(~exist('max_iter', 'var')) max_iter = 100; else if(ischar(max_iter)) max_iter = str2num(max_iter); end end if(~exist('no_silhouette', 'var')) no_silhouette = 0; % silouette step will be performed end % % We (Hesheng, Mert, Jorge and I) decided that random initialization can be same across groups of subjects. % rand('twister',5489) if(ischar(normalize)) normalize = str2num(normalize); end if(ischar(num_clusters)) num_clusters = str2num(num_clusters); end if(ischar(num_tries)) num_tries = str2num(num_tries); end if(ischar(num_smooth)) num_smooth = str2num(num_smooth); end % read mask if(~isempty(strfind(mesh_name, 'fsaverage'))) lh_avg_mesh = CBIG_ReadNCAvgMesh('lh', mesh_name, 'inflated', mask); l1 = find(lh_avg_mesh.MARS_label == 2); lh_num_verts = size(lh_avg_mesh.vertices, 2); rh_avg_mesh = CBIG_ReadNCAvgMesh('rh', mesh_name, 'inflated', mask); l2 = find(rh_avg_mesh.MARS_label == 2); rh_num_verts = size(rh_avg_mesh.vertices, 2); l = [l1 l2+length(lh_avg_mesh.MARS_label)]; else % mesh.l: 0 - medial wall, 1 - cortex [mesh.v, mesh.l, mesh.ct] = read_annotation(fullfile(getenv('CBIG_CODE_DIR'), 'data', 'templates', 'surface', 'fs_LR_32k', 'label', 'medialwall.annot')); lh_num_verts = length(mesh.l) / 2; rh_num_verts = lh_num_verts; cort_label = mesh.ct.table(2, 5); l1 = 1:lh_num_verts; l1 = l1(mesh.l(l1)==cort_label); l2 = 1:rh_num_verts; l2 = l2(mesh.l(l2+lh_num_verts)==cort_label); l = [l1 l2+lh_num_verts]; end % read data (voxels x N subjects) series = read_fmri(profile1); if(~isempty(strfind(mesh_name, 'fsaverage'))) series2 = read_fmri(profile2); series = [series; series2]; end % We (Hesheng, Mert, Jorge and I) decided that random initialization can be same across groups of subjects. % rand('twister',5489) was moved to after MRIread is because MRIread calls/apps/arch/Linux_x86_64/freesurfer/4.5.0/matlab/load_nifti.m, which calls rand('state', sum(100*clock)); rand('twister',5489) % smooth, only applied for data in fsaverage* space if(~isempty(strfind(mesh_name, 'fsaverage'))) series(1:end/2, :) = transpose(MARS_AverageData(lh_avg_mesh, transpose(series(1:end/2, :)), 0, num_smooth)); series(end/2+1:end, :) = transpose(MARS_AverageData(rh_avg_mesh, transpose(series(end/2+1:end, :)), 0, num_smooth)); end % extract mask voxels series series = series(l, :); % remove voxels that are completely not correlated with any rois. non_zero_corr_index = (sum(series, 2) ~= 0); series = series(non_zero_corr_index, :); % znormalize (series assumed to be voxels x subjects or voxels x profile) if(normalize) mean_series = nanmean(series, 1); std_series = nanstd(series, 1, 1); series = bsxfun(@minus, series, mean_series); series = bsxfun(@times, series, 1./(std_series+eps) ); end % Perform Kmeans if(num_clusters > 1) % Normalize to zero mean across subjects series = bsxfun(@minus, series, mean(series, 2) ); tic, clustered = direcClus_fix_bessel_bsxfun(series, num_clusters, size(series, 2) - 1, num_tries, lambda, 0, 0, 1e-4, 1, max_iter, 1); toc cidx = clustered.clusters; lambda = clustered.lambda; mtc = clustered.mtc; p = clustered.p; lowerbound = clustered.likelihood(end); if(sum(non_zero_corr_index) < length(non_zero_corr_index)) %there are vertices with no correlation new_cidx = zeros(length(non_zero_corr_index), 1); new_cidx(non_zero_corr_index) = cidx; cidx = new_cidx; end else cidx = ones(length(l), 1); lambda = 0; mtc = 0; p = 0; end % Write Clustering Results lh_labels = zeros(lh_num_verts, 1); lh_labels(l1) = cidx(1:length(l1)); rh_labels = zeros(rh_num_verts, 1); rh_labels(l2) = cidx(length(l1)+1:end); save(output_file, 'lh_labels', 'rh_labels', 'lambda', 'mtc', 'lowerbound'); if(num_clusters > 1 && ~isempty(strfind(mesh_name, 'fsaverage')) && no_silhouette==0) tic; s = silhouette(series, cidx(non_zero_corr_index), 'correlation'); toc if(sum(non_zero_corr_index) < length(non_zero_corr_index)) %there are vertices with no correlation new_s = ones(length(non_zero_corr_index), 1); new_s(non_zero_corr_index) = s; s = new_s; end else s = zeros(length(l), 1); end lh_s = ones(lh_num_verts, 1); lh_s(l1) = s(1:length(l1)); rh_s = ones(rh_num_verts, 1); rh_s(l2) = s(length(l1)+1:end); save(output_file, 'lh_labels', 'rh_labels', 'lh_s', 'rh_s', 'lambda', 'mtc', 'p', 'lowerbound'); function vol = read_fmri(fmri_name) % [fmri, vol] = read_fmri(fmri_name) % Given the name of averaged correlation profile file (fmri_name), this % function read in the content of signals (vol). % % Input: % - fmri_name: % The full path of input file name. % It can be .nii.gz file for correlation profile in fsaverage* % spaces; or .mat file for correlation profile in fs_LR_32k space % (there must be a variable called 'profile_mat' in the .mat file). % % Output: % - vol: % A num_voxels x num_timepoints matrix which is the reshaped 'vol' % structure for .nii.gz file or the variable 'profile_mat' for .mat file. % if (~isempty(strfind(fmri_name, '.nii.gz'))) % if input file is NIFTI file fmri = MRIread(fmri_name); vol = fmri.vol; vol_size = size(vol); if(length(vol_size) < 4) vol = reshape(vol, prod(vol_size(1:3)), 1); else vol = reshape(vol, prod(vol_size(1:3)), vol_size(4)); end fmri.vol = []; else load(fmri_name); vol = profile_mat; end
{ "content_hash": "3213460e6ae76767c9a676553cb49d42", "timestamp": "", "source": "github", "line_count": 211, "max_line_length": 187, "avg_line_length": 37.28436018957346, "alnum_prop": 0.6389983475276472, "repo_name": "ThomasYeoLab/CBIG", "id": "658329f425ac410082d3b88d941e3a15edb9ddea", "size": "7867", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "utilities/matlab/DSP/CBIG_VonmisesSeriesClustering_fix_bessel_randnum_bsxfun.m", "mode": "33261", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "35378" }, { "name": "C", "bytes": "2076236" }, { "name": "C++", "bytes": "1461097" }, { "name": "CSS", "bytes": "6852" }, { "name": "Fortran", "bytes": "598090" }, { "name": "HTML", "bytes": "287918" }, { "name": "Jupyter Notebook", "bytes": "569200" }, { "name": "MATLAB", "bytes": "10013692" }, { "name": "Makefile", "bytes": "7902" }, { "name": "Objective-C", "bytes": "77" }, { "name": "PostScript", "bytes": "8416" }, { "name": "Python", "bytes": "2499129" }, { "name": "R", "bytes": "33929" }, { "name": "Shell", "bytes": "1923688" }, { "name": "TeX", "bytes": "8993" }, { "name": "Vim Script", "bytes": "2859" }, { "name": "XSLT", "bytes": "19506" } ], "symlink_target": "" }
import Ember from 'ember'; export default Ember.Mixin.create({ model() { return this.store.findRecord('visual', this.routeName); }, setupController(controller, model) { this.controllerFor(this.routeName.split('.').slice(0, 2).join('/')).setProperties({ model }); } });
{ "content_hash": "5a6c186d1bf435753fb33904a58b5225", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 97, "avg_line_length": 28.6, "alnum_prop": 0.6713286713286714, "repo_name": "ming-codes/ember-cli-d3", "id": "466aa8b7a93afcd72aa7e7d5b94970b8d4f7bd98", "size": "286", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/dummy/app/mixins/gallery-route-mixin.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1480" }, { "name": "HTML", "bytes": "8116" }, { "name": "JavaScript", "bytes": "81195" }, { "name": "Makefile", "bytes": "377" } ], "symlink_target": "" }
package de.qaware.heimdall; import org.testng.annotations.Test; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.not; import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.core.Is.is; public class PasswordFactoryTest { @Test public void testCreate() throws Exception { Password password = PasswordFactory.create(); assertThat(password, is(not(nullValue()))); } }
{ "content_hash": "7794cb08aaa43a6b3b0d9115ac7d6148", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 53, "avg_line_length": 25.333333333333332, "alnum_prop": 0.75, "repo_name": "qaware/heimdall", "id": "6a56949082c27efb5140f80a22f56cc4ceabf4a8", "size": "1577", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/test/java/de/qaware/heimdall/PasswordFactoryTest.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "66737" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>qcert: Not compatible 👼</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.10.2 / qcert - 2.0.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> qcert <small> 2.0.0 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-06-30 02:36:08 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-06-30 02:36:08 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-num base Num library distributed with the OCaml compiler base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils coq 8.10.2 Formal proof management system num 0 The Num library for arbitrary-precision integer and rational arithmetic ocaml 4.05.0 The OCaml compiler (virtual package) ocaml-base-compiler 4.05.0 Official 4.05.0 release ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.5 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; name: &quot;coq-qcert&quot; version: &quot;2.0.0&quot; synopsis: &quot;Verified compiler for data-centric languages&quot; description: &quot;&quot;&quot; This is the Coq library for Q*cert, a platform for implementing and verifying data languages and compilers. It includes abstract syntax and semantics for several source query languages (OQL, SQL), for intermediate database representations (nested relational algebra and calculus), and correctness proofs for part of the compilation to JavaScript and Java. &quot;&quot;&quot; maintainer: &quot;Jerome Simeon &lt;jeromesimeon@me.com&gt;&quot; authors: [ &quot;Josh Auerbach &lt;&gt;&quot; &quot;Martin Hirzel &lt;&gt;&quot; &quot;Louis Mandel &lt;&gt;&quot; &quot;Avi Shinnar &lt;&gt;&quot; &quot;Jerome Simeon &lt;&gt;&quot; ] license: &quot;Apache-2.0&quot; homepage: &quot;https://querycert.github.io&quot; bug-reports: &quot;https://github.com/querycert/qcert/issues&quot; dev-repo: &quot;git+https://github.com/querycert/qcert&quot; build: [ [make &quot;configure&quot;] [make &quot;-j&quot; jobs name] [&quot;dune&quot; &quot;build&quot; &quot;-j&quot; jobs &quot;-p&quot; name] ] install: [ [make &quot;install-coqdev&quot;] ] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/Qcert&quot;] depends: [ &quot;ocaml&quot; {&gt;= &quot;4.07.1&quot;} &quot;ocamlfind&quot; &quot;dune&quot; &quot;coq&quot; {&gt;= &quot;8.8.2&quot; &amp; &lt; &quot;8.9~&quot;} &quot;coq-flocq&quot; {&gt;= &quot;2.6.1&quot; &amp; &lt; &quot;3.0~&quot;} &quot;coq-jsast&quot; {&gt;= &quot;1.0.9&quot;} &quot;menhir&quot; &quot;base64&quot; &quot;uri&quot; &quot;calendar&quot; ] tags: [ &quot;keyword:databases&quot; &quot;keyword:queries&quot; &quot;keyword:relational&quot; &quot;keyword:compiler&quot; &quot;date:2020-07-24&quot; &quot;logpath:Qcert&quot; ] url { src: &quot;https://github.com/querycert/qcert/archive/v2.0.0.tar.gz&quot; checksum: &quot;d60d6633119e83362e5092e0c5b7b859&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-qcert.2.0.0 coq.8.10.2</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.10.2). The following dependencies couldn&#39;t be met: - coq-qcert -&gt; ocaml &gt;= 4.07.1 base of this switch (use `--unlock-base&#39; to force) No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-qcert.2.0.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
{ "content_hash": "0c3f6c7393e3d7f2d3e1c10605bffb76", "timestamp": "", "source": "github", "line_count": 178, "max_line_length": 355, "avg_line_length": 42.59550561797753, "alnum_prop": 0.5538116591928252, "repo_name": "coq-bench/coq-bench.github.io", "id": "b217900dbb94f4abe4896b273b54d1e69d594b1b", "size": "7607", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.05.0-2.0.1/released/8.10.2/qcert/2.0.0.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
// See pages 323 and 324 in "Artificial Intelligence", by Rich and Knight (section 12.5, "Iterative Deepening") using System; using System.Collections.Generic; //using System.Linq; //using System.Text; namespace Inference.AStar { // The Iterative-Deepening-A* Algorithm public class IDAStarAlgorithm<T> : HeuristicSearchAlgorithmBase<T> where T : AStarStateBase { private readonly Stack<T> openStack = new Stack<T>(); private int closedSetTotalFromPreviousIterations; public IDAStarAlgorithm(ISuccessorStateGenerator<T> successorStateGenerator) : base(successorStateGenerator) { } public override T Search(T startState, T goalState) { successorStateGenerator.StateValidityTest(startState); successorStateGenerator.StateValidityTest(goalState); closedSetTotalFromPreviousIterations = 0; var threshold = startState.f; for (; ; ) { var thresholdHasBeenSurpassed = false; var nextThreshold = int.MaxValue; openStack.Clear(); closedSet.Clear(); openStack.Push(startState); while (openStack.Count > 0) { var currentState = openStack.Pop(); closedSet.Add(currentState); if (currentState.Equals(goalState)) { return currentState; } var possibleSuccessorStatesData = successorStateGenerator.GenerateSuccessorStates(currentState, startState, goalState); foreach (var stateData in possibleSuccessorStatesData) { var state = stateData.Key; if (state.f > threshold) { thresholdHasBeenSurpassed = true; if (state.f < nextThreshold) { nextThreshold = state.f; } } else if (!openStack.Contains(state) && !closedSet.Contains(state)) { openStack.Push(state); } } } if (!thresholdHasBeenSurpassed) { break; } threshold = nextThreshold; closedSetTotalFromPreviousIterations += closedSet.Count; } return null; } public override int NumStatesGenerated { get { return openStack.Count + NumStatesExamined; } } public override int NumStatesExamined { get { return closedSet.Count + closedSetTotalFromPreviousIterations; } } } }
{ "content_hash": "78d0d4708c4ca2ee6eb1b5ddc0be04ff", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 139, "avg_line_length": 31.06930693069307, "alnum_prop": 0.48151688973868706, "repo_name": "tom-weatherhead/inference", "id": "95dd90d791fd0b184d775ab69875446f9dec86c9", "size": "3140", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "InferenceLibs/Inference/AStar/IDAStarAlgorithm.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "2000917" }, { "name": "Prolog", "bytes": "2129" } ], "symlink_target": "" }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. #if FEATURE_CTYPES using System; using System.Collections.Generic; using System.Numerics; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Microsoft.Scripting; using Microsoft.Scripting.Runtime; using IronPython.Runtime; using IronPython.Runtime.Operations; using IronPython.Runtime.Types; namespace IronPython.Modules { /// <summary> /// Provides support for interop with native code from Python code. /// </summary> public static partial class CTypes { /// <summary> /// The meta class for ctypes simple data types. These include primitives like ints, /// floats, etc... char/wchar pointers, and untyped pointers. /// </summary> [PythonType, PythonHidden] public class SimpleType : PythonType, INativeType { internal readonly SimpleTypeKind _type; private readonly char _charType; private readonly string _format; private readonly bool _swap; public SimpleType(CodeContext/*!*/ context, string name, PythonTuple bases, PythonDictionary dict) : base(context, name, bases, dict) { string sVal; const string allowedTypes = "?cbBghHiIlLdfuzZqQPXOv"; const string swappedTypes = "fdhHiIlLqQ"; if (!TryGetBoundCustomMember(context, "_type_", out object val) || (sVal = StringOps.AsString(val)) == null || sVal.Length != 1 || allowedTypes.IndexOf(sVal[0]) == -1) { throw PythonOps.AttributeError("AttributeError: class must define a '_type_' attribute which must be a single character string containing one of '{0}'.", allowedTypes); } _charType = sVal[0]; switch (_charType) { case '?': _type = SimpleTypeKind.Boolean; break; case 'c': _type = SimpleTypeKind.Char; break; case 'b': _type = SimpleTypeKind.SignedByte; break; case 'B': _type = SimpleTypeKind.UnsignedByte; break; case 'h': _type = SimpleTypeKind.SignedShort; break; case 'H': _type = SimpleTypeKind.UnsignedShort; break; case 'i': _type = SimpleTypeKind.SignedInt; break; case 'I': _type = SimpleTypeKind.UnsignedInt; break; case 'l': _type = SimpleTypeKind.SignedLong; break; case 'L': _type = SimpleTypeKind.UnsignedLong; break; case 'f': _type = SimpleTypeKind.Single; break; case 'g': // long double, new in 2.6 case 'd': _type = SimpleTypeKind.Double; break; case 'q': _type = SimpleTypeKind.SignedLongLong; break; case 'Q': _type = SimpleTypeKind.UnsignedLongLong; break; case 'O': _type = SimpleTypeKind.Object; break; case 'P': _type = SimpleTypeKind.Pointer; break; case 'z': _type = SimpleTypeKind.CharPointer; break; case 'Z': _type = SimpleTypeKind.WCharPointer; break; case 'u': _type = SimpleTypeKind.WChar; break; case 'v': _type = SimpleTypeKind.VariantBool; break; case 'X': _type = SimpleTypeKind.BStr; break; default: throw new NotImplementedException("simple type " + sVal); } if (!name.EndsWith("_be") && !name.EndsWith("_le") && swappedTypes.IndexOf(_charType) != -1) { CreateSwappedType(context, name, bases, dict); } _format = (BitConverter.IsLittleEndian ? '<' : '>') + _charType.ToString(); } private SimpleType(Type underlyingSystemType) : base(underlyingSystemType) { } private SimpleType(CodeContext/*!*/ context, string name, PythonTuple bases, PythonDictionary dict, bool isLittleEndian) : this(context, name, bases, dict) { _format = (isLittleEndian ? '<' : '>') + _charType.ToString(); _swap = isLittleEndian != BitConverter.IsLittleEndian; } private void CreateSwappedType(CodeContext/*!*/ context, string name, PythonTuple bases, PythonDictionary dict) { SimpleType swapped = new SimpleType(context, name + (BitConverter.IsLittleEndian ? "_be" : "_le"), bases, dict, !BitConverter.IsLittleEndian); if (BitConverter.IsLittleEndian) { AddSlot("__ctype_be__", new PythonTypeUserDescriptorSlot(swapped)); AddSlot("__ctype_le__", new PythonTypeUserDescriptorSlot(this)); swapped.AddSlot("__ctype_le__", new PythonTypeUserDescriptorSlot(this)); swapped.AddSlot("__ctype_be__", new PythonTypeUserDescriptorSlot(swapped)); } else { AddSlot("__ctype_le__", new PythonTypeUserDescriptorSlot(swapped)); AddSlot("__ctype_be__", new PythonTypeUserDescriptorSlot(this)); swapped.AddSlot("__ctype_le__", new PythonTypeUserDescriptorSlot(swapped)); swapped.AddSlot("__ctype_be__", new PythonTypeUserDescriptorSlot(this)); } } public static ArrayType/*!*/ operator *(SimpleType type, int count) { return MakeArrayType(type, count); } public static ArrayType/*!*/ operator *(int count, SimpleType type) { return MakeArrayType(type, count); } internal static PythonType MakeSystemType(Type underlyingSystemType) { return PythonType.SetPythonType(underlyingSystemType, new SimpleType(underlyingSystemType)); } public SimpleCData from_address(CodeContext/*!*/ context, int address) { return from_address(context, new IntPtr(address)); } public SimpleCData from_address(CodeContext/*!*/ context, BigInteger address) { return from_address(context, new IntPtr((long)address)); } public SimpleCData from_address(CodeContext/*!*/ context, IntPtr ptr) { SimpleCData res = (SimpleCData)CreateInstance(context); res.SetAddress(ptr); return res; } public SimpleCData from_buffer(ArrayModule.array array, [DefaultParameterValue(0)]int offset) { ValidateArraySizes(array, offset, ((INativeType)this).Size); SimpleCData res = (SimpleCData)CreateInstance(Context.SharedContext); IntPtr addr = array.GetArrayAddress(); res._memHolder = new MemoryHolder(addr.Add(offset), ((INativeType)this).Size); res._memHolder.AddObject("ffffffff", array); return res; } public SimpleCData from_buffer_copy(ArrayModule.array array, [DefaultParameterValue(0)]int offset) { ValidateArraySizes(array, offset, ((INativeType)this).Size); SimpleCData res = (SimpleCData)CreateInstance(Context.SharedContext); res._memHolder = new MemoryHolder(((INativeType)this).Size); res._memHolder.CopyFrom(array.GetArrayAddress().Add(offset), new IntPtr(((INativeType)this).Size)); GC.KeepAlive(array); return res; } /// <summary> /// Converts an object into a function call parameter. /// </summary> public object from_param(object obj) { // TODO: This isn't right as we have an obj associated w/ the argument, CPython doesn't. return new NativeArgument((CData)PythonCalls.Call(this, obj), _charType.ToString()); } public SimpleCData in_dll(CodeContext/*!*/ context, object library, string name) { IntPtr handle = GetHandleFromObject(library, "in_dll expected object with _handle attribute"); IntPtr addr = NativeFunctions.LoadFunction(handle, name); if (addr == IntPtr.Zero) { throw PythonOps.ValueError("{0} not found when attempting to load {1} from dll", name, Name); } SimpleCData res = (SimpleCData)CreateInstance(context); res.SetAddress(addr); return res; } #region INativeType Members int INativeType.Size { get { switch (_type) { case SimpleTypeKind.Char: case SimpleTypeKind.SignedByte: case SimpleTypeKind.UnsignedByte: case SimpleTypeKind.Boolean: return 1; case SimpleTypeKind.SignedShort: case SimpleTypeKind.UnsignedShort: case SimpleTypeKind.WChar: case SimpleTypeKind.VariantBool: return 2; case SimpleTypeKind.SignedInt: case SimpleTypeKind.UnsignedInt: case SimpleTypeKind.UnsignedLong: case SimpleTypeKind.SignedLong: case SimpleTypeKind.Single: return 4; case SimpleTypeKind.Double: case SimpleTypeKind.UnsignedLongLong: case SimpleTypeKind.SignedLongLong: return 8; case SimpleTypeKind.Object: case SimpleTypeKind.Pointer: case SimpleTypeKind.CharPointer: case SimpleTypeKind.WCharPointer: case SimpleTypeKind.BStr: return IntPtr.Size; } throw new InvalidOperationException(_type.ToString()); } } int INativeType.Alignment { get { return ((INativeType)this).Size; } } object INativeType.GetValue(MemoryHolder/*!*/ owner, object readingFrom, int offset, bool raw) { object res; switch (_type) { case SimpleTypeKind.Boolean: res = owner.ReadByte(offset) != 0 ? ScriptingRuntimeHelpers.True : ScriptingRuntimeHelpers.False; break; case SimpleTypeKind.Char: res = new string((char)owner.ReadByte(offset), 1); break; case SimpleTypeKind.SignedByte: res = GetIntReturn((int)(sbyte)owner.ReadByte(offset)); break; case SimpleTypeKind.UnsignedByte: res = GetIntReturn((int)owner.ReadByte(offset)); break; case SimpleTypeKind.SignedShort: res = GetIntReturn(owner.ReadInt16(offset, _swap)); break; case SimpleTypeKind.WChar: res = new string((char)owner.ReadInt16(offset), 1); break; case SimpleTypeKind.UnsignedShort: res = GetIntReturn((ushort)owner.ReadInt16(offset, _swap)); break; case SimpleTypeKind.VariantBool: res = owner.ReadInt16(offset, _swap) != 0 ? ScriptingRuntimeHelpers.True : ScriptingRuntimeHelpers.False; break; case SimpleTypeKind.SignedInt: res = GetIntReturn(owner.ReadInt32(offset, _swap)); break; case SimpleTypeKind.UnsignedInt: res = GetIntReturn((uint)owner.ReadInt32(offset, _swap)); break; case SimpleTypeKind.UnsignedLong: res = GetIntReturn((uint)owner.ReadInt32(offset, _swap)); break; case SimpleTypeKind.SignedLong: res = GetIntReturn(owner.ReadInt32(offset, _swap)); break; case SimpleTypeKind.Single: res = GetSingleReturn(owner.ReadInt32(offset, _swap)); break; case SimpleTypeKind.Double: res = GetDoubleReturn(owner.ReadInt64(offset, _swap)); break; case SimpleTypeKind.UnsignedLongLong: res = GetIntReturn((ulong)owner.ReadInt64(offset, _swap)); break; case SimpleTypeKind.SignedLongLong: res = GetIntReturn(owner.ReadInt64(offset, _swap)); break; case SimpleTypeKind.Object: res = GetObjectReturn(owner.ReadIntPtr(offset)); break; case SimpleTypeKind.Pointer: res = owner.ReadIntPtr(offset).ToPython(); break; case SimpleTypeKind.CharPointer: res = owner.ReadMemoryHolder(offset).ReadAnsiString(0); break; case SimpleTypeKind.WCharPointer: res = owner.ReadMemoryHolder(offset).ReadUnicodeString(0); break; case SimpleTypeKind.BStr: res = Marshal.PtrToStringBSTR(owner.ReadIntPtr(offset)); break; default: throw new InvalidOperationException(); } if (!raw && IsSubClass) { res = PythonCalls.Call(this, res); } return res; } /// <summary> /// Helper function for reading char/wchar's. This is used for reading from /// arrays and pointers to avoid creating lots of 1-char strings. /// </summary> internal char ReadChar(MemoryHolder/*!*/ owner, int offset) { switch (_type) { case SimpleTypeKind.Char: return (char)owner.ReadByte(offset); case SimpleTypeKind.WChar: return (char)owner.ReadInt16(offset); default: throw new InvalidOperationException(); } } object INativeType.SetValue(MemoryHolder/*!*/ owner, int offset, object value) { if (value is SimpleCData data && data.NativeType == this) { data._memHolder.CopyTo(owner, offset, ((INativeType)this).Size); return null; } switch (_type) { case SimpleTypeKind.Boolean: owner.WriteByte(offset, ModuleOps.GetBoolean(value, this)); break; case SimpleTypeKind.Char: owner.WriteByte(offset, ModuleOps.GetChar(value, this)); break; case SimpleTypeKind.SignedByte: owner.WriteByte(offset, ModuleOps.GetSignedByte(value, this)); break; case SimpleTypeKind.UnsignedByte: owner.WriteByte(offset, ModuleOps.GetUnsignedByte(value, this)); break; case SimpleTypeKind.WChar: owner.WriteInt16(offset, (short)ModuleOps.GetWChar(value, this)); break; case SimpleTypeKind.SignedShort: owner.WriteInt16(offset, ModuleOps.GetSignedShort(value, this), _swap); break; case SimpleTypeKind.UnsignedShort: owner.WriteInt16(offset, ModuleOps.GetUnsignedShort(value, this), _swap); break; case SimpleTypeKind.VariantBool: owner.WriteInt16(offset, (short)ModuleOps.GetVariantBool(value, this), _swap); break; case SimpleTypeKind.SignedInt: owner.WriteInt32(offset, ModuleOps.GetSignedInt(value, this), _swap); break; case SimpleTypeKind.UnsignedInt: owner.WriteInt32(offset, ModuleOps.GetUnsignedInt(value, this), _swap); break; case SimpleTypeKind.UnsignedLong: owner.WriteInt32(offset, ModuleOps.GetUnsignedLong(value, this), _swap); break; case SimpleTypeKind.SignedLong: owner.WriteInt32(offset, ModuleOps.GetSignedLong(value, this), _swap); break; case SimpleTypeKind.Single: owner.WriteInt32(offset, ModuleOps.GetSingleBits(value), _swap); break; case SimpleTypeKind.Double: owner.WriteInt64(offset, ModuleOps.GetDoubleBits(value), _swap); break; case SimpleTypeKind.UnsignedLongLong: owner.WriteInt64(offset, ModuleOps.GetUnsignedLongLong(value, this), _swap); break; case SimpleTypeKind.SignedLongLong: owner.WriteInt64(offset, ModuleOps.GetSignedLongLong(value, this), _swap); break; case SimpleTypeKind.Object: owner.WriteIntPtr(offset, ModuleOps.GetObject(value)); break; case SimpleTypeKind.Pointer: owner.WriteIntPtr(offset, ModuleOps.GetPointer(value)); break; case SimpleTypeKind.CharPointer: owner.WriteIntPtr(offset, ModuleOps.GetCharPointer(value)); return value; case SimpleTypeKind.WCharPointer: owner.WriteIntPtr(offset, ModuleOps.GetWCharPointer(value)); return value; case SimpleTypeKind.BStr: owner.WriteIntPtr(offset, ModuleOps.GetBSTR(value)); return value; default: throw new InvalidOperationException(); } return null; } Type/*!*/ INativeType.GetNativeType() { switch (_type) { case SimpleTypeKind.Boolean: return typeof(bool); case SimpleTypeKind.Char: return typeof(byte); case SimpleTypeKind.SignedByte: return typeof(sbyte); case SimpleTypeKind.UnsignedByte: return typeof(byte); case SimpleTypeKind.SignedShort: case SimpleTypeKind.VariantBool: return typeof(short); case SimpleTypeKind.UnsignedShort: return typeof(ushort); case SimpleTypeKind.WChar: return typeof(char); case SimpleTypeKind.SignedInt: case SimpleTypeKind.SignedLong: return typeof(int); case SimpleTypeKind.UnsignedInt: case SimpleTypeKind.UnsignedLong: return typeof(uint); case SimpleTypeKind.Single: return typeof(float); case SimpleTypeKind.Double: return typeof(double); case SimpleTypeKind.UnsignedLongLong: return typeof(ulong); case SimpleTypeKind.SignedLongLong: return typeof(long); case SimpleTypeKind.Object: return typeof(IntPtr); case SimpleTypeKind.Pointer: case SimpleTypeKind.CharPointer: case SimpleTypeKind.WCharPointer: case SimpleTypeKind.BStr: return typeof(IntPtr); } throw new InvalidOperationException(); } private static readonly MethodInfo StringGetPinnableReference = typeof(string).GetMethod("GetPinnableReference"); MarshalCleanup INativeType.EmitMarshalling(ILGenerator/*!*/ method, LocalOrArg argIndex, List<object>/*!*/ constantPool, int constantPoolArgument) { MarshalCleanup cleanup = null; Label marshalled = method.DefineLabel(); Type argumentType = argIndex.Type; if (!argumentType.IsValueType && _type != SimpleTypeKind.Object && _type != SimpleTypeKind.Pointer) { // check if we have an explicit CData instance. If we have a CData but it's the // wrong type CheckSimpleCDataType will throw. Label primitive = method.DefineLabel(); argIndex.Emit(method); constantPool.Add(this); method.Emit(OpCodes.Ldarg, constantPoolArgument); method.Emit(OpCodes.Ldc_I4, constantPool.Count - 1); method.Emit(OpCodes.Ldelem_Ref); method.Emit(OpCodes.Call, typeof(ModuleOps).GetMethod("CheckSimpleCDataType")); method.Emit(OpCodes.Brfalse, primitive); argIndex.Emit(method); method.Emit(OpCodes.Castclass, typeof(CData)); method.Emit(OpCodes.Call, typeof(CData).GetMethod("get_UnsafeAddress")); method.Emit(OpCodes.Ldobj, ((INativeType)this).GetNativeType()); method.Emit(OpCodes.Br, marshalled); method.MarkLabel(primitive); } argIndex.Emit(method); if (argumentType.IsValueType) { method.Emit(OpCodes.Box, argumentType); } switch (_type) { case SimpleTypeKind.Boolean: case SimpleTypeKind.Char: case SimpleTypeKind.SignedByte: case SimpleTypeKind.UnsignedByte: case SimpleTypeKind.SignedShort: case SimpleTypeKind.UnsignedShort: case SimpleTypeKind.WChar: case SimpleTypeKind.SignedInt: case SimpleTypeKind.UnsignedInt: case SimpleTypeKind.UnsignedLong: case SimpleTypeKind.SignedLong: case SimpleTypeKind.Single: case SimpleTypeKind.Double: case SimpleTypeKind.UnsignedLongLong: case SimpleTypeKind.SignedLongLong: case SimpleTypeKind.VariantBool: constantPool.Add(this); method.Emit(OpCodes.Ldarg, constantPoolArgument); method.Emit(OpCodes.Ldc_I4, constantPool.Count - 1); method.Emit(OpCodes.Ldelem_Ref); method.Emit(OpCodes.Call, typeof(ModuleOps).GetMethod("Get" + _type)); break; case SimpleTypeKind.Pointer: Label done = method.DefineLabel(); TryBytesConversion(method, done); Label nextTry = method.DefineLabel(); argIndex.Emit(method); if (argumentType.IsValueType) { method.Emit(OpCodes.Box, argumentType); } method.Emit(OpCodes.Isinst, typeof(string)); method.Emit(OpCodes.Dup); method.Emit(OpCodes.Brfalse, nextTry); if (StringGetPinnableReference is null) { LocalBuilder lb = method.DeclareLocal(typeof(string), true); method.Emit(OpCodes.Stloc, lb); method.Emit(OpCodes.Ldloc, lb); method.Emit(OpCodes.Conv_I); #pragma warning disable CS0618 // Type or member is obsolete method.Emit(OpCodes.Ldc_I4, RuntimeHelpers.OffsetToStringData); #pragma warning restore CS0618 // Type or member is obsolete method.Emit(OpCodes.Add); } else { method.Emit(OpCodes.Call, StringGetPinnableReference); } method.Emit(OpCodes.Br, done); method.MarkLabel(nextTry); method.Emit(OpCodes.Pop); argIndex.Emit(method); if (argumentType.IsValueType) { method.Emit(OpCodes.Box, argumentType); } method.Emit(OpCodes.Call, typeof(ModuleOps).GetMethod("GetPointer")); method.MarkLabel(done); break; case SimpleTypeKind.Object: // TODO: Need cleanup here method.Emit(OpCodes.Call, typeof(CTypes).GetMethod("PyObj_ToPtr")); break; case SimpleTypeKind.CharPointer: done = method.DefineLabel(); TryToCharPtrConversion(method, argIndex, argumentType, done); cleanup = MarshalCharPointer(method, argIndex); method.MarkLabel(done); break; case SimpleTypeKind.WCharPointer: done = method.DefineLabel(); TryArrayToWCharPtrConversion(method, argIndex, argumentType, done); MarshalWCharPointer(method, argIndex); method.MarkLabel(done); break; case SimpleTypeKind.BStr: throw new NotImplementedException("BSTR marshalling"); } method.MarkLabel(marshalled); return cleanup; } private static void TryBytesConversion(ILGenerator method, Label done) { Label nextTry = method.DefineLabel(); LocalBuilder lb = method.DeclareLocal(typeof(byte).MakeByRefType(), true); method.Emit(OpCodes.Call, typeof(ModuleOps).GetMethod("TryCheckBytes")); method.Emit(OpCodes.Dup); method.Emit(OpCodes.Brfalse, nextTry); method.Emit(OpCodes.Ldc_I4_0); method.Emit(OpCodes.Ldelema, typeof(Byte)); method.Emit(OpCodes.Stloc, lb); method.Emit(OpCodes.Ldloc, lb); method.Emit(OpCodes.Br, done); method.MarkLabel(nextTry); method.Emit(OpCodes.Pop); } internal static void TryArrayToWCharPtrConversion(ILGenerator method, LocalOrArg argIndex, Type argumentType, Label done) { Label nextTry = method.DefineLabel(); method.Emit(OpCodes.Call, typeof(ModuleOps).GetMethod("TryCheckWCharArray")); method.Emit(OpCodes.Dup); method.Emit(OpCodes.Brfalse, nextTry); method.Emit(OpCodes.Call, typeof(CData).GetMethod("get_UnsafeAddress")); method.Emit(OpCodes.Br, done); method.MarkLabel(nextTry); method.Emit(OpCodes.Pop); argIndex.Emit(method); if (argumentType.IsValueType) { method.Emit(OpCodes.Box, argumentType); } } internal static void TryToCharPtrConversion(ILGenerator method, LocalOrArg argIndex, Type argumentType, Label done) { TryBytesConversion(method, done); Label nextTry = method.DefineLabel(); argIndex.Emit(method); method.Emit(OpCodes.Call, typeof(ModuleOps).GetMethod("TryCheckCharArray")); method.Emit(OpCodes.Dup); method.Emit(OpCodes.Brfalse, nextTry); method.Emit(OpCodes.Call, typeof(CData).GetMethod("get_UnsafeAddress")); method.Emit(OpCodes.Br, done); method.MarkLabel(nextTry); method.Emit(OpCodes.Pop); argIndex.Emit(method); if (argumentType.IsValueType) { method.Emit(OpCodes.Box, argumentType); } } internal static void MarshalWCharPointer(ILGenerator method, LocalOrArg argIndex) { Type argumentType = argIndex.Type; Label isNull; Label done; isNull = method.DefineLabel(); done = method.DefineLabel(); method.Emit(OpCodes.Brfalse, isNull); argIndex.Emit(method); if (argumentType.IsValueType) { method.Emit(OpCodes.Box, argumentType); } if (StringGetPinnableReference is null) { LocalBuilder lb = method.DeclareLocal(typeof(string), true); method.Emit(OpCodes.Stloc, lb); method.Emit(OpCodes.Ldloc, lb); method.Emit(OpCodes.Conv_I); #pragma warning disable CS0618 // Type or member is obsolete method.Emit(OpCodes.Ldc_I4, RuntimeHelpers.OffsetToStringData); #pragma warning restore CS0618 // Type or member is obsolete method.Emit(OpCodes.Add); } else { method.Emit(OpCodes.Call, StringGetPinnableReference); } method.Emit(OpCodes.Br, done); method.MarkLabel(isNull); method.Emit(OpCodes.Ldc_I4_0); method.Emit(OpCodes.Conv_I); method.MarkLabel(done); } internal static MarshalCleanup MarshalCharPointer(ILGenerator method, LocalOrArg argIndex) { Type argumentType = argIndex.Type; Label isNull, done; LocalBuilder lb; isNull = method.DefineLabel(); done = method.DefineLabel(); method.Emit(OpCodes.Brfalse, isNull); argIndex.Emit(method); if (argumentType.IsValueType) { method.Emit(OpCodes.Box, argumentType); } lb = method.DeclareLocal(typeof(IntPtr)); method.Emit(OpCodes.Call, typeof(ModuleOps).GetMethod("StringToHGlobalAnsi")); method.Emit(OpCodes.Stloc, lb); method.Emit(OpCodes.Ldloc, lb); method.Emit(OpCodes.Br, done); method.MarkLabel(isNull); method.Emit(OpCodes.Ldc_I4_0); method.Emit(OpCodes.Conv_I); method.MarkLabel(done); return new StringCleanup(lb); } Type/*!*/ INativeType.GetPythonType() { if (IsSubClass) { return typeof(object); } return GetPythonTypeWorker(); } private Type GetPythonTypeWorker() { switch (_type) { case SimpleTypeKind.Boolean: return typeof(bool); case SimpleTypeKind.CharPointer: case SimpleTypeKind.WCharPointer: case SimpleTypeKind.WChar: case SimpleTypeKind.Char: case SimpleTypeKind.BStr: return typeof(string); case SimpleTypeKind.VariantBool: case SimpleTypeKind.SignedByte: case SimpleTypeKind.UnsignedByte: case SimpleTypeKind.SignedShort: case SimpleTypeKind.UnsignedShort: case SimpleTypeKind.SignedInt: case SimpleTypeKind.SignedLong: return typeof(int); case SimpleTypeKind.UnsignedInt: case SimpleTypeKind.UnsignedLong: case SimpleTypeKind.UnsignedLongLong: case SimpleTypeKind.SignedLongLong: case SimpleTypeKind.Pointer: case SimpleTypeKind.Object: return typeof(object); case SimpleTypeKind.Single: case SimpleTypeKind.Double: return typeof(double); default: throw new InvalidOperationException(); } } void INativeType.EmitReverseMarshalling(ILGenerator method, LocalOrArg value, List<object> constantPool, int constantPoolArgument) { value.Emit(method); switch (_type) { case SimpleTypeKind.SignedByte: case SimpleTypeKind.UnsignedByte: case SimpleTypeKind.SignedShort: case SimpleTypeKind.UnsignedShort: case SimpleTypeKind.VariantBool: method.Emit(OpCodes.Conv_I4); break; case SimpleTypeKind.SignedInt: case SimpleTypeKind.SignedLong: case SimpleTypeKind.Boolean: break; case SimpleTypeKind.Single: method.Emit(OpCodes.Conv_R8); break; case SimpleTypeKind.Double: break; case SimpleTypeKind.UnsignedInt: case SimpleTypeKind.UnsignedLong: EmitInt32ToObject(method, value); break; case SimpleTypeKind.UnsignedLongLong: case SimpleTypeKind.SignedLongLong: EmitInt64ToObject(method, value); break; case SimpleTypeKind.Object: method.Emit(OpCodes.Call, typeof(ModuleOps).GetMethod("IntPtrToObject")); break; case SimpleTypeKind.WCharPointer: method.Emit(OpCodes.Call, typeof(Marshal).GetMethod("PtrToStringUni", new[] { typeof(IntPtr) })); break; case SimpleTypeKind.CharPointer: method.Emit(OpCodes.Call, typeof(Marshal).GetMethod("PtrToStringAnsi", new[] { typeof(IntPtr) })); break; case SimpleTypeKind.BStr: method.Emit(OpCodes.Call, typeof(Marshal).GetMethod("PtrToStringBSTR", new[] { typeof(IntPtr) })); break; case SimpleTypeKind.Char: method.Emit(OpCodes.Call, typeof(ModuleOps).GetMethod("CharToString")); break; case SimpleTypeKind.WChar: method.Emit(OpCodes.Call, typeof(ModuleOps).GetMethod("WCharToString")); break; case SimpleTypeKind.Pointer: Label done, notNull; done = method.DefineLabel(); notNull = method.DefineLabel(); if (IntPtr.Size == 4) { LocalBuilder tmpLocal = method.DeclareLocal(typeof(uint)); method.Emit(OpCodes.Conv_U4); method.Emit(OpCodes.Stloc, tmpLocal); method.Emit(OpCodes.Ldloc, tmpLocal); method.Emit(OpCodes.Ldc_I4_0); method.Emit(OpCodes.Conv_U4); method.Emit(OpCodes.Bne_Un, notNull); method.Emit(OpCodes.Ldnull); method.Emit(OpCodes.Br, done); method.MarkLabel(notNull); method.Emit(OpCodes.Ldloc, tmpLocal); EmitInt32ToObject(method, new Local(tmpLocal)); } else { LocalBuilder tmpLocal = method.DeclareLocal(typeof(long)); method.Emit(OpCodes.Conv_I8); method.Emit(OpCodes.Stloc, tmpLocal); method.Emit(OpCodes.Ldloc, tmpLocal); method.Emit(OpCodes.Ldc_I4_0); method.Emit(OpCodes.Conv_U8); method.Emit(OpCodes.Bne_Un, notNull); method.Emit(OpCodes.Ldnull); method.Emit(OpCodes.Br, done); method.MarkLabel(notNull); method.Emit(OpCodes.Ldloc, tmpLocal); EmitInt64ToObject(method, new Local(tmpLocal)); } method.MarkLabel(done); break; } if (IsSubClass) { LocalBuilder tmp = method.DeclareLocal(typeof(object)); if (GetPythonTypeWorker().IsValueType) { method.Emit(OpCodes.Box, GetPythonTypeWorker()); } method.Emit(OpCodes.Stloc, tmp); constantPool.Add(this); method.Emit(OpCodes.Ldarg, constantPoolArgument); method.Emit(OpCodes.Ldc_I4, constantPool.Count - 1); method.Emit(OpCodes.Ldelem_Ref); method.Emit(OpCodes.Ldloc, tmp); method.Emit(OpCodes.Call, typeof(ModuleOps).GetMethod("CreateSubclassInstance")); } } private static void EmitInt64ToObject(ILGenerator method, LocalOrArg value) { Label done; Label bigInt = method.DefineLabel(); done = method.DefineLabel(); method.Emit(OpCodes.Ldc_I4, Int32.MaxValue); method.Emit(OpCodes.Conv_I8); method.Emit(OpCodes.Bgt, bigInt); value.Emit(method); method.Emit(OpCodes.Ldc_I4, Int32.MinValue); method.Emit(OpCodes.Conv_I8); method.Emit(OpCodes.Blt, bigInt); value.Emit(method); method.Emit(OpCodes.Conv_I4); method.Emit(OpCodes.Box, typeof(int)); method.Emit(OpCodes.Br, done); method.MarkLabel(bigInt); value.Emit(method); method.Emit(OpCodes.Call, typeof(BigInteger).GetMethod("op_Implicit", new[] { value.Type })); method.Emit(OpCodes.Box, typeof(BigInteger)); method.MarkLabel(done); } private static void EmitInt32ToObject(ILGenerator method, LocalOrArg value) { Label intVal, done; intVal = method.DefineLabel(); done = method.DefineLabel(); method.Emit(OpCodes.Ldc_I4, Int32.MaxValue); method.Emit(value.Type == typeof(uint) ? OpCodes.Conv_U4 : OpCodes.Conv_U8); method.Emit(OpCodes.Ble, intVal); value.Emit(method); method.Emit(OpCodes.Call, typeof(BigInteger).GetMethod("op_Implicit", new[] { value.Type })); method.Emit(OpCodes.Box, typeof(BigInteger)); method.Emit(OpCodes.Br, done); method.MarkLabel(intVal); value.Emit(method); method.Emit(OpCodes.Conv_I4); method.Emit(OpCodes.Box, typeof(int)); method.MarkLabel(done); } private bool IsSubClass { get { return BaseTypes.Count != 1 || BaseTypes[0] != CTypes._SimpleCData; } } private object GetObjectReturn(IntPtr intPtr) { GCHandle handle = GCHandle.FromIntPtr(intPtr); object res = handle.Target; // TODO: handle lifetime management return res; } private object GetDoubleReturn(long p) { return BitConverter.ToDouble(BitConverter.GetBytes(p), 0); } private object GetSingleReturn(int p) { return BitConverter.ToSingle(BitConverter.GetBytes(p), 0); } private static object GetIntReturn(int value) { return ScriptingRuntimeHelpers.Int32ToObject((int)value); } private static object GetIntReturn(uint value) { if (value > Int32.MaxValue) { return (BigInteger)value; } return ScriptingRuntimeHelpers.Int32ToObject((int)value); } private static object GetIntReturn(long value) { if (value <= Int32.MaxValue && value >= Int32.MinValue) { return (int)value; } return (BigInteger)value; } private static object GetIntReturn(ulong value) { if (value <= Int32.MaxValue) { return (int)value; } return (BigInteger)value; } string INativeType.TypeFormat { get { return _format; } } #endregion } } } #endif
{ "content_hash": "647cae6093cea0d8f12be66fd6a142af", "timestamp": "", "source": "github", "line_count": 840, "max_line_length": 188, "avg_line_length": 48.82857142857143, "alnum_prop": 0.5331334113516677, "repo_name": "IronLanguages/ironpython2", "id": "e9ad37fb2a9e00fd24d6bd3a904929d7370f0e29", "size": "41016", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Src/IronPython.Modules/_ctypes/SimpleType.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "4080" }, { "name": "C", "bytes": "20290" }, { "name": "C#", "bytes": "12424667" }, { "name": "C++", "bytes": "69156" }, { "name": "Classic ASP", "bytes": "2117" }, { "name": "HTML", "bytes": "13181412" }, { "name": "JavaScript", "bytes": "1656" }, { "name": "Makefile", "bytes": "332" }, { "name": "PLSQL", "bytes": "22886" }, { "name": "PowerShell", "bytes": "67035" }, { "name": "Python", "bytes": "27860071" }, { "name": "Roff", "bytes": "21" }, { "name": "Shell", "bytes": "193" }, { "name": "Smalltalk", "bytes": "3" }, { "name": "VBScript", "bytes": "974" }, { "name": "XSLT", "bytes": "2058" } ], "symlink_target": "" }
package com.amazonaws.services.rekognition.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; @Generated("com.amazonaws:aws-java-sdk-code-generator") public class CopyProjectVersionRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** * <p> * The ARN of the source project in the trusting AWS account. * </p> */ private String sourceProjectArn; /** * <p> * The ARN of the model version in the source project that you want to copy to a destination project. * </p> */ private String sourceProjectVersionArn; /** * <p> * The ARN of the project in the trusted AWS account that you want to copy the model version to. * </p> */ private String destinationProjectArn; /** * <p> * A name for the version of the model that's copied to the destination project. * </p> */ private String versionName; /** * <p> * The S3 bucket and folder location where the training output for the source model version is placed. * </p> */ private OutputConfig outputConfig; /** * <p> * The key-value tags to assign to the model version. * </p> */ private java.util.Map<String, String> tags; /** * <p> * The identifier for your AWS Key Management Service key (AWS KMS key). You can supply the Amazon Resource Name * (ARN) of your KMS key, the ID of your KMS key, an alias for your KMS key, or an alias ARN. The key is used to * encrypt training results and manifest files written to the output Amazon S3 bucket (<code>OutputConfig</code>). * </p> * <p> * If you choose to use your own KMS key, you need the following permissions on the KMS key. * </p> * <ul> * <li> * <p> * kms:CreateGrant * </p> * </li> * <li> * <p> * kms:DescribeKey * </p> * </li> * <li> * <p> * kms:GenerateDataKey * </p> * </li> * <li> * <p> * kms:Decrypt * </p> * </li> * </ul> * <p> * If you don't specify a value for <code>KmsKeyId</code>, images copied into the service are encrypted using a key * that AWS owns and manages. * </p> */ private String kmsKeyId; /** * <p> * The ARN of the source project in the trusting AWS account. * </p> * * @param sourceProjectArn * The ARN of the source project in the trusting AWS account. */ public void setSourceProjectArn(String sourceProjectArn) { this.sourceProjectArn = sourceProjectArn; } /** * <p> * The ARN of the source project in the trusting AWS account. * </p> * * @return The ARN of the source project in the trusting AWS account. */ public String getSourceProjectArn() { return this.sourceProjectArn; } /** * <p> * The ARN of the source project in the trusting AWS account. * </p> * * @param sourceProjectArn * The ARN of the source project in the trusting AWS account. * @return Returns a reference to this object so that method calls can be chained together. */ public CopyProjectVersionRequest withSourceProjectArn(String sourceProjectArn) { setSourceProjectArn(sourceProjectArn); return this; } /** * <p> * The ARN of the model version in the source project that you want to copy to a destination project. * </p> * * @param sourceProjectVersionArn * The ARN of the model version in the source project that you want to copy to a destination project. */ public void setSourceProjectVersionArn(String sourceProjectVersionArn) { this.sourceProjectVersionArn = sourceProjectVersionArn; } /** * <p> * The ARN of the model version in the source project that you want to copy to a destination project. * </p> * * @return The ARN of the model version in the source project that you want to copy to a destination project. */ public String getSourceProjectVersionArn() { return this.sourceProjectVersionArn; } /** * <p> * The ARN of the model version in the source project that you want to copy to a destination project. * </p> * * @param sourceProjectVersionArn * The ARN of the model version in the source project that you want to copy to a destination project. * @return Returns a reference to this object so that method calls can be chained together. */ public CopyProjectVersionRequest withSourceProjectVersionArn(String sourceProjectVersionArn) { setSourceProjectVersionArn(sourceProjectVersionArn); return this; } /** * <p> * The ARN of the project in the trusted AWS account that you want to copy the model version to. * </p> * * @param destinationProjectArn * The ARN of the project in the trusted AWS account that you want to copy the model version to. */ public void setDestinationProjectArn(String destinationProjectArn) { this.destinationProjectArn = destinationProjectArn; } /** * <p> * The ARN of the project in the trusted AWS account that you want to copy the model version to. * </p> * * @return The ARN of the project in the trusted AWS account that you want to copy the model version to. */ public String getDestinationProjectArn() { return this.destinationProjectArn; } /** * <p> * The ARN of the project in the trusted AWS account that you want to copy the model version to. * </p> * * @param destinationProjectArn * The ARN of the project in the trusted AWS account that you want to copy the model version to. * @return Returns a reference to this object so that method calls can be chained together. */ public CopyProjectVersionRequest withDestinationProjectArn(String destinationProjectArn) { setDestinationProjectArn(destinationProjectArn); return this; } /** * <p> * A name for the version of the model that's copied to the destination project. * </p> * * @param versionName * A name for the version of the model that's copied to the destination project. */ public void setVersionName(String versionName) { this.versionName = versionName; } /** * <p> * A name for the version of the model that's copied to the destination project. * </p> * * @return A name for the version of the model that's copied to the destination project. */ public String getVersionName() { return this.versionName; } /** * <p> * A name for the version of the model that's copied to the destination project. * </p> * * @param versionName * A name for the version of the model that's copied to the destination project. * @return Returns a reference to this object so that method calls can be chained together. */ public CopyProjectVersionRequest withVersionName(String versionName) { setVersionName(versionName); return this; } /** * <p> * The S3 bucket and folder location where the training output for the source model version is placed. * </p> * * @param outputConfig * The S3 bucket and folder location where the training output for the source model version is placed. */ public void setOutputConfig(OutputConfig outputConfig) { this.outputConfig = outputConfig; } /** * <p> * The S3 bucket and folder location where the training output for the source model version is placed. * </p> * * @return The S3 bucket and folder location where the training output for the source model version is placed. */ public OutputConfig getOutputConfig() { return this.outputConfig; } /** * <p> * The S3 bucket and folder location where the training output for the source model version is placed. * </p> * * @param outputConfig * The S3 bucket and folder location where the training output for the source model version is placed. * @return Returns a reference to this object so that method calls can be chained together. */ public CopyProjectVersionRequest withOutputConfig(OutputConfig outputConfig) { setOutputConfig(outputConfig); return this; } /** * <p> * The key-value tags to assign to the model version. * </p> * * @return The key-value tags to assign to the model version. */ public java.util.Map<String, String> getTags() { return tags; } /** * <p> * The key-value tags to assign to the model version. * </p> * * @param tags * The key-value tags to assign to the model version. */ public void setTags(java.util.Map<String, String> tags) { this.tags = tags; } /** * <p> * The key-value tags to assign to the model version. * </p> * * @param tags * The key-value tags to assign to the model version. * @return Returns a reference to this object so that method calls can be chained together. */ public CopyProjectVersionRequest withTags(java.util.Map<String, String> tags) { setTags(tags); return this; } /** * Add a single Tags entry * * @see CopyProjectVersionRequest#withTags * @returns a reference to this object so that method calls can be chained together. */ public CopyProjectVersionRequest addTagsEntry(String key, String value) { if (null == this.tags) { this.tags = new java.util.HashMap<String, String>(); } if (this.tags.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.tags.put(key, value); return this; } /** * Removes all the entries added into Tags. * * @return Returns a reference to this object so that method calls can be chained together. */ public CopyProjectVersionRequest clearTagsEntries() { this.tags = null; return this; } /** * <p> * The identifier for your AWS Key Management Service key (AWS KMS key). You can supply the Amazon Resource Name * (ARN) of your KMS key, the ID of your KMS key, an alias for your KMS key, or an alias ARN. The key is used to * encrypt training results and manifest files written to the output Amazon S3 bucket (<code>OutputConfig</code>). * </p> * <p> * If you choose to use your own KMS key, you need the following permissions on the KMS key. * </p> * <ul> * <li> * <p> * kms:CreateGrant * </p> * </li> * <li> * <p> * kms:DescribeKey * </p> * </li> * <li> * <p> * kms:GenerateDataKey * </p> * </li> * <li> * <p> * kms:Decrypt * </p> * </li> * </ul> * <p> * If you don't specify a value for <code>KmsKeyId</code>, images copied into the service are encrypted using a key * that AWS owns and manages. * </p> * * @param kmsKeyId * The identifier for your AWS Key Management Service key (AWS KMS key). You can supply the Amazon Resource * Name (ARN) of your KMS key, the ID of your KMS key, an alias for your KMS key, or an alias ARN. The key is * used to encrypt training results and manifest files written to the output Amazon S3 bucket ( * <code>OutputConfig</code>).</p> * <p> * If you choose to use your own KMS key, you need the following permissions on the KMS key. * </p> * <ul> * <li> * <p> * kms:CreateGrant * </p> * </li> * <li> * <p> * kms:DescribeKey * </p> * </li> * <li> * <p> * kms:GenerateDataKey * </p> * </li> * <li> * <p> * kms:Decrypt * </p> * </li> * </ul> * <p> * If you don't specify a value for <code>KmsKeyId</code>, images copied into the service are encrypted using * a key that AWS owns and manages. */ public void setKmsKeyId(String kmsKeyId) { this.kmsKeyId = kmsKeyId; } /** * <p> * The identifier for your AWS Key Management Service key (AWS KMS key). You can supply the Amazon Resource Name * (ARN) of your KMS key, the ID of your KMS key, an alias for your KMS key, or an alias ARN. The key is used to * encrypt training results and manifest files written to the output Amazon S3 bucket (<code>OutputConfig</code>). * </p> * <p> * If you choose to use your own KMS key, you need the following permissions on the KMS key. * </p> * <ul> * <li> * <p> * kms:CreateGrant * </p> * </li> * <li> * <p> * kms:DescribeKey * </p> * </li> * <li> * <p> * kms:GenerateDataKey * </p> * </li> * <li> * <p> * kms:Decrypt * </p> * </li> * </ul> * <p> * If you don't specify a value for <code>KmsKeyId</code>, images copied into the service are encrypted using a key * that AWS owns and manages. * </p> * * @return The identifier for your AWS Key Management Service key (AWS KMS key). You can supply the Amazon Resource * Name (ARN) of your KMS key, the ID of your KMS key, an alias for your KMS key, or an alias ARN. The key * is used to encrypt training results and manifest files written to the output Amazon S3 bucket ( * <code>OutputConfig</code>).</p> * <p> * If you choose to use your own KMS key, you need the following permissions on the KMS key. * </p> * <ul> * <li> * <p> * kms:CreateGrant * </p> * </li> * <li> * <p> * kms:DescribeKey * </p> * </li> * <li> * <p> * kms:GenerateDataKey * </p> * </li> * <li> * <p> * kms:Decrypt * </p> * </li> * </ul> * <p> * If you don't specify a value for <code>KmsKeyId</code>, images copied into the service are encrypted * using a key that AWS owns and manages. */ public String getKmsKeyId() { return this.kmsKeyId; } /** * <p> * The identifier for your AWS Key Management Service key (AWS KMS key). You can supply the Amazon Resource Name * (ARN) of your KMS key, the ID of your KMS key, an alias for your KMS key, or an alias ARN. The key is used to * encrypt training results and manifest files written to the output Amazon S3 bucket (<code>OutputConfig</code>). * </p> * <p> * If you choose to use your own KMS key, you need the following permissions on the KMS key. * </p> * <ul> * <li> * <p> * kms:CreateGrant * </p> * </li> * <li> * <p> * kms:DescribeKey * </p> * </li> * <li> * <p> * kms:GenerateDataKey * </p> * </li> * <li> * <p> * kms:Decrypt * </p> * </li> * </ul> * <p> * If you don't specify a value for <code>KmsKeyId</code>, images copied into the service are encrypted using a key * that AWS owns and manages. * </p> * * @param kmsKeyId * The identifier for your AWS Key Management Service key (AWS KMS key). You can supply the Amazon Resource * Name (ARN) of your KMS key, the ID of your KMS key, an alias for your KMS key, or an alias ARN. The key is * used to encrypt training results and manifest files written to the output Amazon S3 bucket ( * <code>OutputConfig</code>).</p> * <p> * If you choose to use your own KMS key, you need the following permissions on the KMS key. * </p> * <ul> * <li> * <p> * kms:CreateGrant * </p> * </li> * <li> * <p> * kms:DescribeKey * </p> * </li> * <li> * <p> * kms:GenerateDataKey * </p> * </li> * <li> * <p> * kms:Decrypt * </p> * </li> * </ul> * <p> * If you don't specify a value for <code>KmsKeyId</code>, images copied into the service are encrypted using * a key that AWS owns and manages. * @return Returns a reference to this object so that method calls can be chained together. */ public CopyProjectVersionRequest withKmsKeyId(String kmsKeyId) { setKmsKeyId(kmsKeyId); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getSourceProjectArn() != null) sb.append("SourceProjectArn: ").append(getSourceProjectArn()).append(","); if (getSourceProjectVersionArn() != null) sb.append("SourceProjectVersionArn: ").append(getSourceProjectVersionArn()).append(","); if (getDestinationProjectArn() != null) sb.append("DestinationProjectArn: ").append(getDestinationProjectArn()).append(","); if (getVersionName() != null) sb.append("VersionName: ").append(getVersionName()).append(","); if (getOutputConfig() != null) sb.append("OutputConfig: ").append(getOutputConfig()).append(","); if (getTags() != null) sb.append("Tags: ").append(getTags()).append(","); if (getKmsKeyId() != null) sb.append("KmsKeyId: ").append(getKmsKeyId()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CopyProjectVersionRequest == false) return false; CopyProjectVersionRequest other = (CopyProjectVersionRequest) obj; if (other.getSourceProjectArn() == null ^ this.getSourceProjectArn() == null) return false; if (other.getSourceProjectArn() != null && other.getSourceProjectArn().equals(this.getSourceProjectArn()) == false) return false; if (other.getSourceProjectVersionArn() == null ^ this.getSourceProjectVersionArn() == null) return false; if (other.getSourceProjectVersionArn() != null && other.getSourceProjectVersionArn().equals(this.getSourceProjectVersionArn()) == false) return false; if (other.getDestinationProjectArn() == null ^ this.getDestinationProjectArn() == null) return false; if (other.getDestinationProjectArn() != null && other.getDestinationProjectArn().equals(this.getDestinationProjectArn()) == false) return false; if (other.getVersionName() == null ^ this.getVersionName() == null) return false; if (other.getVersionName() != null && other.getVersionName().equals(this.getVersionName()) == false) return false; if (other.getOutputConfig() == null ^ this.getOutputConfig() == null) return false; if (other.getOutputConfig() != null && other.getOutputConfig().equals(this.getOutputConfig()) == false) return false; if (other.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; if (other.getKmsKeyId() == null ^ this.getKmsKeyId() == null) return false; if (other.getKmsKeyId() != null && other.getKmsKeyId().equals(this.getKmsKeyId()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getSourceProjectArn() == null) ? 0 : getSourceProjectArn().hashCode()); hashCode = prime * hashCode + ((getSourceProjectVersionArn() == null) ? 0 : getSourceProjectVersionArn().hashCode()); hashCode = prime * hashCode + ((getDestinationProjectArn() == null) ? 0 : getDestinationProjectArn().hashCode()); hashCode = prime * hashCode + ((getVersionName() == null) ? 0 : getVersionName().hashCode()); hashCode = prime * hashCode + ((getOutputConfig() == null) ? 0 : getOutputConfig().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); hashCode = prime * hashCode + ((getKmsKeyId() == null) ? 0 : getKmsKeyId().hashCode()); return hashCode; } @Override public CopyProjectVersionRequest clone() { return (CopyProjectVersionRequest) super.clone(); } }
{ "content_hash": "2b728025ac6789e67510ccb8b2bca51c", "timestamp": "", "source": "github", "line_count": 671, "max_line_length": 144, "avg_line_length": 32.72876304023845, "alnum_prop": 0.5769318337052047, "repo_name": "aws/aws-sdk-java", "id": "f06c9183fe0d30a1253dd0df8fea2763e94083a0", "size": "22541", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "aws-java-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/CopyProjectVersionRequest.java", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
<?php namespace ThreadAndMirror\MoodBoardBundle\Entity; use Doctrine\Common\Collections\ArrayCollection; use Symfony\Component\Validator\Constraints as Assert; use Symfony\Component\HttpFoundation\File\UploadedFile; use Doctrine\ORM\Mapping as ORM; use Gedmo\Mapping\Annotation as Gedmo; /** * @ORM\Table(name="tam_moodboard_moodboard") */ class MoodBoard { /** * @ORM\Id * @ORM\Column(type="integer") * @ORM\GeneratedValue(strategy="AUTO") */ protected $id; /** * @ORM\Column(type="text", length=64) * @Gedmo\Slug(fields={"title"}) */ protected $slug; /** * @ORM\Column(type="string") * @Assert\NotBlank() */ protected $title; /** * @ORM\Column(type="text", nullable=true) */ protected $caption; /** * @ORM\Column(type="integer", nullable=true) */ protected $background; /** * @ORM\Column(type="datetime") * @Gedmo\Timestampable(on="create") */ protected $created; /** * @ORM\Column(type="datetime") * @Gedmo\Timestampable(on="update") */ protected $updated; /** * @ORM\OneToMany(targetEntity="Element", mappedBy="moodboard", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OrderBy({"position" = "ASC"}) */ protected $elements; public function __construct() { $this->elements = new ArrayCollection(); } /** * Get id * * @return integer */ public function getId() { return $this->id; } /** * Set slug * * @param string $slug * @return MoodBoard */ public function setSlug($slug) { $this->slug = $slug; return $this; } /** * Get slug * * @return string */ public function getSlug() { return $this->slug; } /** * Set title * * @param string $title * @return MoodBoard */ public function setTitle($title) { $this->title = $title; return $this; } /** * Get title * * @return string */ public function getTitle() { return $this->title; } /** * Set caption * * @param string $caption * @return MoodBoard */ public function setCaption($caption) { $this->caption = $caption; return $this; } /** * Get caption * * @return string */ public function getCaption() { return $this->caption; } /** * Set background * * @param integer $background * @return MoodBoard */ public function setBackground($background) { $this->background = $background; return $this; } /** * Get background * * @return integer */ public function getBackground() { return $this->background; } /** * Set created * * @param \DateTime $created * @return MoodBoard */ public function setCreated($created) { $this->created = $created; return $this; } /** * Get created * * @return \DateTime */ public function getCreated() { return $this->created; } /** * Set updated * * @param \DateTime $updated * @return MoodBoard */ public function setUpdated($updated) { $this->updated = $updated; return $this; } /** * Get updated * * @return \DateTime */ public function getUpdated() { return $this->updated; } /** * Add elements * * @param \ThreadAndMirror\MoodBoardBundle\Entity\Element $elements * @return MoodBoard */ public function addElement(\ThreadAndMirror\MoodBoardBundle\Entity\Element $elements) { $this->elements[] = $elements; return $this; } /** * Remove elements * * @param \ThreadAndMirror\MoodBoardBundle\Entity\Element $elements */ public function removeElement(\ThreadAndMirror\MoodBoardBundle\Entity\Element $elements) { $this->elements->removeElement($elements); } /** * Get elements * * @return \Doctrine\Common\Collections\Collection */ public function getElements() { return $this->elements; } }
{ "content_hash": "08857b5e645afa46b028765f241a40dd", "timestamp": "", "source": "github", "line_count": 247, "max_line_length": 118, "avg_line_length": 17.902834008097166, "alnum_prop": 0.5323383084577115, "repo_name": "ScragLabs/ThreadAndMirror", "id": "76c6715ea33630559d38ff1f7206a50e8b72654e", "size": "4422", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/ThreadAndMirror/MoodBoardBundle/Entity/MoodBoard.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "286" }, { "name": "CSS", "bytes": "118343" }, { "name": "HTML", "bytes": "182105" }, { "name": "JavaScript", "bytes": "32490" }, { "name": "PHP", "bytes": "939387" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>bertrand: Not compatible</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.9.0 / bertrand - 8.7.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> bertrand <small> 8.7.0 <span class="label label-info">Not compatible</span> </small> </h1> <p><em><script>document.write(moment("2020-03-15 06:26:03 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2020-03-15 06:26:03 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base camlp5 7.11 Preprocessor-pretty-printer of OCaml conf-findutils 1 Virtual package relying on findutils conf-m4 1 Virtual package relying on m4 coq 8.9.0 Formal proof management system num 1.3 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.09.0 The OCaml compiler (virtual package) ocaml-base-compiler 4.09.0 Official release 4.09.0 ocaml-config 1 OCaml Switch Configuration ocamlfind 1.8.1 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;Hugo.Herbelin@inria.fr&quot; homepage: &quot;https://github.com/coq-community/bertrand&quot; license: &quot;LGPL 2.1&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/Bertrand&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.7&quot; &amp; &lt; &quot;8.8~&quot;} ] tags: [ &quot;keyword: Knuth&#39;s algorithm&quot; &quot;keyword: prime numbers&quot; &quot;keyword: Bertrand&#39;s postulate&quot; &quot;category: Mathematics/Arithmetic and Number Theory/Number theory&quot; &quot;category: Computer Science/Decision Procedures and Certified Algorithms/Correctness proofs based on external tools&quot; &quot;category: Miscellaneous/Extracted Programs/Arithmetic&quot; &quot;date: 2002&quot; ] authors: [ &quot;Laurent Théry&quot; ] bug-reports: &quot;https://github.com/coq-community/bertrand/issues&quot; dev-repo: &quot;git+https://github.com/coq-community/bertrand.git&quot; synopsis: &quot;Correctness of Knuth&#39;s algorithm for prime numbers&quot; description: &quot;&quot;&quot; A proof of correctness of the algorithm as described in `The Art of Computer Programming: Fundamental Algorithms&#39; by Knuth, pages 147-149&quot;&quot;&quot; flags: light-uninstall url { src: &quot;https://github.com/coq-community/bertrand/archive/v8.7.0.tar.gz&quot; checksum: &quot;md5=94c1f46fd9ba1f18c956f3fac62dff4a&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-bertrand.8.7.0 coq.8.9.0</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.9.0). The following dependencies couldn&#39;t be met: - coq-bertrand -&gt; coq &lt; 8.8~ -&gt; ocaml &lt; 4.06.0 base of this switch (use `--unlock-base&#39; to force) Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-bertrand.8.7.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> <small>Sources are on <a href="https://github.com/coq-bench">GitHub</a>. © Guillaume Claret.</small> </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
{ "content_hash": "ac7c8b7da79f17f1970a9a4d565ac8d6", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 426, "avg_line_length": 43.377245508982035, "alnum_prop": 0.554527885146328, "repo_name": "coq-bench/coq-bench.github.io", "id": "fc8cbc11fc7ec86fc50309105a49c8ebae752ea6", "size": "7247", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.09.0-2.0.5/released/8.9.0/bertrand/8.7.0.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
from datetime import datetime from app import db class Base(db.Model): __abstract__ = True id = db.Column(db.Integer, primary_key=True) created_date = db.Column(db.DateTime, index=True, default=datetime.utcnow) updated_date = db.Column(db.DateTime, index=True, default=datetime.utcnow)
{ "content_hash": "2e42d889d9b77cf4a003168647e82488", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 78, "avg_line_length": 33.77777777777778, "alnum_prop": 0.7236842105263158, "repo_name": "levlaz/braindump", "id": "5c96778047951f510622a877c43b986516226f64", "size": "304", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/model/base.py", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "8140" }, { "name": "HTML", "bytes": "28738" }, { "name": "JavaScript", "bytes": "9981" }, { "name": "Mako", "bytes": "412" }, { "name": "Nginx", "bytes": "619" }, { "name": "Python", "bytes": "79390" }, { "name": "Shell", "bytes": "5537" } ], "symlink_target": "" }
$solutionDir = [System.IO.Path]::GetDirectoryName($dte.Solution.FullName) + "\" $path = $installPath.Replace($solutionDir, "`$(SolutionDir)") $NativeAssembliesDir = Join-Path $path "NativeBinaries" $x86 = $(Join-Path $NativeAssembliesDir "x86\*.*") $LibGit2SharpPostBuildCmd = " xcopy /s /y `"$x86`" `"`$(TargetDir)`""
{ "content_hash": "393dc6269e59114f36d73c14fe8a14a0", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 79, "avg_line_length": 40, "alnum_prop": 0.696875, "repo_name": "paulcbetts/libgit2sharp", "id": "35cf68efa4d4813348ad58342f9b484fa041cae8", "size": "320", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "nuget.package/Tools/GetLibGit2SharpPostBuildCmd.ps1", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "259205" }, { "name": "Shell", "bytes": "14605" } ], "symlink_target": "" }