text
stringlengths
2
99.9k
meta
dict
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #import "ios/web/web_state/js/crw_js_post_request_loader.h" #include "base/json/string_escape.h" #import "base/strings/sys_string_conversions.h" #import "ios/web/web_state/js/page_script_util.h" #import "ios/web/web_state/ui/crw_wk_script_message_router.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support." #endif namespace { // Escapes characters and encloses given string in quotes for use in JavaScript. NSString* EscapeAndQuoteStringForJavaScript(NSString* unescapedString) { std::string string = base::SysNSStringToUTF8(unescapedString); return base::SysUTF8ToNSString(base::GetQuotedJSONString(string)); } // JavaScript message handler name installed in WKWebView for request errors. NSString* const kErrorHandlerName = @"POSTErrorHandler"; // JavaScript message handler name installed in WKWebView for successful // request completion. NSString* const kSuccessHandlerName = @"POSTSuccessHandler"; } // namespace @interface CRWJSPOSTRequestLoader () { NSString* _requestScript; } // JavaScript used to execute POST requests. Lazily instantiated. @property(nonatomic, copy, readonly) NSString* requestScript; // Handler for UIApplicationDidReceiveMemoryWarningNotification. - (void)handleMemoryWarning; // Forms a JavaScript method call to |requestScript| that executes given // |request|. - (NSString*)scriptToExecutePOSTRequest:(NSURLRequest*)request; // Converts a dictionary of HTTP request headers to a JavaScript object. - (NSString*)JSONForJavaScriptFromRequestHeaders:(NSDictionary*)headers; @end @implementation CRWJSPOSTRequestLoader - (instancetype)init { self = [super init]; if (self) { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleMemoryWarning) name:UIApplicationDidReceiveMemoryWarningNotification object:nil]; } return self; } - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; } - (NSString*)requestScript { if (!_requestScript) { _requestScript = [web::GetPageScript(@"post_request") copy]; } return _requestScript; } - (WKNavigation*)loadPOSTRequest:(NSURLRequest*)request inWebView:(WKWebView*)webView messageRouter:(CRWWKScriptMessageRouter*)messageRouter completionHandler:(void (^)(NSError*))completionHandler { DCHECK([request.HTTPMethod isEqualToString:@"POST"]); DCHECK(webView); DCHECK(messageRouter); DCHECK(completionHandler); // Install error handling and success routers. __weak CRWWKScriptMessageRouter* weakRouter = messageRouter; [messageRouter setScriptMessageHandler:^(WKScriptMessage* message) { // Cleaning up script handlers. [weakRouter removeScriptMessageHandlerForName:kErrorHandlerName webView:webView]; [weakRouter removeScriptMessageHandlerForName:kSuccessHandlerName webView:webView]; completionHandler(nil); } name:kSuccessHandlerName webView:webView]; [messageRouter setScriptMessageHandler:^(WKScriptMessage* message) { NSNumber* statusCode = message.body; NSError* error = [NSError errorWithDomain:NSURLErrorDomain code:statusCode.integerValue userInfo:nil]; [weakRouter removeScriptMessageHandlerForName:kErrorHandlerName webView:webView]; [weakRouter removeScriptMessageHandlerForName:kSuccessHandlerName webView:webView]; completionHandler(error); } name:kErrorHandlerName webView:webView]; NSString* HTML = [NSString stringWithFormat:@"<html><script>%@%@</script></html>", self.requestScript, [self scriptToExecutePOSTRequest:request]]; return [webView loadHTMLString:HTML baseURL:request.URL]; } #pragma mark - Private methods. - (void)handleMemoryWarning { // Request script can be recreated from file at any moment. _requestScript = nil; } - (NSString*)scriptToExecutePOSTRequest:(NSURLRequest*)request { NSDictionary* headers = [request allHTTPHeaderFields]; NSString* headerString = [self JSONForJavaScriptFromRequestHeaders:headers]; NSString* URLString = [[request URL] absoluteString]; NSString* contentType = headers[@"Content-Type"]; NSString* base64Data = [[request HTTPBody] base64EncodedStringWithOptions:0]; // Here |headerString| is already properly escaped when returned from // -JSONForJavaScriptFromRequestHeaders:. return [NSString stringWithFormat: @"__crPostRequestWorkaround.runPostRequest(%@, %@, %@, %@)", EscapeAndQuoteStringForJavaScript(URLString), headerString, EscapeAndQuoteStringForJavaScript(base64Data), EscapeAndQuoteStringForJavaScript(contentType)]; } - (NSString*)JSONForJavaScriptFromRequestHeaders:(NSDictionary*)headers { if (headers) { NSData* headerData = [NSJSONSerialization dataWithJSONObject:headers options:0 error:nil]; if (headerData) { // This string is properly escaped by NSJSONSerialization. It needs to // have no quotes since JavaScripts takes this parameter as an // Object<string, string>. return [[NSString alloc] initWithData:headerData encoding:NSUTF8StringEncoding]; } } return @"{}"; } @end
{ "pile_set_name": "Github" }
// CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: https://codemirror.net/LICENSE /* Multiplexing mode -- exactly like the original CodeMirror multiplexingMode, https://codemirror.net/demo/multiplex.html, except use the option start:true to make it so the mode switch pattern must be at the beginning of the line. Original copyright on https://codemirror.net/addon/mode/multiplex.js: CodeMirror, copyright (c) by Marijn Haverbeke and others Distributed under an MIT license: http://codemirror.net/LICENSE */ CodeMirror.cocalcMultiplexingMode = function (outer /*, others */) { // Others should be {open, close, mode [, delimStyle] [, innerStyle]} objects var others = Array.prototype.slice.call(arguments, 1); function indexOf(string, pattern, from, returnEnd) { if (typeof pattern == "string") { var found = string.indexOf(pattern, from); return returnEnd && found > -1 ? found + pattern.length : found; } var m = pattern.exec(from ? string.slice(from) : string); return m ? m.index + from + (returnEnd ? m[0].length : 0) : -1; } return { startState: function () { return { outer: CodeMirror.startState(outer), innerActive: null, inner: null, }; }, copyState: function (state) { return { outer: CodeMirror.copyState(outer, state.outer), innerActive: state.innerActive, inner: state.innerActive && CodeMirror.copyState(state.innerActive.mode, state.inner), }; }, token: function (stream, state) { if (!state.innerActive) { var cutOff = Infinity, oldContent = stream.string; for (var i = 0; i < others.length; ++i) { var other = others[i]; if ( // This is our modification of usptream. other.start && oldContent.slice(0, other.open.length) != other.open ) { continue; } var found = indexOf(oldContent, other.open, stream.pos); if (found == stream.pos) { if (!other.parseDelimiters) stream.match(other.open); state.innerActive = other; // Get the outer indent, making sure to handle CodeMirror.Pass var outerIndent = 0; if (outer.indent) { var possibleOuterIndent = outer.indent(state.outer, "", ""); if (possibleOuterIndent !== CodeMirror.Pass) outerIndent = possibleOuterIndent; } state.inner = CodeMirror.startState(other.mode, outerIndent); return ( other.delimStyle && other.delimStyle + " " + other.delimStyle + "-open" ); } else if (found != -1 && found < cutOff) { cutOff = found; } } if (cutOff != Infinity) stream.string = oldContent.slice(0, cutOff); var outerToken = outer.token(stream, state.outer); if (cutOff != Infinity) stream.string = oldContent; return outerToken; } else { var curInner = state.innerActive, oldContent = stream.string; if (!curInner.close && stream.sol()) { state.innerActive = state.inner = null; return this.token(stream, state); } var found = curInner.close ? indexOf( oldContent, curInner.close, stream.pos, curInner.parseDelimiters ) : -1; if (found == stream.pos && !curInner.parseDelimiters) { stream.match(curInner.close); state.innerActive = state.inner = null; return ( curInner.delimStyle && curInner.delimStyle + " " + curInner.delimStyle + "-close" ); } if (found > -1) stream.string = oldContent.slice(0, found); var innerToken = curInner.mode.token(stream, state.inner); if (found > -1) stream.string = oldContent; if (found == stream.pos && curInner.parseDelimiters) state.innerActive = state.inner = null; if (curInner.innerStyle) { if (innerToken) innerToken = innerToken + " " + curInner.innerStyle; else innerToken = curInner.innerStyle; } return innerToken; } }, indent: function (state, textAfter, line) { var mode = state.innerActive ? state.innerActive.mode : outer; if (!mode.indent) return CodeMirror.Pass; return mode.indent( state.innerActive ? state.inner : state.outer, textAfter, line ); }, blankLine: function (state) { var mode = state.innerActive ? state.innerActive.mode : outer; if (mode.blankLine) { mode.blankLine(state.innerActive ? state.inner : state.outer); } if (!state.innerActive) { for (var i = 0; i < others.length; ++i) { var other = others[i]; if (other.open === "\n") { state.innerActive = other; state.inner = CodeMirror.startState( other.mode, mode.indent ? mode.indent(state.outer, "", "") : 0 ); } } } else if (state.innerActive.close === "\n") { state.innerActive = state.inner = null; } }, electricChars: outer.electricChars, innerMode: function (state) { return state.inner ? { state: state.inner, mode: state.innerActive.mode } : { state: state.outer, mode: outer }; }, }; };
{ "pile_set_name": "Github" }
// // UIViewControlled+Extended.swift // Pokemon Weakness // // Created by Oscar Duran on 24/7/16. // Copyright © 2016 Skydev. All rights reserved. // import UIKit extension UIViewController { func present(viewController: UIViewController, animated: Bool = true) { presentViewController(viewController, animated: animated, completion: nil) } }
{ "pile_set_name": "Github" }
# Counter Counter application is the most simple and the basic example of ReactorKit. ![counter](https://user-images.githubusercontent.com/931655/30179038-0ba51cdc-93d9-11e7-95e4-9fb3000c6c3f.png)
{ "pile_set_name": "Github" }
/* * Copyright (C) 2001-2016 Food and Agriculture Organization of the * United Nations (FAO-UN), United Nations World Food Programme (WFP) * and United Nations Environment Programme (UNEP) * * 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 2 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; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Contact: Jeroen Ticheler - FAO - Viale delle Terme di Caracalla 2, * Rome - Italy. email: geonetwork@osgeo.org */ package org.fao.geonet.web; import jeeves.constants.Jeeves; import org.apache.commons.lang.StringUtils; import org.fao.geonet.ApplicationContextHolder; import org.fao.geonet.NodeInfo; import org.fao.geonet.api.exception.ResourceNotFoundException; import org.fao.geonet.domain.Source; import org.fao.geonet.domain.SourceType; import org.fao.geonet.repository.SourceRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.Lazy; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.view.RedirectView; import java.util.ArrayList; import java.util.Collections; import java.util.Enumeration; import java.util.HashSet; import java.util.List; import java.util.Set; import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; import static jeeves.config.springutil.JeevesDelegatingFilterProxy.getApplicationContextFromServletContext; /** * Handles requests where there is no locale and a redirect to a correct (and localized) service is * needed. Redirect should depend on the language of the users browser or the forced language. * <p/> * Created by Jesse on 12/4/13. */ @Controller @Lazy(value = true) public class LocaleRedirects { private static final String LANG_PARAMETER = "hl"; private static final String ACCEPT_LANGUAGE_HEADER = "Accept-Language"; private static final String ACCEPT_HEADER = "Accept"; private static final String ACCEPT_VALUE = "text/html"; private static final String REFERER_PARAMETER = "referer"; private static final String NODE_PARAMETER = "node"; private static final Set<String> SPECIAL_HEADERS; static { HashSet<String> headers = new HashSet<String>(); headers.add(LANG_PARAMETER); headers.add(REFERER_PARAMETER); SPECIAL_HEADERS = Collections.unmodifiableSet(headers); } private String _homeRedirectUrl = "catalog.search"; private String _portalHomeRedirectUrl = NodeInfo.DEFAULT_NODE + "/api/sources"; @Autowired DefaultLanguage defaultLanguage; @Autowired NodeInfo currentNode; @Autowired SourceRepository sourceRepository; /** * Handle redirect for / to the default node if no extra parameter. * Use /?node=A to redirect to a node * Use /?hl=fre to redirect to a specific language * * @param request * @param langCookie * @param langParam Define which lang to redirect to * @param portal Define which node to redirect to * @param langHeader * @return */ @RequestMapping(value = "/") public ModelAndView redirectRootPath(final HttpServletRequest request, @CookieValue(value = Jeeves.LANG_COOKIE, required = false) final String langCookie, @RequestHeader(value = ACCEPT_HEADER, required = false) final String accept, @RequestParam(value = LANG_PARAMETER, required = false) final String langParam, @RequestHeader(value = ACCEPT_LANGUAGE_HEADER, required = false) final String langHeader, @RequestParam(value = NODE_PARAMETER, required = false) String portal ) throws ResourceNotFoundException { String lang = lang(langParam, langCookie, langHeader); if (checkPortalExist(portal, !accept.startsWith(ACCEPT_VALUE))) { return redirectURL(createServiceUrl(request, _homeRedirectUrl, lang, portal)); } else { if (sourceRepository.findByType(SourceType.portal).size() == 0) { return redirectURL(createServiceUrl(request, _homeRedirectUrl, lang, NodeInfo.DEFAULT_NODE)); } // Redirect to list of portal page if more than one or the default if only one return redirectURL(_portalHomeRedirectUrl); } } /** * Handle redirect for /portalId * * @param request * @param portal * @param langCookie * @param langParam * @param langHeader * @return */ @RequestMapping(value = {"/{portal}", "/{portal}/"}) public ModelAndView redirectPortalPath(final HttpServletRequest request, @PathVariable String portal, @CookieValue(value = Jeeves.LANG_COOKIE, required = false) final String langCookie, @RequestHeader(value = ACCEPT_HEADER, required = false) final String accept, @RequestParam(value = LANG_PARAMETER, required = false) final String langParam, @RequestHeader(value = ACCEPT_LANGUAGE_HEADER, required = false) final String langHeader) throws ResourceNotFoundException { String lang = lang(langParam, langCookie, langHeader); if (checkPortalExist(portal, !accept.startsWith(ACCEPT_VALUE))) { return redirectURL(createServiceUrl(request, _homeRedirectUrl, lang, portal)); } else { if (sourceRepository.findByType(SourceType.subportal).size() == 0) { return redirectURL(createServiceUrl(request, _homeRedirectUrl, lang, NodeInfo.DEFAULT_NODE)); } // Redirect to list of portal page if more than one or the default if only one return redirectURL(_portalHomeRedirectUrl); } } /** * Check that the requested portal exist. *If not return the list of existing ones if requested one is not found. * * @param portal * @throws ResourceNotFoundException */ private boolean checkPortalExist(String portal, boolean throwException) throws ResourceNotFoundException { if (portal == null || NodeInfo.DEFAULT_NODE.equals(portal)) { // This is the default node return true; } final Source one = sourceRepository.findOne(portal); if (one == null) { List<String> portalList = new ArrayList<>(); portalList.add(NodeInfo.DEFAULT_NODE); sourceRepository.findByType(SourceType.subportal).forEach(e -> { portalList.add(e.getUuid()); }); if (throwException) { throw new ResourceNotFoundException(String.format( "No portal found with id '%s'. The list of available portals are: %s", portal, portalList.toString() )); } return false; } return true; } @RequestMapping(value = "/login.jsp") public ModelAndView login(final HttpServletRequest request, @RequestParam(value = LANG_PARAMETER, required = false) String langParam, @RequestParam(value = NODE_PARAMETER, required = false) String node, @CookieValue(value = Jeeves.LANG_COOKIE, required = false) String langCookie, @RequestHeader(value = ACCEPT_LANGUAGE_HEADER, required = false) final String langHeader) { String lang = lang(langParam, langCookie, langHeader); return redirectURL(createServiceUrl(request, "catalog.signin", lang, node)); } @RequestMapping(value = "/accessDenied.jsp") public ModelAndView accessDenied(final HttpServletRequest request, @RequestParam(value = LANG_PARAMETER, required = false) String langParam, @RequestParam(value = NODE_PARAMETER, required = false) String node, @CookieValue(value = Jeeves.LANG_COOKIE, required = false) String langCookie, @RequestParam(value = REFERER_PARAMETER, required = false) String referer, @RequestHeader(value = ACCEPT_LANGUAGE_HEADER, required = false) final String langHeader) { String lang = lang(langParam, langCookie, langHeader); if (referer == null || referer.trim().isEmpty() || referer.contains("accessDenied") || referer.contains("service-not-allowed")) { referer = "UNKNOWN"; } return redirectURL(createServiceUrl(request, "service-not-allowed?referer=" + referer, lang, node)); } private ModelAndView redirectURL(final String url) { RedirectView rv = new RedirectView(url); rv.setStatusCode(HttpStatus.FOUND); return new ModelAndView(rv); } private String createServiceUrl(HttpServletRequest request, String service, String lang, String node) { node = node == null ? currentNode.getId() : node; final Enumeration parameterNames = request.getParameterNames(); StringBuilder headers = new StringBuilder(); while (parameterNames.hasMoreElements()) { String paramName = (String) parameterNames.nextElement(); if (!SPECIAL_HEADERS.contains(paramName)) { for (String value : request.getParameterValues(paramName)) { if (headers.length() > 0) { headers.append('&'); } headers.append(paramName); if (!value.isEmpty()) { headers.append('=').append(value); } } } } final String queryString; if (headers.length() == 0) { queryString = ""; } else { if (service.contains("?")) { queryString = "&" + headers; } else { queryString = "?" + headers; } } return request.getContextPath() + "/" + node + "/" + lang + "/" + service + queryString; } private String lang(String langParam, String langCookie, String langHeader) { if (defaultLanguage.isForceDefault()) { return defaultLanguage.getLanguage(); } if (langParam != null) { return langParam; } if (langCookie != null) { return langCookie; } if (langHeader == null) { return defaultLanguage.getLanguage(); } String userLang = langHeader.split("-|,", 2)[0].toLowerCase(); if (userLang.matches("^en")) { userLang = "eng"; } else if (userLang.matches("^fr")) { userLang = "fre"; } else if (userLang.matches("^de")) { userLang = "ger"; } else if (userLang.matches("^it")) { userLang = "ita"; } else if (userLang.matches("^ca")) { userLang = "cat"; } else if (userLang.matches("^es")) { userLang = "spa"; } else if (userLang.matches("^fi")) { userLang = "fin"; } else if (userLang.matches("^pl")) { userLang = "pol"; } else if (userLang.matches("^no")) { userLang = "nor"; } else if (userLang.matches("^nl")) { userLang = "dut"; } else if (userLang.matches("^pt")) { userLang = "por"; } else if (userLang.matches("^ar")) { userLang = "ara"; } else if (userLang.matches("^zh")) { userLang = "chi"; } else if (userLang.matches("^ru")) { userLang = "rus"; } else if (userLang.matches("^tr")) { userLang = "tur"; } else { userLang = defaultLanguage.getLanguage(); } return userLang; } }
{ "pile_set_name": "Github" }
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Jun 9 2015 22:53:21). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2014 by Steve Nygard. // #import <Foundation/NSObject.h> #import "MacBuddyManager-Protocol.h" @class ADMUser, CloudConfigurationManager, NSData, NSNumber, NSString, SetupStateManager, iCloudManager; @interface LocalUserAccountManager : NSObject <MacBuddyManager> { ADMUser *_createdUser; NSString *userName; NSString *fullName; NSString *password; NSString *hint; NSData *userPictureData; BOOL isOpenDirectoryAccount; NSString *odUsername; NSString *odFullname; iCloudManager *icloudManager; CDUnknownBlockType _additionalApplySettingsBlock; BOOL shouldCreateUser; BOOL allowAppleIDLocalAccountPasswordReset; BOOL siriEnabled; BOOL _allowDiskUnlock; BOOL _usingExpressSetupValues; BOOL _locationServicesEnabled; SetupStateManager *setupStateManager; NSString *siriLanguageCode; CloudConfigurationManager *_cloudConfigManager; NSString *_diskUnlockPassword; NSString *_appleID; NSNumber *_deviceAnalyticsOptIn; NSNumber *_appAnalyticsOptIn; } + (id)_pickUserPicturePath; + (id)randomUserPictureData; + (BOOL)_setHiddenUsersListUser:(id)arg1 adding:(BOOL)arg2; + (id)_userWithName:(id)arg1 byFullName:(BOOL)arg2 localOnly:(BOOL)arg3; + (id)passwordContentCheck:(id)arg1 forUsername:(id)arg2; + (unsigned long long)getGlobalPasswordLengthPolicy; @property NSNumber *appAnalyticsOptIn; // @synthesize appAnalyticsOptIn=_appAnalyticsOptIn; @property NSNumber *deviceAnalyticsOptIn; // @synthesize deviceAnalyticsOptIn=_deviceAnalyticsOptIn; @property BOOL locationServicesEnabled; // @synthesize locationServicesEnabled=_locationServicesEnabled; @property(retain) NSString *appleID; // @synthesize appleID=_appleID; @property BOOL usingExpressSetupValues; // @synthesize usingExpressSetupValues=_usingExpressSetupValues; @property(retain) NSString *diskUnlockPassword; // @synthesize diskUnlockPassword=_diskUnlockPassword; @property BOOL allowDiskUnlock; // @synthesize allowDiskUnlock=_allowDiskUnlock; @property(retain) CloudConfigurationManager *cloudConfigManager; // @synthesize cloudConfigManager=_cloudConfigManager; @property(copy) NSString *siriLanguageCode; // @synthesize siriLanguageCode; @property BOOL siriEnabled; // @synthesize siriEnabled; @property BOOL allowAppleIDLocalAccountPasswordReset; // @synthesize allowAppleIDLocalAccountPasswordReset; @property(retain) SetupStateManager *setupStateManager; // @synthesize setupStateManager; @property BOOL shouldCreateUser; // @synthesize shouldCreateUser; @property(retain) iCloudManager *icloudManager; // @synthesize icloudManager; @property(copy) NSString *odFullname; // @synthesize odFullname; @property(copy) NSString *odUsername; // @synthesize odUsername; @property BOOL isOpenDirectoryAccount; // @synthesize isOpenDirectoryAccount; @property(retain) NSData *userPictureData; // @synthesize userPictureData; @property(retain) NSString *hint; // @synthesize hint; @property(retain) NSString *password; // @synthesize password; @property(retain) NSString *fullName; // @synthesize fullName; @property(retain) NSString *userName; // @synthesize userName; - (void).cxx_destruct; - (void)setAdditionalApplySettingsBlock:(CDUnknownBlockType)arg1; - (BOOL)siriVoiceTrainingExists; - (BOOL)siriVoiceTriggerSupported; - (BOOL)siriCanBeExpressSetup; - (BOOL)adminAccountExists:(id *)arg1:(id *)arg2; @property(readonly) BOOL adminAccountExists; @property(readonly) NSString *suggestedFullname; @property(readonly) BOOL canEnableAppleIDLocalAccountPasswordReset; - (BOOL)validatePassword:(id)arg1 forUserWithShortName:(id)arg2 localOnly:(BOOL)arg3; - (BOOL)nameIsReserved:(id)arg1; - (BOOL)userExistsWithFullName:(id)arg1 localOnly:(BOOL)arg2 outShortName:(id *)arg3; - (BOOL)userExistsWithShortName:(id)arg1 localOnly:(BOOL)arg2 outFullname:(id *)arg3; - (BOOL)applySettings:(id *)arg1; - (BOOL)commitUserAccount; - (id)preparedMBResumeDictionary; @property(readonly) ADMUser *createdUser; - (id)settingsStatusMessage; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end
{ "pile_set_name": "Github" }
// (C) Copyright 2005 Matthias Troyer // Use, modification and distribution is subject to 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) // See http://www.boost.org for updates, documentation, and revision history. #ifndef BOOST_SERIALIZATION_DETAIL_GET_DATA_HPP #define BOOST_SERIALIZATION_DETAIL_GET_DATA_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) # pragma once #endif #if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) #define STD _STLP_STD #else #define STD std #endif #include <vector> #include <valarray> namespace boost { namespace serialization { namespace detail { template <class T, class Allocator> T* get_data(STD::vector<T,Allocator>& v) { return v.empty() ? 0 : &(v[0]); } template <class T, class Allocator> T* get_data(STD::vector<T,Allocator> const & v) { return get_data(const_cast<STD::vector<T,Allocator>&>(v)); } template <class T> T* get_data(STD::valarray<T>& v) { return v.size()==0 ? 0 : &(v[0]); } template <class T> const T* get_data(STD::valarray<T> const& v) { return get_data(const_cast<STD::valarray<T>&>(v)); } } // detail } // serialization } // boost #undef STD #endif // BOOST_SERIALIZATION_DETAIL_GET_DATA_HPP
{ "pile_set_name": "Github" }
gcr.io/google_containers/kube-controller-manager:v1.7.1
{ "pile_set_name": "Github" }
package com.jbidwatcher.ui; /* * Copyright (c) 2000-2007, CyberFOX Software, Inc. All Rights Reserved. * * Developed by mrs (Morgan Schweers) */ import com.google.inject.Inject; import com.jbidwatcher.auction.EntryFactory; import com.jbidwatcher.util.queue.DropQObject; import com.jbidwatcher.util.queue.MessageQueue; import com.jbidwatcher.util.queue.MQFactory; import com.jbidwatcher.util.config.JConfig; import com.jbidwatcher.util.StringTools; import com.jbidwatcher.auction.server.AuctionServerManager; import com.jbidwatcher.auction.AuctionEntry; import com.jbidwatcher.auction.EntryCorral; public class JBWDropHandler implements MessageQueue.Listener { private static boolean do_uber_debug = false; private static String lastSeen = null; private EntryFactory entryFactory; private AuctionServerManager auctionServerManager; private EntryCorral entryCorral; private AuctionsManager auctionsManager; @Inject public JBWDropHandler(EntryFactory entryFactory, AuctionServerManager auctionServerManager, EntryCorral corral, AuctionsManager auctionsManager) { this.entryFactory = entryFactory; this.auctionServerManager = auctionServerManager; this.entryCorral = corral; this.auctionsManager = auctionsManager; MQFactory.getConcrete("drop").registerListener(this); } public void messageAction(Object deQ) { if (deQ instanceof String && StringTools.isNumberOnly((String)deQ)) { AuctionEntry ae = entryCorral.takeForRead((String) deQ); if (ae != null) { boolean lostAuction = !ae.hasAuction(); ae.update(); if (lostAuction) auctionsManager.addEntry(ae); return; } } String auctionURL; String label; boolean interactive; if(deQ instanceof String) { auctionURL = deQ.toString(); label = null; interactive = true; } else { DropQObject dObj = (DropQObject) deQ; auctionURL = (String) dObj.getData(); label = dObj.getLabel(); interactive = dObj.isInteractive(); } loadDroppedEntry(auctionURL, label, interactive); } private void loadDroppedEntry(String auctionURL, String label, boolean interactive) { if (do_uber_debug) JConfig.log().logDebug("Dropping (action): " + auctionURL); // Check to see if it's got a protocol ({protocol}:{path}) // If not, treat it as an item number alone, in the space of the default auction server. // If so, we get the identifier from the URL (which is multi-country), String aucId = auctionServerManager.getServer().stripId(auctionURL); if(EntryFactory.isInvalid(interactive, aucId)) return; // Create an auction entry from the id. AuctionEntry aeNew = entryFactory.conditionallyAddEntry(interactive, aucId, label); if(aeNew == null) { if (lastSeen == null || !aucId.equals(lastSeen)) { JConfig.log().logDebug("Not loaded (" + aucId + ")."); lastSeen = aucId; } } else { lastSeen = aeNew.getIdentifier(); } } }
{ "pile_set_name": "Github" }
/* * HafilatLookup.kt * * Copyright 2018 Google * * 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. If not, see <http://www.gnu.org/licenses/>. */ package au.id.micolous.metrodroid.transit.hafilat import au.id.micolous.metrodroid.multi.FormattedString import au.id.micolous.metrodroid.multi.R import au.id.micolous.metrodroid.multi.StringResource import au.id.micolous.metrodroid.time.MetroTimeZone import au.id.micolous.metrodroid.transit.TransitCurrency import au.id.micolous.metrodroid.transit.en1545.En1545LookupSTR object HafilatLookup : En1545LookupSTR("hafilat") { override val timeZone: MetroTimeZone get() = MetroTimeZone.DUBAI override fun parseCurrency(price: Int): TransitCurrency = TransitCurrency(price, "AED") internal fun isPurseTariff(agency: Int?, contractTariff: Int?): Boolean = agency == 1 && contractTariff in listOf(0x2710) override fun getRouteName(routeNumber: Int?, routeVariant: Int?, agency: Int?, transport: Int?) = FormattedString(routeNumber.toString()) override val subscriptionMap: Map<Int, StringResource> = mapOf( 0x2710 to R.string.adelaide_ticket_type_regular // TODO: handle other tickets ) }
{ "pile_set_name": "Github" }
{ "name": "chameleon-template-parse", "version": "1.0.5", "description": "", "main": "index.js", "scripts": { "eslint": "eslint ./src", "lint": "eslint --ext .js src --fix", "dev": "webpack-dev-server", "test": "mocha --recursive --reporter spec", "cover": "istanbul cover --report lcov node_modules/mocha/bin/_mocha -- -R spec --recursive" }, "author": "Chameleon-Team", "license": "Apache", "dependencies": { "@babel/generator": "^7.1.2", "@babel/parser": "^7.3.4", "@babel/plugin-syntax-jsx": "^7.0.0", "@babel/traverse": "^7.1.0", "@babel/types": "^7.1.2", "babylon": "^6.18.0", "hash-sum": "^1.0.2", "tapable": "^1.1.0" }, "devDependencies": { "chai": "^4.2.0", "chameleon-css-loader": "1.0.5", "chameleon-mixins": "1.0.5", "chameleon-tool-utils": "1.0.5", "clean-webpack-plugin": "^0.1.19", "coveralls": "^2.11.9", "eslint": "^5.9.0", "gulp": "^3.9.1", "gulp-uglify-es": "^1.0.4", "html-webpack-plugin": "^3.2.0", "istanbul": "^0.4.5", "mocha": "^5.2.0", "uglifyjs-webpack-plugin": "^2.0.1", "webpack": "^4.20.2", "webpack-cli": "^3.1.1", "webpack-dev-server": "^3.1.9" }, "mail": "ChameleonCore@didiglobal.com", "gitHead": "5ddcde4330774710f7646559446e008f7785ce00" }
{ "pile_set_name": "Github" }
/* * This file is part of the Chelsio T4 Ethernet driver for Linux. * * Copyright (c) 2015 Chelsio Communications, Inc. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU * General Public License (GPL) Version 2, available from the file * COPYING in the main directory of this source tree, or the * OpenIB.org BSD license below: * * Redistribution and use in source and binary forms, with or * without modification, are permitted provided that the following * conditions are met: * * - Redistributions of source code must retain the above * copyright notice, this list of conditions and the following * disclaimer. * * - Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials * provided with the distribution. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifdef CONFIG_CHELSIO_T4_FCOE #include <scsi/fc/fc_fs.h> #include <scsi/libfcoe.h> #include "cxgb4.h" bool cxgb_fcoe_sof_eof_supported(struct adapter *adap, struct sk_buff *skb) { struct fcoe_hdr *fcoeh = (struct fcoe_hdr *)skb_network_header(skb); u8 sof = fcoeh->fcoe_sof; u8 eof = 0; if ((sof != FC_SOF_I3) && (sof != FC_SOF_N3)) { dev_err(adap->pdev_dev, "Unsupported SOF 0x%x\n", sof); return false; } skb_copy_bits(skb, skb->len - 4, &eof, 1); if ((eof != FC_EOF_N) && (eof != FC_EOF_T)) { dev_err(adap->pdev_dev, "Unsupported EOF 0x%x\n", eof); return false; } return true; } /** * cxgb_fcoe_enable - enable FCoE offload features * @netdev: net device * * Returns 0 on success or -EINVAL on failure. */ int cxgb_fcoe_enable(struct net_device *netdev) { struct port_info *pi = netdev_priv(netdev); struct adapter *adap = pi->adapter; struct cxgb_fcoe *fcoe = &pi->fcoe; if (is_t4(adap->params.chip)) return -EINVAL; if (!(adap->flags & FULL_INIT_DONE)) return -EINVAL; dev_info(adap->pdev_dev, "Enabling FCoE offload features\n"); netdev->features |= NETIF_F_FCOE_CRC; netdev->vlan_features |= NETIF_F_FCOE_CRC; netdev->features |= NETIF_F_FCOE_MTU; netdev->vlan_features |= NETIF_F_FCOE_MTU; netdev_features_change(netdev); fcoe->flags |= CXGB_FCOE_ENABLED; return 0; } /** * cxgb_fcoe_disable - disable FCoE offload * @netdev: net device * * Returns 0 on success or -EINVAL on failure. */ int cxgb_fcoe_disable(struct net_device *netdev) { struct port_info *pi = netdev_priv(netdev); struct adapter *adap = pi->adapter; struct cxgb_fcoe *fcoe = &pi->fcoe; if (!(fcoe->flags & CXGB_FCOE_ENABLED)) return -EINVAL; dev_info(adap->pdev_dev, "Disabling FCoE offload features\n"); fcoe->flags &= ~CXGB_FCOE_ENABLED; netdev->features &= ~NETIF_F_FCOE_CRC; netdev->vlan_features &= ~NETIF_F_FCOE_CRC; netdev->features &= ~NETIF_F_FCOE_MTU; netdev->vlan_features &= ~NETIF_F_FCOE_MTU; netdev_features_change(netdev); return 0; } #endif /* CONFIG_CHELSIO_T4_FCOE */
{ "pile_set_name": "Github" }
apiVersion: k8s.nginx.org/v1 kind: VirtualServerRoute metadata: name: backends spec: host: virtual-server-route.example.com subroutes: - path: "/backends/canned-response" action: return: code: 407 # not required. the default is 200 type: application/json # not required. default is text/plain body: '{ \"host\": \"${host}\", \"request_time\": \"${request_time}\", \"pid\": \"${pid}\", \"server_protocol\": \"${server_protocol}\", \"connections_active\": \"${connections_active}\", \"connections_writing\": \"${connections_writing}\", \"request_uri\": \"${request_uri}\", \"remote_addr\": \"${remote_addr}\", \"remote_port\": \"${remote_port}\", \"server_addr\": \"${server_addr}\", \"request_method\": \"${request_method}\", \"scheme\": \"${scheme}\", \"request_length\": \"${request_length}\", \"nginx_version\": \"${nginx_version}\", \"connection\": \"${connection}\", \"time_local\": \"${time_local}\", \"server_port\": \"${server_port}\", \"server_name\": \"${server_name}\", \"connections_waiting\": \"${connections_waiting}\", \"request_body\": \"${request_body}\", \"args\": \"${args}\", \"time_iso8601\": \"${time_iso8601}\", \"connections_reading\": \"${connections_reading}\" }' - path: "/backends/canned-defaults" action: return: body: | line1 line2 line3
{ "pile_set_name": "Github" }
/* crc32.c -- compute the CRC-32 of a data stream * Copyright (C) 1995-2006, 2010, 2011, 2012, 2016 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h * * Thanks to Rodney Brown <rbrown64@csc.com.au> for his contribution of faster * CRC methods: exclusive-oring 32 bits of data at a time, and pre-computing * tables for updating the shift register in one step with three exclusive-ors * instead of four steps with four exclusive-ors. This results in about a * factor of two increase in speed on a Power PC G4 (PPC7455) using gcc -O3. */ /* @(#) $Id$ */ /* Note on the use of DYNAMIC_CRC_TABLE: there is no mutex or semaphore protection on the static variables used to control the first-use generation of the crc tables. Therefore, if you #define DYNAMIC_CRC_TABLE, you should first call get_crc_table() to initialize the tables before allowing more than one thread to use crc32(). DYNAMIC_CRC_TABLE and MAKECRCH can be #defined to write out crc32.h. */ #ifdef MAKECRCH # include <stdio.h> # ifndef DYNAMIC_CRC_TABLE # define DYNAMIC_CRC_TABLE # endif /* !DYNAMIC_CRC_TABLE */ #endif /* MAKECRCH */ #include "zutil.h" /* for STDC and FAR definitions */ /* Definitions for doing the crc four data bytes at a time. */ #if !defined(NOBYFOUR) && defined(Z_U4) # define BYFOUR #endif #ifdef BYFOUR local unsigned long crc32_little OF((unsigned long, const unsigned char FAR *, z_size_t)); local unsigned long crc32_big OF((unsigned long, const unsigned char FAR *, z_size_t)); # define TBLS 8 #else # define TBLS 1 #endif /* BYFOUR */ /* Local functions for crc concatenation */ local unsigned long gf2_matrix_times OF((unsigned long *mat, unsigned long vec)); local void gf2_matrix_square OF((unsigned long *square, unsigned long *mat)); local uLong crc32_combine_ OF((uLong crc1, uLong crc2, z_off64_t len2)); #ifdef DYNAMIC_CRC_TABLE local volatile int crc_table_empty = 1; local z_crc_t FAR crc_table[TBLS][256]; local void make_crc_table OF((void)); #ifdef MAKECRCH local void write_table OF((FILE *, const z_crc_t FAR *)); #endif /* MAKECRCH */ /* Generate tables for a byte-wise 32-bit CRC calculation on the polynomial: x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1. Polynomials over GF(2) are represented in binary, one bit per coefficient, with the lowest powers in the most significant bit. Then adding polynomials is just exclusive-or, and multiplying a polynomial by x is a right shift by one. If we call the above polynomial p, and represent a byte as the polynomial q, also with the lowest power in the most significant bit (so the byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p, where a mod b means the remainder after dividing a by b. This calculation is done using the shift-register method of multiplying and taking the remainder. The register is initialized to zero, and for each incoming bit, x^32 is added mod p to the register if the bit is a one (where x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by x (which is shifting right by one and adding x^32 mod p if the bit shifted out is a one). We start with the highest power (least significant bit) of q and repeat for all eight bits of q. The first table is simply the CRC of all possible eight bit values. This is all the information needed to generate CRCs on data a byte at a time for all combinations of CRC register values and incoming bytes. The remaining tables allow for word-at-a-time CRC calculation for both big-endian and little- endian machines, where a word is four bytes. */ local void make_crc_table() { z_crc_t c; int n, k; z_crc_t poly; /* polynomial exclusive-or pattern */ /* terms of polynomial defining this crc (except x^32): */ static volatile int first = 1; /* flag to limit concurrent making */ static const unsigned char p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26}; /* See if another task is already doing this (not thread-safe, but better than nothing -- significantly reduces duration of vulnerability in case the advice about DYNAMIC_CRC_TABLE is ignored) */ if (first) { first = 0; /* make exclusive-or pattern from polynomial (0xedb88320UL) */ poly = 0; for (n = 0; n < (int)(sizeof(p)/sizeof(unsigned char)); n++) poly |= (z_crc_t)1 << (31 - p[n]); /* generate a crc for every 8-bit value */ for (n = 0; n < 256; n++) { c = (z_crc_t)n; for (k = 0; k < 8; k++) c = c & 1 ? poly ^ (c >> 1) : c >> 1; crc_table[0][n] = c; } #ifdef BYFOUR /* generate crc for each value followed by one, two, and three zeros, and then the byte reversal of those as well as the first table */ for (n = 0; n < 256; n++) { c = crc_table[0][n]; crc_table[4][n] = ZSWAP32(c); for (k = 1; k < 4; k++) { c = crc_table[0][c & 0xff] ^ (c >> 8); crc_table[k][n] = c; crc_table[k + 4][n] = ZSWAP32(c); } } #endif /* BYFOUR */ crc_table_empty = 0; } else { /* not first */ /* wait for the other guy to finish (not efficient, but rare) */ while (crc_table_empty) ; } #ifdef MAKECRCH /* write out CRC tables to crc32.h */ { FILE *out; out = fopen("crc32.h", "w"); if (out == NULL) return; fprintf(out, "/* crc32.h -- tables for rapid CRC calculation\n"); fprintf(out, " * Generated automatically by crc32.c\n */\n\n"); fprintf(out, "local const z_crc_t FAR "); fprintf(out, "crc_table[TBLS][256] =\n{\n {\n"); write_table(out, crc_table[0]); # ifdef BYFOUR fprintf(out, "#ifdef BYFOUR\n"); for (k = 1; k < 8; k++) { fprintf(out, " },\n {\n"); write_table(out, crc_table[k]); } fprintf(out, "#endif\n"); # endif /* BYFOUR */ fprintf(out, " }\n};\n"); fclose(out); } #endif /* MAKECRCH */ } #ifdef MAKECRCH local void write_table(out, table) FILE *out; const z_crc_t FAR *table; { int n; for (n = 0; n < 256; n++) fprintf(out, "%s0x%08lxUL%s", n % 5 ? "" : " ", (unsigned long)(table[n]), n == 255 ? "\n" : (n % 5 == 4 ? ",\n" : ", ")); } #endif /* MAKECRCH */ #else /* !DYNAMIC_CRC_TABLE */ /* ======================================================================== * Tables of CRC-32s of all single-byte values, made by make_crc_table(). */ #include "crc32.h" #endif /* DYNAMIC_CRC_TABLE */ /* ========================================================================= * This function can be used by asm versions of crc32() */ const z_crc_t FAR * ZEXPORT get_crc_table() { #ifdef DYNAMIC_CRC_TABLE if (crc_table_empty) make_crc_table(); #endif /* DYNAMIC_CRC_TABLE */ return (const z_crc_t FAR *)crc_table; } /* ========================================================================= */ #define DO1 crc = crc_table[0][((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8) #define DO8 DO1; DO1; DO1; DO1; DO1; DO1; DO1; DO1 /* ========================================================================= */ unsigned long ZEXPORT crc32_z(crc, buf, len) unsigned long crc; const unsigned char FAR *buf; z_size_t len; { if (buf == Z_NULL) return 0UL; #ifdef DYNAMIC_CRC_TABLE if (crc_table_empty) make_crc_table(); #endif /* DYNAMIC_CRC_TABLE */ #ifdef BYFOUR if (sizeof(void *) == sizeof(ptrdiff_t)) { z_crc_t endian; endian = 1; if (*((unsigned char *)(&endian))) return crc32_little(crc, buf, len); else return crc32_big(crc, buf, len); } #endif /* BYFOUR */ crc = crc ^ 0xffffffffUL; while (len >= 8) { DO8; len -= 8; } if (len) do { DO1; } while (--len); return crc ^ 0xffffffffUL; } /* ========================================================================= */ unsigned long ZEXPORT crc32(crc, buf, len) unsigned long crc; const unsigned char FAR *buf; uInt len; { return crc32_z(crc, buf, len); } #ifdef BYFOUR /* This BYFOUR code accesses the passed unsigned char * buffer with a 32-bit integer pointer type. This violates the strict aliasing rule, where a compiler can assume, for optimization purposes, that two pointers to fundamentally different types won't ever point to the same memory. This can manifest as a problem only if one of the pointers is written to. This code only reads from those pointers. So long as this code remains isolated in this compilation unit, there won't be a problem. For this reason, this code should not be copied and pasted into a compilation unit in which other code writes to the buffer that is passed to these routines. */ /* ========================================================================= */ #define DOLIT4 c ^= *buf4++; \ c = crc_table[3][c & 0xff] ^ crc_table[2][(c >> 8) & 0xff] ^ \ crc_table[1][(c >> 16) & 0xff] ^ crc_table[0][c >> 24] #define DOLIT32 DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4 /* ========================================================================= */ local unsigned long crc32_little(crc, buf, len) unsigned long crc; const unsigned char FAR *buf; z_size_t len; { register z_crc_t c; register const z_crc_t FAR *buf4; c = (z_crc_t)crc; c = ~c; while (len && ((ptrdiff_t)buf & 3)) { c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8); len--; } buf4 = (const z_crc_t FAR *)(const void FAR *)buf; while (len >= 32) { DOLIT32; len -= 32; } while (len >= 4) { DOLIT4; len -= 4; } buf = (const unsigned char FAR *)buf4; if (len) do { c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8); } while (--len); c = ~c; return (unsigned long)c; } /* ========================================================================= */ #define DOBIG4 c ^= *buf4++; \ c = crc_table[4][c & 0xff] ^ crc_table[5][(c >> 8) & 0xff] ^ \ crc_table[6][(c >> 16) & 0xff] ^ crc_table[7][c >> 24] #define DOBIG32 DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4 /* ========================================================================= */ local unsigned long crc32_big(crc, buf, len) unsigned long crc; const unsigned char FAR *buf; z_size_t len; { register z_crc_t c; register const z_crc_t FAR *buf4; c = ZSWAP32((z_crc_t)crc); c = ~c; while (len && ((ptrdiff_t)buf & 3)) { c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8); len--; } buf4 = (const z_crc_t FAR *)(const void FAR *)buf; while (len >= 32) { DOBIG32; len -= 32; } while (len >= 4) { DOBIG4; len -= 4; } buf = (const unsigned char FAR *)buf4; if (len) do { c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8); } while (--len); c = ~c; return (unsigned long)(ZSWAP32(c)); } #endif /* BYFOUR */ #define GF2_DIM 32 /* dimension of GF(2) vectors (length of CRC) */ /* ========================================================================= */ local unsigned long gf2_matrix_times(mat, vec) unsigned long *mat; unsigned long vec; { unsigned long sum; sum = 0; while (vec) { if (vec & 1) sum ^= *mat; vec >>= 1; mat++; } return sum; } /* ========================================================================= */ local void gf2_matrix_square(square, mat) unsigned long *square; unsigned long *mat; { int n; for (n = 0; n < GF2_DIM; n++) square[n] = gf2_matrix_times(mat, mat[n]); } /* ========================================================================= */ local uLong crc32_combine_(crc1, crc2, len2) uLong crc1; uLong crc2; z_off64_t len2; { int n; unsigned long row; unsigned long even[GF2_DIM]; /* even-power-of-two zeros operator */ unsigned long odd[GF2_DIM]; /* odd-power-of-two zeros operator */ /* degenerate case (also disallow negative lengths) */ if (len2 <= 0) return crc1; /* put operator for one zero bit in odd */ odd[0] = 0xedb88320UL; /* CRC-32 polynomial */ row = 1; for (n = 1; n < GF2_DIM; n++) { odd[n] = row; row <<= 1; } /* put operator for two zero bits in even */ gf2_matrix_square(even, odd); /* put operator for four zero bits in odd */ gf2_matrix_square(odd, even); /* apply len2 zeros to crc1 (first square will put the operator for one zero byte, eight zero bits, in even) */ do { /* apply zeros operator for this bit of len2 */ gf2_matrix_square(even, odd); if (len2 & 1) crc1 = gf2_matrix_times(even, crc1); len2 >>= 1; /* if no more bits set, then done */ if (len2 == 0) break; /* another iteration of the loop with odd and even swapped */ gf2_matrix_square(odd, even); if (len2 & 1) crc1 = gf2_matrix_times(odd, crc1); len2 >>= 1; /* if no more bits set, then done */ } while (len2 != 0); /* return combined crc */ crc1 ^= crc2; return crc1; } /* ========================================================================= */ uLong ZEXPORT crc32_combine(crc1, crc2, len2) uLong crc1; uLong crc2; z_off_t len2; { return crc32_combine_(crc1, crc2, len2); } uLong ZEXPORT crc32_combine64(crc1, crc2, len2) uLong crc1; uLong crc2; z_off64_t len2; { return crc32_combine_(crc1, crc2, len2); }
{ "pile_set_name": "Github" }
<resources> <!-- Base application theme for API 14+. This theme completely replaces AppBaseTheme from BOTH res/values/styles.xml and res/values-v11/styles.xml on API 14+ devices. --> <style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar"> <!-- API 14 theme customizations can go here. --> </style> </resources>
{ "pile_set_name": "Github" }
// Copyright (c) The Libra Core Contributors // SPDX-License-Identifier: Apache-2.0 use libra_secure_push_metrics::{register_int_counter_vec, IntCounterVec}; use once_cell::sync::Lazy; /// The metrics counter for the key manager. static COUNTER: Lazy<IntCounterVec> = Lazy::new(|| { register_int_counter_vec!( "libra_key_manager_state", "Outcome for key operations", &["key", "state"] ) .unwrap() }); /// Metric counter keys. const CHECK_KEYS: &str = "check_keys"; const CONSENSUS_KEY: &str = "consensus_key"; /// Metric counter states. pub const KEYS_STILL_FRESH: &[&str] = &[CHECK_KEYS, "keys_still_fresh"]; pub const LIVENESS_ERROR_ENCOUNTERED: &[&str] = &[CHECK_KEYS, "liveness_error_encountered"]; pub const NO_ACTION: &[&str] = &[CHECK_KEYS, "no_action"]; pub const ROTATED_IN_STORAGE: &[&str] = &[CONSENSUS_KEY, "rotated_in_storage"]; pub const SUBMITTED_ROTATION_TRANSACTION: &[&str] = &[CONSENSUS_KEY, "submitted_rotation_transaction"]; pub const WAITING_ON_RECONFIGURATION: &[&str] = &[CHECK_KEYS, "waiting_on_reconfiguration"]; pub const WAITING_ON_TRANSACTION_EXECUTION: &[&str] = &[CHECK_KEYS, "waiting_on_transaction_execution"]; pub const UNEXPECTED_ERROR_ENCOUNTERED: &[&str] = &[CHECK_KEYS, "unexpected_error_encountered"]; /// Initializes all metric counter states. pub fn initialize_all_metric_counters() { let metric_counter_states = &[ KEYS_STILL_FRESH, LIVENESS_ERROR_ENCOUNTERED, NO_ACTION, ROTATED_IN_STORAGE, SUBMITTED_ROTATION_TRANSACTION, WAITING_ON_RECONFIGURATION, WAITING_ON_TRANSACTION_EXECUTION, UNEXPECTED_ERROR_ENCOUNTERED, ]; let _ = metric_counter_states .iter() .for_each(|metric_counter_state| { COUNTER.with_label_values(metric_counter_state).reset(); }); } /// Increments a metric counter state. pub fn increment_metric_counter(metric_counter_state: &[&str]) { COUNTER.with_label_values(metric_counter_state).inc(); }
{ "pile_set_name": "Github" }
require 'net/http' module Integrations module Slack class Service def self.send(private_uri, project_channel, bot_username, message) self.new(private_uri, project_channel, bot_username).send(message) end def initialize(private_uri, project_channel = 'off-topic', bot_username = 'marvin') @private_uri = URI.parse(private_uri) @project_channel = project_channel @bot_username = bot_username end def send(text) if Rails.env.development? Rails.logger.debug('NOT SENDING TO OUTSIDE INTEGRATION!') Rails.logger.debug("URL: #{@private_uri}") Rails.logger.debug("Payload: #{payload(text)}") else Net::HTTP.post_form(@private_uri, 'payload' => payload(text)) end end def payload(text) { username: @bot_username, channel: @project_channel, attachments: text }.to_json end end end end
{ "pile_set_name": "Github" }
/* * Copyright (c) 2012 GCT Semiconductor, Inc. All rights reserved. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * 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. */ #include <linux/uaccess.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/mm.h> #include <linux/usb.h> #include <linux/unistd.h> #include <linux/slab.h> #include <linux/firmware.h> #include <asm/byteorder.h> #include "gdm_usb.h" #include "usb_boot.h" #define DN_KERNEL_MAGIC_NUMBER 0x10760001 #define DN_ROOTFS_MAGIC_NUMBER 0x10760002 #define DOWNLOAD_SIZE 1024 #define MAX_IMG_CNT 16 #define FW_DIR "gdm72xx/" #define FW_UIMG "gdmuimg.bin" #define FW_KERN "zImage" #define FW_FS "ramdisk.jffs2" struct dn_header { __be32 magic_num; __be32 file_size; }; struct img_header { u32 magic_code; u32 count; u32 len; u32 offset[MAX_IMG_CNT]; char hostname[32]; char date[32]; }; struct fw_info { u32 id; u32 len; u32 kernel_len; u32 rootfs_len; u32 kernel_offset; u32 rootfs_offset; u32 fw_ver; u32 mac_ver; char hostname[32]; char userid[16]; char date[32]; char user_desc[128]; }; static void array_le32_to_cpu(u32 *arr, int num) { int i; for (i = 0; i < num; i++, arr++) le32_to_cpus(arr); } static u8 *tx_buf; static int gdm_wibro_send(struct usb_device *usbdev, void *data, int len) { int ret; int actual; ret = usb_bulk_msg(usbdev, usb_sndbulkpipe(usbdev, 1), data, len, &actual, 1000); if (ret < 0) { dev_err(&usbdev->dev, "Error : usb_bulk_msg ( result = %d )\n", ret); return ret; } return 0; } static int gdm_wibro_recv(struct usb_device *usbdev, void *data, int len) { int ret; int actual; ret = usb_bulk_msg(usbdev, usb_rcvbulkpipe(usbdev, 2), data, len, &actual, 5000); if (ret < 0) { dev_err(&usbdev->dev, "Error : usb_bulk_msg(recv) ( result = %d )\n", ret); return ret; } return 0; } static int download_image(struct usb_device *usbdev, const struct firmware *firm, loff_t pos, u32 img_len, u32 magic_num) { struct dn_header h; int ret = 0; u32 size; size = ALIGN(img_len, DOWNLOAD_SIZE); h.magic_num = cpu_to_be32(magic_num); h.file_size = cpu_to_be32(size); ret = gdm_wibro_send(usbdev, &h, sizeof(h)); if (ret < 0) return ret; while (img_len > 0) { if (img_len > DOWNLOAD_SIZE) size = DOWNLOAD_SIZE; else size = img_len; /* the last chunk of data */ memcpy(tx_buf, firm->data + pos, size); ret = gdm_wibro_send(usbdev, tx_buf, size); if (ret < 0) return ret; img_len -= size; pos += size; } return ret; } int usb_boot(struct usb_device *usbdev, u16 pid) { int i, ret = 0; struct img_header hdr; struct fw_info fw_info; loff_t pos = 0; char *img_name = FW_DIR FW_UIMG; const struct firmware *firm; ret = request_firmware(&firm, img_name, &usbdev->dev); if (ret < 0) { dev_err(&usbdev->dev, "requesting firmware %s failed with error %d\n", img_name, ret); return ret; } tx_buf = kmalloc(DOWNLOAD_SIZE, GFP_KERNEL); if (tx_buf == NULL) return -ENOMEM; if (firm->size < sizeof(hdr)) { dev_err(&usbdev->dev, "Cannot read the image info.\n"); ret = -EIO; goto out; } memcpy(&hdr, firm->data, sizeof(hdr)); array_le32_to_cpu((u32 *)&hdr, 19); if (hdr.count > MAX_IMG_CNT) { dev_err(&usbdev->dev, "Too many images. %d\n", hdr.count); ret = -EINVAL; goto out; } for (i = 0; i < hdr.count; i++) { if (hdr.offset[i] > hdr.len) { dev_err(&usbdev->dev, "Invalid offset. Entry = %d Offset = 0x%08x Image length = 0x%08x\n", i, hdr.offset[i], hdr.len); ret = -EINVAL; goto out; } pos = hdr.offset[i]; if (firm->size < sizeof(fw_info) + pos) { dev_err(&usbdev->dev, "Cannot read the FW info.\n"); ret = -EIO; goto out; } memcpy(&fw_info, firm->data + pos, sizeof(fw_info)); array_le32_to_cpu((u32 *)&fw_info, 8); if ((fw_info.id & 0xffff) != pid) continue; pos = hdr.offset[i] + fw_info.kernel_offset; if (firm->size < fw_info.kernel_len + pos) { dev_err(&usbdev->dev, "Kernel FW is too small.\n"); goto out; } ret = download_image(usbdev, firm, pos, fw_info.kernel_len, DN_KERNEL_MAGIC_NUMBER); if (ret < 0) goto out; dev_info(&usbdev->dev, "GCT: Kernel download success.\n"); pos = hdr.offset[i] + fw_info.rootfs_offset; if (firm->size < fw_info.rootfs_len + pos) { dev_err(&usbdev->dev, "Filesystem FW is too small.\n"); goto out; } ret = download_image(usbdev, firm, pos, fw_info.rootfs_len, DN_ROOTFS_MAGIC_NUMBER); if (ret < 0) goto out; dev_info(&usbdev->dev, "GCT: Filesystem download success.\n"); break; } if (i == hdr.count) { dev_err(&usbdev->dev, "Firmware for gsk%x is not installed.\n", pid); ret = -EINVAL; } out: release_firmware(firm); kfree(tx_buf); return ret; } /*#define GDM7205_PADDING 256 */ #define DOWNLOAD_CHUCK 2048 #define KERNEL_TYPE_STRING "linux" #define FS_TYPE_STRING "rootfs" static int em_wait_ack(struct usb_device *usbdev, int send_zlp) { int ack; int ret = -1; if (send_zlp) { /*Send ZLP*/ ret = gdm_wibro_send(usbdev, NULL, 0); if (ret < 0) goto out; } /*Wait for ACK*/ ret = gdm_wibro_recv(usbdev, &ack, sizeof(ack)); if (ret < 0) goto out; out: return ret; } static int em_download_image(struct usb_device *usbdev, const char *img_name, char *type_string) { char *buf = NULL; loff_t pos = 0; int ret = 0; int len; int img_len; const struct firmware *firm; #if defined(GDM7205_PADDING) const int pad_size = GDM7205_PADDING; #else const int pad_size = 0; #endif ret = request_firmware(&firm, img_name, &usbdev->dev); if (ret < 0) { dev_err(&usbdev->dev, "requesting firmware %s failed with error %d\n", img_name, ret); return ret; } buf = kmalloc(DOWNLOAD_CHUCK + pad_size, GFP_KERNEL); if (buf == NULL) return -ENOMEM; strcpy(buf+pad_size, type_string); ret = gdm_wibro_send(usbdev, buf, strlen(type_string)+pad_size); if (ret < 0) goto out; img_len = firm->size; if (img_len <= 0) { ret = -1; goto out; } while (img_len > 0) { if (img_len > DOWNLOAD_CHUCK) len = DOWNLOAD_CHUCK; else len = img_len; /* the last chunk of data */ memcpy(buf+pad_size, firm->data + pos, len); ret = gdm_wibro_send(usbdev, buf, len+pad_size); if (ret < 0) goto out; img_len -= DOWNLOAD_CHUCK; pos += DOWNLOAD_CHUCK; ret = em_wait_ack(usbdev, ((len+pad_size) % 512 == 0)); if (ret < 0) goto out; } ret = em_wait_ack(usbdev, 1); if (ret < 0) goto out; out: release_firmware(firm); kfree(buf); return ret; } static int em_fw_reset(struct usb_device *usbdev) { /*Send ZLP*/ return gdm_wibro_send(usbdev, NULL, 0); } int usb_emergency(struct usb_device *usbdev) { int ret; const char *kern_name = FW_DIR FW_KERN; const char *fs_name = FW_DIR FW_FS; ret = em_download_image(usbdev, kern_name, KERNEL_TYPE_STRING); if (ret < 0) return ret; dev_err(&usbdev->dev, "GCT Emergency: Kernel download success.\n"); ret = em_download_image(usbdev, fs_name, FS_TYPE_STRING); if (ret < 0) return ret; dev_info(&usbdev->dev, "GCT Emergency: Filesystem download success.\n"); ret = em_fw_reset(usbdev); return ret; }
{ "pile_set_name": "Github" }
/* * Copyright Red Hat Inc. and/or its affiliates and other contributors * as indicated by the authors tag. All rights reserved. * * This copyrighted material is made available to anyone wishing to use, * modify, copy, or redistribute it subject to the terms and conditions * of the GNU General Public License version 2. * * This particular file is subject to the "Classpath" exception as provided in the * LICENSE file that accompanied this code. * * This program is distributed in the hope that it will be useful, but WITHOUT A * 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 distribution; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. */ shared String constAbc = "abcdef"; shared String constLoremIpsumSingleLine = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."; shared String constLoremIpsumMultiLine = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."; shared String[] constAbcArray = [ "abc", "def", "xyz"]; shared Character constCharA = 'A'; shared Character constCharAngstromSign = '\{#212B}'; shared Integer constNumZero = 0; shared Integer constNumTwo = constNumZero + 1 + 1; shared Integer constNumMilion = 1_000_000; shared Float constNumPI = 3.14;
{ "pile_set_name": "Github" }
// Copyright 2018 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "components/download/internal/common/download_db_cache.h" #include <memory> #include "base/bind.h" #include "base/guid.h" #include "base/run_loop.h" #include "base/test/task_environment.h" #include "base/test/test_mock_time_task_runner.h" #include "components/download/database/download_db_conversions.h" #include "components/download/database/download_db_entry.h" #include "components/download/database/download_db_impl.h" #include "components/download/database/in_progress/download_entry.h" #include "components/download/public/common/download_item_impl.h" #include "components/download/public/common/download_utils.h" #include "components/download/public/common/mock_download_item.h" #include "components/leveldb_proto/testing/fake_db.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" using testing::_; using testing::Return; using testing::ReturnRefOfCopy; namespace download { namespace { DownloadDBEntry CreateDownloadDBEntry() { DownloadDBEntry entry; DownloadInfo download_info; download_info.in_progress_info = InProgressInfo(); download_info.guid = base::GenerateGUID(); static int id = 0; download_info.id = ++id; download_info.in_progress_info->hash = "abc"; entry.download_info = download_info; return entry; } std::string GetKey(const std::string& guid) { return DownloadNamespaceToString( DownloadNamespace::NAMESPACE_BROWSER_DOWNLOAD) + "," + guid; } // Clean up an in-progress entry that's loaded from the download DB, since // newly loaded entries should be in an interrupted state. void CleanUpInProgressEntry(DownloadDBEntry* entry) { entry->download_info->in_progress_info->state = DownloadItem::INTERRUPTED; entry->download_info->in_progress_info->interrupt_reason = DOWNLOAD_INTERRUPT_REASON_CRASH; entry->download_info->in_progress_info->hash = std::string(); } } // namespace class DownloadDBCacheTest : public testing::Test { public: DownloadDBCacheTest() : db_(nullptr), task_runner_(new base::TestMockTimeTaskRunner) {} ~DownloadDBCacheTest() override = default; void CreateDBCache() { auto db = std::make_unique< leveldb_proto::test::FakeDB<download_pb::DownloadDBEntry>>( &db_entries_); db_ = db.get(); auto download_db = std::make_unique<DownloadDBImpl>( DownloadNamespace::NAMESPACE_BROWSER_DOWNLOAD, std::move(db)); db_cache_ = std::make_unique<DownloadDBCache>(std::move(download_db)); db_cache_->SetTimerTaskRunnerForTesting(task_runner_); } void InitCallback(std::vector<DownloadDBEntry>* loaded_entries, bool success, std::unique_ptr<std::vector<DownloadDBEntry>> entries) { loaded_entries->swap(*entries); } void PrepopulateSampleEntries() { DownloadDBEntry first = CreateDownloadDBEntry(); DownloadDBEntry second = CreateDownloadDBEntry(); DownloadDBEntry third = CreateDownloadDBEntry(); db_entries_.insert( std::make_pair("unknown," + first.GetGuid(), DownloadDBConversions::DownloadDBEntryToProto(first))); db_entries_.insert( std::make_pair(GetKey(second.GetGuid()), DownloadDBConversions::DownloadDBEntryToProto(second))); db_entries_.insert( std::make_pair(GetKey(third.GetGuid()), DownloadDBConversions::DownloadDBEntryToProto(third))); } DownloadDB* GetDownloadDB() { return db_cache_->download_db_.get(); } void OnDownloadUpdated(DownloadItem* item) { db_cache_->OnDownloadUpdated(item); } protected: std::map<std::string, download_pb::DownloadDBEntry> db_entries_; leveldb_proto::test::FakeDB<download_pb::DownloadDBEntry>* db_; std::unique_ptr<DownloadDBCache> db_cache_; scoped_refptr<base::TestMockTimeTaskRunner> task_runner_; base::test::TaskEnvironment task_environment_; DISALLOW_COPY_AND_ASSIGN(DownloadDBCacheTest); }; TEST_F(DownloadDBCacheTest, InitializeAndRetrieve) { PrepopulateSampleEntries(); CreateDBCache(); std::vector<DownloadDBEntry> loaded_entries; db_cache_->Initialize( base::BindOnce(&DownloadDBCacheTest::InitCallback, base::Unretained(this), &loaded_entries)); db_->InitStatusCallback(leveldb_proto::Enums::InitStatus::kOK); db_->LoadCallback(true); ASSERT_EQ(loaded_entries.size(), 2u); for (auto& db_entry : loaded_entries) { DownloadDBEntry entry = DownloadDBConversions::DownloadDBEntryFromProto( db_entries_.find(GetKey(db_entry.GetGuid()))->second); // Newly loaded entries should be in an interrupted state. CleanUpInProgressEntry(&entry); ASSERT_EQ(db_entry, entry); EXPECT_FALSE(db_cache_->RetrieveEntry(db_entry.GetGuid())); } } // Test that new entry is added immediately to the database TEST_F(DownloadDBCacheTest, AddNewEntry) { PrepopulateSampleEntries(); CreateDBCache(); std::vector<DownloadDBEntry> loaded_entries; db_cache_->Initialize( base::BindOnce(&DownloadDBCacheTest::InitCallback, base::Unretained(this), &loaded_entries)); db_->InitStatusCallback(leveldb_proto::Enums::InitStatus::kOK); db_->LoadCallback(true); ASSERT_EQ(loaded_entries.size(), 2u); DownloadDBEntry new_entry = CreateDownloadDBEntry(); db_cache_->AddOrReplaceEntry(new_entry); ASSERT_EQ(new_entry, db_cache_->RetrieveEntry(new_entry.GetGuid())); db_->UpdateCallback(true); loaded_entries.clear(); DownloadDB* download_db = GetDownloadDB(); download_db->LoadEntries(base::BindOnce(&DownloadDBCacheTest::InitCallback, base::Unretained(this), &loaded_entries)); db_->LoadCallback(true); ASSERT_EQ(loaded_entries.size(), 3u); } // Test that modifying an existing entry could take some time to update the DB. TEST_F(DownloadDBCacheTest, ModifyExistingEntry) { PrepopulateSampleEntries(); CreateDBCache(); std::vector<DownloadDBEntry> loaded_entries; db_cache_->Initialize( base::BindOnce(&DownloadDBCacheTest::InitCallback, base::Unretained(this), &loaded_entries)); db_->InitStatusCallback(leveldb_proto::Enums::InitStatus::kOK); db_->LoadCallback(true); ASSERT_EQ(loaded_entries.size(), 2u); // Let the DBCache to cache the entries first. loaded_entries[0].download_info->in_progress_info->state = DownloadItem::IN_PROGRESS; loaded_entries[1].download_info->id = 101; db_cache_->AddOrReplaceEntry(loaded_entries[0]); db_->UpdateCallback(true); db_cache_->AddOrReplaceEntry(loaded_entries[1]); db_->UpdateCallback(true); // Only the first entry is cached, as the second entry is still interrupted. EXPECT_TRUE(db_cache_->RetrieveEntry(loaded_entries[0].GetGuid())); EXPECT_FALSE(db_cache_->RetrieveEntry(loaded_entries[1].GetGuid())); loaded_entries[0].download_info->id = 100; db_cache_->AddOrReplaceEntry(loaded_entries[0]); ASSERT_EQ(task_runner_->GetPendingTaskCount(), 1u); ASSERT_GT(task_runner_->NextPendingTaskDelay(), base::TimeDelta()); task_runner_->FastForwardUntilNoTasksRemain(); db_->UpdateCallback(true); loaded_entries.clear(); DownloadDB* download_db = GetDownloadDB(); download_db->LoadEntries(base::BindOnce(&DownloadDBCacheTest::InitCallback, base::Unretained(this), &loaded_entries)); db_->LoadCallback(true); ASSERT_EQ(loaded_entries.size(), 2u); ASSERT_EQ(loaded_entries[0].download_info->id, 100); ASSERT_EQ(loaded_entries[1].download_info->id, 101); } // Test that modifying current path will immediately update the DB. TEST_F(DownloadDBCacheTest, FilePathChange) { DownloadDBEntry entry = CreateDownloadDBEntry(); InProgressInfo info; base::FilePath test_path = base::FilePath(FILE_PATH_LITERAL("/tmp")); info.current_path = test_path; entry.download_info->in_progress_info = info; db_entries_.insert( std::make_pair(GetKey(entry.GetGuid()), DownloadDBConversions::DownloadDBEntryToProto(entry))); CreateDBCache(); std::vector<DownloadDBEntry> loaded_entries; db_cache_->Initialize( base::BindOnce(&DownloadDBCacheTest::InitCallback, base::Unretained(this), &loaded_entries)); db_->InitStatusCallback(leveldb_proto::Enums::InitStatus::kOK); db_->LoadCallback(true); ASSERT_EQ(loaded_entries.size(), 1u); ASSERT_EQ(loaded_entries[0].download_info->in_progress_info->current_path, test_path); test_path = base::FilePath(FILE_PATH_LITERAL("/test")); loaded_entries[0].download_info->in_progress_info->current_path = test_path; db_cache_->AddOrReplaceEntry(loaded_entries[0]); db_->UpdateCallback(true); loaded_entries.clear(); DownloadDB* download_db = GetDownloadDB(); download_db->LoadEntries(base::BindOnce(&DownloadDBCacheTest::InitCallback, base::Unretained(this), &loaded_entries)); db_->LoadCallback(true); ASSERT_EQ(loaded_entries.size(), 1u); ASSERT_EQ(loaded_entries[0].download_info->in_progress_info->current_path, test_path); } TEST_F(DownloadDBCacheTest, RemoveEntry) { PrepopulateSampleEntries(); CreateDBCache(); std::vector<DownloadDBEntry> loaded_entries; db_cache_->Initialize( base::BindOnce(&DownloadDBCacheTest::InitCallback, base::Unretained(this), &loaded_entries)); db_->InitStatusCallback(leveldb_proto::Enums::InitStatus::kOK); db_->LoadCallback(true); ASSERT_EQ(loaded_entries.size(), 2u); std::string guid = loaded_entries[0].GetGuid(); std::string guid2 = loaded_entries[1].GetGuid(); db_cache_->RemoveEntry(loaded_entries[0].GetGuid()); db_->UpdateCallback(true); loaded_entries.clear(); DownloadDB* download_db = GetDownloadDB(); download_db->LoadEntries(base::BindOnce(&DownloadDBCacheTest::InitCallback, base::Unretained(this), &loaded_entries)); db_->LoadCallback(true); ASSERT_EQ(loaded_entries.size(), 1u); ASSERT_EQ(guid2, loaded_entries[0].GetGuid()); } // Test that removing an entry during the middle of modifying it should work. TEST_F(DownloadDBCacheTest, RemoveWhileModifyExistingEntry) { PrepopulateSampleEntries(); CreateDBCache(); std::vector<DownloadDBEntry> loaded_entries; db_cache_->Initialize( base::BindOnce(&DownloadDBCacheTest::InitCallback, base::Unretained(this), &loaded_entries)); db_->InitStatusCallback(leveldb_proto::Enums::InitStatus::kOK); db_->LoadCallback(true); ASSERT_EQ(loaded_entries.size(), 2u); // Let the DBCache to cache the entry first. loaded_entries[0].download_info->in_progress_info->state = DownloadItem::IN_PROGRESS; db_cache_->AddOrReplaceEntry(loaded_entries[0]); ASSERT_EQ(task_runner_->GetPendingTaskCount(), 0u); db_->UpdateCallback(true); // Update the cached entry. A task will be posted to update the DB. loaded_entries[0].download_info->id = 100; db_cache_->AddOrReplaceEntry(loaded_entries[0]); ASSERT_EQ(task_runner_->GetPendingTaskCount(), 1u); ASSERT_GT(task_runner_->NextPendingTaskDelay(), base::TimeDelta()); db_cache_->RemoveEntry(loaded_entries[0].GetGuid()); task_runner_->FastForwardUntilNoTasksRemain(); DownloadDBEntry remaining = loaded_entries[1]; loaded_entries.clear(); DownloadDB* download_db = GetDownloadDB(); download_db->LoadEntries(base::BindOnce(&DownloadDBCacheTest::InitCallback, base::Unretained(this), &loaded_entries)); db_->LoadCallback(true); ASSERT_EQ(loaded_entries.size(), 1u); CleanUpInProgressEntry(&loaded_entries[0]); ASSERT_EQ(remaining, loaded_entries[0]); } } // namespace download
{ "pile_set_name": "Github" }
// i386 register table. // Copyright (C) 2007-2019 Free Software Foundation, Inc. // // This file is part of the GNU opcodes library. // // This library 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, or (at your option) // any later version. // // It 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 GAS; see the file COPYING. If not, write to the Free // Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA // 02110-1301, USA. // Make %st first as we test for it. st, FloatReg|Acc, 0, 0, 11, 33 // 8 bit regs al, Reg8|Acc, 0, 0, Dw2Inval, Dw2Inval cl, Reg8|ShiftCount, 0, 1, Dw2Inval, Dw2Inval dl, Reg8, 0, 2, Dw2Inval, Dw2Inval bl, Reg8, 0, 3, Dw2Inval, Dw2Inval ah, Reg8, 0, 4, Dw2Inval, Dw2Inval ch, Reg8, 0, 5, Dw2Inval, Dw2Inval dh, Reg8, 0, 6, Dw2Inval, Dw2Inval bh, Reg8, 0, 7, Dw2Inval, Dw2Inval axl, Reg8, RegRex64, 0, Dw2Inval, Dw2Inval cxl, Reg8, RegRex64, 1, Dw2Inval, Dw2Inval dxl, Reg8, RegRex64, 2, Dw2Inval, Dw2Inval bxl, Reg8, RegRex64, 3, Dw2Inval, Dw2Inval spl, Reg8, RegRex64, 4, Dw2Inval, Dw2Inval bpl, Reg8, RegRex64, 5, Dw2Inval, Dw2Inval sil, Reg8, RegRex64, 6, Dw2Inval, Dw2Inval dil, Reg8, RegRex64, 7, Dw2Inval, Dw2Inval r8b, Reg8, RegRex|RegRex64, 0, Dw2Inval, Dw2Inval r9b, Reg8, RegRex|RegRex64, 1, Dw2Inval, Dw2Inval r10b, Reg8, RegRex|RegRex64, 2, Dw2Inval, Dw2Inval r11b, Reg8, RegRex|RegRex64, 3, Dw2Inval, Dw2Inval r12b, Reg8, RegRex|RegRex64, 4, Dw2Inval, Dw2Inval r13b, Reg8, RegRex|RegRex64, 5, Dw2Inval, Dw2Inval r14b, Reg8, RegRex|RegRex64, 6, Dw2Inval, Dw2Inval r15b, Reg8, RegRex|RegRex64, 7, Dw2Inval, Dw2Inval // 16 bit regs ax, Reg16|Acc, 0, 0, Dw2Inval, Dw2Inval cx, Reg16, 0, 1, Dw2Inval, Dw2Inval dx, Reg16|InOutPortReg, 0, 2, Dw2Inval, Dw2Inval bx, Reg16|BaseIndex, 0, 3, Dw2Inval, Dw2Inval sp, Reg16, 0, 4, Dw2Inval, Dw2Inval bp, Reg16|BaseIndex, 0, 5, Dw2Inval, Dw2Inval si, Reg16|BaseIndex, 0, 6, Dw2Inval, Dw2Inval di, Reg16|BaseIndex, 0, 7, Dw2Inval, Dw2Inval r8w, Reg16, RegRex, 0, Dw2Inval, Dw2Inval r9w, Reg16, RegRex, 1, Dw2Inval, Dw2Inval r10w, Reg16, RegRex, 2, Dw2Inval, Dw2Inval r11w, Reg16, RegRex, 3, Dw2Inval, Dw2Inval r12w, Reg16, RegRex, 4, Dw2Inval, Dw2Inval r13w, Reg16, RegRex, 5, Dw2Inval, Dw2Inval r14w, Reg16, RegRex, 6, Dw2Inval, Dw2Inval r15w, Reg16, RegRex, 7, Dw2Inval, Dw2Inval // 32 bit regs eax, Reg32|BaseIndex|Acc, 0, 0, 0, Dw2Inval ecx, Reg32|BaseIndex, 0, 1, 1, Dw2Inval edx, Reg32|BaseIndex, 0, 2, 2, Dw2Inval ebx, Reg32|BaseIndex, 0, 3, 3, Dw2Inval esp, Reg32, 0, 4, 4, Dw2Inval ebp, Reg32|BaseIndex, 0, 5, 5, Dw2Inval esi, Reg32|BaseIndex, 0, 6, 6, Dw2Inval edi, Reg32|BaseIndex, 0, 7, 7, Dw2Inval r8d, Reg32|BaseIndex, RegRex, 0, Dw2Inval, Dw2Inval r9d, Reg32|BaseIndex, RegRex, 1, Dw2Inval, Dw2Inval r10d, Reg32|BaseIndex, RegRex, 2, Dw2Inval, Dw2Inval r11d, Reg32|BaseIndex, RegRex, 3, Dw2Inval, Dw2Inval r12d, Reg32|BaseIndex, RegRex, 4, Dw2Inval, Dw2Inval r13d, Reg32|BaseIndex, RegRex, 5, Dw2Inval, Dw2Inval r14d, Reg32|BaseIndex, RegRex, 6, Dw2Inval, Dw2Inval r15d, Reg32|BaseIndex, RegRex, 7, Dw2Inval, Dw2Inval rax, Reg64|BaseIndex|Acc, 0, 0, Dw2Inval, 0 rcx, Reg64|BaseIndex, 0, 1, Dw2Inval, 2 rdx, Reg64|BaseIndex, 0, 2, Dw2Inval, 1 rbx, Reg64|BaseIndex, 0, 3, Dw2Inval, 3 rsp, Reg64, 0, 4, Dw2Inval, 7 rbp, Reg64|BaseIndex, 0, 5, Dw2Inval, 6 rsi, Reg64|BaseIndex, 0, 6, Dw2Inval, 4 rdi, Reg64|BaseIndex, 0, 7, Dw2Inval, 5 r8, Reg64|BaseIndex, RegRex, 0, Dw2Inval, 8 r9, Reg64|BaseIndex, RegRex, 1, Dw2Inval, 9 r10, Reg64|BaseIndex, RegRex, 2, Dw2Inval, 10 r11, Reg64|BaseIndex, RegRex, 3, Dw2Inval, 11 r12, Reg64|BaseIndex, RegRex, 4, Dw2Inval, 12 r13, Reg64|BaseIndex, RegRex, 5, Dw2Inval, 13 r14, Reg64|BaseIndex, RegRex, 6, Dw2Inval, 14 r15, Reg64|BaseIndex, RegRex, 7, Dw2Inval, 15 // Vector mask registers. k0, RegMask, 0, 0, 93, 118 k1, RegMask, 0, 1, 94, 119 k2, RegMask, 0, 2, 95, 120 k3, RegMask, 0, 3, 96, 121 k4, RegMask, 0, 4, 97, 122 k5, RegMask, 0, 5, 98, 123 k6, RegMask, 0, 6, 99, 124 k7, RegMask, 0, 7, 100, 125 // Segment registers. es, SReg2, 0, 0, 40, 50 cs, SReg2, 0, 1, 41, 51 ss, SReg2, 0, 2, 42, 52 ds, SReg2, 0, 3, 43, 53 fs, SReg3, 0, 4, 44, 54 gs, SReg3, 0, 5, 45, 55 flat, SReg3, 0, RegFlat, Dw2Inval, Dw2Inval // Control registers. cr0, Control, 0, 0, Dw2Inval, Dw2Inval cr1, Control, 0, 1, Dw2Inval, Dw2Inval cr2, Control, 0, 2, Dw2Inval, Dw2Inval cr3, Control, 0, 3, Dw2Inval, Dw2Inval cr4, Control, 0, 4, Dw2Inval, Dw2Inval cr5, Control, 0, 5, Dw2Inval, Dw2Inval cr6, Control, 0, 6, Dw2Inval, Dw2Inval cr7, Control, 0, 7, Dw2Inval, Dw2Inval cr8, Control, RegRex, 0, Dw2Inval, Dw2Inval cr9, Control, RegRex, 1, Dw2Inval, Dw2Inval cr10, Control, RegRex, 2, Dw2Inval, Dw2Inval cr11, Control, RegRex, 3, Dw2Inval, Dw2Inval cr12, Control, RegRex, 4, Dw2Inval, Dw2Inval cr13, Control, RegRex, 5, Dw2Inval, Dw2Inval cr14, Control, RegRex, 6, Dw2Inval, Dw2Inval cr15, Control, RegRex, 7, Dw2Inval, Dw2Inval // Debug registers. db0, Debug, 0, 0, Dw2Inval, Dw2Inval db1, Debug, 0, 1, Dw2Inval, Dw2Inval db2, Debug, 0, 2, Dw2Inval, Dw2Inval db3, Debug, 0, 3, Dw2Inval, Dw2Inval db4, Debug, 0, 4, Dw2Inval, Dw2Inval db5, Debug, 0, 5, Dw2Inval, Dw2Inval db6, Debug, 0, 6, Dw2Inval, Dw2Inval db7, Debug, 0, 7, Dw2Inval, Dw2Inval db8, Debug, RegRex, 0, Dw2Inval, Dw2Inval db9, Debug, RegRex, 1, Dw2Inval, Dw2Inval db10, Debug, RegRex, 2, Dw2Inval, Dw2Inval db11, Debug, RegRex, 3, Dw2Inval, Dw2Inval db12, Debug, RegRex, 4, Dw2Inval, Dw2Inval db13, Debug, RegRex, 5, Dw2Inval, Dw2Inval db14, Debug, RegRex, 6, Dw2Inval, Dw2Inval db15, Debug, RegRex, 7, Dw2Inval, Dw2Inval dr0, Debug, 0, 0, Dw2Inval, Dw2Inval dr1, Debug, 0, 1, Dw2Inval, Dw2Inval dr2, Debug, 0, 2, Dw2Inval, Dw2Inval dr3, Debug, 0, 3, Dw2Inval, Dw2Inval dr4, Debug, 0, 4, Dw2Inval, Dw2Inval dr5, Debug, 0, 5, Dw2Inval, Dw2Inval dr6, Debug, 0, 6, Dw2Inval, Dw2Inval dr7, Debug, 0, 7, Dw2Inval, Dw2Inval dr8, Debug, RegRex, 0, Dw2Inval, Dw2Inval dr9, Debug, RegRex, 1, Dw2Inval, Dw2Inval dr10, Debug, RegRex, 2, Dw2Inval, Dw2Inval dr11, Debug, RegRex, 3, Dw2Inval, Dw2Inval dr12, Debug, RegRex, 4, Dw2Inval, Dw2Inval dr13, Debug, RegRex, 5, Dw2Inval, Dw2Inval dr14, Debug, RegRex, 6, Dw2Inval, Dw2Inval dr15, Debug, RegRex, 7, Dw2Inval, Dw2Inval // Test registers. tr0, Test, 0, 0, Dw2Inval, Dw2Inval tr1, Test, 0, 1, Dw2Inval, Dw2Inval tr2, Test, 0, 2, Dw2Inval, Dw2Inval tr3, Test, 0, 3, Dw2Inval, Dw2Inval tr4, Test, 0, 4, Dw2Inval, Dw2Inval tr5, Test, 0, 5, Dw2Inval, Dw2Inval tr6, Test, 0, 6, Dw2Inval, Dw2Inval tr7, Test, 0, 7, Dw2Inval, Dw2Inval // MMX and simd registers. mm0, RegMMX, 0, 0, 29, 41 mm1, RegMMX, 0, 1, 30, 42 mm2, RegMMX, 0, 2, 31, 43 mm3, RegMMX, 0, 3, 32, 44 mm4, RegMMX, 0, 4, 33, 45 mm5, RegMMX, 0, 5, 34, 46 mm6, RegMMX, 0, 6, 35, 47 mm7, RegMMX, 0, 7, 36, 48 xmm0, RegXMM|Acc, 0, 0, 21, 17 xmm1, RegXMM, 0, 1, 22, 18 xmm2, RegXMM, 0, 2, 23, 19 xmm3, RegXMM, 0, 3, 24, 20 xmm4, RegXMM, 0, 4, 25, 21 xmm5, RegXMM, 0, 5, 26, 22 xmm6, RegXMM, 0, 6, 27, 23 xmm7, RegXMM, 0, 7, 28, 24 xmm8, RegXMM, RegRex, 0, Dw2Inval, 25 xmm9, RegXMM, RegRex, 1, Dw2Inval, 26 xmm10, RegXMM, RegRex, 2, Dw2Inval, 27 xmm11, RegXMM, RegRex, 3, Dw2Inval, 28 xmm12, RegXMM, RegRex, 4, Dw2Inval, 29 xmm13, RegXMM, RegRex, 5, Dw2Inval, 30 xmm14, RegXMM, RegRex, 6, Dw2Inval, 31 xmm15, RegXMM, RegRex, 7, Dw2Inval, 32 xmm16, RegXMM, RegVRex, 0, Dw2Inval, 67 xmm17, RegXMM, RegVRex, 1, Dw2Inval, 68 xmm18, RegXMM, RegVRex, 2, Dw2Inval, 69 xmm19, RegXMM, RegVRex, 3, Dw2Inval, 70 xmm20, RegXMM, RegVRex, 4, Dw2Inval, 71 xmm21, RegXMM, RegVRex, 5, Dw2Inval, 72 xmm22, RegXMM, RegVRex, 6, Dw2Inval, 73 xmm23, RegXMM, RegVRex, 7, Dw2Inval, 74 xmm24, RegXMM, RegVRex|RegRex, 0, Dw2Inval, 75 xmm25, RegXMM, RegVRex|RegRex, 1, Dw2Inval, 76 xmm26, RegXMM, RegVRex|RegRex, 2, Dw2Inval, 77 xmm27, RegXMM, RegVRex|RegRex, 3, Dw2Inval, 78 xmm28, RegXMM, RegVRex|RegRex, 4, Dw2Inval, 79 xmm29, RegXMM, RegVRex|RegRex, 5, Dw2Inval, 80 xmm30, RegXMM, RegVRex|RegRex, 6, Dw2Inval, 81 xmm31, RegXMM, RegVRex|RegRex, 7, Dw2Inval, 82 // AVX registers. ymm0, RegYMM, 0, 0, Dw2Inval, Dw2Inval ymm1, RegYMM, 0, 1, Dw2Inval, Dw2Inval ymm2, RegYMM, 0, 2, Dw2Inval, Dw2Inval ymm3, RegYMM, 0, 3, Dw2Inval, Dw2Inval ymm4, RegYMM, 0, 4, Dw2Inval, Dw2Inval ymm5, RegYMM, 0, 5, Dw2Inval, Dw2Inval ymm6, RegYMM, 0, 6, Dw2Inval, Dw2Inval ymm7, RegYMM, 0, 7, Dw2Inval, Dw2Inval ymm8, RegYMM, RegRex, 0, Dw2Inval, Dw2Inval ymm9, RegYMM, RegRex, 1, Dw2Inval, Dw2Inval ymm10, RegYMM, RegRex, 2, Dw2Inval, Dw2Inval ymm11, RegYMM, RegRex, 3, Dw2Inval, Dw2Inval ymm12, RegYMM, RegRex, 4, Dw2Inval, Dw2Inval ymm13, RegYMM, RegRex, 5, Dw2Inval, Dw2Inval ymm14, RegYMM, RegRex, 6, Dw2Inval, Dw2Inval ymm15, RegYMM, RegRex, 7, Dw2Inval, Dw2Inval ymm16, RegYMM, RegVRex, 0, Dw2Inval, Dw2Inval ymm17, RegYMM, RegVRex, 1, Dw2Inval, Dw2Inval ymm18, RegYMM, RegVRex, 2, Dw2Inval, Dw2Inval ymm19, RegYMM, RegVRex, 3, Dw2Inval, Dw2Inval ymm20, RegYMM, RegVRex, 4, Dw2Inval, Dw2Inval ymm21, RegYMM, RegVRex, 5, Dw2Inval, Dw2Inval ymm22, RegYMM, RegVRex, 6, Dw2Inval, Dw2Inval ymm23, RegYMM, RegVRex, 7, Dw2Inval, Dw2Inval ymm24, RegYMM, RegVRex|RegRex, 0, Dw2Inval, Dw2Inval ymm25, RegYMM, RegVRex|RegRex, 1, Dw2Inval, Dw2Inval ymm26, RegYMM, RegVRex|RegRex, 2, Dw2Inval, Dw2Inval ymm27, RegYMM, RegVRex|RegRex, 3, Dw2Inval, Dw2Inval ymm28, RegYMM, RegVRex|RegRex, 4, Dw2Inval, Dw2Inval ymm29, RegYMM, RegVRex|RegRex, 5, Dw2Inval, Dw2Inval ymm30, RegYMM, RegVRex|RegRex, 6, Dw2Inval, Dw2Inval ymm31, RegYMM, RegVRex|RegRex, 7, Dw2Inval, Dw2Inval // AVX512 registers. zmm0, RegZMM, 0, 0, Dw2Inval, Dw2Inval zmm1, RegZMM, 0, 1, Dw2Inval, Dw2Inval zmm2, RegZMM, 0, 2, Dw2Inval, Dw2Inval zmm3, RegZMM, 0, 3, Dw2Inval, Dw2Inval zmm4, RegZMM, 0, 4, Dw2Inval, Dw2Inval zmm5, RegZMM, 0, 5, Dw2Inval, Dw2Inval zmm6, RegZMM, 0, 6, Dw2Inval, Dw2Inval zmm7, RegZMM, 0, 7, Dw2Inval, Dw2Inval zmm8, RegZMM, RegRex, 0, Dw2Inval, Dw2Inval zmm9, RegZMM, RegRex, 1, Dw2Inval, Dw2Inval zmm10, RegZMM, RegRex, 2, Dw2Inval, Dw2Inval zmm11, RegZMM, RegRex, 3, Dw2Inval, Dw2Inval zmm12, RegZMM, RegRex, 4, Dw2Inval, Dw2Inval zmm13, RegZMM, RegRex, 5, Dw2Inval, Dw2Inval zmm14, RegZMM, RegRex, 6, Dw2Inval, Dw2Inval zmm15, RegZMM, RegRex, 7, Dw2Inval, Dw2Inval zmm16, RegZMM, RegVRex, 0, Dw2Inval, Dw2Inval zmm17, RegZMM, RegVRex, 1, Dw2Inval, Dw2Inval zmm18, RegZMM, RegVRex, 2, Dw2Inval, Dw2Inval zmm19, RegZMM, RegVRex, 3, Dw2Inval, Dw2Inval zmm20, RegZMM, RegVRex, 4, Dw2Inval, Dw2Inval zmm21, RegZMM, RegVRex, 5, Dw2Inval, Dw2Inval zmm22, RegZMM, RegVRex, 6, Dw2Inval, Dw2Inval zmm23, RegZMM, RegVRex, 7, Dw2Inval, Dw2Inval zmm24, RegZMM, RegVRex|RegRex, 0, Dw2Inval, Dw2Inval zmm25, RegZMM, RegVRex|RegRex, 1, Dw2Inval, Dw2Inval zmm26, RegZMM, RegVRex|RegRex, 2, Dw2Inval, Dw2Inval zmm27, RegZMM, RegVRex|RegRex, 3, Dw2Inval, Dw2Inval zmm28, RegZMM, RegVRex|RegRex, 4, Dw2Inval, Dw2Inval zmm29, RegZMM, RegVRex|RegRex, 5, Dw2Inval, Dw2Inval zmm30, RegZMM, RegVRex|RegRex, 6, Dw2Inval, Dw2Inval zmm31, RegZMM, RegVRex|RegRex, 7, Dw2Inval, Dw2Inval // Bound registers for MPX bnd0, RegBND, 0, 0, Dw2Inval, Dw2Inval bnd1, RegBND, 0, 1, Dw2Inval, Dw2Inval bnd2, RegBND, 0, 2, Dw2Inval, Dw2Inval bnd3, RegBND, 0, 3, Dw2Inval, Dw2Inval // No Reg will make these registers rejected for all purposes except // for addressing. This saves creating one extra type for RIP/EIP. rip, Qword, RegRex64, RegIP, Dw2Inval, 16 eip, Dword, RegRex64, RegIP, 8, Dw2Inval // No Reg will make these registers rejected for all purposes except // for addressing. riz, Qword|BaseIndex, RegRex64, RegIZ, Dw2Inval, Dw2Inval eiz, Dword|BaseIndex, 0, RegIZ, Dw2Inval, Dw2Inval // fp regs. st(0), FloatReg|Acc, 0, 0, 11, 33 st(1), FloatReg, 0, 1, 12, 34 st(2), FloatReg, 0, 2, 13, 35 st(3), FloatReg, 0, 3, 14, 36 st(4), FloatReg, 0, 4, 15, 37 st(5), FloatReg, 0, 5, 16, 38 st(6), FloatReg, 0, 6, 17, 39 st(7), FloatReg, 0, 7, 18, 40 // Pseudo-register names only used in .cfi_* directives eflags, 0, 0, 0, 9, 49 rflags, 0, 0, 0, Dw2Inval, 49 fs.base, 0, 0, 0, Dw2Inval, 58 gs.base, 0, 0, 0, Dw2Inval, 59 tr, 0, 0, 0, 48, 62 ldtr, 0, 0, 0, 49, 63 // st0...7 for backward compatibility st0, 0, 0, 0, 11, 33 st1, 0, 0, 1, 12, 34 st2, 0, 0, 2, 13, 35 st3, 0, 0, 3, 14, 36 st4, 0, 0, 4, 15, 37 st5, 0, 0, 5, 16, 38 st6, 0, 0, 6, 17, 39 st7, 0, 0, 7, 18, 40 fcw, 0, 0, 0, 37, 65 fsw, 0, 0, 0, 38, 66 mxcsr, 0, 0, 0, 39, 64
{ "pile_set_name": "Github" }
From sentto-2242572-60165-1038789071-jm=jmason.org@returns.groups.yahoo.com Mon Dec 2 11:25:35 2002 Return-Path: <sentto-2242572-60165-1038789071-yyyy=spamassassin.taint.org@returns.groups.yahoo.com> Delivered-To: yyyy@localhost.spamassassin.taint.org Received: from localhost (jalapeno [127.0.0.1]) by jmason.org (Postfix) with ESMTP id 239ED16F21 for <jm@localhost>; Mon, 2 Dec 2002 11:23:27 +0000 (GMT) Received: from jalapeno [127.0.0.1] by localhost with IMAP (fetchmail-5.9.0) for jm@localhost (single-drop); Mon, 02 Dec 2002 11:23:27 +0000 (GMT) Received: from n15.grp.scd.yahoo.com (n15.grp.scd.yahoo.com [66.218.66.70]) by dogma.slashnull.org (8.11.6/8.11.6) with SMTP id gB20Th828173 for <jm@jmason.org>; Mon, 2 Dec 2002 00:29:43 GMT X-Egroups-Return: sentto-2242572-60165-1038789071-yyyy=spamassassin.taint.org@returns.groups.yahoo.com Received: from [66.218.66.95] by n15.grp.scd.yahoo.com with NNFMP; 02 Dec 2002 00:31:11 -0000 X-Sender: dmcmann@btinternet.com X-Apparently-To: zzzzteana@yahoogroups.com Received: (EGP: mail-8_2_3_0); 2 Dec 2002 00:31:11 -0000 Received: (qmail 25456 invoked from network); 2 Dec 2002 00:31:10 -0000 Received: from unknown (66.218.66.217) by m7.grp.scd.yahoo.com with QMQP; 2 Dec 2002 00:31:10 -0000 Received: from unknown (HELO gadolinium.btinternet.com) (194.73.73.111) by mta2.grp.scd.yahoo.com with SMTP; 2 Dec 2002 00:31:10 -0000 Received: from host217-39-130-30.in-addr.btopenworld.com ([217.39.130.30] helo=b5w3e9) by gadolinium.btinternet.com with smtp (Exim 3.22 #16) id 18IeUP-0004rn-00 for forteana@yahoogroups.com; Mon, 02 Dec 2002 00:31:10 +0000 Message-Id: <001901c2999a$32790340$1e8227d9@b5w3e9> To: <zzzzteana@yahoogroups.com> References: <ase7ib+lp7v@eGroups.com> X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-Mimeole: Produced By Microsoft MimeOLE V6.00.2800.1106 From: "D.McMann" <dmcmann@btinternet.com> X-Yahoo-Profile: davemcmann2002 MIME-Version: 1.0 Mailing-List: list zzzzteana@yahoogroups.com; contact forteana-owner@yahoogroups.com Delivered-To: mailing list zzzzteana@yahoogroups.com Precedence: bulk List-Unsubscribe: <mailto:zzzzteana-unsubscribe@yahoogroups.com> Date: Mon, 2 Dec 2002 00:31:46 -0000 Subject: Re: [zzzzteana] Re: Archer-UK TV Alert Reply-To: zzzzteana@yahoogroups.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Yes, I enjoyed it. Then afterwards, there was a debate thing on ITV about genius or madness, featuring a friend of mine's boss plus David Icke, also the very likeable Evelyn Glennie. Dave To unsubscribe from this group, send an email to: forteana-unsubscribe@egroups.com Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
{ "pile_set_name": "Github" }
// **************************************************************************** // // Common Mixins // mixins can be used across all scss files, at all levels // // -> Naming convention: // general -> specific // E.g: $vzb-border-color-blue; // // **************************************************************************** // ---------------------------------------------------------------------------- // Bourbon mixins: http://bourbon.io/docs/ // ---------------------------------------------------------------------------- @import "~bourbon/app/assets/stylesheets/bourbon"; // ---------------------------------------------------------------------------- // Sizes, borders and margins // ---------------------------------------------------------------------------- @mixin reset-margin-padding { padding: 0; margin: 0; } //center a box horizontally (div, anything) @mixin center-block { display: block; margin-left: auto; margin-right: auto; } @mixin box-sizing($box-model) { @include prefixer(box-sizing, $box-model, webkit moz ms o spec); } @mixin border-radius($border-radius) { @include prefixer(border-radius, $border-radius, webkit moz ms o spec); } @mixin translate($x, $y) { @include prefixer(transform, translate($x, $y), spec webkit moz ms o); } @mixin rotate($r) { @include prefixer(transform, rotate($r), spec webkit moz ms o); } @mixin box-shadow($x, $y, $blur, $color, $inset: false) { @if $inset { @include prefixer(box-shadow, inset $x $y $blur $color, webkit moz ms o spec); } @else { @include prefixer(box-shadow, $x $y $blur $color, webkit moz ms o spec); } } // ---------------------------------------------------------------------------- // Color and Transformation // ---------------------------------------------------------------------------- @mixin opacity($v) { filter: alpha(opacity=($v * 100)); opacity: $v; } // ---------------------------------------------------------------------------- // Text // ---------------------------------------------------------------------------- //converts pixels to em @mixin font-size($size: 12px) { font-size: (0.06 * $size / 1px) + em; } //same with line height @mixin line-height($height: 12px) { line-height: (0.125 * $height / 1px) + em; } // ---------------------------------------------------------------------------- // Animation // ---------------------------------------------------------------------------- @keyframes rotate-forever { 0% { transform: rotate(0deg); } 100% { transform: rotate(359deg); } } // ---------------------------------------------------------------------------- // Responsiveness // ---------------------------------------------------------------------------- //overflow mobile y @mixin overflow-mobile { -webkit-overflow-scrolling: auto; } // ---------------------------------------------------------------------------- // Other // ---------------------------------------------------------------------------- //TODO: evaluate if this mixin should be included at all @mixin tooltip($background-color: $vzb-color-white, $padding: 0.5em, $arrow-base: 1em, $arrow-length: 0.5em, $border-width: 0, $border-color: false) { @include box-sizing(border-box); position: absolute; padding: $padding; margin-bottom: $arrow-length; background-color: $background-color; cursor: default; visibility: hidden; &::after { border-left: ($arrow-base / 2 - $border-width) solid transparent; border-right: ($arrow-base / 2 - $border-width) solid transparent; border-top: ($arrow-length - $border-width) solid $background-color; content: ''; height: 0; left: 50%; margin-left: ($border-width - $arrow-base / 2); position: absolute; top: 100%; width: 0; } @if $border-width { border: $border-width solid $border-color; &::before { border-left: ($arrow-base / 2) solid transparent; border-right: ($arrow-base / 2) solid transparent; border-top: $arrow-length solid $border-color; content: ''; height: 0; left: 50%; margin-left: ($arrow-base / -2); position: absolute; top: 100%; width: 0; } } } @mixin rtl { @each $p in & { @at-root #{".vzb-rtl" + $p} { @content; } } } @mixin stroke($stroke, $color: $vzb-color-stroke, $opacity: $vzb-stroke-opacity) { paint-order: stroke; stroke: $color; stroke-opacity: $opacity; stroke-width: $stroke; stroke-linecap: butt; stroke-linejoin: miter; }
{ "pile_set_name": "Github" }
/** * In this file we will implement the automatic SLA support tree generation. * */ #include <numeric> #include <libslic3r/SLA/SupportTree.hpp> #include <libslic3r/SLA/SpatIndex.hpp> #include <libslic3r/SLA/SupportTreeBuilder.hpp> #include <libslic3r/SLA/SupportTreeBuildsteps.hpp> #include <libslic3r/MTUtils.hpp> #include <libslic3r/ClipperUtils.hpp> #include <libslic3r/Model.hpp> #include <libnest2d/optimizers/nlopt/genetic.hpp> #include <libnest2d/optimizers/nlopt/subplex.hpp> #include <boost/log/trivial.hpp> #include <tbb/parallel_for.h> #include <tbb/mutex.h> #include <tbb/spin_mutex.h> #include <libslic3r/I18N.hpp> //! macro used to mark string used at localization, //! return same string #define L(s) Slic3r::I18N::translate(s) namespace Slic3r { namespace sla { void SupportTree::retrieve_full_mesh(TriangleMesh &outmesh) const { outmesh.merge(retrieve_mesh(MeshType::Support)); outmesh.merge(retrieve_mesh(MeshType::Pad)); } std::vector<ExPolygons> SupportTree::slice( const std::vector<float> &grid, float cr) const { const TriangleMesh &sup_mesh = retrieve_mesh(MeshType::Support); const TriangleMesh &pad_mesh = retrieve_mesh(MeshType::Pad); using Slices = std::vector<ExPolygons>; auto slices = reserve_vector<Slices>(2); if (!sup_mesh.empty()) { slices.emplace_back(); TriangleMeshSlicer sup_slicer(&sup_mesh); sup_slicer.slice(grid, SlicingMode::Regular, cr, &slices.back(), ctl().cancelfn); } if (!pad_mesh.empty()) { slices.emplace_back(); auto bb = pad_mesh.bounding_box(); auto maxzit = std::upper_bound(grid.begin(), grid.end(), bb.max.z()); auto cap = grid.end() - maxzit; auto padgrid = reserve_vector<float>(size_t(cap > 0 ? cap : 0)); std::copy(grid.begin(), maxzit, std::back_inserter(padgrid)); TriangleMeshSlicer pad_slicer(&pad_mesh); pad_slicer.slice(padgrid, SlicingMode::Regular, cr, &slices.back(), ctl().cancelfn); } size_t len = grid.size(); for (const Slices &slv : slices) { len = std::min(len, slv.size()); } // Either the support or the pad or both has to be non empty if (slices.empty()) return {}; Slices &mrg = slices.front(); for (auto it = std::next(slices.begin()); it != slices.end(); ++it) { for (size_t i = 0; i < len; ++i) { Slices &slv = *it; std::copy(slv[i].begin(), slv[i].end(), std::back_inserter(mrg[i])); slv[i] = {}; // clear and delete } } return mrg; } SupportTree::UPtr SupportTree::create(const SupportableMesh &sm, const JobController & ctl) { auto builder = make_unique<SupportTreeBuilder>(); builder->m_ctl = ctl; if (sm.cfg.enabled) { // Execute takes care about the ground_level SupportTreeBuildsteps::execute(*builder, sm); builder->merge_and_cleanup(); // clean metadata, leave only the meshes. } else { // If a pad gets added later, it will be in the right Z level builder->ground_level = sm.emesh.ground_level(); } return std::move(builder); } }} // namespace Slic3r::sla
{ "pile_set_name": "Github" }
/* * Copyright (C) Lightbend Inc. <https://www.lightbend.com> */ package play.filters.gzip import java.util.function.BiFunction import java.util.zip.Deflater import javax.inject.Inject import javax.inject.Provider import javax.inject.Singleton import akka.stream.scaladsl._ import akka.stream.FlowShape import akka.stream.Materializer import akka.stream.OverflowStrategy import akka.util.ByteString import com.typesafe.config.ConfigMemorySize import play.api.Configuration import play.api.Logger import play.api.http._ import play.api.inject._ import play.api.libs.streams.GzipFlow import play.api.mvc.RequestHeader.acceptHeader import play.api.mvc._ import play.core.j import scala.compat.java8.FunctionConverters._ import scala.concurrent.ExecutionContext import scala.concurrent.Future /** * A gzip filter. * * This filter may gzip the responses for any requests that aren't HEAD requests and specify an accept encoding of gzip. * * It won't gzip under the following conditions: * * - The response code is 204 or 304 (these codes MUST NOT contain a body, and an empty gzipped response is 20 bytes * long) * - The response already defines a Content-Encoding header * - The size of the response body is equal or smaller than a given threshold. If the body size cannot be determined, * then it is assumed the response is over the threshold * - A custom shouldGzip function is supplied and it returns false * * Since gzipping changes the content length of the response, this filter may do some buffering - it will buffer any * streamed responses that define a content length less than the configured chunked threshold. Responses that are * greater in length, or that don't define a content length, will not be buffered, but will be sent as chunked * responses. */ @Singleton class GzipFilter @Inject() (config: GzipFilterConfig)(implicit mat: Materializer) extends EssentialFilter { import play.api.http.HeaderNames._ def this( bufferSize: Int = 8192, chunkedThreshold: Int = 102400, threshold: Int = 0, shouldGzip: (RequestHeader, Result) => Boolean = (_, _) => true, compressionLevel: Int = Deflater.DEFAULT_COMPRESSION )(implicit mat: Materializer) = this(GzipFilterConfig(bufferSize, chunkedThreshold, threshold, shouldGzip, compressionLevel)) def apply(next: EssentialAction) = new EssentialAction { implicit val ec = mat.executionContext def apply(request: RequestHeader) = { if (mayCompress(request)) { next(request).mapFuture(result => handleResult(request, result)) } else { next(request) } } } private def createGzipFlow: Flow[ByteString, ByteString, _] = GzipFlow.gzip(config.bufferSize, config.compressionLevel) private def handleResult(request: RequestHeader, result: Result): Future[Result] = { implicit val ec = mat.executionContext if (shouldCompress(result) && config.shouldGzip(request, result)) { val header = result.header.copy(headers = setupHeader(result.header)) result.body match { case HttpEntity.Strict(data, contentType) => compressStrictEntity(Source.single(data), contentType) .map(entity => result.copy(header = header, body = entity)) case entity @ HttpEntity.Streamed(_, Some(contentLength), contentType) if contentLength <= config.chunkedThreshold => // It's below the chunked threshold, so buffer then compress and send compressStrictEntity(entity.data, contentType) .map(strictEntity => result.copy(header = header, body = strictEntity)) case HttpEntity.Streamed(data, _, contentType) if request.version == HttpProtocol.HTTP_1_0 => // It's above the chunked threshold, but we can't chunk it because we're using HTTP 1.0. // Instead, we use a close delimited body (ie, regular body with no content length) val gzipped = data.via(createGzipFlow) Future.successful( result.copy(header = header, body = HttpEntity.Streamed(gzipped, None, contentType)) ) case HttpEntity.Streamed(data, _, contentType) => // It's above the chunked threshold, compress through the gzip flow, and send as chunked val gzipped = data.via(createGzipFlow).map(d => HttpChunk.Chunk(d)) Future.successful( result.copy(header = header, body = HttpEntity.Chunked(gzipped, contentType)) ) case HttpEntity.Chunked(chunks, contentType) => val gzipFlow = Flow.fromGraph(GraphDSL.create[FlowShape[HttpChunk, HttpChunk]]() { implicit builder => import GraphDSL.Implicits._ val extractChunks = Flow[HttpChunk].collect { case HttpChunk.Chunk(data) => data } val createChunks = Flow[ByteString].map[HttpChunk](HttpChunk.Chunk.apply) val filterLastChunk = Flow[HttpChunk] .filter(_.isInstanceOf[HttpChunk.LastChunk]) // Since we're doing a merge by concatenating, the filter last chunk won't receive demand until the gzip // flow is finished. But the broadcast won't start broadcasting until both flows start demanding. So we // put a buffer of one in to ensure the filter last chunk flow demands from the broadcast. .buffer(1, OverflowStrategy.backpressure) val broadcast = builder.add(Broadcast[HttpChunk](2)) val concat = builder.add(Concat[HttpChunk]()) // Broadcast the stream through two separate flows, one that collects chunks and turns them into // ByteStrings, sends those ByteStrings through the Gzip flow, and then turns them back into chunks, // the other that just allows the last chunk through. Then concat those two flows together. broadcast.out(0) ~> extractChunks ~> createGzipFlow ~> createChunks ~> concat.in(0) broadcast.out(1) ~> filterLastChunk ~> concat.in(1) new FlowShape(broadcast.in, concat.out) }) Future.successful( result.copy(header = header, body = HttpEntity.Chunked(chunks.via(gzipFlow), contentType)) ) } } else { Future.successful(result) } } private def compressStrictEntity(source: Source[ByteString, Any], contentType: Option[String])( implicit ec: ExecutionContext ) = { val compressed = source.via(createGzipFlow).runFold(ByteString.empty)(_ ++ _) compressed.map(data => HttpEntity.Strict(data, contentType)) } /** * Whether this request may be compressed. */ private def mayCompress(request: RequestHeader) = request.method != "HEAD" && gzipIsAcceptedAndPreferredBy(request) private def gzipIsAcceptedAndPreferredBy(request: RequestHeader) = { val codings = acceptHeader(request.headers, ACCEPT_ENCODING) def explicitQValue(coding: String) = codings.collectFirst { case (q, c) if c.equalsIgnoreCase(coding) => q } def defaultQValue(coding: String) = if (coding == "identity") 0.001d else 0d def qvalue(coding: String) = explicitQValue(coding).orElse(explicitQValue("*")).getOrElse(defaultQValue(coding)) qvalue("gzip") > 0d && qvalue("gzip") >= qvalue("identity") } /** * Whether this response should be compressed. Responses that may not contain content won't be compressed, nor will * responses that already define a content encoding. Empty responses also shouldn't be compressed, as they will * actually always get bigger. Also responses whose body size are equal or lower than the given byte threshold won't * be compressed, because it's assumed they end up being bigger than the original body. */ private def shouldCompress(result: Result) = isAllowedContent(result.header) && isNotAlreadyCompressed(result.header) && !result.body.isKnownEmpty && result.body.contentLength.forall(_ > config.threshold) /** * Certain response codes are forbidden by the HTTP spec to contain content, but a gzipped response always contains * a minimum of 20 bytes, even for empty responses. */ private def isAllowedContent(header: ResponseHeader) = header.status != Status.NO_CONTENT && header.status != Status.NOT_MODIFIED /** * Of course, we don't want to double compress responses */ private def isNotAlreadyCompressed(header: ResponseHeader) = header.headers.get(CONTENT_ENCODING).isEmpty private def setupHeader(rh: ResponseHeader): Map[String, String] = { rh.headers + (CONTENT_ENCODING -> "gzip") + rh.varyWith(ACCEPT_ENCODING) } } /** * Configuration for the gzip filter * * @param bufferSize The size of the buffer to use for gzipping. * @param chunkedThreshold The content length threshold, after which the filter will switch to chunking the result. * @param threshold The byte threshold for the response body size which controls if a response should be gzipped. * @param shouldGzip Whether the given request/result should be gzipped. This can be used, for example, to implement * black/white lists for gzipping by content type. * @param compressionLevel Compression level to use for the underlying [[java.util.zip.Deflater]] instance. */ case class GzipFilterConfig( bufferSize: Int = 8192, chunkedThreshold: Int = 102400, threshold: Int = 0, shouldGzip: (RequestHeader, Result) => Boolean = (_, _) => true, compressionLevel: Int = Deflater.DEFAULT_COMPRESSION ) { // alternate constructor and builder methods for Java def this() = this(shouldGzip = (_, _) => true) def withShouldGzip(shouldGzip: (RequestHeader, Result) => Boolean): GzipFilterConfig = copy(shouldGzip = shouldGzip) def withShouldGzip(shouldGzip: BiFunction[play.mvc.Http.RequestHeader, play.mvc.Result, Boolean]): GzipFilterConfig = withShouldGzip((req: RequestHeader, res: Result) => shouldGzip.asScala(req.asJava, res.asJava)) def withChunkedThreshold(threshold: Int): GzipFilterConfig = copy(chunkedThreshold = threshold) def withThreshold(threshold: Int): GzipFilterConfig = copy(threshold = threshold) def withBufferSize(size: Int): GzipFilterConfig = copy(bufferSize = size) def withCompressionLevel(level: Int): GzipFilterConfig = copy(compressionLevel = level) } object GzipFilterConfig { private val logger = Logger(this.getClass) def fromConfiguration(conf: Configuration): GzipFilterConfig = { def parseConfigMediaTypes(config: Configuration, key: String): Seq[MediaType] = { val mediaTypes = config.get[Seq[String]](key).flatMap { case "*" => // "*" wildcards are accepted for backwards compatibility with when "MediaRange" was used for parsing, // but they are not part of the MediaType spec as defined in RFC2616. logger.warn( "Support for '*' wildcards may be removed in future versions of play," + " as they don't conform to the specification for MediaType strings. Use */* instead." ) Some(MediaType("*", "*", Seq.empty)) case MediaType.parse(mediaType) => Some(mediaType) case invalid => logger.error(s"Failed to parse the configured MediaType mask '$invalid'") None } mediaTypes.foreach { case MediaType("*", "*", _) => logger.warn( "Wildcard MediaTypes don't make much sense in a whitelist (too permissive) or " + "blacklist (too restrictive), and are not recommended. " ) case _ => () // the configured MediaType mask is valid } mediaTypes } def matches(outgoing: MediaType, mask: MediaType): Boolean = { def capturedByMask(value: String, mask: String): Boolean = { mask == "*" || value.equalsIgnoreCase(mask) } capturedByMask(outgoing.mediaType, mask.mediaType) && capturedByMask(outgoing.mediaSubType, mask.mediaSubType) } val config = conf.get[Configuration]("play.filters.gzip") val whiteList = parseConfigMediaTypes(config, "contentType.whiteList") val blackList = parseConfigMediaTypes(config, "contentType.blackList") GzipFilterConfig( bufferSize = config.get[ConfigMemorySize]("bufferSize").toBytes.toInt, chunkedThreshold = config.get[ConfigMemorySize]("chunkedThreshold").toBytes.toInt, threshold = config.get[ConfigMemorySize]("threshold").toBytes.toInt, shouldGzip = (_, res) => if (whiteList.isEmpty) { if (blackList.isEmpty) { true // default case, both whitelist and blacklist are empty so we gzip it. } else { // The blacklist is defined, so we gzip the result if it's not blacklisted. res.body.contentType match { case Some(MediaType.parse(outgoing)) => blackList.forall(mask => !matches(outgoing, mask)) case _ => true // Fail open (to gziping), since blacklists have a tendency to fail open. } } } else { // The whitelist is defined. We gzip the result IFF there is a matching whitelist entry. res.body.contentType match { case Some(MediaType.parse(outgoing)) => whiteList.exists(mask => matches(outgoing, mask)) case _ => false // Fail closed (to not gziping), since whitelists are intentionally strict. } }, compressionLevel = config.get[Int]("compressionLevel") ) } } /** * The gzip filter configuration provider. */ @Singleton class GzipFilterConfigProvider @Inject() (config: Configuration) extends Provider[GzipFilterConfig] { lazy val get = GzipFilterConfig.fromConfiguration(config) } /** * The gzip filter module. */ class GzipFilterModule extends SimpleModule( bind[GzipFilterConfig].toProvider[GzipFilterConfigProvider], bind[GzipFilter].toSelf ) /** * The gzip filter components. */ trait GzipFilterComponents { def configuration: Configuration def materializer: Materializer lazy val gzipFilterConfig: GzipFilterConfig = GzipFilterConfig.fromConfiguration(configuration) lazy val gzipFilter: GzipFilter = new GzipFilter(gzipFilterConfig)(materializer) }
{ "pile_set_name": "Github" }
# 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. FROM centos:6 MAINTAINER Richard Guo <riguo@pivotal.io> # install all software we need RUN yum install -y epel-release && \ yum makecache && \ yum install -y man passwd sudo tar which git mlocate links make bzip2 \ autoconf automake libtool m4 gcc gcc-c++ gdb flex cmake gperf indent \ libuuid-devel krb5-devel libgsasl-devel expat-devel libxml2-devel \ perl-ExtUtils-Embed pam-devel python-devel snappy-devel \ libyaml-devel libevent-devel bzip2-devel openssl-devel \ openldap-devel readline-devel net-snmp-devel apr-devel \ libesmtp-devel xerces-c-devel python-pip json-c-devel \ apache-ivy java-1.7.0-openjdk-devel wget \ openssh-clients openssh-server perl-JSON && \ yum clean all # update gcc RUN wget -O /etc/yum.repos.d/slc6-devtoolset.repo http://linuxsoft.cern.ch/cern/devtoolset/slc6-devtoolset.repo && \ rpm --import http://linuxsoft.cern.ch/cern/slc68/x86_64/RPM-GPG-KEY-cern && \ yum install -y devtoolset-2-gcc devtoolset-2-binutils devtoolset-2-gcc-c++ && \ echo "source /opt/rh/devtoolset-2/enable" >> ~/.bashrc && \ source ~/.bashrc # install libcurl 7.45.0 RUN mkdir -p /tmp/build/ && \ cd /tmp/build && curl -L "http://curl.haxx.se/download/curl-7.45.0.tar.bz2" -o curl-7.45.0.tar.bz2 && \ tar -xjf curl-7.45.0.tar.bz2 && cd curl-7.45.0 && \ ./configure --prefix=/usr && make && make install && \ rm -rf /tmp/build && ldconfig # install maven RUN curl -L "http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo" -o /etc/yum.repos.d/epel-apache-maven.repo && \ yum install -y apache-maven && \ yum clean all # OS requirements RUN echo "kernel.sem = 250 512000 100 2048" >> /etc/sysctl.conf # setup ssh server and keys for root RUN ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa && \ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys && \ chmod 0600 ~/.ssh/authorized_keys # setup JAVA_HOME for all users RUN echo "#!/bin/sh" > /etc/profile.d/java.sh && \ echo "export JAVA_HOME=/etc/alternatives/java_sdk" >> /etc/profile.d/java.sh && \ chmod a+x /etc/profile.d/java.sh # install boost 1.59 RUN mkdir -p /tmp/build && \ cd /tmp/build && curl -L "http://downloads.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.bz2" -o boost_1_59_0.tar.bz2 && \ tar -xjf boost_1_59_0.tar.bz2 && cd boost_1_59_0 && \ ./bootstrap.sh && ./b2 --prefix=/usr -q && ./b2 --prefix=/usr -q install && \ rm -rf /tmp/build # install bison 2.5.1 RUN mkdir -p /tmp/build/ && \ cd /tmp/build && curl -L "ftp://ftp.gnu.org/gnu/bison/bison-2.5.1.tar.gz" -o bison-2.5.1.tar.gz && \ tar -xzf bison-2.5.1.tar.gz && cd bison-2.5.1 && \ ./configure --prefix=/usr && make && make install && \ rm -rf /tmp/build # install thrift 0.9.1 RUN mkdir -p /tmp/build && \ cd /tmp/build && curl -L "https://archive.apache.org/dist/thrift/0.9.1/thrift-0.9.1.tar.gz" -o thrift-0.9.1.tar.gz && \ tar -xf thrift-0.9.1.tar.gz && cd thrift-0.9.1 && \ ./configure --prefix=/usr --without-tests && \ make && make install && \ rm -rf /tmp/build # install protobuf 2.5.0 RUN mkdir -p /tmp/build/ && \ cd /tmp/build && curl -L "https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.bz2" -o protobuf-2.5.0.tar.bz2 && \ tar -xjf protobuf-2.5.0.tar.bz2 && cd protobuf-2.5.0 && \ ./configure --prefix=/usr && make && make install && ldconfig && \ rm -rf /tmp/build # install python module RUN pip --retries=50 --timeout=300 install pycrypto RUN pip --retries=50 --timeout=300 install cogapp # create user gpadmin since HAWQ cannot run under root RUN groupadd -g 1000 gpadmin && \ useradd -u 1000 -g 1000 gpadmin && \ echo "gpadmin ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/gpadmin # sudo should not require tty RUN sed -i -e 's|Defaults requiretty|#Defaults requiretty|' /etc/sudoers RUN echo "#!/bin/bash" > /etc/profile.d/user.sh && \ echo "export USER=\`whoami\`" >> /etc/profile.d/user.sh && \ chmod a+x /etc/profile.d/user.sh ENV BASEDIR /data RUN mkdir -p /data && chmod 777 /data USER gpadmin # setup ssh client keys for gpadmin RUN ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa && \ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys && \ chmod 0600 ~/.ssh/authorized_keys WORKDIR /data
{ "pile_set_name": "Github" }
/*============================================================================= Copyright (c) 2001-2011 Joel de Guzman 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) ==============================================================================*/ #if !defined(FUSION_IS_SEQUENCE_05052005_1002) #define FUSION_IS_SEQUENCE_05052005_1002 #include <boost/fusion/support/config.hpp> #include <boost/fusion/support/sequence_base.hpp> #include <boost/fusion/support/tag_of.hpp> #include <boost/mpl/is_sequence.hpp> #include <boost/mpl/or.hpp> #include <boost/mpl/bool.hpp> #include <boost/type_traits/is_convertible.hpp> #include <boost/type_traits/is_same.hpp> namespace boost { namespace fusion { // Special tags: struct non_fusion_tag; struct boost_tuple_tag; // boost::tuples::tuple tag struct boost_array_tag; // boost::array tag struct mpl_sequence_tag; // mpl sequence tag struct std_pair_tag; // std::pair tag namespace extension { template <typename T> struct is_sequence_impl { template <typename Sequence> struct apply : is_convertible<Sequence, fusion::detail::from_sequence_convertible_type> {}; }; template <> struct is_sequence_impl<non_fusion_tag> { template <typename T> struct apply : mpl::false_ {}; }; template <> struct is_sequence_impl<boost_tuple_tag>; template <> struct is_sequence_impl<boost_array_tag>; template <> struct is_sequence_impl<mpl_sequence_tag>; template <> struct is_sequence_impl<std_pair_tag>; } namespace traits { template <typename T> struct is_sequence : mpl::bool_< (bool)extension::is_sequence_impl< typename fusion::detail::tag_of<T>::type >::template apply<T>::type::value > {}; template <typename Sequence, typename Enable = void> struct is_native_fusion_sequence : is_convertible<Sequence, fusion::detail::from_sequence_convertible_type> {}; } }} #endif
{ "pile_set_name": "Github" }
/* * Copyright (c) 1994, 2003, 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 sun.tools.tree; import sun.tools.java.*; import sun.tools.asm.Assembler; import java.util.Hashtable; /** * WARNING: The contents of this source file are not part of any * supported API. Code that depends on them does so at its own risk: * they are subject to change or removal without notice. */ public class LengthExpression extends UnaryExpression { /** * Constructor */ public LengthExpression(long where, Expression right) { super(LENGTH, where, Type.tInt, right); } /** * Select the type of the expression */ public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) { vset = right.checkValue(env, ctx, vset, exp); if (!right.type.isType(TC_ARRAY)) { env.error(where, "invalid.length", right.type); } return vset; } /** * Code */ public void codeValue(Environment env, Context ctx, Assembler asm) { right.codeValue(env, ctx, asm); asm.add(where, opc_arraylength); } }
{ "pile_set_name": "Github" }
///////////////////////////////////////////////////////////////////////// // $Id$ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2013-2014 The Bochs Project // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ///////////////////////////////////////////////////////////////////////// // ALSA PCM input/output and MIDI output support written by Volker Ruppert #include "iodev.h" #include "soundmod.h" #include "soundalsa.h" #if BX_HAVE_ALSASOUND && BX_SUPPORT_SOUNDLOW #define LOG_THIS bx_sound_alsa_c::bx_sound_alsa_c() :bx_sound_lowlevel_c() { alsa_seq.handle = NULL; alsa_pcm[0].handle = NULL; alsa_pcm[1].handle = NULL; alsa_pcm[0].buffer = NULL; alsa_pcm[1].buffer = NULL; BX_INFO(("Sound lowlevel module 'alsa' initialized")); } bx_sound_alsa_c::~bx_sound_alsa_c() { // nothing for now } int bx_sound_alsa_c::waveready() { return BX_SOUNDLOW_OK; } int bx_sound_alsa_c::midiready() { return BX_SOUNDLOW_OK; } int bx_sound_alsa_c::alsa_seq_open(const char *alsadev) { char *mididev, *ptr; int client, port, ret = 0; int length = strlen(alsadev) + 1; mididev = new char[length]; if (mididev == NULL) return BX_SOUNDLOW_ERR; strcpy(mididev, alsadev); ptr = strtok(mididev, ":"); if (ptr == NULL) { BX_ERROR(("ALSA sequencer setup: missing client parameters")); return BX_SOUNDLOW_ERR; } client = atoi(ptr); ptr = strtok(NULL, ":"); if (ptr == NULL) { BX_ERROR(("ALSA sequencer setup: missing port parameter")); return BX_SOUNDLOW_ERR; } port = atoi(ptr); delete(mididev); if (snd_seq_open(&alsa_seq.handle, "default", SND_SEQ_OPEN_OUTPUT, 0) < 0) { BX_ERROR(("Couldn't open ALSA sequencer for midi output")); return BX_SOUNDLOW_ERR; } ret = snd_seq_create_simple_port(alsa_seq.handle, NULL, SND_SEQ_PORT_CAP_WRITE | SND_SEQ_PORT_CAP_SUBS_WRITE | SND_SEQ_PORT_CAP_READ, SND_SEQ_PORT_TYPE_MIDI_GENERIC); if (ret < 0) { BX_ERROR(("ALSA sequencer: error creating port %s", snd_strerror(errno))); } else { alsa_seq.source_port = ret; ret = snd_seq_connect_to(alsa_seq.handle, alsa_seq.source_port, client, port); if (ret < 0) { BX_ERROR(("ALSA sequencer: could not connect to port %d:%d", client, port)); } } if (ret < 0) { snd_seq_close(alsa_seq.handle); return BX_SOUNDLOW_ERR; } else { return BX_SOUNDLOW_OK; } } int bx_sound_alsa_c::openmidioutput(const char *mididev) { if ((mididev == NULL) || (strlen(mididev) < 1)) return BX_SOUNDLOW_ERR; return alsa_seq_open(mididev); } int bx_sound_alsa_c::alsa_seq_output(int delta, int command, int length, Bit8u data[]) { int cmd, chan, value; snd_seq_event_t ev; snd_seq_ev_clear(&ev); snd_seq_ev_set_source(&ev, alsa_seq.source_port); snd_seq_ev_set_subs(&ev); snd_seq_ev_set_direct(&ev); cmd = command & 0xf0; chan = command & 0x0f; switch (cmd) { case 0x80: ev.type = SND_SEQ_EVENT_NOTEOFF; ev.data.note.channel = chan; ev.data.note.note = data[0]; ev.data.note.velocity = data[1]; ev.data.note.duration = delta; break; case 0x90: ev.type = SND_SEQ_EVENT_NOTEON; ev.data.note.channel = chan; ev.data.note.note = data[0]; ev.data.note.velocity = data[1]; ev.data.note.duration = 0; break; case 0xa0: ev.type = SND_SEQ_EVENT_KEYPRESS; ev.data.control.channel = chan; ev.data.control.param = data[0]; ev.data.control.value = data[1]; break; case 0xb0: ev.type = SND_SEQ_EVENT_CONTROLLER; ev.data.control.channel = chan; ev.data.control.param = data[0]; ev.data.control.value = data[1]; break; case 0xc0: ev.type = SND_SEQ_EVENT_PGMCHANGE; ev.data.control.channel = chan; ev.data.control.value = data[0]; break; case 0xd0: ev.type = SND_SEQ_EVENT_CHANPRESS; ev.data.control.channel = chan; ev.data.control.value = data[0]; break; case 0xe0: ev.type = SND_SEQ_EVENT_PITCHBEND; ev.data.control.channel = chan; value = data[0] | (data[1] << 7); value -= 0x2000; ev.data.control.value = value; break; case 0xf0: BX_ERROR(("alsa_seq_output(): SYSEX not implemented, length=%d", length)); return BX_SOUNDLOW_ERR; default: BX_ERROR(("alsa_seq_output(): unknown command 0x%02x, length=%d", command, length)); return BX_SOUNDLOW_ERR; } snd_seq_event_output(alsa_seq.handle, &ev); snd_seq_drain_output(alsa_seq.handle); return BX_SOUNDLOW_OK; } int bx_sound_alsa_c::sendmidicommand(int delta, int command, int length, Bit8u data[]) { if (alsa_seq.handle != NULL) { return alsa_seq_output(delta, command, length, data); } return BX_SOUNDLOW_ERR; } int bx_sound_alsa_c::closemidioutput() { if (alsa_seq.handle != NULL) { snd_seq_close(alsa_seq.handle); } return BX_SOUNDLOW_OK; } int bx_sound_alsa_c::openwaveoutput(const char *wavedev) { return BX_SOUNDLOW_OK; } int bx_sound_alsa_c::alsa_pcm_open(bx_bool mode, int frequency, int bits, bx_bool stereo, int format) { int ret; snd_pcm_format_t fmt; snd_pcm_hw_params_t *params; unsigned int size, freq; int dir, signeddata = format & 1; alsa_pcm[mode].audio_bufsize = 0; if (alsa_pcm[mode].handle == NULL) { ret = snd_pcm_open(&alsa_pcm[mode].handle, "default", mode ? SND_PCM_STREAM_CAPTURE : SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK); if (ret < 0) { return BX_SOUNDLOW_ERR; } BX_INFO(("ALSA: opened default PCM %s device", mode ? "input":"output")); } snd_pcm_hw_params_alloca(&params); snd_pcm_hw_params_any(alsa_pcm[mode].handle, params); snd_pcm_hw_params_set_access(alsa_pcm[mode].handle, params, SND_PCM_ACCESS_RW_INTERLEAVED); if ((frequency == wave_ch[mode].oldfreq) && (bits == wave_ch[mode].oldbits) && (stereo == wave_ch[mode].oldstereo) && (format == wave_ch[mode].oldformat)) return BX_SOUNDLOW_OK; // nothing to do wave_ch[mode].oldfreq = frequency; wave_ch[mode].oldbits = bits; wave_ch[mode].oldstereo = stereo; wave_ch[mode].oldformat = format; freq = (unsigned int)frequency; if (bits == 16) { if (signeddata == 1) fmt = SND_PCM_FORMAT_S16_LE; else fmt = SND_PCM_FORMAT_U16_LE; size = 2; } else if (bits == 8) { if (signeddata == 1) fmt = SND_PCM_FORMAT_S8; else fmt = SND_PCM_FORMAT_U8; size = 1; } else return BX_SOUNDLOW_ERR; if (stereo) size *= 2; snd_pcm_hw_params_set_format(alsa_pcm[mode].handle, params, fmt); snd_pcm_hw_params_set_channels(alsa_pcm[mode].handle, params, (stereo != 0) ? 2 : 1); snd_pcm_hw_params_set_rate_near(alsa_pcm[mode].handle, params, &freq, &dir); alsa_pcm[mode].frames = 32; snd_pcm_hw_params_set_period_size_near(alsa_pcm[mode].handle, params, &alsa_pcm[mode].frames, &dir); ret = snd_pcm_hw_params(alsa_pcm[mode].handle, params); if (ret < 0) { return BX_SOUNDLOW_ERR; } snd_pcm_hw_params_get_period_size(params, &alsa_pcm[mode].frames, &dir); alsa_pcm[mode].alsa_bufsize = alsa_pcm[mode].frames * size; BX_DEBUG(("ALSA: buffer size set to %d", alsa_pcm[mode].alsa_bufsize)); if (alsa_pcm[mode].buffer != NULL) { free(alsa_pcm[mode].buffer); alsa_pcm[mode].buffer = NULL; } return BX_SOUNDLOW_OK; } int bx_sound_alsa_c::startwaveplayback(int frequency, int bits, bx_bool stereo, int format) { return alsa_pcm_open(0, frequency, bits, stereo, format); } int bx_sound_alsa_c::alsa_pcm_write() { int ret; if (alsa_pcm[0].buffer == NULL) { alsa_pcm[0].buffer = (char *)malloc(alsa_pcm[0].alsa_bufsize); } while (alsa_pcm[0].audio_bufsize >= alsa_pcm[0].alsa_bufsize) { memcpy(alsa_pcm[0].buffer, audio_buffer[0], alsa_pcm[0].alsa_bufsize); ret = snd_pcm_writei(alsa_pcm[0].handle, alsa_pcm[0].buffer, alsa_pcm[0].frames); if (ret == -EAGAIN) continue; if (ret == -EPIPE) { /* EPIPE means underrun */ BX_ERROR(("ALSA: underrun occurred")); snd_pcm_prepare(alsa_pcm[0].handle); } else if (ret < 0) { BX_ERROR(("ALSA: error from writei: %s", snd_strerror(ret))); } else if (ret != (int)alsa_pcm[0].frames) { BX_ERROR(("ALSA: short write, write %d frames", ret)); } alsa_pcm[0].audio_bufsize -= alsa_pcm[0].alsa_bufsize; memcpy(audio_buffer[0], audio_buffer[0]+alsa_pcm[0].alsa_bufsize, alsa_pcm[0].audio_bufsize); } if ((alsa_pcm[0].audio_bufsize == 0) && (alsa_pcm[0].buffer != NULL)) { free(alsa_pcm[0].buffer); alsa_pcm[0].buffer = NULL; } return BX_SOUNDLOW_OK; } int bx_sound_alsa_c::sendwavepacket(int length, Bit8u data[]) { if (!alsa_pcm[0].handle) { // Alert indicating that caller is probably erroneous BX_ERROR(("sendwavepacket(): pcm is not open")); return BX_SOUNDLOW_ERR; } if ((alsa_pcm[0].audio_bufsize+length) <= BX_SOUND_LINUX_BUFSIZE) { memcpy(audio_buffer[0]+alsa_pcm[0].audio_bufsize, data, length); alsa_pcm[0].audio_bufsize += length; } else { BX_ERROR(("ALSA: audio buffer overflow")); return BX_SOUNDLOW_ERR; } if (alsa_pcm[0].audio_bufsize < alsa_pcm[0].alsa_bufsize) { return BX_SOUNDLOW_OK; } else { return alsa_pcm_write(); } } int bx_sound_alsa_c::stopwaveplayback() { if (alsa_pcm[0].handle && alsa_pcm[0].audio_bufsize > 0) { if (alsa_pcm[0].audio_bufsize < alsa_pcm[0].alsa_bufsize) { memset(audio_buffer[0]+alsa_pcm[0].audio_bufsize, 0, alsa_pcm[0].alsa_bufsize-alsa_pcm[0].audio_bufsize); alsa_pcm[0].audio_bufsize = alsa_pcm[0].alsa_bufsize; } alsa_pcm_write(); } return BX_SOUNDLOW_OK; } int bx_sound_alsa_c::closewaveoutput() { if (alsa_pcm[0].handle != NULL) { snd_pcm_drain(alsa_pcm[0].handle); snd_pcm_close(alsa_pcm[0].handle); alsa_pcm[0].handle = NULL; } return BX_SOUNDLOW_OK; } int bx_sound_alsa_c::openwaveinput(const char *wavedev, sound_record_handler_t rh) { record_handler = rh; if (rh != NULL) { record_timer_index = bx_pc_system.register_timer(this, record_timer_handler, 1, 1, 0, "soundlnx"); // record timer: inactive, continuous, frequency variable } return BX_SOUNDLOW_OK; } int bx_sound_alsa_c::startwaverecord(int frequency, int bits, bx_bool stereo, int format) { Bit64u timer_val; Bit8u shift = 0; if (record_timer_index != BX_NULL_TIMER_HANDLE) { if (bits == 16) shift++; if (stereo) shift++; record_packet_size = (frequency / 10) << shift; // 0.1 sec if (record_packet_size > BX_SOUNDLOW_WAVEPACKETSIZE) { record_packet_size = BX_SOUNDLOW_WAVEPACKETSIZE; } timer_val = (Bit64u)record_packet_size * 1000000 / (frequency << shift); bx_pc_system.activate_timer(record_timer_index, (Bit32u)timer_val, 1); } return alsa_pcm_open(1, frequency, bits, stereo, format); } int bx_sound_alsa_c::getwavepacket(int length, Bit8u data[]) { int ret; if (alsa_pcm[1].buffer == NULL) { alsa_pcm[1].buffer = (char *)malloc(alsa_pcm[1].alsa_bufsize); } while (alsa_pcm[1].audio_bufsize < length) { ret = snd_pcm_readi(alsa_pcm[1].handle, alsa_pcm[1].buffer, alsa_pcm[1].frames); if (ret == -EAGAIN) continue; if (ret == -EPIPE) { /* EPIPE means overrun */ BX_ERROR(("overrun occurred")); snd_pcm_prepare(alsa_pcm[1].handle); } else if (ret < 0) { BX_ERROR(("error from read: %s", snd_strerror(ret))); } else if (ret != (int)alsa_pcm[1].frames) { BX_ERROR(("short read, read %d frames", ret)); } memcpy(audio_buffer[1]+alsa_pcm[1].audio_bufsize, alsa_pcm[1].buffer, alsa_pcm[1].alsa_bufsize); alsa_pcm[1].audio_bufsize += alsa_pcm[1].alsa_bufsize; } memcpy(data, audio_buffer[1], length); alsa_pcm[1].audio_bufsize -= length; if ((alsa_pcm[1].audio_bufsize <= 0) && (alsa_pcm[1].buffer != NULL)) { free(alsa_pcm[1].buffer); alsa_pcm[1].buffer = NULL; } return BX_SOUNDLOW_OK; } int bx_sound_alsa_c::stopwaverecord() { if (record_timer_index != BX_NULL_TIMER_HANDLE) { bx_pc_system.deactivate_timer(record_timer_index); } if (alsa_pcm[1].handle != NULL) { snd_pcm_drain(alsa_pcm[1].handle); } return BX_SOUNDLOW_OK; } int bx_sound_alsa_c::closewaveinput() { stopwaverecord(); if (alsa_pcm[1].handle != NULL) { snd_pcm_drain(alsa_pcm[1].handle); snd_pcm_close(alsa_pcm[1].handle); alsa_pcm[1].handle = NULL; } return BX_SOUNDLOW_OK; } void bx_sound_alsa_c::record_timer_handler(void *this_ptr) { bx_sound_alsa_c *class_ptr = (bx_sound_alsa_c *) this_ptr; class_ptr->record_timer(); } void bx_sound_alsa_c::record_timer(void) { record_handler(this, record_packet_size); } #endif
{ "pile_set_name": "Github" }
#ifndef crypto_scalarmult_curve25519_H #define crypto_scalarmult_curve25519_H #include <stddef.h> #include "export.h" #ifdef __cplusplus extern "C" { #endif #define crypto_scalarmult_curve25519_BYTES 32U SODIUM_EXPORT size_t crypto_scalarmult_curve25519_bytes(void); #define crypto_scalarmult_curve25519_SCALARBYTES 32U SODIUM_EXPORT size_t crypto_scalarmult_curve25519_scalarbytes(void); SODIUM_EXPORT int crypto_scalarmult_curve25519(unsigned char *q, const unsigned char *n, const unsigned char *p) __attribute__ ((warn_unused_result)); SODIUM_EXPORT int crypto_scalarmult_curve25519_base(unsigned char *q, const unsigned char *n); /* ------------------------------------------------------------------------- */ int _crypto_scalarmult_curve25519_pick_best_implementation(void); #ifdef __cplusplus } #endif #endif
{ "pile_set_name": "Github" }
[Mesh] type = GeneratedMesh dim = 1 nx = 5 [] [Variables] [./u] [../] [] [ICs] [./ic] type = ConstantIC variable = u value = 1 [../] [] [Kernels] [./diff] type = Diffusion variable = u [../] [] [BCs] [./left] type = RobinBC variable = u boundary = left enable = false [../] [./right] type = RobinBC variable = u boundary = right [../] [] [Preconditioning] [./pc] type = SMP full = true [../] [] [Executioner] type = Steady solve_type = NEWTON nl_max_its = 1 []
{ "pile_set_name": "Github" }
/* This file is a part of libcds - Concurrent Data Structures library (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 Source code repo: http://github.com/khizmax/libcds/ Download: http://sourceforge.net/projects/libcds/files/ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef CDSUNIT_LIST_TEST_KV_LIST_HP_H #define CDSUNIT_LIST_TEST_KV_LIST_HP_H #include "test_kv_list.h" namespace cds_test { class kv_list_hp : public kv_list_common { protected: template <typename List> void test_hp( List& l ) { // Precondition: list is empty // Postcondition: list is empty static const size_t nSize = 20; typedef typename List::key_type list_key_type; typedef typename List::mapped_type list_mapped_type; typedef typename List::value_type list_value_type; typedef typename List::guarded_ptr guarded_ptr; struct key_val { int key; int val; }; key_val arr[nSize]; for ( size_t i = 0; i < nSize; ++i ) { arr[i].key = static_cast<int>(i); arr[i].val = arr[i].key * 10; } shuffle( arr, arr + nSize ); ASSERT_TRUE( l.empty() ); ASSERT_CONTAINER_SIZE( l, 0 ); guarded_ptr gp; size_t nCount = 0; // get() test for ( auto& i : arr ) { gp = l.get( i.key ); EXPECT_TRUE( !gp ); gp = l.get_with( other_key( i.key ), other_less()); EXPECT_TRUE( !gp ); EXPECT_TRUE( l.insert( i.key, i.val )); gp = l.get( i.key ); ASSERT_FALSE( !gp ); EXPECT_EQ( gp->first.nKey, i.key ); EXPECT_EQ( gp->second.val, gp->first.nKey * 10 ); gp->second.val = gp->first.nKey * 5; gp = l.get_with( other_key( i.key ), other_less()); ASSERT_FALSE( !gp ); EXPECT_EQ( gp->first.nKey, i.key ); EXPECT_EQ( gp->second.val, gp->first.nKey * 5 ); gp->second.val = gp->first.nKey * 10; ++nCount; ASSERT_FALSE( l.empty() ); ASSERT_CONTAINER_SIZE( l, nCount ); } ASSERT_FALSE( l.empty() ); ASSERT_CONTAINER_SIZE( l, nSize ); // extract() test for ( auto const& i : arr ) { ASSERT_FALSE( l.empty() ); ASSERT_CONTAINER_SIZE( l, nCount ); --nCount; gp = l.get( i.key ); ASSERT_FALSE( !gp ); EXPECT_EQ( gp->first.nKey, i.key ); switch ( i.key & 1 ) { case 0: gp = l.extract( i.key ); break; case 1: gp = l.extract_with( other_key( i.key ), other_less()); break; } ASSERT_FALSE( !gp ); EXPECT_EQ( gp->first.nKey, i.key ); EXPECT_EQ( gp->second.val, gp->first.nKey * 10 ); gp = l.get( i.key ); EXPECT_FALSE( gp ); gp = l.extract( i.key ); EXPECT_FALSE( gp ); gp = l.extract_with( other_key( i.key ), other_less()); EXPECT_FALSE( gp ); } ASSERT_TRUE( l.empty() ); ASSERT_CONTAINER_SIZE( l, 0 ); } }; } // namespace cds_list #endif // CDSUNIT_LIST_TEST_KV_LIST_HP_H
{ "pile_set_name": "Github" }
# Request parameter from attached device string param_id --- bool success ParamValue value
{ "pile_set_name": "Github" }
--- title: s_isDebuggerCheckDisabledForTestPurposes 字段 ms.date: 03/30/2017 ms.technology: dotnet-wpf topic_type: - apiref api_name: - System.Windows.Diagnostics.VisualDiagnostics.s_isDebuggerCheckDisabledForTestPurposes api_location: - PresentationCore.dll api_type: - Assembly ms.assetid: 9033a513-c255-4f31-b6d7-09b8d8c50e2d ms.openlocfilehash: ad9bc0ecf4b7a8e5f3ef13fdff5aa59ca8915922 ms.sourcegitcommit: 8699383914c24a0df033393f55db3369db728a7b ms.translationtype: MT ms.contentlocale: zh-CN ms.lasthandoff: 05/15/2019 ms.locfileid: "65634660" --- # <a name="sisdebuggercheckdisabledfortestpurposes-field"></a>s_isDebuggerCheckDisabledForTestPurposes 字段 在此专用字段`System.Windows.Diagnostics.VisualDiagnostics`类由 Visual Studio 用来确定是否将执行活动的调试器内部检查。 ## <a name="syntax"></a>语法 ```csharp private static bool s_isDebuggerCheckDisabledForTestPurposes ``` > [!WARNING] > 中的 Api`System.Windows.Diagnostics.VisualDiagnostics`当在调试器下运行应用程序时,类才可用。 设置`s_isDebuggerCheckDisabledForTestPurposes`到`true`访问调试器外的 Api。 > > Microsoft 不支持在生产应用程序在任何情况下使用此字段。 ## <a name="requirements"></a>要求 **Namespace**:<xref:System.Windows.Diagnostics> **程序集:** PresentationCore (在 PresentationCore.dll 中) **.NET framework 版本:** 自 4.6 之后可用。
{ "pile_set_name": "Github" }
#!/usr/bin/env python # -*- coding: utf-8; py-indent-offset:4 -*- ############################################################################### # # Copyright (C) 2015-2020 Daniel Rodriguez # # 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. If not, see <http://www.gnu.org/licenses/>. # ############################################################################### from __future__ import (absolute_import, division, print_function, unicode_literals) import testcommon import backtrader as bt import backtrader.indicators as btind chkdatas = 1 chkvals = [ ['57.644284', '41.630968', '53.352553'], ] chkmin = 15 chkind = btind.RSI_Safe def test_run(main=False): datas = [testcommon.getdata(i) for i in range(chkdatas)] testcommon.runtest(datas, testcommon.TestStrategy, main=main, plot=main, chkind=chkind, chkmin=chkmin, chkvals=chkvals) if __name__ == '__main__': test_run(main=True)
{ "pile_set_name": "Github" }
/* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.apache.batik.css.engine.value.svg; import org.apache.batik.css.engine.value.IdentifierManager; import org.apache.batik.css.engine.value.StringMap; import org.apache.batik.css.engine.value.Value; import org.apache.batik.css.engine.value.ValueManager; import org.apache.batik.util.CSSConstants; import org.apache.batik.util.SVGTypes; /** * This class provides a manager for the 'writing-mode' property values. * * @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a> * @version $Id$ */ public class WritingModeManager extends IdentifierManager { /** * The identifier values. */ protected static final StringMap values = new StringMap(); static { values.put(CSSConstants.CSS_LR_VALUE, SVGValueConstants.LR_VALUE); values.put(CSSConstants.CSS_LR_TB_VALUE, SVGValueConstants.LR_TB_VALUE); values.put(CSSConstants.CSS_RL_VALUE, SVGValueConstants.RL_VALUE); values.put(CSSConstants.CSS_RL_TB_VALUE, SVGValueConstants.RL_TB_VALUE); values.put(CSSConstants.CSS_TB_VALUE, SVGValueConstants.TB_VALUE); values.put(CSSConstants.CSS_TB_RL_VALUE, SVGValueConstants.TB_RL_VALUE); } /** * Implements {@link * org.apache.batik.css.engine.value.ValueManager#isInheritedProperty()}. */ public boolean isInheritedProperty() { return true; } /** * Implements {@link ValueManager#isAnimatableProperty()}. */ public boolean isAnimatableProperty() { return false; } /** * Implements {@link ValueManager#isAdditiveProperty()}. */ public boolean isAdditiveProperty() { return false; } /** * Implements {@link ValueManager#getPropertyType()}. */ public int getPropertyType() { return SVGTypes.TYPE_IDENT; } /** * Implements {@link * org.apache.batik.css.engine.value.ValueManager#getPropertyName()}. */ public String getPropertyName() { return CSSConstants.CSS_WRITING_MODE_PROPERTY; } /** * Implements {@link * org.apache.batik.css.engine.value.ValueManager#getDefaultValue()}. */ public Value getDefaultValue() { return SVGValueConstants.LR_TB_VALUE; } /** * Implements {@link IdentifierManager#getIdentifiers()}. */ public StringMap getIdentifiers() { return values; } }
{ "pile_set_name": "Github" }
##DESCRIPTION ## Trigonometry problem: Solve a special right triangle ##ENDDESCRIPTION ##KEYWORDS('trigonometry', 'right triangle', 'triangle') ## DBsubject(Trigonometry) ## DBchapter(Triangle Trigonometry) ## DBsection(Applications of special triangles & right triangles) ## Level(2) ## Author(K. Andrew Parker) ## Institution(CUNY City Tech) ## Language(en) ######################################################################## DOCUMENT(); loadMacros( "PGstandard.pl", # Standard macros for PG language "MathObjects.pl", "PGML.pl", "PGgraphmacros.pl" ); # Print problem number and point value (weight) for the problem TEXT(beginproblem()); # Show which answers are correct and which ones are incorrect $showPartialCorrectAnswers = 1; ############################################################## # # Setup # # Context("Numeric"); Context()->flags->set(reduceConstants=>0, reduceConstantFunctions=>0); Parser::Number::NoDecimals(); $hyp = random(3,11,2); $leg = Formula("$hyp/sqrt(2)"); $forty5 = "45~~x{00B0}"; $xmin = 0; $xmax = 1; $ymin = 0; $ymax = 1; $gr = init_graph(-0.15,-0.15,1.15,1.15,size=>[300,300]); $gr->lb('reset'); $gr->lb( new Label($xmin,$ymin,'A','black','center','top')); $gr->lb( new Label($xmax,$ymin,'B','black','center','top')); $gr->lb( new Label($xmin,$ymax,'C','black','center','bottom')); $gr->lb( new Label($xmin+0.05,$ymax-0.13,"$forty5",'blue','center','middle')); $gr->lb( new Label($xmax-0.1,$ymin+0.03,"$forty5",'blue','center','middle')); $gr->lb( new Label(0.5,$ymin-0.025,'x','red','center','middle')); $gr->lb( new Label($xmin-0.03,0.5,'y','red','center','middle')); $gr->lb( new Label(0.55,0.5,"$hyp",'blue','center','middle')); $gr->moveTo($xmin,$ymin); $gr->lineTo($xmax,$ymin,"black",2); # bottom edge $gr->lineTo($xmin,$ymax,"black",2); # hypotenuse $gr->lineTo($xmin,$ymin,"black",2); # left edge ############################################################## # # Text # # BEGIN_PGML >> [@ image(insertGraph($gr), width=>400, height=>400) @]* << If [` \overline{BC} `] has length [$hyp], find the length of [` \overline{AB} `] and [` \overline{AC} `]. [` \overline{AB} = `] [__________]{$leg} [` \overline{AC} = `] [__________]{$leg} * Your answers need to be in exact form, do not use decimal approximations. * To enter a number like [` \sqrt{3} `], use _sqrt(3)_. END_PGML BEGIN_PGML_HINT Any 45-45-90 triangle will also be an isosceles triangle. Which two sides must have the same length? Can you use this knowledge to determine the remaining sides? END_PGML_HINT BEGIN_PGML_SOLUTION 45-45-90 triangles are always isosceles triangles. The legs always have the same length. So we know right away that [` x = y `], based on the variables from the image. Now we can use Pythagorean theorem to help us with the legs: [` \overline{AB}^2 + \overline{AC}^2 = \overline{BC}^2 `] [` x^2 + y^2 = ([$hyp])^2 `] [` x^2 + x^2 = [@$hyp**2@] `] (_because [`x=y`]_) [` 2x^2 = [@$hyp**2@] `] [` x^2 = \frac{[@$hyp**2@]}{2} `] [` x = \sqrt{\frac{[@$hyp**2@]}{2}} `] [` x = \frac{[$hyp]}{\sqrt{2}} `] So we know the length of both legs: [` \overline{AB} = [$leg] `] and [` \overline{AC} = [$leg] `] END_PGML_SOLUTION COMMENT("Funded by US DoE Title V: Opening Gateways grant."); ENDDOCUMENT();
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="108dp" android:height="108dp" android:viewportWidth="108" android:viewportHeight="108"> <path android:fillColor="#008577" android:pathData="M0,0h108v108h-108z" /> <path android:fillColor="#00000000" android:pathData="M9,0L9,108" android:strokeWidth="0.8" android:strokeColor="#33FFFFFF" /> <path android:fillColor="#00000000" android:pathData="M19,0L19,108" android:strokeWidth="0.8" android:strokeColor="#33FFFFFF" /> <path android:fillColor="#00000000" android:pathData="M29,0L29,108" android:strokeWidth="0.8" android:strokeColor="#33FFFFFF" /> <path android:fillColor="#00000000" android:pathData="M39,0L39,108" android:strokeWidth="0.8" android:strokeColor="#33FFFFFF" /> <path android:fillColor="#00000000" android:pathData="M49,0L49,108" android:strokeWidth="0.8" android:strokeColor="#33FFFFFF" /> <path android:fillColor="#00000000" android:pathData="M59,0L59,108" android:strokeWidth="0.8" android:strokeColor="#33FFFFFF" /> <path android:fillColor="#00000000" android:pathData="M69,0L69,108" android:strokeWidth="0.8" android:strokeColor="#33FFFFFF" /> <path android:fillColor="#00000000" android:pathData="M79,0L79,108" android:strokeWidth="0.8" android:strokeColor="#33FFFFFF" /> <path android:fillColor="#00000000" android:pathData="M89,0L89,108" android:strokeWidth="0.8" android:strokeColor="#33FFFFFF" /> <path android:fillColor="#00000000" android:pathData="M99,0L99,108" android:strokeWidth="0.8" android:strokeColor="#33FFFFFF" /> <path android:fillColor="#00000000" android:pathData="M0,9L108,9" android:strokeWidth="0.8" android:strokeColor="#33FFFFFF" /> <path android:fillColor="#00000000" android:pathData="M0,19L108,19" android:strokeWidth="0.8" android:strokeColor="#33FFFFFF" /> <path android:fillColor="#00000000" android:pathData="M0,29L108,29" android:strokeWidth="0.8" android:strokeColor="#33FFFFFF" /> <path android:fillColor="#00000000" android:pathData="M0,39L108,39" android:strokeWidth="0.8" android:strokeColor="#33FFFFFF" /> <path android:fillColor="#00000000" android:pathData="M0,49L108,49" android:strokeWidth="0.8" android:strokeColor="#33FFFFFF" /> <path android:fillColor="#00000000" android:pathData="M0,59L108,59" android:strokeWidth="0.8" android:strokeColor="#33FFFFFF" /> <path android:fillColor="#00000000" android:pathData="M0,69L108,69" android:strokeWidth="0.8" android:strokeColor="#33FFFFFF" /> <path android:fillColor="#00000000" android:pathData="M0,79L108,79" android:strokeWidth="0.8" android:strokeColor="#33FFFFFF" /> <path android:fillColor="#00000000" android:pathData="M0,89L108,89" android:strokeWidth="0.8" android:strokeColor="#33FFFFFF" /> <path android:fillColor="#00000000" android:pathData="M0,99L108,99" android:strokeWidth="0.8" android:strokeColor="#33FFFFFF" /> <path android:fillColor="#00000000" android:pathData="M19,29L89,29" android:strokeWidth="0.8" android:strokeColor="#33FFFFFF" /> <path android:fillColor="#00000000" android:pathData="M19,39L89,39" android:strokeWidth="0.8" android:strokeColor="#33FFFFFF" /> <path android:fillColor="#00000000" android:pathData="M19,49L89,49" android:strokeWidth="0.8" android:strokeColor="#33FFFFFF" /> <path android:fillColor="#00000000" android:pathData="M19,59L89,59" android:strokeWidth="0.8" android:strokeColor="#33FFFFFF" /> <path android:fillColor="#00000000" android:pathData="M19,69L89,69" android:strokeWidth="0.8" android:strokeColor="#33FFFFFF" /> <path android:fillColor="#00000000" android:pathData="M19,79L89,79" android:strokeWidth="0.8" android:strokeColor="#33FFFFFF" /> <path android:fillColor="#00000000" android:pathData="M29,19L29,89" android:strokeWidth="0.8" android:strokeColor="#33FFFFFF" /> <path android:fillColor="#00000000" android:pathData="M39,19L39,89" android:strokeWidth="0.8" android:strokeColor="#33FFFFFF" /> <path android:fillColor="#00000000" android:pathData="M49,19L49,89" android:strokeWidth="0.8" android:strokeColor="#33FFFFFF" /> <path android:fillColor="#00000000" android:pathData="M59,19L59,89" android:strokeWidth="0.8" android:strokeColor="#33FFFFFF" /> <path android:fillColor="#00000000" android:pathData="M69,19L69,89" android:strokeWidth="0.8" android:strokeColor="#33FFFFFF" /> <path android:fillColor="#00000000" android:pathData="M79,19L79,89" android:strokeWidth="0.8" android:strokeColor="#33FFFFFF" /> </vector>
{ "pile_set_name": "Github" }
/*! * jQuery UI CSS Framework 1.11.4 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license * * http://api.jqueryui.com/category/theming/ * * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px */ /* Component containers ----------------------------------*/ .ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; } .ui-widget .ui-widget { font-size: 1em; } .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; } .ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url("images/ui-bg_flat_75_ffffff_40x100.png") 50% 50% repeat-x; color: #222222; } .ui-widget-content a { color: #222222; } .ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x; color: #222222; font-weight: bold; } .ui-widget-header a { color: #222222; } /* Interaction states ----------------------------------*/ .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x; font-weight: normal; color: #555555; } .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; } .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x; font-weight: normal; color: #212121; } .ui-state-hover a, .ui-state-hover a:hover, .ui-state-hover a:link, .ui-state-hover a:visited, .ui-state-focus a, .ui-state-focus a:hover, .ui-state-focus a:link, .ui-state-focus a:visited { color: #212121; text-decoration: none; } .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x; font-weight: normal; color: #212121; } .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; } /* Interaction Cues ----------------------------------*/ .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight { border: 1px solid #fcefa1; background: #fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x; color: #363636; } .ui-state-highlight a, .ui-widget-content .ui-state-highlight a, .ui-widget-header .ui-state-highlight a { color: #363636; } .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error { border: 1px solid #cd0a0a; background: #fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x; color: #cd0a0a; } .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; } .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; } .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } .ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); /* support: IE8 */ font-weight: normal; } .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); /* support: IE8 */ background-image: none; } .ui-state-disabled .ui-icon { filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */ } /* Icons ----------------------------------*/ /* states and images */ .ui-icon { width: 16px; height: 16px; } .ui-icon, .ui-widget-content .ui-icon { background-image: url("images/ui-icons_222222_256x240.png"); } .ui-widget-header .ui-icon { background-image: url("images/ui-icons_222222_256x240.png"); } .ui-state-default .ui-icon { background-image: url("images/ui-icons_888888_256x240.png"); } .ui-state-hover .ui-icon, .ui-state-focus .ui-icon { background-image: url("images/ui-icons_454545_256x240.png"); } .ui-state-active .ui-icon { background-image: url("images/ui-icons_454545_256x240.png"); } .ui-state-highlight .ui-icon { background-image: url("images/ui-icons_2e83ff_256x240.png"); } .ui-state-error .ui-icon, .ui-state-error-text .ui-icon { background-image: url("images/ui-icons_cd0a0a_256x240.png"); } /* positioning */ .ui-icon-blank { background-position: 16px 16px; } .ui-icon-carat-1-n { background-position: 0 0; } .ui-icon-carat-1-ne { background-position: -16px 0; } .ui-icon-carat-1-e { background-position: -32px 0; } .ui-icon-carat-1-se { background-position: -48px 0; } .ui-icon-carat-1-s { background-position: -64px 0; } .ui-icon-carat-1-sw { background-position: -80px 0; } .ui-icon-carat-1-w { background-position: -96px 0; } .ui-icon-carat-1-nw { background-position: -112px 0; } .ui-icon-carat-2-n-s { background-position: -128px 0; } .ui-icon-carat-2-e-w { background-position: -144px 0; } .ui-icon-triangle-1-n { background-position: 0 -16px; } .ui-icon-triangle-1-ne { background-position: -16px -16px; } .ui-icon-triangle-1-e { background-position: -32px -16px; } .ui-icon-triangle-1-se { background-position: -48px -16px; } .ui-icon-triangle-1-s { background-position: -64px -16px; } .ui-icon-triangle-1-sw { background-position: -80px -16px; } .ui-icon-triangle-1-w { background-position: -96px -16px; } .ui-icon-triangle-1-nw { background-position: -112px -16px; } .ui-icon-triangle-2-n-s { background-position: -128px -16px; } .ui-icon-triangle-2-e-w { background-position: -144px -16px; } .ui-icon-arrow-1-n { background-position: 0 -32px; } .ui-icon-arrow-1-ne { background-position: -16px -32px; } .ui-icon-arrow-1-e { background-position: -32px -32px; } .ui-icon-arrow-1-se { background-position: -48px -32px; } .ui-icon-arrow-1-s { background-position: -64px -32px; } .ui-icon-arrow-1-sw { background-position: -80px -32px; } .ui-icon-arrow-1-w { background-position: -96px -32px; } .ui-icon-arrow-1-nw { background-position: -112px -32px; } .ui-icon-arrow-2-n-s { background-position: -128px -32px; } .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } .ui-icon-arrow-2-e-w { background-position: -160px -32px; } .ui-icon-arrow-2-se-nw { background-position: -176px -32px; } .ui-icon-arrowstop-1-n { background-position: -192px -32px; } .ui-icon-arrowstop-1-e { background-position: -208px -32px; } .ui-icon-arrowstop-1-s { background-position: -224px -32px; } .ui-icon-arrowstop-1-w { background-position: -240px -32px; } .ui-icon-arrowthick-1-n { background-position: 0 -48px; } .ui-icon-arrowthick-1-ne { background-position: -16px -48px; } .ui-icon-arrowthick-1-e { background-position: -32px -48px; } .ui-icon-arrowthick-1-se { background-position: -48px -48px; } .ui-icon-arrowthick-1-s { background-position: -64px -48px; } .ui-icon-arrowthick-1-sw { background-position: -80px -48px; } .ui-icon-arrowthick-1-w { background-position: -96px -48px; } .ui-icon-arrowthick-1-nw { background-position: -112px -48px; } .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } .ui-icon-arrowreturn-1-w { background-position: -64px -64px; } .ui-icon-arrowreturn-1-n { background-position: -80px -64px; } .ui-icon-arrowreturn-1-e { background-position: -96px -64px; } .ui-icon-arrowreturn-1-s { background-position: -112px -64px; } .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } .ui-icon-arrow-4 { background-position: 0 -80px; } .ui-icon-arrow-4-diag { background-position: -16px -80px; } .ui-icon-extlink { background-position: -32px -80px; } .ui-icon-newwin { background-position: -48px -80px; } .ui-icon-refresh { background-position: -64px -80px; } .ui-icon-shuffle { background-position: -80px -80px; } .ui-icon-transfer-e-w { background-position: -96px -80px; } .ui-icon-transferthick-e-w { background-position: -112px -80px; } .ui-icon-folder-collapsed { background-position: 0 -96px; } .ui-icon-folder-open { background-position: -16px -96px; } .ui-icon-document { background-position: -32px -96px; } .ui-icon-document-b { background-position: -48px -96px; } .ui-icon-note { background-position: -64px -96px; } .ui-icon-mail-closed { background-position: -80px -96px; } .ui-icon-mail-open { background-position: -96px -96px; } .ui-icon-suitcase { background-position: -112px -96px; } .ui-icon-comment { background-position: -128px -96px; } .ui-icon-person { background-position: -144px -96px; } .ui-icon-print { background-position: -160px -96px; } .ui-icon-trash { background-position: -176px -96px; } .ui-icon-locked { background-position: -192px -96px; } .ui-icon-unlocked { background-position: -208px -96px; } .ui-icon-bookmark { background-position: -224px -96px; } .ui-icon-tag { background-position: -240px -96px; } .ui-icon-home { background-position: 0 -112px; } .ui-icon-flag { background-position: -16px -112px; } .ui-icon-calendar { background-position: -32px -112px; } .ui-icon-cart { background-position: -48px -112px; } .ui-icon-pencil { background-position: -64px -112px; } .ui-icon-clock { background-position: -80px -112px; } .ui-icon-disk { background-position: -96px -112px; } .ui-icon-calculator { background-position: -112px -112px; } .ui-icon-zoomin { background-position: -128px -112px; } .ui-icon-zoomout { background-position: -144px -112px; } .ui-icon-search { background-position: -160px -112px; } .ui-icon-wrench { background-position: -176px -112px; } .ui-icon-gear { background-position: -192px -112px; } .ui-icon-heart { background-position: -208px -112px; } .ui-icon-star { background-position: -224px -112px; } .ui-icon-link { background-position: -240px -112px; } .ui-icon-cancel { background-position: 0 -128px; } .ui-icon-plus { background-position: -16px -128px; } .ui-icon-plusthick { background-position: -32px -128px; } .ui-icon-minus { background-position: -48px -128px; } .ui-icon-minusthick { background-position: -64px -128px; } .ui-icon-close { background-position: -80px -128px; } .ui-icon-closethick { background-position: -96px -128px; } .ui-icon-key { background-position: -112px -128px; } .ui-icon-lightbulb { background-position: -128px -128px; } .ui-icon-scissors { background-position: -144px -128px; } .ui-icon-clipboard { background-position: -160px -128px; } .ui-icon-copy { background-position: -176px -128px; } .ui-icon-contact { background-position: -192px -128px; } .ui-icon-image { background-position: -208px -128px; } .ui-icon-video { background-position: -224px -128px; } .ui-icon-script { background-position: -240px -128px; } .ui-icon-alert { background-position: 0 -144px; } .ui-icon-info { background-position: -16px -144px; } .ui-icon-notice { background-position: -32px -144px; } .ui-icon-help { background-position: -48px -144px; } .ui-icon-check { background-position: -64px -144px; } .ui-icon-bullet { background-position: -80px -144px; } .ui-icon-radio-on { background-position: -96px -144px; } .ui-icon-radio-off { background-position: -112px -144px; } .ui-icon-pin-w { background-position: -128px -144px; } .ui-icon-pin-s { background-position: -144px -144px; } .ui-icon-play { background-position: 0 -160px; } .ui-icon-pause { background-position: -16px -160px; } .ui-icon-seek-next { background-position: -32px -160px; } .ui-icon-seek-prev { background-position: -48px -160px; } .ui-icon-seek-end { background-position: -64px -160px; } .ui-icon-seek-start { background-position: -80px -160px; } /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ .ui-icon-seek-first { background-position: -80px -160px; } .ui-icon-stop { background-position: -96px -160px; } .ui-icon-eject { background-position: -112px -160px; } .ui-icon-volume-off { background-position: -128px -160px; } .ui-icon-volume-on { background-position: -144px -160px; } .ui-icon-power { background-position: 0 -176px; } .ui-icon-signal-diag { background-position: -16px -176px; } .ui-icon-signal { background-position: -32px -176px; } .ui-icon-battery-0 { background-position: -48px -176px; } .ui-icon-battery-1 { background-position: -64px -176px; } .ui-icon-battery-2 { background-position: -80px -176px; } .ui-icon-battery-3 { background-position: -96px -176px; } .ui-icon-circle-plus { background-position: 0 -192px; } .ui-icon-circle-minus { background-position: -16px -192px; } .ui-icon-circle-close { background-position: -32px -192px; } .ui-icon-circle-triangle-e { background-position: -48px -192px; } .ui-icon-circle-triangle-s { background-position: -64px -192px; } .ui-icon-circle-triangle-w { background-position: -80px -192px; } .ui-icon-circle-triangle-n { background-position: -96px -192px; } .ui-icon-circle-arrow-e { background-position: -112px -192px; } .ui-icon-circle-arrow-s { background-position: -128px -192px; } .ui-icon-circle-arrow-w { background-position: -144px -192px; } .ui-icon-circle-arrow-n { background-position: -160px -192px; } .ui-icon-circle-zoomin { background-position: -176px -192px; } .ui-icon-circle-zoomout { background-position: -192px -192px; } .ui-icon-circle-check { background-position: -208px -192px; } .ui-icon-circlesmall-plus { background-position: 0 -208px; } .ui-icon-circlesmall-minus { background-position: -16px -208px; } .ui-icon-circlesmall-close { background-position: -32px -208px; } .ui-icon-squaresmall-plus { background-position: -48px -208px; } .ui-icon-squaresmall-minus { background-position: -64px -208px; } .ui-icon-squaresmall-close { background-position: -80px -208px; } .ui-icon-grip-dotted-vertical { background-position: 0 -224px; } .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } .ui-icon-grip-solid-vertical { background-position: -32px -224px; } .ui-icon-grip-solid-horizontal { background-position: -48px -224px; } .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } .ui-icon-grip-diagonal-se { background-position: -80px -224px; } /* Misc visuals ----------------------------------*/ /* Corner radius */ .ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { border-top-left-radius: 4px; } .ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { border-top-right-radius: 4px; } .ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { border-bottom-left-radius: 4px; } .ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { border-bottom-right-radius: 4px; } /* Overlays */ .ui-widget-overlay { background: #aaaaaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x; opacity: .3; filter: Alpha(Opacity=30); /* support: IE8 */ } .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x; opacity: .3; filter: Alpha(Opacity=30); /* support: IE8 */ border-radius: 8px; }
{ "pile_set_name": "Github" }
// use jsx to render html, do not modify simple.html import BannerAnim from 'rc-banner-anim'; import QueueAnim from 'rc-queue-anim'; import TweenOne from 'rc-tween-one'; import React from 'react'; import ReactDOM from 'react-dom'; import './assets/index.less'; import '../assets/index.less'; const { Element } = BannerAnim; const BgElement = Element.BgElement; function Demo() { return ( <BannerAnim autoPlay> <Element key="aaa" prefixCls="banner-user-elem" > <BgElement key="bg" className="bg" style={{ backgroundImage: 'url(https://os.alipayobjects.com/rmsportal/IhCNTqPpLeTNnwr.jpg)', backgroundSize: 'cover', backgroundPosition: 'center', }} /> <QueueAnim name="QueueAnim"> <h1 key="h1">Ant Motion Demo</h1> <p key="p">Ant Motion Demo.Ant Motion Demo.Ant Motion Demo.Ant Motion Demo</p> </QueueAnim> <TweenOne animation={{ y: 50, opacity: 0, type: 'from', delay: 200 }} name="TweenOne"> Ant Motion Demo.Ant Motion Demo </TweenOne> </Element> <Element key="bbb" prefixCls="banner-user-elem" > <BgElement key="bg" className="bg" style={{ backgroundImage: 'url(https://os.alipayobjects.com/rmsportal/uaQVvDrCwryVlbb.jpg)', backgroundSize: 'cover', backgroundPosition: 'center', }} /> <QueueAnim name="QueueAnim"> <h1 key="h1">Ant Motion Demo</h1> <p key="p">Ant Motion Demo.Ant Motion Demo.Ant Motion Demo.Ant Motion Demo</p> </QueueAnim> <TweenOne animation={{ y: 50, opacity: 0, type: 'from', delay: 200 }} name="TweenOne"> Ant Motion Demo.Ant Motion Demo </TweenOne> </Element> </BannerAnim> ); } ReactDOM.render(<Demo />, document.getElementById('__react-content'));
{ "pile_set_name": "Github" }
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <title>basic_datagram_socket::at_mark (1 of 2 overloads)</title> <link rel="stylesheet" href="../../../../boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.75.2"> <link rel="home" href="../../../../index.html" title="Asio"> <link rel="up" href="../at_mark.html" title="basic_datagram_socket::at_mark"> <link rel="prev" href="../at_mark.html" title="basic_datagram_socket::at_mark"> <link rel="next" href="overload2.html" title="basic_datagram_socket::at_mark (2 of 2 overloads)"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <table cellpadding="2" width="100%"><tr><td valign="top"><img alt="asio C++ library" width="250" height="60" src="../../../../asio.png"></td></tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="../at_mark.html"><img src="../../../../prev.png" alt="Prev"></a><a accesskey="u" href="../at_mark.html"><img src="../../../../up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../home.png" alt="Home"></a><a accesskey="n" href="overload2.html"><img src="../../../../next.png" alt="Next"></a> </div> <div class="section"> <div class="titlepage"><div><div><h5 class="title"> <a name="asio.reference.basic_datagram_socket.at_mark.overload1"></a><a class="link" href="overload1.html" title="basic_datagram_socket::at_mark (1 of 2 overloads)">basic_datagram_socket::at_mark (1 of 2 overloads)</a> </h5></div></div></div> <p> <span class="emphasis"><em>Inherited from basic_socket.</em></span> </p> <p> Determine whether the socket is at the out-of-band data mark. </p> <pre class="programlisting">bool at_mark() const; </pre> <p> This function is used to check whether the socket input is currently positioned at the out-of-band data mark. </p> <h6> <a name="asio.reference.basic_datagram_socket.at_mark.overload1.h0"></a> <span><a name="asio.reference.basic_datagram_socket.at_mark.overload1.return_value"></a></span><a class="link" href="overload1.html#asio.reference.basic_datagram_socket.at_mark.overload1.return_value">Return Value</a> </h6> <p> A bool indicating whether the socket is at the out-of-band data mark. </p> <h6> <a name="asio.reference.basic_datagram_socket.at_mark.overload1.h1"></a> <span><a name="asio.reference.basic_datagram_socket.at_mark.overload1.exceptions"></a></span><a class="link" href="overload1.html#asio.reference.basic_datagram_socket.at_mark.overload1.exceptions">Exceptions</a> </h6> <div class="variablelist"> <p class="title"><b></b></p> <dl> <dt><span class="term">asio::system_error</span></dt> <dd><p> Thrown on failure. </p></dd> </dl> </div> </div> <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> <td align="left"></td> <td align="right"><div class="copyright-footer">Copyright &#169; 2003-2019 Christopher M. Kohlhoff<p> Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) </p> </div></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="../at_mark.html"><img src="../../../../prev.png" alt="Prev"></a><a accesskey="u" href="../at_mark.html"><img src="../../../../up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../home.png" alt="Home"></a><a accesskey="n" href="overload2.html"><img src="../../../../next.png" alt="Next"></a> </div> </body> </html>
{ "pile_set_name": "Github" }
require 'spec_helper' describe 'PreviewGenerator' do it 'can be created by an URI' do g = PreviewGenerator.new('http://google.com') expect(g.uri).to eq('http://google.com') end context '#generate_preview' do it 'invokes LinkThumbnailer' do website = double(videos: [], images: []) expect(LinkThumbnailer).to receive(:generate).with('http://hey.com').and_return(website) PreviewGenerator.new('http://hey.com').generate_preview end it 'handles bad URIs' do expect(LinkThumbnailer).to receive(:generate).and_raise(Net::HTTPServerException.new('', '')) expect { PreviewGenerator.new('http://hey.com').generate_preview }.not_to raise_error end it 'detects the first embeddable video code' do embeddable = double(embed_code: 'code') non_embeddable = double(embed_code: nil) website = double(videos: [non_embeddable, embeddable], images: []) expect(LinkThumbnailer).to receive(:generate).with('http://hey.com').and_return(website) pg = PreviewGenerator.new('http://hey.com') pg.generate_preview expect(pg.video?).to eq(true) expect(pg.image?).to eq(false) expect(pg.type).to eq(:video) expect(pg.code).to eq('code') end it 'uses the first available image' do img = double(src: 'src') website = double(videos: [], images: [img]) expect(LinkThumbnailer).to receive(:generate).with('http://hey.com').and_return(website) pg = PreviewGenerator.new('http://hey.com') pg.generate_preview expect(pg.video?).to eq(false) expect(pg.image?).to eq(true) expect(pg.type).to eq(:image) expect(pg.code).to eq('src') end it 'gives up with no videos nor images' do website = double(videos: [], images: []) expect(LinkThumbnailer).to receive(:generate).with('http://hey.com').and_return(website) pg = PreviewGenerator.new('http://hey.com') pg.generate_preview expect(pg.video?).to eq(false) expect(pg.image?).to eq(false) expect(pg.none?).to eq(true) end end end
{ "pile_set_name": "Github" }
fileFormatVersion: 2 guid: 3c433e134e4719444b65bf064a77e22e timeCreated: 1455877211 licenseType: Store NativeFormatImporter: userData: assetBundleName: assetBundleVariant:
{ "pile_set_name": "Github" }
// // REPhotoThumbnailView.m // REPhotoCollectionController // // Copyright (c) 2012 Roman Efimov (https://github.com/romaonthego) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // #import "REPhotoThumbnailView.h" @implementation REPhotoThumbnailView @synthesize borderColor = _borderColor; - (void)setPhoto:(NSObject <REPhotoObjectProtocol> *)photo { } - (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { self.backgroundColor = [UIColor whiteColor]; self.borderColor = [UIColor colorWithRed:204/255.0 green:204/255.0 blue:204/255.0 alpha:1]; } return self; } // Only override drawRect: if you perform custom drawing. // An empty implementation adversely affects performance during animation. - (void)drawRect:(CGRect)rect { CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetLineWidth(context, 1); CGContextSetStrokeColorWithColor(context, _borderColor.CGColor); CGContextStrokeRect(context, rect); } @end
{ "pile_set_name": "Github" }
{ "info": { "gameover": { "address": 16713763, "type": "|u1" }, "lives": { "address": 16713842, "type": "|u1" }, "score": { "address": 16714566, "type": ">d4" } } }
{ "pile_set_name": "Github" }
eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=enabled org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
{ "pile_set_name": "Github" }
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- * vim: set ts=8 sts=4 et sw=4 tw=99: * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef vm_ArgumentsObject_inl_h #define vm_ArgumentsObject_inl_h #include "vm/ArgumentsObject.h" #include "vm/EnvironmentObject.h" #include "vm/EnvironmentObject-inl.h" #include "vm/JSScript-inl.h" namespace js { inline const Value& ArgumentsObject::element(uint32_t i) const { MOZ_ASSERT(!isElementDeleted(i)); const Value& v = data()->args[i]; if (IsMagicScopeSlotValue(v)) { CallObject& callobj = getFixedSlot(MAYBE_CALL_SLOT).toObject().as<CallObject>(); return callobj.aliasedFormalFromArguments(v); } return v; } inline void ArgumentsObject::setElement(JSContext* cx, uint32_t i, const Value& v) { MOZ_ASSERT(!isElementDeleted(i)); GCPtrValue& lhs = data()->args[i]; if (IsMagicScopeSlotValue(lhs)) { uint32_t slot = SlotFromMagicScopeSlotValue(lhs); CallObject& callobj = getFixedSlot(MAYBE_CALL_SLOT).toObject().as<CallObject>(); for (Shape::Range<NoGC> r(callobj.lastProperty()); !r.empty(); r.popFront()) { if (r.front().slot() == slot) { callobj.setAliasedFormalFromArguments(cx, lhs, r.front().propid(), v); return; } } MOZ_CRASH("Bad Arguments::setElement"); } lhs = v; } inline bool ArgumentsObject::maybeGetElements(uint32_t start, uint32_t count, Value* vp) { MOZ_ASSERT(start + count >= start); uint32_t length = initialLength(); if (start > length || start + count > length || isAnyElementDeleted()) { return false; } for (uint32_t i = start, end = start + count; i < end; ++i, ++vp) { *vp = element(i); } return true; } } /* namespace js */ #endif /* vm_ArgumentsObject_inl_h */
{ "pile_set_name": "Github" }
/* ----------------------------------------------------------------------- asm.h - Copyright (c) 1998 Geoffrey Keating PowerPC Assembly glue. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #define ASM_GLOBAL_DIRECTIVE .globl #define C_SYMBOL_NAME(name) name /* Macro for a label. */ #ifdef __STDC__ #define C_LABEL(name) name##: #else #define C_LABEL(name) name/**/: #endif /* This seems to always be the case on PPC. */ #define ALIGNARG(log2) log2 /* For ELF we need the `.type' directive to make shared libs work right. */ #define ASM_TYPE_DIRECTIVE(name,typearg) .type name,typearg; #define ASM_SIZE_DIRECTIVE(name) .size name,.-name /* If compiled for profiling, call `_mcount' at the start of each function. */ #ifdef PROF /* The mcount code relies on the return address being on the stack to locate our caller and so it can restore it; so store one just for its benefit. */ #ifdef PIC #define CALL_MCOUNT \ .pushsection; \ .section ".data"; \ .align ALIGNARG(2); \ 0:.long 0; \ .previous; \ mflr %r0; \ stw %r0,4(%r1); \ bl _GLOBAL_OFFSET_TABLE_@local-4; \ mflr %r11; \ lwz %r0,0b@got(%r11); \ bl JUMPTARGET(_mcount); #else /* PIC */ #define CALL_MCOUNT \ .section ".data"; \ .align ALIGNARG(2); \ 0:.long 0; \ .previous; \ mflr %r0; \ lis %r11,0b@ha; \ stw %r0,4(%r1); \ addi %r0,%r11,0b@l; \ bl JUMPTARGET(_mcount); #endif /* PIC */ #else /* PROF */ #define CALL_MCOUNT /* Do nothing. */ #endif /* PROF */ #define ENTRY(name) \ ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \ ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \ .align ALIGNARG(2); \ C_LABEL(name) \ CALL_MCOUNT #define EALIGN_W_0 /* No words to insert. */ #define EALIGN_W_1 nop #define EALIGN_W_2 nop;nop #define EALIGN_W_3 nop;nop;nop #define EALIGN_W_4 EALIGN_W_3;nop #define EALIGN_W_5 EALIGN_W_4;nop #define EALIGN_W_6 EALIGN_W_5;nop #define EALIGN_W_7 EALIGN_W_6;nop /* EALIGN is like ENTRY, but does alignment to 'words'*4 bytes past a 2^align boundary. */ #ifdef PROF #define EALIGN(name, alignt, words) \ ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \ ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \ .align ALIGNARG(2); \ C_LABEL(name) \ CALL_MCOUNT \ b 0f; \ .align ALIGNARG(alignt); \ EALIGN_W_##words; \ 0: #else /* PROF */ #define EALIGN(name, alignt, words) \ ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \ ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \ .align ALIGNARG(alignt); \ EALIGN_W_##words; \ C_LABEL(name) #endif #define END(name) \ ASM_SIZE_DIRECTIVE(name) #ifdef PIC #define JUMPTARGET(name) name##@plt #else #define JUMPTARGET(name) name #endif /* Local labels stripped out by the linker. */ #define L(x) .L##x
{ "pile_set_name": "Github" }
usage=<<EOH table2js -- convert html table to json Usage: table2js [-r] [<cols>...] table2js [-c <regex>] [<cols>...] table2js -h | --help Options: -h --help Show this message. -r Raw mode; don't strip whitespace or convert numerical values -c <regex> Cleaner regex, all matches removed from data, e.g. 'AUD|USD' <cols> List of column headers, e.g. name, age EOH if ! docopt $usage $*; then exit false fi to text | jf <<EOH (function() { var raw = sys.getenv(self, 'r')[0], cols = sys.getenv(self, 'cols'), rspec = sys.getenv(self, 'c')[0], cleaner = rspec ? new RegExp(rspec, 'g') : null; return $$("tr", x).toArray().map(function(e) { var row = $$(e).find("td").toArray().map(function(e) { var data = $$(e).text(); if (!raw) { data = data.trim(); if (cleaner) { data = data.replace(cleaner, ''); } var num = +data; if (!isNaN(num)) { data = num; } else { num = +data.replace(/,/g, '') if (!isNaN(num)) { data = num; } } } return data; }); if (!row.length) { return null; } if (!cols.length) { cols = []; for (var i = 0, len = row.length; i < len; i++) { cols.push(i.toString()); } } return zip_object(cols, row); }).filter(function(e) { return !!e; }); })() EOH
{ "pile_set_name": "Github" }
; RUN: opt -S -early-cse < %s | FileCheck %s declare float @roundf(float) #0 declare float @llvm.round.f32(float) #0 declare double @round(double) #0 declare double @llvm.round.f64(double) #0 ; CHECK-LABEL: @constant_fold_round_f32_01 ; CHECK-NEXT: ret float 1.000000e+00 define float @constant_fold_round_f32_01() #0 { %x = call float @roundf(float 1.25) #0 ret float %x } ; CHECK-LABEL: @constant_fold_round_f32_02 ; CHECK-NEXT: ret float -1.000000e+00 define float @constant_fold_round_f32_02() #0 { %x = call float @llvm.round.f32(float -1.25) #0 ret float %x } ; CHECK-LABEL: @constant_fold_round_f32_03 ; CHECK-NEXT: ret float 2.000000e+00 define float @constant_fold_round_f32_03() #0 { %x = call float @roundf(float 1.5) #0 ret float %x } ; CHECK-LABEL: @constant_fold_round_f32_04 ; CHECK-NEXT: ret float -2.000000e+00 define float @constant_fold_round_f32_04() #0 { %x = call float @llvm.round.f32(float -1.5) #0 ret float %x } ; CHECK-LABEL: @constant_fold_round_f32_05 ; CHECK-NEXT: ret float 3.000000e+00 define float @constant_fold_round_f32_05() #0 { %x = call float @roundf(float 2.75) #0 ret float %x } ; CHECK-LABEL: @constant_fold_round_f32_06 ; CHECK-NEXT: ret float -3.000000e+00 define float @constant_fold_round_f32_06() #0 { %x = call float @llvm.round.f32(float -2.75) #0 ret float %x } ; CHECK-LABEL: @constant_fold_round_f64_01 ; CHECK-NEXT: ret double 1.000000e+00 define double @constant_fold_round_f64_01() #0 { %x = call double @round(double 1.3) #0 ret double %x } ; CHECK-LABEL: @constant_fold_round_f64_02 ; CHECK-NEXT: ret double -1.000000e+00 define double @constant_fold_round_f64_02() #0 { %x = call double @llvm.round.f64(double -1.3) #0 ret double %x } ; CHECK-LABEL: @constant_fold_round_f64_03 ; CHECK-NEXT: ret double 2.000000e+00 define double @constant_fold_round_f64_03() #0 { %x = call double @round(double 1.5) #0 ret double %x } ; CHECK-LABEL: @constant_fold_round_f64_04 ; CHECK-NEXT: ret double -2.000000e+00 define double @constant_fold_round_f64_04() #0 { %x = call double @llvm.round.f64(double -1.5) #0 ret double %x } ; CHECK-LABEL: @constant_fold_round_f64_05 ; CHECK-NEXT: ret double 3.000000e+00 define double @constant_fold_round_f64_05() #0 { %x = call double @round(double 2.7) #0 ret double %x } ; CHECK-LABEL: @constant_fold_round_f64_06 ; CHECK-NEXT: ret double -3.000000e+00 define double @constant_fold_round_f64_06() #0 { %x = call double @llvm.round.f64(double -2.7) #0 ret double %x } attributes #0 = { nounwind readnone }
{ "pile_set_name": "Github" }
// Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option cc_enable_arenas = true; option go_package = "github.com/golang/protobuf/ptypes/timestamp"; option java_package = "com.google.protobuf"; option java_outer_classname = "TimestampProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; // A Timestamp represents a point in time independent of any time zone // or calendar, represented as seconds and fractions of seconds at // nanosecond resolution in UTC Epoch time. It is encoded using the // Proleptic Gregorian Calendar which extends the Gregorian calendar // backwards to year one. It is encoded assuming all minutes are 60 // seconds long, i.e. leap seconds are "smeared" so that no leap second // table is needed for interpretation. Range is from // 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. // By restricting to that range, we ensure that we can convert to // and from RFC 3339 date strings. // See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt). // // # Examples // // Example 1: Compute Timestamp from POSIX `time()`. // // Timestamp timestamp; // timestamp.set_seconds(time(NULL)); // timestamp.set_nanos(0); // // Example 2: Compute Timestamp from POSIX `gettimeofday()`. // // struct timeval tv; // gettimeofday(&tv, NULL); // // Timestamp timestamp; // timestamp.set_seconds(tv.tv_sec); // timestamp.set_nanos(tv.tv_usec * 1000); // // Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. // // FILETIME ft; // GetSystemTimeAsFileTime(&ft); // UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // // // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. // Timestamp timestamp; // timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); // timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); // // Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. // // long millis = System.currentTimeMillis(); // // Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) // .setNanos((int) ((millis % 1000) * 1000000)).build(); // // // Example 5: Compute Timestamp from current time in Python. // // timestamp = Timestamp() // timestamp.GetCurrentTime() // // # JSON Mapping // // In JSON format, the Timestamp type is encoded as a string in the // [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the // format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" // where {year} is always expressed using four digits while {month}, {day}, // {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional // seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), // are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone // is required, though only UTC (as indicated by "Z") is presently supported. // // For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past // 01:30 UTC on January 15, 2017. // // In JavaScript, one can convert a Date object to this format using the // standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString] // method. In Python, a standard `datetime.datetime` object can be converted // to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) // with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one // can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( // http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()) // to obtain a formatter capable of generating timestamps in this format. // // message Timestamp { // Represents seconds of UTC time since Unix epoch // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to // 9999-12-31T23:59:59Z inclusive. int64 seconds = 1; // Non-negative fractions of a second at nanosecond resolution. Negative // second values with fractions must still have non-negative nanos values // that count forward in time. Must be from 0 to 999,999,999 // inclusive. int32 nanos = 2; }
{ "pile_set_name": "Github" }
/* * * Copyright (c) 2006-2020, Speedment, Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); You may not * use this file except in compliance with the License. You may obtain a copy of * the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ package com.speedment.generator.translator.util; import static com.speedment.common.invariant.NullUtil.requireNonNullElements; import com.speedment.generator.translator.namer.JavaLanguageNamer; import java.util.*; import static java.util.Objects.requireNonNull; import java.util.function.Function; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Stream; /** * * @author Per Minborg * @since 2.1.0 */ public enum Pluralis { INSTANCE; private final List<Rule> rules; private final Set<String> uncountables; private final Map<String, String> irregulars; Pluralis() { rules = new ArrayList<>(); uncountables = new HashSet<>(); irregulars = new HashMap<>(); init(); Collections.reverse(rules); // Search the general rules last } public String pluralizeJavaIdentifier(String javaIdentifier, JavaLanguageNamer javaLanguageNamer) { requireNonNull(javaIdentifier); int lastCapitalCharacter = -1; for (int i = 0; i < javaIdentifier.length(); i++) { if (Character.isUpperCase(javaIdentifier.charAt(i))) { lastCapitalCharacter = i; } } if (lastCapitalCharacter == -1) { return pluralize(javaIdentifier); } else { final String firstPartOfWord = javaIdentifier.substring(0, lastCapitalCharacter); final String lastPartOfWord = javaIdentifier.substring(lastCapitalCharacter); final String pluralOflastPartOfWord = pluralize(lastPartOfWord); return firstPartOfWord + javaLanguageNamer.javaTypeName(pluralOflastPartOfWord); } } /** * Returns a plural version in normalized form of the given word. * * @param word the given singular word form * @return a plural version in normalized form of the given word */ public String pluralize(String word) { requireNonNull(word); final String normalized = normalize(word); if (normalized.length() == 0) { return normalized; } if (isUncountable(normalized)) { return normalized; } if (isIrregular(word)) { return irregulars.get(normalized); } for (Rule rule : rules) { final Optional<String> result = rule.apply(normalized); if (result.isPresent()) { return result.get(); } } return normalized; } /** * Returns a textual representation of an ordinal. 1 = 1st, 2 = 2nd, 101 * = 101st, 111 = 111th * * @param number the ordinal number * @return a textual representation of an ordinal */ public String ordinalize(final int number) { final int remainder = Math.abs(number % 100); final String numberStr = Integer.toString(number); if (remainder < 10) { if (remainder == 1) { return numberStr + "st"; } if (remainder == 2) { return numberStr + "nd"; } if (remainder == 3) { return numberStr + "rd"; } } return numberStr + "th"; } /** * Returns if the provided word is considered as an uncountable. * * @param word to check * @return if the provided word is considered as an uncountable */ public boolean isUncountable(String word) { requireNonNull(word); return uncountables.contains(normalize(word)); } public boolean isIrregular(String word) { requireNonNull(word); return irregulars.containsKey(normalize(word)); } protected void addRule(String rule, String replacement) { requireNonNull(rule); requireNonNull(replacement); rules.add(new Rule(rule, replacement)); } protected void addIrregular(String singular, String plural) { requireNonNull(singular); requireNonNull(plural); irregulars.put(normalize(singular), normalize(plural)); } protected void addUncountable(String... words) { requireNonNullElements(words); Stream.of(words).map(normalizeMapper()).forEach(uncountables::add); } private String normalize(String input) { requireNonNull(input); return normalizeMapper().apply(input); } public Function<String, String> normalizeMapper() { return s -> Optional.ofNullable(s).orElse("").trim().toLowerCase(); } private void init() { addRule("$", "s"); addRule("(.+)s$", "$1ses"); addRule("(ax|test)is$", "$1es"); addRule("(octop)us$", "$1i"); addRule("(octop|vir)i$", "$1i"); addRule("(alias|status)$", "$1es"); addRule("(bu)s$", "$1ses"); addRule("(buffal|tomat)o$", "$1oes"); addRule("([ti])um$", "$1a"); addRule("([ti])a$", "$1a"); addRule("sis$", "ses"); addRule("(?:([^f])fe|([lr])f)$", "$1$2ves"); addRule("(hive)$", "$1s"); addRule("([^aeiouy]|qu)y$", "$1ies"); addRule("(x|ch|ss|sh)$", "$1es"); addRule("(matr|vert|ind)ix|ex$", "$1ices"); addRule("([m|l])ouse$", "$1ice"); addRule("([m|l])ice$", "$1ice"); addRule("^(ox)$", "$1en"); addRule("(quiz)$", "$1zes"); addIrregular("woman", "women"); addIrregular("man", "men"); addIrregular("child", "children"); addIrregular("sex", "sexes"); addIrregular("person", "people"); addUncountable("furniture", "equipment", "information", "rice", "money", "species", "series", "fish", "sheep", "data"); } private static final class Rule implements Function<String, Optional<String>> { private final String expression; private final Pattern expressionPattern; private final String replacement; private Rule(final String expression, final String replacement) { this.expression = requireNonNull(expression); this.replacement =requireNonNull(replacement); this.expressionPattern = Pattern.compile(expression, Pattern.CASE_INSENSITIVE); } /** * Apply the rule against the input string, returning the modified * string or null if the rule didn't apply (and no modifications were * made) * * @param input the input string * @return the modified string if this rule applied, or null if the * input was not modified by this rule */ @Override public Optional<String> apply(String input) { final Matcher matcher = expressionPattern.matcher(input); if (!matcher.find()) { return Optional.empty(); } return Optional.ofNullable(matcher.replaceAll(replacement)); } @Override public int hashCode() { int hash = 3; hash = 41 * hash + Objects.hashCode(expression); hash = 41 * hash + Objects.hashCode(replacement); return hash; } @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Rule other = (Rule) obj; if (!Objects.equals(this.expression, other.expression)) { return false; } return Objects.equals(this.replacement, other.replacement); } @Override public String toString() { return expression + " -> " + replacement; } } }
{ "pile_set_name": "Github" }
#include "ruby.h" #include "extconf.h" #include "crc32.h" VALUE Digest_CRC32_update(VALUE self, VALUE data) { VALUE crc_ivar_name = rb_intern("@crc"); VALUE crc_ivar = rb_ivar_get(self, crc_ivar_name); crc32_t crc = NUM2UINT(crc_ivar); const char *data_ptr = StringValuePtr(data); size_t length = RSTRING_LEN(data); crc = crc32_update(crc,data_ptr,length); rb_ivar_set(self, crc_ivar_name, UINT2NUM(crc)); return self; } void Init_crc32_ext() { VALUE mDigest = rb_const_get(rb_cObject, rb_intern("Digest")); VALUE cCRC32 = rb_const_get(mDigest, rb_intern("CRC32")); rb_define_method(cCRC32, "update", Digest_CRC32_update, 1); }
{ "pile_set_name": "Github" }
/* * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ /* File: ConditionVariable.java Originally written by Doug Lea and released into the public domain. This may be used for any purposes whatsoever without acknowledgment. Thanks for the assistance and support of Sun Microsystems Labs, and everyone contributing, testing, and using this code. History: Date Who What 11Jun1998 dl Create public version 08dec2001 kmc Added support for Reentrant Mutexes */ package com.sun.corba.se.impl.orbutil.concurrent; import com.sun.corba.se.impl.orbutil.ORBUtility ; /** * This class is designed for fans of POSIX pthreads programming. * If you restrict yourself to Mutexes and CondVars, you can * use most of your favorite constructions. Don't randomly mix them * with synchronized methods or blocks though. * <p> * Method names and behavior are as close as is reasonable to * those in POSIX. * <p> * <b>Sample Usage.</b> Here is a full version of a bounded buffer * that implements the BoundedChannel interface, written in * a style reminscent of that in POSIX programming books. * <pre> * class CVBuffer implements BoundedChannel { * private final Mutex mutex; * private final CondVar notFull; * private final CondVar notEmpty; * private int count = 0; * private int takePtr = 0; * private int putPtr = 0; * private final Object[] array; * * public CVBuffer(int capacity) { * array = new Object[capacity]; * mutex = new Mutex(); * notFull = new CondVar(mutex); * notEmpty = new CondVar(mutex); * } * * public int capacity() { return array.length; } * * public void put(Object x) throws InterruptedException { * mutex.acquire(); * try { * while (count == array.length) { * notFull.await(); * } * array[putPtr] = x; * putPtr = (putPtr + 1) % array.length; * ++count; * notEmpty.signal(); * } * finally { * mutex.release(); * } * } * * public Object take() throws InterruptedException { * Object x = null; * mutex.acquire(); * try { * while (count == 0) { * notEmpty.await(); * } * x = array[takePtr]; * array[takePtr] = null; * takePtr = (takePtr + 1) % array.length; * --count; * notFull.signal(); * } * finally { * mutex.release(); * } * return x; * } * * public boolean offer(Object x, long msecs) throws InterruptedException { * mutex.acquire(); * try { * if (count == array.length) { * notFull.timedwait(msecs); * if (count == array.length) * return false; * } * array[putPtr] = x; * putPtr = (putPtr + 1) % array.length; * ++count; * notEmpty.signal(); * return true; * } * finally { * mutex.release(); * } * } * * public Object poll(long msecs) throws InterruptedException { * Object x = null; * mutex.acquire(); * try { * if (count == 0) { * notEmpty.timedwait(msecs); * if (count == 0) * return null; * } * x = array[takePtr]; * array[takePtr] = null; * takePtr = (takePtr + 1) % array.length; * --count; * notFull.signal(); * } * finally { * mutex.release(); * } * return x; * } * } * * </pre> * @see Mutex * [<a href="http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html"> Introduction to this package. </a>] **/ public class CondVar { protected boolean debug_ ; /** The mutex **/ protected final Sync mutex_; protected final ReentrantMutex remutex_; private int releaseMutex() { int count = 1 ; if (remutex_!=null) count = remutex_.releaseAll() ; else mutex_.release() ; return count ; } private void acquireMutex( int count ) throws InterruptedException { if (remutex_!=null) remutex_.acquireAll( count ) ; else mutex_.acquire() ; } /** * Create a new CondVar that relies on the given mutual * exclusion lock. * @param mutex A mutual exclusion lock which must either be non-reentrant, * or else be ReentrantMutex. * Standard usage is to supply an instance of <code>Mutex</code>, * but, for example, a Semaphore initialized to 1 also works. * On the other hand, many other Sync implementations would not * work here, so some care is required to supply a sensible * synchronization object. * In normal use, the mutex should be one that is used for <em>all</em> * synchronization of the object using the CondVar. Generally, * to prevent nested monitor lockouts, this * object should not use any native Java synchronized blocks. **/ public CondVar(Sync mutex, boolean debug) { debug_ = debug ; mutex_ = mutex; if (mutex instanceof ReentrantMutex) remutex_ = (ReentrantMutex)mutex; else remutex_ = null; } public CondVar( Sync mutex ) { this( mutex, false ) ; } /** * Wait for notification. This operation at least momentarily * releases the mutex. The mutex is always held upon return, * even if interrupted. * @exception InterruptedException if the thread was interrupted * before or during the wait. However, if the thread is interrupted * after the wait but during mutex re-acquisition, the interruption * is ignored, while still ensuring * that the currentThread's interruption state stays true, so can * be probed by callers. **/ public void await() throws InterruptedException { int count = 0 ; if (Thread.interrupted()) throw new InterruptedException(); try { if (debug_) ORBUtility.dprintTrace( this, "await enter" ) ; synchronized(this) { count = releaseMutex() ; try { wait(); } catch (InterruptedException ex) { notify(); throw ex; } } } finally { // Must ignore interrupt on re-acquire boolean interrupted = false; for (;;) { try { acquireMutex( count ); break; } catch (InterruptedException ex) { interrupted = true; } } if (interrupted) { Thread.currentThread().interrupt(); } if (debug_) ORBUtility.dprintTrace( this, "await exit" ) ; } } /** * Wait for at most msecs for notification. * This operation at least momentarily * releases the mutex. The mutex is always held upon return, * even if interrupted. * @param msecs The time to wait. A value less than or equal to zero * causes a momentarily release * and re-acquire of the mutex, and always returns false. * @return false if at least msecs have elapsed * upon resumption; else true. A * false return does NOT necessarily imply that the thread was * not notified. For example, it might have been notified * after the time elapsed but just before resuming. * @exception InterruptedException if the thread was interrupted * before or during the wait. **/ public boolean timedwait(long msecs) throws InterruptedException { if (Thread.interrupted()) throw new InterruptedException(); boolean success = false; int count = 0; try { if (debug_) ORBUtility.dprintTrace( this, "timedwait enter" ) ; synchronized(this) { count = releaseMutex() ; try { if (msecs > 0) { long start = System.currentTimeMillis(); wait(msecs); success = System.currentTimeMillis() - start <= msecs; } } catch (InterruptedException ex) { notify(); throw ex; } } } finally { // Must ignore interrupt on re-acquire boolean interrupted = false; for (;;) { try { acquireMutex( count ) ; break; } catch (InterruptedException ex) { interrupted = true; } } if (interrupted) { Thread.currentThread().interrupt(); } if (debug_) ORBUtility.dprintTrace( this, "timedwait exit" ) ; } return success; } /** * Notify a waiting thread. * If one exists, a non-interrupted thread will return * normally (i.e., not via InterruptedException) from await or timedwait. **/ public synchronized void signal() { notify(); } /** Notify all waiting threads **/ public synchronized void broadcast() { notifyAll(); } }
{ "pile_set_name": "Github" }
Output Change Documentation =========================== The EnergyPlus Input and Output form changes each release. This isn't referring to the numeric output of EnergyPlus, but rather the structure that is interpreted by other interfaces or scripts. This folder will contain the rules files that describe any structural output changes to EnergyPlus between releases. The format of this rules file is still being formed, so currently we have a plain text free form rules "format". Once the required form is determined, the file can be changed. To make sure the purpose of the rules file is understood, consider the following use cases for the file: - A report variable name changes: this is already documented in the ```Report Variables XYZ.csv``` file. - A graphical interface may read the tabular (html, etc.) output of EnergyPlus in order to perform calculations or results presentation to the user. The interface may expect the table headings in a certain form, and if this form changes -- even minorly -- it could break the interface's ability to display the output. While it is understood that changes/improvements may occur, they need to be clearly documented so that interfaces can adopt the changes easily. - A graphical interface may read the sql output. If the structure of this database changes, it could break interfaces as well. Some examples of changes that need to be documented: - A change in the header row of an html, sql, or other table type - EIO file changes?? Some examples of changes that don't need to be documented: - Numeric output changes within tables due to bug fixes/improvements.
{ "pile_set_name": "Github" }
/**************************************************************************** * * ftsmooth.h * * Anti-aliasing renderer interface (specification). * * Copyright (C) 1996-2019 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, * modified, and distributed under the terms of the FreeType project * license, LICENSE.TXT. By continuing to use, modify, or distribute * this file you indicate that you have read the license and * understand and accept it fully. * */ #ifndef FTSMOOTH_H_ #define FTSMOOTH_H_ #include <ft2build.h> #include FT_RENDER_H FT_BEGIN_HEADER FT_DECLARE_RENDERER( ft_smooth_renderer_class ) FT_DECLARE_RENDERER( ft_smooth_lcd_renderer_class ) FT_DECLARE_RENDERER( ft_smooth_lcdv_renderer_class ) FT_END_HEADER #endif /* FTSMOOTH_H_ */ /* END */
{ "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 <Foundation/NSOperationQueue.h> @interface STMOperationQueue : NSOperationQueue { } + (id)serialBackgroundQueue; + (id)concurrentBackgroundQueue; - (void)addOperation:(id)arg1; - (void)addOperations:(id)arg1; @end
{ "pile_set_name": "Github" }
// go run mksyscall.go -l32 -tags freebsd,386 syscall_bsd.go syscall_freebsd.go syscall_freebsd_386.go // Code generated by the command above; see README.md. DO NOT EDIT. // +build freebsd,386 package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(ngid int, gid *_Gid_t) (n int, err error) { r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(ngid int, gid *_Gid_t) (err error) { _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) { r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) wpid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(s int, how int) (err error) { _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) { r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { var _p0 unsafe.Pointer if len(mib) > 0 { _p0 = unsafe.Pointer(&mib[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, timeval *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimes(fd int, timeval *[2]Timeval) (err error) { _, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fcntl(fd int, cmd int, arg int) (val int, err error) { r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Madvise(b []byte, behav int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(behav)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlockall(flags int) (err error) { _, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mprotect(b []byte, prot int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Msync(b []byte, flags int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlockall() (err error) { _, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe2(p *[2]_C_int, flags int) (err error) { _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ptrace(request int, pid int, addr uintptr, data int) (err error) { _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getcwd(buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS___GETCWD, uintptr(_p0), uintptr(len(buf)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctl(fd int, req uint, arg uintptr) (err error) { _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Access(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { _, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func CapEnter() (err error) { _, _, e1 := Syscall(SYS_CAP_ENTER, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func capRightsGet(version int, fd int, rightsp *CapRights) (err error) { _, _, e1 := Syscall(SYS___CAP_RIGHTS_GET, uintptr(version), uintptr(fd), uintptr(unsafe.Pointer(rightsp))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func capRightsLimit(fd int, rightsp *CapRights) (err error) { _, _, e1 := Syscall(SYS_CAP_RIGHTS_LIMIT, uintptr(fd), uintptr(unsafe.Pointer(rightsp)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chflags(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chmod(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chroot(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Close(fd int) (err error) { _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(fd int) (nfd int, err error) { r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0) nfd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(from int, to int) (err error) { _, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exit(code int) { Syscall(SYS_EXIT, uintptr(code), 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrDeleteFd(fd int, attrnamespace int, attrname string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(attrname) if err != nil { return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrListFd(fd int, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FD, uintptr(fd), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrGetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrSetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrDeleteFile(file string, attrnamespace int, attrname string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrListFile(file string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(file) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrGetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrSetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attrname) if err != nil { return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(link) if err != nil { return } r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_POSIX_FADVISE, uintptr(fd), uintptr(offset), uintptr(offset>>32), uintptr(length), uintptr(length>>32), uintptr(advice)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchdir(fd int) (err error) { _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchflags(fd int, flags int) (err error) { _, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmod(fd int, mode uint32) (err error) { _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Flock(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fpathconf(fd int, name int) (val int, err error) { r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fstat(fd int, stat *stat_freebsd11_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fstat_freebsd12(fd int, stat *Stat_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT_FREEBSD12, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fstatat(fd int, path string, stat *stat_freebsd11_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FSTATAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fstatat_freebsd12(fd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FSTATAT_FREEBSD12, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fstatfs(fd int, stat *statfs_freebsd11_t) (err error) { _, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fstatfs_freebsd12(fd int, stat *Statfs_t) (err error) { _, _, e1 := Syscall(SYS_FSTATFS_FREEBSD12, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsync(fd int) (err error) { _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), uintptr(length>>32)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_GETDIRENTRIES, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getdirentries_freebsd12(fd int, buf []byte, basep *uint64) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_GETDIRENTRIES_FREEBSD12, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getdtablesize() (size int) { r0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0) size = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0) egid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (uid int) { r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0) gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, err error) { r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) pgid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgrp() (pgrp int) { r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0) pgrp = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0) pid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0) ppid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpriority(which int, who int) (prio int, err error) { r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) prio = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(which int, lim *Rlimit) (err error) { _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (err error) { _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, err error) { r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) sid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Issetugid() (tainted bool) { r0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0) tainted = bool(r0 != 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kill(pid int, signum syscall.Signal) (err error) { _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kqueue() (fd int, err error) { r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Link(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall6(SYS_LINKAT, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, backlog int) (err error) { _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func lstat(path string, stat *stat_freebsd11_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdir(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifo(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mknod(path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mknodat(fd int, path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mknodat_freebsd12(fd int, path string, mode uint32, dev uint64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_MKNODAT_FREEBSD12, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Open(path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Openat(fdat int, path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(fdat), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pathconf(path string, name int) (val int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlink(path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rename(from string, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(fromfd int, from string, tofd int, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Revoke(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rmdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { r0, r1, e1 := Syscall6(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(offset>>32), uintptr(whence), 0, 0) newoffset = int64(int64(r1)<<32 | int64(r0)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) { _, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setegid(egid int) (err error) { _, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seteuid(euid int) (err error) { _, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(gid int) (err error) { _, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setlogin(name string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(name) if err != nil { return } _, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (err error) { _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpriority(which int, who int, prio int) (err error) { _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (err error) { _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (err error) { _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresgid(rgid int, egid int, sgid int) (err error) { _, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresuid(ruid int, euid int, suid int) (err error) { _, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setrlimit(which int, lim *Rlimit) (err error) { _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, err error) { r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) pid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tp *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setuid(uid int) (err error) { _, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func stat(path string, stat *stat_freebsd11_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func statfs(path string, stat *statfs_freebsd11_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func statfs_freebsd12(path string, stat *Statfs_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STATFS_FREEBSD12, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlink(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sync() (err error) { _, _, e1 := Syscall(SYS_SYNC, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), uintptr(length>>32)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(newmask int) (oldmask int) { r0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0) oldmask = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Undelete(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlink(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlinkat(dirfd int, path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unmount(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func write(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { r0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos), uintptr(pos>>32), 0, 0) ret = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func readlen(fd int, buf *byte, nbuf int) (n int, err error) { r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func writelen(fd int, buf *byte, nbuf int) (n int, err error) { r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error) { r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0) nfd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return }
{ "pile_set_name": "Github" }
import {Subject} from 'rxjs'; import {Injectable} from '@angular/core'; import {Quest} from '../Interfaces/Quest'; import {environment} from '../../environments/environment'; import { HttpClient, HttpErrorResponse } from '@angular/common/http'; import {Participation} from '../Interfaces/Participation'; @Injectable() export class ParticipationService { private participationUpdateSource = new Subject<string>(); participationUpdated$ = this.participationUpdateSource.asObservable(); constructor(public http: HttpClient) { } createParticipation(quest: Quest): Promise<Participation> { return this.http.post<Participation>(`${environment.endpoint}/participation/${quest.id}`, null) .toPromise() .catch(this.handleError); } public getParticipations(quest: Quest): Promise<Participation[]> { return this.http.get<Participation[]>(`${environment.endpoint}/participation/${quest.id}/all`).toPromise(); } public getAllMyParticipations(): Promise<Participation[]> { return this.http.get<Participation[]>(`${environment.endpoint}/participation/allMyParticipations`).toPromise(); } announceParticipationUpdate() { this.participationUpdateSource.next(); } private handleError(error: HttpErrorResponse | any) { let errMsg: string; if (error instanceof HttpErrorResponse) { errMsg = `${error.status} - ${error.statusText || ''}`; } else { errMsg = error.message ? error.message : error.toString(); } console.error(errMsg); return Promise.reject(errMsg); } }
{ "pile_set_name": "Github" }
#ifndef CAFFE_FLATTEN_LAYER_HPP_ #define CAFFE_FLATTEN_LAYER_HPP_ #include <vector> #include "caffe/blob.hpp" #include "caffe/layer.hpp" #include "caffe/proto/caffe.pb.h" namespace caffe { /** * @brief Reshapes the input Blob into flat vectors. * * Note: because this layer does not change the input values -- merely the * dimensions -- it can simply copy the input. The copy happens "virtually" * (thus taking effectively 0 real time) by setting, in Forward, the data * pointer of the top Blob to that of the bottom Blob (see Blob::ShareData), * and in Backward, the diff pointer of the bottom Blob to that of the top Blob * (see Blob::ShareDiff). */ template <typename Dtype> class FlattenLayer : public Layer<Dtype> { public: explicit FlattenLayer(const LayerParameter& param) : Layer<Dtype>(param) {} virtual void Reshape(const vector<Blob<Dtype>*>& bottom, const vector<Blob<Dtype>*>& top); virtual inline const char* type() const { return "Flatten"; } virtual inline int ExactNumBottomBlobs() const { return 1; } virtual inline int ExactNumTopBlobs() const { return 1; } protected: /** * @param bottom input Blob vector (length 2+) * -# @f$ (N \times C \times H \times W) @f$ * the inputs * @param top output Blob vector (length 1) * -# @f$ (N \times CHW \times 1 \times 1) @f$ * the outputs -- i.e., the (virtually) copied, flattened inputs */ virtual void Forward_cpu(const vector<Blob<Dtype>*>& bottom, const vector<Blob<Dtype>*>& top); /** * @brief Computes the error gradient w.r.t. the concatenate inputs. * * @param top output Blob vector (length 1), providing the error gradient with * respect to the outputs * @param propagate_down see Layer::Backward. * @param bottom input Blob vector (length K), into which the top error * gradient is (virtually) copied */ virtual void Backward_cpu(const vector<Blob<Dtype>*>& top, const vector<bool>& propagate_down, const vector<Blob<Dtype>*>& bottom); }; } // namespace caffe #endif // CAFFE_FLATTEN_LAYER_HPP_
{ "pile_set_name": "Github" }
# ioFog System Container Requirements Every ioFog instance comes with some default containers. These "system containers" provide functionality that enhances the ioFog software. The reason this functionality comes in the form of a container is so it can be updated easily for all ioFog instances. One of the best things about ioFog is that once the base software that handles containers is running, everything else can be implemented as a container and this minimizes the versioning problems that happen with distributed software. The first system container is called Core Networking. It is responsible for connecting to instances of the ComSat product, also made by iofog. ComSat creates secure network pipes that move pure bytes from one place to another through all firewalls and other internetworking challenges. So the Core Networking container has functionality that manages connections to the ComSat, understands how to verify the identity of a ComSat, and relays the incoming traffic to the proper place in the ioFog instance. It also moves the outbound traffic to the ComSat so it can reach its desintation on the other side (which is always unknown from the ioFog instance's perspective). The Core Networking system container can be operated in two different modes. In public mode, the container takes in bytes via ComSat socket connections and sends those bytes directly to a designated host on the local network at the proper local port. Then it takes the response bytes and moves them directly back to the ComSat socket that sent the original bytes. This creates a secure pipe from the outside world into a specific port on a specific container... all without revealing any information about the container to the outside world or exposing anything other than the chosen port. In private mode, the Core Networking system container receives data messages on the ioFog real-time data message Websocket and sends them on the ComSat socket. It also receives messages on the ComSat socket and publishes them on the ioFog real-time data message Websocket. Although the Core Networking container does not know where the other end of the ComSat socket is connected, this still results in a many-to-many interconnected web of ioFogs. The container does not need to know the destination. It only needs to follow the rules of communication while operating in private mode. The ComSat is the only thing that knows which sockets connect together, but it has no knowledge of what is connected to those sockets. And because the ioFog instances are the initiators of the ComSat socket connections on both sides... if the ComSat becomes compromised, any break in the existing connections to try to re-route them would result in ioFog instances closing their connections... and when they would try to reestablish connections they would be using non-matching passcodes. The second system container is called Debug Console. Its primary purpose is to give developers the ability to look at ioMessages without needing to build an application to do so. So why can't developers just look at ioMessages directly? Because actual ioMessages move very quickly from one container to another and then they are gone. They either end up going out from an ioFog instance to another ioFog instance or going out to some final endpoint such as a data repository, an enterprise cloud system, or something similar. Developers need to look at ioMessages so they can debug their code in production situations and so they can see what the ioMessage data looks like at different points in the container-to-container processing chain. The Debug Console captures the ioMessages that are routed to it and makes them available through a REST API. By taking data that is in motion and holding onto it, the Debug Console gives the developer a chance to see what's happening in a live system just like they were running a debugging console on a local build environment. It's a lot like setting a breakpoint in an IDE and looking at the value of some variables or objects. The Debug Console hosts a REST API on port 80 that provides access to the messages it is holding. In order to talk to the container on port 80, the public port feature of the ComSat technology is used. This allows a developer to see ioMessages moving through a live system from anywhere. This is important because most deployed instances of ioFog will not be in the same physical location as the developer or the solution maintenance person. To prevent unwanted access to the ioMessages, the Debug Console only responds to REST API requests that provide a valid access token. The Debug Console container gets the current valid access token from its container configuration information. The third system container is called Stream Viewer. Its primary purpose is to provide developers with a way to see the messages moving through the ioFog in human way... looking at the content instead of the data. Just like photo editing software lets you look at the picture you are editing, the Stream Viewer lets you see the information moving through ioFog in its native form. In order to show the messages in a human-viewable format, the Stream Viewer needs to interpret the incoming messages and save them as the appropriate output files. It knows how to format and save the different types of messages because it has a reference table that matches to the known ioMessage InfoTypes and InfoFormats. When an incoming message does not match any known types (there is no entry in the table) then the Stream Viewer just creates a default output file for that message. The Stream Viewer stores output files with timestamps as the names. They are stored in folders with the names of the publishers. This allows Stream Viewer to identify the proper files when generating responses for its REST API. And speaking of REST APIs... the Stream Viewer provides a REST API on port 80 that allows developers to ask for the list of files for a particular publisher within a particular timeframe. The Stream Viewer also provides an HTTP Web server that serves out the files from the publisher folders when they are directly requested on port 80. By providing both of these services, Stream Viewer gives developers the ability to see what files are available to view and then retrieve them for direct viewing. As an example, let's assume we have a camera connected to ioFog. The photos coming from the camera are routed into Stream Viewer. The Stream Viewer saves them as their native PNG file type and keeps them in a folder. The developer asks the Stream Viewer REST API for the list of files belonging to that camera and generated in the last 5 minutes. The Stream Viewer gives the file list as JSON output and then the developer loops through the file list and retrieves the PNG files directly from the Stream Viewer like a regular Web server. Now the developer can see what the camera saw in the last 5 minutes... and they can do it from anywhere on the planet! #### Core Networking Container Requirements * Hold a pool of socket connections to the ComSat specified in the configuration * Create the number of pool connections specified in the configuration * If configured in "private" mode, receive and post messages from and to the ioFog * If configured in "public" mode, take incoming bytes on the ComSat socket and pipe them directly into a local network request * Make local network requests based on the configuration provided for this container * Pipe the response from the local network request directly back to the ComSat socket which sent the bytes * When a ComSat socket closes, remove it from the connection pool * Monitor the connection pool and make sure it always has the configured number of open connections * If connectivity to the ComSat disappears for any reason (gets dropped, network unavailable, etc.) then close all connections in the pool and open fresh connections to the ComSat * If connections to the ComSat cannot be opened, try again regularly but don't consume too much CPU usage * Send the ComSat socket passcode (provided in container configuration) immediately upon successfully opening each ComSat socket * When in "private" mode, use the real-time data message Websocket to send and receive messages to and from the ioFog Local API * Use the real-time control message Websocket to make sure any changes to container configuration are received immediately * When a "new config" control message is received, immediately make a request on the ioFog REST API to retrieve the updated container configuration * Build this system container with the Java Container SDK * Use TLS secure socket connections to the ComSat, which will not open successfully if the identity of the ComSat cannot be verified * Use a local intermediate public certificate file to verify the identity of the ComSat * Send a heartbeat transmission to the ComSat on every open socket at the interval specified in the container configuration * Send the ASCII byte values 'BEAT' as the heartbeat transmission on the ComSat sockets * Keep track of the last time each socket had successful communication with the ComSat (the "last active" timestamp) * Check incoming socket messages to see if they are equal to 'BEAT' or 'BEATBEAT'... if they are, update the "last active" timestamp for the receiving socket * When a ComSat socket has been inactive past the threshold (set in container config) then close the socket so a new one can be opened * Check incoming socket messages to see if they are equal to "AUTHORIZED"... if they are, update the "last active" timestamp for the receiving socket... this is a response that the ComSat will provide when the passcode was correct for a newly opened socket * When sending a message on a ComSat socket, send a 'TXEND' transmission immediately after the end of the actual message * When receiving a message on a ComSat socket, accumulate the incoming message bytes until receiving a 'TXEND' transmission... then it is OK to parse the message * After receiving a 'TXEND' transmission on a ComSat socket, send an 'ACK' transmission * When operating in "private" mode, keep a buffer of messages to be sent on the ComSat socket... this this allows messages to still be delivered under troublesome network connectivity situations * Remove a message from the buffer when an "ACK" message has been received after sending the message * If an 'ACK' is not received after sending a message on a ComSat socket, send the same message again after a short time period * Limit the amount of messages stored in the buffer to a safe level to avoid memory limit crashes... simply delete the oldest message when a new one arrives * Limit the number of bytes being buffered by a receiving ComSat socket to a safe level... drop bytes out of memory if needed and do not attempt to parse messages that have missing bytes... and close a socket connection if needed in order to avoid memory limit crashes... alternatively you can drop bytes until receiving a 'TXEND' and then send an 'ACK' in order to avoid receiving the same large message again * Parse and consume container configuration according to this example: <pre> {"mode":"public","host":"comsat1.iofog.org","port":35046,"connectioncount":60,"passcode":"vy7cvpztnhgc3jdptgxp9ttmzxfyfbqh","localhost":"iofog","localport":60401,"heartbeatfrequency":20000,"heartbeatabsencethreshold":60000} Or {"mode":"private","host":"comsat2.iofog.org","port":35081,"connectioncount":1,"passcode":"vy7cvpztnhgc3jdptgxp9ttmzxfyfbqh","localhost":"","localport":0,"heartbeatfrequency":20000,"heartbeatabsencethreshold":60000} </pre> #### Debug Console Container Requirements * Get the current container configuration from the ioFog Local API immediately when the container starts * Open a control message Websocket connection to the ioFog Local API and make sure that an open connection is always present * When a new config message is received on the control message Websocket, send an "acknowledge" response and then make a request to the ioFog Local API REST endpoing to get the current container configuration * Whenever container configuration is received, use the configuration information to set up the container's operations according to the config information - the template for the configuration information can be found in the Debug Console Specification document * Open a data message Websocket connection to the ioFog Local API and make sure that an open connection is always present * Receive messages that arrive on the data message Websocket connection and send an "acknowledge" response and then store each message in the appropriate file * Store messages in a different file for each publisher * Store messages in JSON format in the files in a way that allows them to be retrieved and turned into an array easily * Name the storage files as "XXXX.json" where the XXXX is the actual publisher ID * Limit the stored file size for each publisher - The limit storage size will be provided in the container configuration * When a file for a particular publisher file has reached its size limit, simply delete the oldest message to make room for the next new message * Provide a REST API on port 80 according to the Debug Console Specification document * Provide a "404 Not Found" response to any request on the REST API that does not include a valid access token * Use the local JSON message storage files to get the messages needed for output on the REST API * Use the Java Container SDK to build the container #### Stream Viewer Container Requirements * Get the current container configuration from the ioFog Local API immediately when the container starts * Open a control message Websocket connection to the ioFog Local API and make sure that an open connection is always present * When a new config message is received on the control message Websocket, send an "acknowledge" response and then make a request to the ioFog Local API REST endpoing to get the current container configuration * Whenever container configuration is received, use the configuration information to set up the container's operations according to the config information - the template for the configuration information can be found in the Stream Viewer Specification document * Open a data message Websocket connection to the ioFog Local API and make sure that an open connection is always present * Receive messages that arrive on the data message Websocket connection and send an "acknowledge" response and then process each message * Keep a table of message types and formats that contains a processing instruction for each type and format * Provide a set of processing functions that can be used for processing different types of messages... the processing consists of taking the incoming message data and turning it into a completed output file * Provide a default processing function that can be used for messages which have no entry in the table of message types and formats * Store messages as a separate file in the appropriate folder * Create a separate folder for each publisher that is sending messages into the Stream Viewer container * Name the stored files as "1234567890123.XXX" where the 1234567890123 is the timestamp of the message and XXX is the standard file extension of the file type * Limit the stored folder size for each publisher - The limit storage size will be provided in the container configuration * When a folder for a particular publisher has reached its size limit, simply delete the oldest file to make room for the next new file * Provide a REST API on port 80 according to the Stream Viewer Specification document * Provide a "404 Not Found" response to any request on the REST API that does not include a valid access token * Provide a standard HTTP Web server on port 80 that serves out the files located in the publisher folders when directly requested * Use the local stored files to generate the file list for output on the REST API * Use the Java Container SDK to build the container
{ "pile_set_name": "Github" }
/* SPDX-License-Identifier: BSD-3-Clause * Copyright (c) 2016 - 2018 Cavium Inc. * All rights reserved. * www.cavium.com */ #ifndef __ETH_COMMON__ #define __ETH_COMMON__ /********************/ /* ETH FW CONSTANTS */ /********************/ /* FP HSI version. FP HSI is compatible if (fwVer.major == drvVer.major && * fwVer.minor >= drvVer.minor) */ /* ETH FP HSI Major version */ #define ETH_HSI_VER_MAJOR 3 /* ETH FP HSI Minor version */ #define ETH_HSI_VER_MINOR 11 /* ETH FP HSI Minor version */ /* Alias for 8.7.x.x/8.8.x.x ETH FP HSI MINOR version. In this version driver * is not required to set pkt_len field in eth_tx_1st_bd struct, and tunneling * offload is not supported. */ #define ETH_HSI_VER_NO_PKT_LEN_TUNN 5 /* Maximum number of pinned L2 connections (CIDs)*/ #define ETH_PINNED_CONN_MAX_NUM 32 #define ETH_CACHE_LINE_SIZE 64 #define ETH_RX_CQE_GAP 32 #define ETH_MAX_RAMROD_PER_CON 8 #define ETH_TX_BD_PAGE_SIZE_BYTES 4096 #define ETH_RX_BD_PAGE_SIZE_BYTES 4096 #define ETH_RX_CQE_PAGE_SIZE_BYTES 4096 #define ETH_RX_NUM_NEXT_PAGE_BDS 2 /* Limitation for Tunneled LSO Packets on the offset (in bytes) of the inner IP * header (relevant to LSO for tunneled packet): */ /* Offset is limited to 253 bytes (inclusive). */ #define ETH_MAX_TUNN_LSO_INNER_IPV4_OFFSET 253 /* Offset is limited to 251 bytes (inclusive). */ #define ETH_MAX_TUNN_LSO_INNER_IPV6_OFFSET 251 #define ETH_TX_MIN_BDS_PER_NON_LSO_PKT 1 #define ETH_TX_MAX_BDS_PER_NON_LSO_PACKET 18 #define ETH_TX_MAX_BDS_PER_LSO_PACKET 255 #define ETH_TX_MAX_LSO_HDR_NBD 4 #define ETH_TX_MIN_BDS_PER_LSO_PKT 3 #define ETH_TX_MIN_BDS_PER_TUNN_IPV6_WITH_EXT_PKT 3 #define ETH_TX_MIN_BDS_PER_IPV6_WITH_EXT_PKT 2 #define ETH_TX_MIN_BDS_PER_PKT_W_LOOPBACK_MODE 2 #define ETH_TX_MIN_BDS_PER_PKT_W_VPORT_FORWARDING 4 /* (QM_REG_TASKBYTECRDCOST_0, QM_VOQ_BYTE_CRD_TASK_COST) - * (VLAN-TAG + CRC + IPG + PREAMBLE) */ #define ETH_TX_MAX_NON_LSO_PKT_LEN (9700 - (4 + 4 + 12 + 8)) #define ETH_TX_MAX_LSO_HDR_BYTES 510 /* Number of BDs to consider for LSO sliding window restriction is * (ETH_TX_LSO_WINDOW_BDS_NUM - hdr_nbd) */ #define ETH_TX_LSO_WINDOW_BDS_NUM (18 - 1) /* Minimum data length (in bytes) in LSO sliding window */ #define ETH_TX_LSO_WINDOW_MIN_LEN 9700 /* Maximum LSO packet TCP payload length (in bytes) */ #define ETH_TX_MAX_LSO_PAYLOAD_LEN 0xFE000 /* Number of same-as-last resources in tx switching */ #define ETH_TX_NUM_SAME_AS_LAST_ENTRIES 320 /* Value for a connection for which same as last feature is disabled */ #define ETH_TX_INACTIVE_SAME_AS_LAST 0xFFFF /* Maximum number of statistics counters */ #define ETH_NUM_STATISTIC_COUNTERS MAX_NUM_VPORTS /* Maximum number of statistics counters when doubled VF zone used */ #define ETH_NUM_STATISTIC_COUNTERS_DOUBLE_VF_ZONE \ (ETH_NUM_STATISTIC_COUNTERS - MAX_NUM_VFS / 2) /* Maximum number of statistics counters when quad VF zone used */ #define ETH_NUM_STATISTIC_COUNTERS_QUAD_VF_ZONE \ (ETH_NUM_STATISTIC_COUNTERS - 3 * MAX_NUM_VFS / 4) /* Maximum number of buffers, used for RX packet placement */ #define ETH_RX_MAX_BUFF_PER_PKT 5 /* Minimum number of free BDs in RX ring, that guarantee receiving of at least * one RX packet. */ #define ETH_RX_BD_THRESHOLD 16 /* num of MAC/VLAN filters */ #define ETH_NUM_MAC_FILTERS 512 #define ETH_NUM_VLAN_FILTERS 512 /* approx. multicast constants */ /* CRC seed for multicast bin calculation */ #define ETH_MULTICAST_BIN_FROM_MAC_SEED 0 #define ETH_MULTICAST_MAC_BINS 256 #define ETH_MULTICAST_MAC_BINS_IN_REGS (ETH_MULTICAST_MAC_BINS / 32) /* ethernet vport update constants */ #define ETH_FILTER_RULES_COUNT 10 /* number of RSS indirection table entries, per Vport) */ #define ETH_RSS_IND_TABLE_ENTRIES_NUM 128 /* Length of RSS key (in regs) */ #define ETH_RSS_KEY_SIZE_REGS 10 /* number of available RSS engines in AH */ #define ETH_RSS_ENGINE_NUM_K2 207 /* number of available RSS engines in BB */ #define ETH_RSS_ENGINE_NUM_BB 127 /* TPA constants */ /* Maximum number of open TPA aggregations */ #define ETH_TPA_MAX_AGGS_NUM 64 /* TPA-start CQE additional BD list length. Used for backward compatible */ #define ETH_TPA_CQE_START_BW_LEN_LIST_SIZE 2 /* Maximum number of buffers, reported by TPA-continue CQE */ #define ETH_TPA_CQE_CONT_LEN_LIST_SIZE 6 /* Maximum number of buffers, reported by TPA-end CQE */ #define ETH_TPA_CQE_END_LEN_LIST_SIZE 4 /* Control frame check constants */ /* Number of etherType values configured by driver for control frame check */ #define ETH_CTL_FRAME_ETH_TYPE_NUM 4 /* GFS constants */ #define ETH_GFT_TRASHCAN_VPORT 0x1FF /* GFT drop flow vport number */ /* * Destination port mode */ enum dst_port_mode { DST_PORT_PHY /* Send to physical port. */, DST_PORT_LOOPBACK /* Send to loopback port. */, DST_PORT_PHY_LOOPBACK /* Send to physical and loopback port. */, DST_PORT_DROP /* Drop the packet in PBF. */, MAX_DST_PORT_MODE }; /* * Ethernet address type */ enum eth_addr_type { BROADCAST_ADDRESS, MULTICAST_ADDRESS, UNICAST_ADDRESS, UNKNOWN_ADDRESS, MAX_ETH_ADDR_TYPE }; struct eth_tx_1st_bd_flags { u8 bitfields; /* Set to 1 in the first BD. (for debug) */ #define ETH_TX_1ST_BD_FLAGS_START_BD_MASK 0x1 #define ETH_TX_1ST_BD_FLAGS_START_BD_SHIFT 0 /* Do not allow additional VLAN manipulations on this packet. */ #define ETH_TX_1ST_BD_FLAGS_FORCE_VLAN_MODE_MASK 0x1 #define ETH_TX_1ST_BD_FLAGS_FORCE_VLAN_MODE_SHIFT 1 /* Recalculate IP checksum. For tunneled packet - relevant to inner header. */ #define ETH_TX_1ST_BD_FLAGS_IP_CSUM_MASK 0x1 #define ETH_TX_1ST_BD_FLAGS_IP_CSUM_SHIFT 2 /* Recalculate TCP/UDP checksum. * For tunneled packet - relevant to inner header. */ #define ETH_TX_1ST_BD_FLAGS_L4_CSUM_MASK 0x1 #define ETH_TX_1ST_BD_FLAGS_L4_CSUM_SHIFT 3 /* If set, insert VLAN tag from vlan field to the packet. * For tunneled packet - relevant to outer header. */ #define ETH_TX_1ST_BD_FLAGS_VLAN_INSERTION_MASK 0x1 #define ETH_TX_1ST_BD_FLAGS_VLAN_INSERTION_SHIFT 4 /* If set, this is an LSO packet. Note: For Tunneled LSO packets, the offset of * the inner IPV4 (and IPV6) header is limited to 253 (and 251 respectively) * bytes, inclusive. */ #define ETH_TX_1ST_BD_FLAGS_LSO_MASK 0x1 #define ETH_TX_1ST_BD_FLAGS_LSO_SHIFT 5 /* Recalculate Tunnel IP Checksum (if Tunnel IP Header is IPv4) */ #define ETH_TX_1ST_BD_FLAGS_TUNN_IP_CSUM_MASK 0x1 #define ETH_TX_1ST_BD_FLAGS_TUNN_IP_CSUM_SHIFT 6 /* Recalculate Tunnel UDP/GRE Checksum (Depending on Tunnel Type) */ #define ETH_TX_1ST_BD_FLAGS_TUNN_L4_CSUM_MASK 0x1 /* Recalculate Tunnel UDP/GRE Checksum (Depending on Tunnel Type). In case of * GRE tunnel, this flag means GRE CSO, and in this case GRE checksum field * Must be present. */ #define ETH_TX_1ST_BD_FLAGS_TUNN_L4_CSUM_MASK 0x1 #define ETH_TX_1ST_BD_FLAGS_TUNN_L4_CSUM_SHIFT 7 }; /* * The parsing information data for the first tx bd of a given packet. */ struct eth_tx_data_1st_bd { /* VLAN tag to insert to packet (if enabled by vlan_insertion flag). */ __le16 vlan; /* Number of BDs in packet. Should be at least 1 in non-LSO packet and at least * 3 in LSO (or Tunnel with IPv6+ext) packet. */ u8 nbds; struct eth_tx_1st_bd_flags bd_flags; __le16 bitfields; /* Indicates a tunneled packet. Must be set for encapsulated packet. */ #define ETH_TX_DATA_1ST_BD_TUNN_FLAG_MASK 0x1 #define ETH_TX_DATA_1ST_BD_TUNN_FLAG_SHIFT 0 #define ETH_TX_DATA_1ST_BD_RESERVED0_MASK 0x1 #define ETH_TX_DATA_1ST_BD_RESERVED0_SHIFT 1 /* Total packet length - must be filled for non-LSO packets. */ #define ETH_TX_DATA_1ST_BD_PKT_LEN_MASK 0x3FFF #define ETH_TX_DATA_1ST_BD_PKT_LEN_SHIFT 2 }; /* * The parsing information data for the second tx bd of a given packet. */ struct eth_tx_data_2nd_bd { /* For tunnel with IPv6+ext - Tunnel header IP datagram length (in BYTEs) */ __le16 tunn_ip_size; __le16 bitfields1; /* For Tunnel header with IPv6 ext. - Inner L2 Header Size (in 2-byte WORDs) */ #define ETH_TX_DATA_2ND_BD_TUNN_INNER_L2_HDR_SIZE_W_MASK 0xF #define ETH_TX_DATA_2ND_BD_TUNN_INNER_L2_HDR_SIZE_W_SHIFT 0 /* For Tunnel header with IPv6 ext. - Inner L2 Header MAC DA Type * (use enum eth_addr_type) */ #define ETH_TX_DATA_2ND_BD_TUNN_INNER_ETH_TYPE_MASK 0x3 #define ETH_TX_DATA_2ND_BD_TUNN_INNER_ETH_TYPE_SHIFT 4 /* Destination port mode. (use enum dest_port_mode) */ #define ETH_TX_DATA_2ND_BD_DEST_PORT_MODE_MASK 0x3 #define ETH_TX_DATA_2ND_BD_DEST_PORT_MODE_SHIFT 6 /* Should be 0 in all the BDs, except the first one. (for debug) */ #define ETH_TX_DATA_2ND_BD_START_BD_MASK 0x1 #define ETH_TX_DATA_2ND_BD_START_BD_SHIFT 8 /* For Tunnel header with IPv6 ext. - Tunnel Type (use enum eth_tx_tunn_type) */ #define ETH_TX_DATA_2ND_BD_TUNN_TYPE_MASK 0x3 #define ETH_TX_DATA_2ND_BD_TUNN_TYPE_SHIFT 9 /* For LSO / Tunnel header with IPv6+ext - Set if inner header is IPv6 */ #define ETH_TX_DATA_2ND_BD_TUNN_INNER_IPV6_MASK 0x1 #define ETH_TX_DATA_2ND_BD_TUNN_INNER_IPV6_SHIFT 11 /* In tunneling mode - Set to 1 when the Inner header is IPv6 with extension. * Otherwise set to 1 if the header is IPv6 with extension. */ #define ETH_TX_DATA_2ND_BD_IPV6_EXT_MASK 0x1 #define ETH_TX_DATA_2ND_BD_IPV6_EXT_SHIFT 12 /* Set to 1 if Tunnel (outer = encapsulating) header has IPv6 ext. (Note: 3rd BD * is required, hence EDPM does not support Tunnel [outer] header with Ipv6Ext) */ #define ETH_TX_DATA_2ND_BD_TUNN_IPV6_EXT_MASK 0x1 #define ETH_TX_DATA_2ND_BD_TUNN_IPV6_EXT_SHIFT 13 /* Set if (inner) L4 protocol is UDP. (Required when IPv6+ext (or tunnel with * inner or outer Ipv6+ext) and l4_csum is set) */ #define ETH_TX_DATA_2ND_BD_L4_UDP_MASK 0x1 #define ETH_TX_DATA_2ND_BD_L4_UDP_SHIFT 14 /* The pseudo header checksum type in the L4 checksum field. Required when * IPv6+ext and l4_csum is set. (use enum eth_l4_pseudo_checksum_mode) */ #define ETH_TX_DATA_2ND_BD_L4_PSEUDO_CSUM_MODE_MASK 0x1 #define ETH_TX_DATA_2ND_BD_L4_PSEUDO_CSUM_MODE_SHIFT 15 __le16 bitfields2; /* For inner/outer header IPv6+ext - (inner) L4 header offset (in 2-byte WORDs). * For regular packet - offset from the beginning of the packet. For tunneled * packet - offset from the beginning of the inner header */ #define ETH_TX_DATA_2ND_BD_L4_HDR_START_OFFSET_W_MASK 0x1FFF #define ETH_TX_DATA_2ND_BD_L4_HDR_START_OFFSET_W_SHIFT 0 #define ETH_TX_DATA_2ND_BD_RESERVED0_MASK 0x7 #define ETH_TX_DATA_2ND_BD_RESERVED0_SHIFT 13 }; /* * Firmware data for L2-EDPM packet. */ struct eth_edpm_fw_data { /* Parsing information data from the 1st BD. */ struct eth_tx_data_1st_bd data_1st_bd; /* Parsing information data from the 2nd BD. */ struct eth_tx_data_2nd_bd data_2nd_bd; __le32 reserved; }; /* * FW debug. */ struct eth_fast_path_cqe_fw_debug { __le16 reserved2 /* FW reserved. */; }; /* * tunneling parsing flags */ struct eth_tunnel_parsing_flags { u8 flags; /* 0 - no tunneling, 1 - GENEVE, 2 - GRE, 3 - VXLAN * (use enum eth_rx_tunn_type) */ #define ETH_TUNNEL_PARSING_FLAGS_TYPE_MASK 0x3 #define ETH_TUNNEL_PARSING_FLAGS_TYPE_SHIFT 0 /* If it s not an encapsulated packet then put 0x0. If it s an encapsulated * packet but the tenant-id doesn t exist then put 0x0. Else put 0x1 * */ #define ETH_TUNNEL_PARSING_FLAGS_TENNANT_ID_EXIST_MASK 0x1 #define ETH_TUNNEL_PARSING_FLAGS_TENNANT_ID_EXIST_SHIFT 2 /* Type of the next header above the tunneling: 0 - unknown, 1 - L2, 2 - Ipv4, * 3 - IPv6 (use enum tunnel_next_protocol) */ #define ETH_TUNNEL_PARSING_FLAGS_NEXT_PROTOCOL_MASK 0x3 #define ETH_TUNNEL_PARSING_FLAGS_NEXT_PROTOCOL_SHIFT 3 /* The result of comparing the DA-ip of the tunnel header. */ #define ETH_TUNNEL_PARSING_FLAGS_FIRSTHDRIPMATCH_MASK 0x1 #define ETH_TUNNEL_PARSING_FLAGS_FIRSTHDRIPMATCH_SHIFT 5 #define ETH_TUNNEL_PARSING_FLAGS_IPV4_FRAGMENT_MASK 0x1 #define ETH_TUNNEL_PARSING_FLAGS_IPV4_FRAGMENT_SHIFT 6 #define ETH_TUNNEL_PARSING_FLAGS_IPV4_OPTIONS_MASK 0x1 #define ETH_TUNNEL_PARSING_FLAGS_IPV4_OPTIONS_SHIFT 7 }; /* * PMD flow control bits */ struct eth_pmd_flow_flags { u8 flags; #define ETH_PMD_FLOW_FLAGS_VALID_MASK 0x1 /* CQE valid bit */ #define ETH_PMD_FLOW_FLAGS_VALID_SHIFT 0 #define ETH_PMD_FLOW_FLAGS_TOGGLE_MASK 0x1 /* CQE ring toggle bit */ #define ETH_PMD_FLOW_FLAGS_TOGGLE_SHIFT 1 #define ETH_PMD_FLOW_FLAGS_RESERVED_MASK 0x3F #define ETH_PMD_FLOW_FLAGS_RESERVED_SHIFT 2 }; /* * Regular ETH Rx FP CQE. */ struct eth_fast_path_rx_reg_cqe { u8 type /* CQE type */; u8 bitfields; /* Type of calculated RSS hash (use enum rss_hash_type) */ #define ETH_FAST_PATH_RX_REG_CQE_RSS_HASH_TYPE_MASK 0x7 #define ETH_FAST_PATH_RX_REG_CQE_RSS_HASH_TYPE_SHIFT 0 /* Traffic Class */ #define ETH_FAST_PATH_RX_REG_CQE_TC_MASK 0xF #define ETH_FAST_PATH_RX_REG_CQE_TC_SHIFT 3 #define ETH_FAST_PATH_RX_REG_CQE_RESERVED0_MASK 0x1 #define ETH_FAST_PATH_RX_REG_CQE_RESERVED0_SHIFT 7 __le16 pkt_len /* Total packet length (from the parser) */; /* Parsing and error flags from the parser */ struct parsing_and_err_flags pars_flags; __le16 vlan_tag /* 802.1q VLAN tag */; __le32 rss_hash /* RSS hash result */; __le16 len_on_first_bd /* Number of bytes placed on first BD */; u8 placement_offset /* Offset of placement from BD start */; /* Tunnel Parsing Flags */ struct eth_tunnel_parsing_flags tunnel_pars_flags; u8 bd_num /* Number of BDs, used for packet */; u8 reserved; __le16 reserved2; /* aRFS flow ID or Resource ID - Indicates a Vport ID from which packet was * sent, used when sending from VF to VF Representor. */ __le32 flow_id_or_resource_id; u8 reserved1[7]; struct eth_pmd_flow_flags pmd_flags /* CQE valid and toggle bits */; }; /* * TPA-continue ETH Rx FP CQE. */ struct eth_fast_path_rx_tpa_cont_cqe { u8 type /* CQE type */; u8 tpa_agg_index /* TPA aggregation index */; /* List of the segment sizes */ __le16 len_list[ETH_TPA_CQE_CONT_LEN_LIST_SIZE]; u8 reserved; u8 reserved1 /* FW reserved. */; __le16 reserved2[ETH_TPA_CQE_CONT_LEN_LIST_SIZE] /* FW reserved. */; u8 reserved3[3]; struct eth_pmd_flow_flags pmd_flags /* CQE valid and toggle bits */; }; /* * TPA-end ETH Rx FP CQE . */ struct eth_fast_path_rx_tpa_end_cqe { u8 type /* CQE type */; u8 tpa_agg_index /* TPA aggregation index */; __le16 total_packet_len /* Total aggregated packet length */; u8 num_of_bds /* Total number of BDs comprising the packet */; /* Aggregation end reason. Use enum eth_tpa_end_reason */ u8 end_reason; __le16 num_of_coalesced_segs /* Number of coalesced TCP segments */; __le32 ts_delta /* TCP timestamp delta */; /* List of the segment sizes */ __le16 len_list[ETH_TPA_CQE_END_LEN_LIST_SIZE]; __le16 reserved3[ETH_TPA_CQE_END_LEN_LIST_SIZE] /* FW reserved. */; __le16 reserved1; u8 reserved2 /* FW reserved. */; struct eth_pmd_flow_flags pmd_flags /* CQE valid and toggle bits */; }; /* * TPA-start ETH Rx FP CQE. */ struct eth_fast_path_rx_tpa_start_cqe { u8 type /* CQE type */; u8 bitfields; /* Type of calculated RSS hash (use enum rss_hash_type) */ #define ETH_FAST_PATH_RX_TPA_START_CQE_RSS_HASH_TYPE_MASK 0x7 #define ETH_FAST_PATH_RX_TPA_START_CQE_RSS_HASH_TYPE_SHIFT 0 /* Traffic Class */ #define ETH_FAST_PATH_RX_TPA_START_CQE_TC_MASK 0xF #define ETH_FAST_PATH_RX_TPA_START_CQE_TC_SHIFT 3 #define ETH_FAST_PATH_RX_TPA_START_CQE_RESERVED0_MASK 0x1 #define ETH_FAST_PATH_RX_TPA_START_CQE_RESERVED0_SHIFT 7 __le16 seg_len /* Segment length (packetLen from the parser) */; /* Parsing and error flags from the parser */ struct parsing_and_err_flags pars_flags; __le16 vlan_tag /* 802.1q VLAN tag */; __le32 rss_hash /* RSS hash result */; __le16 len_on_first_bd /* Number of bytes placed on first BD */; u8 placement_offset /* Offset of placement from BD start */; /* Tunnel Parsing Flags */ struct eth_tunnel_parsing_flags tunnel_pars_flags; u8 tpa_agg_index /* TPA aggregation index */; u8 header_len /* Packet L2+L3+L4 header length */; /* Additional BDs length list. Used for backward compatible. */ __le16 bw_ext_bd_len_list[ETH_TPA_CQE_START_BW_LEN_LIST_SIZE]; __le16 reserved2; /* aRFS or GFS flow ID or Resource ID - Indicates a Vport ID from which packet * was sent, used when sending from VF to VF Representor */ __le32 flow_id_or_resource_id; u8 reserved[3]; struct eth_pmd_flow_flags pmd_flags /* CQE valid and toggle bits */; }; /* * The L4 pseudo checksum mode for Ethernet */ enum eth_l4_pseudo_checksum_mode { /* Pseudo Header checksum on packet is calculated with the correct packet length * field. */ ETH_L4_PSEUDO_CSUM_CORRECT_LENGTH, /* Pseudo Header checksum on packet is calculated with zero length field. */ ETH_L4_PSEUDO_CSUM_ZERO_LENGTH, MAX_ETH_L4_PSEUDO_CHECKSUM_MODE }; struct eth_rx_bd { struct regpair addr /* single continues buffer */; }; /* * regular ETH Rx SP CQE */ struct eth_slow_path_rx_cqe { u8 type /* CQE type */; u8 ramrod_cmd_id; u8 error_flag; u8 reserved[25]; __le16 echo; u8 reserved1; struct eth_pmd_flow_flags pmd_flags /* CQE valid and toggle bits */; }; /* * union for all ETH Rx CQE types */ union eth_rx_cqe { /* Regular FP CQE */ struct eth_fast_path_rx_reg_cqe fast_path_regular; /* TPA-start CQE */ struct eth_fast_path_rx_tpa_start_cqe fast_path_tpa_start; /* TPA-continue CQE */ struct eth_fast_path_rx_tpa_cont_cqe fast_path_tpa_cont; /* TPA-end CQE */ struct eth_fast_path_rx_tpa_end_cqe fast_path_tpa_end; struct eth_slow_path_rx_cqe slow_path /* SP CQE */; }; /* * ETH Rx CQE type */ enum eth_rx_cqe_type { ETH_RX_CQE_TYPE_UNUSED, ETH_RX_CQE_TYPE_REGULAR /* Regular FP ETH Rx CQE */, ETH_RX_CQE_TYPE_SLOW_PATH /* Slow path ETH Rx CQE */, ETH_RX_CQE_TYPE_TPA_START /* TPA start ETH Rx CQE */, ETH_RX_CQE_TYPE_TPA_CONT /* TPA Continue ETH Rx CQE */, ETH_RX_CQE_TYPE_TPA_END /* TPA end ETH Rx CQE */, MAX_ETH_RX_CQE_TYPE }; /* * Wrapper for PD RX CQE - used in order to cover full cache line when writing * CQE */ struct eth_rx_pmd_cqe { union eth_rx_cqe cqe /* CQE data itself */; u8 reserved[ETH_RX_CQE_GAP]; }; /* * Eth RX Tunnel Type */ enum eth_rx_tunn_type { ETH_RX_NO_TUNN /* No Tunnel. */, ETH_RX_TUNN_GENEVE /* GENEVE Tunnel. */, ETH_RX_TUNN_GRE /* GRE Tunnel. */, ETH_RX_TUNN_VXLAN /* VXLAN Tunnel. */, MAX_ETH_RX_TUNN_TYPE }; /* * Aggregation end reason. */ enum eth_tpa_end_reason { ETH_AGG_END_UNUSED, ETH_AGG_END_SP_UPDATE /* SP configuration update */, /* Maximum aggregation length or maximum buffer number used. */ ETH_AGG_END_MAX_LEN, /* TCP PSH flag or TCP payload length below continue threshold. */ ETH_AGG_END_LAST_SEG, ETH_AGG_END_TIMEOUT /* Timeout expiration. */, /* Packet header not consistency: different IPv4 TOS, TTL or flags, IPv6 TC, * Hop limit or Flow label, TCP header length or TS options. In GRO different * TS value, SMAC, DMAC, ackNum, windowSize or VLAN */ ETH_AGG_END_NOT_CONSISTENT, /* Out of order or retransmission packet: sequence, ack or timestamp not * consistent with previous segment. */ ETH_AGG_END_OUT_OF_ORDER, /* Next segment cant be aggregated due to LLC/SNAP, IP error, IP fragment, IPv4 * options, IPv6 extension, IP ECN = CE, TCP errors, TCP options, zero TCP * payload length , TCP flags or not supported tunnel header options. */ ETH_AGG_END_NON_TPA_SEG, MAX_ETH_TPA_END_REASON }; /* * The first tx bd of a given packet */ struct eth_tx_1st_bd { struct regpair addr /* Single continuous buffer */; __le16 nbytes /* Number of bytes in this BD. */; struct eth_tx_data_1st_bd data /* Parsing information data. */; }; /* * The second tx bd of a given packet */ struct eth_tx_2nd_bd { struct regpair addr /* Single continuous buffer */; __le16 nbytes /* Number of bytes in this BD. */; struct eth_tx_data_2nd_bd data /* Parsing information data. */; }; /* * The parsing information data for the third tx bd of a given packet. */ struct eth_tx_data_3rd_bd { __le16 lso_mss /* For LSO packet - the MSS in bytes. */; __le16 bitfields; /* For LSO with inner/outer IPv6+ext - TCP header length (in 4-byte WORDs) */ #define ETH_TX_DATA_3RD_BD_TCP_HDR_LEN_DW_MASK 0xF #define ETH_TX_DATA_3RD_BD_TCP_HDR_LEN_DW_SHIFT 0 /* LSO - number of BDs which contain headers. value should be in range * (1..ETH_TX_MAX_LSO_HDR_NBD). */ #define ETH_TX_DATA_3RD_BD_HDR_NBD_MASK 0xF #define ETH_TX_DATA_3RD_BD_HDR_NBD_SHIFT 4 /* Should be 0 in all the BDs, except the first one. (for debug) */ #define ETH_TX_DATA_3RD_BD_START_BD_MASK 0x1 #define ETH_TX_DATA_3RD_BD_START_BD_SHIFT 8 #define ETH_TX_DATA_3RD_BD_RESERVED0_MASK 0x7F #define ETH_TX_DATA_3RD_BD_RESERVED0_SHIFT 9 /* For tunnel with IPv6+ext - Pointer to tunnel L4 Header (in 2-byte WORDs) */ u8 tunn_l4_hdr_start_offset_w; /* For tunnel with IPv6+ext - Total size of Tunnel Header (in 2-byte WORDs) */ u8 tunn_hdr_size_w; }; /* * The third tx bd of a given packet */ struct eth_tx_3rd_bd { struct regpair addr /* Single continuous buffer */; __le16 nbytes /* Number of bytes in this BD. */; struct eth_tx_data_3rd_bd data /* Parsing information data. */; }; /* * The parsing information data for the forth tx bd of a given packet. */ struct eth_tx_data_4th_bd { /* Destination Vport ID to forward the packet, applicable only when * tx_dst_port_mode_config == ETH_TX_DST_MODE_CONFIG_FORWARD_DATA_IN_BD and * dst_port_mode == DST_PORT_LOOPBACK, used to route the packet from VF * Representor to VF */ u8 dst_vport_id; u8 reserved4; __le16 bitfields; /* if set, dst_vport_id has a valid value and will be used in FW */ #define ETH_TX_DATA_4TH_BD_DST_VPORT_ID_VALID_MASK 0x1 #define ETH_TX_DATA_4TH_BD_DST_VPORT_ID_VALID_SHIFT 0 #define ETH_TX_DATA_4TH_BD_RESERVED1_MASK 0x7F #define ETH_TX_DATA_4TH_BD_RESERVED1_SHIFT 1 /* Should be 0 in all the BDs, except the first one. (for debug) */ #define ETH_TX_DATA_4TH_BD_START_BD_MASK 0x1 #define ETH_TX_DATA_4TH_BD_START_BD_SHIFT 8 #define ETH_TX_DATA_4TH_BD_RESERVED2_MASK 0x7F #define ETH_TX_DATA_4TH_BD_RESERVED2_SHIFT 9 __le16 reserved3; }; /* * The forth tx bd of a given packet */ struct eth_tx_4th_bd { struct regpair addr /* Single continuous buffer */; __le16 nbytes /* Number of bytes in this BD. */; struct eth_tx_data_4th_bd data /* Parsing information data. */; }; /* * Complementary information for the regular tx bd of a given packet. */ struct eth_tx_data_bd { __le16 reserved0; __le16 bitfields; #define ETH_TX_DATA_BD_RESERVED1_MASK 0xFF #define ETH_TX_DATA_BD_RESERVED1_SHIFT 0 /* Should be 0 in all the BDs, except the first one. (for debug) */ #define ETH_TX_DATA_BD_START_BD_MASK 0x1 #define ETH_TX_DATA_BD_START_BD_SHIFT 8 #define ETH_TX_DATA_BD_RESERVED2_MASK 0x7F #define ETH_TX_DATA_BD_RESERVED2_SHIFT 9 __le16 reserved3; }; /* * The common regular TX BD ring element */ struct eth_tx_bd { struct regpair addr /* Single continuous buffer */; __le16 nbytes /* Number of bytes in this BD. */; struct eth_tx_data_bd data /* Complementary information. */; }; union eth_tx_bd_types { struct eth_tx_1st_bd first_bd /* The first tx bd of a given packet */; /* The second tx bd of a given packet */ struct eth_tx_2nd_bd second_bd; struct eth_tx_3rd_bd third_bd /* The third tx bd of a given packet */; struct eth_tx_4th_bd fourth_bd /* The fourth tx bd of a given packet */; struct eth_tx_bd reg_bd /* The common regular bd */; }; /* * Eth Tx Tunnel Type */ enum eth_tx_tunn_type { ETH_TX_TUNN_GENEVE /* GENEVE Tunnel. */, ETH_TX_TUNN_TTAG /* T-Tag Tunnel. */, ETH_TX_TUNN_GRE /* GRE Tunnel. */, ETH_TX_TUNN_VXLAN /* VXLAN Tunnel. */, MAX_ETH_TX_TUNN_TYPE }; /* * Mstorm Queue Zone */ struct mstorm_eth_queue_zone { struct eth_rx_prod_data rx_producers /* ETH Rx producers data */; __le32 reserved[3]; }; /* * Ystorm Queue Zone */ struct xstorm_eth_queue_zone { /* Tx interrupt coalescing TimeSet */ struct coalescing_timeset int_coalescing_timeset; u8 reserved[7]; }; /* * ETH doorbell data */ struct eth_db_data { u8 params; /* destination of doorbell (use enum db_dest) */ #define ETH_DB_DATA_DEST_MASK 0x3 #define ETH_DB_DATA_DEST_SHIFT 0 /* aggregative command to CM (use enum db_agg_cmd_sel) */ #define ETH_DB_DATA_AGG_CMD_MASK 0x3 #define ETH_DB_DATA_AGG_CMD_SHIFT 2 #define ETH_DB_DATA_BYPASS_EN_MASK 0x1 /* enable QM bypass */ #define ETH_DB_DATA_BYPASS_EN_SHIFT 4 #define ETH_DB_DATA_RESERVED_MASK 0x1 #define ETH_DB_DATA_RESERVED_SHIFT 5 /* aggregative value selection */ #define ETH_DB_DATA_AGG_VAL_SEL_MASK 0x3 #define ETH_DB_DATA_AGG_VAL_SEL_SHIFT 6 /* bit for every DQ counter flags in CM context that DQ can increment */ u8 agg_flags; __le16 bd_prod; }; #endif /* __ETH_COMMON__ */
{ "pile_set_name": "Github" }
/* 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 certificates implements an abstract controller that is useful for // building controllers that manage CSRs package certificates import ( "fmt" "time" "golang.org/x/time/rate" "k8s.io/klog" certificates "k8s.io/api/certificates/v1beta1" "k8s.io/apimachinery/pkg/api/errors" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/wait" certificatesinformers "k8s.io/client-go/informers/certificates/v1beta1" clientset "k8s.io/client-go/kubernetes" v1core "k8s.io/client-go/kubernetes/typed/core/v1" certificateslisters "k8s.io/client-go/listers/certificates/v1beta1" "k8s.io/client-go/tools/cache" "k8s.io/client-go/tools/record" "k8s.io/client-go/util/workqueue" "k8s.io/kubernetes/pkg/controller" ) type CertificateController struct { kubeClient clientset.Interface csrLister certificateslisters.CertificateSigningRequestLister csrsSynced cache.InformerSynced handler func(*certificates.CertificateSigningRequest) error queue workqueue.RateLimitingInterface } func NewCertificateController( kubeClient clientset.Interface, csrInformer certificatesinformers.CertificateSigningRequestInformer, handler func(*certificates.CertificateSigningRequest) error, ) *CertificateController { // Send events to the apiserver eventBroadcaster := record.NewBroadcaster() eventBroadcaster.StartLogging(klog.Infof) eventBroadcaster.StartRecordingToSink(&v1core.EventSinkImpl{Interface: kubeClient.CoreV1().Events("")}) cc := &CertificateController{ kubeClient: kubeClient, queue: workqueue.NewNamedRateLimitingQueue(workqueue.NewMaxOfRateLimiter( workqueue.NewItemExponentialFailureRateLimiter(200*time.Millisecond, 1000*time.Second), // 10 qps, 100 bucket size. This is only for retry speed and its only the overall factor (not per item) &workqueue.BucketRateLimiter{Limiter: rate.NewLimiter(rate.Limit(10), 100)}, ), "certificate"), handler: handler, } // Manage the addition/update of certificate requests csrInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ AddFunc: func(obj interface{}) { csr := obj.(*certificates.CertificateSigningRequest) klog.V(4).Infof("Adding certificate request %s", csr.Name) cc.enqueueCertificateRequest(obj) }, UpdateFunc: func(old, new interface{}) { oldCSR := old.(*certificates.CertificateSigningRequest) klog.V(4).Infof("Updating certificate request %s", oldCSR.Name) cc.enqueueCertificateRequest(new) }, DeleteFunc: func(obj interface{}) { csr, ok := obj.(*certificates.CertificateSigningRequest) if !ok { tombstone, ok := obj.(cache.DeletedFinalStateUnknown) if !ok { klog.V(2).Infof("Couldn't get object from tombstone %#v", obj) return } csr, ok = tombstone.Obj.(*certificates.CertificateSigningRequest) if !ok { klog.V(2).Infof("Tombstone contained object that is not a CSR: %#v", obj) return } } klog.V(4).Infof("Deleting certificate request %s", csr.Name) cc.enqueueCertificateRequest(obj) }, }) cc.csrLister = csrInformer.Lister() cc.csrsSynced = csrInformer.Informer().HasSynced return cc } // Run the main goroutine responsible for watching and syncing jobs. func (cc *CertificateController) Run(workers int, stopCh <-chan struct{}) { defer utilruntime.HandleCrash() defer cc.queue.ShutDown() klog.Infof("Starting certificate controller") defer klog.Infof("Shutting down certificate controller") if !controller.WaitForCacheSync("certificate", stopCh, cc.csrsSynced) { return } for i := 0; i < workers; i++ { go wait.Until(cc.worker, time.Second, stopCh) } <-stopCh } // worker runs a thread that dequeues CSRs, handles them, and marks them done. func (cc *CertificateController) worker() { for cc.processNextWorkItem() { } } // processNextWorkItem deals with one key off the queue. It returns false when it's time to quit. func (cc *CertificateController) processNextWorkItem() bool { cKey, quit := cc.queue.Get() if quit { return false } defer cc.queue.Done(cKey) if err := cc.syncFunc(cKey.(string)); err != nil { cc.queue.AddRateLimited(cKey) if _, ignorable := err.(ignorableError); !ignorable { utilruntime.HandleError(fmt.Errorf("Sync %v failed with : %v", cKey, err)) } else { klog.V(4).Infof("Sync %v failed with : %v", cKey, err) } return true } cc.queue.Forget(cKey) return true } func (cc *CertificateController) enqueueCertificateRequest(obj interface{}) { key, err := controller.KeyFunc(obj) if err != nil { utilruntime.HandleError(fmt.Errorf("Couldn't get key for object %+v: %v", obj, err)) return } cc.queue.Add(key) } // maybeSignCertificate will inspect the certificate request and, if it has // been approved and meets policy expectations, generate an X509 cert using the // cluster CA assets. If successful it will update the CSR approve subresource // with the signed certificate. func (cc *CertificateController) syncFunc(key string) error { startTime := time.Now() defer func() { klog.V(4).Infof("Finished syncing certificate request %q (%v)", key, time.Since(startTime)) }() csr, err := cc.csrLister.Get(key) if errors.IsNotFound(err) { klog.V(3).Infof("csr has been deleted: %v", key) return nil } if err != nil { return err } if csr.Status.Certificate != nil { // no need to do anything because it already has a cert return nil } // need to operate on a copy so we don't mutate the csr in the shared cache csr = csr.DeepCopy() return cc.handler(csr) } // IgnorableError returns an error that we shouldn't handle (i.e. log) because // it's spammy and usually user error. Instead we will log these errors at a // higher log level. We still need to throw these errors to signal that the // sync should be retried. func IgnorableError(s string, args ...interface{}) ignorableError { return ignorableError(fmt.Sprintf(s, args...)) } type ignorableError string func (e ignorableError) Error() string { return string(e) }
{ "pile_set_name": "Github" }
import React from 'react'; import { css } from 'emotion'; import { until } from '@guardian/src-foundations/mq'; import { body } from '@guardian/src-foundations/typography'; type Props = { children: string; }; export const StandfirstWrapper = ({ children }: Props) => ( <div className={css` display: flex; flex-direction: column; ${body.small()}; font-size: 14px; padding-left: 5px; padding-right: 5px; padding-bottom: 6px; ${until.tablet} { display: none; } `} > {children} </div> );
{ "pile_set_name": "Github" }
var test = `abc ${foo}`;
{ "pile_set_name": "Github" }
# # Copyright (C) 2009-2019 by frePPLe bv # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero # General Public License for more details. # # You should have received a copy of the GNU Affero General Public # License along with this program. If not, see <http://www.gnu.org/licenses/>. # ## ## CHECK OUT THE DIFFERENT HINTS IN THIS FILE TO TWEAK THE CONFIGURATION ## TO YOUR PARTICULAR NEEDS. ## ## HINT: The likely bottleneck in the system will be the database and not the ## apache web server. Tuning the database should be the first optimization step. ## HINT: Using MPM worker will give best performance and scalability. ## Tweak the number of processes and threads to your needs. <IfModule mpm_worker_module> StartServers 2 MinSpareThreads 10 MaxSpareThreads 25 ThreadLimit 25 ThreadsPerChild 25 MaxClients 100 MaxRequestsPerChild 0 </IfModule> ## This the mimimum set of modules required for frePPLe. ## HINT: Remove extra modules for optimal performance and minimal memory footprint. #LoadModule deflate_module modules/mod_deflate.so #LoadModule mime_module modules/mod_mime.so #LoadModule alias_module modules/mod_alias.so #LoadModule expires_module modules/mod_expires.so #LoadModule authz_host_module modules/mod_authz_host.so #LoadModule env_module modules/mod_env.so WSGIRestrictStdout Off ## HINT: All of the frePPLe-specific configurations can be put in a virtual host. This is # required if you want to host other applications on the same Apache web server. # <VirtualHost *:6666> AllowEncodedSlashes On WSGIPassAuthorization On AddDefaultCharset utf-8 # Ensuring a utf-8 compatible locale is used. SetEnv LC_ALL en_US.UTF-8 ## Deamon mode provides optimal performance and scalability. ## HINT: Uncomment the following lines to enable daemon mode, and tune the number ## of processes to your needs. #WSGIDaemonProcess frepple-django user=www-data group=www-data processes=5 threads=3 display-name=%{GROUP} #WSGIProcessGroup frepple-django ## Extra uncomment for daemon mode on Red Hat Linux #WSGISocketPrefix /var/run/mod_wsgi WSGIScriptAlias / "/usr/lib/python3/dist-packages/freppledb/wsgi.py" <Directory "/usr/lib/python3/dist-packages/freppledb/"> # Access control Satisfy Any Order deny,allow Allow from all Require all granted </Directory> # Compress the data. This setting is optional but highly recommended. # The compression drastically reduces the network traffic for the # request, while taking up only a little extra overhead on the webserver. # A compression ratio of 10 is typically achieved for large reports. SetOutputFilter DEFLATE # Disable Apache control over expiration ExpiresActive Off # Allows web app to let apache serve static content. # The djangosettings.py file needs to have an entry "APACHE_XSENDFILE = True" # to use this feature. <IfModule xsendfile_module> XSendFilePath /var/log/frepple XSendFile on </IfModule> # Serving static files Alias /robots.txt "/usr/share/frepple/static/robots.txt" Alias /favicon.ico "/usr/share/frepple/static/favicon.ico" Alias /static/ "/usr/share/frepple/static/" <Directory "/usr/share/frepple/static/"> # Access control Satisfy Any Order allow,deny Allow from all Require all granted # Cache all these static files in the client browser ExpiresActive On ExpiresDefault "access plus 60 days" # No directory indexes allowed Options -Indexes # Compress SetOutputFilter DEFLATE </Directory> #</VirtualHost>
{ "pile_set_name": "Github" }
{ "images" : [ { "idiom" : "iphone", "size" : "20x20", "scale" : "2x" }, { "idiom" : "iphone", "size" : "20x20", "scale" : "3x" }, { "idiom" : "iphone", "size" : "29x29", "scale" : "2x" }, { "idiom" : "iphone", "size" : "29x29", "scale" : "3x" }, { "idiom" : "iphone", "size" : "40x40", "scale" : "2x" }, { "idiom" : "iphone", "size" : "40x40", "scale" : "3x" }, { "idiom" : "iphone", "size" : "60x60", "scale" : "2x" }, { "idiom" : "iphone", "size" : "60x60", "scale" : "3x" }, { "idiom" : "ipad", "size" : "20x20", "scale" : "1x" }, { "idiom" : "ipad", "size" : "20x20", "scale" : "2x" }, { "idiom" : "ipad", "size" : "29x29", "scale" : "1x" }, { "idiom" : "ipad", "size" : "29x29", "scale" : "2x" }, { "idiom" : "ipad", "size" : "40x40", "scale" : "1x" }, { "idiom" : "ipad", "size" : "40x40", "scale" : "2x" }, { "idiom" : "ipad", "size" : "76x76", "scale" : "1x" }, { "idiom" : "ipad", "size" : "76x76", "scale" : "2x" }, { "idiom" : "ipad", "size" : "83.5x83.5", "scale" : "2x" }, { "idiom" : "ios-marketing", "size" : "1024x1024", "scale" : "1x" } ], "info" : { "version" : 1, "author" : "xcode" } }
{ "pile_set_name": "Github" }
/* * Copyright (C) the libgit2 contributors. All rights reserved. * * This file is part of libgit2, distributed under the GNU GPL v2 with * a Linking Exception. For full terms see the included COPYING file. */ #ifndef INCLUDE_posix_h__ #define INCLUDE_posix_h__ #include "common.h" #include <fcntl.h> #include <time.h> #include "fnmatch.h" /* stat: file mode type testing macros */ #ifndef S_IFGITLINK #define S_IFGITLINK 0160000 #define S_ISGITLINK(m) (((m) & S_IFMT) == S_IFGITLINK) #endif #ifndef S_IFLNK #define S_IFLNK 0120000 #undef _S_IFLNK #define _S_IFLNK S_IFLNK #endif #ifndef S_IWUSR #define S_IWUSR 00200 #endif #ifndef S_IXUSR #define S_IXUSR 00100 #endif #ifndef S_ISLNK #define S_ISLNK(m) (((m) & _S_IFMT) == _S_IFLNK) #endif #ifndef S_ISDIR #define S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR) #endif #ifndef S_ISREG #define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG) #endif #ifndef S_ISFIFO #define S_ISFIFO(m) (((m) & _S_IFMT) == _S_IFIFO) #endif /* if S_ISGID is not defined, then don't try to set it */ #ifndef S_ISGID #define S_ISGID 0 #endif #ifndef O_BINARY #define O_BINARY 0 #endif #ifndef O_CLOEXEC #define O_CLOEXEC 0 #endif #ifndef SOCK_CLOEXEC #define SOCK_CLOEXEC 0 #endif /* access() mode parameter #defines */ #ifndef F_OK #define F_OK 0 /* existence check */ #endif #ifndef W_OK #define W_OK 2 /* write mode check */ #endif #ifndef R_OK #define R_OK 4 /* read mode check */ #endif /* Determine whether an errno value indicates that a read or write failed * because the descriptor is blocked. */ #if defined(EWOULDBLOCK) #define GIT_ISBLOCKED(e) ((e) == EAGAIN || (e) == EWOULDBLOCK) #else #define GIT_ISBLOCKED(e) ((e) == EAGAIN) #endif /* define some standard errnos that the runtime may be missing. for example, * mingw lacks EAFNOSUPPORT. */ #ifndef EAFNOSUPPORT #define EAFNOSUPPORT (INT_MAX-1) #endif typedef int git_file; /** * Standard POSIX Methods * * All the methods starting with the `p_` prefix are * direct ports of the standard POSIX methods. * * Some of the methods are slightly wrapped to provide * saner defaults. Some of these methods are emulated * in Windows platforms. * * Use your manpages to check the docs on these. */ extern ssize_t p_read(git_file fd, void *buf, size_t cnt); extern int p_write(git_file fd, const void *buf, size_t cnt); #define p_close(fd) close(fd) #define p_umask(m) umask(m) extern int p_open(const char *path, int flags, ...); extern int p_creat(const char *path, mode_t mode); extern int p_getcwd(char *buffer_out, size_t size); extern int p_rename(const char *from, const char *to); extern int git__page_size(size_t *page_size); extern int git__mmap_alignment(size_t *page_size); /* The number of times `p_fsync` has been called. Note that this is for * test code only; it it not necessarily thread-safe and should not be * relied upon in production. */ extern size_t p_fsync__cnt; /** * Platform-dependent methods */ #ifdef GIT_WIN32 # include "win32/posix.h" #else # include "unix/posix.h" #endif #include "strnlen.h" #ifdef NO_READDIR_R GIT_INLINE(int) p_readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result) { GIT_UNUSED(entry); *result = readdir(dirp); return 0; } #else /* NO_READDIR_R */ # define p_readdir_r(d,e,r) readdir_r(d,e,r) #endif #ifdef NO_ADDRINFO # include <netdb.h> struct addrinfo { struct hostent *ai_hostent; struct servent *ai_servent; struct sockaddr_in ai_addr_in; struct sockaddr *ai_addr; size_t ai_addrlen; int ai_family; int ai_socktype; int ai_protocol; long ai_port; struct addrinfo *ai_next; }; extern int p_getaddrinfo(const char *host, const char *port, struct addrinfo *hints, struct addrinfo **info); extern void p_freeaddrinfo(struct addrinfo *info); extern const char *p_gai_strerror(int ret); #else # define p_getaddrinfo(a, b, c, d) getaddrinfo(a, b, c, d) # define p_freeaddrinfo(a) freeaddrinfo(a) # define p_gai_strerror(c) gai_strerror(c) #endif /* NO_ADDRINFO */ #endif
{ "pile_set_name": "Github" }
/* * Serial Attached SCSI (SAS) Phy class * * Copyright (C) 2005 Adaptec, Inc. All rights reserved. * Copyright (C) 2005 Luben Tuikov <luben_tuikov@adaptec.com> * * This file is licensed under GPLv2. * * 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 2 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; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #include "sas_internal.h" #include <scsi/scsi_host.h> #include <scsi/scsi_transport.h> #include <scsi/scsi_transport_sas.h> #include "../scsi_sas_internal.h" /* ---------- Phy events ---------- */ static void sas_phye_loss_of_signal(struct work_struct *work) { struct asd_sas_event *ev = container_of(work, struct asd_sas_event, work); struct asd_sas_phy *phy = ev->phy; sas_begin_event(PHYE_LOSS_OF_SIGNAL, &phy->ha->event_lock, &phy->phy_events_pending); phy->error = 0; sas_deform_port(phy); } static void sas_phye_oob_done(struct work_struct *work) { struct asd_sas_event *ev = container_of(work, struct asd_sas_event, work); struct asd_sas_phy *phy = ev->phy; sas_begin_event(PHYE_OOB_DONE, &phy->ha->event_lock, &phy->phy_events_pending); phy->error = 0; } static void sas_phye_oob_error(struct work_struct *work) { struct asd_sas_event *ev = container_of(work, struct asd_sas_event, work); struct asd_sas_phy *phy = ev->phy; struct sas_ha_struct *sas_ha = phy->ha; struct asd_sas_port *port = phy->port; struct sas_internal *i = to_sas_internal(sas_ha->core.shost->transportt); sas_begin_event(PHYE_OOB_ERROR, &phy->ha->event_lock, &phy->phy_events_pending); sas_deform_port(phy); if (!port && phy->enabled && i->dft->lldd_control_phy) { phy->error++; switch (phy->error) { case 1: case 2: i->dft->lldd_control_phy(phy, PHY_FUNC_HARD_RESET, NULL); break; case 3: default: phy->error = 0; phy->enabled = 0; i->dft->lldd_control_phy(phy, PHY_FUNC_DISABLE, NULL); break; } } } static void sas_phye_spinup_hold(struct work_struct *work) { struct asd_sas_event *ev = container_of(work, struct asd_sas_event, work); struct asd_sas_phy *phy = ev->phy; struct sas_ha_struct *sas_ha = phy->ha; struct sas_internal *i = to_sas_internal(sas_ha->core.shost->transportt); sas_begin_event(PHYE_SPINUP_HOLD, &phy->ha->event_lock, &phy->phy_events_pending); phy->error = 0; i->dft->lldd_control_phy(phy, PHY_FUNC_RELEASE_SPINUP_HOLD, NULL); } /* ---------- Phy class registration ---------- */ int sas_register_phys(struct sas_ha_struct *sas_ha) { int i; static const work_func_t sas_phy_event_fns[PHY_NUM_EVENTS] = { [PHYE_LOSS_OF_SIGNAL] = sas_phye_loss_of_signal, [PHYE_OOB_DONE] = sas_phye_oob_done, [PHYE_OOB_ERROR] = sas_phye_oob_error, [PHYE_SPINUP_HOLD] = sas_phye_spinup_hold, }; static const work_func_t sas_port_event_fns[PORT_NUM_EVENTS] = { [PORTE_BYTES_DMAED] = sas_porte_bytes_dmaed, [PORTE_BROADCAST_RCVD] = sas_porte_broadcast_rcvd, [PORTE_LINK_RESET_ERR] = sas_porte_link_reset_err, [PORTE_TIMER_EVENT] = sas_porte_timer_event, [PORTE_HARD_RESET] = sas_porte_hard_reset, }; /* Now register the phys. */ for (i = 0; i < sas_ha->num_phys; i++) { int k; struct asd_sas_phy *phy = sas_ha->sas_phy[i]; phy->error = 0; INIT_LIST_HEAD(&phy->port_phy_el); for (k = 0; k < PORT_NUM_EVENTS; k++) { INIT_WORK(&phy->port_events[k].work, sas_port_event_fns[k]); phy->port_events[k].phy = phy; } for (k = 0; k < PHY_NUM_EVENTS; k++) { INIT_WORK(&phy->phy_events[k].work, sas_phy_event_fns[k]); phy->phy_events[k].phy = phy; } phy->port = NULL; phy->ha = sas_ha; spin_lock_init(&phy->frame_rcvd_lock); spin_lock_init(&phy->sas_prim_lock); phy->frame_rcvd_size = 0; phy->phy = sas_phy_alloc(&sas_ha->core.shost->shost_gendev, i); if (!phy->phy) return -ENOMEM; phy->phy->identify.initiator_port_protocols = phy->iproto; phy->phy->identify.target_port_protocols = phy->tproto; phy->phy->identify.sas_address = SAS_ADDR(sas_ha->sas_addr); phy->phy->identify.phy_identifier = i; phy->phy->minimum_linkrate_hw = SAS_LINK_RATE_UNKNOWN; phy->phy->maximum_linkrate_hw = SAS_LINK_RATE_UNKNOWN; phy->phy->minimum_linkrate = SAS_LINK_RATE_UNKNOWN; phy->phy->maximum_linkrate = SAS_LINK_RATE_UNKNOWN; phy->phy->negotiated_linkrate = SAS_LINK_RATE_UNKNOWN; sas_phy_add(phy->phy); } return 0; }
{ "pile_set_name": "Github" }
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import <IDEKit/IDEViewController.h> #import "DVTPagingSheetViewController-Protocol.h" @class IDEAccountTeamPickerWindowController, NSPopUpButton, NSTextField; @interface IDEAccountTeamPickerSingleListTeamsViewController : IDEViewController <DVTPagingSheetViewController> { IDEAccountTeamPickerWindowController *_pagingSheetWindowController; NSTextField *_positioningLabel; NSPopUpButton *_teamsPopUp; } @property(retain) NSPopUpButton *teamsPopUp; // @synthesize teamsPopUp=_teamsPopUp; @property(retain) NSTextField *positioningLabel; // @synthesize positioningLabel=_positioningLabel; @property(retain, nonatomic) IDEAccountTeamPickerWindowController *pagingSheetWindowController; // @synthesize pagingSheetWindowController=_pagingSheetWindowController; - (void).cxx_destruct; - (id)teamMenuItemForTeamRecord:(id)arg1 wrapper:(id)arg2 indented:(BOOL)arg3; - (id)accountMenuItemForWrapper:(id)arg1; - (id)menuFromAccountWrappers:(id)arg1; - (void)refreshMenu; - (void)cancel:(id)arg1; - (void)select:(id)arg1; - (void)viewAccounts:(id)arg1; - (void)primitiveInvalidate; - (void)viewDidInstall; @end
{ "pile_set_name": "Github" }
:orphan: .. _zephyr_1.13: Zephyr Kernel 1.13.0 #################### We are pleased to announce the release of Zephyr kernel version 1.13.0. Major enhancements with this release include: * Extensible and Pluggable Tracing Support * Compartmentalized application memory organization * Logging System Overhaul * Introduce system calls for BSD socket APIs * Support for IEEE 802.1AS-2011 generalized Precision Time Protocol (gPTP) * Link Layer Discovery Protocol (LLDP) TX support * Support for TLS and DTLS using BSD socket API * Support for Link Layer Multicast Name Resolution (LLMNR) * Introduced reworked ADC API and updated Nordic, NXP, Atmel, and Synopsys DesignWare drivers * Support OS driven Power Management framework * Basic support for Arm TrustZone in Armv8-M The following sections provide detailed lists of changes by component. Kernel ****** * Remove kernel event manager, replaced by generic tracing interface * Enhanced Timeout and Tick handling in kernel * Compartmentalized application memory organization * Fix errno access for user mode Architectures ************* * arch: arc: improve the reset code * arch: arc: use a separate stack for exception handling * arch: arc: refactor the arc stack check support * arch: arm: stm32: enable instruction and data caches on STM32F7 * arch: arm: implement ARMv8-M MPU driver * irq: Fix irq_lock api usage * arch: arm: macro API for defining non-secure entry functions * arch: arm: allow processor to ignore/recover from faults * arm: nxp: mpu: Consolidate k64 mpu regions * arm: Print NXP MPU error information in BusFault dump * arch: ARM: Change the march used by cortex-m0 and cortex-m0plus * arch: arm: integrate ARM CMSE with CMake * arch: arm: basic Arm TrustZone-M functionality for Cortex-M23 and Cortex-M33 * arch: arm: built-in stack protection using Armv8-M SPLIM registers * arch: arm: API for using TT intrinsics in Secure/Non-Secure Armv8-M firmware * arch: arm: clean up MPU code for ARM and NXP * arch: arm: Set Zero Latency IRQ to priority level zero * arch/arm: Fix locking in __pendsv Boards & SoC Support ******************** * x86: add SoC configuration for Apollo Lake * x86: add support for UP Squared (Pentium/Celeron) * arc: Support Synopsys ARC nSim instruction set simulator * riscv32: riscv-privilege: Microsemi Mi-V support * Added support for the following Arm boards: * efr32_slwstk6061a * nrf52_adafruit_feather * nrf52810_pca10040 * nrf52840_pca10059 * nucleo_f207zg * reel_board * stm32f723e_disco * stm32f746g_disco * stm32f769i_disco * udoo_neo_full_m4 * warp7_m4 Drivers and Sensors ******************* * adc: Introduced reworked API and updated Nordic, NXP, Atmel, and Synopsys DesignWare drivers * audio: Added TLV320DAC310x audio DAC driver * can: Added can support for STM32L432 * clock_control: Added STM32F7 family clock control * entropy: Added support for STM32F7 * eth: Enabled gPTP support in mcux and gmac drivers * eth: Added promiscuous mode support to native_posix * eth: mcux: Added an option for randomized, but stable MAC address * gpio: Added STM32F7 GPIO support * interrupt_controller: Added STM32F7 EXTI support * i2c: Added support for STM32F7 * i2c: Added i.MX shim driver * i2c: Implemented slave support for stm32_v2 * i2c: Added EEPROM I2C slave driver * i2c: Added shims for nrfx TWI and TWIM drivers * i2s: Exposed i2s APIs to user mode * led: Added TI LP5562 and NXP PCA9633 drivers * modem: Added Wistron WNC-M14A2A LTE-M Modem driver * modem: Added modem receiver (tty) driver * pinmux: Added STM32F7 pinmux support * pwm: Added i.MX shim driver * pwm: Added shim for nrfx PWM HW driver * serial: Added power management to nRF UART driver * serial: Added STM32F7 UART support * serial: Allow to pass arbitrary user data to irq callback * serial: Added UARTE driver for the nRFx family * sensor: Added adxl372, mma8451q, adt7420 drivers * sensor: lis2dh: Fix I2C burst read/write operations * rtc: Added support for STM32 * usb: Added support for OTG FS on STM32F2 and STM32F7 * usb: Added High Speed support for DesignWare USB * wifi: Added SimpleLink WiFi Offload Driver (wifi_mgmt only) Networking ********** * Introduce system calls for BSD socket APIs. * Add IPv4 autoconf support. This adds support for IPv4 link-local addresses (169.254.*.*) * Add TLS and DTLS support to BSD socket API. They are configured via setsockopt() API. * Add support for IEEE 802.1AS-2011 generalized Precision Time Protocol (gPTP) for ethernet networks. A sample application is created to show how to interact with gPTP code. * Add support for PTP clock driver. This driver will be used by gPTP supported ethernet drivers. * Add Link Layer Discovery Protocol (LLDP) TX support. * Add support for managing Qav credit-based shaper algorithm. * Add generic TX timestamping support. * Add carrier detection support to ethernet L2 driver. * Add support for having vendor specific ethernet statistics. * Add getter support to ethernet management interface. * Add promiscuous mode support to network interface. A sample application is created that shows how to use the user API for getting all network packets. The native_posix ethernet driver supports promiscuous mode at this point. * Add support for Link Layer Multicast Name Resolution (LLMNR). LLMNR is used in Microsoft Windows networks for local name resolution. * Add API to net_pkt to prefill a network packet to a pre-defined value. * Add IEEE 802.1Qav support to Atmel GMAC ethernet driver. * Add hardware TX timestamping support to Atmel GMAC ethernet driver. * Add multiple hardware queue support to Atmel GMAC ethernet driver. * Add gPTP support to Atmel GMAC ethernet driver. * Add support for TI SimpleLink WiFI offload driver. * Add support for randomized but stable MAC address in NXP MCUX ethernet driver. * Add extra prints to net-shell for ethernet based network interfaces. The supported features and priority queue information is printed. * Add and fix string to integer conversions in net-shell. * Allow user to configure MAC address filters into ethernet devices. * Catch network interface ON and OFF events in DHCPv4 and renew address lease if we re-connected. * Remove forever timeouts when waiting a new network buffer to be available. * Relay network interface up/down command from net-shell to Linux host for native_posix ethernet driver. * No need to join IPv6 solicited node multicast group for Bluetooth IPSP supported nodes. * Allow external program to be started for native_posix ethernet driver. This allows for example startup of wireshark when zeth is created. * Network packet priority and traffic class fixes and clarifications. * Lower memory consumption in net by using packed enums when applicable. * Correctly notify net_app server when TCP is disconnected. * Register OpenThread used unicast and multicast IPv6 addresses for network interface. * Enable Fast Connect policy for TI SimpleLink ethernet driver. * Fix ieee802154 simulator driver channel/tx power settings. * Handle large IPv6 packets properly. * Enable gPTP support in native_posix, NXP mcux and Atmel GMAC ethernet drivers. The native_posix ethernet driver gPTP support is only for testing purposes. * Network configuration (net_config) library split from the net_app library. (This change requires updating application configs to refer to corresponding NET_CONFIG_* options instead of NET_APP_*). * Moving all layer 2 (L2) network code into subsys/net/l2 directory. * Add MSS option on sending TCP SYN request. * Fix TCP by processing zero window probes when our receive window is 0. * IPv4, IPv6, ICMPv6, ARP code refactoring and cleanup. * IPv6 address lifetime fixes. * IPv6 fragmentation fixes. * ARP fixes when using VLAN. * Timeout too long lasting ARP requests. * DHCPv4 fixes and timeout management refactoring. * TCP retry, RST packet handling, and memory leak fixes. * IP address print function enhancements. * HTTP fix when sending the last chunk. * MQTT fixes. * LWM2M cleanups and fixes. * Fix cache support in Atmel GMAC ethernet driver. * Fix NXP MCUX ethernet driver to detect carrier lost event. * Port native API echo-server/echo-client samples to BSD sockets API, with TLS/DTLS support. * Handle out-of-buf situations gracefully in echo-client and echo-server sample applications. Bluetooth ********* * New user-friendly service population using a refreshed BT_GATT_CHARACTERISTIC macro. * Added support for Bluetooth hardware in the native_posix board, allowing developers to use the native POSIX architecture with Bluetooth. * Added a new helper API to parse advertising data. * Added a new flag, BT_LE_ADV_OPT_USE_NAME, to include the Bluetooth Device Name in the advertising data. * Added support for fixed passkeys to use in bonding procedures. * Added a new Bluetooth shell command to send arbitrary HCI commands to the controller. * Added a new feature to support multiple local identities using a single controller. * Added a new, board-specific mesh sample for the nRF52x series that implements the following models: - Generic OnOff client and server. - Generic Level client and server. - Generic Power OnOff client and server. - Light Lightness client and server. - Light CTL client and server. - Vendor Model. * Controller: Added a TX Power Kconfig option. * Controller: Use the newly available nrfx utility functions to access the nRF5x hardware. * Controller: Multiple bug fixes. * Controller: Added support for the nRF52810 SoC from Nordic Semiconductor. * New HCI driver quirks API to support controllers that need uncommon reset sequences. * Host: Multiple bug fixes for GATT and SMP. * Mesh: Multiple bug fixes. Build and Infrastructure ************************ * Kconfig: Remove redundant 'default n' properties * cmake: replace PROJECT_SOURCE_DIR with ZEPHYR_BASE * Kconfig: Switch to improved globbing statements Libraries / Subsystems *********************** * Tracing: Basic support SEGGER systemview * Logging: Introduce a new logging subsystem * fs/nvs: Improved nvs for larger blocksizes * subsys: console: Refactor code to allow per-UART "tty" wrapper HALs **** * ext/hal: stm32cube: STM32L4: Enable legacy CAN API * ext: Import Atmel SAMD20 header files from ASF library * ext: gecko: Add Silabs Gecko SDK for EFR32FG1P SoCs * drivers: add i.MX I2C driver shim * hal: stm32f2x: Add HAL for the STM32F2x series * ext: stm32cube: update stm32l4xx cube version * ext: stm32cube: update stm32f7xx cube version * ext: stm32cube: update stm32f4xx cube version * ext: stm32cube: update stm32f3xx cube version * ext: stm32cube: update stm32f1xx cube version * ext: hal: nordic: Update nrfx to version 1.1.0 * net: drivers: wifi: SimpleLink WiFi Offload Driver (wifi_mgmt only) * ext/hal/nxp/imx: Import the nxp imx6 freertos bsp Documentation ************* * Simplified and more maintainable theme applied to documentation. Latest and previous four releases regenerated and published to https://docs.zephyrproject.org * Updated contributing guidelines * General organization cleanup and spell check on docs including content generated from Kconfig files and doxygen API comments. * General improvements to documentation following code, implementation changes, and in support of new features, boards, and samples. * Documentation generation now supported on Windows host systems (previously only linux doc generation was supported). * PDF version of documentation can now be created Tests and Samples ***************** * Enhanced benchmarks to support userspace * Improve test coverage for the kernel Issue Related Items ******************* These GitHub issues were addressed since the previous 1.12.0 tagged release: .. comment List derived from GitHub Issue query: ... * :github:`issuenumber` - issue title * :github:`9862` - tests/drivers/build_all#test_build_sensors_a_m @ quark_se_c1000_devboard:x86 BUILD failed * :github:`9857` - tests/cmsis_rtos_v1 - test_signal_events_signalled results in Assertion failure on all targets with PR#9856 * :github:`9840` - doc: potential broken link when referencing latest doc version * :github:`9833` - Bluetooth Mesh incorrect reference to CONFIG_BT_SETTINGS * :github:`9788` - update to mbedTLS 2.12.0 * :github:`9786` - arch: xtensa: build failure due to extra #endif * :github:`9785` - Bluetooth: bt_gatt_service_register() assumes sc delayed work handler is initialized * :github:`9772` - Test application hangs without any console output on x86/ARC based boards @arduino_101:arc * :github:`9768` - [Coverity CID :187902] Memory - illegal accesses in /subsys/net/ip/ipv6_fragment.c * :github:`9766` - [Coverity CID :187904] Integer handling issues in /tests/benchmarks/timing_info/src/semaphore_bench.c * :github:`9753` - ESP32: Failing to build project * :github:`9746` - zephyr networking non socket client server, qemu_x86 issue * :github:`9744` - tests/kernel/mbox/mbox_usage/testcase.yaml#kernel.mailbox crashes on ESP32 * :github:`9727` - Bluetooth: IPSP Sample Doc no match for new path * :github:`9723` - tests/drivers/adc/adc_api/ fails on sam_e70_xplained * :github:`9718` - The test suite test_spi (spi_loopback) when built and run on the nrf52832_pca10040 board * :github:`9701` - Suggestion: Turn warnings into errors in extract_dts_includes.py * :github:`9689` - Multiple tests are failing on sam_e70_xplained once the cache is enabled * :github:`9684` - tests/posix/ fails on sam_e70_xplained * :github:`9683` - Multiple testcases in tests/kernel/mem_protect/mem_protect, tests/kernel/alert, tests/kernel/mem_pool test fails on sam_e70_xplained due to commit c090776 * :github:`9682` - tests/kernel/init: kernel.common.init.verify_bootdelay fails on sam_e70_xplained * :github:`9680` - tests/mem_slab/mslab, tests/mem_slab/mslab_api and tests/mem_slab/mslab_threadsafe tests are crashing on sam_e70_xplained * :github:`9677` - tests:cmsis_rtos_v1: test_mutex crashes with bus fault on sam_e70_xplained * :github:`9676` - benchmark.timing.userspace not working on nrf52840 with v1.13.0-rc1 * :github:`9671` - Zephyr with WNC-M14A2A not compiling * :github:`9670` - Bluetooth: Mesh: Persistent Storage: AppKey not restored * :github:`9667` - LwM2M: Writeable parameter /3311/0/5850 doesn't persist write * :github:`9665` - tests/drivers/watchdog/wdt_basic_api crashes on Quark D2k / SE and ESP32 * :github:`9664` - tests/kernel/threads/thread_apis/kernel.threads.user_mode crases on QEMU-x86 * :github:`9652` - gen_isr_table@mimxrt1050_evk runs failure on R1.13_RC1. * :github:`9649` - readme of LPCxpresso54114_mo core needs update for R1.13 * :github:`9646` - sanitycheck: crashes after test execution summary report are not caught * :github:`9644` - [Coverity CID :187817] Error handling issues in /tests/benchmarks/timing_info/src/msg_passing_bench.c * :github:`9643` - [Coverity CID :187818] Error handling issues in /tests/benchmarks/timing_info/src/msg_passing_bench.c * :github:`9642` - [Coverity CID :187819] Memory - illegal accesses in /subsys/logging/log_msg.c * :github:`9641` - [Coverity CID :187820] Memory - illegal accesses in /subsys/bluetooth/host/hci_core.c * :github:`9640` - [Coverity CID :187821] Memory - illegal accesses in /subsys/bluetooth/host/hci_core.c * :github:`9639` - [Coverity CID :187822] Null pointer dereferences in /subsys/net/ip/tcp.c * :github:`9638` - [Coverity CID :187823] Memory - corruptions in /samples/net/coap_server/src/coap-server.c * :github:`9637` - [Coverity CID :187824] Integer handling issues in /lib/cmsis_rtos_v1/cmsis_thread.c * :github:`9636` - [Coverity CID :187825] Error handling issues in /subsys/net/ip/udp.c * :github:`9635` - [Coverity CID :187826] Error handling issues in /tests/benchmarks/timing_info/src/msg_passing_bench.c * :github:`9634` - [Coverity CID :187827] Null pointer dereferences in /subsys/logging/log_msg.c * :github:`9633` - [Coverity CID :187828] Error handling issues in /tests/benchmarks/timing_info/src/msg_passing_bench.c * :github:`9630` - STM32L4: something wrong with GPIO interrupts * :github:`9623` - tests/net/lib/tls_credentials/ crashed on sam_e70_xplained and frdm_k64f * :github:`9622` - tests/net/mgmt/ crashed on sam_e70_xplained * :github:`9621` - tests/net/promiscuous crashed on sam_e70_xplained * :github:`9619` - tests/net/socket/getaddrinfo/ - crashes on sam_e70_xplained and frdm_k64f * :github:`9618` - tests/net/udp/ - MPU fault on sam_e70_xplained * :github:`9617` - tests/net/websocket/ - passed on QEMUx86 but the target crashed after that * :github:`9614` - tests/net/socket/ faults on sam_e70_xplained and frdm_k64f * :github:`9611` - tests/kernel/sched/schedule_api/testcase.yaml#kernel.sched.slice_reset fails on nrf52840_pca10056, sam_e70_xplained, nrf52_pca10040 * :github:`9609` - tests/kernel/mem_protect/stack_random: kernel.memory_protection.stack_random fails on emsk7d_v22 * :github:`9598` - tests/power/power_states fail on arduino101:x86 * :github:`9597` - tests/subsys/fs/fat_fs_api assertion fail on arduino101 * :github:`9591` - @hci.h use of magic-number in bluetooth addr struct (Missing define in @bluetooth.h) * :github:`9580` - peripheral_hids does not remember bonds * :github:`9575` - Network NULL pointer reference when enable net/dhcpv4 debug * :github:`9574` - tests/cmsis_rtos_v1 - test_mutex_lock_timeout results in Assertion failure on all targets with PR#9569 * :github:`9561` - Question: Does it support passing the bootloader(mcuboot) parameter to the kernel(zephyr)? * :github:`9558` - DTC 1.4.7 breaks at least FRDM_K64F builds * :github:`9537` - ENC28J60 can't receive packets properly * :github:`9536` - console: missing kernel.h include in header * :github:`9535` - broken callback handling in nrfx gpio driver * :github:`9530` - Bluetooth/gatt: bt_gatt_notify never return -ENOMEM, undocumented return value. * :github:`9527` - tests/kernel/sched/schedule_api/testcase.yaml#kernel.sched.unlock_preemptible fails on nrf52840_pca10056, sam_e70_xplained, nrf52_pca10040 * :github:`9523` - tests/kernel/mem_protect/stackprot hangs without any console output on nrf51/52 * :github:`9494` - Nordic nrf52810_pca10040 is missing default bluetooth configuration options * :github:`9487` - tests/cmsis_rtos_v1 - test_kernel_systick results in Assertion failure on nrf51/52 * :github:`9486` - sanitycheck filter rules does not work * :github:`9471` - soc: efr32fg1p: hello_world sample app hangs when started by MCUboot * :github:`9470` - LWM2M: TLV encoding of read result is wrong * :github:`9468` - tests/kernel/mem_pool/mem_pool_concept/testcase.yaml#kernel.memory_pool fails on nrf52840_pca10056, nrf52_pca10040 and nrf51_pca10028 * :github:`9466` - tests/kernel/context/testcase.yaml#kernel.common.k_sleep fails on nrf52_pca10040 and nrf52840_pca10056 * :github:`9465` - tests/net/ptp/clock: PTP clock test are failing on FRDM_K64f and same_e70_xplained platforms * :github:`9462` - [Coverity CID :187670] Integer handling issues in /tests/net/ethernet_mgmt/src/main.c * :github:`9461` - [Coverity CID :187671] Uninitialized variables in /tests/net/iface/src/main.c * :github:`9460` - [Coverity CID :187672] Uninitialized variables in /tests/net/iface/src/main.c * :github:`9459` - tests/posix/timer fails on nRF51/52 * :github:`9452` - Error parsing DTS 'compatible' property list * :github:`9446` - CI didn't report failure due to ARC_INIT issue * :github:`9444` - sanitycheck not able to run due to CONFIG_ARC_INIT=n * :github:`9441` - tests/kernel/gen_isr_table fails on mimxrt1050_evk * :github:`9413` - tests/cmsis_rtos_v1 - test_signal_events_signalled results in Assertion failure on nrf51/52 * :github:`9402` - samples/drivers/watchdog fails on frdm_k64f * :github:`9396` - ./loop-socat.sh not running * :github:`9392` - samples/bluetooth/hci_uart ninja flash - UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 360: ordinal not in range(128) * :github:`9389` - ESP32 support: setting env var ESP_DEVICE not working * :github:`9356` - Test tests/crypto/rand32 hangs on nrf51_pca10028 * :github:`9348` - samples: net: echo_client/echo_server does not work with IPv4 qemu_x86 * :github:`9310` - nRF52_PCA10040: Failing test_slice_reset * :github:`9297` - [Coverity CID :187318] Error handling issues in /tests/posix/pthread_key/src/pthread_key.c * :github:`9296` - [Coverity CID :187319] Control flow issues in /subsys/net/lib/sockets/sockets.c * :github:`9295` - [Coverity CID :187320] Control flow issues in /drivers/ethernet/eth_sam_gmac.c * :github:`9294` - [Coverity CID :187321] Possible Control flow issues in /samples/net/sockets/big_http_download/src/big_http_download.c * :github:`9293` - [Coverity CID :187322] Incorrect expression in /tests/posix/pthread_key/src/pthread_key.c * :github:`9292` - [Coverity CID :187323] Control flow issues in /subsys/net/ip/net_if.c * :github:`9291` - [Coverity CID :187324] Control flow issues in /subsys/net/lib/sockets/sockets.c * :github:`9287` - net/dhcpv4: Fix single byte buffer filling madness * :github:`9273` - k_pipe_alloc_init() api is failing on qemu_x86 * :github:`9270` - cmake: kconfig: menuconfig is not writing zephyr/.config * :github:`9262` - tests/kernel/mem_protect/userspace.access_other_memdomain fails on sam_e70_xplained and nrf52840_pca10056 * :github:`9238` - Get POSIX board compliant with default configuration guidelines * :github:`9234` - Get ARC boards compliant with default configuration guidelines * :github:`9224` - sam_e70_xplained fails to build several tests * :github:`9221` - calloc memory data is not initialized to zero for MINIMAL_LIBC * :github:`9198` - Out-of-Tree YAML and DTS support * :github:`9196` - optimize gen_kobject_list.py * :github:`9160` - net: openthread: Mesh Local IPv6 is not in zephyr stack * :github:`9148` - samples/net/http_server: Failed to respond back to CURL command on http Client * :github:`9135` - Failure : "integer overflow in exp" on Altera-Max 10 platform * :github:`9134` - Build failure with SAM_e70 platform * :github:`9131` - samples/net/coaps_server: Failed to send response to coaps_client * :github:`9128` - doc build fails if no reST reference to file * :github:`9113` - Enabling various thread options causes failures on cortex-M0 boards * :github:`9108` - Which board is suit with esidon?? * :github:`9098` - Doc build failure not noticed by CI test system * :github:`9081` - dynamic thread objects do not have a thread ID assigned * :github:`9067` - Failed tests: posix.sema and posix_checks on em_starterkit_em7d_v22 * :github:`9061` - sanitycheck not printing QEMU console in some cases * :github:`9058` - Kconfig default on BT_ACL_RX_COUNT can be 1, but range is 2-64 * :github:`9054` - Build failures with mimxrt1050_evk board * :github:`9044` - "logging: Remove log.h including in headers limitation" breaks logging * :github:`9032` - net/sockets/echo_async crashes after several connections (qemu_x86) * :github:`9028` - STM32 SPI/I2S: LSB bit corrupted for the received data * :github:`9019` - cmsis Include/ version mismatch * :github:`9006` - Create driver for the MMA8451Q accelerometer sensor on FRDM-KL25Z * :github:`9002` - [Coverity CID :187063] Control flow issues in /subsys/net/l2/ethernet/ethernet_mgmt.c * :github:`9001` - [Coverity CID :187064] Control flow issues in /subsys/bluetooth/host/mesh/cfg_srv.c * :github:`9000` - [Coverity CID :187065] Memory - corruptions in /subsys/net/l2/ethernet/gptp/gptp_mi.c * :github:`8998` - [Coverity CID :187068] Memory - illegal accesses in /subsys/bluetooth/host/mesh/cfg_srv.c * :github:`8997` - [Coverity CID :187069] Memory - illegal accesses in /subsys/logging/log_msg.c * :github:`8996` - [Coverity CID :187070] Control flow issues in /drivers/bluetooth/hci/spi.c * :github:`8995` - [Coverity CID :187071] Insecure data handling in /subsys/net/l2/ethernet/gptp/gptp_mi.c * :github:`8994` - [Coverity CID :187072] Error handling issues in /samples/net/sockets/echo_server/src/udp.c * :github:`8993` - [Coverity CID :187073] Null pointer dereferences in /subsys/net/ip/utils.c * :github:`8992` - [Coverity CID :187074] Incorrect expression in /samples/net/traffic_class/src/main.c * :github:`8991` - [Coverity CID :187075] Memory - corruptions in /subsys/net/l2/ethernet/gptp/gptp_mi.c * :github:`8990` - [Coverity CID :187077] Memory - corruptions in /samples/net/rpl_border_router/src/http.c * :github:`8989` - [Coverity CID :187078] Control flow issues in /subsys/net/l2/ethernet/gptp/gptp_md.c * :github:`8988` - [Coverity CID :187079] Integer handling issues in /subsys/net/l2/ethernet/gptp/gptp.c * :github:`8987` - [Coverity CID :187080] Control flow issues in /subsys/net/l2/ethernet/gptp/gptp_mi.c * :github:`8982` - tests/drivers/watchdog/wdt_basic_api results in FATAL EXCEPTION on esp32 * :github:`8977` - CMake Error * :github:`8976` - nordic: watchdog: Cannot be initialized - circular dependency * :github:`8968` - The tests/kernel/tickless/tickless_concept fails on nRF5x * :github:`8963` - tests/net/trickle, utils and icmpv6 hangs on sam_e70_xplained:arm * :github:`8960` - Tcp connection not connecting * :github:`8950` - ARM fault dumping code does too much, assumes all faults are fatal, and doesn't work under some configurations * :github:`8949` - nsim_sem board does not work * :github:`8933` - doc: build WARNING on windows 7 * :github:`8931` - STM32L4 CAN sample project does not compile * :github:`8924` - Get rid of -fno-strict-overflow * :github:`8906` - zsock_getaddrinfo is not reentrant * :github:`8899` - Failed test: kernel.common.timing.sleep on nrf52 (tests/kernel/sleep/kernel.common.timing) * :github:`8898` - Failed test: kernel.timer.timer_periodicity on nrf51/nrf52 * :github:`8897` - Failed test: kernel.tickless.tickless_slice on nrf51/nrf52 * :github:`8896` - Failed test: kernel.sched.slice_reset and kernel.sched.slice_scheduling (tests/kernel/sched/schedule_api/kernel.sched) on nrf51/nrf52 * :github:`8895` - Failed test: kernel.common.timing.pending on nrf51_pca10028 and nrf52_pca10040 (tests/kernel/pending/kernel.common.timing) * :github:`8888` - http client example fails on mimxrt1050_evk * :github:`8887` - Ping command crash on mimxrt1050_evk * :github:`8871` - drivers: can: Compiling error due to stm23Cube update * :github:`8866` - Failed test: net.arp.arp (tests/net/arp) on sam_e70_xplained * :github:`8865` - Failed test: net.udp.udp (tests/net/udp/) on sam_e70_xplained * :github:`8864` - ARM MPU _arch_buffer_validate allowing reads to kernel memory * :github:`8860` - GATT MTU Callback * :github:`8849` - Allow application to define its own DTS bindings * :github:`8833` - OpenThread: Minimal Thread Device (MTD) option is not building * :github:`8829` - BLE "device name" characteristic of Generic Access Service is read only * :github:`8820` - wifi_winc1500 driver socket id stored in net_context->user_data may be overwritten at socket layer * :github:`8815` - Nordic: Directly accessing GPIOTE might create unstable firmware (GPIO, PWM, BLE) * :github:`8800` - cmake errors with menuconfig * :github:`8798` - k_cycle_get_32() implementation on nrf series is too slow. * :github:`8791` - Request supporting OTG_HS port on STM32F4/F7 SoCs * :github:`8790` - K64F/Kinetis: extract_dts_includes.py warnings when building sample * :github:`8752` - net: ARP is broken after PR #8608 * :github:`8732` - tests/subsys/usb/bos/ fails randomly * :github:`8727` - Network stack cleanup: DHCPv4 * :github:`8720` - Network stack cleanup: IPv4 * :github:`8717` - posix: Memory is not returned to mempool when a pthread complete its execution * :github:`8715` - buffer-overflow in tests/net/tx_timestamp * :github:`8713` - add DTS gpio support for NRF51 * :github:`8705` - Out of the box error in samples/subsys/nvs with nRF52-PCA10040 * :github:`8700` - [Coverity CID :186841] Null pointer dereferences in /subsys/usb/usb_descriptor.c * :github:`8699` - [Coverity CID :186842] Memory - illegal accesses in /drivers/interrupt_controller/plic.c * :github:`8698` - [Coverity CID :186843] Parse warnings in /tests/kernel/mem_protect/mem_protect/src/mem_domain.c * :github:`8697` - [Coverity CID :186844] Parse warnings in /tests/net/ieee802154/fragment/src/main.c * :github:`8696` - [Coverity CID :186845] Parse warnings in /tests/net/ieee802154/l2/src/ieee802154_test.c * :github:`8695` - [Coverity CID :186846] Null pointer dereferences in /tests/net/ptp/clock/src/main.c * :github:`8694` - [Coverity CID :186847] Parse warnings in /tests/kernel/mem_protect/mem_protect/src/inherit.c * :github:`8693` - [Coverity CID :186848] Parse warnings in /tests/kernel/mem_protect/mem_protect/src/mem_domain.c * :github:`8692` - [Coverity CID :186849] Parse warnings in /tests/kernel/mem_protect/mem_protect/src/mem_domain.c * :github:`8691` - [Coverity CID :186850] Parse warnings in /tests/kernel/mem_protect/mem_protect/src/mem_domain.c * :github:`8690` - [Coverity CID :186851] Error handling issues in /tests/bluetooth/mesh/src/microbit.c * :github:`8689` - [Coverity CID :186852] Parse warnings in /tests/kernel/mem_protect/mem_protect/src/mem_domain.c * :github:`8669` - fault during my timer testing * :github:`8668` - net: ARP is broken in master (at least) on STM32 * :github:`8658` - tests/net/trickle fails on FRDM k64f * :github:`8657` - tests/net/ptp fails on QEMU x86 * :github:`8646` - CONFIG_NET_OFFLOAD defined in subsys/net/l2/, but not referenced there * :github:`8643` - Add SAADC driver for nRF52 * :github:`8642` - ieee802154 tests fail to build * :github:`8636` - MCUboot firmware update issue * :github:`8611` - RT1050EVK: MPU FAULT with Zephyr OS v1.12.0-360-gf3d1b22 using ztest * :github:`8610` - USB: Setup stage in control transfers * :github:`8605` - mbedtls_ssl_close_notify was called after DTLS context released * :github:`8602` - master broken for stm32 ARM boards * :github:`8600` - Not able to bind the adc device structure for nrf52832 controller * :github:`8598` - [Coverity CID :186057] - Out of bounds write in samples/net/rpl_border_router/src/coap.c * :github:`8596` - drivers: dma_cavs: NULL pointer exception when DMA start called after DMA stop * :github:`8593` - samples/mpu/mem_domain_apis_test/kernel.memory_protection.memory_domains fails to build * :github:`8587` - ZTEST should support multiple calls to mocked function * :github:`8584` - ToolchainCapabilityDatabase.cmake:93 error in PR #8579 * :github:`8576` - there have a error in doc * :github:`8567` - Can't parse json * :github:`8563` - Compilation warning/error on stm32l4: "__weak" redefined * :github:`8529` - tests/kernel/common/kernel.common fails for native_posix on Ubuntu 16.04 * :github:`8528` - rpl-mesh-qemu sample, the net inface init failed. * :github:`8511` - nrf52_blenano2 tmp112 sensor sample build failed - redefined I2C * :github:`8506` - tests/subsys/fs/fat_fs_api - test_fat_mount results into assertion failure on Arduino_101 - FS init failed (-19) * :github:`8502` - Compiling for native_posix with newlib is missing various math symbols * :github:`8501` - I think there is a issue about shell. * :github:`8470` - Broken Arduino 101 Bluetooth Core flashing * :github:`8466` - k_sleep on mimxrt1050_evk board broken * :github:`8464` - sdk_version file missing * :github:`8462` - non-ASCII / non-UTF-8 files in ext/ * :github:`8452` - ieee802154: csma-ca: random backoff factor looks wrong * :github:`8444` - "make clean" removes include directory * :github:`8438` - cmake: Propagation of library specific compile flag * :github:`8434` - Networking Problems, Size Missmatch 15 vs 13 * :github:`8431` - mqtt: unimplemented MQTT_UNSUBACK in mqtt_parser function in mqtt.c file * :github:`8424` - HID example broken * :github:`8416` - [Coverity CID :186580] Uninitialized variables in /drivers/can/stm32_can.c * :github:`8415` - [Coverity CID :186581] Memory - corruptions in /subsys/bluetooth/host/gatt.c * :github:`8414` - [Coverity CID :186582] Memory - corruptions in /subsys/bluetooth/host/gatt.c * :github:`8413` - [Coverity CID :186583] Error handling issues in /samples/net/sockets/dumb_http_server/src/socket_dumb_http.c * :github:`8393` - ``CONFIG_MULTITHREADING=n`` builds call main() with interrupts locked * :github:`8391` - nrf52_blenano2 tmp112 sensor sample build failed. * :github:`8390` - bluetooth: request APIs to notify application that pairing is complete or not * :github:`8388` - Assigning to promptless symbols should have a better error message * :github:`8385` - Missing documentation on bt_conn_auth_cb(...) * :github:`8382` - ESP32: add support for ESP-IDF bootloader * :github:`8380` - cmake: ninja clean tries to remove include folders * :github:`8378` - subsys: settings: Idea for a very simple settings system * :github:`8371` - nRF5: enable UARTE peripheral support * :github:`8367` - fs: nvs: auto restore FS on writing while power down error. * :github:`8366` - mcumgr: unable to perform 2nd update * :github:`8365` - mcumgr: improper response to "image list" command after update. * :github:`8361` - __ASSERT() triggers with ``CONFIG_MULTITHREADING=n`` * :github:`8358` - Flashing Target Device FAIL * :github:`8357` - bluetooth: request the capability to change gap device name programmatically * :github:`8356` - Failed test: kernel.common.bitfield (tests/kernel/common) on Altera Max10 * :github:`8355` - CMake prints a spammy warning about "policy CMP0000" * :github:`8350` - bluetooth: request BLE stack to support pre-set passkey for pairing * :github:`8334` - nrf52840.dtsi contains "0x" in device label * :github:`8329` - qustion: build-system: How to generate a preprocess file * :github:`8327` - CONFIG_SPI_FLASH_W25QXXDV_MAX_DATA_LEN doesn't work in proj.conf * :github:`8322` - LwM2M: Occasional registration updates fail with 4.4 error * :github:`8313` - Enable hardware stack checking for ARC em_starterkit_em7d (Secure mode) * :github:`8311` - tests/benchmarks/sys_kernel fails on frdm_k64f, sam_e70 * :github:`8309` - lpcxpresso54114_m4: when i configed system clock from 48M to 96M the target can't work. * :github:`8302` - Failed test: peripheral.adc.adc on quark_se * :github:`8300` - Failed test: kernel.memory_protection.userspace.access_after_revoke (in tests/kernel/mem_protect/userspace) * :github:`8299` - Failed test: kernel.memory_pool.mpool_alloc_free_isr (in tests/kernel/mem_pool/mem_pool_api) * :github:`8298` - Failed test: kernel.alert.isr_alert_consumed (in tests/kernel/alert/) on quark_se_c1000_ss * :github:`8293` - ARM: MPU faults should indicate faulting memory address * :github:`8292` - Rework ARC exception stack * :github:`8287` - LwM2M: Cancelling an observation doesn't work * :github:`8286` - LwM2M: Observe of not allowed value still creates observer * :github:`8284` - Documentation build on Windows * :github:`8283` - Failed test: kernel.mailbox.msg_receiver_unlimited (tests/kernel/mbox/mbox_usage/) on ESP32 * :github:`8262` - [Bluetooth] MPU FAULT on sdu_recv * :github:`8255` - [RFC] Add support for system suspend/resume handling from kernel * :github:`8252` - GPIO interrupt only called once on nRF52832 * :github:`8240` - ESP32: update to recent ESP-IDF * :github:`8235` - nxp_lpc54102: how to add lpc54102 support? * :github:`8231` - GATT Macro Confusion * :github:`8226` - drivers: can: stm32_can: various issues * :github:`8225` - Error mbedtls_pk_verify MBEDTLS_ERR_RSA_VERIFY_FAILED * :github:`8215` - Update watchdog driver sample to new API * :github:`8210` - Always rebuilding even though there are no changes. * :github:`8206` - Stray files in libapp.a * :github:`8203` - Implement system calls for the new socket APIs * :github:`8199` - Tests: Crypto: rand32 faults on nrf51_pca10028 and nrf52_pca10040 * :github:`8188` - net: TCP: FIN packets aren't queued for retransmission, loss leads to TCP timeout on peer's side * :github:`8183` - zsock_getaddrinfo() is not reentrant * :github:`8173` - Driver tests failing with an assertion on frdm_k64f * :github:`8138` - Unsatisfactory kernel benchmark results on SAM E-70 Xplained * :github:`8128` - scheduler: threads using k_sleep can be _swap()'d back too early * :github:`8125` - About BMI160 reading issue. * :github:`8090` - tests/sched/schedule_api fails to build on EMSK7d * :github:`8041` - arm: NXP MPU does not report faulting address for Stacking Errors * :github:`8039` - tests/shell failing on Arduino 101 / Quark SE arc * :github:`8026` - Verify TLS server side operation * :github:`8019` - ARP: should drop any packet pended when timeout * :github:`8013` - Open-AMP power on can not communicate * :github:`7999` - HCI UART with Linux host cannot connect to nrf52 6lowpan peripheral * :github:`7978` - SSE and SSE_FP_MATH are set on frdm_k64f, which doesn't have it, triggering Kconfig warnings * :github:`7977` - ARC_INIT is set on boards that don't have it, triggering Kconfig warnings * :github:`7966` - Move k_thread_foreach() tests to tests/kernel/threads * :github:`7924` - mcu_mgmt: Memory corruption (cborattr suspected) - test case with smp_svr * :github:`7906` - tests/benchmarks/sys_kernel fails on Arduino Due * :github:`7884` - tests/power/power_states never completes on Arduino 101's arc core * :github:`7882` - tests/dfu/mcuboot.test_bank_erase fails on nrf52840_pca10056 * :github:`7869` - Improve Zero Latency IRQ on ARM * :github:`7848` - CONFIG_BMM150_SET_ATTR not defined (and now removed), giving dead code * :github:`7800` - ext/lib/mgmt/mcumgr/cmd/log_mgmt/Kconfig references MDLOG, but MDLOG doesn't exist * :github:`7758` - sanitycheck error with --coverage * :github:`7705` - nxp_kinetis/k6x boot MPU regions are configured incorrectly * :github:`7703` - NUM_KERNEL_OBJECT_FILES is too small * :github:`7685` - API for 802.1Qav parameters configuration * :github:`7678` - Unstable ping RTT with ethernet ipv4 networking * :github:`7658` - [RFC] net: Split off net_app_settings lib to a separate directory under subsys/net/lib/ * :github:`7596` - API to communicate list of MAC addresses to the Ethernet controller * :github:`7595` - Promiscuous mode and receiving all packets at applications level * :github:`7571` - IP stack can't recover from a packet overload * :github:`7570` - usb: update bcdUSB to 2.00 * :github:`7553` - DHCP client does not notice missing link * :github:`7509` - [Coverity CID :185398] Memory - corruptions in /samples/net/mbedtls_sslclient/src/mini_client.c * :github:`7502` - samples/mbedtls_sslclient: Discards TLS records, handshake does not work * :github:`7473` - Bluetooth: Support for multiple local identity addresses * :github:`7423` - samples: net: echo_client: sample runs failed with prj_qemu_x86_tls.conf configuration file * :github:`7384` - ARM MPU region configuration possibly out of bounds * :github:`7372` - Create socket options for certificates and ciphers * :github:`7371` - Move TLS connection data out from net_context * :github:`7370` - Add Kconfig options to handle certificates and ciphers. * :github:`7367` - Doxygen warnings about device.h macros * :github:`7314` - Generate SPDX TagValue document as part of 1.13 release * :github:`7310` - Provide signed Zephyr releases * :github:`7243` - BLE DTM ll_test does not set correct TXPower * :github:`7230` - The guidelines for whether something should be in DTS or Kconfig are too vague * :github:`7173` - Difference between the ZEPHYR_BASE and PROJECT_SOURCE_DIR CMake variables is unclear * :github:`7145` - Configuration file for Cross Toolchain on macOS * :github:`7112` - ARMv8-M: API for checking permissions using ARMv8-M TT intrinsics * :github:`7106` - tests: obj_tracing: Test fails on ESP32, semaphore count is more than what is created in the application * :github:`7042` - Ethernet network management interface additions for MAC filtering * :github:`6982` - STM32F746G DISCOVERY board support * :github:`6981` - STM32F7 series MCUs support * :github:`6866` - build: requirements: No module named yaml and elftools * :github:`6846` - need console subsystem abstraction for console syscalls * :github:`6785` - Fail to compile when OT l2 debug is enabled. * :github:`6778` - Push latest docs down into a "latest" folder * :github:`6775` - Simplify left nav index on technical docs * :github:`6749` - kconfig: The error message is misleading when values are out-of-range * :github:`6730` - ARMv8-M: internal low-level (TrustZone) API & implementation for configuring IRQ target * :github:`6727` - k_mem_pool crash with larger values of n_max * :github:`6681` - [Coverity CID: 183051] Error handling issues in /tests/benchmarks/app_kernel/src/memmap_b.c * :github:`6678` - [Coverity CID: 183054] Memory - corruptions in /tests/lib/c_lib/src/main.c * :github:`6676` - [Coverity CID: 183056] Memory - corruptions in /tests/kernel/common/src/atomic.c * :github:`6673` - [Coverity CID: 183059] Memory - corruptions in /samples/net/mbedtls_dtlsclient/src/dtls_client.c * :github:`6593` - Allow configuring the USB serial number string in runtime * :github:`6533` - 1.12 Release Checklist * :github:`6522` - Should have a "dumb" O(N) scheduler * :github:`6514` - samples/drivers/i2c_fujitsu_fram: Data comparison on data written and data read fails randomly * :github:`6399` - How to using the PPI chanels from 20-31 in Nrf5 chip? * :github:`6373` - ARMv8-M: Implement stack limit checking for Secure/Non-secure stack pointers * :github:`6188` - doc: Merge non-apache contributing into CONTRIBUTING * :github:`6132` - [RFC] Restructuring and cleanup of mbedTLS configurations * :github:`5980` - NRF5 I2C standard speed 250kHz * :github:`5939` - NRF5 I2C (TWI) driver * :github:`5900` - net: Prototype a TLS convenience API based on sockets * :github:`5896` - Accidentally using MSYS's python from native windows leads to obscure error messages * :github:`5833` - Script to import mcux sdk * :github:`5733` - single threaded applications fail when asserts are enabled * :github:`5732` - sanitycheck fails with gcc 7 as the host compiler * :github:`5725` - Ninja: Running sanitycheck has byproducts outside of sanity-out * :github:`5723` - cmake: Accept CONFIG_XX overrides from command line * :github:`5524` - reorg documentation structure on website (docs.zephyrproject.org) * :github:`5445` - Shadowed declarations in bluetooth stack * :github:`5371` - [Coverity CID: 180698] Null pointer dereferences in /tests/bluetooth/tester/src/gatt.c * :github:`5366` - Document zephyr-app-commands usage * :github:`5357` - CII Badge: Generate list of externally maintained dependencies * :github:`5153` - [RFC] Discussion of "cmake" vs "make" variables, aka "build environment" vs "work environment" setup * :github:`5132` - Soft real-time "tasklets" in kernel * :github:`4963` - Convert NIOS2 boards to device tree * :github:`4957` - Add build targets for each explicit debug/flash option * :github:`4883` - Should command line examples be "cut and paste" ready? * :github:`4829` - device tree: gpio * :github:`4767` - USB: assign endpoints at runtime * :github:`4762` - [nrf][power][Sample] nrf52 exits from Low Power Mode immedately * :github:`4590` - [CID: 178238] Parse warnings in samples/mpu/mem_domain_apis_test/src/main.c * :github:`4283` - kconfig warning are being ignored by sanitycheck * :github:`4060` - net: NET_CONTEXT_SYNC_RECV relevant * :github:`4047` - [nrf] nrf GPIO does not have sense configuration value * :github:`4018` - zephyr.git/tests/net/mld/testcase.yaml#test :evalution failed * :github:`3995` - net tcp retry triggers assert in kernel/sem.c:145 * :github:`3993` - Enabling Low Power Mode on nordic based platforms(nrf52/51) * :github:`3980` - Remove adc_enable/adc_disable functions * :github:`3947` - multiple build failures with XCC toolchain * :github:`3935` - Bluetooth sample setup docs mentions unknown "btproxy" tool * :github:`3903` - Static code scan (coverity) issues seen * :github:`3845` - Enable Sphinx option doc_role='any' for improved reference linking * :github:`3826` - RISCV32 {__irq_wrapper} exception handling error under compressed instruction mode? * :github:`3770` - mbedtls build error when CONFIG_DEBUG=y * :github:`3754` - Support static BT MAC address * :github:`3666` - schedule_api test uses zassert without cleaning up properly * :github:`3631` - program text should be in its own memory region * :github:`3602` - power_mgr and power_states: need build option to keep the app exiting in "active" state * :github:`3583` - NUCLEO-L073RZ/NUCLEO-L053R8 Dev Board Support * :github:`3458` - Port Zephyr to Silabs EFM32ZG-STK3200 * :github:`3395` - Provide a sample app that demonstrates VLANs * :github:`3394` - Support basic VLAN tags * :github:`3393` - VLAN: Expose through virtual network interfaces * :github:`3377` - Missing le_param_updated callback when conn param update request fails * :github:`3363` - Missing board documentation for nios2/qemu_nois2 * :github:`3354` - Missing board documentation for x86/se_c1000_devboard * :github:`3263` - improve Galileo flashing process * :github:`3233` - LLDP Transmitting Agent * :github:`3222` - No negative response if remote enabled encryption too soon * :github:`3221` - re-pairing with no-bond legacy pairing results in using all zeros LTK * :github:`3187` - frdm_k64f: Ethernet networking starts to respond ~10s after boot * :github:`3173` - k_cpu_atomic_idle failed @ARM * :github:`3150` - Si1153 Ambient Light Sensor, Proximity, and Gesture detector support * :github:`3149` - Add support for ADXRS290 * :github:`3073` - Add Atmel SAM family DAC (DACC) driver * :github:`3071` - Add Atmel SAM family Timer Counter (TC) driver * :github:`3067` - Support Precision Time Protocol (PTP) * :github:`3056` - arch-specific inline functions cannot manipulate _kernel * :github:`3025` - Implement _tsc_read equivalent for NiosII * :github:`3024` - Implement _tsc_read equivalent for ARM * :github:`3007` - Provide board documentation for all boards * :github:`2991` - Enable NXP Cortex-M SoCs with MCUXpresso SDK * :github:`2975` - add arc nSIM simulator build target * :github:`2972` - extend sanitycheck to support ARC simulator * :github:`2956` - I2C Slave Driver * :github:`2954` - nRF5x interrupt-driven TX UART driver * :github:`2952` - ADC: ADC fails to work when fetch multiple sequence entries * :github:`2934` - Ecosystem and Tool Support * :github:`2879` - ARC: Interrupt latency too large * :github:`2645` - create DRAM_BASE_ADDRESS and SIZE config parameters * :github:`2623` - nRF52 UART behaviour sensitive to timing of baud rate initialization. * :github:`2568` - Have the kernel give the leftover memory to the IP stack * :github:`2422` - O(1) pend queue support * :github:`2353` - nRF5x: Refactor gpio_nrf5.c to use the MDK headers * :github:`1678` - support edge/pulse interrupts on ARC * :github:`1662` - Problem sourcing the project environment file from zsh * :github:`1600` - Could you give me BTP upper tester demo which can work on PC * :github:`1464` - SYS_CLOCK_HW_CYCLES_PER_SEC is missing a default value
{ "pile_set_name": "Github" }
// Copyright 2019 Zhizhesihai (Beijing) Technology Limited. // // 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, // See the License for the specific language governing permissions and // limitations under the License. use std::cmp::max; use std::sync::{Arc, Once}; use core::codec::postings::posting_format::BLOCK_SIZE; use core::store::io::{DataOutput, IndexInput, IndexOutput}; use core::util::packed::*; use core::util::BitsRequired; use error::Result; use std::mem::MaybeUninit; use std::ptr; /// Special number of bits per value used whenever all values to encode are equal. const ALL_VALUES_EQUAL: i32 = 0; /// Upper limit of the number of bytes that might be required to stored /// <code>BLOCK_SIZE</code> encoded values. pub const MAX_ENCODED_SIZE: usize = BLOCK_SIZE as usize * 4; /// Upper limit of the number of values that might be decoded in a single call to /// {@link #read_block(IndexInput, [u8], [i32])}. Although values after /// `BLOCK_SIZE` are garbage, it is necessary to allocate value buffers /// whose size is `MAX_DATA_SIZE` to avoid `IndexOutOfBounds` Error. /// /// NOTE: this value is always equal to `max_data_size()`, use const instead of /// something like lazy_static can allow us use [; MAX_DATA_SIZE] instead of Vec. pub const MAX_DATA_SIZE: usize = 147; #[test] fn test_max_data_size() { assert_eq!(MAX_DATA_SIZE, max_data_size()); } static START: Once = Once::new(); fn compute_iterations(decoder: &impl PackedIntDecoder) -> i32 { (BLOCK_SIZE as f32 / decoder.byte_value_count() as f32).ceil() as i32 } pub fn max_data_size() -> usize { static mut MAX_DATA_SIZE: usize = 0; START.call_once(|| { let mut max_data_size: usize = 0; for version in VERSION_START..=VERSION_CURRENT { let format = Format::Packed; for bpv in 1..33 { if let Ok(decoder) = get_decoder(format, version, bpv) { let iterations = compute_iterations(&decoder) as usize; max_data_size = max(max_data_size, iterations * decoder.byte_value_count()); } else { panic!(format!( "get_decoder({:?},{:?},{:?}) failed.", format, version, bpv )); } } let format = Format::PackedSingleBlock; for bpv in 1..33 { if let Ok(decoder) = get_decoder(format, version, bpv) { let iterations = compute_iterations(&decoder) as usize; max_data_size = max(max_data_size, iterations * decoder.byte_value_count()); } else { panic!(format!( "get_decoder({:?},{:?},{:?}) failed.", format, version, bpv )); } } } unsafe { MAX_DATA_SIZE = max_data_size }; }); unsafe { MAX_DATA_SIZE } } fn encoded_size(format: Format, version: i32, bits_per_value: i32) -> i32 { format.byte_count(version, BLOCK_SIZE, bits_per_value) as i32 } struct ForUtilInstance { encoded_sizes: [i32; 32], decoders: MaybeUninit<[BulkOperationEnum; 32]>, encoders: MaybeUninit<[BulkOperationEnum; 32]>, iterations: [i32; 32], } impl Drop for ForUtilInstance { fn drop(&mut self) { unsafe { ptr::drop_in_place(self.decoders.as_mut_ptr()); ptr::drop_in_place(self.encoders.as_mut_ptr()); } } } impl ForUtilInstance { fn with_input(input: &mut dyn IndexInput) -> Result<ForUtilInstance> { let packed_ints_version = input.read_vint()?; check_version(packed_ints_version)?; let mut encoded_sizes = [0; 32]; let mut iterations = [0; 32]; let mut decoders = MaybeUninit::<[BulkOperationEnum; 32]>::uninit(); let mut encoders = MaybeUninit::<[BulkOperationEnum; 32]>::uninit(); for bpv in 0..32 { let code = input.read_vint()?; let format_id = ((code as usize) >> 5) as i32; let bits_per_value = (code & 31) + 1; let format = Format::with_id(format_id); encoded_sizes[bpv] = encoded_size(format, packed_ints_version, bits_per_value); unsafe { decoders.get_mut()[bpv] = get_decoder(format, packed_ints_version, bits_per_value)?; encoders.get_mut()[bpv] = get_encoder(format, packed_ints_version, bits_per_value)?; iterations[bpv] = compute_iterations(&decoders.get_ref()[bpv]); } } Ok(ForUtilInstance { encoded_sizes, decoders, encoders, // not used when read iterations, }) } fn with_output<T: DataOutput + ?Sized>( acceptable_overhead_ratio: f32, output: &mut T, ) -> Result<Self> { output.write_vint(VERSION_CURRENT)?; let mut encoders = MaybeUninit::<[BulkOperationEnum; 32]>::uninit(); let mut decoders = MaybeUninit::<[BulkOperationEnum; 32]>::uninit(); let mut iterations = [0i32; 32]; let mut encoded_sizes = [0i32; 32]; for bpv in 1..33usize { let FormatAndBits { format, bits_per_value, } = FormatAndBits::fastest(BLOCK_SIZE, bpv as i32, acceptable_overhead_ratio); debug_assert!(format.is_supported(bits_per_value)); debug_assert!(bits_per_value <= 32); encoded_sizes[bpv - 1] = encoded_size(format, VERSION_CURRENT, bits_per_value); unsafe { decoders.get_mut()[bpv - 1] = get_decoder(format, VERSION_CURRENT, bits_per_value)?; encoders.get_mut()[bpv - 1] = get_encoder(format, VERSION_CURRENT, bits_per_value)?; iterations[bpv - 1] = compute_iterations(&decoders.get_ref()[bpv - 1]); } output.write_vint(format.get_id() << 5 | (bits_per_value - 1))?; } Ok(ForUtilInstance { encoded_sizes, decoders, encoders, iterations, }) } pub fn read_block( &self, input: &mut dyn IndexInput, encoded: &mut [u8], decoded: &mut [i32], ) -> Result<()> { let num_bits = input.read_byte()? as usize; debug_assert!(num_bits <= 32); if num_bits as i32 == ALL_VALUES_EQUAL { let value = input.read_vint()?; decoded[0..BLOCK_SIZE as usize] .iter_mut() .map(|x| *x = value) .count(); return Ok(()); } let encoded_size = self.encoded_sizes[num_bits - 1]; input.read_exact(&mut encoded[0..encoded_size as usize])?; let decoder = unsafe { &self.decoders.get_ref()[num_bits - 1] }; let iters = self.iterations[num_bits - 1] as usize; decoder.decode_byte_to_int(encoded, decoded, iters); Ok(()) } pub fn skip_block(&self, input: &mut dyn IndexInput) -> Result<()> { let num_bits = input.read_byte()? as usize; if num_bits as i32 == ALL_VALUES_EQUAL { input.read_vint()?; return Ok(()); } let encoded_size = self.encoded_sizes[num_bits - 1]; let fp = input.file_pointer(); input.seek(fp + i64::from(encoded_size)) } } #[derive(Clone)] pub struct ForUtil { instance: Arc<ForUtilInstance>, } impl ForUtil { pub fn with_input(input: &mut dyn IndexInput) -> Result<ForUtil> { Ok(ForUtil { instance: Arc::new(ForUtilInstance::with_input(input)?), }) } pub fn with_output<T: DataOutput + ?Sized>( acceptable_overhead_ratio: f32, output: &mut T, ) -> Result<Self> { Ok(ForUtil { instance: Arc::new(ForUtilInstance::with_output( acceptable_overhead_ratio, output, )?), }) } pub fn read_block( &self, input: &mut dyn IndexInput, encoded: &mut [u8], decoded: &mut [i32], ) -> Result<()> { self.instance.read_block(input, encoded, decoded) } fn is_all_equal(data: &[i32]) -> bool { assert!(!data.is_empty()); let v = data[0]; for i in &data[1..BLOCK_SIZE as usize] { if *i != v { return false; } } true } fn bits_required(data: &[i32]) -> i32 { let mut or = 0; for i in &data[..BLOCK_SIZE as usize] { debug_assert!(*i >= 0); or |= *i; } debug_assert!(or >= 0); or.bits_required() as i32 } pub fn write_block( &self, data: &[i32], encoded: &mut [u8], out: &mut impl IndexOutput, ) -> Result<()> { if Self::is_all_equal(data) { out.write_byte(0)?; return out.write_vint(data[0]); } let num_bits = Self::bits_required(data) as usize; assert!(num_bits > 0 && num_bits <= 32); let iters = self.instance.iterations[num_bits - 1]; let encoder = unsafe { &self.instance.encoders.get_ref()[num_bits - 1] }; assert!(iters * encoder.byte_value_count() as i32 >= BLOCK_SIZE); let encoded_size = self.instance.encoded_sizes[num_bits - 1]; debug_assert!(iters * encoder.byte_block_count() as i32 >= encoded_size); out.write_byte(num_bits as u8)?; encoder.encode_int_to_byte(data, encoded, iters as usize); out.write_bytes(encoded, 0, encoded_size as usize) } pub fn skip_block(&self, input: &mut dyn IndexInput) -> Result<()> { self.instance.skip_block(input) } }
{ "pile_set_name": "Github" }
# uncompyle6 version 2.9.10 # Python bytecode 2.7 (62211) # Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10) # [GCC 6.2.0 20161005] # Embedded file name: __init__.py import _dsz import dsz import dsz.data import dsz.lp import mcl.tasking import sys import Queue import xml import xml.sax import xml.sax.handler InitialList = 1 StartList = 2 StopList = 3 Type_IPv4 = 'IPv4' Type_IPv6 = 'IPv6' class NetConnections(dsz.data.TaskReader): def __init__(self, cmd=None, id=None): dsz.data.TaskReader.__init__(self, cmd, id) self.__currentList = None self.__currentItem = None self.__currentEndPoint = None self.__timestamp = None self.__currentNamedItem = None self.StartConnectionListItem = FilteredIterator(self, ConnectionList, StartList) self.StopConnectionListItem = FilteredIterator(self, ConnectionList, StopList) self.InitialConnectionListItem = None for item in self: if self.InitialConnectionListItem != None: break return def startElement(self, name, attrs): dsz.data.TaskReader.startElement(self, name, attrs) self.__currentText = None if name == 'Connections': self.__timestamp = attrs['lptimestamp'] if name == 'Initial': temp = ConnectionList(InitialList, self.__timestamp) self.InitialConnectionListItem = temp self.__currentList = temp self.currentItems.put(temp) elif name == 'Started': temp = ConnectionList(StartList, self.__timestamp) self.__currentList = temp self.currentItems.put(temp) elif name == 'Stopped': temp = ConnectionList(StopList, self.__timestamp) self.__currentList = temp self.currentItems.put(temp) elif name == 'Connection': temp = ConnectionItem() self.__currentItem = temp self.__currentList.Connection.append(temp) try: temp.State = attrs['state'] except: temp.State = None try: temp.Type = attrs['type'] except: temp.Type = None try: temp.Valid = attrs['valid'] == 'true' except: temp.Valid = False elif name == 'LocalAddress' or name == 'RemoteAddress': temp = EndPoint() self.__currentEndPoint = temp elif name == 'NamedPipe': temp = NamedItem('Pipe') self.__currentNamedItem = temp self.__currentList.Connection.append(temp) elif name == 'MailSlot': temp = NamedItem('Mail') self.__currentNamedItem = temp self.__currentList.Connection.append(temp) return def endElement(self, name): dsz.data.TaskReader.endElement(self, name) if name == 'LocalAddress': self.__currentItem.Local = self.__currentEndPoint elif name == 'RemoteAddress': self.__currentItem.Remote = self.__currentEndPoint elif name == 'IPv4Address': self.__currentEndPoint.IPv4 = self.__currentText self.__currentEndPoint.Address = self.__currentText self.__currentEndPoint.Type = Type_IPv4 elif name == 'IPv6Address': items = self.__currentText.split('%') if len(items) == 3: self.__currentText = '%s%%%s' % (items[0], items[2]) self.__currentEndPoint.IPv6 = self.__currentText self.__currentEndPoint.Address = self.__currentText self.__currentEndPoint.Type = Type_IPv6 elif name == 'LocalPort' or name == 'RemotePort': self.__currentEndPoint.Port = int(self.__currentText) self.__currentEndPoint.Portv4 = int(self.__currentText) self.__currentEndPoint.Portv6 = int(self.__currentText) elif name == 'Pid': self.__currentItem.Pid = int(self.__currentText) elif name == 'Name': self.__currentNamedItem.Name = self.__currentText self.__currentText = None return def characters(self, content): dsz.data.TaskReader.characters(self, content) content = ''.join(content.encode('utf-8')) if self.__currentText == None: self.__currentText = content else: self.__currentText += content return def Display(self): dsz.ui.Echo(' TYPE PROCESS LOCAL REMOTE STATE') dsz.ui.Echo('--------------------------------------------------------------------------------------------------------- -') for item in self: item.Display() class ConnectionList(dsz.data.DataBean): def __init__(self, listType, timestamp): self.ListType = listType self.Timestamp = timestamp self.Connection = list() def Display(self): prefix = ' ' if self.ListType == StartList: prefix = '+' elif self.ListType == StopList: prefix = '-' for conn in self.Connection: conn.Display(prefix) class ConnectionItem(dsz.data.DataBean): def __init__(self): self.Pid = None self.Local = None self.Remote = None return def Display(self, prefix=''): valid = '' type = '' proc = '' local = '' remote = '' state = '' if not self.Valid: valid = '*' if self.Type != None: type = self.Type if self.Pid != None: proc = '%d' % self.Pid if self.Local != None: local = self.Local.toString() if self.Remote != None: remote = self.Remote.toString() if self.State != None: state = self.State dsz.ui.Echo('%s%1s%-4s %5s %-35s %-35s %-14s' % (prefix, valid, type, proc, local, remote, state)) return class NamedItem(dsz.data.DataBean): def __init__(self, type): self.Name = None self.Type = type return def Display(self, prefix=''): dsz.ui.Echo('%s%-8s %s' % (prefix, self.Type, self.Name)) class EndPoint(dsz.data.DataBean): def __init__(self): self.Portv4 = None self.IPv4 = None self.Portv6 = None self.IPv6 = None self.Port = None self.Address = None self.Type = None return def toString(self): if self.Type == Type_IPv4: if len(self.Address) == 0: return '*:*' else: return '%s:%d' % (self.Address, self.Port) elif self.Type == Type_IPv6: if self.Address == '::' and (self.Port == 0 or self.Port == None): return '*:*' else: if self.Port == 0 or self.Port == None: return '[%s]:*' % self.Address return '[%s]:%d' % (self.Address, self.Port) else: return '*:*' return class FilteredIterator(dsz.data.IteratorBean): def __init__(self, item, iterType, listType): dsz.data.IteratorBean.__init__(self, item, iterType) self.listType = listType def evaluate(self, ret): return ret.ListType == self.listType dsz.data.RegisterCommand('NetConnections', NetConnections, True) NETCONNECTIONS = NetConnections netconnections = NetConnections
{ "pile_set_name": "Github" }
SHA256 (gtk-engines-2.20.2.tar.bz2) = FbaAq8psdz7LhSU1IfoQDdO4VJvv7sx1lbECCdYtZrU= SIZE (gtk-engines-2.20.2.tar.bz2) = 688171
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="ProjectModuleManager"> <modules> <module fileurl="file://$PROJECT_DIR$/OpenCVCheck.iml" filepath="$PROJECT_DIR$/OpenCVCheck.iml" /> <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" /> <module fileurl="file://$PROJECT_DIR$/openCVLibrary320/openCVLibrary320.iml" filepath="$PROJECT_DIR$/openCVLibrary320/openCVLibrary320.iml" /> </modules> </component> </project>
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342" /> <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --></configSections> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-4.0.4.1" newVersion="4.0.4.1" /> </dependentAssembly> <dependentAssembly> <publisherPolicy apply="no" /> <assemblyIdentity name="Oracle.ManagedDataAccess" publicKeyToken="89b483f429c47342" culture="neutral" /> <bindingRedirect oldVersion="4.121.0.0 - 4.65535.65535.65535" newVersion="4.122.19.1" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Autofac" publicKeyToken="17863af14b0044da" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-4.9.4.0" newVersion="4.9.4.0" /> </dependentAssembly> </assemblyBinding> </runtime> <entityFramework> <providers> <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> <provider invariantName="Oracle.ManagedDataAccess.Client" type="Oracle.ManagedDataAccess.EntityFramework.EFOracleProviderServices, Oracle.ManagedDataAccess.EntityFramework, Version=6.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342" /> <provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.9.12.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"></provider> <provider invariantName="Npgsql" type="Npgsql.NpgsqlServices, EntityFramework6.Npgsql" /> </providers> <defaultConnectionFactory type="Npgsql.NpgsqlConnectionFactory, EntityFramework6.Npgsql" /> </entityFramework> <system.data> <DbProviderFactories> <remove invariant="Oracle.ManagedDataAccess.Client" /> <add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver" type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342" /> <remove invariant="MySql.Data.MySqlClient" /><add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.12.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" /><remove invariant="Npgsql" /><add name="Npgsql Provider" invariant="Npgsql" description=".NET Framework Data Provider for PostgreSQL" type="Npgsql.NpgsqlFactory, Npgsql, Version=4.0.10.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7" /></DbProviderFactories> </system.data> <oracle.manageddataaccess.client> <version number="*"> <dataSources> <dataSource alias="SampleDataSource" descriptor="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL))) " /> </dataSources> </version> </oracle.manageddataaccess.client> <connectionStrings> <add name="OracleDbContext" providerName="Oracle.ManagedDataAccess.Client" connectionString="User Id=oracle_user;Password=oracle_user_password;Data Source=oracle" /> </connectionStrings> </configuration>
{ "pile_set_name": "Github" }
//给定一个只包括 '(',')','{','}','[',']' 的字符串,判断字符串是否有效。 // // 有效字符串需满足: // // // 左括号必须用相同类型的右括号闭合。 // 左括号必须以正确的顺序闭合。 // // // 注意空字符串可被认为是有效字符串。 // // 示例 1: // // 输入: "()" //输出: true // // // 示例 2: // // 输入: "()[]{}" //输出: true // // // 示例 3: // // 输入: "(]" //输出: false // // // 示例 4: // // 输入: "([)]" //输出: false // // // 示例 5: // // 输入: "{[]}" //输出: true // Related Topics 栈 字符串 //leetcode submit region begin(Prohibit modification and deletion) class Solution { public boolean isValid(String s) { if (s.length() % 2 == 1) { return false; } else { Stack<Character> stack = new Stack<Character>(); for (int i = 0; i < s.length(); ++i) { if (s.charAt(i) == '(') { stack.push(')'); } else if (s.charAt(i) == '{') { stack.push('}'); } else if (s.charAt(i) == '[') { stack.push(']'); } else if (stack.isEmpty() || stack.pop() != s.charAt(i)) { return false; } } return stack.isEmpty(); } } } //leetcode submit region end(Prohibit modification and deletion)
{ "pile_set_name": "Github" }
/* * Copyright © <2010>, Intel Corporation. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sub license, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * This file was originally licensed under the following 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. * */ // Module name: loadNV12_16x16T.asm // // Load and transpose NV12 16x16 block // //---------------------------------------------------------------- // Symbols need to be defined before including this module // // Source region in :ud // SRC_YD: SRC_YD Base=rxx ElementSize=4 SrcRegion=REGION(8,1) Type=ud // 8 GRFs // SRC_UD: SRC_UD Base=rxx ElementSize=4 SrcRegion=REGION(8,1) Type=ud (U+V for NV12) // 4 GRFs // // Source region is :ub. The same region as :ud region // SRC_YB: SRC_YB Base=rxx ElementSize=1 SrcRegion=REGION(16,1) Type=ub // 8 GRFs // SRC_UB: SRC_UB Base=rxx ElementSize=1 SrcRegion=REGION(16,1) Type=ub // 2 GRFs // SRC_VB: SRC_VB Base=rxx ElementSize=1 SrcRegion=REGION(16,1) Type=ub // 2 GRFs // // Binding table index: // BI_SRC_Y: Binding table index of Y surface // BI_SRC_UV: Binding table index of UV surface (NV12) // // Temp buffer: // BUF_B: BUF_B Base=rxx ElementSize=1 SrcRegion=REGION(16,1) Type=ub // //---------------------------------------------------------------- #if defined(_DEBUG) mov (1) EntrySignatureC:w 0xDDD1:w #endif // Read Y mov (2) MSGSRC.0<1>:ud ORIX_CUR<2;2,1>:w // Block origin mov (1) MSGSRC.2<1>:ud 0x000F000F:ud // Block width and height (16x16) send (8) SRC_YD(0)<1> MSGHDRY MSGSRC<8;8,1>:ud DAPREAD RESP_LEN(8)+DWBRMSGDSC_RC+BI_SRC_Y // Read 8 GRFs // Read U+V asr (1) MSGSRC.1:ud MSGSRC.1:ud 1:w // NV12 U+V block origin y = half of Y comp mov (1) MSGSRC.2<1>:ud 0x0007000F:ud // NV12 U+V block width and height (16x8) send (8) SRC_UD(0)<1> MSGHDRU MSGSRC<8;8,1>:ud DAPREAD RESP_LEN(4)+DWBRMSGDSC_RC+BI_SRC_UV // Read 4 GRFs #include "TransposeNV12_16x16.asm" // #include "Transpose_Y_16x16.asm" // #include "Transpose_NV12_UV_16x8.asm" // End of loadNV12_16x16T
{ "pile_set_name": "Github" }
// Copyright 2014 tsuru 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 main import ( "github.com/tsuru/config" "github.com/tsuru/tsuru/cmd" "launchpad.net/gnuflag" ) type configFile struct { value string } func (v *configFile) String() string { return v.value } func (v *configFile) Set(value string) error { err := config.ReadConfigFile(value) if err != nil { return err } v.value = value return nil } type tsrCommand struct { cmd.Command fs *gnuflag.FlagSet file configFile } func (c *tsrCommand) Flags() *gnuflag.FlagSet { if c.fs == nil { if f, ok := c.Command.(cmd.FlaggedCommand); ok { c.fs = f.Flags() } else { c.fs = gnuflag.NewFlagSet("tsr", gnuflag.ExitOnError) } c.fs.Var(&c.file, "config", "Path to configuration file (default to /etc/tsuru/tsuru.conf)") c.fs.Var(&c.file, "c", "Path to configuration file (default to /etc/tsuru/tsuru.conf)") } return c.fs }
{ "pile_set_name": "Github" }
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "QDataCacheBase.h" @interface QDataCacheSatellite : QDataCacheBase { } + (id)dataCacheSatellite; @end
{ "pile_set_name": "Github" }
\begin[papersize=a4]{document}\nofolios \font[language=my,family=Padauk] \set[parameter=linebreak.tolerance,value=2000] အပြည်ပြည်ဆိုင်ရာ လူ့အခွင့်အရေး ကြေညာစာတမ်း ၁၉၄၈ ခုနှစ်၊ဒီဇင်ဘာလ ၁၀ ရက်နေ့တွင် ကမ္ဘာ့ကုလသမဂ္ဂအဖွဲ့ညီလာခံ အစည်းအဝေးကြီးက လူ့အခွင့်အရေး ကြေညာစာတမ်းကြီးကို အတည်ပြု၍ ကြေညာလိုက်ရာထိုကြေညာစာတမ်းကြီး၏ စာသားသည်နောက်စာမျက်နှာ များတွင် အပြည့်အစုံပါရှိသည်။ ဤကဲ့သို့ရာဇဝင်တင်မည့် ကြေညာချက်ကို ပြုလုပ်ပြီးနောက် ဤညီလာခံအစည်းအဝေးကြီးက ကမ္ဘာ့ကုလသမဂ္ဂအဖွဲ့ဝင် နိုင်ငံ အားလုံးအား ထိုကြေညာစာတမ်းကြီး၏ စာသားကိုအများပြည်သူတို့ ကြားသိစေရန် ကြေညာပါမည့် အကြောင်းကိုလည်းကောင်း၊ ထို့ပြင်နိုင်ငံများ၊ သို့တည်းမဟုတ် နယ်မြေများ၏ နိုင်ငံရေး အဆင့်အတန်းကို လိုက်၍ ခွဲခြားခြင်း မပြုဘဲအဓိကအားဖြင့် စာသင်ကျောင်းများနှင့် အခြားပညာရေး အဖွဲ့အစည်းများတွင် ထိုကြေညာစာတမ်းကြီးကို ဖြန့်ချိ ဝေငှ စေရန်၊ မြင်သာအောင် ပြသထားစေရန်၊ဖတ်ကြားစေရန်နှင့် အဓိပ္ပါယ်ရှင်းလင်း ဖော်ပြစေရန် ဆောင်ရွက်ပါမည့် အကြောင်းဖြင့် လည်းကောင်း ဆင့်ဆို လိုက်သည်။ \end{document}
{ "pile_set_name": "Github" }
# Navigation Guide Lets build the navigation for a simple chat app. First, we should decide on the structure of our application state. Because we can have a stack of screens in our app, we will store the list of scenes in an array: ```javascript class MyApp extends React.Component { constructor(props) { super(props); this.state = { scenes: [ {key: 'home'}, // this represents the application home screen ], }; } ``` For our render function, we want to display the topmost/current scene in the stack. ```javascript render() { const scene = this.state.scenes[this.state.scenes.length - 1]; if (scene.key === 'home') { return <HomeView />; } if (scene.type === 'chat') { return <ChatView id={scene.key} />; } return null; } ``` To open a chat screen, we could add a method called `openChat`: ```javascript openChat(id) { this.setState({ scenes: [ ...this.state.scenes, { type: 'chat', key: id } ], }); } ``` And if we wanted to go back, we could implement a back method like this: ```javascript goBack() { if (this.state.scenes.length > 1) { this.setState({ scenes: this.state.scenes.slice(0, this.state.scenes.length - 1), }); } } ``` However, it quickly becomes complicated to maintain independent methods for every navigation action in your app. To fix this, we can delegate all of the navigation logic to a reducer: ```javascript constructor(props) { super(props); this.state = AppReducer(null, { type: 'init' }); } dispatch(action) { this.setState(AppReducer(this.state, action)); } ``` Our reducer would then look like this: ```javascript function AppReducer(lastState, action) { let state = lastState; if (!state) { state = { scenes: [ {key: 'home'} ], }; } if (action.type === 'back' && state.scenes.length > 1) { return { scenes: state.scenes.slice(0, this.state.scenes.length - 1), }; } if (action.type === 'openChat') { return { scenes: [ ...state.scenes, { type: 'chat', key: action.id } ], }; } return state; } ``` Now, we can easily implement our navigation methods as the following: ```javascript openChat(id) { this.dispatch({ type: 'openChat', id }); } goBack() { this.dispatch({ type: 'back' }); } ``` And now that we have implemented `this.dispatch`, we can give access to allow sub-components to dispatch actions: ```javascript render() { const scene = this.state.scenes[this.state.scenes.length - 1]; if (scene.key === 'home') { return ( <HomeView dispatch={this.dispatch.bind(this)} /> ); } if (scene.type === 'chat') { return ( <ChatView id={scene.key} dispatch={this.dispatch.bind(this)} /> ); } return null; } ``` ```javascript function HomeView(props) { return <Text onPress={() => { props.dispatch({ type: 'openChat', id: 'A' }); }}> This is the home screen. Tap to open Chat A. </Text>; } function ChatView(props) { return <Text onPress={() => { props.dispatch({ type: 'back' }); }}> This is chat {props.id}. Tap to go back home. </Text>; } ``` Now we have a simple application which supports opening the chat view and returning to the home screen. See the code here: https://gist.github.com/ericvicenti/d8f00f4edaf50a8773d734667e32b1a7 ### Android Back Button The back button is critical for navigation on Android, so we can go ahead and add support for it now. Our application can subscribe to back button events and pass them into the dispatch: ### Link support
{ "pile_set_name": "Github" }
import React from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; import { Reference } from 'react-popper'; import Button from '../../Button'; class DropdownToggle extends React.Component { onClick = e => { const { disabled, nav, tag, onClick } = this.props; const { toggle } = this.context; if (disabled) { e.preventDefault(); return; } if (nav && !tag) { e.preventDefault(); } if (onClick) { onClick(e); } toggle(e); }; render() { const { className, color, caret, nav, tag, ...props } = this.props; const { isOpen } = this.context; const ariaLabel = props['aria-label'] || 'Toggle Dropdown'; const classes = classNames( { 'dropdown-toggle': caret, 'nav-link': nav }, className ); const children = props.children || <span className='sr-only'>{ariaLabel}</span>; let Tag = tag; if (nav && !tag) { Tag = 'a'; props.href = '#'; } else if (!tag) { Tag = Button; props.color = color; } return ( <Reference data-test='dropdown-toggle'> {({ ref }) => tag || nav ? ( <Tag {...props} className={classes} onClick={this.onClick} aria-expanded={isOpen} ref={ref}> {children} </Tag> ) : ( <Tag {...props} className={classes} onClick={this.onClick} aria-expanded={isOpen} innerRef={ref}> {children} </Tag> ) } </Reference> ); } } DropdownToggle.propTypes = { 'aria-haspopup': PropTypes.bool, caret: PropTypes.bool, children: PropTypes.node, className: PropTypes.string, color: PropTypes.string, disabled: PropTypes.bool, nav: PropTypes.bool, onClick: PropTypes.func, tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]) }; DropdownToggle.defaultProps = { 'aria-haspopup': true, color: 'secondary' }; DropdownToggle.contextTypes = { isOpen: PropTypes.bool.isRequired, toggle: PropTypes.func.isRequired }; export default DropdownToggle; export { DropdownToggle as MDBDropdownToggle };
{ "pile_set_name": "Github" }
/** * This file is part of Aion-Lightning <aion-lightning.org>. * * Aion-Lightning 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. * * Aion-Lightning 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 Aion-Lightning. * If not, see <http://www.gnu.org/licenses/>. */ package com.aionemu.gameserver.network.aion.clientpackets; import com.aionemu.gameserver.configs.main.GSConfig; import com.aionemu.gameserver.network.aion.AionClientPacket; import com.aionemu.gameserver.network.aion.AionConnection; import com.aionemu.gameserver.network.aion.AionConnection.State; import com.aionemu.gameserver.network.aion.serverpackets.SM_CREATE_CHARACTER; import com.aionemu.gameserver.network.aion.serverpackets.SM_NICKNAME_CHECK_RESPONSE; import com.aionemu.gameserver.services.NameRestrictionService; import com.aionemu.gameserver.services.player.PlayerService; /** * In this packets aion client is asking if given nickname is ok/free?. * * @author -Nemesiss- * @modified cura */ public class CM_CHECK_NICKNAME extends AionClientPacket { /** * nick name that need to be checked */ private String nick; /** * Constructs new instance of <tt>CM_CHECK_NICKNAME </tt> packet * * @param opcode */ public CM_CHECK_NICKNAME(int opcode, State state, State... restStates) { super(opcode, state, restStates); } /** * {@inheritDoc} */ @Override protected void readImpl() { nick = readS(); } /** * {@inheritDoc} */ @Override protected void runImpl() { AionConnection client = getConnection(); if (!PlayerService.isFreeName(nick) || PlayerService.isOldName(nick)) { if (GSConfig.CHARACTER_CREATION_MODE == 2) { client.sendPacket(new SM_NICKNAME_CHECK_RESPONSE(SM_CREATE_CHARACTER.RESPONSE_NAME_RESERVED)); } else { client.sendPacket(new SM_NICKNAME_CHECK_RESPONSE(SM_CREATE_CHARACTER.RESPONSE_NAME_ALREADY_USED)); } } else if (!NameRestrictionService.isValidName(nick)) { client.sendPacket(new SM_NICKNAME_CHECK_RESPONSE(SM_CREATE_CHARACTER.RESPONSE_INVALID_NAME)); } else if (NameRestrictionService.isForbiddenWord(nick)) { client.sendPacket(new SM_CREATE_CHARACTER(null, SM_CREATE_CHARACTER.RESPONSE_FORBIDDEN_CHAR_NAME)); } else { client.sendPacket(new SM_NICKNAME_CHECK_RESPONSE(SM_CREATE_CHARACTER.RESPONSE_OK)); } } }
{ "pile_set_name": "Github" }
module Types class SubmissionType < Types::BaseObject connection_type_class Types::PupilfirstConnection field :id, ID, null: false field :created_at, GraphQL::Types::ISO8601DateTime, null: false field :evaluated_at, GraphQL::Types::ISO8601DateTime, null: true field :passed_at, GraphQL::Types::ISO8601DateTime, null: true field :evaluator_name, String, null: true field :feedback, [Types::SubmissionFeedbackType], null: false field :grades, [Types::GradeType], null: false field :files, [Types::SubmissionFileType], null: false field :checklist, GraphQL::Types::JSON, null: false field :title, String, null: false field :level_id, ID, null: false field :target_id, ID, null: false field :user_names, String, null: false field :feedback_sent, Boolean, null: false field :coach_ids, [String], null: false field :team_name, String, null: true def title object.target.title end def level_id object.target.target_group.level_id end def user_names object.founders.map do |founder| founder.user.name end.join(', ') end def feedback_sent object.startup_feedback.present? end def coach_ids team_ids = object.founders.map(&:startup_id).uniq FacultyStartupEnrollment.where(startup_id: team_ids).pluck(:faculty_id) end def evaluator_name object.evaluator&.name end def grades object.timeline_event_grades.map do |submission_grading| { evaluation_criterion_id: submission_grading.evaluation_criterion_id, grade: submission_grading.grade } end end def feedback object.startup_feedback end def files object.timeline_event_files.with_attached_file.map do |file| { id: file.id, title: file.file.filename, url: Rails.application.routes.url_helpers.download_timeline_event_file_path(file) } end end def students_have_same_team object.founders.distinct(:startup_id).pluck(:startup_id).one? end def team_name if object.team_submission? && students_have_same_team && object.timeline_event_owners.count > 1 object.founders.first.startup.name end end end end
{ "pile_set_name": "Github" }
module DropletKit class DatabaseUserMapping include Kartograph::DSL kartograph do mapping DatabaseUser root_key singular: 'user', plural: 'users', scopes: [:read] property :name, scopes: [:read] property :role, scopes: [:read, :create] property :password, scopes: [:read, :create] end end end
{ "pile_set_name": "Github" }
platform: linux image_resource: type: docker-image source: repository: pcfnorm/rootfs inputs: - name: pcf-pipelines params: PIPELINE_NAME: PIPELINE_PATH: PIPELINE_PARAMS: ATC_EXTERNAL_URL: ATC_BASIC_AUTH_USERNAME: ATC_BASIC_AUTH_PASSWORD: ATC_TEAM_NAME: run: path: pcf-pipelines/tasks/set-pipeline/task.sh
{ "pile_set_name": "Github" }
--- description: "Automatically generated file. DO NOT MODIFY" --- ```javascript const options = { authProvider, }; const client = Client.init(options); let res = await client.api('/teams/{teamId}/schedule') .version('beta') .get(); ```
{ "pile_set_name": "Github" }
#include "c.h" static Tree addtree(int, Tree, Tree); static Tree andtree(int, Tree, Tree); static Tree cmptree(int, Tree, Tree); static int compatible(Type, Type); static Tree multree(int, Tree, Tree); static Tree subtree(int, Tree, Tree); #define isvoidptr(ty) \ (isptr(ty) && unqual(ty->type) == voidtype) Tree (*optree[])(int, Tree, Tree) = { #define xx(a,b,c,d,e,f,g) e, #define yy(a,b,c,d,e,f,g) e, #include "token.h" }; Tree call(Tree f, Type fty, Coordinate src) { int n = 0; Tree args = NULL, r = NULL, e; Type *proto, rty = unqual(freturn(fty)); Symbol t3 = NULL; if (fty->u.f.oldstyle) proto = NULL; else proto = fty->u.f.proto; if (hascall(f)) r = f; if (isstruct(rty)) { t3 = temporary(AUTO, unqual(rty)); if (rty->size == 0) error("illegal use of incomplete type `%t'\n", rty); } if (t != ')') for (;;) { Tree q = pointer(expr1(0)); if (proto && *proto && *proto != voidtype) { Type aty; q = value(q); aty = assign(*proto, q); if (aty) q = cast(q, aty); else error("type error in argument %d to %s; found `%t' expected `%t'\n", n + 1, funcname(f), q->type, *proto); if ((isint(q->type) || isenum(q->type)) && q->type->size != inttype->size) q = cast(q, promote(q->type)); ++proto; } else { if (!fty->u.f.oldstyle && *proto == NULL) error("too many arguments to %s\n", funcname(f)); q = value(q); if (isarray(q->type) || q->type->size == 0) error("type error in argument %d to %s; `%t' is illegal\n", n + 1, funcname(f), q->type); else q = cast(q, promote(q->type)); } if (!IR->wants_argb && isstruct(q->type)) { if (iscallb(q)) q = addrof(q); else { Symbol t1 = temporary(AUTO, unqual(q->type)); q = asgn(t1, q); q = tree(RIGHT, ptr(t1->type), root(q), lvalue(idtree(t1))); } } if (q->type->size == 0) q->type = inttype; if (hascall(q)) r = r ? tree(RIGHT, voidtype, r, q) : q; args = tree(mkop(ARG, q->type), q->type, q, args); n++; if (Aflag >= 2 && n == 32) warning("more than 31 arguments in a call to %s\n", funcname(f)); if (t != ',') break; t = gettok(); } expect(')'); if (proto && *proto && *proto != voidtype) error("insufficient number of arguments to %s\n", funcname(f)); if (r) args = tree(RIGHT, voidtype, r, args); e = calltree(f, rty, args, t3); if (events.calls) apply(events.calls, &src, &e); return e; } Tree calltree(Tree f, Type ty, Tree args, Symbol t3) { Tree p; if (args) f = tree(RIGHT, f->type, args, f); if (isstruct(ty)) assert(t3), p = tree(RIGHT, ty, tree(CALL+B, ty, f, addrof(idtree(t3))), idtree(t3)); else { Type rty = ty; if (isenum(ty)) rty = unqual(ty)->type; if (!isfloat(rty)) rty = promote(rty); p = tree(mkop(CALL, rty), rty, f, NULL); if (isptr(ty) || p->type->size > ty->size) p = cast(p, ty); } return p; } Tree vcall(Symbol func, Type ty, ...) { va_list ap; Tree args = NULL, e, f = pointer(idtree(func)), r = NULL; assert(isfunc(func->type)); if (ty == NULL) ty = freturn(func->type); va_start(ap, ty); while ((e = va_arg(ap, Tree)) != NULL) { if (hascall(e)) r = r == NULL ? e : tree(RIGHT, voidtype, r, e); args = tree(mkop(ARG, e->type), e->type, e, args); } va_end(ap); if (r != NULL) args = tree(RIGHT, voidtype, r, args); return calltree(f, ty, args, NULL); } int iscallb(Tree e) { return e->op == RIGHT && e->kids[0] && e->kids[1] && e->kids[0]->op == CALL+B && e->kids[1]->op == INDIR+B && isaddrop(e->kids[1]->kids[0]->op) && e->kids[1]->kids[0]->u.sym->temporary; } static Tree addtree(int op, Tree l, Tree r) { Type ty = inttype; if (isarith(l->type) && isarith(r->type)) { ty = binary(l->type, r->type); l = cast(l, ty); r = cast(r, ty); } else if (isptr(l->type) && isint(r->type)) return addtree(ADD, r, l); else if ( isptr(r->type) && isint(l->type) && !isfunc(r->type->type)) { long n; ty = unqual(r->type); n = unqual(ty->type)->size; if (n == 0) error("unknown size for type `%t'\n", ty->type); l = cast(l, promote(l->type)); if (n > 1) l = multree(MUL, cnsttree(signedptr, n), l); if (YYcheck && !isaddrop(r->op)) /* omit */ return nullcall(ty, YYcheck, r, l); /* omit */ return simplify(ADD, ty, l, r); } else typeerror(op, l, r); return simplify(op, ty, l, r); } Tree cnsttree(Type ty, ...) { Tree p = tree(mkop(CNST,ty), ty, NULL, NULL); va_list ap; va_start(ap, ty); switch (ty->op) { case INT: p->u.v.i = va_arg(ap, long); break; case UNSIGNED:p->u.v.u = va_arg(ap, unsigned long)&ones(8*ty->size); break; case FLOAT: p->u.v.d = va_arg(ap, double); break; case POINTER: p->u.v.p = va_arg(ap, void *); break; default: assert(0); } va_end(ap); return p; } Tree consttree(unsigned n, Type ty) { if (isarray(ty)) ty = atop(ty); else assert(isint(ty)); return cnsttree(ty, (unsigned long)n); } static Tree cmptree(int op, Tree l, Tree r) { Type ty; if (isarith(l->type) && isarith(r->type)) { ty = binary(l->type, r->type); l = cast(l, ty); r = cast(r, ty); } else if (compatible(l->type, r->type)) { ty = unsignedptr; l = cast(l, ty); r = cast(r, ty); } else { ty = unsignedtype; typeerror(op, l, r); } return simplify(mkop(op,ty), inttype, l, r); } static int compatible(Type ty1, Type ty2) { return isptr(ty1) && !isfunc(ty1->type) && isptr(ty2) && !isfunc(ty2->type) && eqtype(unqual(ty1->type), unqual(ty2->type), 0); } int isnullptr(Tree e) { Type ty = unqual(e->type); return generic(e->op) == CNST && ((ty->op == INT && e->u.v.i == 0) || (ty->op == UNSIGNED && e->u.v.u == 0) || (isvoidptr(ty) && e->u.v.p == NULL)); } Tree eqtree(int op, Tree l, Tree r) { Type xty = l->type, yty = r->type; if ((isptr(xty) && isnullptr(r)) || (isptr(xty) && !isfunc(xty->type) && isvoidptr(yty)) || (isptr(xty) && isptr(yty) && eqtype(unqual(xty->type), unqual(yty->type), 1))) { Type ty = unsignedptr; l = cast(l, ty); r = cast(r, ty); return simplify(mkop(op,ty), inttype, l, r); } if ((isptr(yty) && isnullptr(l)) || (isptr(yty) && !isfunc(yty->type) && isvoidptr(xty))) return eqtree(op, r, l); return cmptree(op, l, r); } Type assign(Type xty, Tree e) { Type yty = unqual(e->type); xty = unqual(xty); if (isenum(xty)) xty = xty->type; if (xty->size == 0 || yty->size == 0) return NULL; if ( (isarith(xty) && isarith(yty)) || (isstruct(xty) && xty == yty)) return xty; if (isptr(xty) && isnullptr(e)) return xty; if (((isvoidptr(xty) && isptr(yty)) || (isptr(xty) && isvoidptr(yty))) && ( (isconst(xty->type) || !isconst(yty->type)) && (isvolatile(xty->type) || !isvolatile(yty->type)))) return xty; if ((isptr(xty) && isptr(yty) && eqtype(unqual(xty->type), unqual(yty->type), 1)) && ( (isconst(xty->type) || !isconst(yty->type)) && (isvolatile(xty->type) || !isvolatile(yty->type)))) return xty; if (isptr(xty) && isptr(yty) && ( (isconst(xty->type) || !isconst(yty->type)) && (isvolatile(xty->type) || !isvolatile(yty->type)))) { Type lty = unqual(xty->type), rty = unqual(yty->type); if ((isenum(lty) && rty == inttype) || (isenum(rty) && lty == inttype)) { if (Aflag >= 1) warning("assignment between `%t' and `%t' is compiler-dependent\n", xty, yty); return xty; } } return NULL; } Tree asgntree(int op, Tree l, Tree r) { Type aty, ty; r = pointer(r); ty = assign(l->type, r); if (ty) r = cast(r, ty); else { typeerror(ASGN, l, r); if (r->type == voidtype) r = retype(r, inttype); ty = r->type; } if (l->op != FIELD) l = lvalue(l); aty = l->type; if (isptr(aty)) aty = unqual(aty)->type; if ( isconst(aty) || (isstruct(aty) && unqual(aty)->u.sym->u.s.cfields)) { if (isaddrop(l->op) && !l->u.sym->computed && !l->u.sym->generated) error("assignment to const identifier `%s'\n", l->u.sym->name); else error("assignment to const location\n"); } if (l->op == FIELD) { long n = 8*l->u.field->type->size - fieldsize(l->u.field); if (n > 0 && isunsigned(l->u.field->type)) r = bittree(BAND, r, cnsttree(r->type, (unsigned long)fieldmask(l->u.field))); else if (n > 0) { if (r->op == CNST+I) { n = r->u.v.i; if (n&(1<<(fieldsize(l->u.field)-1))) n |= ~0UL<<fieldsize(l->u.field); r = cnsttree(r->type, n); } else r = shtree(RSH, shtree(LSH, r, cnsttree(inttype, n)), cnsttree(inttype, n)); } } if (isstruct(ty) && isaddrop(l->op) && iscallb(r)) return tree(RIGHT, ty, tree(CALL+B, ty, r->kids[0]->kids[0], l), idtree(l->u.sym)); return tree(mkop(op,ty), ty, l, r); } Tree condtree(Tree e, Tree l, Tree r) { Symbol t1; Type ty, xty = l->type, yty = r->type; Tree p; if (isarith(xty) && isarith(yty)) ty = binary(xty, yty); else if (eqtype(xty, yty, 1)) ty = unqual(xty); else if (isptr(xty) && isnullptr(r)) ty = xty; else if (isnullptr(l) && isptr(yty)) ty = yty; else if ((isptr(xty) && !isfunc(xty->type) && isvoidptr(yty)) || (isptr(yty) && !isfunc(yty->type) && isvoidptr(xty))) ty = voidptype; else if ((isptr(xty) && isptr(yty) && eqtype(unqual(xty->type), unqual(yty->type), 1))) ty = xty; else { typeerror(COND, l, r); return consttree(0, inttype); } if (isptr(ty)) { ty = unqual(unqual(ty)->type); if ((isptr(xty) && isconst(unqual(xty)->type)) || (isptr(yty) && isconst(unqual(yty)->type))) ty = qual(CONST, ty); if ((isptr(xty) && isvolatile(unqual(xty)->type)) || (isptr(yty) && isvolatile(unqual(yty)->type))) ty = qual(VOLATILE, ty); ty = ptr(ty); } switch (e->op) { case CNST+I: return cast(e->u.v.i != 0 ? l : r, ty); case CNST+U: return cast(e->u.v.u != 0 ? l : r, ty); case CNST+P: return cast(e->u.v.p != 0 ? l : r, ty); case CNST+F: return cast(e->u.v.d != 0.0 ? l : r, ty); } if (ty != voidtype && ty->size > 0) { t1 = genident(REGISTER, unqual(ty), level); /* t1 = temporary(REGISTER, unqual(ty)); */ l = asgn(t1, l); r = asgn(t1, r); } else t1 = NULL; p = tree(COND, ty, cond(e), tree(RIGHT, ty, root(l), root(r))); p->u.sym = t1; return p; } /* addrof - address of p */ Tree addrof(Tree p) { Tree q = p; for (;;) switch (generic(q->op)) { case RIGHT: assert(q->kids[0] || q->kids[1]); q = q->kids[1] ? q->kids[1] : q->kids[0]; continue; case ASGN: q = q->kids[1]; continue; case COND: { Symbol t1 = q->u.sym; q->u.sym = 0; q = idtree(t1); /* fall through */ } case INDIR: if (p == q) return q->kids[0]; q = q->kids[0]; return tree(RIGHT, q->type, root(p), q); default: error("addressable object required\n"); return value(p); } } /* andtree - construct tree for l [&& ||] r */ static Tree andtree(int op, Tree l, Tree r) { if (!isscalar(l->type) || !isscalar(r->type)) typeerror(op, l, r); return simplify(op, inttype, cond(l), cond(r)); } /* asgn - generate tree for assignment of expr e to symbol p sans qualifiers */ Tree asgn(Symbol p, Tree e) { if (isarray(p->type)) e = tree(ASGN+B, p->type, idtree(p), tree(INDIR+B, e->type, e, NULL)); else { Type ty = p->type; p->type = unqual(p->type); if (isstruct(p->type) && p->type->u.sym->u.s.cfields) { p->type->u.sym->u.s.cfields = 0; e = asgntree(ASGN, idtree(p), e); p->type->u.sym->u.s.cfields = 1; } else e = asgntree(ASGN, idtree(p), e); p->type = ty; } return e; } /* bittree - construct tree for l [& | ^ %] r */ Tree bittree(int op, Tree l, Tree r) { Type ty = inttype; if (isint(l->type) && isint(r->type)) { ty = binary(l->type, r->type); l = cast(l, ty); r = cast(r, ty); } else typeerror(op, l, r); return simplify(op, ty, l, r); } /* multree - construct tree for l [* /] r */ static Tree multree(int op, Tree l, Tree r) { Type ty = inttype; if (isarith(l->type) && isarith(r->type)) { ty = binary(l->type, r->type); l = cast(l, ty); r = cast(r, ty); } else typeerror(op, l, r); return simplify(op, ty, l, r); } /* shtree - construct tree for l [>> <<] r */ Tree shtree(int op, Tree l, Tree r) { Type ty = inttype; if (isint(l->type) && isint(r->type)) { ty = promote(l->type); l = cast(l, ty); r = cast(r, inttype); } else typeerror(op, l, r); return simplify(op, ty, l, r); } /* subtree - construct tree for l - r */ static Tree subtree(int op, Tree l, Tree r) { long n; Type ty = inttype; if (isarith(l->type) && isarith(r->type)) { ty = binary(l->type, r->type); l = cast(l, ty); r = cast(r, ty); } else if (isptr(l->type) && !isfunc(l->type->type) && isint(r->type)) { ty = unqual(l->type); n = unqual(ty->type)->size; if (n == 0) error("unknown size for type `%t'\n", ty->type); r = cast(r, promote(r->type)); if (n > 1) r = multree(MUL, cnsttree(signedptr, n), r); if (isunsigned(r->type)) r = cast(r, unsignedptr); else r = cast(r, signedptr); return simplify(SUB+P, ty, l, r); } else if (compatible(l->type, r->type)) { ty = unqual(l->type); n = unqual(ty->type)->size; if (n == 0) error("unknown size for type `%t'\n", ty->type); l = simplify(SUB+U, unsignedptr, cast(l, unsignedptr), cast(r, unsignedptr)); return simplify(DIV+I, longtype, cast(l, longtype), cnsttree(longtype, n)); } else typeerror(op, l, r); return simplify(op, ty, l, r); } /* typeerror - issue "operands of op have illegal types `l' and `r'" */ void typeerror(int op, Tree l, Tree r) { int i; static struct { int op; char *name; } ops[] = { {ASGN, "="}, {INDIR, "*"}, {NEG, "-"}, {ADD, "+"}, {SUB, "-"}, {LSH, "<<"}, {MOD, "%"}, {RSH, ">>"}, {BAND, "&"}, {BCOM, "~"}, {BOR, "|"}, {BXOR, "^"}, {DIV, "/"}, {MUL, "*"}, {EQ, "=="}, {GE, ">="}, {GT, ">"}, {LE, "<="}, {LT, "<"}, {NE, "!="}, {AND, "&&"}, {NOT, "!"}, {OR, "||"}, {COND, "?:"}, {0, 0} }; op = generic(op); for (i = 0; ops[i].op; i++) if (op == ops[i].op) break; assert(ops[i].name); if (r) error("operands of %s have illegal types `%t' and `%t'\n", ops[i].name, l->type, r->type); else error("operand of unary %s has illegal type `%t'\n", ops[i].name, l->type); }
{ "pile_set_name": "Github" }
define void @foo(i32 %x) { ret void }
{ "pile_set_name": "Github" }
0 7 document-start 0 1 doc 0 1 doc 0 0 1 14 #text 0 1 1 1 empty 1 0 1 14 #text 0 1 0 15 doc 0 0 0 7 document-end 0 1 doc
{ "pile_set_name": "Github" }
package(default_visibility = ["//visibility:public"]) load( "@io_bazel_rules_go//go:def.bzl", "go_library", ) go_library( name = "go_default_library", srcs = ["semantic.go"], importpath = "k8s.io/apimachinery/pkg/api/equality", deps = [ "//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/conversion:go_default_library", "//vendor/k8s.io/apimachinery/pkg/fields:go_default_library", "//vendor/k8s.io/apimachinery/pkg/labels:go_default_library", ], ) filegroup( name = "package-srcs", srcs = glob(["**"]), tags = ["automanaged"], visibility = ["//visibility:private"], ) filegroup( name = "all-srcs", srcs = [":package-srcs"], tags = ["automanaged"], )
{ "pile_set_name": "Github" }
[FORMAT "WCOFF"] [INSTRSET "i486p"] [BITS 32] [FILE "api010.nas"] GLOBAL _api_free [SECTION .text] _api_free: ; void api_free(char *addr, int size); PUSH EBX MOV EDX,10 MOV EBX,[CS:0x0020] MOV EAX,[ESP+ 8] ; addr MOV ECX,[ESP+12] ; size INT 0x40 POP EBX RET
{ "pile_set_name": "Github" }
<?php if(isset($_GET['file'])) dl_mod($_GET['file']); function dl_mod($mod) { if(strlen($mod) > 0 && file_exists("files/$mod") && strpos($mod, "/") === false) { increment_dl_counter($mod); header("Location: files/$mod"); //include 'dog.php'; } else echo("Hm, doesn't seem like that file exists :( <br><a href='./'>Back</a>"); } function increment_dl_counter($mod) { $path = "dls/$mod.txt"; $dls = get_dls($mod); $dls_int = intval($dls); ++$dls_int; file_put_contents($path, $dls_int); } function get_dls($mod) { $path = 'dls/'; $file = "$path$mod.txt"; if(file_exists($file)) return file_get_contents($file); if(!file_exists($path)) mkdir('dls/'); file_put_contents($file, '0'); return get_dls($mod); } ?>
{ "pile_set_name": "Github" }
/* Copyright 2003-2013 Joaquin M Lopez Munoz. * 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) * * See http://www.boost.org/libs/multi_index for library home page. */ #ifndef BOOST_MULTI_INDEX_DETAIL_ITER_ADAPTOR_HPP #define BOOST_MULTI_INDEX_DETAIL_ITER_ADAPTOR_HPP #if defined(_MSC_VER) #pragma once #endif #include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */ #include <boost/mpl/apply.hpp> #include <boost/operators.hpp> namespace boost{ namespace multi_index{ namespace detail{ /* Poor man's version of boost::iterator_adaptor. Used instead of the * original as compile times for the latter are significantly higher. * The interface is not replicated exactly, only to the extent necessary * for internal consumption. */ /* NB. The purpose of the (non-inclass) global operators ==, < and - defined * above is to partially alleviate a problem of MSVC++ 6.0 by * which * friend-injected operators on T are not visible if T is instantiated only * in template code where T is a dependent type. */ class iter_adaptor_access { public: template<class Class> static typename Class::reference dereference(const Class& x) { return x.dereference(); } template<class Class> static bool equal(const Class& x,const Class& y) { return x.equal(y); } template<class Class> static void increment(Class& x) { x.increment(); } template<class Class> static void decrement(Class& x) { x.decrement(); } template<class Class> static void advance(Class& x,typename Class::difference_type n) { x.advance(n); } template<class Class> static typename Class::difference_type distance_to( const Class& x,const Class& y) { return x.distance_to(y); } }; template<typename Category> struct iter_adaptor_selector; template<class Derived,class Base> class forward_iter_adaptor_base: public forward_iterator_helper< Derived, typename Base::value_type, typename Base::difference_type, typename Base::pointer, typename Base::reference> { public: typedef typename Base::reference reference; reference operator*()const { return iter_adaptor_access::dereference(final()); } friend bool operator==(const Derived& x,const Derived& y) { return iter_adaptor_access::equal(x,y); } Derived& operator++() { iter_adaptor_access::increment(final()); return final(); } private: Derived& final(){return *static_cast<Derived*>(this);} const Derived& final()const{return *static_cast<const Derived*>(this);} }; template<class Derived,class Base> bool operator==( const forward_iter_adaptor_base<Derived,Base>& x, const forward_iter_adaptor_base<Derived,Base>& y) { return iter_adaptor_access::equal( static_cast<const Derived&>(x),static_cast<const Derived&>(y)); } template<> struct iter_adaptor_selector<std::forward_iterator_tag> { template<class Derived,class Base> struct apply { typedef forward_iter_adaptor_base<Derived,Base> type; }; }; template<class Derived,class Base> class bidirectional_iter_adaptor_base: public bidirectional_iterator_helper< Derived, typename Base::value_type, typename Base::difference_type, typename Base::pointer, typename Base::reference> { public: typedef typename Base::reference reference; reference operator*()const { return iter_adaptor_access::dereference(final()); } friend bool operator==(const Derived& x,const Derived& y) { return iter_adaptor_access::equal(x,y); } Derived& operator++() { iter_adaptor_access::increment(final()); return final(); } Derived& operator--() { iter_adaptor_access::decrement(final()); return final(); } private: Derived& final(){return *static_cast<Derived*>(this);} const Derived& final()const{return *static_cast<const Derived*>(this);} }; template<class Derived,class Base> bool operator==( const bidirectional_iter_adaptor_base<Derived,Base>& x, const bidirectional_iter_adaptor_base<Derived,Base>& y) { return iter_adaptor_access::equal( static_cast<const Derived&>(x),static_cast<const Derived&>(y)); } template<> struct iter_adaptor_selector<std::bidirectional_iterator_tag> { template<class Derived,class Base> struct apply { typedef bidirectional_iter_adaptor_base<Derived,Base> type; }; }; template<class Derived,class Base> class random_access_iter_adaptor_base: public random_access_iterator_helper< Derived, typename Base::value_type, typename Base::difference_type, typename Base::pointer, typename Base::reference> { public: typedef typename Base::reference reference; typedef typename Base::difference_type difference_type; reference operator*()const { return iter_adaptor_access::dereference(final()); } friend bool operator==(const Derived& x,const Derived& y) { return iter_adaptor_access::equal(x,y); } friend bool operator<(const Derived& x,const Derived& y) { return iter_adaptor_access::distance_to(x,y)>0; } Derived& operator++() { iter_adaptor_access::increment(final()); return final(); } Derived& operator--() { iter_adaptor_access::decrement(final()); return final(); } Derived& operator+=(difference_type n) { iter_adaptor_access::advance(final(),n); return final(); } Derived& operator-=(difference_type n) { iter_adaptor_access::advance(final(),-n); return final(); } friend difference_type operator-(const Derived& x,const Derived& y) { return iter_adaptor_access::distance_to(y,x); } private: Derived& final(){return *static_cast<Derived*>(this);} const Derived& final()const{return *static_cast<const Derived*>(this);} }; template<class Derived,class Base> bool operator==( const random_access_iter_adaptor_base<Derived,Base>& x, const random_access_iter_adaptor_base<Derived,Base>& y) { return iter_adaptor_access::equal( static_cast<const Derived&>(x),static_cast<const Derived&>(y)); } template<class Derived,class Base> bool operator<( const random_access_iter_adaptor_base<Derived,Base>& x, const random_access_iter_adaptor_base<Derived,Base>& y) { return iter_adaptor_access::distance_to( static_cast<const Derived&>(x),static_cast<const Derived&>(y))>0; } template<class Derived,class Base> typename random_access_iter_adaptor_base<Derived,Base>::difference_type operator-( const random_access_iter_adaptor_base<Derived,Base>& x, const random_access_iter_adaptor_base<Derived,Base>& y) { return iter_adaptor_access::distance_to( static_cast<const Derived&>(y),static_cast<const Derived&>(x)); } template<> struct iter_adaptor_selector<std::random_access_iterator_tag> { template<class Derived,class Base> struct apply { typedef random_access_iter_adaptor_base<Derived,Base> type; }; }; template<class Derived,class Base> struct iter_adaptor_base { typedef iter_adaptor_selector< typename Base::iterator_category> selector; typedef typename mpl::apply2< selector,Derived,Base>::type type; }; template<class Derived,class Base> class iter_adaptor:public iter_adaptor_base<Derived,Base>::type { protected: iter_adaptor(){} explicit iter_adaptor(const Base& b_):b(b_){} const Base& base_reference()const{return b;} Base& base_reference(){return b;} private: Base b; }; } /* namespace multi_index::detail */ } /* namespace multi_index */ } /* namespace boost */ #endif
{ "pile_set_name": "Github" }
/* crypto/hmac/hmactest.c */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * * This package is an SSL implementation written * by Eric Young (eay@cryptsoft.com). * The implementation was written so as to conform with Netscapes SSL. * * This library is free for commercial and non-commercial use as long as * the following conditions are aheared to. The following conditions * apply to all code found in this distribution, be it the RC4, RSA, * lhash, DES, etc., code; not just the SSL code. The SSL documentation * included with this distribution is covered by the same copyright terms * except that the holder is Tim Hudson (tjh@cryptsoft.com). * * Copyright remains Eric Young's, and as such any Copyright notices in * the code are not to be removed. * If this package is used in a product, Eric Young should be given attribution * as the author of the parts of the library used. * This can be in the form of a textual message at program startup or * in documentation (online or textual) provided with the package. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * "This product includes cryptographic software written by * Eric Young (eay@cryptsoft.com)" * The word 'cryptographic' can be left out if the rouines from the library * being used are not cryptographic related :-). * 4. If you include any Windows specific code (or a derivative thereof) from * the apps directory (application code) you must include an acknowledgement: * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" * * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * The licence and distribution terms for any publically available version or * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence * [including the GNU Public Licence.] */ #include <stdio.h> #include <string.h> #include <stdlib.h> #include "../e_os.h" #ifdef OPENSSL_NO_HMAC int main(int argc, char *argv[]) { printf("No HMAC support\n"); return(0); } #else #include <openssl/hmac.h> #ifndef OPENSSL_NO_MD5 #include <openssl/md5.h> #endif #ifdef CHARSET_EBCDIC #include <openssl/ebcdic.h> #endif #ifndef OPENSSL_NO_MD5 static struct test_st { unsigned char key[16]; int key_len; unsigned char data[64]; int data_len; unsigned char *digest; } test[4]={ { "", 0, "More text test vectors to stuff up EBCDIC machines :-)", 54, (unsigned char *)"e9139d1e6ee064ef8cf514fc7dc83e86", },{ {0x0b,0x0b,0x0b,0x0b,0x0b,0x0b,0x0b,0x0b, 0x0b,0x0b,0x0b,0x0b,0x0b,0x0b,0x0b,0x0b,}, 16, "Hi There", 8, (unsigned char *)"9294727a3638bb1c13f48ef8158bfc9d", },{ "Jefe", 4, "what do ya want for nothing?", 28, (unsigned char *)"750c783e6ab0b503eaa86e310a5db738", },{ {0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa, 0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,}, 16, {0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd, 0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd, 0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd, 0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd, 0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd, 0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd, 0xdd,0xdd}, 50, (unsigned char *)"56be34521d144c88dbb8c733f0e8b3f6", }, }; #endif static char *pt(unsigned char *md); int main(int argc, char *argv[]) { #ifndef OPENSSL_NO_MD5 int i; char *p; #endif int err=0; #ifdef OPENSSL_NO_MD5 printf("test skipped: MD5 disabled\n"); #else #ifdef CHARSET_EBCDIC ebcdic2ascii(test[0].data, test[0].data, test[0].data_len); ebcdic2ascii(test[1].data, test[1].data, test[1].data_len); ebcdic2ascii(test[2].key, test[2].key, test[2].key_len); ebcdic2ascii(test[2].data, test[2].data, test[2].data_len); #endif for (i=0; i<4; i++) { p=pt(HMAC(EVP_md5(), test[i].key, test[i].key_len, test[i].data, test[i].data_len, NULL,NULL)); if (strcmp(p,(char *)test[i].digest) != 0) { printf("error calculating HMAC on %d entry'\n",i); printf("got %s instead of %s\n",p,test[i].digest); err++; } else printf("test %d ok\n",i); } #endif /* OPENSSL_NO_MD5 */ EXIT(err); return(0); } #ifndef OPENSSL_NO_MD5 static char *pt(unsigned char *md) { int i; static char buf[80]; for (i=0; i<MD5_DIGEST_LENGTH; i++) sprintf(&(buf[i*2]),"%02x",md[i]); return(buf); } #endif #endif
{ "pile_set_name": "Github" }
// *********************************************************************** // Assembly : XLabs.Core // Author : XLabs Team // Created : 12-27-2015 // // Last Modified By : XLabs Team // Last Modified On : 01-04-2016 // *********************************************************************** // <copyright file="InvalidNestingException.cs" company="XLabs Team"> // Copyright (c) XLabs Team. All rights reserved. // </copyright> // <summary> // This project is licensed under the Apache 2.0 license // https://github.com/XLabs/Xamarin-Forms-Labs/blob/master/LICENSE // // XLabs is a open source project that aims to provide a powerfull and cross // platform set of controls tailored to work with Xamarin Forms. // </summary> // *********************************************************************** // using System; using System.Collections.Generic; using System.Linq; namespace XLabs.Exceptions { /// <summary> /// Thrown when an element or attached property is not withing the /// proper container /// </summary> public class InvalidNestingException : Exception { /// <summary> /// Hide any possible default constructor /// Redundant I know, but it costs nothing /// and communicates the design intent to /// other developers. /// </summary> private InvalidNestingException() { } /// <summary> /// Constructs the exception and passes a meaningful /// message to the base Exception /// </summary> /// <param name="nestedType">The inner type</param> /// <param name="expectedContainer">The container type that was expected</param> /// <param name="history">All parents considered in the search</param> public InvalidNestingException(Type nestedType, Type expectedContainer, List<string> history) : base(string.Format("{0} must be contained within a {1} (or a subclass).\nSearch History:{2}",nestedType.Name,expectedContainer.Name,history.Aggregate((s1, s2) => s1 + "," + s2))) { NestedType = nestedType; ExpectedContainer = expectedContainer; NestedName = nestedType.Name; ExpectedContainerName = expectedContainer.Name; SearchPath = history; } /// <summary> /// All parents considered in the search /// </summary> public IEnumerable<string> SearchPath { get; set; } /// <summary> /// The actual type of inner object /// </summary> public Type NestedType { get; set; } /// <summary> /// The expected type of the container /// </summary> public Type ExpectedContainer { get; set; } /// <summary> /// The name of the inner object /// </summary> public string NestedName { get; set; } /// <summary> /// The name of the expected container /// </summary> public string ExpectedContainerName { get; set; } } }
{ "pile_set_name": "Github" }
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace Aspose.Cells.GridWeb.Examples.CSharp.Miscellaneous.Format { public partial class ApplyDateTimeFormats { /// <summary> /// Button1 control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::System.Web.UI.WebControls.Button Button1; /// <summary> /// DropDownList1 control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::System.Web.UI.WebControls.DropDownList DropDownList1; /// <summary> /// TextBox1 control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::System.Web.UI.WebControls.TextBox TextBox1; /// <summary> /// Button2 control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::System.Web.UI.WebControls.Button Button2; /// <summary> /// GridWeb1 control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::Aspose.Cells.GridWeb.GridWeb GridWeb1; } }
{ "pile_set_name": "Github" }
/* Copyright 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. */ // Code generated by lister-gen. DO NOT EDIT. package v1beta1 import ( v1beta1 "k8s.io/api/storage/v1beta1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" ) // CSINodeLister helps list CSINodes. type CSINodeLister interface { // List lists all CSINodes in the indexer. List(selector labels.Selector) (ret []*v1beta1.CSINode, err error) // Get retrieves the CSINode from the index for a given name. Get(name string) (*v1beta1.CSINode, error) CSINodeListerExpansion } // cSINodeLister implements the CSINodeLister interface. type cSINodeLister struct { indexer cache.Indexer } // NewCSINodeLister returns a new CSINodeLister. func NewCSINodeLister(indexer cache.Indexer) CSINodeLister { return &cSINodeLister{indexer: indexer} } // List lists all CSINodes in the indexer. func (s *cSINodeLister) List(selector labels.Selector) (ret []*v1beta1.CSINode, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { ret = append(ret, m.(*v1beta1.CSINode)) }) return ret, err } // Get retrieves the CSINode from the index for a given name. func (s *cSINodeLister) Get(name string) (*v1beta1.CSINode, error) { obj, exists, err := s.indexer.GetByKey(name) if err != nil { return nil, err } if !exists { return nil, errors.NewNotFound(v1beta1.Resource("csinode"), name) } return obj.(*v1beta1.CSINode), nil }
{ "pile_set_name": "Github" }
within Buildings.Fluid.HeatExchangers.DXCoils.AirCooled.Data; package DoubleSpeed "Performance data for DoubleSpeed DXCoils" extends Modelica.Icons.MaterialPropertiesPackage; annotation(preferredView="info", Documentation(info="<html> <p> Package with performance data for air-cooled DX coils. </p> </html>", revisions="<html> <p> Generated on 04/25/2016 13:21 by thierry </p> </html>")); end DoubleSpeed;
{ "pile_set_name": "Github" }