PairSet repetition in ttf font GPOS table - truetype

I am reading ttf specification and realizing the parser. But I have encountered a problem of parsing 'GPOS' table.
This is the link to GPOS table specification: http://www.microsoft.com/typography/otspec/gpos.htm
It says:
ValueFormat2 applies to the ValueRecord of the second glyph in each pair. ValueRecords for all second glyphs must use ValueFormat2. If ValueFormat2 is set to null, then the second glyph of the pair is the “next” glyph for which a lookup should be performed.
My first question: What would happen when 'ValueFormat2' is 'null'? Is it the same with 'ValueFormat1'? If so, why the spec using different expressions?
Compared with the .ttx file generated by ttx, I find that there are repetitions of PairSet in GPOS section. But my parser couldn't read out such repetitions from ttf binary file. For example: times.ttf on Windows7. File 'time.ttx' has the following items, but my parser reads out 'index 13', then the next group is 'index 16', which means I have missed 'index 14' and 'index 15'. And I don't know why I cannot read out the same result as ttx does.
My second question: Is there anything I have missed from the ttf specification? Which and where are such repetitions explained? Thanks in advance!
<PairSet index="13">
<!-- PairValueCount=2 -->
<PairValueRecord index="0">
<SecondGlyph value="comma"/>
<Value1 XAdvance="-133"/>
</PairValueRecord>
<PairValueRecord index="1">
<SecondGlyph value="period"/>
<Value1 XAdvance="-133"/>
</PairValueRecord>
</PairSet>
<PairSet index="14">
<!-- PairValueCount=2 -->
<PairValueRecord index="0">
<SecondGlyph value="comma"/>
<Value1 XAdvance="-133"/>
</PairValueRecord>
<PairValueRecord index="1">
<SecondGlyph value="period"/>
<Value1 XAdvance="-133"/>
</PairValueRecord>
</PairSet>
<PairSet index="15">
<!-- PairValueCount=2 -->
<PairValueRecord index="0">
<SecondGlyph value="comma"/>
<Value1 XAdvance="-133"/>
</PairValueRecord>
<PairValueRecord index="1">
<SecondGlyph value="period"/>
<Value1 XAdvance="-133"/>
</PairValueRecord>
</PairSet>
<PairSet index="16">
<!-- PairValueCount=1 -->
<PairValueRecord index="0">
<SecondGlyph value="quoteleft"/>
<Value1 XAdvance="-152"/>
</PairValueRecord>
</PairSet>

Related

Format for Adding an attribute to .vtk file

I am trying to add an attribute to a vtu file, the attribute being a mesh metric which is a single value for each triangle in my mesh, the vtu file containing mesh information with the following headers:
` <VTKFile type="UnstructuredGrid" version="0.1" byte_order="LittleEndian">
<UnstructuredGrid>
<Piece NumberOfPoints="468" NumberOfCells="862">
<Points>
<DataArray NumberOfComponents="3" type="Float64" Format="binary">
*insert nodes coordinates*
</DataArray>
</Points>
<Cells>
<DataArray type="Int32" Name="connectivity" Format="binary">
*insert connectivity info*
</DataArray>
<DataArray type="Int32" Name="offsets" Format="binary">
* insert offset data*
</DataArray>
<DataArray type="Int32" Name="types" Format="binary">
</DataArray>
****This is where I inserted my array
<DataArray type="Float64" Name="meshmetric" Format="binary">
*insert mesh metric values*
</DataArray>
</Cells>
</Piece>
</UnstructuredGrid>
</VTKFile>`
I added my mesh metric array after but it doesn't appear when I load the file to paraview, it could be I didn't place the array correctly b) I didn't know how to view it on paraview. c) I need to change/ add an information to the mesh information inn the array or
I am not using python
Your meshmetric <DataArray> tag is not inside the correct tag.
<Cells> is here to define the cells themselves. The associated data should be under a <CellData> tag, itself being a sibling of <Cells>. So
<Cells> ... </Cells>
<CellData>
<DataArray name='meshmetric'>
...
</DataArray>
</CellData>
Some doc is here

loop / Extract nodes from clob xml column in oracle pl sql

