code
stringlengths 3
1.05M
| repo_name
stringlengths 4
116
| path
stringlengths 3
942
| language
stringclasses 30
values | license
stringclasses 15
values | size
int32 3
1.05M
|
|---|---|---|---|---|---|
GBS Demultiplexer
=================
Custom GBS Demultiplexer for Illumina reads
|
fstrozzi/gbs_demultiplexer
|
README.md
|
Markdown
|
mit
| 82
|
<?php
namespace Biz\File\Service\Impl;
use Biz\BaseService;
use Biz\File\Dao\UploadFileDao;
use Biz\File\Service\FileImplementor;
use AppBundle\Common\FileToolkit;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Biz\User\Service\UserService;
class LocalFileImplementorImpl extends BaseService implements FileImplementor
{
public function getFile($file)
{
$file['fullpath'] = $this->getFileFullPath($file);
$file['webpath'] = '';
return $file;
}
public function getFullFile($file)
{
return $this->getFile($file);
}
public function addFile($targetType, $targetId, array $fileInfo = array(), UploadedFile $originalFile = null)
{
$errors = FileToolkit::validateFileExtension($originalFile);
if ($errors) {
@unlink($originalFile->getRealPath());
throw $this->createServiceException('该文件格式,不允许上传。');
}
$uploadFile = array();
$uploadFile['filename'] = $originalFile->getClientOriginalName();
$uploadFile['ext'] = FileToolkit::getFileExtension($originalFile);
$uploadFile['fileSize'] = $originalFile->getSize();
$filename = FileToolkit::generateFilename($uploadFile['ext']);
$uploadFile['hashId'] = "{$uploadFile['targetType']}/{$uploadFile['targetId']}/{$filename}";
$uploadFile['convertHash'] = "ch-{$uploadFile['hashId']}";
$uploadFile['convertStatus'] = 'none';
$uploadFile['type'] = FileToolkit::getFileTypeByExtension($uploadFile['ext']);
$uploadFile['isPublic'] = empty($fileInfo['isPublic']) ? 0 : 1;
$uploadFile['canDownload'] = empty($uploadFile['canDownload']) ? 0 : 1;
$uploadFile['updatedUserId'] = $uploadFile['createdUserId'] = $this->getCurrentUser()->id;
$uploadFile['updatedTime'] = $uploadFile['createdTime'] = time();
$targetPath = $this->getFilePath($targetType, $targetId);
$originalFile->move($targetPath, $filename);
return $uploadFile;
}
public function saveConvertResult($file, array $result = array())
{
}
public function convertFile($file, $status, $result = null, $callback = null)
{
throw $this->createServiceException('本地文件暂不支持转换');
}
public function updateFile($file, $fields)
{
}
public function makeUploadParams($params)
{
$uploadParams = array();
$uploadParams['storage'] = 'local';
$uploadParams['url'] = $params['defaultUploadUrl'];
$uploadParams['postParams'] = array();
$uploadParams['postParams']['token'] = $this->getUserService()->makeToken('fileupload', $params['user'], strtotime('+ 2 hours'));
return $uploadParams;
}
public function reconvert($globalId, $options)
{
}
public function getUploadAuth($params)
{
}
public function reconvertFile($file, $convertCallback, $pipeline = null)
{
}
//LocalFileImplementorImpl2
public function findFiles($file, $conditions)
{
}
public function prepareUpload($params)
{
$file = array();
$file['filename'] = empty($params['fileName']) ? '' : $params['fileName'];
$pos = strrpos($file['filename'], '.');
$file['ext'] = empty($pos) ? '' : substr($file['filename'], $pos + 1);
$file['fileSize'] = empty($params['fileSize']) ? 0 : $params['fileSize'];
$file['status'] = 'uploading';
$file['targetId'] = $params['targetId'];
$file['targetType'] = $params['targetType'];
$file['storage'] = 'local';
$file['type'] = FileToolkit::getFileTypeByExtension($file['ext']);
$file['updatedUserId'] = empty($params['userId']) ? 0 : $params['userId'];
$file['updatedTime'] = time();
$file['createdUserId'] = $file['updatedUserId'];
$file['createdTime'] = $file['updatedTime'];
$filename = FileToolkit::generateFilename($file['ext']);
$file['hashId'] = "{$file['targetType']}/{$file['targetId']}/{$filename}";
$file['convertHash'] = "ch-{$file['hashId']}";
$file['convertStatus'] = 'none';
return $file;
}
public function moveFile($targetType, $targetId, UploadedFile $originalFile = null, $data = array())
{
$errors = FileToolkit::validateFileExtension($originalFile);
if ($errors) {
@unlink($originalFile->getRealPath());
throw $this->createServiceException('该文件格式,不允许上传。');
}
$targetPath = $this->getFilePath($targetType, $targetId);
$filename = str_replace("{$targetType}/{$targetId}/", '', $data['hashId']);
$originalFile->move($targetPath, $filename);
}
public function reconvertOldFile($file, $convertCallback, $pipeline = null)
{
return null;
}
public function finishedUpload($file, $params)
{
return array_merge(array('success' => true, 'convertStatus' => 'success'), $params);
}
public function resumeUpload($hash, $params)
{
}
public function getDownloadFile($file, $ssl = false)
{
return $file;
}
public function deleteFile($file)
{
$filename = $this->getFileFullPath($file);
@unlink($filename);
return array('success' => true);
}
public function search($conditions)
{
$start = $conditions['start'];
$limit = $conditions['limit'];
unset($conditions['start']);
unset($conditions['limit']);
return $this->getUploadFileDao()->search($conditions, array('createdTime' => 'DESC'), $start, $limit);
}
public function getFileByGlobalId($globalId)
{
}
public function initUpload($params)
{
$uploadParams = array();
$uploadParams['uploadMode'] = 'local';
$uploadParams['url'] = $this->getUploadUrl($params);
$uploadParams['postParams'] = array();
$uploadParams['postParams']['token'] = $this->getUserService()->makeToken(
'fileupload',
$params['userId'],
strtotime('+ 2 hours'),
$params
);
return $uploadParams;
}
protected function getUploadUrl($params)
{
global $kernel;
$url = $kernel->getContainer()->get('router')->generate('uploadfile_upload', $params, true);
return $url;
}
protected function getFileFullPath($file)
{
$baseDirectory = $this->biz['topxia.disk.local_directory'];
return $baseDirectory.DIRECTORY_SEPARATOR.$file['hashId'];
}
protected function getFileWebPath($file)
{
if (!$file['isPublic']) {
return '';
}
return $this->biz['topxia.upload.public_url_path'].DIRECTORY_SEPARATOR.$file['hashId'];
}
protected function getFilePath($targetType, $targetId)
{
$baseDirectory = $this->biz['topxia.disk.local_directory'];
return $baseDirectory.DIRECTORY_SEPARATOR.$targetType.DIRECTORY_SEPARATOR.$targetId;
}
/**
* only support for cloud file.
*
* @param $globalId
*
* @return array
*/
public function download($globalId)
{
return array();
}
/**
* only support for cloud file.
*
* @param $globalId
*
* @return array
*/
public function getDefaultHumbnails($globalId)
{
return array();
}
/**
* only support for cloud file.
*
* @param $globalId
* @param $options
*
* @return array
*/
public function getThumbnail($globalId, $options)
{
return array();
}
/**
* only support for cloud file.
*
* @param $options
*
* @return array
*/
public function getStatistics($options)
{
return array();
}
/**
* @param $globalId
* @param bool $ssl
*
* @deprecated only support for cloud file use CloudFileImplementorImpl
*
* @return array
*/
public function player($globalId, $ssl = false)
{
return array();
}
/**
* @return UserService
*/
protected function getUserService()
{
return $this->biz->service('User:UserService');
}
/**
* @return UploadFileDao
*/
protected function getUploadFileDao()
{
return $this->createDao('File:UploadFileDao');
}
}
|
richtermark/SMEAGOnline
|
src/Biz/File/Service/Impl/LocalFileImplementorImpl.php
|
PHP
|
mit
| 8,475
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
File name: myWirelessRouter.py
Author: xu42 <https://github.com/xu42>
Date created: 04/04/2016
Python Version: 3.5
监测某台无线设备是否接入路由器, 同时猜解当前任务
适用于 Mercury MW310R 型号的无线路由器
'''
import http.client
import base64
import re
import time
# 配置参数
# url: 路由器后台登陆地址
# port: 路由器后台登陆地址端口
# timeout: 超时
# password: 路由器后台登陆密码
# mac_address: 需要监测的设备的MAC地址
# payload: ajax请求时发送的数据, 请忽视
config = {
'url': '123.123.123.123',
'port': '80',
'timeout': 20,
'password': '123456',
'mac_address': '11:11:11:11:11:11',
'payload': '[LAN_WLAN_ASSOC_DEV#0,0,0,0,0,0#0,0,0,0,0,0]0,4\r\nAssociatedDeviceMACAddress\r\nX_TP_TotalPacketsSent\r\nX_TP_TotalPacketsReceived\r\nX_TP_HostName\r\n'
}
# 构造请求头部
def __setHeaders():
headers = {
'cookie': 'Authorization=Basic ' + base64.b64encode(config['password'].encode('utf-8')).decode('utf-8'),
'referer': config['url']
}
return headers
# 发起请求
def __initRequest():
conn = http.client.HTTPConnection(config['url'], config['port'], config['timeout'])
conn.request('POST', "/cgi?5", config['payload'], __setHeaders())
res = conn.getresponse()
if res.status != 200:
print(res.status, res.reason)
exit()
data = res.read()
conn.close()
return data.decode('utf-8')
# 解析当前接入设备和接收发送数据包量
def __getAssociatedDevice():
a = re.findall(r"=(.+?)\s", __initRequest())
# device_list = zip(a[::3], a[1::3], a[2::3])
return a
# 判断某一设备是否在线
def __isOnline(MACAddress):
device_list = __getAssociatedDevice()
try:
device_list.index(MACAddress)
return True
except ValueError:
return False
# 猜解当前在做什么
def __doWhat(MACAddress = config['mac_address']):
if __isOnline(MACAddress):
print("已连入WIFI...")
print("正在猜解当前在做...")
device_list_1 = __getAssociatedDevice()
time.sleep(10)
device_list_2 = __getAssociatedDevice()
index_1 = device_list_1.index(MACAddress)
index_2 = device_list_2.index(MACAddress)
less = int(device_list_2[index_2 + 2]) - int(device_list_1[index_1 + 2])
if less < 5:
print("10s内接收数据包:", less, ",可能连着WIFI什么也没做...")
elif less < 30:
print("10s内接收数据包:", less, ",可能聊着QQ...")
else:
print("10s内接收数据包:", less, ",可能刷微博|看视频...")
else:
print("没有连入WIFI...")
def main():
__doWhat()
if __name__ == '__main__':
main()
|
xu42/Python
|
myWirelessRouter/myWirelessRouter.py
|
Python
|
mit
| 2,628
|
<?php
namespace Orchestra\Foundation\Http\Controllers;
use Illuminate\Http\Request;
use Orchestra\Contracts\Foundation\Listener\Account\UserCreator;
use Orchestra\Contracts\Foundation\Listener\Account\UserRemover;
use Orchestra\Contracts\Foundation\Listener\Account\UserUpdater;
use Orchestra\Contracts\Foundation\Listener\Account\UserViewer;
use Orchestra\Foundation\Processors\User as Processor;
class UsersController extends AdminController implements UserCreator, UserRemover, UserUpdater, UserViewer
{
/**
* Setup controller middleware.
*
* @return void
*/
protected function onCreate()
{
$this->middleware([
'orchestra.auth',
'orchestra.can:manage-users',
]);
$this->middleware('orchestra.csrf', ['only' => 'delete']);
}
/**
* List all the users.
*
* GET (:orchestra)/users
*
* @param \Illuminate\Http\Request $request
* @param \Orchestra\Foundation\Processors\User $processor
*
* @return mixed
*/
public function index(Request $request, Processor $processor)
{
return $processor->view($this, $request->all());
}
/**
* Create a new user.
*
* GET (:orchestra)/users/create
*
* @param \Orchestra\Foundation\Processors\User $processor
*
* @return mixed
*/
public function create(Processor $processor)
{
return $processor->create($this);
}
/**
* Edit the user.
*
* GET (:orchestra)/users/$user/edit
*
* @param \Orchestra\Foundation\Processors\User $processor
* @param int|string $user
*
* @return mixed
*/
public function edit(Processor $processor, $user)
{
return $processor->edit($this, $user);
}
/**
* Create the user.
*
* POST (:orchestra)/users
*
* @param \Illuminate\Http\Request $request
* @param \Orchestra\Foundation\Processors\User $processor
*
* @return mixed
*/
public function store(Request $request, Processor $processor)
{
return $processor->store($this, $request->all());
}
/**
* Update the user.
*
* PUT (:orchestra)/users/$user
*
* @param \Illuminate\Http\Request $request
* @param \Orchestra\Foundation\Processors\User $processor
* @param int|string $user
*
* @return mixed
*/
public function update(Request $request, Processor $processor, $user)
{
return $processor->update($this, $user, $request->all());
}
/**
* Request to delete a user.
*
* GET (:orchestra)/$user/delete
*
* @param \Orchestra\Foundation\Processors\User $processor
* @param int|string $user
*
* @return mixed
*/
public function delete(Processor $processor, $user)
{
return $this->destroy($processor, $user);
}
/**
* Request to delete a user.
*
* DELETE (:orchestra)/$user
*
* @param \Orchestra\Foundation\Processors\User $processor
* @param int|string $user
*
* @return mixed
*/
public function destroy(Processor $processor, $user)
{
return $processor->destroy($this, $user);
}
/**
* Response when list users page succeed.
*
* @param array $data
*
* @return mixed
*/
public function showUsers(array $data)
{
\set_meta('title', \trans('orchestra/foundation::title.users.list'));
return \view('orchestra/foundation::users.index', $data);
}
/**
* Response when create user page succeed.
*
* @param array $data
*
* @return mixed
*/
public function showUserCreator(array $data)
{
\set_meta('title', \trans('orchestra/foundation::title.users.create'));
return \view('orchestra/foundation::users.edit', $data);
}
/**
* Response when edit user page succeed.
*
* @param array $data
*
* @return mixed
*/
public function showUserChanger(array $data)
{
\set_meta('title', \trans('orchestra/foundation::title.users.update'));
return \view('orchestra/foundation::users.edit', $data);
}
/**
* Response when storing user failed on validation.
*
* @param \Illuminate\Contracts\Support\MessageBag|array $errors
*
* @return mixed
*/
public function createUserFailedValidation($errors)
{
return $this->redirectWithErrors(handles('orchestra::users/create'), $errors);
}
/**
* Response when storing user failed.
*
* @param array $errors
*
* @return mixed
*/
public function createUserFailed(array $errors)
{
$message = \trans('orchestra/foundation::response.db-failed', $errors);
return $this->redirectWithMessage(\handles('orchestra::users'), $message, 'error');
}
/**
* Response when storing user succeed.
*
* @return mixed
*/
public function userCreated()
{
$message = \trans('orchestra/foundation::response.users.create');
return $this->redirectWithMessage(\handles('orchestra::users'), $message);
}
/**
* Response when update user failed on validation.
*
* @param \Illuminate\Contracts\Support\MessageBag|array $errors
* @param string|int $id
*
* @return mixed
*/
public function updateUserFailedValidation($errors, $id)
{
return $this->redirectWithErrors(\handles("orchestra::users/{$id}/edit"), $errors);
}
/**
* Response when updating user failed.
*
* @param array $errors
*
* @return mixed
*/
public function updateUserFailed(array $errors)
{
$message = \trans('orchestra/foundation::response.db-failed', $errors);
return $this->redirectWithMessage(\handles('orchestra::users'), $message, 'error');
}
/**
* Response when updating user succeed.
*
* @return mixed
*/
public function userUpdated()
{
$message = \trans('orchestra/foundation::response.users.update');
return $this->redirectWithMessage(\handles('orchestra::users'), $message);
}
/**
* Response when destroying user failed.
*
* @param array $errors
*
* @return mixed
*/
public function userDeletionFailed(array $errors)
{
$message = \trans('orchestra/foundation::response.db-failed', $errors);
return $this->redirectWithMessage(\handles('orchestra::users'), $message, 'error');
}
/**
* Response when destroying user succeed.
*
* @return mixed
*/
public function userDeleted()
{
$message = \trans('orchestra/foundation::response.users.delete');
return $this->redirectWithMessage(\handles('orchestra::users'), $message);
}
/**
* Response when user tried to self delete.
*
* @return mixed
*/
public function selfDeletionFailed()
{
return $this->suspend(404);
}
/**
* Response when user verification failed.
*
* @return mixed
*/
public function abortWhenUserMismatched()
{
return $this->suspend(500);
}
}
|
orchestral/foundation
|
src/Http/Controllers/UsersController.php
|
PHP
|
mit
| 7,310
|
require 'cgi'
require 'net/http'
require 'uri'
require 'yaml'
module HtmlMockup
class W3CValidator
ValidationUri = "http://validator.w3.org/check"
class RequestError < StandardError; end
attr_reader :valid,:response,:errors,:warnings,:status
class << self
def validation_uri
@uri ||= URI.parse(ValidationUri)
end
end
def initialize(html)
@html = html
end
def validate!
@status = @warnings = @errors = @response = @valid = nil
options = {"output" => "json"}
query,headers = build_post_query(options)
response = self.request(:post,self.class.validation_uri.path,query,headers)
@status,@warnings,@errors = response["x-w3c-validator-status"],response["x-w3c-validator-warnings"].to_i,response["x-w3c-validator-errors"].to_i
if @status == "Valid" && @warnings == 0 && @errors == 0
return @valid = true
else
begin
@response = YAML.load(response.body)
rescue
end
return (@valid = (@errros == 0))
end
end
protected
def build_post_query(options)
boundary = "validate-this-content-please"
headers = {"Content-type" => "multipart/form-data, boundary=" + boundary + " "}
parts = []
options.each do |k,v|
parts << post_param(k,v)
end
parts << file_param("uploaded_file","index.html",@html,"text/html")
q = parts.map{|p| "--#{boundary}\r\n#{p}"}.join("") + "--#{boundary}--"
[q,headers]
end
def post_param(k,v)
"Content-Disposition: form-data; name=\"#{CGI::escape(k)}\"\r\n\r\n#{v}\r\n"
end
def file_param(k,filename,content,mime_type)
out = []
out << "Content-Disposition: form-data; name=\"#{CGI::escape(k)}\"; filename=\"#{filename}\""
out << "Content-Transfer-Encoding: binary"
out << "Content-Type: #{mime_type}"
out.join("\r\n") + "\r\n\r\n" + content + "\r\n"
end
# Makes request to remote service.
def request(method, path, *arguments)
perform_request(method, path, arguments, 3)
end
def perform_request(method, path, arguments, tries=3)
result = nil
result = http.send(method, path, *arguments)
handle_response(result)
rescue RequestError => e
if tries > 0
perform_request(method, path, arguments, tries-1)
else
raise
end
rescue Timeout::Error => e
raise
end
# Handles response and error codes from remote service.
def handle_response(response)
case response.code.to_i
when 301,302
raise "Redirect"
when 200...400
response
when 400
raise "Bad Request"
when 401
raise "Unauthorized Access"
when 403
raise "Forbidden Access"
when 404
raise "Rescoure not found"
when 405
raise "Method not allowed"
when 409
raise RequestError.new("Rescource conflict")
when 422
raise RequestError.new("Resource invalid")
when 401...500
raise "Client error"
when 500...600
raise RequestError.new("Server error")
else
raise "Unknown response: #{response.code.to_i}"
end
end
def http
site = self.class.validation_uri
http = Net::HTTP.new(site.host, site.port)
# http.use_ssl = site.is_a?(URI::HTTPS)
# http.verify_mode = OpenSSL::SSL::VERIFY_NONE if http.use_ssl
http
end
end
end
|
DigitPaint/html_mockup
|
lib/html_mockup/w3c_validator.rb
|
Ruby
|
mit
| 3,595
|
from django.urls import path
from . import views
urlpatterns = [
path('overview/', views.overview, name='overview'),
]
|
mrts/foodbank-campaign
|
src/locations/urls.py
|
Python
|
mit
| 125
|
<div class="md"><p>Encasement was certainly not something we were expecting. It really changed our whole perspective on what exactly was occurring. We thought that the <em>flesh interfaces</em> were just like pipes that went from one location to another, perhaps extradimensionally or by some other "magic." But when the first subject came back encased, we realized that... Well, I'm not sure what we realized. We realized -- for the thousandth time in our dealings with the flesh interfaces -- that we were dealing with something really beyond us. That's why I called it 'magic.' They were so far beyond our understanding, it was basically like meddling with some kind of black magic.</p>
<p>The first subject to come back encased was an 8-year-old girl we had named Jingles. We started naming the kids dogs' names to try to depersonalize them, to assuage the guilt. This was done by the recommendation of CIA psychiatrists, but it didn't work very well. We all still felt like shit. But what choice did we have? Could we just ignore the flesh interfaces and not study them? Perhaps, but you must realize that the Soviets were also studying them. That changed the whole equation. If they... Well, the ethical issues have been debated to death. What's done is done. We dropped the bomb on Hiroshima, we gave those blankets to the Indians, and we sent those kids through those portals, and now it's all just a part of history.</p>
<p>Anyways, we sent Jingles into flesh interface and an object returned 2 minutes later, which is a pretty long time for an interface. It was a large organic sac lined with viens, vaguely resembling a human lung, about 4 feet long. We x-rayed it and saw the skeleton inside and cut it open. Sure enough, Jingles was inside, naked and covered with blood, with no hair on her head. There was an umbelical cord attached to her belly button, which was attached to a sort of placenta.</p>
<p>We had a problem with the surgeons trying to harm her. It was later realized that her blood -- its blood -- the blood from the sac, had high concentrations of an exotic LSD analogue. It was getting absorbed through the skin. The placenta was like an LSD factory, pumping out millions of doses. This particular blend made people pretty violent, so we had to put on containment suits.</p>
<p>Jingles' skin was flawless, like a newborn's. No wrinkles on the back of her neck, no wrinkles on her palms except the major ones. She had the form of an 8-year-old girl but seemed a lot... newer. We did MRIs on her bone plates, and found they were still highly undeveloped, as if she was newborn. We wondered, is this really Jingles or some kind of clone? What sort of apparatus could have possibly produced this clone, and why?</p>
<p>After a day of observation, she awoke. We weren't sure if her mind was still there. Perhaps she had been "wiped clean." So we waited, asking her questions. At first, her behavior was like that of an infant. Just smiling and gurgling and clasping her hands. It was pretty eerie seeing that kind of behavior from an 8-year-old. Really, it was pretty eerie looking at her at all. Her skin was so pure and glowing, she looked like an absolute angel. I... we... well, anyways...</p>
<p>After a while she started babbling, saying little phrases. In a matter of hours, she seemed to progress through the various stages of development, her sentence structure and awareness becoming more and more sophisticated. As soon as she could understand sentences, we started questioning her again. Who was she? She said her name. She knew her past. This wasn't just a blank clone. This may or may not have been the original girl, but she seemed to have the same mind as the original. So then we asked her the question that we wanted to know, the question that had plauged us for years, the question that had led us, in the face of all humanity and morality, to send a child into a living apparatus of death.</p>
<p>What did you see? What's on the other side?</p>
<p>Her expression grew thoughtful. She was such a thoughtful, bright girl. We chose her for her intelligence. So young and bright and we just threw her... Anyways, she thought about the question, and it seemed then that we would finally get an answer, a real answer. I remember the sense of anticipation in the room. It was like nothing I've ever felt before or since. Remember, I quit the program that day, so I was never able to question another subject. Anyways, she said to us, "Inside the chamber, I started to feel drowsy. The everything changed. And... I knew what I saw. I had seen it before. I said to myself, 'This is like the room in grammy's house. The quiet room."</p>
<p>We asked her what she meant by this. She replied with these words -- her final words before she simply stopped living and sat there dead with her eyes still on us -- she said, "Come unto these yellow sands."</p>
</div>
|
cryzed/The-Interface-Series-e-book
|
parts/_9MOTHER9HORSE9EYES9/d2en7bz.html
|
HTML
|
mit
| 5,005
|
<?php
namespace App\Http\Controllers\Asset;
use App\Http\Controllers\Controller as BaseController;
use App\Http\Requests\Asset\ManualRequest;
use App\Http\Requests\AttachmentUpdateRequest;
use App\Repositories\Asset\ManualRepository;
use App\Repositories\Asset\Repository as AssetRepository;
class ManualController extends BaseController
{
/**
* @var AssetRepository
*/
protected $asset;
/**
* Constructor.
*
* @param AssetRepository $asset
* @param ManualRepository $manual
*/
public function __construct(AssetRepository $asset, ManualRepository $manual)
{
$this->asset = $asset;
$this->manual = $manual;
}
/**
* Displays all of the specified asset manuals.
*
* @param int|string $id
*
* @return \Illuminate\View\View
*/
public function index($id)
{
$asset = $this->asset->find($id);
return view('assets.manuals.index', compact('asset'));
}
/**
* Displays the asset manual upload form.
*
* @param int|string $id
*
* @return \Illuminate\View\View
*/
public function create($id)
{
$asset = $this->asset->find($id);
return view('assets.manuals.create', compact('asset'));
}
/**
* Uploads manuals and attaches them to the specified asset.
*
* @param ManualRequest $request
* @param int|string $id
*
* @return \Illuminate\Http\RedirectResponse
*/
public function store(ManualRequest $request, $id)
{
$asset = $this->asset->find($id);
$attachments = $this->manual->upload($request, $asset, $asset->manuals());
if ($attachments) {
$message = 'Successfully uploaded files.';
return redirect()->route('maintenance.assets.manuals.index', [$asset->id])->withSuccess($message);
} else {
$message = 'There was an issue uploading the files you selected. Please try again.';
return redirect()->route('maintenance.assets.manuals.create', [$id])->withErrors($message);
}
}
/**
* Displays the asset manual.
*
* @param int|string $id
* @param int|string $manualId
*
* @return \Illuminate\View\View
*/
public function show($id, $manualId)
{
$asset = $this->asset->find($id);
$manual = $asset->manuals()->find($manualId);
if ($manual) {
return view('assets.manuals.show', compact('asset', 'manual'));
}
abort(404);
}
/**
* Displays the form for editing an uploaded manual.
*
* @param int|string $id
* @param int|string $manualId
*
* @return \Illuminate\View\View
*/
public function edit($id, $manualId)
{
$asset = $this->asset->find($id);
$manual = $asset->manuals()->find($manualId);
if ($manual) {
return view('assets.manuals.edit', compact('asset', 'manual'));
}
abort(404);
}
/**
* Updates the specified asset manual upload.
*
* @param AttachmentUpdateRequest $request
* @param int|string $id
* @param int|string $manualId
*
* @return \Illuminate\Http\RedirectResponse
*/
public function update(AttachmentUpdateRequest $request, $id, $manualId)
{
$asset = $this->asset->find($id);
$manual = $this->manual->update($request, $asset->manuals(), $manualId);
if ($manual) {
$message = 'Successfully updated manual.';
return redirect()->route('maintenance.assets.manuals.show', [$asset->id, $manual->id])->withSuccess($message);
} else {
$message = 'There was an issue updating this manual. Please try again.';
return redirect()->route('maintenance.assets.manuals.show', [$id, $manualId])->withErrors($message);
}
}
/**
* Processes deleting an attachment record and the file itself.
*
* @param int|string $id
* @param int|string $manualId
*
* @return \Illuminate\Http\RedirectResponse
*/
public function destroy($id, $manualId)
{
$asset = $this->asset->find($id);
$manual = $asset->manuals()->find($manualId);
if ($manual && $manual->delete()) {
$message = 'Successfully deleted manual.';
return redirect()->route('maintenance.assets.manuals.index', [$asset->id])->withSuccess($message);
} else {
$message = 'There was an issue deleting this manual. Please try again.';
return redirect()->route('maintenance.assets.manuals.show', [$asset->id, $manual->id])->withErrors($message);
}
}
/**
* Prompts the user to download the specified uploaded file.
*
* @param int|string $id
* @param int|string $manualId
*
* @return \Symfony\Component\HttpFoundation\BinaryFileResponse
*/
public function download($id, $manualId)
{
$asset = $this->asset->find($id);
$manual = $asset->manuals()->find($manualId);
if ($manual) {
return response()->download($manual->download_path);
}
abort(404);
}
}
|
stevebauman/maintenance
|
app/Http/Controllers/Asset/ManualController.php
|
PHP
|
mit
| 5,254
|
using System;
using System.Web.Http;
using System.Web.Http.Tracing;
namespace WebConfigTransformations
{
// TODO: To enable tracing in your application, please add the following line of code
// to your startup code (WebApiConfig.cs or Global.asax.cs in an MVC 4 project):
// TraceConfig.Register(config);
// For more information, refer to: http://www.asp.net/web-api
/// <summary>
/// This static class contains helper methods related to the registration
/// of <see cref="ITraceWriter"/> instances.
/// </summary>
public static class TraceConfig
{
/// <summary>
/// Registers the <see cref="ITraceWriter"/> implementation to use
/// for this application.
/// </summary>
/// <param name="configuration">The <see cref="HttpConfiguration"/> in which
/// to register the trace writer.</param>
public static void Register(HttpConfiguration configuration)
{
if (configuration == null)
{
throw new ArgumentNullException("configuration");
}
SystemDiagnosticsTraceWriter traceWriter =
new SystemDiagnosticsTraceWriter()
{
MinimumLevel = TraceLevel.Info,
IsVerbose = false
};
configuration.Services.Replace(typeof(ITraceWriter), traceWriter);
}
}
}
|
MicrosoftLearning/20487-DevelopingWindowsAzureAndWebServices
|
Allfiles/20487C/Mod08/DemoFiles/WebConfigTransformations/end/WebConfigTransformations/App_Start/TraceConfig.cs
|
C#
|
mit
| 1,429
|
/**********************************************************************/
/* ____ ____ */
/* / /\/ / */
/* /___/ \ / */
/* \ \ \/ */
/* \ \ Copyright (c) 2003-2009 Xilinx, Inc. */
/* / / All Right Reserved. */
/* /---/ /\ */
/* \ \ / \ */
/* \___\/\___\ */
/***********************************************************************/
/* This file is designed for use with ISim build 0x8ef4fb42 */
#define XSI_HIDE_SYMBOL_SPEC true
#include "xsi.h"
#include <memory.h>
#ifdef __GNUC__
#include <stdlib.h>
#else
#include <malloc.h>
#define alloca _alloca
#endif
static const char *ng0 = "//Mac/Github/TEOCOA/EXP3/MAIN.v";
static unsigned int ng1[] = {0U, 0U};
static unsigned int ng2[] = {1U, 0U};
static unsigned int ng3[] = {3U, 0U};
static unsigned int ng4[] = {1543U, 0U};
static unsigned int ng5[] = {2U, 0U};
static unsigned int ng6[] = {2147483648U, 0U};
static unsigned int ng7[] = {2147483647U, 0U};
static unsigned int ng8[] = {4U, 0U};
static unsigned int ng9[] = {4294967295U, 0U};
static unsigned int ng10[] = {5U, 0U};
static unsigned int ng11[] = {6U, 0U};
static unsigned int ng12[] = {7U, 0U};
static unsigned int ng13[] = {305419896U, 0U};
static unsigned int ng14[] = {858989090U, 0U};
static unsigned int ng15[] = {2596069104U, 0U};
static unsigned int ng16[] = {286335522U, 0U};
static int ng17[] = {7, 0};
static int ng18[] = {0, 0};
static int ng19[] = {6, 0};
static int ng20[] = {1, 0};
static void Always_33_0(char *t0)
{
char *t1;
char *t2;
char *t3;
char *t4;
char *t5;
int t6;
char *t7;
char *t8;
LAB0: t1 = (t0 + 1996U);
t2 = *((char **)t1);
if (t2 == 0)
goto LAB2;
LAB3: goto *t2;
LAB2: xsi_set_current_line(33, ng0);
t2 = (t0 + 2336);
*((int *)t2) = 1;
t3 = (t0 + 2024);
*((char **)t3) = t2;
*((char **)t1) = &&LAB4;
LAB1: return;
LAB4: xsi_set_current_line(34, ng0);
LAB5: xsi_set_current_line(35, ng0);
t4 = (t0 + 692U);
t5 = *((char **)t4);
LAB6: t4 = ((char*)((ng1)));
t6 = xsi_vlog_unsigned_case_compare(t5, 3, t4, 3);
if (t6 == 1)
goto LAB7;
LAB8: t2 = ((char*)((ng2)));
t6 = xsi_vlog_unsigned_case_compare(t5, 3, t2, 3);
if (t6 == 1)
goto LAB9;
LAB10: t2 = ((char*)((ng5)));
t6 = xsi_vlog_unsigned_case_compare(t5, 3, t2, 3);
if (t6 == 1)
goto LAB11;
LAB12: t2 = ((char*)((ng3)));
t6 = xsi_vlog_unsigned_case_compare(t5, 3, t2, 3);
if (t6 == 1)
goto LAB13;
LAB14: t2 = ((char*)((ng8)));
t6 = xsi_vlog_unsigned_case_compare(t5, 3, t2, 3);
if (t6 == 1)
goto LAB15;
LAB16: t2 = ((char*)((ng10)));
t6 = xsi_vlog_unsigned_case_compare(t5, 3, t2, 3);
if (t6 == 1)
goto LAB17;
LAB18: t2 = ((char*)((ng11)));
t6 = xsi_vlog_unsigned_case_compare(t5, 3, t2, 3);
if (t6 == 1)
goto LAB19;
LAB20: t2 = ((char*)((ng12)));
t6 = xsi_vlog_unsigned_case_compare(t5, 3, t2, 3);
if (t6 == 1)
goto LAB21;
LAB22:
LAB24:
LAB23: xsi_set_current_line(45, ng0);
LAB34: xsi_set_current_line(45, ng0);
t2 = ((char*)((ng15)));
t3 = (t0 + 1380);
xsi_vlogvar_assign_value(t3, t2, 0, 0, 32);
xsi_set_current_line(45, ng0);
t2 = ((char*)((ng16)));
t3 = (t0 + 1472);
xsi_vlogvar_assign_value(t3, t2, 0, 0, 32);
LAB25: goto LAB2;
LAB7: xsi_set_current_line(36, ng0);
LAB26: xsi_set_current_line(36, ng0);
t7 = ((char*)((ng1)));
t8 = (t0 + 1380);
xsi_vlogvar_assign_value(t8, t7, 0, 0, 32);
xsi_set_current_line(36, ng0);
t2 = ((char*)((ng1)));
t3 = (t0 + 1472);
xsi_vlogvar_assign_value(t3, t2, 0, 0, 32);
goto LAB25;
LAB9: xsi_set_current_line(37, ng0);
LAB27: xsi_set_current_line(37, ng0);
t3 = ((char*)((ng3)));
t4 = (t0 + 1380);
xsi_vlogvar_assign_value(t4, t3, 0, 0, 32);
xsi_set_current_line(37, ng0);
t2 = ((char*)((ng4)));
t3 = (t0 + 1472);
xsi_vlogvar_assign_value(t3, t2, 0, 0, 32);
goto LAB25;
LAB11: xsi_set_current_line(38, ng0);
LAB28: xsi_set_current_line(38, ng0);
t3 = ((char*)((ng6)));
t4 = (t0 + 1380);
xsi_vlogvar_assign_value(t4, t3, 0, 0, 32);
xsi_set_current_line(38, ng0);
t2 = ((char*)((ng6)));
t3 = (t0 + 1472);
xsi_vlogvar_assign_value(t3, t2, 0, 0, 32);
goto LAB25;
LAB13: xsi_set_current_line(39, ng0);
LAB29: xsi_set_current_line(39, ng0);
t3 = ((char*)((ng7)));
t4 = (t0 + 1380);
xsi_vlogvar_assign_value(t4, t3, 0, 0, 32);
xsi_set_current_line(39, ng0);
t2 = ((char*)((ng7)));
t3 = (t0 + 1472);
xsi_vlogvar_assign_value(t3, t2, 0, 0, 32);
goto LAB25;
LAB15: xsi_set_current_line(40, ng0);
LAB30: xsi_set_current_line(40, ng0);
t3 = ((char*)((ng9)));
t4 = (t0 + 1380);
xsi_vlogvar_assign_value(t4, t3, 0, 0, 32);
xsi_set_current_line(40, ng0);
t2 = ((char*)((ng9)));
t3 = (t0 + 1472);
xsi_vlogvar_assign_value(t3, t2, 0, 0, 32);
goto LAB25;
LAB17: xsi_set_current_line(41, ng0);
LAB31: xsi_set_current_line(41, ng0);
t3 = ((char*)((ng6)));
t4 = (t0 + 1380);
xsi_vlogvar_assign_value(t4, t3, 0, 0, 32);
xsi_set_current_line(41, ng0);
t2 = ((char*)((ng9)));
t3 = (t0 + 1472);
xsi_vlogvar_assign_value(t3, t2, 0, 0, 32);
goto LAB25;
LAB19: xsi_set_current_line(42, ng0);
LAB32: xsi_set_current_line(42, ng0);
t3 = ((char*)((ng9)));
t4 = (t0 + 1380);
xsi_vlogvar_assign_value(t4, t3, 0, 0, 32);
xsi_set_current_line(42, ng0);
t2 = ((char*)((ng6)));
t3 = (t0 + 1472);
xsi_vlogvar_assign_value(t3, t2, 0, 0, 32);
goto LAB25;
LAB21: xsi_set_current_line(43, ng0);
LAB33: xsi_set_current_line(43, ng0);
t3 = ((char*)((ng13)));
t4 = (t0 + 1380);
xsi_vlogvar_assign_value(t4, t3, 0, 0, 32);
xsi_set_current_line(43, ng0);
t2 = ((char*)((ng14)));
t3 = (t0 + 1472);
xsi_vlogvar_assign_value(t3, t2, 0, 0, 32);
goto LAB25;
}
static void Always_58_1(char *t0)
{
char t7[8];
char t18[8];
char t19[8];
char *t1;
char *t2;
char *t3;
char *t4;
char *t5;
int t6;
char *t8;
char *t9;
char *t10;
unsigned int t11;
unsigned int t12;
unsigned int t13;
unsigned int t14;
unsigned int t15;
unsigned int t16;
char *t17;
char *t20;
char *t21;
int t22;
int t23;
char *t24;
int t25;
int t26;
int t27;
int t28;
int t29;
LAB0: t1 = (t0 + 2140U);
t2 = *((char **)t1);
if (t2 == 0)
goto LAB2;
LAB3: goto *t2;
LAB2: xsi_set_current_line(58, ng0);
t2 = (t0 + 2344);
*((int *)t2) = 1;
t3 = (t0 + 2168);
*((char **)t3) = t2;
*((char **)t1) = &&LAB4;
LAB1: return;
LAB4: xsi_set_current_line(59, ng0);
LAB5: xsi_set_current_line(60, ng0);
t4 = (t0 + 784U);
t5 = *((char **)t4);
LAB6: t4 = ((char*)((ng1)));
t6 = xsi_vlog_unsigned_case_compare(t5, 3, t4, 3);
if (t6 == 1)
goto LAB7;
LAB8: t2 = ((char*)((ng2)));
t6 = xsi_vlog_unsigned_case_compare(t5, 3, t2, 3);
if (t6 == 1)
goto LAB9;
LAB10: t2 = ((char*)((ng5)));
t6 = xsi_vlog_unsigned_case_compare(t5, 3, t2, 3);
if (t6 == 1)
goto LAB11;
LAB12: t2 = ((char*)((ng3)));
t6 = xsi_vlog_unsigned_case_compare(t5, 3, t2, 3);
if (t6 == 1)
goto LAB13;
LAB14:
LAB16:
LAB15: xsi_set_current_line(65, ng0);
LAB22: xsi_set_current_line(65, ng0);
t2 = (t0 + 968U);
t3 = *((char **)t2);
t2 = (t0 + 1288);
t4 = (t0 + 1288);
t8 = (t4 + 44U);
t9 = *((char **)t8);
t10 = ((char*)((ng17)));
xsi_vlog_generic_convert_bit_index(t7, t9, 2, t10, 32, 1);
t17 = (t7 + 4);
t11 = *((unsigned int *)t17);
t6 = (!(t11));
if (t6 == 1)
goto LAB23;
LAB24: xsi_set_current_line(65, ng0);
t2 = (t0 + 1060U);
t3 = *((char **)t2);
t2 = (t0 + 1288);
t4 = (t0 + 1288);
t8 = (t4 + 44U);
t9 = *((char **)t8);
t10 = ((char*)((ng18)));
xsi_vlog_generic_convert_bit_index(t7, t9, 2, t10, 32, 1);
t17 = (t7 + 4);
t11 = *((unsigned int *)t17);
t6 = (!(t11));
if (t6 == 1)
goto LAB25;
LAB26: xsi_set_current_line(65, ng0);
t2 = ((char*)((ng1)));
t3 = (t0 + 1288);
t4 = (t0 + 1288);
t8 = (t4 + 44U);
t9 = *((char **)t8);
t10 = ((char*)((ng19)));
t17 = ((char*)((ng20)));
xsi_vlog_convert_partindices(t7, t18, t19, ((int*)(t9)), 2, t10, 32, 1, t17, 32, 1);
t20 = (t7 + 4);
t11 = *((unsigned int *)t20);
t6 = (!(t11));
t21 = (t18 + 4);
t12 = *((unsigned int *)t21);
t22 = (!(t12));
t23 = (t6 && t22);
t24 = (t19 + 4);
t13 = *((unsigned int *)t24);
t25 = (!(t13));
t26 = (t23 && t25);
if (t26 == 1)
goto LAB27;
LAB28:
LAB17: goto LAB2;
LAB7: xsi_set_current_line(61, ng0);
LAB18: xsi_set_current_line(61, ng0);
t8 = (t0 + 876U);
t9 = *((char **)t8);
memset(t7, 0, 8);
t8 = (t7 + 4);
t10 = (t9 + 4);
t11 = *((unsigned int *)t9);
t12 = (t11 >> 0);
*((unsigned int *)t7) = t12;
t13 = *((unsigned int *)t10);
t14 = (t13 >> 0);
*((unsigned int *)t8) = t14;
t15 = *((unsigned int *)t7);
*((unsigned int *)t7) = (t15 & 255U);
t16 = *((unsigned int *)t8);
*((unsigned int *)t8) = (t16 & 255U);
t17 = (t0 + 1288);
xsi_vlogvar_assign_value(t17, t7, 0, 0, 8);
goto LAB17;
LAB9: xsi_set_current_line(62, ng0);
LAB19: xsi_set_current_line(62, ng0);
t3 = (t0 + 876U);
t4 = *((char **)t3);
memset(t7, 0, 8);
t3 = (t7 + 4);
t8 = (t4 + 4);
t11 = *((unsigned int *)t4);
t12 = (t11 >> 8);
*((unsigned int *)t7) = t12;
t13 = *((unsigned int *)t8);
t14 = (t13 >> 8);
*((unsigned int *)t3) = t14;
t15 = *((unsigned int *)t7);
*((unsigned int *)t7) = (t15 & 255U);
t16 = *((unsigned int *)t3);
*((unsigned int *)t3) = (t16 & 255U);
t9 = (t0 + 1288);
xsi_vlogvar_assign_value(t9, t7, 0, 0, 8);
goto LAB17;
LAB11: xsi_set_current_line(63, ng0);
LAB20: xsi_set_current_line(63, ng0);
t3 = (t0 + 876U);
t4 = *((char **)t3);
memset(t7, 0, 8);
t3 = (t7 + 4);
t8 = (t4 + 4);
t11 = *((unsigned int *)t4);
t12 = (t11 >> 16);
*((unsigned int *)t7) = t12;
t13 = *((unsigned int *)t8);
t14 = (t13 >> 16);
*((unsigned int *)t3) = t14;
t15 = *((unsigned int *)t7);
*((unsigned int *)t7) = (t15 & 255U);
t16 = *((unsigned int *)t3);
*((unsigned int *)t3) = (t16 & 255U);
t9 = (t0 + 1288);
xsi_vlogvar_assign_value(t9, t7, 0, 0, 8);
goto LAB17;
LAB13: xsi_set_current_line(64, ng0);
LAB21: xsi_set_current_line(64, ng0);
t3 = (t0 + 876U);
t4 = *((char **)t3);
memset(t7, 0, 8);
t3 = (t7 + 4);
t8 = (t4 + 4);
t11 = *((unsigned int *)t4);
t12 = (t11 >> 24);
*((unsigned int *)t7) = t12;
t13 = *((unsigned int *)t8);
t14 = (t13 >> 24);
*((unsigned int *)t3) = t14;
t15 = *((unsigned int *)t7);
*((unsigned int *)t7) = (t15 & 255U);
t16 = *((unsigned int *)t3);
*((unsigned int *)t3) = (t16 & 255U);
t9 = (t0 + 1288);
xsi_vlogvar_assign_value(t9, t7, 0, 0, 8);
goto LAB17;
LAB23: xsi_vlogvar_assign_value(t2, t3, 0, *((unsigned int *)t7), 1);
goto LAB24;
LAB25: xsi_vlogvar_assign_value(t2, t3, 0, *((unsigned int *)t7), 1);
goto LAB26;
LAB27: t14 = *((unsigned int *)t19);
t27 = (t14 + 0);
t15 = *((unsigned int *)t7);
t16 = *((unsigned int *)t18);
t28 = (t15 - t16);
t29 = (t28 + 1);
xsi_vlogvar_assign_value(t3, t2, t27, *((unsigned int *)t18), t29);
goto LAB28;
}
extern void work_m_00000000002550268797_0664496283_init()
{
static char *pe[] = {(void *)Always_33_0,(void *)Always_58_1};
xsi_register_didat("work_m_00000000002550268797_0664496283", "isim/TEST_isim_beh.exe.sim/work/m_00000000002550268797_0664496283.didat");
xsi_register_executes(pe);
}
|
iAklis/teoca
|
EXP3/isim/TEST_isim_beh.exe.sim/work/m_00000000002550268797_0664496283.c
|
C
|
mit
| 12,937
|
#include "askpassphrasedialog.h"
#include "ui_askpassphrasedialog.h"
#include "guiconstants.h"
#include "walletmodel.h"
#include <QMessageBox>
#include <QPushButton>
#include <QKeyEvent>
AskPassphraseDialog::AskPassphraseDialog(Mode mode, QWidget *parent) :
QDialog(parent),
ui(new Ui::AskPassphraseDialog),
mode(mode),
model(0),
fCapsLock(false)
{
ui->setupUi(this);
ui->passEdit1->setMaxLength(MAX_PASSPHRASE_SIZE);
ui->passEdit2->setMaxLength(MAX_PASSPHRASE_SIZE);
ui->passEdit3->setMaxLength(MAX_PASSPHRASE_SIZE);
// Setup Caps Lock detection.
ui->passEdit1->installEventFilter(this);
ui->passEdit2->installEventFilter(this);
ui->passEdit3->installEventFilter(this);
switch(mode)
{
case Encrypt: // Ask passphrase x2
ui->passLabel1->hide();
ui->passEdit1->hide();
ui->warningLabel->setText(tr("Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>."));
setWindowTitle(tr("Encrypt wallet"));
break;
case Unlock: // Ask passphrase
ui->warningLabel->setText(tr("This operation needs your wallet passphrase to unlock the wallet."));
ui->passLabel2->hide();
ui->passEdit2->hide();
ui->passLabel3->hide();
ui->passEdit3->hide();
setWindowTitle(tr("Unlock wallet"));
break;
case Decrypt: // Ask passphrase
ui->warningLabel->setText(tr("This operation needs your wallet passphrase to decrypt the wallet."));
ui->passLabel2->hide();
ui->passEdit2->hide();
ui->passLabel3->hide();
ui->passEdit3->hide();
setWindowTitle(tr("Decrypt wallet"));
break;
case ChangePass: // Ask old passphrase + new passphrase x2
setWindowTitle(tr("Change passphrase"));
ui->warningLabel->setText(tr("Enter the old and new passphrase to the wallet."));
break;
}
textChanged();
connect(ui->passEdit1, SIGNAL(textChanged(QString)), this, SLOT(textChanged()));
connect(ui->passEdit2, SIGNAL(textChanged(QString)), this, SLOT(textChanged()));
connect(ui->passEdit3, SIGNAL(textChanged(QString)), this, SLOT(textChanged()));
}
AskPassphraseDialog::~AskPassphraseDialog()
{
// Attempt to overwrite text so that they do not linger around in memory
ui->passEdit1->setText(QString(" ").repeated(ui->passEdit1->text().size()));
ui->passEdit2->setText(QString(" ").repeated(ui->passEdit2->text().size()));
ui->passEdit3->setText(QString(" ").repeated(ui->passEdit3->text().size()));
delete ui;
}
void AskPassphraseDialog::setModel(WalletModel *model)
{
this->model = model;
}
void AskPassphraseDialog::accept()
{
SecureString oldpass, newpass1, newpass2;
if(!model)
return;
oldpass.reserve(MAX_PASSPHRASE_SIZE);
newpass1.reserve(MAX_PASSPHRASE_SIZE);
newpass2.reserve(MAX_PASSPHRASE_SIZE);
// TODO: get rid of this .c_str() by implementing SecureString::operator=(std::string)
// Alternately, find a way to make this input mlock()'d to begin with.
oldpass.assign(ui->passEdit1->text().toStdString().c_str());
newpass1.assign(ui->passEdit2->text().toStdString().c_str());
newpass2.assign(ui->passEdit3->text().toStdString().c_str());
switch(mode)
{
case Encrypt: {
if(newpass1.empty() || newpass2.empty())
{
// Cannot encrypt with empty passphrase
break;
}
QMessageBox::StandardButton retval = QMessageBox::question(this, tr("Confirm wallet encryption"),
tr("WARNING: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR SMALLCHANGE</b>!\nAre you sure you wish to encrypt your wallet?"),
QMessageBox::Yes|QMessageBox::Cancel,
QMessageBox::Cancel);
if(retval == QMessageBox::Yes)
{
if(newpass1 == newpass2)
{
if(model->setWalletEncrypted(true, newpass1))
{
QMessageBox::warning(this, tr("Wallet encrypted"),
tr("TopCoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your smallchange from being stolen by malware infecting your computer."));
QApplication::quit();
}
else
{
QMessageBox::critical(this, tr("Wallet encryption failed"),
tr("Wallet encryption failed due to an internal error. Your wallet was not encrypted."));
}
QDialog::accept(); // Success
}
else
{
QMessageBox::critical(this, tr("Wallet encryption failed"),
tr("The supplied passphrases do not match."));
}
}
else
{
QDialog::reject(); // Cancelled
}
} break;
case Unlock:
if(!model->setWalletLocked(false, oldpass))
{
QMessageBox::critical(this, tr("Wallet unlock failed"),
tr("The passphrase entered for the wallet decryption was incorrect."));
}
else
{
QDialog::accept(); // Success
}
break;
case Decrypt:
if(!model->setWalletEncrypted(false, oldpass))
{
QMessageBox::critical(this, tr("Wallet decryption failed"),
tr("The passphrase entered for the wallet decryption was incorrect."));
}
else
{
QDialog::accept(); // Success
}
break;
case ChangePass:
if(newpass1 == newpass2)
{
if(model->changePassphrase(oldpass, newpass1))
{
QMessageBox::information(this, tr("Wallet encrypted"),
tr("Wallet passphrase was successfully changed."));
QDialog::accept(); // Success
}
else
{
QMessageBox::critical(this, tr("Wallet encryption failed"),
tr("The passphrase entered for the wallet decryption was incorrect."));
}
}
else
{
QMessageBox::critical(this, tr("Wallet encryption failed"),
tr("The supplied passphrases do not match."));
}
break;
}
}
void AskPassphraseDialog::textChanged()
{
// Validate input, set Ok button to enabled when accepable
bool acceptable = false;
switch(mode)
{
case Encrypt: // New passphrase x2
acceptable = !ui->passEdit2->text().isEmpty() && !ui->passEdit3->text().isEmpty();
break;
case Unlock: // Old passphrase x1
case Decrypt:
acceptable = !ui->passEdit1->text().isEmpty();
break;
case ChangePass: // Old passphrase x1, new passphrase x2
acceptable = !ui->passEdit1->text().isEmpty() && !ui->passEdit2->text().isEmpty() && !ui->passEdit3->text().isEmpty();
break;
}
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(acceptable);
}
bool AskPassphraseDialog::event(QEvent *event)
{
// Detect Caps Lock key press.
if (event->type() == QEvent::KeyPress) {
QKeyEvent *ke = static_cast<QKeyEvent *>(event);
if (ke->key() == Qt::Key_CapsLock) {
fCapsLock = !fCapsLock;
}
if (fCapsLock) {
ui->capsLabel->setText(tr("Warning: The Caps Lock key is on."));
} else {
ui->capsLabel->clear();
}
}
return QWidget::event(event);
}
bool AskPassphraseDialog::eventFilter(QObject *, QEvent *event)
{
/* Detect Caps Lock.
* There is no good OS-independent way to check a key state in Qt, but we
* can detect Caps Lock by checking for the following condition:
* Shift key is down and the result is a lower case character, or
* Shift key is not down and the result is an upper case character.
*/
if (event->type() == QEvent::KeyPress) {
QKeyEvent *ke = static_cast<QKeyEvent *>(event);
QString str = ke->text();
if (str.length() != 0) {
const QChar *psz = str.unicode();
bool fShift = (ke->modifiers() & Qt::ShiftModifier) != 0;
if ((fShift && psz->isLower()) || (!fShift && psz->isUpper())) {
fCapsLock = true;
ui->capsLabel->setText(tr("Warning: The Caps Lock key is on."));
} else if (psz->isLetter()) {
fCapsLock = false;
ui->capsLabel->clear();
}
}
}
return false;
}
|
topcoin/topcoin
|
src/qt/askpassphrasedialog.cpp
|
C++
|
mit
| 8,937
|
import React, { createElement, forwardRef, useRef, useState } from 'react';
import { decorate, observable } from 'mobx';
import { observer, useObserver } from 'mobx-react';
import 'mobx-react-lite/batchingForReactDom';
class Todo {
constructor() {
this.id = Math.random();
this.title = 'initial';
this.finished = false;
}
}
decorate(Todo, {
title: observable,
finished: observable
});
const Forward = observer(
// eslint-disable-next-line react/display-name
forwardRef(({ todo }, ref) => {
return (
<p ref={ref}>
Forward: "{todo.title}" {'' + todo.finished}
</p>
);
})
);
const todo = new Todo();
const TodoView = observer(({ todo }) => {
return (
<p>
Todo View: "{todo.title}" {'' + todo.finished}
</p>
);
});
const HookView = ({ todo }) => {
return useObserver(() => {
return (
<p>
Todo View: "{todo.title}" {'' + todo.finished}
</p>
);
});
};
export function MobXDemo() {
const ref = useRef(null);
let [v, set] = useState(0);
const success = ref.current && ref.current.nodeName === 'P';
return (
<div>
<input
type="text"
placeholder="type here..."
onInput={e => {
todo.title = e.target.value;
set(v + 1);
}}
/>
<p>
<b style={`color: ${success ? 'green' : 'red'}`}>
{success ? 'SUCCESS' : 'FAIL'}
</b>
</p>
<TodoView todo={todo} />
<Forward todo={todo} ref={ref} />
<HookView todo={todo} />
</div>
);
}
|
developit/preact
|
demo/mobx.js
|
JavaScript
|
mit
| 1,434
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_24) on Mon Apr 01 21:56:39 EDT 2013 -->
<TITLE>
TraceExpression (ATG Java API)
</TITLE>
<META NAME="date" CONTENT="2013-04-01">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="TraceExpression (ATG Java API)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../atg/search/routing/command/search/Trace.html" title="class in atg.search.routing.command.search"><B>PREV CLASS</B></A>
<A HREF="../../../../../atg/search/routing/command/search/TreeQueryRequest.html" title="class in atg.search.routing.command.search"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?atg/search/routing/command/search/TraceExpression.html" target="_top"><B>FRAMES</B></A>
<A HREF="TraceExpression.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
atg.search.routing.command.search</FONT>
<BR>
Class TraceExpression</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../../../resources/inherit.gif" ALT="extended by ">atg.search.routing.command.SearchXMLObject
<IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>atg.search.routing.command.search.TraceExpression</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD>java.io.Serializable</DD>
</DL>
<HR>
<DL>
<DT><PRE>public class <B>TraceExpression</B><DT>extends atg.search.routing.command.SearchXMLObject</DL>
</PRE>
<P>
An expression that determines which items should be traced. One of URL, HDoc, or Property is required.
If sending HDocs to a multi-partition index, then the HDoc must include the content id. See <A HREF="../../../../../atg/search/routing/command/search/TraceExpression.html#addHDoc(atg.search.routing.command.search.HDoc)"><CODE>addHDoc(HDoc)</CODE></A>
<P>
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../serialized-form.html#atg.search.routing.command.search.TraceExpression">Serialized Form</A></DL>
<HR>
<P>
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Field Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../atg/search/routing/command/search/TraceExpression.html#CLASS_VERSION">CLASS_VERSION</A></B></CODE>
<BR>
Class version string</TD>
</TR>
</TABLE>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../atg/search/routing/command/search/TraceExpression.html#TraceExpression()">TraceExpression</A></B>()</CODE>
<BR>
</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected static <A HREF="../../../../../atg/search/routing/command/search/TraceExpression.html" title="class in atg.search.routing.command.search">TraceExpression</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../atg/search/routing/command/search/TraceExpression.html#fromXmlParser(atg.search.routing.utils.SearchMessageNode)">fromXmlParser</A></B>(atg.search.routing.utils.SearchMessageNode xml)</CODE>
<BR>
creates a new TraceExpression from the xml parser</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.util.List<<A HREF="../../../../../atg/search/routing/command/search/HDoc.html" title="class in atg.search.routing.command.search">HDoc</A>></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../atg/search/routing/command/search/TraceExpression.html#getHDocs()">getHDocs</A></B>()</CODE>
<BR>
Returns the List of HDocs</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.util.List<<A HREF="../../../../../atg/search/routing/command/search/IndexedItemProperty.html" title="class in atg.search.routing.command.search">IndexedItemProperty</A>></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../atg/search/routing/command/search/TraceExpression.html#getProperties()">getProperties</A></B>()</CODE>
<BR>
Returns the List of property names and values</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../atg/search/routing/command/search/TraceExpression.html#getRequestTag()">getRequestTag</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.util.List<java.lang.String></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../atg/search/routing/command/search/TraceExpression.html#getUrls()">getUrls</A></B>()</CODE>
<BR>
Returns the list of urls</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../atg/search/routing/command/search/TraceExpression.html#setHDocs(java.util.List)">setHDocs</A></B>(java.util.List<<A HREF="../../../../../atg/search/routing/command/search/HDoc.html" title="class in atg.search.routing.command.search">HDoc</A>> pHDocs)</CODE>
<BR>
Sets the List of HDocs</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../atg/search/routing/command/search/TraceExpression.html#setProperties(java.util.List)">setProperties</A></B>(java.util.List<<A HREF="../../../../../atg/search/routing/command/search/IndexedItemProperty.html" title="class in atg.search.routing.command.search">IndexedItemProperty</A>> pProperties)</CODE>
<BR>
Sets the List of property names and values</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../atg/search/routing/command/search/TraceExpression.html#setUrls(java.util.List)">setUrls</A></B>(java.util.List<java.lang.String> pUrls)</CODE>
<BR>
Sets the list of urls</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../atg/search/routing/command/search/TraceExpression.html#setXml(java.lang.String)">setXml</A></B>(java.lang.String pXml)</CODE>
<BR>
Sets the xml from a string, even if the root element is not the trace expression.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../atg/search/routing/command/search/TraceExpression.html#toString()">toString</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../atg/search/routing/command/search/TraceExpression.html#toXML()">toXML</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="../../../../../atg/search/routing/command/search/TraceExpression.html" title="class in atg.search.routing.command.search">TraceExpression</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../atg/search/routing/command/search/TraceExpression.html#valueOf(java.lang.String)">valueOf</A></B>(java.lang.String pXml)</CODE>
<BR>
parses trace expression xml and returns a populated TraceExpression</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_atg.search.routing.command.SearchXMLObject"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class atg.search.routing.command.SearchXMLObject</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>appendComplexXml, appendOptionalAttr, appendOptionalElem, appendOptionalElem, appendOptionalElem, appendOptionalValue, appendRequiredAttr, appendRequiredElem, appendRequiredElem, appendRequiredValue, getAllAttributeXML, getAllBodyXML, getAttributeXML, getBodyXML, getDefaultXmlBytes, getParentXMLObject, getXmlPath, isPrintedFirstChild, setParentXMLObject, setPrintedFirstChild, toXML</CODE></TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<A NAME="field_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Field Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="CLASS_VERSION"><!-- --></A><H3>
CLASS_VERSION</H3>
<PRE>
public static java.lang.String <B>CLASS_VERSION</B></PRE>
<DL>
<DD>Class version string
<P>
<DL>
</DL>
</DL>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="TraceExpression()"><!-- --></A><H3>
TraceExpression</H3>
<PRE>
public <B>TraceExpression</B>()</PRE>
<DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="getHDocs()"><!-- --></A><H3>
getHDocs</H3>
<PRE>
public java.util.List<<A HREF="../../../../../atg/search/routing/command/search/HDoc.html" title="class in atg.search.routing.command.search">HDoc</A>> <B>getHDocs</B>()</PRE>
<DL>
<DD>Returns the List of HDocs
<P>
<DD><DL>
<DT><B>Returns:</B><DD>List of HDocs</DL>
</DD>
</DL>
<HR>
<A NAME="setHDocs(java.util.List)"><!-- --></A><H3>
setHDocs</H3>
<PRE>
public void <B>setHDocs</B>(java.util.List<<A HREF="../../../../../atg/search/routing/command/search/HDoc.html" title="class in atg.search.routing.command.search">HDoc</A>> pHDocs)</PRE>
<DL>
<DD>Sets the List of HDocs
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>pHDocs</CODE> - list of HDocs</DL>
</DD>
</DL>
<HR>
<A NAME="getUrls()"><!-- --></A><H3>
getUrls</H3>
<PRE>
public java.util.List<java.lang.String> <B>getUrls</B>()</PRE>
<DL>
<DD>Returns the list of urls
<P>
<DD><DL>
<DT><B>Returns:</B><DD>list of urls</DL>
</DD>
</DL>
<HR>
<A NAME="setUrls(java.util.List)"><!-- --></A><H3>
setUrls</H3>
<PRE>
public void <B>setUrls</B>(java.util.List<java.lang.String> pUrls)</PRE>
<DL>
<DD>Sets the list of urls
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>pUrls</CODE> - list of urls</DL>
</DD>
</DL>
<HR>
<A NAME="getProperties()"><!-- --></A><H3>
getProperties</H3>
<PRE>
public java.util.List<<A HREF="../../../../../atg/search/routing/command/search/IndexedItemProperty.html" title="class in atg.search.routing.command.search">IndexedItemProperty</A>> <B>getProperties</B>()</PRE>
<DL>
<DD>Returns the List of property names and values
<P>
<DD><DL>
<DT><B>Returns:</B><DD>List of property names and values</DL>
</DD>
</DL>
<HR>
<A NAME="setProperties(java.util.List)"><!-- --></A><H3>
setProperties</H3>
<PRE>
public void <B>setProperties</B>(java.util.List<<A HREF="../../../../../atg/search/routing/command/search/IndexedItemProperty.html" title="class in atg.search.routing.command.search">IndexedItemProperty</A>> pProperties)</PRE>
<DL>
<DD>Sets the List of property names and values
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>pProperties</CODE> - name and value list</DL>
</DD>
</DL>
<HR>
<A NAME="toXML()"><!-- --></A><H3>
toXML</H3>
<PRE>
public java.lang.String <B>toXML</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE>toXML</CODE> in class <CODE>atg.search.routing.command.SearchXMLObject</CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="valueOf(java.lang.String)"><!-- --></A><H3>
valueOf</H3>
<PRE>
public static <A HREF="../../../../../atg/search/routing/command/search/TraceExpression.html" title="class in atg.search.routing.command.search">TraceExpression</A> <B>valueOf</B>(java.lang.String pXml)</PRE>
<DL>
<DD>parses trace expression xml and returns a populated TraceExpression
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>pXml</CODE> - well-formed and decoded xml
<DT><B>Returns:</B><DD>a populated TraceExpression, or null if the input is null or empty</DL>
</DD>
</DL>
<HR>
<A NAME="fromXmlParser(atg.search.routing.utils.SearchMessageNode)"><!-- --></A><H3>
fromXmlParser</H3>
<PRE>
protected static <A HREF="../../../../../atg/search/routing/command/search/TraceExpression.html" title="class in atg.search.routing.command.search">TraceExpression</A> <B>fromXmlParser</B>(atg.search.routing.utils.SearchMessageNode xml)</PRE>
<DL>
<DD>creates a new TraceExpression from the xml parser
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>xml</CODE> - an xml parser
<DT><B>Returns:</B><DD>a new TraceExpression initialized from the parser</DL>
</DD>
</DL>
<HR>
<A NAME="setXml(java.lang.String)"><!-- --></A><H3>
setXml</H3>
<PRE>
public void <B>setXml</B>(java.lang.String pXml)</PRE>
<DL>
<DD>Sets the xml from a string, even if the root element is not the trace expression.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>pXml</CODE> - the xml</DL>
</DD>
</DL>
<HR>
<A NAME="toString()"><!-- --></A><H3>
toString</H3>
<PRE>
public java.lang.String <B>toString</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE>toString</CODE> in class <CODE>atg.search.routing.command.SearchXMLObject</CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getRequestTag()"><!-- --></A><H3>
getRequestTag</H3>
<PRE>
public java.lang.String <B>getRequestTag</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE>getRequestTag</CODE> in class <CODE>atg.search.routing.command.SearchXMLObject</CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../atg/search/routing/command/search/Trace.html" title="class in atg.search.routing.command.search"><B>PREV CLASS</B></A>
<A HREF="../../../../../atg/search/routing/command/search/TreeQueryRequest.html" title="class in atg.search.routing.command.search"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?atg/search/routing/command/search/TraceExpression.html" target="_top"><B>FRAMES</B></A>
<A HREF="TraceExpression.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>
|
Smolations/more-dash-docsets
|
docsets/ATG 10.2.docset/Contents/Resources/Documents/atg/search/routing/command/search/TraceExpression.html
|
HTML
|
mit
| 22,408
|
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePersonsReferencesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('persons_references_1_1', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('id_history');
$table->foreign('id_history', 'persons_references_1_1_1_fk_historys')->references('id')->on('historys');
$table->unsignedInteger('id_elderly');
$table->foreign('id_elderly', 'persons_references_1_1_2_fk_elderlies')->references('id')->on('elderlies');
$table->string('name_1_1', '50')->nullable(true);
$table->date('date_of_birth_1_1')->nullable(true);
$table->string('link_1_1', '30')->nullable(true);
$table->string('address_1_1', '50')->nullable(true);
$table->string('telephone_1_1', '15')->nullable(true);
$table->string('cell_phone_1_1', '15')->nullable(true);
$table->boolean('does_this_person_live_with_you_1_1')->nullable(true);
$table->date('date_of_this_information_1_1')->nullable(true);
$table->softDeletes();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('persons_references_1_1');
}
}
|
Vabrins/CadernetaDoIdoso
|
database/migrations/2017_08_23_025525_create_persons_references_table.php
|
PHP
|
mit
| 1,549
|
using jInv.Mesh
using Test
# setup 3D problem
nc = [5, 7, 8]
x0 = rand(3)
domain = [x0[1], 4, x0[2], 2, x0[3], 6]
h = (domain[2:2:end]-domain[1:2:end])./nc
h1 = h[1]*ones(nc[1])
h2 = h[2]*ones(nc[2])
h3 = h[3]*ones(nc[3])
Mt = getTensorMesh3D(h1,h2,h3,x0)
Mr = getRegularMesh(domain,nc)
Mt2 = getTensorMesh3D(h1+rand(nc[1]),h2+rand(nc[2]),h3+rand(nc[3]),x0)
Meshes = (Mt,Mr,Mt2)
for k=1:length(Meshes)
M = Meshes[k]
print("\ttesting differential operators for $(typeof(M))...")
@test norm(getDivergenceMatrix(M)*getCurlMatrix(M),Inf)<1e-12
Lap = getNodalLaplacianMatrix(M)
G = getNodalGradientMatrix(M)
@test norm(Lap*ones(size(Lap,2))/M.nc) < 1e-10
@test norm(G'*G- Lap,Inf) <1e-12
print("passed!\n")
end
|
JuliaInv/jInv.jl
|
test/Mesh/testDiffOps.jl
|
Julia
|
mit
| 730
|
// Test logging in
casper.test.comment('Test logging in');
casper.start('http://localhost:3000/', function() {
this.clickLabel('Login', 'a');
this.then(function() {
this.test.assertExists('form', 'login form exists');
this.test.assertUrlMatch('http://localhost:3000/auth/login');
this.fill('form', {
'username' : 'testuserone',
'password' : 'password'
}, true);
this.then(function() {
this.test.assertExists('div .alert', 'alert exists');
this.test.assertSelectorHasText('div .alert', 'Logged in');
this.test.assertSelectorHasText('a', 'Logout');
this.test.assertSelectorDoesntHaveText('a', 'Login');
this.test.assertSelectorHasText('a', 'My Profile');
});
});
});
casper.run(function() {
this.clickLabel('Logout', 'a');
this.test.done(7);
});
|
ShaneKilkelly/YesodExample
|
casper/loginTest.js
|
JavaScript
|
mit
| 916
|
<?php
function shorten($url, $qr=NULL){
if(function_exists('curl_init')){
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, 'http://goo.gl/api/shorten');
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'security_token=null&url='.urlencode($url));
$results = curl_exec($ch);
$headerInfo = curl_getinfo($ch);
curl_close($ch);
if ($headerInfo['http_code'] === 201){ // HTTP Code 201 = Created
$results = json_decode($results);
if(isset($results->short_url)){
$qr = !is_null($qr)?'.qr':'';
return $results->short_url.$qr;
}
return FALSE;
}
return FALSE;
}
trigger_error("cURL required to shorten URLs.", E_USER_WARNING); // Show the user a neat error.
return FALSE;
}
// Example: Just the Short URL
echo shorten('http://www.google.com/');
// Example: Give the Short Code URL and image it.
$qrURL = shorten('http://www.google.com/', TRUE);
echo '<img src="'.$qrURL.'" />';
?>
|
voidabhi/reddy
|
ShortUrl.php
|
PHP
|
mit
| 942
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Jam;
using MySql.Data.MySqlClient;
using System.Web.UI.HtmlControls;
public partial class Track : JamPage
{
public Track()
{
m_Code = 22;
}
private string TrackID
{
get
{
return (string)ViewState["TrackID"];
}
set
{
ViewState["TrackID"] = value;
}
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
TrackID = (string)HttpContext.Current.Items["song_id"];
FillForm();
ctrUserComment.SubjectID = TrackID;
ctrUserComment.SubjKind = "music";
ctrRating.SubjectID = TrackID;
ctrRating.SubjKind = "music";
SetPageTitleDescr(new string[] {
lbTitle.Text,
lbTitle.Text },
new string[] {
String.Format("Music. Title: {0}, Author: {1}", lbTitle.Text, hlAuthor.Text) + (!String.IsNullOrEmpty(hlBand.Text) ? (", Band: " + hlBand.Text) : ""),
String.Format("Музыка. Название: {0}, Автор: {1}", lbTitle.Text, hlAuthor.Text) + (!String.IsNullOrEmpty(hlBand.Text) ? (", Группа: " + hlBand.Text) : "") });
}
}
private void AddPlayer(string sSongTitle, string sImgId)
{
HtmlGenericControl hcPlayer = new HtmlGenericControl();
hcPlayer.InnerHtml = String.Format(@"
<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width='400' height='15' id='xspf_player' align='middle'>
<param name='allowScriptAccess' value='sameDomain' />
<param name='movie' value='{0}' />
<param name='quality' value='high' />
<param name='bgcolor' value='#e6e6e6' />
<embed src='{0}' quality='high' bgcolor='#e6e6e6' width='400' height='15' name='xspf_player' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />
</object>
", this.ResolveUrl("~/Player/xspf_player.swf") + "?song_title=" + Uri.EscapeUriString(sSongTitle) + "&song_url=" + this.ResolveUrl("~/GetMusic.aspx?id=" + TrackID) + "&autoload=true" + (!String.IsNullOrEmpty(sImgId) ? "&song_image=" + this.ResolveUrl("~/GetImage.aspx?id=" + sImgId) : ""));
phPlayer.Controls.Add(hcPlayer);
}
private void FillForm()
{
if (!String.IsNullOrEmpty(TrackID))
{
MySqlConnection con = Utils.GetSqlConnection();
if (con != null)
{
try
{
MySqlCommand cmd = new MySqlCommand(@"select
music.Title, music.FileName, music.Description, music.Style, music.Language, music.ImgId, userinfo.SiteName as AuthorName, bands.Name as BandName
from music left outer join bands on (music.BandId=bands.Id and bands.Deleted=0), userinfo, usertoband where music.Id=?TrackId and music.Deleted=0 and music.Author=userinfo.Id and userinfo.Deleted=0", con);
cmd.Parameters.Add("?TrackId", MySqlDbType.UInt64).Value = UInt64.Parse(TrackID);
if (UserInfo != null)
{
cmd.CommandText += @" and (music.Author=?UserId or music.Visibility IS NULL or music.Visibility=0 or music.Visibility=1 or
(music.Visibility=3 and music.BandId=usertoband.BandId and usertoband.UserId=?UserId and usertoband.Deleted=0))";
cmd.Parameters.Add("?UserId", MySqlDbType.UInt64).Value = UserInfo.UIntId;
}
else
{
cmd.CommandText += " and (music.Visibility IS NULL or music.Visibility=0)";
}
MySqlDataReader rdr = cmd.ExecuteReader();
if (rdr != null)
{
string sImgId = null;
if (rdr.Read())
{
lbTitle.Text = rdr.GetString("Title");
lbDescr.Text = rdr.IsDBNull ( rdr.GetOrdinal ( "Description" ) ) ? "" : rdr.GetString ( "Description" );
lbStyle.Text = rdr.IsDBNull ( rdr.GetOrdinal ( "Description" ) ) ? "" : rdr.GetString ( "Style" );
//lbAuthor.Text = rdr.GetString("AuthorName");
hlAuthor.Text = rdr.GetString("AuthorName");
hlAuthor.NavigateUrl = Jam.JamRouteUrl.PickUp ( "folk", this.LangEnum, new System.Collections.Generic.Dictionary<string, string> ( ) { { "name", hlAuthor.Text } } );
//lbBand.Text = rdr.IsDBNull(rdr.GetOrdinal("BandName")) ? "" : rdr.GetString("BandName");
hlBand.Text = rdr.IsDBNull(rdr.GetOrdinal("BandName")) ? "" : rdr.GetString("BandName");
if (!String.IsNullOrEmpty(hlBand.Text))
{
trBand.Visible = true;
hlBand.NavigateUrl = Jam.JamRouteUrl.PickUp ( "band", this.LangEnum, new System.Collections.Generic.Dictionary<string, string> ( ) { { "name", hlBand.Text } } );
}
else
{
trBand.Visible = false;
}
lbLang.Text = rdr.IsDBNull(rdr.GetOrdinal("Language")) ? "" : rdr.GetString("Language");
trLang.Visible = !String.IsNullOrEmpty(lbLang.Text);
sImgId = rdr.IsDBNull(rdr.GetOrdinal("ImgId")) ? null : rdr.GetString("ImgId");
}
rdr.Close();
AddPlayer(lbTitle.Text, sImgId);
}
}
catch (Exception ex)
{
JamLog.log(JamLog.enEntryType.error, "Track", "FillForm: " + ex.Message);
}
finally
{
con.Close();
}
}
}
}
}
|
hardsky/music-head
|
web/Track.aspx.cs
|
C#
|
mit
| 6,295
|
---
layout: single
author_profile: true
comments: false
title: false
---
### Overview
My research deals with mathematical modeling of complex systems and statistical signal processing, for information inference and decision making. A detailed list of my ongoing and past research projects are listed below.
#### Calico Life Sciences
* Will update soon.
#### Washington University in St. Louis
* Signal denoising and pattern recognition in time-series data. [\[<span style="color:blue">_More_</span>\]](/research/timeseries/)
* Gait cycle validation and segmentation using inertial sensors. [\[<span style="color:blue">_More_</span>\]](/research/gaitseg/)
* Modeling, detecting, and tracking of freezing of gait in Parkinson disease. [\[<span style="color:blue">_More_</span>\]](/research/freezegait/)
* Target detection using weather radars and electromagnetic vector sensors. [\[<span style="color:blue">_More_</span>\]](/research/wradaremvs/)
#### Indian Institute of Science, Bangalore
* Foot-mounted indoor navigation system for indoor positioning. [\[<span style="color:blue">_More_</span>\]](/research/indoorpos/)
* Modeling and classification of vehicles using magnetometers. [\[<span style="color:blue">_More_</span>\]](/research/vehclass/)
|
prateekgv/prateekgv.github.io
|
research/index.md
|
Markdown
|
mit
| 1,255
|
<?php
/*
* This file is part of the symfony package.
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* Propel filter form generator.
*
* This class generates a Propel filter forms.
*
* @package symfony
* @subpackage generator
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
* @version SVN: $Id: sfPropelFormFilterGenerator.class.php 24392 2009-11-25 18:35:39Z FabianLange $
*/
class sfPropelFormFilterGenerator extends sfPropelFormGenerator
{
/**
* Initializes the current sfGenerator instance.
*
* @param sfGeneratorManager $generatorManager A sfGeneratorManager instance
*/
public function initialize(sfGeneratorManager $generatorManager)
{
parent::initialize($generatorManager);
$this->setGeneratorClass('sfPropelFormFilter');
}
/**
* Generates classes and templates in cache.
*
* @param array $params The parameters
*
* @return string The data to put in configuration cache
*/
public function generate($params = array())
{
$this->params = $params;
if (!isset($this->params['connection']))
{
throw new sfParseException('You must specify a "connection" parameter.');
}
if (!isset($this->params['model_dir_name']))
{
$this->params['model_dir_name'] = 'model';
}
if (!isset($this->params['filter_dir_name']))
{
$this->params['filter_dir_name'] = 'filter';
}
$this->loadBuilders();
// create the project base class for all forms
$file = sfConfig::get('sf_lib_dir').'/filter/BaseFormFilterPropel.class.php';
if (!file_exists($file))
{
if (!is_dir($directory = dirname($file)))
{
mkdir($directory, 0777, true);
}
file_put_contents($file, $this->evalTemplate('sfPropelFormFilterBaseTemplate.php'));
}
// create a form class for every Propel class
foreach ($this->dbMap->getTables() as $tableName => $table)
{
$behaviors = $table->getBehaviors();
if (isset($behaviors['symfony']['filter']) && 'false' === $behaviors['symfony']['filter'])
{
continue;
}
$this->table = $table;
// find the package to store filter forms in the same directory as the model classes
$packages = explode('.', constant(constant($table->getClassname().'::PEER').'::CLASS_DEFAULT'));
array_pop($packages);
if (false === $pos = array_search($this->params['model_dir_name'], $packages))
{
throw new InvalidArgumentException(sprintf('Unable to find the model dir name (%s) in the package %s.', $this->params['model_dir_name'], constant(constant($table->getClassname().'::PEER').'::CLASS_DEFAULT')));
}
$packages[$pos] = $this->params['filter_dir_name'];
$baseDir = sfConfig::get('sf_root_dir').'/'.implode(DIRECTORY_SEPARATOR, $packages);
if (!is_dir($baseDir.'/base'))
{
mkdir($baseDir.'/base', 0777, true);
}
file_put_contents($baseDir.'/base/Base'.$table->getClassname().'FormFilter.class.php', $this->evalTemplate('sfPropelFormFilterGeneratedTemplate.php'));
if (!file_exists($classFile = $baseDir.'/'.$table->getClassname().'FormFilter.class.php'))
{
file_put_contents($classFile, $this->evalTemplate('sfPropelFormFilterTemplate.php'));
}
}
}
/**
* Returns a sfWidgetForm class name for a given column.
*
* @param ColumnMap $column A ColumnMap object
*
* @return string The name of a subclass of sfWidgetForm
*/
public function getWidgetClassForColumn(ColumnMap $column)
{
switch ($column->getType())
{
case PropelColumnTypes::BOOLEAN:
case PropelColumnTypes::BOOLEAN_EMU:
case PropelColumnTypes::ENUM:
$name = 'Choice';
break;
case PropelColumnTypes::DATE:
case PropelColumnTypes::TIME:
case PropelColumnTypes::TIMESTAMP:
$name = 'FilterDate';
break;
default:
$name = 'FilterInput';
}
if ($column->isForeignKey())
{
$name = 'PropelChoice';
}
return sprintf('sfWidgetForm%s', $name);
}
/**
* Returns a PHP string representing options to pass to a widget for a given column.
*
* @param ColumnMap $column A ColumnMap object
*
* @return string The options to pass to the widget as a PHP string
*/
public function getWidgetOptionsForColumn(ColumnMap $column)
{
$options = array();
$withEmpty = $column->isNotNull() && !$column->isForeignKey() ? array("'with_empty' => false") : array();
switch ($column->getType())
{
case PropelColumnTypes::BOOLEAN:
case PropelColumnTypes::BOOLEAN_EMU:
$options[] = "'choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no')";
break;
case PropelColumnTypes::DATE:
case PropelColumnTypes::TIME:
case PropelColumnTypes::TIMESTAMP:
$options[] = "'from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate()";
$options = array_merge($options, $withEmpty);
break;
case PropelColumnTypes::ENUM:
$valueSet = $column->getValueSet();
$choices = array_merge(array(''=>'all'), $valueSet);
$options[] = sprintf("'choices' => %s", preg_replace('/\s+/', '', var_export($choices, true)));
break;
default:
$options = array_merge($options, $withEmpty);
}
if ($column->isForeignKey())
{
$options[] = sprintf('\'model\' => \'%s\', \'add_empty\' => true', $this->getForeignTable($column)->getClassname());
$refColumn = $this->getForeignTable($column)->getColumn($column->getRelatedColumnName());
if (!$refColumn->isPrimaryKey())
{
$options[] = sprintf('\'key_method\' => \'get%s\'', $refColumn->getPhpName());
}
}
return count($options) ? sprintf('array(%s)', implode(', ', $options)) : '';
}
/**
* Returns a sfValidator class name for a given column.
*
* @param ColumnMap $column A ColumnMap object
*
* @return string The name of a subclass of sfValidator
*/
public function getValidatorClassForColumn(ColumnMap $column)
{
switch ($column->getType())
{
case PropelColumnTypes::BOOLEAN:
case PropelColumnTypes::BOOLEAN_EMU:
case PropelColumnTypes::ENUM:
$name = 'Choice';
break;
case PropelColumnTypes::DOUBLE:
case PropelColumnTypes::FLOAT:
case PropelColumnTypes::NUMERIC:
case PropelColumnTypes::DECIMAL:
case PropelColumnTypes::REAL:
$name = 'Number';
break;
case PropelColumnTypes::INTEGER:
case PropelColumnTypes::SMALLINT:
case PropelColumnTypes::TINYINT:
case PropelColumnTypes::BIGINT:
$name = 'Integer';
break;
case PropelColumnTypes::DATE:
case PropelColumnTypes::TIME:
case PropelColumnTypes::TIMESTAMP:
$name = 'DateRange';
break;
default:
$name = 'Pass';
}
if ($column->isPrimaryKey() || $column->isForeignKey())
{
$name = 'PropelChoice';
}
return sprintf('sfValidator%s', $name);
}
/**
* Returns a PHP string representing options to pass to a validator for a given column.
*
* @param ColumnMap $column A ColumnMap object
*
* @return string The options to pass to the validator as a PHP string
*/
public function getValidatorOptionsForColumn(ColumnMap $column)
{
$options = array('\'required\' => false');
if ($column->isForeignKey())
{
$options[] = sprintf('\'model\' => \'%s\', \'column\' => \'%s\'', $this->getForeignTable($column)->getClassname(), $this->translateColumnName($column, true));
}
else if ($column->isPrimaryKey())
{
$options[] = sprintf('\'model\' => \'%s\', \'column\' => \'%s\'', $column->getTable()->getClassname(), $this->translateColumnName($column));
}
else
{
switch ($column->getType())
{
case PropelColumnTypes::BOOLEAN:
case PropelColumnTypes::BOOLEAN_EMU:
$options[] = "'choices' => array('', 1, 0)";
break;
case PropelColumnTypes::DATE:
case PropelColumnTypes::TIME:
case PropelColumnTypes::TIMESTAMP:
$options[] = "'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false))";
break;
case PropelColumnTypes::ENUM:
$valueSet = $column->getValueSet();
$options[] = sprintf("'choices' => %s", preg_replace('/\s+/', '', var_export(array_keys($valueSet), true)));
break;
}
}
return count($options) ? sprintf('array(%s)', implode(', ', $options)) : '';
}
public function getValidatorForColumn($column)
{
$format = 'new %s(%s)';
if (in_array($class = $this->getValidatorClassForColumn($column), array('sfValidatorInteger', 'sfValidatorNumber')))
{
$format = 'new sfValidatorSchemaFilter(\'text\', new %s(%s))';
}
return sprintf($format, $class, $this->getValidatorOptionsForColumn($column));
}
public function getType(ColumnMap $column)
{
if ($column->isForeignKey())
{
return 'ForeignKey';
}
switch ($column->getType())
{
case PropelColumnTypes::BOOLEAN:
case PropelColumnTypes::BOOLEAN_EMU:
return 'Boolean';
case PropelColumnTypes::DATE:
case PropelColumnTypes::TIME:
case PropelColumnTypes::TIMESTAMP:
return 'Date';
case PropelColumnTypes::DOUBLE:
case PropelColumnTypes::FLOAT:
case PropelColumnTypes::NUMERIC:
case PropelColumnTypes::DECIMAL:
case PropelColumnTypes::REAL:
case PropelColumnTypes::INTEGER:
case PropelColumnTypes::SMALLINT:
case PropelColumnTypes::TINYINT:
case PropelColumnTypes::BIGINT:
return 'Number';
default:
return 'Text';
}
}
}
|
jenkins-khan/Jenkins-Khan
|
plugins/sfPropelORMPlugin/lib/generator/sfPropelFormFilterGenerator.class.php
|
PHP
|
mit
| 10,039
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>V8 API Reference Guide for node.js v4.4.1: v8::Symbol Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">V8 API Reference Guide for node.js v4.4.1
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="inherits.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacev8.html">v8</a></li><li class="navelem"><a class="el" href="classv8_1_1Symbol.html">Symbol</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> |
<a href="#pub-static-methods">Static Public Member Functions</a> |
<a href="classv8_1_1Symbol-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">v8::Symbol Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p><code>#include <<a class="el" href="v8_8h_source.html">v8.h</a>></code></p>
<div class="dynheader">
Inheritance diagram for v8::Symbol:</div>
<div class="dyncontent">
<div class="center"><img src="classv8_1_1Symbol__inherit__graph.png" border="0" usemap="#v8_1_1Symbol_inherit__map" alt="Inheritance graph"/></div>
<map name="v8_1_1Symbol_inherit__map" id="v8_1_1Symbol_inherit__map">
</map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for v8::Symbol:</div>
<div class="dyncontent">
<div class="center"><img src="classv8_1_1Symbol__coll__graph.png" border="0" usemap="#v8_1_1Symbol_coll__map" alt="Collaboration graph"/></div>
<map name="v8_1_1Symbol_coll__map" id="v8_1_1Symbol_coll__map">
</map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:af1c1ccf079ac99e0db858c30e6458587"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af1c1ccf079ac99e0db858c30e6458587"></a>
<a class="el" href="classv8_1_1Local.html">Local</a>< <a class="el" href="classv8_1_1Value.html">Value</a> > </td><td class="memItemRight" valign="bottom"><b>Name</b> () const </td></tr>
<tr class="separator:af1c1ccf079ac99e0db858c30e6458587"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header pub_methods_classv8_1_1Name"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classv8_1_1Name')"><img src="closed.png" alt="-"/> Public Member Functions inherited from <a class="el" href="classv8_1_1Name.html">v8::Name</a></td></tr>
<tr class="memitem:aef60fce47685fad12914304f6bc52bf2 inherit pub_methods_classv8_1_1Name"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Name.html#aef60fce47685fad12914304f6bc52bf2">GetIdentityHash</a> ()</td></tr>
<tr class="separator:aef60fce47685fad12914304f6bc52bf2 inherit pub_methods_classv8_1_1Name"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header pub_methods_classv8_1_1Value"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classv8_1_1Value')"><img src="closed.png" alt="-"/> Public Member Functions inherited from <a class="el" href="classv8_1_1Value.html">v8::Value</a></td></tr>
<tr class="memitem:aea287b745656baa8a12a2ae1d69744b6 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">V8_INLINE bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#aea287b745656baa8a12a2ae1d69744b6">IsUndefined</a> () const </td></tr>
<tr class="separator:aea287b745656baa8a12a2ae1d69744b6 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa2c6ed8ef832223a7e2cd81e6ac61c78 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">V8_INLINE bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#aa2c6ed8ef832223a7e2cd81e6ac61c78">IsNull</a> () const </td></tr>
<tr class="separator:aa2c6ed8ef832223a7e2cd81e6ac61c78 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8f27462322186b295195eecb3e81d6d7 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#a8f27462322186b295195eecb3e81d6d7">IsTrue</a> () const </td></tr>
<tr class="separator:a8f27462322186b295195eecb3e81d6d7 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a68c0296071d01ca899825d7643cf495a inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#a68c0296071d01ca899825d7643cf495a">IsFalse</a> () const </td></tr>
<tr class="separator:a68c0296071d01ca899825d7643cf495a inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8829b16b442a6231499c89fd5a6f8049 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#a8829b16b442a6231499c89fd5a6f8049">IsName</a> () const </td></tr>
<tr class="separator:a8829b16b442a6231499c89fd5a6f8049 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab23a34b7df62806808e01b0908bf5f00 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">V8_INLINE bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#ab23a34b7df62806808e01b0908bf5f00">IsString</a> () const </td></tr>
<tr class="separator:ab23a34b7df62806808e01b0908bf5f00 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af3e6081c22d09a7bbc0a2aff59ed60a5 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#af3e6081c22d09a7bbc0a2aff59ed60a5">IsSymbol</a> () const </td></tr>
<tr class="separator:af3e6081c22d09a7bbc0a2aff59ed60a5 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a05532a34cdd215f273163830ed8b77e7 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#a05532a34cdd215f273163830ed8b77e7">IsFunction</a> () const </td></tr>
<tr class="separator:a05532a34cdd215f273163830ed8b77e7 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aaee0b144087d20eae02314c9393ff80f inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#aaee0b144087d20eae02314c9393ff80f">IsArray</a> () const </td></tr>
<tr class="separator:aaee0b144087d20eae02314c9393ff80f inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a355b7991c5c978c0341f6f961b63c5a2 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#a355b7991c5c978c0341f6f961b63c5a2">IsObject</a> () const </td></tr>
<tr class="separator:a355b7991c5c978c0341f6f961b63c5a2 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0aceb7645e71b096df5cd73d1252b1b0 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#a0aceb7645e71b096df5cd73d1252b1b0">IsBoolean</a> () const </td></tr>
<tr class="separator:a0aceb7645e71b096df5cd73d1252b1b0 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1bd51e3e55f67c65b9a8f587fbffb7c7 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#a1bd51e3e55f67c65b9a8f587fbffb7c7">IsNumber</a> () const </td></tr>
<tr class="separator:a1bd51e3e55f67c65b9a8f587fbffb7c7 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7ac61a325c18af8dcb6d7d5bf47d2503 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#a7ac61a325c18af8dcb6d7d5bf47d2503">IsExternal</a> () const </td></tr>
<tr class="separator:a7ac61a325c18af8dcb6d7d5bf47d2503 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a01e1db51c65b2feace248b7acbf71a2c inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#a01e1db51c65b2feace248b7acbf71a2c">IsInt32</a> () const </td></tr>
<tr class="separator:a01e1db51c65b2feace248b7acbf71a2c inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a783c89631bac4ef3c4b909f40cc2b8d8 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#a783c89631bac4ef3c4b909f40cc2b8d8">IsUint32</a> () const </td></tr>
<tr class="separator:a783c89631bac4ef3c4b909f40cc2b8d8 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8bc11fab0aded4a805722ab6df173cae inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#a8bc11fab0aded4a805722ab6df173cae">IsDate</a> () const </td></tr>
<tr class="separator:a8bc11fab0aded4a805722ab6df173cae inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad06a4b1f7215d852c367df390491ac84 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#ad06a4b1f7215d852c367df390491ac84">IsArgumentsObject</a> () const </td></tr>
<tr class="separator:ad06a4b1f7215d852c367df390491ac84 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:abe7bc06283e5e66013f2f056a943168b inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#abe7bc06283e5e66013f2f056a943168b">IsBooleanObject</a> () const </td></tr>
<tr class="separator:abe7bc06283e5e66013f2f056a943168b inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a5f4aa9504a6d8fc3af9489330179fe14 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#a5f4aa9504a6d8fc3af9489330179fe14">IsNumberObject</a> () const </td></tr>
<tr class="separator:a5f4aa9504a6d8fc3af9489330179fe14 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3e0f2727455fd01a39a60b92f77e28e0 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#a3e0f2727455fd01a39a60b92f77e28e0">IsStringObject</a> () const </td></tr>
<tr class="separator:a3e0f2727455fd01a39a60b92f77e28e0 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a867baa94cb8f1069452359e6cef6751e inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#a867baa94cb8f1069452359e6cef6751e">IsSymbolObject</a> () const </td></tr>
<tr class="separator:a867baa94cb8f1069452359e6cef6751e inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a579fb52e893cdc24f8b77e5acc77d06d inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#a579fb52e893cdc24f8b77e5acc77d06d">IsNativeError</a> () const </td></tr>
<tr class="separator:a579fb52e893cdc24f8b77e5acc77d06d inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aae41e43486937d6122c297a0d43ac0b8 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#aae41e43486937d6122c297a0d43ac0b8">IsRegExp</a> () const </td></tr>
<tr class="separator:aae41e43486937d6122c297a0d43ac0b8 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1cbbebde8c256d051c4606a7300870c6 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#a1cbbebde8c256d051c4606a7300870c6">IsGeneratorFunction</a> () const </td></tr>
<tr class="separator:a1cbbebde8c256d051c4606a7300870c6 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a72982768acdadd82d1df02a452251d14 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#a72982768acdadd82d1df02a452251d14">IsGeneratorObject</a> () const </td></tr>
<tr class="separator:a72982768acdadd82d1df02a452251d14 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a93d6a0817b15a1d28050ba16e131e6b4 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#a93d6a0817b15a1d28050ba16e131e6b4">IsPromise</a> () const </td></tr>
<tr class="separator:a93d6a0817b15a1d28050ba16e131e6b4 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a71ef50f22d6bb4a093cc931b3d981c08 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#a71ef50f22d6bb4a093cc931b3d981c08">IsMap</a> () const </td></tr>
<tr class="separator:a71ef50f22d6bb4a093cc931b3d981c08 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a220bd4056471ee1dda8ab9565517edd7 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#a220bd4056471ee1dda8ab9565517edd7">IsSet</a> () const </td></tr>
<tr class="separator:a220bd4056471ee1dda8ab9565517edd7 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af9c52a0668fa3260a0d12a2cdf895b4e inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#af9c52a0668fa3260a0d12a2cdf895b4e">IsMapIterator</a> () const </td></tr>
<tr class="separator:af9c52a0668fa3260a0d12a2cdf895b4e inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:addbae0104e07b990ee1af0bd7927824b inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#addbae0104e07b990ee1af0bd7927824b">IsSetIterator</a> () const </td></tr>
<tr class="separator:addbae0104e07b990ee1af0bd7927824b inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aab0297b39ed8e2a71b5dca7950228a36 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#aab0297b39ed8e2a71b5dca7950228a36">IsWeakMap</a> () const </td></tr>
<tr class="separator:aab0297b39ed8e2a71b5dca7950228a36 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6f5a238206cbd95f98e2da92cab72e80 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#a6f5a238206cbd95f98e2da92cab72e80">IsWeakSet</a> () const </td></tr>
<tr class="separator:a6f5a238206cbd95f98e2da92cab72e80 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a65f9dad740f2468b44dc16349611c351 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#a65f9dad740f2468b44dc16349611c351">IsArrayBuffer</a> () const </td></tr>
<tr class="separator:a65f9dad740f2468b44dc16349611c351 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad54475d15b7e6b6e17fc80fb4570cdf2 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#ad54475d15b7e6b6e17fc80fb4570cdf2">IsArrayBufferView</a> () const </td></tr>
<tr class="separator:ad54475d15b7e6b6e17fc80fb4570cdf2 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac2f2f6c39f14a39fbb5b43577125dfe4 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#ac2f2f6c39f14a39fbb5b43577125dfe4">IsTypedArray</a> () const </td></tr>
<tr class="separator:ac2f2f6c39f14a39fbb5b43577125dfe4 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:acbe2cd9c9cce96ee498677ba37c8466d inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#acbe2cd9c9cce96ee498677ba37c8466d">IsUint8Array</a> () const </td></tr>
<tr class="separator:acbe2cd9c9cce96ee498677ba37c8466d inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad3cb464ab5ef0215bd2cbdd4eb2b7e3d inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#ad3cb464ab5ef0215bd2cbdd4eb2b7e3d">IsUint8ClampedArray</a> () const </td></tr>
<tr class="separator:ad3cb464ab5ef0215bd2cbdd4eb2b7e3d inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a10a88a2794271dfcd9c3abd565e8f28a inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#a10a88a2794271dfcd9c3abd565e8f28a">IsInt8Array</a> () const </td></tr>
<tr class="separator:a10a88a2794271dfcd9c3abd565e8f28a inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4a45fabf58b241f5de3086a3dd0a09ae inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#a4a45fabf58b241f5de3086a3dd0a09ae">IsUint16Array</a> () const </td></tr>
<tr class="separator:a4a45fabf58b241f5de3086a3dd0a09ae inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a928c586639dd75ae4efdaa66b1fc4d50 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#a928c586639dd75ae4efdaa66b1fc4d50">IsInt16Array</a> () const </td></tr>
<tr class="separator:a928c586639dd75ae4efdaa66b1fc4d50 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a5e39229dc74d534835cf4ceba10676f4 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#a5e39229dc74d534835cf4ceba10676f4">IsUint32Array</a> () const </td></tr>
<tr class="separator:a5e39229dc74d534835cf4ceba10676f4 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a48eac78a49c8b42d9f8cf05c514b3750 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#a48eac78a49c8b42d9f8cf05c514b3750">IsInt32Array</a> () const </td></tr>
<tr class="separator:a48eac78a49c8b42d9f8cf05c514b3750 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4effc7ca1a221dd8c1e23c0f28145ef0 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#a4effc7ca1a221dd8c1e23c0f28145ef0">IsFloat32Array</a> () const </td></tr>
<tr class="separator:a4effc7ca1a221dd8c1e23c0f28145ef0 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a293f140b81b0219d1497e937ed948b1e inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#a293f140b81b0219d1497e937ed948b1e">IsFloat64Array</a> () const </td></tr>
<tr class="separator:a293f140b81b0219d1497e937ed948b1e inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab071bf567d89c8ce1489b1b7d93abc36 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#ab071bf567d89c8ce1489b1b7d93abc36">IsFloat32x4</a> () const </td></tr>
<tr class="separator:ab071bf567d89c8ce1489b1b7d93abc36 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:afd20ab51e79658acc405c12dad2260ab inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#afd20ab51e79658acc405c12dad2260ab">IsDataView</a> () const </td></tr>
<tr class="separator:afd20ab51e79658acc405c12dad2260ab inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa4ce26f174a4c1823dec56eb946d3134 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#aa4ce26f174a4c1823dec56eb946d3134">IsSharedArrayBuffer</a> () const </td></tr>
<tr class="separator:aa4ce26f174a4c1823dec56eb946d3134 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a40a62da1dd52184cc4c1fd735c538f8b inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a40a62da1dd52184cc4c1fd735c538f8b"></a>
V8_WARN_UNUSED_RESULT <a class="el" href="classv8_1_1MaybeLocal.html">MaybeLocal</a>< <a class="el" href="classv8_1_1Boolean.html">Boolean</a> > </td><td class="memItemRight" valign="bottom"><b>ToBoolean</b> (<a class="el" href="classv8_1_1Local.html">Local</a>< <a class="el" href="classv8_1_1Context.html">Context</a> > context) const </td></tr>
<tr class="separator:a40a62da1dd52184cc4c1fd735c538f8b inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9fa8386aa436c2b83c9af6a65b8a2cad inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9fa8386aa436c2b83c9af6a65b8a2cad"></a>
V8_WARN_UNUSED_RESULT <a class="el" href="classv8_1_1MaybeLocal.html">MaybeLocal</a>< <a class="el" href="classv8_1_1Number.html">Number</a> > </td><td class="memItemRight" valign="bottom"><b>ToNumber</b> (<a class="el" href="classv8_1_1Local.html">Local</a>< <a class="el" href="classv8_1_1Context.html">Context</a> > context) const </td></tr>
<tr class="separator:a9fa8386aa436c2b83c9af6a65b8a2cad inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a62315204812aa88ac5577587c49e02ab inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a62315204812aa88ac5577587c49e02ab"></a>
V8_WARN_UNUSED_RESULT <a class="el" href="classv8_1_1MaybeLocal.html">MaybeLocal</a>< <a class="el" href="classv8_1_1String.html">String</a> > </td><td class="memItemRight" valign="bottom"><b>ToString</b> (<a class="el" href="classv8_1_1Local.html">Local</a>< <a class="el" href="classv8_1_1Context.html">Context</a> > context) const </td></tr>
<tr class="separator:a62315204812aa88ac5577587c49e02ab inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aeb6599247811f27464db5dc4777e35e6 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aeb6599247811f27464db5dc4777e35e6"></a>
V8_WARN_UNUSED_RESULT <a class="el" href="classv8_1_1MaybeLocal.html">MaybeLocal</a>< <a class="el" href="classv8_1_1String.html">String</a> > </td><td class="memItemRight" valign="bottom"><b>ToDetailString</b> (<a class="el" href="classv8_1_1Local.html">Local</a>< <a class="el" href="classv8_1_1Context.html">Context</a> > context) const </td></tr>
<tr class="separator:aeb6599247811f27464db5dc4777e35e6 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4823df6b6920f74f64f30d5341fc879a inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4823df6b6920f74f64f30d5341fc879a"></a>
V8_WARN_UNUSED_RESULT <a class="el" href="classv8_1_1MaybeLocal.html">MaybeLocal</a>< <a class="el" href="classv8_1_1Object.html">Object</a> > </td><td class="memItemRight" valign="bottom"><b>ToObject</b> (<a class="el" href="classv8_1_1Local.html">Local</a>< <a class="el" href="classv8_1_1Context.html">Context</a> > context) const </td></tr>
<tr class="separator:a4823df6b6920f74f64f30d5341fc879a inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a183cd0a8d99f2bbbaa4405b21ef752d6 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a183cd0a8d99f2bbbaa4405b21ef752d6"></a>
V8_WARN_UNUSED_RESULT <a class="el" href="classv8_1_1MaybeLocal.html">MaybeLocal</a>< <a class="el" href="classv8_1_1Integer.html">Integer</a> > </td><td class="memItemRight" valign="bottom"><b>ToInteger</b> (<a class="el" href="classv8_1_1Local.html">Local</a>< <a class="el" href="classv8_1_1Context.html">Context</a> > context) const </td></tr>
<tr class="separator:a183cd0a8d99f2bbbaa4405b21ef752d6 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3ea85bd616b0cf6335cd580937b56e1c inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3ea85bd616b0cf6335cd580937b56e1c"></a>
V8_WARN_UNUSED_RESULT <a class="el" href="classv8_1_1MaybeLocal.html">MaybeLocal</a>< <a class="el" href="classv8_1_1Uint32.html">Uint32</a> > </td><td class="memItemRight" valign="bottom"><b>ToUint32</b> (<a class="el" href="classv8_1_1Local.html">Local</a>< <a class="el" href="classv8_1_1Context.html">Context</a> > context) const </td></tr>
<tr class="separator:a3ea85bd616b0cf6335cd580937b56e1c inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a710ab9ca1f72a69bee3223e03d01e414 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a710ab9ca1f72a69bee3223e03d01e414"></a>
V8_WARN_UNUSED_RESULT <a class="el" href="classv8_1_1MaybeLocal.html">MaybeLocal</a>< <a class="el" href="classv8_1_1Int32.html">Int32</a> > </td><td class="memItemRight" valign="bottom"><b>ToInt32</b> (<a class="el" href="classv8_1_1Local.html">Local</a>< <a class="el" href="classv8_1_1Context.html">Context</a> > context) const </td></tr>
<tr class="separator:a710ab9ca1f72a69bee3223e03d01e414 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad3b9978f3fedccb48817ce87c5a454ed inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad3b9978f3fedccb48817ce87c5a454ed"></a>
 </td><td class="memItemRight" valign="bottom"><b>V8_DEPRECATE_SOON</b> ("Use maybe version", Local< <a class="el" href="classv8_1_1Boolean.html">Boolean</a> > ToBoolean(<a class="el" href="classv8_1_1Isolate.html">Isolate</a> *isolate) const)</td></tr>
<tr class="separator:ad3b9978f3fedccb48817ce87c5a454ed inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a855a0b74584b9c322c04891783f37e9c inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a855a0b74584b9c322c04891783f37e9c"></a>
 </td><td class="memItemRight" valign="bottom"><b>V8_DEPRECATE_SOON</b> ("Use maybe version", Local< <a class="el" href="classv8_1_1Number.html">Number</a> > ToNumber(<a class="el" href="classv8_1_1Isolate.html">Isolate</a> *isolate) const)</td></tr>
<tr class="separator:a855a0b74584b9c322c04891783f37e9c inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a898f773c591e760fcb98e99cccff3e5c inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a898f773c591e760fcb98e99cccff3e5c"></a>
 </td><td class="memItemRight" valign="bottom"><b>V8_DEPRECATE_SOON</b> ("Use maybe version", Local< <a class="el" href="classv8_1_1String.html">String</a> > ToString(<a class="el" href="classv8_1_1Isolate.html">Isolate</a> *isolate) const)</td></tr>
<tr class="separator:a898f773c591e760fcb98e99cccff3e5c inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7966967b1b55bf39487b4485aa821fb2 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7966967b1b55bf39487b4485aa821fb2"></a>
 </td><td class="memItemRight" valign="bottom"><b>V8_DEPRECATE_SOON</b> ("Use maybe version", Local< <a class="el" href="classv8_1_1String.html">String</a> > ToDetailString(<a class="el" href="classv8_1_1Isolate.html">Isolate</a> *isolate) const)</td></tr>
<tr class="separator:a7966967b1b55bf39487b4485aa821fb2 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4c98939a72d6c48b01c8279cfe218d34 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4c98939a72d6c48b01c8279cfe218d34"></a>
 </td><td class="memItemRight" valign="bottom"><b>V8_DEPRECATE_SOON</b> ("Use maybe version", Local< <a class="el" href="classv8_1_1Object.html">Object</a> > ToObject(<a class="el" href="classv8_1_1Isolate.html">Isolate</a> *isolate) const)</td></tr>
<tr class="separator:a4c98939a72d6c48b01c8279cfe218d34 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aae926c4392edf0ad4a5383ab0d8af4b1 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aae926c4392edf0ad4a5383ab0d8af4b1"></a>
 </td><td class="memItemRight" valign="bottom"><b>V8_DEPRECATE_SOON</b> ("Use maybe version", Local< <a class="el" href="classv8_1_1Integer.html">Integer</a> > ToInteger(<a class="el" href="classv8_1_1Isolate.html">Isolate</a> *isolate) const)</td></tr>
<tr class="separator:aae926c4392edf0ad4a5383ab0d8af4b1 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7bf28af92f41657ef0fc4bdc015a124f inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7bf28af92f41657ef0fc4bdc015a124f"></a>
 </td><td class="memItemRight" valign="bottom"><b>V8_DEPRECATE_SOON</b> ("Use maybe version", Local< <a class="el" href="classv8_1_1Uint32.html">Uint32</a> > ToUint32(<a class="el" href="classv8_1_1Isolate.html">Isolate</a> *isolate) const)</td></tr>
<tr class="separator:a7bf28af92f41657ef0fc4bdc015a124f inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:abf72660ee84f81fe2fed85e39e6a3c86 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abf72660ee84f81fe2fed85e39e6a3c86"></a>
 </td><td class="memItemRight" valign="bottom"><b>V8_DEPRECATE_SOON</b> ("Use maybe version", Local< <a class="el" href="classv8_1_1Int32.html">Int32</a> > ToInt32(<a class="el" href="classv8_1_1Isolate.html">Isolate</a> *isolate) const)</td></tr>
<tr class="separator:abf72660ee84f81fe2fed85e39e6a3c86 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4c9960d9a42b62b83d70ade47d88fa52 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4c9960d9a42b62b83d70ade47d88fa52"></a>
 </td><td class="memItemRight" valign="bottom"><b>V8_DEPRECATE_SOON</b> ("Use maybe version", Local< <a class="el" href="classv8_1_1Boolean.html">Boolean</a> > ToBoolean() const)</td></tr>
<tr class="separator:a4c9960d9a42b62b83d70ade47d88fa52 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3569dca21e27c889a4f4e343292e5ffc inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3569dca21e27c889a4f4e343292e5ffc"></a>
 </td><td class="memItemRight" valign="bottom"><b>V8_DEPRECATE_SOON</b> ("Use maybe version", Local< <a class="el" href="classv8_1_1Number.html">Number</a> > ToNumber() const)</td></tr>
<tr class="separator:a3569dca21e27c889a4f4e343292e5ffc inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4d1fe1c6d7ba6cccef24fc3fe528d75a inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4d1fe1c6d7ba6cccef24fc3fe528d75a"></a>
 </td><td class="memItemRight" valign="bottom"><b>V8_DEPRECATE_SOON</b> ("Use maybe version", Local< <a class="el" href="classv8_1_1String.html">String</a> > ToString() const)</td></tr>
<tr class="separator:a4d1fe1c6d7ba6cccef24fc3fe528d75a inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af8a9f3532d549640ad69037214d51305 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af8a9f3532d549640ad69037214d51305"></a>
 </td><td class="memItemRight" valign="bottom"><b>V8_DEPRECATE_SOON</b> ("Use maybe version", Local< <a class="el" href="classv8_1_1String.html">String</a> > ToDetailString() const)</td></tr>
<tr class="separator:af8a9f3532d549640ad69037214d51305 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a594821f24e204aa6a7b1f003a79089a5 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a594821f24e204aa6a7b1f003a79089a5"></a>
 </td><td class="memItemRight" valign="bottom"><b>V8_DEPRECATE_SOON</b> ("Use maybe version", Local< <a class="el" href="classv8_1_1Object.html">Object</a> > ToObject() const)</td></tr>
<tr class="separator:a594821f24e204aa6a7b1f003a79089a5 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aaf6d45da85632495545435e44ed2eeab inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aaf6d45da85632495545435e44ed2eeab"></a>
 </td><td class="memItemRight" valign="bottom"><b>V8_DEPRECATE_SOON</b> ("Use maybe version", Local< <a class="el" href="classv8_1_1Integer.html">Integer</a> > ToInteger() const)</td></tr>
<tr class="separator:aaf6d45da85632495545435e44ed2eeab inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab1a06e5e80b70f38389d8add992e4b2a inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab1a06e5e80b70f38389d8add992e4b2a"></a>
 </td><td class="memItemRight" valign="bottom"><b>V8_DEPRECATE_SOON</b> ("Use maybe version", Local< <a class="el" href="classv8_1_1Uint32.html">Uint32</a> > ToUint32() const)</td></tr>
<tr class="separator:ab1a06e5e80b70f38389d8add992e4b2a inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a105c830761d2a094edc64d99a4c06f55 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a105c830761d2a094edc64d99a4c06f55"></a>
 </td><td class="memItemRight" valign="bottom"><b>V8_DEPRECATE_SOON</b> ("Use maybe version", Local< <a class="el" href="classv8_1_1Int32.html">Int32</a> > ToInt32() const)</td></tr>
<tr class="separator:a105c830761d2a094edc64d99a4c06f55 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a48ae008760161c7ae7fd54a9db9cffcf inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#a48ae008760161c7ae7fd54a9db9cffcf">V8_DEPRECATE_SOON</a> ("Use maybe version", Local< <a class="el" href="classv8_1_1Uint32.html">Uint32</a> > ToArrayIndex() const)</td></tr>
<tr class="separator:a48ae008760161c7ae7fd54a9db9cffcf inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:abac68de66288d00b3b612c20e5059515 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abac68de66288d00b3b612c20e5059515"></a>
V8_WARN_UNUSED_RESULT <a class="el" href="classv8_1_1MaybeLocal.html">MaybeLocal</a>< <a class="el" href="classv8_1_1Uint32.html">Uint32</a> > </td><td class="memItemRight" valign="bottom"><b>ToArrayIndex</b> (<a class="el" href="classv8_1_1Local.html">Local</a>< <a class="el" href="classv8_1_1Context.html">Context</a> > context) const </td></tr>
<tr class="separator:abac68de66288d00b3b612c20e5059515 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae6e855a09c4b60ec2c4674731d0d365c inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae6e855a09c4b60ec2c4674731d0d365c"></a>
V8_WARN_UNUSED_RESULT <a class="el" href="classv8_1_1Maybe.html">Maybe</a>< bool > </td><td class="memItemRight" valign="bottom"><b>BooleanValue</b> (<a class="el" href="classv8_1_1Local.html">Local</a>< <a class="el" href="classv8_1_1Context.html">Context</a> > context) const </td></tr>
<tr class="separator:ae6e855a09c4b60ec2c4674731d0d365c inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3dcd02e3d5ee791e0c42c7f2ebfedbaf inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3dcd02e3d5ee791e0c42c7f2ebfedbaf"></a>
V8_WARN_UNUSED_RESULT <a class="el" href="classv8_1_1Maybe.html">Maybe</a>< double > </td><td class="memItemRight" valign="bottom"><b>NumberValue</b> (<a class="el" href="classv8_1_1Local.html">Local</a>< <a class="el" href="classv8_1_1Context.html">Context</a> > context) const </td></tr>
<tr class="separator:a3dcd02e3d5ee791e0c42c7f2ebfedbaf inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2163c66da18cfc69b21139496cbed80a inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2163c66da18cfc69b21139496cbed80a"></a>
V8_WARN_UNUSED_RESULT <a class="el" href="classv8_1_1Maybe.html">Maybe</a>< int64_t > </td><td class="memItemRight" valign="bottom"><b>IntegerValue</b> (<a class="el" href="classv8_1_1Local.html">Local</a>< <a class="el" href="classv8_1_1Context.html">Context</a> > context) const </td></tr>
<tr class="separator:a2163c66da18cfc69b21139496cbed80a inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a99b845757d060f581f25df433362b216 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a99b845757d060f581f25df433362b216"></a>
V8_WARN_UNUSED_RESULT <a class="el" href="classv8_1_1Maybe.html">Maybe</a>< uint32_t > </td><td class="memItemRight" valign="bottom"><b>Uint32Value</b> (<a class="el" href="classv8_1_1Local.html">Local</a>< <a class="el" href="classv8_1_1Context.html">Context</a> > context) const </td></tr>
<tr class="separator:a99b845757d060f581f25df433362b216 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a60321e60ce602a225f0acc096af75ee8 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a60321e60ce602a225f0acc096af75ee8"></a>
V8_WARN_UNUSED_RESULT <a class="el" href="classv8_1_1Maybe.html">Maybe</a>< int32_t > </td><td class="memItemRight" valign="bottom"><b>Int32Value</b> (<a class="el" href="classv8_1_1Local.html">Local</a>< <a class="el" href="classv8_1_1Context.html">Context</a> > context) const </td></tr>
<tr class="separator:a60321e60ce602a225f0acc096af75ee8 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aff3530eeb271134bbb0b6206d736f00b inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aff3530eeb271134bbb0b6206d736f00b"></a>
 </td><td class="memItemRight" valign="bottom"><b>V8_DEPRECATE_SOON</b> ("Use maybe version", bool BooleanValue() const)</td></tr>
<tr class="separator:aff3530eeb271134bbb0b6206d736f00b inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2d1835968f05581123c96add5b03c41c inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2d1835968f05581123c96add5b03c41c"></a>
 </td><td class="memItemRight" valign="bottom"><b>V8_DEPRECATE_SOON</b> ("Use maybe version", double NumberValue() const)</td></tr>
<tr class="separator:a2d1835968f05581123c96add5b03c41c inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0b08feca02c1c902c094b23ca245fce5 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0b08feca02c1c902c094b23ca245fce5"></a>
 </td><td class="memItemRight" valign="bottom"><b>V8_DEPRECATE_SOON</b> ("Use maybe version", int64_t IntegerValue() const)</td></tr>
<tr class="separator:a0b08feca02c1c902c094b23ca245fce5 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a67ef6d2af84b297bb1a6d825915c7f0f inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a67ef6d2af84b297bb1a6d825915c7f0f"></a>
 </td><td class="memItemRight" valign="bottom"><b>V8_DEPRECATE_SOON</b> ("Use maybe version", uint32_t Uint32Value() const)</td></tr>
<tr class="separator:a67ef6d2af84b297bb1a6d825915c7f0f inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac091f8bdb5fc293ec803f16b9780a3b5 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac091f8bdb5fc293ec803f16b9780a3b5"></a>
 </td><td class="memItemRight" valign="bottom"><b>V8_DEPRECATE_SOON</b> ("Use maybe version", int32_t Int32Value() const)</td></tr>
<tr class="separator:ac091f8bdb5fc293ec803f16b9780a3b5 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae3528a485935d1b19a0e007cd5a06799 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classv8_1_1Value.html#ae3528a485935d1b19a0e007cd5a06799">V8_DEPRECATE_SOON</a> ("Use maybe version", bool Equals(<a class="el" href="classv8_1_1Local.html">Local</a>< <a class="el" href="classv8_1_1Value.html">Value</a> > that) const)</td></tr>
<tr class="separator:ae3528a485935d1b19a0e007cd5a06799 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad98db94739e250aec626fc443bac7947 inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad98db94739e250aec626fc443bac7947"></a>
V8_WARN_UNUSED_RESULT <a class="el" href="classv8_1_1Maybe.html">Maybe</a>< bool > </td><td class="memItemRight" valign="bottom"><b>Equals</b> (<a class="el" href="classv8_1_1Local.html">Local</a>< <a class="el" href="classv8_1_1Context.html">Context</a> > context, <a class="el" href="classv8_1_1Local.html">Local</a>< <a class="el" href="classv8_1_1Value.html">Value</a> > that) const </td></tr>
<tr class="separator:ad98db94739e250aec626fc443bac7947 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae5742f470be23852222b577ff1f8ad4a inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae5742f470be23852222b577ff1f8ad4a"></a>
bool </td><td class="memItemRight" valign="bottom"><b>StrictEquals</b> (<a class="el" href="classv8_1_1Local.html">Local</a>< <a class="el" href="classv8_1_1Value.html">Value</a> > that) const </td></tr>
<tr class="separator:ae5742f470be23852222b577ff1f8ad4a inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab64798867e84e66d5fa79003dad9d44b inherit pub_methods_classv8_1_1Value"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab64798867e84e66d5fa79003dad9d44b"></a>
bool </td><td class="memItemRight" valign="bottom"><b>SameValue</b> (<a class="el" href="classv8_1_1Local.html">Local</a>< <a class="el" href="classv8_1_1Value.html">Value</a> > that) const </td></tr>
<tr class="separator:ab64798867e84e66d5fa79003dad9d44b inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac2142bb3ec6527633c4f9133e80cdc19 inherit pub_methods_classv8_1_1Value"><td class="memTemplParams" colspan="2"><a class="anchor" id="ac2142bb3ec6527633c4f9133e80cdc19"></a>
template<class T > </td></tr>
<tr class="memitem:ac2142bb3ec6527633c4f9133e80cdc19 inherit pub_methods_classv8_1_1Value"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="classv8_1_1Value.html">Value</a> * </td><td class="memTemplItemRight" valign="bottom"><b>Cast</b> (T *value)</td></tr>
<tr class="separator:ac2142bb3ec6527633c4f9133e80cdc19 inherit pub_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:add1f6084974464105b56595d34c14ab9"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="add1f6084974464105b56595d34c14ab9"></a>
static <a class="el" href="classv8_1_1Local.html">Local</a>< <a class="el" href="classv8_1_1Symbol.html">Symbol</a> > </td><td class="memItemRight" valign="bottom"><b>New</b> (<a class="el" href="classv8_1_1Isolate.html">Isolate</a> *isolate, <a class="el" href="classv8_1_1Local.html">Local</a>< <a class="el" href="classv8_1_1String.html">String</a> > name=<a class="el" href="classv8_1_1Local.html">Local</a>< <a class="el" href="classv8_1_1String.html">String</a> >())</td></tr>
<tr class="separator:add1f6084974464105b56595d34c14ab9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8a4a6bdc7d3e31c71cf48fa5cb811fc8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8a4a6bdc7d3e31c71cf48fa5cb811fc8"></a>
static <a class="el" href="classv8_1_1Local.html">Local</a>< <a class="el" href="classv8_1_1Symbol.html">Symbol</a> > </td><td class="memItemRight" valign="bottom"><b>For</b> (<a class="el" href="classv8_1_1Isolate.html">Isolate</a> *isolate, <a class="el" href="classv8_1_1Local.html">Local</a>< <a class="el" href="classv8_1_1String.html">String</a> > name)</td></tr>
<tr class="separator:a8a4a6bdc7d3e31c71cf48fa5cb811fc8"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac3937f0b0b831c4be495a399f26d7301"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac3937f0b0b831c4be495a399f26d7301"></a>
static <a class="el" href="classv8_1_1Local.html">Local</a>< <a class="el" href="classv8_1_1Symbol.html">Symbol</a> > </td><td class="memItemRight" valign="bottom"><b>ForApi</b> (<a class="el" href="classv8_1_1Isolate.html">Isolate</a> *isolate, <a class="el" href="classv8_1_1Local.html">Local</a>< <a class="el" href="classv8_1_1String.html">String</a> > name)</td></tr>
<tr class="separator:ac3937f0b0b831c4be495a399f26d7301"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a35aa1aca7135c5bf9052d8d067d126b1"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a35aa1aca7135c5bf9052d8d067d126b1"></a>
static <a class="el" href="classv8_1_1Local.html">Local</a>< <a class="el" href="classv8_1_1Symbol.html">Symbol</a> > </td><td class="memItemRight" valign="bottom"><b>GetIterator</b> (<a class="el" href="classv8_1_1Isolate.html">Isolate</a> *isolate)</td></tr>
<tr class="separator:a35aa1aca7135c5bf9052d8d067d126b1"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:acf5b5220a820f6ed1e61500292ebec13"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="acf5b5220a820f6ed1e61500292ebec13"></a>
static <a class="el" href="classv8_1_1Local.html">Local</a>< <a class="el" href="classv8_1_1Symbol.html">Symbol</a> > </td><td class="memItemRight" valign="bottom"><b>GetUnscopables</b> (<a class="el" href="classv8_1_1Isolate.html">Isolate</a> *isolate)</td></tr>
<tr class="separator:acf5b5220a820f6ed1e61500292ebec13"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab595ae7100ce23e4b1677ecab02f5972"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab595ae7100ce23e4b1677ecab02f5972"></a>
static <a class="el" href="classv8_1_1Local.html">Local</a>< <a class="el" href="classv8_1_1Symbol.html">Symbol</a> > </td><td class="memItemRight" valign="bottom"><b>GetToStringTag</b> (<a class="el" href="classv8_1_1Isolate.html">Isolate</a> *isolate)</td></tr>
<tr class="separator:ab595ae7100ce23e4b1677ecab02f5972"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6bb214df5e2d8655379a648530aebaf1"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6bb214df5e2d8655379a648530aebaf1"></a>
static V8_INLINE <a class="el" href="classv8_1_1Symbol.html">Symbol</a> * </td><td class="memItemRight" valign="bottom"><b>Cast</b> (<a class="el" href="classv8_1_1Value.html">v8::Value</a> *obj)</td></tr>
<tr class="separator:a6bb214df5e2d8655379a648530aebaf1"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header pub_static_methods_classv8_1_1Name"><td colspan="2" onclick="javascript:toggleInherit('pub_static_methods_classv8_1_1Name')"><img src="closed.png" alt="-"/> Static Public Member Functions inherited from <a class="el" href="classv8_1_1Name.html">v8::Name</a></td></tr>
<tr class="memitem:a8291aa8958f5dfb67d4415510f584ac4 inherit pub_static_methods_classv8_1_1Name"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8291aa8958f5dfb67d4415510f584ac4"></a>
static V8_INLINE <a class="el" href="classv8_1_1Name.html">Name</a> * </td><td class="memItemRight" valign="bottom"><b>Cast</b> (<a class="el" href="classv8_1_1Value.html">v8::Value</a> *obj)</td></tr>
<tr class="separator:a8291aa8958f5dfb67d4415510f584ac4 inherit pub_static_methods_classv8_1_1Name"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header pub_static_methods_classv8_1_1Value"><td colspan="2" onclick="javascript:toggleInherit('pub_static_methods_classv8_1_1Value')"><img src="closed.png" alt="-"/> Static Public Member Functions inherited from <a class="el" href="classv8_1_1Value.html">v8::Value</a></td></tr>
<tr class="memitem:ae5aa9b54ebed55819c3a4b2a3eb5fe12 inherit pub_static_methods_classv8_1_1Value"><td class="memTemplParams" colspan="2"><a class="anchor" id="ae5aa9b54ebed55819c3a4b2a3eb5fe12"></a>
template<class T > </td></tr>
<tr class="memitem:ae5aa9b54ebed55819c3a4b2a3eb5fe12 inherit pub_static_methods_classv8_1_1Value"><td class="memTemplItemLeft" align="right" valign="top">static V8_INLINE <a class="el" href="classv8_1_1Value.html">Value</a> * </td><td class="memTemplItemRight" valign="bottom"><b>Cast</b> (T *value)</td></tr>
<tr class="separator:ae5aa9b54ebed55819c3a4b2a3eb5fe12 inherit pub_static_methods_classv8_1_1Value"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A JavaScript symbol (ECMA-262 edition 6)</p>
<p>This is an experimental feature. Use at your own risk. </p>
</div><hr/>The documentation for this class was generated from the following file:<ul>
<li>deps/v8/include/<a class="el" href="v8_8h_source.html">v8.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html>
|
v8-dox/v8-dox.github.io
|
d7b81b5/html/classv8_1_1Symbol.html
|
HTML
|
mit
| 60,662
|
<!DOCTYPE html>
<html xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<head>
<meta content="en-us" http-equiv="Content-Language" />
<meta content="text/html; charset=utf-16" http-equiv="Content-Type" />
<title _locid="PortabilityAnalysis0">.NET Portability Report</title>
<style>
/* Body style, for the entire document */
body {
background: #F3F3F4;
color: #1E1E1F;
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
padding: 0;
margin: 0;
}
/* Header1 style, used for the main title */
h1 {
padding: 10px 0px 10px 10px;
font-size: 21pt;
background-color: #E2E2E2;
border-bottom: 1px #C1C1C2 solid;
color: #201F20;
margin: 0;
font-weight: normal;
}
/* Header2 style, used for "Overview" and other sections */
h2 {
font-size: 18pt;
font-weight: normal;
padding: 15px 0 5px 0;
margin: 0;
}
/* Header3 style, used for sub-sections, such as project name */
h3 {
font-weight: normal;
font-size: 15pt;
margin: 0;
padding: 15px 0 5px 0;
background-color: transparent;
}
h4 {
font-weight: normal;
font-size: 12pt;
margin: 0;
padding: 0 0 0 0;
background-color: transparent;
}
/* Color all hyperlinks one color */
a {
color: #1382CE;
}
/* Paragraph text (for longer informational messages) */
p {
font-size: 10pt;
}
/* Table styles */
table {
border-spacing: 0 0;
border-collapse: collapse;
font-size: 10pt;
}
table th {
background: #E7E7E8;
text-align: left;
text-decoration: none;
font-weight: normal;
padding: 3px 6px 3px 6px;
}
table td {
vertical-align: top;
padding: 3px 6px 5px 5px;
margin: 0px;
border: 1px solid #E7E7E8;
background: #F7F7F8;
}
.NoBreakingChanges {
color: darkgreen;
font-weight:bold;
}
.FewBreakingChanges {
color: orange;
font-weight:bold;
}
.ManyBreakingChanges {
color: red;
font-weight:bold;
}
.BreakDetails {
margin-left: 30px;
}
.CompatMessage {
font-style: italic;
font-size: 10pt;
}
.GoodMessage {
color: darkgreen;
}
/* Local link is a style for hyperlinks that link to file:/// content, there are lots so color them as 'normal' text until the user mouse overs */
.localLink {
color: #1E1E1F;
background: #EEEEED;
text-decoration: none;
}
.localLink:hover {
color: #1382CE;
background: #FFFF99;
text-decoration: none;
}
/* Center text, used in the over views cells that contain message level counts */
.textCentered {
text-align: center;
}
/* The message cells in message tables should take up all avaliable space */
.messageCell {
width: 100%;
}
/* Padding around the content after the h1 */
#content {
padding: 0px 12px 12px 12px;
}
/* The overview table expands to width, with a max width of 97% */
#overview table {
width: auto;
max-width: 75%;
}
/* The messages tables are always 97% width */
#messages table {
width: 97%;
}
/* All Icons */
.IconSuccessEncoded, .IconInfoEncoded, .IconWarningEncoded, .IconErrorEncoded {
min-width: 18px;
min-height: 18px;
background-repeat: no-repeat;
background-position: center;
}
/* Success icon encoded */
.IconSuccessEncoded {
/* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */
/* [---XsltValidateInternal-Base64EncodedImage:IconSuccess#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABPElEQVR4Xp1Tv0vDUBi8FqeA4NpBcBLcWnQSApncOnTo4FSnjP0DsnXpH5CxiwbHDg4Zuj4oOEXiJgiC4FDcCkLWmIMc1Pfw+eMgQ77v3Xf3Pe51YKGqqisAEwCR1TIAsiAIblSo6xrdHeJR85Xle3mdmCQKb0PsfqyxxzM8K15HZADl/H5+sHpZwYfxyRjTs+kWwKBx8yoHd2mRiuzF8mkJniWH/13u3Fjrs/EdhsdDFHGB/DLXEJBDLh1MWPAhPo1BLB4WX5yQywHR+m3tVe/t97D52CB/ziG0nIgD/qDuYg8WuCcVZ2YGwlJ3YDugkpR/VNcAEx6GEKhERSr71FuO4YCM4XBdwKvecjIlkSnsO0Hyp/GxSeJAdzBKzpOtnPwyyiPdAZhpZptT04tU+zk7s8czeges//s5C5+CwqrR4/gw+AAAAABJRU5ErkJggg==);
}
/* Information icon encoded */
.IconInfoEncoded {
/* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */
/* [---XsltValidateInternal-Base64EncodedImage:IconInformation#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABHElEQVR4Xs2TsUoDQRRF7wwoziokjZUKadInhdhukR9YP8DMX1hYW+QvdsXa/QHBbcXC7W0CamWTQnclFutceIQJwwaWNLlwm5k5d94M76mmaeCrrmsLYOocY12FcxZFUeozCqKqqgYA8uevv1H6VuPxcwlfk5N92KHBxfFeCSAxxswlYAW/Xr989x/mv9gkhtyMDhcAxgzRsp7flj8B/HF1RsMXq+NZMkopaHe7lbKxQUEIGbKsYNoGn969060hZBkQex/W8oRQwsQaW2o3Ago2SVcJUzAgY3N0lTCZZm+zPS8HB51gMmS1DEYyOz9acKO1D8JWTlafKIMxdhvlfdyT94Vv5h7P8Ky7nQzACmhvKq3zk3PjW9asz9D/1oigecsioooAAAAASUVORK5CYII=);
}
/* Warning icon encoded */
.IconWarningEncoded {
/* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */
/* [---XsltValidateInternal-Base64EncodedImage:IconWarning#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAx0lEQVR4XpWSMQ7CMAxFf4xAyBMLCxMrO8dhaBcuwdCJS3RJBw7SA/QGTCxdWJgiQYWKXJWKIXHIlyw5lqr34tQgEOdcBsCOx5yZK3hCCKdYXneQkh4pEfqzLfu+wVDSyyzFoJjfz9NB+pAF+eizx2Vruts0k15mPgvS6GYvpVtQhB61IB/dk6AF6fS4Ben0uIX5odtFe8Q/eW1KvFeH4e8khT6+gm5B+t3juyDt7n0jpe+CANTd+oTUjN/U3yVaABnSUjFz/gFq44JaVSCXeQAAAABJRU5ErkJggg==);
}
/* Error icon encoded */
.IconErrorEncoded {
/* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */
/* [---XsltValidateInternal-Base64EncodedImage:IconError#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABQElEQVR4XqWTvUoEQRCE6wYPZUA80AfwAQz23uCMjA7MDRQEIzPBVEyNTQUFIw00vcQTTMzuAh/AxEQQT8HF/3G/oGGnEUGuoNnd6qoZuqltyKEsyzVJq5I6rnUp6SjGeGhESikzzlc1eL7opfuVbrqbU1Zw9NCgtQMaZpY0eNnaaL2fHusvTK5vKu7sjSS1Y4y3QUA6K3e3Mau5UFDyMP7tYF9o8cAHZv68vipoIJg971PZIZ5HiwdvYGGvFVFHmGmZ2MxwmQYPXubPl9Up0tfoMQGetXd6mRbvhBw+boZ6WF7Mbv1+GsHRk0fQmPAH1GfmZirbCfDJ61tw3Px8/8pZsPAG4jlVhcPgZ7adwNWBB68lkRQWFiTgFlbnLY3DGGM7izIJIyT/jjIvEJw6fdJTc6krDzh6aMwMP9bvDH4ADSsa9uSWVJkAAAAASUVORK5CYII=);
}
</style>
</head>
<body>
<h1 _locid="PortabilityReport">.NET Portability Report</h1>
<div id="content">
<div id="submissionId" style="font-size:8pt;">
<p>
<i>
Submission Id
e090f130-3c59-43ee-b765-7902ea3d9289
</i>
</p>
</div>
<h2 _locid="SummaryTitle">
<a name="Portability Summary"></a>Portability Summary
</h2>
<div id="summary">
<table>
<tbody>
<tr>
<th>Assembly</th>
<th>ASP.NET 5,Version=v1.0</th>
<th>Windows,Version=v8.1</th>
<th>.NET Framework,Version=v4.6</th>
<th>Windows Phone,Version=v8.1</th>
</tr>
<tr>
<td><strong><a href="#SecureBlackbox.PGPTLS.Async">SecureBlackbox.PGPTLS.Async</a></strong></td>
<td class="text-center">100.00 %</td>
<td class="text-center">100.00 %</td>
<td class="text-center">100.00 %</td>
<td class="text-center">100.00 %</td>
</tr>
</tbody>
</table>
</div>
<div id="details">
</div>
</div>
</body>
</html>
|
kuhlenh/port-to-core
|
Reports/se/secureblackbox.12.0.272/SecureBlackbox.PGPTLS.Async-windowsphone8.html
|
HTML
|
mit
| 9,669
|
// Initialize your app
var myApp = new Framework7({
cache: false,
});
// Export selectors engine
var $$ = Dom7;
// Add views
var leftView = myApp.addView('.view-left', {
// Because we use fixed-through navbar we can enable dynamic navbar
dynamicNavbar: true
,ignoreCache : true
});
var mainView = myApp.addView('.view-main', {
// Because we use fixed-through navbar we can enable dynamic navbar
dynamicNavbar: true
,ignoreCache : true
});
myApp.pageData = {'sliders' : {'clockIn' : {'value' : 0 , outputHour : 0, outputMins: 0}, 'clockOut' : {'value' : 0, outputHour : 0, outputMins: 0} }}
myApp.onPageInit('ClockIn special', function (page) {
myApp.options = {};
myApp.options.StartHour = 5;
//Clear div
// $$('.ajaxResult1');.html('..');
$$('.inputStartHour').val(myApp.options.StartHour);
myApp.CalculateHoursWorked = function(){
//Figure out hours worked by blocks.
var CheckInTime = $$('.inputCheckInTime').val();
var CheckOutTime = $$('.inputCheckOutTime').val();
var CheckInArray = CheckInTime.split(':');
var CheckOutArray = CheckOutTime.split(':');
var InMinutes = (parseFloat(CheckInArray[0],2) * 60 )+ parseFloat(CheckInArray[1]);
var OutMinutes = (parseFloat(CheckOutArray[0],2) * 60 )+ parseFloat(CheckOutArray[1]);
hoursWorked = hoursTohhmm((OutMinutes - InMinutes) /60);
$$('.hourWorked').html(hoursWorked +' hours. ' );
$$('.clockHoursWorked').val(hoursWorked +' hours. ');
}
myApp.SliderToTime = function (sliderValue) {
//Start at 5am and create increments for each minute to midnight
var startTime = 60 * myApp.options.StartHour;
var maxTime = 60 * 24;
var totalMins = maxTime - startTime;
var outputValue = (totalMins / 100) * sliderValue;
var inMins = (outputValue / 60 ) + 5 ;
var outputHour = Math.floor(inMins);
var theMins = (inMins - outputHour) * 100;;
var outputMins = 0;
//Set out intervals of 15 mins.
if (theMins < 25){
outputMins = '00';
}else if (theMins < 50){
outputMins = '15';
} else if (theMins < 75) {
outputMins = '30';
}else if (theMins < 100) {
outputMins = '45';
} else {
outputMins = '45';
}
return myApp.Time24To12({ 'outputMins' : outputMins, 'outputHour' : outputHour , 'ampm' : '', 'pmHour': outputHour});
}
myApp.TimeToSlider = function(Hour, Min ){
//5am start.
var startTime = 60 * myApp.options.StartHour;
var maxTime = 60 * 24;
var totalMins = maxTime - startTime;
var TotalMinutesSelected = ((Hour - myApp.options.StartHour) * 60 )+ Min;
var perc = TotalMinutesSelected / totalMins;
return TimeToSlider;
}
myApp.Time24To12 = function(TimeArray) {
if (TimeArray.outputHour > 12){
TimeArray.ampm = 'PM';
TimeArray.pmHour = TimeArray.outputHour - 12;
} else {
TimeArray.ampm = 'AM';
}
return TimeArray;
}
$$('.clockInSliderPosition').on('input change', function(){
Output = myApp.SliderToTime(this.value);
$$('.clockinSelectOutput').html( Output.pmHour + ':' + Output.outputMins + ' ' + Output.ampm);
$$('.inputCheckInTime').val(Output.outputHour + ':' + Output.outputMins);
myApp.pageData.sliders.clockIn.outputHour = Output.outputHour;
myApp.pageData.sliders.clockIn.outputMins = Output.outputMins;
myApp.pageData.sliders.clockIn.value = this.value;
myApp.CalculateHoursWorked();
});
myApp.CalculateSliderHours = function(){
Output = myApp.SliderToTime(this.value);
$$('.clockOutSelectOutput').html( Output.pmHour + ':' + Output.outputMins+ ' ' + Output.ampm);
$$('.inputCheckOutTime').val(Output.outputHour + ':' + Output.outputMins);
myApp.pageData.sliders.clockOut.outputHour = Output.outputHour;
myApp.pageData.sliders.clockOut.outputMins = Output.outputMins;
myApp.pageData.sliders.clockOut.value = this.value;
myApp.CalculateHoursWorked();
}
$$('.clockOutSliderPosition').on('input change', myApp.CalculateSliderHours );
//Form Submit variables
$$('form.ajax-submit').on('submitError', function (e) {
alert('An error has occured while recording your ClockIn Details. Please record on paper and contact Toby.');
});
$$('.btnsavedone').on('click' , function(){
// alert('ha');
myApp.BtnSaveDoneClicked = true;
$$('.debugout').html($$('.debugout').html() + ';' );
})
$$('form.ajax-submit').on('submitted', function (e) {
var ajaxResultDiv = $$('.ajaxResult1');
$$('.debugout').html($$('.debugout').html() + 'x' );
if (myApp.BtnSaveDoneClicked == true){
// Initialize View
var mainView = myApp.addView('.view-main')
$$('.debugout').html($$('.debugout').html() + 'y' );
// Load page from about.html file to main View:
//var empid = $$('input:[name=employeeID]').val();
//mainView.router.loadPage('done.php?id=' + empid);
//alert($$('.input_employeeid').val() + ' ' + 'done.php?id=' + $$('#employeeID').val() );
var empid = $$( e.currentTarget ).find('input.employeeID')
mainView.router.loadPage('done.php?id=' + $$(empid).val());
}
myApp.BtnSaveDoneClicked = false;
// var data = e.detail.data; // Ajax response from action file
// do something with response data
//alert( e.detail.stringify());
// ajaxResultDiv.html(data);
})
});
function hoursTohhmm(hours){
var sign = hours < 0 ? "-" : "";
var h = Math.floor(Math.abs(hours))
var m = Math.floor((Math.abs(hours) * 60) % 60);
return sign + (h < 10 ? "0" : "") + h + ":" + (m < 10 ? "0" : "") + m;
}
|
tobya/wageminder
|
clockin/js/my-app.js
|
JavaScript
|
mit
| 5,892
|
@import url(http://weloveiconfonts.com/api/?family=Arial);
/* brandico */
[class*="brandico-"]:before {
font-family: 'Arial', sans-serif;
}
* {
box-sizing: border-box;
}
html, body {
height: 100%;
}
.wrap {
position: relative;
height: 88%;
min-height: 500px;
padding:0px 0 20px;
width:90%;
margin:0 auto;
}
.game {
-webkit-transform-style: preserve-3d;
transform-style: preserve-3d;
-webkit-perspective: 500px;
perspective: 500px;
min-height: 100%;
/*height: 100%;*/
height:460px;
}
@-webkit-keyframes matchAnim {
0% {
background: #bcffcc;
}
100% {
background: white;
}
}
@keyframes matchAnim {
0% {
background: #bcffcc;
}
100% {
background: white;
}
}
.card {
float: left;
width: 12.5%;
height: 25%;
padding: 5px;
text-align: center;
display: block;
-webkit-perspective: 500px;
perspective: 500px;
position: relative;
cursor: pointer;
z-index: 50;
-webkit-tap-highlight-color: transparent;
}
@media (max-width: 800px) {
.card {
width: 25%;
height: 30.666%; /*16.666%;*/
}
}
@media(max-width:480px){
.card {
width: 25%;
height: 22.666%; /*16.666%;*/
}
}
.card .inside {
width: 100%;
height: 100%;
display: block;
-webkit-transform-style: preserve-3d;
transform-style: preserve-3d;
-webkit-transition: .4s ease-in-out;
transition: .4s ease-in-out;
/*background: white;*/
/*background:url(../images/hinhchualat_1.png) no-repeat top center / 90%;*/
}
.card .inside.picked, .card .inside.matched {
-webkit-transform: rotateY(180deg);
transform: rotateY(180deg);
}
.card .inside.matched {
-webkit-animation: 1s matchAnim ease-in-out;
animation: 1s matchAnim ease-in-out;
-webkit-animation-delay: .4s;
animation-delay: .4s;
}
.card .front, .card .back {
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.card .front img, .card .back img {
max-width: 100%;
display: block;
margin: 0 auto;
max-height: 100%;
}
.card .front {
-webkit-transform: rotateY(-180deg);
transform: rotateY(-180deg);
}
@media (max-width: 800px) {
.card .front {
padding: 5px;
}
}
@media (max-width: 800px) {
.card .back {
padding: 10px;
}
}
.modal .winner {
font-size: 80px;
text-align: center;
font-family: "Arial", sans-serif;
color: #4d4d4d;
text-shadow: 0px 3px 0 black;
}
@media (max-width: 480px) {
.modal .winner {
font-size: 60px;
}
}
.modal .restart {
font-family: "Arial", sans-serif;
margin: 30px auto;
padding: 20px 30px;
display: block;
font-size: 30px;
border: none;
background: #4d4d4d;
background: -webkit-linear-gradient(#4d4d4d, #222);
background: linear-gradient(#4d4d4d, #222);
border: 1px solid #222;
border-radius: 5px;
color: white;
text-shadow: 0px 1px 0 black;
cursor: pointer;
}
.modal .restart:hover {
background: -webkit-linear-gradient(#222, black);
background: linear-gradient(#222, black);
}
.modal .message {
text-align: center;
}
.modal .message a {
text-decoration: none;
color: #28afe6;
font-weight: bold;
}
.modal .message a:hover {
color: #56c0eb;
border-bottom: 1px dotted #56c0eb;
}
.modal .share-text {
text-align: center;
margin: 10px auto;
}
.modal .social {
margin: 20px auto;
text-align: center;
}
.modal .social li {
display: inline-block;
height: 50px;
width: 50px;
margin-right: 10px;
}
.modal .social li:last-child {
margin-right: 0;
}
.modal .social li a {
display: block;
line-height: 50px;
font-size: 20px;
color: white;
text-decoration: none;
border-radius: 5px;
}
.modal .social li a.facebook {
background: #3b5998;
}
.modal .social li a.facebook:hover {
background: #4c70ba;
}
.modal .social li a.google {
background: #D34836;
}
.modal .social li a.google:hover {
background: #dc6e60;
}
.modal .social li a.twitter {
background: #4099FF;
}
.modal .social li a.twitter:hover {
background: #73b4ff;
}
|
nhatthienlongdaihiep/tkkd_xungba
|
static/xungba/css/lathinh.css
|
CSS
|
mit
| 4,069
|
Bitcoin 0.8.6 BETA
====================
Copyright (c) 2009-2013 Bitcoin Developers
Distributed under the MIT/X11 software license, see the accompanying
file COPYING or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in the [OpenSSL Toolkit](http://www.openssl.org/). This product includes
cryptographic software written by Eric Young ([eay@cryptsoft.com](mailto:eay@cryptsoft.com)), and UPnP software written by Thomas Bernard.
Intro
---------------------
Bitcoin is a free open source peer-to-peer electronic cash system that is
completely decentralized, without the need for a central server or trusted
parties. Users hold the crypto keys to their own money and transact directly
with each other, with the help of a P2P network to check for double-spending.
Setup
---------------------
You need the Qt4 run-time libraries to run TotallyLegitCoin-Qt. On Debian or Ubuntu:
`sudo apt-get install libqtgui4`
Unpack the files into a directory and run:
- bin/32/bitcoin-qt (GUI, 32-bit)
- bin/32/totallylegitcoind (headless, 32-bit)
- bin/64/bitcoin-qt (GUI, 64-bit)
- bin/64/totallylegitcoind (headless, 64-bit)
See the documentation at the [Bitcoin Wiki](https://en.bitcoin.it/wiki/Main_Page)
for help and more information.
Other Pages
---------------------
- [Unix Build Notes](build-unix.md)
- [OSX Build Notes](build-osx.md)
- [Windows Build Notes](build-msw.md)
- [Coding Guidelines](coding.md)
- [Release Process](release-process.md)
- [Release Notes](release-notes.md)
- [Multiwallet Qt Development](multiwallet-qt.md)
- [Unit Tests](unit-tests.md)
- [Translation Process](translation_process.md)
|
totallylegitbiz/totallylegitcoin
|
doc/README.md
|
Markdown
|
mit
| 1,690
|
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>W29196_text</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div style="margin-left: auto; margin-right: auto; width: 800px; overflow: hidden;">
<div style="float: left;">
<a href="page73.html">«</a>
</div>
<div style="float: right;">
</div>
</div>
<hr/>
<div style="position: absolute; margin-left: 385px; margin-top: 137px;">
<p class="styleSans729.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">AREA OF DISTUREANCE 8.3 ACRESi ,T: “u :a .I nun <br/>[my D 5—19 I . MILDRED 7—I9H 2222. HILDRDB— 9H! 22 I .8 -: I' II 6601 2228.1 RENNER a”: 7— 0H . RENNERFELDT 8—30H1 222 <br/>UHP— OHP— OHF— GNP—— <br/>QVERHEAD POWER LINE <br/>I <br/>I <br/>I <br/>I <br/>I <br/>| LL 2 3 z :3 § In <br/>I 3 O c: <2 é E <br/>W éhLTstE'CAL'EE <br/>CONTINENTAL RESOURCES INC. CUBIC YARDS ARE STAKED <br/>Po Box 268870 255931?” 3’32? wan: AA _ OKLAHOMA CITY, OKLAHOMA 73126 —‘—-E 3%? ELEVA TOTAL CUT: 27,529 CUBIC YARDS ‘ BACKSLOPES <br/>TOTAL FILL: 15,847 CUBIC YARDS ASSUME) DRILLING RIG LAYOUT Use excess materials in access road fill AT 1 1/2 5 1 % <br/>SECTION 19. T155N, R98W I WILLIAMS COUNTY. NORTH DAKOTA Finished Rig Grade Elevation: 222:5 ft. ASL <br/>DRAFT: HEDGE SCALE 1 = 100' DATE: 4—5-2013 PROJECT NO. 12—10 <br/> </p>
</div>
</body>
</html>
|
datamade/elpc_bakken
|
ocr_extracted/W29196_text/page74.html
|
HTML
|
mit
| 1,620
|
<?php
namespace Tests\QueryBuilder\PostgreSQL;
use Furry\Database;
trait Table
{
/**
* @dataProvider tableNameProvider
*
* @param $tableName
* @param $expected
*/
public function testTable($tableName, $expected)
{
/** @var Database $db */
$db = $this->db;
$query = $db->table($tableName);
$class = new \ReflectionClass('\Furry\Database\Query');
$property = $class->getProperty("table");
$property->setAccessible(true);
$tableName = $property->getValue($query);
$this->assertEquals($expected, $tableName);
}
/**
* escaped table names
* @return array
*/
public function tableNameProvider()
{
return [
['testTable', '"testTable"'],
['testTable as t', '"testTable" AS "t"']
];
}
}
|
gpawru/furry-framework-database
|
Tests/QueryBuilder/PostgreSQL/Table.php
|
PHP
|
mit
| 861
|
# frozen_string_literal: true
require "test_helper"
describe Committee::Drivers::OpenAPI2::ParameterSchemaBuilder do
before do
end
it "reflects a basic type into a schema" do
data = {
"parameters" => [
{
"name" => "limit",
"type" => "integer",
}
]
}
schema, schema_data = call(data)
assert_nil schema_data
assert_equal ["limit"], schema.properties.keys
assert_equal [], schema.required
assert_equal ["integer"], schema.properties["limit"].type
assert_nil schema.properties["limit"].enum
assert_nil schema.properties["limit"].format
assert_nil schema.properties["limit"].pattern
assert_nil schema.properties["limit"].min_length
assert_nil schema.properties["limit"].max_length
assert_nil schema.properties["limit"].min_items
assert_nil schema.properties["limit"].max_items
assert_nil schema.properties["limit"].unique_items
assert_nil schema.properties["limit"].min
assert_nil schema.properties["limit"].min_exclusive
assert_nil schema.properties["limit"].max
assert_nil schema.properties["limit"].max_exclusive
assert_nil schema.properties["limit"].multiple_of
end
it "reflects a required property into a schema" do
data = {
"parameters" => [
{
"name" => "limit",
"required" => true,
}
]
}
schema, schema_data = call(data)
assert_nil schema_data
assert_equal ["limit"], schema.required
end
it "reflects an array with an items schema into a schema" do
data = {
"parameters" => [
{
"name" => "tags",
"type" => "array",
"minItems" => 1,
"maxItems" => 10,
"uniqueItems" => true,
"items" => {
"type" => "string"
}
}
]
}
schema, schema_data = call(data)
assert_nil schema_data
assert_equal ["array"], schema.properties["tags"].type
assert_equal 1, schema.properties["tags"].min_items
assert_equal 10, schema.properties["tags"].max_items
assert_equal true, schema.properties["tags"].unique_items
assert_equal({ "type" => "string" }, schema.properties["tags"].items)
end
it "reflects a enum property into a schema" do
data = {
"parameters" => [
{
"name" => "type",
"type" => "string",
"enum" => ["hoge", "fuga"]
}
]
}
schema, schema_data = call(data)
assert_nil schema_data
assert_equal ["hoge", "fuga"], schema.properties["type"].enum
end
it "reflects string properties into a schema" do
data = {
"parameters" => [
{
"name" => "password",
"type" => "string",
"format" => "password",
"pattern" => "[a-zA-Z0-9]+",
"minLength" => 6,
"maxLength" => 30
}
]
}
schema, schema_data = call(data)
assert_nil schema_data
assert_equal "password", schema.properties["password"].format
assert_equal Regexp.new("[a-zA-Z0-9]+"), schema.properties["password"].pattern
assert_equal 6, schema.properties["password"].min_length
assert_equal 30, schema.properties["password"].max_length
end
it "reflects number properties into a schema" do
data = {
"parameters" => [
{
"name" => "limit",
"type" => "integer",
"minimum" => 20,
"exclusiveMinimum" => true,
"maximum" => 100,
"exclusiveMaximum" => false,
"multipleOf" => 10
}
]
}
schema, schema_data = call(data)
assert_nil schema_data
assert_equal 20, schema.properties["limit"].min
assert_equal true, schema.properties["limit"].min_exclusive
assert_equal 100, schema.properties["limit"].max
assert_equal false, schema.properties["limit"].max_exclusive
assert_equal 10, schema.properties["limit"].multiple_of
end
it "returns schema data for a body parameter" do
data = {
"parameters" => [
{
"name" => "payload",
"in" => "body",
"schema" => {
"$ref" => "#/definitions/foo",
}
}
]
}
schema, schema_data = call(data)
assert_nil schema
assert_equal({ "$ref" => "#/definitions/foo" }, schema_data)
end
it "requires that certain fields are present" do
data = {
"parameters" => [
{
}
]
}
e = assert_raises ArgumentError do
call(data)
end
assert_equal "Committee: no name section in link data.", e.message
end
it "requires that body parameters not be mixed with form parameters" do
data = {
"parameters" => [
{
"name" => "payload",
"in" => "body",
},
{
"name" => "limit",
"in" => "form",
},
]
}
e = assert_raises ArgumentError do
call(data)
end
assert_equal "Committee: can't mix body parameter with form parameters.",
e.message
end
def call(data)
Committee::Drivers::OpenAPI2::ParameterSchemaBuilder.new(data).call
end
end
|
interagent/committee
|
test/drivers/open_api_2/parameter_schema_builder_test.rb
|
Ruby
|
mit
| 5,146
|
from schedulerEdge import SchedulerEdge
import time
if __name__ == '__main__':
#scheduler = BackgroundScheduler()
#scheduler.add_job(tick, 'cron', second = '5,10',minute = '40' , id = "12")
#scheduler.start()
#while True:
# time.sleep(1)
test_sched = SchedulerEdge()
#test_sched.add_job(3)
test_sched.add_job('{ "modo": "cron", "info": {"second": "5", "minute": "*/1", "hour": "*", "day": "*", "week": "*", "month": "*", "year": "*" }}')
#test_sched.add_job('interval-12')
#test_sched.add_job('interval-45')
#time.sleep(2)
#test_sched.remove_job('interval-45')
|
hubertokf/lupsEdgeServer
|
projects/old_files/moduleOfRules/testesched.py
|
Python
|
mit
| 613
|
<!DOCTYPE html>
<html>
{{ partial "header.html" .}}
<body>
{{ partial "nav.html" .}}
<script type="text/javascript">setActive("design");</script>
<div class="postliste">
<div class="container">
{{- range .Data.Pages }}
<div class="bildebe">
<a href="{{ .Permalink }}">
<h1>{{ .Title }}</h1>
{{if isset .Params "featured_image" }}
<img id="topbilde" src="{{ .Permalink }}{{ index .Params "featured_image" }}">
{{ end }}
</div>
{{- end }}
</a>
</div>
</div>
{{ partial "footer.html" .}}
</body>
</html>
|
klyngen/HUGO-portfolio-tema
|
layouts/section/design.html
|
HTML
|
mit
| 618
|
export const ic_system_update = {"viewBox":"0 0 24 24","children":[{"name":"path","attribs":{"d":"M0 0h24v24H0z","fill":"none"},"children":[]},{"name":"path","attribs":{"d":"M17 1.01L7 1c-1.1 0-2 .9-2 2v18c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V3c0-1.1-.9-1.99-2-1.99zM17 19H7V5h10v14zm-1-6h-3V8h-2v5H8l4 4 4-4z"},"children":[]}]};
|
wmira/react-icons-kit
|
src/md/ic_system_update.js
|
JavaScript
|
mit
| 324
|
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Jison, parse table visualation page</title>
<script src="http://explorercanvas.googlecode.com/svn-history/r48/tags/m3/excanvas.compiled.js"></script>
<script src="http://github.com/zaach/jison/raw/master/web/content/assets/js/jquery.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script>
<script src="https://raw.github.com/sporritt/jsPlumb/master/archive/jsPlumb-0.0.3-min.js"></script>
<script src="http://github.com/zaach/jison/raw/master/web/content/assets/js/json2.js"></script>
<script src="http://github.com/zaach/jison/raw/master/web/content/assets/js/es5.js"></script>
<script src="http://github.com/zaach/jison/raw/master/web/content/assets/js/lib/jison/lexer.js"></script>
<script src="http://github.com/zaach/jison/raw/master/web/content/assets/js/lib/jison/util/typal.js"></script>
<script src="http://github.com/zaach/jison/raw/master/web/content/assets/js/lib/jison/util/set.js"></script>
<script src="http://github.com/zaach/jison/raw/master/web/content/assets/js/lib/jison/util/bnf-parser.js"></script>
<script src="http://github.com/zaach/jison/raw/master/web/content/assets/js/lib/jison/bnf.js"></script>
<script src="http://github.com/zaach/jison/raw/master/web/content/assets/js/lib/jison.js"></script>
<script>
function run() {
var parser = buildGrammar($('#grammar').val());
console.log(parser);
parser.states.forEach(addState);
parser.states.forEach(linkNodes);
}
function buildGrammar(val) {
var type = $('#type')[0].options[$('#type')[0].selectedIndex].value || 'slr';
var grammar = val;
var cfg;
try {
cfg = JSON.parse(grammar);
} catch(e) {
try {
cfg = bnf.parse(grammar);
} catch (e) {
return alert('Oops. Make sure your grammar is in the correct format.\n' + e);
}
}
Jison.print = function () {};
return new Jison.Generator(cfg, {
type: type,
noDefaultResolve: true
});
}
function linkNodes(state, i) {
var node = $('#state_' + i);
for (var edge in state.edges) {
if (state.edges.hasOwnProperty(edge)) {
node.plumb({
target: 'state_' + state.edges[edge]
});
}
}
}
function addState(state, i) {
var node = $('<div class="state">').attr('id', 'state_' + i).css({
top: i * 270,
left: i * 250
}).html(state.join('<br />'));
$('#states').append(node);
}
$(document).ready(function () {
jsPlumb.DEFAULT_DRAG_OPTIONS = {
cursor: 'pointer',
zIndex: 2000
};
jsPlumb.DEFAULT_PAINT_STYLE = {
lineWidth: 10,
strokeStyle: 'rgba(0, 0, 200, 0.5)'
};
$('#process_btn').click(run);
});
</script>
<style>
#states {
position: relative;
}
.state {
font-size: 13px;
font-family: monospace;
position: absolute;
z-index: 20;
opacity: 0.8;
background: #ddd;
width: 200px;
height: 200px;
overflow: auto;
padding: 1em;
}
</style>
</head>
<body>
<textarea id="grammar" rows="20" cols="80">
{
"tokens": "ZERO PLUS",
"bnf": {
"E" :[ "E PLUS T",
"T" ],
"T" :[ "ZERO" ]
}
}
</textarea>
<p>
Algorithm: <select id="type">
<option value="lr0">LR(0)</option>
<option value="slr">SLR(1)</option>
<option value="lr">LR(1)</option>
</select>
<small>* WARNING: LR(1) may take considerable time to execute for large/ambiguous grammars.</small>
</p>
<p><button id="process_btn">Process Grammar</button>
</p>
<div id="states">
</div>
</body>
</html>
|
GerHobbelt/jison
|
web/jison/states.html
|
HTML
|
mit
| 4,070
|
define(["app/helpers"], function(helpers) {
return ["$http", function($http) {
// This is a constructor function for the singleton SnippetLoader service. It will be called exactly once by the AngularJS Dependecy Injector.
this.loadContentTemplate = function(contentType) {
return new Promise(function(resolve, reject) {
console.log("Loading content template of type:", contentType);
if (!contentType)
contentType = "_undefined";
$http.get("snippets/content_templates/" + contentType + ".json").then(function(r) {
var template = r.data;
console.log("Received content template:", template);
resolve(template);
}).catch(function (e) {
console.error("Error requesting content template:", e);
reject(e);
})
});
};
this.loadPageTemplate = function(type) {
return this.loadContentTemplate(type).then(function(t) {
t.id = helpers.generateGuid();
return t;
}).catch(function(e) {
console.error("Unable to load page template", e);
});
}
this.loadQuestionTemplate = function(type) {
return this.loadContentTemplate(type).then(function(t) {
t.id = helpers.generateGuid();
return t;
}).catch(function(e) {
console.error("Unable to load question template", e);
});
}
}];
});
|
ucam-cl-dtg/scooter
|
app/js/app/services/SnippetLoader.js
|
JavaScript
|
mit
| 1,288
|
import os.path
import sqlite3
from config import CONFIG
def init_db():
"""初始化数据库"""
f = os.path.exists(CONFIG['DB_FILE'])
if f:
print("数据库文件存在...")
with open(CONFIG['SQL_SCRIPT_FILE'], 'r', encoding='utf8') as f:
file_content = f.read()
con = sqlite3.connect(CONFIG['DB_FILE'])
cur = con.cursor()
cur.executescript(file_content)
con.commit()
con.close()
return "初始化数据库完成!"
print(init_db())
|
zzir/white
|
init_db.py
|
Python
|
mit
| 493
|
using UnityEngine;
using System.Collections;
public class SpeedSynchro : MonoBehaviour {
private VelocityFPC vfpc;
private RelativisticObject obj;
// Use this for initialization
void Start () {
vfpc = this.GetComponent<VelocityFPC>();
obj = this.GetComponent<RelativisticObject>();
}
// Update is called once per frame
void Update () {
obj.viw = vfpc.vitesse;
}
}
|
stonneau/Celerity
|
Sources/Assets/OpenRelativity/SpeedSynchro.cs
|
C#
|
mit
| 385
|
class CreateSubscribers < ActiveRecord::Migration
def self.up
create_table :subscribers do |t|
t.string :name
t.string :email
t.timestamps
end
end
def self.down
drop_table :subscribers
end
end
|
beef/Subscribers
|
generators/subscribers_migration/templates/migration.rb
|
Ruby
|
mit
| 237
|
/*
* Copyright (c) 2012 Adobe Systems Incorporated. All rights reserved.
*
* 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.
*
*/
/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50, regexp: true */
/*global define, $, _parseRuleList: true */
// JSLint Note: _parseRuleList() is cyclical dependency, not a global function.
// It was added to this list to prevent JSLint warning about being used before being defined.
/**
* Set of utilities for simple parsing of CSS text.
*/
define(function (require, exports, module) {
"use strict";
var CodeMirror = require("thirdparty/CodeMirror2/lib/codemirror"),
Async = require("utils/Async"),
DocumentManager = require("document/DocumentManager"),
EditorManager = require("editor/EditorManager"),
HTMLUtils = require("language/HTMLUtils"),
ProjectManager = require("project/ProjectManager"),
TokenUtils = require("utils/TokenUtils"),
_ = require("thirdparty/lodash");
// Constants
var SELECTOR = "selector",
PROP_NAME = "prop.name",
PROP_VALUE = "prop.value",
IMPORT_URL = "import.url";
var RESERVED_FLOW_NAMES = ["content", "element"],
INVALID_FLOW_NAMES = ["none", "inherit", "default", "auto", "initial"],
IGNORED_FLOW_NAMES = RESERVED_FLOW_NAMES.concat(INVALID_FLOW_NAMES);
/**
* @private
* Checks if the current cursor position is inside the property name context
* @param {editor:{CodeMirror}, pos:{ch:{string}, line:{number}}, token:{object}} context
* @return {boolean} true if the context is in property name
*/
function _isInPropName(ctx) {
var state,
lastToken;
if (!ctx || !ctx.token || !ctx.token.state || ctx.token.type === "comment") {
return false;
}
state = ctx.token.state.localState || ctx.token.state;
if (!state.context) {
return false;
}
lastToken = state.context.type;
return (lastToken === "{" || lastToken === "rule" || lastToken === "block");
}
/**
* @private
* Checks if the current cursor position is inside the property value context
* @param {editor:{CodeMirror}, pos:{ch:{string}, line:{number}}, token:{object}} context
* @return {boolean} true if the context is in property value
*/
function _isInPropValue(ctx) {
function isInsideParens(context) {
if (context.type !== "parens" || !context.prev) {
return false;
}
if (context.prev.type === "prop") {
return true;
}
return isInsideParens(context.prev);
}
var state;
if (!ctx || !ctx.token || !ctx.token.state || ctx.token.type === "comment") {
return false;
}
state = ctx.token.state.localState || ctx.token.state;
if (!state.context || !state.context.prev) {
return false;
}
return ((state.context.type === "prop" &&
(state.context.prev.type === "rule" || state.context.prev.type === "block")) ||
isInsideParens(state.context));
}
/**
* @private
* Checks if the current cursor position is inside an at-rule
* @param {editor:{CodeMirror}, pos:{ch:{string}, line:{number}}, token:{object}} context
* @return {boolean} true if the context is in property value
*/
function _isInAtRule(ctx) {
var state;
if (!ctx || !ctx.token || !ctx.token.state) {
return false;
}
state = ctx.token.state.localState || ctx.token.state;
if (!state.context) {
return false;
}
return (state.context.type === "at");
}
/**
* @private
* Creates a context info object
* @param {string=} context A constant string
* @param {number=} offset The offset of the token for a given cursor position
* @param {string=} name Property name of the context
* @param {number=} index The index of the property value for a given cursor position
* @param {Array.<string>=} values An array of property values
* @param {boolean=} isNewItem If this is true, then the value in index refers to the index at which a new item
* is going to be inserted and should not be used for accessing an existing value in values array.
* @param {{start: {line: number, ch: number},
* end: {line: number, ch: number}}=} range A range object with a start position and an end position
* @return {{context: string,
* offset: number,
* name: string,
* index: number,
* values: Array.<string>,
* isNewItem: boolean,
* range: {start: {line: number, ch: number},
* end: {line: number, ch: number}}}} A CSS context info object.
*/
function createInfo(context, offset, name, index, values, isNewItem, range) {
var ruleInfo = { context: context || "",
offset: offset || 0,
name: name || "",
index: -1,
values: [],
isNewItem: (isNewItem === true),
range: range };
if (context === PROP_VALUE || context === SELECTOR || context === IMPORT_URL) {
ruleInfo.index = index;
ruleInfo.values = values;
}
return ruleInfo;
}
/**
* @private
* Scan backwards to check for any prefix if the current context is property name.
* If the current context is in a prefix (either 'meta' or '-'), then scan forwards
* to collect the entire property name. Return the name of the property in the CSS
* context info object if there is one that seems to be valid. Return an empty context
* info when we find an invalid one.
*
* @param {editor:{CodeMirror}, pos:{ch:{string}, line:{number}}, token:{object}} ctx context
* @return {{context: string,
* offset: number,
* name: string,
* index: number,
* values: Array.<string>,
* isNewItem: boolean,
* range: {start: {line: number, ch: number},
* end: {line: number, ch: number}}}} A CSS context info object.
*/
function _getPropNameInfo(ctx) {
var propName = "",
offset = TokenUtils.offsetInToken(ctx),
tokenString = ctx.token.string,
excludedCharacters = [";", "{", "}"];
if (ctx.token.type === "property" || ctx.token.type === "property error" ||
ctx.token.type === "tag") {
propName = tokenString;
if (TokenUtils.movePrevToken(ctx) && /\S/.test(ctx.token.string) &&
excludedCharacters.indexOf(ctx.token.string) === -1) {
propName = ctx.token.string + tokenString;
offset += ctx.token.string.length;
}
} else if (ctx.token.type === "meta" || tokenString === "-") {
propName = tokenString;
if (TokenUtils.moveNextToken(ctx) &&
(ctx.token.type === "property" || ctx.token.type === "property error" ||
ctx.token.type === "tag")) {
propName += ctx.token.string;
}
} else if (/\S/.test(tokenString) && excludedCharacters.indexOf(tokenString) === -1) {
// We're not inside the property name context.
return createInfo();
} else {
var testPos = {ch: ctx.pos.ch + 1, line: ctx.pos.line},
testToken = ctx.editor.getTokenAt(testPos, true);
if (testToken.type === "property" || testToken.type === "property error" ||
testToken.type === "tag") {
propName = testToken.string;
offset = 0;
}
}
// If we're in the property name context but not in an existing property name,
// then reset offset to zero.
if (propName === "") {
offset = 0;
}
return createInfo(PROP_NAME, offset, propName);
}
/**
* @private
* Scans backwards from the current context and returns the name of the property if there is
* a valid one.
* @param {editor:{CodeMirror}, pos:{ch:{string}, line:{number}}, token:{object}} context
* @return {string} the property name of the current rule.
*/
function _getPropNameStartingFromPropValue(ctx) {
var ctxClone = $.extend({}, ctx),
propName = "";
do {
// If we're no longer in the property value before seeing a colon, then we don't
// have a valid property name. Just return an empty string.
if (ctxClone.token.string !== ":" && !_isInPropValue(ctxClone)) {
return "";
}
} while (ctxClone.token.string !== ":" && TokenUtils.moveSkippingWhitespace(TokenUtils.movePrevToken, ctxClone));
if (ctxClone.token.string === ":" && TokenUtils.moveSkippingWhitespace(TokenUtils.movePrevToken, ctxClone) &&
(ctxClone.token.type === "property" || ctxClone.token.type === "property error")) {
propName = ctxClone.token.string;
if (TokenUtils.movePrevToken(ctxClone) && ctxClone.token.type === "meta") {
propName = ctxClone.token.string + propName;
}
}
return propName;
}
/**
* @private
* Gets all of the space/comma seperated tokens before the the current cursor position.
* @param {editor:{CodeMirror}, pos:{ch:{string}, line:{number}}, token:{object}} context
* @return {?Array.<string>} An array of all the space/comma seperated tokens before the
* current cursor position
*/
function _getPrecedingPropValues(ctx) {
var lastValue = "",
curValue,
propValues = [];
while (ctx.token.string !== ":" && TokenUtils.movePrevToken(ctx)) {
if (ctx.token.string === ":" || !_isInPropValue(ctx)) {
break;
}
curValue = ctx.token.string;
if (lastValue !== "") {
curValue += lastValue;
}
if ((ctx.token.string.length > 0 && !ctx.token.string.match(/\S/)) ||
ctx.token.string === ",") {
lastValue = curValue;
} else {
lastValue = "";
if (propValues.length === 0 || curValue.match(/,\s*$/)) {
// stack is empty, or current value ends with a comma
// (and optional whitespace), so push it on the stack
propValues.push(curValue);
} else {
// current value does not end with a comma (and optional ws) so prepend
// to last stack item (e.g. "rgba(50" get broken into 2 tokens)
propValues[propValues.length - 1] = curValue + propValues[propValues.length - 1];
}
}
}
if (propValues.length > 0) {
propValues.reverse();
}
return propValues;
}
/**
* @private
* Gets all of the space/comma seperated tokens after the the current cursor position.
* @param {editor:{CodeMirror}, pos:{ch:{string}, line:{number}}, token:{object}} context
* @param {string} currentValue The token string at the current cursor position
* @return {?Array.<string>} An array of all the space/comma seperated tokens after the
* current cursor position
*/
function _getSucceedingPropValues(ctx, currentValue) {
var lastValue = currentValue,
curValue,
propValues = [];
while (ctx.token.string !== ";" && ctx.token.string !== "}" && TokenUtils.moveNextToken(ctx)) {
if (ctx.token.string === ";" || ctx.token.string === "}") {
break;
}
if (!_isInPropValue(ctx)) {
lastValue = "";
break;
}
if (lastValue === "") {
lastValue = ctx.token.string.trim();
} else if (lastValue.length > 0) {
if (ctx.token.string.length > 0 && !ctx.token.string.match(/\S/)) {
lastValue += ctx.token.string;
propValues.push(lastValue);
lastValue = "";
} else if (ctx.token.string === ",") {
lastValue += ctx.token.string;
} else if (lastValue && lastValue.match(/,$/)) {
propValues.push(lastValue);
if (ctx.token.string.length > 0) {
lastValue = ctx.token.string;
} else {
lastValue = "";
}
} else {
// e.g. "rgba(50" gets broken into 2 tokens
lastValue += ctx.token.string;
}
}
}
if (lastValue.length > 0) {
propValues.push(lastValue);
}
return propValues;
}
/**
* @private
* Return a range object with a start position and an end position after
* skipping any whitespaces and all separators used before and after a
* valid property value.
*
* @param {editor:{CodeMirror}, pos:{ch:{string}, line:{number}}, token:{object}} startCtx context
* @param {editor:{CodeMirror}, pos:{ch:{string}, line:{number}}, token:{object}} endCtx context
* @return {{start: {line: number, ch: number},
* end: {line: number, ch: number}}} A range object.
*/
function _getRangeForPropValue(startCtx, endCtx) {
var range = { "start": {},
"end": {} };
// Skip the ":" and any leading whitespace
while (TokenUtils.moveNextToken(startCtx)) {
if (/\S/.test(startCtx.token.string)) {
break;
}
}
// Skip the trailing whitespace and property separators.
while (endCtx.token.string === ";" || endCtx.token.string === "}" ||
!/\S/.test(endCtx.token.string)) {
TokenUtils.movePrevToken(endCtx);
}
range.start = _.clone(startCtx.pos);
range.start.ch = startCtx.token.start;
range.end = _.clone(endCtx.pos);
range.end.ch = endCtx.token.end;
return range;
}
/**
* @private
* Returns a context info object for the current CSS style rule
* @param {editor:{CodeMirror}, pos:{ch:{string}, line:{number}}, token:{object}} context
* @param {!Editor} editor
* @return {{context: string,
* offset: number,
* name: string,
* index: number,
* values: Array.<string>,
* isNewItem: boolean,
* range: {start: {line: number, ch: number},
* end: {line: number, ch: number}}}} A CSS context info object.
*/
function _getRuleInfoStartingFromPropValue(ctx, editor) {
var propNamePos = $.extend({}, ctx.pos),
backwardPos = $.extend({}, ctx.pos),
forwardPos = $.extend({}, ctx.pos),
propNameCtx = TokenUtils.getInitialContext(editor._codeMirror, propNamePos),
backwardCtx,
forwardCtx,
lastValue = "",
propValues = [],
index = -1,
offset = TokenUtils.offsetInToken(ctx),
canAddNewOne = false,
testPos = {ch: ctx.pos.ch + 1, line: ctx.pos.line},
testToken = editor._codeMirror.getTokenAt(testPos, true),
propName,
range;
// Get property name first. If we don't have a valid property name, then
// return a default rule info.
propName = _getPropNameStartingFromPropValue(propNameCtx);
if (!propName) {
return createInfo();
}
// Scan backward to collect all preceding property values
backwardCtx = TokenUtils.getInitialContext(editor._codeMirror, backwardPos);
propValues = _getPrecedingPropValues(backwardCtx);
lastValue = "";
if (ctx.token.string === ":") {
index = 0;
canAddNewOne = true;
} else {
index = propValues.length - 1;
if (ctx.token.string === ",") {
propValues[index] += ctx.token.string;
index++;
canAddNewOne = true;
} else {
index = (index < 0) ? 0 : index + 1;
if (ctx.token.string.match(/\S/)) {
lastValue = ctx.token.string;
} else {
// Last token is all whitespace
canAddNewOne = true;
if (index > 0) {
// Append all spaces before the cursor to the previous value in values array
propValues[index - 1] += ctx.token.string.substr(0, offset);
}
}
}
}
if (canAddNewOne) {
offset = 0;
// If pos is at EOL, then there's implied whitespace (newline).
if (editor.document.getLine(ctx.pos.line).length > ctx.pos.ch &&
(testToken.string.length === 0 || testToken.string.match(/\S/))) {
canAddNewOne = false;
}
}
// Scan forward to collect all succeeding property values and append to all propValues.
forwardCtx = TokenUtils.getInitialContext(editor._codeMirror, forwardPos);
propValues = propValues.concat(_getSucceedingPropValues(forwardCtx, lastValue));
if (propValues.length) {
range = _getRangeForPropValue(backwardCtx, forwardCtx);
} else {
// No property value, so just return the cursor pos as range
range = { "start": _.clone(ctx.pos),
"end": _.clone(ctx.pos) };
}
// If current index is more than the propValues size, then the cursor is
// at the end of the existing property values and is ready for adding another one.
if (index === propValues.length) {
canAddNewOne = true;
}
return createInfo(PROP_VALUE, offset, propName, index, propValues, canAddNewOne, range);
}
/**
* @private
* Returns a context info object for the current CSS import rule
* @param {editor:{CodeMirror}, pos:{ch:{string}, line:{number}}, token:{object}} context
* @param {!Editor} editor
* @return {{context: string,
* offset: number,
* name: string,
* index: number,
* values: Array.<string>,
* isNewItem: boolean,
* range: {start: {line: number, ch: number},
* end: {line: number, ch: number}}}} A CSS context info object.
*/
function _getImportUrlInfo(ctx, editor) {
var propNamePos = $.extend({}, ctx.pos),
backwardPos = $.extend({}, ctx.pos),
forwardPos = $.extend({}, ctx.pos),
backwardCtx,
forwardCtx,
index = 0,
propValues = [],
offset = TokenUtils.offsetInToken(ctx),
testPos = {ch: ctx.pos.ch + 1, line: ctx.pos.line},
testToken = editor._codeMirror.getTokenAt(testPos, true);
// Currently only support url. May be null if starting to type
if (ctx.token.type && ctx.token.type !== "string") {
return createInfo();
}
// Move backward to @import and collect data as we go. We return propValues
// array, but we can only have 1 value, so put all data in first item
backwardCtx = TokenUtils.getInitialContext(editor._codeMirror, backwardPos);
propValues[0] = backwardCtx.token.string;
while (TokenUtils.movePrevToken(backwardCtx)) {
if (backwardCtx.token.type === "def" && backwardCtx.token.string === "@import") {
break;
}
if (backwardCtx.token.type && backwardCtx.token.type !== "tag" && backwardCtx.token.string !== "url") {
// Previous token may be white-space
// Otherwise, previous token may only be "url("
break;
}
propValues[0] = backwardCtx.token.string + propValues[0];
offset += backwardCtx.token.string.length;
}
if (backwardCtx.token.type !== "def" || backwardCtx.token.string !== "@import") {
// Not in url
return createInfo();
}
// Get value after cursor up until closing paren or newline
forwardCtx = TokenUtils.getInitialContext(editor._codeMirror, forwardPos);
do {
if (!TokenUtils.moveNextToken(forwardCtx)) {
if (forwardCtx.token.string === "(") {
break;
} else {
return createInfo();
}
}
propValues[0] += forwardCtx.token.string;
} while (forwardCtx.token.string !== ")" && forwardCtx.token.string !== "");
return createInfo(IMPORT_URL, offset, "", index, propValues, false);
}
/**
* Returns a context info object for the given cursor position
* @param {!Editor} editor
* @param {{ch: number, line: number}} constPos A CM pos (likely from editor.getCursorPos())
* @return {{context: string,
* offset: number,
* name: string,
* index: number,
* values: Array.<string>,
* isNewItem: boolean,
* range: {start: {line: number, ch: number},
* end: {line: number, ch: number}}}} A CSS context info object.
*/
function getInfoAtPos(editor, constPos) {
// We're going to be changing pos a lot, but we don't want to mess up
// the pos the caller passed in so we use extend to make a safe copy of it.
var pos = $.extend({}, constPos),
ctx = TokenUtils.getInitialContext(editor._codeMirror, pos),
offset = TokenUtils.offsetInToken(ctx),
propName = "",
mode = editor.getModeForSelection();
// Check if this is inside a style block or in a css/less document.
if (mode !== "css" && mode !== "text/x-scss" && mode !== "text/x-less") {
return createInfo();
}
if (_isInPropName(ctx)) {
return _getPropNameInfo(ctx, editor);
}
if (_isInPropValue(ctx)) {
return _getRuleInfoStartingFromPropValue(ctx, editor);
}
if (_isInAtRule(ctx)) {
return _getImportUrlInfo(ctx, editor);
}
return createInfo();
}
/**
* Extracts all CSS selectors from the given text
* Returns an array of selectors. Each selector is an object with the following properties:
selector: the text of the selector (note: comma separated selector groups like
"h1, h2" are broken into separate selectors)
ruleStartLine: line in the text where the rule (including preceding comment) appears
ruleStartChar: column in the line where the rule (including preceding comment) starts
selectorStartLine: line in the text where the selector appears
selectorStartChar: column in the line where the selector starts
selectorEndLine: line where the selector ends
selectorEndChar: column where the selector ends
selectorGroupStartLine: line where the comma-separated selector group (e.g. .foo, .bar, .baz)
starts that this selector (e.g. .baz) is part of. Particularly relevant for
groups that are on multiple lines.
selectorGroupStartChar: column in line where the selector group starts.
selectorGroup: the entire selector group containing this selector, or undefined if there
is only one selector in the rule.
declListStartLine: line where the declaration list for the rule starts
declListStartChar: column in line where the declaration list for the rule starts
declListEndLine: line where the declaration list for the rule ends
declListEndChar: column in the line where the declaration list for the rule ends
* @param text {!string} CSS text to extract from
* @return {Array.<Object>} Array with objects specifying selectors.
*/
function extractAllSelectors(text) {
var selectors = [];
var mode = CodeMirror.getMode({indentUnit: 2}, "css");
var state, lines, lineCount;
var token, style, stream, line;
var currentSelector = "";
var ruleStartChar = -1, ruleStartLine = -1;
var selectorStartChar = -1, selectorStartLine = -1;
var selectorGroupStartLine = -1, selectorGroupStartChar = -1;
var declListStartLine = -1, declListStartChar = -1;
var escapePattern = new RegExp("\\\\[^\\\\]+", "g");
var validationPattern = new RegExp("\\\\([a-f0-9]{6}|[a-f0-9]{4}(\\s|\\\\|$)|[a-f0-9]{2}(\\s|\\\\|$)|.)", "i");
// implement _firstToken()/_nextToken() methods to
// provide a single stream of tokens
function _hasStream() {
while (stream.eol()) {
line++;
if (line >= lineCount) {
return false;
}
if (currentSelector.match(/\S/)) {
// If we are in a current selector and starting a newline,
// make sure there is whitespace in the selector
currentSelector += " ";
}
stream = new CodeMirror.StringStream(lines[line]);
}
return true;
}
function _firstToken() {
state = CodeMirror.startState(mode);
lines = CodeMirror.splitLines(text);
lineCount = lines.length;
if (lineCount === 0) {
return false;
}
line = 0;
stream = new CodeMirror.StringStream(lines[line]);
if (!_hasStream()) {
return false;
}
style = mode.token(stream, state);
token = stream.current();
return true;
}
function _nextToken() {
// advance the stream past this token
stream.start = stream.pos;
if (!_hasStream()) {
return false;
}
style = mode.token(stream, state);
token = stream.current();
return true;
}
function _firstTokenSkippingWhitespace() {
if (!_firstToken()) {
return false;
}
while (!token.match(/\S/)) {
if (!_nextToken()) {
return false;
}
}
return true;
}
function _nextTokenSkippingWhitespace() {
if (!_nextToken()) {
return false;
}
while (!token.match(/\S/)) {
if (!_nextToken()) {
return false;
}
}
return true;
}
function _isStartComment() {
return (token.match(/^\/\*/));
}
function _parseComment() {
while (!token.match(/\*\/$/)) {
if (!_nextToken()) {
break;
}
}
}
function _nextTokenSkippingComments() {
if (!_nextToken()) {
return false;
}
while (_isStartComment()) {
_parseComment();
if (!_nextToken()) {
return false;
}
}
return true;
}
function _skipToClosingBracket() {
var unmatchedBraces = 0;
while (true) {
if (token === "{") {
unmatchedBraces++;
} else if (token === "}") {
unmatchedBraces--;
if (unmatchedBraces === 0) {
return;
}
}
if (!_nextTokenSkippingComments()) {
return; // eof
}
}
}
function _parseSelector(start) {
currentSelector = "";
selectorStartChar = start;
selectorStartLine = line;
// Everything until the next ',' or '{' is part of the current selector
while (token !== "," && token !== "{") {
currentSelector += token;
if (!_nextTokenSkippingComments()) {
return false; // eof
}
}
// Unicode character replacement as defined in http://www.w3.org/TR/CSS21/syndata.html#characters
if (/\\/.test(currentSelector)) {
// Double replace in case of pattern overlapping (regex improvement?)
currentSelector = currentSelector.replace(escapePattern, function (escapedToken) {
return escapedToken.replace(validationPattern, function (unicodeChar) {
unicodeChar = unicodeChar.substr(1);
if (unicodeChar.length === 1) {
return unicodeChar;
} else {
if (parseInt(unicodeChar, 16) < 0x10FFFF) {
return String.fromCharCode(parseInt(unicodeChar, 16));
} else { return String.fromCharCode(0xFFFD); }
}
});
});
}
currentSelector = currentSelector.trim();
var startChar = (selectorGroupStartLine === -1) ? selectorStartChar : selectorStartChar + 1;
var selectorStart = (stream.string.indexOf(currentSelector, selectorStartChar) !== -1) ? stream.string.indexOf(currentSelector, selectorStartChar - currentSelector.length) : startChar;
if (currentSelector !== "") {
selectors.push({selector: currentSelector,
ruleStartLine: ruleStartLine,
ruleStartChar: ruleStartChar,
selectorStartLine: selectorStartLine,
selectorStartChar: selectorStart,
declListEndLine: -1,
selectorEndLine: line,
selectorEndChar: selectorStart + currentSelector.length,
selectorGroupStartLine: selectorGroupStartLine,
selectorGroupStartChar: selectorGroupStartChar
});
currentSelector = "";
}
selectorStartChar = -1;
return true;
}
function _parseSelectorList() {
selectorGroupStartLine = (stream.string.indexOf(",") !== -1) ? line : -1;
selectorGroupStartChar = stream.start;
if (!_parseSelector(stream.start)) {
return false;
}
while (token === ",") {
if (!_nextTokenSkippingComments()) {
return false; // eof
}
if (!_parseSelector(stream.start)) {
return false;
}
}
return true;
}
function _parseDeclarationList() {
var j;
declListStartLine = Math.min(line, lineCount - 1);
declListStartChar = stream.start;
// Extract the entire selector group we just saw.
var selectorGroup, sgLine;
if (selectorGroupStartLine !== -1) {
selectorGroup = "";
for (sgLine = selectorGroupStartLine; sgLine <= declListStartLine; sgLine++) {
var startChar = 0, endChar = lines[sgLine].length;
if (sgLine === selectorGroupStartLine) {
startChar = selectorGroupStartChar;
} else {
selectorGroup += " "; // replace the newline with a single space
}
if (sgLine === declListStartLine) {
endChar = declListStartChar;
}
selectorGroup += lines[sgLine].substring(startChar, endChar);
}
selectorGroup = selectorGroup.trim();
}
// Since we're now in a declaration list, that means we also finished
// parsing the whole selector group. Therefore, reset selectorGroupStartLine
// so that next time we parse a selector we know it's a new group
selectorGroupStartLine = -1;
selectorGroupStartChar = -1;
ruleStartLine = -1;
ruleStartChar = -1;
// Skip everything until the next '}'
while (token !== "}") {
if (!_nextTokenSkippingComments()) {
break;
}
}
// assign this declaration list position and selector group to every selector on the stack
// that doesn't have a declaration list start and end line
for (j = selectors.length - 1; j >= 0; j--) {
if (selectors[j].declListEndLine !== -1) {
break;
} else {
selectors[j].declListStartLine = declListStartLine;
selectors[j].declListStartChar = declListStartChar;
selectors[j].declListEndLine = line;
selectors[j].declListEndChar = stream.pos - 1; // stream.pos actually points to the char after the }
if (selectorGroup) {
selectors[j].selectorGroup = selectorGroup;
}
}
}
}
function includeCommentInNextRule() {
if (ruleStartChar !== -1) {
return false; // already included
}
if (stream.start > 0 && lines[line].substr(0, stream.start).indexOf("}") !== -1) {
return false; // on same line as '}', so it's for previous rule
}
return true;
}
function _isStartAtRule() {
return (token.match(/^@/));
}
function _parseAtRule() {
// reset these fields to ignore comments preceding @rules
ruleStartLine = -1;
ruleStartChar = -1;
selectorStartLine = -1;
selectorStartChar = -1;
selectorGroupStartLine = -1;
selectorGroupStartChar = -1;
if (token.match(/@media/i)) {
// @media rule holds a rule list
// Skip everything until the opening '{'
while (token !== "{") {
if (!_nextTokenSkippingComments()) {
return; // eof
}
}
// skip past '{', to next non-ws token
if (!_nextTokenSkippingWhitespace()) {
return; // eof
}
// Parse rules until we see '}'
_parseRuleList("}");
} else if (token.match(/@(charset|import|namespace)/i)) {
// This code handles @rules in this format:
// @rule ... ;
// Skip everything until the next ';'
while (token !== ";") {
if (!_nextTokenSkippingComments()) {
return; // eof
}
}
} else {
// This code handle @rules that use this format:
// @rule ... { ... }
// such as @page, @keyframes (also -webkit-keyframes, etc.), and @font-face.
// Skip everything including nested braces until the next matching '}'
_skipToClosingBracket();
}
}
// parse a style rule
function _parseRule() {
if (!_parseSelectorList()) {
return false;
}
_parseDeclarationList();
}
function _parseRuleList(escapeToken) {
while ((!escapeToken) || token !== escapeToken) {
if (_isStartAtRule()) {
// @rule
_parseAtRule();
} else if (_isStartComment()) {
// comment - make this part of style rule
if (includeCommentInNextRule()) {
ruleStartChar = stream.start;
ruleStartLine = line;
}
_parseComment();
} else {
// Otherwise, it's style rule
if (ruleStartChar === -1) {
ruleStartChar = stream.start;
ruleStartLine = line;
}
_parseRule();
}
if (!_nextTokenSkippingWhitespace()) {
break;
}
}
}
// Do parsing
if (_firstTokenSkippingWhitespace()) {
// Style sheet is a rule list
_parseRuleList();
}
return selectors;
}
/*
* This code can be used to create an "independent" HTML document that can be passed to jQuery
* calls. Allows using jQuery's CSS selector engine without actually putting anything in the browser's DOM
*
var _htmlDoctype = document.implementation.createDocumentType('html',
'-//W3C//DTD XHTML 1.0 Strict//EN',
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'
);
var _htmlDocument = document.implementation.createDocument('http://www.w3.org/1999/xhtml', 'html', _htmlDoctype);
function checkIfSelectorSelectsHTML(selector, theHTML) {
$('html', _htmlDocument).html(theHTML);
return ($(selector, _htmlDocument).length > 0);
}
*/
/**
* Finds all instances of the specified selector in "text".
* Returns an Array of Objects with start and end properties.
*
* For Sprint 4, we only support simple selectors. This function will need to change
* dramatically to support full selectors.
*
* FUTURE: (JRB) It would be nice to eventually use the browser/jquery to do the selector evaluation.
* One way to do this would be to take the user's HTML, add a special attribute to every tag with a UID,
* and then construct a DOM (using the commented out code above). Then, give this DOM and the selector to
* jquery and ask what matches. If the node that the user's cursor is in comes back from jquery, then
* we know the selector applies.
*
* @param text {!string} CSS text to search
* @param selector {!string} selector to search for
* @return {Array.<{selectorGroupStartLine:number, declListEndLine:number, selector:string}>}
* Array of objects containing the start and end line numbers (0-based, inclusive range) for each
* matched selector.
*/
function _findAllMatchingSelectorsInText(text, selector) {
var allSelectors = extractAllSelectors(text);
var result = [];
var i;
// For sprint 4 we only match the rightmost simple selector, and ignore
// attribute selectors and pseudo selectors
var classOrIdSelector = selector[0] === "." || selector[0] === "#";
var prefix = "";
// Escape initial "." in selector, if present.
if (selector[0] === ".") {
selector = "\\" + selector;
}
if (!classOrIdSelector) {
// Tag selectors must have nothing, whitespace, or a combinator before it.
selector = "(^|[\\s>+~])" + selector;
}
var re = new RegExp(selector + "(\\[[^\\]]*\\]|:{1,2}[\\w-()]+|\\.[\\w-]+|#[\\w-]+)*\\s*$", classOrIdSelector ? "" : "i");
allSelectors.forEach(function (entry) {
if (entry.selector.search(re) !== -1) {
result.push(entry);
} else if (!classOrIdSelector) {
// Special case for tag selectors - match "*" as the rightmost character
if (/\*\s*$/.test(entry.selector)) {
result.push(entry);
}
}
});
return result;
}
/**
* Converts the results of _findAllMatchingSelectorsInText() into a simpler bag of data and
* appends those new objects to the given 'resultSelectors' Array.
* @param {Array.<{document:Document, lineStart:number, lineEnd:number}>} resultSelectors
* @param {Array.<{selectorGroupStartLine:number, declListEndLine:number, selector:string}>} selectorsToAdd
* @param {!Document} sourceDoc
* @param {!number} lineOffset Amount to offset all line number info by. Used if the first line
* of the parsed CSS text is not the first line of the sourceDoc.
*/
function _addSelectorsToResults(resultSelectors, selectorsToAdd, sourceDoc, lineOffset) {
selectorsToAdd.forEach(function (selectorInfo) {
resultSelectors.push({
name: selectorInfo.selector,
document: sourceDoc,
lineStart: selectorInfo.ruleStartLine + lineOffset,
lineEnd: selectorInfo.declListEndLine + lineOffset,
selectorGroup: selectorInfo.selectorGroup
});
});
}
/** Finds matching selectors in CSS files; adds them to 'resultSelectors' */
function _findMatchingRulesInCSSFiles(selector, resultSelectors) {
var result = new $.Deferred();
// Load one CSS file and search its contents
function _loadFileAndScan(fullPath, selector) {
var oneFileResult = new $.Deferred();
DocumentManager.getDocumentForPath(fullPath)
.done(function (doc) {
// Find all matching rules for the given CSS file's content, and add them to the
// overall search result
var oneCSSFileMatches = _findAllMatchingSelectorsInText(doc.getText(), selector);
_addSelectorsToResults(resultSelectors, oneCSSFileMatches, doc, 0);
oneFileResult.resolve();
})
.fail(function (error) {
oneFileResult.reject(error);
});
return oneFileResult.promise();
}
ProjectManager.getAllFiles(ProjectManager.getLanguageFilter("css"))
.done(function (cssFiles) {
// Load index of all CSS files; then process each CSS file in turn (see above)
Async.doInParallel(cssFiles, function (fileInfo, number) {
return _loadFileAndScan(fileInfo.fullPath, selector);
})
.then(result.resolve, result.reject);
});
return result.promise();
}
/** Finds matching selectors in the <style> block of a single HTML file; adds them to 'resultSelectors' */
function _findMatchingRulesInStyleBlocks(htmlDocument, selector, resultSelectors) {
// HTMLUtils requires a real CodeMirror instance; make sure we can give it the right Editor
var htmlEditor = EditorManager.getCurrentFullEditor();
if (htmlEditor.document !== htmlDocument) {
console.error("Cannot search for <style> blocks in HTML file other than current editor");
return;
}
// Find all <style> blocks in the HTML file
var styleBlocks = HTMLUtils.findStyleBlocks(htmlEditor);
styleBlocks.forEach(function (styleBlockInfo) {
// Search this one <style> block's content, appending results to 'resultSelectors'
var oneStyleBlockMatches = _findAllMatchingSelectorsInText(styleBlockInfo.text, selector);
_addSelectorsToResults(resultSelectors, oneStyleBlockMatches, htmlDocument, styleBlockInfo.start.line);
});
}
/**
* Return all rules matching the specified selector.
* For Sprint 4, we only look at the rightmost simple selector. For example, searching for ".foo" will
* match these rules:
* .foo {}
* div .foo {}
* div.foo {}
* div .foo[bar="42"] {}
* div .foo:hovered {}
* div .foo::first-child
* but will *not* match these rules:
* .foobar {}
* .foo .bar {}
* div .foo .bar {}
* .foo.bar {}
*
* @param {!string} selector The selector to match. This can be a tag selector, class selector or id selector
* @param {?Document} htmlDocument An HTML file for context (so we can search <style> blocks)
* @return {$.Promise} that will be resolved with an Array of objects containing the
* source document, start line, and end line (0-based, inclusive range) for each matching declaration list.
* Does not addRef() the documents returned in the array.
*/
function findMatchingRules(selector, htmlDocument) {
var result = new $.Deferred(),
resultSelectors = [];
// Synchronously search for matches in <style> blocks
if (htmlDocument) {
_findMatchingRulesInStyleBlocks(htmlDocument, selector, resultSelectors);
}
// Asynchronously search for matches in all the project's CSS files
// (results are appended together in same 'resultSelectors' array)
_findMatchingRulesInCSSFiles(selector, resultSelectors)
.done(function () {
result.resolve(resultSelectors);
})
.fail(function (error) {
result.reject(error);
});
return result.promise();
}
/**
* Returns the selector(s) of the rule at the specified document pos, or "" if the position is
* is not within a style rule.
*
* @param {!Editor} editor Editor to search
* @param {!{line: number, ch: number}} pos Position to search
* @return {string} Selector(s) for the rule at the specified position, or "" if the position
* is not within a style rule. If the rule has multiple selectors, a comma-separated
* selector string is returned.
*/
function findSelectorAtDocumentPos(editor, pos) {
var cm = editor._codeMirror;
var ctx = TokenUtils.getInitialContext(cm, $.extend({}, pos));
var selector = "", inSelector = false, foundChars = false;
function _stripAtRules(selector) {
selector = selector.trim();
if (selector.indexOf("@") === 0) {
return "";
}
return selector;
}
// Parse a selector. Assumes ctx is pointing at the opening
// { that is after the selector name.
function _parseSelector(ctx) {
var selector = "";
// Skip over {
TokenUtils.movePrevToken(ctx);
while (true) {
if (ctx.token.type !== "comment") {
// Stop once we've reached a {, }, or ;
if (/[\{\}\;]/.test(ctx.token.string)) {
break;
}
// Stop once we've reached a <style ...> tag
if (ctx.token.string === "style" && ctx.token.type === "tag") {
// Remove everything up to end-of-tag from selector
var eotIndex = selector.indexOf(">");
if (eotIndex !== -1) {
selector = selector.substring(eotIndex + 1);
}
break;
}
selector = ctx.token.string + selector;
}
if (!TokenUtils.movePrevToken(ctx)) {
break;
}
}
return selector;
}
// scan backwards to see if the cursor is in a rule
while (true) {
if (ctx.token.type !== "comment") {
if (ctx.token.string === "}") {
break;
} else if (ctx.token.string === "{") {
selector = _parseSelector(ctx);
break;
} else {
if (/\S/.test(ctx.token.string)) {
foundChars = true;
}
}
}
if (!TokenUtils.movePrevToken(ctx)) {
break;
}
}
selector = _stripAtRules(selector);
// Reset the context to original scan position
ctx = TokenUtils.getInitialContext(cm, $.extend({}, pos));
// special case - we aren't in a selector and haven't found any chars,
// look at the next immediate token to see if it is non-whitespace
if (!selector && !foundChars) {
if (TokenUtils.moveNextToken(ctx) && ctx.token.type !== "comment" && /\S/.test(ctx.token.string)) {
foundChars = true;
ctx = TokenUtils.getInitialContext(cm, $.extend({}, pos));
}
}
// At this point if we haven't found a selector, but have seen chars when
// scanning, assume we are in the middle of a selector.
if (!selector && foundChars) {
// scan forward to see if the cursor is in a selector
while (true) {
if (ctx.token.type !== "comment") {
if (ctx.token.string === "{") {
selector = _parseSelector(ctx);
break;
} else if (ctx.token.string === "}" || ctx.token.string === ";") {
break;
}
}
if (!TokenUtils.moveNextToken(ctx)) {
break;
}
}
}
return _stripAtRules(selector);
}
/**
* removes CSS comments from the content
* @param {!string} content to reduce
* @return {string} reduced content
*/
function _removeComments(content) {
return content.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\//g, "");
}
/**
* removes strings from the content
* @param {!string} content to reduce
* @return {string} reduced content
*/
function _removeStrings(content) {
return content.replace(/[^\\]\"(.*)[^\\]\"|[^\\]\'(.*)[^\\]\'+/g, "");
}
/**
* Reduces the style sheet by removing comments and strings
* so that the content can be parsed using a regular expression
* @param {!string} content to reduce
* @return {string} reduced content
*/
function reduceStyleSheetForRegExParsing(content) {
return _removeStrings(_removeComments(content));
}
/**
* Extracts all named flow instances
* @param {!string} text to extract from
* @return {Array.<string>} array of unique flow names found in the content (empty if none)
*/
function extractAllNamedFlows(text) {
var namedFlowRegEx = /(?:flow\-(into|from)\:\s*)([\w\-]+)(?:\s*;)/gi,
result = [],
names = {},
thisMatch;
// Reduce the content so that matches
// inside strings and comments are ignored
text = reduceStyleSheetForRegExParsing(text);
// Find the first match
thisMatch = namedFlowRegEx.exec(text);
// Iterate over the matches and add them to result
while (thisMatch) {
var thisName = thisMatch[2];
if (IGNORED_FLOW_NAMES.indexOf(thisName) === -1 && !names.hasOwnProperty(thisName)) {
names[thisName] = result.push(thisName);
}
thisMatch = namedFlowRegEx.exec(text);
}
return result;
}
/**
* Adds a new rule to the end of the given document, and returns the range of the added rule
* and the position of the cursor on the indented blank line within it. Note that the range will
* not include all the inserted text (we insert extra newlines before and after the rule).
* @param {Document} doc The document to insert the rule into.
* @param {string} selector The selector to use for the given rule.
* @param {boolean} useTabChar Whether to indent with a tab.
* @param {number} indentUnit If useTabChar is false, how many spaces to indent with.
* @return {{range: {from: {line: number, ch: number}, to: {line: number, ch: number}}, pos: {line: number, ch: number}}}
* The range of the inserted rule and the location where the cursor should be placed.
*/
function addRuleToDocument(doc, selector, useTabChar, indentUnit) {
var newRule = "\n" + selector + " {\n",
blankLineOffset;
if (useTabChar) {
newRule += "\t";
blankLineOffset = 1;
} else {
var i;
for (i = 0; i < indentUnit; i++) {
newRule += " ";
}
blankLineOffset = indentUnit;
}
newRule += "\n}\n";
var docLines = doc.getText().split("\n"),
lastDocLine = docLines.length - 1,
lastDocChar = docLines[docLines.length - 1].length;
doc.replaceRange(newRule, {line: lastDocLine, ch: lastDocChar});
return {
range: {
from: {line: lastDocLine + 1, ch: 0},
to: {line: lastDocLine + 3, ch: 1}
},
pos: {line: lastDocLine + 2, ch: blankLineOffset}
};
}
/**
*
* In the given rule array (as returned by `findMatchingRules()`), if multiple rules in a row
* refer to the same rule (because there were multiple matching selectors), eliminate the redundant
* rules. Also, always use the selector group if available instead of the original matching selector.
*/
function consolidateRules(rules) {
var newRules = [], lastRule;
rules.forEach(function (rule) {
if (rule.selectorGroup) {
rule.name = rule.selectorGroup;
}
// Push the entry unless it refers to the same rule as the previous entry.
if (!(lastRule &&
rule.document === lastRule.document &&
rule.lineStart === lastRule.lineStart &&
rule.lineEnd === lastRule.lineEnd &&
rule.selectorGroup === lastRule.selectorGroup)) {
newRules.push(rule);
}
lastRule = rule;
});
return newRules;
}
/**
* Given a TextRange, extracts the selector(s) for the rule in the range and returns it.
* Assumes the range only contains one rule; if there's more than one, it will return the
* selector(s) for the first rule.
* @param {TextRange} range The range to extract the selector(s) from.
* @return {string} The selector(s) for the rule in the range.
*/
function getRangeSelectors(range) {
// There's currently no immediate way to access a given line in a Document, because it's just
// stored as a string. Eventually, we should have Documents cache the lines in the document
// as well, or make them use CodeMirror documents which do the same thing.
var i, startIndex = 0, endIndex, text = range.document.getText();
for (i = 0; i < range.startLine; i++) {
startIndex = text.indexOf("\n", startIndex) + 1;
}
endIndex = startIndex;
// Go one line past the end line. We'll extract text up to but not including the last newline.
for (i = range.startLine + 1; i <= range.endLine + 1; i++) {
endIndex = text.indexOf("\n", endIndex) + 1;
}
var allSelectors = extractAllSelectors(text.substring(startIndex, endIndex));
// There should only be one rule in the range, and if there are multiple selectors for
// the first rule, they'll all be recorded in the "selectorGroup" for the first selector,
// so we only need to look at the first one.
return (allSelectors.length ? allSelectors[0].selectorGroup || allSelectors[0].selector : "");
}
exports._findAllMatchingSelectorsInText = _findAllMatchingSelectorsInText; // For testing only
exports.findMatchingRules = findMatchingRules;
exports.extractAllSelectors = extractAllSelectors;
exports.extractAllNamedFlows = extractAllNamedFlows;
exports.findSelectorAtDocumentPos = findSelectorAtDocumentPos;
exports.reduceStyleSheetForRegExParsing = reduceStyleSheetForRegExParsing;
exports.addRuleToDocument = addRuleToDocument;
exports.consolidateRules = consolidateRules;
exports.getRangeSelectors = getRangeSelectors;
exports.SELECTOR = SELECTOR;
exports.PROP_NAME = PROP_NAME;
exports.PROP_VALUE = PROP_VALUE;
exports.IMPORT_URL = IMPORT_URL;
exports.getInfoAtPos = getInfoAtPos;
// The createInfo is really only for the unit tests so they can make the same
// structure to compare results with.
exports.createInfo = createInfo;
});
|
alicoding/nimble
|
src/language/CSSUtils.js
|
JavaScript
|
mit
| 60,267
|
(function(){
"use strict";
angular.module('app.controllers').controller('HomeCtrl', function(){
//
});
})();
|
apps-libX/myapp
|
angular/app/app/home/home.js
|
JavaScript
|
mit
| 131
|
// ***********************************************************************
// Assembly : ACBr.Net.NFSe
// Author : RFTD
// Created : 05-19-2016
//
// Last Modified By : RFTD
// Last Modified On : 05-19-2016
// ***********************************************************************
// <copyright file="TipoRPS.cs" company="ACBr.Net">
// The MIT License (MIT)
// Copyright (c) 2016 Grupo ACBr.Net
//
// 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.
// </copyright>
// <summary></summary>
// ***********************************************************************
namespace ACBr.Net.NFSe.Nota
{
public enum TipoRps
{
RPS = 0,
NFConjugada = 1,
Cupom = 2
}
}
|
rafd75/ACBr.Net.NFSe
|
src/ACBr.Net.NFSe.Shared/Nota/TipoRps.cs
|
C#
|
mit
| 1,736
|
#include "worker.h"
#include "sharedbuffer.h"
#include "nan.h"
#include "util.h"
using namespace v8;
static Persistent<ObjectTemplate> worker_template;
static Persistent<String> id_symbol;
NAN_METHOD(Eval) {
NanScope();
NanReturnUndefined();
}
Worker::Worker() {
m_error = 0;
}
Worker::~Worker() {
}
//static
Worker* Worker::Start(const v8::Arguments &args) {
if (worker_template.IsEmpty()) {
Local<String> localSymbol = NanNew<String>("id");
NanAssignPersistent(id_symbol, localSymbol);
Local<ObjectTemplate> tpl = ObjectTemplate::New();
tpl->SetInternalFieldCount(1);
tpl->Set(localSymbol, NanNew<Integer>(0));
tpl->Set(NanNew<String>("eval"), NanNew<FunctionTemplate>(Eval));
NanAssignPersistent(worker_template, tpl);
}
if (args.Length() < 3 || !args[2]->IsFunction()) {
NanThrowTypeError("Usage: createWorker(script, sharedBufferObj, callback)");
return NULL;
}
Worker *worker = new Worker();
worker->m_script = new String::Utf8Value(args[0]);
if (args[1]->IsNumber()) {
NanAssignPersistent(worker->m_sharedBufferId, args[1]->ToInt32());
}
NanAssignPersistent(worker->m_callback, args[2]->ToObject());
Local<Object> jsObj = NanNew(worker_template)->NewInstance();
jsObj->Set(NanNew<String>("id"), NanNew<Integer>(11));
NanSetInternalFieldPointer(jsObj, 0, worker);
NanAssignPersistent(worker->m_jsobject, jsObj);
worker->m_work.data = worker;
/*int ret = */uv_queue_work(uv_default_loop(), &(worker->m_work), WorkerProc, PostWorkerProc);
return worker;
}
//static
void Worker::WorkerProc(uv_work_t *req) {
// sub thread
Worker *worker = (Worker*)(req->data);
worker->m_isolate = Isolate::New();
NanSetIsolateData(worker->m_isolate, worker);
if (!Locker::IsActive()) {
worker->ReleaseIsolate();
return;
}
{ // wrap Lock within scope is very important
Locker myLocker(worker->m_isolate);
worker->m_isolate->Enter();
NanScope();
Persistent<Context> ctx = Context::New();
ctx->Enter();
Local<Object> ctx_global = ctx->Global();
Handle<Object> consoleObj = NanNew<Object>();
consoleObj->Set(NanNew<String>("log"), NanNew<FunctionTemplate>(console_log)->GetFunction());
consoleObj->Set(NanNew<String>("error"), NanNew<FunctionTemplate>(console_error)->GetFunction());
ctx_global->Set(NanNew<String>("console"), consoleObj, (PropertyAttribute)(ReadOnly | DontDelete));
if (!worker->m_sharedBufferId.IsEmpty()) {
SharedBuffer *buf = SharedBuffer::getSharedBuffer((int)worker->m_sharedBufferId->Value());
if (buf) {
Local<ObjectTemplate> sharedBufTpl = ObjectTemplate::New();
Local<Object> jsObj = sharedBufTpl->NewInstance();
SharedBuffer::bindProperties(jsObj, buf);
NanAssignPersistent(worker->m_sharedBufferObject, jsObj);
ctx_global->Set(NanNew<String>("sharedBuffer"), jsObj);
} else {
ctx_global->Set(NanNew<String>("sharedBuffer"), Null());
}
} else {
ctx_global->Set(NanNew<String>("sharedBuffer"), Null());
}
TryCatch tryCatch;
String::Utf8Value *result;
Local<String> source = NanNew<String>(**worker->m_script, worker->m_script->length());
Local<Script> script = NanCompileScript(source);
Local<Value> retValue = NanRunScript(script);
if (!tryCatch.HasCaught()) {
result = new String::Utf8Value(retValue->ToString());
} else {
worker->m_error = 1;
Local<Value> err = tryCatch.Exception();
result = new String::Utf8Value(err->ToString());
printf("WorkerProc failed to run script: %s\n", **result);
}
worker->m_result = result;
ctx.Dispose();
}
worker->ReleaseIsolate();
}
//static
void Worker::PostWorkerProc(uv_work_t *req, int result) {
Worker *worker = (Worker*)(req->data);
NanScope();
Local<Value> argv[2];
if (worker->m_error) {
argv[0] = String::New("error");
argv[1] = Local<Value>::New(Null());
} else {
argv[0] = Local<Value>::New(Null());
argv[1] = String::New("Succeed");
}
worker->m_callback->CallAsFunction(Object::New(), 2, argv);
}
void Worker::ReleaseIsolate() {
m_isolate->Exit();
m_isolate->Dispose();
m_isolate = NULL;
}
|
yejingfu/multithread
|
src/worker.cc
|
C++
|
mit
| 4,222
|
# Contributing
When contributing to this repository, please proactively ask any unclear details
about the project and issue.
Please note we have a code of conduct, please follow it in all your interactions with the project.
## Pull Request Process
1. Ensure any install or build dependencies are removed before the end of the layer when doing a
build.
2. Submit a Pull Request with description about the details of changes to the
interface, this includes new environment variables, exposed ports, useful file
locations and container parameters.
3. Once your code has been approved by (at least) one reviewer, the repository maintainer
can merge your changes to the target branch.
## Code of Conduct
### Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.
### Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
### Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
### Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
### Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at **imre.nagi2812@gmail.com**. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
### Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]
|
imrenagi/rojak-web-frontend
|
CONTRIBUTING.md
|
Markdown
|
mit
| 3,805
|
<style is="custom-style">/* Included Color Vars */
* {
--primary-color-dark: #303F9F;
--primary-color: #3F51B5;
--primary-color-light: #C5CAE9;
--primary-color-highlight: #edf4fd;
--primary-color-text: #FFFFFF;
--accent-color: #8BC34A;
--primary-text-color: #212121;
--secondary-text-color: #727272;
--divider-color: #B6B6B6;
--color-neutral-light: #f7f7f7;
--color-neutral: #f4f4f4;
--color-neutral-dark: #ececec;
--color-neutral-text-light: #e2e2e2;
--color-neutral-text: #000000;
--color-neutral-text-dark: #757575;
--color-neutral-text-bg: #ffffff; }
/*# sourceMappingURL=color-vars-body.css.map */
</style>
|
bstavroulakis/polymer-dashboard
|
app/css/skins/default/color-vars.css
|
CSS
|
mit
| 644
|
---
layout: post
microblog: true
date: 2017-04-01 07:25 +0300
guid: http://desparoz.micro.blog/2017/04/01/t848028483527880704.html
---
Split the Universe via NASA [t.co/jMP6ereKo...](https://t.co/jMP6ereKoI) [t.co/nMK4UEvwx...](https://t.co/nMK4UEvwxu)
|
desparoz/desparoz.github.io
|
_posts/2017-04-01-t848028483527880704.md
|
Markdown
|
mit
| 254
|
<HTML><HEAD>
<TITLE>Review for Underground Comedy Movie, The (1999)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1 ALIGN="CENTER" CLASS="title"><A HREF="/Title?0201290">Underground Comedy Movie, The (1999)</A></H1><H3 ALIGN=CENTER>reviewed by<BR><A HREF="/ReviewsBy?Harvey+S.+Karten">Harvey S. Karten</A></H3><HR WIDTH="40%" SIZE="4">
<PRE>THE UNDERGROUND COMEDY MOVIE</PRE>
<PRE> Reviewed by Harvey Karten, Ph.D.
Phaedra Cinema
Director: Vince Offer
Writer: Vince Offer
Cast: Geena Lee Nolin, Slash, Michael Clark Duncan, Joey
Buttafuoco, Lightfield Lewis, Karen Black,
Rebecca Chaney, Jeery Mongo Brownlee, Michael Parisi,
Gloria Sperling, Bobby Lee</PRE>
<P> Humankind's foibles are so numerous that we don't wonder
that satirical theater, printed words and later movies became
a popular genre ever since Aristophanes spoofed the
pretensions of Socrates 2500 years ago. Satire is my genre:
but it's gotta be good. There's a difference, for example,
between John Cleese's stellar role as Fawlty Towers on TV
some two decades ago and John Cleese's embarrassing
performance as a high-kicking transvestite in the abysmal
recent comedy, "The Out-of-Towners." There's also a
difference between the limp parody of high-school kids in
"Jawbreakers" and the incisive send-up of American morality
and ethics in the wonderful new teen-based film, "Election."</P>
<P> There's also the kind of movie that's so bad that it's good.
Such is not "The Underground Comedy Movie," which is so
bad that it's bad. Really atrocious. Its writer-director, young
Vince Offer, supposedly took ten years to make this alleged
comedy, with which he hopes to draw chuckles and guffaws
by pure outrageousness. Remember how some people
walked out of last year's "There's Something About Mary"
because of a supposedly vulgar riff on the title character's
hair mousse? "The Underground Comedy Movie" not only
makes that movie look like "The Wizard of Oz," but director
Offer actually sued the team that gave Cameron Diaz a new
look for allegedly stealing fourteen--count 'em--fourteen ideas
from his new film.</P>
<P> Though Offer insists that his film is "guaranteed to offend,"
presumably to affront those who remain in their seats
throughout the 87 minutes, "The Underground Comedy
Movie" is so unfinished, so lacking in varnish, that it can
scarcely wound anyone--unless Offer can find someone
around who is horrified to find gallons of milk, substituting for
semen, poured over one actor after another. Actually a
series of skits with performers popping up now and then, the
movie showcases such events as "The Miss American Bag
Lady Contest," using actual bag women in the L.A. area (or is
it Tijuana?), who parade around in swim suits to be judged by
four drunks lying in the gutter casting their votes. In a
running skit on the theme "things you will never see," the film
opens on two supermodels "taking a dump," and concludes
with a hopelessly inept "jury making the right decision"--in
which two white guys cast the jury's only "not guilty votes" in
the case of a black defendant, claiming that the society is
"only trying to keep the brother down."</P>
<P> Gays, blacks, Jews, Italians, comic book characters,
virgins, psychologists and even the dead are lampooned, but
for real sophistication, you've gotta see "Batman" repeatedly
clubbing two hare krishna guys with baseball equipment and
a lifeguard who keeps his eyes fixed on some beautiful
women on a raft while a guy is repeatedly attacked by a
shark. An actor named Bobby Lee plays "Sushi Papa."
Doesn't Mr. Offer know that he's playing the role of a
Chinese and not a Japanese? Michael Parisi performs in the
role of the Godmother in yet another skit mocking one of the
great cinema works of all time, but making an offer that the
audience can easily resist.</P>
<P> "The Underground Comedy Movie" has humor, so to
speak, directed at the 14-17-year-old demos, but since it
would be rated NC-17 when it opens in theaters on May 7, its
prime audience would presumably not even get to see the
movie. For once, the juvenile set can thank the ratings
system for keeping them out.</P>
<PRE>Not Rated. Running Time: 87 minutes. (C) 1999
Harvey Karten</PRE>
<HR><P CLASS=flush><SMALL>The review above was posted to the
<A HREF="news:rec.arts.movies.reviews">rec.arts.movies.reviews</A> newsgroup (<A HREF="news:de.rec.film.kritiken">de.rec.film.kritiken</A> for German reviews).<BR>
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.<BR>
Please direct comments/criticisms of the review to relevant newsgroups.<BR>
Broken URLs inthe reviews are the responsibility of the author.<BR>
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
</SMALL></P>
<P ALIGN=CENTER>Related links: <A HREF="/Reviews/">index of all rec.arts.movies.reviews reviews</A></P>
</P></BODY></HTML>
|
xianjunzhengbackup/code
|
data science/machine_learning_for_the_web/chapter_4/movie/17880.html
|
HTML
|
mit
| 5,171
|
// stdafx.cpp : source file that includes just the standard includes
// Pookie.DayTime.Client.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
// TODO: reference any additional headers you need in STDAFX.H
// and not in this file
|
jleo2255/c_challenges
|
Pookie.DayTime.Client/Pookie.DayTime.Client/stdafx.cpp
|
C++
|
mit
| 300
|
#!/usr/bin/env bash
WORKING_DIR=/your/path/to/MyDict
PYTHON=python3
${PYTHON} ${WORKING_DIR}/main.py
|
zhuzhenpeng/MyDict
|
mydict.sh
|
Shell
|
mit
| 102
|
/* -----------------------------------------------------------------------------------------------------------
Software License for The Fraunhofer FDK AAC Codec Library for Android
© Copyright 1995 - 2013 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.
All rights reserved.
1. INTRODUCTION
The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software that implements
the MPEG Advanced Audio Coding ("AAC") encoding and decoding scheme for digital audio.
This FDK AAC Codec software is intended to be used on a wide variety of Android devices.
AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient general perceptual
audio codecs. AAC-ELD is considered the best-performing full-bandwidth communications codec by
independent studies and is widely deployed. AAC has been standardized by ISO and IEC as part
of the MPEG specifications.
Patent licenses for necessary patent claims for the FDK AAC Codec (including those of Fraunhofer)
may be obtained through Via Licensing (www.vialicensing.com) or through the respective patent owners
individually for the purpose of encoding or decoding bit streams in products that are compliant with
the ISO/IEC MPEG audio standards. Please note that most manufacturers of Android devices already license
these patent claims through Via Licensing or directly from the patent owners, and therefore FDK AAC Codec
software may already be covered under those patent licenses when it is used for those licensed purposes only.
Commercially-licensed AAC software libraries, including floating-point versions with enhanced sound quality,
are also available from Fraunhofer. Users are encouraged to check the Fraunhofer website for additional
applications information and documentation.
2. COPYRIGHT LICENSE
Redistribution and use in source and binary forms, with or without modification, are permitted without
payment of copyright license fees provided that you satisfy the following conditions:
You must retain the complete text of this software license in redistributions of the FDK AAC Codec or
your modifications thereto in source code form.
You must retain the complete text of this software license in the documentation and/or other materials
provided with redistributions of the FDK AAC Codec or your modifications thereto in binary form.
You must make available free of charge copies of the complete source code of the FDK AAC Codec and your
modifications thereto to recipients of copies in binary form.
The name of Fraunhofer may not be used to endorse or promote products derived from this library without
prior written permission.
You may not charge copyright license fees for anyone to use, copy or distribute the FDK AAC Codec
software or your modifications thereto.
Your modified versions of the FDK AAC Codec must carry prominent notices stating that you changed the software
and the date of any change. For modified versions of the FDK AAC Codec, the term
"Fraunhofer FDK AAC Codec Library for Android" must be replaced by the term
"Third-Party Modified Version of the Fraunhofer FDK AAC Codec Library for Android."
3. NO PATENT LICENSE
NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without limitation the patents of Fraunhofer,
ARE GRANTED BY THIS SOFTWARE LICENSE. Fraunhofer provides no warranty of patent non-infringement with
respect to this software.
You may use this FDK AAC Codec software or modifications thereto only for purposes that are authorized
by appropriate patent licenses.
4. DISCLAIMER
This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright holders and contributors
"AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, including but not limited to the implied warranties
of merchantability and fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary, or consequential damages,
including but not limited to procurement of substitute goods or services; loss of use, data, or profits,
or business interruption, however caused and on any theory of liability, whether in contract, strict
liability, or tort (including negligence), arising in any way out of the use of this software, even if
advised of the possibility of such damage.
5. CONTACT INFORMATION
Fraunhofer Institute for Integrated Circuits IIS
Attention: Audio and Multimedia Departments - FDK AAC LL
Am Wolfsmantel 33
91058 Erlangen, Germany
www.iis.fraunhofer.de/amm
amm-info@iis.fraunhofer.de
----------------------------------------------------------------------------------------------------------- */
/***************************** MPEG-4 AAC Decoder **************************
Author(s): Josef Hoepfl
Description: long/short-block decoding
******************************************************************************/
#include "block.h"
#include "aac_rom.h"
#include "FDK_bitstream.h"
#include "FDK_tools_rom.h"
#include "aacdec_hcr.h"
#include "rvlc.h"
#if defined(__arm__)
#include "arm/block_arm.cpp"
#endif
/*!
\brief Read escape sequence of codeword
The function reads the escape sequence from the bitstream,
if the absolute value of the quantized coefficient has the
value 16.
\return quantized coefficient
*/
LONG CBlock_GetEscape(HANDLE_FDK_BITSTREAM bs, /*!< pointer to bitstream */
const LONG q) /*!< quantized coefficient */
{
LONG i, off, neg ;
if (q < 0)
{
if (q != -16) return q;
neg = 1;
}
else
{
if (q != +16) return q;
neg = 0;
}
for (i=4; ; i++)
{
if (FDKreadBits(bs,1) == 0)
break;
}
if (i > 16)
{
if (i - 16 > CACHE_BITS) { /* cannot read more than "CACHE_BITS" bits at once in the function FDKreadBits() */
return (MAX_QUANTIZED_VALUE + 1); /* returning invalid value that will be captured later */
}
off = FDKreadBits(bs,i-16) << 16;
off |= FDKreadBits(bs,16);
}
else
{
off = FDKreadBits(bs,i);
}
i = off + (1 << i);
if (neg) i = -i;
return i;
}
AAC_DECODER_ERROR CBlock_ReadScaleFactorData(
CAacDecoderChannelInfo *pAacDecoderChannelInfo,
HANDLE_FDK_BITSTREAM bs,
UINT flags
)
{
int temp;
int band;
int group;
int position = 0; /* accu for intensity delta coding */
int factor = pAacDecoderChannelInfo->pDynData->RawDataInfo.GlobalGain; /* accu for scale factor delta coding */
UCHAR *pCodeBook = pAacDecoderChannelInfo->pDynData->aCodeBook;
SHORT *pScaleFactor = pAacDecoderChannelInfo->pDynData->aScaleFactor;
const CodeBookDescription *hcb =&AACcodeBookDescriptionTable[BOOKSCL];
int ScaleFactorBandsTransmitted = GetScaleFactorBandsTransmitted(&pAacDecoderChannelInfo->icsInfo);
for (group=0; group < GetWindowGroups(&pAacDecoderChannelInfo->icsInfo); group++)
{
for (band=0; band < ScaleFactorBandsTransmitted; band++)
{
switch (pCodeBook[group*16+band]) {
case ZERO_HCB: /* zero book */
pScaleFactor[group*16+band] = 0;
break;
default: /* decode scale factor */
{
temp = CBlock_DecodeHuffmanWord(bs,hcb);
factor += temp - 60; /* MIDFAC 1.5 dB */
}
pScaleFactor[group*16+band] = factor - 100;
break;
case INTENSITY_HCB: /* intensity steering */
case INTENSITY_HCB2:
temp = CBlock_DecodeHuffmanWord(bs,hcb);
position += temp - 60;
pScaleFactor[group*16+band] = position - 100;
break;
case NOISE_HCB: /* PNS */
if (flags & (AC_MPS_RES|AC_USAC|AC_RSVD50)) {
return AAC_DEC_PARSE_ERROR;
}
CPns_Read( &pAacDecoderChannelInfo->data.aac.PnsData, bs, hcb, pAacDecoderChannelInfo->pDynData->aScaleFactor, pAacDecoderChannelInfo->pDynData->RawDataInfo.GlobalGain, band, group);
break;
}
}
}
return AAC_DEC_OK;
}
void CBlock_ScaleSpectralData(CAacDecoderChannelInfo *pAacDecoderChannelInfo, SamplingRateInfo *pSamplingRateInfo)
{
int band;
int window;
const SHORT * RESTRICT pSfbScale = pAacDecoderChannelInfo->pDynData->aSfbScale;
SHORT * RESTRICT pSpecScale = pAacDecoderChannelInfo->specScale;
int groupwin,group;
const SHORT * RESTRICT BandOffsets = GetScaleFactorBandOffsets(&pAacDecoderChannelInfo->icsInfo, pSamplingRateInfo);
SPECTRAL_PTR RESTRICT pSpectralCoefficient = pAacDecoderChannelInfo->pSpectralCoefficient;
FDKmemclear(pSpecScale, 8*sizeof(SHORT));
int max_band = GetScaleFactorBandsTransmitted(&pAacDecoderChannelInfo->icsInfo);
for (window=0, group=0; group < GetWindowGroups(&pAacDecoderChannelInfo->icsInfo); group++)
{
for (groupwin=0; groupwin < GetWindowGroupLength(&pAacDecoderChannelInfo->icsInfo,group); groupwin++, window++)
{
int SpecScale_window = pSpecScale[window];
FIXP_DBL *pSpectrum = SPEC(pSpectralCoefficient, window, pAacDecoderChannelInfo->granuleLength);
/* find scaling for current window */
for (band=0; band < max_band; band++)
{
SpecScale_window = fMax(SpecScale_window, (int)pSfbScale[window*16+band]);
}
if (pAacDecoderChannelInfo->pDynData->TnsData.Active) {
SpecScale_window += TNS_SCALE;
}
/* store scaling of current window */
pSpecScale[window] = SpecScale_window;
#ifdef FUNCTION_CBlock_ScaleSpectralData_func1
CBlock_ScaleSpectralData_func1(pSpectrum, max_band, BandOffsets, SpecScale_window, pSfbScale, window);
#else /* FUNCTION_CBlock_ScaleSpectralData_func1 */
for (band=0; band < max_band; band++)
{
int scale = SpecScale_window - pSfbScale[window*16+band];
if (scale)
{
/* following relation can be used for optimizations: (BandOffsets[i]%4) == 0 for all i */
int max_index = BandOffsets[band+1];
for (int index = BandOffsets[band]; index < max_index; index++)
{
pSpectrum[index] >>= scale;
}
}
}
#endif /* FUNCTION_CBlock_ScaleSpectralData_func1 */
}
}
}
AAC_DECODER_ERROR CBlock_ReadSectionData(HANDLE_FDK_BITSTREAM bs,
CAacDecoderChannelInfo *pAacDecoderChannelInfo,
const SamplingRateInfo *pSamplingRateInfo,
const UINT flags)
{
int top, band;
int sect_len, sect_len_incr;
int group;
UCHAR sect_cb;
UCHAR *pCodeBook = pAacDecoderChannelInfo->pDynData->aCodeBook;
/* HCR input (long) */
SHORT *pNumLinesInSec = pAacDecoderChannelInfo->pDynData->specificTo.aac.aNumLineInSec4Hcr;
int numLinesInSecIdx = 0;
UCHAR *pHcrCodeBook = pAacDecoderChannelInfo->pDynData->specificTo.aac.aCodeBooks4Hcr;
const SHORT *BandOffsets = GetScaleFactorBandOffsets(&pAacDecoderChannelInfo->icsInfo, pSamplingRateInfo);
pAacDecoderChannelInfo->pDynData->specificTo.aac.numberSection = 0;
AAC_DECODER_ERROR ErrorStatus = AAC_DEC_OK;
FDKmemclear(pCodeBook, sizeof(UCHAR)*(8*16));
const int nbits = (IsLongBlock(&pAacDecoderChannelInfo->icsInfo) == 1) ? 5 : 3;
int sect_esc_val = (1 << nbits) - 1 ;
UCHAR ScaleFactorBandsTransmitted = GetScaleFactorBandsTransmitted(&pAacDecoderChannelInfo->icsInfo);
for (group=0; group<GetWindowGroups(&pAacDecoderChannelInfo->icsInfo); group++)
{
for (band=0; band < ScaleFactorBandsTransmitted; )
{
sect_len = 0;
if ( flags & AC_ER_VCB11 ) {
sect_cb = (UCHAR) FDKreadBits(bs,5);
}
else
sect_cb = (UCHAR) FDKreadBits(bs,4);
if ( ((flags & AC_ER_VCB11) == 0) || ( sect_cb < 11 ) || ((sect_cb > 11) && (sect_cb < 16)) ) {
sect_len_incr = FDKreadBits(bs, nbits);
while (sect_len_incr == sect_esc_val)
{
sect_len += sect_esc_val;
sect_len_incr = FDKreadBits(bs, nbits);
}
}
else {
sect_len_incr = 1;
}
sect_len += sect_len_incr;
top = band + sect_len;
if (flags & AC_ER_HCR) {
/* HCR input (long) -- collecting sideinfo (for HCR-_long_ only) */
pNumLinesInSec[numLinesInSecIdx] = BandOffsets[top] - BandOffsets[band];
numLinesInSecIdx++;
if (numLinesInSecIdx >= MAX_SFB_HCR) {
return AAC_DEC_PARSE_ERROR;
}
if (sect_cb == BOOKSCL)
{
return AAC_DEC_INVALID_CODE_BOOK;
} else {
*pHcrCodeBook++ = sect_cb;
}
pAacDecoderChannelInfo->pDynData->specificTo.aac.numberSection++;
}
/* Check spectral line limits */
if (IsLongBlock( &(pAacDecoderChannelInfo->icsInfo) ))
{
if (top > 64) {
return AAC_DEC_DECODE_FRAME_ERROR;
}
} else { /* short block */
if (top + group*16 > (8 * 16)) {
return AAC_DEC_DECODE_FRAME_ERROR;
}
}
/* Check if decoded codebook index is feasible */
if ( (sect_cb == BOOKSCL)
|| ( (sect_cb == INTENSITY_HCB || sect_cb == INTENSITY_HCB2) && pAacDecoderChannelInfo->pDynData->RawDataInfo.CommonWindow == 0)
)
{
return AAC_DEC_INVALID_CODE_BOOK;
}
/* Store codebook index */
for (; band < top; band++)
{
pCodeBook[group*16+band] = sect_cb;
}
}
}
return ErrorStatus;
}
/* mso: provides a faster way to i-quantize a whole band in one go */
/**
* \brief inverse quantize one sfb. Each value of the sfb is processed according to the
* formula: spectrum[i] = Sign(spectrum[i]) * Matissa(spectrum[i])^(4/3) * 2^(lsb/4).
* \param spectrum pointer to first line of the sfb to be inverse quantized.
* \param noLines number of lines belonging to the sfb.
* \param lsb last 2 bits of the scale factor of the sfb.
* \param scale max allowed shift scale for the sfb.
*/
static
void InverseQuantizeBand( FIXP_DBL * RESTRICT spectrum,
INT noLines,
INT lsb,
INT scale )
{
const FIXP_DBL * RESTRICT InverseQuantTabler=(FIXP_DBL *)InverseQuantTable;
const FIXP_DBL * RESTRICT MantissaTabler=(FIXP_DBL *)MantissaTable[lsb];
const SCHAR* RESTRICT ExponentTabler=(SCHAR*)ExponentTable[lsb];
FIXP_DBL *ptr = spectrum;
FIXP_DBL signedValue;
FDK_ASSERT(noLines>2);
for (INT i=noLines; i--; )
{
if ((signedValue = *ptr++) != FL2FXCONST_DBL(0))
{
FIXP_DBL value = fAbs(signedValue);
UINT freeBits = CntLeadingZeros(value);
UINT exponent = 32 - freeBits;
UINT x = (UINT) (LONG)value << (INT) freeBits;
x <<= 1; /* shift out sign bit to avoid masking later on */
UINT tableIndex = x >> 24;
x = (x >> 20) & 0x0F;
UINT r0=(UINT)(LONG)InverseQuantTabler[tableIndex+0];
UINT r1=(UINT)(LONG)InverseQuantTabler[tableIndex+1];
UINT temp= (r1 - r0)*x + (r0 << 4);
value = fMultDiv2((FIXP_DBL)temp, MantissaTabler[exponent]);
/* + 1 compensates fMultDiv2() */
scaleValueInPlace(&value, scale + ExponentTabler[exponent] + 1);
signedValue = (signedValue < (FIXP_DBL)0) ? -value : value;
ptr[-1] = signedValue;
}
}
}
AAC_DECODER_ERROR CBlock_InverseQuantizeSpectralData(CAacDecoderChannelInfo *pAacDecoderChannelInfo, SamplingRateInfo *pSamplingRateInfo)
{
int window, group, groupwin, band;
int ScaleFactorBandsTransmitted = GetScaleFactorBandsTransmitted(&pAacDecoderChannelInfo->icsInfo);
UCHAR *RESTRICT pCodeBook = pAacDecoderChannelInfo->pDynData->aCodeBook;
SHORT *RESTRICT pSfbScale = pAacDecoderChannelInfo->pDynData->aSfbScale;
SHORT *RESTRICT pScaleFactor = pAacDecoderChannelInfo->pDynData->aScaleFactor;
const SHORT *RESTRICT BandOffsets = GetScaleFactorBandOffsets(&pAacDecoderChannelInfo->icsInfo, pSamplingRateInfo);
FDKmemclear(pAacDecoderChannelInfo->pDynData->aSfbScale, (8*16)*sizeof(SHORT));
for (window=0, group=0; group < GetWindowGroups(&pAacDecoderChannelInfo->icsInfo); group++)
{
for (groupwin=0; groupwin < GetWindowGroupLength(&pAacDecoderChannelInfo->icsInfo,group); groupwin++, window++)
{
/* inverse quantization */
for (band=0; band < ScaleFactorBandsTransmitted; band++)
{
FIXP_DBL *pSpectralCoefficient = SPEC(pAacDecoderChannelInfo->pSpectralCoefficient, window, pAacDecoderChannelInfo->granuleLength) + BandOffsets[band];
int noLines = BandOffsets[band+1] - BandOffsets[band];
int bnds = group*16+band;
int i;
if ((pCodeBook[bnds] == ZERO_HCB)
|| (pCodeBook[bnds] == INTENSITY_HCB)
|| (pCodeBook[bnds] == INTENSITY_HCB2)
)
continue;
if (pCodeBook[bnds] == NOISE_HCB)
{
/* Leave headroom for PNS values. + 1 because ceil(log2(2^(0.25*3))) = 1,
worst case of additional headroom required because of the scalefactor. */
pSfbScale[window*16+band] = (pScaleFactor [bnds] >> 2) + 1 ;
continue;
}
/* Find max spectral line value of the current sfb */
FIXP_DBL locMax = (FIXP_DBL)0;
for (i = noLines; i-- ; ) {
/* Expensive memory access */
locMax = fMax(fixp_abs(pSpectralCoefficient[i]), locMax);
}
/* Cheap robustness improvement - Do not remove!!! */
if (fixp_abs(locMax) > (FIXP_DBL)MAX_QUANTIZED_VALUE) {
return AAC_DEC_DECODE_FRAME_ERROR;
}
/*
The inverse quantized spectral lines are defined by:
pSpectralCoefficient[i] = Sign(pSpectralCoefficient[i]) * 2^(0.25*pScaleFactor[bnds]) * pSpectralCoefficient[i]^(4/3)
This is equivalent to:
pSpectralCoefficient[i] = Sign(pSpectralCoefficient[i]) * (2^(pScaleFactor[bnds] % 4) * pSpectralCoefficient[i]^(4/3))
pSpectralCoefficient_e[i] += pScaleFactor[bnds]/4
*/
{
int msb = pScaleFactor [bnds] >> 2 ;
int lsb = pScaleFactor [bnds] & 0x03 ;
int scale = GetScaleFromValue(locMax, lsb);
pSfbScale[window*16+band] = msb - scale;
InverseQuantizeBand(pSpectralCoefficient, noLines, lsb, scale);
}
}
}
}
return AAC_DEC_OK;
}
AAC_DECODER_ERROR CBlock_ReadSpectralData(HANDLE_FDK_BITSTREAM bs,
CAacDecoderChannelInfo *pAacDecoderChannelInfo,
const SamplingRateInfo *pSamplingRateInfo,
const UINT flags)
{
int i,index;
int window,group,groupwin,groupoffset,band;
UCHAR *RESTRICT pCodeBook = pAacDecoderChannelInfo->pDynData->aCodeBook;
const SHORT *RESTRICT BandOffsets = GetScaleFactorBandOffsets(&pAacDecoderChannelInfo->icsInfo, pSamplingRateInfo);
SPECTRAL_PTR pSpectralCoefficient = pAacDecoderChannelInfo->pSpectralCoefficient;
FIXP_DBL locMax;
int ScaleFactorBandsTransmitted = GetScaleFactorBandsTransmitted(&pAacDecoderChannelInfo->icsInfo);
FDK_ASSERT(BandOffsets != NULL);
FDKmemclear(pSpectralCoefficient, sizeof(SPECTRUM));
if ( (flags & AC_ER_HCR) == 0 )
{
groupoffset = 0;
/* plain huffman decoder short */
for (group=0; group < GetWindowGroups(&pAacDecoderChannelInfo->icsInfo); group++)
{
for (band=0; band < ScaleFactorBandsTransmitted; band++)
{
int bnds = group*16+band;
UCHAR currentCB = pCodeBook[bnds];
/* patch to run plain-huffman-decoder with vcb11 input codebooks (LAV-checking might be possible below using the virtual cb and a LAV-table) */
if ((currentCB >= 16) && (currentCB <= 31)) {
pCodeBook[bnds] = currentCB = 11;
}
if ( !((currentCB == ZERO_HCB)
|| (currentCB == NOISE_HCB)
|| (currentCB == INTENSITY_HCB)
|| (currentCB == INTENSITY_HCB2)) )
{
const CodeBookDescription *hcb = &AACcodeBookDescriptionTable[currentCB];
int step = hcb->Dimension;
int offset = hcb->Offset;
int bits = hcb->numBits;
int mask = (1<<bits)-1;
for (groupwin=0; groupwin < GetWindowGroupLength(&pAacDecoderChannelInfo->icsInfo,group); groupwin++)
{
window = groupoffset + groupwin;
FIXP_DBL *mdctSpectrum = SPEC(pSpectralCoefficient, window, pAacDecoderChannelInfo->granuleLength);
locMax = (FIXP_DBL)0 ;
for (index=BandOffsets[band]; index < BandOffsets[band+1]; index+=step)
{
int idx = CBlock_DecodeHuffmanWord(bs,hcb);
for (i=0; i<step; i++) {
FIXP_DBL tmp;
tmp = (FIXP_DBL)((idx & mask)-offset);
idx >>= bits;
if (offset == 0) {
if (tmp != FIXP_DBL(0))
tmp = (FDKreadBits(bs,1))? -tmp : tmp;
}
mdctSpectrum[index+i] = tmp;
}
if (currentCB == ESCBOOK)
{
mdctSpectrum[index+0] = (FIXP_DBL)CBlock_GetEscape(bs, (LONG)mdctSpectrum[index+0]);
mdctSpectrum[index+1] = (FIXP_DBL)CBlock_GetEscape(bs, (LONG)mdctSpectrum[index+1]);
}
}
}
}
}
groupoffset += GetWindowGroupLength(&pAacDecoderChannelInfo->icsInfo,group);
}
/* plain huffman decoding (short) finished */
}
/* HCR - Huffman Codeword Reordering short */
else /* if ( flags & AC_ER_HCR ) */
{
H_HCR_INFO hHcr = &pAacDecoderChannelInfo->pComData->overlay.aac.erHcrInfo;
int hcrStatus = 0;
/* advanced Huffman decoding starts here (HCR decoding :) */
if ( pAacDecoderChannelInfo->pDynData->specificTo.aac.lenOfReorderedSpectralData != 0 ) {
/* HCR initialization short */
hcrStatus = HcrInit(hHcr, pAacDecoderChannelInfo, pSamplingRateInfo, bs);
if (hcrStatus != 0) {
return AAC_DEC_DECODE_FRAME_ERROR;
}
/* HCR decoding short */
hcrStatus = HcrDecoder(hHcr, pAacDecoderChannelInfo, pSamplingRateInfo, bs);
if (hcrStatus != 0) {
#if HCR_ERROR_CONCEALMENT
HcrMuteErroneousLines(hHcr);
#else
return AAC_DEC_DECODE_FRAME_ERROR;
#endif /* HCR_ERROR_CONCEALMENT */
}
FDKpushFor (bs, pAacDecoderChannelInfo->pDynData->specificTo.aac.lenOfReorderedSpectralData);
}
}
/* HCR - Huffman Codeword Reordering short finished */
if ( IsLongBlock(&pAacDecoderChannelInfo->icsInfo) && !(flags & (AC_ELD|AC_SCALABLE)) )
{
/* apply pulse data */
CPulseData_Apply(&pAacDecoderChannelInfo->pDynData->specificTo.aac.PulseData,
GetScaleFactorBandOffsets(&pAacDecoderChannelInfo->icsInfo, pSamplingRateInfo),
SPEC_LONG(pSpectralCoefficient));
}
return AAC_DEC_OK;
}
void ApplyTools ( CAacDecoderChannelInfo *pAacDecoderChannelInfo[],
const SamplingRateInfo *pSamplingRateInfo,
const UINT flags,
const int channel )
{
if ( !(flags & (AC_USAC|AC_RSVD50|AC_MPS_RES)) ) {
CPns_Apply(
&pAacDecoderChannelInfo[channel]->data.aac.PnsData,
&pAacDecoderChannelInfo[channel]->icsInfo,
pAacDecoderChannelInfo[channel]->pSpectralCoefficient,
pAacDecoderChannelInfo[channel]->specScale,
pAacDecoderChannelInfo[channel]->pDynData->aScaleFactor,
pSamplingRateInfo,
pAacDecoderChannelInfo[channel]->granuleLength,
channel
);
}
CTns_Apply (
&pAacDecoderChannelInfo[channel]->pDynData->TnsData,
&pAacDecoderChannelInfo[channel]->icsInfo,
pAacDecoderChannelInfo[channel]->pSpectralCoefficient,
pSamplingRateInfo,
pAacDecoderChannelInfo[channel]->granuleLength
);
}
static
int getWindow2Nr(int length, int shape)
{
int nr = 0;
if (shape == 2) {
/* Low Overlap, 3/4 zeroed */
nr = (length * 3)>>2;
}
return nr;
}
void CBlock_FrequencyToTime(CAacDecoderStaticChannelInfo *pAacDecoderStaticChannelInfo,
CAacDecoderChannelInfo *pAacDecoderChannelInfo,
INT_PCM outSamples[],
const SHORT frameLen,
const int stride,
const int frameOk,
FIXP_DBL *pWorkBuffer1 )
{
int fr, fl, tl, nSamples, nSpec;
/* Determine left slope length (fl), right slope length (fr) and transform length (tl).
USAC: The slope length may mismatch with the previous frame in case of LPD / FD
transitions. The adjustment is handled by the imdct implementation.
*/
tl = frameLen;
nSpec = 1;
switch( pAacDecoderChannelInfo->icsInfo.WindowSequence ) {
default:
case OnlyLongSequence:
fl = frameLen;
fr = frameLen - getWindow2Nr(frameLen, GetWindowShape(&pAacDecoderChannelInfo->icsInfo));
break;
case LongStopSequence:
fl = frameLen >> 3;
fr = frameLen;
break;
case LongStartSequence: /* or StopStartSequence */
fl = frameLen;
fr = frameLen >> 3;
break;
case EightShortSequence:
fl = fr = frameLen >> 3;
tl >>= 3;
nSpec = 8;
break;
}
{
int i;
{
FIXP_DBL *tmp = pAacDecoderChannelInfo->pComData->workBufferCore1->mdctOutTemp;
nSamples = imdct_block(
&pAacDecoderStaticChannelInfo->IMdct,
tmp,
SPEC_LONG(pAacDecoderChannelInfo->pSpectralCoefficient),
pAacDecoderChannelInfo->specScale,
nSpec,
frameLen,
tl,
FDKgetWindowSlope(fl, GetWindowShape(&pAacDecoderChannelInfo->icsInfo)),
fl,
FDKgetWindowSlope(fr, GetWindowShape(&pAacDecoderChannelInfo->icsInfo)),
fr,
(FIXP_DBL)0 );
for (i=0; i<frameLen; i++) {
outSamples[i*stride] = IMDCT_SCALE(tmp[i]);
}
}
}
FDK_ASSERT(nSamples == frameLen);
}
#include "ldfiltbank.h"
void CBlock_FrequencyToTimeLowDelay( CAacDecoderStaticChannelInfo *pAacDecoderStaticChannelInfo,
CAacDecoderChannelInfo *pAacDecoderChannelInfo,
INT_PCM outSamples[],
const short frameLen,
const char stride )
{
InvMdctTransformLowDelay_fdk (
SPEC_LONG(pAacDecoderChannelInfo->pSpectralCoefficient),
pAacDecoderChannelInfo->specScale[0],
outSamples,
pAacDecoderStaticChannelInfo->pOverlapBuffer,
stride,
frameLen
);
}
|
alesaccoia/asutilities
|
thirdparty/fdk-aac/libAACdec/src/block.cpp
|
C++
|
mit
| 26,810
|
#!/usr/bin/env python
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# 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.
#
__revision__ = "test/scons-time/mem/stage.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
"""
Verify the mem --stage option.
"""
import TestSCons_time
test = TestSCons_time.TestSCons_time()
test.fake_logfile('foo-000-0.log', 0)
test.fake_logfile('foo-000-1.log', 0)
test.fake_logfile('foo-000-2.log', 0)
test.fake_logfile('foo-001-0.log', 1)
test.fake_logfile('foo-001-1.log', 1)
test.fake_logfile('foo-001-2.log', 1)
expect = """\
set key bottom left
plot '-' title "Startup" with lines lt 1, \\
'-' title "Full build" with lines lt 2, \\
'-' title "Up-to-date build" with lines lt 3
# Startup
0 %(index)s000.000
1 %(index)s001.000
e
# Full build
0 %(index)s000.000
1 %(index)s001.000
e
# Up-to-date build
0 %(index)s000.000
1 %(index)s001.000
e
"""
pre_read = expect % {'index' : 1}
post_read = expect % {'index' : 2}
pre_build = expect % {'index' : 3}
post_build = expect % {'index' : 4}
test.run(arguments = 'mem --fmt gnuplot --stage pre-read', stdout=pre_read)
test.run(arguments = 'mem --fmt gnuplot --stage=post-read', stdout=post_read)
test.run(arguments = 'mem --fmt gnuplot --stage=pre-build', stdout=pre_build)
test.run(arguments = 'mem --fmt gnuplot --stage post-build', stdout=post_build)
expect = """\
scons-time: mem: Unrecognized stage "unknown".
"""
test.run(arguments = 'mem --fmt gnuplot --stage unknown',
status = 1,
stderr = expect)
test.pass_test()
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=4 shiftwidth=4:
|
EmanueleCannizzaro/scons
|
test/scons-time/mem/stage.py
|
Python
|
mit
| 2,679
|
#!/bin/bash
# Script to provide IP Address score as per projecthoneypot
# Input your HTTP:bl API Key from the site in the "KEY" field below:
KEY='';
SUFFIX="dnsbl.httpbl.org";
echo "Enter IP Address:";
read IPADDRESS;
REVERSEIP=$(echo "$IPADDRESS" | awk -F. '{print $4"."$3"."$2"."$1}');
RESULT=$(eval $echo "dig +short $KEY"."$REVERSEIP"."$SUFFIX");
if [[ -z "$RESULT" ]]; then
echo "IP Address is Clean as per ProjectHoneyPot";
exit;
fi
# 2nd Octet Provides the no. of days back the IP Address was seen by ProjectHoneyPot
LASTSEEN=$(echo $RESULT | awk -F. '{print $2}');
echo "Last Seen = $LASTSEEN days back!";
# 4th Octet Provides the Category
CATEGORYOCTET=$(echo $RESULT | awk -F. '{print $4}');
if [[ $CATEGORYOCTET -eq 0 ]]; then
CATEGORY=SearchEngine;
elif [[ $CATEGORYOCTET -eq 1 ]]; then
CATEGORY=Suspicious;
elif [[ $CATEGORYOCTET -eq 2 ]]; then
CATEGORY=Harvester;
elif [[ $CATEGORYOCTET -eq 4 ]]; then
CATEGORY=CommentSpammer;
fi
echo "Category = $CATEGORY";
# 3rd Octet provides the Threat Score or the Search Engine Name if Category is Search Engine
SCORE=$(echo $RESULT | awk -F. '{print $3}');
if [[ $CATEGORYOCTET -eq 0 ]]; then
if [[ $SCORE -eq 0 ]]; then
SEARCHENGINE=Undocumented;
elif [[ $SCORE -eq 1 ]]; then
SEARCHENGINE=AltaVista;
elif [[ $SCORE -eq 2 ]]; then
SEARCHENGINE=Ask;
elif [[ $SCORE -eq 3 ]]; then
SEARCHENGINE=Baidu;
elif [[ $SCORE -eq 4 ]]; then
SEARCHENGINE=Excite;
elif [[ $SCORE -eq 5 ]]; then
SEARCHENGINE=Google;
elif [[ $SCORE -eq 6 ]]; then
SEARCHENGINE=Looksmart;
elif [[ $SCORE -eq 7 ]]; then
SEARCHENGINE=Lycos;
elif [[ $SCORE -eq 8 ]]; then
SEARCHENGINE=MSN;
elif [[ $SCORE -eq 9 ]]; then
SEARCHENGINE=Yahoo;
elif [[ $SCORE -eq 10 ]]; then
SEARCHENGINE=Cuil;
elif [[ $SCORE -eq 11 ]]; then
SEARCHENGINE=InfoSeek;
elif [[ $SCORE -eq 12 ]]; then
SEARCHENGINE=Miscellaneous;
fi
echo "Search Engine Name = $SEARCHENGINE";
else
echo "Threat Score = $SCORE"
fi
|
aarvee11/ProjectHoneyPotTool
|
checkip.sh
|
Shell
|
mit
| 1,998
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>ext-lib: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.7.1+1 / ext-lib - 0.11.6</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
ext-lib
<small>
0.11.6
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-02-11 17:12:35 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-02-11 17:12:35 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
camlp5 7.14 Preprocessor-pretty-printer of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-perl 2 Virtual package relying on perl
coq 8.7.1+1 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.08.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.08.1 Official release 4.08.1
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.3 A library manager for OCaml
# opam file:
opam-version: "2.0"
synopsis: "A library of Coq definitions, theorems, and tactics"
description:
"A collection of theories and plugins that may be useful in other Coq developments."
maintainer: "gmalecha@gmail.com"
authors: "Gregory Malecha"
license: "BSD-2-Clause"
tags: "logpath:ExtLib"
homepage: "https://github.com/coq-community/coq-ext-lib"
bug-reports: "https://github.com/coq-community/coq-ext-lib/issues"
depends: [
"ocaml"
"coq" {>= "8.8"}
]
build: [make "-j%{jobs}%" "theories"]
run-test: [make "-j%{jobs}%" "examples"]
install: [make "install"]
dev-repo: "git+https://github.com/coq-community/coq-ext-lib.git"
url {
src: "https://github.com/coq-community/coq-ext-lib/archive/v0.11.6.tar.gz"
checksum: [
"md5=442577afb6ff3a02043478690057cc21"
"sha512=5e429e291439885c57ad537d2bf644345973740e29cff42e4045367f9f1e22a406b15e17af415e8d301eb0caf179495a506ea04c1ce39f94875366a49aa2db80"
]
}</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-ext-lib.0.11.6 coq.8.7.1+1</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.7.1+1).
The following dependencies couldn't be met:
- coq-ext-lib -> coq >= 8.8
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-ext-lib.0.11.6</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
|
coq-bench/coq-bench.github.io
|
clean/Linux-x86_64-4.08.1-2.0.5/released/8.7.1+1/ext-lib/0.11.6.html
|
HTML
|
mit
| 6,826
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>dijkstra: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.6 / dijkstra - 0.1.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
dijkstra
<small>
0.1.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2021-12-14 11:53:07 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2021-12-14 11:53:07 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-num base Num library distributed with the OCaml compiler
base-ocamlbuild base OCamlbuild binary and libraries distributed with the OCaml compiler
base-threads base
base-unix base
camlp5 7.14 Preprocessor-pretty-printer of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-perl 1 Virtual package relying on perl
coq 8.6 Formal proof management system
num 0 The Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.02.3 The OCaml compiler (virtual package)
ocaml-base-compiler 4.02.3 Official 4.02.3 release
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.1 A library manager for OCaml
# opam file:
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
synopsis: "A Verified Implementation of Dijkstra's Algorithm"
maintainer: ["Masayuki Mizuno <mizuno@wantedly.com>"]
authors: ["Masayuki Mizuno <mizuno@wantedly.com>"]
license: "MIT"
homepage: "https://github.com/fetburner/coq-dijkstra"
bug-reports: "https://github.com/fetburner/coq-dijkstra/issues"
depends: [
"dune" {>= "2.5"}
"coq" {>= "8.8"}
"coq-mathcomp-ssreflect" {>= "1.11"}
]
build: [
["dune" "subst"] {pinned}
[
"dune"
"build"
"-p"
name
"-j"
jobs
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
]
dev-repo: "git+https://github.com/fetburner/coq-dijkstra.git"
tags: [
"keyword:graph theory"
"keyword:shortest path"
"keyword:Dijkstra's algorithm"
"category:Computer Science/Graph Theory"
"date:2021-03-02"
"logpath:Dijkstra"
]
url {
src: "https://github.com/fetburner/coq-dijkstra/archive/0.1.0.tar.gz"
checksum: "md5=ba5b8f156d209b428eaafe75436bee97"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-dijkstra.0.1.0 coq.8.6</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.6).
The following dependencies couldn't be met:
- coq-dijkstra -> coq-mathcomp-ssreflect >= 1.11 -> coq >= 8.7 -> ocaml >= 4.05.0
base of this switch (use `--unlock-base' to force)
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-dijkstra.0.1.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
|
coq-bench/coq-bench.github.io
|
clean/Linux-x86_64-4.02.3-2.0.6/released/8.6/dijkstra/0.1.0.html
|
HTML
|
mit
| 7,339
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>corn: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.10.1 / corn - 1.0.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
corn
<small>
1.0.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2021-10-27 08:55:36 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2021-10-27 08:55:36 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
coq 8.10.1 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.09.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.09.1 Official release 4.09.1
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.1 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "b.a.w.spitters@gmail.com"
homepage: "http://corn.cs.ru.nl/"
doc: "http://corn.cs.ru.nl/"
authors: "Corn development team"
license: "GPL 2"
build: [
["./configure.sh"]
[make "-j%{jobs}%"]
]
install: [make "install"]
depends: [
"ocaml"
"coq" {>= "8.4pl4" & < "8.5~"}
"coq-math-classes"
]
tags: [
"logpath:CoRN"
]
synopsis: "The CoRN library"
url {
src:
"https://github.com/c-corn/corn/archive/e9162eaba7e705e793aad4dbbffdb606aba9b3bb.tar.gz"
checksum: "md5=868d1b9114497c6d92d7f75a9470b64d"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-corn.1.0.0 coq.8.10.1</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.10.1).
The following dependencies couldn't be met:
- coq-corn -> coq < 8.5~ -> ocaml < 4.03.0
base of this switch (use `--unlock-base' to force)
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-corn.1.0.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
|
coq-bench/coq-bench.github.io
|
clean/Linux-x86_64-4.09.1-2.0.6/released/8.10.1/corn/1.0.0.html
|
HTML
|
mit
| 6,265
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>hammer: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.10.0 / hammer - 1.3.2+8.14</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
hammer
<small>
1.3.2+8.14
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2021-12-07 06:33:16 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2021-12-07 06:33:16 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
coq 8.10.0 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.07.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.07.1 Official release 4.07.1
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.1 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "palmskog@gmail.com"
homepage: "https://github.com/lukaszcz/coqhammer"
dev-repo: "git+https://github.com/lukaszcz/coqhammer.git"
bug-reports: "https://github.com/lukaszcz/coqhammer/issues"
license: "LGPL-2.1-only"
synopsis: "General-purpose automated reasoning hammer tool for Coq"
description: """
A general-purpose automated reasoning hammer tool for Coq that combines
learning from previous proofs with the translation of problems to the
logics of automated systems and the reconstruction of successfully found proofs.
"""
build: [make "-j%{jobs}%" "plugin"]
install: [
[make "install-plugin"]
[make "test-plugin"] {with-test}
]
depends: [
"ocaml" { >= "4.08" }
"coq" {>= "8.14" & < "8.15~"}
("conf-g++" {build} | "conf-clang" {build})
"coq-hammer-tactics" {= version}
]
tags: [
"category:Miscellaneous/Coq Extensions"
"keyword:automation"
"keyword:hammer"
"logpath:Hammer.Plugin"
"date:2021-11-22"
]
authors: [
"Lukasz Czajka <lukaszcz@mimuw.edu.pl>"
"Cezary Kaliszyk <cezary.kaliszyk@uibk.ac.at>"
]
url {
src: "https://github.com/lukaszcz/coqhammer/archive/v1.3.2-coq8.14.tar.gz"
checksum: "sha512=68c6e6a2054ce9dd3d87cb61e667f638e7b9fb2b5ec9571427d9fac59d0901cbfa4e57c59edb3a8bc52c2626985fca6edbac42caf2acdc5858fb6e13f15afcea"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-hammer.1.3.2+8.14 coq.8.10.0</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.10.0).
The following dependencies couldn't be met:
- coq-hammer -> ocaml >= 4.08
base of this switch (use `--unlock-base' to force)
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-hammer.1.3.2+8.14</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
|
coq-bench/coq-bench.github.io
|
clean/Linux-x86_64-4.07.1-2.0.6/released/8.10.0/hammer/1.3.2+8.14.html
|
HTML
|
mit
| 7,174
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>disel-examples: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.7.1 / disel-examples - 2.2</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
disel-examples
<small>
2.2
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-01-28 23:20:48 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-01-28 23:20:48 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
camlp5 7.14 Preprocessor-pretty-printer of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-perl 2 Virtual package relying on perl
coq 8.7.1 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.09.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.09.1 Official release 4.09.1
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.2 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "palmskog@gmail.com"
homepage: "https://github.com/DistributedComponents/disel"
dev-repo: "git+https://github.com/DistributedComponents/disel.git"
bug-reports: "https://github.com/DistributedComponents/disel/issues"
license: "BSD-2-Clause"
synopsis: "Example systems for Disel, a separation-style logic for compositional verification of distributed systems in Coq"
build: [make "-j%{jobs}%" "-C" "Examples"]
install: [make "-C" "Examples" "install"]
depends: [
"ocaml"
"coq" {>= "8.7" & < "8.13~"}
"coq-mathcomp-ssreflect" {>= "1.9.0" & < "1.12~"}
"coq-fcsl-pcm" {< "1.3.0"}
"coq-disel" {= version}
]
tags: [
"category:Computer Science/Concurrent Systems and Protocols/Theory of concurrent systems"
"keyword:program verification"
"keyword:separation logic"
"keyword:distributed algorithms"
"logpath:DiSeL"
"date:2020-07-26"
]
authors: [
"Ilya Sergey"
"James R. Wilcox"
]
url {
src: "https://github.com/DistributedComponents/disel/archive/v2.2.tar.gz"
checksum: "sha512=52ede64ded6f54ec60220095d5315a1862a4eae067cdeeb418c5902167b2b8387a8e0de076811493808a55988b1753c1cf1c1c33e146d1279461fe056d4817a7"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-disel-examples.2.2 coq.8.7.1</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.7.1).
The following dependencies couldn't be met:
- coq-disel-examples -> coq-disel >= 2.2 -> coq-mathcomp-ssreflect >= 1.9.0 -> coq >= 8.10
- coq-disel-examples -> coq-fcsl-pcm < 1.3.0 -> coq-mathcomp-ssreflect < 1.8~ -> coq < 8.7~ -> ocaml < 4.06.0
base of this switch (use `--unlock-base' to force)
- coq-disel-examples -> coq-fcsl-pcm < 1.3.0 -> coq >= dev
no matching version
- coq-disel-examples -> coq-mathcomp-ssreflect >= 1.9.0 -> coq >= 8.10
Your request can't be satisfied:
- No available version of coq satisfies the constraints
- No available version of coq-mathcomp-ssreflect satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-disel-examples.2.2</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
|
coq-bench/coq-bench.github.io
|
clean/Linux-x86_64-4.09.1-2.0.6/released/8.7.1/disel-examples/2.2.html
|
HTML
|
mit
| 7,765
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("2.NotDevisableBy3And7")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("2.NotDevisableBy3And7")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("c16e57d6-a31c-4fe2-b9dd-ed34c911610e")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
|
Ico093/TelerikAcademy
|
C#1/Homework/6.Loops/6.Loops/2.NotDevisableBy3And7/Properties/AssemblyInfo.cs
|
C#
|
mit
| 1,418
|
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.Diagnostics.Runtime.Utilities;
using System.IO;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using Microsoft.CSharp;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using Microsoft.Diagnostics.Runtime.Interop;
namespace Microsoft.Diagnostics.Runtime.Tests
{
public static class Helpers
{
public static ClrMethod GetMethod(this ClrType type, string name)
{
return GetMethods(type, name).Single();
}
public static IEnumerable<ClrMethod> GetMethods(this ClrType type, string name)
{
return type.Methods.Where(m => m.Name == name);
}
public static HashSet<T> Unique<T>(this IEnumerable<T> self)
{
HashSet<T> set = new HashSet<T>();
foreach (T t in self)
set.Add(t);
return set;
}
public static ClrAppDomain GetDomainByName(this ClrRuntime runtime, string domainName)
{
return runtime.AppDomains.Where(ad => ad.Name == domainName).Single();
}
public static ClrModule GetModule(this ClrRuntime runtime, string filename)
{
return (from module in runtime.Modules
let file = Path.GetFileName(module.FileName)
where file.Equals(filename, StringComparison.OrdinalIgnoreCase)
select module).Single();
}
public static ClrThread GetMainThread(this ClrRuntime runtime)
{
ClrThread thread = runtime.Threads.Where(t => !t.IsFinalizer).Single();
return thread;
}
public static ClrStackFrame GetFrame(this ClrThread thread, string functionName)
{
return thread.StackTrace.Where(sf => sf.Method != null ? sf.Method.Name == functionName : false).Single();
}
public static string TestWorkingDirectory { get { return _userSetWorkingPath ?? _workingPath.Value; } set { Debug.Assert(!_workingPath.IsValueCreated); _userSetWorkingPath = value; } }
#region Working Path Helpers
static string _userSetWorkingPath = null;
static Lazy<string> _workingPath = new Lazy<string>(() => CreateWorkingPath(), true);
private static string CreateWorkingPath()
{
Random r = new Random();
string path;
do
{
path = Path.Combine(Environment.CurrentDirectory, TempRoot + r.Next().ToString());
} while (Directory.Exists(path));
Directory.CreateDirectory(path);
return path;
}
internal static readonly string TempRoot = "clrmd_removeme_";
#endregion
}
[TestClass]
public class GlobalCleanup
{
[AssemblyCleanup]
public static void AssemblyCleanup()
{
GC.Collect();
GC.WaitForPendingFinalizers();
foreach (string directory in Directory.GetDirectories(Environment.CurrentDirectory))
if (directory.Contains(Helpers.TempRoot))
Directory.Delete(directory, true);
}
}
}
|
JeffCyr/clrmd
|
src/Microsoft.Diagnostics.Runtime.Tests/Helpers.cs
|
C#
|
mit
| 3,242
|
# blog
Learning PHP and MySQL by creating a blog
|
MohammedAttya2/blog
|
README.md
|
Markdown
|
mit
| 49
|
<!DOCTYPE html>
<html>
<head>
<title>Game - Model Previewer</title>
<link href="../css/webglbook.css" rel="stylesheet" />
<link href="game-model-viewer.css" rel="stylesheet" />
<script src="../libs/Three.js"></script>
<script src="../libs/jquery-1.6.4.js"></script>
<script src="../libs/jquery.mousewheel.js"></script>
<script src="../libs/RequestAnimationFrame.js"></script>
<script src="../sim/sim.js"></script>
<script src="modelViewer.js"></script>
<script src="JSONModel.js"></script>
<script>
var app = null;
var container = null;
var currentModel = null;
var modelInfo = [
// Model from Turbosquid
// http://www.turbosquid.com/FullPreview/Index.cfm/ID/577061
// Author: deluxe3D
// http://www.turbosquid.com/Search/Artists/deluxe3D
{ modelClass : JSONModel, url : "../models/Nissan GTR OBJ/Objects/NissanOBJ1.js", scale:0.0254, model:null},
// Model from Turbosquid
// http://www.turbosquid.com/FullPreview/Index.cfm/ID/302272
// Author: Phosphoer
// http://www.turbosquid.com/Search/Artists/Phosphoer
{ modelClass : JSONModel, url : "../models/Nova Car/NovaCar.js", scale:0.33, position:{y:-1}, model:null},
// Model from Turbosquid
// http://www.turbosquid.com/FullPreview/Index.cfm/ID/595293
// Author: OpticalDreamSoft
// http://www.turbosquid.com/Search/Artists/OpticalDreamSoft
{ modelClass : JSONModel, url : "../models/Hatchback/body.js", scale:1, model:null},
{ modelClass : JSONModel, url : "../models/Hatchback/wheel.js", scale:5, model:null},
// Model from Turbosquid
// http://www.turbosquid.com/FullPreview/Index.cfm/ID/595293
// Author: sakis25
// http://www.turbosquid.com/Search/Artists/sakis25
{ modelClass : JSONModel, url : "../models/Camaro-1/Camaro.js", scale:0.1, position:{x:-.5, y:0},
rotation:{ x: -Math.PI / 2, z: Math.PI }, model:null},
// Model by Arefin Mohiuddin, Sunglass.io
// http://www.turbosquid.com/FullPreview/Index.cfm/ID/595293
// Author: sakis25
// http://www.turbosquid.com/Search/Artists/sakis25
{ modelClass : JSONModel, url : "../models/SunglassCar/base_pretextured.js", scale:.001, position:{x:0, y:0},
rotation:{ x: -Math.PI / 2, z: Math.PI }, model:null},
// Model from Turbosquid
// http://www.turbosquid.com/FullPreview/Index.cfm/ID/545178
// Author: Tox3d
// http://www.turbosquid.com/Search/Artists/Tox3d
{ modelClass : JSONModel, url : "../models/Route66obj/RT66sign.js", scale:.6, position:{x:0, y:0},
rotation:{ x: 0, z: 0 }, model:null},
] ;
function onModelLoaded(model, info)
{
var geometry = model.mesh.geometry;
// Display the bounding box, number of materials and number of faces
geometry.computeBoundingBox();
var bbox = geometry.boundingBox;
var width = bbox.x[1] - bbox.x[0];
var height = bbox.y[1] - bbox.y[0];
var depth = bbox.z[1] - bbox.z[0];
var nMaterials = geometry.materials.length;
var nFaces = geometry.faces.length;
var nPlaces = 3;
var statsHTML = "Model Info<br>Dimensions: " + width.toFixed(nPlaces) + " x " +
height.toFixed(nPlaces) + " x " + depth.toFixed(nPlaces) + "<br># Materials: " + nMaterials +
"<br># Faces: " + nFaces;
info.model = model;
info.stats = statsHTML;
displayModelStats(statsHTML);
}
function displayModelStats(statsHTML)
{
var modelStats = document.getElementById("modelStats");
modelStats.innerHTML = statsHTML;
modelStats.style.display = "block";
}
function selectModel()
{
var select = document.getElementById("select");
var index = select.selectedIndex - 1;
if (index >= 0)
{
if (currentModel)
{
app.removeModel(currentModel);
}
var model;
var info = modelInfo[index];
if (info.model)
{
model = info.model;
displayModelStats(info.stats);
}
else
{
model = new info.modelClass;
model.init(
{
url : info.url, scale:info.scale,
callback: function(model) {
onModelLoaded(model, info);
}
});
}
if (info.position)
{
model.object3D.position.set(info.position.x ? info.position.x : 0,
info.position.y ? info.position.y : 0,
info.position.z ? info.position.z : 0);
}
if (info.rotation)
{
model.object3D.rotation.set(info.rotation.x ? info.rotation.x : 0,
info.rotation.y ? info.rotation.y : 0,
info.rotation.z ? info.rotation.z : 0);
}
app.addModel(model);
currentModel = model;
}
}
$(document).ready(
function() {
var select = document.getElementById("select");
var options = [];
options[0]=document.createElement("option");
options[0].text="Select a model/format";
options[1]=document.createElement("option");
options[1].text="Nissan GTR/Three.js JSON (.js)";
options[2]=document.createElement("option");
options[2].text="Nova Car/Three.js JSON (.js)";
options[3]=document.createElement("option");
options[3].text="Hatchback Body/Three.js JSON (.js)";
options[4]=document.createElement("option");
options[4].text="Hatchback Wheel/Three.js JSON (.js)";
options[5]=document.createElement("option");
options[5].text="Camaro/Three.js JSON (.js)";
options[6]=document.createElement("option");
options[6].text="Sunglass.io Car/Three.js JSON (.js)";
options[7]=document.createElement("option");
options[7].text="Route 66 Sign/Three.js JSON (.js)";
select.add(options[0]);
select.add(options[1]);
select.add(options[2]);
select.add(options[3]);
select.add(options[4]);
select.add(options[5]);
select.add(options[6]);
select.add(options[7]);
container = document.getElementById("container");
app = new ModelViewer();
app.init({ container: container });
app.run();
}
);
</script>
</head>
<body>
<center><h1>Game - Model Previewer</h1></center>
<div id="models" style="text-align:center;" >
<select id="select" onchange="selectModel();"></select>
</div>
<div id="container"></div>
<div id="prompt">
Click the mouse to manipulate the model: Left = rotate, Right = Pan<br></br>
Credits:
Nissan GTR by <a href='http://www.turbosquid.com/Search/Artists/deluxe3D'>deluxe3D</a> at <a href='http://www.turbosquid.com/FullPreview/Index.cfm/ID/577061'>Turbosquid</a>
Nova Car by <a href='http://www.turbosquid.com/Search/Artists/Phosphoer'>Phosphoer</a> at <a href='http://www.turbosquid.com/FullPreview/Index.cfm/ID/302272'>Turbosquid</a>
Hatchback by <a href='http://www.turbosquid.com/Search/Artists/OpticalDreamSoft'>OpticalDreamSoft</a> at <a href='http://www.turbosquid.com/FullPreview/Index.cfm/ID/595293'>Turbosquid</a>
Camaro by <a href='http://www.turbosquid.com/Search/Artists/sakis25'>sakis25</a> at <a href='// http://www.turbosquid.com/FullPreview/Index.cfm/ID/595293'>Turbosquid</a>
</div>
<div id="modelStats">
Info here:<br></br>
Dimensions w x h x d<br></br>
Poly count xxxxx
</div>
</body>
</html>
|
juhnowski/interactivefishing
|
httpdocs/ch8/game-model-viewer.html
|
HTML
|
mit
| 7,238
|
(function() {
packages = {
// Lazily construct the package hierarchy from class names.
root: function(classes) {
var map = {};
function find(name, data) {
var node = map[name], i;
if (!node) {
node = map[name] = data || {name: name, children: []};
if (name.length) {
node.parent = find(name.substring(0, i = name.lastIndexOf(".")));
node.parent.children.push(node);
//node.key = name.substring(i + 1);
node.key = data.rpiId;
}
}
return node;
}
classes.forEach(function(d) {
find(d.name, d);
});
return map[""];
},
// Return a list of imports for the given array of nodes.
imports: function(nodes) {
var map = {},
imports = [];
// Compute a map from name to node.
nodes.forEach(function(d) {
map[d.name] = d;
});
// For each import, construct a link from the source to target node.
nodes.forEach(function(d) {
if (d.imports) d.imports.forEach(function(i) {
imports.push({source: map[d.name], target: map[i.name], goals: i.goals});
});
});
return imports;
}
};
})();
|
gxm/soccer-visuals
|
web/js-lib/packages.js
|
JavaScript
|
mit
| 1,109
|
require 'spec_helper'
describe Neoid::Relationship do
let(:user) { User.create!(name: "Elad Ossadon", slug: "elado") }
let(:movie) { Movie.create!(name: "Memento", slug: "memento-1999", year: 1999) }
it "should call neo_save after relationship model creation" do
Like.any_instance.should_receive(:neo_save)
user.like! movie
end
it "should create a neo_relationship for like" do
like = user.like! movie
like = user.likes.last
like.neo_find_by_id.should_not be_nil
like.neo_relationship.should_not be_nil
like.neo_relationship.start_node.should == user.neo_node
like.neo_relationship.end_node.should == movie.neo_node
like.neo_relationship.rel_type.should == 'likes'
end
it "should delete a relationship on deleting a record" do
user.like! movie
like = user.likes.last
relationship_neo_id = like.neo_relationship.neo_id
Neography::Relationship.load(relationship_neo_id).should_not be_nil
user.unlike! movie
expect { Neography::Relationship.load(relationship_neo_id) }.to raise_error(Neography::RelationshipNotFoundException)
end
it "should update neo4j on manual set of a collection" do
movies = [
Movie.create(name: "Memento"),
Movie.create(name: "The Prestige"),
Movie.create(name: "The Dark Knight"),
Movie.create(name: "Spiderman")
]
user.neo_node.outgoing(:likes).length.should == 0
expect {
user.movies = movies
}.to change{ user.neo_node.outgoing(:likes).length }.to(movies.length)
expect { expect {
user.movies -= movies[0..1]
}.to change{ user.movies.count }.by(-2)
}.to change{ user.neo_node.outgoing(:likes).length }.by(-2)
expect {
user.movies = []
}.to change{ user.neo_node.outgoing(:likes).length }.to(0)
expect {
user.movie_ids = movies[0...2].collect(&:id)
}.to change{ user.neo_node.outgoing(:likes).length }.to(2)
end
it "should update a relationship after relationship model update" do
like = user.like! movie
like.neo_relationship.rate.should be_nil
like.rate = 10
like.save!
like.neo_relationship.rate.should == 10
end
context "polymorphic relationship" do
let(:user) { User.create(name: "Elad Ossadon", slug: "elado") }
it "should create relationships with polymorphic items" do
followed = [
User.create(name: "Some One", slug: "someone"),
Movie.create(name: "The Prestige"),
Movie.create(name: "The Dark Knight")
]
expect {
followed.each do |item|
user.user_follows.create!(item: item)
end
}.to change{ user.neo_node.outgoing(:follows).length }.to(followed.length)
expect {
user.user_follows = user.user_follows[0...1]
}.to change{ user.neo_node.outgoing(:follows).length }.to(1)
expect {
user.user_follows = []
}.to change{ user.neo_node.outgoing(:follows).length }.to(0)
end
end
end
|
glsignal/neoid
|
spec/neoid/relationship_spec.rb
|
Ruby
|
mit
| 2,983
|
#import <Cocoa/Cocoa.h>
#import "Signal.h"
@interface FrontWindowSignal : Signal {
NSString *lastJson;
}
+ (NSString*)findDocUrl:(AXUIElementRef)window;
+ (NSString*)findWebUrl:(AXUIElementRef)window;
+ (AXUIElementRef)findMainWindowOfApp:(AXUIElementRef)appElem;
+ (NSArray*)findDescentantsOf:(AXUIElementRef)elem matchingRolePath:(NSArray*)rolePath;
@end
|
andrewschaaf/MacLogger
|
MacLogger/FrontWindowSignal.h
|
C
|
mit
| 365
|
'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _EventRowMixin = require('./EventRowMixin');
var _EventRowMixin2 = _interopRequireDefault(_EventRowMixin);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var EventRow = function (_React$Component) {
_inherits(EventRow, _React$Component);
function EventRow() {
_classCallCheck(this, EventRow);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
EventRow.prototype.render = function render() {
var _this2 = this;
var segments = this.props.segments;
var lastEnd = 1;
return _react2.default.createElement(
'div',
{ className: 'rbc-row' },
segments.reduce(function (row, _ref, li) {
var event = _ref.event,
left = _ref.left,
right = _ref.right,
span = _ref.span;
var key = '_lvl_' + li;
var gap = left - lastEnd;
var content = _EventRowMixin2.default.renderEvent(_this2.props, event);
if (gap) row.push(_EventRowMixin2.default.renderSpan(_this2.props, gap, key + '_gap'));
row.push(_EventRowMixin2.default.renderSpan(_this2.props, span, key, content));
lastEnd = right + 1;
return row;
}, [])
);
};
return EventRow;
}(_react2.default.Component);
EventRow.propTypes = _extends({
segments: _propTypes2.default.array
}, _EventRowMixin2.default.propTypes);
EventRow.defaultProps = _extends({}, _EventRowMixin2.default.defaultProps);
exports.default = EventRow;
|
aggiedefenders/aggiedefenders.github.io
|
node_modules/react-big-calendar/lib/EventRow.js
|
JavaScript
|
mit
| 2,891
|
module.exports = function brify (text) {
return text.replace(/\n/g, '<br/>');
};
|
intesso/brify
|
index.js
|
JavaScript
|
mit
| 82
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Documentation</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="../">
<link rel="icon" href="images/favicon.ico"/>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/base.css">
<link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/template.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
<script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
<script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/js/all.min.js" integrity="sha256-0vuk8LXoyrmCjp1f0O300qo1M75ZQyhH9X3J6d+scmk=" crossorigin="anonymous"></script>
<script src="js/search.js"></script>
<script defer src="js/searchIndex.js"></script>
</head>
<body id="top">
<header class="phpdocumentor-header phpdocumentor-section">
<h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">Documentation</a></h1>
<input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
<label class="phpdocumentor-header__menu-icon" for="menu-button">
<i class="fas fa-bars"></i>
</label>
<section data-search-form class="phpdocumentor-search">
<label>
<span class="visually-hidden">Search for</span>
<svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
<line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
</svg>
<input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
</label>
</section>
<nav class="phpdocumentor-topnav">
<ul class="phpdocumentor-topnav__menu">
</ul>
</nav>
</header>
<main class="phpdocumentor">
<div class="phpdocumentor-section">
<input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
<label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
Menu
</label>
<aside class="phpdocumentor-column -four phpdocumentor-sidebar">
<section class="phpdocumentor-sidebar__category">
<h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
<h4 class="phpdocumentor-sidebar__root-namespace"><a href="namespaces/unitconverter.html"><abbr title="\UnitConverter">UnitConverter</abbr></a></h4>
<ul class="phpdocumentor-list">
<li><a href="namespaces/unitconverter-calculator.html"><abbr title="\UnitConverter\Calculator">Calculator</abbr></a></li>
<li><a href="namespaces/unitconverter-exception.html"><abbr title="\UnitConverter\Exception">Exception</abbr></a></li>
<li><a href="namespaces/unitconverter-registry.html"><abbr title="\UnitConverter\Registry">Registry</abbr></a></li>
<li><a href="namespaces/unitconverter-support.html"><abbr title="\UnitConverter\Support">Support</abbr></a></li>
<li><a href="namespaces/unitconverter-unit.html"><abbr title="\UnitConverter\Unit">Unit</abbr></a></li>
</ul>
</section>
<section class="phpdocumentor-sidebar__category">
<h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
</section>
<section class="phpdocumentor-sidebar__category">
<h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
</section>
</aside>
<div class="phpdocumentor-column -eight phpdocumentor-content">
<ul class="phpdocumentor-breadcrumbs">
<li class="phpdocumentor-breadcrumb"><a href="namespaces/unitconverter.html">UnitConverter</a></li>
<li class="phpdocumentor-breadcrumb"><a href="namespaces/unitconverter-unit.html">Unit</a></li>
<li class="phpdocumentor-breadcrumb"><a href="namespaces/unitconverter-unit-family.html">Family</a></li>
</ul>
<article class="phpdocumentor-element -interface">
<h2 class="phpdocumentor-content__title">
SiSubmultipleUnit
<span class="phpdocumentor-interface__extends">
extends
<a href="classes/UnitConverter-Unit-Family-SiUnit.html"><abbr title="\UnitConverter\Unit\Family\SiUnit">SiUnit</abbr></a> </span>
</h2>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/Unit/Family/SiSubmultipleUnit.php"><a href="files/src-unit-family-sisubmultipleunit.html"><abbr title="src/Unit/Family/SiSubmultipleUnit.php">SiSubmultipleUnit.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">25</span>
</aside>
<p class="phpdocumentor-summary">Interface for any SI submultiple units to implement.</p>
<section class="phpdocumentor-description"></section>
<h5 class="phpdocumentor-tag-list__heading" id="tags">
Tags
<a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
</h5>
<dl class="phpdocumentor-tag-list">
<dt class="phpdocumentor-tag-list__entry">
<span class="phpdocumentor-tag__name">version</span>
</dt>
<dd class="phpdocumentor-tag-list__definition">
<span class="phpdocumentor-tag-link">1.0.0</span>
<section class="phpdocumentor-description"></section>
</dd>
<dt class="phpdocumentor-tag-list__entry">
<span class="phpdocumentor-tag__name">since</span>
</dt>
<dd class="phpdocumentor-tag-list__definition">
<span class="phpdocumentor-tag-link">0.6.7</span>
<section class="phpdocumentor-description"></section>
</dd>
<dt class="phpdocumentor-tag-list__entry">
<span class="phpdocumentor-tag__name">author</span>
</dt>
<dd class="phpdocumentor-tag-list__definition">
<section class="phpdocumentor-description"><p>Jordan Brauer <a href="mailto:18744334+jordanbrauer@users.noreply.github.com">18744334+jordanbrauer@users.noreply.github.com</a></p>
</section>
</dd>
<dt class="phpdocumentor-tag-list__entry">
<span class="phpdocumentor-tag__name">codeCoverageIgnore</span>
</dt>
<dd class="phpdocumentor-tag-list__definition">
<section class="phpdocumentor-description"></section>
</dd>
</dl>
</article>
<section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
<section class="phpdocumentor-search-results__dialog">
<header class="phpdocumentor-search-results__header">
<h2 class="phpdocumentor-search-results__title">Search results</h2>
<button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
</header>
<section class="phpdocumentor-search-results__body">
<ul class="phpdocumentor-search-results__entries"></ul>
</section>
</section>
</section>
</div>
</div>
<a href="classes/UnitConverter-Unit-Family-SiSubmultipleUnit.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
</main>
<script>
cssVars({});
</script>
</body>
</html>
|
jordanbrauer/unit-converter
|
docs/classes/UnitConverter-Unit-Family-SiSubmultipleUnit.html
|
HTML
|
mit
| 9,498
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Coq bench</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../../..">Unstable</a></li>
<li><a href=".">8.4.5 / contrib:railroad-crossing 8.4.dev</a></li>
<li class="active"><a href="">2014-11-19 16:22:58</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="../../../../../about.html">About</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href=".">« Up</a>
<h1>
contrib:railroad-crossing
<small>
8.4.dev
<span class="label label-success">5 s</span>
</small>
</h1>
<p><em><script>document.write(moment("2014-11-19 16:22:58 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2014-11-19 16:22:58 UTC)</em><p>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>ruby lint.rb unstable ../unstable/packages/coq:contrib:railroad-crossing/coq:contrib:railroad-crossing.8.4.dev</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
<dt>Output</dt>
<dd><pre>The package is valid.
</pre></dd>
</dl>
<h2>Dry install</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --dry-run coq:contrib:railroad-crossing.8.4.dev coq.8.4.5</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>1 s</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.4.5).
The following actions will be performed:
- install coq:contrib:railroad-crossing.8.4.dev
=== 1 to install ===
=-=- Synchronizing package archives -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=-=- Installing packages =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Building coq:contrib:railroad-crossing.8.4.dev:
coq_makefile -f Make -o Makefile
make -j4
make install
Installing coq:contrib:railroad-crossing.8.4.dev.
</pre></dd>
</dl>
<p>Dry install without Coq, to test if the problem was incompatibility with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --deps-only coq:contrib:railroad-crossing.8.4.dev</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>1 s</dd>
</dl>
<h2>Install</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --verbose coq:contrib:railroad-crossing.8.4.dev</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>5 s</dd>
<dt>Output</dt>
<dd><pre>The following actions will be performed:
- install coq:contrib:railroad-crossing.8.4.dev
=== 1 to install ===
=-=- Synchronizing package archives -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[coq:contrib:railroad-crossing] Fetching git://clarus.io/railroad-crossing#v8.4
Initialized empty Git repository in /home/bench/.opam/packages.dev/coq:contrib:railroad-crossing.8.4.dev/.git/
[master (root-commit) 62ee962] opam-git-init
warning: no common commits
From git://clarus.io/railroad-crossing
* [new branch] v8.4 -> opam-ref
* [new branch] v8.4 -> origin/v8.4
LICENSE
Make
Makefile
TemporalOperators.v
bench.log
description
railroad_crossing.v
time_clocks.v
HEAD is now at 201c2b0 Sauvegarde des bench.log
=-=- Installing packages =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Building coq:contrib:railroad-crossing.8.4.dev:
coq_makefile -f Make -o Makefile
make -j4
make install
"coqdep" -c -slash -R . RailroadCrossing "railroad_crossing.v" > "railroad_crossing.v.d" || ( RV=$?; rm -f "railroad_crossing.v.d"; exit ${RV} )
"coqdep" -c -slash -R . RailroadCrossing "time_clocks.v" > "time_clocks.v.d" || ( RV=$?; rm -f "time_clocks.v.d"; exit ${RV} )
"coqc" -q -R . RailroadCrossing time_clocks
"coqc" -q -R . RailroadCrossing railroad_crossing
for i in time_clocks.vo railroad_crossing.vo; do \
install -d `dirname "/home/bench/.opam/system/lib/coq/user-contrib"/RailroadCrossing/$i`; \
install -m 0644 $i "/home/bench/.opam/system/lib/coq/user-contrib"/RailroadCrossing/$i; \
done
Installing coq:contrib:railroad-crossing.8.4.dev.
</pre></dd>
</dl>
<h2>Installation size</h2>
<p>Data not available in this bench.</p>
<h2>Uninstall</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq:contrib:railroad-crossing.8.4.dev</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>1 s</dd>
<dt>Output</dt>
<dd><pre>The following actions will be performed:
- remove coq:contrib:railroad-crossing.8.4.dev
=== 1 to remove ===
=-=- Synchronizing package archives -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[coq:contrib:railroad-crossing] Fetching git://clarus.io/railroad-crossing#v8.4
=-=- Removing Packages =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Removing coq:contrib:railroad-crossing.8.4.dev.
rm -R /home/bench/.opam/system/lib/coq/user-contrib/RailroadCrossing
</pre></dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
<small>Sources are on <a href="https://github.com/coq-bench">GitHub</a>. © Guillaume Claret.</small>
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
|
coq-bench/coq-bench.github.io-old
|
clean/Linux-x86_64-4.02.1-1.2.0/unstable/8.4.5/contrib:railroad-crossing/8.4.dev/2014-11-19_16-22-58.html
|
HTML
|
mit
| 8,416
|
---
layout: post
title: 圣地巡礼:马修·斯卡德 的纽约
categories: [旅行随笔]
<!---->tags: [random thoughts]
comments: true
---
<br>
在世界的中心,我想起的却是一个酗酒无证的孤独私家侦探。
前段时间在纽约待了几天,本来也没什么计划,只是在曼哈顿街头游荡,看过了各种博物馆和演出,就不知道该做什么。然后就想到,去找一下 Matthew 生活的地方吧。
主要依据是 Lawrence Block 自己作的这个guide: http://www.mulhollandbooks.com/2011/05/13/searching-new-york-for-matthew-and-bernie/ . 因为是一时兴起,记忆模糊,也没带书,不能去找更多故事场景中的地方。最后只是去了西北旅馆以及 Parc Vendome, 晨星,火焰,圣保罗教堂和圣伯纳德教堂。
那天早上先是坐地铁到五十六街,地狱厨房的中心地带。曾是因治安恶劣而得名的社区,但在士绅化的趋势下,早已贴近中产阶级的生活方式。
沿第七大道走到五十七街,转弯走到第八与第九大道之间,便能看见 Parc Bendome,是一栋相当大型的公寓楼;对面则是马修住了许多年的西北旅馆的原址。在 Block 写作那篇指导时它已从一家廉价旅馆变成了高档酒店,而在我前去时则又成了一栋写字楼。
Parc Vendome 的外观。
曾经是西北旅馆的写字楼。
街道的全景。
沿五十七街走到与第九大道交汇处就是 “晨星”,Matthew 和 TJ 经常吃早餐的地方。餐馆里面并不大,在早上十点之后仍然拥挤;而菜单相当丰富。
街道对面的 The Morning Star。
法式吐司加培根。
“火焰” 则是再向北一个街区,五十八街与第九大道交汇处。
The Flame 的外观。
往北再走一点是圣保罗教堂,马修曾经每次捐出十分之一收入并且点蜡烛,后来则是参加戒酒集会的地方。
教堂的正面。
内部远景。
现实中点一支蜡烛需要三美元。
戒酒集会举行的地下室。
Matthew 和 Mick 参加屠夫弥撒的圣伯纳德教堂则是在布鲁克林区,从曼哈顿中城坐地铁过去需要三、四十分钟。当时是工作日的早晨,街区安静,高架铁路的影子切割了蓝天,周围看到的只是五金店、汽车维修站和街边停靠的货车,与曼哈顿的繁华截然不同。那片区域原本是爱尔兰裔社区,而现在已被西班牙裔取代,教堂的名字也变成了 Our Lady of Guadalupe.
教堂的外观
后院的人物雕像
布鲁克林的街道
铁轨和蓝天
遗憾的是 “巴黎绿” 和葛洛根酒吧并不存在;而更遗憾的是阿姆斯特朗酒吧曾是真实的,现在却已不在了。
其实马修给我的感觉就像某个在网上偶然发现的、不认识的博主。你把他的博客地址放进收藏夹,不会刻意去刷,但偶尔想起来就会看一看,阅读他关于自己生活、婚姻和工作的叙述,喝了多少杯波本,走了多少个街区,往教堂的募捐箱里放了多少钱。这使你得以了解他的情绪和想法,他人生的轨迹,尽管你们素昧平生。如果他消失了很久,你会有些疑虑,虽然不至于真的影响情绪;而当他回来,重新以漫不经心的口吻继续他的叙述,你会觉得莫名地安心。
而机缘巧合的时候,我去了他的城市,走过了他曾走过的那些街道,去了他去过的教堂。没有刻意寻找,但我知道他在那儿,只是我没有遇见他。
|
blackbird07/blackbird07.github.io
|
_drafts/圣地巡礼:马修·斯卡德的纽约.md
|
Markdown
|
mit
| 3,592
|
import React from 'react';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(
<g><path d="M20 5H4c-1.1 0-1.99.9-1.99 2L2 17c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm-9 3h2v2h-2V8zm0 3h2v2h-2v-2zM8 8h2v2H8V8zm0 3h2v2H8v-2zm-1 2H5v-2h2v2zm0-3H5V8h2v2zm9 7H8v-2h8v2zm0-4h-2v-2h2v2zm0-3h-2V8h2v2zm3 3h-2v-2h2v2zm0-3h-2V8h2v2z" /></g>
, 'Keyboard');
|
cherniavskii/material-ui
|
packages/material-ui-icons/src/Keyboard.js
|
JavaScript
|
mit
| 387
|
/*-- Básico ----------------------------------------------------------*/
ul, ul li { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p, form { margin: 0; padding: 0; }
.clear { clear: both; }
img { border: none; }
/*--clear de floats*/
.clearfix:before, .clearfix:after{
content:"";
display: table;
}
.clearfix:after{
clear:both;
}
.clearfix {
zoom: 1;
}
/*añadido para poder navegar por los ejercicios*/
.volver{
position: fixed;
bottom:0;
}
|
Janenerim/dam-2015
|
XHTML/EJ07/css/main.css
|
CSS
|
mit
| 479
|
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>Space Joust Docs</title>
<script src='../javascript/application.js'></script>
<script src='../javascript/search.js'></script>
<link rel='stylesheet' href='../stylesheets/application.css' type='text/css'>
</head>
<body>
<div id='base' data-path='../'></div>
<div id='header'>
<div id='menu'>
<a href='../extra/README.md.html' title='Space Joust'>
Space Joust
</a>
»
<a href='../alphabetical_index.html' title='Index'>
Index
</a>
»
<span class='title'>TestExportClass</span>
</div>
</div>
<div id='content'>
<h1>
Class:
TestExportClass
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>node_modules/codo/spec/_templates/classes/export_class.coffee</td>
</tr>
</table>
<h2>Overview</h2>
<div class='docstring'>
<p>Yep, this should be assigned to the class</p>
</div>
<div class='tags'>
</div>
</div>
<div id='footer'>
April 25, 15 12:39:13 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>
2.0.11
✲
Press H to see the keyboard shortcuts
✲
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
✲
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
Control the navigation frame:
</p>
<ul>
<li>
<span>L</span>
Toggle list view
</li>
<li>
<span>C</span>
Show class list
</li>
<li>
<span>I</span>
Show mixin list
</li>
<li>
<span>F</span>
Show file list
</li>
<li>
<span>M</span>
Show method list
</li>
<li>
<span>E</span>
Show extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
</div>
</body>
</html>
|
wjagodfrey/spaceJoust
|
doc/class/TestExportClass.html
|
HTML
|
mit
| 2,393
|
import sys
import os
import os.path
from jinja2 import Template
from configparser import ConfigParser
import io
if __name__ == "__main__":
if len(sys.argv) != 3:
print("Usage: <program> <deploy_cfg_template_file> <file_with_properties>")
print("Properties from <file_with_properties> will be applied to <deploy_cfg_template_file>")
print("template which will be overwritten with .orig copy saved in the same folder first.")
sys.exit(1)
file = open(sys.argv[1], 'r')
text = file.read()
t = Template(text)
config = ConfigParser()
if os.path.isfile(sys.argv[2]):
config.read(sys.argv[2])
elif "KBASE_ENDPOINT" in os.environ:
kbase_endpoint = os.environ.get("KBASE_ENDPOINT")
props = "[global]\n" + \
"kbase_endpoint = " + kbase_endpoint + "\n" + \
"job_service_url = " + kbase_endpoint + "/userandjobstate\n" + \
"workspace_url = " + kbase_endpoint + "/ws\n" + \
"shock_url = " + kbase_endpoint + "/shock-api\n" + \
"handle_url = " + kbase_endpoint + "/handle_service\n" + \
"srv_wiz_url = " + kbase_endpoint + "/service_wizard\n" + \
"njsw_url = " + kbase_endpoint + "/njs_wrapper\n"
if "AUTH_SERVICE_URL" in os.environ:
props += "auth_service_url = " + os.environ.get("AUTH_SERVICE_URL") + "\n"
elif "auth2services" in kbase_endpoint:
props += "auth_service_url = " + kbase_endpoint + "/auth/api/legacy/KBase/Sessions/Login\n"
props += "auth_service_url_allow_insecure = " + \
os.environ.get("AUTH_SERVICE_URL_ALLOW_INSECURE", "false") + "\n"
config.readfp(io.StringIO(props))
else:
raise ValueError('Neither ' + sys.argv[2] + ' file nor KBASE_ENDPOINT env-variable found')
props = dict(config.items("global"))
output = t.render(props)
with open(sys.argv[1] + ".orig", 'w') as f:
f.write(text)
with open(sys.argv[1], 'w') as f:
f.write(output)
|
briehl/narrative-test
|
scripts/prepare_deploy_cfg.py
|
Python
|
mit
| 2,057
|
package com.github.bespalovdn.asteriskscala.agi
import java.net.InetSocketAddress
import akka.actor.Actor
import com.github.bespalovdn.asteriskscala.agi.execution.AsyncAction
import com.github.bespalovdn.asteriskscala.agi.handler.AgiRequestHandlerFactory
import com.github.bespalovdn.scalalog.StaticLogger
import scala.concurrent.Future
import scala.concurrent.duration._
class AgiServerActor (bindAddr: InetSocketAddress,
handlerFactory: AgiRequestHandlerFactory,
recoveryInterval: FiniteDuration = 30 seconds)
extends Actor
with StaticLogger
with AsyncAction
{
var lifetime: AgiServer#LifeCycle = null
var stopped = false
override def preStart(): Unit = {
super.preStart()
startServer()
}
override def postStop(): Unit = {
stopServer()
super.postStop()
}
override def receive: Receive = {
case InternalMsg.Restart => startServer()
case InternalMsg.Stopped =>
if(!stopped){
logger.warn("AGI server unexpectedly stopped. Will try to recovery in %s..." format recoveryInterval)
scheduleRestart()
}
}
def startServer(): Unit ={
try {
lifetime = new AgiServer(bindAddr, handlerFactory).run()
lifetime.stopped >> (self ! InternalMsg.Stopped).point[Future]
stopped = false
}catch{
case e: Throwable =>
val msg = "Unable to start AGI server. Reason: %s. Will try to recovery in %s... ".format(
e.getMessage, recoveryInterval)
logger.warn(msg, e)
scheduleRestart()
}
}
def stopServer(): Unit ={
stopped = true
lifetime.stop()
}
def scheduleRestart(): Unit ={
import context.dispatcher
context.system.scheduler.scheduleOnce(recoveryInterval, self, InternalMsg.Restart)
}
private object InternalMsg
{
case object Restart
case object Stopped
}
}
|
bespalovdn/asterisk-scala
|
agi/src/main/scala/com/github/bespalovdn/asteriskscala/agi/AgiServerActor.scala
|
Scala
|
mit
| 2,063
|
#include "variant/pwm_platform.hpp"
#include "hal.h"
static const PWMConfig MOTOR_PWM_CONFIG {
500000, // 500 kHz PWM clock frequency.
1000, // PWM period 2.0 ms.
NULL, // No callback.
{
{PWM_OUTPUT_ACTIVE_HIGH, NULL},
{PWM_OUTPUT_ACTIVE_HIGH, NULL},
{PWM_OUTPUT_ACTIVE_HIGH, NULL},
{PWM_OUTPUT_ACTIVE_HIGH, NULL}
}, // Channel configurations
0,0 // HW dependent
};
PWMPlatform::PWMPlatform() {
pwmStart(&PWMD1, &MOTOR_PWM_CONFIG);
palSetPadMode(GPIOC, 6, PAL_MODE_ALTERNATE(4));
palSetPadMode(GPIOC, 7, PAL_MODE_ALTERNATE(4));
palSetPadMode(GPIOC, 8, PAL_MODE_ALTERNATE(4));
palSetPadMode(GPIOC, 9, PAL_MODE_ALTERNATE(4));
}
void PWMPlatform::set(std::uint8_t ch, float dc) {
pwmcnt_t width = PWM_PERCENTAGE_TO_WIDTH(&PWMD1, dc * 10000.0f);
pwmEnableChannel(&PWMD1, ch, width);
}
|
OSURoboticsClub/aerial_control
|
variants/platforms/stm32f4discovery/pwm_platform.cpp
|
C++
|
mit
| 844
|
require 'yaml'
$messages = YAML.load_file(File.dirname(__FILE__) + '/messages.yml')
$language = 'en'
public
##
# Translate the given key with the default language
# @param [Symbol|String] key the key
# @return the translated text
def translate(key)
$messages[$language][key.to_s]
end
##
# Set the language to be used
# @param [String] language the language
def set_language(language)
$language = language
end
|
thomsmits/markdown-tools
|
mdc/lib/messages.rb
|
Ruby
|
mit
| 417
|
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170318145737 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE page ADD title_en VARCHAR(255) NOT NULL, ADD content_en LONGTEXT NOT NULL, ADD raw TINYINT(1) NOT NULL');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE page DROP title_en, DROP content_en, DROP raw');
}
}
|
spopovic14/cedeum_final
|
app/DoctrineMigrations/Version20170318145737.php
|
PHP
|
mit
| 1,122
|
var MongoClient = require('mongodb').MongoClient;
/**
* Count the number of talks in the database
*
* @param {string} dburl Database url string.
* @param {function} callback Callback function to execute with results.
*/
function count(dburl, callback) {
'use strict';
MongoClient.connect(dburl, function(err, db) {
if (err) {
return callback(err, null);
}
return db.collection('talks').count();
});
}
/**
* Generic method for getting Talks.
*
* By default pageNumber is set to 1 if its not specified.
* Also returns 25 elements if quantity is not specified.
*
* @param {string} dburl Database url string.
* @param {object} conds Search and filter conditions.
* @param {object} sort Sorting conditions.
* @param {number} quantity Number of results to fetch.
* @param {number} pageNumber Page number to fetch.
* @param {function} callback Callback function to execute with results.
*/
function searchTalks(dburl, conds, sort, quantity, pageNumber, callback) {
'use strict';
pageNumber = pageNumber || 1;
quantity = quantity || 25;
MongoClient.connect(dburl, function(err, db) {
if (err) {
return callback(err, null);
}
var talks = db.collection('talks');
talks
.find(conds)
.sort(sort)
.skip(pageNumber > 0 ? ((pageNumber - 1) * quantity) : 0)
.limit(quantity)
.toArray(function(err, docs) {
if (err) {
return callback(err, null);
}
db.close();
return callback(null, docs);
});
});
}
/**
* Get a Random Talk.
*
* Get a random talk from the collection.
*
* @param {string} dburl Database url string.
* @param {function} callback Callback function to execute with the results.
*/
exports.getRandom = function(dburl, callback) {
'use strict';
MongoClient.connect(dburl, function(err, db) {
if (err) {
return callback(err, null);
}
var talks = db.collection('talks');
talks.count(function(err, count) {
var rand = Math.floor(Math.random() * count) + 1;
talks
.find()
.limit(-1)
.skip(rand)
.limit(1)
.toArray(function(err, docs) {
if (err) {
return callback(err, null);
}
db.close();
return callback(null, docs);
});
});
});
};
/**
* Search Talks.
*
* Performs a query search on talks full-text index on elastic-search.
*
* @param {string} index Elastic search connection string.
* @param {string} q Query string to search.
* @param {function} callback Callback function to execute with the results.
*/
exports.search = function(q, callback) {
'use strict';
MongoClient.connect(dburl, function(err, db) {
if (err) {
return callback(err, null);
}
var talks = db.collection('talks');
var results = {};
db.close();
return callback(null, results);
});
};
/**
* Get all the Talks from the database.
*
* @param {string} dburl Database url string.
* @param {function} callback Callback function to execute with results.
*/
exports.all = function(dburl, callback) {
'use strict';
MongoClient.connect(dburl, function(err, db) {
if (err) {
return callback(err, null);
}
var talks = db.collection('talks');
talks
.find({})
.toArray(function(err, docs) {
if (err) {
return callback(err, null);
}
db.close();
return callback(null, docs);
});
});
};
/**
* Get the latest Talks.
*
* Latest talks are sorted by its creation date in descendant order.
*
* @param {string} dburl Database url string.
* @param {number} quantity Number of results to get.
* @param {number} pageNumber Page number to get results.
* @param {function} callback Callback function to execute with results.
*/
exports.latest = function(dburl, quantity, pageNumber, callback) {
'use strict';
var conds = {};
var sort = {
created: -1
};
quantity = quantity || 25;
pageNumber = pageNumber || 1;
return searchTalks(dburl, conds, sort, quantity, pageNumber, callback);
};
/**
* Get the most popular Talks.
*
* Popular talks are sorted in descendant order first by its number of
* votes and then by its number of views.
*
* @param {string} dburl Database url string.
* @param {number} quantity Number of results to get.
* @param {number} pageNumber Page number to get results.
* @param {function} callback Callback function to execute with results.
*/
exports.popular = function(dburl, quantity, pageNumber, callback) {
'use strict';
var conds = {};
var sort = {
voteCount: -1,
viewCount: -1
};
quantity = quantity || 25;
pageNumber = pageNumber || 1;
return searchTalks(dburl, conds, sort, quantity, pageNumber, callback);
};
/**
* Create a new talk.
*
* Creates a new talk storing it into the database.
*
* @param {string} dburl Database url string.
* @param {number} obj Number of results to get.
* @param {function} callback Callback function to execute with results.
*/
exports.createTalk = function(dburl, obj, callback) {
'use strict';
MongoClient.connect(dburl, function(err, db) {
if (err) {
return callback(err, null);
}
var talks = db.collection('talks');
talks.insert(obj, function(err, docs) {
if (err) {
return callback(err, null);
}
db.close();
return callback(null, docs);
});
});
};
/**
* Delete a talk by its id.
*
* Remove a database from the database.
*
* @param {string} dburl Database url string.
* @param {number} id Talk unique id.
* @param {function} callback Callback function to execute with results.
*/
exports.deleteTalk = function(dburl, id, callback) {
'use strict';
MongoClient.connect(dburl, function(err, db) {
if (err) {
return callback(err, null);
}
var talks = db.collection('talks');
talks.remove({
id: id
}, function(err, docs) {
if (err) {
return callback(err, null);
}
db.close();
return callback(null, docs);
});
});
};
/**
* Get a talk by id.
*
* Get a Talk from the database by its unique id.
*
* @param {string} dburl Database url string.
* @param {number} id Talk unique id.
* @param {function} callback Callbacak function to execute with results.
*/
exports.get = function(dburl, id, callback) {
'use strict';
MongoClient.connect(dburl, function(err, db) {
if (err) {
return callback(err, null);
}
var talks = db.collection('talks');
talks.findOne({
id: id
}, function(err, doc) {
if (err) {
return callback(err, null);
}
db.close();
return callback(null, doc);
});
});
};
/**
* Upvote a Talk.
*
* Updates a talk increasing its vote count by 1.
* It checks if the user did not upvoted the talk already and also adds user
* id on a list of upvoters for this talk in case its not present.
*
* @param {string} dburl Database url string.
* @param {number} id Talk unique id.
* @param {number} userid User's unique id.
* @param {function} callback Callback function to execute with the results.
*/
exports.upvote = function(dburl, id, userid, callback) {
'use strict';
MongoClient.connect(dburl, function(err, db) {
if (err) {
return callback(err, null);
}
var talks = db.collection('talks');
talks.update({
'id': id,
'votes': {
'$ne': userid
}
}, {
'$inc': {
'voteCount': 1
},
'$push': {
'votes': userid
}
}, function(err, talk) {
if (err) {
return callback(err, null);
}
db.close();
return callback(null, talk);
});
});
};
/**
* Favorite a Talk.
*
* Updates a talk with increasing its favorites count by 1.
* It checks if the user did not favorited the talk already and also adds user
* id on a list of favoriters for this talk in case its not present.
*
* @param {string} dburl Database url string.
* @param {number} id Talk unique id.
* @param {number} userid User's unique id.
* @param {function} callback Callback function to execute with the results.
*/
exports.favorite = function(dburl, id, userid, callback) {
'use strict';
MongoClient.connect(dburl, function(err, db) {
if (err) {
return callback(err, null);
}
var talks = db.collection('talks');
talks.update({
'id': id,
'favorites': {
'$ne': userid
}
}, {
'$inc': {
'favoriteCount': 1
},
'$push': {
'favorites': userid
}
}, function(err, talk) {
if (err) {
return callback(err, null);
}
db.close();
return callback(null, talk);
});
});
};
/**
* Unfavorite a Talk.
*
* Updates a talk with decreasing its favorites count by 1.
* It checks if the user did favorited the talk already and also removes user
* id on a list of favoriters for this talk.
*
* @param {string} dburl Database url string.
* @param {number} id Talk unique id.
* @param {number} userid User's unique id.
* @param {function} callback Callback function to execute with the results.
*/
exports.unfavorite = function(dburl, id, userid, callback) {
'use strict';
MongoClient.connect(dburl, function(err, db) {
if (err) {
return callback(err, null);
}
var talks = db.collection('talks');
talks.update({
'id': id,
'favorites': {
'$in': [userid]
}
}, {
'$inc': {
'favoriteCount': -1
},
'$pull': {
'favorites': userid
}
}, function(err, talk) {
if (err) {
return callback(err, null);
}
db.close();
return callback(null, talk);
});
});
};
/**
* Rank a Talk.
*
* Updates a talk with its raking score field.
*
* @param {string} dburl Database url string.
* @param {number} id Talk unique id.
* @param {float} score Ranking score.
* @param {function} callback Callback function to execute with the results.
*/
exports.rank = function(dburl, id, score, callback) {
'use strict';
MongoClient.connect(dburl, function(err, db) {
if (err) {
return callback(err, null);
}
var talks = db.collection('talks');
talks.update({
'id': id
}, {
'$set': {
'ranking': score
}
}, function(err) {
if (err) {
return callback(err);
}
db.close();
return callback(null);
});
});
};
/**
* Play a Talk.
*
* Get a Talk by its slug name and updates views counter field by 1.
*
* @param {string} dburl Database url string
* @param {string} slug Talk slug field.
* @param {function} callback Callback function to execute with results.
*/
exports.play = function(dburl, slug, callback) {
'use strict';
MongoClient.connect(dburl, function(err, db) {
if (err) {
return callback(err, null);
}
var talks = db.collection('talks');
talks.findOne({
'slug': slug
}, function(err, talk) {
if (err) {
return callback(err, null);
}
talks.update({
'slug': slug
}, {
'$inc': {
'viewCount': 1
},
'$set': {
updated: Date.now()
}
}, function(err) {
if (err) {
return callback(err, null);
}
db.close();
return callback(null, talk);
});
});
});
};
/**
* Get a list of talks tagged as.
*
* Results are sorted by creation date in descending order.
* By default 25 results are returned.
*
* @param {string} dburl Database url string.
* @param {string} tag Tag string.
* @param {number} quantity Number of results to fetch.
* @param {number} pageNumber Number of the page to fetch.
* @param {function} callback Callback function to execute with results.
*/
exports.getByTag = function(dburl, tag, quantity, pageNumber, callback) {
'use strict';
var conds = {
tags: tag
};
var sort = {
created: -1
};
quantity = quantity || 25;
return searchTalks(dburl, conds, sort, quantity, pageNumber, callback);
};
/**
* Get a Talk by slug.
*
* Get a Talk by its generated slug field.
* http://en.wikipedia.org/wiki/Semantic_URL#Slug
*
* @param {string} dburl Database url string.
* @param {string} slug Slug string.
* @param {function} callback Callback function to execute with results.
*/
exports.getBySlug = function(dburl, slug, callback) {
'use strict';
MongoClient.connect(dburl, function(err, db) {
if (err) {
return callback(err, null);
}
var talks = db.collection('talks');
talks.find({
'slug': slug
}).toArray(function(err, docs) {
if (err) {
return callback(err, null);
}
db.close();
return callback(null, docs);
});
});
};
/**
* Get a Talk by code.
*
* Get a Talk by its field code .
*
* @param {string} dburl Database url string.
* @param {string} code Code string.
* @param {function} callback Callback function to execute with results.
*/
exports.getByCode = function(dburl, code, callback) {
'use strict';
MongoClient.connect(dburl, function(err, db) {
if (err) {
return callback(err, null);
}
var talks = db.collection('talks');
talks.find({
'code': code
}).toArray(function(err, docs) {
if (err) {
return callback(err, null);
}
db.close();
return callback(null, docs);
});
});
};
/**
* Get related Talks to another Talk.
*
* Related Talks are tagged with at least one of the tags of the
* original one.
* Results are sorted by creation date in descendant order.
* Also the original Talk is descarted so a Talk can't be related to
* itself.
*
* @param {string} dburl Database url string.
* @param {number} id Original Talk id.
* @param {Array} tags List of tag strings.
* @param {number} quantity Number of results to fetch.
* @param {function} callback Callback function to execute with results.
*/
exports.related = function(dburl, id, tags, quantity, callback) {
'use strict';
MongoClient.connect(dburl, function(err, db) {
if (err) {
return callback(err, null);
}
var talks = db.collection('talks');
talks
.find({
'tags': {
'$in': tags
},
'id': {
'$ne': id
}
})
.sort({
'created': -1
})
.limit(quantity)
.toArray(function(err, docs) {
if (err) {
return callback(err, null);
}
db.close();
return callback(null, docs);
});
});
};
/**
* Get a list of Talks published by an User.
*
* Given an userid, get a list of talks published by him.
* Returns the list sorted by creation date, being first element the
* most recent one.
*
* @param {string} dburl Database url string.
* @param {number} userid User unique id.
* @param {number} quantity Number of results to fetch.
* @param {number} pageNumber Number of the page to fetch.
* @param {function} callback Callback function to execute with results.
*/
exports.getByAuthorId = function(dburl, id, quantity, pageNumber, callback) {
'use strict';
var conds = {
'author.id': id
};
var sort = {
created: -1
};
quantity = quantity || 25;
pageNumber = pageNumber || 1;
return searchTalks(dburl, conds, sort, quantity, pageNumber, callback);
};
/**
* Get a list of Talks upvoted by an User.
*
* Given an userid, get a list fo the Tlks that the User has upvoted.
* Returns the list sorted by creation date, being first element the
* most recent one.
*
* @param {string} dburl Database url string.
* @param {number} userid User unique id.
* @param {function} callback Callback function to execute with results.
*/
exports.getUpvotedByAuthorId = function(
dburl,
userid,
quantity,
pageNumber,
callback) {
'use strict';
var conds = {
'votes': {
'$in': [userid]
}
};
var sort = {
created: -1
};
quantity = quantity || 25;
pageNumber = pageNumber || 1;
return searchTalks(dburl, conds, sort, quantity, pageNumber, callback);
};
/**
* Get a list of Talks favorited by an User.
*
* Given an userid, get a list of the Talks that the User has favorited.
* Returns the list sorted by creation date, being first element the
* most recent one.
*
* @param {string} dburl Database url connection string.
* @param {number} userid User unique id.
* @param {function} callback Callback function to execute with results.
*/
exports.getFavoritedByAuthorId = function(
dburl,
userid,
quantity,
pageNumber,
callback) {
'use strict';
var conds = {
'favorites': {
'$in': [userid]
}
};
var sort = {
created: -1
};
quantity = quantity || 25;
pageNumber = pageNumber || 1;
return searchTalks(dburl, conds, sort, quantity, pageNumber, callback);
};
|
tlksio/libtlks
|
lib/talk.js
|
JavaScript
|
mit
| 19,184
|
# frozen_string_literal: true
class ConvertExternalServiceReceiverData < ActiveRecord::Migration[4.2]
def up
ExternalServiceReceiver.find_each do |receiver|
show_url = receiver.response_data
new_data = { show_url: show_url, edit_url: "#{show_url}/take" }
receiver.update_attribute :response_data, new_data.to_json
end
end
def down
ExternalServiceReceiver.find_each do |receiver|
json = receiver.response_data
parsed = JSON.parse json
receiver.update_attribute :response_data, parsed[:show_url]
end
end
end
|
tablexi/nucore-open
|
db/migrate/20140320184445_convert_external_service_receiver_data.rb
|
Ruby
|
mit
| 570
|
#include "unitinventoryhandler.h"
/*!
* @author kovlev
*/
bool UnitInventoryHandler::matches(UnitType unitType, ItemType itemType) {
switch (unitType) {
case UnitType::FIGHTER:
return (itemType == ItemType::MELEE ||
itemType == ItemType::SHIELD ||
itemType == ItemType::ARMOR ||
itemType == ItemType::JEWELLERY);
break;
case UnitType::ARCHER:
return (itemType == ItemType::BOW ||
itemType == ItemType::ARROW ||
itemType == ItemType::ARMOR ||
itemType == ItemType::JEWELLERY);
break;
case UnitType::MAGE:
return (itemType == ItemType::STAFF ||
itemType == ItemType::MAGICSHIELD ||
itemType == ItemType::CLOAK ||
itemType == ItemType::JEWELLERY);
break;
case UnitType::OTHER:
return false;
break;
}
return false;
}
bool UnitInventoryHandler::hasType(Unit* unit, ItemType itemType) {
for (int i = 0; i < unit->getUnitInventorySize(); i++) {
if (unit->getItem(i) != NULL) {
if (unit->getItem(i)->getItemType() == itemType) {
return true;
}
}
}
return false;
}
|
kovleventer/FoD
|
src/player/unitinventoryhandler.cpp
|
C++
|
mit
| 1,049
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using System.Linq;
using osu.Framework.Caching;
using osu.Framework.Configuration;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Objects.Drawables;
using OpenTK;
using osu.Game.Rulesets.Objects.Types;
namespace osu.Game.Rulesets.Timing
{
/// <summary>
/// A container that scrolls relative to the current time. Will autosize to the total duration of all contained hit objects along the scrolling axes.
/// </summary>
public abstract class ScrollingContainer : Container<DrawableHitObject>
{
/// <summary>
/// Gets or sets the range of time that is visible by the length of the scrolling axes.
/// </summary>
public readonly BindableDouble VisibleTimeRange = new BindableDouble { Default = 1000 };
/// <summary>
/// The axes through which this <see cref="ScrollingContainer"/> scrolls. This is set by the <see cref="SpeedAdjustmentContainer"/>.
/// </summary>
internal Axes ScrollingAxes;
public override bool RemoveWhenNotAlive => false;
/// <summary>
/// The control point that defines the speed adjustments for this container. This is set by the <see cref="SpeedAdjustmentContainer"/>.
/// </summary>
internal MultiplierControlPoint ControlPoint;
private Cached<double> durationBacking;
/// <summary>
/// Creates a new <see cref="ScrollingContainer"/>.
/// </summary>
protected ScrollingContainer()
{
RelativeSizeAxes = Axes.Both;
RelativePositionAxes = Axes.Both;
}
protected override int Compare(Drawable x, Drawable y)
{
var hX = (DrawableHitObject)x;
var hY = (DrawableHitObject)y;
int result = hY.HitObject.StartTime.CompareTo(hX.HitObject.StartTime);
if (result != 0)
return result;
return base.Compare(y, x);
}
public override void Add(DrawableHitObject drawable)
{
durationBacking.Invalidate();
base.Add(drawable);
}
public override bool Remove(DrawableHitObject drawable)
{
durationBacking.Invalidate();
return base.Remove(drawable);
}
// Todo: This may underestimate the size of the hit object in some cases, but won't be too much of a problem for now
private double computeDuration() => Math.Max(0, Children.Select(c => (c.HitObject as IHasEndTime)?.EndTime ?? c.HitObject.StartTime).DefaultIfEmpty().Max() - ControlPoint.StartTime) + 1000;
/// <summary>
/// An approximate total duration of this scrolling container.
/// </summary>
public double Duration => durationBacking.IsValid ? durationBacking : (durationBacking.Value = computeDuration());
protected override void Update()
{
base.Update();
RelativeChildOffset = new Vector2((ScrollingAxes & Axes.X) > 0 ? (float)ControlPoint.StartTime : 0, (ScrollingAxes & Axes.Y) > 0 ? (float)ControlPoint.StartTime : 0);
// We want our size and position-space along the scrolling axes to span our duration to completely enclose all the hit objects
Size = new Vector2((ScrollingAxes & Axes.X) > 0 ? (float)Duration : Size.X, (ScrollingAxes & Axes.Y) > 0 ? (float)Duration : Size.Y);
// And we need to make sure the hit object's position-space doesn't change due to our resizing
RelativeChildSize = Size;
}
}
}
|
Damnae/osu
|
osu.Game/Rulesets/Timing/ScrollingContainer.cs
|
C#
|
mit
| 3,838
|
# frozen_string_literal: true
module RuboCop
module Cop
module Layout
# Here we check if the elements of a multi-line array literal are
# aligned.
class AlignArray < Cop
include AutocorrectAlignment
MSG = 'Align the elements of an array literal if they span more ' \
'than one line.'.freeze
def on_array(node)
check_alignment(node.children)
end
end
end
end
end
|
mclark/rubocop
|
lib/rubocop/cop/layout/align_array.rb
|
Ruby
|
mit
| 456
|
<html>
<head>
<script type="text/javascript" src="../src/sunlight.js"></script>
<script type="text/javascript" src="../src/lang/sunlight.sln.js"></script>
<link rel="stylesheet" type="text/css" href="../src/themes/sunlight.default.css" />
</head>
<body>
<pre id="code" class="sunlight-highlight-sln">Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Project1", "Project1.vbproj", "{8CDD8387-B905-44A8-B5D5-07BB50E05BEA}"
EndProject
Global
GlobalSection(SolutionNotes) = postSolution
Name1 = Note2
Issue1 = N
Text1 = This is a shared note.
Name2 = Note3
Issue2 = N
Text2 = This is also a shared note. The second of two shared notes.
NumNotes = 2
EndGlobalSection
GlobalSection(SolutionConfiguration) = preSolution
ConfigName.0 = Debug
ConfigName.1 = Release
EndGlobalSection
GlobalSection(ProjectDependencies) = postSolution
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{8CDD8387-B905-44A8-B5D5-07BB50E05BEA}.Debug.ActiveCfg = Debug|.NET
{8CDD8387-B905-44A8-B5D5-07BB50E05BEA}.Debug.Build.0 = Debug|.NET
{8CDD8387-B905-44A8-B5D5-07BB50E05BEA}.Release.ActiveCfg = Release|.NET
{8CDD8387-B905-44A8-B5D5-07BB50E05BEA}.Release.Build.0 = Release|.NET
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
EndGlobal</pre>
</body>
<script type="text/javascript" src="test.js"></script>
<script type="text/javascript">//<![CDATA[
assertExists("keyword", "Project", "Project keyword");
assertExists("keyword", "EndProject", "EndProject keyword");
assertExists("keyword", "Global", "Global keyword");
assertExists("keyword", "EndGlobal", "EndGlobal keyword");
assertExists("keyword", "GlobalSection", "GlobalSection keyword");
assertExists("keyword", "EndGlobalSection", "EndGlobalSection keyword");
assertExists("sectionName", "preSolution", "preSolution section name");
assertExists("sectionName", "postSolution", "postSolution section name");
assertExists("string", "\"{F184B08F-C81C-45F6-A57F-5ABD9991F28F}\"", "string");
assertExists("ident", ".Debug.ActiveCfg", "ident that starts with period");
assertExists("ident", "ConfigName.0", "ident with period");
assertExists("ident", "Name1", "normal ident");
assertExists("operator", "=", "= operator");
assertExists("operator", "|", "| operator");
assertExists("named-ident", "SolutionNotes", "argument to GlobalSection");
assertExists("named-ident", "ProjectDependencies", "argument to ProjectDependencies");
assertExists("guid", "{8CDD8387-B905-44A8-B5D5-07BB50E05BEA}", "guid");
assertExists("comment", "# Visual Studio 2010", "comment");
assertExists("formatDeclaration", "Microsoft Visual Studio Solution File, Format Version 11.00", "formatDeclaration");
//]]></script>
</html>
|
pocesar/docstrap
|
bower_components/sunlight/tests/test-sln.html
|
HTML
|
mit
| 3,008
|
# NodeBB VKontakte SSO
NodeBB Plugin that allows users to login/register via their Vkontakte account.
## Installation
npm install nodebb-plugin-sso-vk
## Configuration
1. Create a **VKontakte OAuth Client** via the [API Console](http://vk.com/dev)
2. Locate your Client ID and Password
3. The appropriate "Callback URL" is your NodeBB's URL with `/auth/vkontakte/callback` appended to it.
|
atomoc/nodebb-plugin-sso-vk
|
README.md
|
Markdown
|
mit
| 403
|
<!DOCTYPE html>
<html class="google" lang="en">
<head>
<script>
(function(H){H.className=H.className.replace(/\bgoogle\b/,'google-js')})(document.documentElement)
</script>
<meta charset="utf-8">
<meta content="initial-scale=1, minimum-scale=1, width=device-width" name="viewport">
<meta content="None" name="description">
<title>
Seoul - Google Careers
</title>
<script src="//www.google.com/js/google.js">
</script>
<link href="//fonts.googleapis.com/css?family=Open+Sans:300,400,600,700&lang=en" rel=
"stylesheet">
<link href="../../../../about/careers/css/default.css" rel="stylesheet">
<script>
var splitUrlPath=window.location.pathname.split("/");var cookiePath="";if(splitUrlPath.length>=4)cookiePath="/"+splitUrlPath[1]+"/"+splitUrlPath[2]+"/";var GOOGLE_REGEX="^https?://www.google.[a-z.]{2,6}";var CAREERS_PARENT_PATHS=".*/about/careers/";var selfReferral=new RegExp(GOOGLE_REGEX+CAREERS_PARENT_PATHS);var referrer=document.referrer;if(selfReferral.test(referrer))referrer="";
dataLayer=[{tagTypeBlacklist:["customScripts"],"pageTitle":"Seoul","lang":"ALL_ALL","domain":window.location.hostname,"cookiepath":cookiePath,"referrer":referrer}];
</script>
<script async defer src=
"//www.google.com/insights/consumersurveys/async_survey?site=eahwy2o2m7mdo3d4jqh2xtgiam">
</script>
<style>
iframe.c1 {display:none;visibility:hidden}
</style>
</head>
<body>
<noscript><iframe class="c1" height="0" src="//www.googletagmanager.com/ns.html?id=GTM-N7PW69"
width="0"></iframe></noscript>
<script>
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-N7PW69');
</script>
<div class="maia-header" id="maia-header" role="banner">
<div class="maia-aux">
<h1>
<a href="/"><img alt="Google" src="//www.google.com/images/logos/google_logo_41.png"></a>
</h1>
<h2>
<a href="../../../../about/careers/">Careers</a>
</h2><a class="maia-teleport" href="#content">Skip to content</a>
<div class="maia-util">
<div>
<form action="https://www.google.com/about/careers/search/" class="maia-search" id=
"jobs-top-search" name="jobs-top-search">
<input id="localeField" name="locale" type="hidden" value=""> <input id="q"
placeholder="Search all jobs" type="text"> <button class="maia-button" id=
"search-submit" onclick="return false" type="submit" value="Search"><span class=
"maia-search-icon">Search</span></button>
</form>
</div>
</div>
</div>
</div>
<div id="corp-crumb">
<ol>
<li>
<a class="breadcrumb" data-g-action="About Google" data-g-event="Breadcrumb Click" href=
"../../../../about/">About Google</a>
</li>
<li>
<a class="breadcrumb" data-g-action="Careers" data-g-event="Breadcrumb Click" href=
"../../../../about/careers/">Careers</a>
</li>
<li>
<a class="breadcrumb" data-g-action="Locations" data-g-event="Breadcrumb Click" href=
"../../../../about/careers/locations/">Locations</a>
</li>
<li>Seoul
</li>
</ol>
</div>
<div id="maia-main" role="main">
<div class="maia-teleport" id="content"></div>
<div class="corp-add-aside jobs-photos" id="corp-content">
<h1>
Google Seoul <span class="jobs-plusone"><g:plusone href=
"//www.google.com/about/careers/locations/seoul/" rel="publisher" size=
"small"></g:plusone></span>
</h1>
<p>
At Google Seoul, we're helping to bring Korea’s tech enthusiasm to the rest of the world.
We’ve developed products like Mobile Search with local users in mind, but also made
global impacts through products like Google TV. Our sales teams help advertisers utilize
rising ad platforms like Mobile and Display Ads, and grow with Google by reaching both
Korean and international clients. And our chefs make some awesome bulgogi.
</p>
<div class="maia-tabset maia-tabset-horizontal" id="location">
<div class="maia-tabset-nav">
<ul>
<li>
<a class="loc-media-tab" href="#tab-gallery">Gallery</a>
</li>
<li>
<a class="loc-media-tab" href="#tab-map">Map</a>
</li>
</ul>
</div>
<div class="maia-tabset-contents jobs-locations-list">
<div class="maia-tabset-content" id="tab-gallery">
<div id="slideshow">
Loading...
</div>
<div class="gallery-pagination">
<a class="gallery-previous loc-gallery" href="javascript:void(0)">Previous</a>
<a class="gallery-next loc-gallery" href="javascript:void(0)">Next</a>
</div>
</div>
<div class="maia-tabset-content" id="tab-map">
<div id="content-map"></div>
</div>
</div>
</div>
<div class="jobs-location-info">
<div class="jobs-location-focus">
<h3>
Accomplishments
</h3>
<p>
Our engineers develop products like <a href=
"https://plus.google.com/u/1/106322104148750976656/posts?gpsrc=hpjob">Google TV</a>,
Search and <a href=
"https://plus.google.com/u/1/111401917971052287374/posts?gpsrc=hpjob">Google
Maps</a>.
</p>
<p>
Our sales teams work closely with companies like Samsung and Hyundai Motor Company.
</p>
<p>
We were named the #1 foreign employer in Korea (for the fourth time in a row) by the
National College Newspapers Association in 2011.
</p>
</div>
<div class="jobs-location-stats">
<h3>
Stats
</h3>
<p>
<em>Number of Seoul Googlers:</em> About a hundred times Conway’s constant
</p>
<p>
<em>Some of our conference rooms are named:</em> Hallasan, Dokdo, Hangang
</p>
<p>
<em>Distance to Lotte World amusement park, in minutes of travel:</em> 15
</p>
</div>
<div class="jobs-location-address">
<h3>
Address
</h3>
<p>
22nd Floor, Gangnam Finance Center<br>
152 Teheran-ro, Gangnam-gu<br>
Seoul 135-984<br>
South Korea<br>
Phone: +82-2-531-9000<br>
</p>
</div>
</div>
<div class="jobs-location-inside">
<div>
<h2>
Inside Google Seoul
</h2>
<p>
Korea’s the most plugged-in country in the world, and Google is leading the way in
the ongoing mobile revolution. For example, Korea has the most <a href=
"https://plus.google.com/u/1/106886664866983861036/posts?gpsrc=hpjob">Google Play</a>
Store downloads per capita in the world – and we’re just getting started. Korea’s
enthusiasm for technology gives us a different set of opportunities and challenges
than other Google offices.
</p>
<p>
We have a relentless focus on serving Korean users, customers and partners. Our
engineers have worked on customizing Search for local users and developed products
that cater to the global markets, such as <a href=
"https://plus.google.com/u/1/106322104148750976656/posts?gpsrc=hpjob">Google TV</a>
and <a href=
"https://plus.google.com/u/1/111401917971052287374/posts?gpsrc=hpjob">Google Maps</a>
technologies. We’ve partnered with companies like Samsung and LG to develop <a href=
"https://plus.google.com/u/1/104629412415657030658/posts?gpsrc=hpjob">Android</a>
phones and other products. And our sales teams work closely with Korean advertisers
to help them grow with Google.
</p>
<p>
Like Googlers across the globe, we get to work in a colorful, fun workplace, with
everything from foosball and pool tables to bean bag chairs and singing rooms. Like
bulgogi and bibimbap? You’ll love our cafeteria.
</p>
<p>
Best of all, we enjoy a culture that gives us the ability to identify and act on
opportunities regardless of title. Between that and our relatively small size, our
Googlers can have an enormous impact on our success in Korea.
</p>
</div>
<blockquote>
<p>
With engineering and sales together on the same floor, we have a lot of personal
interaction and a really entrepreneurial atmosphere.
</p><span>- Ted Cho, Engineering Director</span>
</blockquote>
</div>
<div class="faq-section">
<h2>
Google Seoul: Frequently Asked Questions
</h2>
<h4 class="twisty">
Where’s Google Seoul located?
</h4>
<p>
In Gangnam-gu, amidst some of the tallest office buildings in the city. Our building,
the Gangnam Finance Centre, is itself the ninth tallest in Seoul. We’re on the 21st and
22nd floors – the views are amazing. We’re two subway stops away from COEX Mall, the
city’s largest underground shopping center, and Bongeunsa, a Zen Buddhist temple built
in the 8th century, and a short walk from Kukkiwon (a.k.a. World Taekwondo
Headquarters).
</p>
<h4 class="twisty">
How is Google Seoul different from other Google locations?
</h4>
<p>
Because we’re smaller than many Google locations, we’re especially nimble. We work
quickly, collaborate a lot and are able to make an immediate impact. What we do makes a
meaningful impact on Google’s presence in Korea.
</p>
<h4 class="twisty">
What are you doing to grow Google’s business in Korea?
</h4>
<p>
Koreans are tremendously tech savvy. The country has outstanding technology
infrastructure. Broadband and mobile networks are lightning fast, for instance, and
Seoul is rolling out free WiFi in public spaces throughout the city. We see that as
providing tremendous opportunities for products like <a href=
"https://plus.google.com/u/1/104629412415657030658/posts?gpsrc=hpjob">Android</a>,
<a href=
"https://plus.google.com/u/1/115229808208707341778/posts?gpsrc=hpjob">YouTube</a> and
<a href="https://plus.google.com/u/1/106322104148750976656/posts?gpsrc=hpjob">Google
TV</a>. We’re at the forefront of some of the most exciting innovations in the mobile
space – for example, our engineers have made huge strides in Mobile Search. And Korea
is one of the countries in which world-leading Android OEM partners, like Samsung and
LG, have introduced next generation Android devices.
</p>
<h4 class="twisty">
Have any cool launches come out of Google Seoul?
</h4>
<p>
We’ve shipped key features of Search and Transit Navigation for <a href=
"https://plus.google.com/u/1/111401917971052287374/posts?gpsrc=hpjob">Google Maps</a>
which helps you get from here to there using public or mass transit. And recently one
of our engineers developed a very cool Korean input method editor (IME) for Android. He
patented it, and it’s gotten rave reviews from Korean users.
</p>
<h4 class="twisty">
Do you do anything to help Nooglers and Googlers from other countries adjust to working
at Google Seoul?
</h4>
<p>
We offer Nooglers small-group tutoring in English and for our international Googlers,
Korean lessons.
</p>
<h4 class="twisty">
How do Seoul Googlers have fun?
</h4>
<p>
We’ve hosted everyone from YouTube sensation David Choi and K-pop girl group 2NE1 to
former government ministers and Vint Cerf, one of the fathers of the Internet. We go on
cool team off-sites – everywhere from ski resorts to the opera to the stunning island
of Jeju. We have an awesome year-end party. And we get together informally for
activities like karaoke.
</p>
<h4 class="twisty">
Does Google Korea do anything to build relationships with Korean developers?
</h4>
<p>
We host several Google nights each year, to which we invite <a href=
"https://plus.google.com/u/1/111395306401981598462/posts?gpsrc=hpjob">developers</a>
and students to demo our products and take part in technical talks. And Googlers from
across our office come together to promote and work on hackathons a couple of times a
year, which are a huge success. We also participate in external developer events and
host <a href=
"https://plus.google.com/u/1/108967384991768947849/posts?gpsrc=hpjob">Android
Developer</a> Lab (ADL) with more than 300 Korean developers every year.
</p>
</div>
<div class="jobs-stories-container hidenav" id="location-wise-stories">
<h2>
Life at Google Seoul
</h2>
<div class="gweb-pagination stories-wrapper">
<div class="gweb-pagination-content">
<a href="../../../../about/careers/lifeatgoogle/most-wanted-work-environments.html"
onclick=
"dataLayer.push({'event': 'link-click', 'eventCategory': 'related-story-image', 'eventAction': 'Most Wanted Work Environments'});">
<img alt="Most Wanted Work Environments" src=
"/about/careers/files/story_most-wanted-work-environments_image_222x222.jpg"></a>
<h3>
Most Wanted Work Environments
</h3>
<p>
The Seoul office takes top honors in Job Korea’s survey on most desired workplaces.
</p>
<p>
<a class="datalayer-click" data-g-action="Most Wanted Work Environments"
data-g-event="related-story-seemore" href=
"../../../../about/careers/lifeatgoogle/most-wanted-work-environments.html">See
more</a>
</p>
</div>
<div class="gweb-pagination-content">
<a href=
"../../../../about/careers/lifeatgoogle/1-foreign-company-people-want-to-work-for.html"
onclick=
"dataLayer.push({'event': 'link-click', 'eventCategory': 'related-story-image', 'eventAction': '#1 Foreign Company People Want to Work For'});">
<img alt="#1 Foreign Company People Want to Work For" src=
"/about/careers/files/story_1-foreign-company-people-want-to-work-for_image_222x222.jpg"></a>
<h3>
#1 Foreign Company People Want to Work For
</h3>
<p>
Google Korea tops another list of "Best Places to Work" where survey respondents
note our ...
</p>
<p>
<a class="datalayer-click" data-g-action=
"#1 Foreign Company People Want to Work For" data-g-event="related-story-seemore"
href=
"../../../../about/careers/lifeatgoogle/1-foreign-company-people-want-to-work-for.html">
See more</a>
</p>
</div>
<div class="gweb-pagination-content">
<a href="../../../../about/careers/lifeatgoogle/women-at-google-apac.html" onclick=
"dataLayer.push({'event': 'link-click', 'eventCategory': 'related-story-image', 'eventAction': 'Google: A great workplace for women'});">
<img alt="Google: A great workplace for women" src=
"/about/careers/files/story_women-at-google-apac_image_222x222.jpg"></a>
<h3>
Google: A great workplace for women
</h3>
<p>
At Google, our mission is to organize the world’s information and make it
universally accessible. ...
</p>
<p>
<a class="datalayer-click" data-g-action="Google: A great workplace for women"
data-g-event="related-story-seemore" href=
"../../../../about/careers/lifeatgoogle/women-at-google-apac.html">See more</a>
</p>
</div>
</div>
</div>
</div>
<div class="jobs-related" id="corp-aside">
<a class="maia-button loc-view-jobs" href=
"https://www.google.com/about/careers/search/#t=sq&q=j&jl=Seoul,Korea">View jobs in
Seoul</a>
<h3>
Teams in Seoul
</h3>
<ul>
<li>
<a class="loc-team-job" href=
"https://www.google.com/about/careers/search/#t=sq&q=j&jl=Seoul,Korea&jc=SOFTWARE_ENGINEERING&jc=HARDWARE_ENGINEERING&jc=NETWORK_ENGINEERING&jc=USER_EXPERIENCE&jc=TECHNICAL_INFRASTRUCTURE_ENGINEERING">
Engineering & Design</a>
</li>
<li>
<a class="loc-team-job" href=
"https://www.google.com/about/careers/search/#t=sq&q=j&jl=Seoul,Korea&jc=INFORMATION_TECHNOLOGY&jc=MANUFACTURING_SUPPLY_CHAIN&jc=DATA_CENTER_OPERATIONS&jc=TECHNICAL_WRITING&jc=PROGRAM_MANAGEMENT">
Operations & Support</a>
</li>
<li>
<a class="loc-team-job" href=
"https://www.google.com/about/careers/search/#t=sq&q=j&jl=Seoul,Korea&jc=PRODUCT_MANAGEMENT">
Product Management</a>
</li>
<li>
<a class="loc-team-job" href=
"https://www.google.com/about/careers/search/#t=sq&q=j&jl=Seoul,Korea&jc=DEVELOPER_RELATIONS&jc=TECHNICAL_SOLUTIONS">
Developer Relations & Technical Solutions</a>
</li>
<li>
<a class="loc-team-job" href=
"https://www.google.com/about/careers/search/#t=sq&q=j&jl=Seoul,Korea&jc=SALES">
Sales & Account Management</a>
</li>
<li>
<a class="loc-team-job" href=
"https://www.google.com/about/careers/search/#t=sq&q=j&jl=Seoul,Korea&jc=PRODUCT_SUPPORT">
Product & Customer Support</a>
</li>
<li>
<a class="loc-team-job" href=
"https://www.google.com/about/careers/search/#t=sq&q=j&jl=Seoul,Korea&jc=PARTNERSHIPS">
Partnerships</a>
</li>
<li>
<a class="loc-team-job" href=
"https://www.google.com/about/careers/search/#t=sq&q=j&jl=Seoul,Korea&jc=SALES_OPERATIONS">
Sales Operations</a>
</li>
<li>
<a class="loc-team-job" href=
"https://www.google.com/about/careers/search/#t=sq&q=j&jl=Seoul,Korea&jc=BUSINESS_STRATEGY">
Business Strategy</a>
</li>
<li>
<a class="loc-team-job" href=
"https://www.google.com/about/careers/search/#t=sq&q=j&jl=Seoul,Korea&jc=LEGAL">
Legal & Government Relations</a>
</li>
<li>
<a class="loc-team-job" href=
"https://www.google.com/about/careers/search/#t=sq&q=j&jl=Seoul,Korea&jc=MARKETING">
Marketing & Communications</a>
</li>
<li>
<a class="loc-team-job" href=
"https://www.google.com/about/careers/search/#t=sq&q=j&jl=Seoul,Korea&jc=PEOPLEOPS">
People Operations</a>
</li>
</ul>
<h3>
Featured locations
</h3>
<ul>
<li>
<a class="loc-featured" href="../mountain-view/">Mountain View (Global HQ)</a>
</li>
<li>
<a class="loc-featured" href="../tokyo/">Tokyo</a>
</li>
<li>
<a class="loc-featured" href="../sing/">Singapore</a>
</li>
<li>
<a class="loc-featured" href="../hyderabad/">Hyderabad</a>
</li>
<li>
<a class="loc-featured" href="../beijing/">Beijing</a>
</li>
</ul>
<h3>
Locations near Seoul
</h3>
<ul>
<li>
<a class="loc-near" href="../osaka/">Osaka</a>
</li>
<li>
<a class="loc-near" href="../shanghai/">Shanghai</a>
</li>
<li>
<a class="loc-near" href="../beijing/">Beijing</a>
</li>
<li>
<a class="loc-near" href="../tokyo/">Tokyo</a>
</li>
<li>
<a class="loc-near" href="../taipei/">Taipei</a>
</li>
</ul>
</div>
</div>
<div id="maia-signature"></div>
<div class="maia-footer" id="maia-footer">
<div id="maia-footer-local">
<div class="maia-aux">
<ul class="corp-footer-local maia-aux">
<li>
<a href="../../../../about/company/">Company</a>
<ul>
<li>
<a href="../../../../about/company/facts/">Who we are</a>
</li>
<li>
<a href="../../../../about/company/philosophy/">What we believe</a>
</li>
<li>
<a href="../../../../about/company/products/">What we do</a>
</li>
</ul>
</li>
<li>
<a href="../../../../press/">News from Google</a>
<ul>
<li>
<a href="../../../../press/images.html">Images and B-roll</a>
</li>
<li>
<a href="../../../../press/blog-directory.html">Blog directory</a>
</li>
<li>
<a href="../../../../press/google-directory.html">Google+ directory</a>
</li>
<li>
<a href="../../../../press/twitter-directory.html">Twitter directory</a>
</li>
<li>
<a href="../../../../press/facebook-directory.html">Facebook directory</a>
</li>
<li>
<a href="../../../../press/youtube-directory.html">YouTube directory</a>
</li>
</ul>
</li>
<li>
<a href="../../../../about/careers/">Careers</a>
<ul>
<li>
<a href="//www.google.com/about/careers/search/">Search all jobs</a>
</li>
<li>
<a href="../../../../about/careers/locations/">Office locations</a>
</li>
<li>
<a href="../../../../about/careers/teams/">Teams & Roles</a>
</li>
<li>
<a href="../../../../about/careers/lifeatgoogle/">Life at Google</a>
</li>
</ul>
</li>
<li>
<a href="//investor.google.com/">Investor relations</a>
<ul>
<li>
<a href="//investor.google.com/releases.html">News and events</a>
</li>
<li>
<a href="//investor.google.com/earnings.html">Financial information</a>
</li>
<li>
<a href="//investor.google.com/corporate/message.html">Corporate governance</a>
</li>
</ul>
</li>
<li>
<a href="../../../../contact/">Contact us</a>
</li>
</ul>
</div>
</div>
<div id="maia-footer-global">
<div class="maia-aux">
<ul>
<li>
<a href="/">Google</a>
</li>
<li>
<a href="/intl/en/about/">About Google</a>
</li>
<li>
<a href="/intl/en/policies/privacy/">Privacy</a>
</li>
<li>
<a href="/intl/en/policies/terms/">Terms</a>
</li>
</ul>
</div>
</div>
</div>
<script src="https://apis.google.com/js/plusone.js">
</script>
<script src="/about/careers/js/view.min.js">
</script>
<script src="//www.google.com/jsapi">
</script>
<script src="//www.google.com/uds/solutions/slideshow/gfslideshow.js">
</script>
<script src=
"https://maps.googleapis.com/maps/api/js?%20key=AIzaSyDdKhtrV93aDe25CC2nddy97OgVn71mWHA&sensor=true"
>
</script>
<script>
var albumFeed = new photo.feed.Album('5723199685499643185');
var locationData = [{"baseoffice": [{"name": "Seoul", "coordinates": "37.50018, 127.03656"}], "region": "Asia Pacific", "office": {"meta": {"keyname": "seoul"}, "description": "At Google Seoul, we're helping to bring Korea\u2019s tech enthusiasm to the rest of the world. We\u2019ve developed products like Mobile Search with local users in mind, but also made global impacts through products like Google TV. Our sales teams help advertisers utilize rising ad platforms like Mobile and Display Ads, and grow with Google by reaching both Korean and international clients. And our chefs make some awesome bulgogi."}, "country": {"name": "Korea"}}];
var regionData = null;
var locations = new jobs.office.Locations({
'canvas' : 'content-map',
'zoomLevel' : 12,
'coordinates' : '37.50018, 127.03656'
});
locations.init(locationData, regionData);
</script>
<script src="//www.google.com/js/maia.js">
</script>
</body>
</html>
|
nimdavtanke/www
|
moon.nimda.pro/intl/en/about/careers/locations/seoul/index.html
|
HTML
|
mit
| 27,103
|
<!DOCTYPE html>
<html lang="en"><meta charset="utf-8" />
<title>Inky obsessions - Reflections</title>
<meta name="description" content="Default Page Description" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="http://blog.shiv.me/css/latex.css" />
<link rel="stylesheet" href="http://blog.shiv.me/css/main.css" />
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
<meta name="generator" content="Hugo 0.75.1" /><body>
<header>
<nav class="navbar">
<div class="nav">
<ul class="nav-links">
</ul>
</div>
</nav>
<div class="intro-header">
<div class="container">
<div class="post-heading">
<h1>Inky obsessions</h1>
</div>
</div>
</div>
</header>
<div id="content">
<div class="container" role="main">
<article class="article" class="blog-post">
<div class="postmeta">
<span class="meta-post">
<i class="fa fa-calendar-alt"></i>May 13, 2013
</span>
</div>
<br>
<p>Have I mentioned the long-standing obsession with stationery, especially, fountain pens? Well, it is a bit of problem, really. In the last few months, I have started hoarding them. It started with one– a Lamy. Once I discovered how one can procure junk on eBay for very little money, I quickly ended up with a selection. As these things go, I suddenly had the increased “need” for inks that are not blue, or black. Nay, simple colours won’t do for the truly obsessed.</p>
<p>Here is the result of the latest rotation of inks and pens.</p>
<p><img src="http://blog.shiv.me/images/Photo-2013-05-12-5-40-53-PM-e1368499228747-225x300.jpg" alt="Ink Rotation - May 12th"></p>
<div class="blog-tags">
<a href="http://blog.shiv.me//tags/esterbrook/">esterbrook</a>
<a href="http://blog.shiv.me//tags/fountain-pens/">fountain pens</a>
<a href="http://blog.shiv.me//tags/hero/">hero</a>
<a href="http://blog.shiv.me//tags/hobby/">hobby</a>
<a href="http://blog.shiv.me//tags/ink/">ink</a>
<a href="http://blog.shiv.me//tags/ink-rotation/">ink rotation</a>
<a href="http://blog.shiv.me//tags/lamy/">Lamy</a>
<a href="http://blog.shiv.me//tags/obsessions/">obsessions</a>
<a href="http://blog.shiv.me//tags/oliver/">oliver</a>
<a href="http://blog.shiv.me//tags/parker/">parker</a>
<a href="http://blog.shiv.me//tags/shaeffer/">shaeffer</a>
</div>
</article>
</div>
</div><footer>
<div class="container">
<p class="credits copyright">
<p class="credits theme-by">
Powered By <a href="https://gohugo.io">Hugo</a> / Theme <a href="https://github.com/7ma7X/HugoTeX">HugoTeX</a>
<br>
<a href="http://blog.shiv.me/about">Shiva Velmurugan</a>
©
2016
</p>
</div>
</footer></body>
</html>
|
shiva/shiva.github.io
|
2013/05/13/inky-obsessions/index.html
|
HTML
|
mit
| 3,341
|
/*
* Copyright (c) 2002-2010 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This 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.neo4j.graphdb;
/**
* Defines a common API for handling properties on both {@link Node nodes} and
* {@link Relationship relationships}.
* <p>
* Properties are key-value pairs. The keys are always strings. Valid property
* value types are all the Java primitives (<code>int</code>, <code>byte</code>,
* <code>float</code>, etc), <code>java.lang.String</code>s and arrays of
* primitives and Strings.
* <p>
* <b>Please note</b> that Neo4j does NOT accept arbitrary objects as property
* values. {@link #setProperty(String, Object) setProperty()} takes a
* <code>java.lang.Object</code> only to avoid an explosion of overloaded
* <code>setProperty()</code> methods.
*/
public interface PropertyContainer
{
/**
* Returns <code>true</code> if this property container has a property
* accessible through the given key, <code>false</code> otherwise. If key is
* <code>null</code>, this method returns <code>false</code>.
*
* @param key the property key
* @return <code>true</code> if this property container has a property
* accessible through the given key, <code>false</code> otherwise
*/
public boolean hasProperty( String key );
/**
* Returns the property value associated with the given key. The value is of
* one of the valid property types, i.e. a Java primitive, a {@link String
* String} or an array of any of the valid types.
* <p>
* If there's no property associated with <code>key</code> an unchecked
* exception is raised. The idiomatic way to avoid an exception for an
* unknown key and instead get <code>null</code> back is to use a default
* value: {@link #getProperty(String, Object) Object valueOrNull =
* nodeOrRel.getProperty( key, null )}
*
* @param key the property key
* @return the property value associated with the given key
* @throws NotFoundException if there's no property associated with
* <code>key</code>
*/
public Object getProperty( String key );
/**
* Returns the property value associated with the given key, or a default
* value. The value is of one of the valid property types, i.e. a Java
* primitive, a {@link String String} or an array of any of the valid types.
*
* @param key the property key
* @param defaultValue the default value that will be returned if no
* property value was associated with the given key
* @return the property value associated with the given key
*/
public Object getProperty( String key, Object defaultValue );
/**
* Sets the property value for the given key to <code>value</code>. The
* property value must be one of the valid property types, i.e:
* <ul>
* <li><code>boolean</code> or <code>boolean[]</code></li>
* <li><code>byte</code> or <code>byte[]</code></li>
* <li><code>short</code> or <code>short[]</code></li>
* <li><code>int</code> or <code>int[]</code></li>
* <li><code>long</code> or <code>long[]</code></li>
* <li><code>float</code> or <code>float[]</code></li>
* <li><code>double</code> or <code>double[]</code></li>
* <li><code>char</code> or <code>char[]</code></li>
* <li><code>java.lang.String</code> or <code>String[]</code></li>
* </ul>
* <p>
* This means that <code>null</code> is not an accepted property value.
*
* @param key the key with which the new property value will be associated
* @param value the new property value, of one of the valid property types
* @throws IllegalArgumentException if <code>value</code> is of an
* unsupported type (including <code>null</code>)
*/
public void setProperty( String key, Object value );
/**
* Removes the property associated with the given key and returns the old
* value. If there's no property associated with the key, <code>null</code>
* will be returned.
*
* @param key the property key
* @return the property value that used to be associated with the given key
*/
public Object removeProperty( String key );
/**
* Returns all existing property keys, or an empty iterable if this property
* container has no properties.
*
* @return all property keys on this property container
*/
// TODO: figure out concurrency semantics
public Iterable<String> getPropertyKeys();
/**
* Returns all currently valid property values, or an empty iterable if this
* node has no properties. All values are of a supported property type, i.e.
* a Java primitive, a {@link String String} or an array of any of the
* supported types.
* <p>
* <b>Note:</b> This method is deprecated and <i>will</i> be removed in
* future releases. Use a combination of {@link #getPropertyKeys()} and
* {@link #getProperty(String)} to achieve the same result.
*
* @return all property values
* @deprecated in favor of using {@link #getPropertyKeys()} in combination
* with {@link #getProperty(String)}.
*/
// TODO: figure out concurrency semantics
@Deprecated
public Iterable<Object> getPropertyValues();
}
|
alexmsmartins/GraphDHT
|
neo4j/kernel-1.0/src/main/java/org/neo4j/graphdb/PropertyContainer.java
|
Java
|
mit
| 6,071
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Problem 8. Catalan Numbers")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Problem 8. Catalan Numbers")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("5385409b-b530-4a64-8c05-76362a41cb6e")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
|
fr0wsTyl/TelerikAcademy-2015
|
Telerik - C# 1/HOMEWORK - loops/Problem 8. Catalan Numbers/Properties/AssemblyInfo.cs
|
C#
|
mit
| 1,428
|
# mincore_downlevel #
Contains function definitions for the Windows API library mincore_downlevel. See winapi for types and constants.
```toml
[dependencies]
mincore_downlevel-sys = "0.0.1"
```
```rust
extern crate mincore_downlevel;
```
[Documentation](https://retep998.github.io/doc/mincore_downlevel/)
|
Boddlnagg/winapi-rs
|
lib/mincore_downlevel/README.md
|
Markdown
|
mit
| 308
|
# -*- coding: utf-8 -*-
"""Objects representing WikidataQuery query syntax and API."""
#
# (C) Pywikibot team, 2013
#
# Distributed under the terms of the MIT license.
from __future__ import unicode_literals
import json
import sys
if sys.version_info[0] > 2:
from urllib.parse import quote
basestring = (str, )
else:
from urllib2 import quote
import pickle
import os
import hashlib
import time
import tempfile
import pywikibot
from pywikibot.comms import http
from pywikibot.page import ItemPage, PropertyPage, Claim
from pywikibot import config
def listify(x):
"""
If given a non-list, encapsulate in a single-element list.
@rtype: list
"""
return x if isinstance(x, list) else [x]
class QuerySet():
"""
A QuerySet represents a set of queries or other query sets.
Queries may be joined by operators (AND and OR).
A QuerySet stores this information as a list of Query(Sets) and
a joiner operator to join them all together
"""
def __init__(self, q):
"""
Initialise a query set from a Query or another QuerySet.
@type q: Query or QuerySet
"""
self.qs = [q]
def addJoiner(self, args, joiner):
"""
Add to this QuerySet using the given joiner.
If the given joiner is not the same as we used before in
this QuerySet, nest the current one in parens before joining.
This makes the implicit grouping of the API explicit.
@return: a new query set representing the joining of this one and
the arguments
"""
if len(self.qs) > 1 and joiner != self.joiner:
left = QuerySet(self)
else:
left = self
left.joiner = joiner
for a in listify(args):
left.qs.append(a)
return left
def AND(self, args):
"""
Add the given args (Queries or QuerySets) to the Query set as a logical conjuction (AND).
@type args: Query or QuerySet
"""
return self.addJoiner(args, "AND")
def OR(self, args):
"""
Add the given args (Queries or QuerySets) to the Query set as a logical disjunction (OR).
@type args: Query or QuerySet
"""
return self.addJoiner(args, "OR")
def __str__(self):
"""
Output as an API-ready string.
@rtype: str
"""
def bracketIfQuerySet(q):
if isinstance(q, QuerySet) and q.joiner != self.joiner:
return "(%s)" % q
else:
return str(q)
s = bracketIfQuerySet(self.qs[0])
for q in self.qs[1:]:
s += " %s %s" % (self.joiner, bracketIfQuerySet(q))
return s
def __repr__(self):
return u"QuerySet(%s)" % self
class Query():
"""
A query is a single query for the WikidataQuery API.
For example:
claim[100:60] or link[enwiki]
Construction of a Query can throw a TypeError if you feed it bad
parameters. Exactly what these need to be depends on the Query
"""
def AND(self, ands):
"""
Produce a query set ANDing this query and all the given query/sets.
@type ands: Query or list of Query
"""
return QuerySet(self).addJoiner(ands, "AND")
def OR(self, ors):
"""
Produce a query set ORing this query and all the given query/sets.
@type ors: Query or list of Query
"""
return QuerySet(self).addJoiner(ors, "OR")
def formatItem(self, item):
"""
Default item formatting is string.
This will work for queries, querysets, ints and strings
"""
return str(item)
def formatList(self, l):
"""
Format and comma-join a list.
@type l: list
"""
return ",".join([self.formatItem(x) for x in l])
@staticmethod
def isOrContainsOnlyTypes(items, types):
"""
Either this item is one of the given types, or it is a list of only those types.
@rtype: bool
"""
if isinstance(items, list):
for x in items:
found = False
for typ in listify(types):
if isinstance(x, typ):
found = True
break
if not found:
return False
else:
for typ in listify(types):
found = False
if isinstance(items, typ):
found = True
break
if not found:
return False
return True
def validate(self):
"""
Validate the query parameters.
Default validate result is a pass - subclasses need to implement
this if they want to check their parameters.
@return: True
@rtype: bool
"""
return True
def validateOrRaise(self, msg=None):
if not self.validate():
raise TypeError(msg)
def convertWDType(self, item):
"""
Convert Wikibase items like ItemPage or PropertyPage into integer IDs.
The resulting IDs may be used in query strings.
@param item: A single item. One of ItemPages, PropertyPages, int
or anything that can be fed to int()
@return: the int ID of the item
"""
if isinstance(item, ItemPage) or isinstance(item, PropertyPage):
return item.getID(numeric=True)
else:
return int(item)
def convertWDTypes(self, items):
return [self.convertWDType(x) for x in listify(items)]
def __str__(self):
"""
Generate a query string to be passed to the WDQ API.
Sub-classes must override this method.
@raise NotImplementedError: Always raised by this abstract method
"""
raise NotImplementedError
def __repr__(self):
return u"Query(%s)" % self
class HasClaim(Query):
"""
This is a Query of the form "claim[prop:val]".
It is subclassed by
the other similar forms like noclaim and string
"""
queryType = "claim"
def __init__(self, prop, items=[]):
"""Constructor."""
self.prop = self.convertWDType(prop)
if isinstance(items, Query):
self.items = items
elif isinstance(self, StringClaim):
self.items = listify(items)
else:
self.items = self.convertWDTypes(items)
self.validateOrRaise()
def formatItems(self):
res = ''
if self.items:
res += ":" + ",".join([self.formatItem(x) for x in self.items])
return res
def validate(self):
return self.isOrContainsOnlyTypes(self.items, [int, Query])
def __str__(self):
if isinstance(self.items, list):
return "%s[%s%s]" % (self.queryType, self.prop, self.formatItems())
elif isinstance(self.items, Query):
return "%s[%s:(%s)]" % (self.queryType, self.prop, self.items)
class NoClaim(HasClaim):
"""Query of the form noclaim[PROPERTY]."""
queryType = "noclaim"
class StringClaim(HasClaim):
"""Query of the form string[PROPERTY:"STRING",...]."""
queryType = "string"
def formatItem(self, x):
"""Add quotes around string."""
return '"%s"' % x
def validate(self):
return self.isOrContainsOnlyTypes(self.items, basestring)
class Tree(Query):
"""Query of the form tree[ITEM,...][PROPERTY,...]<PROPERTY,...>."""
queryType = "tree"
def __init__(self, item, forward=[], reverse=[]):
"""
Constructor.
@param item: The root item
@param forward: List of forward properties, can be empty
@param reverse: List of reverse properties, can be empty
"""
# check sensible things coming in, as we lose info once we do
# type conversion
if not self.isOrContainsOnlyTypes(item, [int, ItemPage]):
raise TypeError("The item paramter must contain or be integer IDs "
"or page.ItemPages")
elif (not self.isOrContainsOnlyTypes(forward, [int, PropertyPage]) or
not self.isOrContainsOnlyTypes(reverse, [int, PropertyPage])):
raise TypeError("The forward and reverse parameters must contain "
"or be integer IDs or page.PropertyPages")
self.item = self.convertWDTypes(item)
self.forward = self.convertWDTypes(forward)
self.reverse = self.convertWDTypes(reverse)
self.validateOrRaise()
def validate(self):
return (self.isOrContainsOnlyTypes(self.item, int) and
self.isOrContainsOnlyTypes(self.forward, int) and
self.isOrContainsOnlyTypes(self.reverse, int))
def __str__(self):
return "%s[%s][%s][%s]" % (self.queryType, self.formatList(self.item),
self.formatList(self.forward),
self.formatList(self.reverse))
class Around(Query):
"""A query in the form around[PROPERTY,LATITUDE,LONGITUDE,RADIUS]."""
queryType = "around"
def __init__(self, prop, coord, rad):
"""Constructor."""
self.prop = self.convertWDType(prop)
self.lt = coord.lat
self.lg = coord.lon
self.rad = rad
def validate(self):
return isinstance(self.prop, int)
def __str__(self):
return "%s[%s,%s,%s,%s]" % (self.queryType, self.prop,
self.lt, self.lg, self.rad)
class Between(Query):
"""
A query in the form between[PROP, BEGIN, END].
You have to give prop and one of begin or end. Note that times have
to be in UTC, timezones are not supported by the API
@param prop: the property
@param begin: WbTime object representing the beginning of the period
@param end: WbTime object representing the end of the period
"""
queryType = "between"
def __init__(self, prop, begin=None, end=None):
"""Constructor."""
self.prop = self.convertWDType(prop)
self.begin = begin
self.end = end
def validate(self):
return (self.begin or self.end) and isinstance(self.prop, int)
def __str__(self):
begin = self.begin.toTimestr() if self.begin else ''
# if you don't have an end, you don't put in the comma
end = ',' + self.end.toTimestr() if self.end else ''
return "%s[%s,%s%s]" % (self.queryType, self.prop, begin, end)
class Link(Query):
"""
A query in the form link[LINK,...], which also includes nolink.
All link elements have to be strings, or validation will throw
"""
queryType = "link"
def __init__(self, link):
"""Constructor."""
self.link = listify(link)
self.validateOrRaise()
def validate(self):
return self.isOrContainsOnlyTypes(self.link, basestring)
def __str__(self):
return "%s[%s]" % (self.queryType, self.formatList(self.link))
class NoLink(Link):
"""A query in the form nolink[..]."""
queryType = "nolink"
def fromClaim(claim):
"""
Construct from a pywikibot.page Claim object.
@type claim: L{pywikibot.page.Claim}
@rtype: L{Query}
"""
if not isinstance(claim, Claim):
raise TypeError("claim must be a page.Claim")
if claim.type == 'wikibase-item':
return HasClaim(claim.getID(numeric=True), claim.getTarget().getID(numeric=True))
if claim.type == 'string':
return StringClaim(claim.getID(numeric=True), claim.getTarget())
else:
raise TypeError("Cannot construct a query from a claim of type %s"
% claim.type)
class WikidataQuery():
"""
An interface to the WikidataQuery API.
Default host is
https://wdq.wmflabs.org/, but you can substitute
a different one.
Caching defaults to a subdir of the system temp directory with a
1 hour max cache age.
Set a zero or negative maxCacheAge to disable caching
"""
def __init__(self, host="https://wdq.wmflabs.org", cacheDir=None,
cacheMaxAge=60):
"""Constructor."""
self.host = host
self.cacheMaxAge = cacheMaxAge
if cacheDir:
self.cacheDir = cacheDir
else:
self.cacheDir = os.path.join(tempfile.gettempdir(),
"wikidataquery_cache")
def getUrl(self, queryStr):
return "%s/api?%s" % (self.host, queryStr)
def getQueryString(self, q, labels=[], props=[]):
"""
Get the query string for a given query or queryset.
@return: string including labels and props
"""
qStr = "q=%s" % quote(str(q))
if labels:
qStr += "&labels=%s" % ','.join(labels)
if props:
qStr += "&props=%s" % ','.join(props)
return qStr
def getCacheFilename(self, queryStr):
"""
Encode a query into a unique and universally safe format.
@rtype: unicode
"""
encQuery = hashlib.sha1(queryStr.encode('utf8')).hexdigest() + ".wdq_cache"
return os.path.join(self.cacheDir, encQuery)
def readFromCache(self, queryStr):
"""
Load the query result from the cache, if possible.
@return: None if the data is not there or if it is too old.
"""
if self.cacheMaxAge <= 0:
return None
cacheFile = self.getCacheFilename(queryStr)
if os.path.isfile(cacheFile):
mtime = os.path.getmtime(cacheFile)
now = time.time()
if ((now - mtime) / 60) < self.cacheMaxAge:
with open(cacheFile, 'rb') as f:
try:
data = pickle.load(f)
except pickle.UnpicklingError:
pywikibot.warning(u"Couldn't read cached data from %s"
% cacheFile)
data = None
return data
return None
def saveToCache(self, q, data):
"""
Save data from a query to a cache file, if enabled.
@rtype: None
"""
if self.cacheMaxAge <= 0:
return
# we have to use our own query string, as otherwise we may
# be able to find the cache file again if there are e.g.
# whitespace differences
cacheFile = self.getCacheFilename(q)
if os.path.exists(cacheFile) and not os.path.isfile(cacheFile):
return
if not os.path.exists(self.cacheDir):
os.makedirs(self.cacheDir)
with open(cacheFile, 'wb') as f:
try:
pickle.dump(data, f, protocol=config.pickle_protocol)
except IOError:
pywikibot.warning(u"Failed to write cache file %s" % cacheFile)
def getDataFromHost(self, queryStr):
"""
Go and fetch a query from the host's API.
@rtype: dict
"""
url = self.getUrl(queryStr)
try:
resp = http.fetch(url)
except:
pywikibot.warning(u"Failed to retrieve %s" % url)
raise
try:
data = json.loads(resp.content)
except ValueError:
pywikibot.warning(u"Data received from host but no JSON could be decoded")
raise pywikibot.ServerError("Data received from host but no JSON could be decoded")
return data
def query(self, q, labels=[], props=[]):
"""
Actually run a query over the API.
@return: dict of the interpreted JSON or None on failure
"""
fullQueryString = self.getQueryString(q, labels, props)
# try to get cached data first
data = self.readFromCache(fullQueryString)
if data:
return data
# the cached data must not be OK, go and get real data from the
# host's API
data = self.getDataFromHost(fullQueryString)
# no JSON found
if not data:
return None
# cache data for next time
self.saveToCache(fullQueryString, data)
return data
|
hperala/kontuwikibot
|
pywikibot/data/wikidataquery.py
|
Python
|
mit
| 16,312
|
#ifndef QTADMOBBANNERDUMMY_H
#define QTADMOBBANNERDUMMY_H
#include "IQtAdMobBanner.h"
class QtAdMobBannerDummy : public IQtAdMobBanner
{
public:
QtAdMobBannerDummy();
virtual ~QtAdMobBannerDummy();
/*
* Configure banner id
*/
virtual void setUnitId(const QString& unitId);
/*
* Retrive banner id
*/
virtual const QString& unitId() const;
/*
* Setup preconfigured banner size
*/
virtual void setSize(Sizes size);
/*
* Retrieve banner size
*/
virtual Sizes size() const;
/*
* Get real banner size in pixels
*/
virtual QSize sizeInPixels();
/*
* Setup banner position
*/
virtual void setPosition(const QPoint& position);
/*
* Retrieve banner position
*/
virtual const QPoint& position() const;
/*
* Show banner
*/
virtual void setVisible(bool isVisible);
/*
* Is banner showed
*/
virtual bool visible();
/*
* Is banner loaded
*/
virtual bool isLoaded();
/*
* Add test device identifier
*/
void addTestDevice(const QString& hashedDeviceId);
private:
QString m_UnitId;
IQtAdMobBanner::Sizes m_BannerSize;
QPoint m_Position;
};
#endif // QTADMOBBANNERDUMMY_H
|
yevgeniy-logachev/QtAdMob
|
QtAdMobBannerDummy.h
|
C
|
mit
| 1,286
|
#include "FileStream.hpp"
#include <cstring>
namespace warped {
//////////////////////////////// Constructors ///////////////////////////////////////////}
FileStream::FileStream(const std::string& filename, std::ios_base::openmode mode) {
fstream_.open(filename, mode);
}
FileStream::FileStream (FileStream&& x) {
*this = std::move(x);
}
FileStream& FileStream::operator= (FileStream&& rhs) {
if (this == &rhs)
return *this;
*this = std::move(rhs);
return *this;
}
///////////////////////////// fstream operations //////////////////////////////////////////////
void FileStream::open(const char* filename, std::ios_base::openmode mode) {
fstream_.open(filename, mode);
}
void FileStream::open(const std::string& filename, std::ios_base::openmode mode) {
fstream_.open(filename, mode);
}
bool FileStream::is_open() const {
return fstream_.is_open();
}
void FileStream::close() {
fstream_.close();
}
std::filebuf* FileStream::rdbuf() const {
return fstream_.rdbuf();
}
//////////////////////////// Output ////////////////////////////////////////////////////////
FileStream& FileStream::operator<< (bool val) {
fstream_ << val;
return *this;
}
FileStream& FileStream::operator<< (short val) {
fstream_ << val;
return *this;
}
FileStream& FileStream::operator<< (unsigned short val) {
fstream_ << val;
return *this;
}
FileStream& FileStream::operator<< (int val) {
fstream_ << val;
return *this;
}
FileStream& FileStream::operator<< (unsigned int val) {
fstream_ << val;
return *this;
}
FileStream& FileStream::operator<< (long val) {
fstream_ << val;
return *this;
}
FileStream& FileStream::operator<< (unsigned long val) {
fstream_ << val;
return *this;
}
FileStream& FileStream::operator<< (long long val) {
fstream_ << val;
return *this;
}
FileStream& FileStream::operator<< (unsigned long long val) {
fstream_ << val;
return *this;
}
FileStream& FileStream::operator<< (float val) {
fstream_ << val;
return *this;
}
FileStream& FileStream::operator<< (double val) {
fstream_ << val;
return *this;
}
FileStream& FileStream::operator<< (long double val) {
fstream_ << val;
return *this;
}
FileStream& FileStream::operator<< (void* val) {
fstream_ << val;
return *this;
}
FileStream& FileStream::operator<< (const char * val) {
fstream_ << val;
return *this;
}
FileStream& FileStream::operator<< (std::streambuf* sb) {
fstream_ << sb;
return *this;
}
// FileStream& FileStream::operator<< (FileStream& (*pf)(FileStream&)) {
// *this << pf;
// return *this;
// }
FileStream& FileStream::operator<< (std::ios& (*pf)(std::ios&)) {
fstream_ << pf;
return *this;
}
FileStream& FileStream::operator<< (std::ios_base& (*pf)(std::ios_base&)) {
fstream_ << pf;
return *this;
}
FileStream& FileStream::put(char c) {
fstream_.put(c);
return *this;
}
FileStream& FileStream::write(const char* s, std::streamsize n) {
fstream_.write(s, n);
return *this;
}
//////////////////////////////// Input /////////////////////////////////////////////////
FileStream& FileStream::operator>> (bool& val) {
fstream_ >> val;
return *this;
}
FileStream& FileStream::operator>> (short& val) {
fstream_ >> val;
return *this;
}
FileStream& FileStream::operator>> (unsigned short & val) {
fstream_ >> val;
return *this;
}
FileStream& FileStream::operator>> (int& val) {
fstream_ >> val;
return *this;
}
FileStream& FileStream::operator>> (unsigned int& val) {
fstream_ >> val;
return *this;
}
FileStream& FileStream::operator>> (long& val) {
fstream_ >> val;
return *this;
}
FileStream& FileStream::operator>> (unsigned long& val) {
fstream_ >> val;
return *this;
}
FileStream& FileStream::operator>> (float& val) {
fstream_ >> val;
return *this;
}
FileStream& FileStream::operator>> (double& val) {
fstream_ >> val;
return *this;
}
FileStream& FileStream::operator>> (long double& val) {
fstream_ >> val;
return *this;
}
FileStream& FileStream::FileStream::operator>> (void*& val) {
fstream_ >> val;
return *this;
}
FileStream& FileStream::operator>> (std::streambuf* sb) {
fstream_ >> sb;
return *this;
}
// FileStream& FileStream::operator>> (FileStream& (*pf)(FileStream)) {
// *this >> pf;
// return *this;
// }
FileStream& FileStream::operator>> (std::ios& (*pf)(std::ios&)) {
fstream_ >> pf;
return *this;
}
FileStream& FileStream::operator>> (std::ios_base& (*pf)(std::ios_base&)) {
fstream_ >> pf;
return *this;
}
std::streamsize FileStream::gcount() const {
return fstream_.gcount();
}
int FileStream::get() {
return fstream_.get();
}
FileStream& FileStream::get (char& c) {
fstream_.get(c);
return *this;
}
FileStream& FileStream::get (char* s, std::streamsize n) {
fstream_.get(s, n);
return *this;
}
FileStream& FileStream::get (char* s, std::streamsize n, char delim) {
fstream_.get(s, n, delim);
return *this;
}
FileStream& FileStream::get (std::streambuf& sb) {
fstream_.get(sb);
return *this;
}
FileStream& FileStream::get (std::streambuf& sb, char delim) {
fstream_.get(sb, delim);
return *this;
}
FileStream& FileStream::getline (char* s, std::streamsize n ) {
fstream_.getline(s, n);
return *this;
}
FileStream& FileStream::getline (char* s, std::streamsize n, char delim ) {
fstream_.getline(s, n, delim);
return *this;
}
FileStream& FileStream::ignore (std::streamsize n, int delim) {
fstream_.ignore(n, delim);
return *this;
}
int FileStream::peek() {
return fstream_.peek();
}
FileStream& FileStream::read (char* s, std::streamsize n) {
fstream_.read(s, n);
return *this;
}
std::streamsize FileStream::readsome (char* s, std::streamsize n) {
return fstream_.readsome(s, n);
}
FileStream& FileStream::putback (char c) {
fstream_.putback(c);
return *this;
}
FileStream& FileStream::unget() {
fstream_.unget();
return *this;
}
std::streampos FileStream::tellg() {
return fstream_.tellg();
}
FileStream& FileStream::seekg (std::streampos pos) {
fstream_.seekg(pos);
return *this;
}
FileStream& FileStream::seekg (std::streamoff off, std::ios_base::seekdir way) {
fstream_.seekg(off, way);
return *this;
}
int FileStream::sync() {
return fstream_.sync();
}
} // namespace warped
|
wilseypa/warped2
|
src/FileStream.cpp
|
C++
|
mit
| 6,479
|
<div class="alert alert-danger">
<?php echo $errorName; ?>
</div>
|
Mcfloy/Intranet
|
views/global/error.php
|
PHP
|
mit
| 66
|
//= require "prism.js"
//= require "jquery/dist/jquery.min.js"
//= require "ga.js"
|
nakanishy/blog.nakanishy.com
|
source/javascripts/all.js
|
JavaScript
|
mit
| 83
|
#include "transactionview.h"
#include "transactionfilterproxy.h"
#include "transactionrecord.h"
#include "walletmodel.h"
#include "addresstablemodel.h"
#include "transactiontablemodel.h"
#include "bitcoinunits.h"
#include "csvmodelwriter.h"
#include "transactiondescdialog.h"
#include "editaddressdialog.h"
#include "optionsmodel.h"
#include "guiutil.h"
#include <QScrollBar>
#include <QComboBox>
#include <QDoubleValidator>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QLineEdit>
#include <QTableView>
#include <QHeaderView>
#include <QPushButton>
#include <QMessageBox>
#include <QPoint>
#include <QMenu>
#include <QApplication>
#include <QClipboard>
#include <QLabel>
#include <QDateTimeEdit>
TransactionView::TransactionView(QWidget *parent) :
QWidget(parent), model(0), transactionProxyModel(0),
transactionView(0)
{
// Build filter row
setContentsMargins(0,0,0,0);
QHBoxLayout *hlayout = new QHBoxLayout();
hlayout->setContentsMargins(0,0,0,0);
#ifdef Q_OS_MAC
hlayout->setSpacing(5);
hlayout->addSpacing(26);
#else
hlayout->setSpacing(0);
hlayout->addSpacing(23);
#endif
dateWidget = new QComboBox(this);
#ifdef Q_OS_MAC
dateWidget->setFixedWidth(121);
#else
dateWidget->setFixedWidth(120);
#endif
dateWidget->addItem(tr("All"), All);
dateWidget->addItem(tr("Today"), Today);
dateWidget->addItem(tr("This week"), ThisWeek);
dateWidget->addItem(tr("This month"), ThisMonth);
dateWidget->addItem(tr("Last month"), LastMonth);
dateWidget->addItem(tr("This year"), ThisYear);
dateWidget->addItem(tr("Range..."), Range);
hlayout->addWidget(dateWidget);
typeWidget = new QComboBox(this);
#ifdef Q_OS_MAC
typeWidget->setFixedWidth(121);
#else
typeWidget->setFixedWidth(120);
#endif
typeWidget->addItem(tr("All"), TransactionFilterProxy::ALL_TYPES);
typeWidget->addItem(tr("Received with"), TransactionFilterProxy::TYPE(TransactionRecord::RecvWithAddress) |
TransactionFilterProxy::TYPE(TransactionRecord::RecvFromOther));
typeWidget->addItem(tr("Sent to"), TransactionFilterProxy::TYPE(TransactionRecord::SendToAddress) |
TransactionFilterProxy::TYPE(TransactionRecord::SendToOther));
typeWidget->addItem(tr("To yourself"), TransactionFilterProxy::TYPE(TransactionRecord::SendToSelf));
typeWidget->addItem(tr("Forged"), TransactionFilterProxy::TYPE(TransactionRecord::Generated));
typeWidget->addItem(tr("Other"), TransactionFilterProxy::TYPE(TransactionRecord::Other));
hlayout->addWidget(typeWidget);
addressWidget = new QLineEdit(this);
#if QT_VERSION >= 0x040700
/* Do not move this to the XML file, Qt before 4.7 will choke on it */
addressWidget->setPlaceholderText(tr("Enter address or label to search"));
#endif
hlayout->addWidget(addressWidget);
amountWidget = new QLineEdit(this);
#if QT_VERSION >= 0x040700
/* Do not move this to the XML file, Qt before 4.7 will choke on it */
amountWidget->setPlaceholderText(tr("Min amount"));
#endif
#ifdef Q_OS_MAC
amountWidget->setFixedWidth(97);
#else
amountWidget->setFixedWidth(100);
#endif
amountWidget->setValidator(new QDoubleValidator(0, 1e20, 8, this));
hlayout->addWidget(amountWidget);
QVBoxLayout *vlayout = new QVBoxLayout(this);
vlayout->setContentsMargins(0,0,0,0);
vlayout->setSpacing(0);
QTableView *view = new QTableView(this);
vlayout->addLayout(hlayout);
vlayout->addWidget(createDateRangeWidget());
vlayout->addWidget(view);
vlayout->setSpacing(0);
int width = view->verticalScrollBar()->sizeHint().width();
// Cover scroll bar width with spacing
#ifdef Q_OS_MAC
hlayout->addSpacing(width+2);
#else
hlayout->addSpacing(width);
#endif
// Always show scroll bar
view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
view->setTabKeyNavigation(false);
view->setContextMenuPolicy(Qt::CustomContextMenu);
transactionView = view;
// Actions
QAction *copyAddressAction = new QAction(tr("Copy address"), this);
QAction *copyLabelAction = new QAction(tr("Copy label"), this);
QAction *copyAmountAction = new QAction(tr("Copy amount"), this);
QAction *copyTxIDAction = new QAction(tr("Copy transaction ID"), this);
QAction *editLabelAction = new QAction(tr("Edit label"), this);
QAction *showDetailsAction = new QAction(tr("Show transaction details"), this);
contextMenu = new QMenu();
contextMenu->addAction(copyAddressAction);
contextMenu->addAction(copyLabelAction);
contextMenu->addAction(copyAmountAction);
contextMenu->addAction(copyTxIDAction);
contextMenu->addAction(editLabelAction);
contextMenu->addAction(showDetailsAction);
// Connect actions
connect(dateWidget, SIGNAL(activated(int)), this, SLOT(chooseDate(int)));
connect(typeWidget, SIGNAL(activated(int)), this, SLOT(chooseType(int)));
connect(addressWidget, SIGNAL(textChanged(QString)), this, SLOT(changedPrefix(QString)));
connect(amountWidget, SIGNAL(textChanged(QString)), this, SLOT(changedAmount(QString)));
connect(view, SIGNAL(doubleClicked(QModelIndex)), this, SIGNAL(doubleClicked(QModelIndex)));
connect(view, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextualMenu(QPoint)));
connect(copyAddressAction, SIGNAL(triggered()), this, SLOT(copyAddress()));
connect(copyLabelAction, SIGNAL(triggered()), this, SLOT(copyLabel()));
connect(copyAmountAction, SIGNAL(triggered()), this, SLOT(copyAmount()));
connect(copyTxIDAction, SIGNAL(triggered()), this, SLOT(copyTxID()));
connect(editLabelAction, SIGNAL(triggered()), this, SLOT(editLabel()));
connect(showDetailsAction, SIGNAL(triggered()), this, SLOT(showDetails()));
}
void TransactionView::setModel(WalletModel *model)
{
this->model = model;
if(model)
{
transactionProxyModel = new TransactionFilterProxy(this);
transactionProxyModel->setSourceModel(model->getTransactionTableModel());
transactionProxyModel->setDynamicSortFilter(true);
transactionProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
transactionProxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
transactionProxyModel->setSortRole(Qt::EditRole);
transactionView->setModel(transactionProxyModel);
transactionView->setAlternatingRowColors(true);
transactionView->setSelectionBehavior(QAbstractItemView::SelectRows);
transactionView->setSelectionMode(QAbstractItemView::ExtendedSelection);
transactionView->setSortingEnabled(true);
transactionView->sortByColumn(TransactionTableModel::Date, Qt::DescendingOrder);
transactionView->verticalHeader()->hide();
transactionView->horizontalHeader()->resizeSection(
TransactionTableModel::Status, 23);
transactionView->horizontalHeader()->resizeSection(
TransactionTableModel::Date, 120);
transactionView->horizontalHeader()->resizeSection(
TransactionTableModel::Type, 120);
transactionView->horizontalHeader()->setResizeMode(
TransactionTableModel::ToAddress, QHeaderView::Stretch);
transactionView->horizontalHeader()->resizeSection(
TransactionTableModel::Amount, 100);
}
}
void TransactionView::chooseDate(int idx)
{
if(!transactionProxyModel)
return;
QDate current = QDate::currentDate();
dateRangeWidget->setVisible(false);
switch(dateWidget->itemData(idx).toInt())
{
case All:
transactionProxyModel->setDateRange(
TransactionFilterProxy::MIN_DATE,
TransactionFilterProxy::MAX_DATE);
break;
case Today:
transactionProxyModel->setDateRange(
QDateTime(current),
TransactionFilterProxy::MAX_DATE);
break;
case ThisWeek: {
// Find last Monday
QDate startOfWeek = current.addDays(-(current.dayOfWeek()-1));
transactionProxyModel->setDateRange(
QDateTime(startOfWeek),
TransactionFilterProxy::MAX_DATE);
} break;
case ThisMonth:
transactionProxyModel->setDateRange(
QDateTime(QDate(current.year(), current.month(), 1)),
TransactionFilterProxy::MAX_DATE);
break;
case LastMonth:
transactionProxyModel->setDateRange(
QDateTime(QDate(current.year(), current.month()-1, 1)),
QDateTime(QDate(current.year(), current.month(), 1)));
break;
case ThisYear:
transactionProxyModel->setDateRange(
QDateTime(QDate(current.year(), 1, 1)),
TransactionFilterProxy::MAX_DATE);
break;
case Range:
dateRangeWidget->setVisible(true);
dateRangeChanged();
break;
}
}
void TransactionView::chooseType(int idx)
{
if(!transactionProxyModel)
return;
transactionProxyModel->setTypeFilter(
typeWidget->itemData(idx).toInt());
}
void TransactionView::changedPrefix(const QString &prefix)
{
if(!transactionProxyModel)
return;
transactionProxyModel->setAddressPrefix(prefix);
}
void TransactionView::changedAmount(const QString &amount)
{
if(!transactionProxyModel)
return;
qint64 amount_parsed = 0;
if(BitcoinUnits::parse(model->getOptionsModel()->getDisplayUnit(), amount, &amount_parsed))
{
transactionProxyModel->setMinAmount(amount_parsed);
}
else
{
transactionProxyModel->setMinAmount(0);
}
}
void TransactionView::exportClicked()
{
// CSV is currently the only supported format
QString filename = GUIUtil::getSaveFileName(
this,
tr("Export Transaction Data"), QString(),
tr("Comma separated file (*.csv)"));
if (filename.isNull()) return;
CSVModelWriter writer(filename);
// name, column, role
writer.setModel(transactionProxyModel);
writer.addColumn(tr("Confirmed"), 0, TransactionTableModel::ConfirmedRole);
writer.addColumn(tr("Date"), 0, TransactionTableModel::DateRole);
writer.addColumn(tr("Type"), TransactionTableModel::Type, Qt::EditRole);
writer.addColumn(tr("Label"), 0, TransactionTableModel::LabelRole);
writer.addColumn(tr("Address"), 0, TransactionTableModel::AddressRole);
writer.addColumn(tr("Amount"), 0, TransactionTableModel::FormattedAmountRole);
writer.addColumn(tr("ID"), 0, TransactionTableModel::TxIDRole);
if(!writer.write())
{
QMessageBox::critical(this, tr("Error exporting"), tr("Could not write to file %1.").arg(filename),
QMessageBox::Abort, QMessageBox::Abort);
}
}
void TransactionView::contextualMenu(const QPoint &point)
{
QModelIndex index = transactionView->indexAt(point);
if(index.isValid())
{
contextMenu->exec(QCursor::pos());
}
}
void TransactionView::copyAddress()
{
GUIUtil::copyEntryData(transactionView, 0, TransactionTableModel::AddressRole);
}
void TransactionView::copyLabel()
{
GUIUtil::copyEntryData(transactionView, 0, TransactionTableModel::LabelRole);
}
void TransactionView::copyAmount()
{
GUIUtil::copyEntryData(transactionView, 0, TransactionTableModel::FormattedAmountRole);
}
void TransactionView::copyTxID()
{
GUIUtil::copyEntryData(transactionView, 0, TransactionTableModel::TxIDRole);
}
void TransactionView::editLabel()
{
if(!transactionView->selectionModel() ||!model)
return;
QModelIndexList selection = transactionView->selectionModel()->selectedRows();
if(!selection.isEmpty())
{
AddressTableModel *addressBook = model->getAddressTableModel();
if(!addressBook)
return;
QString address = selection.at(0).data(TransactionTableModel::AddressRole).toString();
if(address.isEmpty())
{
// If this transaction has no associated address, exit
return;
}
// Is address in address book? Address book can miss address when a transaction is
// sent from outside the UI.
int idx = addressBook->lookupAddress(address);
if(idx != -1)
{
// Edit sending / receiving address
QModelIndex modelIdx = addressBook->index(idx, 0, QModelIndex());
// Determine type of address, launch appropriate editor dialog type
QString type = modelIdx.data(AddressTableModel::TypeRole).toString();
EditAddressDialog dlg(type==AddressTableModel::Receive
? EditAddressDialog::EditReceivingAddress
: EditAddressDialog::EditSendingAddress,
this);
dlg.setModel(addressBook);
dlg.loadRow(idx);
dlg.exec();
}
else
{
// Add sending address
EditAddressDialog dlg(EditAddressDialog::NewSendingAddress,
this);
dlg.setModel(addressBook);
dlg.setAddress(address);
dlg.exec();
}
}
}
void TransactionView::showDetails()
{
if(!transactionView->selectionModel())
return;
QModelIndexList selection = transactionView->selectionModel()->selectedRows();
if(!selection.isEmpty())
{
TransactionDescDialog dlg(selection.at(0));
dlg.exec();
}
}
QWidget *TransactionView::createDateRangeWidget()
{
dateRangeWidget = new QFrame();
dateRangeWidget->setFrameStyle(QFrame::Panel | QFrame::Raised);
dateRangeWidget->setContentsMargins(1,1,1,1);
QHBoxLayout *layout = new QHBoxLayout(dateRangeWidget);
layout->setContentsMargins(0,0,0,0);
layout->addSpacing(23);
layout->addWidget(new QLabel(tr("Range:")));
dateFrom = new QDateTimeEdit(this);
dateFrom->setDisplayFormat("dd/MM/yy");
dateFrom->setCalendarPopup(true);
dateFrom->setMinimumWidth(100);
dateFrom->setDate(QDate::currentDate().addDays(-7));
layout->addWidget(dateFrom);
layout->addWidget(new QLabel(tr("to")));
dateTo = new QDateTimeEdit(this);
dateTo->setDisplayFormat("dd/MM/yy");
dateTo->setCalendarPopup(true);
dateTo->setMinimumWidth(100);
dateTo->setDate(QDate::currentDate());
layout->addWidget(dateTo);
layout->addStretch();
// Hide by default
dateRangeWidget->setVisible(false);
// Notify on change
connect(dateFrom, SIGNAL(dateChanged(QDate)), this, SLOT(dateRangeChanged()));
connect(dateTo, SIGNAL(dateChanged(QDate)), this, SLOT(dateRangeChanged()));
return dateRangeWidget;
}
void TransactionView::dateRangeChanged()
{
if(!transactionProxyModel)
return;
transactionProxyModel->setDateRange(
QDateTime(dateFrom->date()),
QDateTime(dateTo->date()).addDays(1));
}
void TransactionView::focusTransaction(const QModelIndex &idx)
{
if(!transactionProxyModel)
return;
QModelIndex targetIdx = transactionProxyModel->mapFromSource(idx);
transactionView->scrollTo(targetIdx);
transactionView->setCurrentIndex(targetIdx);
transactionView->setFocus();
}
|
techcoincommunity/firecoin
|
src/qt/transactionview.cpp
|
C++
|
mit
| 15,306
|
<?php
/**
* User: Dre
* Date: 27-1-2016
* Time: 11:55
*/
namespace CF\DataStruct\Join;
abstract class DataStructJoin {
const TYPE_OBJECT = 'object';
const TYPE_EXTENSION = 'extension';
const ORDER_ONE_TO_MANY = 'oneToMany';
const ORDER_ONE_TO_ONE = 'oneToOne';
const STRUCTURE_INNER = 'inner';
const STRUCTURE_LEFT = 'left';
const ONE = 'one';
const MANY = 'many';
/**
* @var array(<localFieldName> => <foreignFieldName>, ...)
*/
protected $foreignKey;
/**
* @var string You can assign an identifier to a join, so you can retreive it with DataStructManager::getJoinByIdentifier
*/
protected $identifier;
/**
* Geeft terug of de join uit aparte objecten bestaat (object), of dat deze in velden in de datastruct zitten(extension)
* @return string <object/extension>
*/
abstract public function getJoinType();
/**
* Geeft terug of de join een 1-1 of 1-n is
* @return DataStructJoin::ORDER...
*/
abstract public function getJoinOrder();
public function setForeignKey(array $keys) {
$this->foreignKey = $keys;
return $this;
}
/**
* Geeft de foreign keys terug
* @return array(<localFieldName> => <foreignFieldName>, ...)
*/
public function getForeignKey() {
return $this->foreignKey;
}
public function getJoinStructure() {
return DataStructJoin::STRUCTURE_INNER;
}
/**
* @return string
*/
public function getIdentifier() {
return $this->identifier;
}
/**
* @param string $identifier
* @return DataStructJoin
*/
public function setIdentifier($identifier) {
$this->identifier = $identifier;
return $this;
}
}
|
ConscriboOS/CF
|
src/DataStruct/Join/DataStructJoin.php
|
PHP
|
mit
| 1,690
|
/*
Written by John MacCallum, The Center for New Music and Audio Technologies,
University of California, Berkeley. Copyright (c) 2009, The Regents of
the University of California (Regents).
Permission to use, copy, modify, distribute, and distribute modified versions
of this software and its documentation without fee and without a signed
licensing agreement, is hereby granted, provided that the above copyright
notice, this paragraph and the following two paragraphs appear in all copies,
modifications, and distributions.
IN NO EVENT SHALL REGENTS 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 REGENTS HAS
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*/
#include <osc/OscPatternMatching.h>
#include <string.h>
/**
* Switch this off to disable matching against a pattern with 2 stars
*/
//#define OSC_MATCH_ENABLE_2STARS 1
/**
* Switch this off to disable matching against a pattern with more than 2 stars which will
* be done recursively.
*/
//#define OSC_MATCH_ENABLE_NSTARS 1
static int osc_match_star(const char *pattern, const char *address);
#if (OSC_MATCH_ENABLE_NSTARS == 1)
static int osc_match_star_r(const char *pattern, const char *address);
#endif
static int osc_match_single_char(const char *pattern, const char *address);
static int osc_match_bracket(const char *pattern, const char *address);
static int osc_match_curly_brace(const char *pattern, const char *address);
int OSCPatternMatching::osc_match(const char *pattern, const char *address, int *pattern_offset, int *address_offset)
{
if(!strcmp(pattern, address))
{
*pattern_offset = (int)strlen(pattern);
*address_offset = (int)strlen(address);
return OSC_MATCH_ADDRESS_COMPLETE | OSC_MATCH_PATTERN_COMPLETE;
}
const char *pattern_start;
const char *address_start;
pattern_start = pattern;
address_start = address;
*pattern_offset = 0;
*address_offset = 0;
while(*address != '\0' && *pattern != '\0')
{
if(*pattern == '*')
{
if(!osc_match_star(pattern, address))
{
return 0;
}
while(*pattern != '/' && *pattern != '\0')
{
pattern++;
}
while(*address != '/' && *address != '\0')
{
address++;
}
}
else if(*address == '*')
{
while(*pattern != '/' && *pattern != '\0')
{
pattern++;
}
while(*address != '/' && *address != '\0')
{
address++;
}
}
else
{
int n = 0;
if(!(n = osc_match_single_char(pattern, address)))
{
return 0;
}
if(*pattern == '[')
{
while(*pattern != ']')
{
pattern++;
}
pattern++;
address++;
}
else if(*pattern == '{')
{
while(*pattern != '}')
{
pattern++;
}
pattern++;
address += n;
}
else
{
pattern++;
address++;
}
}
}
*pattern_offset = pattern - pattern_start;
*address_offset = address - address_start;
int r = 0;
if(*address == '\0')
{
r |= OSC_MATCH_ADDRESS_COMPLETE;
}
if(*pattern == '\0')
{
r |= OSC_MATCH_PATTERN_COMPLETE;
}
return r;
}
static int osc_match_star(const char *pattern, const char *address)
{
#if (OSC_MATCH_ENABLE_2STARS == 1)
const char *address_start = address;
const char *pattern_start = pattern;
#endif
int num_stars = 0;
if(*address == '\0')
{
return 0;
}
while(*address != '/' && *address != '\0')
{
address++;
}
while(*pattern != '/' && *pattern != '\0')
{
if(*pattern == '*')
{
num_stars++;
}
pattern++;
}
pattern--;
address--;
switch(num_stars)
{
case 1:
{
const char *pp = pattern, *aa = address;
while(*pp != '*')
{
if(!(osc_match_single_char(pp, aa)))
{
return 0;
}
if(*pp == ']' || *pp == '}'){
while(*pp != '[' && *pp != '{')
{
pp--;
}
}
pp--;
aa--;
}
}
break;
case 2:
#if (OSC_MATCH_ENABLE_2STARS == 1)
{
const char *pp = pattern, *aa = address;
while(*pp != '*')
{
if(!(osc_match_single_char(pp, aa)))
{
return 0;
}
if(*pp == ']' || *pp == '}')
{
while(*pp != '[' && *pp != '{')
{
pp--;
}
}
pp--;
aa--;
}
aa++; // we want to start one character forward to allow the star to match nothing
const char *star2 = pp;
const char *test = aa;
int i = 0;
while(test > address_start)
{
pp = star2 - 1;
aa = test - 1;
i++;
while(*pp != '*')
{
if(!osc_match_single_char(pp, aa))
{
break;
}
if(*pp == ']' || *pp == '}')
{
while(*pp != '[' && *pp != '{')
{
pp--;
}
}
pp--;
aa--;
}
if(pp == pattern_start)
{
return 1;
}
test--;
}
return 0;
}
break;
#else
return 0;
#endif
default:
#if (OSC_MATCH_ENABLE_NSTARS == 1)
return osc_match_star_r(pattern_start, address_start);
break;
#else
return 0;
#endif
}
return 1;
}
#if (OSC_MATCH_ENABLE_NSTARS == 1)
static int osc_match_star_r(const char *pattern, const char *address)
{
if(*address == '/' || *address == '\0')
{
if(*pattern == '/' || *pattern == '\0' || (*pattern == '*' && ((*(pattern + 1) == '/') || *(pattern + 1) == '\0')))
{
return 1;
}
else
{
return 0;
}
}
if(*pattern == '*')
{
if(osc_match_star_r(pattern + 1, address))
{
return 1;
}
else
{
return osc_match_star_r(pattern, address + 1);
}
}
else
{
if(!osc_match_single_char(pattern, address))
{
return 0;
}
if(*pattern == '[' || *pattern == '{')
{
while(*pattern != ']' && *pattern != '}')
{
pattern++;
}
}
return osc_match_star_r(pattern + 1, address + 1);
}
}
#endif
static int osc_match_single_char(const char *pattern, const char *address)
{
switch(*pattern)
{
case '[':
return osc_match_bracket(pattern, address);
case ']':
while(*pattern != '[')
{
pattern--;
}
return osc_match_bracket(pattern, address);
case '{':
return osc_match_curly_brace(pattern, address);
case '}':
while(*pattern != '{')
{
pattern--;
}
return osc_match_curly_brace(pattern, address);
case '?':
return 1;
default:
if(*pattern == *address)
{
return 1;
}
else
{
return 0;
}
}
return 0;
}
static int osc_match_bracket(const char *pattern, const char *address)
{
pattern++;
int val = 1;
if(*pattern == '!')
{
pattern++;
val = 0;
}
int matched = !val;
while(*pattern != ']' && *pattern != '\0')
{
// the character we're on now is the beginning of a range
if(*(pattern + 1) == '-')
{
if(*address >= *pattern && *address <= *(pattern + 2))
{
matched = val;
break;
}
else
{
pattern += 3;
}
}
else
{
// just test the character
if(*pattern == *address)
{
matched = val;
break;
}
pattern++;
}
}
return matched;
}
int osc_match_curly_brace(const char *pattern, const char *address)
{
pattern++;
const char *ptr = pattern;
while(*ptr != '}' && *ptr != '\0' && *ptr != '/')
{
while(*ptr != '}' && *ptr != '\0' && *ptr != '/' && *ptr != ',')
{
ptr++;
}
int n = ptr - pattern;
if(!strncmp(pattern, address, n))
{
return n;
}
else
{
ptr++;
pattern = ptr;
}
}
return 0;
}
|
MugenSAS/osc-cpp-qt
|
osc/OscPatternMatching.cpp
|
C++
|
mit
| 7,646
|
<?php
namespace SportChecked\ContactBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* This is the class that validates and merges configuration from your app/config files
*
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
*/
class Configuration implements ConfigurationInterface
{
/**
* {@inheritDoc}
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('contact');
// Here you should define the parameters that are allowed to
// configure your bundle. See the documentation linked above for
// more information on that topic.
return $treeBuilder;
}
}
|
leoestela/sportchecked
|
src/SportChecked/ContactBundle/DependencyInjection/Configuration.php
|
PHP
|
mit
| 882
|
from typing import cast
from pytest import raises
from graphql import graphql_sync
from graphql.type import (
GraphQLArgument,
GraphQLBoolean,
GraphQLEnumType,
GraphQLEnumValue,
GraphQLField,
GraphQLFloat,
GraphQLID,
GraphQLInt,
GraphQLObjectType,
GraphQLSchema,
GraphQLString,
assert_enum_type,
)
from graphql.utilities import (
build_schema,
build_client_schema,
introspection_from_schema,
print_schema,
)
from graphql.utilities.get_introspection_query import (
IntrospectionEnumType,
IntrospectionInputObjectType,
IntrospectionInterfaceType,
IntrospectionObjectType,
IntrospectionType,
IntrospectionUnionType,
)
from ..utils import dedent
def cycle_introspection(sdl_string: str):
"""Test that the client side introspection gives the same result.
This function does a full cycle of going from a string with the contents of the SDL,
build in-memory GraphQLSchema from it, produce a client-side representation of the
schema by using "build_client_schema" and then return that schema printed as SDL.
"""
server_schema = build_schema(sdl_string)
initial_introspection = introspection_from_schema(server_schema)
client_schema = build_client_schema(initial_introspection)
# If the client then runs the introspection query against the client-side schema,
# it should get a result identical to what was returned by the server
second_introspection = introspection_from_schema(client_schema)
# If the client then runs the introspection query against the client-side
# schema, it should get a result identical to what was returned by the server.
assert initial_introspection == second_introspection
return print_schema(client_schema)
def describe_type_system_build_schema_from_introspection():
def builds_a_simple_schema():
sdl = dedent(
'''
"""Simple schema"""
schema {
query: Simple
}
"""This is a simple type"""
type Simple {
"""This is a string field"""
string: String
}
'''
)
assert cycle_introspection(sdl) == sdl
def builds_a_schema_without_the_query_type():
sdl = dedent(
"""
type Query {
foo: String
}
"""
)
schema = build_schema(sdl)
introspection = introspection_from_schema(schema)
del introspection["__schema"]["queryType"] # type: ignore
client_schema = build_client_schema(introspection)
assert client_schema.query_type is None
assert print_schema(client_schema) == sdl
def builds_a_simple_schema_with_all_operation_types():
sdl = dedent(
'''
schema {
query: QueryType
mutation: MutationType
subscription: SubscriptionType
}
"""This is a simple mutation type"""
type MutationType {
"""Set the string field"""
string: String
}
"""This is a simple query type"""
type QueryType {
"""This is a string field"""
string: String
}
"""This is a simple subscription type"""
type SubscriptionType {
"""This is a string field"""
string: String
}
'''
)
assert cycle_introspection(sdl) == sdl
def uses_built_in_scalars_when_possible():
sdl = dedent(
"""
scalar CustomScalar
type Query {
int: Int
float: Float
string: String
boolean: Boolean
id: ID
custom: CustomScalar
}
"""
)
assert cycle_introspection(sdl) == sdl
schema = build_schema(sdl)
introspection = introspection_from_schema(schema)
client_schema = build_client_schema(introspection)
# Built-ins are used
assert client_schema.get_type("Int") is GraphQLInt
assert client_schema.get_type("Float") is GraphQLFloat
assert client_schema.get_type("String") is GraphQLString
assert client_schema.get_type("Boolean") is GraphQLBoolean
assert client_schema.get_type("ID") is GraphQLID
# Custom are built
custom_scalar = schema.get_type("CustomScalar")
assert client_schema.get_type("CustomScalar") is not custom_scalar
def includes_standard_types_only_if_they_are_used():
schema = build_schema(
"""
type Query {
foo: String
}
"""
)
introspection = introspection_from_schema(schema)
client_schema = build_client_schema(introspection)
assert client_schema.get_type("Int") is None
assert client_schema.get_type("Float") is None
assert client_schema.get_type("ID") is None
def builds_a_schema_with_a_recursive_type_reference():
sdl = dedent(
"""
schema {
query: Recur
}
type Recur {
recur: Recur
}
"""
)
assert cycle_introspection(sdl) == sdl
def builds_a_schema_with_a_circular_type_reference():
sdl = dedent(
"""
type Dog {
bestFriend: Human
}
type Human {
bestFriend: Dog
}
type Query {
dog: Dog
human: Human
}
"""
)
assert cycle_introspection(sdl) == sdl
def builds_a_schema_with_an_interface():
sdl = dedent(
'''
type Dog implements Friendly {
bestFriend: Friendly
}
interface Friendly {
"""The best friend of this friendly thing"""
bestFriend: Friendly
}
type Human implements Friendly {
bestFriend: Friendly
}
type Query {
friendly: Friendly
}
'''
)
assert cycle_introspection(sdl) == sdl
def builds_a_schema_with_an_interface_hierarchy():
sdl = dedent(
'''
type Dog implements Friendly & Named {
bestFriend: Friendly
name: String
}
interface Friendly implements Named {
"""The best friend of this friendly thing"""
bestFriend: Friendly
name: String
}
type Human implements Friendly & Named {
bestFriend: Friendly
name: String
}
interface Named {
name: String
}
type Query {
friendly: Friendly
}
'''
)
assert cycle_introspection(sdl) == sdl
def builds_a_schema_with_an_implicit_interface():
sdl = dedent(
'''
type Dog implements Friendly {
bestFriend: Friendly
}
interface Friendly {
"""The best friend of this friendly thing"""
bestFriend: Friendly
}
type Query {
dog: Dog
}
'''
)
assert cycle_introspection(sdl) == sdl
def builds_a_schema_with_a_union():
sdl = dedent(
"""
type Dog {
bestFriend: Friendly
}
union Friendly = Dog | Human
type Human {
bestFriend: Friendly
}
type Query {
friendly: Friendly
}
"""
)
assert cycle_introspection(sdl) == sdl
def builds_a_schema_with_complex_field_values():
sdl = dedent(
"""
type Query {
string: String
listOfString: [String]
nonNullString: String!
nonNullListOfString: [String]!
nonNullListOfNonNullString: [String!]!
}
"""
)
assert cycle_introspection(sdl) == sdl
def builds_a_schema_with_field_arguments():
sdl = dedent(
'''
type Query {
"""A field with a single arg"""
one(
"""This is an int arg"""
intArg: Int
): String
"""A field with a two args"""
two(
"""This is an list of int arg"""
listArg: [Int]
"""This is a required arg"""
requiredArg: Boolean!
): String
}
'''
)
assert cycle_introspection(sdl) == sdl
def builds_a_schema_with_default_value_on_custom_scalar_field():
sdl = dedent(
"""
scalar CustomScalar
type Query {
testField(testArg: CustomScalar = "default"): String
}
"""
)
assert cycle_introspection(sdl) == sdl
def builds_a_schema_with_an_enum():
food_enum = GraphQLEnumType(
"Food",
{
"VEGETABLES": GraphQLEnumValue(
1, description="Foods that are vegetables."
),
"FRUITS": GraphQLEnumValue(2),
"OILS": GraphQLEnumValue(3, deprecation_reason="Too fatty."),
},
description="Varieties of food stuffs",
)
schema = GraphQLSchema(
GraphQLObjectType(
"EnumFields",
{
"food": GraphQLField(
food_enum,
args={
"kind": GraphQLArgument(
food_enum, description="what kind of food?"
)
},
description="Repeats the arg you give it",
)
},
)
)
introspection = introspection_from_schema(schema)
client_schema = build_client_schema(introspection)
second_introspection = introspection_from_schema(client_schema)
assert second_introspection == introspection
# It's also an Enum type on the client.
client_food_enum = assert_enum_type(client_schema.get_type("Food"))
# Client types do not get server-only values, so the values mirror the names,
# rather than using the integers defined in the "server" schema.
values = {
name: value.to_kwargs() for name, value in client_food_enum.values.items()
}
assert values == {
"VEGETABLES": {
"value": "VEGETABLES",
"description": "Foods that are vegetables.",
"deprecation_reason": None,
"extensions": {},
"ast_node": None,
},
"FRUITS": {
"value": "FRUITS",
"description": None,
"deprecation_reason": None,
"extensions": {},
"ast_node": None,
},
"OILS": {
"value": "OILS",
"description": None,
"deprecation_reason": "Too fatty.",
"extensions": {},
"ast_node": None,
},
}
def builds_a_schema_with_an_input_object():
sdl = dedent(
'''
"""An input address"""
input Address {
"""What street is this address?"""
street: String!
"""The city the address is within?"""
city: String!
"""The country (blank will assume USA)."""
country: String = "USA"
}
type Query {
"""Get a geocode from an address"""
geocode(
"""The address to lookup"""
address: Address
): String
}
'''
)
assert cycle_introspection(sdl) == sdl
def builds_a_schema_with_field_arguments_with_default_values():
sdl = dedent(
"""
input Geo {
lat: Float
lon: Float
}
type Query {
defaultInt(intArg: Int = 30): String
defaultList(listArg: [Int] = [1, 2, 3]): String
defaultObject(objArg: Geo = {lat: 37.485, lon: -122.148}): String
defaultNull(intArg: Int = null): String
noDefault(intArg: Int): String
}
"""
)
assert cycle_introspection(sdl) == sdl
def builds_a_schema_with_custom_directives():
sdl = dedent(
'''
"""This is a custom directive"""
directive @customDirective repeatable on FIELD
type Query {
string: String
}
'''
)
assert cycle_introspection(sdl) == sdl
def builds_a_schema_without_directives():
sdl = dedent(
"""
type Query {
foo: String
}
"""
)
schema = build_schema(sdl)
introspection = introspection_from_schema(schema)
del introspection["__schema"]["directives"] # type: ignore
client_schema = build_client_schema(introspection)
assert schema.directives
assert client_schema.directives == ()
assert print_schema(client_schema) == sdl
def builds_a_schema_aware_of_deprecation():
sdl = dedent(
'''
directive @someDirective(
"""This is a shiny new argument"""
shinyArg: SomeInputObject
"""This was our design mistake :("""
oldArg: String @deprecated(reason: "Use shinyArg")
) on QUERY
enum Color {
"""So rosy"""
RED
"""So grassy"""
GREEN
"""So calming"""
BLUE
"""So sickening"""
MAUVE @deprecated(reason: "No longer in fashion")
}
input SomeInputObject {
"""Nothing special about it, just deprecated for some unknown reason"""
oldField: String @deprecated(reason: "Don't use it, use newField instead!")
"""Same field but with a new name"""
newField: String
}
type Query {
"""This is a shiny string field"""
shinyString: String
"""This is a deprecated string field"""
deprecatedString: String @deprecated(reason: "Use shinyString")
"""Color of a week"""
color: Color
"""Some random field"""
someField(
"""This is a shiny new argument"""
shinyArg: SomeInputObject
"""This was our design mistake :("""
oldArg: String @deprecated(reason: "Use shinyArg")
): String
}
''' # noqa: E501
)
assert cycle_introspection(sdl) == sdl
def builds_a_schema_with_empty_deprecation_reasons():
sdl = dedent(
"""
directive @someDirective(someArg: SomeInputObject @deprecated(reason: "")) on QUERY
type Query {
someField(someArg: SomeInputObject @deprecated(reason: "")): SomeEnum @deprecated(reason: "")
}
input SomeInputObject {
someInputField: String @deprecated(reason: "")
}
enum SomeEnum {
SOME_VALUE @deprecated(reason: "")
}
""" # noqa: E501
)
assert cycle_introspection(sdl) == sdl
def builds_a_schema_with_specified_by_url():
sdl = dedent(
"""
scalar Foo @specifiedBy(url: "https://example.com/foo_spec")
type Query {
foo: Foo
}
"""
)
assert cycle_introspection(sdl) == sdl
def can_use_client_schema_for_limited_execution():
schema = build_schema(
"""
scalar CustomScalar
type Query {
foo(custom1: CustomScalar, custom2: CustomScalar): String
}
"""
)
introspection = introspection_from_schema(schema)
client_schema = build_client_schema(introspection)
class Data:
foo = "bar"
unused = "value"
result = graphql_sync(
client_schema,
"query Limited($v: CustomScalar) { foo(custom1: 123, custom2: $v) }",
root_value=Data(),
variable_values={"v": "baz"},
)
assert result.data == {"foo": "bar"}
def can_build_invalid_schema():
schema = build_schema("type Query", assume_valid=True)
introspection = introspection_from_schema(schema)
client_schema = build_client_schema(introspection, assume_valid=True)
assert client_schema.to_kwargs()["assume_valid"] is True
def describe_throws_when_given_invalid_introspection():
dummy_schema = build_schema(
"""
type Query {
foo(bar: String): String
}
interface SomeInterface {
foo: String
}
union SomeUnion = Query
enum SomeEnum { FOO }
input SomeInputObject {
foo: String
}
directive @SomeDirective on QUERY
"""
)
def throws_when_introspection_is_missing_schema_property():
with raises(TypeError) as exc_info:
# noinspection PyTypeChecker
build_client_schema(None) # type: ignore
assert str(exc_info.value) == (
"Invalid or incomplete introspection result. Ensure that you"
" are passing the 'data' attribute of an introspection response"
" and no 'errors' were returned alongside: None."
)
with raises(TypeError) as exc_info:
# noinspection PyTypeChecker
build_client_schema({}) # type: ignore
assert str(exc_info.value) == (
"Invalid or incomplete introspection result. Ensure that you"
" are passing the 'data' attribute of an introspection response"
" and no 'errors' were returned alongside: {}."
)
def throws_when_referenced_unknown_type():
introspection = introspection_from_schema(dummy_schema)
introspection["__schema"]["types"] = [
type_
for type_ in introspection["__schema"]["types"]
if type_["name"] != "Query"
]
with raises(TypeError) as exc_info:
build_client_schema(introspection)
assert str(exc_info.value) == (
"Invalid or incomplete schema, unknown type: Query."
" Ensure that a full introspection query is used"
" in order to build a client schema."
)
def throws_when_missing_definition_for_one_of_the_standard_scalars():
schema = build_schema(
"""
type Query {
foo: Float
}
"""
)
introspection = introspection_from_schema(schema)
introspection["__schema"]["types"] = [
type_
for type_ in introspection["__schema"]["types"]
if type_["name"] != "Float"
]
with raises(TypeError) as exc_info:
build_client_schema(introspection)
assert str(exc_info.value).endswith(
"Invalid or incomplete schema, unknown type: Float."
" Ensure that a full introspection query is used"
" in order to build a client schema."
)
def throws_when_type_reference_is_missing_name():
introspection = introspection_from_schema(dummy_schema)
query_type = cast(IntrospectionType, introspection["__schema"]["queryType"])
assert query_type["name"] == "Query"
del query_type["name"] # type: ignore
with raises(TypeError) as exc_info:
build_client_schema(introspection)
assert str(exc_info.value) == "Unknown type reference: {}."
def throws_when_missing_kind():
introspection = introspection_from_schema(dummy_schema)
query_type_introspection = next(
type_
for type_ in introspection["__schema"]["types"]
if type_["name"] == "Query"
)
assert query_type_introspection["kind"] == "OBJECT"
del query_type_introspection["kind"]
with raises(
TypeError,
match=r"^Invalid or incomplete introspection result\."
" Ensure that a full introspection query is used"
r" in order to build a client schema: {'name': 'Query', .*}\.$",
):
build_client_schema(introspection)
def throws_when_missing_interfaces():
introspection = introspection_from_schema(dummy_schema)
query_type_introspection = cast(
IntrospectionObjectType,
next(
type_
for type_ in introspection["__schema"]["types"]
if type_["name"] == "Query"
),
)
assert query_type_introspection["interfaces"] == []
del query_type_introspection["interfaces"] # type: ignore
with raises(
TypeError,
match="^Query interfaces cannot be resolved."
" Introspection result missing interfaces:"
r" {'kind': 'OBJECT', 'name': 'Query', .*}\.$",
):
build_client_schema(introspection)
def legacy_support_for_interfaces_with_null_as_interfaces_field():
introspection = introspection_from_schema(dummy_schema)
some_interface_introspection = cast(
IntrospectionInterfaceType,
next(
type_
for type_ in introspection["__schema"]["types"]
if type_["name"] == "SomeInterface"
),
)
assert some_interface_introspection["interfaces"] == []
some_interface_introspection["interfaces"] = None # type: ignore
client_schema = build_client_schema(introspection)
assert print_schema(client_schema) == print_schema(dummy_schema)
def throws_when_missing_fields():
introspection = introspection_from_schema(dummy_schema)
query_type_introspection = cast(
IntrospectionObjectType,
next(
type_
for type_ in introspection["__schema"]["types"]
if type_["name"] == "Query"
),
)
assert query_type_introspection["fields"]
del query_type_introspection["fields"] # type: ignore
with raises(
TypeError,
match="^Query fields cannot be resolved."
" Introspection result missing fields:"
r" {'kind': 'OBJECT', 'name': 'Query', .*}\.$",
):
build_client_schema(introspection)
def throws_when_missing_field_args():
introspection = introspection_from_schema(dummy_schema)
query_type_introspection = cast(
IntrospectionObjectType,
next(
type_
for type_ in introspection["__schema"]["types"]
if type_["name"] == "Query"
),
)
field = query_type_introspection["fields"][0]
assert field["args"]
del field["args"] # type: ignore
with raises(
TypeError,
match="^Query fields cannot be resolved."
r" Introspection result missing field args: {'name': 'foo', .*}\.$",
):
build_client_schema(introspection)
def throws_when_output_type_is_used_as_an_arg_type():
introspection = introspection_from_schema(dummy_schema)
query_type_introspection = cast(
IntrospectionObjectType,
next(
type_
for type_ in introspection["__schema"]["types"]
if type_["name"] == "Query"
),
)
arg = query_type_introspection["fields"][0]["args"][0]
assert arg["type"]["name"] == "String"
arg["type"]["name"] = "SomeUnion"
with raises(TypeError) as exc_info:
build_client_schema(introspection)
assert str(exc_info.value).startswith(
"Query fields cannot be resolved."
" Introspection must provide input type for arguments,"
" but received: SomeUnion."
)
def throws_when_output_type_is_used_as_an_input_value_type():
introspection = introspection_from_schema(dummy_schema)
input_object_type_introspection = cast(
IntrospectionInputObjectType,
next(
type_
for type_ in introspection["__schema"]["types"]
if type_["name"] == "SomeInputObject"
),
)
input_field = input_object_type_introspection["inputFields"][0]
assert input_field["type"]["name"] == "String"
input_field["type"]["name"] = "SomeUnion"
with raises(TypeError) as exc_info:
build_client_schema(introspection)
assert str(exc_info.value).startswith(
"SomeInputObject fields cannot be resolved."
" Introspection must provide input type for input fields,"
" but received: SomeUnion."
)
def throws_when_input_type_is_used_as_a_field_type():
introspection = introspection_from_schema(dummy_schema)
query_type_introspection = cast(
IntrospectionObjectType,
next(
type_
for type_ in introspection["__schema"]["types"]
if type_["name"] == "Query"
),
)
field = query_type_introspection["fields"][0]
assert field["type"]["name"] == "String"
field["type"]["name"] = "SomeInputObject"
with raises(TypeError) as exc_info:
build_client_schema(introspection)
assert str(exc_info.value).startswith(
"Query fields cannot be resolved."
" Introspection must provide output type for fields,"
" but received: SomeInputObject."
)
def throws_when_missing_possible_types():
introspection = introspection_from_schema(dummy_schema)
some_union_introspection = cast(
IntrospectionUnionType,
next(
type_
for type_ in introspection["__schema"]["types"]
if type_["name"] == "SomeUnion"
),
)
assert some_union_introspection["possibleTypes"]
del some_union_introspection["possibleTypes"] # type: ignore
with raises(
TypeError,
match="^Introspection result missing possibleTypes:"
r" {'kind': 'UNION', 'name': 'SomeUnion', .*}\.$",
):
build_client_schema(introspection)
def throws_when_missing_enum_values():
introspection = introspection_from_schema(dummy_schema)
some_enum_introspection = cast(
IntrospectionEnumType,
next(
type_
for type_ in introspection["__schema"]["types"]
if type_["name"] == "SomeEnum"
),
)
assert some_enum_introspection["enumValues"]
del some_enum_introspection["enumValues"] # type: ignore
with raises(
TypeError,
match="^Introspection result missing enumValues:"
r" {'kind': 'ENUM', 'name': 'SomeEnum', .*}\.$",
):
build_client_schema(introspection)
def throws_when_missing_input_fields():
introspection = introspection_from_schema(dummy_schema)
some_input_object_introspection = cast(
IntrospectionInputObjectType,
next(
type_
for type_ in introspection["__schema"]["types"]
if type_["name"] == "SomeInputObject"
),
)
assert some_input_object_introspection["inputFields"]
del some_input_object_introspection["inputFields"] # type: ignore
with raises(
TypeError,
match="^Introspection result missing inputFields:"
r" {'kind': 'INPUT_OBJECT', 'name': 'SomeInputObject', .*}\.$",
):
build_client_schema(introspection)
def throws_when_missing_directive_locations():
introspection = introspection_from_schema(dummy_schema)
some_directive_introspection = introspection["__schema"]["directives"][0]
assert some_directive_introspection["name"] == "SomeDirective"
assert some_directive_introspection["locations"] == ["QUERY"]
del some_directive_introspection["locations"] # type: ignore
with raises(
TypeError,
match="^Introspection result missing directive locations:"
r" {'name': 'SomeDirective', .*}\.$",
):
build_client_schema(introspection)
def throws_when_missing_directive_args():
introspection = introspection_from_schema(dummy_schema)
some_directive_introspection = introspection["__schema"]["directives"][0]
assert some_directive_introspection["name"] == "SomeDirective"
assert some_directive_introspection["args"] == []
del some_directive_introspection["args"] # type: ignore
with raises(
TypeError,
match="^Introspection result missing directive args:"
r" {'name': 'SomeDirective', .*}\.$",
):
build_client_schema(introspection)
def describe_very_deep_decorators_are_not_supported():
def fails_on_very_deep_lists_more_than_7_levels():
schema = build_schema(
"""
type Query {
foo: [[[[[[[[String]]]]]]]]
}
"""
)
introspection = introspection_from_schema(schema)
with raises(TypeError) as exc_info:
build_client_schema(introspection)
assert str(exc_info.value) == (
"Query fields cannot be resolved."
" Decorated type deeper than introspection query."
)
def fails_on_a_very_deep_non_null_more_than_7_levels():
schema = build_schema(
"""
type Query {
foo: [[[[String!]!]!]!]
}
"""
)
introspection = introspection_from_schema(schema)
with raises(TypeError) as exc_info:
build_client_schema(introspection)
assert str(exc_info.value) == (
"Query fields cannot be resolved."
" Decorated type deeper than introspection query."
)
def succeeds_on_deep_types_less_or_equal_7_levels():
# e.g., fully non-null 3D matrix
sdl = dedent(
"""
type Query {
foo: [[[String!]!]!]!
}
"""
)
assert cycle_introspection(sdl) == sdl
def describe_prevents_infinite_recursion_on_invalid_introspection():
def recursive_interfaces():
sdl = """
type Query {
foo: Foo
}
type Foo {
foo: String
}
"""
schema = build_schema(sdl, assume_valid=True)
introspection = introspection_from_schema(schema)
foo_introspection = cast(
IntrospectionObjectType,
next(
type_
for type_ in introspection["__schema"]["types"]
if type_["name"] == "Foo"
),
)
assert foo_introspection["interfaces"] == []
# we need to patch here since invalid interfaces cannot be built with Python
foo_introspection["interfaces"] = [
{"kind": "OBJECT", "name": "Foo", "ofType": None}
]
with raises(TypeError) as exc_info:
build_client_schema(introspection)
assert str(exc_info.value) == (
"Foo interfaces cannot be resolved."
" Expected Foo to be a GraphQL Interface type."
)
def recursive_union():
sdl = """
type Query {
foo: Foo
}
union Foo
"""
schema = build_schema(sdl, assume_valid=True)
introspection = introspection_from_schema(schema)
foo_introspection = next(
type_
for type_ in introspection["__schema"]["types"]
if type_["name"] == "Foo"
)
assert foo_introspection["kind"] == "UNION"
assert foo_introspection["possibleTypes"] == []
# we need to patch here since invalid unions cannot be built with Python
foo_introspection["possibleTypes"] = [
{"kind": "UNION", "name": "Foo", "ofType": None}
]
with raises(TypeError) as exc_info:
build_client_schema(introspection)
assert str(exc_info.value) == (
"Foo types cannot be resolved."
" Expected Foo to be a GraphQL Object type."
)
|
graphql-python/graphql-core
|
tests/utilities/test_build_client_schema.py
|
Python
|
mit
| 35,277
|
import { withStyles } from '@material-ui/core/styles';
import cx from 'clsx';
export const SideSection = withStyles(theme => ({
aside: {
[theme.breakpoints.up('md')]: {
minWidth: 0,
flex: 1,
padding: '0 20px',
background: theme.palette.background.paper,
borderRadius: theme.shape.borderRadius,
},
},
}))(({ classes, children, className, ...props }) => {
return (
<aside className={cx(classes.aside, className)} {...props}>
{children}
</aside>
);
});
export const SideSectionHeader = withStyles(theme => ({
asideHeader: {
lineHeight: '20px',
padding: '12px 0',
fontWeight: 700,
[theme.breakpoints.up('md')]: {
padding: '20px 0 12px',
borderBottom: `1px solid ${theme.palette.secondary[500]}`,
},
},
}))(({ classes, children, className, ...props }) => {
return (
<header className={cx(classes.asideHeader, className)} {...props}>
{children}
</header>
);
});
export const SideSectionLinks = withStyles(theme => ({
asideItems: {
display: 'flex',
flexFlow: 'row',
overflowX: 'auto',
'--gutter': `${theme.spacing(2)}px`,
margin: `0 calc(-1 * var(--gutter))`,
padding: `0 var(--gutter)`,
'&::after': {
// Right-most gutter after the last item
content: '""',
flex: '0 0 var(--gutter)',
},
[theme.breakpoints.up('sm')]: {
'--gutter': `${theme.spacing(3)}px`,
},
[theme.breakpoints.up('md')]: {
'--gutter': 0,
flexFlow: 'column',
overflowX: 'visible',
'&::after': {
display: 'none',
},
},
},
}))(({ classes, children, className, ...props }) => {
return (
<div className={cx(classes.asideItems, className)} {...props}>
{children}
</div>
);
});
export const SideSectionLink = withStyles(theme => ({
asideItem: {
// override <a> defaults
textDecoration: 'none',
color: 'inherit',
cursor: 'pointer',
[theme.breakpoints.down('sm')]: {
padding: 16,
background: theme.palette.background.paper,
borderRadius: theme.shape.borderRadius,
flex: '0 0 320px',
maxWidth: '66vw',
'& + &': {
marginLeft: 12,
},
},
[theme.breakpoints.up('md')]: {
padding: '16px 0',
'& + &': {
borderTop: `1px solid ${theme.palette.secondary[100]}`,
},
},
},
}))(({ classes, children, className, ...props }) => {
return (
<a className={cx(classes.asideItem, className)} {...props}>
{children}
</a>
);
});
export const SideSectionText = withStyles(() => ({
asideText: {
display: '-webkit-box',
overflow: 'hidden',
boxOrient: 'vertical',
textOverflow: 'ellipsis',
lineClamp: 5,
},
}))(({ classes, children, className, ...props }) => {
return (
<article className={cx(classes.asideText, className)} {...props}>
{children}
</article>
);
});
|
cofacts/rumors-site
|
components/SideSection.js
|
JavaScript
|
mit
| 2,921
|
<template name="itemsList">
{{> header}}
<div class="panel panel-default">
<div class="panel-heading row">
<div class="col-md-3">
<h3 class="panel-title">{{list.name}}</h3>
</div>
<div class="col-md-1 pull-right">
<a href="/" type="button" class="btn btn-primary btn-sm">
<span class="glyphicon glyphicon-home"></span>
</a>
</div>
</div>
<div class="panel-body">
<div class="row">
<div class="col-md-7">
<div class="list-group">
{{#each list.items}}
<div class="list-group-item">
{{#with itemObject}}
<span class="glyphicon glyphicon-barcode"></span>
{{name}}: {{../quantity}}
{{/with}}
</div>
{{/each}}
</div>
</div>
<div class="col-md-4">
<div class="list-group">
{{#each items}}
<div class="list-group-item row">
<div class="col-md-6">
<span class="glyphicon glyphicon-barcode"></span>
{{name}}
</div>
<div class="btn-group btn-group-xs col-md-6">
<button type="button" class="addItem btn btn-default">
<span class="glyphicon glyphicon-plus"></span>
</button>
<button type="button" class="removeItem btn btn-default">
<span class="glyphicon glyphicon-minus"></span>
</button>
</div>
</div>
{{/each}}
</div>
</div>
</div>
</div>
</div>
</template>
|
drgorb/shopito
|
app/client/items-list.html
|
HTML
|
mit
| 2,006
|
/*********************************************************************
赤外線リモコン受信部 for Raspberry Pi
本ソースリストおよびソフトウェアは、ライセンスフリーです。
利用、編集、再配布等が自由に行えますが、著作権表示の改変は禁止します。
Copyright (c) 2009-2016 Wataru KUNINO
https://bokunimo.net/raspi/
*********************************************************************/
#include <sys/time.h>
#define IR_IN_OFF 1 // 赤外線センサ非受光時の入力値
#define IR_IN_ON 0 // 赤外線センサ受光時の入力値
#define SYNC_WAIT 2*16*470 // 待ち時間[us] (15ms) ※intの範囲
//enum IR_TYPE{AEHA=0,NEC=1,SIRC=2};// 家製協AEHA、NEC、SONY SIRC切り換え
#define AEHA 0
#define NEC 1
#define SIRC 2
#define AUTO 255 // 2016/07/16 自動モードの追加
// #define DEBUG
extern FILE *fgpio;
extern char buf[],gpio[],dir[];
struct timeval micros_time; //time_t micros_time;
int micros_prev,micros_sec=0;
int micros(){
int micros;
gettimeofday(µs_time, NULL); // time(µs_time);
micros = micros_time.tv_usec;
if(micros_prev > micros ) micros_sec++;
micros_prev = micros;
micros += micros_sec * 1000000;
return micros;
}
void micros_0(){
micros_sec=0;
}
byte digitalRead(){
fgpio = fopen(gpio, "r");
if(fgpio){
fgets(buf, S_NUM, fgpio);
fclose(fgpio);
return (byte)atoi(buf);
}
return 255;
}
/* シンボル読取り*/
int ir_sens(byte det){
int counter;
byte in,det_wait,det_count;
if( det == IR_IN_OFF ){ /* AEHA, NEC */
det_wait = IR_IN_ON; // 消灯待ち
det_count= IR_IN_OFF; // 消灯カウント
}else{ /* SIRC */
det_wait = IR_IN_OFF; // 点灯待ち
det_count= IR_IN_ON; // 点灯カウント
}
/* 待ち */
counter = micros()+SYNC_WAIT;
do in = digitalRead();
while( micros()<counter && (in == det_wait) );
/* カウント */
counter = micros()+SYNC_WAIT;
if(in == det_wait) return( -1 ); /* 待ちタイムアウト */
do in = digitalRead();
while( micros()<counter && (in == det_count));
counter = micros() - counter + SYNC_WAIT;
if( in == det_count ) return( -2 ); /* 変化せず */
if( counter > SYNC_WAIT ) return( -3 ); /* 長すぎ */
return( (int)counter );
}
/* 赤外線信号読み取りシンプル */
int ir_read(byte *data, const byte data_num, byte mode){ // mode の constを解除
int i,bit;
int data_len= -1; // Irデータのビット数
int len, data_wait;
int len_on=0,len_off=0; // 信号長(ループカウント)
int symbol_len, noise; // 判定用シンボル長
byte det = IR_IN_OFF; // 判定時の入力信号レベル(SIRC対応)
byte in=0;
#ifdef DEBUG
int t[1024];
int t_i=0;
#endif
if(data_num<2) return( -3 ); /* 入力不備 */
/* SYNC_ON検出 */
len_on = ir_sens(IR_IN_ON); // 受光待ち
if( len_on < 0 ) return( -1 ); /* タイムアウト */
/* SYNC_OFF検出 */
len_off = ir_sens(IR_IN_OFF);
if( len_off < 0 ) return( -2 ); /* エラー */
/* モード設定 (SIRCについては最初の1ビットに遅延が許されないので、初期の遅延を最小化する)*/
if( mode == AUTO){
if( len_off < 1200 ){
mode=SIRC;
}else if( len_off < 3000 ) mode =AEHA; else mode =NEC;
}
switch( mode ){
case SIRC: // H(4T) + L(1T) 4:1
micros_0();
for(bit=0;bit<7;bit++){
len = ir_sens( IR_IN_ON );
if( len > 225 && len < 1800){
if( len < 900 ){
in = in>>1;
in += 0;
}else{
in = in>>1;
in += 128;
}
}else break;
}
in >>= 1;
data[0]=in;
if(bit==7){
bit=0;
for(i=1;i<3;i++){
in = 0;
for(bit=0;bit<8;bit++){
len = ir_sens( IR_IN_ON );
if( len > 225 && len < 1800){
if( len < 900 ){
in = in>>1;
in += 0;
}else{
in = in>>1;
in += 128;
}
}else{
in = in>>(8 - bit);
data[i]=in;
data_len = i * 8 + bit;
i = data_num -1; // break for i
bit=7; // break for bit
}
}
data[i]=in;
}
}
symbol_len = (3*len_off)/2;
det=IR_IN_ON;
break;
case NEC: // H(16T) + L(8T) 2:1
symbol_len = len_off/4; // ON(1T)+OFF(3T) 判定 2T ∴ 8T -> 2T
det=IR_IN_OFF;
break;
case AEHA: // H(8T) + L(4T) 2:1
default:
symbol_len = len_off/2; // ON(1T)+OFF(3T) 判定 2T ∴ 4T -> 2T
det=IR_IN_OFF;
break;
}
if(det==IR_IN_OFF){
micros_0();
/* データー読取り*/
data_wait = 3 * symbol_len; // 終了検出するシンボル長
noise = symbol_len /6; // ノイズと判定するシンボル長
for(i=0;i<data_num;i++){
in = 0;
for(bit=0;bit<8;bit++){
len = ir_sens( IR_IN_OFF ); // ir_sens( det )
if( len > noise && len < data_wait){
if( len < symbol_len ){
in = in>>1;
in += 0;
}else{
in = in>>1;
in += 128;
}
#ifdef DEBUG
t[t_i]=len;
t_i++; // if(t_i>1023) t_i=1023;
#endif
}else{
in = in>>(8 - bit);
data[i]=in;
data_len = i * 8 + bit;
i = data_num -1; // break for i
bit=7; // break for bit
#ifdef DEBUG
t[t_i]=len;
t_i++; if(t_i>1023){
printf("DEBUG:out of memory\n");
goto debug_exit;
}
#endif
}
}
data[i]=in;
}
}
#ifdef DEBUG //1234567890
debug_exit:
printf("------------------------ DEBUG ----------------------\n");
printf("Mode = %d",mode);
switch(mode){
case AEHA: printf(" (AEHA)\n"); break;
case NEC : printf(" (NEC )\n"); break;
case SIRC: printf(" (SIRC)\n"); break;
default : printf(" (UNKNOWN)\n"); break;
}
printf("Detector= %d",det);
if(det==IR_IN_OFF) printf(" (IR_IN_OFF)\n"); else printf(" (IR_IN_ON)\n");
printf("SYNC LEN= %d\n",len_on+len_off);
printf("SYNC ON = %d\n",len_on);
printf("SYNC OFF= %d\n",len_off);
printf("SYMOL = %d\n",symbol_len);
printf("DATA LEN= %d\n",data_len);
len=data_len/8;
if(data_len%8)len++;
printf("data[%02d]= {%02X",len,data[0]);
for(i=1;i<len;i++) printf(",%02X",data[i]);
printf("}\n");
for(i=0;i<t_i;i++){
printf("%4d ",t[i]);
if(i%8==7)printf("\n");
}
printf("\n");
#endif // DEBUG
/* データの有効性のチェック 共通 */
if(data_len<16)data_len=-2; // 2バイトに満たないのは無効
if(data[0]==0 && data[1]==0) data_len=-3; // メーカーコード00
/* 有効性のチェック AEHA */
switch( mode ){
case AEHA:
in=( data[0]^
(data[0]>>4)^
data[1]^
(data[1]>>4)^
data[2]
)&0x0F;
if( in ){
data_len=-4; // メーカーコードのパリティ確認
#ifdef DEBUG
printf("AEHA ERR= %02X ##############################\n",in);
#endif // DEBUG
}
break;
case NEC:
in=( data[2]^
data[3]^
0xFF
)&0xFF;
if( in ){
data_len=-5; // データのパリティ確認
#ifdef DEBUG
printf("NEC ERR= %02X ##############################\n",in);
#endif // DEBUG
}
break;
default:
break;
}
return(data_len);
}
|
bokunimowakaru/RaspberryPi
|
libs/ir/ir_read.c
|
C
|
mit
| 7,145
|
var $topnav = $('#topnav-row .col');
var $sidebar = $('#main-row .sidebar');
var $main = $('#main-row .main');
$(document).on('click', '.on-sidebar-toggler', function (e) {
$sidebar.toggleClass('col-md-3 col-lg-2 d-md-block col-12');
$topnav.toggleClass('d-md-none');
$main.toggleClass('col-md-9 col-lg-10 col-12');
});
|
osalabs/osafw-asp.net
|
www/App_Data/template/layout/common.js
|
JavaScript
|
mit
| 334
|