Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Make BigBlueButton recording listing more intuitive | {if $bbb_recordings}
<p>{tr}Current recordings:{/tr}</p>
<ol>
{foreach from=$bbb_recordings item=recording}
{if $recording.published}
<li>
{tr _0=$recording.startTime|tiki_long_date _1=$recording.startTime|tiki_short_time _2=$recording.endTime|tiki_short_time}On %0 from %1 to %2{/tr}
{permission name=admin}
<a data-confirm="{tr}This will permanently remove the recording{/tr}" class="bbb-remove-link" href="{service controller=bigbluebutton action=delete_recording id=$recording.recordID}">{icon _id=cross}</a>
{/permission}
<ul>
{foreach from=$recording.playback key=type item=url}
<a href="{$url|escape}">{$type|escape}</a>
{/foreach}
</ul>
</li>
{/if}
{/foreach}
</ol>
{/if}
{jq}
$('.bbb-remove-link').requireConfirm({
success: function () {
$(this).closest('li').remove();
}
});
{/jq}
| {if $bbb_recordings}
<p>{tr}Current recordings:{/tr}</p>
<ol>
{foreach from=$bbb_recordings item=recording}
{if $recording.published}
<li>
{tr _0=$recording.startTime|tiki_long_date _1=$recording.startTime|tiki_short_time _2=$recording.endTime|tiki_short_time}On %0 from %1 to %2{/tr}
{permission name=admin}
<a data-confirm="{tr}This will permanently remove the recording{/tr}" class="bbb-remove-link" href="{service controller=bigbluebutton action=delete_recording id=$recording.recordID}">{icon _id=cross}</a>
{/permission}
<ul>
{foreach from=$recording.playback key=type item=url}
<a href="{$url|escape}">{$type|escape}</a> {tr}(including audio recording & chat log){/tr}
{/foreach}
</ul>
</li>
{/if}
{/foreach}
</ol>
{/if}
{jq}
$('.bbb-remove-link').requireConfirm({
success: function () {
$(this).closest('li').remove();
}
});
{/jq}
|
Remove stutter from type CommandClassID | // THIS FILE IS AUTO-GENERATED BY CCGEN
// DO NOT MODIFY
package commandclass
type CommandClassID byte
const (
{{range .CommandClasses}}
{{.GetConstName}} CommandClassID = {{.Key}}{{end}}
)
func (c CommandClassID) String() string {
switch c {
{{range .CommandClasses}}
{{if eq .Version 1}}
case {{.GetConstName}}:
return "{{.Help}}"
{{end}}
{{end}}
default:
return fmt.Sprintf("Unknown (0x%X)", byte(c))
}
}
func Parse(ccVersion uint8, payload []byte) (interface{}, error) {
switch {
{{range $_, $cc := .CommandClasses}}{{if .CanGen}}{{$version := .Version}}
case payload[0] == byte({{.GetConstName}}) && ccVersion == {{$version}}:
switch payload[1] {
{{range .Commands}}case {{.Key}}:
command := {{$cc.GetPackageName}}.{{(ToGoName .Name)}}{}
if err := command.UnmarshalBinary(payload[2:]); err != nil {
return nil, err
}
return command, nil
{{end}}default:
return nil, errors.New("Unknown command in command class {{.Help}}")
}
{{end}}{{end}}
default:
return nil, errors.New("Unknown command class")
}
}
| // THIS FILE IS AUTO-GENERATED BY CCGEN
// DO NOT MODIFY
package commandclass
type ID byte
const (
{{range .CommandClasses}}
{{.GetConstName}} ID = {{.Key}}{{end}}
)
func (c ID) String() string {
switch c {
{{range .CommandClasses}}
{{if eq .Version 1}}
case {{.GetConstName}}:
return "{{.Help}}"
{{end}}
{{end}}
default:
return fmt.Sprintf("Unknown (0x%X)", byte(c))
}
}
func Parse(ccVersion uint8, payload []byte) (interface{}, error) {
switch {
{{range $_, $cc := .CommandClasses}}{{if .CanGen}}{{$version := .Version}}
case payload[0] == byte({{.GetConstName}}) && ccVersion == {{$version}}:
switch payload[1] {
{{range .Commands}}case {{.Key}}:
command := {{$cc.GetPackageName}}.{{(ToGoName .Name)}}{}
if err := command.UnmarshalBinary(payload[2:]); err != nil {
return nil, err
}
return command, nil
{{end}}default:
return nil, errors.New("Unknown command in command class {{.Help}}")
}
{{end}}{{end}}
default:
return nil, errors.New("Unknown command class")
}
}
|
Hide worker information if live dashboard disabled | <div class="col-lg-4">
<div class="panel panel-info">
<div class="panel-heading">
<h4 class="panel-title"><i class="fa fa-desktop fa-fw"></i> Worker Information</h4>
</div>
<div class="panel-body no-padding">
{if !$DISABLED_DASHBOARD and !$DISABLED_DASHBOARD_API}
<table class="table table-bordered table-hover table-striped">
<thead>
<tr>
<th>Worker</th>
<th>Hashrate</th>
<th>Difficulty</th>
</tr>
</thead>
<tbody id="b-workers">
<td colspan="3" class="text-center">No worker information available</td>
</tbody>
</tr>
</table>
{/if}
</div>
</div>
</div>
| {if !$DISABLED_DASHBOARD and !$DISABLED_DASHBOARD_API}
<div class="col-lg-4">
<div class="panel panel-info">
<div class="panel-heading">
<h4 class="panel-title"><i class="fa fa-desktop fa-fw"></i> Worker Information</h4>
</div>
<div class="panel-body no-padding">
<table class="table table-bordered table-hover table-striped">
<thead>
<tr>
<th>Worker</th>
<th>Hashrate</th>
<th>Difficulty</th>
</tr>
</thead>
<tbody id="b-workers">
<td colspan="3" class="text-center">No worker information available</td>
</tbody>
</tr>
</table>
</div>
</div>
</div>
{/if}
|
Change a small button in Publish | <section>
<h3>{$c->__('post.preview')}</h3>
<br />
<article>
<section>
<content>
{$content|prepareString}
</content>
</section>
</article>
</section>
<div class="no_bar">
<a onclick="Dialog.clear()" class="button flat">
{$c->__('button.cancel')}
</a>
</div>
| <section>
<h3>{$c->__('post.preview')}</h3>
<br />
<article>
<section>
<content>
{$content|prepareString}
</content>
</section>
</article>
</section>
<div class="no_bar">
<a onclick="Dialog.clear()" class="button flat">
{$c->__('button.close')}
</a>
</div>
|
Put striptags around values in metatags, just to be sure. | {% with m.config.seo.keywords.value as keywords %}
{% with m.config.seo.description.value as description %}
{% if id %}
<link rel="shorturl" href="{% url id id=id %}" />
<link rel="canonical" href="{{ m.rsc[id].page_url }}" />
{% if m.rsc[id].seo_noindex %}
<meta name="robots" content="noindex" />
{% else %}
{% with m.rsc[id].seo_keywords as seo_keywords %}
{% if seo_keywords %}
<meta name="keywords" content="{{ seo_keywords }}, {{ keywords }}" />
{% else %}
<meta name="keywords" content="{% for predicate in m.rsc[id].op %}{% ifnotequal predicate "depiction" %}{% for oid in m.rsc[id].o[predicate] %}{{ m.rsc[oid].title }}, {% endfor %}{% endifnotequal %}{% endfor %}{{ keywords }}" />
{% endif %}
<meta name="description" content="{{ m.rsc[id].seo_desc|default:m.rsc[id].summary }} {{ description }}" />
{% endwith %}
{% endif %}
{% else %}
{% if keywords or description %}
<meta name="keywords" content="{{ keywords }}" />
<meta name="description" content="{{ description }}" />
{% endif %}
{% endif %}
{% endwith %}
{% endwith %}
| {% with m.config.seo.keywords.value as keywords %}
{% with m.config.seo.description.value as description %}
{% if id %}
<link rel="shorturl" href="{% url id id=id %}" />
<link rel="canonical" href="{{ m.rsc[id].page_url }}" />
{% if m.rsc[id].seo_noindex %}
<meta name="robots" content="noindex" />
{% else %}
{% with m.rsc[id].seo_keywords as seo_keywords %}
{% if seo_keywords %}
<meta name="keywords" content="{{ seo_keywords|striptags }}, {{ keywords|striptags }}" />
{% else %}
<meta name="keywords" content="{% for predicate in m.rsc[id].op %}{% ifnotequal predicate "depiction" %}{% for oid in m.rsc[id].o[predicate] %}{{ m.rsc[oid].title|striptags }}, {% endfor %}{% endifnotequal %}{% endfor %}{{ keywords }}" />
{% endif %}
<meta name="description" content="{{ m.rsc[id].seo_desc|default:m.rsc[id].summary|striptags }} {{ description|striptags }}" />
{% endwith %}
{% endif %}
{% else %}
{% if keywords or description %}
<meta name="keywords" content="{{ keywords|striptags }}" />
<meta name="description" content="{{ description|striptags }}" />
{% endif %}
{% endif %}
{% endwith %}
{% endwith %}
|
Add infinite scroll to collection query | {% extends "beeldenzoeker/base.tpl" %}
{% block body_class %}t--adlib-query{% endblock %}
{% block content %}
{% include "masthead/masthead.tpl" %}
<main>
<div class="adlib-object__actions">
<div class="main-container">
{% include "beeldenzoeker/share.tpl" %}
</div>
</div>
<article class="main-content">
{% include "page-title/page-title.tpl" %}
{% include "subtitle/subtitle.tpl" %}
{% include "summary/summary.tpl" %}
{% include "body/body.tpl" %}
</article>
{% block search_query %}
{% include "beeldenzoeker/search-query-wrapper.tpl" id_exclude=id query_id=id show_pager=`false` %}
{% endblock %}
</main>
{% endblock %}
| {% extends "beeldenzoeker/base.tpl" %}
{% block body_class %}t--adlib-query{% endblock %}
{% block content %}
{% include "masthead/masthead.tpl" %}
<main>
<div class="adlib-object__actions">
<div class="main-container">
{% include "beeldenzoeker/share.tpl" %}
</div>
</div>
<article class="main-content">
{% include "page-title/page-title.tpl" %}
{% include "subtitle/subtitle.tpl" %}
{% include "summary/summary.tpl" %}
{% include "body/body.tpl" %}
</article>
{% block search_query %}
{% include "beeldenzoeker/search-query-wrapper.tpl" id_exclude=id query_id=id pagelen=20 infinite_scroll %}
{% endblock %}
</main>
{% endblock %}
|
Add permission check to page create | {extends "designs/site.tpl"}
{block title}Pages — {$dwoo.parent}{/block}
{block content}
<div class="row">
<div class="col-md-8 col-md-offset-2">
<header class="page-header">
<form action="/pages/create" method="GET" class="pull-right">
{* field "Title" "Page Title" *}
<button type="submit" class="btn btn-success">Create New Page</button>
</form>
<h1>Pages Directory</h1>
</header>
<ul>
{foreach item=Page from=$data}
<li><a href="/pages/{$Page->Handle}">{$Page->Title|escape}</a></li>
{/foreach}
</ul>
</div>
</div>
{/block} | {extends "designs/site.tpl"}
{block title}Pages — {$dwoo.parent}{/block}
{block content}
<div class="row">
<div class="col-md-8 col-md-offset-2">
{if Emergence\CMS\PagesRequestHandler::checkWriteAccess(\Emergence\CMS\Page::create())}
<header class="page-header">
<form action="/pages/create" method="GET" class="pull-right">
{* field "Title" "Page Title" *}
<button type="submit" class="btn btn-success">Create New Page</button>
</form>
<h1>Pages Directory</h1>
</header>
{/if}
<ul>
{foreach item=Page from=$data}
<li><a href="/pages/{$Page->Handle}">{$Page->Title|escape}</a></li>
{/foreach}
</ul>
</div>
</div>
{/block} |
Disable Block Explorer Link and Chain Info on mmcFE Theme | {include file="global/block_header.tpl" BLOCK_HEADER="Pool Statistics"}
<table class="" width="50%" style="font-size:14px;">
<tbody>
<tr>
<td class="leftheader">Pool Hash Rate</td>
<td>{$GLOBAL.hashrate|number_format:"3"} {$GLOBAL.hashunits.pool}</td>
</tr>
<tr>
<td class="leftheader">Current Total Miners</td>
<td>{$GLOBAL.workers}</td>
</tr>
<tr>
<td class="leftheader">Current Block</td>
<td><a href="http://explorer.litecoin.net/search?q={$CURRENTBLOCK}" target="_new">{$CURRENTBLOCK}</a></td>
</tr>
<tr>
<td class="leftheader">Current Difficulty</td>
<td><a href="http://allchains.info/" target="_new">{$DIFFICULTY}</a></td>
</tr>
</tbody>
</table>
{if !$GLOBAL.website.api.disabled}<li>These stats are also available in JSON format <a href="{$smarty.server.PHP_SELF}?page=api&action=public" target="_api">HERE</a></li>{/if}
{include file="global/block_footer.tpl"}
| {include file="global/block_header.tpl" BLOCK_HEADER="Pool Statistics"}
<table class="" width="50%" style="font-size:14px;">
<tbody>
<tr>
<td class="leftheader">Pool Hash Rate</td>
<td>{$GLOBAL.hashrate|number_format:"3"} {$GLOBAL.hashunits.pool}</td>
</tr>
<tr>
<td class="leftheader">Current Total Miners</td>
<td>{$GLOBAL.workers}</td>
</tr>
<tr>
<td class="leftheader">Current Block</td>
{if ! $GLOBAL.website.blockexplorer.disabled}
<td><a href="{$GLOBAL.website.blockexplorer.url}{$CURRENTBLOCKHASH}" target="_new">{$CURRENTBLOCK}</a></td>
{else}
<td>{$CURRENTBLOCK}</td>
{/if}
</tr>
<tr>
<td class="leftheader">Current Difficulty</td>
{if ! $GLOBAL.website.chaininfo.disabled}
<td><a href="{$GLOBAL.website.chaininfo.url}" target="_new">{$DIFFICULTY}</a></td>
{else}
<td>{$DIFFICULTY}</td>
{/if}
</tr>
</tbody>
</table>
{if !$GLOBAL.website.api.disabled}<li>These stats are also available in JSON format <a href="{$smarty.server.PHP_SELF}?page=api&action=public" target="_api">HERE</a></li>{/if}
{include file="global/block_footer.tpl"}
|
Tweak the userdata for explicitness and error handling | #!/bin/bash
# Create jupyter user
adduser ${notebook_user} --gecos "" --disabled-password
# Write config file
mkdir /home/${notebook_user}/.jupyter
cat << EOF > /home/${notebook_user}/.jupyter/jupyter_notebook_config.py
c.NotebookApp.notebook_dir = u"/home/${notebook_user}/"
c.NotebookApp.ip = "*"
c.NotebookApp.port = ${notebook_port}
c.NotebookApp.open_browser = False
c.NotebookApp.password = u'${hashed_password}'
EOF
# Start notebook server
runuser -l ${notebook_user} -c '/home/ubuntu/anaconda3/bin/jupyter notebook' | #!/usr/bin/env bash
set -o errexit
set -o nounset
# Create jupyter user
adduser ${notebook_user} --gecos "" --disabled-password
# Write config file
mkdir /home/${notebook_user}/.jupyter
cat << EOF > /home/${notebook_user}/.jupyter/jupyter_notebook_config.py
c.NotebookApp.notebook_dir = u"/home/${notebook_user}/"
c.NotebookApp.ip = "*"
c.NotebookApp.port = ${notebook_port}
c.NotebookApp.open_browser = False
c.NotebookApp.password = u'${hashed_password}'
EOF
# Start notebook server
runuser --login ${notebook_user} --command '/home/ubuntu/anaconda3/bin/jupyter notebook'
|
Add link to project id and add internal_project_id to href tag in the projects overview table | <h3> Upload projects in <a href="http://biom-format.org/documentation/format_versions/biom-1.0.html">biom format (version 1.0)</a></h3>
<div id="project-upload-message-area"></div>
<form>
<input class="btn" id="project-fileupload" type="file" name="files[]" multiple>
</form>
<script src="{#$WebRoot#}/js/uploadProject.js" type="text/javascript"></script>
<i class="fa fa-refresh fa-spin" style="font-size:24px; display:none" id="project-upload-busy-indicator"></i>
<h3> My projects </h3>
<table id="project-table" class="table project-table project-table-striped table-bordered" width="100%" cellspacing="0">
<thead>
<tr><th>ID</th><th>Import Date</th><th># OTUs</th><th># Samples</th></tr>
</thead>
</table>
<script type="text/javascript">
var table = $('#project-table').DataTable( {
ajax: {
url: '{#$ServicePath#}/listing/projects?dbversion={#$DbVersion#}',
dataSrc: 'data'
},
columns: [
{ data: 'id' },
{ data: 'import_date' },
{ data: 'rows' },
{ data: 'columns' }
]
} );
</script> | <h3> Upload projects in <a href="http://biom-format.org/documentation/format_versions/biom-1.0.html">biom format (version 1.0)</a></h3>
<div id="project-upload-message-area"></div>
<form>
<input class="btn" id="project-fileupload" type="file" name="files[]" multiple>
</form>
<script src="{#$WebRoot#}/js/uploadProject.js" type="text/javascript"></script>
<i class="fa fa-refresh fa-spin" style="font-size:24px; display:none" id="project-upload-busy-indicator"></i>
<h3> My projects </h3>
<table id="project-table" class="table project-table project-table-striped table-bordered" width="100%" cellspacing="0">
<thead>
<tr><th>ID</th><th>Import Date</th><th># OTUs</th><th># Samples</th></tr>
</thead>
</table>
<script type="text/javascript">
var table = $('#project-table').DataTable( {
ajax: {
url: '{#$ServicePath#}/listing/projects?dbversion={#$DbVersion#}',
dataSrc: 'data'
},
columns: [
{ data: 'id' },
{ data: 'import_date' },
{ data: 'rows' },
{ data: 'columns' }
],
columnDefs: [{
targets: 0,
render: function (data, type, full, meta) {
return '<a href="'+full.internal_project_id+'">'+full.id+'</a>';
}
}]
} );
</script> |
Fix describe error in keil readme template | # TensorFlow Lite Micro Mbed Project
This folder has been autogenerated by TensorFlow, and contains source, header,
and project files needed to build a single TensorFlow Lite Micro target using
the Keil uVision IDE.
| # TensorFlow Lite Micro Keil Project
This folder has been autogenerated by TensorFlow, and contains source, header,
and project files needed to build a single TensorFlow Lite Micro target using
the Keil uVision IDE.
|
Remove further Libre.fm branding from gnufm theme | {include file='mini-header.tpl'}
<h2>{t}Login{/t}</h2>
<h3>{t}Need an account?{/t} <a href="{base_url}/register.php">{t}Register now!{/t}</a></h3>
{if isset($errors)}
<p id='errors'>{$errors}</p>
{/if}
<form method="post">
{include file='login-form.tpl'}
</form>
<p>{t escape=no}Join us in #libre.fm on irc.freenode.net to help shape that, or <a href="http://lists.nongnu.org/mailman/listinfo/librefm-discuss"> join our mailing list</a> and have your say!{/t}</p>
{include file='mini-footer.tpl'}
| {include file='mini-header.tpl'}
<h2>{t}Login{/t}</h2>
<h3>{t}Need an account?{/t} <a href="{base_url}/register.php">{t}Register now!{/t}</a></h3>
{if isset($errors)}
<p id='errors'>{$errors}</p>
{/if}
<form method="post">
{include file='login-form.tpl'}
</form>
{include file='mini-footer.tpl'}
|
Add title for other objects | {% extends "page.tpl" %}
{% block title %}{{ id.title }}{% endblock %}
{% block body_class %}collection{% endblock %}
{% block content %}
<div class="page--collection page__content-wrapper do_ginger_default_content_group_navigation">
{% with id as collection %}
{% block masthead %}
{% include "_masthead.tpl" article=collection %}
{% endblock %}
<main role="main" class="page__main-content">
<article class="page__content">
<h1 class="page__content__title">{{ collection.title }}</h1>
{% if collection.summary %}
<div class="page__content__intro">
{{ collection.summary }}
</div>
{% endif %}
<div class="page__content__body">
{{ collection.body|show_media }}
</div>
</article>
</main>
{% block correlatedItems %}
{% if id.o.haspart %}
{% if id.o.haspart|length > 10 %}
{% include "_correlated-items.tpl"
items=id.o.haspart|slice:[1,10]
showMetaData="date"
title="Andere objecten"
variant="related"
showMoreLabel="Toon alle"
showMoreQueryRsc=m.rsc.le_all_events
%}
{% else %}
{% include "_correlated-items.tpl" items=id.o.haspart showMetaData="date" title="" %}
{% endif %}
{% endif %}
{% endblock %}
{% endwith %}
</div>
{% endblock %}
| {% extends "page.tpl" %}
{% block title %}{{ id.title }}{% endblock %}
{% block body_class %}collection{% endblock %}
{% block content %}
<div class="page--collection page__content-wrapper do_ginger_default_content_group_navigation">
{% with id as collection %}
{% block masthead %}
{% include "_masthead.tpl" article=collection %}
{% endblock %}
<main role="main" class="page__main-content">
<article class="page__content">
<h1 class="page__content__title">{{ collection.title }}</h1>
{% if collection.summary %}
<div class="page__content__intro">
{{ collection.summary }}
</div>
{% endif %}
<div class="page__content__body">
{{ collection.body|show_media }}
</div>
</article>
</main>
{% block correlatedItems %}
{% if id.o.haspart %}
{% if id.o.haspart|length > 10 %}
{% include "_correlated-items.tpl"
items=id.o.haspart|slice:[1,10]
showMetaData="date"
title="Andere objecten"
variant="related"
showMoreLabel="Toon alle"
showMoreQueryRsc=m.rsc.le_all_events
%}
{% else %}
{% include "_correlated-items.tpl" items=id.o.haspart showMetaData="date" title="Andere objecten" %}
{% endif %}
{% endif %}
{% endblock %}
{% endwith %}
</div>
{% endblock %}
|
Add a publish button on user Contact page | <ul class="list thick">
<li>
{if="$contactr != null"}
<span class="control icon active gray" onclick="ContactHeader_ajaxEditContact('{$contact->jid|echapJS}')">
<i class="zmdi zmdi-edit"></i>
</span>
<span class="control icon active gray" onclick="ContactHeader_ajaxDeleteContact('{$contact->jid|echapJS}')">
<i class="zmdi zmdi-delete"></i>
</span>
{else}
{if="!$contact->isMe()"}
<!--<span class="control icon active gray" onclick="Roster_ajaxDisplaySearch('{$contact->jid}')">
<i class="zmdi zmdi-account-add"></i>
</span>-->
{/if}
{/if}
<span class="primary icon active gray" onclick="history.back()">
<i class="zmdi zmdi-arrow-back"></i>
</span>
<p class="line">
{$contact->getTrueName()}
</p>
<p class="line">{$contact->jid}</p>
</li>
</ul>
{if="!$contact->isMe()"}
<button onclick="ContactHeader_ajaxChat('{$contact->jid|echapJS}')" class="button action color">
<i class="zmdi zmdi-comment-text-alt"></i>
</button>
{/if}
| <ul class="list thick">
<li>
{if="$contactr != null"}
<span class="control icon active gray" onclick="ContactHeader_ajaxEditContact('{$contact->jid|echapJS}')">
<i class="zmdi zmdi-edit"></i>
</span>
<span class="control icon active gray" onclick="ContactHeader_ajaxDeleteContact('{$contact->jid|echapJS}')">
<i class="zmdi zmdi-delete"></i>
</span>
{else}
{if="!$contact->isMe()"}
<!--<span class="control icon active gray" onclick="Roster_ajaxDisplaySearch('{$contact->jid}')">
<i class="zmdi zmdi-account-add"></i>
</span>-->
{/if}
{/if}
<span class="primary icon active gray" onclick="history.back()">
<i class="zmdi zmdi-arrow-back"></i>
</span>
<p class="line">
{$contact->getTrueName()}
</p>
<p class="line">{$contact->jid}</p>
</li>
</ul>
{if="$contact->isMe()"}
<button class="button action color"
title="{$c->__('publishbrief.post')}"
onclick="MovimUtils.reload('{$c->route('publish')}')">
<i class="zmdi zmdi-edit"></i>
</button>
{else}
<button onclick="ContactHeader_ajaxChat('{$contact->jid|echapJS}')" class="button action color">
<i class="zmdi zmdi-comment-text-alt"></i>
</button>
{/if}
|
Add link so users can ask for a new connector | <div class="ImportOptions-navigation">
<button class="Carousel-Navigation CDB-Size-large ImportOptions-navigationButton ImportOptions-navigationButton--prev js-goPrev">
<i class="CDB-IconFont CDB-IconFont-arrowPrev u-actionTextColor"></i>
</button>
<button class="Carousel-Navigation CDB-Size-large ImportOptions-navigationButton ImportOptions-navigationButton--next js-goNext">
<i class="CDB-IconFont CDB-IconFont-arrowNext u-actionTextColor"></i>
</button>
</div>
<div class="AddLayer-tabs">
<ul class="ImportOptions-tabsList js-menu CDB-Text CDB-Size-medium u-altTextColor"></ul>
</div>
<div class="ImportOptions-panes js-content"></div>
| <div class="ImportOptions-navigation">
<button class="Carousel-Navigation CDB-Size-large ImportOptions-navigationButton ImportOptions-navigationButton--prev js-goPrev">
<i class="CDB-IconFont CDB-IconFont-arrowPrev u-actionTextColor"></i>
</button>
<button class="Carousel-Navigation CDB-Size-large ImportOptions-navigationButton ImportOptions-navigationButton--next js-goNext">
<i class="CDB-IconFont CDB-IconFont-arrowNext u-actionTextColor"></i>
</button>
</div>
<div class="AddLayer-tabs">
<ul class="ImportOptions-tabsList js-menu CDB-Text CDB-Size-medium u-altTextColor"></ul>
<p class="CDB-Text CDB-Size-medium u-altTextColor u-tSpace-xl">
Is your data somewhere else?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSeSP4idHpOLdGlUkCCve1BfCsakZdmeAO_5yrHH4FSIJt5cdw/viewform" target="_blank">Request data source</a>
</p>
</div>
<div class="ImportOptions-panes js-content"></div>
|
Add smarty block to allow definition of css-classes on html tag | <!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="description" content="{"{block name='head-description'}{/block}"|escape}">
<meta name="keywords" content="{"{block name='head-keywords'}{/block}"|escape}">
<title>{block name='title'}{$pageObj->getTitle()|escape}{/block}</title>
{resource file='library.css'}
{resource file='internal.css'}
{resource file='init.js'}
{block name='head'}{/block}
</head>
<body id="{$pageObj->getAutoId()}" class="{$pageObj->getClassHierarchy()|implode:' '}">
{block name='body-start'}{/block}
{block name='body'}{/block}
{if $smarty.const.IS_DEBUG}{component name='CM_Component_Debug'}{/if}
{resource file='library.js'}
{resource file='internal.js'}
{$render->getJs()->renderScripts()}
{CM_Tracking::getInstance()->getHtml()}
{block name='body-end'}{/block}
</body>
</html>
| <!doctype html>
<html lang="en" class="{block name='html-class'}{/block}">
<head>
<meta charset="utf-8">
<meta name="description" content="{"{block name='head-description'}{/block}"|escape}">
<meta name="keywords" content="{"{block name='head-keywords'}{/block}"|escape}">
<title>{block name='title'}{$pageObj->getTitle()|escape}{/block}</title>
{resource file='library.css'}
{resource file='internal.css'}
{resource file='init.js'}
{block name='head'}{/block}
</head>
<body id="{$pageObj->getAutoId()}" class="{$pageObj->getClassHierarchy()|implode:' '}">
{block name='body-start'}{/block}
{block name='body'}{/block}
{if $smarty.const.IS_DEBUG}{component name='CM_Component_Debug'}{/if}
{resource file='library.js'}
{resource file='internal.js'}
{$render->getJs()->renderScripts()}
{CM_Tracking::getInstance()->getHtml()}
{block name='body-end'}{/block}
</body>
</html>
|
Improve template for meta admin | <!DOCTYPE html>
<html>
<meta name="viewport" content="width=device-width" />
<noscript><meta http-equiv="refresh" content="0;/?legacy=1" /></noscript>
<script data-spa>
if (!Object.getPrototypeOf || !Object.defineProperty || !window.history ||
(function () {'use strict'; return this; }()) ||
(Object.getPrototypeOf({ __proto__: Function.prototype }) !==
Function.prototype) || (Object.defineProperty({}, 'foo',
{ get: function () { return 'bar'; } }).foo !== 'bar')) {
if (document.cookie.indexOf('legacy=') === -1) {
document.cookie = 'legacy=1;path=/';
location.reload();
} else {
document.write('<p>Your browser is not supported</p>');
}
} else {
document.write('<scr' + 'ipt src="${ stRoot }meta-admin.legacy.js"></sc' + 'ript>');
document.write('<scr' + 'ipt src="/i18n.js"></sc' + 'ript>');
document.write('<scr' + 'ipt data-spa src="${ stRoot }meta-admin.js"></sc' + 'ript>');
}
</script>
| <!DOCTYPE html>
<html>
<meta name="viewport" content="width=device-width" />
<noscript><meta http-equiv="refresh" content="0;/?legacy=1" /></noscript>
<script data-spa>
if (!Object.getPrototypeOf || !Object.defineProperty || !window.history ||
(function () {'use strict'; return this; }()) ||
(Object.getPrototypeOf({ __proto__: Function.prototype }) !==
Function.prototype) || (Object.defineProperty({}, 'foo',
{ get: function () { return 'bar'; } }).foo !== 'bar')) {
if (document.cookie.indexOf('legacy=') === -1) {
document.cookie = 'legacy=1;path=/';
location.reload();
} else {
document.write('<p>Your browser is not supported</p>');
}
} else {
document.write('<link href="${ stRoot }meta-admin.css" rel="stylesheet" />');
document.write('<scr' + 'ipt src="${ stRoot }meta-admin.legacy.js"></sc' + 'ript>');
document.write('<scr' + 'ipt src="/i18n.js"></sc' + 'ript>');
document.write('<scr' + 'ipt data-spa src="${ stRoot }meta-admin.js"></sc' + 'ript>');
}
</script>
|
Use newer version of SchemaSchemaDemo.jar. | urn:bitprint:OLY3VJIZIX53DRG3F5S5LO7VYFQWPZ2H.ICXJSXB5VHDUBAIUKEZYU2YPC3AENQ2ADWMIGLQ
| urn:bitprint:SWVUD74Y3R7L4B4VJVCYZCGMWZDFLFOD.CR2QNHSPGTKEP4LQPZJGT6BXHFPJOG45DAR4FBY
|
Update DBC, Schema, and CMIP-REST. | {
"description": "{#projectName}",
"require": {
"php": ">=5.2.0",
"ryprop/nife": "~0.0.1",
"earthit/php-common": "~0.0.4",
"earthit/dbc": "~0.0.1",
"earthit/schema": "~0.0.1",
"earthit/cmip-rest": "~0.0.1",
"doctrine/dbal": "~2.4.0"
},
"autoload": {
"psr-0": {
"{#projectNamespace}_": "lib/"
}
}
}
| {
"description": "{#projectName}",
"require": {
"php": ">=5.2.0",
"ryprop/nife": "~0.0.1",
"earthit/php-common": "~0.0.4",
"earthit/dbc": "~0.0.2",
"earthit/schema": "~0.0.2",
"earthit/cmip-rest": "~0.0.2",
"doctrine/dbal": "~2.4.0"
},
"autoload": {
"psr-0": {
"{#projectNamespace}_": "lib/"
}
}
}
|
Add rsc button title parameter fix | {% include "_action_ginger_connection.tpl" category=category cg_id=id.content_group_id predicate=predicate add_author direction='out' btn_class='page-action--add' title=title tab="new" tabs_enabled=["new"] %}
| {% include "_action_ginger_connection.tpl" category=category cg_id=id.content_group_id predicate=predicate add_author direction='out' btn_class='page-action--add' btn_title=btn_title tab="new" tabs_enabled=["new"] %}
|
Fix user list search not responding to clicks on search results | <div class="user-mode user-mode-search">
{{#each matches}}
<span role="button" class="{{original.className}}">{{{string}}}</span>
{{/each}}
</div>
| <div class="user-mode user-mode-search">
{{#each matches}}
<span role="button" class="{{original.className}}" data-name="{{original.dataset.name}}">{{{string}}}</span>
{{/each}}
</div>
|
Add condig language to view | <!DOCTYPE html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title><?= config('app.title').' - '.config('app.description') ?></title>
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Lato:300">
<link rel="stylesheet" href="<?= base_url('assets/styles/main.css') ?>">
</head>
<body>
<div id="app"><?= $this->section('page-content') ?></div>
<?= $this->section('page-scripts') ?>
</body>
</html>
| <!DOCTYPE html>
<html class="no-js" lang="<?= config('lang.default') ?>">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title><?= config('app.title').' - '.config('app.description') ?></title>
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Lato:300">
<link rel="stylesheet" href="<?= base_url('assets/styles/main.css') ?>">
</head>
<body>
<div id="app"><?= $this->section('page-content') ?></div>
<?= $this->section('page-scripts') ?>
</body>
</html>
|
Remove jq not needed due to r56027 | {if $prefs.javascript_enabled !== 'y'}
<div class="modal-footer">
<a class="btn btn-default" href="{$extra.referer}">
{tr}Back{/tr}
</a>
<button type='submit' form="confirm-action" class="btn {if !empty($confirmButtonClass)}{$confirmButtonClass}{else}btn-primary{/if}">
{if !empty($confirmButton)}
{$confirmButton}
{else}
{tr}OK{/tr}
{/if}
</button>
</div>
{*If js is enabled, the layouts/internal/modal.tpl will be used which already has buttons*}
{else}
{jq}
$('form.confirm-action').submit(function () {
confirmAction(this);
return false;
});
{/jq}
{/if}
| {if $prefs.javascript_enabled !== 'y'}
<div class="modal-footer">
<a class="btn btn-default" href="{$extra.referer}">
{tr}Back{/tr}
</a>
<button type='submit' form="confirm-action" class="btn {if !empty($confirmButtonClass)}{$confirmButtonClass}{else}btn-primary{/if}">
{if !empty($confirmButton)}
{$confirmButton}
{else}
{tr}OK{/tr}
{/if}
</button>
</div>
{/if}
{* If js is enabled, the layouts/internal/modal.tpl will be used which already has buttons *}
|
Add button class to better see that is a button | {include file="inc/header.tpl"}
<h2>{$LANG.finish}</h2>
<p class="bold">{$LANG.looking_hosting}</p>
<p class="bold"><a href="{$smarty.const.PH7_URL_ROOT}" target="_blank">{$LANG.go_your_site}</a> | <a href="{$smarty.const.PH7_URL_ROOT}admin123" target="_blank">{$LANG.go_your_admin_panel}</a></p>
<p> </p>
<p>{$LANG.remove_install_folder}</p>
<form action="{$smarty.const.PH7_URL_SLUG_INSTALL}finish" method="post">
<p><button type="submit" name="confirm_remove_install" value="1" onclick="return confirm('{$LANG.confirm_remove_install_folder_auto}')">{$LANG.remove_install_folder_auto}</button></p>
</form>
{include file="inc/footer.tpl"}
| {include file="inc/header.tpl"}
<h2>{$LANG.finish}</h2>
<p class="bold">{$LANG.looking_hosting}</p>
<p class="bold"><a href="{$smarty.const.PH7_URL_ROOT}" target="_blank">{$LANG.go_your_site}</a> | <a href="{$smarty.const.PH7_URL_ROOT}admin123" target="_blank">{$LANG.go_your_admin_panel}</a></p>
<p> </p>
<p>{$LANG.remove_install_folder}</p>
<form action="{$smarty.const.PH7_URL_SLUG_INSTALL}finish" method="post">
<p><button class="button" type="submit" name="confirm_remove_install" value="1" onclick="return confirm('{$LANG.confirm_remove_install_folder_auto}')">{$LANG.remove_install_folder_auto}</button></p>
</form>
{include file="inc/footer.tpl"}
|
Fix missing attributes on unhandled messages | <div class="msg msg-{{slugify command}} {{type}}{{#if self}} self{{/if}}{{#if highlight}} highlight{{/if}}" data-time="{{time}}">
<span class="time tooltipped tooltipped-e" aria-label="{{localetime time}}">
{{tz time}}
</span>
<span class="from">[{{command}}]</span>
<span class="content">
{{#each params}}
<span>{{this}}</span>
{{/each}}
</span>
</div>
| <div class="msg msg-{{slugify command}} {{type}}{{#if self}} self{{/if}}{{#if highlight}} highlight{{/if}}" id="msg-{{id}}" data-time="{{time}}">
<span class="time tooltipped tooltipped-e" aria-label="{{localetime time}}">
{{tz time}}
</span>
<span class="from">[{{command}}]</span>
<span class="content">
{{#each params}}
<span>{{this}}</span>
{{/each}}
</span>
</div>
|
Update notification view to accept html as info parameter. | <li class="Notifier-item <%- (status === 'loading') ? 'is-working' : ''%>">
<% if (status === 'loading') { %>
<div class="Notifier-icon CDB-LoaderIcon u-rSpace--m js-theme">
<div class="CDB-LoaderIcon-item">
<span class="CDB-LoaderIcon-itemClose"></span>
<span class="CDB-LoaderIcon-itemCircle"></span>
</div>
</div>
<% } %>
<% if (status === 'success') { %>
<div class="Notifier-icon CDB-Shape u-rSpace--m">
<div class="CDB-Shape-CircleItem is-green is-medium">
<div class="CDB-Shape-tick is-medium is-green"></div>
</div>
</div>
<% } %>
<% if (status === 'error') { %>
<div class="Notifier-icon CDB-Shape u-rSpace--m">
<div class="CDB-Shape-CircleItem is-red">
<div class="CDB-Shape-close is-medium is-red"></div>
</div>
</div>
<% } %>
<div class="Notifier-info">
<p class="CDB-Text CDB-Size-medium"><%- info %></p>
</div>
<% if (isActionable) { %>
<div class="Notifier-actions js-actionButton"></div>
<% } %>
<% if (isClosable) { %>
<div class="Notifier-actions js-closeButton"></div>
<% } %>
</li> | <li class="Notifier-item <%- (status === 'loading') ? 'is-working' : ''%>">
<% if (status === 'loading') { %>
<div class="Notifier-icon CDB-LoaderIcon u-rSpace--m js-theme">
<div class="CDB-LoaderIcon-item">
<span class="CDB-LoaderIcon-itemClose"></span>
<span class="CDB-LoaderIcon-itemCircle"></span>
</div>
</div>
<% } %>
<% if (status === 'success') { %>
<div class="Notifier-icon CDB-Shape u-rSpace--m">
<div class="CDB-Shape-CircleItem is-green is-medium">
<div class="CDB-Shape-tick is-medium is-green"></div>
</div>
</div>
<% } %>
<% if (status === 'error') { %>
<div class="Notifier-icon CDB-Shape u-rSpace--m">
<div class="CDB-Shape-CircleItem is-red">
<div class="CDB-Shape-close is-medium is-red"></div>
</div>
</div>
<% } %>
<div class="Notifier-info">
<p class="CDB-Text CDB-Size-medium"><%= info %></p>
</div>
<% if (isActionable) { %>
<div class="Notifier-actions js-actionButton"></div>
<% } %>
<% if (isClosable) { %>
<div class="Notifier-actions js-closeButton"></div>
<% } %>
</li> |
Fix missing Tabs widget in Post | <?php $this->widget('Init');?>
<?php $this->widget('VisioLink');?>
<?php $this->widget('Notification');?>
<?php $this->widget('Toast');?>
<?php $this->widget('Upload');?>
<?php $this->widget('Search');?>
<?php $this->widget('Notifications');?>
<?php $this->widget('SendTo');?>
<?php $this->widget('ContactActions');?>
<?php $this->widget('PostActions');?>
<nav class="color dark">
<?php $this->widget('Presence');?>
<?php $this->widget('Navigation');?>
</nav>
<?php $this->widget('BottomNavigation');?>
<main>
<?php $this->widget('Post');?>
</main>
| <?php $this->widget('Init');?>
<?php $this->widget('VisioLink');?>
<?php $this->widget('Notification');?>
<?php $this->widget('Toast');?>
<?php $this->widget('Upload');?>
<?php $this->widget('Search');?>
<?php $this->widget('Notifications');?>
<?php $this->widget('SendTo');?>
<?php $this->widget('Tabs');?>
<?php $this->widget('ContactActions');?>
<?php $this->widget('PostActions');?>
<nav class="color dark">
<?php $this->widget('Presence');?>
<?php $this->widget('Navigation');?>
</nav>
<?php $this->widget('BottomNavigation');?>
<main>
<?php $this->widget('Post');?>
</main>
|
Add class 'has-depiction' if the list item has a depiction. | {% if id.is_visible and id.is_published and not id|member:exclude %}
<li {% include "_language_attrs.tpl" id=id class="do_clickable" %}>
{% with id.depiction as dep %}
{% if dep %}
{% if dep.id.is_a.document %}
<img src="{% image_url dep mediaclass="base-list-item-small-document" %}" alt="" />
{% else %}
<img src="{% image_url dep mediaclass="base-list-item-small" %}" alt="" />
{% endif %}
{% endif %}
{% endwith %}
<h3>{{ id.title|default:"—" }}</h3>
<p>
{% if is_large %}{{ id|summary:300 }}
{% else %}{{ id|summary:120 }}
{% endif %}
<a href="{{ id.page_url with in_collection=in_collection }}">{_ Read more _} »</a>
</p>
</li>
{% endif %}
| {% if id.is_visible and id.is_published and not id|member:exclude %}
{% with id.depiction as dep %}
{% if dep %}
<li {% include "_language_attrs.tpl" id=id class="do_clickable has-depiction" %}>
{% if dep.id.is_a.document %}
<img src="{% image_url dep mediaclass="base-list-item-small-document" %}" alt="" />
{% else %}
<img src="{% image_url dep mediaclass="base-list-item-small" %}" alt="" />
{% endif %}
{% else %}
<li {% include "_language_attrs.tpl" id=id class="do_clickable" %}>
{% endif %}
<h3>{{ id.title|default:"—" }}</h3>
<p>
{% if is_large %}{{ id|summary:300 }}
{% else %}{{ id|summary:120 }}
{% endif %}
<a href="{{ id.page_url with in_collection=in_collection }}">{_ Read more _} »</a>
</p>
</li>
{% endwith %}
{% endif %}
|
Disable trade currency if no price currency defined | <div id="siteinfo">{$GLOBAL.websitename}<br/>
<span class="slogan">{$GLOBAL.slogan}</span>
</div>
<div id="ministats">
<table border="0">
<tr>
<td><li>{$GLOBAL.config.currency}/{$GLOBAL.config.price.currency}: {$GLOBAL.price|default:"n/a"|number_format:"4"} </li></td>
<td><li>Pool Hashrate: {($GLOBAL.hashrate / 1000)|number_format:"3"} MH/s </li></td>
<td><li>Pool Sharerate: {$GLOBAL.sharerate|number_format:"2"} Shares/s </li></td>
<td><li>Pool Workers: {$GLOBAL.workers} </li></td>
</tr>
</table>
</div>
| <div id="siteinfo">{$GLOBAL.websitename}<br/>
<span class="slogan">{$GLOBAL.slogan}</span>
</div>
<div id="ministats">
<table border="0">
<tr>
{if $GLOBAL.config.price.currency}<td><li>{$GLOBAL.config.currency}/{$GLOBAL.config.price.currency}: {$GLOBAL.price|default:"n/a"|number_format:"4"} </li></td>{/if}
<td><li>Pool Hashrate: {($GLOBAL.hashrate / 1000)|number_format:"3"} MH/s </li></td>
<td><li>Pool Sharerate: {$GLOBAL.sharerate|number_format:"2"} Shares/s </li></td>
<td><li>Pool Workers: {$GLOBAL.workers} </li></td>
</tr>
</table>
</div>
|
Fix for no rosters in view | <div id="roster_view" class="dataTables_wrapper">
<table>
<tr>
<th>{$labels.name}</th>
<th>{$labels.type}</th>
<th>{$labels.value}</th>
<th>{$labels.next_run}</th>
<th>{$labels.last_run}</th>
<th>{$labels.privilege}</th>
<th>{$labels.links}</th>
</tr>
{assign var="rowClass" value="odd-row"}
{foreach from=$rows key=index item=record}
<tr id="row_{$index}" class={$rowClass}>
<td>{$record.name}</td>
<td>{$record.type_translated}</td>
<td>{$record.value_translated}</td>
<td>{$record.next_run}</td>
<td>{$record.last_run}</td>
<td>{$record.privilege}</td>
<td>{$record.links}</td>
</tr>
{if $rowClass eq "odd-row"}
{assign var="rowClass" value="even-row"}
{else}
{assign var="rowClass" value="odd-row"}
{/if}
{/foreach}
</table>
</div>
| <div id="roster_view" class="dataTables_wrapper">
<table>
<tr>
<th>{$labels.name}</th>
<th>{$labels.type}</th>
<th>{$labels.value}</th>
<th>{$labels.next_run}</th>
<th>{$labels.last_run}</th>
<th>{$labels.privilege}</th>
<th>{$labels.links}</th>
</tr>
{assign var="rowClass" value="odd-row"}
{if ! isset($var)}
{else}
{foreach from=$rows key=index item=record}
<tr id="row_{$index}" class={$rowClass}>
{if $record.id eq ''}
<td colspan="7">{$record.name}</td>
{else}
<td>{$record.name}</td>
<td>{$record.type_translated}</td>
<td>{$record.value_translated}</td>
<td>{$record.next_run}</td>
<td>{$record.last_run}</td>
<td>{$record.privilege}</td>
<td>{$record.links}</td>
{/if}
</tr>
{if $rowClass eq "odd-row"}
{assign var="rowClass" value="even-row"}
{else}
{assign var="rowClass" value="odd-row"}
{/if}
{/foreach}
</table>
</div>
|
Fix a typo in toolchain definition | load("@local_config_platform//:constraints.bzl", "HOST_CONSTRAINTS")
toolchain(
name = "cc-toolchain-%{name}",
exec_compatible_with = HOST_CONSTRAINTS,
target_compatible_with = HOST_CONSTRAINTS,
toolchain = "@local_config_cc//:cc-compiler-%{name}",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
toolchain(
name = "cc-toolchain-armeabi-v7a",
exec_compatible_with = HOST_CONSTRAINTS,
target_compatible_with = [
"@platforms//cpu:arm",
"@platforms//os:android",
],
toolchain = "@local_config_cc//:cc-compiler-armabi-v7a",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
| load("@local_config_platform//:constraints.bzl", "HOST_CONSTRAINTS")
toolchain(
name = "cc-toolchain-%{name}",
exec_compatible_with = HOST_CONSTRAINTS,
target_compatible_with = HOST_CONSTRAINTS,
toolchain = "@local_config_cc//:cc-compiler-%{name}",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
toolchain(
name = "cc-toolchain-armeabi-v7a",
exec_compatible_with = HOST_CONSTRAINTS,
target_compatible_with = [
"@platforms//cpu:arm",
"@platforms//os:android",
],
toolchain = "@local_config_cc//:cc-compiler-armeabi-v7a",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
|
Fix time format so no unneeded link will be generated bu wiki | {* $Header: /cvsroot/tikiwiki/tiki/templates/modules/mod-since_last_visit.tpl,v 1.3 2003-08-07 20:56:53 zaufi Exp $ *}
{if $user}
<div class="box">
<div class="box-title">
{include file="modules/module-title.tpl" module_title="{tr}Since your last visit{/tr}" module_name="since_last_visit"}
</div>
<div class="box-data">
{tr}Since your last visit on{/tr}<br/>
<b>{$nvi_info.lastVisit|tiki_short_datetime}</b><br/>
{$nvi_info.images} {tr}new images{/tr}<br/>
{$nvi_info.pages} {tr}wiki pages changed{/tr}<br/>
{$nvi_info.files} {tr}new files{/tr}<br/>
{$nvi_info.comments} {tr}new comments{/tr}<br/>
{$nvi_info.users} {tr}new users{/tr}<br/>
</div>
</div>
{/if}
| {* $Header: /cvsroot/tikiwiki/tiki/templates/modules/mod-since_last_visit.tpl,v 1.4 2003-08-13 22:46:11 zaufi Exp $ *}
{if $user}
<div class="box">
<div class="box-title">
{include file="modules/module-title.tpl" module_title="{tr}Since your last visit{/tr}" module_name="since_last_visit"}
</div>
<div class="box-data">
{tr}Since your last visit on{/tr}<br/>
<b>{$nvi_info.lastVisit|tiki_short_datetime|replace:"[":""|replace:"]":""}</b><br/>
{$nvi_info.images} {tr}new images{/tr}<br/>
{$nvi_info.pages} {tr}wiki pages changed{/tr}<br/>
{$nvi_info.files} {tr}new files{/tr}<br/>
{$nvi_info.comments} {tr}new comments{/tr}<br/>
{$nvi_info.users} {tr}new users{/tr}<br/>
</div>
</div>
{/if}
|
Use javascript to switch perspective on select change (and hide "Go" button) if enabled, to be more consistent with other modules (theme, lang etc) | {if $perspectives|@count gt 0}
{tikimodule error=$module_params.error title=$tpl_module_title name="perspective" flip=$module_params.flip decorations=$module_params.decorations nobox=$module_params.nobox notitle=$module_params.notitle}
<form method="get" action="tiki-switch_perspective.php">
<select name="perspective">
<option>{tr}Default{/tr}</option>
{foreach from=$perspectives item=persp}
<option value="{$persp.perspectiveId|escape}"{if $persp.perspectiveId eq $current_perspective} selected="selected"{/if}>{$persp.name|escape}</option>
{/foreach}
</select>
<input type="submit" value="{tr}Go{/tr}"/>
</form>
{if $tiki_p_perspective_admin eq 'y'}
<div align="center">
<a href="tiki-edit_perspective.php">{tr}Edit perspectives{/tr}</a>
</div>
{/if}
{/tikimodule}
{/if} | {if $perspectives|@count gt 0}
{tikimodule error=$module_params.error title=$tpl_module_title name="perspective" flip=$module_params.flip decorations=$module_params.decorations nobox=$module_params.nobox notitle=$module_params.notitle}
<form method="get" action="tiki-switch_perspective.php">
<select name="perspective" onchange="this.form.submit();">
<option>{tr}Default{/tr}</option>
{foreach from=$perspectives item=persp}
<option value="{$persp.perspectiveId|escape}"{if $persp.perspectiveId eq $current_perspective} selected="selected"{/if}>{$persp.name|escape}</option>
{/foreach}
</select>
<noscript>
<input type="submit" value="{tr}Go{/tr}"/>
</noscript>
</form>
{if $tiki_p_perspective_admin eq 'y'}
<div align="center">
<a href="tiki-edit_perspective.php">{tr}Edit perspectives{/tr}</a>
</div>
{/if}
{/tikimodule}
{/if} |
Add cuda_is_configured() build macro for testing whether CUDA was enabled at configure time. Change: 141474932 | # Macros for building CUDA code.
def cuda_path_flags():
"""Stub for compatibility with internal build."""
return []
def if_cuda(if_true, if_false = []):
"""Shorthand for select()'ing on whether we're building with CUDA.
Returns a select statement which evaluates to if_true if we're building
with CUDA enabled. Otherwise, the select statement evaluates to if_false.
"""
return select({
"@local_config_cuda//cuda:using_nvcc": if_true,
"//conditions:default": if_false
})
def if_cuda_is_configured(x):
"""Tests if the CUDA was enabled during the configure process.
Unlike if_cuda(), this does not require that we are building with
--config=cuda. Used to allow non-CUDA code to depend on CUDA libraries.
"""
if %{cuda_is_configured}:
return x
return []
| # Macros for building CUDA code.
def cuda_path_flags():
"""Stub for compatibility with internal build."""
return []
def if_cuda(if_true, if_false = []):
"""Shorthand for select()'ing on whether we're building with CUDA.
Returns a select statement which evaluates to if_true if we're building
with CUDA enabled. Otherwise, the select statement evaluates to if_false.
"""
return select({
"@local_config_cuda//cuda:using_nvcc": if_true,
"//conditions:default": if_false
})
def cuda_is_configured():
"""Returns true if CUDA was enabled during the configure process."""
return %{cuda_is_configured}
def if_cuda_is_configured(x):
"""Tests if the CUDA was enabled during the configure process.
Unlike if_cuda(), this does not require that we are building with
--config=cuda. Used to allow non-CUDA code to depend on CUDA libraries.
"""
if cuda_is_configured():
return x
return []
|
Hide empty fields in HTML popup | <table class="lizmapPopupTable">
<thead>
<tr>
<th>{@view~map.popup.table.th.data@}</th>
<th>{@view~map.popup.table.th.value@}</th>
</tr>
</thead>
<tbody>
{foreach $attributes as $attribute}
{if $attribute['name'] != 'geometry' && $attribute['name'] != 'maptip'}
<tr>
<th>{$attribute['name']}</th>
<td>{$attribute['name']|featurepopup:$attribute['value'],$repository,$project}</td>
</tr>
{/if}
{/foreach}
</tbody>
</table>
| <table class="lizmapPopupTable">
<thead>
<tr>
<th>{@view~map.popup.table.th.data@}</th>
<th>{@view~map.popup.table.th.value@}</th>
</tr>
</thead>
<tbody>
{foreach $attributes as $attribute}
{if $attribute['name'] != 'geometry' && $attribute['name'] != 'maptip' && $attribute['value'] != ''}
<tr>
<th>{$attribute['name']}</th>
<td>{$attribute['name']|featurepopup:$attribute['value'],$repository,$project}</td>
</tr>
{/if}
{/foreach}
</tbody>
</table>
|
Update dirs with docker volume mount | {{/*
Config dirs
*/}}
{{- define "config.dirs" }}
- name: POLYAXON_DIRS_DOCKER
value: {{ .Values.dirs.docker | quote }}
- name: POLYAXON_DIRS_NVIDIA
value: {{ toJson .Values.dirs.nvidia | quote }}
{{- if and .Values.mountPaths.nvidia.lib .Values.mountPaths.nvidia.bin .Values.mountPaths.nvidia.libcuda }}
- name: POLYAXON_MOUNT_PATHS_NVIDIA
value: {{ toJson .Values.mountPaths.nvidia | quote }}
- name: LD_LIBRARY_PATH
value: "{{ .Values.mountPaths.nvidia.lib }}:{{ .Values.mountPaths.nvidia.libcuda }}"
{{- else if and .Values.dirs.nvidia.lib .Values.dirs.nvidia.bin .Values.dirs.nvidia.libcuda }}
- name: POLYAXON_MOUNT_PATHS_NVIDIA
value: {{ toJson .Values.dirs.nvidia | quote }}
- name: LD_LIBRARY_PATH
value: "{{ .Values.dirs.nvidia.lib }}:{{ .Values.dirs.nvidia.libcuda }}"
{{- end }}
{{- end -}}
| {{/*
Config dirs
*/}}
{{- define "config.dirs" }}
- name: POLYAXON_DIRS_DOCKER
value: {{ .Values.dirs.docker | quote }}
- name: POLYAXON_DIRS_NVIDIA
value: {{ toJson .Values.dirs.nvidia | quote }}
{{- if .Values.mountPaths.docker }}
- name: POLYAXON_MOUNT_PATHS_DOCKER
value: {{ toJson .Values.mountPaths.docker | quote }}
{{- else }}
- name: POLYAXON_MOUNT_PATHS_DOCKER
value: {{ toJson .Values.dirs.docker | quote }}
{{- end }}
{{- if and .Values.mountPaths.nvidia.lib .Values.mountPaths.nvidia.bin .Values.mountPaths.nvidia.libcuda }}
- name: POLYAXON_MOUNT_PATHS_NVIDIA
value: {{ toJson .Values.mountPaths.nvidia | quote }}
- name: LD_LIBRARY_PATH
value: "{{ .Values.mountPaths.nvidia.lib }}:{{ .Values.mountPaths.nvidia.libcuda }}"
{{- else if and .Values.dirs.nvidia.lib .Values.dirs.nvidia.bin .Values.dirs.nvidia.libcuda }}
- name: POLYAXON_MOUNT_PATHS_NVIDIA
value: {{ toJson .Values.dirs.nvidia | quote }}
- name: LD_LIBRARY_PATH
value: "{{ .Values.dirs.nvidia.lib }}:{{ .Values.dirs.nvidia.libcuda }}"
{{- end }}
{{- end -}}
|
Fix typo in XAMPP name + fix potential security flaws | <h2>Use <a href="http://ph7cms.com">pH7CMS</a> on a non-Linux system</h2>
<p>Of course, you can also install <strong>pH7CMS</strong> on Mac and Windows!</p>
<p>All pH7CMS versions are compatible with Mac OS and from <em>pH7CMS 1.0.2</em> with Windows OS.</p>
<p>You can install a server manually but to simplify tasks, we generally recommend <a href="http://www.mamp.info" target="_blank"><strong>MAMP</strong></a> for Mac and <a href="https://www.apachefriends.org" target="_blank"><strong>XAMP</strong></a>/<a href="http://www.wampserver.com" target="_blank"><strong>Wamp</strong></a> for Windows.</p>
<p>Please make sure you download the package with PHP 5.6/7 versions or higher.</p>
<p>These software allow you to quickly install a server environment on a non-Linux server and it often prevents problems.</p>
<p>Keep in mind that for security reasons, these kind of software is only recommended for a development/private server and not for a production server. Please refer to the website of the software for more information.</p>
| <h2>Use <a href="http://ph7cms.com">pH7CMS</a> on a non-Linux system</h2>
<p>Of course, you can also install <strong>pH7CMS</strong> on Mac and Windows!</p>
<p>All pH7CMS versions are compatible with Mac OS and from <em>pH7CMS 1.0.2</em> with Windows OS.</p>
<p>You can install a server manually but to simplify tasks, we generally recommend <a href="http://www.mamp.info" rel="noopener" target="_blank"><strong>MAMP</strong></a> for Mac and <a href="https://www.apachefriends.org" rel="noopener" target="_blank"><strong>XAMPP</strong></a>/<a href="http://www.wampserver.com" rel="noopener" target="_blank"><strong>Wamp</strong></a> for Windows.</p>
<p>Please make sure you download the package with PHP 5.6/7 versions or higher.</p>
<p>These software allow you to quickly install a server environment on a non-Linux server and it often prevents problems.</p>
<p>Keep in mind that for security reasons, these kind of software is only recommended for a development/private server and not for a production server. Please refer to the website of the software for more information.</p>
|
Fix title of checkin complete page | {extends designs/site.tpl}
{block title}How to help — {$dwoo.parent}{/block}
{block content}
{$Checkin = $data}
<div class="page-header">
<h1>{_ "Success!"}</h1>
</div>
<p>Thanks for checking in {if $Checkin->Project}to {projectLink $Checkin->Project}{/if} @ {Laddr::$siteName|escape}!</p>
<h2>{_ "Things to do next:"}</h2>
<ul>
{if $Checkin->Project}
<li><a href="{$Checkin->Project->getURL()}">{_ "Post an update to your project"}</a></li>
{else}
<li><a href="/projects">{_ "Find or start a project"}</a></li>
{/if}
<li><a href="/">{_ "Return to the home page"}</a></li>
{if $.Session->hasAccountLevel('Developer')}
<li><a href="/develop#/html-templates/checked-in.tpl">{_ "Add stuff to this list"}</a></li>
{/if}
</ul>
{/block} | {extends designs/site.tpl}
{block title}Checkin Complete — {$dwoo.parent}{/block}
{block content}
{$Checkin = $data}
<div class="page-header">
<h1>{_ "Success!"}</h1>
</div>
<p>Thanks for checking in {if $Checkin->Project}to {projectLink $Checkin->Project}{/if} @ {Laddr::$siteName|escape}!</p>
<h2>{_ "Things to do next:"}</h2>
<ul>
{if $Checkin->Project}
<li><a href="{$Checkin->Project->getURL()}">{_ "Post an update to your project"}</a></li>
{else}
<li><a href="/projects">{_ "Find or start a project"}</a></li>
{/if}
<li><a href="/">{_ "Return to the home page"}</a></li>
{if $.Session->hasAccountLevel('Developer')}
<li><a href="/develop#/html-templates/checked-in.tpl">{_ "Add stuff to this list"}</a></li>
{/if}
</ul>
{/block} |
Add Google API key form | <div class="col-md-8">
{{ ConfigFileCoreForm::display('service.api', PH7_PATH_APP_CONFIG) }}
<p class="small">{lang}Google Map might not be working if you are not using a API key. It is highly recommended to use one.{/lang}<br />
{lang 'You can get one <a href="%0%">here</a>. Enable Google Map API (which is disabled by default). Finally create an API key. Select "Api Key" for the Credential type, then select "Server Key", them you will get your API key to paste in this form. ', 'http://console.developers.google.com/apis/library'}</p>
</div> | |
Join Collaborations - The first search result starts at the wrong location. | {foreach $results as $result}
<div class="col-md-6">
{assign var=grpname value="syn_organicgrp_`$result.object_id`"}
{if not $grpname|in_group}
{include file="syn-groupsbox.tpl" private="{if $result.status == 'o'}n{elseif $result.status == 'p'}y{/if}"}
{/if}
</div>
{/foreach}
| {foreach $results as $result}
{assign var=grpname value="syn_organicgrp_`$result.object_id`"}
{if not $grpname|in_group}
<div class="col-md-6">
{include file="syn-groupsbox.tpl" private="{if $result.status == 'o'}n{elseif $result.status == 'p'}y{/if}"}
</div>
{/if}
{/foreach}
|
Add template for list with label and URI | <ul>
{% for item in items %}
{% if item['@id'] as uri %}
<a href="{{ uri }}">
<li>{{ item['rdfs:label'] }}</li>
</a>
{% else %}
<li>{{ item['rdfs:label'] }}</li>
{% endif %}
{% endfor %}
</ul>
| |
Check on admin rights of link to admin | {% with m.config.i18n.language_list.list as languages %}
{% with m.rsc[id].language as r_lang %}
{% wire id=#form type="submit"
postback={
rsc_edit_basics
id=id
edge_id=edge_id
update_element=update_element
template=template
actions=actions
callback=callback
is_update=is_update
}
delegate=delegate
%}
<form id="{{ #form }}" method="POST" action="postback" class="form">
<div class="tabbable">
{% block tabbar %}
<ul class="nav nav-pills">
<li class="active"><a data-toggle="tab" href="#{{ #main }}">{_ Main _}</a></li>
<li><a data-toggle="tab" href="#{{ #acl }}">{_ Access control _}</a></li>
</ul>
{% endblock %}
<div class="tab-content">
{% block tab_content %}
<div class="tab-pane form-horizontal active" id="{{ #main }}">
{% catinclude "_admin_edit_basics.tpl" id in_dialog is_editable=id.is_editable languages=languages %}
{% if id.is_a.category or id.is_a.predicate %}
<div class="form-group row">
<label class="control-label col-md-3" for="{{ #unique }}">{_ Unique name _}</label>
<div class="col-md-9">
<input class="form-control" type="text" id="{{ #unique }}" name="name" value="{{ id.name }}" />
{% validate id=#unique name="name" type={presence} %}
</div>
</div>
{% endif %}
<div class="form-group row">
<label class="control-label col-md-3" for="{{ #published }}">{_ Published _}</label>
<div class="col-md-9">
<div class="checkbox">
<label>
<input type="checkbox" id="{{ #published }}" name="is_published" value="1" {% if id.is_published %}checked="checked"{% endif %} />
</label>
</div>
</div>
</div>
</div>
{% endblock %}
{% block tab_visible_for %}
<div class="tab-pane form-horizontal" id="{{ #acl }}">
{% include "_admin_edit_visible_for.tpl" id=id %}
</div>
{% endblock %}
{% block tab_extra %}
{% endblock %}
</div>
</div>
<div class="modal-footer">
{% button class="btn btn-default" action={dialog_close} text=_"Cancel" tag="a" %}
{% if m.acl.use.mod_admin %}
<a href="{% url admin_edit_rsc id=id %}" class="btn btn-default">{_ Visit full edit page _}</a>
{% endif %}
{% button class="btn btn-primary" type="submit" text=_"Save" %}
</div>
</form>
{% endwith %}
{% endwith %}
| |
Enable watch events for comments on wiki pages | {tr}The page {$mail_page} was commented by {$mail_user} at {$mail_date|tiki_short_datetime}{/tr}
{tr}You can view the page following this link:{/tr}
{$mail_machine}?page={$mail_page|escape:"url"}
{tr}Title{/tr}: {$mail_title}
{tr}Comment:{/tr} {$mail_comment}
{tr}If you don't want to receive these notifications follow this link:{/tr}
{$mail_machine_raw}/tiki-user_watches.php?hash={$mail_hash}
| |
Add a new doc page | <h2>How to set the development mode</h2>
<p>To set the development mode, please edit <code>~/_YOUR-PROTECTED-FOLDER/app/configs/config.ini</code><br />
Replace <code>"environment = production"</code> by <code>"environment = development"</code> at the beginning of the file.<br /><br />
After that, it is also better to clear your browser cache (CTRL+F5).</p>
| |
Add a test template for event messages | <h4>Events</h4>
<table id="messageDumpTable" style="font-size:0.8em;border-collapse:collapse;">
<thead>
<tr>
<th>Date</th>
<th>Reason</th>
<th> </th>
</tr>
</thead>
<tbody>
<? for event events ?>
<tr>
<td><?=event.putDate?></td>
<td><?=event.reason?> - <?= event.desc ?></td>
<td><?=event.id?></td>
<td>
<?= event.fields ?>
</td>
</tr>
<? endfor ?>
</tbody>
</table> | |
Remove hard code from testing | /*
* Partial src: https://github.com/eris-ltd/hello-eris/blob/master/contracts/DealManager.sol
*/
import "Task.sol";
import "SequenceList.sol";
contract TaskManager {
SequenceList list = new SequenceList();
/*modifier onlyOwner() {
if (msg.sender != owner)
throw;
_ // `_` is synonymous to JS middleware's `next()`
}*/
// TODO extend with eventObject if possible; `bytes32[]`?
event ActionEvent(address indexed userAddr, bytes32 actionType);
function registerActionEvent(bytes32 actionType) {
ActionEvent(msg.sender, actionType);
}
/**
* Adds a new task with the specified attributes
*/
function addTask(bytes32 _id, bytes32 _title, bytes32 _desc, bytes32 _status, bytes32 _complete, bytes32 _reward)
returns (bool isOverwrite)
{
Task t = new Task(_id, _title, _desc, _status, _complete, _reward);
isOverwrite = list.insert(_id, t);
registerActionEvent("ADD TASK");
return isOverwrite;
}
// TODO
function getTaskAtIndex(uint _idx) constant returns (address, uint) {
registerActionEvent("GET TASK");
return list.valueAtIndexHasNext(0);
}
function getTaskListSize() constant returns (uint) {
registerActionEvent("GET SIZE");
return list.size();
}
function getTaskKeyAtIndex(uint _idx) constant returns (bytes32) {
return list.keyAtIndex(_idx);
}
}
| /*
* Partial src: https://github.com/eris-ltd/hello-eris/blob/master/contracts/DealManager.sol
*/
import "Task.sol";
import "SequenceList.sol";
contract TaskManager {
SequenceList list = new SequenceList();
/*modifier onlyOwner() {
if (msg.sender != owner)
throw;
_ // `_` is synonymous to JS middleware's `next()`
}*/
// TODO extend with eventObject if possible; `bytes32[]`?
event ActionEvent(address indexed userAddr, bytes32 actionType);
function registerActionEvent(bytes32 actionType) {
ActionEvent(msg.sender, actionType);
}
/**
* Adds a new task with the specified attributes
*/
function addTask(bytes32 _id, bytes32 _title, bytes32 _desc, bytes32 _status, bytes32 _complete, bytes32 _reward)
returns (bool isOverwrite)
{
Task t = new Task(_id, _title, _desc, _status, _complete, _reward);
isOverwrite = list.insert(_id, t);
registerActionEvent("ADD TASK");
return isOverwrite;
}
// TODO
function getTaskAtIndex(uint _idx) constant returns (address, uint) {
registerActionEvent("GET TASK");
return list.valueAtIndexHasNext(_idx);
}
function getTaskListSize() constant returns (uint) {
registerActionEvent("GET SIZE");
return list.size();
}
function getTaskKeyAtIndex(uint _idx) constant returns (bytes32) {
return list.keyAtIndex(_idx);
}
}
|
Update pragma version for test contract | pragma solidity ^0.4.24;
contract NewPragma {
uint x;
constructor() public {
x = 5;
}
}
| pragma solidity ^0.5.0;
contract NewPragma {
uint x;
constructor() public {
x = 5;
}
}
|
Add new example of http post request | #include <amxmodx>
#include <curl>
#pragma semicolon 1
#pragma ctrlchar '\'
public plugin_init()
{
register_plugin("HTTP: Post request", "1.0.0", "gamingEx aka. Kaido Ren");
@requestBegin();
}
enum dataStruct { curl_slist: linkedList };
@requestBegin()
{
new CURL: pCurl, curl_slist: pHeaders, sData[dataStruct];
pHeaders = curl_slist_append(pHeaders, "Content-Type: application/json");
pHeaders = curl_slist_append(pHeaders, "User-Agent: curl");
sData[linkedList] = pHeaders;
if ((pCurl = curl_easy_init())) {
curl_easy_setopt(pCurl, CURLOPT_URL, "http://jsonplaceholder.typicode.com/posts");
curl_easy_setopt(pCurl, CURLOPT_COPYPOSTFIELDS, "{\"title\": \"foo\", \"body\": \"bar\", \"userId\": 1}");
curl_easy_setopt(pCurl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(pCurl, CURLOPT_HTTPHEADER, pHeaders);
curl_easy_setopt(pCurl, CURLOPT_WRITEFUNCTION, "@responseWrite");
curl_easy_perform(pCurl, "@requestComplete", sData, dataStruct);
}
}
@responseWrite(const data[], const size, const nmemb)
{
server_print("Response body: \n%s", data);
return size * nmemb; // tell curl how many bytes we handled
}
@requestComplete(CURL: curl, CURLcode: code, const data[dataStruct])
{
if (code != CURLE_OK) {
new szError[128];
curl_easy_strerror(code, szError, charsmax(szError));
server_print("CURL: %s", szError);
}
curl_easy_cleanup(curl);
curl_slist_free_all(data[linkedList]);
} | |
Add the beginnings of a Richards benchmark. |
; Based on V8 JavaScript richards
ID_IDLE: 0,
ID_WORKER: 1,
ID_HANDLER_A: 2,
ID_HANDLER_B: 3,
ID_DEVICE_A: 4,
ID_DEVICE_B: 5,
NUMBER_OF_IDS: 6,
COUNT: 10000,
EXPECTED_QUEUE_COUNT: 23246,
EXPECTED_HOLD_COUNT: 9297,
STATE_RUNNING: 0,
STATE_RUNNABLE: 1,
STATE_SUSPENDED: 2,
STATE_HELD: 4,
STATE_SUSPENDED_RUNNABLE: STATE_SUSPENDED | STATE_RUNNABLE,
STATE_NOT_HELD: -5,
DATA_SIZE: 4,
; The Richards benchmark simulates the task dispatcher of an
; operating system.
runRichards = #(
scheduler = Scheduler create
queue = Packet create(nil, ID_WORKER, :work)
workerQueue = Packet create(queue, ID_WORKER, :work)
queue = Packet create(nil, ID_DEVICE_A, :device)
queue = Packet create(queue, ID_DEVICE_A, :device)
handlerQueue = Packet create(queue, ID_DEVICE_A, :device)
queue = Packet create(nil, ID_DEVICE_B, :device)
queue = Packet create(queue, ID_DEVICE_B, :device)
handlerQueue2 = Packet create(queue, ID_DEVICE_B, :device)
s0 = scheduler withIdleTask(ID_IDLE, 0, nil, COUNT)
s1 = s0 withWorkerTask(ID_WORKER, 1000, workerQueue)
s2 = s1 withHandlerTask(ID_HANDLER_A, 2000, handlerQueue)
s3 = s2 withHandlerTask(ID_HANDLER_B, 3000, handlerQueue2)
s4 = s3 withDeviceTask(ID_DEVICE_A, 4000, nil)
s5 = s4 withDeviceTask(ID_DEVICE_B, 5000, nil)
result = s5 schedule!
if(result queueCount != EXPECTED_QUEUE_COUNT || result holdCount != EXPECTED_HOLD_COUNT,
"Error during execution: queueCount = #{result queueCount}, holdCount = #{result holdCount}." println)
)
| |
Exclude entities with ONLY a type declaration from label check | # # Missing Label
#
# Problem: An entity does not have a label. This may cause confusion or misuse.
#
# Solution: Add a label.
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?entity ?property ?value WHERE {
?entity ?any ?o .
BIND ("rdfs:label" AS ?property) .
FILTER NOT EXISTS {?entity rdfs:label ?value}
FILTER NOT EXISTS {?entity a owl:Ontology}
FILTER NOT EXISTS {
?entity owl:deprecated ?dep .
FILTER regex(str(?dep), "true")
}
FILTER (!isBlank(?entity))
}
ORDER BY ?entity | # # Missing Label
#
# Problem: An entity does not have a label. This may cause confusion or misuse.
#
# Solution: Add a label.
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?entity ?property ?value WHERE {
?entity ?any ?o .
BIND ("rdfs:label" AS ?property) .
FILTER NOT EXISTS {?entity rdfs:label ?value}
FILTER NOT EXISTS {?entity a owl:Ontology}
FILTER NOT EXISTS {
?entity owl:deprecated ?dep .
FILTER regex(str(?dep), "true")
}
FILTER EXISTS {
?entity ?property ?object .
FILTER (?property != rdf:type)
}
FILTER (!isBlank(?entity))
}
ORDER BY ?entity |
Create queries to process genre statements | # 1) Remove split statements from publications
SPARQL
PREFIX migration: <http://migration.deichman.no/>
PREFIX : <http://data.deichman.no/ontology#>
WITH <http://deichman.no/migration>
delete {
?doc ?p ?o
} where {
?doc a :Publication ;
?p ?o .
values ?p {
migration:genreSplit1
migration:genreSplit2
migration:genreSplitMain
migration:genreSplitSub
}
}
; | |
Add sketch of RWO to MADSRDF Name construct | PREFIX madsrdf: <http://www.loc.gov/mads/rdf/v1#>
CONSTRUCT {
?name a madsrdf:PersonalName ;
madsrdf:identifiesRWO ?s ;
madsrdf:elementList (
?givenElem
?famnameElem
) .
?famnameElem a madsrdf:FamilyNameElement ; madsrdf:elementValue ?familyName .
?givenElem a madsrdf:GivenNameElement ; madsrdf:elementValue ?givenName .
} WHERE {
?s a :Person .
BIND(bnode() as ?name)
OPTIONAL {
?s :familyName ?familyName .
BIND(bnode() as ?famnameElem)
}
OPTIONAL {
?s givenName ?givenName .
BIND(bnode() as ?givenElem)
}
}
| |
Switch to [] spawn from execVM | /*
Wolfe Edits get init'd here!
*/
//[] execVM "init_TFAR.sqf"; //TFAR Init
[] execVM "init_ACE_Spray.sqf"; //Ace3 Custom Sprays Init
| /*
Wolfe Edits get init'd here!
*/
//[] execVM "init_TFAR.sqf"; //TFAR Init
[] spawn "init_ACE_Spray.sqf"; //Ace3 Custom Sprays Init
|
Move mission announcement a little up | // ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com *
// ******************************************************************************************
//@file Version: 1.0
//@file Name: init.sqf
//@file Author: [404] Deadbeat / edited by LouD
//@file Created: 20/11/2012 05:19
diag_log format["Message %1",messageSystem];
_hint = messageSystem;
//hint _hint;
[
_hint,
[
0,
safeZoneY + 0.15,
1,
1
],
[10,10],
8,
1.5,
0
] spawn BIS_fnc_textTiles; | // ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com *
// ******************************************************************************************
//@file Version: 1.0
//@file Name: init.sqf
//@file Author: [404] Deadbeat / edited by LouD
//@file Created: 20/11/2012 05:19
diag_log format["Message %1",messageSystem];
_hint = messageSystem;
//hint _hint;
[
_hint,
[
0,
safeZoneY + 0.03,
1,
1
],
[10,10],
8,
1.5,
0
] spawn BIS_fnc_textTiles; |
Remove spawn from track projectile | params ["_projectile", "_side"];
private _id = format ["%1", _projectile];
private _position = getPosASL _projectile;
private _dir = direction _projectile;
private _simulation = getText (configFile >> "cfgAmmo" >> typeOf _projectile >> "simulation");
private _lastTime = time;
waitUntil {
if !(isNull _projectile) then {
_dir = direction _projectile;
_position = getPosASL _projectile;
if (time >= (_lastTime + 1)) then {
_lastTime = time;
[_id, _position, _dir, _simulation, _side] spawn {
params ["_id", "_position", "_dir", "_simulation", "_side"];
private _arr = ["object",
["type", ["string", "ProjectilePosition"]],
["projectile", [_id, ([_position, _dir] call anrop_aar_fnc_serializePosition), _side, _simulation] call anrop_aar_fnc_serializeProjectile]
];
_arr call anrop_aar_fnc_sendEvent;
};
};
};
isNull _projectile;
};
private _arr = ["object",
["type", ["string", "ProjectileDestroyed"]],
["projectile", [_id, ([_position, _dir] call anrop_aar_fnc_serializePosition), _side, _simulation] call anrop_aar_fnc_serializeProjectile]
];
_arr call anrop_aar_fnc_sendEvent;
| params ["_projectile", "_side"];
private _id = format ["%1", _projectile];
private _position = getPosASL _projectile;
private _dir = direction _projectile;
private _simulation = getText (configFile >> "cfgAmmo" >> typeOf _projectile >> "simulation");
private _lastTime = time;
waitUntil {
if !(isNull _projectile) then {
_dir = direction _projectile;
_position = getPosASL _projectile;
if (time >= (_lastTime + 1)) then {
_lastTime = time;
private _arr = ["object",
["type", ["string", "ProjectilePosition"]],
["projectile", [_id, ([_position, _dir] call anrop_aar_fnc_serializePosition), _side, _simulation] call anrop_aar_fnc_serializeProjectile]
];
_arr call anrop_aar_fnc_sendEvent;
};
};
isNull _projectile;
};
private _arr = ["object",
["type", ["string", "ProjectileDestroyed"]],
["projectile", [_id, ([_position, _dir] call anrop_aar_fnc_serializePosition), _side, _simulation] call anrop_aar_fnc_serializeProjectile]
];
_arr call anrop_aar_fnc_sendEvent;
|
Add query for selecting coursework for student users | SELECT Coursework.id AS coursework_id,
Coursework.title AS title,
Coursework.date_submitted AS date_submitted,
Coursework.file AS file,
Coursework.file_extension AS file_extension,
Coursework.class_id AS class_id,
Class.module_id AS module_id,
Module.name AS module_name,
User.id AS lecturer_id,
Lecturer.email AS lecturer_email,
User.first_name AS lecturer_firstname,
User.last_name AS lecturer_lastname
FROM Coursework
INNER JOIN Class ON Class.id = Coursework.class_id
INNER JOIN Module ON Module.id = Class.module_id
INNER JOIN Lecturer ON Lecturer.user_id = Class.lecturer_user_id
INNER JOIN User ON User.id = Lecturer.user_id
WHERE Class.semester_id = 'C15' AND Coursework.student_user_id = 1; | |
Add SQL script to output workspace IDs Looks like internal workspaces don't have the source_identifier set. Previously was using the condition: | set echo off
set verify off
set feedback off
set heading off
set trimspool on
set termout off
set pagesize 0
spool &1
select to_char(workspace_id)
from apex_workspaces
where source_identifier is null;
spool off
exit
| |
Create topology and use pgRouting | -- Install extensions
CREATE EXTENSION postgis;
CREATE EXTENSION postgis_topology;
CREATE EXTENSION pgrouting;
SET search_path = topology,public;
-- Part I: Create topology for 'roads' with postgis_topology
SELECT topology.CreateTopology('roads_topo', 4326);
SELECT topology.AddTopoGeometryColumn('roads_topo', 'public', 'roads', 'topo_geom', 'LINESTRING');
-- Create Topology Layer 1 with tolerance 0.000007
DO $$DECLARE r record;
BEGIN
FOR r IN SELECT * FROM roads LOOP
BEGIN
UPDATE roads SET topo_geom = topology.toTopoGeom(geom, 'roads_topo', 1, 0.000007)
WHERE gid = r.gid;
EXCEPTION
WHEN OTHERS THEN
RAISE WARNING 'Loading of record % failed: %', r.osm_id, SQLERRM;
END;
END LOOP;
END$$;
-- Verify Topology
SELECT * FROM
topology.TopologySummary('roads_topo');
-- PartII: Create topology with pgRouting (for shortest path calculation)
ALTER TABLE roads ADD COLUMN "source" integer;
ALTER TABLE roads ADD COLUMN "target" integer;
SELECT pgr_createTopology('roads', 0.00001, 'geom', 'gid');
-- Add columns for cost and reverse cost
ALTER TABLE roads ADD COLUMN "cost" double precision;
ALTER TABLE roads ADD COLUMN "reverse_cost" double precision;
-- Fill cost and reverse cost with data
UPDATE roads SET
cost = ST_Length(geom),
reverse_cost= ST_Length(geom);
--Calculate shortest path between id 323 and 100
SELECT seq, id1 AS node, id2 AS edge, cost FROM pgr_dijkstra('
SELECT gid AS id,
source::integer,
target::integer,
cost::double precision
FROM roads',
100, 323, false, false
);
| |
Change TO ds table protocol column to not null | /*
Copyright 2016 Comcast Cable Communications Management, LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
-- +goose Up
-- SQL in section 'Up' is executed when this migration is applied
alter table deliveryservice modify protocol tinyint(4) DEFAULT '0' NOT NULL;
-- +goose Down
-- SQL section 'Down' is executed when this migration is rolled back
alter table deliveryservice modify protocol tinyint(4) DEFAULT '0';
| |
Change ARVO table columns regarding taustakysymys. | IF NOT EXISTS (
select * from INFORMATION_SCHEMA.COLUMNS
where TABLE_SCHEMA='dbo' and TABLE_NAME='sa_arvo_kaikki'
and COLUMN_NAME='taustakysymykset'
) BEGIN
ALTER TABLE dbo.sa_arvo_kaikki ADD
taustakysymykset bit NULL
END
IF EXISTS (
select * from INFORMATION_SCHEMA.COLUMNS
where TABLE_SCHEMA='dbo' and TABLE_NAME='sa_arvo_kaikki'
and COLUMN_NAME='taustakysymys_ika'
) BEGIN
ALTER TABLE dbo.sa_arvo_kaikki DROP COLUMN
taustakysymys_ika
END
IF EXISTS (
select * from INFORMATION_SCHEMA.COLUMNS
where TABLE_SCHEMA='dbo' and TABLE_NAME='sa_arvo_kaikki'
and COLUMN_NAME='taustakysymys_sukupuoli'
) BEGIN
ALTER TABLE dbo.sa_arvo_kaikki DROP COLUMN
taustakysymys_sukupuoli
END
IF EXISTS (
select * from INFORMATION_SCHEMA.COLUMNS
where TABLE_SCHEMA='dbo' and TABLE_NAME='sa_arvo_kaikki'
and COLUMN_NAME='taustakysymys_pohjakoulutus'
) BEGIN
ALTER TABLE dbo.sa_arvo_kaikki DROP COLUMN
taustakysymys_pohjakoulutus
END
| |
Add constraint to datasetVersion table | /* ----------------------------------------
Add unique constraint to prevent multiple drafts
Ticket 2132
*/ ----------------------------------------
ALTER TABLE datasetversion
ADD CONSTRAINT uq_datasetversion UNIQUE(dataset_id, versionnumber, minorversionnumber);
| |
Implement notification for IACUC Rescheduled event | INSERT INTO NOTIFICATION_TYPE (NOTIFICATION_TYPE_ID, MODULE_CODE, ACTION_CODE, DESCRIPTION, SUBJECT, MESSAGE, PROMPT_USER, SEND_NOTIFICATION, UPDATE_USER, UPDATE_TIMESTAMP, VER_NBR, OBJ_ID)
VALUES(SEQ_NOTIFICATION_TYPE_ID.NEXTVAL, (SELECT MODULE_CODE FROM COEUS_MODULE WHERE DESCRIPTION='IACUC Protocol'),'202','IACUC Protocol Rescheduled','IACUC Protocol {PROTOCOL_NUMBER} Rescheduled','The IACUC protocol number <a title="" target="_self" href="{DOCUMENT_PREFIX}/kew/DocHandler.do?command=displayDocSearchView&docId={DOCUMENT_NUMBER}">{PROTOCOL_NUMBER}</a>, Principal Investigator {PI_NAME} has had the action "Reschedule" performed on it.<br />The action was executed by {USER_FULLNAME}. Additional information and further actions can be accessed through the Kuali Coeus system.','Y','N','admin',SYSDATE,1,SYS_GUID())
/
INSERT INTO NOTIFICATION_TYPE_RECIPIENT (NOTIFICATION_TYPE_RECIPIENT_ID, NOTIFICATION_TYPE_ID, ROLE_NAME, UPDATE_USER, UPDATE_TIMESTAMP, VER_NBR, OBJ_ID, ROLE_SUB_QUALIFIER)
VALUES(SEQ_NOTIFICATION_TYPE_ID.NEXTVAL,(SELECT NOTIFICATION_TYPE_ID FROM NOTIFICATION_TYPE WHERE DESCRIPTION='IACUC Protocol Rescheduled'),'KC-IACUC:PI','admin',SYSDATE,1,SYS_GUID(), null)
/
INSERT INTO NOTIFICATION_TYPE_RECIPIENT (NOTIFICATION_TYPE_RECIPIENT_ID, NOTIFICATION_TYPE_ID, ROLE_NAME, UPDATE_USER, UPDATE_TIMESTAMP, VER_NBR, OBJ_ID, ROLE_SUB_QUALIFIER)
VALUES(SEQ_NOTIFICATION_TYPE_ID.NEXTVAL,(SELECT NOTIFICATION_TYPE_ID FROM NOTIFICATION_TYPE WHERE DESCRIPTION='IACUC Protocol Rescheduled'),'KC-UNT:IACUC Administrator','admin',SYSDATE,1,SYS_GUID(), null)
/
| |
Create sql migration to initialize database | CREATE SEQUENCE "public"."Movies_id_seq"
INCREMENT 1
MINVALUE 1
MAXVALUE 9223372036854775807
START 1
CACHE 1;
CREATE SEQUENCE "public"."M_genre_genre_id_seq"
INCREMENT 1
MINVALUE 1
MAXVALUE 9223372036854775807
START 1
CACHE 1;
CREATE OR REPLACE FUNCTION public.post_rating_update_func()
RETURNS trigger
LANGUAGE plpgsql
AS $function$
BEGIN
IF NEW.post_rating is distinct from OLD.post_rating and old.date_watched is null and new.date_watched is not distinct from old.date_watched THEN
NEW.date_watched := current_date;
END IF;
RETURN NEW;
END$function$;
COMMENT ON FUNCTION "public"."post_rating_update_func"() IS NULL;
CREATE TABLE "public"."m_genre" (
"genre_id" Integer DEFAULT nextval('"M_genre_genre_id_seq"'::regclass) NOT NULL,
"title" Character Varying( 100 ) NOT NULL,
PRIMARY KEY ( "genre_id" ) );
CREATE TABLE "public"."movies" (
"id" Integer DEFAULT nextval('"Movies_id_seq"'::regclass) NOT NULL,
"title" Character Varying( 100 ) NOT NULL,
"theater_release" Date,
"dvd_release" Date,
"date_watched" Date,
"pre_rating" SmallInt,
"post_rating" SmallInt,
"genre_id" Integer,
"active" Boolean DEFAULT true NOT NULL,
PRIMARY KEY ( "id" ),
CONSTRAINT "post_rating_range" CHECK((post_rating >= 0) AND (post_rating <= 100)),
CONSTRAINT "pre_rating_range" CHECK((pre_rating >= 0) AND (pre_rating <= 100)) );
CREATE TRIGGER trigger1 BEFORE UPDATE ON "public"."movies" FOR EACH ROW EXECUTE PROCEDURE post_rating_update_func();
| |
Add database patch for oauth_consumer flag. | -- Add a flag to oauth consumers to indicate whether
-- this key can be used with a grant_type of "password"
ALTER TABLE `oauth_consumers` ADD `enable_password_grant` TINYINT(1) DEFAULT 0;
INSERT INTO patch_history SET patch_number = 48;
| |
Make null function test more interesting. | SELECT name, order_date
FROM customers INNER JOIN orders ON customers.cid = orders.cid
WHERE name = SUBSTR(NULL, 10, 11)
| SELECT name, order_date
FROM customers INNER JOIN orders ON customers.cid = orders.cid
WHERE name = SUBSTR(name, NULL, 10)
|
Change type of timestamp columns | CREATE FUNCTION alter_timestamps() RETURNS void AS $$
DECLARE
columns varchar[] := ARRAY['creation_date',
'modification_date', 'publication_date'];
col varchar;
BEGIN
SET LOCAL timezone='UTC';
FOREACH col IN ARRAY columns
LOOP
EXECUTE format('ALTER TABLE articles '
'ALTER COLUMN %I TYPE timestamp with time zone',
col);
END LOOP;
END;
$$ LANGUAGE plpgsql;
SELECT alter_timestamps();
| |
Update evolutions, adding logical name to asset meta | # --- Add logical name of disks to asset meta
# --- !Ups
INSERT INTO asset_meta (name, priority, label, description) VALUES ('DISK_LOGICAL_NAME', -1, 'Disk logical name', 'The logical name of the disk as reported by lshw');
# --- !Downs
DELETE FROM asset_meta WHERE name ='DISK_LOGICAL_NAME'
| |
Add IF NOT EXISTS to all operations | /**
* Create Posts Table
*/
CREATE TABLE IF NOT EXISTS posts (
id INTEGER PRIMARY KEY AUTOINCREMENT,
title TEXT NOT NULL,
slug TEST NOT NULL,
text_raw TEXT NOT NULL,
text_compiled TEXT NOT NULL,
created_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
/**
* Create index for slug, title, and text_raw
*/
CREATE UNIQUE INDEX IF NOT EXISTS slug_idx ON posts(slug);
CREATE INDEX IF NOT EXISTS title_idx ON posts(title);
CREATE INDEX IF NOT EXISTS text_raw_idx ON posts(text_raw);
/**
* Create Posts Triggers to handle updates
*/
CREATE TRIGGER IF NOT EXISTS trigger_update_post AFTER UPDATE ON posts
BEGIN
UPDATE posts
SET updated_date = CURRENT_TIMESTAMP
WHERE id = OLD.id;
END;
/**
* Create Tags Table
*/
CREATE TABLE IF NOT EXISTS tags (
id INTEGER PRIMARY KEY AUTOINCREMENT,
tag TEXT NOT NULL,
created_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
/**
* Create Index on tag
*/
CREATE INDEX IF NOT EXISTS tag_idx ON tags(tag);
/**
* Create Tags Triggers to handle updates
*/
CREATE TRIGGER IF NOT EXISTS trigger_update_tag AFTER UPDATE ON tags
BEGIN
UPDATE tags
SET updated_date = CURRENT_TIMESTAMP
WHERE id = OLD.id;
END;
/**
* Create Association Table
* between posts and tags to
* resolve their M:M relationship
*/
CREATE TABLE IF NOT EXISTS posts_tags (
post_id INTEGER,
tag_id INTEGER,
FOREIGN KEY(post_id) REFERENCES posts(id) ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY(tag_id) REFERENCES tags(id)
);
| |
Add AddressBase Premium Address Point view | -- View: addressbase_premium.address_point
CREATE OR REPLACE VIEW addressbase_premium.address_point AS
SELECT deliverypointaddress.rmudprn AS OSAPR,
deliverypointaddress.departmentname AS departmentname,
deliverypointaddress.poboxnumber AS poboxnumber,
deliverypointaddress.organisationname AS organisationname,
deliverypointaddress.buildingnumber AS buildingnumber,
deliverypointaddress.subbuildingname AS subbuildingname,
deliverypointaddress.buildingname AS buildingname,
deliverypointaddress.thoroughfarename AS thoroughfarename,
deliverypointaddress.dependentthoroughfarename AS dependentthoroughfarename,
deliverypointaddress.posttown AS posttown,
deliverypointaddress.dependentlocality AS dependentlocality,
deliverypointaddress.doubledependentlocality AS doubledependentlocality,
NULL AS county,
substr(deliverypointaddress.postcode,1,4)||right(deliverypointaddress.postcode,3) AS postcode,
round(st_x(blpu.wkb_geometry)*10) as X,
round(st_y(blpu.wkb_geometry)*10) as Y,
NULL AS source_flag,
blpu.changetype AS changetype,
replace(deliverypointaddress.lastupdatedate, '-', '') AS lastupdatedate,
replace(deliverypointaddress.processdate, '-', '') AS processdate
FROM addressbase_premium.deliverypointaddress deliverypointaddress
LEFT JOIN addressbase_premium.basiclandpropertyunit blpu ON deliverypointaddress.uprn = blpu.uprn;
COMMENT ON VIEW addressbase_premium.address_point
IS 'Address Base Premium formated to look similar to Address Point!
Author: Andy Berry
www.dragontail.co.uk
Version 1.2 03-07-2014
';
| |
Add sample SQL template to create PostgreSQL VIEW for iRedMail server. | --
-- Notes:
--
-- * if you're running RHEL/CentOS 6 or 7, don't forget to uncomment lines
-- under `Required by RHEL/CentOS X` to create dblink function.
--
-- * of course you should replace `xxx` in below sample SQL command by the
-- real SQL username/password/database name.
--
-- * it's better to use SQL user `vmail` which has read-only permission to
-- `vmail` database. Don't use `vmailadmin` or `postgres` user.
--
-- Known issue on iRedMail server:
--
-- * Column `mailbox.created` stores timestamp when this account was created,
-- if the timestamp contains timezone info (e.g. 2015-02-28 22:31:16.562376),
-- this plugin cannot display any contact (causes SQL syntax error).
-- Changing the timestamp to 2015-02-28 22:31:16 (without time zone info)
-- fixes this issue.
--
-- Required by RHEL/CentOS 6.
--
-- CREATE LANGUAGE plpgsql;
-- \i /usr/share/pgsql/contrib/dblink.sql;
--
-- Required by RHEL/CentOS 7
--
-- CREATE EXTENSION dblink;
CREATE VIEW global_addressbook AS
SELECT * FROM dblink('host=127.0.0.1 port=5432 user=vmail password=xxx dbname=vmail', 'SELECT extract(epoch FROM created), name, username, domain FROM mailbox WHERE active=1')
AS global_addressbook ("ID" BIGINT, name VARCHAR(255), email VARCHAR(255), domain VARCHAR(255));
ALTER TABLE global_addressbook OWNER TO roundcube;
| |
Add millis to datetime fields in DB | ALTER TABLE SECURE_DATA
CHANGE CREATED_TS CREATED_TS DATETIME(3) NOT NULL,
CHANGE LAST_UPDATED_TS LAST_UPDATED_TS DATETIME(3) NOT NULL;
ALTER TABLE SECURE_DATA_VERSION
CHANGE ACTION_TS ACTION_TS DATETIME(3) NOT NULL,
CHANGE VERSION_CREATED_TS VERSION_CREATED_TS DATETIME(3) NOT NULL;
ALTER TABLE SAFE_DEPOSIT_BOX
CHANGE CREATED_TS CREATED_TS DATETIME(3) NOT NULL,
CHANGE LAST_UPDATED_TS LAST_UPDATED_TS DATETIME(3) NOT NULL;
ALTER TABLE USER_GROUP_PERMISSIONS
CHANGE CREATED_TS CREATED_TS DATETIME(3) NOT NULL,
CHANGE LAST_UPDATED_TS LAST_UPDATED_TS DATETIME(3) NOT NULL;
ALTER TABLE USER_GROUP
CHANGE CREATED_TS CREATED_TS DATETIME(3) NOT NULL,
CHANGE LAST_UPDATED_TS LAST_UPDATED_TS DATETIME(3) NOT NULL;
ALTER TABLE AWS_IAM_ROLE_PERMISSIONS
CHANGE CREATED_TS CREATED_TS DATETIME(3) NOT NULL,
CHANGE LAST_UPDATED_TS LAST_UPDATED_TS DATETIME(3) NOT NULL;
ALTER TABLE AWS_IAM_ROLE
CHANGE CREATED_TS CREATED_TS DATETIME(3) NOT NULL,
CHANGE LAST_UPDATED_TS LAST_UPDATED_TS DATETIME(3) NOT NULL;
ALTER TABLE CATEGORY
CHANGE CREATED_TS CREATED_TS DATETIME(3) NOT NULL,
CHANGE LAST_UPDATED_TS LAST_UPDATED_TS DATETIME(3) NOT NULL;
ALTER TABLE ROLE
CHANGE CREATED_TS CREATED_TS DATETIME(3) NOT NULL,
CHANGE LAST_UPDATED_TS LAST_UPDATED_TS DATETIME(3) NOT NULL; | |
Add occurrence date range columns to model runs db table | -- Updates the database schema to add occurrence_data_range_start_date and occurrence_data_range_end_date columns to the model_run table.
-- Copyright (c) 2015 University of Oxford
ALTER TABLE model_run ADD COLUMN occurrence_data_range_start_date timestamp;
ALTER TABLE model_run ADD COLUMN occurrence_data_range_end_date timestamp;
-- Set all old model runs to "now", as old model runs will be deleted and the data range is not retrivable for non-automatic historic runs.
UPDATE model_run
SET occurrence_data_range_start_date = statement_timestamp()
WHERE occurrence_data_range_start_date IS NULL;
UPDATE model_run
SET occurrence_data_range_end_date = statement_timestamp()
WHERE occurrence_data_range_end_date IS NULL;
ALTER TABLE model_run ALTER COLUMN occurrence_data_range_start_date SET NOT NULL;
ALTER TABLE model_run ALTER COLUMN occurrence_data_range_end_date SET NOT NULL;
| |
Add ProjectLicense SQL insert script | BEGIN;
INSERT INTO projectlicense VALUES(1, 'f', 'f', 'f', 't', 'GNU General Public License 2.0', 0, 'GPL-2.0', 'http://opensource.org/licenses/GPL-2.0');
INSERT INTO projectlicense VALUES(2, 'f', 'f', 'f', 't', 'GNU General Public License 3.0', 1, 'GPL-3.0', 'http://opensource.org/licenses/GPL-3.0');
INSERT INTO projectlicense VALUES(3, 'f', 'f', 'f', 't', 'GNU Lesser General Public License 2.1', 2, 'LGPL-2.1', 'http://opensource.org/licenses/LGPL-2.1');
INSERT INTO projectlicense VALUES(4, 'f', 'f', 'f', 't', 'GNU Lesser General Public License 3.0', 3, 'LGPL-3.0', 'http://opensource.org/licenses/LGPL-3.0');
INSERT INTO projectlicense VALUES(5, 'f', 'f', 'f', 't', 'BSD 2-Clause License', 4, 'BSD-2', 'http://opensource.org/licenses/BSD-2-Clause');
INSERT INTO projectlicense VALUES(6, 'f', 'f', 'f', 't', 'BSD 3-Clause License', 5, 'BSD-3', 'http://opensource.org/licenses/BSD-3-Clause');
INSERT INTO projectlicense VALUES(7, 'f', 'f', 'f', 't', 'Apache License 2.0', 6, 'AL-2.0', 'http://opensource.org/licenses/Apache-2.0');
INSERT INTO projectlicense VALUES(8, 'f', 'f', 'f', 't', 'Eclipse Public License', 7, 'EPL-1.0', 'http://opensource.org/licenses/EPL-1.0');
INSERT INTO projectlicense VALUES(9, 'f', 'f', 'f', 't', 'MIT License', 8, 'MIT', 'http://opensource.org/licenses/MIT');
COMMIT;
| |
Reduce index size to avoid error "1071 (42000) at line 302: Specified key was too long; max key length is 1000 bytes" | /* Reduce index size to avoid error "1071 (42000) at line 302: Specified key was too long; max key length is 1000 bytes" */
ALTER TABLE user
DROP INDEX user_category,
DROP INDEX user_last_first_name,
DROP INDEX user_first_last_name,
DROP INDEX user_phone,
DROP INDEX user_name
;
ALTER TABLE user
ADD INDEX user_category(category(128)),
ADD INDEX user_last_first_name(last_name(128),first_name(128)),
ADD INDEX user_first_last_name(first_name(128),last_name(128)),
ADD INDEX user_phone(phone(10))
;
| |
Add Weewx postgres database script. | --
-- PostgreSQL database initialization script
--
-- Execute it like this: psql -d <your_database> -f weewx_pg.sql
--
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;
SET search_path = public, pg_catalog;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: archive; Type: TABLE; Schema: public; Owner: weewx; Tablespace:
--
CREATE TABLE archive (
datetime timestamp without time zone NOT NULL,
usunits integer NOT NULL,
"interval" integer NOT NULL,
barometer real,
pressure real,
altimeter real,
intemp real,
outtemp real,
inhumidity real,
outhumidity real,
windspeed real,
winddir real,
windgust real,
windgustdir real,
rainrate real,
rain real,
dewpoint real,
windchill real,
heatindex real,
et real,
radiation real,
uv real,
extratemp1 real,
extratemp2 real,
extratemp3 real,
soiltemp1 real,
soiltemp2 real,
soiltemp3 real,
soiltemp4 real,
leaftemp1 real,
leaftemp2 real,
extrahumid1 real,
extrahumid2 real,
soilmoist1 real,
soilmoist2 real,
soilmoist3 real,
soilmoist4 real,
leafwet1 real,
leafwet2 real,
rxcheckpercent real,
txbatterystatus real,
consbatteryvoltage real,
hail real,
hailrate real,
heatingtemp real,
heatingvoltage real,
supplyvoltage real,
referencevoltage real,
windbatterystatus real,
rainbatterystatus real,
outtempbatterystatus real,
intempbatterystatus real
);
ALTER TABLE public.archive OWNER TO weewx;
--
-- Name: archive_pkey; Type: CONSTRAINT; Schema: public; Owner: weewx; Tablespace:
--
ALTER TABLE ONLY archive
ADD CONSTRAINT archive_pkey PRIMARY KEY (datetime);
| |
Add script with DB schema | CREATE TABLE IF NOT EXISTS entries
(
title TEXT,
content TEXT
);
CREATE TABLE IF NOT EXISTS tags
(
name TEXT
);
CREATE TABLE IF NOT EXISTS tags_entries
(
tag_id INTEGER,
entry_id INTEGER,
PRIMARY KEY (tag_id, entry_id)
)
WITHOUT ROWID;
| |
Define admin roles to import/export domains | Create or replace FUNCTION __temp_insert_add_domain_import_export_permissions_for_admins()
RETURNS VOID
AS $procedure$
DECLARE
v_VM_IMPORTER_EXPORTER_ID UUID;
BEGIN
v_VM_IMPORTER_EXPORTER_ID := 'def00030-0000-0000-0000-def000000011';
INSERT INTO roles (id, name, description, is_readonly, role_type, allows_viewing_children, app_mode) VALUES (v_VM_IMPORTER_EXPORTER_ID, 'VmImporterExporter', 'Administrator Role, with permission to import or export Vms', true, 1, true, 1);
PERFORM fn_db_add_action_group_to_role(v_VM_IMPORTER_EXPORTER_ID,8);
RETURN;
END; $procedure$
LANGUAGE plpgsql;
SELECT __temp_insert_add_domain_import_export_permissions_for_admins();
DROP function __temp_insert_add_domain_import_export_permissions_for_admins();
| |
Add PL/PGSQL function to find tables involved in a query | -- Return an array of table names used by a given query
CREATE OR REPLACE FUNCTION CDB_QueryTables(query text)
RETURNS name[]
AS $$
DECLARE
exp XML;
tables NAME[];
BEGIN
EXECUTE 'EXPLAIN (FORMAT XML) ' || query INTO STRICT exp;
-- Now need to extract all values of <Relation-Name>
--RAISE DEBUG 'Explain: %', exp;
tables := xpath('//x:Relation-Name/text()', exp, ARRAY[ARRAY['x', 'http://www.postgresql.org/2009/explain']]);
--RAISE DEBUG 'Tables: %', tables;
return tables;
END
$$ LANGUAGE 'plpgsql' VOLATILE STRICT;
| |
Fix path error for load data command | USE log_data;
LOAD DATA INPATH '/statistics/log_data/apache.log' OVERWRITE INTO TABLE apache_log;
| USE log_data;
LOAD DATA INPATH 'statistics/log_data/apache.log' OVERWRITE INTO TABLE apache_log;
|
Add migration script for devices with missing device type | ---
-- #%L
-- DeviceHive Dao RDBMS Implementation
-- %%
-- Copyright (C) 2016 DataArt
-- %%
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- #L%
---
UPDATE device SET device_type_id = 1 WHERE device_type_id IS NULL; | |
Convert recently created tables default charset to utf8mb4 | ALTER TABLE `editor_subscriptions` COMMENT '';
ALTER TABLE `addons_reusedguid` CONVERT TO CHARACTER SET utf8mb4;
ALTER TABLE `addons_users_pending_confirmation` CONVERT TO CHARACTER SET utf8mb4;
ALTER TABLE `api_apikeyconfirmation` CONVERT TO CHARACTER SET utf8mb4;
ALTER TABLE `hero_primaryhero` CONVERT TO CHARACTER SET utf8mb4;
ALTER TABLE `hero_secondaryhero` CONVERT TO CHARACTER SET utf8mb4;
ALTER TABLE `hero_secondaryheromodule` CONVERT TO CHARACTER SET utf8mb4;
ALTER TABLE `log_activity_comment_draft` CONVERT TO CHARACTER SET utf8mb4;
ALTER TABLE `scanners_results` CONVERT TO CHARACTER SET utf8mb4;
ALTER TABLE `users_disposable_email_domain_restriction` CONVERT TO CHARACTER SET utf8mb4;
ALTER TABLE `users_user_email_restriction` CONVERT TO CHARACTER SET utf8mb4;
ALTER TABLE `users_user_network_restriction` CONVERT TO CHARACTER SET utf8mb4;
ALTER TABLE `users_userrestrictionhistory` CONVERT TO CHARACTER SET utf8mb4;
ALTER TABLE `yara_results` CONVERT TO CHARACTER SET utf8mb4;
| |
Implement IACUC notification for Lift Hold | INSERT INTO NOTIFICATION_TYPE (NOTIFICATION_TYPE_ID, MODULE_CODE, ACTION_CODE, DESCRIPTION, SUBJECT, MESSAGE, PROMPT_USER, SEND_NOTIFICATION, UPDATE_USER, UPDATE_TIMESTAMP, VER_NBR, OBJ_ID)
VALUES (SEQ_NOTIFICATION_TYPE_ID.NEXTVAL, (SELECT MODULE_CODE FROM COEUS_MODULE WHERE DESCRIPTION='IACUC Protocol'),'208','IACUC Protocol Lift Hold','IACUC Protocol {PROTOCOL_NUMBER} Lift Hold Action','The IACUC protocol number <a title="" target="_self" href="{DOCUMENT_PREFIX}/kew/DocHandler.do?command=displayDocSearchView&docId={DOCUMENT_NUMBER}">{PROTOCOL_NUMBER}</a>, Principal Investigator {PI_NAME} has had the action "Lift Hold" performed on it.<br />The action was executed by {USER_FULLNAME}. Additional information and further actions can be accessed through the Kuali Coeus system.','Y','Y','admin',SYSDATE,1,SYS_GUID())
/
INSERT INTO NOTIFICATION_TYPE_RECIPIENT (NOTIFICATION_TYPE_RECIPIENT_ID, NOTIFICATION_TYPE_ID, ROLE_NAME, UPDATE_USER, UPDATE_TIMESTAMP, VER_NBR, OBJ_ID, ROLE_SUB_QUALIFIER)
VALUES (SEQ_NOTIFICATION_TYPE_ID.NEXTVAL,(SELECT NOTIFICATION_TYPE_ID FROM NOTIFICATION_TYPE WHERE DESCRIPTION='IACUC Protocol Lift Hold'),'KC-IACUC:PI','admin',SYSDATE,1,SYS_GUID(), null)
/
INSERT INTO NOTIFICATION_TYPE_RECIPIENT (NOTIFICATION_TYPE_RECIPIENT_ID, NOTIFICATION_TYPE_ID, ROLE_NAME, UPDATE_USER, UPDATE_TIMESTAMP, VER_NBR, OBJ_ID, ROLE_SUB_QUALIFIER)
VALUES (SEQ_NOTIFICATION_TYPE_ID.NEXTVAL,(SELECT NOTIFICATION_TYPE_ID FROM NOTIFICATION_TYPE WHERE DESCRIPTION='IACUC Protocol Lift Hold'),'KC-UNT:IACUC Administrator','admin',SYSDATE,1,SYS_GUID(), null)
/
| |
Add quota references to entities. | select fn_db_add_column('vm_static', 'quota_id', 'UUID');
select fn_db_add_column('images', 'quota_id', 'UUID');
select fn_db_add_column('storage_pool', 'quota_enforcement_type', 'INTEGER'); | |
Change the unexpired table to use DATE columns to make for faster indicies |
-- +goose Up
-- SQL in section 'Up' is executed when this migration is applied
ALTER TABLE `unexpired_certificate`
CHANGE COLUMN `notBefore` `notBefore` DATE NULL DEFAULT NULL,
CHANGE COLUMN `notAfter` `notAfter` DATE NULL DEFAULT NULL;
-- +goose Down
-- SQL section 'Down' is executed when this migration is rolled back
ALTER TABLE `unexpired_certificate`
CHANGE COLUMN `notBefore` `notBefore` DATETIME NULL DEFAULT NULL ,
CHANGE COLUMN `notAfter` `notAfter` DATETIME NULL DEFAULT NULL ;
| |
Create table with all the datas | DROP TABLE IF EXISTS ER_waits;
CREATE TABLE ER_waits
(PRIMARY KEY (provider_id))
SELECT DISTINCT a.provider_id,
a.hospital_name,
b.HospitalName AS ajc_hospital_name,
a.address,
a.city,
a.state,
a.zip_code,
a.county_name,
a.condition_name,
a.measure_id,
a.measure_name,
a.score,
a.sample
FROM hospital_compare.HQI_HOSP_TimelyEffectiveCare a
JOIN hospital_names b ON a.provider_ID = b.ProviderNumber
WHERE condition_name = "Emergency Department"
AND STATE = "GA";
ALTER TABLE ER_waits ADD INCREMENT MEDIUMINT NOT NULL AUTO_INCREMENT KEY;
ALTER TABLE ER_waits ADD COLUMN EDV varchar(255),
ADD COLUMN ED_1b varchar(10),
ADD COLUMN ED_2b varchar(10),
ADD COLUMN OP_18b varchar(10),
ADD COLUMN OP_20 varchar(10),
ADD COLUMN OP_21 varchar(10),
ADD COLUMN OP_22 varchar(10),
ADD COLUMN OP_23 varchar(10);
| |
Create command for current mysql table | CREATE TABLE `users` (
`idusers` int(11) NOT NULL AUTO_INCREMENT,
`email` varchar(254) NOT NULL,
`first_name` varchar(45) NOT NULL,
`last_name` varchar(45) NOT NULL,
`password` varchar(45) NOT NULL,
PRIMARY KEY (`idusers`),
UNIQUE KEY `idusers_UNIQUE` (`idusers`),
UNIQUE KEY `email_UNIQUE` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
| |
Set start time for inactive games predating them | -- For games that never had any turns taken, their last action time should be
-- a reasonable approximation of the game start time.
UPDATE game AS g
SET g.start_time = g.last_action_time
WHERE g.start_time = 0
| |
Add rollback script for schema V1.3 | -- revert record slug='archive' in table preferences_metadata to previous schema version 1.2
begin;
update "preferences_metadata"
set "schema" = 'object {
boolean enabled;
array [
string [ "JSON", "XML" ];
] {1,2} data_format;
string default_archive_container_url?;
object {
string iad;
string ord;
string dfw;
string lon;
string hkg;
string syd;
} archive_container_urls?;
};'
where "slug" = 'archive';
-- remove the flyway version 1.3
delete from "schema_version"
where "version" = '1.3';
end;
| |
Add self reference to ACCOUNTS table. | ALTER TABLE "PUBLIC"."ACCOUNTS"
ADD COLUMN "PARENT_ID" BIGINT NULL
;
ALTER TABLE "PUBLIC"."ACCOUNTS"
ADD CONSTRAINT FK_ACCOUNTS
FOREIGN KEY (PARENT_ID)
REFERENCES "PUBLIC"."ACCOUNTS"(ACCOUNT_ID)
;
CREATE INDEX SYS_IDX_10119 ON "PUBLIC"."ACCOUNTS"(PARENT_ID)
; | |
Add script to populate database | CREATE TABLE breeds (
name varchar(30) UNIQUE,
type varchar(30),
lifeExpectancy INT,
origin varchar(30)
);
INSERT INTO breeds VALUES ('poodle', 'sporting', 14, 'Germany');
| |
Add database table for keeping track of labels on events | /* Copyright 2019 The Matrix.org Foundation C.I.C.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
CREATE TABLE IF NOT EXISTS event_labels (
event_id TEXT,
label TEXT,
PRIMARY KEY(event_id, label)
); | |
Update kunnat to more generic layer | UPDATE oskari_maplayer SET name = 'tilastointialueet:kunta4500k' WHERE type = 'statslayer' AND name = 'tilastointialueet:kunta4500k_2017';
| |
Add SQL script to delete etalabot activities. | create index idx_activity_user_id on activity (user_id);
create index idx_activity_detail_activity_id on activity_detail (activity_id);
delete from activity_detail where activity_id in (select id from activity where user_id in (select id from "user" where name = 'etalabot'));
delete from activity where user_id in (select id from "user" where name = 'etalabot');
drop index idx_activity_user_id;
drop index idx_activity_detail_activity_id;
| |
Add SQL for customers example | -- phpMyAdmin SQL Dump
-- version 4.2.7.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Aug 20, 2015 at 02:33 am
-- Server version: 5.6.20
-- PHP Version: 5.5.15
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `ajax_customers`
--
-- --------------------------------------------------------
--
-- Table structure for table `customers`
--
CREATE TABLE IF NOT EXISTS `customers` (
`id` int(10) unsigned NOT NULL,
`first_name` varchar(20) NOT NULL,
`last_name` varchar(20) NOT NULL,
`phone` varchar(20) NOT NULL,
`email` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ;
--
-- Dumping data for table `customers`
--
INSERT INTO `customers` (`id`, `first_name`, `last_name`, `phone`, `email`) VALUES
(1, 'Ben', 'Abbott', '022 465 4789', 'ben.abbott@yoobee.ac.nz'),
(2, 'James', 'King', '022 123 4567', 'james.king@website.com'),
(3, 'Bruce', 'Wayne', '022 666 6666', 'totally.not@batman.com'),
(4, 'Clarke', 'Kent', '022 999 9999', 'idonot@fly.com');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `customers`
--
ALTER TABLE `customers`
ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `email` (`email`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `customers`
--
ALTER TABLE `customers`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=5;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| |
Reduce consequence_terms in motif_feature_variation and regulatory_feature_variation tables |
# Update consequence_types in motif_feature_variation and regulatory_feature_variation tables
# Only store SO_terms that can be assigned to a variant overlapping a regulatory region
ALTER TABLE motif_feature_variation MODIFY consequence_types SET (
'TF_binding_site_variant',
'TFBS_ablation',
'TFBS_fusion',
'TFBS_amplification',
'TFBS_translocation'
) DEFAULT NULL;
ALTER TABLE regulatory_feature_variation MODIFY consequence_types SET (
'regulatory_region_variant',
'regulatory_region_ablation',
'regulatory_region_fusion',
'regulatory_region_amplification',
'regulatory_region_translocation'
) DEFAULT NULL;
# patch identifier
INSERT INTO meta (species_id, meta_key, meta_value) VALUES (NULL,'patch', 'patch_79_80_d.sql|Reduce consequence_terms to the set of relevant SO_terms in motif_feature_variation and regulatory_feature_variation tables');
| |
Add search route II (route coord generation) (api) | UPDATE routes AS nroute
JOIN (
SELECT route.id AS id, AVG(stop.lat) AS lat, AVG(stop.lng) AS lng FROM routes AS route
JOIN trips AS trip ON trip.route_id = route.id
JOIN stop_times AS time ON time.trip_id = trip.id
JOIN stops AS stop ON stop.id = time.stop_id
GROUP BY route.id
) AS coords ON coords.id = nroute.id
SET
nroute.lat = coords.lat,
nroute.lng = coords.lng;
| |
Set management network in upgrade | UPDATE network_cluster nc1
SET management = TRUE
WHERE network_id IN (SELECT id
FROM network
WHERE name = (SELECT COALESCE((SELECT option_value
FROM vdc_options
WHERE option_name = 'DefaultManagementNetwork'
AND version = 'general'),
'ovirtmgmt')))
AND NOT exists(SELECT 1
FROM network_cluster nc2
WHERE nc1.cluster_id = nc2.cluster_id
AND nc2.management = TRUE);
| |
Add table definition to store (failed) token attempts |
CREATE TABLE if not exists gems__token_attempts (
gta_id_attempt bigint unsigned not null auto_increment,
gta_id_token varchar(9) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null,
gta_ip_address int(11) unsigned not null,
gta_datetime timestamp not null,
PRIMARY KEY (gta_id_attempt)
)
ENGINE=InnoDB
AUTO_INCREMENT = 10000
CHARACTER SET 'utf8' COLLATE 'utf8_general_ci';
| |
Add the first migration, to create the tasks table in H2 database | CREATE TABLE tasks (
id INT (11) PRIMARY KEY AUTO_INCREMENT,
title VARCHAR(200) NOT NULL,
description TEXT DEFAULT '',
status TINYINT NOT NULL DEFAULT 0,
created_at DATETIME NOT NULL DEFAULT NOW()
); | |
Add test cases for creating index | -- Create a nonclustered index on a table or view
CREATE INDEX i1 ON t1 (col1);
--Create a clustered index on a table and use a 3-part name for the table
CREATE CLUSTERED INDEX i1 ON d1.s1.t1 (col1);
-- Create a nonclustered index with a unique constraint on 3 columns and specify the sort order for each column
CREATE UNIQUE INDEX i1 ON t1 (col1 DESC, col2 ASC, col3 DESC);
-- Create a nonclustered index with a unique constraint on 3 columns and specify the sort order for each column
CREATE UNIQUE INDEX i1 ON t1 (col1 DESC, col2 ASC, col3 DESC);
CREATE NONCLUSTERED INDEX IX_Address_PostalCode
ON Person.Address (PostalCode)
INCLUDE (AddressLine1, AddressLine2, City, StateProvinceID);
-- filtered index
CREATE NONCLUSTERED INDEX IX_BillOfMaterials_ComponentID
ON Production.BillOfMaterials (ComponentID, StartDate)
WHERE EndDate IS NOT NULL ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.