I have this xml content stored in a clob column of a table, I have to loop through the "molecule" nodes under the "reactantList" node,and store each "molecule" node into another table containing a list of molecules,
Any help please?
I tried with xmltype, xmlsequence, xmltable etc but did not work, I also have to specify the namespace "xmlns=.." somewhere as an argument to xmltype I think, to be able to make it work...
<cml xmlns="http://www.chemaxon.com" version="ChemAxon file format v20.20.0, generated by vunknown" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.chemaxon.com http://www.chemaxon.com/marvin/schema/mrvSchema_20_20_0.xsd">
<MDocument>
<MChemicalStruct>
<reaction>
<arrow type="DEFAULT" x1="-8.022119140625" y1="0.8333333333333334" x2="-3.5637858072916657" y2="0.8333333333333334" />
<reactantList>
<molecule molID="m1">
<atomArray>
<atom id="a1" elementType="C" x2="-13.938333333333334" y2="0.7083333333333333" />
<atom id="a2" elementType="O" x2="-15.478333333333333" y2="0.7083333333333333" lonePair="2" />
</atomArray>
<bondArray>
<bond id="b1" atomRefs2="a1 a2" order="1" />
</bondArray>
</molecule>
<molecule molID="m2">
<atomArray>
<atom id="a1" elementType="O" x2="-9.897119140624998" y2="0.8333333333333333" mrvValence="0" lonePair="3" />
</atomArray>
<bondArray />
</molecule>
</reactantList>
<agentList />
<productList />
</reaction>
</MChemicalStruct>
<MReactionSign toption="NOROT" fontScale="14.0" halign="CENTER" valign="CENTER" autoSize="true" id="o1">
<Field name="text">
<![CDATA[{D font=SansSerif,size=18,bold}+]]>
</Field>
<MPoint x="-11.730452473958332" y="0.6666666666666666" />
<MPoint x="-11.217119140624998" y="0.6666666666666666" />
<MPoint x="-11.217119140624998" y="1.18" />
<MPoint x="-11.730452473958332" y="1.18" />
</MReactionSign>
</MDocument>
</cml>
You can use:
INSERT INTO molecules (molecule)
SELECT x.molecule
FROM table_name t
CROSS APPLY XMLTABLE(
XMLNAMESPACES(
'http://www.w3.org/2001/XMLSchema-instance' AS "xsi",
DEFAULT 'http://www.chemaxon.com'
),
'/cml/MDocument/MChemicalStruct/reaction/reactantList/molecule'
PASSING XMLTYPE(t.xml)
COLUMNS
molecule XMLTYPE PATH '.'
) x
db<>fiddle here

How can I highlight syntax in Microsoft OneNote 2013?

I want to highlight syntax for my programming language of choice (proprietary) in Microsoft OneNote 2013 with a macro or script. I found a free Macro creator for MS OneNote '13 that allows creation of custom macros called "OneTastic". I created a macro that is given two arrays with lists of predefined words associated with different colors to give each list (ex: List 1 words = blue, list 2 words = orange, etc.)
API: https://www.omeratay.com/onetastic/docs/
Problem: The search logic is finding words inside of bigger words, like "IN" inside of the word "domain" (domaIN). My code is below:
<?xml version="1.0" encoding="utf-16"?>
<Macro name="CCL TEST 3" category="Color" description="" version="10">
<ModifyVar name="KEYWORDS1" op="set">
<Function name="String_Split">
<Param name="string" value="drop create program go %i declare call set end END execute else elseif protect constant curqual of subroutine to noconstant record free range in is protect define macro endmacro" />
<Param name="delimiter" value=" " />
</Function>
</ModifyVar>
<ModifyVar name="counter" op="set" value="0" />
<WhileVar name="counter" op="lt">
<Function name="Array_Length">
<Param name="array" var="KEYWORDS1" />
</Function>
<IsRootOp />
<ModifyVar name="keyword" op="set" var="KEYWORDS1">
<RightIndex var="counter" />
</ModifyVar>
<For each="Text">
<That hasProp="value" op="eq" var="keyword" />
<ModifyProp name="fontColor" op="set" value="blue" />
</For>
<ModifyVar name="counter" op="add" value="1" />
</WhileVar>
<ModifyVar name="KEYWORDS2" op="set">
<Function name="String_Split">
<Param name="string" value="datetimefind datetimediff cnvtdatetime cnvtalias format build concat findfile error alterlist alter initrec cnvtdate esmError echo max min avg sum count uar_get_code_meaning mod substring size trim hour day isnumeric expand locateval cnvtstring fillstring btestfindstring logical uar_get_code_display uar_get_meaning_by_codeset UAR_GET_CODE_BY sqltype cnvtreal echorecord cnvtupper cnvtlower cnvtdatetimeutc abs datetimediff year julian btest decode evaluate findstring asis replace validate nullterm parser value uar_timer_create uar_CreatePropList uar_SetPropString uar_CloseHandle uar_Timer_Destroy uar_Timer_Stop build2 patstring piece cnvtalphanum timestampdiff" />
<Param name="delimiter" value=" " />
</Function>
</ModifyVar>
<ModifyVar name="counter2" op="set" value="0" />
<WhileVar name="counter2" op="lt">
<Function name="Array_Length">
<Param name="array" var="KEYWORDS2" />
</Function>
<IsRootOp />
<ModifyVar name="keyword" op="set" var="KEYWORDS2">
<RightIndex var="counter2" />
</ModifyVar>
<For each="Text">
<That hasProp="value" op="eq" var="keyword" />
<ModifyProp name="fontColor" op="set" value="orange" />
</For>
<ModifyVar name="counter2" op="add" value="1" />
</WhileVar>
</Macro>
There is no such inbuilt feature available in OneNote but you can do it.
Use Visual Studio Code, it's free. Turn on right text copy/pasting. Write your code in in VS code. Copy it. It'll paste exactly as you see. Colors and all.
While this does not use VBA, I use and love the add-in NoteHightlight2016
If you don't find a language you can go through and add your own. I've added the Excel Formula keywords to the languages supported and I believe it is a bit easier than creating in OneTastic, which I also use and love.

