text
stringlengths 2
100k
| meta
dict |
---|---|
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
* @package CodeIgniter
* @author ExpressionEngine Dev Team
* @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
* @license http://codeigniter.com/user_guide/license.html
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
*/
// ------------------------------------------------------------------------
/**
* Pagination Class
*
* @package CodeIgniter
* @subpackage Libraries
* @category Pagination
* @author ExpressionEngine Dev Team
* @link http://codeigniter.com/user_guide/libraries/pagination.html
*/
class CI_Pagination {
var $base_url = ''; // The page we are linking to
var $prefix = ''; // A custom prefix added to the path.
var $suffix = ''; // A custom suffix added to the path.
var $total_rows = 0; // Total number of items (database results)
var $per_page = 10; // Max number of items you want shown per page
var $num_links = 2; // Number of "digit" links to show before/after the currently viewed page
var $cur_page = 0; // The current page being viewed
var $first_link = '‹ First';
var $next_link = '>';
var $prev_link = '<';
var $last_link = 'Last ›';
var $uri_segment = 3;
var $full_tag_open = '';
var $full_tag_close = '';
var $first_tag_open = '';
var $first_tag_close = ' ';
var $last_tag_open = ' ';
var $last_tag_close = '';
var $first_url = ''; // Alternative URL for the First Page.
var $cur_tag_open = ' <strong>';
var $cur_tag_close = '</strong>';
var $next_tag_open = ' ';
var $next_tag_close = ' ';
var $prev_tag_open = ' ';
var $prev_tag_close = '';
var $num_tag_open = ' ';
var $num_tag_close = '';
var $page_query_string = FALSE;
var $query_string_segment = 'per_page';
var $display_pages = TRUE;
var $anchor_class = '';
/**
* Constructor
*
* @access public
* @param array initialization parameters
*/
public function __construct($params = array())
{
if (count($params) > 0)
{
$this->initialize($params);
}
if ($this->anchor_class != '')
{
$this->anchor_class = 'class="'.$this->anchor_class.'" ';
}
log_message('debug', "Pagination Class Initialized");
}
// --------------------------------------------------------------------
/**
* Initialize Preferences
*
* @access public
* @param array initialization parameters
* @return void
*/
function initialize($params = array())
{
if (count($params) > 0)
{
foreach ($params as $key => $val)
{
if (isset($this->$key))
{
$this->$key = $val;
}
}
}
}
// --------------------------------------------------------------------
/**
* Generate the pagination links
*
* @access public
* @return string
*/
function create_links()
{
// If our item count or per-page total is zero there is no need to continue.
if ($this->total_rows == 0 OR $this->per_page == 0)
{
return '';
}
// Calculate the total number of pages
$num_pages = ceil($this->total_rows / $this->per_page);
// Is there only one page? Hm... nothing more to do here then.
if ($num_pages == 1)
{
return '';
}
// Determine the current page number.
$CI =& get_instance();
if ($CI->config->item('enable_query_strings') === TRUE OR $this->page_query_string === TRUE)
{
if ($CI->input->get($this->query_string_segment) != 0)
{
$this->cur_page = $CI->input->get($this->query_string_segment);
// Prep the current page - no funny business!
$this->cur_page = (int) $this->cur_page;
}
}
else
{
if ($CI->uri->segment($this->uri_segment) != 0)
{
$this->cur_page = $CI->uri->segment($this->uri_segment);
// Prep the current page - no funny business!
$this->cur_page = (int) $this->cur_page;
}
}
$this->num_links = (int)$this->num_links;
if ($this->num_links < 1)
{
show_error('Your number of links must be a positive number.');
}
if ( ! is_numeric($this->cur_page))
{
$this->cur_page = 0;
}
// Is the page number beyond the result range?
// If so we show the last page
if ($this->cur_page > $this->total_rows)
{
$this->cur_page = ($num_pages - 1) * $this->per_page;
}
$uri_page_number = $this->cur_page;
$this->cur_page = floor(($this->cur_page/$this->per_page) + 1);
// Calculate the start and end numbers. These determine
// which number to start and end the digit links with
$start = (($this->cur_page - $this->num_links) > 0) ? $this->cur_page - ($this->num_links - 1) : 1;
$end = (($this->cur_page + $this->num_links) < $num_pages) ? $this->cur_page + $this->num_links : $num_pages;
// Is pagination being used over GET or POST? If get, add a per_page query
// string. If post, add a trailing slash to the base URL if needed
if ($CI->config->item('enable_query_strings') === TRUE OR $this->page_query_string === TRUE)
{
$this->base_url = rtrim($this->base_url).'&'.$this->query_string_segment.'=';
}
else
{
$this->base_url = rtrim($this->base_url, '/') .'/';
}
// And here we go...
$output = '';
// Render the "First" link
if ($this->first_link !== FALSE AND $this->cur_page > ($this->num_links + 1))
{
$first_url = ($this->first_url == '') ? $this->base_url : $this->first_url;
$output .= $this->first_tag_open.'<a '.$this->anchor_class.'href="'.$first_url.'">'.$this->first_link.'</a>'.$this->first_tag_close;
}
// Render the "previous" link
if ($this->prev_link !== FALSE AND $this->cur_page != 1)
{
$i = $uri_page_number - $this->per_page;
if ($i == 0 && $this->first_url != '')
{
$output .= $this->prev_tag_open.'<a '.$this->anchor_class.'href="'.$this->first_url.'">'.$this->prev_link.'</a>'.$this->prev_tag_close;
}
else
{
$i = ($i == 0) ? '' : $this->prefix.$i.$this->suffix;
$output .= $this->prev_tag_open.'<a '.$this->anchor_class.'href="'.$this->base_url.$i.'">'.$this->prev_link.'</a>'.$this->prev_tag_close;
}
}
// Render the pages
if ($this->display_pages !== FALSE)
{
// Write the digit links
for ($loop = $start -1; $loop <= $end; $loop++)
{
$i = ($loop * $this->per_page) - $this->per_page;
if ($i >= 0)
{
if ($this->cur_page == $loop)
{
$output .= $this->cur_tag_open.$loop.$this->cur_tag_close; // Current page
}
else
{
$n = ($i == 0) ? '' : $i;
if ($n == '' && $this->first_url != '')
{
$output .= $this->num_tag_open.'<a '.$this->anchor_class.'href="'.$this->first_url.'">'.$loop.'</a>'.$this->num_tag_close;
}
else
{
$n = ($n == '') ? '' : $this->prefix.$n.$this->suffix;
$output .= $this->num_tag_open.'<a '.$this->anchor_class.'href="'.$this->base_url.$n.'">'.$loop.'</a>'.$this->num_tag_close;
}
}
}
}
}
// Render the "next" link
if ($this->next_link !== FALSE AND $this->cur_page < $num_pages)
{
$output .= $this->next_tag_open.'<a '.$this->anchor_class.'href="'.$this->base_url.$this->prefix.($this->cur_page * $this->per_page).$this->suffix.'">'.$this->next_link.'</a>'.$this->next_tag_close;
}
// Render the "Last" link
if ($this->last_link !== FALSE AND ($this->cur_page + $this->num_links) < $num_pages)
{
$i = (($num_pages * $this->per_page) - $this->per_page);
$output .= $this->last_tag_open.'<a '.$this->anchor_class.'href="'.$this->base_url.$this->prefix.$i.$this->suffix.'">'.$this->last_link.'</a>'.$this->last_tag_close;
}
// Kill double slashes. Note: Sometimes we can end up with a double slash
// in the penultimate link so we'll kill all double slashes.
$output = preg_replace("#([^:])//+#", "\\1/", $output);
// Add the wrapper HTML if exists
$output = $this->full_tag_open.$output.$this->full_tag_close;
return $output;
}
}
// END Pagination Class
/* End of file Pagination.php */
/* Location: ./system/libraries/Pagination.php */ | {
"pile_set_name": "Github"
} |
module.exports = {
'#{number} by {user} was closed {time} ago':
'{user} 在 {time}前關閉了 #{number}。',
'#{number} opened {time} ago by {user}':
'{user} 在 {time}前新增了 #{number}。',
ACTIONS: '操作',
'ANALYTICS INFORMATION': '分析資料',
ASSIGNEES: '被指派者',
'Add a comment...': '新增評論...',
All: '查看全部',
'App is up to date': 'App 已經是最新版本',
'Apply Label': '套用標籤',
'Apply a label to this issue': '新增標籤至此議題',
'Are you sure?': '您確定嗎?',
'Assign Yourself': '指派給自己',
Assignees: '被指派者',
'Author: ': '',
BIO: '簡介',
CANCEL: '取消',
CONTACT: '聯絡方式',
CONTRIBUTORS: '貢獻者',
"Can't login?": '',
"Can't see all your organizations?": '看不到你所屬的所有組織?',
Cancel: '取消',
'Change Merge Type': '改變合併類型',
'Check for update': '檢查更新',
'Check out {repoName} on GitHub. {repoUrl}':
'快來看看 GitHub上 的 {repoName} {repoUrl}',
'Checking for update...': '檢查更新中...',
'Close {issueType}': '關閉 {issueType}',
Closed: '已關閉',
Code: '程式碼',
'Comment Actions': '評論操作',
'Commit Message': '提交說明',
'Commit Title': '提交標題',
Commits: '',
'Committer: ': '',
'Communicate on conversations, merge pull requests and more':
'參與議題討論、合併請求',
Company: '公司',
'Connecting to GitHub...': '連線至 GitHub...',
'Control notifications': '通知設定',
'Create a merge commit': '建立合併提交',
DELETED: '移除',
DESCRIPTION: '簡介',
Delete: '刪除',
Diff: '差異',
'Easily obtain repository, user and organization information':
'便捷地獲得版本庫、使用者與組織的資訊',
Edit: '編輯',
'Edit Comment': '編輯評論',
Email: 'Email',
'File renamed without any changes': '相同檔案更名',
Follow: '關注',
Followers: '追蹤者',
Following: '關注',
'Follows you': '已關注您',
Fork: 'Fork',
Forks: '分支',
'GitPoint is open source and the history of contributions to the platform will always be visible to the public.':
'GitPoint 是開源軟體,所有對本軟體的歷史貢獻資訊都會一直向外界公開。',
'GitPoint repository': 'GitPoint 的 repository',
INFO: '資訊',
ISSUES: '議題',
"If we happen to include another third party platform to collect stack traces, error logs or more analytics information, we'll make sure that user data remains anonymized and encrypted.":
'如果我們使用第三方平台來蒐集堆棧跟蹤訊息(stack traces)、錯誤紀錄(error logs)或更多的分析資訊,我們將保證使用者的資訊均為匿名且加密的。',
'If you have any questions about this Privacy Policy or GitPoint in general, please file an issue in the':
'如果您對本條款或 GitPoint 有任何問題,請將問題發送至',
Issue: '議題',
'Issue Actions': '議題操作',
'Issue Comment': '議題評論',
'Issue Title': '議題標題',
'Issue is locked': '議題已鎖定',
Issues: '議題',
'Issues and Pull Requests': '議題 與 合併請求',
LABELS: '標籤',
Language: '語言',
'Last updated: July 15, 2017': '最後更新:2017年7月15日',
Location: '地點',
'Lock {issueType}': '鎖定 {issueType}',
'Locked, but you can still comment...': '已鎖定,但您可以繼續評論...',
MEMBERS: '成員',
'Make a donation': '贊助我們',
'Mark all as read': '全部標記為已讀',
'Merge Pull Request': '接受合併請求',
'Merge Type': '合併類型',
Merged: '已合併',
NEW: '新增',
'New Issue': '新增議題',
'No README.md found': '找不到 README.md',
'No closed issues found!': '沒有已關閉的議題!',
'No closed pull requests found!': '',
'No commit found!': '',
'No contributors found': '沒有貢獻者',
'No description provided.': '沒有提供描述',
'No issues': '沒有議題',
'No members found': '',
'No open issues': '沒有未解決的議題',
'No open issues found!': '沒有待解決的議題!',
'No open pull requests': '沒有未處理的合併請求',
'No open pull requests found!': '沒有未處理的合併請求!',
'No organizations': '沒有組織',
'No pull requests': '沒有合併請求',
'No repositories found :(': '未找到符合條件的版本庫 :(',
'No users found :(': '未找到符合條件的使用者 :(',
'None yet': '尚無',
'Not applicable in debug mode': '無法在除錯模式中使用',
OK: 'OK',
'OPEN SOURCE': '開源',
ORGANIZATIONS: '組織',
OWNER: '擁有者',
'One of the most feature-rich GitHub clients that is 100% free':
'完全免費,功能最強大的 GitHub 應用程式!',
'Oops! it seems that you are not connected to the internet!': '',
Open: '未處理',
'Open in Browser': '在瀏覽器中打開',
Options: '設定',
'Organization Actions': '組織操作',
'PULL REQUESTS': '合併請求',
Participating: '查看參與中',
'Preparing GitPoint...': 'GitPoint 準備中...',
'Privacy Policy': '隱私條款',
'Pull Request': '合併請求',
'Pull Requests': '合併請求',
README: 'README',
'README Actions': 'README 操作',
'Reopen {issueType}': '重新開啟 {issueType}',
Repositories: '版本庫',
'Repositories and Users': '版本庫與使用者',
'Repository Actions': '版本庫操作',
'Repository is not found': '',
'Retrieving notifications': '正在取得通知',
'SIGN IN': '登入',
SOURCE: '來源',
'Search for any {type}': '搜尋任意 {type}',
'Searching for {query}': '正在搜尋 {query}',
Settings: '設定',
Share: '分享',
'Share {repoName}': '分享 {repoName}',
'Sign Out': '登出',
'Squash and merge': '整併與合併',
Star: '加星',
Starred: '已加星',
Stars: 'Stars',
Submit: '送出',
TOPICS: 'TOPICS',
'Thank you for reading our Privacy Policy. We hope you enjoy using GitPoint as much as we enjoyed building it.':
'感謝閱讀我們的隱私條款。我們希望您能如同我們享受開發 GitPoint 的過程般,也很享受地使用它!',
"This means that in no way, shape or form do we ever view, use or share a user's GitHub data. If private data ever becomes visible at any point we will not record or view it. If it happens to be accidentally recorded, we will delete it immediately using secure erase methods. Again, we've set up authentication specifically so that this never happens.":
'這代表我們不可能查看、使用,與分享使用者的 GitHub 資料。即使私人資料變為可見,我們也不會查看或儲存它。如果它意外地被儲存下來,我們將立即使用安全的清除方式刪除它。再次重申,我們已經特別地建立了授權機制,以保證此類情事不會發生。',
'USER DATA': '使用者資料',
Unfollow: '取消關注',
Unknown: '',
'Unlock {issueType}': '解鎖 {issueType}',
Unread: '查看未讀',
Unstar: '取消加星',
Unwatch: '取消關注',
'Update is available!': '有新版本!',
'User Actions': '使用者操作',
Users: '使用者',
'View All': '查看全部',
'View Code': '查看程式碼',
'View Commits': '',
'View and control all of your unread and participating notifications':
'檢視並設定所有未讀與參與的通知',
Watch: '關注',
Watchers: '關注者',
Watching: '關注中',
'We currently use Google Analytics and iTunes App Analytics to help us measure traffic and usage trends for the GitPoint. These tools collect information sent by your device including device and platform version, region and referrer. This information cannot reasonably be used to identify any particular individual user and no personal information is extracted.':
'目前我們使用 Google Analytics 和 iTunes App Analytics 來幫助我們分析 GitPoint 的流量和使用趨勢。這些工具從您的裝置上蒐集包含裝置、系統版本、地區、來源等資訊。這些資訊並無法被用來識別任一特定使用者或取得任何個人資訊。',
"We do not do anything with your GitHub information. After authenticating, the user's OAuth token is persisted directly on their device storage. It is not possible for us to retrieve that information. We never view a user's access token nor store it whatsoever.":
'我們不會把您的 GitHub 資訊用於任何用途。授權登入後,使用者的 OAuth token 只會被保留在使用者裝置的儲存空間中。我們無法取得此類資訊。我們不會查看或儲存使用者的 access token。',
"We're glad you decided to use GitPoint. This Privacy Policy is here to inform you about what we do — and do not do — with our user's data.":
'我們很高興您選擇使用 GitPoint。您可以在本隱私條款中查閱我們使用哪些與不使用哪些使用者資料。',
Website: '網站',
'Welcome to GitPoint': '歡迎使用 GitPoint',
'With each contribution to the app, code review is always performed to prevent anybody from including malicious code of any kind.':
'每個向本 App 送交的程式碼貢獻都會經過我們的審查,以防止任何人注入任何形式的惡意程式碼。',
'Write a comment for your issue here': '在此填入您對議題的評論',
'Write a message for your commit here': '在此填入您提交的說明',
'Write a title for your commit here': '載此填入您提交的標題',
'Write a title for your issue here': '在此填入議題的標題',
Yes: '是',
"You don't have any notifications of this type": '您沒有這個類型的通知',
'You may have to request approval for them.': '你可能需要請求許可',
'You need to have a commit title!': '請提供一個提交的標題',
'You need to have an issue title!': '請提供一個標題',
_thousandsAbbreviation: '千',
'forked from': '分岔自',
merge: '合併',
repository: '版本庫',
squash: '整併',
user: '使用者',
'{aboutXHours}h': '{aboutXHours}时',
'{aboutXMonths}mo': '{aboutXMonths}月',
'{aboutXYears}y': '{aboutXYears}年',
'{actor} added {member} at {repo}': '{actor} 新增了 {member} 在 {repo}',
'{actor} closed issue {issue} at {repo}':
'{actor} 關閉了議題 {issue} 在 {repo}',
'{actor} closed pull request {pr} at {repo}':
'{actor} 關閉了合併請求 {pr} 在 {repo}',
'{actor} commented on commit': '{actor} 在 commit 上評論',
'{actor} commented on issue {issue} at {repo}':
'{actor} 在議題留下了評論 {issue} 在 {repo}',
'{actor} commented on pull request {issue} at {repo}':
'{actor} 在合併請求留下了評論 {issue} 在 {repo}',
'{actor} commented on pull request {pr} at {repo}': '',
'{actor} created branch {ref} at {repo}':
'{actor} 建立了分支 {ref} 在 {repo}',
'{actor} created repository {repo}': '{actor} 建立了版本庫 {repo}',
'{actor} created tag {ref} at {repo}': '{actor} 建立了tag {ref} 在 {repo}',
'{actor} created the {repo} wiki': '',
'{actor} deleted branch {ref} at {repo}':
'{actor} 刪除了分支 {ref} 在 {repo}',
'{actor} deleted tag {ref} at {repo}': '{actor} 刪除了tag {ref} 在 {repo}',
'{actor} edited the {repo} wiki': '',
'{actor} edited {member} at {repo}': '{actor} 編輯了 {member} 在 {repo}',
'{actor} forked {repo} at {fork}': '{actor} fork 了 {repo} 在 {fork}',
'{actor} made {repo} public': '{actor} 使得 {repo} 公開',
'{actor} merged pull request {pr} at {repo}': '',
'{actor} opened issue {issue} at {repo}':
'{actor} 打開了議題 {issue} 在 {repo}',
'{actor} opened pull request {pr} at {repo}':
'{actor} 打開了合併請求 {pr} 在 {repo}',
'{actor} published release {id}': '{actor} 發佈了發佈 {id}',
'{actor} pushed to {ref} at {repo}': '{actor} 推送至 {ref} 在 {repo}',
'{actor} removed {member} at {repo}': '{actor} 移除了 {member} 在 {repo}',
'{actor} reopened issue {issue} at {repo}':
'{actor} 重新打開了議題 {issue} 在 {repo}',
'{actor} reopened pull request {pr} at {repo}':
'{actor} 重新打開了合併請求 {pr} 在 {repo}',
'{actor} starred {repo}': '{actor} 給星 {repo}',
'{almostXYears}y': '{almostXYears}年',
'{halfAMinute}s': '30秒',
'{lessThanXMinutes}m': '{lessThanXMinutes}分',
'{lessThanXSeconds}s': '{lessThanXSeconds}秒',
'{numFilesChanged} files': '{numFilesChanged} 個檔案',
'{overXYears}y': '{overXYears}年',
'{xDays}d': '{xDays}日',
'{xHours}h': '{xHours}时',
'{xMinutes}m': '{xMinutes}分',
'{xMonths}mo': '{xMonths}月',
'{xSeconds}s': '{xSeconds}秒',
'{xYears}y': '{xYears}年',
};
| {
"pile_set_name": "Github"
} |
# Nimbus
# Copyright (c) 2018 Status Research & Development GmbH
# Licensed under either of
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
# * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
# at your option. This file may not be copied, modified, or distributed except according to those terms.
import
chronicles, strformat, strutils, sequtils, parseutils, sets, macros,
eth/common,
./interpreter/opcode_values
logScope:
topics = "vm code_stream"
type
CodeStream* = ref object
bytes*: seq[byte]
depthProcessed: int
invalidPositions: HashSet[int]
pc*: int
cached: seq[(int, Op, string)]
proc `$`*(b: byte): string =
$(b.int)
proc newCodeStream*(codeBytes: seq[byte]): CodeStream =
new(result)
shallowCopy(result.bytes, codeBytes)
result.pc = 0
result.invalidPositions = initHashSet[int]()
result.depthProcessed = 0
result.cached = @[]
proc newCodeStream*(codeBytes: string): CodeStream =
newCodeStream(codeBytes.mapIt(it.byte))
proc newCodeStreamFromUnescaped*(code: string): CodeStream =
# from 0xunescaped
var codeBytes: seq[byte] = @[]
for z, c in code[2..^1]:
if z mod 2 == 1:
var value: int
discard parseHex(&"0x{code[z+1..z+2]}", value)
codeBytes.add(value.byte)
newCodeStream(codeBytes)
proc read*(c: var CodeStream, size: int): seq[byte] =
# TODO: use openarray[bytes]
if c.pc + size - 1 < c.bytes.len:
result = c.bytes[c.pc .. c.pc + size - 1]
c.pc += size
else:
result = @[]
c.pc = c.bytes.len
proc readVmWord*(c: var CodeStream, n: int): UInt256 =
## Reads `n` bytes from the code stream and pads
## the remaining bytes with zeros.
let result_bytes = cast[ptr array[32, byte]](addr result)
let last = min(c.pc + n, c.bytes.len)
let toWrite = last - c.pc
for i in 0 ..< toWrite : result_bytes[i] = c.bytes[last - i - 1]
c.pc = last
proc len*(c: CodeStream): int =
len(c.bytes)
proc next*(c: var CodeStream): Op =
if c.pc != c.bytes.len:
result = Op(c.bytes[c.pc])
inc c.pc
else:
result = Stop
iterator items*(c: var CodeStream): Op =
var nextOpcode = c.next()
while nextOpcode != Op.STOP:
yield nextOpcode
nextOpcode = c.next()
proc `[]`*(c: CodeStream, offset: int): Op =
Op(c.bytes[offset])
proc peek*(c: var CodeStream): Op =
if c.pc < c.bytes.len:
result = Op(c.bytes[c.pc])
else:
result = Stop
proc updatePc*(c: var CodeStream, value: int) =
c.pc = min(value, len(c))
when false:
template seek*(cs: var CodeStream, pc: int, handler: untyped): untyped =
var anchorPc = cs.pc
cs.pc = pc
try:
var c {.inject.} = cs
handler
finally:
cs.pc = anchorPc
proc isValidOpcode*(c: CodeStream, position: int): bool =
if position >= len(c):
return false
if position in c.invalidPositions:
return false
if position <= c.depthProcessed:
return true
else:
var i = c.depthProcessed
while i <= position:
var opcode = Op(c[i])
if opcode >= Op.PUSH1 and opcode <= Op.PUSH32:
var leftBound = (i + 1)
var rightBound = leftBound + (opcode.int - 95)
for z in leftBound ..< rightBound:
c.invalidPositions.incl(z)
i = rightBound
else:
c.depthProcessed = i
i += 1
if position in c.invalidPositions:
return false
else:
return true
proc decompile*(original: var CodeStream): seq[(int, Op, string)] =
# behave as https://etherscan.io/opcode-tool
# TODO
if original.cached.len > 0:
return original.cached
result = @[]
var c = newCodeStream(original.bytes)
while true:
var op = c.next
if op >= PUSH1 and op <= PUSH32:
let bytes = c.read(op.int - 95)
result.add((c.pc - 1, op, "0x" & bytes.mapIt($(it.BiggestInt.toHex(2))).join("")))
elif op != Op.Stop:
result.add((c.pc - 1, op, ""))
else:
result.add((-1, Op.STOP, ""))
break
original.cached = result
proc displayDecompiled*(c: CodeStream) =
var copy = c
let opcodes = copy.decompile()
for op in opcodes:
echo op[0], " ", op[1], " ", op[2]
proc hasSStore*(c: var CodeStream): bool =
let opcodes = c.decompile()
result = opcodes.anyIt(it[1] == SSTORE)
proc atEnd*(c: CodeStream): bool =
result = c.pc >= c.bytes.len
| {
"pile_set_name": "Github"
} |
<?php
namespace builder;
/**
* 软件接口
*/
interface Software
{
public function produce();
}
| {
"pile_set_name": "Github"
} |
/*
* TabularLayout.java
*
* Created on October 8, 2008, 2:32 PM
*
* Copyright 2003-2010 Tufts University Licensed under the
* Educational Community 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.osedu.org/licenses/ECL-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.
*/
/**
*
* @author akumar03
*/
package edu.tufts.vue.layout;
import java.io.*;
import java.net.*;
import java.util.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import tufts.vue.*;
import edu.tufts.vue.metadata.MetadataList;
import edu.tufts.vue.metadata.VueMetadataElement;
import edu.tufts.vue.dataset.*;
/*
* This layout puts nodes in a grid. By default it will make or try to make
* a square grid. Eventually it may be possible to define the number of rows,
* columns and cell spacing.
*/
public class ScrollingTabularLayout extends Layout {
public static int DEFAULT_ROWS =6;
private static boolean IM_LAYOUT=false;
private static int LIMIT_ROWS=6;
private static boolean STRICT_ROW_COUNT=true;
/** Creates a new instance of TabularLayout */
public ScrollingTabularLayout() {
}
public LWMap createMap(Dataset ds, String mapName) throws Exception {
LWMap map = new LWMap(mapName);
return map;
}
public static void useStrictRowCount(boolean count)
{
STRICT_ROW_COUNT=count;
}
public static void overrideDefaultRowCount(int rows)
{
LIMIT_ROWS=rows;
}
public static void setIMLayout(boolean im)
{
IM_LAYOUT=im;
}
public void layout(LWSelection selection) throws Exception {
double minX = Double.POSITIVE_INFINITY;
double minY = Double.POSITIVE_INFINITY;
int mod = DEFAULT_ROWS;
if (STRICT_ROW_COUNT)
mod = LIMIT_ROWS;
double xAdd = X_COL_SIZE; // default horizontal distance between the nodes
double yAdd = Y_COL_SIZE; //default vertical distance between nodes
int count = 0;
int total = 0;
final java.util.List<LWComponent> toLayout = new ArrayList(selection.size());
for (LWComponent c : selection) {
// TODO: this should be done in the caller for all layout actions?
if (c.isManagedLocation())
continue;
if (c instanceof LWNode || c instanceof LWText) {
toLayout.add(c);
} else if (c instanceof LWImage) {
// should already be handled by checking isManagedLocation, but just in case
final LWImage image = (LWImage) c;
if (!image.isNodeIcon())
toLayout.add(c);
}
}
for (LWComponent node : toLayout) {
/*
* If we're using the collaborative IM layout, then we need to be careful about this, in the current layout
* if you're not zoom fitting things can get pulled to the upper left, not sure if this is intended
* so i'm leaving it alone, and just special casing the instant messenging case.
*/
if (IM_LAYOUT)
{
minX = node.getLocation().getX() !=0.0 && node.getLocation().getX() < minX ? node.getLocation().getX() : minX;
minY = node.getLocation().getX() !=0.0 && node.getLocation().getY() < minY ? node.getLocation().getY() : minY;
}
else
{
minX = node.getLocation().getX() < minX ? node.getLocation().getX() : minX;
minY = node.getLocation().getY() < minY ? node.getLocation().getY() : minY;
}
xAdd = xAdd > node.getWidth() ? xAdd : node.getWidth();
yAdd = yAdd > node.getHeight() ? yAdd : node.getHeight();
total++;
// System.out.println(node.getLabel()+"X= "+node.getLocation().getX()+" Y= "+node.getLocation().getY()+" MIN: "+minX+" : "+minY);
}
xAdd += X_SPACING; // spacing between nodes
yAdd += Y_SPACING; // vertical spacing
double x = minX;
double y = minY;
if (!STRICT_ROW_COUNT)
mod = (int) Math.ceil(Math.sqrt((double) total));
for (LWComponent node : toLayout) {
total++;
if (count % mod == 0) {
if (count != 0) {
x += xAdd;
//System.out.println("Y : " +y +"," + " yAdd : " + yAdd);
}
y = minY;
} else {
y += yAdd;
}
count++;
node.setLocation(x, y);
}
}
}
| {
"pile_set_name": "Github"
} |
/*
* FB driver for the TLS8204 LCD Controller
*
* The display is monochrome and the video memory is RGB565.
* Any pixel value except 0 turns the pixel on.
*
* Copyright (C) 2013 Noralf Tronnes
* Copyright (C) 2014 Michael Hope (adapted for the TLS8204)
*
* 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.
*/
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/gpio.h>
#include <linux/spi/spi.h>
#include <linux/delay.h>
#include "fbtft.h"
#define DRVNAME "fb_tls8204"
#define WIDTH 84
#define HEIGHT 48
#define TXBUFLEN WIDTH
/* gamma is used to control contrast in this driver */
#define DEFAULT_GAMMA "40"
static unsigned int bs = 4;
module_param(bs, uint, 0000);
MODULE_PARM_DESC(bs, "BS[2:0] Bias voltage level: 0-7 (default: 4)");
static int init_display(struct fbtft_par *par)
{
par->fbtftops.reset(par);
/* Enter extended command mode */
write_reg(par, 0x21); /* 5:1 1
* 2:0 PD - Powerdown control: chip is active
* 1:0 V - Entry mode: horizontal addressing
* 0:1 H - Extended instruction set control:
* extended
*/
/* H=1 Bias system */
write_reg(par, 0x10 | (bs & 0x7));
/* 4:1 1
* 3:0 0
* 2:x BS2 - Bias System
* 1:x BS1
* 0:x BS0
*/
/* Set the address of the first display line. */
write_reg(par, 0x04 | (64 >> 6));
write_reg(par, 0x40 | (64 & 0x3F));
/* Enter H=0 standard command mode */
write_reg(par, 0x20);
/* H=0 Display control */
write_reg(par, 0x08 | 4);
/* 3:1 1
* 2:1 D - DE: 10=normal mode
* 1:0 0
* 0:0 E
*/
return 0;
}
static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye)
{
/* H=0 Set X address of RAM */
write_reg(par, 0x80); /* 7:1 1
* 6-0: X[6:0] - 0x00
*/
/* H=0 Set Y address of RAM */
write_reg(par, 0x40); /* 7:0 0
* 6:1 1
* 2-0: Y[2:0] - 0x0
*/
}
static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
{
u16 *vmem16 = (u16 *)par->info->screen_buffer;
int x, y, i;
int ret = 0;
for (y = 0; y < HEIGHT / 8; y++) {
u8 *buf = par->txbuf.buf;
/* The display is 102x68 but the LCD is 84x48.
* Set the write pointer at the start of each row.
*/
gpio_set_value(par->gpio.dc, 0);
write_reg(par, 0x80 | 0);
write_reg(par, 0x40 | y);
for (x = 0; x < WIDTH; x++) {
u8 ch = 0;
for (i = 0; i < 8 * WIDTH; i += WIDTH) {
ch >>= 1;
if (vmem16[(y * 8 * WIDTH) + i + x])
ch |= 0x80;
}
*buf++ = ch;
}
/* Write the row */
gpio_set_value(par->gpio.dc, 1);
ret = par->fbtftops.write(par, par->txbuf.buf, WIDTH);
if (ret < 0) {
dev_err(par->info->device,
"write failed and returned: %d\n", ret);
break;
}
}
return ret;
}
static int set_gamma(struct fbtft_par *par, u32 *curves)
{
/* apply mask */
curves[0] &= 0x7F;
write_reg(par, 0x21); /* turn on extended instruction set */
write_reg(par, 0x80 | curves[0]);
write_reg(par, 0x20); /* turn off extended instruction set */
return 0;
}
static struct fbtft_display display = {
.regwidth = 8,
.width = WIDTH,
.height = HEIGHT,
.txbuflen = TXBUFLEN,
.gamma_num = 1,
.gamma_len = 1,
.gamma = DEFAULT_GAMMA,
.fbtftops = {
.init_display = init_display,
.set_addr_win = set_addr_win,
.write_vmem = write_vmem,
.set_gamma = set_gamma,
},
.backlight = 1,
};
FBTFT_REGISTER_DRIVER(DRVNAME, "teralane,tls8204", &display);
MODULE_ALIAS("spi:" DRVNAME);
MODULE_ALIAS("spi:tls8204");
MODULE_DESCRIPTION("FB driver for the TLS8204 LCD Controller");
MODULE_AUTHOR("Michael Hope");
MODULE_LICENSE("GPL");
| {
"pile_set_name": "Github"
} |
<?php
use PHPUnit\Framework\TestCase;
class TreeTest extends TestCase {
protected static $n;
protected static $about_node;
protected static $blog_node;
protected static $contact_node;
static function tearDownAfterClass (): void {
if (file_exists ('cache/test_tree.json')) {
unlink ('cache/test_tree.json');
}
}
function test_single_node () {
self::$n = new Tree ('cache/test_tree.json');
/**
* This is the tree on first install, just an index page.
*/
self::$n->tree = array (
(object) array (
'data' => 'Home',
'attr' => (object) array (
'id' => 'index',
'sort' => 0
)
)
);
/**
* Should have only one id:
*
* index
*/
$this->assertEquals (self::$n->get_all_ids (), array ('index'));
}
function test_adding_node () {
self::$blog_node = (object) array (
'data' => 'Blog',
'attr' => (object) array (
'id' => 'blog',
'sort' => 0
)
);
/**
* Add blog page with title.
*/
self::$n->add ('blog', 'index', 'Blog');
/**
* Should have second id now:
*
* index
* - blog
*/
$this->assertEquals (self::$n->get_all_ids (), array ('index', 'blog'));
}
function test_adding_subnode () {
self::$about_node = (object) array (
'data' => 'About',
'attr' => (object) array (
'id' => 'about',
'sort' => 0
)
);
/**
* Add about page under blog as array.
*/
self::$n->add (array (
'data' => 'About',
'attr' => array (
'id' => 'about',
'sort' => 0
)
), 'blog');
/**
* Should have third id now under blog:
*
* index
* - blog
* - about
*/
$this->assertEquals (self::$n->get_all_ids (), array ('index', 'blog', 'about'));
// Make sure about is under blog.
$this->assertEquals (self::$n->parent ('about')->attr->id, self::$blog_node->attr->id);
}
function test_find_node () {
// Find the about node and verify it.
$this->assertEquals (self::$n->node ('about')->attr->id, self::$about_node->attr->id);
}
function test_paths () {
// Test all paths
$this->assertEquals (self::$n->path ('index'), array ('index'));
$this->assertEquals (self::$n->path ('blog'), array ('index', 'blog'));
$this->assertEquals (self::$n->path ('about'), array ('index', 'blog', 'about'));
// Test paths with titles
$this->assertEquals (self::$n->path ('blog', true), array ('index' => 'Home', 'blog' => 'Blog'));
}
function test_sections () {
// Test sections
$this->assertEquals (self::$n->sections (), array ('index', 'blog'));
}
function test_remove () {
// Remove about and verify.
self::$n->remove ('about');
$this->assertFalse (isset (self::$n->node ('blog')->children));
$this->assertNull (self::$n->node ('about'));
$this->assertEquals (self::$n->get_all_ids (), array ('index', 'blog'));
}
function test_remove_with_children () {
/**
* Add about and remove blog and verify.
*
* Structure:
*
* index
* - blog
* - about
*/
self::$n->add (self::$about_node, 'blog');
$this->assertEquals (self::$n->get_all_ids (), array ('index', 'blog', 'about'));
self::$n->remove ('blog');
$this->assertNull (self::$n->node ('about'));
$this->assertNull (self::$n->node ('blog'));
$this->assertEquals (self::$n->get_all_ids (), array ('index'));
}
function test_add_remove () {
/**
* Add blog to root and verify add/remove root nodes.
*
* Structure:
*
* index
* about
*/
self::$about_node = (object) array (
'data' => 'About',
'attr' => (object) array (
'id' => 'about',
'sort' => 0
)
);
self::$n->add (self::$about_node);
$this->assertEquals (self::$n->get_all_ids (), array ('index', 'about'));
$this->assertEquals (self::$n->node ('about')->attr->sort, 1);
self::$n->remove ('about');
$this->assertEquals (count (self::$n->tree), 1);
}
function test_remove_non_recursive () {
/**
* Add blog and about and contact nodes and test remove() non-recursive.
*
* Structure:
*
* index
* about
* - contact
* - blog
*/
self::$about_node = (object) array (
'data' => 'About',
'attr' => (object) array (
'id' => 'about',
'sort' => 0
)
);
self::$contact_node = (object) array (
'data' => 'Contact',
'attr' => (object) array (
'id' => 'contact',
'sort' => 0
)
);
self::$blog_node = (object) array (
'data' => 'Blog',
'attr' => (object) array (
'id' => 'blog',
'sort' => 0
)
);
self::$n->add (self::$about_node);
self::$n->add (self::$contact_node, 'about');
self::$n->add (self::$blog_node, 'about');
$this->assertEquals (self::$n->get_all_ids (), array ('index', 'about', 'contact', 'blog'));
self::$n->remove ('about', false);
$this->assertEquals (self::$n->get_all_ids (), array ('index', 'contact', 'blog'));
$this->assertEquals (self::$n->parent ('contact'), null);
$this->assertEquals (self::$n->parent ('blog'), null);
self::$n->remove ('contact');
self::$n->remove ('blog');
}
function test_remove_path () {
/**
* Add node in two places and test remove_path().
*
* Structure:
*
* index
* - contact
* - about
* about
*/
self::$about_node = (object) array (
'data' => 'About',
'attr' => (object) array (
'id' => 'about',
'sort' => 0
)
);
self::$contact_node = (object) array (
'data' => 'Contact',
'attr' => (object) array (
'id' => 'contact',
'sort' => 0
)
);
self::$n->add (self::$about_node);
self::$n->add (self::$contact_node, 'index');
self::$n->add (self::$about_node, 'contact');
$this->assertEquals (self::$n->get_all_ids (), array ('index', 'contact', 'about'));
self::$n->remove_path (array ('index', 'contact', 'about'));
$contact = self::$n->node ('contact');
$this->assertFalse (isset ($contact->children));
self::$n->remove ('contact');
self::$n->remove ('about');
}
function test_move () {
/**
* Add blog and about and contact nodes and test move().
*
* Structure:
*
* index
* - about
* - blog
* - contact
*/
self::$about_node = (object) array (
'data' => 'About',
'attr' => (object) array (
'id' => 'about',
'sort' => 0
)
);
self::$contact_node = (object) array (
'data' => 'Contact',
'attr' => (object) array (
'id' => 'contact',
'sort' => 0
)
);
self::$blog_node = (object) array (
'data' => 'Blog',
'attr' => (object) array (
'id' => 'blog',
'sort' => 0
)
);
self::$n->add (self::$about_node, 'index');
self::$n->add (self::$contact_node, 'index');
self::$n->add (self::$blog_node, 'about');
$this->assertEquals (self::$n->get_all_ids (), array ('index', 'about', 'blog', 'contact'));
/**
* Move contact under about. New structure:
*
* index
* - about
* - blog
* - contact
*/
self::$n->move ('contact', 'about');
$this->assertEquals (self::$n->parent ('contact')->attr->id, 'about');
/**
* Move contact under blog. New structure:
*
* index
* - about
* - blog
* - contact
*/
self::$n->move ('contact', 'blog');
$this->assertEquals (self::$n->parent ('contact')->attr->id, 'blog');
$this->assertEquals (self::$n->parent ('blog')->attr->id, 'about');
$this->assertEquals (self::$n->parent ('about')->attr->id, 'index');
/**
* Move blog to top. New structure:
*
* index
* - about
* blog
* - contact
*/
self::$n->move ('blog', false);
$this->assertEquals (self::$n->parent ('contact')->attr->id, 'blog');
$this->assertEquals (self::$n->parent ('blog'), null);
/**
* Move blog to after about under index. New structure:
*
* index
* - about
* - blog
* - contact
*/
self::$n->move ('blog', 'about', 'after');
$this->assertEquals (self::$n->parent ('blog')->attr->id, 'index');
$this->assertEquals (self::$n->parent ('contact')->attr->id, 'blog');
$this->assertEquals (self::$n->node ('about')->attr->sort, 0);
$this->assertEquals (self::$n->node ('blog')->attr->sort, 1);
/**
* Move blog to after about under index. New structure:
*
* index
* - about
* - contact
* - blog
*/
self::$n->move ('contact', 'blog', 'before');
$this->assertEquals (self::$n->parent ('contact')->attr->id, 'index');
$this->assertEquals (self::$n->node ('about')->attr->sort, 0);
$this->assertEquals (self::$n->node ('contact')->attr->sort, 1);
$this->assertEquals (self::$n->node ('blog')->attr->sort, 2);
/**
* Move blog to before index. New structure:
*
* blog
* index
* - about
* - contact
*/
self::$n->move ('blog', 'index', 'before');
$this->assertEquals (self::$n->parent ('blog'), null);
$this->assertEquals (self::$n->node ('blog')->attr->sort, 0);
$this->assertEquals (self::$n->node ('index')->attr->sort, 1);
/**
* Move blog to after index. New structure:
*
* index
* - about
* - contact
* blog
*/
self::$n->move ('blog', 'index', 'after');
$this->assertEquals (self::$n->parent ('blog'), null);
$this->assertEquals (self::$n->node ('index')->attr->sort, 0);
$this->assertEquals (self::$n->node ('blog')->attr->sort, 1);
/**
* Move index to after blog. New structure:
*
* blog
* index
* - about
* - contact
*/
self::$n->move ('index', 'blog', 'after');
$this->assertEquals (self::$n->parent ('blog'), null);
$this->assertEquals (self::$n->node ('blog')->attr->sort, 0);
$this->assertEquals (self::$n->node ('index')->attr->sort, 1);
$this->assertEquals (count (self::$n->node ('index')->children), 2);
/**
* Move index to before blog. New structure:
*
* index
* - about
* - contact
* blog
*/
self::$n->move ('index', 'blog', 'before');
$this->assertEquals (self::$n->parent ('blog'), null);
$this->assertEquals (self::$n->node ('index')->attr->sort, 0);
$this->assertEquals (self::$n->node ('blog')->attr->sort, 1);
$this->assertEquals (count (self::$n->node ('index')->children), 2);
}
}
| {
"pile_set_name": "Github"
} |
<?php
/**
* Abstract implementation of SignableIF which represents a signable row
* in the database.
*
* Copyright (C) 2013 OEMR 501c3 www.oemr.org
*
* LICENSE: 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://opensource.org/licenses/gpl-license.php>;.
*
* @package OpenEMR
* @author Ken Chapple <[email protected]>
* @author Medical Information Integration, LLC
* @link http://www.open-emr.org
**/
namespace ESign;
require_once $GLOBALS['srcdir'] . '/ESign/SignableIF.php';
require_once $GLOBALS['srcdir'] . '/ESign/Signature.php';
require_once $GLOBALS['srcdir'] . '/ESign/Utils/Verification.php';
abstract class DbRow_Signable implements SignableIF
{
private $_signatures = array();
private $_tableId = null;
private $_tableName = null;
private $_verification = null;
public function __construct($tableId, $tableName)
{
$this->_tableId = $tableId;
$this->_tableName = $tableName;
$this->_verification = new Utils_Verification();
}
public function getSignatures()
{
$this->_signatures = array();
$statement = "SELECT E.id, E.tid, E.table, E.uid, U.fname, U.lname, E.datetime, E.is_lock, E.amendment, E.hash, E.signature_hash FROM esign_signatures E ";
$statement .= "JOIN users U ON E.uid = U.id ";
$statement .= "WHERE E.tid = ? AND E.table = ? ";
$statement .= "ORDER BY E.datetime ASC";
$result = sqlStatement($statement, array( $this->_tableId, $this->_tableName ));
while ($row = sqlFetchArray($result)) {
$signature = new Signature(
$row['id'],
$row['tid'],
$row['table'],
$row['is_lock'],
$row['uid'],
$row['fname'],
$row['lname'],
$row['datetime'],
$row['hash'],
$row['amendment'],
$row['signature_hash']
);
$this->_signatures[] = $signature;
}
return $this->_signatures;
}
/**
* Get the hash of the last signature of type LOCK.
*
* This is used for comparison with a current hash to
* verify data integrity.
*
* @return sha1|empty string
*/
protected function getLastLockHash()
{
$statement = "SELECT E.tid, E.table, E.hash FROM esign_signatures E ";
$statement .= "WHERE E.tid = ? AND E.table = ? AND E.is_lock = ? ";
$statement .= "ORDER BY E.datetime DESC LIMIT 1";
$row = sqlQuery($statement, array( $this->_tableId, $this->_tableName, SignatureIF::ESIGN_LOCK ));
$hash = null;
if ($row && isset($row['hash'])) {
$hash = $row['hash'];
}
return $hash;
}
public function getTableId()
{
return $this->_tableId;
}
public function renderForm()
{
include 'views/esign_signature_log.php';
}
public function isLocked()
{
$statement = "SELECT E.is_lock FROM esign_signatures E ";
$statement .= "WHERE E.tid = ? AND E.table = ? AND is_lock = ? ";
$statement .= "ORDER BY E.datetime DESC LIMIT 1 ";
$row = sqlQuery($statement, array( $this->_tableId, $this->_tableName, SignatureIF::ESIGN_LOCK ));
if ($row && $row['is_lock'] == SignatureIF::ESIGN_LOCK) {
return true;
}
return false;
}
public function sign($userId, $lock = false, $amendment = null)
{
$statement = "INSERT INTO `esign_signatures` ( `tid`, `table`, `uid`, `datetime`, `is_lock`, `hash`, `amendment`, `signature_hash` ) ";
$statement .= "VALUES ( ?, ?, ?, NOW(), ?, ?, ?, ? ) ";
// Make type string
$isLock = SignatureIF::ESIGN_NOLOCK;
if ($lock) {
$isLock = SignatureIF::ESIGN_LOCK;
}
// Create a hash of the signable object so we can verify it's integrity
$hash = $this->_verification->hash($this->getData());
// Crate a hash of the signature data itself. This is the same data as Signature::getData() method
$signature = array(
$this->_tableId,
$this->_tableName,
$userId,
$isLock,
$hash,
$amendment );
$signatureHash = $this->_verification->hash($signature);
// Append the hash of the signature data to the insert array before we insert
$signature[] = $signatureHash;
$id = sqlInsert($statement, $signature);
if ($id === false) {
throw new \Exception("Error occured while attempting to insert a signature into the database.");
}
return $id;
}
public function verify()
{
$valid = true;
// Verify the signable data integrity
// Check to see if this SignableIF is locked
if ($this->isLocked()) {
$signatures = $this->getSignatures();
// SignableIF is locked, so if it has any signatures, make sure it hasn't been edited since lock
if (count($signatures)) {
// Verify the data of the SignableIF object
$lastLockHash = $this->getLastLockHash();
$valid = $this->_verification->verify($this->getData(), $lastLockHash);
if ($valid === true) {
// If still vlaid, verify each signatures' integrity
foreach ($signatures as $signature) {
if ($signature instanceof SignatureIF) {
$valid = $signature->verify();
if ($valid === false) {
break;
}
}
}
}
}
}
return $valid;
}
}
| {
"pile_set_name": "Github"
} |
import {BaseModel, BaseRequest} from '../../../shared/class/BaseModel';
import {Region} from '../region/region';
export class Zone extends BaseModel {
id: string;
name: string;
vars: string;
credentialId: string;
cloudVars: {} = {};
regionName: string;
provider: string;
status: string;
}
export class ZoneCreateRequest extends BaseRequest {
vars: string;
regionName: string;
regionID: string;
cloudVars: {} = {};
provider: string;
credentialId: string;
}
export class ZoneUpdateRequest extends BaseRequest {
vars: string;
regionID: string;
cloudVars: {} = {};
}
export class CloudZoneRequest extends BaseRequest {
cloudVars: {} = {};
datacenter: string;
}
export class CloudZone {
cluster: string;
networks: [] = [];
resourcePools: [] = [];
datastores: [] = [];
storages: Storage[] = [];
securityGroups: [] = [];
networkList: Network[] = [];
floatingNetworkList: Network[] = [];
ipTypes: [] = [];
imageList: Image[] = [];
}
export class CloudTemplate {
imageName: string;
guestId: string;
}
export class Storage {
id: string;
name: string;
}
export class Network {
id: string;
name: string;
subnetList: Subnet[] = [];
}
export class Subnet {
id: string;
name: string;
}
export class Image {
id: string;
name: string;
}
| {
"pile_set_name": "Github"
} |
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Mage
* @package Mage_GoogleCheckout
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/**
* @category Mage
* @package Mage_GoogleCheckout
* @author Magento Core Team <[email protected]>
*/
class Mage_GoogleCheckout_RedirectController extends Mage_Core_Controller_Front_Action
{
/**
* Send request to Google Checkout and return Response Api
*
* @return Mage_GoogleCheckout_Model_Api_Xml_Checkout
*/
protected function _getApi ()
{
$session = Mage::getSingleton('checkout/session');
$api = Mage::getModel('googlecheckout/api');
/* @var $quote Mage_Sales_Model_Quote */
$quote = $session->getQuote();
if (!$quote->hasItems()) {
$this->getResponse()->setRedirect(Mage::getUrl('checkout/cart'));
$api->setError(true);
}
$storeQuote = Mage::getModel('sales/quote')->setStoreId(Mage::app()->getStore()->getId());
$storeQuote->merge($quote);
$storeQuote
->setItemsCount($quote->getItemsCount())
->setItemsQty($quote->getItemsQty())
->setChangedFlag(false);
$storeQuote->save();
$baseCurrency = $quote->getBaseCurrencyCode();
$currency = Mage::app()->getStore($quote->getStoreId())->getBaseCurrency();
/*
* Set payment method to google checkout, so all price rules will work out this case
* and will use right sales rules
*/
if ($quote->isVirtual()) {
$quote->getBillingAddress()->setPaymentMethod('googlecheckout');
} else {
$quote->getShippingAddress()->setPaymentMethod('googlecheckout');
}
$quote->collectTotals()->save();
if (!$api->getError()) {
$api = $api->setAnalyticsData($this->getRequest()->getPost('analyticsdata'))
->checkout($quote);
$response = $api->getResponse();
if ($api->getError()) {
Mage::getSingleton('checkout/session')->addError($api->getError());
} else {
$quote->setIsActive(false)->save();
$session->replaceQuote($storeQuote);
Mage::getModel('checkout/cart')->init()->save();
if (Mage::getStoreConfigFlag('google/checkout/hide_cart_contents')) {
$session->setGoogleCheckoutQuoteId($session->getQuoteId());
$session->setQuoteId(null);
}
}
}
return $api;
}
public function checkoutAction()
{
$session = Mage::getSingleton('checkout/session');
Mage::dispatchEvent('googlecheckout_checkout_before', array('quote' => $session->getQuote()));
$api = $this->_getApi();
if ($api->getError()) {
$url = Mage::getUrl('checkout/cart');
} else {
$url = $api->getRedirectUrl();
}
$this->getResponse()->setRedirect($url);
}
/**
* When a customer chooses Google Checkout on Checkout/Payment page
*
*/
public function redirectAction()
{
$api = $this->_getApi();
if ($api->getError()) {
$this->getResponse()->setRedirect(Mage::getUrl('checkout/cart'));
return;
} else {
$url = $api->getRedirectUrl();
$this->loadLayout();
$this->getLayout()->getBlock('googlecheckout_redirect')->setRedirectUrl($url);
$this->renderLayout();
}
}
public function cartAction()
{
if (Mage::getStoreConfigFlag('google/checkout/hide_cart_contents')) {
$session = Mage::getSingleton('checkout/session');
if ($session->getQuoteId()) {
$session->getQuote()->delete();
}
$session->setQuoteId($session->getGoogleCheckoutQuoteId());
$session->setGoogleCheckoutQuoteId(null);
}
$this->_redirect('checkout/cart');
}
public function continueAction()
{
$session = Mage::getSingleton('checkout/session');
if ($quoteId = $session->getGoogleCheckoutQuoteId()) {
$quote = Mage::getModel('sales/quote')->load($quoteId)
->setIsActive(false)->save();
}
$session->clear();
if (Mage::getStoreConfigFlag('google/checkout/hide_cart_contents')) {
$session->setGoogleCheckoutQuoteId(null);
}
$url = Mage::getStoreConfig('google/checkout/continue_shopping_url');
if (empty($url)) {
$this->_redirect('');
} elseif (substr($url, 0, 4) === 'http') {
$this->getResponse()->setRedirect($url);
} else {
$this->_redirect($url);
}
}
/**
* Redirect to login page
*
*/
public function redirectLogin()
{
$this->setFlag('', 'no-dispatch', true);
$this->getResponse()->setRedirect(
Mage::helper('core/url')->addRequestParam(
Mage::helper('customer')->getLoginUrl(),
array('context' => 'checkout')
)
);
}
}
| {
"pile_set_name": "Github"
} |
import React from 'react';
import { ImageProps, View } from 'react-native';
import {
Card,
CardElement,
CardProps,
StyleService,
StyleType,
Text,
useStyleSheet,
} from '@ui-kitten/components';
export interface ProfileParameterCardProps extends Omit<CardProps, 'children'> {
hint: string;
value: string;
icon: (style: StyleType) => React.ReactElement<ImageProps>;
}
export const ProfileParameterCard = (props: ProfileParameterCardProps): CardElement => {
const styles = useStyleSheet(themedStyles);
const { hint, value, icon, ...restProps } = props;
return (
<Card {...restProps}>
<View style={styles.topContainer}>
<Text appearance='hint'>
{hint}
</Text>
{icon(styles.icon)}
</View>
<Text
style={styles.valueLabel}
category='h5'>
{value}
</Text>
</Card>
);
};
const themedStyles = StyleService.create({
topContainer: {
flexDirection: 'row',
justifyContent: 'space-between',
},
valueLabel: {
marginTop: 20,
},
icon: {
width: 20,
height: 20,
tintColor: 'color-primary-default',
},
});
| {
"pile_set_name": "Github"
} |
<!doctype html>
<meta charset=utf-8>
<title>IndexedDB: IDBObjectStore clear() Exception Ordering</title>
<link rel="help" href="https://w3c.github.io/IndexedDB/#dom-idbobjectstore-clear">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support.js"></script>
<script>
indexeddb_test(
(t, db) => {
const store = db.createObjectStore('s');
const store2 = db.createObjectStore('s2');
db.deleteObjectStore('s2');
setTimeout(t.step_func(() => {
assert_throws(
'InvalidStateError', () => { store2.clear(); },
'"has been deleted" check (InvalidStateError) should precede ' +
'"not active" check (TransactionInactiveError)');
t.done();
}), 0);
},
(t, db) => {},
'IDBObjectStore.clear exception order: ' +
'InvalidStateError vs. TransactionInactiveError'
);
indexeddb_test(
(t, db) => {
const store = db.createObjectStore('s');
},
(t, db) => {
const tx = db.transaction('s', 'readonly');
const store = tx.objectStore('s');
setTimeout(t.step_func(() => {
assert_throws(
'TransactionInactiveError', () => { store.clear(); },
'"not active" check (TransactionInactiveError) should precede ' +
'"read only" check (ReadOnlyError)');
t.done();
}), 0);
},
'IDBObjectStore.clear exception order: ' +
'TransactionInactiveError vs. ReadOnlyError'
);
</script>
| {
"pile_set_name": "Github"
} |
<?php
/**
* English language strings for Dashboards
*
* @package modx
* @subpackage lexicon
* @language en
*/
$_lang['dashboard'] = 'Dashboard';
$_lang['dashboard_add'] = 'הוספת לוח מחוונים';
$_lang['dashboard_create'] = 'יצירת לוח מחוונים';
$_lang['dashboard_desc_name'] = 'שם לוח המחוונים.';
$_lang['dashboard_desc_description'] = 'תיאור קצר של לוח המחוונים.';
$_lang['dashboard_desc_hide_trees'] = 'ע״י סימון תיבת הבחירה הזו, עץ הדפים בצד שמאל יוסתר בעת טעינת לוח מחוונים זה בדף הפתיחה.';
$_lang['dashboard_hide_trees'] = 'הסתר את עץ הדפים בצד שמאל';
$_lang['dashboard_duplicate'] = 'שיכפול לוח מחוונים';
$_lang['dashboard_remove'] = 'מחיקת לוח מחוונים';
$_lang['dashboard_remove_confirm'] = 'אתם בטוחים שברצונכם להסיר לוח מחוונים זה?';
$_lang['dashboard_remove_multiple'] = 'הסרת מספר לוחות מחוונים';
$_lang['dashboard_remove_multiple_confirm'] = 'Are you sure you want to remove the selected Dashboards?';
$_lang['dashboard_update'] = 'Update Dashboard';
$_lang['dashboard_err_ae_name'] = 'A dashboard with the name "[[+name]]" already exists! Please try another name.';
$_lang['dashboard_err_duplicate'] = 'An error occurred while trying to duplicate the dashboard.';
$_lang['dashboard_err_nf'] = 'לוח מחוונים לא נמצא.';
$_lang['dashboard_err_ns'] = 'Dashboard not specified.';
$_lang['dashboard_err_ns_name'] = 'Please specify a name for the widget.';
$_lang['dashboard_err_remove'] = 'An error occurred while trying to remove the Dashboard.';
$_lang['dashboard_err_remove_default'] = 'You cannot remove the default Dashboard!';
$_lang['dashboard_err_save'] = 'An error occurred while trying to save the Dashboard.';
$_lang['dashboard_usergroup_add'] = 'Assign Dashboard to User Group';
$_lang['dashboard_usergroup_remove'] = 'Remove Dashboard from User Group';
$_lang['dashboard_usergroup_remove_confirm'] = 'Are you sure you want to revert this User Group to using the default Dashboard?';
$_lang['dashboard_usergroups.intro_msg'] = 'Here is a list of all the User Groups using this Dashboard.';
$_lang['dashboard_widget_err_placed'] = 'This widget is already placed in this Dashboard!';
$_lang['dashboard_widgets.intro_msg'] = 'Here you can add, manage, and remove Widgets from this Dashboard. You can also drag and drop the rows in the grid to rearrange them.';
$_lang['dashboards'] = 'Dashboards';
$_lang['dashboards.intro_msg'] = 'Here you can manage all the available Dashboards for this MODX manager.';
$_lang['rank'] = 'Rank';
$_lang['user_group_filter'] = 'By User Group';
$_lang['widget'] = 'Widget';
$_lang['widget_content'] = 'Widget Content';
$_lang['widget_create'] = 'Create New Widget';
$_lang['widget_err_ae_name'] = 'A widget with the name "[[+name]]" already exists! Please try another name.';
$_lang['widget_err_nf'] = 'Widget not found!';
$_lang['widget_err_ns'] = 'Widget not specified!';
$_lang['widget_err_ns_name'] = 'Please specify a name for the widget.';
$_lang['widget_err_remove'] = 'An error occurred while trying to remove the Widget.';
$_lang['widget_err_save'] = 'An error occurred while trying to save the Widget.';
$_lang['widget_file'] = 'File';
$_lang['widget_dashboards.intro_msg'] = 'Below is a list of all the Dashboards that this Widget has been placed on.';
$_lang['widget_dashboard_remove'] = 'Remove Widget From Dashboard';
$_lang['widget_description_desc'] = 'A description, or Lexicon Entry key, of the Widget and what it does.';
$_lang['widget_html'] = 'HTML';
$_lang['widget_lexicon_desc'] = 'The Lexicon Topic to load with this Widget. Useful for providing translations for the name and description, as well as any text in the widget.';
$_lang['widget_name_desc'] = 'The name, or Lexicon Entry key, of the Widget.';
$_lang['widget_new'] = 'New Widget';
$_lang['widget_remove'] = 'Delete Widget';
$_lang['widget_remove_confirm'] = 'Are you sure you want to remove this Dashboard Widget? This is permanent, and will remove the Widget from all Dashboards.';
$_lang['widget_remove_multiple'] = 'Delete Multiple Widgets';
$_lang['widget_remove_multiple_confirm'] = 'Are you sure you want to remove these Dashboard Widgets? This is permanent, and will remove the Widgets from all their assigned Dashboards.';
$_lang['widget_namespace'] = 'Namespace';
$_lang['widget_namespace_desc'] = 'The Namespace that this widget will be loaded into. Useful for custom paths.';
$_lang['widget_php'] = 'Inline PHP Widget';
$_lang['widget_place'] = 'Place Widget';
$_lang['widget_size'] = 'Size';
$_lang['widget_size_desc'] = 'The size of the widget. Can either be a half-screen wide ("Half"), the width of the screen ("Full"), or a full screen width and two rows ("Double").';
$_lang['widget_size_double'] = 'Double';
$_lang['widget_size_full'] = 'Full';
$_lang['widget_size_half'] = 'Half';
$_lang['widget_snippet'] = 'Snippet';
$_lang['widget_type'] = 'Widget Type';
$_lang['widget_type_desc'] = 'The type of widget this is. "Snippet" widgets are MODX Snippets that are run and return their output. "HTML" widgets are just straight HTML. "File" widgets are loaded directly from files, which can either return their output or the name of the modDashboardWidgetClass-extended class to load. "Inline PHP" Widgets are widgets that are straight PHP in the widget content, similar to a Snippet.';
$_lang['widget_unplace'] = 'Remove Widget from Dashboard';
$_lang['widget_update'] = 'Update Widget';
$_lang['widgets'] = 'Widgets';
$_lang['widgets.intro_msg'] = 'Below is a list of all the installed Dashboard Widgets you have.';
$_lang['w_configcheck'] = 'Configuration Check';
$_lang['w_configcheck_desc'] = 'Displays a configuration check that ensures your MODX install is secure.';
$_lang['w_newsfeed'] = 'MODX News Feed';
$_lang['w_newsfeed_desc'] = 'Displays the MODX News Feed';
$_lang['w_recentlyeditedresources'] = 'Recently Edited Resources';
$_lang['w_recentlyeditedresources_desc'] = 'Shows a list of the most recently edited resources by the user.';
$_lang['w_securityfeed'] = 'MODX Security Feed';
$_lang['w_securityfeed_desc'] = 'Displays the MODX Security Feed';
$_lang['w_whosonline'] = 'Who\'s Online';
$_lang['w_whosonline_desc'] = 'Shows a list of online users.'; | {
"pile_set_name": "Github"
} |
// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package cldr
// This file contains test data.
import (
"io"
"strings"
)
type testLoader struct {
}
func (t testLoader) Len() int {
return len(testFiles)
}
func (t testLoader) Path(i int) string {
return testPaths[i]
}
func (t testLoader) Reader(i int) (io.ReadCloser, error) {
return &reader{*strings.NewReader(testFiles[i])}, nil
}
// reader adds a dummy Close method to strings.Reader so that it
// satisfies the io.ReadCloser interface.
type reader struct {
strings.Reader
}
func (r reader) Close() error {
return nil
}
var (
testFiles = []string{de_xml, gsw_xml, root_xml}
testPaths = []string{
"common/main/de.xml",
"common/main/gsw.xml",
"common/main/root.xml",
}
)
var root_xml = `<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE ldml SYSTEM "../../common/dtd/ldml.dtd">
<ldml>
<identity>
<language type="root"/>
<generation date="now"/>
</identity>
<characters>
<exemplarCharacters>[]</exemplarCharacters>
<exemplarCharacters type="auxiliary">[]</exemplarCharacters>
<exemplarCharacters type="punctuation">[\- ‐ – — … ' ‘ ‚ " “ „ \& #]</exemplarCharacters>
<ellipsis type="final">{0}…</ellipsis>
<ellipsis type="initial">…{0}</ellipsis>
<moreInformation>?</moreInformation>
</characters>
<dates>
<calendars>
<default choice="gregorian"/>
<calendar type="buddhist">
<months>
<alias source="locale" path="../../calendar[@type='gregorian']/months"/>
</months>
</calendar>
<calendar type="chinese">
<months>
<alias source="locale" path="../../calendar[@type='gregorian']/months"/>
</months>
</calendar>
<calendar type="gregorian">
<months>
<default choice="format"/>
<monthContext type="format">
<default choice="wide"/>
<monthWidth type="narrow">
<alias source="locale" path="../../monthContext[@type='stand-alone']/monthWidth[@type='narrow']"/>
</monthWidth>
<monthWidth type="wide">
<month type="1">11</month>
<month type="2">22</month>
<month type="3">33</month>
<month type="4">44</month>
</monthWidth>
</monthContext>
<monthContext type="stand-alone">
<monthWidth type="narrow">
<month type="1">1</month>
<month type="2">2</month>
<month type="3">3</month>
<month type="4">4</month>
</monthWidth>
<monthWidth type="wide">
<alias source="locale" path="../../monthContext[@type='format']/monthWidth[@type='wide']"/>
</monthWidth>
</monthContext>
</months>
</calendar>
</calendars>
</dates>
</ldml>
`
var de_xml = `<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE ldml SYSTEM "../../common/dtd/ldml.dtd">
<ldml>
<identity>
<language type="de"/>
</identity>
<characters>
<exemplarCharacters>[a ä b c d e ö p q r s ß t u ü v w x y z]</exemplarCharacters>
<exemplarCharacters type="auxiliary">[á à ă]</exemplarCharacters>
<exemplarCharacters type="index">[A B C D E F G H Z]</exemplarCharacters>
<ellipsis type="final">{0} …</ellipsis>
<ellipsis type="initial">… {0}</ellipsis>
<moreInformation>?</moreInformation>
<stopwords>
<stopwordList type="collation" draft="provisional">der die das</stopwordList>
</stopwords>
</characters>
<dates>
<calendars>
<calendar type="buddhist">
<months>
<monthContext type="format">
<monthWidth type="narrow">
<month type="3">BBB</month>
</monthWidth>
<monthWidth type="wide">
<month type="3">bbb</month>
</monthWidth>
</monthContext>
</months>
</calendar>
<calendar type="gregorian">
<months>
<monthContext type="format">
<monthWidth type="narrow">
<month type="3">M</month>
<month type="4">A</month>
</monthWidth>
<monthWidth type="wide">
<month type="3">Maerz</month>
<month type="4">April</month>
<month type="5">Mai</month>
</monthWidth>
</monthContext>
<monthContext type="stand-alone">
<monthWidth type="narrow">
<month type="3">m</month>
<month type="5">m</month>
</monthWidth>
<monthWidth type="wide">
<month type="4">april</month>
<month type="5">mai</month>
</monthWidth>
</monthContext>
</months>
</calendar>
</calendars>
</dates>
<posix>
<messages>
<yesstr>yes:y</yesstr>
<nostr>no:n</nostr>
</messages>
</posix>
</ldml>
`
var gsw_xml = `<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE ldml SYSTEM "../../common/dtd/ldml.dtd">
<ldml>
<identity>
<language type="gsw"/>
</identity>
<posix>
<alias source="de" path="//ldml/posix"/>
</posix>
</ldml>
`
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2015 Memorial Sloan-Kettering Cancer Center.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS
* FOR A PARTICULAR PURPOSE. The software and documentation provided hereunder
* is on an "as is" basis, and Memorial Sloan-Kettering Cancer Center has no
* obligations to provide maintenance, support, updates, enhancements or
* modifications. In no event shall Memorial Sloan-Kettering Cancer Center be
* liable to any party for direct, indirect, special, incidental or
* consequential damages, including lost profits, arising out of the use of this
* software and its documentation, even if Memorial Sloan-Kettering Cancer
* Center has been advised of the possibility of such damage.
*/
/*
* This file is part of cBioPortal.
*
* cBioPortal 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.
*
* 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 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/>.
*/
package org.mskcc.cbio.portal.scripts.drug;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
public class DrugDataResource {
private String name;
private String resourceURL;
private String version;
public DrugDataResource() {
}
public DrugDataResource(String name, String resourceURL, String version) {
this.name = name;
this.resourceURL = resourceURL;
this.version = version;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getResourceURL() {
return resourceURL;
}
public void setResourceURL(String resourceURL) {
this.resourceURL = resourceURL;
}
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
public InputStream getResourceAsStream() throws IOException {
URL url = new URL(resourceURL);
return url.openStream();
}
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright 2016 Red Hat Inc.
*
* 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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.
*
* Authors: Ben Skeggs <[email protected]>
*/
#include "ior.h"
void
gm107_sor_dp_pattern(struct nvkm_ior *sor, int pattern)
{
struct nvkm_device *device = sor->disp->engine.subdev.device;
const u32 soff = nv50_ior_base(sor);
const u32 data = 0x01010101 * pattern;
if (sor->asy.link & 1)
nvkm_mask(device, 0x61c110 + soff, 0x0f0f0f0f, data);
else
nvkm_mask(device, 0x61c12c + soff, 0x0f0f0f0f, data);
}
static const struct nvkm_ior_func
gm107_sor = {
.state = gf119_sor_state,
.power = nv50_sor_power,
.clock = gf119_sor_clock,
.hdmi = {
.ctrl = gk104_hdmi_ctrl,
},
.dp = {
.lanes = { 0, 1, 2, 3 },
.links = gf119_sor_dp_links,
.power = g94_sor_dp_power,
.pattern = gm107_sor_dp_pattern,
.drive = gf119_sor_dp_drive,
.vcpi = gf119_sor_dp_vcpi,
.audio = gf119_sor_dp_audio,
.audio_sym = gf119_sor_dp_audio_sym,
.watermark = gf119_sor_dp_watermark,
},
.hda = {
.hpd = gf119_hda_hpd,
.eld = gf119_hda_eld,
},
};
int
gm107_sor_new(struct nvkm_disp *disp, int id)
{
return gf119_sor_new_(&gm107_sor, disp, id);
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2013 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<!-- Default title for color picker dialog [CHAR LIMIT=30] -->
<string name="cpv_default_title">Выберите цвет</string>
<string name="cpv_presets">Предустановки</string>
<string name="cpv_custom">Особый</string>
<string name="cpv_select">Выбрать</string>
<string name="cpv_transparency">Прозрачность</string>
</resources>
| {
"pile_set_name": "Github"
} |
.. _oVirt_module_development:
oVirt Ansible Modules
=====================
The set of modules for interacting with oVirt/RHV are currently part of the community.general collection (on `Galaxy <https://galaxy.ansible.com/community/general>`_, source code `repository <https://github.com/ansible-collections/community.general/tree/main/plugins/modules/cloud/ovirt>`_). This document serves as developer coding guidelines for creating oVirt/RHV modules.
.. contents::
:local:
Naming
------
- All modules should start with an ``ovirt_`` prefix.
- All modules should be named after the resource it manages in singular
form.
- All modules that gather information should have a ``_info``
suffix.
Interface
---------
- Every module should return the ID of the resource it manages.
- Every module should return the dictionary of the resource it manages.
- Never change the name of the parameter, as we guarantee backward
compatibility. Use aliases instead.
- If a parameter can't achieve idempotency for any reason, please
document it.
Interoperability
----------------
- All modules should work against all minor versions of
version 4 of the API. Version 3 of the API is not supported.
Libraries
---------
- All modules should use ``ovirt_full_argument_spec`` or
``ovirt_info_full_argument_spec`` to pick up the standard input (such
as auth and ``fetch_nested``).
- All modules should use ``extends_documentation_fragment``: ovirt to go
along with ``ovirt_full_argument_spec``.
- All info modules should use ``extends_documentation_fragment``:
``ovirt_info`` to go along with ``ovirt_info_full_argument_spec``.
- Functions that are common to all modules should be implemented in the
``module_utils/ovirt.py`` file, so they can be reused.
- Python SDK version 4 must be used.
New module development
----------------------
Please read :ref:`developing_modules`,
first to know what common properties, functions and features every module must
have.
In order to achieve idempotency of oVirt entity attributes, a helper class
was created. The first thing you need to do is to extend this class and override a few
methods:
.. code:: python
try:
import ovirtsdk4.types as otypes
except ImportError:
pass
from ansible.module_utils.ovirt import (
BaseModule,
equal
)
class ClustersModule(BaseModule):
# The build method builds the entity we want to create.
# Always be sure to build only the parameters the user specified
# in their yaml file, so we don't change the values which we shouldn't
# change. If you set the parameter to None, nothing will be changed.
def build_entity(self):
return otypes.Cluster(
name=self.param('name'),
comment=self.param('comment'),
description=self.param('description'),
)
# The update_check method checks if the update is needed to be done on
# the entity. The equal method doesn't check the values which are None,
# which means it doesn't check the values which user didn't set in yaml.
# All other values are checked and if there is found some mismatch,
# the update method is run on the entity, the entity is build by
# 'build_entity' method. You don't have to care about calling the update,
# it's called behind the scene by the 'BaseModule' class.
def update_check(self, entity):
return (
equal(self.param('comment'), entity.comment)
and equal(self.param('description'), entity.description)
)
The code above handle the check if the entity should be updated, so we
don't update the entity if not needed and also it construct the needed
entity of the SDK.
.. code:: python
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.ovirt import (
check_sdk,
create_connection,
ovirt_full_argument_spec,
)
# This module will support two states of the cluster,
# either it will be present or absent. The user can
# specify three parameters: name, comment and description,
# The 'ovirt_full_argument_spec' function, will merge the
# parameters created here with some common one like 'auth':
argument_spec = ovirt_full_argument_spec(
state=dict(
choices=['present', 'absent'],
default='present',
),
name=dict(default=None, required=True),
description=dict(default=None),
comment=dict(default=None),
)
# Create the Ansible module, please always implement the
# feautre called 'check_mode', for 'create', 'update' and
# 'delete' operations it's implemented by default in BaseModule:
module = AnsibleModule(
argument_spec=argument_spec,
supports_check_mode=True,
)
# Check if the user has Python SDK installed:
check_sdk(module)
try:
auth = module.params.pop('auth')
# Create the connection to the oVirt engine:
connection = create_connection(auth)
# Create the service which manages the entity:
clusters_service = connection.system_service().clusters_service()
# Create the module which will handle create, update and delete flow:
clusters_module = ClustersModule(
connection=connection,
module=module,
service=clusters_service,
)
# Check the state and call the appropriate method:
state = module.params['state']
if state == 'present':
ret = clusters_module.create()
elif state == 'absent':
ret = clusters_module.remove()
# The return value of the 'create' and 'remove' method is dictionary
# with the 'id' of the entity we manage and the type of the entity
# with filled in attributes of the entity. The 'change' status is
# also returned by those methods:
module.exit_json(**ret)
except Exception as e:
# Modules can't raises exception, it always must exit with
# 'module.fail_json' in case of exception. Always use
# 'exception=traceback.format_exc' for debugging purposes:
module.fail_json(msg=str(e), exception=traceback.format_exc())
finally:
# Logout only in case the user passed the 'token' in 'auth'
# parameter:
connection.close(logout=auth.get('token') is None)
If your module must support action handling (for example,
virtual machine start) you must ensure that you handle the states of the
virtual machine correctly, and document the behavior of the
module:
.. code:: python
if state == 'running':
ret = vms_module.action(
action='start',
post_action=vms_module._post_start_action,
action_condition=lambda vm: (
vm.status not in [
otypes.VmStatus.MIGRATING,
otypes.VmStatus.POWERING_UP,
otypes.VmStatus.REBOOT_IN_PROGRESS,
otypes.VmStatus.WAIT_FOR_LAUNCH,
otypes.VmStatus.UP,
otypes.VmStatus.RESTORING_STATE,
]
),
wait_condition=lambda vm: vm.status == otypes.VmStatus.UP,
# Start action kwargs:
use_cloud_init=use_cloud_init,
use_sysprep=use_sysprep,
# ...
)
As you can see from the preceding example, the ``action`` method accepts the ``action_condition`` and
``wait_condition``, which are methods which accept the virtual machine
object as a parameter, so you can check whether the virtual
machine is in a proper state before the action. The rest of the
parameters are for the ``start`` action. You may also handle pre-
or post- action tasks by defining ``pre_action`` and ``post_action``
parameters.
Testing
-------
- Integration testing is currently done in oVirt's CI system
`on Jenkins <https://jenkins.ovirt.org/view/All/job/ovirt-system-tests_ansible-suite-master/>`__
and
`on GitHub <https://github.com/oVirt/ovirt-system-tests/tree/master/ansible-suite-master/>`__.
- Please consider using these integration tests if you create a new module or add a new feature to an existing
module.
| {
"pile_set_name": "Github"
} |
/*
* RenderManager - exporting logic common between the CLI and GUI.
*
* Copyright (c) 2015 Ryan Roden-Corrent <ryan/at/rcorre.net>
*
* This file is part of LMMS - https://lmms.io
*
* 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 (see COPYING); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
*/
#include <QDebug>
#include <QDir>
#include "RenderManager.h"
#include "Song.h"
#include "BBTrackContainer.h"
#include "BBTrack.h"
#include "stdshims.h"
RenderManager::RenderManager(
const Mixer::qualitySettings & qualitySettings,
const OutputSettings & outputSettings,
ProjectRenderer::ExportFileFormats fmt,
QString outputPath) :
m_qualitySettings(qualitySettings),
m_oldQualitySettings( Engine::mixer()->currentQualitySettings() ),
m_outputSettings(outputSettings),
m_format(fmt),
m_outputPath(outputPath)
{
Engine::mixer()->storeAudioDevice();
}
RenderManager::~RenderManager()
{
Engine::mixer()->restoreAudioDevice(); // Also deletes audio dev.
Engine::mixer()->changeQuality( m_oldQualitySettings );
}
void RenderManager::abortProcessing()
{
if ( m_activeRenderer ) {
disconnect( m_activeRenderer.get(), SIGNAL( finished() ),
this, SLOT( renderNextTrack() ) );
m_activeRenderer->abortProcessing();
}
restoreMutedState();
}
// Called to render each new track when rendering tracks individually.
void RenderManager::renderNextTrack()
{
m_activeRenderer.reset();
if( m_tracksToRender.isEmpty() )
{
// nothing left to render
restoreMutedState();
emit finished();
}
else
{
// pop the next track from our rendering queue
Track* renderTrack = m_tracksToRender.back();
m_tracksToRender.pop_back();
// mute everything but the track we are about to render
for (auto track : m_unmuted)
{
track->setMuted(track != renderTrack);
}
// for multi-render, prefix each output file with a different number
int trackNum = m_tracksToRender.size() + 1;
render( pathForTrack(renderTrack, trackNum) );
}
}
// Render the song into individual tracks
void RenderManager::renderTracks()
{
const TrackContainer::TrackList & tl = Engine::getSong()->tracks();
// find all currently unnmuted tracks -- we want to render these.
for( auto it = tl.begin(); it != tl.end(); ++it )
{
Track* tk = (*it);
Track::TrackTypes type = tk->type();
// Don't render automation tracks
if ( tk->isMuted() == false &&
( type == Track::InstrumentTrack || type == Track::SampleTrack ) )
{
m_unmuted.push_back(tk);
}
}
const TrackContainer::TrackList t2 = Engine::getBBTrackContainer()->tracks();
for( auto it = t2.begin(); it != t2.end(); ++it )
{
Track* tk = (*it);
Track::TrackTypes type = tk->type();
// Don't render automation tracks
if ( tk->isMuted() == false &&
( type == Track::InstrumentTrack || type == Track::SampleTrack ) )
{
m_unmuted.push_back(tk);
}
}
// copy the list of unmuted tracks into our rendering queue.
// we need to remember which tracks were unmuted to restore state at the end.
m_tracksToRender = m_unmuted;
renderNextTrack();
}
// Render the song into a single track
void RenderManager::renderProject()
{
render( m_outputPath );
}
void RenderManager::render(QString outputPath)
{
m_activeRenderer = make_unique<ProjectRenderer>(
m_qualitySettings,
m_outputSettings,
m_format,
outputPath);
if( m_activeRenderer->isReady() )
{
// pass progress signals through
connect( m_activeRenderer.get(), SIGNAL( progressChanged( int ) ),
this, SIGNAL( progressChanged( int ) ) );
// when it is finished, render the next track.
// if we have not queued any tracks, renderNextTrack will just clean up
connect( m_activeRenderer.get(), SIGNAL( finished() ),
this, SLOT( renderNextTrack() ) );
m_activeRenderer->startProcessing();
}
else
{
qDebug( "Renderer failed to acquire a file device!" );
renderNextTrack();
}
}
// Unmute all tracks that were muted while rendering tracks
void RenderManager::restoreMutedState()
{
while( !m_unmuted.isEmpty() )
{
Track* restoreTrack = m_unmuted.back();
m_unmuted.pop_back();
restoreTrack->setMuted( false );
}
}
// Determine the output path for a track when rendering tracks individually
QString RenderManager::pathForTrack(const Track *track, int num)
{
QString extension = ProjectRenderer::getFileExtensionFromFormat( m_format );
QString name = track->name();
name = name.remove(QRegExp(FILENAME_FILTER));
name = QString( "%1_%2%3" ).arg( num ).arg( name ).arg( extension );
return QDir(m_outputPath).filePath(name);
}
void RenderManager::updateConsoleProgress()
{
if ( m_activeRenderer )
{
m_activeRenderer->updateConsoleProgress();
int totalNum = m_unmuted.size();
if ( totalNum > 0 )
{
// we are rendering multiple tracks, append a track counter to the output
int trackNum = totalNum - m_tracksToRender.size();
fprintf( stderr, "(%d/%d)", trackNum, totalNum );
}
}
}
| {
"pile_set_name": "Github"
} |
2
| {
"pile_set_name": "Github"
} |
var path = require('path')
var utils = require('./utils')
var webpack = require('webpack')
var config = require('../config')
var merge = require('webpack-merge')
var baseWebpackConfig = require('./webpack.base.conf')
var CopyWebpackPlugin = require('copy-webpack-plugin')
var HtmlWebpackPlugin = require('html-webpack-plugin')
var ExtractTextPlugin = require('extract-text-webpack-plugin')
var OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
var env = config.build.env
var webpackConfig = merge(baseWebpackConfig, {
module: {
rules: utils.styleLoaders({
sourceMap: config.build.productionSourceMap,
extract: true
})
},
devtool: config.build.productionSourceMap ? '#source-map' : false,
output: {
path: config.build.assetsRoot,
filename: utils.assetsPath('js/[name].[chunkhash].js'),
chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
},
plugins: [
// http://vuejs.github.io/vue-loader/en/workflow/production.html
new webpack.DefinePlugin({
'process.env': env
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
},
sourceMap: true
}),
// extract css into its own file
new ExtractTextPlugin({
filename: utils.assetsPath('css/[name].[contenthash].css')
}),
// Compress extracted CSS. We are using this plugin so that possible
// duplicated CSS from different components can be deduped.
new OptimizeCSSPlugin({
cssProcessorOptions: {
safe: true
}
}),
// generate dist index.html with correct asset hash for caching.
// you can customize output by editing /index.html
// see https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: config.build.index,
template: 'index.html',
inject: true,
minify: {
removeComments: true,
collapseWhitespace: true,
removeAttributeQuotes: true
// more options:
// https://github.com/kangax/html-minifier#options-quick-reference
},
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
chunksSortMode: 'dependency'
}),
// split vendor js into its own file
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks: function (module, count) {
// any required modules inside node_modules are extracted to vendor
return (
module.resource &&
/\.js$/.test(module.resource) &&
module.resource.indexOf(
path.join(__dirname, '../node_modules')
) === 0
)
}
}),
// extract webpack runtime and module manifest to its own file in order to
// prevent vendor hash from being updated whenever app bundle is updated
new webpack.optimize.CommonsChunkPlugin({
name: 'manifest',
chunks: ['vendor']
}),
// copy custom static assets
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../static'),
to: config.build.assetsSubDirectory,
ignore: ['.*']
}
])
]
})
if (config.build.productionGzip) {
var CompressionWebpackPlugin = require('compression-webpack-plugin')
webpackConfig.plugins.push(
new CompressionWebpackPlugin({
asset: '[path].gz[query]',
algorithm: 'gzip',
test: new RegExp(
'\\.(' +
config.build.productionGzipExtensions.join('|') +
')$'
),
threshold: 10240,
minRatio: 0.8
})
)
}
if (config.build.bundleAnalyzerReport) {
var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
webpackConfig.plugins.push(new BundleAnalyzerPlugin())
}
module.exports = webpackConfig
| {
"pile_set_name": "Github"
} |
./test_dns_lookup: dict_regexp_lookup: no-mx.reg: porcupine.org. 3600 IN MX 10 spike.porcupine.org.
./test_dns_lookup: dict_regexp_lookup: no-mx.reg: porcupine.org. 3600 IN MX 30 m1.porcupine.org.
./test_dns_lookup: dict_regexp_lookup: no-mx.reg: porcupine.org. 3600 IN MX 30 vz.porcupine.org.
./test_dns_lookup: dns_get_answer: type MX for porcupine.org
./test_dns_lookup: dns_get_answer: type MX for porcupine.org
./test_dns_lookup: dns_get_answer: type MX for porcupine.org
./test_dns_lookup: dns_query: porcupine.org (MX): OK
./test_dns_lookup: ignoring DNS RR: porcupine.org. 3600 IN MX 10 spike.porcupine.org.
./test_dns_lookup: ignoring DNS RR: porcupine.org. 3600 IN MX 30 m1.porcupine.org.
./test_dns_lookup: ignoring DNS RR: porcupine.org. 3600 IN MX 30 vz.porcupine.org.
./test_dns_lookup: lookup porcupine.org type MX flags RES_USE_DNSSEC
./test_dns_lookup: maps_find: DNS reply filter: regexp:no-mx.reg(0,lock|fold_fix): porcupine.org. 3600 IN MX 10 spike.porcupine.org. = ignore
./test_dns_lookup: maps_find: DNS reply filter: regexp:no-mx.reg(0,lock|fold_fix): porcupine.org. 3600 IN MX 30 m1.porcupine.org. = ignore
./test_dns_lookup: maps_find: DNS reply filter: regexp:no-mx.reg(0,lock|fold_fix): porcupine.org. 3600 IN MX 30 vz.porcupine.org. = ignore
./test_dns_lookup: warning: Error looking up name=porcupine.org type=MX: DNS reply filter drops all results (rcode=0)
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.uimanager;
import android.view.View;
import androidx.annotation.Nullable;
/**
* This is an interface that must be implemented by classes that wish to take over the
* responsibility of setting properties of all views managed by the view manager.
*
* @param <T> the type of the view supported by this delegate
*/
public interface ViewManagerDelegate<T extends View> {
void setProperty(T view, String propName, @Nullable Object value);
}
| {
"pile_set_name": "Github"
} |
syntax = "proto3";
package envoy.type.matcher;
import "envoy/type/matcher/number.proto";
import "envoy/type/matcher/string.proto";
import "udpa/annotations/status.proto";
import "validate/validate.proto";
option java_package = "io.envoyproxy.envoy.type.matcher";
option java_outer_classname = "ValueProto";
option java_multiple_files = true;
option (udpa.annotations.file_status).package_version_status = FROZEN;
// [#protodoc-title: Value matcher]
// Specifies the way to match a ProtobufWkt::Value. Primitive values and ListValue are supported.
// StructValue is not supported and is always not matched.
// [#next-free-field: 7]
message ValueMatcher {
// NullMatch is an empty message to specify a null value.
message NullMatch {
}
// Specifies how to match a value.
oneof match_pattern {
option (validate.required) = true;
// If specified, a match occurs if and only if the target value is a NullValue.
NullMatch null_match = 1;
// If specified, a match occurs if and only if the target value is a double value and is
// matched to this field.
DoubleMatcher double_match = 2;
// If specified, a match occurs if and only if the target value is a string value and is
// matched to this field.
StringMatcher string_match = 3;
// If specified, a match occurs if and only if the target value is a bool value and is equal
// to this field.
bool bool_match = 4;
// If specified, value match will be performed based on whether the path is referring to a
// valid primitive value in the metadata. If the path is referring to a non-primitive value,
// the result is always not matched.
bool present_match = 5;
// If specified, a match occurs if and only if the target value is a list value and
// is matched to this field.
ListMatcher list_match = 6;
}
}
// Specifies the way to match a list value.
message ListMatcher {
oneof match_pattern {
option (validate.required) = true;
// If specified, at least one of the values in the list must match the value specified.
ValueMatcher one_of = 1;
}
}
| {
"pile_set_name": "Github"
} |
void foo()
{
}
| {
"pile_set_name": "Github"
} |
#include <ostream>
#include "IOMC/ParticleGuns/interface/FlatRandomPtAndDxyGunProducer.h"
#include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"
#include "SimDataFormats/GeneratorProducts/interface/GenEventInfoProduct.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/Utilities/interface/RandomNumberGenerator.h"
#include "CLHEP/Random/RandFlat.h"
using namespace edm;
using namespace std;
FlatRandomPtAndDxyGunProducer::FlatRandomPtAndDxyGunProducer(const ParameterSet& pset) : BaseFlatGunProducer(pset) {
ParameterSet defpset;
ParameterSet pgun_params = pset.getParameter<ParameterSet>("PGunParameters");
fMinPt = pgun_params.getParameter<double>("MinPt");
fMaxPt = pgun_params.getParameter<double>("MaxPt");
dxyMin_ = pgun_params.getParameter<double>("dxyMin");
dxyMax_ = pgun_params.getParameter<double>("dxyMax");
lxyMax_ = pgun_params.getParameter<double>("LxyMax");
lzMax_ = pgun_params.getParameter<double>("LzMax");
ConeRadius_ = pgun_params.getParameter<double>("ConeRadius");
ConeH_ = pgun_params.getParameter<double>("ConeH");
DistanceToAPEX_ = pgun_params.getParameter<double>("DistanceToAPEX");
produces<HepMCProduct>("unsmeared");
produces<GenEventInfoProduct>();
}
FlatRandomPtAndDxyGunProducer::~FlatRandomPtAndDxyGunProducer() {
// no need to cleanup GenEvent memory - done in HepMCProduct
}
void FlatRandomPtAndDxyGunProducer::produce(Event& e, const EventSetup& es) {
edm::Service<edm::RandomNumberGenerator> rng;
CLHEP::HepRandomEngine* engine = &rng->getEngine(e.streamID());
if (fVerbosity > 0) {
cout << " FlatRandomPtAndDxyGunProducer : Begin New Event Generation" << endl;
}
// event loop (well, another step in it...)
// no need to clean up GenEvent memory - done in HepMCProduct
//
// here re-create fEvt (memory)
//
fEvt = new HepMC::GenEvent();
// now actualy, cook up the event from PDGTable and gun parameters
int barcode = 1;
for (unsigned int ip = 0; ip < fPartIDs.size(); ++ip) {
double phi_vtx = 0;
double dxy = 0;
double pt = 0;
double eta = 0;
double px = 0;
double py = 0;
double pz = 0;
double vx = 0;
double vy = 0;
double vz = 0;
double lxy = 0;
bool passLoop = false;
while (not passLoop) {
bool passLxy = false;
bool passLz = false;
phi_vtx = CLHEP::RandFlat::shoot(engine, fMinPhi, fMaxPhi);
dxy = CLHEP::RandFlat::shoot(engine, dxyMin_, dxyMax_);
float dxysign = CLHEP::RandFlat::shoot(engine, -1, 1);
if (dxysign < 0)
dxy = -dxy;
pt = CLHEP::RandFlat::shoot(engine, fMinPt, fMaxPt);
px = pt * cos(phi_vtx);
py = pt * sin(phi_vtx);
for (int i = 0; i < 10000; i++) {
vx = CLHEP::RandFlat::shoot(engine, -lxyMax_, lxyMax_);
vy = (pt * dxy + vx * py) / px;
lxy = sqrt(vx * vx + vy * vy);
if (lxy < abs(lxyMax_) and (vx * px + vy * py) > 0) {
passLxy = true;
break;
}
}
eta = CLHEP::RandFlat::shoot(engine, fMinEta, fMaxEta);
pz = pt * sinh(eta);
//vz = fabs(fRandomGaussGenerator->fire(0.0, LzWidth_/2.0));
float ConeTheta = ConeRadius_ / ConeH_;
for (int j = 0; j < 100; j++) {
vz = CLHEP::RandFlat::shoot(engine, 0.0, lzMax_); // this is abs(vz)
float v0 = vz - DistanceToAPEX_;
if (v0 <= 0 or lxy * lxy / (ConeTheta * ConeTheta) > v0 * v0) {
passLz = true;
break;
}
}
if (pz < 0)
vz = -vz;
passLoop = (passLxy and passLz);
if (passLoop)
break;
}
HepMC::GenVertex* Vtx1 = new HepMC::GenVertex(HepMC::FourVector(vx, vy, vz));
int PartID = fPartIDs[ip];
const HepPDT::ParticleData* PData = fPDGTable->particle(HepPDT::ParticleID(abs(PartID)));
double mass = PData->mass().value();
double energy2 = px * px + py * py + pz * pz + mass * mass;
double energy = sqrt(energy2);
HepMC::FourVector p(px, py, pz, energy);
HepMC::GenParticle* Part = new HepMC::GenParticle(p, PartID, 1);
Part->suggest_barcode(barcode);
barcode++;
Vtx1->add_particle_out(Part);
fEvt->add_vertex(Vtx1);
if (fAddAntiParticle) {
HepMC::GenVertex* Vtx2 = new HepMC::GenVertex(HepMC::FourVector(-vx, -vy, -vz));
HepMC::FourVector ap(-px, -py, -pz, energy);
int APartID = -PartID;
if (PartID == 22 || PartID == 23) {
APartID = PartID;
}
HepMC::GenParticle* APart = new HepMC::GenParticle(ap, APartID, 1);
APart->suggest_barcode(barcode);
barcode++;
Vtx2->add_particle_out(APart);
fEvt->add_vertex(Vtx2);
}
}
fEvt->set_event_number(e.id().event());
fEvt->set_signal_process_id(20);
if (fVerbosity > 0) {
fEvt->print();
}
unique_ptr<HepMCProduct> BProduct(new HepMCProduct());
BProduct->addHepMCData(fEvt);
e.put(std::move(BProduct), "unsmeared");
unique_ptr<GenEventInfoProduct> genEventInfo(new GenEventInfoProduct(fEvt));
e.put(std::move(genEventInfo));
if (fVerbosity > 0) {
cout << " FlatRandomPtAndDxyGunProducer : End New Event Generation" << endl;
fEvt->print();
}
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2016-2020 VMware, Inc. All Rights Reserved.
* This software is released under MIT license.
* The full license information can be found in LICENSE in the root directory of this project.
*/
import { Component } from '@angular/core';
@Component({
selector: 'clr-hot-fuss-demo',
template: `
<!--https://en.wikipedia.org/wiki/Hot_Fuss-->
<h4>Hot Fuss (2004)</h4>
<p>
Hot Fuss is the debut studio album by American rock band The Killers. It was released on June 7, 2004 in the
United Kingdom and on June 15, 2004 in the United States. The album is mostly influenced by new wave music and
post-punk. Hot Fuss produced several commercially and critically successful singles: "Mr. Brightside", "Somebody
Told Me", "All These Things That I've Done" and "Smile Like You Mean It".
</p>
`,
})
export class HotFuss2Demo {}
| {
"pile_set_name": "Github"
} |
================================================================================
= =
= Notepad3 - light-weight Scintilla-based text editor for Windows =
= =
= (c) Rizonesoft 2008-2016 =
= https://www.rizonesoft.com =
= =
================================================================================
Description
--------------------------------------------------------------------------------
Notepad like text editor based on the Scintilla source code. Notepad3 based on
code from Notepad2 and MiniPath on code from metapath.
--------------------------------------------------------------------------------
Changes compared to Flo's official Notepad2 (made in Notepad2-mod):
--------------------------------------------------------------------------------
- Code folding
- Support for bookmarks
- Option to mark all occurrences of a word
- Updated Scintilla component
- Word auto-completion
- Syntax highlighting support for AutoHotkey (AHK), AutoIt3, AviSynth, Bash,
CMake, CoffeeScript, Inno Setup, LaTeX, Lua, Markdown, NSIS, Ruby, Tcl,
YAML and VHDL scripts.
- Improved support for NFO ANSI art
- Other various minor changes and tweaks
--------------------------------------------------------------------------------
Changes compared to the Notepad2-mod fork:
--------------------------------------------------------------------------------
- Additional syntax highlighting support for Awk, D, golang, MATLAB
- State of the art Regular Expression search engine (Onigmu)
- New toolbar icons based on Yusuke Kamiyaman's Fugue Icons
(Purchased by Rizonesoft)
- Hyperlink Hotspot highlighting
(single click Open in Browser (Ctrl) / Load in Editor (Alt))
- New program icon and other small cosmetic changes
- In-App support for AES-256 Rijndael encryption/decryption of files.
(incl. external commandline tool for batch processing)
- Virtual Space rectangular selection box (Alt-Key down)
- High-DPI awareness, including high definition toolbar icons
- Undo/Redo preserves selection
- File History preserves Caret position (optional)
and remembers encoding of file
- Accelerated word navigation
- Preserve caret position of items in file history
- Count occurrences of a marked selection or word
- Count and Mark occurrences of matching search/find expression
- Visual Studio style copy/paste current line (no selection)
- Insert GUIDs
- Dropped support for Windows XP version
- Other various minor changes, tweaks and bugfixes
--------------------------------------------------------------------------------
Supported Operating Systems:
--------------------------------------------------------------------------------
Windows 7, 8, 8.1 and 10 both 32-bit and 64-bit
--------------------------------------------------------------------------------
Contributors
--------------------------------------------------------------------------------
- Rainer Kottenhoff
- Florian Balmer ( http://www.flos-freeware.ch )
- XhmikosR ( http://xhmikosr.github.io/notepad2-mod/ )
- Kai Liu ( http://code.kliu.org/misc/notepad2/ )
- RL Vision
- Aleksandar Lekov
- Bruno Barbieri | {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2019 Hemanth Savarala.
*
* Licensed under the GNU General Public License v3
*
* This 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 software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*/
package code.name.monkey.retromusic.volume;
import android.database.ContentObserver;
import android.media.AudioManager;
import android.net.Uri;
import android.os.Handler;
import androidx.annotation.NonNull;
public class AudioVolumeContentObserver extends ContentObserver {
private final OnAudioVolumeChangedListener mListener;
private final AudioManager mAudioManager;
private final int mAudioStreamType;
private float mLastVolume;
AudioVolumeContentObserver(@NonNull Handler handler, @NonNull AudioManager audioManager,
int audioStreamType,
@NonNull OnAudioVolumeChangedListener listener) {
super(handler);
mAudioManager = audioManager;
mAudioStreamType = audioStreamType;
mListener = listener;
mLastVolume = audioManager.getStreamVolume(mAudioStreamType);
}
/**
* Depending on the handler this method may be executed on the UI thread
*/
@Override
public void onChange(boolean selfChange, Uri uri) {
if (mAudioManager != null && mListener != null) {
int maxVolume = mAudioManager.getStreamMaxVolume(mAudioStreamType);
int currentVolume = mAudioManager.getStreamVolume(mAudioStreamType);
if (currentVolume != mLastVolume) {
mLastVolume = currentVolume;
mListener.onAudioVolumeChanged(currentVolume, maxVolume);
}
}
}
@Override
public boolean deliverSelfNotifications() {
return super.deliverSelfNotifications();
}
} | {
"pile_set_name": "Github"
} |
/*
*
* Copyright 2018 gRPC 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 grpc
import (
"context"
"fmt"
"net"
"time"
"google.golang.org/grpc/backoff"
"google.golang.org/grpc/balancer"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/internal"
internalbackoff "google.golang.org/grpc/internal/backoff"
"google.golang.org/grpc/internal/envconfig"
"google.golang.org/grpc/internal/transport"
"google.golang.org/grpc/keepalive"
"google.golang.org/grpc/resolver"
"google.golang.org/grpc/stats"
)
// dialOptions configure a Dial call. dialOptions are set by the DialOption
// values passed to Dial.
type dialOptions struct {
unaryInt UnaryClientInterceptor
streamInt StreamClientInterceptor
chainUnaryInts []UnaryClientInterceptor
chainStreamInts []StreamClientInterceptor
cp Compressor
dc Decompressor
bs internalbackoff.Strategy
block bool
insecure bool
timeout time.Duration
scChan <-chan ServiceConfig
authority string
copts transport.ConnectOptions
callOptions []CallOption
// This is used by v1 balancer dial option WithBalancer to support v1
// balancer, and also by WithBalancerName dial option.
balancerBuilder balancer.Builder
channelzParentID int64
disableServiceConfig bool
disableRetry bool
disableHealthCheck bool
healthCheckFunc internal.HealthChecker
minConnectTimeout func() time.Duration
defaultServiceConfig *ServiceConfig // defaultServiceConfig is parsed from defaultServiceConfigRawJSON.
defaultServiceConfigRawJSON *string
// This is used by ccResolverWrapper to backoff between successive calls to
// resolver.ResolveNow(). The user will have no need to configure this, but
// we need to be able to configure this in tests.
resolveNowBackoff func(int) time.Duration
resolvers []resolver.Builder
}
// DialOption configures how we set up the connection.
type DialOption interface {
apply(*dialOptions)
}
// EmptyDialOption does not alter the dial configuration. It can be embedded in
// another structure to build custom dial options.
//
// This API is EXPERIMENTAL.
type EmptyDialOption struct{}
func (EmptyDialOption) apply(*dialOptions) {}
// funcDialOption wraps a function that modifies dialOptions into an
// implementation of the DialOption interface.
type funcDialOption struct {
f func(*dialOptions)
}
func (fdo *funcDialOption) apply(do *dialOptions) {
fdo.f(do)
}
func newFuncDialOption(f func(*dialOptions)) *funcDialOption {
return &funcDialOption{
f: f,
}
}
// WithWriteBufferSize determines how much data can be batched before doing a
// write on the wire. The corresponding memory allocation for this buffer will
// be twice the size to keep syscalls low. The default value for this buffer is
// 32KB.
//
// Zero will disable the write buffer such that each write will be on underlying
// connection. Note: A Send call may not directly translate to a write.
func WithWriteBufferSize(s int) DialOption {
return newFuncDialOption(func(o *dialOptions) {
o.copts.WriteBufferSize = s
})
}
// WithReadBufferSize lets you set the size of read buffer, this determines how
// much data can be read at most for each read syscall.
//
// The default value for this buffer is 32KB. Zero will disable read buffer for
// a connection so data framer can access the underlying conn directly.
func WithReadBufferSize(s int) DialOption {
return newFuncDialOption(func(o *dialOptions) {
o.copts.ReadBufferSize = s
})
}
// WithInitialWindowSize returns a DialOption which sets the value for initial
// window size on a stream. The lower bound for window size is 64K and any value
// smaller than that will be ignored.
func WithInitialWindowSize(s int32) DialOption {
return newFuncDialOption(func(o *dialOptions) {
o.copts.InitialWindowSize = s
})
}
// WithInitialConnWindowSize returns a DialOption which sets the value for
// initial window size on a connection. The lower bound for window size is 64K
// and any value smaller than that will be ignored.
func WithInitialConnWindowSize(s int32) DialOption {
return newFuncDialOption(func(o *dialOptions) {
o.copts.InitialConnWindowSize = s
})
}
// WithMaxMsgSize returns a DialOption which sets the maximum message size the
// client can receive.
//
// Deprecated: use WithDefaultCallOptions(MaxCallRecvMsgSize(s)) instead. Will
// be supported throughout 1.x.
func WithMaxMsgSize(s int) DialOption {
return WithDefaultCallOptions(MaxCallRecvMsgSize(s))
}
// WithDefaultCallOptions returns a DialOption which sets the default
// CallOptions for calls over the connection.
func WithDefaultCallOptions(cos ...CallOption) DialOption {
return newFuncDialOption(func(o *dialOptions) {
o.callOptions = append(o.callOptions, cos...)
})
}
// WithCodec returns a DialOption which sets a codec for message marshaling and
// unmarshaling.
//
// Deprecated: use WithDefaultCallOptions(ForceCodec(_)) instead. Will be
// supported throughout 1.x.
func WithCodec(c Codec) DialOption {
return WithDefaultCallOptions(CallCustomCodec(c))
}
// WithCompressor returns a DialOption which sets a Compressor to use for
// message compression. It has lower priority than the compressor set by the
// UseCompressor CallOption.
//
// Deprecated: use UseCompressor instead. Will be supported throughout 1.x.
func WithCompressor(cp Compressor) DialOption {
return newFuncDialOption(func(o *dialOptions) {
o.cp = cp
})
}
// WithDecompressor returns a DialOption which sets a Decompressor to use for
// incoming message decompression. If incoming response messages are encoded
// using the decompressor's Type(), it will be used. Otherwise, the message
// encoding will be used to look up the compressor registered via
// encoding.RegisterCompressor, which will then be used to decompress the
// message. If no compressor is registered for the encoding, an Unimplemented
// status error will be returned.
//
// Deprecated: use encoding.RegisterCompressor instead. Will be supported
// throughout 1.x.
func WithDecompressor(dc Decompressor) DialOption {
return newFuncDialOption(func(o *dialOptions) {
o.dc = dc
})
}
// WithBalancer returns a DialOption which sets a load balancer with the v1 API.
// Name resolver will be ignored if this DialOption is specified.
//
// Deprecated: use the new balancer APIs in balancer package and
// WithBalancerName. Will be removed in a future 1.x release.
func WithBalancer(b Balancer) DialOption {
return newFuncDialOption(func(o *dialOptions) {
o.balancerBuilder = &balancerWrapperBuilder{
b: b,
}
})
}
// WithBalancerName sets the balancer that the ClientConn will be initialized
// with. Balancer registered with balancerName will be used. This function
// panics if no balancer was registered by balancerName.
//
// The balancer cannot be overridden by balancer option specified by service
// config.
//
// Deprecated: use WithDefaultServiceConfig and WithDisableServiceConfig
// instead. Will be removed in a future 1.x release.
func WithBalancerName(balancerName string) DialOption {
builder := balancer.Get(balancerName)
if builder == nil {
panic(fmt.Sprintf("grpc.WithBalancerName: no balancer is registered for name %v", balancerName))
}
return newFuncDialOption(func(o *dialOptions) {
o.balancerBuilder = builder
})
}
// WithServiceConfig returns a DialOption which has a channel to read the
// service configuration.
//
// Deprecated: service config should be received through name resolver or via
// WithDefaultServiceConfig, as specified at
// https://github.com/grpc/grpc/blob/master/doc/service_config.md. Will be
// removed in a future 1.x release.
func WithServiceConfig(c <-chan ServiceConfig) DialOption {
return newFuncDialOption(func(o *dialOptions) {
o.scChan = c
})
}
// WithConnectParams configures the dialer to use the provided ConnectParams.
//
// The backoff configuration specified as part of the ConnectParams overrides
// all defaults specified in
// https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md. Consider
// using the backoff.DefaultConfig as a base, in cases where you want to
// override only a subset of the backoff configuration.
//
// This API is EXPERIMENTAL.
func WithConnectParams(p ConnectParams) DialOption {
return newFuncDialOption(func(o *dialOptions) {
o.bs = internalbackoff.Exponential{Config: p.Backoff}
o.minConnectTimeout = func() time.Duration {
return p.MinConnectTimeout
}
})
}
// WithBackoffMaxDelay configures the dialer to use the provided maximum delay
// when backing off after failed connection attempts.
//
// Deprecated: use WithConnectParams instead. Will be supported throughout 1.x.
func WithBackoffMaxDelay(md time.Duration) DialOption {
return WithBackoffConfig(BackoffConfig{MaxDelay: md})
}
// WithBackoffConfig configures the dialer to use the provided backoff
// parameters after connection failures.
//
// Deprecated: use WithConnectParams instead. Will be supported throughout 1.x.
func WithBackoffConfig(b BackoffConfig) DialOption {
bc := backoff.DefaultConfig
bc.MaxDelay = b.MaxDelay
return withBackoff(internalbackoff.Exponential{Config: bc})
}
// withBackoff sets the backoff strategy used for connectRetryNum after a failed
// connection attempt.
//
// This can be exported if arbitrary backoff strategies are allowed by gRPC.
func withBackoff(bs internalbackoff.Strategy) DialOption {
return newFuncDialOption(func(o *dialOptions) {
o.bs = bs
})
}
// WithBlock returns a DialOption which makes caller of Dial blocks until the
// underlying connection is up. Without this, Dial returns immediately and
// connecting the server happens in background.
func WithBlock() DialOption {
return newFuncDialOption(func(o *dialOptions) {
o.block = true
})
}
// WithInsecure returns a DialOption which disables transport security for this
// ClientConn. Note that transport security is required unless WithInsecure is
// set.
func WithInsecure() DialOption {
return newFuncDialOption(func(o *dialOptions) {
o.insecure = true
})
}
// WithTransportCredentials returns a DialOption which configures a connection
// level security credentials (e.g., TLS/SSL). This should not be used together
// with WithCredentialsBundle.
func WithTransportCredentials(creds credentials.TransportCredentials) DialOption {
return newFuncDialOption(func(o *dialOptions) {
o.copts.TransportCredentials = creds
})
}
// WithPerRPCCredentials returns a DialOption which sets credentials and places
// auth state on each outbound RPC.
func WithPerRPCCredentials(creds credentials.PerRPCCredentials) DialOption {
return newFuncDialOption(func(o *dialOptions) {
o.copts.PerRPCCredentials = append(o.copts.PerRPCCredentials, creds)
})
}
// WithCredentialsBundle returns a DialOption to set a credentials bundle for
// the ClientConn.WithCreds. This should not be used together with
// WithTransportCredentials.
//
// This API is experimental.
func WithCredentialsBundle(b credentials.Bundle) DialOption {
return newFuncDialOption(func(o *dialOptions) {
o.copts.CredsBundle = b
})
}
// WithTimeout returns a DialOption that configures a timeout for dialing a
// ClientConn initially. This is valid if and only if WithBlock() is present.
//
// Deprecated: use DialContext instead of Dial and context.WithTimeout
// instead. Will be supported throughout 1.x.
func WithTimeout(d time.Duration) DialOption {
return newFuncDialOption(func(o *dialOptions) {
o.timeout = d
})
}
// WithContextDialer returns a DialOption that sets a dialer to create
// connections. If FailOnNonTempDialError() is set to true, and an error is
// returned by f, gRPC checks the error's Temporary() method to decide if it
// should try to reconnect to the network address.
func WithContextDialer(f func(context.Context, string) (net.Conn, error)) DialOption {
return newFuncDialOption(func(o *dialOptions) {
o.copts.Dialer = f
})
}
func init() {
internal.WithHealthCheckFunc = withHealthCheckFunc
}
// WithDialer returns a DialOption that specifies a function to use for dialing
// network addresses. If FailOnNonTempDialError() is set to true, and an error
// is returned by f, gRPC checks the error's Temporary() method to decide if it
// should try to reconnect to the network address.
//
// Deprecated: use WithContextDialer instead. Will be supported throughout
// 1.x.
func WithDialer(f func(string, time.Duration) (net.Conn, error)) DialOption {
return WithContextDialer(
func(ctx context.Context, addr string) (net.Conn, error) {
if deadline, ok := ctx.Deadline(); ok {
return f(addr, time.Until(deadline))
}
return f(addr, 0)
})
}
// WithStatsHandler returns a DialOption that specifies the stats handler for
// all the RPCs and underlying network connections in this ClientConn.
func WithStatsHandler(h stats.Handler) DialOption {
return newFuncDialOption(func(o *dialOptions) {
o.copts.StatsHandler = h
})
}
// FailOnNonTempDialError returns a DialOption that specifies if gRPC fails on
// non-temporary dial errors. If f is true, and dialer returns a non-temporary
// error, gRPC will fail the connection to the network address and won't try to
// reconnect. The default value of FailOnNonTempDialError is false.
//
// FailOnNonTempDialError only affects the initial dial, and does not do
// anything useful unless you are also using WithBlock().
//
// This is an EXPERIMENTAL API.
func FailOnNonTempDialError(f bool) DialOption {
return newFuncDialOption(func(o *dialOptions) {
o.copts.FailOnNonTempDialError = f
})
}
// WithUserAgent returns a DialOption that specifies a user agent string for all
// the RPCs.
func WithUserAgent(s string) DialOption {
return newFuncDialOption(func(o *dialOptions) {
o.copts.UserAgent = s
})
}
// WithKeepaliveParams returns a DialOption that specifies keepalive parameters
// for the client transport.
func WithKeepaliveParams(kp keepalive.ClientParameters) DialOption {
if kp.Time < internal.KeepaliveMinPingTime {
grpclog.Warningf("Adjusting keepalive ping interval to minimum period of %v", internal.KeepaliveMinPingTime)
kp.Time = internal.KeepaliveMinPingTime
}
return newFuncDialOption(func(o *dialOptions) {
o.copts.KeepaliveParams = kp
})
}
// WithUnaryInterceptor returns a DialOption that specifies the interceptor for
// unary RPCs.
func WithUnaryInterceptor(f UnaryClientInterceptor) DialOption {
return newFuncDialOption(func(o *dialOptions) {
o.unaryInt = f
})
}
// WithChainUnaryInterceptor returns a DialOption that specifies the chained
// interceptor for unary RPCs. The first interceptor will be the outer most,
// while the last interceptor will be the inner most wrapper around the real call.
// All interceptors added by this method will be chained, and the interceptor
// defined by WithUnaryInterceptor will always be prepended to the chain.
func WithChainUnaryInterceptor(interceptors ...UnaryClientInterceptor) DialOption {
return newFuncDialOption(func(o *dialOptions) {
o.chainUnaryInts = append(o.chainUnaryInts, interceptors...)
})
}
// WithStreamInterceptor returns a DialOption that specifies the interceptor for
// streaming RPCs.
func WithStreamInterceptor(f StreamClientInterceptor) DialOption {
return newFuncDialOption(func(o *dialOptions) {
o.streamInt = f
})
}
// WithChainStreamInterceptor returns a DialOption that specifies the chained
// interceptor for unary RPCs. The first interceptor will be the outer most,
// while the last interceptor will be the inner most wrapper around the real call.
// All interceptors added by this method will be chained, and the interceptor
// defined by WithStreamInterceptor will always be prepended to the chain.
func WithChainStreamInterceptor(interceptors ...StreamClientInterceptor) DialOption {
return newFuncDialOption(func(o *dialOptions) {
o.chainStreamInts = append(o.chainStreamInts, interceptors...)
})
}
// WithAuthority returns a DialOption that specifies the value to be used as the
// :authority pseudo-header. This value only works with WithInsecure and has no
// effect if TransportCredentials are present.
func WithAuthority(a string) DialOption {
return newFuncDialOption(func(o *dialOptions) {
o.authority = a
})
}
// WithChannelzParentID returns a DialOption that specifies the channelz ID of
// current ClientConn's parent. This function is used in nested channel creation
// (e.g. grpclb dial).
//
// This API is EXPERIMENTAL.
func WithChannelzParentID(id int64) DialOption {
return newFuncDialOption(func(o *dialOptions) {
o.channelzParentID = id
})
}
// WithDisableServiceConfig returns a DialOption that causes gRPC to ignore any
// service config provided by the resolver and provides a hint to the resolver
// to not fetch service configs.
//
// Note that this dial option only disables service config from resolver. If
// default service config is provided, gRPC will use the default service config.
func WithDisableServiceConfig() DialOption {
return newFuncDialOption(func(o *dialOptions) {
o.disableServiceConfig = true
})
}
// WithDefaultServiceConfig returns a DialOption that configures the default
// service config, which will be used in cases where:
//
// 1. WithDisableServiceConfig is also used.
// 2. Resolver does not return a service config or if the resolver returns an
// invalid service config.
//
// This API is EXPERIMENTAL.
func WithDefaultServiceConfig(s string) DialOption {
return newFuncDialOption(func(o *dialOptions) {
o.defaultServiceConfigRawJSON = &s
})
}
// WithDisableRetry returns a DialOption that disables retries, even if the
// service config enables them. This does not impact transparent retries, which
// will happen automatically if no data is written to the wire or if the RPC is
// unprocessed by the remote server.
//
// Retry support is currently disabled by default, but will be enabled by
// default in the future. Until then, it may be enabled by setting the
// environment variable "GRPC_GO_RETRY" to "on".
//
// This API is EXPERIMENTAL.
func WithDisableRetry() DialOption {
return newFuncDialOption(func(o *dialOptions) {
o.disableRetry = true
})
}
// WithMaxHeaderListSize returns a DialOption that specifies the maximum
// (uncompressed) size of header list that the client is prepared to accept.
func WithMaxHeaderListSize(s uint32) DialOption {
return newFuncDialOption(func(o *dialOptions) {
o.copts.MaxHeaderListSize = &s
})
}
// WithDisableHealthCheck disables the LB channel health checking for all
// SubConns of this ClientConn.
//
// This API is EXPERIMENTAL.
func WithDisableHealthCheck() DialOption {
return newFuncDialOption(func(o *dialOptions) {
o.disableHealthCheck = true
})
}
// withHealthCheckFunc replaces the default health check function with the
// provided one. It makes tests easier to change the health check function.
//
// For testing purpose only.
func withHealthCheckFunc(f internal.HealthChecker) DialOption {
return newFuncDialOption(func(o *dialOptions) {
o.healthCheckFunc = f
})
}
func defaultDialOptions() dialOptions {
return dialOptions{
disableRetry: !envconfig.Retry,
healthCheckFunc: internal.HealthCheckFunc,
copts: transport.ConnectOptions{
WriteBufferSize: defaultWriteBufSize,
ReadBufferSize: defaultReadBufSize,
},
resolveNowBackoff: internalbackoff.DefaultExponential.Backoff,
}
}
// withGetMinConnectDeadline specifies the function that clientconn uses to
// get minConnectDeadline. This can be used to make connection attempts happen
// faster/slower.
//
// For testing purpose only.
func withMinConnectDeadline(f func() time.Duration) DialOption {
return newFuncDialOption(func(o *dialOptions) {
o.minConnectTimeout = f
})
}
// withResolveNowBackoff specifies the function that clientconn uses to backoff
// between successive calls to resolver.ResolveNow().
//
// For testing purpose only.
func withResolveNowBackoff(f func(int) time.Duration) DialOption {
return newFuncDialOption(func(o *dialOptions) {
o.resolveNowBackoff = f
})
}
// WithResolvers allows a list of resolver implementations to be registered
// locally with the ClientConn without needing to be globally registered via
// resolver.Register. They will be matched against the scheme used for the
// current Dial only, and will take precedence over the global registry.
//
// This API is EXPERIMENTAL.
func WithResolvers(rs ...resolver.Builder) DialOption {
return newFuncDialOption(func(o *dialOptions) {
o.resolvers = append(o.resolvers, rs...)
})
}
| {
"pile_set_name": "Github"
} |
// Copyright 2017 the V8 project 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 "src/compiler/property-access-builder.h"
#include "src/compilation-dependencies.h"
#include "src/compiler/access-builder.h"
#include "src/compiler/access-info.h"
#include "src/compiler/js-graph.h"
#include "src/compiler/node-matchers.h"
#include "src/compiler/simplified-operator.h"
#include "src/lookup.h"
#include "src/field-index-inl.h"
#include "src/isolate-inl.h"
namespace v8 {
namespace internal {
namespace compiler {
Graph* PropertyAccessBuilder::graph() const { return jsgraph()->graph(); }
Isolate* PropertyAccessBuilder::isolate() const { return jsgraph()->isolate(); }
CommonOperatorBuilder* PropertyAccessBuilder::common() const {
return jsgraph()->common();
}
SimplifiedOperatorBuilder* PropertyAccessBuilder::simplified() const {
return jsgraph()->simplified();
}
bool HasOnlyStringMaps(MapHandles const& maps) {
for (auto map : maps) {
if (!map->IsStringMap()) return false;
}
return true;
}
namespace {
bool HasOnlyNumberMaps(MapHandles const& maps) {
for (auto map : maps) {
if (map->instance_type() != HEAP_NUMBER_TYPE) return false;
}
return true;
}
bool HasOnlySequentialStringMaps(MapHandles const& maps) {
for (auto map : maps) {
if (!map->IsStringMap()) return false;
if (!StringShape(map->instance_type()).IsSequential()) {
return false;
}
}
return true;
}
} // namespace
bool PropertyAccessBuilder::TryBuildStringCheck(MapHandles const& maps,
Node** receiver, Node** effect,
Node* control) {
if (HasOnlyStringMaps(maps)) {
if (HasOnlySequentialStringMaps(maps)) {
*receiver = *effect = graph()->NewNode(simplified()->CheckSeqString(),
*receiver, *effect, control);
} else {
// Monormorphic string access (ignoring the fact that there are multiple
// String maps).
*receiver = *effect = graph()->NewNode(simplified()->CheckString(),
*receiver, *effect, control);
}
return true;
}
return false;
}
bool PropertyAccessBuilder::TryBuildNumberCheck(MapHandles const& maps,
Node** receiver, Node** effect,
Node* control) {
if (HasOnlyNumberMaps(maps)) {
// Monomorphic number access (we also deal with Smis here).
*receiver = *effect = graph()->NewNode(simplified()->CheckNumber(),
*receiver, *effect, control);
return true;
}
return false;
}
Node* PropertyAccessBuilder::BuildCheckHeapObject(Node* receiver, Node** effect,
Node* control) {
switch (receiver->opcode()) {
case IrOpcode::kHeapConstant:
case IrOpcode::kJSCreate:
case IrOpcode::kJSCreateArguments:
case IrOpcode::kJSCreateArray:
case IrOpcode::kJSCreateClosure:
case IrOpcode::kJSCreateIterResultObject:
case IrOpcode::kJSCreateLiteralArray:
case IrOpcode::kJSCreateLiteralObject:
case IrOpcode::kJSCreateLiteralRegExp:
case IrOpcode::kJSConvertReceiver:
case IrOpcode::kJSToName:
case IrOpcode::kJSToString:
case IrOpcode::kJSToObject:
case IrOpcode::kJSTypeOf: {
return receiver;
}
default: {
return *effect = graph()->NewNode(simplified()->CheckHeapObject(),
receiver, *effect, control);
}
}
UNREACHABLE();
return nullptr;
}
void PropertyAccessBuilder::BuildCheckMaps(
Node* receiver, Node** effect, Node* control,
std::vector<Handle<Map>> const& receiver_maps) {
HeapObjectMatcher m(receiver);
if (m.HasValue()) {
Handle<Map> receiver_map(m.Value()->map(), isolate());
if (receiver_map->is_stable()) {
for (Handle<Map> map : receiver_maps) {
if (map.is_identical_to(receiver_map)) {
dependencies()->AssumeMapStable(receiver_map);
return;
}
}
}
}
ZoneHandleSet<Map> maps;
CheckMapsFlags flags = CheckMapsFlag::kNone;
for (Handle<Map> map : receiver_maps) {
maps.insert(map, graph()->zone());
if (map->is_migration_target()) {
flags |= CheckMapsFlag::kTryMigrateInstance;
}
}
*effect = graph()->NewNode(simplified()->CheckMaps(flags, maps), receiver,
*effect, control);
}
void PropertyAccessBuilder::AssumePrototypesStable(
Handle<Context> native_context,
std::vector<Handle<Map>> const& receiver_maps, Handle<JSObject> holder) {
// Determine actual holder and perform prototype chain checks.
for (auto map : receiver_maps) {
// Perform the implicit ToObject for primitives here.
// Implemented according to ES6 section 7.3.2 GetV (V, P).
Handle<JSFunction> constructor;
if (Map::GetConstructorFunction(map, native_context)
.ToHandle(&constructor)) {
map = handle(constructor->initial_map(), holder->GetIsolate());
}
dependencies()->AssumePrototypeMapsStable(map, holder);
}
}
Node* PropertyAccessBuilder::ResolveHolder(
PropertyAccessInfo const& access_info, Node* receiver) {
Handle<JSObject> holder;
if (access_info.holder().ToHandle(&holder)) {
return jsgraph()->Constant(holder);
}
return receiver;
}
Node* PropertyAccessBuilder::TryBuildLoadConstantDataField(
Handle<Name> name, PropertyAccessInfo const& access_info, Node* receiver) {
// Optimize immutable property loads.
HeapObjectMatcher m(receiver);
if (m.HasValue() && m.Value()->IsJSObject()) {
// TODO(ishell): Use something simpler like
//
// Handle<Object> value =
// JSObject::FastPropertyAt(Handle<JSObject>::cast(m.Value()),
// Representation::Tagged(), field_index);
//
// here, once we have the immutable bit in the access_info.
// TODO(turbofan): Given that we already have the field_index here, we
// might be smarter in the future and not rely on the LookupIterator,
// but for now let's just do what Crankshaft does.
LookupIterator it(m.Value(), name, LookupIterator::OWN_SKIP_INTERCEPTOR);
if (it.state() == LookupIterator::DATA) {
bool is_reaonly_non_configurable =
it.IsReadOnly() && !it.IsConfigurable();
if (is_reaonly_non_configurable ||
(FLAG_track_constant_fields && access_info.IsDataConstantField())) {
Node* value = jsgraph()->Constant(JSReceiver::GetDataProperty(&it));
if (!is_reaonly_non_configurable) {
// It's necessary to add dependency on the map that introduced
// the field.
DCHECK(access_info.IsDataConstantField());
DCHECK(!it.is_dictionary_holder());
Handle<Map> field_owner_map = it.GetFieldOwnerMap();
dependencies()->AssumeFieldOwner(field_owner_map);
}
return value;
}
}
}
return nullptr;
}
Node* PropertyAccessBuilder::BuildLoadDataField(
Handle<Name> name, PropertyAccessInfo const& access_info, Node* receiver,
Node** effect, Node** control) {
DCHECK(access_info.IsDataField() || access_info.IsDataConstantField());
receiver = ResolveHolder(access_info, receiver);
if (Node* value =
TryBuildLoadConstantDataField(name, access_info, receiver)) {
return value;
}
FieldIndex const field_index = access_info.field_index();
Type* const field_type = access_info.field_type();
MachineRepresentation const field_representation =
access_info.field_representation();
Node* storage = receiver;
if (!field_index.is_inobject()) {
storage = *effect = graph()->NewNode(
simplified()->LoadField(AccessBuilder::ForJSObjectPropertiesOrHash()),
storage, *effect, *control);
}
FieldAccess field_access = {
kTaggedBase,
field_index.offset(),
name,
MaybeHandle<Map>(),
field_type,
MachineType::TypeForRepresentation(field_representation),
kFullWriteBarrier};
if (field_representation == MachineRepresentation::kFloat64) {
if (!field_index.is_inobject() || field_index.is_hidden_field() ||
!FLAG_unbox_double_fields) {
FieldAccess const storage_access = {kTaggedBase,
field_index.offset(),
name,
MaybeHandle<Map>(),
Type::OtherInternal(),
MachineType::TaggedPointer(),
kPointerWriteBarrier};
storage = *effect = graph()->NewNode(
simplified()->LoadField(storage_access), storage, *effect, *control);
field_access.offset = HeapNumber::kValueOffset;
field_access.name = MaybeHandle<Name>();
}
} else if (field_representation == MachineRepresentation::kTaggedPointer) {
// Remember the map of the field value, if its map is stable. This is
// used by the LoadElimination to eliminate map checks on the result.
Handle<Map> field_map;
if (access_info.field_map().ToHandle(&field_map)) {
if (field_map->is_stable()) {
dependencies()->AssumeMapStable(field_map);
field_access.map = field_map;
}
}
}
Node* value = *effect = graph()->NewNode(
simplified()->LoadField(field_access), storage, *effect, *control);
return value;
}
} // namespace compiler
} // namespace internal
} // namespace v8
| {
"pile_set_name": "Github"
} |
---
layout: feature
title: 'Abbr'
shortdef: 'abbreviation'
udver: '2'
---
Boolean feature. Is this an abbreviation?
### <a name="Yes">`Yes`</a>: it is abbreviation
Examples: [sv] _<b>t.ex.</b>, <b>ca</b>_
| {
"pile_set_name": "Github"
} |
# Electronica TDS-5m (Technics RP-DJ1210 earpads)
See [usage instructions](https://github.com/jaakkopasanen/AutoEq#usage) for more options and info.
### Parametric EQs
In case of using parametric equalizer, apply preamp of **-7.6dB** and build filters manually
with these parameters. The first 5 filters can be used independently.
When using independent subset of filters, apply preamp of **-7.5dB**.
| Type | Fc | Q | Gain |
|:--------|:---------|:-----|:--------|
| Peaking | 25 Hz | 0.95 | 6.3 dB |
| Peaking | 1486 Hz | 2.46 | 4.5 dB |
| Peaking | 2599 Hz | 1.91 | -5.6 dB |
| Peaking | 4156 Hz | 3.71 | 4.4 dB |
| Peaking | 12219 Hz | 0.91 | 6.9 dB |
| Peaking | 292 Hz | 0.82 | -2.2 dB |
| Peaking | 5882 Hz | 6.01 | -1.8 dB |
| Peaking | 9333 Hz | 6.65 | 2.0 dB |
| Peaking | 15764 Hz | 2.61 | 3.0 dB |
| Peaking | 20095 Hz | 0.82 | -7.0 dB |
### Fixed Band EQs
In case of using fixed band (also called graphic) equalizer, apply preamp of **-7.2dB**
(if available) and set gains manually with these parameters.
| Type | Fc | Q | Gain |
|:--------|:---------|:-----|:--------|
| Peaking | 31 Hz | 1.41 | 6.6 dB |
| Peaking | 62 Hz | 1.41 | 0.4 dB |
| Peaking | 125 Hz | 1.41 | -0.4 dB |
| Peaking | 250 Hz | 1.41 | -1.7 dB |
| Peaking | 500 Hz | 1.41 | -2.0 dB |
| Peaking | 1000 Hz | 1.41 | 2.8 dB |
| Peaking | 2000 Hz | 1.41 | -1.9 dB |
| Peaking | 4000 Hz | 1.41 | 0.3 dB |
| Peaking | 8000 Hz | 1.41 | 4.1 dB |
| Peaking | 16000 Hz | 1.41 | 5.9 dB |
### Graphs
.png) | {
"pile_set_name": "Github"
} |
Array3d v(8,27,64);
cout << v.pow(0.333333) << endl;
| {
"pile_set_name": "Github"
} |
<?php
print wikidiff2_do_diff( $x, $y, 2);
print wikidiff3_do_diff( $x, $y, 3);
?> | {
"pile_set_name": "Github"
} |
////////////////////////////////////////////////////////////////////////////////
/// DISCLAIMER
///
/// Copyright 2014-2020 ArangoDB GmbH, Cologne, Germany
/// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany
///
/// 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.
///
/// Copyright holder is ArangoDB GmbH, Cologne, Germany
///
/// @author Jan Steemann
////////////////////////////////////////////////////////////////////////////////
#include "ConsoleThread.h"
#include <v8.h>
#include <iostream>
#include "ApplicationFeatures/ApplicationServer.h"
#include "Basics/MutexLocker.h"
#include "Basics/application-exit.h"
#include "Basics/tri-strings.h"
#include "Logger/LogMacros.h"
#include "Logger/Logger.h"
#include "Logger/LoggerStream.h"
#include "Rest/Version.h"
#include "V8/JavaScriptSecurityContext.h"
#include "V8/V8LineEditor.h"
#include "V8/v8-conv.h"
#include "V8/v8-utils.h"
#include "V8Server/V8DealerFeature.h"
#include "VocBase/vocbase.h"
#ifdef TRI_HAVE_SIGNAL_H
#include <signal.h>
#endif
using namespace arangodb;
using namespace arangodb::application_features;
using namespace arangodb::basics;
using namespace arangodb::rest;
V8LineEditor* ConsoleThread::serverConsole = nullptr;
Mutex ConsoleThread::serverConsoleMutex;
ConsoleThread::ConsoleThread(ApplicationServer& applicationServer, TRI_vocbase_t* vocbase)
: Thread(applicationServer, "Console"), _vocbase(vocbase), _userAborted(false) {}
ConsoleThread::~ConsoleThread() { shutdown(); }
static char const* USER_ABORTED = "user aborted";
void ConsoleThread::run() {
std::this_thread::sleep_for(std::chrono::milliseconds(100));
bool v8Enabled = V8DealerFeature::DEALER && V8DealerFeature::DEALER->isEnabled();
if (!v8Enabled) {
LOG_TOPIC("4a00f", FATAL, arangodb::Logger::FIXME) << "V8 engine is not enabled";
FATAL_ERROR_EXIT();
}
// enter V8 context
JavaScriptSecurityContext securityContext = JavaScriptSecurityContext::createAdminScriptContext();
V8ContextGuard guard(_vocbase, securityContext);
// work
try {
inner(guard);
} catch (char const* error) {
if (strcmp(error, USER_ABORTED) != 0) {
LOG_TOPIC("6e7fd", ERR, arangodb::Logger::FIXME) << error;
}
} catch (...) {
_server.beginShutdown();
throw;
}
// exit context
_server.beginShutdown();
}
void ConsoleThread::inner(V8ContextGuard const& guard) {
// flush all log output before we print the console prompt
Logger::flush();
v8::Isolate* isolate = guard.isolate();
v8::HandleScope globalScope(isolate);
// run the shell
std::cout << "arangod console (" << rest::Version::getVerboseVersionString()
<< ")" << std::endl;
std::cout << "Copyright (c) ArangoDB GmbH" << std::endl;
v8::Local<v8::String> name(TRI_V8_ASCII_STRING(isolate, TRI_V8_SHELL_COMMAND_NAME));
auto localContext = v8::Local<v8::Context>::New(isolate, guard.context()->_context);
localContext->Enter();
{
v8::Context::Scope contextScope(localContext);
// .............................................................................
// run console
// .............................................................................
uint64_t const gcInterval = 10;
uint64_t nrCommands = 0;
// read and eval .arangod.rc from home directory if it exists
char const* startupScript = R"SCRIPT(
start_pretty_print(true);
start_color_print('arangodb', true);
(function () {
var __fs__ = require("fs");
var __rcf__ = __fs__.join(__fs__.home(), ".arangod.rc");
if (__fs__.exists(__rcf__)) {
try {
var __content__ = __fs__.read(__rcf__);
eval(__content__);
}
catch (err) {
require("console").log("error in rc file '%s': %s", __rcf__, String(err.stack || err));
}
}
})();
)SCRIPT";
TRI_ExecuteJavaScriptString(isolate, localContext,
TRI_V8_ASCII_STRING(isolate, startupScript),
TRI_V8_ASCII_STRING(isolate, "(startup)"), false);
#ifndef _WIN32
// allow SIGINT in this particular thread... otherwise we cannot CTRL-C the
// console
sigset_t set;
sigemptyset(&set);
sigaddset(&set, SIGINT);
if (pthread_sigmask(SIG_UNBLOCK, &set, nullptr) < 0) {
LOG_TOPIC("62022", ERR, arangodb::Logger::FIXME)
<< "unable to install signal handler";
}
#endif
V8LineEditor console(isolate, localContext, ".arangod.history");
console.open(true);
{
MUTEX_LOCKER(mutexLocker, serverConsoleMutex);
serverConsole = &console;
}
bool lastEmpty = false;
while (!isStopping() && !_userAborted.load()) {
if (nrCommands >= gcInterval || V8PlatformFeature::isOutOfMemory(isolate)) {
TRI_RunGarbageCollectionV8(isolate, 0.5);
nrCommands = 0;
// needs to be reset after the garbage collection
V8PlatformFeature::resetOutOfMemory(isolate);
}
std::string input;
ShellBase::EofType eof;
isolate->CancelTerminateExecution();
{
MUTEX_LOCKER(mutexLocker, serverConsoleMutex);
input = console.prompt("arangod> ", "arangod>", eof);
}
if (eof == ShellBase::EOF_FORCE_ABORT || (eof == ShellBase::EOF_ABORT && lastEmpty)) {
_userAborted.store(true);
}
if (_userAborted.load()) {
break;
}
if (input.empty()) {
lastEmpty = true;
continue;
}
lastEmpty = false;
nrCommands++;
console.addHistory(input);
{
v8::TryCatch tryCatch(isolate);
v8::HandleScope scope(isolate);
console.setExecutingCommand(true);
TRI_ExecuteJavaScriptString(isolate, localContext,
TRI_V8_STD_STRING(isolate, input), name, true);
console.setExecutingCommand(false);
if (_userAborted.load()) {
std::cout << "command aborted" << std::endl;
} else if (tryCatch.HasCaught()) {
if (!tryCatch.CanContinue() || tryCatch.HasTerminated()) {
std::cout << "command aborted" << std::endl;
} else {
std::cout << TRI_StringifyV8Exception(isolate, &tryCatch);
}
}
}
}
{
MUTEX_LOCKER(mutexLocker, serverConsoleMutex);
serverConsole = nullptr;
}
}
localContext->Exit();
throw USER_ABORTED;
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright 2000 by Hans Reiser, licensing governed by reiserfs/README
*/
#include <linux/time.h>
#include "reiserfs.h"
#include "acl.h"
#include "xattr.h"
#include <linux/uaccess.h>
#include <linux/pagemap.h>
#include <linux/swap.h>
#include <linux/writeback.h>
#include <linux/blkdev.h>
#include <linux/buffer_head.h>
#include <linux/quotaops.h>
/*
* We pack the tails of files on file close, not at the time they are written.
* This implies an unnecessary copy of the tail and an unnecessary indirect item
* insertion/balancing, for files that are written in one write.
* It avoids unnecessary tail packings (balances) for files that are written in
* multiple writes and are small enough to have tails.
*
* file_release is called by the VFS layer when the file is closed. If
* this is the last open file descriptor, and the file
* small enough to have a tail, and the tail is currently in an
* unformatted node, the tail is converted back into a direct item.
*
* We use reiserfs_truncate_file to pack the tail, since it already has
* all the conditions coded.
*/
static int reiserfs_file_release(struct inode *inode, struct file *filp)
{
struct reiserfs_transaction_handle th;
int err;
int jbegin_failure = 0;
BUG_ON(!S_ISREG(inode->i_mode));
if (atomic_add_unless(&REISERFS_I(inode)->openers, -1, 1))
return 0;
mutex_lock(&REISERFS_I(inode)->tailpack);
if (!atomic_dec_and_test(&REISERFS_I(inode)->openers)) {
mutex_unlock(&REISERFS_I(inode)->tailpack);
return 0;
}
/* fast out for when nothing needs to be done */
if ((!(REISERFS_I(inode)->i_flags & i_pack_on_close_mask) ||
!tail_has_to_be_packed(inode)) &&
REISERFS_I(inode)->i_prealloc_count <= 0) {
mutex_unlock(&REISERFS_I(inode)->tailpack);
return 0;
}
reiserfs_write_lock(inode->i_sb);
/*
* freeing preallocation only involves relogging blocks that
* are already in the current transaction. preallocation gets
* freed at the end of each transaction, so it is impossible for
* us to log any additional blocks (including quota blocks)
*/
err = journal_begin(&th, inode->i_sb, 1);
if (err) {
/*
* uh oh, we can't allow the inode to go away while there
* is still preallocation blocks pending. Try to join the
* aborted transaction
*/
jbegin_failure = err;
err = journal_join_abort(&th, inode->i_sb);
if (err) {
/*
* hmpf, our choices here aren't good. We can pin
* the inode which will disallow unmount from ever
* happening, we can do nothing, which will corrupt
* random memory on unmount, or we can forcibly
* remove the file from the preallocation list, which
* will leak blocks on disk. Lets pin the inode
* and let the admin know what is going on.
*/
igrab(inode);
reiserfs_warning(inode->i_sb, "clm-9001",
"pinning inode %lu because the "
"preallocation can't be freed",
inode->i_ino);
goto out;
}
}
reiserfs_update_inode_transaction(inode);
#ifdef REISERFS_PREALLOCATE
reiserfs_discard_prealloc(&th, inode);
#endif
err = journal_end(&th);
/* copy back the error code from journal_begin */
if (!err)
err = jbegin_failure;
if (!err &&
(REISERFS_I(inode)->i_flags & i_pack_on_close_mask) &&
tail_has_to_be_packed(inode)) {
/*
* if regular file is released by last holder and it has been
* appended (we append by unformatted node only) or its direct
* item(s) had to be converted, then it may have to be
* indirect2direct converted
*/
err = reiserfs_truncate_file(inode, 0);
}
out:
reiserfs_write_unlock(inode->i_sb);
mutex_unlock(&REISERFS_I(inode)->tailpack);
return err;
}
static int reiserfs_file_open(struct inode *inode, struct file *file)
{
int err = dquot_file_open(inode, file);
/* somebody might be tailpacking on final close; wait for it */
if (!atomic_inc_not_zero(&REISERFS_I(inode)->openers)) {
mutex_lock(&REISERFS_I(inode)->tailpack);
atomic_inc(&REISERFS_I(inode)->openers);
mutex_unlock(&REISERFS_I(inode)->tailpack);
}
return err;
}
void reiserfs_vfs_truncate_file(struct inode *inode)
{
mutex_lock(&REISERFS_I(inode)->tailpack);
reiserfs_truncate_file(inode, 1);
mutex_unlock(&REISERFS_I(inode)->tailpack);
}
/* Sync a reiserfs file. */
/*
* FIXME: sync_mapping_buffers() never has anything to sync. Can
* be removed...
*/
static int reiserfs_sync_file(struct file *filp, loff_t start, loff_t end,
int datasync)
{
struct inode *inode = filp->f_mapping->host;
int err;
int barrier_done;
err = filemap_write_and_wait_range(inode->i_mapping, start, end);
if (err)
return err;
inode_lock(inode);
BUG_ON(!S_ISREG(inode->i_mode));
err = sync_mapping_buffers(inode->i_mapping);
reiserfs_write_lock(inode->i_sb);
barrier_done = reiserfs_commit_for_inode(inode);
reiserfs_write_unlock(inode->i_sb);
if (barrier_done != 1 && reiserfs_barrier_flush(inode->i_sb))
blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL, NULL);
inode_unlock(inode);
if (barrier_done < 0)
return barrier_done;
return (err < 0) ? -EIO : 0;
}
/* taken fs/buffer.c:__block_commit_write */
int reiserfs_commit_page(struct inode *inode, struct page *page,
unsigned from, unsigned to)
{
unsigned block_start, block_end;
int partial = 0;
unsigned blocksize;
struct buffer_head *bh, *head;
unsigned long i_size_index = inode->i_size >> PAGE_SHIFT;
int new;
int logit = reiserfs_file_data_log(inode);
struct super_block *s = inode->i_sb;
int bh_per_page = PAGE_SIZE / s->s_blocksize;
struct reiserfs_transaction_handle th;
int ret = 0;
th.t_trans_id = 0;
blocksize = 1 << inode->i_blkbits;
if (logit) {
reiserfs_write_lock(s);
ret = journal_begin(&th, s, bh_per_page + 1);
if (ret)
goto drop_write_lock;
reiserfs_update_inode_transaction(inode);
}
for (bh = head = page_buffers(page), block_start = 0;
bh != head || !block_start;
block_start = block_end, bh = bh->b_this_page) {
new = buffer_new(bh);
clear_buffer_new(bh);
block_end = block_start + blocksize;
if (block_end <= from || block_start >= to) {
if (!buffer_uptodate(bh))
partial = 1;
} else {
set_buffer_uptodate(bh);
if (logit) {
reiserfs_prepare_for_journal(s, bh, 1);
journal_mark_dirty(&th, bh);
} else if (!buffer_dirty(bh)) {
mark_buffer_dirty(bh);
/*
* do data=ordered on any page past the end
* of file and any buffer marked BH_New.
*/
if (reiserfs_data_ordered(inode->i_sb) &&
(new || page->index >= i_size_index)) {
reiserfs_add_ordered_list(inode, bh);
}
}
}
}
if (logit) {
ret = journal_end(&th);
drop_write_lock:
reiserfs_write_unlock(s);
}
/*
* If this is a partial write which happened to make all buffers
* uptodate then we can optimize away a bogus readpage() for
* the next read(). Here we 'discover' whether the page went
* uptodate as a result of this (potentially partial) write.
*/
if (!partial)
SetPageUptodate(page);
return ret;
}
const struct file_operations reiserfs_file_operations = {
.unlocked_ioctl = reiserfs_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = reiserfs_compat_ioctl,
#endif
.mmap = generic_file_mmap,
.open = reiserfs_file_open,
.release = reiserfs_file_release,
.fsync = reiserfs_sync_file,
.read_iter = generic_file_read_iter,
.write_iter = generic_file_write_iter,
.splice_read = generic_file_splice_read,
.splice_write = iter_file_splice_write,
.llseek = generic_file_llseek,
};
const struct inode_operations reiserfs_file_inode_operations = {
.setattr = reiserfs_setattr,
.listxattr = reiserfs_listxattr,
.permission = reiserfs_permission,
.get_acl = reiserfs_get_acl,
.set_acl = reiserfs_set_acl,
};
| {
"pile_set_name": "Github"
} |
/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* 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/err.h>
#include <linux/kernel.h>
#include <linux/platform_device.h>
#include <linux/irq.h>
#include <linux/io.h>
#include <linux/platform_data/qcom_crypto_device.h>
#include <linux/dma-mapping.h>
#include <sound/msm-dai-q6.h>
#include <sound/apr_audio.h>
#include <linux/usb/android.h>
#include <asm/hardware/gic.h>
#include <asm/mach/flash.h>
#include <mach/board.h>
#include <mach/msm_iomap.h>
#include <mach/msm_hsusb.h>
#include <mach/irqs.h>
#include <mach/socinfo.h>
#include <mach/rpm.h>
#include <mach/msm_bus_board.h>
#include <asm/hardware/cache-l2x0.h>
#include <mach/msm_sps.h>
#include <mach/dma.h>
#include "pm.h"
#include "devices.h"
#include <mach/gpio.h>
#include <mach/mpm.h>
#include "spm.h"
#include "rpm_resources.h"
#include "msm_watchdog.h"
#include "rpm_stats.h"
#include "rpm_log.h"
/* Address of GSBI blocks */
#define MSM_GSBI1_PHYS 0x16000000
#define MSM_GSBI2_PHYS 0x16100000
#define MSM_GSBI3_PHYS 0x16200000
#define MSM_GSBI4_PHYS 0x16300000
#define MSM_GSBI5_PHYS 0x16400000
#define MSM_UART4DM_PHYS (MSM_GSBI4_PHYS + 0x40000)
/* GSBI QUP devices */
#define MSM_GSBI1_QUP_PHYS (MSM_GSBI1_PHYS + 0x80000)
#define MSM_GSBI2_QUP_PHYS (MSM_GSBI2_PHYS + 0x80000)
#define MSM_GSBI3_QUP_PHYS (MSM_GSBI3_PHYS + 0x80000)
#define MSM_GSBI4_QUP_PHYS (MSM_GSBI4_PHYS + 0x80000)
#define MSM_GSBI5_QUP_PHYS (MSM_GSBI5_PHYS + 0x80000)
#define MSM_QUP_SIZE SZ_4K
/* Address of SSBI CMD */
#define MSM_PMIC1_SSBI_CMD_PHYS 0x00500000
#define MSM_PMIC_SSBI_SIZE SZ_4K
#define MSM_GPIO_I2C_CLK 16
#define MSM_GPIO_I2C_SDA 17
#define MSM9615_RPM_MASTER_STATS_BASE 0x10A700
static struct msm_watchdog_pdata msm_watchdog_pdata = {
.pet_time = 10000,
.bark_time = 11000,
.has_secure = false,
.use_kernel_fiq = true,
.base = MSM_TMR_BASE + WDT0_OFFSET,
};
static struct resource msm_watchdog_resources[] = {
{
.start = WDT0_ACCSCSSNBARK_INT,
.end = WDT0_ACCSCSSNBARK_INT,
.flags = IORESOURCE_IRQ,
},
};
struct platform_device msm9615_device_watchdog = {
.name = "msm_watchdog",
.id = -1,
.dev = {
.platform_data = &msm_watchdog_pdata,
},
.num_resources = ARRAY_SIZE(msm_watchdog_resources),
.resource = msm_watchdog_resources,
};
static struct resource msm_dmov_resource[] = {
{
.start = ADM_0_SCSS_1_IRQ,
.flags = IORESOURCE_IRQ,
},
{
.start = 0x18320000,
.end = 0x18320000 + SZ_1M - 1,
.flags = IORESOURCE_MEM,
},
};
static struct msm_dmov_pdata msm_dmov_pdata = {
.sd = 1,
.sd_size = 0x800,
};
struct platform_device msm9615_device_dmov = {
.name = "msm_dmov",
.id = -1,
.resource = msm_dmov_resource,
.num_resources = ARRAY_SIZE(msm_dmov_resource),
.dev = {
.platform_data = &msm_dmov_pdata,
},
};
struct platform_device msm9615_device_acpuclk = {
.name = "acpuclk-9615",
.id = -1,
};
#define MSM_USB_BAM_BASE 0x12502000
#define MSM_USB_BAM_SIZE SZ_16K
#define MSM_HSIC_BAM_BASE 0x12542000
#define MSM_HSIC_BAM_SIZE SZ_16K
static struct resource resources_otg[] = {
{
.start = MSM9615_HSUSB_PHYS,
.end = MSM9615_HSUSB_PHYS + MSM9615_HSUSB_SIZE - 1,
.flags = IORESOURCE_MEM,
},
{
.start = USB1_HS_IRQ,
.end = USB1_HS_IRQ,
.flags = IORESOURCE_IRQ,
},
};
struct platform_device msm_device_otg = {
.name = "msm_otg",
.id = -1,
.num_resources = ARRAY_SIZE(resources_otg),
.resource = resources_otg,
.dev = {
.coherent_dma_mask = DMA_BIT_MASK(32),
},
};
#define MSM_HSUSB_RESUME_GPIO 79
static struct resource resources_hsusb[] = {
{
.start = MSM9615_HSUSB_PHYS,
.end = MSM9615_HSUSB_PHYS + MSM9615_HSUSB_SIZE - 1,
.flags = IORESOURCE_MEM,
},
{
.start = USB1_HS_IRQ,
.end = USB1_HS_IRQ,
.flags = IORESOURCE_IRQ,
},
{
.start = MSM_HSUSB_RESUME_GPIO,
.end = MSM_HSUSB_RESUME_GPIO,
.name = "USB_RESUME",
.flags = IORESOURCE_IO,
},
};
static struct resource resources_usb_bam[] = {
{
.name = "hsusb",
.start = MSM_USB_BAM_BASE,
.end = MSM_USB_BAM_BASE + MSM_USB_BAM_SIZE - 1,
.flags = IORESOURCE_MEM,
},
{
.name = "hsusb",
.start = USB1_HS_BAM_IRQ,
.end = USB1_HS_BAM_IRQ,
.flags = IORESOURCE_IRQ,
},
{
.name = "hsic",
.start = MSM_HSIC_BAM_BASE,
.end = MSM_HSIC_BAM_BASE + MSM_HSIC_BAM_SIZE - 1,
.flags = IORESOURCE_MEM,
},
{
.name = "hsic",
.start = USB_HSIC_BAM_IRQ,
.end = USB_HSIC_BAM_IRQ,
.flags = IORESOURCE_IRQ,
},
};
struct platform_device msm_device_usb_bam = {
.name = "usb_bam",
.id = -1,
.num_resources = ARRAY_SIZE(resources_usb_bam),
.resource = resources_usb_bam,
};
struct platform_device msm_device_gadget_peripheral = {
.name = "msm_hsusb",
.id = -1,
.num_resources = ARRAY_SIZE(resources_hsusb),
.resource = resources_hsusb,
.dev = {
.coherent_dma_mask = DMA_BIT_MASK(32),
},
};
static struct resource resources_hsic_peripheral[] = {
{
.start = MSM9615_HSIC_PHYS,
.end = MSM9615_HSIC_PHYS + MSM9615_HSIC_SIZE - 1,
.flags = IORESOURCE_MEM,
},
{
.start = USB_HSIC_IRQ,
.end = USB_HSIC_IRQ,
.flags = IORESOURCE_IRQ,
},
};
struct platform_device msm_device_hsic_peripheral = {
.name = "msm_hsic_peripheral",
.id = -1,
.num_resources = ARRAY_SIZE(resources_hsic_peripheral),
.resource = resources_hsic_peripheral,
.dev = {
.coherent_dma_mask = DMA_BIT_MASK(32),
},
};
static struct resource resources_hsusb_host[] = {
{
.start = MSM9615_HSUSB_PHYS,
.end = MSM9615_HSUSB_PHYS + MSM9615_HSUSB_PHYS - 1,
.flags = IORESOURCE_MEM,
},
{
.start = USB1_HS_IRQ,
.end = USB1_HS_IRQ,
.flags = IORESOURCE_IRQ,
},
};
static u64 dma_mask = DMA_BIT_MASK(32);
struct platform_device msm_device_hsusb_host = {
.name = "msm_hsusb_host",
.id = -1,
.num_resources = ARRAY_SIZE(resources_hsusb_host),
.resource = resources_hsusb_host,
.dev = {
.dma_mask = &dma_mask,
.coherent_dma_mask = 0xffffffff,
},
};
static struct resource resources_hsic_host[] = {
{
.start = MSM9615_HSIC_PHYS,
.end = MSM9615_HSIC_PHYS + MSM9615_HSIC_SIZE - 1,
.flags = IORESOURCE_MEM,
},
{
.start = USB_HSIC_IRQ,
.end = USB_HSIC_IRQ,
.flags = IORESOURCE_IRQ,
},
};
struct platform_device msm_device_hsic_host = {
.name = "msm_hsic_host",
.id = -1,
.num_resources = ARRAY_SIZE(resources_hsic_host),
.resource = resources_hsic_host,
.dev = {
.dma_mask = &dma_mask,
.coherent_dma_mask = 0xffffffff,
},
};
static struct resource resources_uart_gsbi4[] = {
{
.start = GSBI4_UARTDM_IRQ,
.end = GSBI4_UARTDM_IRQ,
.flags = IORESOURCE_IRQ,
},
{
.start = MSM_UART4DM_PHYS,
.end = MSM_UART4DM_PHYS + PAGE_SIZE - 1,
.name = "uartdm_resource",
.flags = IORESOURCE_MEM,
},
{
.start = MSM_GSBI4_PHYS,
.end = MSM_GSBI4_PHYS + PAGE_SIZE - 1,
.name = "gsbi_resource",
.flags = IORESOURCE_MEM,
},
};
struct platform_device msm9615_device_uart_gsbi4 = {
.name = "msm_serial_hsl",
.id = 0,
.num_resources = ARRAY_SIZE(resources_uart_gsbi4),
.resource = resources_uart_gsbi4,
};
static struct resource resources_qup_i2c_gsbi5[] = {
{
.name = "gsbi_qup_i2c_addr",
.start = MSM_GSBI5_PHYS,
.end = MSM_GSBI5_PHYS + 4 - 1,
.flags = IORESOURCE_MEM,
},
{
.name = "qup_phys_addr",
.start = MSM_GSBI5_QUP_PHYS,
.end = MSM_GSBI5_QUP_PHYS + MSM_QUP_SIZE - 1,
.flags = IORESOURCE_MEM,
},
{
.name = "qup_err_intr",
.start = GSBI5_QUP_IRQ,
.end = GSBI5_QUP_IRQ,
.flags = IORESOURCE_IRQ,
},
{
.name = "i2c_clk",
.start = MSM_GPIO_I2C_CLK,
.end = MSM_GPIO_I2C_CLK,
.flags = IORESOURCE_IO,
},
{
.name = "i2c_sda",
.start = MSM_GPIO_I2C_SDA,
.end = MSM_GPIO_I2C_SDA,
.flags = IORESOURCE_IO,
},
};
struct platform_device msm9615_device_qup_i2c_gsbi5 = {
.name = "qup_i2c",
.id = 0,
.num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi5),
.resource = resources_qup_i2c_gsbi5,
};
static struct resource resources_qup_spi_gsbi3[] = {
{
.name = "spi_base",
.start = MSM_GSBI3_QUP_PHYS,
.end = MSM_GSBI3_QUP_PHYS + SZ_4K - 1,
.flags = IORESOURCE_MEM,
},
{
.name = "gsbi_base",
.start = MSM_GSBI3_PHYS,
.end = MSM_GSBI3_PHYS + 4 - 1,
.flags = IORESOURCE_MEM,
},
{
.name = "spi_irq_in",
.start = GSBI3_QUP_IRQ,
.end = GSBI3_QUP_IRQ,
.flags = IORESOURCE_IRQ,
},
};
struct platform_device msm9615_device_qup_spi_gsbi3 = {
.name = "spi_qsd",
.id = 0,
.num_resources = ARRAY_SIZE(resources_qup_spi_gsbi3),
.resource = resources_qup_spi_gsbi3,
};
#define LPASS_SLIMBUS_PHYS 0x28080000
#define LPASS_SLIMBUS_BAM_PHYS 0x28084000
#define LPASS_SLIMBUS_SLEW (MSM9615_TLMM_PHYS + 0x207C)
/* Board info for the slimbus slave device */
static struct resource slimbus_res[] = {
{
.start = LPASS_SLIMBUS_PHYS,
.end = LPASS_SLIMBUS_PHYS + 8191,
.flags = IORESOURCE_MEM,
.name = "slimbus_physical",
},
{
.start = LPASS_SLIMBUS_BAM_PHYS,
.end = LPASS_SLIMBUS_BAM_PHYS + 8191,
.flags = IORESOURCE_MEM,
.name = "slimbus_bam_physical",
},
{
.start = LPASS_SLIMBUS_SLEW,
.end = LPASS_SLIMBUS_SLEW + 4 - 1,
.flags = IORESOURCE_MEM,
.name = "slimbus_slew_reg",
},
{
.start = SLIMBUS0_CORE_EE1_IRQ,
.end = SLIMBUS0_CORE_EE1_IRQ,
.flags = IORESOURCE_IRQ,
.name = "slimbus_irq",
},
{
.start = SLIMBUS0_BAM_EE1_IRQ,
.end = SLIMBUS0_BAM_EE1_IRQ,
.flags = IORESOURCE_IRQ,
.name = "slimbus_bam_irq",
},
};
struct platform_device msm9615_slim_ctrl = {
.name = "msm_slim_ctrl",
.id = 1,
.num_resources = ARRAY_SIZE(slimbus_res),
.resource = slimbus_res,
.dev = {
.coherent_dma_mask = 0xffffffffULL,
},
};
struct platform_device msm_pcm = {
.name = "msm-pcm-dsp",
.id = -1,
};
struct platform_device msm_multi_ch_pcm = {
.name = "msm-multi-ch-pcm-dsp",
.id = -1,
};
struct platform_device msm_pcm_routing = {
.name = "msm-pcm-routing",
.id = -1,
};
struct platform_device msm_cpudai0 = {
.name = "msm-dai-q6",
.id = 0x4000,
};
struct platform_device msm_cpudai1 = {
.name = "msm-dai-q6",
.id = 0x4001,
};
struct platform_device msm_cpudai_bt_rx = {
.name = "msm-dai-q6",
.id = 0x3000,
};
struct platform_device msm_cpudai_bt_tx = {
.name = "msm-dai-q6",
.id = 0x3001,
};
/*
* Machine specific data for AUX PCM Interface
* which the driver will be unware of.
*/
struct msm_dai_auxpcm_pdata auxpcm_pdata = {
.clk = "pcm_clk",
.mode_8k = {
.mode = AFE_PCM_CFG_MODE_PCM,
.sync = AFE_PCM_CFG_SYNC_INT,
.frame = AFE_PCM_CFG_FRM_256BPF,
.quant = AFE_PCM_CFG_QUANT_LINEAR_NOPAD,
.slot = 0,
.data = AFE_PCM_CFG_CDATAOE_MASTER,
.pcm_clk_rate = 2048000,
},
.mode_16k = {
.mode = AFE_PCM_CFG_MODE_PCM,
.sync = AFE_PCM_CFG_SYNC_INT,
.frame = AFE_PCM_CFG_FRM_256BPF,
.quant = AFE_PCM_CFG_QUANT_LINEAR_NOPAD,
.slot = 0,
.data = AFE_PCM_CFG_CDATAOE_MASTER,
.pcm_clk_rate = 4096000,
}
};
struct platform_device msm_cpudai_auxpcm_rx = {
.name = "msm-dai-q6",
.id = 2,
.dev = {
.platform_data = &auxpcm_pdata,
},
};
struct platform_device msm_cpudai_auxpcm_tx = {
.name = "msm-dai-q6",
.id = 3,
.dev = {
.platform_data = &auxpcm_pdata,
},
};
struct msm_dai_auxpcm_pdata sec_auxpcm_pdata = {
.clk = "sec_pcm_clk",
.mode_8k = {
.mode = AFE_PCM_CFG_MODE_PCM,
.sync = AFE_PCM_CFG_SYNC_INT,
.frame = AFE_PCM_CFG_FRM_256BPF,
.quant = AFE_PCM_CFG_QUANT_LINEAR_NOPAD,
.slot = 0,
.data = AFE_PCM_CFG_CDATAOE_MASTER,
.pcm_clk_rate = 2048000,
},
.mode_16k = {
.mode = AFE_PCM_CFG_MODE_PCM,
.sync = AFE_PCM_CFG_SYNC_INT,
.frame = AFE_PCM_CFG_FRM_256BPF,
.quant = AFE_PCM_CFG_QUANT_LINEAR_NOPAD,
.slot = 0,
.data = AFE_PCM_CFG_CDATAOE_MASTER,
.pcm_clk_rate = 4096000,
}
};
struct platform_device msm_cpudai_sec_auxpcm_rx = {
.name = "msm-dai-q6",
.id = 12,
.dev = {
.platform_data = &sec_auxpcm_pdata,
},
};
struct platform_device msm_cpudai_sec_auxpcm_tx = {
.name = "msm-dai-q6",
.id = 13,
.dev = {
.platform_data = &sec_auxpcm_pdata,
},
};
struct platform_device msm_cpu_fe = {
.name = "msm-dai-fe",
.id = -1,
};
struct platform_device msm_stub_codec = {
.name = "msm-stub-codec",
.id = 1,
};
struct platform_device msm_voice = {
.name = "msm-pcm-voice",
.id = -1,
};
struct platform_device msm_cpudai_incall_music_rx = {
.name = "msm-dai-q6",
.id = 0x8005,
};
struct platform_device msm_cpudai_incall_record_rx = {
.name = "msm-dai-q6",
.id = 0x8004,
};
struct platform_device msm_cpudai_incall_record_tx = {
.name = "msm-dai-q6",
.id = 0x8003,
};
struct platform_device msm_i2s_cpudai0 = {
.name = "msm-dai-q6",
.id = PRIMARY_I2S_RX,
};
struct platform_device msm_i2s_cpudai1 = {
.name = "msm-dai-q6",
.id = PRIMARY_I2S_TX,
};
struct platform_device msm_i2s_cpudai4 = {
.name = "msm-dai-q6",
.id = SECONDARY_I2S_RX,
};
struct platform_device msm_i2s_cpudai5 = {
.name = "msm-dai-q6",
.id = SECONDARY_I2S_TX,
};
struct platform_device msm_voip = {
.name = "msm-voip-dsp",
.id = -1,
};
struct platform_device msm_cpudai_stub = {
.name = "msm-dai-stub",
.id = -1,
};
struct platform_device msm_dtmf = {
.name = "msm-pcm-dtmf",
.id = -1,
};
struct platform_device msm_host_pcm_voice = {
.name = "msm-host-pcm-voice",
.id = -1,
};
struct platform_device msm_compr_dsp = {
.name = "msm-compr-dsp",
.id = -1,
};
struct platform_device msm_pcm_hostless = {
.name = "msm-pcm-hostless",
.id = -1,
};
struct platform_device msm_cpudai_afe_01_rx = {
.name = "msm-dai-q6",
.id = 0xE0,
};
struct platform_device msm_cpudai_afe_01_tx = {
.name = "msm-dai-q6",
.id = 0xF0,
};
struct platform_device msm_cpudai_afe_02_rx = {
.name = "msm-dai-q6",
.id = 0xF1,
};
struct platform_device msm_cpudai_afe_02_tx = {
.name = "msm-dai-q6",
.id = 0xE1,
};
struct platform_device msm_pcm_afe = {
.name = "msm-pcm-afe",
.id = -1,
};
static struct resource resources_ssbi_pmic1[] = {
{
.start = MSM_PMIC1_SSBI_CMD_PHYS,
.end = MSM_PMIC1_SSBI_CMD_PHYS + MSM_PMIC_SSBI_SIZE - 1,
.flags = IORESOURCE_MEM,
},
};
struct platform_device msm9615_device_ssbi_pmic1 = {
.name = "msm_ssbi",
.id = 0,
.resource = resources_ssbi_pmic1,
.num_resources = ARRAY_SIZE(resources_ssbi_pmic1),
};
static struct resource resources_sps[] = {
{
.name = "pipe_mem",
.start = 0x12800000,
.end = 0x12800000 + 0x4000 - 1,
.flags = IORESOURCE_MEM,
},
{
.name = "bamdma_dma",
.start = 0x12240000,
.end = 0x12240000 + 0x1000 - 1,
.flags = IORESOURCE_MEM,
},
{
.name = "bamdma_bam",
.start = 0x12244000,
.end = 0x12244000 + 0x4000 - 1,
.flags = IORESOURCE_MEM,
},
{
.name = "bamdma_irq",
.start = SPS_BAM_DMA_IRQ,
.end = SPS_BAM_DMA_IRQ,
.flags = IORESOURCE_IRQ,
},
};
struct msm_sps_platform_data msm_sps_pdata = {
.bamdma_restricted_pipes = 0x06,
};
struct platform_device msm_device_sps = {
.name = "msm_sps",
.id = -1,
.num_resources = ARRAY_SIZE(resources_sps),
.resource = resources_sps,
.dev.platform_data = &msm_sps_pdata,
};
#define MSM_NAND_PHYS 0x1B400000
static struct resource resources_nand[] = {
[0] = {
.name = "msm_nand_dmac",
.start = DMOV_NAND_CHAN,
.end = DMOV_NAND_CHAN,
.flags = IORESOURCE_DMA,
},
[1] = {
.name = "msm_nand_phys",
.start = MSM_NAND_PHYS,
.end = MSM_NAND_PHYS + 0x7FF,
.flags = IORESOURCE_MEM,
},
};
struct flash_platform_data msm_nand_data = {
.version = VERSION_2,
};
struct platform_device msm_device_nand = {
.name = "msm_nand",
.id = -1,
.num_resources = ARRAY_SIZE(resources_nand),
.resource = resources_nand,
.dev = {
.platform_data = &msm_nand_data,
},
};
struct platform_device msm_device_smd = {
.name = "msm_smd",
.id = -1,
};
struct platform_device msm_device_bam_dmux = {
.name = "BAM_RMNT",
.id = -1,
};
static struct resource msm_9615_q6_lpass_resources[] = {
{
.start = LPASS_Q6SS_WDOG_EXPIRED,
.end = LPASS_Q6SS_WDOG_EXPIRED,
.flags = IORESOURCE_IRQ,
},
};
struct platform_device msm_9615_q6_lpass = {
.name = "pil-q6v4-lpass",
.id = -1,
.num_resources = ARRAY_SIZE(msm_9615_q6_lpass_resources),
.resource = msm_9615_q6_lpass_resources,
};
static struct resource msm_9615_q6_mss_resources[] = {
{
.start = Q6FW_WDOG_EXPIRED_IRQ,
.end = Q6FW_WDOG_EXPIRED_IRQ,
.flags = IORESOURCE_IRQ,
},
{
.start = Q6SW_WDOG_EXPIRED_IRQ,
.end = Q6SW_WDOG_EXPIRED_IRQ,
.flags = IORESOURCE_IRQ,
},
};
struct platform_device msm_9615_q6_mss = {
.name = "pil-q6v4-modem",
.id = -1,
.num_resources = ARRAY_SIZE(msm_9615_q6_mss_resources),
.resource = msm_9615_q6_mss_resources,
};
#ifdef CONFIG_HW_RANDOM_MSM
/* PRNG device */
#define MSM_PRNG_PHYS 0x1A500000
static struct resource rng_resources = {
.flags = IORESOURCE_MEM,
.start = MSM_PRNG_PHYS,
.end = MSM_PRNG_PHYS + SZ_512 - 1,
};
struct platform_device msm_device_rng = {
.name = "msm_rng",
.id = 0,
.num_resources = 1,
.resource = &rng_resources,
};
#endif
#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) || \
defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
#define QCE_SIZE 0x10000
#define QCE_0_BASE 0x18500000
#define QCE_HW_KEY_SUPPORT 0
#define QCE_SHA_HMAC_SUPPORT 1
#define QCE_SHARE_CE_RESOURCE 1
#define QCE_CE_SHARED 0
static struct resource qcrypto_resources[] = {
[0] = {
.start = QCE_0_BASE,
.end = QCE_0_BASE + QCE_SIZE - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
.name = "crypto_channels",
.start = DMOV_CE_IN_CHAN,
.end = DMOV_CE_OUT_CHAN,
.flags = IORESOURCE_DMA,
},
[2] = {
.name = "crypto_crci_in",
.start = DMOV_CE_IN_CRCI,
.end = DMOV_CE_IN_CRCI,
.flags = IORESOURCE_DMA,
},
[3] = {
.name = "crypto_crci_out",
.start = DMOV_CE_OUT_CRCI,
.end = DMOV_CE_OUT_CRCI,
.flags = IORESOURCE_DMA,
},
};
static struct resource qcedev_resources[] = {
[0] = {
.start = QCE_0_BASE,
.end = QCE_0_BASE + QCE_SIZE - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
.name = "crypto_channels",
.start = DMOV_CE_IN_CHAN,
.end = DMOV_CE_OUT_CHAN,
.flags = IORESOURCE_DMA,
},
[2] = {
.name = "crypto_crci_in",
.start = DMOV_CE_IN_CRCI,
.end = DMOV_CE_IN_CRCI,
.flags = IORESOURCE_DMA,
},
[3] = {
.name = "crypto_crci_out",
.start = DMOV_CE_OUT_CRCI,
.end = DMOV_CE_OUT_CRCI,
.flags = IORESOURCE_DMA,
},
};
#endif
#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
static struct msm_ce_hw_support qcrypto_ce_hw_suppport = {
.ce_shared = QCE_CE_SHARED,
.shared_ce_resource = QCE_SHARE_CE_RESOURCE,
.hw_key_support = QCE_HW_KEY_SUPPORT,
.sha_hmac = QCE_SHA_HMAC_SUPPORT,
.bus_scale_table = NULL,
};
struct platform_device msm9615_qcrypto_device = {
.name = "qcrypto",
.id = 0,
.num_resources = ARRAY_SIZE(qcrypto_resources),
.resource = qcrypto_resources,
.dev = {
.coherent_dma_mask = DMA_BIT_MASK(32),
.platform_data = &qcrypto_ce_hw_suppport,
},
};
#endif
#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
static struct msm_ce_hw_support qcedev_ce_hw_suppport = {
.ce_shared = QCE_CE_SHARED,
.shared_ce_resource = QCE_SHARE_CE_RESOURCE,
.hw_key_support = QCE_HW_KEY_SUPPORT,
.sha_hmac = QCE_SHA_HMAC_SUPPORT,
.bus_scale_table = NULL,
};
struct platform_device msm9615_qcedev_device = {
.name = "qce",
.id = 0,
.num_resources = ARRAY_SIZE(qcedev_resources),
.resource = qcedev_resources,
.dev = {
.coherent_dma_mask = DMA_BIT_MASK(32),
.platform_data = &qcedev_ce_hw_suppport,
},
};
#endif
#define MSM_SDC1_BASE 0x12180000
#define MSM_SDC1_DML_BASE (MSM_SDC1_BASE + 0x800)
#define MSM_SDC1_BAM_BASE (MSM_SDC1_BASE + 0x2000)
#define MSM_SDC2_BASE 0x12140000
#define MSM_SDC2_DML_BASE (MSM_SDC2_BASE + 0x800)
#define MSM_SDC2_BAM_BASE (MSM_SDC2_BASE + 0x2000)
static struct resource resources_sdc1[] = {
{
.name = "core_mem",
.flags = IORESOURCE_MEM,
.start = MSM_SDC1_BASE,
.end = MSM_SDC1_DML_BASE - 1,
},
{
.name = "core_irq",
.flags = IORESOURCE_IRQ,
.start = SDC1_IRQ_0,
.end = SDC1_IRQ_0
},
#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
{
.name = "dml_mem",
.start = MSM_SDC1_DML_BASE,
.end = MSM_SDC1_BAM_BASE - 1,
.flags = IORESOURCE_MEM,
},
{
.name = "bam_mem",
.start = MSM_SDC1_BAM_BASE,
.end = MSM_SDC1_BAM_BASE + (2 * SZ_4K) - 1,
.flags = IORESOURCE_MEM,
},
{
.name = "bam_irq",
.start = SDC1_BAM_IRQ,
.end = SDC1_BAM_IRQ,
.flags = IORESOURCE_IRQ,
},
#endif
};
static struct resource resources_sdc2[] = {
{
.name = "core_mem",
.flags = IORESOURCE_MEM,
.start = MSM_SDC2_BASE,
.end = MSM_SDC2_DML_BASE - 1,
},
{
.name = "core_irq",
.flags = IORESOURCE_IRQ,
.start = SDC2_IRQ_0,
.end = SDC2_IRQ_0
},
#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
{
.name = "dml_mem",
.start = MSM_SDC2_DML_BASE,
.end = MSM_SDC2_BAM_BASE - 1,
.flags = IORESOURCE_MEM,
},
{
.name = "bam_mem",
.start = MSM_SDC2_BAM_BASE,
.end = MSM_SDC2_BAM_BASE + (2 * SZ_4K) - 1,
.flags = IORESOURCE_MEM,
},
{
.name = "bam_irq",
.start = SDC2_BAM_IRQ,
.end = SDC2_BAM_IRQ,
.flags = IORESOURCE_IRQ,
},
#endif
};
struct platform_device msm_device_sdc1 = {
.name = "msm_sdcc",
.id = 1,
.num_resources = ARRAY_SIZE(resources_sdc1),
.resource = resources_sdc1,
.dev = {
.coherent_dma_mask = 0xffffffff,
},
};
struct platform_device msm_device_sdc2 = {
.name = "msm_sdcc",
.id = 2,
.num_resources = ARRAY_SIZE(resources_sdc2),
.resource = resources_sdc2,
.dev = {
.coherent_dma_mask = 0xffffffff,
},
};
static struct platform_device *msm_sdcc_devices[] __initdata = {
&msm_device_sdc1,
&msm_device_sdc2,
};
int __init msm_add_sdcc(unsigned int controller, struct mmc_platform_data *plat)
{
struct platform_device *pdev;
if (controller < 1 || controller > 2)
return -EINVAL;
pdev = msm_sdcc_devices[controller - 1];
pdev->dev.platform_data = plat;
return platform_device_register(pdev);
}
#ifdef CONFIG_FB_MSM_EBI2
static struct resource msm_ebi2_lcdc_resources[] = {
{
.name = "base",
.start = 0x1B300000,
.end = 0x1B300000 + PAGE_SIZE - 1,
.flags = IORESOURCE_MEM,
},
{
.name = "lcd01",
.start = 0x1FC00000,
.end = 0x1FC00000 + 0x80000 - 1,
.flags = IORESOURCE_MEM,
},
};
struct platform_device msm_ebi2_lcdc_device = {
.name = "ebi2_lcd",
.id = 0,
.num_resources = ARRAY_SIZE(msm_ebi2_lcdc_resources),
.resource = msm_ebi2_lcdc_resources,
};
#endif
#ifdef CONFIG_CACHE_L2X0
static int __init l2x0_cache_init(void)
{
int aux_ctrl = 0;
/* Way Size 010(0x2) 32KB */
aux_ctrl = (0x1 << L2X0_AUX_CTRL_SHARE_OVERRIDE_SHIFT) | \
(0x2 << L2X0_AUX_CTRL_WAY_SIZE_SHIFT) | \
(0x1 << L2X0_AUX_CTRL_EVNT_MON_BUS_EN_SHIFT);
/* L2 Latency setting required by hardware. Default is 0x20
which is no good.
*/
writel_relaxed(0x220, MSM_L2CC_BASE + L2X0_DATA_LATENCY_CTRL);
l2x0_init(MSM_L2CC_BASE, aux_ctrl, L2X0_AUX_CTRL_MASK);
return 0;
}
#else
static int __init l2x0_cache_init(void){ return 0; }
#endif
struct msm_rpm_platform_data msm9615_rpm_data __initdata = {
.reg_base_addrs = {
[MSM_RPM_PAGE_STATUS] = MSM_RPM_BASE,
[MSM_RPM_PAGE_CTRL] = MSM_RPM_BASE + 0x400,
[MSM_RPM_PAGE_REQ] = MSM_RPM_BASE + 0x600,
[MSM_RPM_PAGE_ACK] = MSM_RPM_BASE + 0xa00,
},
.irq_ack = RPM_APCC_CPU0_GP_HIGH_IRQ,
.irq_err = RPM_APCC_CPU0_GP_LOW_IRQ,
.irq_wakeup = RPM_APCC_CPU0_WAKE_UP_IRQ,
.ipc_rpm_reg = MSM_APCS_GCC_BASE + 0x008,
.ipc_rpm_val = 4,
.target_id = {
MSM_RPM_MAP(9615, NOTIFICATION_CONFIGURED_0, NOTIFICATION, 4),
MSM_RPM_MAP(9615, NOTIFICATION_REGISTERED_0, NOTIFICATION, 4),
MSM_RPM_MAP(9615, INVALIDATE_0, INVALIDATE, 8),
MSM_RPM_MAP(9615, TRIGGER_TIMED_TO, TRIGGER_TIMED, 1),
MSM_RPM_MAP(9615, TRIGGER_TIMED_SCLK_COUNT, TRIGGER_TIMED, 1),
MSM_RPM_MAP(9615, RPM_CTL, RPM_CTL, 1),
MSM_RPM_MAP(9615, CXO_CLK, CXO_CLK, 1),
MSM_RPM_MAP(9615, SYSTEM_FABRIC_CLK, SYSTEM_FABRIC_CLK, 1),
MSM_RPM_MAP(9615, DAYTONA_FABRIC_CLK, DAYTONA_FABRIC_CLK, 1),
MSM_RPM_MAP(9615, SFPB_CLK, SFPB_CLK, 1),
MSM_RPM_MAP(9615, CFPB_CLK, CFPB_CLK, 1),
MSM_RPM_MAP(9615, EBI1_CLK, EBI1_CLK, 1),
MSM_RPM_MAP(9615, SYS_FABRIC_CFG_HALT_0,
SYS_FABRIC_CFG_HALT, 2),
MSM_RPM_MAP(9615, SYS_FABRIC_CFG_CLKMOD_0,
SYS_FABRIC_CFG_CLKMOD, 3),
MSM_RPM_MAP(9615, SYS_FABRIC_CFG_IOCTL,
SYS_FABRIC_CFG_IOCTL, 1),
MSM_RPM_MAP(9615, SYSTEM_FABRIC_ARB_0,
SYSTEM_FABRIC_ARB, 27),
MSM_RPM_MAP(9615, PM8018_S1_0, PM8018_S1, 2),
MSM_RPM_MAP(9615, PM8018_S2_0, PM8018_S2, 2),
MSM_RPM_MAP(9615, PM8018_S3_0, PM8018_S3, 2),
MSM_RPM_MAP(9615, PM8018_S4_0, PM8018_S4, 2),
MSM_RPM_MAP(9615, PM8018_S5_0, PM8018_S5, 2),
MSM_RPM_MAP(9615, PM8018_L1_0, PM8018_L1, 2),
MSM_RPM_MAP(9615, PM8018_L2_0, PM8018_L2, 2),
MSM_RPM_MAP(9615, PM8018_L3_0, PM8018_L3, 2),
MSM_RPM_MAP(9615, PM8018_L4_0, PM8018_L4, 2),
MSM_RPM_MAP(9615, PM8018_L5_0, PM8018_L5, 2),
MSM_RPM_MAP(9615, PM8018_L6_0, PM8018_L6, 2),
MSM_RPM_MAP(9615, PM8018_L7_0, PM8018_L7, 2),
MSM_RPM_MAP(9615, PM8018_L8_0, PM8018_L8, 2),
MSM_RPM_MAP(9615, PM8018_L9_0, PM8018_L9, 2),
MSM_RPM_MAP(9615, PM8018_L10_0, PM8018_L10, 2),
MSM_RPM_MAP(9615, PM8018_L11_0, PM8018_L11, 2),
MSM_RPM_MAP(9615, PM8018_L12_0, PM8018_L12, 2),
MSM_RPM_MAP(9615, PM8018_L13_0, PM8018_L13, 2),
MSM_RPM_MAP(9615, PM8018_L14_0, PM8018_L14, 2),
MSM_RPM_MAP(9615, PM8018_LVS1, PM8018_LVS1, 1),
MSM_RPM_MAP(9615, NCP_0, NCP, 2),
MSM_RPM_MAP(9615, CXO_BUFFERS, CXO_BUFFERS, 1),
MSM_RPM_MAP(9615, USB_OTG_SWITCH, USB_OTG_SWITCH, 1),
MSM_RPM_MAP(9615, HDMI_SWITCH, HDMI_SWITCH, 1),
MSM_RPM_MAP(9615, VOLTAGE_CORNER, VOLTAGE_CORNER, 1),
},
.target_status = {
MSM_RPM_STATUS_ID_MAP(9615, VERSION_MAJOR),
MSM_RPM_STATUS_ID_MAP(9615, VERSION_MINOR),
MSM_RPM_STATUS_ID_MAP(9615, VERSION_BUILD),
MSM_RPM_STATUS_ID_MAP(9615, SUPPORTED_RESOURCES_0),
MSM_RPM_STATUS_ID_MAP(9615, SUPPORTED_RESOURCES_1),
MSM_RPM_STATUS_ID_MAP(9615, SUPPORTED_RESOURCES_2),
MSM_RPM_STATUS_ID_MAP(9615, RESERVED_SUPPORTED_RESOURCES_0),
MSM_RPM_STATUS_ID_MAP(9615, SEQUENCE),
MSM_RPM_STATUS_ID_MAP(9615, RPM_CTL),
MSM_RPM_STATUS_ID_MAP(9615, CXO_CLK),
MSM_RPM_STATUS_ID_MAP(9615, SYSTEM_FABRIC_CLK),
MSM_RPM_STATUS_ID_MAP(9615, DAYTONA_FABRIC_CLK),
MSM_RPM_STATUS_ID_MAP(9615, SFPB_CLK),
MSM_RPM_STATUS_ID_MAP(9615, CFPB_CLK),
MSM_RPM_STATUS_ID_MAP(9615, EBI1_CLK),
MSM_RPM_STATUS_ID_MAP(9615, SYS_FABRIC_CFG_HALT),
MSM_RPM_STATUS_ID_MAP(9615, SYS_FABRIC_CFG_CLKMOD),
MSM_RPM_STATUS_ID_MAP(9615, SYS_FABRIC_CFG_IOCTL),
MSM_RPM_STATUS_ID_MAP(9615, SYSTEM_FABRIC_ARB),
MSM_RPM_STATUS_ID_MAP(9615, PM8018_S1_0),
MSM_RPM_STATUS_ID_MAP(9615, PM8018_S1_1),
MSM_RPM_STATUS_ID_MAP(9615, PM8018_S2_0),
MSM_RPM_STATUS_ID_MAP(9615, PM8018_S2_1),
MSM_RPM_STATUS_ID_MAP(9615, PM8018_S3_0),
MSM_RPM_STATUS_ID_MAP(9615, PM8018_S3_1),
MSM_RPM_STATUS_ID_MAP(9615, PM8018_S4_0),
MSM_RPM_STATUS_ID_MAP(9615, PM8018_S4_1),
MSM_RPM_STATUS_ID_MAP(9615, PM8018_S5_0),
MSM_RPM_STATUS_ID_MAP(9615, PM8018_S5_1),
MSM_RPM_STATUS_ID_MAP(9615, PM8018_L1_0),
MSM_RPM_STATUS_ID_MAP(9615, PM8018_L1_1),
MSM_RPM_STATUS_ID_MAP(9615, PM8018_L2_0),
MSM_RPM_STATUS_ID_MAP(9615, PM8018_L2_1),
MSM_RPM_STATUS_ID_MAP(9615, PM8018_L3_0),
MSM_RPM_STATUS_ID_MAP(9615, PM8018_L3_1),
MSM_RPM_STATUS_ID_MAP(9615, PM8018_L4_0),
MSM_RPM_STATUS_ID_MAP(9615, PM8018_L4_1),
MSM_RPM_STATUS_ID_MAP(9615, PM8018_L5_0),
MSM_RPM_STATUS_ID_MAP(9615, PM8018_L5_1),
MSM_RPM_STATUS_ID_MAP(9615, PM8018_L6_0),
MSM_RPM_STATUS_ID_MAP(9615, PM8018_L6_1),
MSM_RPM_STATUS_ID_MAP(9615, PM8018_L7_0),
MSM_RPM_STATUS_ID_MAP(9615, PM8018_L7_1),
MSM_RPM_STATUS_ID_MAP(9615, PM8018_L8_0),
MSM_RPM_STATUS_ID_MAP(9615, PM8018_L8_1),
MSM_RPM_STATUS_ID_MAP(9615, PM8018_L9_0),
MSM_RPM_STATUS_ID_MAP(9615, PM8018_L9_1),
MSM_RPM_STATUS_ID_MAP(9615, PM8018_L10_0),
MSM_RPM_STATUS_ID_MAP(9615, PM8018_L10_1),
MSM_RPM_STATUS_ID_MAP(9615, PM8018_L11_0),
MSM_RPM_STATUS_ID_MAP(9615, PM8018_L11_1),
MSM_RPM_STATUS_ID_MAP(9615, PM8018_L12_0),
MSM_RPM_STATUS_ID_MAP(9615, PM8018_L12_1),
MSM_RPM_STATUS_ID_MAP(9615, PM8018_L13_0),
MSM_RPM_STATUS_ID_MAP(9615, PM8018_L13_1),
MSM_RPM_STATUS_ID_MAP(9615, PM8018_L14_0),
MSM_RPM_STATUS_ID_MAP(9615, PM8018_L14_1),
MSM_RPM_STATUS_ID_MAP(9615, PM8018_LVS1),
MSM_RPM_STATUS_ID_MAP(9615, NCP_0),
MSM_RPM_STATUS_ID_MAP(9615, NCP_1),
MSM_RPM_STATUS_ID_MAP(9615, CXO_BUFFERS),
MSM_RPM_STATUS_ID_MAP(9615, USB_OTG_SWITCH),
MSM_RPM_STATUS_ID_MAP(9615, HDMI_SWITCH),
MSM_RPM_STATUS_ID_MAP(9615, VOLTAGE_CORNER),
},
.target_ctrl_id = {
MSM_RPM_CTRL_MAP(9615, VERSION_MAJOR),
MSM_RPM_CTRL_MAP(9615, VERSION_MINOR),
MSM_RPM_CTRL_MAP(9615, VERSION_BUILD),
MSM_RPM_CTRL_MAP(9615, REQ_CTX_0),
MSM_RPM_CTRL_MAP(9615, REQ_SEL_0),
MSM_RPM_CTRL_MAP(9615, ACK_CTX_0),
MSM_RPM_CTRL_MAP(9615, ACK_SEL_0),
},
.sel_invalidate = MSM_RPM_9615_SEL_INVALIDATE,
.sel_notification = MSM_RPM_9615_SEL_NOTIFICATION,
.sel_last = MSM_RPM_9615_SEL_LAST,
.ver = {3, 0, 0},
};
struct platform_device msm9615_rpm_device = {
.name = "msm_rpm",
.id = -1,
};
static uint16_t msm_mpm_irqs_m2a[MSM_MPM_NR_MPM_IRQS] __initdata = {
[4] = MSM_GPIO_TO_INT(30),
[5] = MSM_GPIO_TO_INT(59),
[6] = MSM_GPIO_TO_INT(81),
[7] = MSM_GPIO_TO_INT(87),
[8] = MSM_GPIO_TO_INT(86),
[9] = MSM_GPIO_TO_INT(2),
[10] = MSM_GPIO_TO_INT(6),
[11] = MSM_GPIO_TO_INT(10),
[12] = MSM_GPIO_TO_INT(14),
[13] = MSM_GPIO_TO_INT(18),
[14] = MSM_GPIO_TO_INT(7),
[15] = MSM_GPIO_TO_INT(11),
[16] = MSM_GPIO_TO_INT(15),
[19] = MSM_GPIO_TO_INT(26),
[20] = MSM_GPIO_TO_INT(28),
[22] = USB_HSIC_IRQ,
[23] = MSM_GPIO_TO_INT(19),
[24] = MSM_GPIO_TO_INT(23),
[26] = MSM_GPIO_TO_INT(3),
[27] = MSM_GPIO_TO_INT(68),
[29] = MSM_GPIO_TO_INT(78),
[31] = MSM_GPIO_TO_INT(0),
[32] = MSM_GPIO_TO_INT(4),
[33] = MSM_GPIO_TO_INT(22),
[34] = MSM_GPIO_TO_INT(17),
[37] = MSM_GPIO_TO_INT(20),
[39] = MSM_GPIO_TO_INT(84),
[40] = USB1_HS_IRQ,
[42] = MSM_GPIO_TO_INT(24),
[43] = MSM_GPIO_TO_INT(79),
[44] = MSM_GPIO_TO_INT(80),
[45] = MSM_GPIO_TO_INT(82),
[46] = MSM_GPIO_TO_INT(85),
[47] = MSM_GPIO_TO_INT(45),
[48] = MSM_GPIO_TO_INT(50),
[49] = MSM_GPIO_TO_INT(51),
[50] = MSM_GPIO_TO_INT(69),
[51] = MSM_GPIO_TO_INT(77),
[52] = MSM_GPIO_TO_INT(1),
[53] = MSM_GPIO_TO_INT(5),
[54] = MSM_GPIO_TO_INT(40),
[55] = MSM_GPIO_TO_INT(27),
};
static uint16_t msm_mpm_bypassed_apps_irqs[] __initdata = {
TLMM_MSM_SUMMARY_IRQ,
RPM_APCC_CPU0_GP_HIGH_IRQ,
RPM_APCC_CPU0_GP_MEDIUM_IRQ,
RPM_APCC_CPU0_GP_LOW_IRQ,
RPM_APCC_CPU0_WAKE_UP_IRQ,
MSS_TO_APPS_IRQ_0,
MSS_TO_APPS_IRQ_1,
LPASS_SCSS_GP_LOW_IRQ,
LPASS_SCSS_GP_MEDIUM_IRQ,
LPASS_SCSS_GP_HIGH_IRQ,
SPS_MTI_31,
A2_BAM_IRQ,
USB1_HS_BAM_IRQ,
};
struct msm_mpm_device_data msm9615_mpm_dev_data __initdata = {
.irqs_m2a = msm_mpm_irqs_m2a,
.irqs_m2a_size = ARRAY_SIZE(msm_mpm_irqs_m2a),
.bypassed_apps_irqs = msm_mpm_bypassed_apps_irqs,
.bypassed_apps_irqs_size = ARRAY_SIZE(msm_mpm_bypassed_apps_irqs),
.mpm_request_reg_base = MSM_RPM_BASE + 0x9d8,
.mpm_status_reg_base = MSM_RPM_BASE + 0xdf8,
.mpm_apps_ipc_reg = MSM_APCS_GCC_BASE + 0x008,
.mpm_apps_ipc_val = BIT(1),
.mpm_ipc_irq = RPM_APCC_CPU0_GP_MEDIUM_IRQ,
};
static uint8_t spm_wfi_cmd_sequence[] __initdata = {
0x00, 0x03, 0x00, 0x0f,
};
static uint8_t spm_power_collapse_without_rpm[] __initdata = {
0x34, 0x24, 0x14, 0x04,
0x54, 0x03, 0x54, 0x04,
0x14, 0x24, 0x3e, 0x0f,
};
static uint8_t spm_power_collapse_with_rpm[] __initdata = {
0x34, 0x24, 0x14, 0x04,
0x54, 0x07, 0x54, 0x04,
0x14, 0x24, 0x3e, 0x0f,
};
static struct msm_spm_seq_entry msm_spm_seq_list[] __initdata = {
[0] = {
.mode = MSM_SPM_MODE_CLOCK_GATING,
.notify_rpm = false,
.cmd = spm_wfi_cmd_sequence,
},
[1] = {
.mode = MSM_SPM_MODE_POWER_COLLAPSE,
.notify_rpm = false,
.cmd = spm_power_collapse_without_rpm,
},
[2] = {
.mode = MSM_SPM_MODE_POWER_COLLAPSE,
.notify_rpm = true,
.cmd = spm_power_collapse_with_rpm,
},
};
static struct msm_spm_platform_data msm_spm_data[] __initdata = {
[0] = {
.reg_base_addr = MSM_SAW0_BASE,
.reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
.reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1001,
.num_modes = ARRAY_SIZE(msm_spm_seq_list),
.modes = msm_spm_seq_list,
},
};
static struct msm_rpmrs_level msm_rpmrs_levels[] __initdata = {
{
MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT,
MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
true,
100, 8000, 100000, 1,
},
{
MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE,
MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
true,
2000, 5000, 60100000, 3000,
},
{
MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
false,
6300, 5000, 60350000, 3500,
},
{
MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, MAX, ACTIVE),
false,
13300, 2000, 71850000, 6800,
},
{
MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, RET_HIGH, RET_LOW),
false,
28300, 0, 76350000, 9800,
},
};
static struct msm_rpmrs_platform_data msm_rpmrs_data __initdata = {
.levels = &msm_rpmrs_levels[0],
.num_levels = ARRAY_SIZE(msm_rpmrs_levels),
.vdd_mem_levels = {
[MSM_RPMRS_VDD_MEM_RET_LOW] = 750000,
[MSM_RPMRS_VDD_MEM_RET_HIGH] = 750000,
[MSM_RPMRS_VDD_MEM_ACTIVE] = 1050000,
[MSM_RPMRS_VDD_MEM_MAX] = 1150000,
},
.vdd_dig_levels = {
[MSM_RPMRS_VDD_DIG_RET_LOW] = 0,
[MSM_RPMRS_VDD_DIG_RET_HIGH] = 0,
[MSM_RPMRS_VDD_DIG_ACTIVE] = 1,
[MSM_RPMRS_VDD_DIG_MAX] = 3,
},
.vdd_mask = 0x7FFFFF,
.rpmrs_target_id = {
[MSM_RPMRS_ID_PXO_CLK] = MSM_RPM_ID_CXO_CLK,
[MSM_RPMRS_ID_L2_CACHE_CTL] = MSM_RPM_ID_LAST,
[MSM_RPMRS_ID_VDD_DIG_0] = MSM_RPM_ID_VOLTAGE_CORNER,
[MSM_RPMRS_ID_VDD_DIG_1] = MSM_RPM_ID_LAST,
[MSM_RPMRS_ID_VDD_MEM_0] = MSM_RPM_ID_PM8018_L9_0,
[MSM_RPMRS_ID_VDD_MEM_1] = MSM_RPM_ID_PM8018_L9_1,
[MSM_RPMRS_ID_RPM_CTL] = MSM_RPM_ID_RPM_CTL,
},
};
static struct msm_rpmstats_platform_data msm_rpm_stat_pdata = {
.version = 1,
};
static struct resource msm_rpm_stat_resource[] = {
{
.start = 0x0010D204,
.end = 0x0010D204 + SZ_8K,
.flags = IORESOURCE_MEM,
.name = "phys_addr_base"
},
};
struct platform_device msm9615_rpm_stat_device = {
.name = "msm_rpm_stat",
.id = -1,
.resource = msm_rpm_stat_resource,
.num_resources = ARRAY_SIZE(msm_rpm_stat_resource),
.dev = {
.platform_data = &msm_rpm_stat_pdata,
}
};
static struct resource resources_rpm_master_stats[] = {
{
.start = MSM9615_RPM_MASTER_STATS_BASE,
.end = MSM9615_RPM_MASTER_STATS_BASE + SZ_256,
.flags = IORESOURCE_MEM,
},
};
static char *master_names[] = {
"KPSS",
"MPSS",
"LPASS",
};
static struct msm_rpm_master_stats_platform_data msm_rpm_master_stat_pdata = {
.masters = master_names,
.num_masters = ARRAY_SIZE(master_names),
.master_offset = 32,
};
struct platform_device msm9615_rpm_master_stat_device = {
.name = "msm_rpm_master_stats",
.id = -1,
.num_resources = ARRAY_SIZE(resources_rpm_master_stats),
.resource = resources_rpm_master_stats,
.dev = {
.platform_data = &msm_rpm_master_stat_pdata,
},
};
static struct msm_rpm_log_platform_data msm_rpm_log_pdata = {
.phys_addr_base = 0x0010AC00,
.reg_offsets = {
[MSM_RPM_LOG_PAGE_INDICES] = 0x00000080,
[MSM_RPM_LOG_PAGE_BUFFER] = 0x000000A0,
},
.phys_size = SZ_8K,
.log_len = 4096, /* log's buffer length in bytes */
.log_len_mask = (4096 >> 2) - 1, /* length mask in units of u32 */
};
struct platform_device msm9615_rpm_log_device = {
.name = "msm_rpm_log",
.id = -1,
.dev = {
.platform_data = &msm_rpm_log_pdata,
},
};
static struct msm_pm_init_data_type msm_pm_data = {
.use_sync_timer = false,
.pc_mode = MSM_PM_PC_NOTZ_L2_EXT,
};
struct platform_device msm9615_pm_8x60 = {
.name = "pm-8x60",
.id = -1,
.dev = {
.platform_data = &msm_pm_data,
},
};
uint32_t __init msm9615_rpm_get_swfi_latency(void)
{
int i;
for (i = 0; i < ARRAY_SIZE(msm_rpmrs_levels); i++) {
if (msm_rpmrs_levels[i].sleep_mode ==
MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)
return msm_rpmrs_levels[i].latency_us;
}
return 0;
}
struct android_usb_platform_data msm_android_usb_pdata = {
.usb_core_id = 0,
};
struct platform_device msm_android_usb_device = {
.name = "android_usb",
.id = -1,
.dev = {
.platform_data = &msm_android_usb_pdata,
},
};
struct android_usb_platform_data msm_android_usb_hsic_pdata = {
.usb_core_id = 1,
};
struct platform_device msm_android_usb_hsic_device = {
.name = "android_usb_hsic",
.id = -1,
.dev = {
.platform_data = &msm_android_usb_hsic_pdata,
},
};
static struct resource msm_gpio_resources[] = {
{
.start = TLMM_MSM_SUMMARY_IRQ,
.end = TLMM_MSM_SUMMARY_IRQ,
.flags = IORESOURCE_IRQ,
},
};
static struct msm_gpio_pdata msm9615_gpio_pdata = {
.ngpio = 88,
.direct_connect_irqs = 8,
};
struct platform_device msm_gpio_device = {
.name = "msmgpio",
.id = -1,
.num_resources = ARRAY_SIZE(msm_gpio_resources),
.resource = msm_gpio_resources,
.dev.platform_data = &msm9615_gpio_pdata,
};
void __init msm9615_device_init(void)
{
msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
BUG_ON(msm_rpm_init(&msm9615_rpm_data));
BUG_ON(msm_rpmrs_levels_init(&msm_rpmrs_data));
msm_android_usb_pdata.swfi_latency =
msm_rpmrs_levels[0].latency_us;
msm_android_usb_hsic_pdata.swfi_latency =
msm_rpmrs_levels[0].latency_us;
}
#define MSM_SHARED_RAM_PHYS 0x40000000
void __init msm9615_map_io(void)
{
msm_shared_ram_phys = MSM_SHARED_RAM_PHYS;
msm_map_msm9615_io();
l2x0_cache_init();
if (socinfo_init() < 0)
pr_err("socinfo_init() failed!\n");
}
void __init msm9615_init_irq(void)
{
struct msm_mpm_device_data *data = NULL;
#ifdef CONFIG_MSM_MPM
data = &msm9615_mpm_dev_data;
#endif
msm_mpm_irq_extn_init(data);
gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
(void *)MSM_QGIC_CPU_BASE);
}
struct platform_device msm_bus_9615_sys_fabric = {
.name = "msm_bus_fabric",
.id = MSM_BUS_FAB_SYSTEM,
};
struct platform_device msm_bus_def_fab = {
.name = "msm_bus_fabric",
.id = MSM_BUS_FAB_DEFAULT,
};
#ifdef CONFIG_FB_MSM_EBI2
static void __init msm_register_device(struct platform_device *pdev, void *data)
{
int ret;
pdev->dev.platform_data = data;
ret = platform_device_register(pdev);
if (ret)
dev_err(&pdev->dev,
"%s: platform_device_register() failed = %d\n",
__func__, ret);
}
void __init msm_fb_register_device(char *name, void *data)
{
if (!strncmp(name, "ebi2", 4))
msm_register_device(&msm_ebi2_lcdc_device, data);
else
pr_err("%s: unknown device! %s\n", __func__, name);
}
#endif
| {
"pile_set_name": "Github"
} |
import { Subscriber } from '../Subscriber';
import { EmptyObservable } from '../observable/EmptyObservable';
/**
* Returns an Observable that repeats the stream of items emitted by the source Observable at most count times.
*
* <img src="./img/repeat.png" width="100%">
*
* @param {number} [count] The number of times the source Observable items are repeated, a count of 0 will yield
* an empty Observable.
* @return {Observable} An Observable that repeats the stream of items emitted by the source Observable at most
* count times.
* @method repeat
* @owner Observable
*/
export function repeat(count = -1) {
return (source) => {
if (count === 0) {
return new EmptyObservable();
}
else if (count < 0) {
return source.lift(new RepeatOperator(-1, source));
}
else {
return source.lift(new RepeatOperator(count - 1, source));
}
};
}
class RepeatOperator {
constructor(count, source) {
this.count = count;
this.source = source;
}
call(subscriber, source) {
return source.subscribe(new RepeatSubscriber(subscriber, this.count, this.source));
}
}
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
class RepeatSubscriber extends Subscriber {
constructor(destination, count, source) {
super(destination);
this.count = count;
this.source = source;
}
complete() {
if (!this.isStopped) {
const { source, count } = this;
if (count === 0) {
return super.complete();
}
else if (count > -1) {
this.count = count - 1;
}
source.subscribe(this._unsubscribeAndRecycle());
}
}
}
//# sourceMappingURL=repeat.js.map | {
"pile_set_name": "Github"
} |
import React, { PropTypes } from 'react';
import PreviewToolbar from '../../containers/preview/preview_toolbar';
import DataVisualisation from '../../containers/preview/data_visualisation';
import ChartSidebar from '../../containers/preview/chart_sidebar';
import Paper from 'material-ui/Paper';
import { Card } from 'material-ui/Card';
import { _ } from 'meteor/underscore';
import { grey300 } from 'material-ui/styles/colors';
class Preview extends React.Component {
constructor(props) {
super(props);
this.state = {
isQueryChanged: false,
isLive: true,
};
this.toggleRenderState = this.toggleRenderState.bind(this);
this.getCurrentData = this.getCurrentData.bind(this);
}
componentWillReceiveProps({
viewObject, queryObject, toggleStartConstructor, checkChangingQuery,
}) {
this.setState({
isQueryChanged: checkChangingQuery(this.props.viewObject.query, viewObject.query),
});
toggleStartConstructor(_.isEmpty(queryObject.fields));
}
getCurrentData() {
if (!this || !this.refs || !this.refs.dataVisualisationCont) return null;
const dataVisualCont = this.refs.dataVisualisationCont;
const dataVisualisation = dataVisualCont.refs.dataVisualisation.getWrappedInstance();
const { data, queryObject, viewObject } = dataVisualisation.props;
viewObject.data = data;
return { queryObject, viewObject };
}
toggleRenderState() {
this.setState({ isLive: !this.state.isLive });
}
render() {
const { savedQuery, queryObject, viewObject, tableType } = this.props;
const { isQueryChanged, isLive } = this.state;
const isFields = !_.isEmpty(queryObject.fields);
return (
<div
className="preview-wrap"
style={isFields ? { height: 'inherit' } : { float: 'right' }}
>
<Card className="preview">
{isFields ?
<div>
{tableType === 'simple' ?
<PreviewToolbar fields={queryObject.fields} />
: ''}
<DataVisualisation
tableType={tableType}
queryObject={queryObject}
viewObject={viewObject}
savedQuery={savedQuery}
isQueryChanged={isQueryChanged}
isLive={isLive}
ref="dataVisualisationCont"
/>
</div>
: ''}
</Card>
<Paper style={{ backgroundColor: grey300 }} className="chart-sidebar-container">
<ChartSidebar
isLive={isLive}
chartType={viewObject.chartType}
toggleRenderState={this.toggleRenderState}
query={viewObject.query}
getCurrentData={this.getCurrentData}
/>
</Paper>
</div>
);
}
}
Preview.propTypes = {
tableType: PropTypes.string,
savedQuery: PropTypes.string,
viewObject: PropTypes.object,
queryObject: PropTypes.object,
};
export default Preview;
| {
"pile_set_name": "Github"
} |
/**
* Module dependencies.
*/
var utils = require('./utils');
/**
* Initialization middleware, exposing the
* request and response to eachother, as well
* as defaulting the X-Powered-By header field.
*
* @param {Function} app
* @return {Function}
* @api private
*/
exports.init = function(app){
return function expressInit(req, res, next){
if (app.enabled('x-powered-by')) res.setHeader('X-Powered-By', 'Express');
req.res = res;
res.req = req;
req.next = next;
req.__proto__ = app.request;
res.__proto__ = app.response;
res.locals = res.locals || utils.locals(res);
next();
}
};
| {
"pile_set_name": "Github"
} |
/*
* FreeModbus Libary: STR71x Port
* Copyright (C) 2006 Christian Walter <[email protected]>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* File: $Id$
*/
/* ----------------------- System includes ----------------------------------*/
#include "assert.h"
/* ----------------------- FreeRTOS includes --------------------------------*/
#include "FreeRTOS.h"
#include "task.h"
/* ----------------------- STR71X includes ----------------------------------*/
#include "gpio.h"
#include "eic.h"
#include "uart.h"
#include "tim.h"
/* ----------------------- Platform includes --------------------------------*/
#include "port.h"
/* ----------------------- Modbus includes ----------------------------------*/
#include "mb.h"
#include "mbport.h"
/* ----------------------- Defines ------------------------------------------*/
#define MB_UART_DEV ( UART0 )
#define MB_UART_RX_PORT ( GPIO0 )
#define MB_UART_RX_PIN ( 8 )
#define MB_UART_TX_PORT ( GPIO0 )
#define MB_UART_TX_PIN ( 9 )
#define MB_UART_IRQ_CH ( UART0_IRQChannel )
#define MB_UART_TX_QUEUE_LEN ( 8 )
#define MB_IRQ_PRIORITY ( 1 )
/* ----------------------- Static functions ---------------------------------*/
void prvvMBSerialIRQHandler( void ) __attribute__ ( ( naked ) );
static inline BOOL prvMBPortTXIsEnabled( );
static inline BOOL prvMBPortRXIsEnabled( );
/* ----------------------- Start implementation -----------------------------*/
BOOL
xMBPortSerialInit( UCHAR ucPort, ULONG ulBaudRate, UCHAR ucDataBits, eMBParity eParity )
{
BOOL xResult = TRUE;
UARTParity_TypeDef eUARTParity;
UARTMode_TypeDef eUARTMode;
(void)ucPort;
switch ( eParity )
{
case MB_PAR_EVEN:
eUARTParity = UART_EVEN_PARITY;
break;
case MB_PAR_ODD:
eUARTParity = UART_ODD_PARITY;
break;
case MB_PAR_NONE:
eUARTParity = UART_NO_PARITY;
break;
}
switch ( ucDataBits )
{
case 7:
if( eParity == MB_PAR_NONE )
{
/* not supported by our hardware. */
xResult = FALSE;
}
else
{
eUARTMode = UARTM_7D_P;
}
break;
case 8:
if( eParity == MB_PAR_NONE )
{
eUARTMode = UARTM_8D;
}
else
{
eUARTMode = UARTM_8D_P;
}
break;
default:
xResult = FALSE;
}
if( xResult != FALSE )
{
/* Setup the UART port pins. */
GPIO_Config( MB_UART_TX_PORT, 1 << MB_UART_TX_PIN, GPIO_AF_PP );
GPIO_Config( MB_UART_RX_PORT, 1 << MB_UART_RX_PIN, GPIO_IN_TRI_CMOS );
/* Configure the UART. */
UART_OnOffConfig( MB_UART_DEV, ENABLE );
UART_FifoConfig( MB_UART_DEV, DISABLE );
UART_FifoReset( MB_UART_DEV, UART_RxFIFO );
UART_FifoReset( MB_UART_DEV, UART_TxFIFO );
UART_LoopBackConfig( MB_UART_DEV, DISABLE );
UART_Config( MB_UART_DEV, ulBaudRate, eUARTParity, UART_1_StopBits,
eUARTMode );
UART_RxConfig( UART0, ENABLE );
vMBPortSerialEnable( FALSE, FALSE );
/* Configure the IEC for the UART interrupts. */
EIC_IRQChannelPriorityConfig( MB_UART_IRQ_CH, MB_IRQ_PRIORITY );
EIC_IRQChannelConfig( MB_UART_IRQ_CH, ENABLE );
}
return xResult;
}
void
vMBPortSerialEnable( BOOL xRxEnable, BOOL xTxEnable )
{
if( xRxEnable )
UART_ItConfig( MB_UART_DEV, UART_RxBufFull, ENABLE );
else
UART_ItConfig( MB_UART_DEV, UART_RxBufFull, DISABLE );
if( xTxEnable )
UART_ItConfig( MB_UART_DEV, UART_TxHalfEmpty, ENABLE );
else
UART_ItConfig( MB_UART_DEV, UART_TxHalfEmpty, DISABLE );
}
BOOL
xMBPortSerialPutByte( CHAR ucByte )
{
MB_UART_DEV->TxBUFR = ucByte;
return TRUE;
}
BOOL
xMBPortSerialGetByte( CHAR * pucByte )
{
*pucByte = MB_UART_DEV->RxBUFR;
return TRUE;
}
BOOL
prvMBPortTXIsEnabled( )
{
return ( MB_UART_DEV->IER & UART_TxHalfEmpty ) == UART_TxHalfEmpty;
}
BOOL
prvMBPortRXIsEnabled( )
{
return ( MB_UART_DEV->IER & UART_RxBufFull ) == UART_RxBufFull;
}
void
prvvMBSerialIRQHandler( void )
{
portENTER_SWITCHING_ISR( );
static BOOL xTaskWokenReceive = FALSE;
static BOOL xTaskWokenTransmit = FALSE;
static USHORT usStatus;
usStatus = UART_FlagStatus( MB_UART_DEV );
if( prvMBPortTXIsEnabled( ) && ( usStatus & UART_TxHalfEmpty ) )
{
xTaskWokenReceive = pxMBFrameCBTransmitterEmpty( );
}
if( prvMBPortRXIsEnabled( ) && ( usStatus & UART_RxBufFull ) )
{
xTaskWokenReceive = pxMBFrameCBByteReceived( );
}
/* End the interrupt in the EIC. */
EIC->IPR |= 1 << EIC_CurrentIRQChannelValue( );
portEXIT_SWITCHING_ISR( ( xTaskWokenReceive
|| xTaskWokenTransmit ) ? pdTRUE : pdFALSE );
}
| {
"pile_set_name": "Github"
} |
#
# Hitex LPC1768-Stick
#
# http://www.hitex.com/?id=1602
#
interface ftdi
ftdi_device_desc "LPC1768-Stick"
ftdi_vid_pid 0x0640 0x0026
ftdi_layout_init 0x0388 0x038b
ftdi_layout_signal nTRST -data 0x0100
ftdi_layout_signal nSRST -data 0x0080 -noe 0x200
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<layout-output xmlns="http://reporting.pentaho.org/namespaces/output/layout-output/pageable/1.0">
<physical-page page-x="0" page-y="0" page-width="595" page-height="842" margin-top="72" margin-left="72" margin-bottom="72" margin-right="72">
<page-area name="Logical-Page-Watermark-Area" x="0.0" y="0.0" width="451.0" height="698.0" color="black" font-face="Serif" font-size="10" font-style-bold="false" font-style-italics="false" font-style-underline="false" font-style-strikethrough="false" type="Logical-Page-Watermark-Area">
<block name="Watermark-Section" type="SectionRenderBox" x="0.0" y="0.0" width="451.0" height="698.0" color="black" font-face="Serif" font-size="10" font-style-bold="false" font-style-italics="false" font-style-underline="false" font-style-strikethrough="false">
<canvas type="CanvasRenderBox" x="0.0" y="0.0" width="451.0" height="698.0" color="black" font-face="Serif" font-size="10" font-style-bold="false" font-style-italics="false" font-style-underline="false" font-style-strikethrough="false">
<attribute xmlns:autoGenNs="http://reporting.pentaho.org/namespaces/engine/attributes/core" autoGenNs:element-type="watermark"/>
</canvas>
</block>
</page-area>
<page-area name="Logical-Page-Header-Area" x="0.0" y="0.0" width="451.0" height="0.0" color="black" font-face="Serif" font-size="10" font-style-bold="false" font-style-italics="false" font-style-underline="false" font-style-strikethrough="false" type="Logical-Page-Header-Area">
<auto name="Header-1" type="AutoRenderBox" x="0.0" y="0.0" width="451.0" height="0.0" color="black" font-face="Serif" font-size="10" font-style-bold="false" font-style-italics="false" font-style-underline="false" font-style-strikethrough="false">
<block type="ProgressMarkerRenderBox" x="0.0" y="0.0" width="451.0" height="0.0" color="black" font-face="Serif" font-size="10" font-style-bold="false" font-style-italics="false" font-style-underline="false" font-style-strikethrough="false">
</block>
</auto>
</page-area>
<block name="Logical-Page-Content-Area" type="BlockRenderBox" x="0.0" y="0.0" width="451.0" height="0.0" color="black" font-face="Serif" font-size="10" font-style-bold="false" font-style-italics="false" font-style-underline="false" font-style-strikethrough="false">
<attribute xmlns:autoGenNs="http://reporting.pentaho.org/namespaces/engine/attributes/core" autoGenNs:element-type="master-report"/>
<attribute xmlns:autoGenNs="http://reporting.pentaho.org/namespaces/engine/attributes/core" autoGenNs:name="ReportProperty Demo"/>
<attribute xmlns:autoGenNs="http://reporting.pentaho.org/namespaces/engine/attributes/internal" autoGenNs:query="default"/>
<block name="Section-0" type="AutoRenderBox" x="0.0" y="0.0" width="451.0" height="0.0" color="black" font-face="Serif" font-size="10" font-style-bold="false" font-style-italics="false" font-style-underline="false" font-style-strikethrough="false">
<block type="ProgressMarkerRenderBox" x="0.0" y="0.0" width="451.0" height="0.0" color="black" font-face="Serif" font-size="10" font-style-bold="false" font-style-italics="false" font-style-underline="false" font-style-strikethrough="false">
</block>
</block>
<block name="::group-0" type="AutoRenderBox" x="0.0" y="0.0" width="451.0" height="0.0" color="black" font-face="Serif" font-size="10" font-style-bold="false" font-style-italics="false" font-style-underline="false" font-style-strikethrough="false">
<attribute xmlns:autoGenNs="http://reporting.pentaho.org/namespaces/engine/attributes/core" autoGenNs:element-type="relational-group"/>
<block type="AutoRenderBox" x="0.0" y="0.0" width="451.0" height="0.0" color="black" font-face="Serif" font-size="10" font-style-bold="false" font-style-italics="false" font-style-underline="false" font-style-strikethrough="false">
<attribute xmlns:autoGenNs="http://reporting.pentaho.org/namespaces/engine/attributes/core" autoGenNs:element-type="group-data-body"/>
</block>
</block>
<block name="Section-0" type="AutoRenderBox" x="0.0" y="0.0" width="451.0" height="0.0" color="black" font-face="Serif" font-size="10" font-style-bold="false" font-style-italics="false" font-style-underline="false" font-style-strikethrough="false">
<block type="ProgressMarkerRenderBox" x="0.0" y="0.0" width="451.0" height="0.0" color="black" font-face="Serif" font-size="10" font-style-bold="false" font-style-italics="false" font-style-underline="false" font-style-strikethrough="false">
</block>
</block>
</block>
<page-area name="Logical-Repeat-Footer-Area" x="0.0" y="698.0" width="451.0" height="0.0" color="black" font-face="Serif" font-size="10" font-style-bold="false" font-style-italics="false" font-style-underline="false" font-style-strikethrough="false" type="Logical-Repeat-Footer-Area">
</page-area>
<page-area name="Logical-Page-Footer-Area" x="0.0" y="698.0" width="451.0" height="0.0" color="black" font-face="Serif" font-size="10" font-style-bold="false" font-style-italics="false" font-style-underline="false" font-style-strikethrough="false" type="Logical-Page-Footer-Area">
<auto name="Footer-2" type="AutoRenderBox" x="0.0" y="698.0" width="451.0" height="0.0" color="black" font-face="Serif" font-size="10" font-style-bold="false" font-style-italics="false" font-style-underline="false" font-style-strikethrough="false">
<block type="ProgressMarkerRenderBox" x="0.0" y="698.0" width="451.0" height="0.0" color="black" font-face="Serif" font-size="10" font-style-bold="false" font-style-italics="false" font-style-underline="false" font-style-strikethrough="false">
</block>
</auto>
</page-area>
</physical-page>
</layout-output>
| {
"pile_set_name": "Github"
} |
/*
Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'docprops', 'vi', {
bgColor: 'Màu nền',
bgFixed: 'Không cuộn nền',
bgImage: 'URL của Hình ảnh nền',
charset: 'Bảng mã ký tự',
charsetASCII: 'ASCII',
charsetCE: 'Trung Âu',
charsetCR: 'Tiếng Kirin',
charsetCT: 'Tiếng Trung Quốc (Big5)',
charsetGR: 'Tiếng Hy Lạp',
charsetJP: 'Tiếng Nhật',
charsetKR: 'Tiếng Hàn',
charsetOther: 'Bảng mã ký tự khác',
charsetTR: 'Tiếng Thổ Nhĩ Kỳ',
charsetUN: 'Unicode (UTF-8)',
charsetWE: 'Tây Âu',
chooseColor: 'Chọn màu',
design: 'Thiết kế',
docTitle: 'Tiêu đề Trang',
docType: 'Kiểu Đề mục Tài liệu',
docTypeOther: 'Kiểu Đề mục Tài liệu khác',
label: 'Thuộc tính Tài liệu',
margin: 'Đường biên của Trang',
marginBottom: 'Dưới',
marginLeft: 'Trái',
marginRight: 'Phải',
marginTop: 'Trên',
meta: 'Siêu dữ liệu',
metaAuthor: 'Tác giả',
metaCopyright: 'Bản quyền',
metaDescription: 'Mô tả tài liệu',
metaKeywords: 'Các từ khóa chỉ mục tài liệu (phân cách bởi dấu phẩy)',
other: '<khác>',
previewHtml: '<p>Đây là một số <strong>văn bản mẫu</strong>. Bạn đang sử dụng <a href="javascript:void(0)">CKEditor</a>.</p>',
title: 'Thuộc tính Tài liệu',
txtColor: 'Màu chữ',
xhtmlDec: 'Bao gồm cả định nghĩa XHTML'
} );
| {
"pile_set_name": "Github"
} |
var Lab = require('lab');
var lab = exports.lab = Lab.script();
var describe = lab.describe;
var before = lab.before;
var after = lab.after;
var it = lab.it;
var Code = require('code');
var expect = Code.expect;
var isString = require('../is-string');
var isFunction = require('../is-function');
var passAny = require('../pass-any');
describe('passAny', function () {
var ctx = {};
before(function (done) {
ctx.arr = [true, 'foo', 'bar', 'qux'];
ctx.ctx = { foo: 1 };
done();
});
after(function (done) {
delete ctx.arr;
delete ctx.ctx;
done();
});
it('should work with array functions', function(done) {
expect(ctx.arr.filter(passAny(isString, isFunction)))
.to.deep.equal(ctx.arr.filter(isStringOrFunction));
done();
});
it('should apply its context to the functions', function(done) {
ctx.arr.forEach(passAny(checkContext).bind(ctx.ctx));
done();
function checkContext () {
return expect(this).to.deep.equal(ctx.ctx);
}
});
it('should throw an error if it receives non-function args', function(done) {
try {
ctx.arr.forEach(passAny(true, false));
}
catch (err) {
expect(err.message).to.equal('all funcs should be functions');
}
done();
});
});
function isStringOrFunction (item) {
return isString(item) || isFunction(item);
}
| {
"pile_set_name": "Github"
} |
// (C) Copyright Tobias Schwinger
//
// Use modification and distribution are subject to the lslboost Software License,
// Version 1.0. (See http://www.lslboost.org/LICENSE_1_0.txt).
//------------------------------------------------------------------------------
// no include guards, this file is intended for multiple inclusion
// input: BOOST_FT_syntax type macro to use
// input: BOOST_FT_cc empty or cc specifier
// input: BOOST_FT_ell empty or "..."
// input: BOOST_FT_cv empty or cv qualifiers
// input: BOOST_FT_flags single decimal integer encoding the flags
// output: BOOST_FT_n number of component types (arity+1)
// output: BOOST_FT_arity current arity
// output: BOOST_FT_type macro that expands to the type
// output: BOOST_FT_tplargs(p) template arguments with given prefix
// output: BOOST_FT_params(p) parameters with given prefix
# include <lslboost/function_types/detail/synthesize_impl/arity10_0.hpp>
# define BOOST_FT_make_type(flags,cc,arity) BOOST_FT_make_type_impl(flags,cc,arity)
# define BOOST_FT_make_type_impl(flags,cc,arity) make_type_ ## flags ## _ ## cc ## _ ## arity
template< typename R , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 >
struct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,11)
{
typedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 BOOST_FT_ell) BOOST_FT_cv ;
};
template< >
struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 12 >
{
template<typename S> struct synthesize_impl_i
{
private:
typedef typename mpl::begin<S> ::type iter_0;
typedef typename mpl::next< iter_0 > ::type iter_1;
typedef typename mpl::next< iter_1 > ::type iter_2;
typedef typename mpl::next< iter_2 > ::type iter_3;
typedef typename mpl::next< iter_3 > ::type iter_4;
typedef typename mpl::next< iter_4 > ::type iter_5;
typedef typename mpl::next< iter_5 > ::type iter_6;
typedef typename mpl::next< iter_6 > ::type iter_7;
typedef typename mpl::next< iter_7 > ::type iter_8;
typedef typename mpl::next< iter_8 > ::type iter_9;
typedef typename mpl::next< iter_9 > ::type iter_10;
typedef typename mpl::next< iter_10 > ::type iter_11;
public:
typedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,11)
< typename mpl::deref< iter_0 > ::type
, typename mpl::deref< iter_1 > ::type
, typename mpl::deref< iter_2 > ::type
, typename mpl::deref< iter_3 > ::type
, typename mpl::deref< iter_4 > ::type
, typename mpl::deref< iter_5 > ::type
, typename mpl::deref< iter_6 > ::type
, typename mpl::deref< iter_7 > ::type
, typename mpl::deref< iter_8 > ::type
, typename mpl::deref< iter_9 > ::type
, typename mpl::deref< iter_10 > ::type
, typename mpl::deref< iter_11 > ::type
> ::type type;
};
};
template< typename R , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 >
struct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,12)
{
typedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 BOOST_FT_ell) BOOST_FT_cv ;
};
template< >
struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 13 >
{
template<typename S> struct synthesize_impl_i
{
private:
typedef typename mpl::begin<S> ::type iter_0;
typedef typename mpl::next< iter_0 > ::type iter_1;
typedef typename mpl::next< iter_1 > ::type iter_2;
typedef typename mpl::next< iter_2 > ::type iter_3;
typedef typename mpl::next< iter_3 > ::type iter_4;
typedef typename mpl::next< iter_4 > ::type iter_5;
typedef typename mpl::next< iter_5 > ::type iter_6;
typedef typename mpl::next< iter_6 > ::type iter_7;
typedef typename mpl::next< iter_7 > ::type iter_8;
typedef typename mpl::next< iter_8 > ::type iter_9;
typedef typename mpl::next< iter_9 > ::type iter_10;
typedef typename mpl::next< iter_10 > ::type iter_11;
typedef typename mpl::next< iter_11 > ::type iter_12;
public:
typedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,12)
< typename mpl::deref< iter_0 > ::type
, typename mpl::deref< iter_1 > ::type
, typename mpl::deref< iter_2 > ::type
, typename mpl::deref< iter_3 > ::type
, typename mpl::deref< iter_4 > ::type
, typename mpl::deref< iter_5 > ::type
, typename mpl::deref< iter_6 > ::type
, typename mpl::deref< iter_7 > ::type
, typename mpl::deref< iter_8 > ::type
, typename mpl::deref< iter_9 > ::type
, typename mpl::deref< iter_10 > ::type
, typename mpl::deref< iter_11 > ::type
, typename mpl::deref< iter_12 > ::type
> ::type type;
};
};
template< typename R , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 >
struct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,13)
{
typedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 BOOST_FT_ell) BOOST_FT_cv ;
};
template< >
struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 14 >
{
template<typename S> struct synthesize_impl_i
{
private:
typedef typename mpl::begin<S> ::type iter_0;
typedef typename mpl::next< iter_0 > ::type iter_1;
typedef typename mpl::next< iter_1 > ::type iter_2;
typedef typename mpl::next< iter_2 > ::type iter_3;
typedef typename mpl::next< iter_3 > ::type iter_4;
typedef typename mpl::next< iter_4 > ::type iter_5;
typedef typename mpl::next< iter_5 > ::type iter_6;
typedef typename mpl::next< iter_6 > ::type iter_7;
typedef typename mpl::next< iter_7 > ::type iter_8;
typedef typename mpl::next< iter_8 > ::type iter_9;
typedef typename mpl::next< iter_9 > ::type iter_10;
typedef typename mpl::next< iter_10 > ::type iter_11;
typedef typename mpl::next< iter_11 > ::type iter_12;
typedef typename mpl::next< iter_12 > ::type iter_13;
public:
typedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,13)
< typename mpl::deref< iter_0 > ::type
, typename mpl::deref< iter_1 > ::type
, typename mpl::deref< iter_2 > ::type
, typename mpl::deref< iter_3 > ::type
, typename mpl::deref< iter_4 > ::type
, typename mpl::deref< iter_5 > ::type
, typename mpl::deref< iter_6 > ::type
, typename mpl::deref< iter_7 > ::type
, typename mpl::deref< iter_8 > ::type
, typename mpl::deref< iter_9 > ::type
, typename mpl::deref< iter_10 > ::type
, typename mpl::deref< iter_11 > ::type
, typename mpl::deref< iter_12 > ::type
, typename mpl::deref< iter_13 > ::type
> ::type type;
};
};
template< typename R , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 >
struct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,14)
{
typedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 BOOST_FT_ell) BOOST_FT_cv ;
};
template< >
struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 15 >
{
template<typename S> struct synthesize_impl_i
{
private:
typedef typename mpl::begin<S> ::type iter_0;
typedef typename mpl::next< iter_0 > ::type iter_1;
typedef typename mpl::next< iter_1 > ::type iter_2;
typedef typename mpl::next< iter_2 > ::type iter_3;
typedef typename mpl::next< iter_3 > ::type iter_4;
typedef typename mpl::next< iter_4 > ::type iter_5;
typedef typename mpl::next< iter_5 > ::type iter_6;
typedef typename mpl::next< iter_6 > ::type iter_7;
typedef typename mpl::next< iter_7 > ::type iter_8;
typedef typename mpl::next< iter_8 > ::type iter_9;
typedef typename mpl::next< iter_9 > ::type iter_10;
typedef typename mpl::next< iter_10 > ::type iter_11;
typedef typename mpl::next< iter_11 > ::type iter_12;
typedef typename mpl::next< iter_12 > ::type iter_13;
typedef typename mpl::next< iter_13 > ::type iter_14;
public:
typedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,14)
< typename mpl::deref< iter_0 > ::type
, typename mpl::deref< iter_1 > ::type
, typename mpl::deref< iter_2 > ::type
, typename mpl::deref< iter_3 > ::type
, typename mpl::deref< iter_4 > ::type
, typename mpl::deref< iter_5 > ::type
, typename mpl::deref< iter_6 > ::type
, typename mpl::deref< iter_7 > ::type
, typename mpl::deref< iter_8 > ::type
, typename mpl::deref< iter_9 > ::type
, typename mpl::deref< iter_10 > ::type
, typename mpl::deref< iter_11 > ::type
, typename mpl::deref< iter_12 > ::type
, typename mpl::deref< iter_13 > ::type
, typename mpl::deref< iter_14 > ::type
> ::type type;
};
};
template< typename R , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 >
struct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,15)
{
typedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 BOOST_FT_ell) BOOST_FT_cv ;
};
template< >
struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 16 >
{
template<typename S> struct synthesize_impl_i
{
private:
typedef typename mpl::begin<S> ::type iter_0;
typedef typename mpl::next< iter_0 > ::type iter_1;
typedef typename mpl::next< iter_1 > ::type iter_2;
typedef typename mpl::next< iter_2 > ::type iter_3;
typedef typename mpl::next< iter_3 > ::type iter_4;
typedef typename mpl::next< iter_4 > ::type iter_5;
typedef typename mpl::next< iter_5 > ::type iter_6;
typedef typename mpl::next< iter_6 > ::type iter_7;
typedef typename mpl::next< iter_7 > ::type iter_8;
typedef typename mpl::next< iter_8 > ::type iter_9;
typedef typename mpl::next< iter_9 > ::type iter_10;
typedef typename mpl::next< iter_10 > ::type iter_11;
typedef typename mpl::next< iter_11 > ::type iter_12;
typedef typename mpl::next< iter_12 > ::type iter_13;
typedef typename mpl::next< iter_13 > ::type iter_14;
typedef typename mpl::next< iter_14 > ::type iter_15;
public:
typedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,15)
< typename mpl::deref< iter_0 > ::type
, typename mpl::deref< iter_1 > ::type
, typename mpl::deref< iter_2 > ::type
, typename mpl::deref< iter_3 > ::type
, typename mpl::deref< iter_4 > ::type
, typename mpl::deref< iter_5 > ::type
, typename mpl::deref< iter_6 > ::type
, typename mpl::deref< iter_7 > ::type
, typename mpl::deref< iter_8 > ::type
, typename mpl::deref< iter_9 > ::type
, typename mpl::deref< iter_10 > ::type
, typename mpl::deref< iter_11 > ::type
, typename mpl::deref< iter_12 > ::type
, typename mpl::deref< iter_13 > ::type
, typename mpl::deref< iter_14 > ::type
, typename mpl::deref< iter_15 > ::type
> ::type type;
};
};
template< typename R , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 >
struct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,16)
{
typedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 BOOST_FT_ell) BOOST_FT_cv ;
};
template< >
struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 17 >
{
template<typename S> struct synthesize_impl_i
{
private:
typedef typename mpl::begin<S> ::type iter_0;
typedef typename mpl::next< iter_0 > ::type iter_1;
typedef typename mpl::next< iter_1 > ::type iter_2;
typedef typename mpl::next< iter_2 > ::type iter_3;
typedef typename mpl::next< iter_3 > ::type iter_4;
typedef typename mpl::next< iter_4 > ::type iter_5;
typedef typename mpl::next< iter_5 > ::type iter_6;
typedef typename mpl::next< iter_6 > ::type iter_7;
typedef typename mpl::next< iter_7 > ::type iter_8;
typedef typename mpl::next< iter_8 > ::type iter_9;
typedef typename mpl::next< iter_9 > ::type iter_10;
typedef typename mpl::next< iter_10 > ::type iter_11;
typedef typename mpl::next< iter_11 > ::type iter_12;
typedef typename mpl::next< iter_12 > ::type iter_13;
typedef typename mpl::next< iter_13 > ::type iter_14;
typedef typename mpl::next< iter_14 > ::type iter_15;
typedef typename mpl::next< iter_15 > ::type iter_16;
public:
typedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,16)
< typename mpl::deref< iter_0 > ::type
, typename mpl::deref< iter_1 > ::type
, typename mpl::deref< iter_2 > ::type
, typename mpl::deref< iter_3 > ::type
, typename mpl::deref< iter_4 > ::type
, typename mpl::deref< iter_5 > ::type
, typename mpl::deref< iter_6 > ::type
, typename mpl::deref< iter_7 > ::type
, typename mpl::deref< iter_8 > ::type
, typename mpl::deref< iter_9 > ::type
, typename mpl::deref< iter_10 > ::type
, typename mpl::deref< iter_11 > ::type
, typename mpl::deref< iter_12 > ::type
, typename mpl::deref< iter_13 > ::type
, typename mpl::deref< iter_14 > ::type
, typename mpl::deref< iter_15 > ::type
, typename mpl::deref< iter_16 > ::type
> ::type type;
};
};
template< typename R , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 >
struct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,17)
{
typedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 BOOST_FT_ell) BOOST_FT_cv ;
};
template< >
struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 18 >
{
template<typename S> struct synthesize_impl_i
{
private:
typedef typename mpl::begin<S> ::type iter_0;
typedef typename mpl::next< iter_0 > ::type iter_1;
typedef typename mpl::next< iter_1 > ::type iter_2;
typedef typename mpl::next< iter_2 > ::type iter_3;
typedef typename mpl::next< iter_3 > ::type iter_4;
typedef typename mpl::next< iter_4 > ::type iter_5;
typedef typename mpl::next< iter_5 > ::type iter_6;
typedef typename mpl::next< iter_6 > ::type iter_7;
typedef typename mpl::next< iter_7 > ::type iter_8;
typedef typename mpl::next< iter_8 > ::type iter_9;
typedef typename mpl::next< iter_9 > ::type iter_10;
typedef typename mpl::next< iter_10 > ::type iter_11;
typedef typename mpl::next< iter_11 > ::type iter_12;
typedef typename mpl::next< iter_12 > ::type iter_13;
typedef typename mpl::next< iter_13 > ::type iter_14;
typedef typename mpl::next< iter_14 > ::type iter_15;
typedef typename mpl::next< iter_15 > ::type iter_16;
typedef typename mpl::next< iter_16 > ::type iter_17;
public:
typedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,17)
< typename mpl::deref< iter_0 > ::type
, typename mpl::deref< iter_1 > ::type
, typename mpl::deref< iter_2 > ::type
, typename mpl::deref< iter_3 > ::type
, typename mpl::deref< iter_4 > ::type
, typename mpl::deref< iter_5 > ::type
, typename mpl::deref< iter_6 > ::type
, typename mpl::deref< iter_7 > ::type
, typename mpl::deref< iter_8 > ::type
, typename mpl::deref< iter_9 > ::type
, typename mpl::deref< iter_10 > ::type
, typename mpl::deref< iter_11 > ::type
, typename mpl::deref< iter_12 > ::type
, typename mpl::deref< iter_13 > ::type
, typename mpl::deref< iter_14 > ::type
, typename mpl::deref< iter_15 > ::type
, typename mpl::deref< iter_16 > ::type
, typename mpl::deref< iter_17 > ::type
> ::type type;
};
};
template< typename R , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 >
struct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,18)
{
typedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 BOOST_FT_ell) BOOST_FT_cv ;
};
template< >
struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 19 >
{
template<typename S> struct synthesize_impl_i
{
private:
typedef typename mpl::begin<S> ::type iter_0;
typedef typename mpl::next< iter_0 > ::type iter_1;
typedef typename mpl::next< iter_1 > ::type iter_2;
typedef typename mpl::next< iter_2 > ::type iter_3;
typedef typename mpl::next< iter_3 > ::type iter_4;
typedef typename mpl::next< iter_4 > ::type iter_5;
typedef typename mpl::next< iter_5 > ::type iter_6;
typedef typename mpl::next< iter_6 > ::type iter_7;
typedef typename mpl::next< iter_7 > ::type iter_8;
typedef typename mpl::next< iter_8 > ::type iter_9;
typedef typename mpl::next< iter_9 > ::type iter_10;
typedef typename mpl::next< iter_10 > ::type iter_11;
typedef typename mpl::next< iter_11 > ::type iter_12;
typedef typename mpl::next< iter_12 > ::type iter_13;
typedef typename mpl::next< iter_13 > ::type iter_14;
typedef typename mpl::next< iter_14 > ::type iter_15;
typedef typename mpl::next< iter_15 > ::type iter_16;
typedef typename mpl::next< iter_16 > ::type iter_17;
typedef typename mpl::next< iter_17 > ::type iter_18;
public:
typedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,18)
< typename mpl::deref< iter_0 > ::type
, typename mpl::deref< iter_1 > ::type
, typename mpl::deref< iter_2 > ::type
, typename mpl::deref< iter_3 > ::type
, typename mpl::deref< iter_4 > ::type
, typename mpl::deref< iter_5 > ::type
, typename mpl::deref< iter_6 > ::type
, typename mpl::deref< iter_7 > ::type
, typename mpl::deref< iter_8 > ::type
, typename mpl::deref< iter_9 > ::type
, typename mpl::deref< iter_10 > ::type
, typename mpl::deref< iter_11 > ::type
, typename mpl::deref< iter_12 > ::type
, typename mpl::deref< iter_13 > ::type
, typename mpl::deref< iter_14 > ::type
, typename mpl::deref< iter_15 > ::type
, typename mpl::deref< iter_16 > ::type
, typename mpl::deref< iter_17 > ::type
, typename mpl::deref< iter_18 > ::type
> ::type type;
};
};
template< typename R , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 >
struct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,19)
{
typedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 BOOST_FT_ell) BOOST_FT_cv ;
};
template< >
struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 20 >
{
template<typename S> struct synthesize_impl_i
{
private:
typedef typename mpl::begin<S> ::type iter_0;
typedef typename mpl::next< iter_0 > ::type iter_1;
typedef typename mpl::next< iter_1 > ::type iter_2;
typedef typename mpl::next< iter_2 > ::type iter_3;
typedef typename mpl::next< iter_3 > ::type iter_4;
typedef typename mpl::next< iter_4 > ::type iter_5;
typedef typename mpl::next< iter_5 > ::type iter_6;
typedef typename mpl::next< iter_6 > ::type iter_7;
typedef typename mpl::next< iter_7 > ::type iter_8;
typedef typename mpl::next< iter_8 > ::type iter_9;
typedef typename mpl::next< iter_9 > ::type iter_10;
typedef typename mpl::next< iter_10 > ::type iter_11;
typedef typename mpl::next< iter_11 > ::type iter_12;
typedef typename mpl::next< iter_12 > ::type iter_13;
typedef typename mpl::next< iter_13 > ::type iter_14;
typedef typename mpl::next< iter_14 > ::type iter_15;
typedef typename mpl::next< iter_15 > ::type iter_16;
typedef typename mpl::next< iter_16 > ::type iter_17;
typedef typename mpl::next< iter_17 > ::type iter_18;
typedef typename mpl::next< iter_18 > ::type iter_19;
public:
typedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,19)
< typename mpl::deref< iter_0 > ::type
, typename mpl::deref< iter_1 > ::type
, typename mpl::deref< iter_2 > ::type
, typename mpl::deref< iter_3 > ::type
, typename mpl::deref< iter_4 > ::type
, typename mpl::deref< iter_5 > ::type
, typename mpl::deref< iter_6 > ::type
, typename mpl::deref< iter_7 > ::type
, typename mpl::deref< iter_8 > ::type
, typename mpl::deref< iter_9 > ::type
, typename mpl::deref< iter_10 > ::type
, typename mpl::deref< iter_11 > ::type
, typename mpl::deref< iter_12 > ::type
, typename mpl::deref< iter_13 > ::type
, typename mpl::deref< iter_14 > ::type
, typename mpl::deref< iter_15 > ::type
, typename mpl::deref< iter_16 > ::type
, typename mpl::deref< iter_17 > ::type
, typename mpl::deref< iter_18 > ::type
, typename mpl::deref< iter_19 > ::type
> ::type type;
};
};
template< typename R , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 >
struct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,20)
{
typedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 BOOST_FT_ell) BOOST_FT_cv ;
};
template< >
struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 21 >
{
template<typename S> struct synthesize_impl_i
{
private:
typedef typename mpl::begin<S> ::type iter_0;
typedef typename mpl::next< iter_0 > ::type iter_1;
typedef typename mpl::next< iter_1 > ::type iter_2;
typedef typename mpl::next< iter_2 > ::type iter_3;
typedef typename mpl::next< iter_3 > ::type iter_4;
typedef typename mpl::next< iter_4 > ::type iter_5;
typedef typename mpl::next< iter_5 > ::type iter_6;
typedef typename mpl::next< iter_6 > ::type iter_7;
typedef typename mpl::next< iter_7 > ::type iter_8;
typedef typename mpl::next< iter_8 > ::type iter_9;
typedef typename mpl::next< iter_9 > ::type iter_10;
typedef typename mpl::next< iter_10 > ::type iter_11;
typedef typename mpl::next< iter_11 > ::type iter_12;
typedef typename mpl::next< iter_12 > ::type iter_13;
typedef typename mpl::next< iter_13 > ::type iter_14;
typedef typename mpl::next< iter_14 > ::type iter_15;
typedef typename mpl::next< iter_15 > ::type iter_16;
typedef typename mpl::next< iter_16 > ::type iter_17;
typedef typename mpl::next< iter_17 > ::type iter_18;
typedef typename mpl::next< iter_18 > ::type iter_19;
typedef typename mpl::next< iter_19 > ::type iter_20;
public:
typedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,20)
< typename mpl::deref< iter_0 > ::type
, typename mpl::deref< iter_1 > ::type
, typename mpl::deref< iter_2 > ::type
, typename mpl::deref< iter_3 > ::type
, typename mpl::deref< iter_4 > ::type
, typename mpl::deref< iter_5 > ::type
, typename mpl::deref< iter_6 > ::type
, typename mpl::deref< iter_7 > ::type
, typename mpl::deref< iter_8 > ::type
, typename mpl::deref< iter_9 > ::type
, typename mpl::deref< iter_10 > ::type
, typename mpl::deref< iter_11 > ::type
, typename mpl::deref< iter_12 > ::type
, typename mpl::deref< iter_13 > ::type
, typename mpl::deref< iter_14 > ::type
, typename mpl::deref< iter_15 > ::type
, typename mpl::deref< iter_16 > ::type
, typename mpl::deref< iter_17 > ::type
, typename mpl::deref< iter_18 > ::type
, typename mpl::deref< iter_19 > ::type
, typename mpl::deref< iter_20 > ::type
> ::type type;
};
};
# undef BOOST_FT_make_type
# undef BOOST_FT_make_type_impl
| {
"pile_set_name": "Github"
} |
// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build mips64le,linux
package unix
const (
SYS_READ = 5000
SYS_WRITE = 5001
SYS_OPEN = 5002
SYS_CLOSE = 5003
SYS_STAT = 5004
SYS_FSTAT = 5005
SYS_LSTAT = 5006
SYS_POLL = 5007
SYS_LSEEK = 5008
SYS_MMAP = 5009
SYS_MPROTECT = 5010
SYS_MUNMAP = 5011
SYS_BRK = 5012
SYS_RT_SIGACTION = 5013
SYS_RT_SIGPROCMASK = 5014
SYS_IOCTL = 5015
SYS_PREAD64 = 5016
SYS_PWRITE64 = 5017
SYS_READV = 5018
SYS_WRITEV = 5019
SYS_ACCESS = 5020
SYS_PIPE = 5021
SYS__NEWSELECT = 5022
SYS_SCHED_YIELD = 5023
SYS_MREMAP = 5024
SYS_MSYNC = 5025
SYS_MINCORE = 5026
SYS_MADVISE = 5027
SYS_SHMGET = 5028
SYS_SHMAT = 5029
SYS_SHMCTL = 5030
SYS_DUP = 5031
SYS_DUP2 = 5032
SYS_PAUSE = 5033
SYS_NANOSLEEP = 5034
SYS_GETITIMER = 5035
SYS_SETITIMER = 5036
SYS_ALARM = 5037
SYS_GETPID = 5038
SYS_SENDFILE = 5039
SYS_SOCKET = 5040
SYS_CONNECT = 5041
SYS_ACCEPT = 5042
SYS_SENDTO = 5043
SYS_RECVFROM = 5044
SYS_SENDMSG = 5045
SYS_RECVMSG = 5046
SYS_SHUTDOWN = 5047
SYS_BIND = 5048
SYS_LISTEN = 5049
SYS_GETSOCKNAME = 5050
SYS_GETPEERNAME = 5051
SYS_SOCKETPAIR = 5052
SYS_SETSOCKOPT = 5053
SYS_GETSOCKOPT = 5054
SYS_CLONE = 5055
SYS_FORK = 5056
SYS_EXECVE = 5057
SYS_EXIT = 5058
SYS_WAIT4 = 5059
SYS_KILL = 5060
SYS_UNAME = 5061
SYS_SEMGET = 5062
SYS_SEMOP = 5063
SYS_SEMCTL = 5064
SYS_SHMDT = 5065
SYS_MSGGET = 5066
SYS_MSGSND = 5067
SYS_MSGRCV = 5068
SYS_MSGCTL = 5069
SYS_FCNTL = 5070
SYS_FLOCK = 5071
SYS_FSYNC = 5072
SYS_FDATASYNC = 5073
SYS_TRUNCATE = 5074
SYS_FTRUNCATE = 5075
SYS_GETDENTS = 5076
SYS_GETCWD = 5077
SYS_CHDIR = 5078
SYS_FCHDIR = 5079
SYS_RENAME = 5080
SYS_MKDIR = 5081
SYS_RMDIR = 5082
SYS_CREAT = 5083
SYS_LINK = 5084
SYS_UNLINK = 5085
SYS_SYMLINK = 5086
SYS_READLINK = 5087
SYS_CHMOD = 5088
SYS_FCHMOD = 5089
SYS_CHOWN = 5090
SYS_FCHOWN = 5091
SYS_LCHOWN = 5092
SYS_UMASK = 5093
SYS_GETTIMEOFDAY = 5094
SYS_GETRLIMIT = 5095
SYS_GETRUSAGE = 5096
SYS_SYSINFO = 5097
SYS_TIMES = 5098
SYS_PTRACE = 5099
SYS_GETUID = 5100
SYS_SYSLOG = 5101
SYS_GETGID = 5102
SYS_SETUID = 5103
SYS_SETGID = 5104
SYS_GETEUID = 5105
SYS_GETEGID = 5106
SYS_SETPGID = 5107
SYS_GETPPID = 5108
SYS_GETPGRP = 5109
SYS_SETSID = 5110
SYS_SETREUID = 5111
SYS_SETREGID = 5112
SYS_GETGROUPS = 5113
SYS_SETGROUPS = 5114
SYS_SETRESUID = 5115
SYS_GETRESUID = 5116
SYS_SETRESGID = 5117
SYS_GETRESGID = 5118
SYS_GETPGID = 5119
SYS_SETFSUID = 5120
SYS_SETFSGID = 5121
SYS_GETSID = 5122
SYS_CAPGET = 5123
SYS_CAPSET = 5124
SYS_RT_SIGPENDING = 5125
SYS_RT_SIGTIMEDWAIT = 5126
SYS_RT_SIGQUEUEINFO = 5127
SYS_RT_SIGSUSPEND = 5128
SYS_SIGALTSTACK = 5129
SYS_UTIME = 5130
SYS_MKNOD = 5131
SYS_PERSONALITY = 5132
SYS_USTAT = 5133
SYS_STATFS = 5134
SYS_FSTATFS = 5135
SYS_SYSFS = 5136
SYS_GETPRIORITY = 5137
SYS_SETPRIORITY = 5138
SYS_SCHED_SETPARAM = 5139
SYS_SCHED_GETPARAM = 5140
SYS_SCHED_SETSCHEDULER = 5141
SYS_SCHED_GETSCHEDULER = 5142
SYS_SCHED_GET_PRIORITY_MAX = 5143
SYS_SCHED_GET_PRIORITY_MIN = 5144
SYS_SCHED_RR_GET_INTERVAL = 5145
SYS_MLOCK = 5146
SYS_MUNLOCK = 5147
SYS_MLOCKALL = 5148
SYS_MUNLOCKALL = 5149
SYS_VHANGUP = 5150
SYS_PIVOT_ROOT = 5151
SYS__SYSCTL = 5152
SYS_PRCTL = 5153
SYS_ADJTIMEX = 5154
SYS_SETRLIMIT = 5155
SYS_CHROOT = 5156
SYS_SYNC = 5157
SYS_ACCT = 5158
SYS_SETTIMEOFDAY = 5159
SYS_MOUNT = 5160
SYS_UMOUNT2 = 5161
SYS_SWAPON = 5162
SYS_SWAPOFF = 5163
SYS_REBOOT = 5164
SYS_SETHOSTNAME = 5165
SYS_SETDOMAINNAME = 5166
SYS_CREATE_MODULE = 5167
SYS_INIT_MODULE = 5168
SYS_DELETE_MODULE = 5169
SYS_GET_KERNEL_SYMS = 5170
SYS_QUERY_MODULE = 5171
SYS_QUOTACTL = 5172
SYS_NFSSERVCTL = 5173
SYS_GETPMSG = 5174
SYS_PUTPMSG = 5175
SYS_AFS_SYSCALL = 5176
SYS_RESERVED177 = 5177
SYS_GETTID = 5178
SYS_READAHEAD = 5179
SYS_SETXATTR = 5180
SYS_LSETXATTR = 5181
SYS_FSETXATTR = 5182
SYS_GETXATTR = 5183
SYS_LGETXATTR = 5184
SYS_FGETXATTR = 5185
SYS_LISTXATTR = 5186
SYS_LLISTXATTR = 5187
SYS_FLISTXATTR = 5188
SYS_REMOVEXATTR = 5189
SYS_LREMOVEXATTR = 5190
SYS_FREMOVEXATTR = 5191
SYS_TKILL = 5192
SYS_RESERVED193 = 5193
SYS_FUTEX = 5194
SYS_SCHED_SETAFFINITY = 5195
SYS_SCHED_GETAFFINITY = 5196
SYS_CACHEFLUSH = 5197
SYS_CACHECTL = 5198
SYS_SYSMIPS = 5199
SYS_IO_SETUP = 5200
SYS_IO_DESTROY = 5201
SYS_IO_GETEVENTS = 5202
SYS_IO_SUBMIT = 5203
SYS_IO_CANCEL = 5204
SYS_EXIT_GROUP = 5205
SYS_LOOKUP_DCOOKIE = 5206
SYS_EPOLL_CREATE = 5207
SYS_EPOLL_CTL = 5208
SYS_EPOLL_WAIT = 5209
SYS_REMAP_FILE_PAGES = 5210
SYS_RT_SIGRETURN = 5211
SYS_SET_TID_ADDRESS = 5212
SYS_RESTART_SYSCALL = 5213
SYS_SEMTIMEDOP = 5214
SYS_FADVISE64 = 5215
SYS_TIMER_CREATE = 5216
SYS_TIMER_SETTIME = 5217
SYS_TIMER_GETTIME = 5218
SYS_TIMER_GETOVERRUN = 5219
SYS_TIMER_DELETE = 5220
SYS_CLOCK_SETTIME = 5221
SYS_CLOCK_GETTIME = 5222
SYS_CLOCK_GETRES = 5223
SYS_CLOCK_NANOSLEEP = 5224
SYS_TGKILL = 5225
SYS_UTIMES = 5226
SYS_MBIND = 5227
SYS_GET_MEMPOLICY = 5228
SYS_SET_MEMPOLICY = 5229
SYS_MQ_OPEN = 5230
SYS_MQ_UNLINK = 5231
SYS_MQ_TIMEDSEND = 5232
SYS_MQ_TIMEDRECEIVE = 5233
SYS_MQ_NOTIFY = 5234
SYS_MQ_GETSETATTR = 5235
SYS_VSERVER = 5236
SYS_WAITID = 5237
SYS_ADD_KEY = 5239
SYS_REQUEST_KEY = 5240
SYS_KEYCTL = 5241
SYS_SET_THREAD_AREA = 5242
SYS_INOTIFY_INIT = 5243
SYS_INOTIFY_ADD_WATCH = 5244
SYS_INOTIFY_RM_WATCH = 5245
SYS_MIGRATE_PAGES = 5246
SYS_OPENAT = 5247
SYS_MKDIRAT = 5248
SYS_MKNODAT = 5249
SYS_FCHOWNAT = 5250
SYS_FUTIMESAT = 5251
SYS_NEWFSTATAT = 5252
SYS_UNLINKAT = 5253
SYS_RENAMEAT = 5254
SYS_LINKAT = 5255
SYS_SYMLINKAT = 5256
SYS_READLINKAT = 5257
SYS_FCHMODAT = 5258
SYS_FACCESSAT = 5259
SYS_PSELECT6 = 5260
SYS_PPOLL = 5261
SYS_UNSHARE = 5262
SYS_SPLICE = 5263
SYS_SYNC_FILE_RANGE = 5264
SYS_TEE = 5265
SYS_VMSPLICE = 5266
SYS_MOVE_PAGES = 5267
SYS_SET_ROBUST_LIST = 5268
SYS_GET_ROBUST_LIST = 5269
SYS_KEXEC_LOAD = 5270
SYS_GETCPU = 5271
SYS_EPOLL_PWAIT = 5272
SYS_IOPRIO_SET = 5273
SYS_IOPRIO_GET = 5274
SYS_UTIMENSAT = 5275
SYS_SIGNALFD = 5276
SYS_TIMERFD = 5277
SYS_EVENTFD = 5278
SYS_FALLOCATE = 5279
SYS_TIMERFD_CREATE = 5280
SYS_TIMERFD_GETTIME = 5281
SYS_TIMERFD_SETTIME = 5282
SYS_SIGNALFD4 = 5283
SYS_EVENTFD2 = 5284
SYS_EPOLL_CREATE1 = 5285
SYS_DUP3 = 5286
SYS_PIPE2 = 5287
SYS_INOTIFY_INIT1 = 5288
SYS_PREADV = 5289
SYS_PWRITEV = 5290
SYS_RT_TGSIGQUEUEINFO = 5291
SYS_PERF_EVENT_OPEN = 5292
SYS_ACCEPT4 = 5293
SYS_RECVMMSG = 5294
SYS_FANOTIFY_INIT = 5295
SYS_FANOTIFY_MARK = 5296
SYS_PRLIMIT64 = 5297
SYS_NAME_TO_HANDLE_AT = 5298
SYS_OPEN_BY_HANDLE_AT = 5299
SYS_CLOCK_ADJTIME = 5300
SYS_SYNCFS = 5301
SYS_SENDMMSG = 5302
SYS_SETNS = 5303
SYS_PROCESS_VM_READV = 5304
SYS_PROCESS_VM_WRITEV = 5305
SYS_KCMP = 5306
SYS_FINIT_MODULE = 5307
SYS_GETDENTS64 = 5308
SYS_SCHED_SETATTR = 5309
SYS_SCHED_GETATTR = 5310
SYS_RENAMEAT2 = 5311
SYS_SECCOMP = 5312
SYS_GETRANDOM = 5313
SYS_MEMFD_CREATE = 5314
SYS_BPF = 5315
SYS_EXECVEAT = 5316
SYS_USERFAULTFD = 5317
SYS_MEMBARRIER = 5318
SYS_MLOCK2 = 5319
SYS_COPY_FILE_RANGE = 5320
SYS_PREADV2 = 5321
SYS_PWRITEV2 = 5322
SYS_PKEY_MPROTECT = 5323
SYS_PKEY_ALLOC = 5324
SYS_PKEY_FREE = 5325
SYS_STATX = 5326
SYS_RSEQ = 5327
SYS_IO_PGETEVENTS = 5328
SYS_PIDFD_SEND_SIGNAL = 5424
SYS_IO_URING_SETUP = 5425
SYS_IO_URING_ENTER = 5426
SYS_IO_URING_REGISTER = 5427
SYS_OPEN_TREE = 5428
SYS_MOVE_MOUNT = 5429
SYS_FSOPEN = 5430
SYS_FSCONFIG = 5431
SYS_FSMOUNT = 5432
SYS_FSPICK = 5433
SYS_PIDFD_OPEN = 5434
SYS_CLONE3 = 5435
)
| {
"pile_set_name": "Github"
} |
from rpython.rlib.rarithmetic import intmask
from rpython.rtyper.rrange import ll_rangelen, ll_rangeitem, ll_rangeitem_nonneg, dum_nocheck
from rpython.rtyper.lltypesystem import rrange
from rpython.rtyper.test.tool import BaseRtypingTest
class TestRrange(BaseRtypingTest):
def test_rlist_range(self):
def test1(start, stop, step, varstep):
expected = range(start, stop, step)
length = len(expected)
if varstep:
l = rrange.ll_newrangest(start, stop, step)
step = l.step
else:
RANGE = rrange.RangeRepr(step).RANGE
l = rrange.ll_newrange(RANGE, start, stop)
assert ll_rangelen(l, step) == length
lst = [ll_rangeitem(dum_nocheck, l, i, step) for i in range(length)]
assert lst == expected
lst = [ll_rangeitem_nonneg(dum_nocheck, l, i, step) for i in range(length)]
assert lst == expected
lst = [ll_rangeitem(dum_nocheck, l, i-length, step) for i in range(length)]
assert lst == expected
for start in (-10, 0, 1, 10):
for stop in (-8, 0, 4, 8, 25):
for step in (1, 2, 3, -1, -2):
for varstep in False, True:
test1(start, stop, step, varstep)
def test_range(self):
def dummyfn(N):
total = 0
for i in range(N):
total += i
return total
res = self.interpret(dummyfn, [10])
assert res == 45
def test_range_is_lazy(self):
def dummyfn(N, M):
total = 0
for i in range(M):
if i == N:
break
total += i
return total
res = self.interpret(dummyfn, [10, 2147418112])
assert res == 45
def test_range_item(self):
def dummyfn(start, stop, i):
r = range(start, stop)
return r[i]
res = self.interpret(dummyfn, [10, 17, 4])
assert res == 14
res = self.interpret(dummyfn, [10, 17, -2])
assert res == 15
def test_xrange(self):
def dummyfn(N):
total = 0
for i in xrange(N):
total += i
return total
res = self.interpret(dummyfn, [10])
assert res == 45
def test_range_len_nostep(self):
def dummyfn(start, stop):
r = range(start, stop)
return len(r)
start, stop = 10, 17
res = self.interpret(dummyfn, [start, stop])
assert res == dummyfn(start, stop)
start, stop = 17, 10
res = self.interpret(dummyfn, [start, stop])
assert res == 0
def test_range_len_step_const(self):
def dummyfn(start, stop):
r = range(start, stop, -2)
return len(r)
start, stop = 10, 17
res = self.interpret(dummyfn, [start, stop])
assert res == 0
start, stop = 17, 10
res = self.interpret(dummyfn, [start, stop])
assert res == dummyfn(start, stop)
def test_range_len_step_nonconst(self):
def dummyfn(start, stop, step):
r = range(start, stop, step)
return len(r)
start, stop, step = 10, 17, -3
res = self.interpret(dummyfn, [start, stop, step])
assert res == 0
start, stop, step = 17, 10, -3
res = self.interpret(dummyfn, [start, stop, step])
assert res == dummyfn(start, stop, step)
def test_range2list(self):
def dummyfn(start, stop):
r = range(start, stop)
r.reverse()
return r[0]
start, stop = 10, 17
res = self.interpret(dummyfn, [start, stop])
assert res == dummyfn(start, stop)
def check_failed(self, func, *args):
try:
self.interpret(func, *args, **kwargs)
except:
return True
else:
return False
def test_range_extra(self):
def failingfn_const():
r = range(10, 17, 0)
return r[-1]
assert self.check_failed(failingfn_const, [])
def failingfn_var(step):
r = range(10, 17, step)
return r[-1]
step = 3
res = self.interpret(failingfn_var, [step])
assert res == failingfn_var(step)
step = 0
assert self.check_failed(failingfn_var, [step])
def test_range_iter(self):
def fn(start, stop, step):
res = 0
if step == 0:
if stop >= start:
r = range(start, stop, 1)
else:
r = range(start, stop, -1)
else:
r = range(start, stop, step)
for i in r:
res = res * 51 + i
return res
for args in [2, 7, 0], [7, 2, 0], [10, 50, 7], [50, -10, -3]:
res = self.interpret(fn, args)
assert res == intmask(fn(*args))
def test_empty_range(self):
def g(lst):
total = 0
for i in range(len(lst)):
total += lst[i]
return total
def fn():
return g([])
res = self.interpret(fn, [])
assert res == 0
def test_enumerate(self):
def fn(n):
for i, x in enumerate([123, 456, 789, 654]):
if i == n:
return x
return 5
res = self.interpret(fn, [2])
assert res == 789
def test_enumerate_instances(self):
class A:
pass
def fn(n):
a = A()
b = A()
a.k = 10
b.k = 20
for i, x in enumerate([a, b]):
if i == n:
return x.k
return 5
res = self.interpret(fn, [1])
assert res == 20
def test_extend_range(self):
def fn(n):
lst = [n, n, n]
lst.extend(range(n))
return len(lst)
res = self.interpret(fn, [5])
assert res == 8
| {
"pile_set_name": "Github"
} |
#!/usr/bin/env ruby
lib = File.expand_path('../lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'oxidized'
require 'pry'
Pry.start
| {
"pile_set_name": "Github"
} |
/****************************************************************************/
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others.
// This program and the accompanying materials are made available under the
// terms of the Eclipse Public License 2.0 which is available at
// https://www.eclipse.org/legal/epl-2.0/
// This Source Code may also be made available under the following Secondary
// Licenses when the conditions for such availability set forth in the Eclipse
// Public License 2.0 are satisfied: GNU General Public License, version 2
// or later which is available at
// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
/****************************************************************************/
/// @file NBPTPlatform.cpp
/// @author Gregor Laemmel
/// @date Tue, 24 Aug 2017
///
// The representation of a pt platform
/****************************************************************************/
#include "NBPTPlatform.h"
NBPTPlatform::NBPTPlatform(Position position, double d): myPos(position), myLength(d) {
}
const Position&
NBPTPlatform::getPos() const {
return myPos;
}
void
NBPTPlatform::reshiftPosition(const double offsetX, const double offsetY) {
myPos.add(offsetX, offsetY, 0);
}
double
NBPTPlatform::getLength() const {
return myLength;
}
| {
"pile_set_name": "Github"
} |
# extracts all @references section
require('stringi')
# we are in the root dir of stringi
srcfiles <- dir('R', pattern='\\.R$', recursive=TRUE, ignore.case=TRUE, full.names=TRUE)
# sprintf("%x", unlist(stri_enc_toutf32(c(UTF8chars))))
for (f in srcfiles) {
cf <- stri_flatten(readLines(f), "\n")
whnasc <- stri_extract_all_regex(cf, "#'\\p{Z}*@reference(.|[\n])*?^(?=#'\\p{Z}+@\\p{L}+|[^#])", stri_opts_regex(multiline=TRUE))
# whnasc <- which(stri_detect_regex(cf, "^#'.*\\\\code\\{\\\\link"))
# whnasc <- which(stri_detect_regex(cf, "^#'.*\\\\link\\{\\\\code"))
if (!is.na(whnasc[[1]][1])) {
cat(stri_trim(sprintf('%-30s: %s', f, whnasc[[1]])), sep='\n\n')
cat("\n")
}
}
| {
"pile_set_name": "Github"
} |
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [[ $# -lt 2 ]] ; then
echo -e 'Usage: ./predict [Weight] [Video] <Max String> <Output Size>'
exit 1
fi
WEIGHT_PATH=$1
VIDEO_PATH=$2
if [[ "$WEIGHT_PATH" != /* ]]; then
WEIGHT_PATH="$DIR/$WEIGHT_PATH"
fi
if [[ "$VIDEO_PATH" != /* ]]; then
VIDEO_PATH="$DIR/$VIDEO_PATH"
fi
if [[ $# -eq 2 ]] ; then
python "$DIR/evaluation/predict.py" "$WEIGHT_PATH" "$VIDEO_PATH"
exit 1
fi
if [[ $# -eq 3 ]] ; then
python "$DIR/evaluation/predict.py" "$WEIGHT_PATH" "$VIDEO_PATH" $3
exit 1
fi
if [[ $# -eq 4 ]] ; then
python "$DIR/evaluation/predict.py" "$WEIGHT_PATH" "$VIDEO_PATH" $3 $4
exit 1
fi
echo 'Too much argument(s)' | {
"pile_set_name": "Github"
} |
<?php
class OpenPNE_KtaiEmoji_Docomo extends OpenPNE_KtaiEmoji_Common
{
/**
* constructor
*/
function OpenPNE_KtaiEmoji_Docomo()
{
$this->carrier_id = 'i';
$this->value_list = array(
1 => '',
2 => '',
3 => '',
4 => '',
5 => '',
6 => '',
7 => '',
8 => '',
9 => '',
10 => '',
11 => '',
12 => '',
13 => '',
14 => '',
15 => '',
16 => '',
17 => '',
18 => '',
19 => '',
20 => '',
21 => '',
22 => '',
23 => '',
24 => '',
25 => '',
26 => '',
27 => '',
28 => '',
29 => '',
30 => '',
31 => '',
32 => '',
33 => '',
34 => '',
35 => '',
36 => '',
37 => '',
38 => '',
39 => '',
40 => '',
41 => '',
42 => '',
43 => '',
44 => '',
45 => '',
46 => '',
47 => '',
48 => '',
49 => '',
50 => '',
51 => '',
52 => '',
53 => '',
54 => '',
55 => '',
56 => '',
57 => '',
58 => '',
59 => '',
60 => '',
61 => '',
62 => '',
63 => '',
64 => '',
65 => '',
66 => '',
67 => '',
68 => '',
69 => '',
70 => '',
71 => '',
72 => '',
73 => '',
74 => '',
75 => '',
76 => '',
77 => '',
78 => '',
79 => '',
80 => '',
81 => '',
82 => '',
83 => '',
84 => '',
85 => '',
86 => '',
87 => '',
88 => '',
89 => '',
90 => '',
91 => '',
92 => '',
93 => '',
94 => '',
95 => '',
96 => '',
97 => '',
98 => '',
99 => '',
100 => '',
101 => '',
102 => '',
103 => '',
104 => '',
105 => '',
106 => '',
107 => '',
108 => '',
109 => '',
110 => '',
111 => '',
112 => '',
113 => '',
114 => '',
115 => '',
116 => '',
117 => '',
118 => '',
119 => '',
120 => '',
121 => '',
122 => '',
123 => '',
124 => '',
125 => '',
126 => '',
127 => '',
128 => '',
129 => '',
130 => '',
131 => '',
132 => '',
133 => '',
134 => '',
135 => '',
136 => '',
137 => '',
138 => '',
139 => '',
140 => '',
141 => '',
142 => '',
143 => '',
144 => '',
145 => '',
146 => '',
147 => '',
148 => '',
149 => '',
150 => '',
151 => '',
152 => '',
153 => '',
154 => '',
155 => '',
156 => '',
157 => '',
158 => '',
159 => '',
160 => '',
161 => '',
162 => '',
163 => '',
164 => '',
165 => '',
166 => '',
167 => '',
168 => '',
169 => '',
170 => '',
171 => '',
172 => '',
173 => '',
174 => '',
175 => '',
176 => '',
177 => '',
178 => '',
179 => '',
180 => '',
181 => '',
182 => '',
183 => '',
184 => '',
185 => '',
186 => '',
187 => '',
188 => '',
189 => '',
190 => '',
191 => '',
192 => '',
193 => '',
194 => '',
195 => '',
196 => '',
197 => '',
198 => '',
199 => '',
200 => '',
201 => '',
202 => '',
203 => '',
204 => '',
205 => '',
206 => '',
207 => '',
208 => '',
209 => '',
210 => '',
211 => '',
212 => '',
213 => '',
214 => '',
215 => '',
216 => '',
217 => '',
218 => '',
219 => '',
220 => '',
221 => '',
222 => '',
223 => '',
224 => '',
225 => '',
226 => '',
227 => '',
228 => '',
229 => '',
230 => '',
231 => '',
232 => '',
233 => '',
234 => '',
235 => '',
236 => '',
237 => '',
238 => '',
239 => '',
240 => '',
241 => '',
242 => '',
243 => '',
244 => '',
245 => '',
246 => '',
247 => '',
248 => '',
249 => '',
250 => '',
251 => '',
252 => '',
);
}
function &getInstance()
{
static $singleton;
if (empty($singleton)) {
$singleton = new OpenPNE_KtaiEmoji_Docomo();
}
return $singleton;
}
}
?>
| {
"pile_set_name": "Github"
} |
package com.intellij.lang.javascript.flex.projectStructure;
import com.intellij.flex.FlexCommonUtils;
import com.intellij.flex.model.bc.LinkageType;
import com.intellij.lang.javascript.flex.FlexModuleType;
import com.intellij.lang.javascript.flex.library.FlexLibraryType;
import com.intellij.lang.javascript.flex.projectStructure.model.BuildConfigurationEntry;
import com.intellij.lang.javascript.flex.projectStructure.model.DependencyEntry;
import com.intellij.lang.javascript.flex.projectStructure.model.FlexBuildConfiguration;
import com.intellij.lang.javascript.flex.projectStructure.model.FlexBuildConfigurationManager;
import com.intellij.lang.javascript.flex.projectStructure.options.BCUtils;
import com.intellij.lang.javascript.flex.projectStructure.options.FlexProjectRootsUtil;
import com.intellij.lang.javascript.flex.sdk.FlexSdkType2;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleType;
import com.intellij.openapi.projectRoots.Sdk;
import com.intellij.openapi.roots.*;
import com.intellij.openapi.roots.impl.libraries.LibraryEx;
import com.intellij.openapi.util.Key;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.JarFileSystem;
import com.intellij.openapi.vfs.VirtualFileManager;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.*;
public class FlexOrderEnumerationHandler extends OrderEnumerationHandler {
public static Key<FlexBuildConfiguration> FORCE_BC = Key.create(FlexOrderEnumerationHandler.class.getName() + ".forceBc");
public static class FactoryImpl extends Factory {
@Override
public boolean isApplicable(@NotNull Module module) {
return ModuleType.get(module) == FlexModuleType.getInstance();
}
@NotNull
@Override
public OrderEnumerationHandler createHandler(@NotNull Module module) {
return new FlexOrderEnumerationHandler(module);
}
}
// TODO our special handling for myWithoutJdk, myWithoutLibraries
private static class ModuleData {
private final Set<FlexBuildConfiguration> bcs = new HashSet<>();
private boolean accessibleInProduction = false; // true if this module accessible by non-test dependency types
public void addBc(FlexBuildConfiguration bc, boolean production) {
bcs.add(bc);
accessibleInProduction |= production;
}
}
@Nullable
private final Map<Module, ModuleData> myActiveConfigurations;
private final Module myRootModule;
public FlexOrderEnumerationHandler(@NotNull Module module) {
myRootModule = module;
myActiveConfigurations = new HashMap<>();
// last argument can be whatever
processModuleWithBuildConfiguration(module, null, myActiveConfigurations, new HashSet<>(), true);
}
// configuration is null for root module (one for which scope is being computed)
private static void processModuleWithBuildConfiguration(@NotNull Module module,
@Nullable FlexBuildConfiguration bc,
Map<Module, ModuleData> modules2activeConfigurations,
Set<FlexBuildConfiguration> processedConfigurations,
boolean productionDependency) {
if (ModuleType.get(module) != FlexModuleType.getInstance()) {
return;
}
final boolean isRootModule = bc == null;
if (isRootModule) {
bc = getActiveConfiguration(module);
}
if (bc == null || !processedConfigurations.add(bc)) {
return;
}
ModuleData moduleData = modules2activeConfigurations.get(module);
if (moduleData == null) {
modules2activeConfigurations.put(module, moduleData = new ModuleData());
}
moduleData.addBc(bc, productionDependency);
for (DependencyEntry entry : bc.getDependencies().getEntries()) {
if (!(entry instanceof BuildConfigurationEntry)) {
continue;
}
final LinkageType linkageType = entry.getDependencyType().getLinkageType();
if (linkageType == LinkageType.LoadInRuntime) {
continue;
}
FlexBuildConfiguration dependencyBc = ((BuildConfigurationEntry)entry).findBuildConfiguration();
if (dependencyBc == null || !FlexCommonUtils.checkDependencyType(bc.getOutputType(), dependencyBc.getOutputType(), linkageType)) {
continue;
}
if (!isRootModule && !BCUtils.isTransitiveDependency(linkageType)) {
continue;
}
Module dependencyModule = ((BuildConfigurationEntry)entry).findModule();
if (dependencyModule == null || dependencyModule == module) {
continue;
}
processModuleWithBuildConfiguration(dependencyModule, dependencyBc, modules2activeConfigurations, processedConfigurations,
entry.getDependencyType().getLinkageType() != LinkageType.Test);
}
}
private static FlexBuildConfiguration getActiveConfiguration(final Module module) {
final FlexBuildConfiguration forced = FORCE_BC.get(module);
return forced != null ? forced : FlexBuildConfigurationManager.getInstance(module).getActiveConfiguration();
}
@NotNull
@Override
public AddDependencyType shouldAddDependency(@NotNull OrderEntry orderEntry,
@NotNull OrderEnumeratorSettings settings) {
Module module = orderEntry.getOwnerModule();
if (ModuleType.get(module) != FlexModuleType.getInstance()) {
return super.shouldAddDependency(orderEntry, settings);
}
if (orderEntry instanceof ModuleSourceOrderEntry) {
return AddDependencyType.DEFAULT;
}
if (orderEntry instanceof JdkOrderEntry) {
if (module != myRootModule) {
// never add transitive dependency to Flex SDK
return AddDependencyType.DO_NOT_ADD;
}
if (myActiveConfigurations == null) {
return AddDependencyType.DEFAULT;
}
ModuleData moduleData = myActiveConfigurations.get(module);
for (FlexBuildConfiguration bc : moduleData.bcs) {
if (bc.getSdk() != null) {
return AddDependencyType.DEFAULT;
}
}
return AddDependencyType.DO_NOT_ADD;
}
Collection<FlexBuildConfiguration> accessibleConfigurations;
if (myActiveConfigurations != null) {
ModuleData moduleData = myActiveConfigurations.get(module);
accessibleConfigurations = moduleData != null ? moduleData.bcs : Collections.emptyList();
}
else {
// let all configurations be accessible in ProjectOrderEnumerator
accessibleConfigurations = Arrays.asList(FlexBuildConfigurationManager.getInstance(module).getBuildConfigurations());
}
if (orderEntry instanceof LibraryOrderEntry) {
final LibraryEx library = (LibraryEx)((LibraryOrderEntry)orderEntry).getLibrary();
if (library == null) {
return AddDependencyType.DEFAULT;
}
if (library.getKind() == FlexLibraryType.FLEX_LIBRARY) {
return FlexProjectRootsUtil.dependOnLibrary(accessibleConfigurations, library, module != myRootModule, settings.isProductionOnly())
? AddDependencyType.DEFAULT
: AddDependencyType.DO_NOT_ADD;
}
else {
// foreign library
return AddDependencyType.DO_NOT_ADD;
}
}
else if (orderEntry instanceof ModuleOrderEntry) {
final Module dependencyModule = ((ModuleOrderEntry)orderEntry).getModule();
if (dependencyModule == null) {
return AddDependencyType.DO_NOT_ADD;
}
if (myActiveConfigurations != null) {
ModuleData moduleData = myActiveConfigurations.get(dependencyModule);
return moduleData != null && (moduleData.accessibleInProduction || !settings.isProductionOnly())
? AddDependencyType.DEFAULT
: AddDependencyType.DO_NOT_ADD;
}
else {
// let all modules dependencies be accessible in ProjectOrderEnumerator
return AddDependencyType.DEFAULT;
}
}
else {
return AddDependencyType.DEFAULT;
}
}
@Override
public boolean addCustomRootsForLibrary(@NotNull final OrderEntry forOrderEntry,
@NotNull final OrderRootType type,
@NotNull final Collection<String> urls) {
if (!(forOrderEntry instanceof JdkOrderEntry)) {
return false;
}
if (myActiveConfigurations == null) {
return false;
}
final Module forModule = forOrderEntry.getOwnerModule();
final FlexBuildConfiguration bc = getActiveConfiguration(forModule);
final Sdk sdk = bc.getSdk();
if (sdk == null || sdk.getSdkType() != FlexSdkType2.getInstance()) {
return false;
}
final String[] allUrls = sdk.getRootProvider().getUrls(type);
if (type != OrderRootType.CLASSES) {
urls.addAll(Arrays.asList(allUrls));
return true;
}
final List<String> themePaths = BCUtils.getThemes(forModule, bc);
final List<String> allAccessibleUrls = ContainerUtil.filter(allUrls, s -> {
s = VirtualFileManager.extractPath(StringUtil.trimEnd(s, JarFileSystem.JAR_SEPARATOR));
return BCUtils.getSdkEntryLinkageType(s, bc) != null || themePaths.contains(s);
});
urls.addAll(new HashSet<>(allAccessibleUrls));
return true;
}
}
| {
"pile_set_name": "Github"
} |
=====================
Moderator's Dashboard
=====================
On logging in moderators see the following dashboard.
.. image:: images/moderator_dashboard.jpg
There are two options available:
* **Add Course**
It allows to create a new course.
* **Create Demo Course**
It creates a demo course contaning sample lesson and quiz with questions.
The dashboard contains all the courses. Each course provides two options
* **Manage Course**
Click on this button to manage the course. See the Manage course section
in the :doc:`moderator_docs/creating_course` page for more details.
* **Details**
Clicking on the Details button shows all the quizzes in the course.
Click on the quiz link to monitor the quiz.
The following pages explain the various functions available for moderators
.. toctree::
moderator_docs/creating_course.rst
moderator_docs/creating_quiz.rst
moderator_docs/creating_question.rst
moderator_docs/creating_lessons_modules.rst
moderator_docs/other_features.rst | {
"pile_set_name": "Github"
} |
<!--
- The MIT License
-
- Copyright (c) 2011, Jeff Blaisdell
-
- 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.
-->
<div>
The maximum number of tags to display in the dropdown. Any non-number value
will default to all.
</div>
| {
"pile_set_name": "Github"
} |
{ stdenv, fetchurl, boost, pkgconfig, librevenge, zlib }:
stdenv.mkDerivation rec {
pname = "libwps";
version = "0.4.11";
src = fetchurl {
url = "mirror://sourceforge/libwps/${pname}-${version}.tar.bz2";
sha256 = "11dg7q6mhvppfzsbzdlxldnsgapvgw17jlj1mca5jy4afn0zvqj8";
};
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ boost librevenge zlib ];
NIX_CFLAGS_COMPILE = "-Wno-error=implicit-fallthrough";
meta = with stdenv.lib; {
homepage = "http://libwps.sourceforge.net/";
description = "Microsoft Works document format import filter library";
platforms = platforms.unix;
license = licenses.lgpl21;
};
}
| {
"pile_set_name": "Github"
} |
// +build !ignore_autogenerated
/*
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 deepcopy-gen. DO NOT EDIT.
package v1
import (
runtime "k8s.io/apimachinery/pkg/runtime"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *CertificateSigningRequest) DeepCopyInto(out *CertificateSigningRequest) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateSigningRequest.
func (in *CertificateSigningRequest) DeepCopy() *CertificateSigningRequest {
if in == nil {
return nil
}
out := new(CertificateSigningRequest)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *CertificateSigningRequest) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *CertificateSigningRequestCondition) DeepCopyInto(out *CertificateSigningRequestCondition) {
*out = *in
in.LastUpdateTime.DeepCopyInto(&out.LastUpdateTime)
in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateSigningRequestCondition.
func (in *CertificateSigningRequestCondition) DeepCopy() *CertificateSigningRequestCondition {
if in == nil {
return nil
}
out := new(CertificateSigningRequestCondition)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *CertificateSigningRequestList) DeepCopyInto(out *CertificateSigningRequestList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]CertificateSigningRequest, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateSigningRequestList.
func (in *CertificateSigningRequestList) DeepCopy() *CertificateSigningRequestList {
if in == nil {
return nil
}
out := new(CertificateSigningRequestList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *CertificateSigningRequestList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *CertificateSigningRequestSpec) DeepCopyInto(out *CertificateSigningRequestSpec) {
*out = *in
if in.Request != nil {
in, out := &in.Request, &out.Request
*out = make([]byte, len(*in))
copy(*out, *in)
}
if in.Usages != nil {
in, out := &in.Usages, &out.Usages
*out = make([]KeyUsage, len(*in))
copy(*out, *in)
}
if in.Groups != nil {
in, out := &in.Groups, &out.Groups
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.Extra != nil {
in, out := &in.Extra, &out.Extra
*out = make(map[string]ExtraValue, len(*in))
for key, val := range *in {
var outVal []string
if val == nil {
(*out)[key] = nil
} else {
in, out := &val, &outVal
*out = make(ExtraValue, len(*in))
copy(*out, *in)
}
(*out)[key] = outVal
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateSigningRequestSpec.
func (in *CertificateSigningRequestSpec) DeepCopy() *CertificateSigningRequestSpec {
if in == nil {
return nil
}
out := new(CertificateSigningRequestSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *CertificateSigningRequestStatus) DeepCopyInto(out *CertificateSigningRequestStatus) {
*out = *in
if in.Conditions != nil {
in, out := &in.Conditions, &out.Conditions
*out = make([]CertificateSigningRequestCondition, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.Certificate != nil {
in, out := &in.Certificate, &out.Certificate
*out = make([]byte, len(*in))
copy(*out, *in)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateSigningRequestStatus.
func (in *CertificateSigningRequestStatus) DeepCopy() *CertificateSigningRequestStatus {
if in == nil {
return nil
}
out := new(CertificateSigningRequestStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in ExtraValue) DeepCopyInto(out *ExtraValue) {
{
in := &in
*out = make(ExtraValue, len(*in))
copy(*out, *in)
return
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtraValue.
func (in ExtraValue) DeepCopy() ExtraValue {
if in == nil {
return nil
}
out := new(ExtraValue)
in.DeepCopyInto(out)
return *out
}
| {
"pile_set_name": "Github"
} |
//
// detail/std_fenced_block.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef BOOST_ASIO_DETAIL_STD_FENCED_BLOCK_HPP
#define BOOST_ASIO_DETAIL_STD_FENCED_BLOCK_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include <boost/asio/detail/config.hpp>
#if defined(BOOST_ASIO_HAS_STD_ATOMIC)
#include <atomic>
#include <boost/asio/detail/noncopyable.hpp>
#include <boost/asio/detail/push_options.hpp>
namespace boost {
namespace asio {
namespace detail {
class std_fenced_block
: private noncopyable
{
public:
enum half_t { half };
enum full_t { full };
// Constructor for a half fenced block.
explicit std_fenced_block(half_t)
{
}
// Constructor for a full fenced block.
explicit std_fenced_block(full_t)
{
std::atomic_thread_fence(std::memory_order_acquire);
}
// Destructor.
~std_fenced_block()
{
std::atomic_thread_fence(std::memory_order_release);
}
};
} // namespace detail
} // namespace asio
} // namespace boost
#include <boost/asio/detail/pop_options.hpp>
#endif // defined(BOOST_ASIO_HAS_STD_ATOMIC)
#endif // BOOST_ASIO_DETAIL_STD_FENCED_BLOCK_HPP
| {
"pile_set_name": "Github"
} |
---
sidebar: home_sidebar
title: Info about chagallwifi
folder: info
layout: deviceinfo
permalink: /devices/chagallwifi/
device: chagallwifi
---
{% include templates/device_info.md %}
| {
"pile_set_name": "Github"
} |
# Sign Up User With Email And Password
[AWS Amplify](https://aws.amazon.com/amplify/)
[Auth](https://docs.amplify.aws/lib/auth/getting-started/q/platform/js) offers
both federated and username/password based authentication. Though the docs
aren't clear, the required `username` parameter can be used as the email field
with the [`signUp`
API](https://aws-amplify.github.io/amplify-js/api/classes/authclass.html#signup).
```javascript
import { Auth } from 'aws-amplify';
async function signUp({ email, password }) {
try {
const user = await Auth.signUp({
username: email,
password,
attributes: {},
});
console.log({ user });
} catch (error) {
console.log('error signing up:', error);
}
}
```
Once the user has entered an email and password into the Sign Up form, those
values can be passed to this `signUp` function. The `email` value is passed as
the `username` and the `password` goes in as is.
Amplify Auth will interpret the `username` as an email and register it as the
contact email for this user.
| {
"pile_set_name": "Github"
} |
/*
* Copyright (C) ST-Ericsson SA 2012
*
* Author: Ola Lilja ([email protected])
* for ST-Ericsson.
*
* License terms:
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as published
* by the Free Software Foundation.
*/
#include <asm/mach-types.h>
#include <linux/module.h>
#include <linux/io.h>
#include <linux/spi/spi.h>
#include <linux/of.h>
#include <sound/soc.h>
#include <sound/initval.h>
#include "ux500_pcm.h"
#include "ux500_msp_dai.h"
#include "mop500_ab8500.h"
/* Define the whole MOP500 soundcard, linking platform to the codec-drivers */
static struct snd_soc_dai_link mop500_dai_links[] = {
{
.name = "ab8500_0",
.stream_name = "ab8500_0",
.cpu_dai_name = "ux500-msp-i2s.1",
.codec_dai_name = "ab8500-codec-dai.0",
.platform_name = "ux500-msp-i2s.1",
.codec_name = "ab8500-codec.0",
.init = mop500_ab8500_machine_init,
.ops = mop500_ab8500_ops,
},
{
.name = "ab8500_1",
.stream_name = "ab8500_1",
.cpu_dai_name = "ux500-msp-i2s.3",
.codec_dai_name = "ab8500-codec-dai.1",
.platform_name = "ux500-msp-i2s.3",
.codec_name = "ab8500-codec.0",
.init = NULL,
.ops = mop500_ab8500_ops,
},
};
static struct snd_soc_card mop500_card = {
.name = "MOP500-card",
.owner = THIS_MODULE,
.probe = NULL,
.dai_link = mop500_dai_links,
.num_links = ARRAY_SIZE(mop500_dai_links),
};
static void mop500_of_node_put(void)
{
int i;
for (i = 0; i < 2; i++) {
of_node_put(mop500_dai_links[i].cpu_of_node);
of_node_put(mop500_dai_links[i].codec_of_node);
}
}
static int mop500_of_probe(struct platform_device *pdev,
struct device_node *np)
{
struct device_node *codec_np, *msp_np[2];
int i;
msp_np[0] = of_parse_phandle(np, "stericsson,cpu-dai", 0);
msp_np[1] = of_parse_phandle(np, "stericsson,cpu-dai", 1);
codec_np = of_parse_phandle(np, "stericsson,audio-codec", 0);
if (!(msp_np[0] && msp_np[1] && codec_np)) {
dev_err(&pdev->dev, "Phandle missing or invalid\n");
mop500_of_node_put();
return -EINVAL;
}
for (i = 0; i < 2; i++) {
mop500_dai_links[i].cpu_of_node = msp_np[i];
mop500_dai_links[i].cpu_dai_name = NULL;
mop500_dai_links[i].platform_of_node = msp_np[i];
mop500_dai_links[i].platform_name = NULL;
mop500_dai_links[i].codec_of_node = codec_np;
mop500_dai_links[i].codec_name = NULL;
}
snd_soc_of_parse_card_name(&mop500_card, "stericsson,card-name");
return 0;
}
static int mop500_probe(struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;
int ret;
dev_dbg(&pdev->dev, "%s: Enter.\n", __func__);
mop500_card.dev = &pdev->dev;
if (np) {
ret = mop500_of_probe(pdev, np);
if (ret)
return ret;
}
dev_dbg(&pdev->dev, "%s: Card %s: Set platform drvdata.\n",
__func__, mop500_card.name);
snd_soc_card_set_drvdata(&mop500_card, NULL);
dev_dbg(&pdev->dev, "%s: Card %s: num_links = %d\n",
__func__, mop500_card.name, mop500_card.num_links);
dev_dbg(&pdev->dev, "%s: Card %s: DAI-link 0: name = %s\n",
__func__, mop500_card.name, mop500_card.dai_link[0].name);
dev_dbg(&pdev->dev, "%s: Card %s: DAI-link 0: stream_name = %s\n",
__func__, mop500_card.name,
mop500_card.dai_link[0].stream_name);
ret = snd_soc_register_card(&mop500_card);
if (ret)
dev_err(&pdev->dev,
"Error: snd_soc_register_card failed (%d)!\n", ret);
return ret;
}
static int mop500_remove(struct platform_device *pdev)
{
struct snd_soc_card *mop500_card = platform_get_drvdata(pdev);
pr_debug("%s: Enter.\n", __func__);
snd_soc_unregister_card(mop500_card);
mop500_ab8500_remove(mop500_card);
mop500_of_node_put();
return 0;
}
static const struct of_device_id snd_soc_mop500_match[] = {
{ .compatible = "stericsson,snd-soc-mop500", },
{},
};
MODULE_DEVICE_TABLE(of, snd_soc_mop500_match);
static struct platform_driver snd_soc_mop500_driver = {
.driver = {
.name = "snd-soc-mop500",
.of_match_table = snd_soc_mop500_match,
},
.probe = mop500_probe,
.remove = mop500_remove,
};
module_platform_driver(snd_soc_mop500_driver);
MODULE_LICENSE("GPL v2");
MODULE_DESCRIPTION("ASoC MOP500 board driver");
MODULE_AUTHOR("Ola Lilja");
| {
"pile_set_name": "Github"
} |
#!ascii label, from subject
100
62 -81.842049 27.334024 50.577446 0.000000
183 -85.562592 35.825272 37.395504 0.000000
223 -44.176506 15.642302 88.353012 0.000000
225 -55.498169 23.873514 79.701729 0.000000
370 -33.764969 8.111195 93.793808 0.000000
402 -89.203133 22.013241 39.515816 0.000000
472 -71.710556 35.825272 59.798801 0.000000
855 -28.014122 12.121784 95.244026 0.000000
909 -85.742615 24.733641 45.166649 0.000000
1034 -68.070015 33.064865 65.389633 0.000000
1480 -80.031776 33.914993 49.467281 0.000000
1481 -83.972359 31.684664 44.136497 0.000000
1482 -81.902054 38.175621 42.856308 0.000000
1483 -83.222252 42.246216 35.945290 0.000000
1551 -44.586567 7.851156 89.183136 0.000000
1553 -50.577446 11.981764 85.442581 0.000000
1554 -56.258282 16.102371 81.111938 0.000000
1555 -61.489048 20.122961 76.271233 0.000000
1556 -65.749680 23.253424 71.690552 0.000000
1820 -39.345791 4.070600 91.863518 0.000000
1821 -39.065750 11.911754 91.293434 0.000000
1897 -90.333298 15.152231 40.165913 0.000000
1899 -87.612892 28.994268 38.555679 0.000000
2064 -69.880287 26.163849 66.599800 0.000000
2065 -73.670837 28.994268 61.118996 0.000000
2066 -77.031342 31.684664 55.368153 0.000000
2067 -74.961029 38.175621 54.087959 0.000000
2829 -83.842346 26.053837 47.907055 0.000000
3427 -78.991623 37.155468 48.817184 0.000000
3428 -81.031921 36.075310 46.196800 0.000000
3429 -79.921761 39.285782 45.516697 0.000000
3543 -44.416538 11.751730 88.833076 0.000000
3544 -47.627014 9.921460 87.382866 0.000000
3545 -47.416981 13.822034 86.972801 0.000000
3547 -53.177830 17.982647 82.782188 0.000000
3548 -55.918228 20.002945 80.471848 0.000000
3549 -58.918674 18.122667 78.761597 0.000000
3550 -58.538620 22.013241 78.051491 0.000000
3551 -60.748943 23.613476 75.861168 0.000000
4000 -36.575382 6.090896 92.883667 0.000000
4001 -39.235775 7.991176 91.653488 0.000000
4002 -36.435364 10.021475 92.603630 0.000000
4167 -89.823227 18.592737 39.865868 0.000000
4170 -84.832489 33.784973 40.796005 0.000000
4171 -85.842628 30.354469 41.376095 0.000000
4172 -86.642754 32.434776 38.005596 0.000000
4533 -64.949562 26.703930 71.210487 0.000000
4534 -67.859985 24.723639 69.190186 0.000000
4535 -67.029861 28.164146 68.680107 0.000000
4536 -69.940292 34.465073 62.639217 0.000000
4537 -70.930450 31.054571 63.309322 0.000000
4538 -72.740700 32.434776 60.498909 0.000000
4539 -75.401100 30.354469 58.278580 0.000000
4540 -74.430954 33.784973 57.628487 0.000000
4541 -76.041191 34.955147 54.758060 0.000000
4542 -73.380798 37.025452 56.978390 0.000000
6144 -28.104136 8.101192 95.644081 0.000000
6145 -30.904547 10.121490 94.573921 0.000000
6146 -33.564938 12.051774 93.443756 0.000000
6147 -30.674513 14.052068 94.153862 0.000000
6245 -87.522888 23.393442 42.366238 0.000000
6246 -86.142677 37.815567 33.934994 0.000000
6247 -87.302849 34.465073 34.545086 0.000000
6466 -66.109734 31.614655 68.060013 0.000000
7294 -80.981918 30.644510 50.047367 0.000000
7295 -82.972214 29.534348 47.396976 0.000000
7296 -82.052078 32.824833 46.826893 0.000000
7297 -82.992218 34.955147 43.526409 0.000000
7298 -83.782333 37.025452 40.155910 0.000000
7300 -82.632164 40.245922 39.435806 0.000000
7301 -84.442429 39.055748 36.695400 0.000000
7455 -44.696583 3.930578 89.383163 0.000000
7457 -47.767033 5.990882 87.662903 0.000000
7458 -50.757473 8.061187 85.802628 0.000000
7459 -53.667900 10.111488 83.792336 0.000000
7460 -50.337410 15.912342 84.952499 0.000000
7461 -53.467873 14.052068 83.352272 0.000000
7462 -56.508320 12.181792 81.622017 0.000000
7463 -59.218719 14.202091 79.341675 0.000000
7467 -63.659370 21.703194 74.030891 0.000000
7468 -62.889256 25.173708 73.580833 0.000000
8091 -41.996185 5.960877 90.573334 0.000000
8092 -41.856163 9.881454 90.293289 0.000000
8093 -41.646130 13.782028 89.883232 0.000000
8094 -36.205326 13.942053 92.183571 0.000000
8303 -90.733360 11.701722 40.415951 0.000000
8307 -84.912491 28.224155 44.676579 0.000000
8308 -86.742767 26.883957 41.896168 0.000000
8309 -88.463028 25.523758 39.065750 0.000000
8310 -88.343002 31.054571 35.125172 0.000000
8311 -89.273140 27.594063 35.665249 0.000000
8759 -80.341827 26.053837 53.567886 0.000000
8763 -69.020164 29.634361 66.039719 0.000000
8764 -71.820572 27.594063 63.899406 0.000000
8765 -74.500961 25.523758 61.649075 0.000000
8766 -76.261223 26.883957 58.848663 0.000000
8767 -77.931473 28.224155 55.968239 0.000000
8768 -79.501701 29.534348 53.017803 0.000000
8769 -78.581566 32.824833 52.447720 0.000000
8770 -77.561417 36.075310 51.817631 0.000000
| {
"pile_set_name": "Github"
} |
// --------------------------------------------------------------------------
// OpenMS -- Open-Source Mass Spectrometry
// --------------------------------------------------------------------------
// Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
// ETH Zurich, and Freie Universitaet Berlin 2002-2020.
//
// This software is released under a three-clause BSD license:
// * 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 any author or any participating institution
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
// For a full list of authors, refer to the file AUTHORS.
// --------------------------------------------------------------------------
// 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 ANY OF THE AUTHORS OR THE CONTRIBUTING
// INSTITUTIONS 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.
//
// --------------------------------------------------------------------------
// $Maintainer: Timo Sachsenberg $
// $Authors: Witold Wolski $
// --------------------------------------------------------------------------
#include <OpenMS/CONCEPT/ClassTest.h>
#include <OpenMS/test_config.h>
#include "OpenMS/OPENSWATHALGO/ALGO/StatsHelpers.h"
using namespace std;
using namespace OpenMS;
using namespace OpenSwath;
START_TEST(DiaPrescore2, "$Id$")
/////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////
START_SECTION ( testscorefunction)
{
static const double arr1[] = {
10, 20, 50, 100, 50, 20, 10, // peak at 600
3, 7, 15, 30, 15, 7, 3, // peak at 601
1, 3, 9, 15, 9, 3, 1, // peak at 602
3, 9, 3 // peak at 603
};
std::vector<double> intensity (arr1, arr1 + sizeof(arr1) / sizeof(double) );
static const double arr2[] = {
599.97, 599.98, 599.99, 600.0, 600.01, 600.02, 600.03,
600.97, 600.98, 600.99, 601.0, 601.01, 601.02, 601.03,
601.97, 601.98, 601.99, 602.0, 602.01, 602.02, 602.03,
602.99, 603.0, 603.01
};
std::vector<double> mz (arr2, arr2 + sizeof(arr2) / sizeof(double) );
double norm = OpenSwath::norm(mz.begin(),mz.end());
std::vector<double> normalized;
OpenSwath::normalize(mz,norm,normalized);
TEST_REAL_SIMILAR(OpenSwath::norm(normalized.begin(),normalized.end()), 1.);
double x = dotProd(normalized.begin(),normalized.end(),normalized.begin());
TEST_REAL_SIMILAR(x, 1.);
double man = manhattanDist(normalized.begin(),normalized.end(),normalized.begin());
TEST_REAL_SIMILAR(man, 0.);
}
END_SECTION
/////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////
END_TEST
| {
"pile_set_name": "Github"
} |
create_clock -period "8.000 ns" -name rgmii_rxc_a [get_ports {rgmii_rxc_a}]
create_clock -period "8.000 ns" -name rgmii_rxc_b [get_ports {rgmii_rxc_b}]
| {
"pile_set_name": "Github"
} |
</$objtype/mkfile
LIB=/$objtype/lib/lib387.a
OFILES=\
atan.$O\
tan.$O\
atan2.$O\
exp.$O\
asin.$O\
log.$O\
sin.$O\
</sys/src/cmd/mksyslib
| {
"pile_set_name": "Github"
} |
//
// ServiceDescriptionFormatExtensionCollectionTest.cs
//
// Author:
// Atsushi Enomoto <[email protected]>
//
// (C) 2006 Novell, Inc.
//
using NUnit.Framework;
using System;
using System.Web.Services.Description;
using System.Xml;
namespace MonoTests.System.Web.Services.Description
{
[TestFixture]
public class ServiceDescriptionFormatExtensionCollectionTest
{
[Test]
[ExpectedException (typeof (ArgumentException))]
public void Add ()
{
ServiceDescriptionFormatExtensionCollection c =
new ServiceDescriptionFormatExtensionCollection (new ServiceDescription ());
c.Add (0);
}
[Test]
public void Add2 ()
{
ServiceDescriptionFormatExtensionCollection c =
new ServiceDescriptionFormatExtensionCollection (new ServiceDescription ());
c.Add (new XmlDocument ().CreateElement ("foo"));
}
class MySoapBinding : SoapBinding
{
}
[Test]
public void Find ()
{
ServiceDescriptionFormatExtensionCollection c =
new ServiceDescriptionFormatExtensionCollection (new ServiceDescription ());
c.Add (new MySoapBinding ());
Assert.IsNotNull (c.Find (typeof (SoapBinding)));
}
}
}
| {
"pile_set_name": "Github"
} |
{
"extName": {
"message": "Hover Zoom+",
"description": "Extension name"
},
"extShortName": {
"message": "HoverZoom",
"description": "Short extension name"
},
"extDescription": {
"message": "Zoom images/videos on all your favorite websites (Facebook, Amazon, etc). Simply hover your mouse over the image to enlarge it.",
"description": "Extension description in Chrome webstore (max. 132 characters)"
},
"extUpdated": {
"message": "Hover Zoom+ has been updated",
"description": "Extension update notification"
},
"popDisableForAllSites": {
"message": "Disable for all sites",
"description": "[popup] Disable the extension"
},
"popAllowPerSiteToggle": {
"message": "Allow per-site extension configuration",
"description": "[popup] Allow per-site extension configuration"
},
"popDisableForSite": {
"message": "Disable for $1",
"description": "[popup] Disables the extension for a specific site"
},
"popEnableForSite": {
"message": "Enable for $1",
"description": "[popup] Enables the extension for a specific site"
},
"popPreloadImages": {
"message": "Preload zoomed images",
"description": "[popup] Preload zoomed images"
},
"popPreloadingImages": {
"message": "Preloading...",
"description": "[popup] Preloading zoomed images"
},
"popMoreOptions": {
"message": "More options",
"description": "[popup] More options"
},
"optTitle": {
"message": "Hover Zoom+ Options",
"description": "[options] Page title"
},
"optButtonSave": {
"message": "Save",
"description": "[options] Save button label"
},
"optButtonReset": {
"message": "Reset",
"description": "[options] Reset button label"
},
"optSaved": {
"message": "Options saved. Some settings might need a page refresh.",
"description": "[options] Notification after saving options"
},
"optPageGeneral": {
"message": "General",
"description": "[options] Page title for general options"
},
"optExtensionEnabled": {
"message": "Enable Hover Zoom",
"description": "[options] Enable Hover Zoom+ option"
},
"optSectionView": {
"message": "View",
"description": "[options] Page section for view options"
},
"optSectionVideo": {
"message": "Video",
"description": "[options] Page section for video options"
},
"optZoomFactor": {
"message": "Enlarge zoomed images by this factor:",
"description": "[options] Adjust the size of zoomed images option"
},
"optZoomFactorUnitName": {
"message": "times",
"description": "[options] Unit name (percentage) for zoomed images size option"
},
"optZoomFactorTooltip": {
"message": "Multiply the size of zoomed images by this amount",
"description": "[options] Tooltip for adjust the size of zoomed images option"
},
"optCaptionLocation": {
"message": "Caption position:",
"description": "[options] Adjust the position of the caption"
},
"optCaptionLocationTooltip": {
"message": "View the caption above/below the image, or not at all",
"description": "[options] Tooltip for adjusting the position of the caption"
},
"optCaptionLocationAbove": {
"message": "Above",
"description": "[options] Caption location option to put captions above the image"
},
"optCaptionLocationBelow": {
"message": "Below",
"description": "[options] Caption location option to put captions below the image"
},
"optCaptionLocationNone": {
"message": "None",
"description": "[options] Caption location option to disable captions"
},
"optMouseUnderlap": {
"message": "Extend zoomed images below the mouse cursor",
"description": "[options] Extend zoomed images below the mouse cursor option"
},
"optMouseUnderlapTooltip": {
"message": "If unchecked, zoomed images will be resized dynamically",
"description": "[options] Tooltip for extend zoomed images below the mouse cursor option"
},
"optPageActionEnabled": {
"message": "Show icon in address bar",
"description": "[options] Show icon in address bar option"
},
"optPageActionEnabledTooltip": {
"message": "Only when images can be zoomed",
"description": "[options] Tooltip for show icon in address bar option"
},
"optShowWhileLoading": {
"message": "Show zoomed pictures while loading",
"description": "[options] Show zoomed pictures while loading option"
},
"optShowWhileLoadingTooltip": {
"message": "Zoomed image will be displayed before it is fully loaded",
"description": "[options] Tooltip for show zoomed pictures while loading option"
},
"optShowHighRes": {
"message": "Show high resolution pictures when available",
"description": "[options] Show high resolution pictures when available option"
},
"optShowHighResTooltip": {
"message": "Pictures may take more time to load",
"description": "[options] Tooltip for show high resolution pictures when available option"
},
"optGalleriesMouseWheel": {
"message": "Use mousewheel to navigate albums",
"description": "[options] Use mousewheel to navigate albums option"
},
"optGalleriesMouseWheelTooltip": {
"message": "Navigate album with the mouse wheel",
"description": "[options] Tooltip for use mousewheel to navigate albums option"
},
"optDisableMouseWheelForVideo": {
"message": "Don't use mousewheel to navigate within video (action keys will still work)",
"description": "[options] Allows you to scroll through albums with the mousewheel but does not change behavior of GFY/Videos"
},
"optDisableMouseWheelForVideoTooltip": {
"message": "Scroll through albums but don't jump forward/backward in videos",
"description": "[options] Allows you to scroll through albums with the mousewheel but does not change behavior of GFY/Videos"
},
"optZoomVideos": {
"message": "Zoom videos (WebM, MP4)",
"description": "[options] Zoom videos (WebM, MP4) option"
},
"optZoomVideosTooltip": {
"message": "Zoom videos (WebM, MP4)",
"description": "[options] Tooltip for zoom videos (WebM, MP4) option"
},
"optVideoPositionStep": {
"message": "Use prev/next action keys (or mousewheel) to change video position by",
"description": "[options] Changing video position amount option"
},
"optVideoPositionStepUnitName": {
"message": "sec",
"description": "[options] Unit name (seconds) for changing video position option"
},
"optVideoPositionStepTooltip": {
"message": "Skip video back or forth for this amount of seconds",
"description": "[options] Tooltip for changing video position option"
},
"optMuteVideos": {
"message": "Mute zoomed videos",
"description": "[options] Mute zoomed videos option"
},
"optMuteVideosTooltip": {
"message": "Disable sound in zoomed videos",
"description": "[options] Tooltip for mute zoomed videos option"
},
"optVideoTimestamp": {
"message": "Show timestamp on videos",
"description": "[options] Enable timestamp / video length on videos"
},
"optVideoTimestampTooltip": {
"message": "Enable timestamp / video length on videos",
"description": "[options] Tooltip for video length countdown on videos"
},
"optVideoVolume": {
"message": "Audio volume for unmuted videos:",
"description": "[options] Audio volume for unmuted videos option"
},
"optVideoVolumeUnitName": {
"message": "%",
"description": "[options] Unit name (percentage) for video volume option"
},
"optVideoVolumeTooltip": {
"message": "If the video is not completely muted, set the volume to this percentage (0-100)",
"description": "[options] Tooltip for audio volume for unmuted videos option"
},
"optEnableAmbilight": {
"message": "Enable ambient light behind images",
"description": "[options] Enable ambient light behind images option"
},
"optEnableAmbilightTooltip": {
"message": "Create a subtle glow effect similar to Philips Ambilight technology",
"description": "[options] Tooltip for enable ambient light behind images option"
},
"optAmbilightHaloSize": {
"message": "Size of halo :",
"description": "[options] Size of halo option"
},
"optAmbilightHaloSizeUnitName": {
"message": "%",
"description": "[options] Unit name (percentage) for halo size"
},
"optAmbilightHaloSizeTooltip": {
"message": "Size of halo around zoomed image (0% : no halo)",
"description": "[options] Tooltip for size of halo"
},
"optAmbilightBackgroundOpacity": {
"message": "Background opacity :",
"description": "[options] Background opacity option"
},
"optAmbilightBackgroundOpacityUnitName": {
"message": "%",
"description": "[options] Unit name (percentage) for background opacity"
},
"optAmbilightBackgroundOpacityTooltip": {
"message": "0% : transparent, 100% : black",
"description": "[options] Tooltip for background opacity"
},
"optCenterImages": {
"message": "Center images",
"description": "[options] Center images in the middle of the page option"
},
"optCenterImagesTooltip": {
"message": "Center images as opposed to having them follow the cursor",
"description": "[options] Tooltip for center images in the middle of the page option"
},
"optFrameBackgroundColor": {
"message": "Frame background color:",
"description": "[options] Frame background color option"
},
"optFrameBackgroundColorTooltip": {
"message": "Background color for the frame the image appears in",
"description": "[options] Tooltip for frame background color option"
},
"optFrameBackgroundColorChooseText": {
"message": "Select",
"description": "[options] Frame background color button - Select"
},
"optFrameBackgroundColorCancelText": {
"message": "Cancel",
"description": "[options] Frame background color button - Cancel"
},
"optSectionDelays": {
"message": "Delays",
"description": "[options] Page section for delay options"
},
"optDisplayDelay": {
"message": "Delay before displaying a picture:",
"description": "[options] Delay before displaying a picture option"
},
"optDisplayDelayVideo": {
"message": "Delay before displaying a video:",
"description": "[options] Delay before displaying a video option"
},
"optFadeDuration": {
"message": "Fading animation duration:",
"description": "[options] Fading animation duration option"
},
"optDurationUnitName": {
"message": "sec",
"description": "[options] Short form of \"second\" for delay duration"
},
"optPagePlugins": {
"message": "Plugins",
"description": "[options] Page title for plugin options"
},
"optPlugins": {
"message": "Enable/disable specific plugins",
"description": "[options] Section which contains checkboxes for disabling plugins"
},
"optPageSites": {
"message": "Sites",
"description": "[options] Page title for site options"
},
"optSectionSitesEnabled": {
"message": "URLs for which Hover Zoom+ must be enabled",
"description": "[options] Page section for enabling extension for specific sites"
},
"optSectionSitesDisabled": {
"message": "URLs for which Hover Zoom+ must be disabled",
"description": "[options] Page section for enabling extension for specific sites"
},
"optWhitelistMode": {
"message": "Whitelist mode",
"description": "[options] Whitelist mode checkbox"
},
"optWhitelistModeTooltip": {
"message": "Only enable Hover Zoom+ for the sites listed below",
"description": "[options] Tooltip for whitelist mode checkbox"
},
"optSitePlaceholder": {
"message": "Examples: facebook.com, google.com/reader",
"description": "[options] Placeholder for a site url input box"
},
"optSiteDisclaimer": {
"message": "Be aware that domain filters can overlap. Example: if you have filtered \"picasaweb.google.com\" and \"google.com\", removing \"picasaweb.google.com\" will not reactivate Picasa Web Albums, as it will still be excluded by the \"google.com\" filter.",
"description": "[options] Disclaimer on the sites option page"
},
"optButtonAddSite": {
"message": "Add",
"description": "[options] Button for adding a site on sites option page"
},
"optPageActionKeys": {
"message": "Action keys",
"description": "[options] Page title for action key options"
},
"optPageAdvanced": {
"message": "Advanced",
"description": "[options] Page title for advanced options"
},
"optSectionAdvanced": {
"message": "Advanced options",
"description": "[options] Page section for advanced options"
},
"optUpdateNotifications": {
"message": "Show update notifications",
"description": "[options] Show update notifications option"
},
"optShowLastUpdateNotification": {
"message": "(show last notification)",
"description": "[options] Show last update notification"
},
"optAddToHistory": {
"message": "Add viewed pictures to the browser's history",
"description": "[options] Add viewed pictures to the browser's history option"
},
"optFilterNSFW": {
"message": "Exclude NSFW images (Reddit only)",
"description": "[options] Exclude NSFW images (Reddit only) option"
},
"optAlwaysPreload": {
"message": "Automatically preload zoomed images",
"description": "[options] Automatically preload zoomed images option"
},
"optEnableGalleries": {
"message": "Enable albums support",
"description": "[options] Enable albums support option"
},
"optPicturesOpacity": {
"message": "Zoomed pictures opacity:",
"description": "[options] Zoomed pictures opacity option"
},
"optOpacityUnitName": {
"message": "%",
"description": "[options] Unit name (percentage) for opacity option"
},
"optActionKeyTitle": {
"message": "Activate Hover Zoom+",
"description": "[options] Action key title"
},
"optActionKeyDescription": {
"message": "If a key is set, Hover Zoom+ will be active only when this key is held down.",
"description": "[options] Action key description"
},
"optHideKeyTitle": {
"message": "Disable Hover Zoom+",
"description": "[options] Action key title"
},
"optHideKeyDescription": {
"message": "Holding this key down hides the zoomed picture. Use it when the picture hides elements that are also displayed on mouseover.",
"description": "[options] Action key description"
},
"optOpenImageInWindowKeyTitle": {
"message": "Open image in a new window",
"description": "[options] Action key title"
},
"optOpenImageInWindowKeyDescription": {
"message": "Press this key to open the image you are currently viewing in a new window. Press this key again to close the window.",
"description": "[options] Action key description"
},
"optOpenImageInTabKeyTitle": {
"message": "Open image in a new tab",
"description": "[options] Action key title"
},
"optOpenImageInTabKeyDescription": {
"message": "Press this key to open the image you are currently viewing in a new tab. Press this key again to close the tab. Shift+key opens the image in a background tab.",
"description": "[options] Action key description"
},
"optSaveImageKeyTitle": {
"message": "Save image",
"description": "[options] Action key title"
},
"optSaveImageKeyDescription": {
"message": "Press this key to save the image you are currently viewing.",
"description": "[options] Action key description"
},
"optFullZoomKeyTitle": {
"message": "Activate full zoom",
"description": "[options] Action key title"
},
"optFullZoomKeyDescription": {
"message": "When this key is held down, the picture is displayed using all available space. Useful for high resolution pictures only.",
"description": "[options] Action key description"
},
"optPrevImgKeyTitle": {
"message": "View previous image in a gallery",
"description": "[options] Action key title"
},
"optPrevImgKeyDescription": {
"message": "Press this key to view the previous image in a gallery.",
"description": "[options] Action key description"
},
"optNextImgKeyTitle": {
"message": "View next image in a gallery",
"description": "[options] Action key title"
},
"optNextImgKeyDescription": {
"message": "Press this key to view the next image in a gallery.",
"description": "[options] Action key description"
},
"optFooterSourceCode": {
"message": "Source code",
"description": "[options] Source code link in page footer"
},
"optFooterReportIssue": {
"message": "Report a bug",
"description": "[options] Report a bug link in page footer"
},
"optFooterVersionCopyright": {
"message": "Version $1 - © 2014-2020 Oleg Anashkin",
"description": "[options] Copyright and version number in page footer"
}
}
| {
"pile_set_name": "Github"
} |
Version:1.0
Morpheus
MRP-3W
Config:Biped
TechBase:Inner Sphere
Era:3066
Source:TRO 3055 - Civil War
Rules Level:4
Mass:65
Engine:390 XL Engine
Structure:Standard
Myomer:Standard
Heat Sinks:10 Double
Walk MP:6
Jump MP:0
Armor:Heavy Ferro-Fibrous(Inner Sphere)
LA Armor:18
RA Armor:18
LT Armor:23
RT Armor:23
CT Armor:34
HD Armor:9
LL Armor:28
RL Armor:28
RTL Armor:5
RTR Armor:5
RTC Armor:7
Weapons:3
ER Medium Laser, Left Arm
ER Medium Laser, Right Arm
Magshot, Center Torso
Left Arm:
Shoulder
Upper Arm Actuator
Lower Arm Actuator
Hand Actuator
ISERMediumLaser
Spikes
Heavy Ferro-Fibrous
Heavy Ferro-Fibrous
Heavy Ferro-Fibrous
Heavy Ferro-Fibrous
Heavy Ferro-Fibrous
Heavy Ferro-Fibrous
Right Arm:
Shoulder
Upper Arm Actuator
Lower Arm Actuator
ISERMediumLaser
ISClaw
ISClaw
ISClaw
ISClaw
ISClaw
Spikes
Heavy Ferro-Fibrous
Heavy Ferro-Fibrous
Left Torso:
Fusion Engine
Fusion Engine
Fusion Engine
ISUMU
ISMagshotGR Ammo
ISGuardianECMSuite
ISGuardianECMSuite
Heavy Ferro-Fibrous
Heavy Ferro-Fibrous
Heavy Ferro-Fibrous
Heavy Ferro-Fibrous
Heavy Ferro-Fibrous
Right Torso:
Fusion Engine
Fusion Engine
Fusion Engine
ISUMU
Heavy Ferro-Fibrous
Heavy Ferro-Fibrous
Heavy Ferro-Fibrous
Heavy Ferro-Fibrous
Heavy Ferro-Fibrous
Heavy Ferro-Fibrous
Heavy Ferro-Fibrous
Heavy Ferro-Fibrous
Center Torso:
Fusion Engine
Fusion Engine
Fusion Engine
Gyro
Gyro
Gyro
Gyro
Fusion Engine
Fusion Engine
Fusion Engine
ISMagshotGR
ISMagshotGR
Head:
Life Support
Sensors
Cockpit
ISMASS
Sensors
Life Support
-Empty-
-Empty-
-Empty-
-Empty-
-Empty-
-Empty-
Left Leg:
Hip
Upper Leg Actuator
Lower Leg Actuator
Foot Actuator
ISUMU
ISUMU
-Empty-
-Empty-
-Empty-
-Empty-
-Empty-
-Empty-
Right Leg:
Hip
Upper Leg Actuator
Lower Leg Actuator
Foot Actuator
ISUMU
ISUMU
-Empty-
-Empty-
-Empty-
-Empty-
-Empty-
-Empty-
| {
"pile_set_name": "Github"
} |
# ansi-regex [](https://travis-ci.org/chalk/ansi-regex)
> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code)
## Install
```
$ npm install ansi-regex
```
## Usage
```js
const ansiRegex = require('ansi-regex');
ansiRegex().test('\u001B[4mcake\u001B[0m');
//=> true
ansiRegex().test('cake');
//=> false
'\u001B[4mcake\u001B[0m'.match(ansiRegex());
//=> ['\u001B[4m', '\u001B[0m']
```
## FAQ
### Why do you test for codes not in the ECMA 48 standard?
Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them.
On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out.
## Maintainers
- [Sindre Sorhus](https://github.com/sindresorhus)
- [Josh Junon](https://github.com/qix-)
## License
MIT
| {
"pile_set_name": "Github"
} |
<%= render 'organizations/organization_banner' %>
<div class="site-content">
<div class="site-content-cap">
<h2 class="site-content-heading">
<span class="assignment-icon assignment-icon-group">
<%= octicon 'organization', height: 22 %>
</span>
Group assignment settings
</h2>
</div>
</div>
<div class="site-content-body">
<%= form_for [@organization, @group_assignment] do |f| %>
<div class="columns">
<div class="two-thirds column">
<%= render partial: 'group_assignments/group_assignment_form_options', locals: { f: f, organization: @organization } %>
</div>
<div class="one-third column dangerzone-container pt-3">
<p class="text-emphasized">Delete this group assignment</p>
<p class="text-gray">Once you delete this group assignment, there is no going back. Please be certain.</p>
<a data-remodal-target="delete-group-assignment" class="btn btn-danger btn-block">Delete this group assignment</a>
</div>
</div>
<div class="form-actions">
<%= f.submit 'Save changes', class: 'btn btn-primary' %>
<%= link_to 'Cancel', [@organization, @group_assignment], class: 'btn', role: 'button' %>
</div>
<% end %>
</div>
<%= render partial: 'group_assignments/delete_group_assignment_modal' %>
| {
"pile_set_name": "Github"
} |
Processors
==========
IEncoder
--------
* **live_encoder** : Gstreamer-based Audio Sink
* **flac_encoder** : FLAC encoder based on Gstreamer
* **aac_encoder** : AAC encoder based on Gstreamer
* **mp3_encoder** : MP3 encoder based on Gstreamer
* **vorbis_encoder** : OGG Vorbis encoder based on Gstreamer
* **opus_encoder** : Opus encoder based on Gstreamer
* **wav_encoder** : WAV encoder based on Gstreamer
* **webm_encoder** : WebM encoder based on Gstreamer
IDecoder
--------
* **array_decoder** : Decoder taking Numpy array as input
* **file_decoder** : File Decoder based on Gstreamer
* **live_decoder** : Live source Decoder based on Gstreamer
IGrapher
--------
* **grapher_aubio_pitch** : Image representing Aubio Pitch
* **grapher_onset_detection_function** : Image representing Onset detection function
* **grapher_waveform** : Image representing Waveform from Analyzer
* **spectrogram_log** : Logarithmic scaled spectrogram (level vs. frequency vs. time).
* **spectrogram_lin** : Linear scaled spectrogram (level vs. frequency vs. time).
* **waveform_simple** : Simple monochrome waveform image.
* **waveform_centroid** : Waveform where peaks are colored relatively to the spectral centroids of each frame buffer.
* **waveform_contour_black** : Black amplitude contour waveform.
* **waveform_contour_white** : an white amplitude contour wavform.
* **waveform_transparent** : Transparent waveform.
IAnalyzer
---------
* **mean_dc_shift** : Mean DC shift analyzer
* **level** : Audio level analyzer
* **aubio_melenergy** : Aubio Mel Energy analyzer
* **aubio_mfcc** : Aubio MFCC analyzer
* **aubio_pitch** : Aubio Pitch estimation analyzer
* **aubio_specdesc** : Aubio Spectral Descriptors collection analyzer
* **aubio_temporal** : Aubio Temporal analyzer
* **yaafe** : Yaafe feature extraction library interface analyzer
* **spectrogram_analyzer** : Spectrogram image builder with an extensible buffer based on tables
* **onset_detection_function** : Onset Detection Function analyzer
* **spectrogram_analyzer_buffer** : Spectrogram image builder with an extensible buffer based on tables
* **waveform_analyzer** : Waveform analyzer
IEffect
-------
* **fx_gain** : Gain effect processor
| {
"pile_set_name": "Github"
} |
/*
* Copyright (C) 2018 Apple Inc. All rights reserved.
*
* 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 above 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.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
*/
#pragma once
#include "Document.h"
namespace WebCore {
class ThrowOnDynamicMarkupInsertionCountIncrementer {
WTF_MAKE_NONCOPYABLE(ThrowOnDynamicMarkupInsertionCountIncrementer);
public:
explicit ThrowOnDynamicMarkupInsertionCountIncrementer(Document& document)
: m_document(document)
{
++document.m_throwOnDynamicMarkupInsertionCount;
}
~ThrowOnDynamicMarkupInsertionCountIncrementer()
{
ASSERT(m_document->m_throwOnDynamicMarkupInsertionCount);
--m_document->m_throwOnDynamicMarkupInsertionCount;
}
private:
Ref<Document> m_document;
};
} // namespace WebCore
| {
"pile_set_name": "Github"
} |
//===- llvm/unittest/Support/ThreadLocalTest.cpp - ThreadLocal tests ------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "llvm/Support/ThreadLocal.h"
#include "gtest/gtest.h"
#include <type_traits>
using namespace llvm;
using namespace sys;
namespace {
class ThreadLocalTest : public ::testing::Test {
};
struct S {
int i;
};
TEST_F(ThreadLocalTest, Basics) {
ThreadLocal<const S> x;
static_assert(
std::is_const<std::remove_pointer<decltype(x.get())>::type>::value,
"ThreadLocal::get didn't return a pointer to const object");
EXPECT_EQ(nullptr, x.get());
S s;
x.set(&s);
EXPECT_EQ(&s, x.get());
x.erase();
EXPECT_EQ(nullptr, x.get());
ThreadLocal<S> y;
static_assert(
!std::is_const<std::remove_pointer<decltype(y.get())>::type>::value,
"ThreadLocal::get returned a pointer to const object");
EXPECT_EQ(nullptr, y.get());
y.set(&s);
EXPECT_EQ(&s, y.get());
y.erase();
EXPECT_EQ(nullptr, y.get());
}
}
| {
"pile_set_name": "Github"
} |
<component name="libraryTable">
<library name="stringtemplate">
<CLASSES>
<root url="file://$PROJECT_DIR$/third-party/java/stringtemplate" />
</CLASSES>
<JAVADOC />
<SOURCES />
<jarDirectory url="file://$PROJECT_DIR$/third-party/java/stringtemplate" recursive="false" />
</library>
</component> | {
"pile_set_name": "Github"
} |
/* Generated by RuntimeBrowser.
*/
@protocol SFXPCInterface
@optional
- (void)deviceDiscoveryDeviceChanged:(SFDevice *)arg1 changes:(unsigned int)arg2;
- (void)deviceDiscoveryFoundDevice:(SFDevice *)arg1;
- (void)deviceDiscoveryLostDevice:(SFDevice *)arg1;
- (void)remoteInteractionSessionTextSessionDidBegin:(SFRemoteTextSessionInfo *)arg1;
- (void)remoteInteractionSessionTextSessionDidChange:(SFRemoteTextSessionInfo *)arg1;
- (void)remoteInteractionSessionTextSessionDidEnd:(SFRemoteTextSessionInfo *)arg1;
- (void)serviceError:(NSError *)arg1;
- (void)serviceReceivedEvent:(SFEventMessage *)arg1;
- (void)serviceReceivedRequest:(SFRequestMessage *)arg1;
- (void)serviceReceivedResponse:(SFResponseMessage *)arg1;
- (void)sessionError:(NSError *)arg1;
- (void)sessionReceivedEvent:(SFEventMessage *)arg1;
- (void)sessionReceivedRequest:(SFRequestMessage *)arg1;
- (void)sessionReceivedResponse:(SFResponseMessage *)arg1;
@end
| {
"pile_set_name": "Github"
} |
" ninja build file syntax.
" Language: ninja build file as described at
" http://martine.github.com/ninja/manual.html
" Version: 1.4
" Last Change: 2014/05/13
" Maintainer: Nicolas Weber <[email protected]>
" Version 1.4 of this script is in the upstream vim repository and will be
" included in the next vim release. If you change this, please send your change
" upstream.
" ninja lexer and parser are at
" https://github.com/martine/ninja/blob/master/src/lexer.in.cc
" https://github.com/martine/ninja/blob/master/src/manifest_parser.cc
if exists("b:current_syntax")
finish
endif
let s:cpo_save = &cpo
set cpo&vim
syn case match
syn match ninjaComment /#.*/ contains=@Spell
" Toplevel statements are the ones listed here and
" toplevel variable assignments (ident '=' value).
" lexer.in.cc, ReadToken() and manifest_parser.cc, Parse()
syn match ninjaKeyword "^build\>"
syn match ninjaKeyword "^rule\>"
syn match ninjaKeyword "^pool\>"
syn match ninjaKeyword "^default\>"
syn match ninjaKeyword "^include\>"
syn match ninjaKeyword "^subninja\>"
" Both 'build' and 'rule' begin a variable scope that ends
" on the first line without indent. 'rule' allows only a
" limited set of magic variables, 'build' allows general
" let assignments.
" manifest_parser.cc, ParseRule()
syn region ninjaRule start="^rule" end="^\ze\S" contains=ALL transparent
syn keyword ninjaRuleCommand contained command deps depfile description generator
\ pool restat rspfile rspfile_content
syn region ninjaPool start="^pool" end="^\ze\S" contains=ALL transparent
syn keyword ninjaPoolCommand contained depth
" Strings are parsed as follows:
" lexer.in.cc, ReadEvalString()
" simple_varname = [a-zA-Z0-9_-]+;
" varname = [a-zA-Z0-9_.-]+;
" $$ -> $
" $\n -> line continuation
" '$ ' -> escaped space
" $simple_varname -> variable
" ${varname} -> variable
syn match ninjaDollar "\$\$"
syn match ninjaWrapLineOperator "\$$"
syn match ninjaSimpleVar "\$[a-zA-Z0-9_-]\+"
syn match ninjaVar "\${[a-zA-Z0-9_.-]\+}"
" operators are:
" variable assignment =
" rule definition :
" implicit dependency |
" order-only dependency ||
syn match ninjaOperator "\(=\|:\||\|||\)\ze\s"
hi def link ninjaComment Comment
hi def link ninjaKeyword Keyword
hi def link ninjaRuleCommand Statement
hi def link ninjaPoolCommand Statement
hi def link ninjaDollar ninjaOperator
hi def link ninjaWrapLineOperator ninjaOperator
hi def link ninjaOperator Operator
hi def link ninjaSimpleVar ninjaVar
hi def link ninjaVar Identifier
let b:current_syntax = "ninja"
let &cpo = s:cpo_save
unlet s:cpo_save
| {
"pile_set_name": "Github"
} |
#ifndef BOOST_ALGORITHM_RG071801_HPP
#define BOOST_ALGORITHM_RG071801_HPP
//
//
// Copyright (c) 1994
// Hewlett-Packard Company
//
// Permission to use, copy, modify, distribute and sell this software
// and its documentation for any purpose is hereby granted without fee,
// provided that the above copyright notice appear in all copies and
// that both that copyright notice and this permission notice appear
// in supporting documentation. Hewlett-Packard Company makes no
// representations about the suitability of this software for any
// purpose. It is provided "as is" without express or implied warranty.
//
//
// Copyright (c) 1996-1998
// Silicon Graphics Computer Systems, Inc.
//
// Permission to use, copy, modify, distribute and sell this software
// and its documentation for any purpose is hereby granted without fee,
// provided that the above copyright notice appear in all copies and
// that both that copyright notice and this permission notice appear
// in supporting documentation. Silicon Graphics makes no
// representations about the suitability of this software for any
// purpose. It is provided "as is" without express or implied warranty.
//
// Copyright 2002 The Trustees of Indiana University.
// 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)
// Boost.MultiArray Library
// Authors: Ronald Garcia
// Jeremy Siek
// Andrew Lumsdaine
// See http://www.boost.org/libs/multi_array for documentation.
#include "boost/iterator.hpp"
namespace boost {
namespace detail {
namespace multi_array {
//--------------------------------------------------
// copy_n (not part of the C++ standard)
#if 1
template <class InputIter, class Size, class OutputIter>
OutputIter copy_n(InputIter first, Size count,
OutputIter result) {
for ( ; count > 0; --count) {
*result = *first;
++first;
++result;
}
return result;
}
#else // !1
template <class InputIter, class Size, class OutputIter>
OutputIter copy_n__(InputIter first, Size count,
OutputIter result,
std::input_iterator_tag) {
for ( ; count > 0; --count) {
*result = *first;
++first;
++result;
}
return result;
}
template <class RAIter, class Size, class OutputIter>
inline OutputIter
copy_n__(RAIter first, Size count,
OutputIter result,
std::random_access_iterator_tag) {
RAIter last = first + count;
return std::copy(first, last, result);
}
template <class InputIter, class Size, class OutputIter>
inline OutputIter
copy_n__(InputIter first, Size count, OutputIter result) {
typedef typename std::iterator_traits<InputIter>::iterator_category cat;
return copy_n__(first, count, result, cat());
}
template <class InputIter, class Size, class OutputIter>
inline OutputIter
copy_n(InputIter first, Size count, OutputIter result) {
return copy_n__(first, count, result);
}
#endif // 1
} // namespace multi_array
} // namespace detail
} // namespace boost
#endif // BOOST_ALGORITHM_RG071801_HPP
| {
"pile_set_name": "Github"
} |
% ----------------------------------------------------------------------
% BEGIN LICENSE BLOCK
% Version: CMPL 1.1
%
% The contents of this file are subject to the Cisco-style Mozilla Public
% License Version 1.1 (the "License"); you may not use this file except
% in compliance with the License. You may obtain a copy of the License
% at www.eclipse-clp.org/license.
%
% Software distributed under the License is distributed on an "AS IS"
% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
% the License for the specific language governing rights and limitations
% under the License.
%
% The Original Code is The ECLiPSe Constraint Logic Programming System.
% The Initial Developer of the Original Code is Cisco Systems, Inc.
% Portions created by the Initial Developer are
% Copyright (C) 1999-2006 Cisco Systems, Inc. All Rights Reserved.
%
% Contributor(s): Parc Technologies Ltd
%
% END LICENSE BLOCK
%
% System: ECLiPSe Constraint Logic Programming System
% Version: $Id: time_log.ecl,v 1.1 2008/06/30 17:43:50 jschimpf Exp $
% ----------------------------------------------------------------------
:- module(time_log).
:- export initialise_time_logging/1.
:- export log_time_local/2.
:- export collate_time_logs/4.
:- comment(summary, "Module for logging and collating test times").
:- comment(copyright, "Cisco Systems, Inc").
:- comment(date, "$Date: 2008/06/30 17:43:50 $").
:- comment(desc, html("\
This module is used for logging and collating the times taken to run
tests (but could be used for other similar purposes). Before
running any tests, call initialise_time_logging/1. This deletes any
old administrative files from a previous test run. Then, within the
test harness for an individual test, call log_time_local/2 to log
the time taken for the test to a temporary local file. Finally,
once all the tests have completed successfully, call
collate_time_logs/4 to collect all the local administrative files
and add all the data to the master log file.
")).
:- comment(initialise_time_logging/1, [
summary:"Prepare for time logging",
amode:initialise_time_logging(++),
args:["Directory":"Root test directory"],
desc:html("\
This predicate prepares the given directory for time logging.
Essentially all it does is traverse the directory tree looking for
old administrative files and deleting them.
")]).
:- comment(log_time_local/2, [
summary:"Log a time in the local directory",
amode:log_time_local(++, ++),
args:[
"Name":"Name of test",
"Time":"Time taken to run test"
],
desc:html("\
Logs to a temporary administrative file in the local directory that
the test with the given name took the specified time to execute.
")]).
:- comment(collate_time_logs/4, [
summary:"Collate local time logs into master log",
amode:collate_time_logs(++, ++, ++, ++),
args:[
"Directory":"Root test directory",
"Package":"ECLiPSe package used",
"Embedding":"ECLiPSe embedding used",
"MasterLogFile":"Master log file"
],
desc:html("\
Collates all the temporary administrative files in the directory
tree specified and logs them to the specified master log file.</P><P>
Package specifies which ECLiPSe package was used, such as `standard'
or `runtime'.</P><P>
Embedding specifies which ECLiPSe embedding was used, such as
`standalone' or `java'.</P><P>
")]).
:- lib(calendar).
:- local struct(local_time(
name, % Name of test in local directory
time % Time taken for test
)).
:- local struct(test_info(
test_subdir, % Subdirectory test was in
test_name, % Name of test
test_time % Time test took to run
)).
:- local struct(date_info(
collection_date, % Date info was collected
collection_time % Time info was collected
)).
:- local struct(version_info(
eclipse_version % 5.2, etc.
%build_number
)).
:- local struct(config_info(
eclipse_package, % standard or runtime
eclipse_embedding % standalone or java
)).
:- local struct(eclipse_info(
eclipse_version_info:version_info,
eclipse_config_info:config_info,
eclipse_location % $ECLIPSEDIR
)).
:- local struct(machine_info(
architecture, % i386_linux, etc.
machine_name % goat.icparc.ic.ac.uk, etc.
)).
:- local struct(user_info(
user_name % wh, js10, etc.
)).
:- local struct(time_log(
test_info : test_info,
date_info : date_info,
eclipse_info : eclipse_info,
machine_info : machine_info,
user_info : user_info
)).
:- local portray(test_info/3, portray_struct/2, [write]).
:- local portray(date_info/2, portray_struct/2, [write]).
:- local portray(version_info/1, portray_struct/2, [write]).
:- local portray(config_info/2, portray_struct/2, [write]).
:- local portray(eclipse_info/3, portray_struct/2, [write]).
:- local portray(machine_info/2, portray_struct/2, [write]).
:- local portray(user_info/1, portray_struct/2, [write]).
:- local portray(time_log/5, portray_struct/2, [write]).
%
% Initialise time logging --- by deleting any local time log files.
%
initialise_time_logging(Directory) :-
find(Directory, ".time_log", LocalLogFiles),
(
foreach(LogFile, LocalLogFiles)
do
delete(LogFile)
).
%
% Log a test time locally
%
log_time_local(Name, Time) :-
open(".time_log", append, Stream),
printf(Stream, "local_time(%q, %.2f).%n", [Name, Time]),
close(Stream).
%
% Collect all the local time log files, add the global data, and append
% them to the master log file.
%
collate_time_logs(Directory, Package, Embedding, MasterLogFile) :-
create_info_template(Package, Embedding, Template),
find(Directory, ".time_log", LocalLogFiles),
split_string(Directory, "/", "/", DirPartList),
length(DirPartList, NDirParts),
open(MasterLogFile, append, Stream),
(
(
foreach(LogFile, LocalLogFiles),
param(NDirParts, Template, Stream)
do
process_local_log_file(LogFile, NDirParts, Template, Stream)
)
->
true
;
printf(error, "Error collating local time logs.%n", [])
),
close(Stream).
process_local_log_file(LogFile, NStripDirParts, Template, Stream) :-
% Extract the name of the test subdirectory.
split_string(LogFile, "/", "/", LogFilePartList),
drop_n(NStripDirParts, LogFilePartList, LogFilePartList1),
drop_last(LogFilePartList1, TestSubdirPartList),
join_string(TestSubdirPartList, "/", TestSubdir),
% Read and process the log file.
read_file_terms_as_list(LogFile, LocalTimeList),
(
foreach(LocalTime, LocalTimeList),
param(Template, TestSubdir, Stream)
do
LocalTime = local_time{
name: TestName,
time: TestTime
},
TestInfo = test_info{
test_subdir:TestSubdir,
test_name: TestName,
test_time: TestTime
},
update_struct(time_log, [test_info:TestInfo], Template, LogTerm),
printf(Stream, "%QDPw.%n", [LogTerm]),
flush(Stream)
).
create_info_template(Package, Embedding, Template) :-
% Collection date info.
mjd_now(MJD),
mjd_to_ymd(MJD, CollectionDate),
mjd_to_time(MJD, Hour:Minute:Second0),
Second is fix(Second0),
CollectionTime = Hour:Minute:Second,
DateInfo = date_info{
collection_date: CollectionDate,
collection_time: CollectionTime
},
% Eclipse info.
get_flag(version, EclipseVersion),
% XXX - Get build number as well
VersionInfo = version_info{
eclipse_version: EclipseVersion
},
ConfigInfo = config_info{
eclipse_package: Package,
eclipse_embedding: Embedding
},
get_flag(installation_directory, EclipseLocation),
EclipseInfo = eclipse_info{
eclipse_version_info: VersionInfo,
eclipse_config_info: ConfigInfo,
eclipse_location: EclipseLocation
},
% Machine info.
get_flag(hostarch, Architecture),
get_flag(hostname, MachineName),
MachineInfo = machine_info{
architecture: Architecture,
machine_name: MachineName
},
% User info.
( getenv("LOGNAME", UserName) ->
true
;
UserName = unknown
),
UserInfo = user_info{user_name:UserName},
Template = time_log{
date_info: DateInfo,
eclipse_info: EclipseInfo,
machine_info: MachineInfo,
user_info: UserInfo
}.
find(Directory, Pattern, FileList) :-
find(Directory, Pattern, FileList, []).
find(Directory, Pattern, FileList0, FileList) :-
read_directory(Directory, Pattern, SubdirList, LocalFileList),
(
foreach(LocalFile, LocalFileList),
fromto(FileList0, [File | Tail], Tail, FileList1),
param(Directory)
do
join_string([Directory, LocalFile], "/", File)
),
(
foreach(Subdir, SubdirList),
fromto(FileList1, FileListOut, FileListIn, FileList),
param(Directory, Pattern)
do
join_string([Directory, Subdir], "/", Dir),
find(Dir, Pattern, FileListOut, FileListIn)
).
read_file_terms_as_list(File, List) :-
open(File, read, Stream),
(
read(Stream, Entry0),
(
fromto(Entry0, PrevEntry, NextEntry, end_of_file),
foreach(Entry, List),
param(Stream)
do
Entry = PrevEntry,
read(Stream, NextEntry)
)
->
close(Stream)
;
% Make sure we close the stream even if something failed.
close(Stream),
fail
).
drop_n(N, List, Remainder) :-
( N > 0 ->
List = [_ | Tail],
N_1 is N - 1,
drop_n(N_1, Tail, Remainder)
;
N =:= 0,
Remainder = List
).
drop_last([_], []) :-
!.
drop_last([X | Xs], [X | Ys]) :-
drop_last(Xs, Ys).
portray_struct(Term, no_macro_expansion(with(Functor,List))) :-
functor(Term, Functor, Arity),
functor(Template, Functor, Arity),
current_struct(Functor, Template),
Term =.. [_ | Args],
Template =.. [_ | Fields],
(
foreach(Arg, Args),
foreach(Field, Fields),
foreach(Name:Arg, List)
do
( Field = Name : _ ->
true
;
Name = Field
)
).
| {
"pile_set_name": "Github"
} |
Jilin Agricultural University
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2017 Cisco and/or its affiliates.
* 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.
*/
/*
Copyright (c) 2001, 2002, 2003, 2004 Eliot Dresselhaus
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.
*/
#include <vppinfra/pool.h>
void
_pool_init_fixed (void **pool_ptr, u32 elt_size, u32 max_elts)
{
u8 *mmap_base;
u64 vector_size;
u64 free_index_size;
u64 total_size;
u64 page_size;
pool_header_t *fh;
vec_header_t *vh;
u8 *v;
u32 *fi;
u32 i;
u32 set_bits;
ASSERT (elt_size);
ASSERT (max_elts);
vector_size = pool_aligned_header_bytes + (u64) elt_size *max_elts;
free_index_size = vec_header_bytes (0) + sizeof (u32) * max_elts;
/* Round up to a cache line boundary */
vector_size = (vector_size + CLIB_CACHE_LINE_BYTES - 1)
& ~(CLIB_CACHE_LINE_BYTES - 1);
free_index_size = (free_index_size + CLIB_CACHE_LINE_BYTES - 1)
& ~(CLIB_CACHE_LINE_BYTES - 1);
total_size = vector_size + free_index_size;
/* Round up to an even number of pages */
page_size = clib_mem_get_page_size ();
total_size = (total_size + page_size - 1) & ~(page_size - 1);
/* mmap demand zero memory */
mmap_base = mmap (0, total_size, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (mmap_base == MAP_FAILED)
{
clib_unix_warning ("mmap");
*pool_ptr = 0;
}
/* First comes the pool header */
fh = (pool_header_t *) mmap_base;
/* Find the user vector pointer */
v = (u8 *) (mmap_base + pool_aligned_header_bytes);
/* Finally, the vector header */
vh = _vec_find (v);
fh->free_bitmap = 0; /* No free elts (yet) */
fh->max_elts = max_elts;
fh->mmap_base = mmap_base;
fh->mmap_size = total_size;
vh->len = max_elts;
/* Build the free-index vector */
vh = (vec_header_t *) (v + vector_size);
vh->len = max_elts;
fi = (u32 *) (vh + 1);
fh->free_indices = fi;
/* Set the entire free bitmap */
clib_bitmap_alloc (fh->free_bitmap, max_elts);
clib_memset (fh->free_bitmap, 0xff,
vec_len (fh->free_bitmap) * sizeof (uword));
/* Clear any extraneous set bits */
set_bits = vec_len (fh->free_bitmap) * BITS (uword);
for (i = max_elts; i < set_bits; i++)
fh->free_bitmap = clib_bitmap_set (fh->free_bitmap, i, 0);
/* Create the initial free vector */
for (i = 0; i < max_elts; i++)
fi[i] = (max_elts - 1) - i;
*pool_ptr = v;
}
/*
* fd.io coding-style-patch-verification: ON
*
* Local Variables:
* eval: (c-set-style "gnu")
* End:
*/
| {
"pile_set_name": "Github"
} |
/*******************************************************************************
Copyright (c) 2016, The OpenBLAS Project
All rights reserved.
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 above 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. Neither the name of the OpenBLAS project 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 OPENBLAS PROJECT 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.
*******************************************************************************/
#include "common.h"
#include <math.h>
#include "macros_msa.h"
#define AND_VEC_W(in) ((v4f32) ((v4i32) in & and_vec))
FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x)
{
BLASLONG i = 0;
FLOAT data0, data1, sumf = 0.0;
v4f32 src0, src1, src2, src3, src4, src5, src6, src7;
v4f32 src8, src9, src10, src11, src12, src13, src14, src15;
v4f32 sum_abs0 = {0, 0, 0, 0};
v4f32 sum_abs1 = {0, 0, 0, 0};
v4f32 sum_abs2 = {0, 0, 0, 0};
v4f32 sum_abs3 = {0, 0, 0, 0};
v4f32 zero_v = {0, 0, 0, 0};
v4i32 and_vec = {0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF};
if (n <= 0 || inc_x <= 0) return (sumf);
if (1 == inc_x)
{
if (n > 63)
{
FLOAT *x_pref;
BLASLONG pref_offset;
pref_offset = (BLASLONG)x & (L1_DATA_LINESIZE - 1);
if (pref_offset > 0)
{
pref_offset = L1_DATA_LINESIZE - pref_offset;
pref_offset = pref_offset / sizeof(FLOAT);
}
x_pref = x + pref_offset + 128 + 32;
LD_SP8_INC(x, 4, src0, src1, src2, src3, src4, src5, src6, src7);
for (i = 0; i < (n >> 6) - 1; i++)
{
PREF_OFFSET(x_pref, 0);
PREF_OFFSET(x_pref, 32);
PREF_OFFSET(x_pref, 64);
PREF_OFFSET(x_pref, 96);
PREF_OFFSET(x_pref, 128);
PREF_OFFSET(x_pref, 160);
PREF_OFFSET(x_pref, 192);
PREF_OFFSET(x_pref, 224);
x_pref += 64;
LD_SP8_INC(x, 4, src8, src9, src10, src11, src12, src13, src14, src15);
sum_abs0 += AND_VEC_W(src0);
sum_abs1 += AND_VEC_W(src1);
sum_abs2 += AND_VEC_W(src2);
sum_abs3 += AND_VEC_W(src3);
sum_abs0 += AND_VEC_W(src4);
sum_abs1 += AND_VEC_W(src5);
sum_abs2 += AND_VEC_W(src6);
sum_abs3 += AND_VEC_W(src7);
LD_SP8_INC(x, 4, src0, src1, src2, src3, src4, src5, src6, src7);
sum_abs0 += AND_VEC_W(src8);
sum_abs1 += AND_VEC_W(src9);
sum_abs2 += AND_VEC_W(src10);
sum_abs3 += AND_VEC_W(src11);
sum_abs0 += AND_VEC_W(src12);
sum_abs1 += AND_VEC_W(src13);
sum_abs2 += AND_VEC_W(src14);
sum_abs3 += AND_VEC_W(src15);
}
LD_SP8_INC(x, 4, src8, src9, src10, src11, src12, src13, src14, src15);
sum_abs0 += AND_VEC_W(src0);
sum_abs1 += AND_VEC_W(src1);
sum_abs2 += AND_VEC_W(src2);
sum_abs3 += AND_VEC_W(src3);
sum_abs0 += AND_VEC_W(src4);
sum_abs1 += AND_VEC_W(src5);
sum_abs2 += AND_VEC_W(src6);
sum_abs3 += AND_VEC_W(src7);
sum_abs0 += AND_VEC_W(src8);
sum_abs1 += AND_VEC_W(src9);
sum_abs2 += AND_VEC_W(src10);
sum_abs3 += AND_VEC_W(src11);
sum_abs0 += AND_VEC_W(src12);
sum_abs1 += AND_VEC_W(src13);
sum_abs2 += AND_VEC_W(src14);
sum_abs3 += AND_VEC_W(src15);
}
if (n & 63)
{
if (n & 32)
{
LD_SP8_INC(x, 4, src0, src1, src2, src3, src4, src5, src6, src7);
sum_abs0 += AND_VEC_W(src0);
sum_abs1 += AND_VEC_W(src1);
sum_abs2 += AND_VEC_W(src2);
sum_abs3 += AND_VEC_W(src3);
sum_abs0 += AND_VEC_W(src4);
sum_abs1 += AND_VEC_W(src5);
sum_abs2 += AND_VEC_W(src6);
sum_abs3 += AND_VEC_W(src7);
}
if (n & 16)
{
LD_SP4_INC(x, 4, src0, src1, src2, src3);
sum_abs0 += AND_VEC_W(src0);
sum_abs1 += AND_VEC_W(src1);
sum_abs2 += AND_VEC_W(src2);
sum_abs3 += AND_VEC_W(src3);
}
if (n & 8)
{
LD_SP2_INC(x, 4, src0, src1);
sum_abs0 += AND_VEC_W(src0);
sum_abs1 += AND_VEC_W(src1);
}
if (n & 4)
{
src0 = LD_SP(x); x += 4;
sum_abs0 += AND_VEC_W(src0);
}
if (n & 2)
{
sumf += fabsf(*x);
sumf += fabsf(*(x + 1));
x += 2;
}
if (n & 1)
{
sumf += fabsf(*x);
}
}
sum_abs0 += sum_abs1 + sum_abs2 + sum_abs3;
sumf += sum_abs0[0];
sumf += sum_abs0[1];
sumf += sum_abs0[2];
sumf += sum_abs0[3];
}
else
{
for (i = (n >> 4); i--;)
{
src0 = (v4f32) __msa_insert_w((v4i32) zero_v, 0, *((int *) x));
x += inc_x;
src0 = (v4f32) __msa_insert_w((v4i32) src0, 1, *((int *) x));
x += inc_x;
src0 = (v4f32) __msa_insert_w((v4i32) src0, 2, *((int *) x));
x += inc_x;
src0 = (v4f32) __msa_insert_w((v4i32) src0, 3, *((int *) x));
x += inc_x;
src1 = (v4f32) __msa_insert_w((v4i32) zero_v, 0, *((int *) x));
x += inc_x;
src1 = (v4f32) __msa_insert_w((v4i32) src1, 1, *((int *) x));
x += inc_x;
src1 = (v4f32) __msa_insert_w((v4i32) src1, 2, *((int *) x));
x += inc_x;
src1 = (v4f32) __msa_insert_w((v4i32) src1, 3, *((int *) x));
x += inc_x;
src2 = (v4f32) __msa_insert_w((v4i32) zero_v, 0, *((int *) x));
x += inc_x;
src2 = (v4f32) __msa_insert_w((v4i32) src2, 1, *((int *) x));
x += inc_x;
src2 = (v4f32) __msa_insert_w((v4i32) src2, 2, *((int *) x));
x += inc_x;
src2 = (v4f32) __msa_insert_w((v4i32) src2, 3, *((int *) x));
x += inc_x;
src3 = (v4f32) __msa_insert_w((v4i32) zero_v, 0, *((int *) x));
x += inc_x;
src3 = (v4f32) __msa_insert_w((v4i32) src3, 1, *((int *) x));
x += inc_x;
src3 = (v4f32) __msa_insert_w((v4i32) src3, 2, *((int *) x));
x += inc_x;
src3 = (v4f32) __msa_insert_w((v4i32) src3, 3, *((int *) x));
x += inc_x;
sum_abs0 += AND_VEC_W(src0);
sum_abs1 += AND_VEC_W(src1);
sum_abs2 += AND_VEC_W(src2);
sum_abs3 += AND_VEC_W(src3);
}
if (n & 15)
{
if (n & 8)
{
src0 = (v4f32) __msa_insert_w((v4i32) zero_v, 0, *((int *) x));
x += inc_x;
src0 = (v4f32) __msa_insert_w((v4i32) src0, 1, *((int *) x));
x += inc_x;
src0 = (v4f32) __msa_insert_w((v4i32) src0, 2, *((int *) x));
x += inc_x;
src0 = (v4f32) __msa_insert_w((v4i32) src0, 3, *((int *) x));
x += inc_x;
src1 = (v4f32) __msa_insert_w((v4i32) zero_v, 0, *((int *) x));
x += inc_x;
src1 = (v4f32) __msa_insert_w((v4i32) src1, 1, *((int *) x));
x += inc_x;
src1 = (v4f32) __msa_insert_w((v4i32) src1, 2, *((int *) x));
x += inc_x;
src1 = (v4f32) __msa_insert_w((v4i32) src1, 3, *((int *) x));
x += inc_x;
sum_abs0 += AND_VEC_W(src0);
sum_abs1 += AND_VEC_W(src1);
}
if (n & 4)
{
src0 = (v4f32) __msa_insert_w((v4i32) zero_v, 0, *((int *) x));
x += inc_x;
src0 = (v4f32) __msa_insert_w((v4i32) src0, 1, *((int *) x));
x += inc_x;
src0 = (v4f32) __msa_insert_w((v4i32) src0, 2, *((int *) x));
x += inc_x;
src0 = (v4f32) __msa_insert_w((v4i32) src0, 3, *((int *) x));
x += inc_x;
sum_abs0 += AND_VEC_W(src0);
}
if (n & 2)
{
data0 = fabsf(*x); x += inc_x;
data1 = fabsf(*x); x += inc_x;
sumf += data0;
sumf += data1;
}
if (n & 1)
{
sumf += fabsf(*x);
}
}
sum_abs0 += sum_abs1 + sum_abs2 + sum_abs3;
sumf += sum_abs0[0];
sumf += sum_abs0[1];
sumf += sum_abs0[2];
sumf += sum_abs0[3];
}
return (sumf);
}
| {
"pile_set_name": "Github"
} |
/*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVFORMAT_W64_H
#define AVFORMAT_W64_H
#include <stdint.h>
extern const uint8_t ff_w64_guid_riff[16];
extern const uint8_t ff_w64_guid_wave[16];
extern const uint8_t ff_w64_guid_fmt [16];
extern const uint8_t ff_w64_guid_fact[16];
extern const uint8_t ff_w64_guid_data[16];
extern const uint8_t ff_w64_guid_summarylist[16];
#endif /* AVFORMAT_W64_H */
| {
"pile_set_name": "Github"
} |
using System.Linq;
using System.Threading.Tasks;
using ChilliCream.Testing;
using HotChocolate;
using HotChocolate.Language;
using HotChocolate.Types;
using Xunit;
using Snapshooter.Xunit;
using StrawberryShake.Generators.Descriptors;
using StrawberryShake.Generators.CSharp;
namespace StrawberryShake.Generators
{
public class InterfaceModelGeneratorTests
: ModelGeneratorTestBase
{
[Fact]
public async Task Interface_No_Fragments()
{
// arrange
var path = HotChocolate.Path.New("root");
DocumentNode document = Utf8GraphQLParser.Parse(
FileResource.Open("Simple_Query.graphql"));
var operation = document.Definitions
.OfType<OperationDefinitionNode>()
.First();
var field = operation.SelectionSet.Selections
.OfType<FieldNode>()
.First();
var query = new QueryDescriptor(
"Simple_Query",
"Foo.Bar.Ns",
"1234",
"12345",
new byte[] { 1, 2, 3 },
document);
var schema = SchemaBuilder.New()
.AddDocumentFromString(FileResource.Open("StarWars.graphql"))
.Use(next => context => Task.CompletedTask)
.Create();
var context = new ModelGeneratorContext(
schema,
query,
"StarWarsClient",
"Foo.Bar.Ns");
var character = schema.GetType<InterfaceType>("Character");
// act
var generator = new InterfaceModelGenerator();
generator.Generate(
context,
operation,
character,
character,
field,
context.CollectFields(character, field.SelectionSet, path),
path);
// assert
var typeLookup = new TypeLookup(
LanguageVersion.CSharp_8_0,
CollectFieldsVisitor.MockLookup(document, context.FieldTypes),
"Foo.Bar");
string output = await WriteAllAsync(context.Descriptors, typeLookup);
output.MatchSnapshot();
}
[Fact]
public async Task Interface_With_Fragments()
{
// arrange
var path = HotChocolate.Path.New("root");
DocumentNode document = Utf8GraphQLParser.Parse(
FileResource.Open("Multiple_Fragments_Query.graphql"));
var operation = document.Definitions
.OfType<OperationDefinitionNode>()
.First();
var field = operation.SelectionSet.Selections
.OfType<FieldNode>()
.First();
var query = new QueryDescriptor(
"Simple_Query",
"Foo.Bar.Ns",
"1234",
"12345",
new byte[] { 1, 2, 3 },
document);
var schema = SchemaBuilder.New()
.AddDocumentFromString(FileResource.Open("StarWars.graphql"))
.Use(next => context => Task.CompletedTask)
.Create();
var context = new ModelGeneratorContext(
schema,
query,
"StarWarsClient",
"Foo.Bar.Ns");
var character = schema.GetType<InterfaceType>("Character");
// act
var generator = new InterfaceModelGenerator();
generator.Generate(
context,
operation,
character,
character,
field,
context.CollectFields(character, field.SelectionSet, path),
path);
// assert
var typeLookup = new TypeLookup(
LanguageVersion.CSharp_8_0,
CollectFieldsVisitor.MockLookup(document, context.FieldTypes),
"Foo.Bar");
string output = await WriteAllAsync(context.Descriptors, typeLookup);
output.MatchSnapshot();
}
[Fact]
public async Task Interface_Two_Cases()
{
// arrange
var path = HotChocolate.Path.New("root");
DocumentNode document = Utf8GraphQLParser.Parse(
@"
query getHero {
hero {
...Hero
}
}
fragment Hero on Character {
...HasName
...SomeDroid
...SomeHuman
}
fragment SomeDroid on Droid {
primaryFunction
}
fragment SomeHuman on Human {
homePlanet
}
fragment HasName on Character {
name
}
");
var operation = document.Definitions
.OfType<OperationDefinitionNode>()
.First();
var field = operation.SelectionSet.Selections
.OfType<FieldNode>()
.First();
var query = new QueryDescriptor(
"Simple_Query",
"Foo.Bar.Ns",
"1234",
"12345",
new byte[] { 1, 2, 3 },
document);
var schema = SchemaBuilder.New()
.AddDocumentFromString(FileResource.Open("StarWars.graphql"))
.Use(next => context => Task.CompletedTask)
.Create();
var context = new ModelGeneratorContext(
schema,
query,
"StarWarsClient",
"Foo.Bar.Ns");
var character = schema.GetType<InterfaceType>("Character");
// act
var generator = new InterfaceModelGenerator();
generator.Generate(
context,
operation,
character,
character,
field,
context.CollectFields(character, field.SelectionSet, path),
path);
// assert
var typeLookup = new TypeLookup(
LanguageVersion.CSharp_8_0,
CollectFieldsVisitor.MockLookup(document, context.FieldTypes),
"Foo.Bar");
string output = await WriteAllAsync(context.Descriptors, typeLookup);
output.MatchSnapshot();
}
[Fact]
public async Task Interface_Two_Cases_2()
{
// arrange
var path = HotChocolate.Path.New("root");
DocumentNode document = Utf8GraphQLParser.Parse(
@"
query getHero {
hero {
...HasName
...SomeDroid
...SomeHuman
}
}
fragment SomeDroid on Droid {
primaryFunction
}
fragment SomeHuman on Human {
homePlanet
}
fragment HasName on Character {
name
}
");
var operation = document.Definitions
.OfType<OperationDefinitionNode>()
.First();
var field = operation.SelectionSet.Selections
.OfType<FieldNode>()
.First();
var query = new QueryDescriptor(
"Simple_Query",
"Foo.Bar.Ns",
"1234",
"12345",
new byte[] { 1, 2, 3 },
document);
var schema = SchemaBuilder.New()
.AddDocumentFromString(FileResource.Open("StarWars.graphql"))
.Use(next => context => Task.CompletedTask)
.Create();
var context = new ModelGeneratorContext(
schema,
query,
"StarWarsClient",
"Foo.Bar.Ns");
var character = schema.GetType<InterfaceType>("Character");
// act
var generator = new InterfaceModelGenerator();
generator.Generate(
context,
operation,
character,
character,
field,
context.CollectFields(character, field.SelectionSet, path),
path);
// assert
var typeLookup = new TypeLookup(
LanguageVersion.CSharp_8_0,
CollectFieldsVisitor.MockLookup(document, context.FieldTypes),
"Foo.Bar");
string output = await WriteAllAsync(context.Descriptors, typeLookup);
output.MatchSnapshot();
}
[Fact]
public async Task Interface_Two_Cases_3()
{
// arrange
var path = HotChocolate.Path.New("root");
DocumentNode document = Utf8GraphQLParser.Parse(
@"
query getHero {
hero {
...Hero
}
}
fragment Hero on Character {
...HasName
...SomeDroid
...SomeHuman
}
fragment SomeDroid on Droid {
...HasName
primaryFunction
}
fragment SomeHuman on Human {
...HasName
homePlanet
}
fragment HasName on Character {
name
}
");
var operation = document.Definitions
.OfType<OperationDefinitionNode>()
.First();
var field = operation.SelectionSet.Selections
.OfType<FieldNode>()
.First();
var query = new QueryDescriptor(
"Simple_Query",
"Foo.Bar.Ns",
"1234",
"12345",
new byte[] { 1, 2, 3 },
document);
var schema = SchemaBuilder.New()
.AddDocumentFromString(FileResource.Open("StarWars.graphql"))
.Use(next => context => Task.CompletedTask)
.Create();
var context = new ModelGeneratorContext(
schema,
query,
"StarWarsClient",
"Foo.Bar.Ns");
var character = schema.GetType<InterfaceType>("Character");
// act
var generator = new InterfaceModelGenerator();
generator.Generate(
context,
operation,
character,
character,
field,
context.CollectFields(character, field.SelectionSet, path),
path);
// assert
var typeLookup = new TypeLookup(
LanguageVersion.CSharp_8_0,
CollectFieldsVisitor.MockLookup(document, context.FieldTypes),
"Foo.Bar");
string output = await WriteAllAsync(context.Descriptors, typeLookup);
output.MatchSnapshot();
}
}
}
| {
"pile_set_name": "Github"
} |
//hong QQ:1410919373
package fl.controls {
import fl.core.*;
import flash.display.*;
import fl.managers.*;
public class Button extends LabelButton implements IFocusManagerComponent {
private static var defaultStyles:Object = {
emphasizedSkin:"Button_emphasizedSkin",
emphasizedPadding:2
};
public static var createAccessibilityImplementation:Function;
protected var emphasizedBorder:DisplayObject;
protected var _emphasized:Boolean = false;
public function Button(){
_emphasized = false;
super();
}
public static function getStyleDefinition():Object{
return (UIComponent.mergeStyles(LabelButton.getStyleDefinition(), defaultStyles));
}
override public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
var _local3:*;
super.drawFocus(_arg1);
if (_arg1){
_local2 = Number(getStyleValue("emphasizedPadding"));
if ((((_local2 < 0)) || (!(_emphasized)))){
_local2 = 0;
};
_local3 = getStyleValue("focusRectPadding");
_local3 = ((_local3)==null) ? 2 : _local3;
_local3 = (_local3 + _local2);
uiFocusRect.x = -(_local3);
uiFocusRect.y = -(_local3);
uiFocusRect.width = (width + (_local3 * 2));
uiFocusRect.height = (height + (_local3 * 2));
};
}
public function set emphasized(_arg1:Boolean):void{
_emphasized = _arg1;
invalidate(InvalidationType.STYLES);
}
override protected function draw():void{
if (((isInvalid(InvalidationType.STYLES)) || (isInvalid(InvalidationType.SIZE)))){
drawEmphasized();
};
super.draw();
if (emphasizedBorder != null){
setChildIndex(emphasizedBorder, (numChildren - 1));
};
}
public function get emphasized():Boolean{
return (_emphasized);
}
override protected function initializeAccessibility():void{
if (Button.createAccessibilityImplementation != null){
Button.createAccessibilityImplementation(this);
};
}
protected function drawEmphasized():void{
var _local1:Object;
var _local2:Number;
if (emphasizedBorder != null){
removeChild(emphasizedBorder);
};
emphasizedBorder = null;
if (!_emphasized){
return;
};
_local1 = getStyleValue("emphasizedSkin");
if (_local1 != null){
emphasizedBorder = getDisplayObjectInstance(_local1);
};
if (emphasizedBorder != null){
addChildAt(emphasizedBorder, 0);
_local2 = Number(getStyleValue("emphasizedPadding"));
emphasizedBorder.x = (emphasizedBorder.y = -(_local2));
emphasizedBorder.width = (width + (_local2 * 2));
emphasizedBorder.height = (height + (_local2 * 2));
};
}
}
}//package fl.controls
| {
"pile_set_name": "Github"
} |
Copyright (c) 2001-2014, JGraph Ltd
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the JGraph 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 JGRAPH 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. | {
"pile_set_name": "Github"
} |
PREFIX : <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/vocabulary/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT *
{
?x :rating1 ?v1 .
?y :rating2 ?v2 .
FILTER ( ?v1 != ?v2 )
}
| {
"pile_set_name": "Github"
} |
# on-headers
[![NPM Version][npm-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url]
[![Node.js Version][node-version-image]][node-version-url]
[![Build Status][travis-image]][travis-url]
[![Test Coverage][coveralls-image]][coveralls-url]
Execute a listener when a response is about to write headers.
## Installation
```sh
$ npm install on-headers
```
## API
```js
var onHeaders = require('on-headers')
```
### onHeaders(res, listener)
This will add the listener `listener` to fire when headers are emitted for `res`.
The listener is passed the `response` object as it's context (`this`). Headers are
considered to be emitted only once, right before they are sent to the client.
When this is called multiple times on the same `res`, the `listener`s are fired
in the reverse order they were added.
## Examples
```js
var http = require('http')
var onHeaders = require('on-headers')
http
.createServer(onRequest)
.listen(3000)
function addPoweredBy() {
// set if not set by end of request
if (!this.getHeader('X-Powered-By')) {
this.setHeader('X-Powered-By', 'Node.js')
}
}
function onRequest(req, res) {
onHeaders(res, addPoweredBy)
res.setHeader('Content-Type', 'text/plain')
res.end('hello!')
}
```
## Testing
```sh
$ npm test
```
## License
[MIT](LICENSE)
[npm-image]: https://img.shields.io/npm/v/on-headers.svg
[npm-url]: https://npmjs.org/package/on-headers
[node-version-image]: https://img.shields.io/node/v/on-headers.svg
[node-version-url]: http://nodejs.org/download/
[travis-image]: https://img.shields.io/travis/jshttp/on-headers/master.svg
[travis-url]: https://travis-ci.org/jshttp/on-headers
[coveralls-image]: https://img.shields.io/coveralls/jshttp/on-headers/master.svg
[coveralls-url]: https://coveralls.io/r/jshttp/on-headers?branch=master
[downloads-image]: https://img.shields.io/npm/dm/on-headers.svg
[downloads-url]: https://npmjs.org/package/on-headers
| {
"pile_set_name": "Github"
} |
@import "../../css/themes/default";
.login {
margin: 20px auto;
width: 50vw;
height: 320px;
min-width: 320px;
max-width: 640px;
padding: 0px;
box-shadow: 0 0 100px rgba(0, 0, 0, .08);
}
.register {
height: 320px;
background: @primary-7;
margin: 0;
padding: 0;
color: @body-background;
& > div{
margin:36px;
text-align: center;
h2{
color: inherit;
margin: 20px;
font-weight: 700;
}
p{
margin-top: 48px;
line-height: 25px;
}
}
}
.form {
min-width: 320px;
height: 100%;
padding: 36px;
.logintitle{
margin: 0 0 20px;
font-weight: 700;
}
button {
width: 100%;
}
p {
color: rgb(204, 204, 204);
text-align: center;
margin-top: 16px;
span {
&:first-child {
margin-right: 16px;
}
}
}
}
.logo {
text-align: center;
cursor: pointer;
padding-top: 32px;
.logoicon{
font-size: 5rem;
}
h2 {
vertical-align: text-bottom;
font-size: 24px;
text-transform: uppercase;
margin-top: 1rem;
display: block;
}
}
//.ant-spin-container,
//.ant-spin-nested-loading {
// height: 100%;
//}
| {
"pile_set_name": "Github"
} |
using System;
using NetRuntimeSystem = System;
using System.ComponentModel;
using NetOffice.Attributes;
namespace NetOffice.ExcelApi
{
/// <summary>
/// DispatchInterface Point
/// SupportByVersion Excel, 9,10,11,12,14,15,16
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff197807.aspx </remarks>
[SupportByVersion("Excel", 9,10,11,12,14,15,16)]
[EntityType(EntityType.IsDispatchInterface)]
public class Point : COMObject
{
#pragma warning disable
#region Type Information
/// <summary>
/// Instance Type
/// </summary>
[EditorBrowsable(EditorBrowsableState.Advanced), Browsable(false), Category("NetOffice"), CoreOverridden]
public override Type InstanceType
{
get
{
return LateBindingApiWrapperType;
}
}
private static Type _type;
[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
public static Type LateBindingApiWrapperType
{
get
{
if (null == _type)
_type = typeof(Point);
return _type;
}
}
#endregion
#region Ctor
/// <param name="factory">current used factory core</param>
/// <param name="parentObject">object there has created the proxy</param>
/// <param name="proxyShare">proxy share instead if com proxy</param>
public Point(Core factory, ICOMObject parentObject, COMProxyShare proxyShare) : base(factory, parentObject, proxyShare)
{
}
///<param name="factory">current used factory core</param>
///<param name="parentObject">object there has created the proxy</param>
///<param name="comProxy">inner wrapped COM proxy</param>
public Point(Core factory, ICOMObject parentObject, object comProxy) : base(factory, parentObject, comProxy)
{
}
///<param name="parentObject">object there has created the proxy</param>
///<param name="comProxy">inner wrapped COM proxy</param>
[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
public Point(ICOMObject parentObject, object comProxy) : base(parentObject, comProxy)
{
}
///<param name="factory">current used factory core</param>
///<param name="parentObject">object there has created the proxy</param>
///<param name="comProxy">inner wrapped COM proxy</param>
///<param name="comProxyType">Type of inner wrapped COM proxy"</param>
[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
public Point(Core factory, ICOMObject parentObject, object comProxy, NetRuntimeSystem.Type comProxyType) : base(factory, parentObject, comProxy, comProxyType)
{
}
///<param name="parentObject">object there has created the proxy</param>
///<param name="comProxy">inner wrapped COM proxy</param>
///<param name="comProxyType">Type of inner wrapped COM proxy"</param>
[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
public Point(ICOMObject parentObject, object comProxy, NetRuntimeSystem.Type comProxyType) : base(parentObject, comProxy, comProxyType)
{
}
///<param name="replacedObject">object to replaced. replacedObject are not usable after this action</param>
[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
public Point(ICOMObject replacedObject) : base(replacedObject)
{
}
[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
public Point() : base()
{
}
/// <param name="progId">registered progID</param>
[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
public Point(string progId) : base(progId)
{
}
#endregion
#region Properties
/// <summary>
/// SupportByVersion Excel 9, 10, 11, 12, 14, 15, 16
/// Get
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff822146.aspx </remarks>
[SupportByVersion("Excel", 9,10,11,12,14,15,16)]
public NetOffice.ExcelApi.Application Application
{
get
{
return Factory.ExecuteKnownReferencePropertyGet<NetOffice.ExcelApi.Application>(this, "Application", NetOffice.ExcelApi.Application.LateBindingApiWrapperType);
}
}
/// <summary>
/// SupportByVersion Excel 9, 10, 11, 12, 14, 15, 16
/// Get
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff839566.aspx </remarks>
[SupportByVersion("Excel", 9,10,11,12,14,15,16)]
public NetOffice.ExcelApi.Enums.XlCreator Creator
{
get
{
return Factory.ExecuteEnumPropertyGet<NetOffice.ExcelApi.Enums.XlCreator>(this, "Creator");
}
}
/// <summary>
/// SupportByVersion Excel 9, 10, 11, 12, 14, 15, 16
/// Get
/// Unknown COM Proxy
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff840338.aspx </remarks>
[SupportByVersion("Excel", 9,10,11,12,14,15,16), ProxyResult]
public object Parent
{
get
{
return Factory.ExecuteReferencePropertyGet(this, "Parent");
}
}
/// <summary>
/// SupportByVersion Excel 9, 10, 11, 12, 14, 15, 16
/// Get
/// </summary>
[SupportByVersion("Excel", 9,10,11,12,14,15,16)]
public NetOffice.ExcelApi.Border Border
{
get
{
return Factory.ExecuteKnownReferencePropertyGet<NetOffice.ExcelApi.Border>(this, "Border", NetOffice.ExcelApi.Border.LateBindingApiWrapperType);
}
}
/// <summary>
/// SupportByVersion Excel 9, 10, 11, 12, 14, 15, 16
/// Get
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff196073.aspx </remarks>
[SupportByVersion("Excel", 9,10,11,12,14,15,16)]
public NetOffice.ExcelApi.DataLabel DataLabel
{
get
{
return Factory.ExecuteKnownReferencePropertyGet<NetOffice.ExcelApi.DataLabel>(this, "DataLabel", NetOffice.ExcelApi.DataLabel.LateBindingApiWrapperType);
}
}
/// <summary>
/// SupportByVersion Excel 9, 10, 11, 12, 14, 15, 16
/// Get/Set
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff838215.aspx </remarks>
[SupportByVersion("Excel", 9,10,11,12,14,15,16)]
public Int32 Explosion
{
get
{
return Factory.ExecuteInt32PropertyGet(this, "Explosion");
}
set
{
Factory.ExecuteValuePropertySet(this, "Explosion", value);
}
}
/// <summary>
/// SupportByVersion Excel 9, 10, 11, 12, 14, 15, 16
/// Get/Set
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff835928.aspx </remarks>
[SupportByVersion("Excel", 9,10,11,12,14,15,16)]
public bool HasDataLabel
{
get
{
return Factory.ExecuteBoolPropertyGet(this, "HasDataLabel");
}
set
{
Factory.ExecuteValuePropertySet(this, "HasDataLabel", value);
}
}
/// <summary>
/// SupportByVersion Excel 9, 10, 11, 12, 14, 15, 16
/// Get
/// </summary>
[SupportByVersion("Excel", 9,10,11,12,14,15,16)]
public NetOffice.ExcelApi.Interior Interior
{
get
{
return Factory.ExecuteKnownReferencePropertyGet<NetOffice.ExcelApi.Interior>(this, "Interior", NetOffice.ExcelApi.Interior.LateBindingApiWrapperType);
}
}
/// <summary>
/// SupportByVersion Excel 9, 10, 11, 12, 14, 15, 16
/// Get/Set
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff821599.aspx </remarks>
[SupportByVersion("Excel", 9,10,11,12,14,15,16)]
public bool InvertIfNegative
{
get
{
return Factory.ExecuteBoolPropertyGet(this, "InvertIfNegative");
}
set
{
Factory.ExecuteValuePropertySet(this, "InvertIfNegative", value);
}
}
/// <summary>
/// SupportByVersion Excel 9, 10, 11, 12, 14, 15, 16
/// Get/Set
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff837151.aspx </remarks>
[SupportByVersion("Excel", 9,10,11,12,14,15,16)]
public Int32 MarkerBackgroundColor
{
get
{
return Factory.ExecuteInt32PropertyGet(this, "MarkerBackgroundColor");
}
set
{
Factory.ExecuteValuePropertySet(this, "MarkerBackgroundColor", value);
}
}
/// <summary>
/// SupportByVersion Excel 9, 10, 11, 12, 14, 15, 16
/// Get/Set
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff822160.aspx </remarks>
[SupportByVersion("Excel", 9,10,11,12,14,15,16)]
public NetOffice.ExcelApi.Enums.XlColorIndex MarkerBackgroundColorIndex
{
get
{
return Factory.ExecuteEnumPropertyGet<NetOffice.ExcelApi.Enums.XlColorIndex>(this, "MarkerBackgroundColorIndex");
}
set
{
Factory.ExecuteEnumPropertySet(this, "MarkerBackgroundColorIndex", value);
}
}
/// <summary>
/// SupportByVersion Excel 9, 10, 11, 12, 14, 15, 16
/// Get/Set
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff834722.aspx </remarks>
[SupportByVersion("Excel", 9,10,11,12,14,15,16)]
public Int32 MarkerForegroundColor
{
get
{
return Factory.ExecuteInt32PropertyGet(this, "MarkerForegroundColor");
}
set
{
Factory.ExecuteValuePropertySet(this, "MarkerForegroundColor", value);
}
}
/// <summary>
/// SupportByVersion Excel 9, 10, 11, 12, 14, 15, 16
/// Get/Set
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff192961.aspx </remarks>
[SupportByVersion("Excel", 9,10,11,12,14,15,16)]
public NetOffice.ExcelApi.Enums.XlColorIndex MarkerForegroundColorIndex
{
get
{
return Factory.ExecuteEnumPropertyGet<NetOffice.ExcelApi.Enums.XlColorIndex>(this, "MarkerForegroundColorIndex");
}
set
{
Factory.ExecuteEnumPropertySet(this, "MarkerForegroundColorIndex", value);
}
}
/// <summary>
/// SupportByVersion Excel 9, 10, 11, 12, 14, 15, 16
/// Get/Set
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff840526.aspx </remarks>
[SupportByVersion("Excel", 9,10,11,12,14,15,16)]
public Int32 MarkerSize
{
get
{
return Factory.ExecuteInt32PropertyGet(this, "MarkerSize");
}
set
{
Factory.ExecuteValuePropertySet(this, "MarkerSize", value);
}
}
/// <summary>
/// SupportByVersion Excel 9, 10, 11, 12, 14, 15, 16
/// Get/Set
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff836837.aspx </remarks>
[SupportByVersion("Excel", 9,10,11,12,14,15,16)]
public NetOffice.ExcelApi.Enums.XlMarkerStyle MarkerStyle
{
get
{
return Factory.ExecuteEnumPropertyGet<NetOffice.ExcelApi.Enums.XlMarkerStyle>(this, "MarkerStyle");
}
set
{
Factory.ExecuteEnumPropertySet(this, "MarkerStyle", value);
}
}
/// <summary>
/// SupportByVersion Excel 9, 10, 11, 12, 14, 15, 16
/// Get/Set
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff822477.aspx </remarks>
[SupportByVersion("Excel", 9,10,11,12,14,15,16)]
public NetOffice.ExcelApi.Enums.XlChartPictureType PictureType
{
get
{
return Factory.ExecuteEnumPropertyGet<NetOffice.ExcelApi.Enums.XlChartPictureType>(this, "PictureType");
}
set
{
Factory.ExecuteEnumPropertySet(this, "PictureType", value);
}
}
/// <summary>
/// SupportByVersion Excel 9, 10, 11, 12, 14, 15, 16
/// Get/Set
/// </summary>
[SupportByVersion("Excel", 9,10,11,12,14,15,16)]
public Int32 PictureUnit
{
get
{
return Factory.ExecuteInt32PropertyGet(this, "PictureUnit");
}
set
{
Factory.ExecuteValuePropertySet(this, "PictureUnit", value);
}
}
/// <summary>
/// SupportByVersion Excel 9, 10, 11, 12, 14, 15, 16
/// Get/Set
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff197578.aspx </remarks>
[SupportByVersion("Excel", 9,10,11,12,14,15,16)]
public bool ApplyPictToSides
{
get
{
return Factory.ExecuteBoolPropertyGet(this, "ApplyPictToSides");
}
set
{
Factory.ExecuteValuePropertySet(this, "ApplyPictToSides", value);
}
}
/// <summary>
/// SupportByVersion Excel 9, 10, 11, 12, 14, 15, 16
/// Get/Set
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff840354.aspx </remarks>
[SupportByVersion("Excel", 9,10,11,12,14,15,16)]
public bool ApplyPictToFront
{
get
{
return Factory.ExecuteBoolPropertyGet(this, "ApplyPictToFront");
}
set
{
Factory.ExecuteValuePropertySet(this, "ApplyPictToFront", value);
}
}
/// <summary>
/// SupportByVersion Excel 9, 10, 11, 12, 14, 15, 16
/// Get/Set
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff837073.aspx </remarks>
[SupportByVersion("Excel", 9,10,11,12,14,15,16)]
public bool ApplyPictToEnd
{
get
{
return Factory.ExecuteBoolPropertyGet(this, "ApplyPictToEnd");
}
set
{
Factory.ExecuteValuePropertySet(this, "ApplyPictToEnd", value);
}
}
/// <summary>
/// SupportByVersion Excel 9, 10, 11, 12, 14, 15, 16
/// Get/Set
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff195731.aspx </remarks>
[SupportByVersion("Excel", 9,10,11,12,14,15,16)]
public bool Shadow
{
get
{
return Factory.ExecuteBoolPropertyGet(this, "Shadow");
}
set
{
Factory.ExecuteValuePropertySet(this, "Shadow", value);
}
}
/// <summary>
/// SupportByVersion Excel 9, 10, 11, 12, 14, 15, 16
/// Get/Set
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff194585.aspx </remarks>
[SupportByVersion("Excel", 9,10,11,12,14,15,16)]
public bool SecondaryPlot
{
get
{
return Factory.ExecuteBoolPropertyGet(this, "SecondaryPlot");
}
set
{
Factory.ExecuteValuePropertySet(this, "SecondaryPlot", value);
}
}
/// <summary>
/// SupportByVersion Excel 9, 10, 11, 12, 14, 15, 16
/// Get
/// </summary>
[SupportByVersion("Excel", 9,10,11,12,14,15,16)]
public NetOffice.ExcelApi.ChartFillFormat Fill
{
get
{
return Factory.ExecuteKnownReferencePropertyGet<NetOffice.ExcelApi.ChartFillFormat>(this, "Fill", NetOffice.ExcelApi.ChartFillFormat.LateBindingApiWrapperType);
}
}
/// <summary>
/// SupportByVersion Excel 12, 14, 15, 16
/// Get/Set
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff193819.aspx </remarks>
[SupportByVersion("Excel", 12,14,15,16)]
public bool Has3DEffect
{
get
{
return Factory.ExecuteBoolPropertyGet(this, "Has3DEffect");
}
set
{
Factory.ExecuteValuePropertySet(this, "Has3DEffect", value);
}
}
/// <summary>
/// SupportByVersion Excel 12, 14, 15, 16
/// Get/Set
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff837811.aspx </remarks>
[SupportByVersion("Excel", 12,14,15,16)]
public Double PictureUnit2
{
get
{
return Factory.ExecuteDoublePropertyGet(this, "PictureUnit2");
}
set
{
Factory.ExecuteValuePropertySet(this, "PictureUnit2", value);
}
}
/// <summary>
/// SupportByVersion Excel 12, 14, 15, 16
/// Get
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff838220.aspx </remarks>
[SupportByVersion("Excel", 12,14,15,16)]
public NetOffice.ExcelApi.ChartFormat Format
{
get
{
return Factory.ExecuteKnownReferencePropertyGet<NetOffice.ExcelApi.ChartFormat>(this, "Format", NetOffice.ExcelApi.ChartFormat.LateBindingApiWrapperType);
}
}
/// <summary>
/// SupportByVersion Excel 14, 15, 16
/// Get
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff197526.aspx </remarks>
[SupportByVersion("Excel", 14,15,16)]
public Double Height
{
get
{
return Factory.ExecuteDoublePropertyGet(this, "Height");
}
}
/// <summary>
/// SupportByVersion Excel 14, 15, 16
/// Get
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff194694.aspx </remarks>
[SupportByVersion("Excel", 14,15,16)]
public Double Width
{
get
{
return Factory.ExecuteDoublePropertyGet(this, "Width");
}
}
/// <summary>
/// SupportByVersion Excel 14, 15, 16
/// Get
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff196265.aspx </remarks>
[SupportByVersion("Excel", 14,15,16)]
public Double Top
{
get
{
return Factory.ExecuteDoublePropertyGet(this, "Top");
}
}
/// <summary>
/// SupportByVersion Excel 14, 15, 16
/// Get
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff840149.aspx </remarks>
[SupportByVersion("Excel", 14,15,16)]
public Double Left
{
get
{
return Factory.ExecuteDoublePropertyGet(this, "Left");
}
}
/// <summary>
/// SupportByVersion Excel 14, 15, 16
/// Get
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff836193.aspx </remarks>
[SupportByVersion("Excel", 14,15,16)]
public string Name
{
get
{
return Factory.ExecuteStringPropertyGet(this, "Name");
}
}
#endregion
#region Methods
/// <summary>
/// SupportByVersion Excel 9, 10, 11, 12, 14, 15, 16
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff840828.aspx </remarks>
/// <param name="type">optional NetOffice.ExcelApi.Enums.XlDataLabelsType Type = 2</param>
/// <param name="legendKey">optional object legendKey</param>
/// <param name="autoText">optional object autoText</param>
[SupportByVersion("Excel", 9,10,11,12,14,15,16)]
public object ApplyDataLabels(object type, object legendKey, object autoText)
{
return Factory.ExecuteVariantMethodGet(this, "ApplyDataLabels", type, legendKey, autoText);
}
/// <summary>
/// SupportByVersion Excel 10, 11, 12, 14, 15, 16
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff840828.aspx </remarks>
/// <param name="type">optional NetOffice.ExcelApi.Enums.XlDataLabelsType Type = 2</param>
/// <param name="legendKey">optional object legendKey</param>
/// <param name="autoText">optional object autoText</param>
/// <param name="hasLeaderLines">optional object hasLeaderLines</param>
/// <param name="showSeriesName">optional object showSeriesName</param>
/// <param name="showCategoryName">optional object showCategoryName</param>
/// <param name="showValue">optional object showValue</param>
/// <param name="showPercentage">optional object showPercentage</param>
/// <param name="showBubbleSize">optional object showBubbleSize</param>
/// <param name="separator">optional object separator</param>
[SupportByVersion("Excel", 10,11,12,14,15,16)]
public object ApplyDataLabels(object type, object legendKey, object autoText, object hasLeaderLines, object showSeriesName, object showCategoryName, object showValue, object showPercentage, object showBubbleSize, object separator)
{
return Factory.ExecuteVariantMethodGet(this, "ApplyDataLabels", new object[]{ type, legendKey, autoText, hasLeaderLines, showSeriesName, showCategoryName, showValue, showPercentage, showBubbleSize, separator });
}
/// <summary>
/// SupportByVersion Excel 9, 10, 11, 12, 14, 15, 16
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff840828.aspx </remarks>
[CustomMethod]
[SupportByVersion("Excel", 9,10,11,12,14,15,16)]
public object ApplyDataLabels()
{
return Factory.ExecuteVariantMethodGet(this, "ApplyDataLabels");
}
/// <summary>
/// SupportByVersion Excel 9, 10, 11, 12, 14, 15, 16
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff840828.aspx </remarks>
/// <param name="type">optional NetOffice.ExcelApi.Enums.XlDataLabelsType Type = 2</param>
[CustomMethod]
[SupportByVersion("Excel", 9,10,11,12,14,15,16)]
public object ApplyDataLabels(object type)
{
return Factory.ExecuteVariantMethodGet(this, "ApplyDataLabels", type);
}
/// <summary>
/// SupportByVersion Excel 9, 10, 11, 12, 14, 15, 16
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff840828.aspx </remarks>
/// <param name="type">optional NetOffice.ExcelApi.Enums.XlDataLabelsType Type = 2</param>
/// <param name="legendKey">optional object legendKey</param>
[CustomMethod]
[SupportByVersion("Excel", 9,10,11,12,14,15,16)]
public object ApplyDataLabels(object type, object legendKey)
{
return Factory.ExecuteVariantMethodGet(this, "ApplyDataLabels", type, legendKey);
}
/// <summary>
/// SupportByVersion Excel 10, 11, 12, 14, 15, 16
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff840828.aspx </remarks>
/// <param name="type">optional NetOffice.ExcelApi.Enums.XlDataLabelsType Type = 2</param>
/// <param name="legendKey">optional object legendKey</param>
/// <param name="autoText">optional object autoText</param>
/// <param name="hasLeaderLines">optional object hasLeaderLines</param>
[CustomMethod]
[SupportByVersion("Excel", 10,11,12,14,15,16)]
public object ApplyDataLabels(object type, object legendKey, object autoText, object hasLeaderLines)
{
return Factory.ExecuteVariantMethodGet(this, "ApplyDataLabels", type, legendKey, autoText, hasLeaderLines);
}
/// <summary>
/// SupportByVersion Excel 10, 11, 12, 14, 15, 16
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff840828.aspx </remarks>
/// <param name="type">optional NetOffice.ExcelApi.Enums.XlDataLabelsType Type = 2</param>
/// <param name="legendKey">optional object legendKey</param>
/// <param name="autoText">optional object autoText</param>
/// <param name="hasLeaderLines">optional object hasLeaderLines</param>
/// <param name="showSeriesName">optional object showSeriesName</param>
[CustomMethod]
[SupportByVersion("Excel", 10,11,12,14,15,16)]
public object ApplyDataLabels(object type, object legendKey, object autoText, object hasLeaderLines, object showSeriesName)
{
return Factory.ExecuteVariantMethodGet(this, "ApplyDataLabels", new object[]{ type, legendKey, autoText, hasLeaderLines, showSeriesName });
}
/// <summary>
/// SupportByVersion Excel 10, 11, 12, 14, 15, 16
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff840828.aspx </remarks>
/// <param name="type">optional NetOffice.ExcelApi.Enums.XlDataLabelsType Type = 2</param>
/// <param name="legendKey">optional object legendKey</param>
/// <param name="autoText">optional object autoText</param>
/// <param name="hasLeaderLines">optional object hasLeaderLines</param>
/// <param name="showSeriesName">optional object showSeriesName</param>
/// <param name="showCategoryName">optional object showCategoryName</param>
[CustomMethod]
[SupportByVersion("Excel", 10,11,12,14,15,16)]
public object ApplyDataLabels(object type, object legendKey, object autoText, object hasLeaderLines, object showSeriesName, object showCategoryName)
{
return Factory.ExecuteVariantMethodGet(this, "ApplyDataLabels", new object[]{ type, legendKey, autoText, hasLeaderLines, showSeriesName, showCategoryName });
}
/// <summary>
/// SupportByVersion Excel 10, 11, 12, 14, 15, 16
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff840828.aspx </remarks>
/// <param name="type">optional NetOffice.ExcelApi.Enums.XlDataLabelsType Type = 2</param>
/// <param name="legendKey">optional object legendKey</param>
/// <param name="autoText">optional object autoText</param>
/// <param name="hasLeaderLines">optional object hasLeaderLines</param>
/// <param name="showSeriesName">optional object showSeriesName</param>
/// <param name="showCategoryName">optional object showCategoryName</param>
/// <param name="showValue">optional object showValue</param>
[CustomMethod]
[SupportByVersion("Excel", 10,11,12,14,15,16)]
public object ApplyDataLabels(object type, object legendKey, object autoText, object hasLeaderLines, object showSeriesName, object showCategoryName, object showValue)
{
return Factory.ExecuteVariantMethodGet(this, "ApplyDataLabels", new object[]{ type, legendKey, autoText, hasLeaderLines, showSeriesName, showCategoryName, showValue });
}
/// <summary>
/// SupportByVersion Excel 10, 11, 12, 14, 15, 16
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff840828.aspx </remarks>
/// <param name="type">optional NetOffice.ExcelApi.Enums.XlDataLabelsType Type = 2</param>
/// <param name="legendKey">optional object legendKey</param>
/// <param name="autoText">optional object autoText</param>
/// <param name="hasLeaderLines">optional object hasLeaderLines</param>
/// <param name="showSeriesName">optional object showSeriesName</param>
/// <param name="showCategoryName">optional object showCategoryName</param>
/// <param name="showValue">optional object showValue</param>
/// <param name="showPercentage">optional object showPercentage</param>
[CustomMethod]
[SupportByVersion("Excel", 10,11,12,14,15,16)]
public object ApplyDataLabels(object type, object legendKey, object autoText, object hasLeaderLines, object showSeriesName, object showCategoryName, object showValue, object showPercentage)
{
return Factory.ExecuteVariantMethodGet(this, "ApplyDataLabels", new object[]{ type, legendKey, autoText, hasLeaderLines, showSeriesName, showCategoryName, showValue, showPercentage });
}
/// <summary>
/// SupportByVersion Excel 10, 11, 12, 14, 15, 16
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff840828.aspx </remarks>
/// <param name="type">optional NetOffice.ExcelApi.Enums.XlDataLabelsType Type = 2</param>
/// <param name="legendKey">optional object legendKey</param>
/// <param name="autoText">optional object autoText</param>
/// <param name="hasLeaderLines">optional object hasLeaderLines</param>
/// <param name="showSeriesName">optional object showSeriesName</param>
/// <param name="showCategoryName">optional object showCategoryName</param>
/// <param name="showValue">optional object showValue</param>
/// <param name="showPercentage">optional object showPercentage</param>
/// <param name="showBubbleSize">optional object showBubbleSize</param>
[CustomMethod]
[SupportByVersion("Excel", 10,11,12,14,15,16)]
public object ApplyDataLabels(object type, object legendKey, object autoText, object hasLeaderLines, object showSeriesName, object showCategoryName, object showValue, object showPercentage, object showBubbleSize)
{
return Factory.ExecuteVariantMethodGet(this, "ApplyDataLabels", new object[]{ type, legendKey, autoText, hasLeaderLines, showSeriesName, showCategoryName, showValue, showPercentage, showBubbleSize });
}
/// <summary>
/// SupportByVersion Excel 9, 10, 11, 12, 14, 15, 16
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff197766.aspx </remarks>
[SupportByVersion("Excel", 9,10,11,12,14,15,16)]
public object ClearFormats()
{
return Factory.ExecuteVariantMethodGet(this, "ClearFormats");
}
/// <summary>
/// SupportByVersion Excel 9, 10, 11, 12, 14, 15, 16
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff194141.aspx </remarks>
[SupportByVersion("Excel", 9,10,11,12,14,15,16)]
public object Copy()
{
return Factory.ExecuteVariantMethodGet(this, "Copy");
}
/// <summary>
/// SupportByVersion Excel 9, 10, 11, 12, 14, 15, 16
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff839159.aspx </remarks>
[SupportByVersion("Excel", 9,10,11,12,14,15,16)]
public object Delete()
{
return Factory.ExecuteVariantMethodGet(this, "Delete");
}
/// <summary>
/// SupportByVersion Excel 9, 10, 11, 12, 14, 15, 16
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff193570.aspx </remarks>
[SupportByVersion("Excel", 9,10,11,12,14,15,16)]
public object Paste()
{
return Factory.ExecuteVariantMethodGet(this, "Paste");
}
/// <summary>
/// SupportByVersion Excel 9, 10, 11, 12, 14, 15, 16
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff193921.aspx </remarks>
[SupportByVersion("Excel", 9,10,11,12,14,15,16)]
public object Select()
{
return Factory.ExecuteVariantMethodGet(this, "Select");
}
/// <summary>
/// SupportByVersion Excel 11, 12, 14, 15, 16
/// </summary>
/// <param name="type">optional NetOffice.ExcelApi.Enums.XlDataLabelsType Type = 2</param>
/// <param name="legendKey">optional object legendKey</param>
/// <param name="autoText">optional object autoText</param>
/// <param name="hasLeaderLines">optional object hasLeaderLines</param>
[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
[SupportByVersion("Excel", 11,12,14,15,16)]
public object _ApplyDataLabels(object type, object legendKey, object autoText, object hasLeaderLines)
{
return Factory.ExecuteVariantMethodGet(this, "_ApplyDataLabels", type, legendKey, autoText, hasLeaderLines);
}
/// <summary>
/// SupportByVersion Excel 11, 12, 14, 15, 16
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
[CustomMethod]
[SupportByVersion("Excel", 11,12,14,15,16)]
public object _ApplyDataLabels()
{
return Factory.ExecuteVariantMethodGet(this, "_ApplyDataLabels");
}
/// <summary>
/// SupportByVersion Excel 11, 12, 14, 15, 16
/// </summary>
/// <param name="type">optional NetOffice.ExcelApi.Enums.XlDataLabelsType Type = 2</param>
[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
[CustomMethod]
[SupportByVersion("Excel", 11,12,14,15,16)]
public object _ApplyDataLabels(object type)
{
return Factory.ExecuteVariantMethodGet(this, "_ApplyDataLabels", type);
}
/// <summary>
/// SupportByVersion Excel 11, 12, 14, 15, 16
/// </summary>
/// <param name="type">optional NetOffice.ExcelApi.Enums.XlDataLabelsType Type = 2</param>
/// <param name="legendKey">optional object legendKey</param>
[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
[CustomMethod]
[SupportByVersion("Excel", 11,12,14,15,16)]
public object _ApplyDataLabels(object type, object legendKey)
{
return Factory.ExecuteVariantMethodGet(this, "_ApplyDataLabels", type, legendKey);
}
/// <summary>
/// SupportByVersion Excel 11, 12, 14, 15, 16
/// </summary>
/// <param name="type">optional NetOffice.ExcelApi.Enums.XlDataLabelsType Type = 2</param>
/// <param name="legendKey">optional object legendKey</param>
/// <param name="autoText">optional object autoText</param>
[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
[CustomMethod]
[SupportByVersion("Excel", 11,12,14,15,16)]
public object _ApplyDataLabels(object type, object legendKey, object autoText)
{
return Factory.ExecuteVariantMethodGet(this, "_ApplyDataLabels", type, legendKey, autoText);
}
/// <summary>
/// SupportByVersion Excel 14, 15, 16
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff835887.aspx </remarks>
/// <param name="loc">NetOffice.ExcelApi.Enums.XlPieSliceLocation loc</param>
/// <param name="index">optional NetOffice.ExcelApi.Enums.XlPieSliceIndex Index = 2</param>
[SupportByVersion("Excel", 14,15,16)]
public Double PieSliceLocation(NetOffice.ExcelApi.Enums.XlPieSliceLocation loc, object index)
{
return Factory.ExecuteDoubleMethodGet(this, "PieSliceLocation", loc, index);
}
/// <summary>
/// SupportByVersion Excel 14, 15, 16
/// </summary>
/// <remarks> MSDN Online: http://msdn.microsoft.com/en-us/en-us/library/office/ff835887.aspx </remarks>
/// <param name="loc">NetOffice.ExcelApi.Enums.XlPieSliceLocation loc</param>
[CustomMethod]
[SupportByVersion("Excel", 14,15,16)]
public Double PieSliceLocation(NetOffice.ExcelApi.Enums.XlPieSliceLocation loc)
{
return Factory.ExecuteDoubleMethodGet(this, "PieSliceLocation", loc);
}
#endregion
#pragma warning restore
}
}
| {
"pile_set_name": "Github"
} |
/*
* SocketProcedures.h - <port> procedures.
*
* Copyright (c) 2009 Higepon(Taro Minowa) <[email protected]>
*
* 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 above 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.
*
* 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.
*
* $Id: SocketProcedures.h 261 2008-07-25 06:16:44Z higepon $
*/
#ifndef SCHEME_SOCKET_PROCEDURES_
#define SCHEME_SOCKET_PROCEDURES_
#include "scheme.h"
namespace scheme {
Object sslSupportedPEx(VM* theVM, int argc, const Object* argv);
Object sslSocketPEx(VM* theVM, int argc, const Object* argv);
Object socketSslizeDEx(VM* theVM, int argc, const Object* argv);
Object internalMonapiMessageSendEx(VM* theVM, int argc, const Object* argv);
Object internalMonapiNameWhereisEx(VM* theVM, int argc, const Object* argv);
Object internalMonapiNameAddDEx(VM* theVM, int argc, const Object* argv);
Object internalMonapiMessageReceiveEx(VM* theVM, int argc, const Object* argv);
Object internalMonapiMessageReplyEx(VM* theVM, int argc, const Object* argv);
Object internalMonapiMessageSendReceiveEx(VM* theVM, int argc, const Object* argv);
Object internalMonapiStreamReadEx(VM* theVM, int argc, const Object* argv);
Object internalMonapiMakeStreamEx(VM* theVM, int argc, const Object* argv);
Object internalMonapiStreamWriteEx(VM* theVM, int argc, const Object* argv);
Object internalMonapiStreamHandleEx(VM* theVM, int argc, const Object* argv);
Object socketPortEx(VM* theVM, int argc, const Object* argv);
Object socketPEx(VM* theVM, int argc, const Object* argv);
Object socketAcceptEx(VM* theVM, int argc, const Object* argv);
Object makeClientSocketEx(VM* theVM, int argc, const Object* argv);
Object makeServerSocketEx(VM* theVM, int argc, const Object* argv);
Object socketRecvEx(VM* theVM, int argc, const Object* argv);
Object socketRecvDEx(VM* theVM, int argc, const Object* argv);
Object socketSendEx(VM* theVM, int argc, const Object* argv);
Object socketCloseEx(VM* theVM, int argc, const Object* argv);
Object socketShutdownEx(VM* theVM, int argc, const Object* argv);
} // namespace scheme
#endif // SCHEME_SOCKET_PROCEDURES_
| {
"pile_set_name": "Github"
} |
// Copyright 2016 Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package uuid
import (
"encoding/binary"
"fmt"
"os"
)
// A Domain represents a Version 2 domain
type Domain byte
// Domain constants for DCE Security (Version 2) UUIDs.
const (
Person = Domain(0)
Group = Domain(1)
Org = Domain(2)
)
// NewDCESecurity returns a DCE Security (Version 2) UUID.
//
// The domain should be one of Person, Group or Org.
// On a POSIX system the id should be the users UID for the Person
// domain and the users GID for the Group. The meaning of id for
// the domain Org or on non-POSIX systems is site defined.
//
// For a given domain/id pair the same token may be returned for up to
// 7 minutes and 10 seconds.
func NewDCESecurity(domain Domain, id uint32) (UUID, error) {
uuid, err := NewUUID()
if err == nil {
uuid[6] = (uuid[6] & 0x0f) | 0x20 // Version 2
uuid[9] = byte(domain)
binary.BigEndian.PutUint32(uuid[0:], id)
}
return uuid, err
}
// NewDCEPerson returns a DCE Security (Version 2) UUID in the person
// domain with the id returned by os.Getuid.
//
// NewDCESecurity(Person, uint32(os.Getuid()))
func NewDCEPerson() (UUID, error) {
return NewDCESecurity(Person, uint32(os.Getuid()))
}
// NewDCEGroup returns a DCE Security (Version 2) UUID in the group
// domain with the id returned by os.Getgid.
//
// NewDCESecurity(Group, uint32(os.Getgid()))
func NewDCEGroup() (UUID, error) {
return NewDCESecurity(Group, uint32(os.Getgid()))
}
// Domain returns the domain for a Version 2 UUID. Domains are only defined
// for Version 2 UUIDs.
func (uuid UUID) Domain() Domain {
return Domain(uuid[9])
}
// ID returns the id for a Version 2 UUID. IDs are only defined for Version 2
// UUIDs.
func (uuid UUID) ID() uint32 {
return binary.BigEndian.Uint32(uuid[0:4])
}
func (d Domain) String() string {
switch d {
case Person:
return "Person"
case Group:
return "Group"
case Org:
return "Org"
}
return fmt.Sprintf("Domain%d", int(d))
}
| {
"pile_set_name": "Github"
} |
/* Localized versions of Info.plist keys */
| {
"pile_set_name": "Github"
} |
/**
* @fileoverview Enforce return after a callback.
* @author Jamund Ferguson
* @copyright 2015 Jamund Ferguson. All rights reserved.
*/
"use strict";
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
module.exports = function(context) {
var callbacks = context.options[0] || ["callback", "cb", "next"];
//--------------------------------------------------------------------------
// Helpers
//--------------------------------------------------------------------------
/**
* Find the closest parent matching a list of types.
* @param {ASTNode} node The node whose parents we are searching
* @param {Array} types The node types to match
* @returns {ASTNode} The matched node or undefined.
*/
function findClosestParentOfType(node, types) {
if (!node.parent) {
return null;
}
if (types.indexOf(node.parent.type) === -1) {
return findClosestParentOfType(node.parent, types);
}
return node.parent;
}
/**
* Check to see if a CallExpression is in our callback list.
* @param {ASTNode} node The node to check against our callback names list.
* @returns {Boolean} Whether or not this function matches our callback name.
*/
function isCallback(node) {
return node.callee.type === "Identifier" && callbacks.indexOf(node.callee.name) > -1;
}
/**
* Determines whether or not the callback is part of a callback expression.
* @param {ASTNode} node The callback node
* @param {ASTNode} parentNode The expression node
* @returns {boolean} Whether or not this is part of a callback expression
*/
function isCallbackExpression(node, parentNode) {
// ensure the parent node exists and is an expression
if (!parentNode || parentNode.type !== "ExpressionStatement") {
return false;
}
// cb()
if (parentNode.expression === node) {
return true;
}
// special case for cb && cb() and similar
if (parentNode.expression.type === "BinaryExpression" || parentNode.expression.type === "LogicalExpression") {
if (parentNode.expression.right === node) {
return true;
}
}
}
//--------------------------------------------------------------------------
// Public
//--------------------------------------------------------------------------
return {
"CallExpression": function(node) {
// if we"re not a callback we can return
if (!isCallback(node)) {
return;
}
// find the closest block, return or loop
var closestBlock = findClosestParentOfType(node, ["BlockStatement", "ReturnStatement", "ArrowFunctionExpression"]) || {},
lastItem, parentType;
// if our parent is a return we know we're ok
if (closestBlock.type === "ReturnStatement" ) {
return;
}
// arrow functions don't always have blocks and implicitly return
if (closestBlock.type === "ArrowFunctionExpression") {
return;
}
// block statements are part of functions and most if statements
if (closestBlock.type === "BlockStatement") {
// find the last item in the block
lastItem = closestBlock.body[closestBlock.body.length - 1];
// if the callback is the last thing in a block that might be ok
if (isCallbackExpression(node, lastItem)) {
parentType = closestBlock.parent.type;
// but only if the block is part of a function
if (parentType === "FunctionExpression" ||
parentType === "FunctionDeclaration" ||
parentType === "ArrowFunctionExpression"
) {
return;
}
}
// ending a block with a return is also ok
if (lastItem.type === "ReturnStatement") {
// but only if the callback is immediately before
if (isCallbackExpression(node, closestBlock.body[closestBlock.body.length - 2])) {
return;
}
}
}
// as long as you're the child of a function at this point you should be asked to return
if (findClosestParentOfType(node, ["FunctionDeclaration", "FunctionExpression", "ArrowFunctionExpression"])) {
context.report(node, "Expected return with your callback function.");
}
}
};
};
module.exports.schema = [{
type: "array",
items: { type: "string" }
}];
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<packages></packages> | {
"pile_set_name": "Github"
} |
# Start of cdmatch.
# Save in your functions directory and autoload, then do
# compctl -x 'S[/][~][./][../]' -g '*(-/)' - \
# 'n[-1,/], s[]' -K cdmatch -S '/' -- cd pushd
#
# Completes directories for cd, pushd, ... anything which knows about cdpath.
# You do not have to include `.' in your cdpath.
#
# It works properly only if $ZSH_VERSION > 3.0-pre4. Remove `emulate -R zsh'
# for all other values of $ZSH_VERSION > 2.6-beta2. For earlier versions
# it still works if RC_EXPAND_PARAM is not set or when cdpath is empty.
emulate -R zsh
setopt localoptions
local narg pref cdp
read -nc narg
read -Ac pref
cdp=(. $cdpath)
reply=( ${^cdp}/${pref[$narg]%$2}*$2(-/DN^M:t) )
return
# End of cdmatch.
| {
"pile_set_name": "Github"
} |
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'pathname'
require 'nokogiri'
require 'uri'
class CrawlerScripts < BaseParser
def parse(request,result)
return unless result['Content-Type'].include? "text/html"
doc = Nokogiri::HTML(result.body.to_s)
doc.xpath("//script").each do |obj|
s = obj['src']
begin
hreq = urltohash('GET', s, request['uri'], nil)
insertnewpath(hreq)
rescue URI::InvalidURIError
# ignored
end
end
end
end
| {
"pile_set_name": "Github"
} |
fileFormatVersion: 2
guid: 2ef92b9ff0b9740ffb2df88d53ac4acf
timeCreated: 1521692054
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
| {
"pile_set_name": "Github"
} |
#pragma once
#include "IUnityInterface.h"
#ifndef __OBJC__
#error metal plugin is objc code.
#endif
#ifndef __clang__
#error only clang compiler is supported.
#endif
#if !__has_feature(objc_arc)
#error metal demands ARC enabled.
#endif
@class NSBundle;
@protocol MTLDevice;
@protocol MTLCommandBuffer;
@protocol MTLCommandEncoder;
@protocol MTLTexture;
struct RenderSurfaceBase;
typedef struct RenderSurfaceBase* UnityRenderBuffer;
// Should only be used on the rendering thread unless noted otherwise.
UNITY_DECLARE_INTERFACE(IUnityGraphicsMetal)
{
NSBundle* (UNITY_INTERFACE_API * MetalBundle)();
id<MTLDevice> (UNITY_INTERFACE_API * MetalDevice)();
id<MTLCommandBuffer> (UNITY_INTERFACE_API * CurrentCommandBuffer)();
// for custom rendering support there are two scenarios:
// you want to use current in-flight MTLCommandEncoder (NB: it might be nil)
id<MTLCommandEncoder> (UNITY_INTERFACE_API * CurrentCommandEncoder)();
// or you might want to create your own encoder.
// In that case you should end unity's encoder before creating your own and end yours before returning control to unity
void (UNITY_INTERFACE_API * EndCurrentCommandEncoder)();
// access to RenderBuffer's texure
// NB: you pass here *native* RenderBuffer, acquired by calling (C#) RenderBuffer.GetNativeRenderBufferPtr
// AAResolvedTextureFromRenderBuffer will return nil in case of non-AA RenderBuffer or if called for depth RenderBuffer
// StencilTextureFromRenderBuffer will return nil in case of no-stencil RenderBuffer or if called for color RenderBuffer
id<MTLTexture> (UNITY_INTERFACE_API * TextureFromRenderBuffer)(UnityRenderBuffer buffer);
id<MTLTexture> (UNITY_INTERFACE_API * AAResolvedTextureFromRenderBuffer)(UnityRenderBuffer buffer);
id<MTLTexture> (UNITY_INTERFACE_API * StencilTextureFromRenderBuffer)(UnityRenderBuffer buffer);
};
UNITY_REGISTER_INTERFACE_GUID(0x992C8EAEA95811E5ULL,0x9A62C4B5B9876117ULL,IUnityGraphicsMetal)
| {
"pile_set_name": "Github"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.