What is fieldno in Tarantool space config? - config

Extract from the config:
space[0].index[0].type = "TREE"
space[0].index[0].unique = 1
space[0].index[0].key_field[0].fieldno = 0
space[0].index[0].key_field[0].type = "STR"
What does fieldno mean? Failed to find clear answer in the docs.

Related

Changes in lua language cause error in ai script

When I run script in game, I got an error message like this:
.\AI\haick.lua:104: bad argument #1 to 'find' (string expected, got nill)
local haick = {}
haick.type = type
haick.tostring = tostring
haick.require = require
haick.error = error
haick.getmetatable = getmetatable
haick.setmetatable = setmetatable
haick.ipairs = ipairs
haick.rawset = rawset
haick.pcall = pcall
haick.len = string.len
haick.sub = string.sub
haick.find = string.find
haick.seed = math.randomseed
haick.max = math.max
haick.abs = math.abs
haick.open = io.open
haick.rename = os.rename
haick.remove = os.remove
haick.date = os.date
haick.exit = os.exit
haick.time = GetTick
haick.actors = GetActors
haick.var = GetV
--> General > Seeding Random:
haick.seed(haick.time())
--> General > Finding Script Location:
local scriptLocation = haick.sub(_REQUIREDNAME, 1, haick.find(_REQUIREDNAME,'/[^\/:*?"<>|]+$'))
Last line (104 in file) causes error and I don`t know how to fix it.
There are links to .lua files below:
https://drive.google.com/file/d/1F90v-h4VjDb0rZUCUETY9684PPGw7IVG/view?usp=sharing
https://drive.google.com/file/d/1fi_wmM3rg7Ov33yM1uo7F_7b-bMPI-Ye/view?usp=sharing
Help, pls!
When you use a function in Lua, you are expected to pass valid arguments for the function.
To use a variable, you must first define it, _REQUIREDNAME in this case is not available, haick.lua file is incomplete. The fault is of the author of the file.
Lua has a very useful reference you can use if you need help, see here

Pine Script: " Can't call 'security' inside: 'if', 'for' "

because I cant find any way to test my Pine Script strategy on multiple symbols, I created a way to loop through my whole Script.
In This I made 10 variables for 10 different Symbols like this:
ersteTicker = "AAPL"
zweiteTicker = "MSFT"
dritterTicker = "..."
Than I loopedfrom 1 to 10 and made 10 If-querys, which give me in every loop the right symbol like this:
a = 1
for i = 0 to 10
if a == 1
tickerID = ersteTicker
if a == 2
tickerID = .....
Now I thougt everything should be all right, but now the console gives back an error message called:
line 75: Can't call 'security' inside: 'if', 'for'
Does anybody know how to bypass this problem??
best regards
Christian
P.S.: I already tested a small other script and in this script the console doesn't give me back this error message, even if I also made a for loop with a security function in it..
(looks like this)
//#version=3
strategy("Meine Strategie", overlay=true)
tickerID = "ADS"
vergleichstimeframe = "D"
TaesRSLPeriode = 200
a = 1
myEma() => ema(close, TaesRSLPeriode)
for i = 0 to 10
if ( a == 1)
Daily_ema = security(tickerID, vergleichstimeframe, myEma())
//plot(Daily_ema*TagesRSLGrenzwert)
longCondition = crossover(sma(close, 14), sma(close, 28))
if (longCondition)
strategy.entry("My Long Entry Id", strategy.long)
shortCondition = crossunder(sma(close, 14), sma(close, 28))
if (shortCondition)
strategy.entry("My Short Entry Id", strategy.short)
Here's an example of global security. The security must not be inside of neither for nor if statements. If you need more symbols - use more securities. But bear in mind, that you can't choose a symbol from a set of symbols and call security with that symbol (because it'll be mutable variable and you cannot use them with security):
//#version=3
strategy("Meine Strategie", overlay=true)
tickerID = "ADS"
vergleichstimeframe = "D"
TaesRSLPeriode = 200
a = 1
myEma() => ema(close, TaesRSLPeriode)
// this always must stay global
Daily_ema = security(tickerID, vergleichstimeframe, myEma())
// here you could put more secureties:
//Daily_ema1 = security(tickerID1, vergleichstimeframe, myEma())
//Daily_ema2 = security(tickerID2, vergleichstimeframe, myEma())
//Daily_ema3 = security(tickerID3, vergleichstimeframe, myEma())
// ...
for i = 0 to 10
if a == 1
if Daily_ema > Daily_ema[i] // actual using of the security's result
strategy.entry("My Long Entry Id", strategy.long)
In general and according to previous comments, the strategy tester isn’t accurate. Just view an indication for the operation. Maybe the only benefit of the testing strategy is to determine the value of (SL, TP). Meanwhile the strategy depends on trusted intermittent periods, you can increase the SL 10 to avoid the temporary reflections

3Ds MAx Script for Reading Pixels from an image

We are trying to read the pixels from an uploaded Bitmap image, yet the line
aBrightness = (0.2126*aPixel[1].red) + (0.7152*aPixel[1].green) + (0.0722*aPixel[1].blue) always gives an error saying "Unknown property: "red" in undefined".
Our current script is:
aBitmap = selectBitMap caption:"Select a Bitmap"
Print(aBitmap.height)
Print(aBitmap.width)
aLength = aBitmap.height
aWidth = aBitmap.width
for i = 0 to (aLength - 10) by 10 do
(
for j = 0 to (aWidth - 10) by 10 do
(
Print(i)
Print(j)
aPixel = getPixels aBitmap [i,j] 1
aBrightness = (0.2126*aPixel[1].red) + (0.7152*aPixel[1].green) + (0.0722*aPixel[1].blue)
aBox = box pos:[i,j,0] width:0.1 length:0.1 height:aBrightness
)
)
We would really appreciate any help regarding this script.
You have your coordinates wrong. The X value goes first.
It should be
APixels = Getpixels aBitmap [j, i] 1
You can check to see if aPixel is undefined before using it.
aPixel = getPixels aBitmap [i,j] 1
if (aPixel == undefined) do ( format "ERROR!!! [%,%]\n" i, j to:listener; continue )
aBrightness = (0.2126*aPixel[1].red) + (0.7152*aPixel[1].green) + (0.0722*aPixel[1].blue)
This might help you figure where the bug is. Often a function will return 'undefined' to a variable so you need to check if it is undefined. In this case, once you fix the bug, you can remove this type of code since you will have eliminated undefined behavior. Notice I used "format" instead of "print", this is much nicer to use for just a tiny extra code.
I see two suspicious things to check.
1) Most indexing in maxscript starts with 1 not 0. Check the documentation.
2) As Rotem pointed out, [x,y], not [y,x]

How to use regex_extractor selector and multiplexing interceptor together in flume?

I am testing flume to load data into hHase and thinking about parallel data loading with using flume's selector and inteceptor, because of speed gap between source and sink.
So, what I want to do with flume are
creating Event's header with interceptors's regex_extractor type
multiplexing Event with header to more than two channels with selector's multiplexing type
in one source-channel-sink.
and tried configuration as below.
agent.sources = tailsrc
agent.channels = mem1 mem2
agent.sinks = std1 std2
agent.sources.tailsrc.type = exec
agent.sources.tailsrc.command = tail -F /home/flumeuser/test/in.txt
agent.sources.tailsrc.batchSize = 1
agent.sources.tailsrc.interceptors = i1
agent.sources.tailsrc.interceptors.i1.type = regex_extractor
agent.sources.tailsrc.interceptors.i1.regex = ^(\\d)
agent.sources.tailsrc.interceptors.i1.serializers = t1
agent.sources.tailsrc.interceptors.i1.serializers.t1.name = type
agent.sources.tailsrc.selector.type = multiplexing
agent.sources.tailsrc.selector.header = type
agent.sources.tailsrc.selector.mapping.1 = mem1
agent.sources.tailsrc.selector.mapping.2 = mem2
agent.sinks.std1.type = file_roll
agent.sinks.std1.channel = mem1
agent.sinks.std1.batchSize = 1
agent.sinks.std1.sink.directory = /var/log/flumeout/1
agent.sinks.std1.rollInterval = 0
agent.sinks.std2.type = file_roll
agent.sinks.std2.channel = mem2
agent.sinks.std2.batchSize = 1
agent.sinks.std2.sink.directory = /var/log/flumeout/2
agent.sinks.std2.rollInterval = 0
agent.channels.mem1.type = memory
agent.channels.mem1.capacity = 100
agent.channels.mem2.type = memory
agent.channels.mem2.capacity = 100
But, it doesn't work!
when selector part is removed, there are some interceptor debugging message in flume's log.
but when selector and interceptor are together, there are nothing.
Is there any wrong expression or something I missed?
Thanks for reading. :)
I found it.
In the flume log, there are warning message as below.
2013-10-10 16:34:20,514 (conf-file-poller-0) [WARN - org.apache.flume.conf.FlumeConfiguration$AgentConfiguration.validateSources(FlumeConfiguration.java:571)] Removed tailsrc due to Failed to configure component!
so I had attached below line
agent.sources.tailsrc.channels = mem1 mem2
and then It works!!!!

Xdebug and Webgrind couldn't get to work

I installed xdebug and webgrind on windows xampp 1.7.7 using this link: link . On going to http:// localhost/webgrind gives something as below instead of showing profiled script.No dropdown menu or something to select.
Select a cachegrind file above
(looking in C:\xampp\htdocs\webgrind\tmp/ for files matching /^cachegrind.out..+..+$/)
But I have 2 files in tmp folder starting with cachegrind.out names.
My settings in (xampp/php/php.ini) are
zend_extension = "C:\xampp\php\ext\php_xdebug-2.2.2-5.3-vc9.dll"
xdebug.profiler_output_dir = "C:\xampp\htdocs\webgrind\tmp"
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_name = cachegrind.out.%t.%p
webgrind/config.php settings
static $storageDir = 'C:\xampp\htdocs\webgrind\tmp';
static $profilerDir = 'C:\xampp\htdocs\webgrind\tmp';
I tried with these too
static $storageDir = '';
static $profilerDir = '/tmp';
But no result. How can I get it to work?
I got this accidentally, playing with values in xampp/php/php.ini file.
Here is the thing change value of xdebug.profiler_append from 0 to 1.
i had the same pb that took a long day having xampp 1.7.7 in my windows 7 OS i found that the
php_xdebug-2.2.2-5.3-vc9.dll was bad even it was php_xdebug-2.2.2-5.3-vc9.exe in the first download after a look at php.ini i found the good default xdebug just here with extra lignes so i delete the semi-colonnes ;
**[XDebug] zend_extension = "C:\Programs\xampp\php\ext\php_xdebug.dll"
xdebug.auto_trace
; Type: boolean, Default value: 0
; When this setting is set to on, the tracing of function calls will be enabled just before the
; script is run. This makes it possible to trace code in the auto_prepend_file.
;xdebug.auto_trace = 0**
; xdebug.collect_includes
; Type: boolean, Default value: 1
yes there was the good php_xdebug.dll coming with xampp
so use it and dont look far :) maybe that will help you
it might be also the matter of relative addressing due to portable xampp.
you can change your Xdebug addresses like this.
before
[XDebug]
zend_extension = "\xampp\php\ext\php_xdebug.dll"
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 1
xdebug.profiler_output_dir = "\xampp\tmp"
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
;xdebug.trace_output_dir = "\xampp\tmp"
after
[XDebug]
zend_extension = "D:\xampp\php\ext\php_xdebug.dll"
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 1
xdebug.profiler_output_dir = "D:\xampp\tmp"
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
;xdebug.trace_output_dir = "\xampp\tmp"