Bookshelf.js: does fetchAll withRelations work? - bookshelf.js

Googling this question turns up multiple contradicting answers ("yes"/"no"/"it doesn't throw any errors, but doesn't bring back any relations.") The new documentation doesn't seem to say anything on the matter. Can anyone give a definitive answer (and, if the answer is "no", a workaround, especially for Many-To-Many relations)?

I'm assuming you mean withRelated, and not withRelations, which is not a valid option.
Yes, it does work. fetchAll() is just a passthrough to collection.fetch(), which does support that option: https://bookshelfjs.org/api.html#Collection-instance-fetch

Related

Disable Jupyter Notebook cell only for whole notebook run

I don't know if it is possible, but I have a Jupyter notebook where I'd like to disable some cells in case of a whole run.
That is, 'Run All' would jump over these cells and not trigger them, but they could still be used if ran alone (e.g. with Ctrl+Enter) without changing the code.
I know %%script false --no-raise-error does the trick, but you need to manually change a constant to re-enable the cells when you need them. Ideally, I'd not have to change anything in the code.
Thanks in advance!
Your question resembles another question on here that I've answered recently. It's not the same question but I think my solution to that one actually works better for you. Here's the link to it and I hope it helps: https://stackoverflow.com/a/73978254/16264178
(PS I previously just copy-pasted my answer to the other question to here and that got flagged by a moderator. He was right that that wasn't best practice (answering different questions with the same answer verbatim). The recommendation though was to flag this thread as a duplicate of the other, which it isn't really. They're similar questions but my suggestion was a fairly imperfect solution to the other query, whereas I think it applies very well to the question in this thread. That's why I reposted my answer here with a link to the other one. That was the best thing I could see to do but people should feel free to enlighten me if they know better)

what does the nowcast.dates attribute tell about the R object?

I am looking at a colleague's R script to learn from it. I notice he has used the attr(object,"nowcast.dates") in his script.
While the other attributes like $names,$row.names,$factor.vars, etc. are intuitive to understand I am not sure what to make of $nowcast.dates. As the name suggest the output is date but not sure how these dates are fetched.
Can someone please explain to me what this attribute means?
Turns out my colleague explicitly set the attribute in the upstream script just as #rawr mentioned. I didn't realise we could create our own attributes. Now I know. Thanks to #rawr and #RuiBarradas

is there any complete minecraft forge documentation anywhere?

While it doesn't appear that this is a duplicate based on my searches, I'm sure other people have complained about this in many places.
I play minecraft and know java pretty well, so I thought it would be interesting to make mods with the minecraft forge. However, most tutorials are outdated or incomplete and I can't find a complete documentation. Now, if someone says, for instance, that existing blocks can be accessed through the Blocks class, I don't know what package that class is in. My more specific question was about modifying the properties of TNT(I wanted to do this as a test mod). Based on what I've been able to scrounge from various forums, using reflection on existing blocks in the game is possible, and what I found surrounding food would suggest there is a class for TNT somewhere that can be modified to boost its power. Just so someone can explain the not-well-explained principles of forge mod making, where would I find this TNT-related class that I could use reflection on, and how would I go about doing that(I've never done stuff with reflection before)?
To be clear, I've gotten forge minecraft all set up, I don't need an explanation of that. Just how to modify the properties of TNT(and hopefully this explanation will help me understand some broader principles)
I've been using https://nekoyue.github.io/ForgeJavaDocs-NG/ for a while. It has 1.12.2, 1.13.2, 1.14.4, 1.15.2, 1.16.5 and 1.17.1
I've been looking for a complete documentation/tutorial too, and I haven't fount a lot of stuff to be clear, but I found a wiki that might be useful. Here it is if you want to check it out:
Mcjty's wiki: https://wiki.mcjty.eu/modding/index.php?title=Main_Page
Forge's official documentation can be found here, versions:
1.15.x
1.16.x
1.17.x

Solve deprecation about $this- get('twig')-> getextension('form')

I'm getting message like this in an application:
Referencing the "form" extension by its name (defined by getName()) is deprecated since 1.26 and will be removed in Twig 2.0. Use the Fully Qualified Extension Class Name instead
The code causing this is:
$this->get('twig')->getExtension('form');
There seem to be some related threads, but I've been unable to find a solution for this. I've also taken a deep look at deprecation notes, but I've been unable to find anything that, with my knowledge, helps me to solve the problem. I'd ask for a clear solution for what I have to do to get rid of this message, that doesn't allow me to even try to upgrade.
Thanks in advance.
Well, I think I've found the solution. I just needed to find out the FQCN for the specific call, and it's
Symfony\Bridge\Twig\Extension\FormExtension
So, adding
use Symfony\Bridge\Twig\Extension\FormExtension;
and replacing
$this->get('twig')->getextension('form')
with
$this->get('twig')->getextension(FormExtension::class)
solved the problem.
I think there should be a more specific guide about what to replace and the replacement for each case.
Regards.
PD: I'm trying to find out how to mark this as solved, but maybe I'm not allowed to do this kind of things yet.

Flex faultCode list

Is there a list of possible faultCode values for Flex's Fault object (mx.rpc.Fault; Flex SDK: 3.4)?
At least faultCodes for faults generated on the client side?
I'm thinking of something like the list of possible runtime errors, found at Adobe's RTE List, but for faultCodes (such as Client.Error.MessageSend, Server.Processing, etc).
Could very well be that I just don't understand my problem well enough to do a decent search, but I've come up with nothing all day. It may also be that there is only one or two client-side faultCode values. Seems like it would make sense that there wouldn't be a comprehensive list of server-side faultCode values, but maybe there's a list of BlazeDS/LiveCycle faultCodes?
Any help much appreciated.
So, it looks like the answer is pretty much "No". I guess this makes sense, I guess, since most server-side faults would come from the server. I figured there would be a list of standard fault types, at least, as part of BlazeDS and/or LCDS.
Here's a pretty good post about setting up exception handling in BlazeDS. Does a good job of explaining why the answer to this question is No, as well as providing a good way of handling exceptions in BlazeDS, which would give you a custom list of fault codes.
http://www.flexpasta.com/index.php/2008/05/16/exception-handling-with-blazeds-and-flex/
Maybe this may help:
There is what they called Fault Event(mx.rpc.events.FaultEvent)
its properties has:
var event:FaultEvent = new FaultEvent();
trace (event.message);
Try adding this in an array so that you could have ur list.
Hope it helps

Resources