OrientDB: is OCommandFunction usable in 3.0.0m1? - orientdb

In version 2 OCommandFuction would be used more or less like this:
OCommandFunction command = new OCommandFunction(function);
ODocument doc = db.command(command).execute(args);
or
OResultSet<ODocument> rs = db.command(command).execute(args);
In 3.0 db.command is deprecated and the 3.0 idiomatic alternatives are documented in most use cases, except, to the best of my knowledge, for the one I described.
Any suggestions?
Thanks

The following should work fine:
db.execute("sql", "RETURN yourFunctin()", params);
3.0M1 is still an early beta, so if you find any problems please report them on the official issue tracker. Thanks!

Related

How to replace deprecated SOBE Code in TYPO3 10.4

I inherited an old TYPO3 Extension using SOBE. As far as I unterstand it's deprecated, but it seems there is no documentation on how to replace it.
The Extension is using Backend Forms and the following line is throwing an error:
if (is_array($GLOBALS['SOBE']->editconf['tt_content']) && reset($GLOBALS['SOBE']->editconf['tt_content']) === 'new') {
The error is:
Cannot access protected property TYPO3\CMS\Backend\Controller\EditDocumentController::$editconf
The Var $GLOBALS['SOBE'] is still there, and there is also editconf, but it's not working.
How can I replace this code or rewrite it?
The SOBE object is part by part removed since years. As there are multiple ways for using it - see https://docs.typo3.org/c/typo3/cms-core/main/en-us/search.html?q=sobe&check_keywords=yes&area=default - you may need to take a closer look what is the exact part of replacing this code.
I would guess you can see more at https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/9.2/Deprecation-84195-ProtectedMethodsAndPropertiesInEditDocumentController.html?highlight=editconf.

Interactive book [Minecraft 1.8.8 Spigot]

This question is about Spigot 1.8.8 (Minecraft).
Hello! I want to create an interactive book (click and hover events) and don't know how. I searched many hours but found nothing that worked for me.
I tried this code:
ItemStack book = new ItemStack(Material.WRITTEN_BOOK);
BookMeta bookMeta = (BookMeta) book.getItemMeta();
BaseComponent[] page = new ComponentBuilder("Click")
.event(new ClickEvent(ClickEvent.Action.OPEN_URL, "http://spigotmc.org"))
.event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("Thanks for hovering").create()))
.create();
bookMeta.spigot().addPage(page);
bookMeta.setTitle("test");
bookMeta.setAuthor("test");
book.setItemMeta(bookMeta);
But bookMeta.spigot().addPage() does not exists.
Please help! I have to use 1.8.8
To my knowledge, there is no fix for this without using NMS. I see that you've read the documentation on the spigot website, but that only applies to newer versions. However, someone has already described how to do it with NMS in this post: https://bukkit.org/threads/creating-book-guis.380796/

How to use `dataTaskDidReceiveResponse` callback?

I'm trying to use dataTaskDidReceiveResponse of the SessionDelegateof the manager but can't find how to use it. I'm new to swift (but experienced with objective-c) and can't found the correct syntax.
I have tried something like
manager.delegate.dataTaskDidReceiveResponse = {
return NSURLSessionResponseDisposition.Allow
}((session:NSURLSession, task:NSURLSessionDataTask, response:NSURLResponse)-> NSURLSessionResponseDisposition)
and some other variants. I don't know if it's just a syntax issue or my comprehension of swift/Alamofire that is lacking.
Can anyone help me found the right path?
Thanks.
Found it:
manager.delegate.dataTaskDidReceiveResponse =
{(session:NSURLSession, dataTask:NSURLSessionDataTask, response:NSURLResponse) -> NSURLSessionResponseDisposition in
return NSURLSessionResponseDisposition.Allow
}

getStructureId returns the real ID minus 1?

this is the code I am using :
JournalArticle article = null;
article = JournalArticleLocalServiceUtil.getLatestArticle(classPk);
String structureId = article.getStructureId();
When I debugged I found that structureId is always the real structureId but minus 1 !!!
Why ?? I need to know if it's Liferay bug ...
thank you,
I am Liferay 6.2 ce ga2.
JournalArticle's field structureId is equivalent not to DDMStructure.structureId, but to DDMStructure.structureKey. I admit, that can be really confusing.
This is due to the DDMStructure's object generation mechanism. When you add new structure using Control Panel, the structureKey is generated automatically using counterLocalService (check this code). As it happens just before the structureId is generated, it is always smaller by one.
See following Jira tickets, where it is explained the structureId vs structureKey issue:
- https://issues.liferay.com/browse/LPS-50671
- https://issues.liferay.com/browse/LPS-31163

How to use getChangedCells method?

I found that getChangedCells method is somehow applicable to the application that I am building right now.
Can someone show me on how to use getChangedCells method?
Thanks
Regards
Jason
var temp= $("#grid").getChangedCells('all') // Return Rows
or
var temp= $("#grid").getChangedCells('dirty') / Returns the changed cells.
Also try looking at the official docs as #ozczecho mentioned
Check this out. Official documentation. Or a similar question.