Semantic mediawiki - Set propery to range of values - properties

I'm trying to set a specific property to a non exact value, for example say that I want to define the height of a pine tree to usually between 3-80 m (according to wikipedia). Then I would like to set something like [[Has height::3-80]] (of course this doesn't work) and defining the unit to meters with "custom units". Then I would like to be able to query for example "trees that can reach the height of 70 meters" and the pine tree would be included. I've been searching and trying different angles for hours now and I can't figure it out. Tried with #set_recurring_event but that seems to be only for dates/time. Also understood how to set multiple values for a property with #arraymap but this doesn't seem to help me here. Really would appreciate help with this (it's probably very easy and right in front of me) Thx! COG

There's no such things. But you able to create template, with parameters you want. The you just use code kinda {{range|min|max|units}}. For example your range of heights looks like {{range|3|80|m}}.

Related

VIM equivalent of IntelliJ's expand/shrink selection?

How would one achieve the same result. I believe the keybinding for macOS Intellij is op+up/down and on windows it is alt+w/d.
Essentially the function highlights the current word, then, with successive presses, expands out to the full string/line/area in-between parenthesis/further out to the next set of parenthesis. Very useful for developing in LISP.
The closest I've gotten is this: https://vi.stackexchange.com/a/19028
Try this plug in: https://github.com/terryma/vim-expand-region
It expands selections based on Vim’s text objects.
Well this may seem comfortable but does not correspondent with the internal logic of vim itself.
See, in vim everything you enter is like a sentence. va{ for example: there is a verb v -> visually select and an object (or movement) { -> paragraph. In this case there is also a modifier a around. You can exchange stuff in this sentence and it will still work vaw, dil, cB and so on. The power of vim is greatly based on that concept.
Of course you can write a function that does vaw first, then S-v and lastly va{ but that will only work with visual selection. It will not work with c or d or anything. So I will recommend to get used to use different keys for different actions.
The visual selection is mostly not needed anyway. Change a paragraph? directly use ca} and so on.
I have found that VI/VA + WOBO (as many times as you need to expand) works similarly. Not as fast but its the same concept and you can even expand/shrink asymmetrically based on your WO's and BO's (Or OW's and OB's depending on how you look at it)

PostgreSQL: Getting Strings between double Brackets

I am new to PostgreSQL and decided to play around with it a little bit. Thus I want to extract Strings from a Marked-Up text, but I do not get the result I wanted.
To do that I have a simple table named book and a column with a text data type called page.
The data looks something like this:
Simon the Sorcerer is a [[teenager]] transported into a fantasy world as a
[[Sorcerer (person)|sorcerer]] dressed in a cloak and [[pointy hat]]; his
cloak and hat are purple in the first game, but change to red for the rest
of the series (aside from possible magical colour changes in the third game).
He must use his logic and magical skills to solve puzzles as he progresses
through the games.
Now I want to extract each String between the brackets [[ ]]. But how do I do that correctly? Or is that even possible without Plug-ins?
I tried different versions with LIKE which did not produce any results, e.g.:
SELECT * FROM book WHERE page LIKE '[[%]]';
SELECT * FROM book WHERE page LIKE '[[teenager]]';
...
I also played a bit with regex, but I only got the whole dataset back instead of the String between the brackets:
SELECT * from book where page ~ '[^[[]+(?=\]])';
Is there a solution for my problem? Help will be much appreciated!
Use the regexp_matches function:
select regexp_matches(page,'[^[[]+(?=\]])','g') from book

Rebol 3 - R3-GUI - How to access text from an area?

I'm struggling a lot coming from R2 and dealing with faces. get-facet seems extremely unintuitive to me.
Let's say I have an area:
view [c: area "hello"] print get-facet c 'text-edit
get-facet always returns "hello" even if I type something else in the area. What is going on with this? The 'caret and 'state facet objects contain the correct text, but I cannot find a way to access them.
The correct command is get-face. Get facet should be used for
For the example above, it is fixed by:
view [c: area "hello"] print get-face c
From an explanation from Cyphre: get-face is intended for the application programmers but get-facet is intended for style developers because it directly accesses the style internals. If styles are updated it may break code if get-face is not used. One should avoid using refinements such as /text or /data on faces as it was easy to do in R2
AREA's facet TEXT-EDIT looks like it just stores the initialization, and the state/caret facet objects contain run-time data

Create a simple "subway" map in vb.net

I'm making an small logistics-oriented map...
I got an datatable containing users and their current locations (like station names), i got an image with all the "stations" and routes between 'em.
Current task is to warn when two users might meet (i.e. one user is one-two stations far from other one) and make statistics report (what stations users visit most), but i don't know where to start.
What's the most economic way to implement this?
I looked on GIS software, but i don't know how to make roads - and work with them too; there's too much unneeded stuff and no functions i need, or i did not found them so far.
Can you do it with php+JS(jQuery) and SQL? Because I think it's the bettter way to do this. Like an in-line app.
But if you really need to do this with VB.net I will try to answer your question:
The most economic way to implement this (I think) Is to make your own functions writen in .net something like:
Function get_number_of_users_in(stationID)
Function draw_user_in_image(userID)
and all the functions you may need...
After this, you can start to making your main program with a graphic interface, you could simply add a timmer to refresh your countent (Images, with a position...)
You can implement a grid and put your image over it, so you can display users like a point in X,Y coordenate. Like:
******************************
* Your image *
* -------------------------- *
* - - *
* - Your grid - *
* -------------------------- *
******************************
Next, you set the fixed coordenates like Station-1 = [(4,5)]
And controle the position with something like this in your main prg:
If get_user_next_to_station(userID) Then
msgBox('An user is close to station'&get_station_name(stationID)'!!')
EndIf
Sory for my probably erros in VB that's been a while I didn't touch this language xD But it's only for show you how you can do this.
Well I think this is the way I would do it, that depends on you and your time and skills in programming. Hope this helped you, if you need more help, you can ask me, there is no problem. Good luck !

What does setTextMatrix of contentByte class in iText do?

I am using iText and am very new to it. There have been several situations where I think I could have figured out the problem with my code if I knew what I was doing - I use examples without knowing the workings behind the code, and even as I look at the source I can't figure out what the programmer was thinking.
What does setTextMatrix of contentByteArray in iText do? And how do I figure out the parameter values I need?
For example:
cb.setTextMatrix(1, 0);
The input parameters are x,y coordinates in points, unless CTM scaling was defined.
0,0 would be the bottom left of the template you are referencing.
The position is the 'baseline' of the text, rather than the top or the bottom.
Transcribed from this source:
https://sourceforge.net/p/itext/mailman/message/12855218/
first parameter sets left margin, second parameter sets bottom margin.