Error in (function (classes, fdef, mtable) FRAPO - rstudio

install.packages("FRAPO")
install.packages("quantmod")
library(FRAPO)
library(quantmod)
startDate <- "2006-01-01"
endDate <- "2015-12-31"
Load input data:----
symbols = c("XLF", "XLP", "XLE", "XLY", "XLV", "XLI", "XLB", "XLK", "XLU")
getSymbols(symbols, src="yahoo", from=startDate, to=endDate)
price.data<-cbind(XLY[,6],XLP[,6],XLE[,6],XLF[,6],XLV[,6],XLI[,6],XLB[,6],XLK[,6], XLU[,6])
colnames(price.data)<-c("Consumer Discretionary", "Consumer Staples", "Energy",
"Financial", "Health Care", "Industrial", "Materials",
"Technology", "Utilities")
names<-c("Consumer Discretionary", "Consumer Staples", "Energy",
"Financial", "Health Care", "Industrial", "Materials",
"Technology", "Utilities")
mcdd<-PMinCDaR(price.data, alpha = 0.95, softBudget = FALSE)
round(mcdd#weights, digits=8)
And I get :
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘returnseries’ for signature ‘"xts"’
I want to use the S&P 500 time series to check the (PMinCDaR )Portfolio optimization for minimum conditional drawdown at risk for the S&P500. But when I tried to use PMinCDaR I get the error: in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘returnseries’ for signature ‘"xts"’

Related

AnchorError occurred. Error Code: InstructionFallbackNotFound. Error Number: 101. Error Message: Fallback functions are not supported

I am trying to call the mintNft function on the front end but it throws an error and I can't fix it
the error is:
"Program log: AnchorError occurred. Error Code: InstructionFallbackNotFound. Error Number: 101. Error Message: Fallback functions are not supported."
see http response:
rpc response
lib.rs
web.ts:
const tx = await program.rpc.mintNft(
mintKey.publicKey,
"https://arweave.net/y5e5DJsiwH0s_ayfMwYk-SnrZtVZzHLQDSTZ5dNRUHA",
"NFT Title",
{
accounts: {
mintAuthority: program.provider.wallet.publicKey,
mint: mintKey.publicKey,
tokenAccount: NftTokenAccount,
tokenProgram: TOKEN_PROGRAM_ID,
metadata: metadataAddress,
tokenMetadataProgram: TOKEN_METADATA_PROGRAM_ID,
payer: program.provider.wallet.publicKey,
systemProgram: SystemProgram.programId,
rent: anchor.web3.SYSVAR_RENT_PUBKEY,
masterEdition: masterEdition,
},
}
);
console.log(tx);
// console.log("Your transaction signature", tx);
its because the instruction that you want to call is not available!
could be because a couple of things, such as:
check if IDL is the latest one, try erasing the target dir and run anchor build (dont forget to replace the program ID in the lib file of your programs)
check if anchor.toml program id equal the deployed program public key in /target/deploy directory
update your code to match anchor 0.24.2, It should look like this in Cargo.toml
[dependencies]
anchor-lang = "0.24.2"
mpl-token-metadata = { version="1.2.5", features = [ "no-entrypoint" ] }
anchor-spl = "0.24.2"
update package.json
{
"dependencies": {
"#project-serum/anchor": "^0.24.2",
"#solana/spl-token": "^0.2.0"
},
"devDependencies": {
"#types/chai": "^4.3.1",
"#types/mocha": "^9.1.1",
"chai": "^4.3.6",
"mocha": "^10.0.0",
"ts-mocha": "^10.0.0",
"typescript": "^4.6.4"
}
}
migrate the code to match anchor 0.24.2 for example (too long to post here) https://github.com/katopz/metaplex-anchor-nft/commit/f54ffaf087858f3997e797133ccc6d7748309c0a
and also rpc here https://github.com/katopz/metaplex-anchor-nft/commit/a72929548c8041ac422708c04078b8543e0f8a67
If nothing work, try run anchor test my forked here (tested today) https://github.com/katopz/metaplex-anchor-nft
For frontend, I think you will need to pass wallet provider to make it work. Should be something like this.
anchor.setProvider(new Client(programId, wallet).provider)
The error is thrown because of capital N in your function-name mintNft.
Capital letters are not supported for function name in solana program.
I also found out that underscore + number is also not supported, e.g. exchange1 is valid function name, but exchange_1 is invalid function name.

Compilation Issues building Nativescript app after upgrade to NS 7.0.6

After a long time, I have upgraded my Nativescript app which was running fine on NS version 5. After upgraded to NS 7.0.6 through NS version 6, I started getting following errors coming from the plugin dependencies. Please note I have tried deleting the node_modules, hooks and platform folders.
node_modules/#nativescript/core/global-types.d.ts:1:1 - error TS6200: Definitions of the following identifiers conflict with those in another file: "audio", "beacon", "cspreport", "download", "embed", "eventsource", "favicon", "fetch", "font", "form", "frame", "hyperlink", "iframe", "image", "imageset", "import", "internal", "location", "manifest", "object", "ping", "plugin", "prefetch", "script", "serviceworker", "sharedworker", "subresource", "style", "track", "video", "worker", "xmlhttprequest", "xslt", HeaderInit, WeakRef
1 declare var global: NodeJS.Global & typeof globalThis;
~~~~~~~
node_modules/tns-core-modules/node_modules/#nativescript/core/tns-core-modules.d.ts:4:1
4 declare enum RequestContext {
~~~~~~~
Conflicts are in this file.
node_modules/#nativescript/core/global-types.d.ts:136:14 - error TS2300: Duplicate identifier 'ModuleType'.
136 declare type ModuleType = 'markup' | 'script' | 'style';
~~~~~~~~~~
node_modules/tns-core-modules/node_modules/#nativescript/core/module.d.ts:95:14
95 declare type ModuleType = "markup" | "script" | "style";
~~~~~~~~~~
'ModuleType' was also declared here.
node_modules/tns-core-modules/node_modules/#nativescript/core/module.d.ts:2:13 - error TS2403: Subsequent variable declarations must have the same type. Variable 'global' must be of type 'Global & typeof globalThis', but here has type 'Global'.
2 declare var global: NodeJS.Global;
~~~~~~
node_modules/#nativescript/core/global-types.d.ts:1:13
1 declare var global: NodeJS.Global & typeof globalThis;
~~~~~~
'global' was also declared here.
node_modules/tns-core-modules/node_modules/#nativescript/core/module.d.ts:95:14 - error TS2300: Duplicate identifier 'ModuleType'.
95 declare type ModuleType = "markup" | "script" | "style";
~~~~~~~~~~
node_modules/#nativescript/core/global-types.d.ts:136:14
136 declare type ModuleType = 'markup' | 'script' | 'style';
~~~~~~~~~~
'ModuleType' was also declared here.
node_modules/tns-core-modules/node_modules/#nativescript/core/tns-core-modules.d.ts:4:1 - error TS6200: Definitions of the following identifiers conflict with those in another file: "audio", "beacon", "cspreport", "download", "embed", "eventsource", "favicon", "fetch", "font", "form", "frame", "hyperlink", "iframe", "image", "imageset", "import", "internal", "location", "manifest", "object", "ping", "plugin", "prefetch", "script", "serviceworker", "sharedworker", "subresource", "style", "track", "video", "worker", "xmlhttprequest", "xslt", HeaderInit, WeakRef
4 declare enum RequestContext {
~~~~~~~
node_modules/#nativescript/core/global-types.d.ts:1:1
1 declare var global: NodeJS.Global & typeof globalThis;
~~~~~~~
Conflicts are in this file.
node_modules/tns-core-modules/node_modules/#nativescript/core/tns-core-modules.d.ts:5:5 - error TS2432: In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element.
5 "audio", "beacon", "cspreport", "download", "embed", "eventsource", "favicon", "fetch",
~~~~~~~
Found 6 errors.
Following are my plugin dependencies:
"dependencies": {
"#nativescript/core": "~7.0.11",
"crypto-js": "^4.0.0",
"nativescript-appversion": "^1.4.4",
"nativescript-grid-view": "^5.1.0",
"nativescript-purchase": "^2.0.14",
"nativescript-screen-orientation": "^2.0.0",
"nativescript-social-share-ns-7": "^11.6.0",
"nativescript-theme-core": "~1.0.6",
"nativescript-toast": "^2.0.0",
"nativescript-ui-chart": "8.0.2",
"nativescript-ui-sidedrawer": "9.0.3",
"nativescript-unit-test-runner": "0.7.0",
"rxjs": "~6.6.3"
}
Since this is part of plugin, I am not sure how I can have these fixed? Any help is highly appreciated. Please let me know in case you need any other details.

Why do I receive 'message too big' on .publish() [error 1009]?

I'm able to establish a firm connection over rosbridge_server with roslibjs, however, whenever I call .publish() the Websocket disconnects and returns
I've tried calling JSON.stringify() to shorten the message size.
I've ensure the message is of the right format.
<script type="text/javascript" src="http://static.robotwebtools.org/EventEmitter2/current/eventemitter2.min.js"></script>
<script type="text/javascript" src="http://static.robotwebtools.org/roslibjs/current/roslib.min.js"></script>
var ros = new ROSLIB.Ros({
url : 'ws://192.168.1.122:9090'
});
var rosbridge_obj = new ROSLIB.Topic({
ros : ros,
name : '/topicname',
messageType : 'topicname/messagetype'
});
var message_obj = new ROSLIB.Message({
header : {
seq : 0,
stamp : 8768,
frame_id : 'Redacted',
},
mobility : {
ForwardY : 0,
TurningX : 0,
},
arm : {
J1 : 0,
J2 : 0,
J3 : 0,
J4 : 0,
J51 : 0,
J52 : 0,
},
mode : {
mode : 0,
},
});
rosbridge_obj.publish(message_obj);
Expected result is that the Websocket will publish and not close however I receive the following:
CloseEvent
bubbles: false
code: 1009
composed: false
currentTarget: WebSocket {url: "ws://192.168.1.122:9090/", readyState: 3, bufferedAmount: 0, onopen: ƒ, onerror: ƒ, …}
defaultPrevented: false
eventPhase: 0
isTrusted: true
path: []
reason: "message too big"
returnValue: true
I encountered the same problem using roslibpy, I was running basic examples of publisher and the connection was closed immediately after publishing the message with error:
WebSocket connection closed: Code=1009, Reason=message too big
It turns out, rosbridge_websocket.launch has a parameter max_message_size which is by default set to None. When I changed it to Inf it started working.
If you have your own launch file:
<include file="$(find rosbridge_server)/launch/rosbridge_websocket.launch">
<arg name="max_message_size" value="Inf" />
</include>
or just (from the command line):
roslaunch rosbridge_server rosbridge_websocket.launch max_message_size:=Inf
Hope this will help, it helped me.
This turned out to be a hardware specific issue. The issue was completely resolved after switching to new hardware.

wakanda remove() Cannot read property 'remove' of undefined - errCode 4055

I do the tuto wakanda at new version and I have error code 4055 when I play js a method addSuperheroes.js.
Please I need help.
Method:
ds.Superhero.remove();
new ds.Superhero({name:"Batman"}).save();
new ds.Superhero({name:"Superman"}).save();
var favoriteSuperhero = new ds.Superhero({name:"Wonder Woman"});
favoriteSuperhero.save();
ds.Superhero.all();
Error:
{
"__ERROR": [
{
"message": "Cannot read property 'remove' of undefined, line #1, file:///Users/arnaudthierard/Documents/Wakanda/solutions/HelloWorldWeb/back-end-superheroes/script/addSuperheroes.js.",
"componentSignature": "jvsc",
"errCode": 4055
},
{
"message": "Error evaluating javascript file:///Users/arnaudthierard/Documents/Wakanda/solutions/HelloWorldWeb/back-end-superheroes/script/addSuperheroes.js",
"componentSignature": "JS4D",
"errCode": 2
}
]
}
Make sure that the dataclass in the model is named Superhero.( not superhero or SuperHero ... )

Download rtmp stream

Hi a friend of ours mother just passed and they'd like the recording of the wedding so they can keep it on a flash drive. I played for about a half hour but have been unsuccessful. After looking at the pages source I fount the following javascript
if ( hasProductInstall && !hasRequestedVersion ) {
// DO NOT MODIFY THE FOLLOWING FOUR LINES
// Location visited after installation is complete if installation is required
var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
var MMredirectURL = window.location;
document.title = document.title.slice(0, 47) + " - Flash Player Installation";
var MMdoctitle = document.title;
AC_FL_RunContent(
"src", "http://AbrahamLGreenandSonSympathyNet.ezwebcast.com/player/playerProductInstall",
"FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
"width", "483",
"height", "416",
"align", "middle",
"id", "FlashPlayer",
"allowFullScreen","true",
"quality", "high",
"bgcolor", "#FFFFFF",
"name", "FlashPlayer",
"allowScriptAccess","always",
"type", "application/x-shockwave-flash",
"pluginspage", "http://www.adobe.com/go/getflashplayer"
);
} else if (hasRequestedVersion) {
// if we've detected an acceptable version
// embed the Flash Content SWF when all tests are passed
AC_FL_RunContent(
"src", "http://AbrahamLGreenandSonSympathyNet.ezwebcast.com/player/player",
"FlashVars","isDebug=0&mv=rtmp://fms35.ezwebcast.com/play/6/recorded_streams/3208/stream15989&user_id=32125&movie_id=14275",
"width", "483",
"height", "416",
"align", "middle",
"id", "FlashPlayer",
"allowFullScreen","true",
"quality", "high",
"bgcolor", "#FFFFFF",
"name", "FlashPlayer",
"allowScriptAccess","always",
"type", "application/x-shockwave-flash",
"pluginspage", "http://www.adobe.com/go/getflashplayer"
);
}
The line of interest at least in my opinion is rtmp://fms35.ezwebcast.com/play/6/recorded_streams/3208/stream15989&user_id=32125&movie_id=14275 I'm assuming that's what I need to download however when I downloaded rtmpdump and tried to run it I get the following and I haven't been able to figure out how to load the library or get this stream downloaded. Any help is greatly appreciated!
USERs-MacBook-Pro:Desktop user$ rtmpdump -r rtmp://fms35.ezwebcast.com/play/2/recorded_streams/3208/stream15989 -W "http://media.kelbymediagroup.com/players/player-4.6-licensed.swf" -o ./funeral.flv
dyld: Library not loaded: /usr/local/lib/librtmp.dylib
Referenced from: /usr/local/bin/rtmpdump
Reason: no suitable image found. Did find:
/usr/local/lib/librtmp.dylib: stat() failed with errno=13
/usr/local/lib/librtmp.dylib: stat() failed with errno=13
Trace/BPT trap: 5

Resources