Lua | attempt to call field 'Color' (a nil value) - lua

enter image description here
260 is problem in console.
nothing, i don't know.
I don't know what to do, please help

Related

string.len() always returns the error "unexpected symbol"

function Main(Inhalt)
print(string.len(Inhalt))
end
Main(Bla)
This is just a example, I run in multiple problems like: "input:3: bad argument #1 to 'len' (string expected, got nil)" (Like here), or anything else with unexpected.
I'm kinda new to this, so please explain it to me from ground up I'm trying to figure out for a pretty long time. I already tried to convert this to a string with tostring(), but yes I'm missing something. Thanks for your help.
In this case Bla either needs to be a string which you can fix by putting quotes around it
function Main(Inhalt)
print(string.len(Inhalt))
end
Main("Bla")
or needs to be a variable that contains a string
Bla="test string"
function Main(Inhalt)
print(string.len(Inhalt))
end
Main(Bla)
Not a lua expert but it seems like you're trying to get the length of the string value Bla. The way you've written it right now does not indicate Bla is of string type. If you change it to the following, this should work.
function Main(Inhalt)
print(string.len(Inhalt))
end
Main("Bla")
Try this:
string1 = "Bla"
Main(string1)
In your code snippet Bla is not defined. Strings are surrounded by "".

How to use getPixel, getColor Method in lua

Can someone please show me the correct way to use getPixel and getColor in lua.
I tried
pix = 5; piy = 5;
getPixel(pix, piy) --getColor(pix, piy)
image:getPixel(pix, piy) --image:getColor(pix, piy)
...and I just can't figure out what lua is complaining about.
error:
attempt to call global 'getPixel' (a nil value)
Can someone please show me the correct way to use getPixel and
getColor in lua.
Lua does not provide a function to get pixels or colours. Again, as in your earlier questions, this is something you'll find in the Gideros manual.
getPixel(pix, piy) --image:getColor(pix, piy)
...and I just can't figure out what lua is complaining about.
error: attempt to call global 'getPixel' (a nil value)
Lua complains about you calling a nil value. There is no variable named getPixel in your global environment.
So once again open the Gideros manual:
http://docs.giderosmobile.com/reference/gideros
Then for example click Pixel in the left menu:
http://docs.giderosmobile.com/reference/gideros/Pixel#Pixel

Swift 3 : List of files Optional()

i'm going nuts.
I'm trying to get the list of "txt" files from a folder but i get the list in the form of
Optional("Filename").txt
Here's my code, nothing fancy. I tried unwrapping the filename but the compiler gives me an error.I tried a "guard", a with "if", i tried "!" ... nothing works.
let enumerator:FileManager.DirectoryEnumerator = FileManager().enumerator(atPath: myFolderPath)!
while let element = enumerator.nextObject() as? String {
print(element)
if element.hasSuffix("txt") {
fileList.append(element)
}
}
I need to show this list in a table view.
I hope i'm not supposed to run trought the array and get the name of the files by using a bunch o string methods just to get rid of this text...
I'm not sure what can i do! I don't really want to use this solution:
Swift: Optional Text In Optional Value
Thank you
# Vadian and Rob: you guys rock, you asked the right question.
The issue was that i'm naming the .txt files with a textfield and i'm doing all the necessary work to make sure that this textfield is not empty or otherwise.
I never thought that this textfield could be optional, hence the Optional("Filename").txt
Once i unwrapped the value from the textfield Optional() had gone.
Thank you.

Attempt to index field 'wikibase' (a nil value)

I have imported to my MediaWiki site the it.Wikipedia Modulo:Bio but I get this error:
Error Lua in Module:Bio line 700: attempt to index field 'wikibase' (a nil value).
In line 700 I have this code:
local entity = mw.wikibase.getEntityObject()
I have multiple wikis that shares the same source code, and the same database, but with its own tables. Then my wikibase is mybase.mywiki.com.
I tried to solve by changing wikibase to mybase:
local entity = mw.mybase.getEntityObject()
But it doesn't work.
The problem is not wikibase: the error simply says that there is no field named wikibase in the mw table, so the problem is that mw doesn't contain what you think it should. You must find the code that puts wikibase field in mw. If it does something like mw.wikibase = something and something is nil, then it is as if that line had not executed (it is not an error to assign nil to a table field, it is like removing the field if it exists already, and doing nothing if it doesn't exist). This is common error when something is an function call, the function may return nil under some circumstances.

Is MetroCriteriaId an integer or a string?

The Google documentation for the GeoPerformance report is a little confusing. On the one hand it says that MetroCriteriaId is of Type Integer but in the Notes it says Name of the metro as a string.
Do anyone know which one is correct, or do I just suck it and see?
It doesn't seem to matter what it is, Int or String, as even in 80812-line report the field is empty. The report definition I used is below and I got data for everything except MetroCriteriaId. Dead field? No idea.
<reportDefinition xmlns="https://adwords.google.com/api/adwords/cm/v201406">
<selector>
<fields>AccountCurrencyCode</fields>
<fields>AccountDescriptiveName</fields>
<fields>AccountTimeZoneId</fields>
<fields>AdFormat</fields>
<fields>AdGroupId</fields>
<fields>AdGroupName</fields>
<fields>AdGroupStatus</fields>
<fields>AdNetworkType1</fields>
<fields>AdNetworkType2</fields>
<fields>AverageCpc</fields>
<fields>AverageCpm</fields>
<fields>AveragePosition</fields>
<fields>CampaignId</fields>
<fields>CampaignName</fields>
<fields>CampaignStatus</fields>
<fields>CityCriteriaId</fields>
<fields>Clicks</fields>
<fields>Conversions</fields>
<fields>Cost</fields>
<fields>CostPerConversion</fields>
<fields>CostPerConversionManyPerClick</fields>
<fields>CountryCriteriaId</fields>
<fields>Ctr</fields>
<fields>CustomerDescriptiveName</fields>
<fields>Date</fields>
<fields>DayOfWeek</fields>
<fields>Device</fields>
<fields>ExternalCustomerId</fields>
<fields>Impressions</fields>
<fields>IsTargetingLocation</fields>
<fields>LocationType</fields>
<fields>MetroCriteriaId</fields>
<fields>Month</fields>
<fields>MonthOfYear</fields>
<fields>MostSpecificCriteriaId</fields>
<fields>PrimaryCompanyName</fields>
<fields>Quarter</fields>
<fields>RegionCriteriaId</fields>
<fields>ValuePerConversion</fields>
<fields>ValuePerConversionManyPerClick</fields>
<fields>ViewThroughConversions</fields>
<fields>Week</fields>
<fields>Year</fields>
<dateRange>
<min>20140601</min>
<max>20140630</max>
</dateRange></selector>
<reportName>Custom Geo Performance Report</reportName>
<reportType>GEO_PERFORMANCE_REPORT</reportType>
<dateRangeType>CUSTOM_DATE</dateRangeType>
<downloadFormat>TSV</downloadFormat>
</reportDefinition>

Resources