SuperCollider error: ServerOptions.memSize not understood - memory

I ran into a memory error so I'm trying to allocate more memory to the server, as instructed by the IDE. However, it doesn't recognise the class method which is clearly documented. What could have possibly gone wrong??
There is absolutely nothing to my code, it's literally just
ServerOptions.memSize = 65536;
I've also tried what I found on a blog, which is
Server.options.memSize = 65536;
Which also does not work. Please help!! I want to make music!

To refer to the current server, use the global variable 's'. Also, capitalization counts.
s.options.memSize = s.options.memSize * 2;

Related

How can I fix this lua runtime error in pico-8?

I'm following your roguelike tutorial and have encountered a problem I do not know how to solve. This is my first-time coding with Lua
If r.nospawn then return 0
--Attempt to index local "R" (a nil value)
I asked the PICO-8 discord server, they tried to help me, but I still don't fully understand, and I did not want to pester them further with the issue. The name of my file on PICO-8 is called Rogue - if that has anything to do with the issue.
Here's a picture of the error, the discord comment I received, and a link to the full list of code on GitHub.
Error in PICO-8
Discord Comment
Github Code
I think you are missing a simple failure case. i.e. what happens when all the entries in rpot have been removed. Then local r=getrnd(rpot) should return null. That might be an error in it's own right i.e. there should always be something to allocate from there.
However getrnd will fail.
function getrnd(arr)
return arr[1+flr(rnd(#arr))]
end
In the case when arr is empty you will try and return element 1, which will be out of bounds. I don't know lua but it might return null for you which leads to the next problem. But that has a simple fix:
repeat
local r=getrnd(rpot)
if r
placed+=infestroom(r)
del(rpot,r)
end
until #rpot==0 or placed>maxmons[floor]

processing error ArrayIndexOutOfBoundsException: 32

myPort = new Serial(this, Serial.list()[32], 115200);
what's wrong with that code?
Any suggestion would be appreciated
Notice the Console output of printArray(Serial.list()).
You have a single serial port "COM4" at index 0.
Any index higher than that (e.g. 32) is out of the valid array index bounds.
The code you're using has a helpful comment:
// if you are a Windows user, please change Serial.list()[your number]
Simply swap the 32 for a 0 and that should do it.
Try to read and understand the code your using: imagine what the code your reading would do and how it run, then actually run it and compare your assumptions to the actual behaviour. Use the Processing reference where you're not familiar. This will help you a lot as a programmer.
For more details see Processing Serial reference.

There is an error that i don't know how to fix in roblox lua

local place = game.Players.LocalPlayer.PlayerGui
function inventrans(amount)
if place.inven.InvenSee:FindFirstChild("Lava")then
place.Lava.Amount.value = place.Amount.value+amount
script.Parent.Amount = script.Parentarent.Amount-amount
else
game.ReplicatedStorage.StorageIco.Lava:clone(1).Parent =
game.Players.LocalPlayer.PlayerGui.inven.InvenSee.Lava
place.Lava.Amount.value = place.Amount.value+amount
script.Parent.Amount = script.Parentarent.Amount-amount
end
end
inventrans(23)
I get the error Lava is not a valid member of Frame.
I am trying to make an inventory system for my game but there is an error that I do not know how to fix. please help
Make sure your script is a local script and located inside a tool or the player gui.
game.Players.LocalPlayer.PlayerGui will be nil if it's not the case.
Make sure you located the object correctly.
You should use :WaitForChild
Example: game.Workspace:WaitForChild("Part")
Which will wait for the part to be added in the Workspace. The reason why you should use it is because your code is ran so fast, the object doesn't have enough time to create the part, so it returns an error. But if you use WaitForChild, it'll wait for the object to load in and then it runs the code.

Ada compiler: warning variable <X> is assigned but never read

I have the following very simple piece of code in Ada which is giving me grief. I trimmed down the code to the minimum to show the problem, the only thing you need to know is that Some_Task is a task type:
task body TB is
Task1 : Some_Task_Ref;
begin
Task1 := new Some_Task;
loop
Put_Line("Main loop is running, whatever...");
delay 5.0;
end loop;
end TB;
From what I understand about task activation in Ada this should be sufficient: I'm creating a task of type "Some_Task" and I don't have to do anything with it, it will execute it's main loop without any intervention. It's not like in java where you have to call a "start" method on the task object.
But if I'm correct, why is the compiler refusing to build, giving me the error:
warning variable "Task1" is assigned but never read
Why should I be forced to "read" Task1? It's a task, all it needs to do is run... what am I missing?
Note: this seems to happen only when I use GNAT in "Gnat mode" (switch -gnatg). Unfortunately I need this mode for some advanced pragmas, but it seems it introduces some "overzelous" checks like the one causing the problem above. How can I deactivate that check?
It's a warning, not an error, and does not prevent building an executable (unless you've turned on "treat warnings as errors"). It's a hint from the compiler that you may have made a mistake in creating a variable that is never used. You can tell the compiler that you don't indend to use Task1 by declaring it as a constant, like this:
Task1 : constant Some_Task_Ref := new Some_Task;
Just to answer this question, since the answer was posted in a comment, which cannot be marked as an answer.
As Holt said (all props to him) this can be fixed by using:
pragma Warnings (Off, Some_Task_Ref) ;

What's the difference between FBTweakBind and FBTweakValue?

I am using FBTweak lib in my iOS project. I wonder is there difference between FBTweakBind and FBTweakValue.
For example:
FBTweakBind(self.headerView, alpha, #"Main Screen", #"Header", #"Alpha", 0.85);
can rewrite like this:
self.headerView.alpha = FBTweakValue( #"Main Screen", #"Header", #"Alpha", 0.85 );
so are they just equal ?
I am playing with FBTweak lib only since couple of minutes, but from what I understood from the documentation on github, FBTweakValue is just setting the value, but FBTweakBind is binding the changes to make tweaks update live.
Keep in mind, that both FBTweakValue and FBTweakBind might behave differently in a release builds
Source: https://github.com/facebook/Tweaks/wiki#bind
I figure it out.
FBTweakBinding will refresh the value it's binding. It means that FBTweak will call the setter of the property whenever you change the value while app is running.
FBTweakValue is just a variable. When program is going through that line of code, the property will be set. If you change the FBTweakValue after where it used, it did nothing, unless that line of code running again.

Resources