How to add in-text references? - reference

I tried to google, but I have not found solution for my question. I have references, e.g. [1], [2],.. etc. But directly in text, I want to add citation, [1] + chapter name, because I references a lot to one source, and I am just pointing to different chapters. How should it be done then? [1, Chapter 1, Chapter name]? or [1] - Chapter 1, Chapter Name.
Thanks a lot.

Related

Asciidoctor do not include the first Headline in chapter count

I'm setting up an asciidoctor book which is arranged as follows:
= Title
== Foreword & Introduction
== Chapter 1:
== Chapter 2:
...
The problem is that when I create the HTML/PDF, the document will be indexed as follows:
Title
1 Foreword & Introduction
2 Chapter 1:
3 Chapter 2:
So, as you can see, all chapters have an offset of "1" caused by the Foreword chapter. Is there a way to get around this, maybe excluding the Foreword from the Chapter count, or using an alphabetic counting just for the Foreword and starting the following ones from "1". Or anything else that could make the final result look better.
Thanks
Lucky me! I just found it when I was searching for something even different:
[dedication%untitled]

Howto: Reference numbered elements of a list by their number

I'd like to do something like this:
These are the problems:
1. Too much concrete
2. Too few plants
...
This was also stated in Problem 1 and Problem 2.
The "Problem 1" and "Problem 2" should be links to the list above.
Output
syntax
These are the problems:
. [[prob1, Problem {counter:prob}]] Too much concrete
. [[prob2, Problem {counter:prob}]] Too few plants
This was also stated in <<prob1>> and <<prob2>>.
Explanation
prob1 and prob2 are IDs for the problems. You can freely choose them. E.g. prob_concrete and prob_plants. That way they would be easier to use.
{counter:prob} is the syntax for counting the counter called prob. You can freely choose the countername. (See "Counters" of the documentation)
Problem {counter:prob}: This is the part, that defines, how the reference is shown, when used (see image above).

Basic dialect, what language is this?

I'm using Concerto post processing app from AVL and I'm having hard time with scripting language we use here. It looks like MS visual basic but not that much and I want to know more about what version of Basic is this, so that I can find more documentation on the web.
When I try code from MS Visual Basic documentation site, like generating int array and puting some elements to initialize it (as you can see below), I got syntax error on Concerto Scripting editor
' Declare a single-dimension array and set its 4 values.
Dim numbers = New Integer() {1, 2, 4, 8}
This is from Concerto's own documentation and I cannot find how to create a simple array but Dataset istead, which is something similar I beleive
NewDSArray
This function generates a new array.
Syntax:
A = NewDSArray([Rows], [Columns])
Parameters:
Rows (optional, 1 = default): Numeric initial number of lines
Columns (optional, 0 = default): Numeric initial number of columns
Function:
A is now a new array with which the Dataset Array class commands can be used.
thisDSMatrix=newdsarray(1,2)
FirstCol={1,2,3}
FirstCol.name="FirstCol" //.name will pass the name into the matrix
thisDSMatrix.PutCell(FirstCol,1,1)
SecondCol={4,5,6}
SecondCol.name="SecondCol"
thisDSMatrix.PutCell(SecondCol,1,2)
Mcols=thisDSMatrix.ColCount //returns 2
Mrows=thisDSMatrix.RowCount //returns 1
thisDSMatrix.AddColumn("MyNewCol") //a column is added and thisDSMatrix.ColCount will now show 3
thisDSMatrix.PutCell({7,8,9},1,thisDSMatrix.ColCount)
return thisDSMatrix
I appreciate if you can help me to spot exact version of Basic Concerto uses. Thank you.
We had basically the same issue and because I didn't want to learn a proprietary language I dicided to go with Python. AVL Concerto provides from version V5.x onwards a Python-API. Despite that the API is not perfect from my point of view, this might be an alternative to the Concerto scripting language. And learning Python will thertenly the better solution.

Syntax in python dictionary

