epub.js: cfiFromPercentage does not return the expected result - epub.js

I am using epub.js and trying to get the cfi from percentage to navigate to a page of the book. I am using the function cfiFromPercentage that epub.js provides us but the result I get is just this:
epubcfi(/!/)
Can someone help me with a working code example?

Related

Implementing mib2c template for scalar

I am trying to get the mib2c template code to work for a simple scalar, but continue to get MY-MIB::mibName = No such object available on this agent at this OID upon a snmpget request no matter what I do.
When generating the mib2c template code I choose the net-snmp -> scalar options. From there I have tried options 1 and 2.
My understanding of the option 2 template is that you shouldn't even have to change any of the code to get it to successfully return a zero value for scalars.
However, the debug messages show that the init_* functions are getting called but the handlers are not getting called at all.
I am wondering if anyone can point me to resources showing a successful implementation example of the mib2c generated code as I am fairly lost at this point.
Thanks!

Clojure yagni "could not find any references" to a proxy Callable instance

I'm trying to use https://github.com/venantius/yagni
When I run it, I get the following error:
=================== WARNING: Parents ======================
== Could not find any references to the following ==
===========================================================
my-proj.my-ns/my-proj.my-ns.proxy$java.lang.Object$Callable$7da976d4
From what I found online, nothing can explain the meaning of this error
Update
Thanks for the comments asking me to give more context.
I was able to understand that the error is coming from a macro I'm using.
In my code, I'm using the time! macro, from the metrics lib.
As you can see herethis macro is using proxy
But this is not my code, is there a way to tell yagni not to look at it? (I guess not since it is a macro and compiled before yagni reads it)

Reverse engineering the checksum algorithm

I have an IP camera that receives commands using POST HTTP requests(for example to call PTZ commands or set various camera settings). The standard way of controlling it is through it's own web interface which is partially an ActiveX plugin and partially standard html+js. Of course because of the ActiveX part it only works in IE under Windows.
I'm attempting to change that by figuring out all the commands and writing a small python or javascript code to do the same, so that it is more cross platform.
I have one major problem. Each POST request contains a calculated "cc" field which I assume is a checksum. The JS code in the cam interface points out that it is calculated by calling a function inside the plugin:
tt = new Date().Format("yyyyMMddhhmmss");
jo_header["tt"] = tt;
if (getCpPlugin() != null && getCpPlugin().valid) {
jo_header["cc"] = getCpPlugin().nsstpGetCC(tt, session_id);
}
nsstpGetCC function obviously calculates the checksum from two parameters the timestamp and session_id. Real example(captured with Wireshark):
tt = "20171018231918"
session_id = "30303532646561302D623434612D3131"
cc = "849e586524385e1071caa4023a3df75401e5bb82"
Checksum seems to be 160bit. I tried both sha-1 and ripemd-160 and all combinations of concatenating tt and session_id I could think of. But I can't seem to get the same hash as the one the original plugin gets. The plugin dll seems to be written in c++. And I have almost no experience with decompilation to dive into this problem from that angle.
So my question basically is can someone figure out how they calculated that cc, or at least give me an idea in which direction to research further. Maybe I'm looking at wrong hash algorithms or something... Or give me some idea how I could somehow figure out what the original ActiveX function nsstpGetCC is doing for example by decompilation or maybe by monitoring it's operation in memory while running. What tools should I use?

OpenCV. FisherFace "model->predict"

First time question here, tx in advance.
I am trying to use code from opencv tutorial that use the fisherface algorithim.
I am able to create the fisherface model and train it,detect faces but fail on the recognition part model->predict.
I am also pretty new to C++ and trying to debug this problem myself but I guess I still need help here.
Jumping in at line model->predict(face_im)
I get to the following line of code in operations.hpp and fail immediately without any description of the error.
template<typename _Tp> inline _Tp* Ptr<_Tp>::operator -> () { return obj; }
executing this line jumps back out to the main and breaks with error
Access violation reading location 0x00000019.
agh, I hope this is not to vague but how can i analyze my problem here?
Again tx in advance and if more info is needed ..sure thing
Et
I've come to a conclusion; it was a scoping problem. By moving the declaration out of main, I was able to get it to work fine.
I guess it was very vague. It's still a bit unclear to me, but I suppose I need to brush up on my C++.

..getHours is not a function

i have some trouble with imacros. It seems that it doesn't recognise getHours() or setHours() functions.
I'll post a bit of my code to show you what i'm trying to do:
var FormatData = new Date(D[0],D[1]-1,D[2],D[3],D[4],D[5],0);
var Data=FormatData;
Data.SetHours(Data.getHours() - Durata[0]);
After execution , i get this error: ".getHours is not a function, line 22 (Error code: -991)"
If it helps, i received the same kind of error for setTimeout() function. And i solved it by adding window.setTimeout().
I tried the same trick here, but still "window.getHours is not a function, line 22 (Error code: -991)"
If you have a solution for using .setHours in imacros , please repply.
Thank you in advance !
Could you please try this one?
Data.setHours(Data.getHours()- Durata[0]);