Issue when using xquery external variables from the command line in BaseX

I have the following query in a XQ file named "consulta.xq"
declare namespace xs = "http://www.w3.org/2001/XMLSchema";
declare variable $word as xs:string+ external;
for $entry in doc("cni_es_cushimariano2008")//e
where $entry//l[matches(., $word)]
return <e>{$entry//r//text()} --> {$entry//l//text()}</e>
My database "cni_es_cushimariano2008" has the following structure/data:
<?xml version="1.0" encoding="UTF-8"?>
<dictionary>
<alphabet>aeiobchjmnñprsty</alphabet>
<section id="main" type="standard">
<!-- cuidarse (de alguien). aamaantsi. -->
<e>
<p>
<l>cuidarse (de alguien)</l>
<r>aamaantsi<s n="verbo intransitivo"/>
<s n="infinitivo"/>
</r>
</p>
</e>
<!-- celoso. aamaantsi. -->
<e>
<p>
<l>celoso</l>
<r>aamaantsi<s n="adjetivo"/>
</r>
</p>
</e>
<!-- traer. aamaantsi. -->
<e>
<p>
<l>traer</l>
<r>aamaantsi<s n="verbo transitivo"/>
<s n="infinitivo"/>
</r>
</p>
</e>
</section>
</dictionary>
I am trying to execute the following command line instruction
$ basex -b$word=celoso consulta.xq
but I don't receive the expected result and receive the following message:
[XPDY0002] No value assigned to $word as xs:string+.
I am not an expert using Basex and XQuery so I will be grateful for any answer that might help me. Thanks in advance.
The $ character presumably is interpreted by your command shell, such that $word does not reach its destination. It might need to be escaped,
$ basex -b\$word=celoso consulta.xq
or even omitted,
$ basex -bword=celoso consulta.xq

2 series on my chart

I would like to show 2 series on the same chart, however I'm not sure how to update the following code:
<%# Control Language="C#" AutoEventWireup="true" CodeBehind="UcSalesSeries.ascx.cs" Inherits="Silverlight.ConfigEnhanced.Web.UcSalesSeries" %>
<asp:Chart ID="Chart1" runat="server" DataSourceID="LinqDataSource1"
Height="500px" Width="750px" >
<Series>
<asp:Series ChartType="Line" Name="Series1" XValueMember="EndOfMonth"
YValueMembers="Quantity" >
</asp:Series>
</Series>
<Series>
<asp:Series ChartType="Line" Name="Series2" XValueMember="EndOfMonth"
YValueMembers="Quantity" >
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1">
</asp:ChartArea>
</ChartAreas> <Legends>
<asp:Legend TableStyle="Auto" Docking="Top" >
</asp:Legend>
</Legends>
</asp:Chart>
<asp:LinqDataSource ID="LinqDataSource1" runat="server"
ContextTypeName="Data.DataClasses1DataContext" EntityTypeName="" Select="new (EndOfMonth, Quantity)"
TableName="T_SalesDatas" OrderBy="EndOfMonth" Where="Model == #Model">
<WhereParameters>
<asp:Parameter DefaultValue="XXS" Name="Model" Type="String" />
</WhereParameters>
</asp:LinqDataSource>
the second serie I would like to see is the same as above, but I would be changing the parameter
<asp:Parameter DefaultValue="NEWVALUE" Name="Model" Type="String" />
The Chart does not support multiple DataSources so you will need to manually add the points from code behind to the chart when rendering the page. You create two tables from your data with the different parameters and iterate each table and adding them to the chart manually.
Read more in the section 'Manual' series population on this MSDN blog:
http://blogs.msdn.com/b/alexgor/archive/2009/02/21/data-binding-ms-chart-control.aspx