I am new in python scripting and I trying to figure out w basics about a program source code.
I am struggling to understand these two expressions:
First :
index = [0]*3, It creates an index but how?
Second :
random.random_shuffle(mylist[-1]), what does "-1" mean? The last item in the list?
Many thanks in advance
Well, you are right in one case. Although nothing in your code uses a dictionary. But, maybe these examples will help clear things up.
my_zeroes = [0]*3
assert my_zeroes == [0, 0, 0]
assert [0, 1, 2, 3][-1] == 3
In the first line the syntax you have here will create a list containing three zeroes. Your statement First : index = [0]*3, It creates an index doesn't really make sense. Indexes are inherent to certain data structures like lists and tuples, for example, you don't 'create' them as such. But hopefully my example makes it a bit clearer what is happening here.
In the second line we just check the above fact is true. If it wasn't true it would throw an AssertionError, so assert is a useful debugging tool.
In the third line we assert the answer to your second question: [some_list][-1] does indeed perform a negative index into the last item of the list. Unless the list in question is empty in which case [][-1] will give you an IndexError, as will any other index for that matter while trying to index into the empty list.
You can check out the Python tutorial to get more familiar with the syntax. Good luck!

What emoticons can you put into class names in your language? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I've just had a discussion with a developer about naming classes in C#. My final throw away line was, "Let's not put any emoticons in our class names."
I can't think of a way you could put emoticons in C# class names, but I haven't thought too hard about it. Is this possible?
Does any programming language allow it? What would be the best/worst language to be able to perform this in?
Update: The Scheme answer bests answers my question. It was a quick idea after a quick discussion so I'm going to accept after a short amount of time and then move on with my life. Thanks for the responses.
Many Japanese-style emoticons - O_o, v_v and the like - are perfectly legal substrings of identifier names in most languages.
For example in Scheme you have the flexibility to include symbols like :, -, / ... in the names,
(define (:-D x)
(+ x 1))
...
(:-D 9)
output: 10
C# supports any Unicode letter for identifiers, so if you find some suitable for emoticons in the Unicode tables, you can use them. The CLR itself allows far more characters in identifier names, like the typical backtick used in compiler-generated names, so you could get really crazy by defining really strange names in MSIL, and then loading the classes with reflection in C# because it does not support those characters...
The method name oO comes to mind. It's an emoticon in itself (small and large eye), but when called on a reference, it expands to a thought bubble: .oO(Hello).
Slightly off-topic: I was processing filenames the other day and realised that all sorts of faces had appeared in my code:
string number(fn.begin()+fn.rfind('_')+1,fn.begin()+fn.rfind('.'));
And of course there are the right-to-left emoticons you almost always get at the end of lines of C++ code:
mesh->Delete();
Why does C++ look so sad?
In C++, if you name a class/struct _ (a poor decision, but here we go), you can derive from it like this:
struct emoticon_to_the_right_of_this :_{
};
Thinking about this, a class o might be just as good:
struct another_emoticon_to_the_right_of_this :o{
};
Hm. I seem to only come up with sad ones. Is that Freud guy around here today? I do have a question to ask him...
Perl uses :: as a package name separator, which means that an IM client might decide to insert a smiley when I talk about XML::Parser (contains ":P") or Data::Dumper (contains ":D"). Punctuation other than :: isn't recommended in package names, so most "extended" smileys are out of the picture, but if I wanted to be very silly I could reference a variable named ${ ':-)' } -- but it would always have to be referenced using the ${'...'} syntax since it's not a recognizable identifier name :)
At this moment in 2014, Apple have just released Swift yesterday. And I made a short example for this. It compiles and runs perfectly fine. :D
I believe I've seen languages that use => to access object attributes (something like person=>father)
It's not actually part of the name, but it could be an emoticon.
Not strictly class names, but there are a few that pop up in PHP from time to time, like an underscore in single quote when concatenating:
$foo = $bar.'_'.$baz;
And as someone else pointed out, you don't even really need special symbols for some of them:
class o_0 {}
class v_v {}
class T_T {}
Something more convoluted:
function d() { echo 'Thumbs up!!'; }
d('_');

Resources