junior |
08:12 |
hi
hi
|
jshanab |
08:12 |
morning
|
taxilian |
09:12 |
g'morning
diorcety: I'll test that pull request in a little bit
|
diorcety |
09:12 |
diorcety: ok
|
taxilian |
10:12 |
hm. actually I have some things I need to do right now; I will get to it today, though. I've pulled and am building it
|
lucent |
10:12 |
Hi
|
Guest54457 |
10:12 |
Hi there, I am new to Firebreath. I have a very basic question. I am want to implement vector addition using a plugin. So basically I will pass 3 typed arrays from javascript and I want to perform vector addition inside the plugin and keep the result in third array which should be accessible later in javascript
I am unable to figure out how to do it well. Do I use FB::JSObjectptr ? Also can the third array that I pass be a out parameter?
|
Guest54457 |
10:12 |
I want to perform something like C[i] = A[i] + B[i]
Hi diorcetly
|
Guest54457 |
11:12 |
anybody home ? :)
|
vpradit |
11:12 |
hello, i'm having a problem accessing live chat logs. it keeps going to bitly.com and i'm not sure what to do from there. any suggestion please?
|
didu |
12:12 |
Hello everyone :)
|
Guest54457 |
12:12 |
hi
|
didu |
12:12 |
I am looking for a example of use of the function Document::getElementById, did someone know a open source project use it ?
|
vpradit |
12:12 |
there's a small example on using getElementById on test.html under BasicMediaPlayer sample project
|
didu |
12:12 |
Ok Thanks you I will check it :) !
|
vpradit |
12:12 |
you're welcome, hope that will help
|
didu |
12:12 |
Oh no sorry xD I was talking about Document::getElementById from Firebreath in c++
http://www.firebreath.org/display/documentation/class+FB+DOM+Document+document
|
vpradit |
12:12 |
ah, ok. In that case, i haven't seen it, sorry for the confusion. :-[
|
Guest54457 |
12:12 |
Hi didu & vpradit, do you guys have any clue about my query by any chance :)
|
vpradit |
12:12 |
Guest54457, what is your query? i think i missed that
|
Guest54457 |
12:12 |
Well I just posted a detailed one on stackoverlfow -- http://stackoverflow.com/questions/13847191/firebreath-npapi-plugin-pass-javascript-arrays-by-reference
Can you please take a look at it
|
didu |
13:12 |
I can't help you sorry, I don't have enouth knowledge for this :(
|
taxilian |
13:12 |
I am back
|
didu |
13:12 |
Hello taxilian
|
taxilian |
13:12 |
hello
now I'm on the phone =]
|
didu |
13:12 |
Ok :) when you come back, do you know a example of use of the function FB::DOM::Document::getElementById ? I want to edit content of element on the webpage
but I find no project who do this for example :(
|
taxilian |
13:12 |
m_host->getDOMDocument()->getElementById
|
didu |
13:12 |
OMG O_O
Thanks you a lot !
|
Guest54457 |
14:12 |
Hi taxilian
Just a request, when you have time would you able to reply to my query posted here in the chatroom. I have also posted detailed one on stackoverflow. http://stackoverflow.com/questions/13847191/firebreath-npapi-plugin-pass-javascript-arrays-by-reference. Just a request. you have been helpful
|
vpradit |
14:12 |
Guest54457, did you try to step into your addvect function to see if A, B, and C are valid pointers?
|
taxilian |
14:12 |
Guest54457 I'm looking at it, writing some suggestions
it's probably your .cast<
you shouldn't ever (unless you know enough to know why it's an exception) use .cast
always use .convert_cast
vpradit I haven't had time to fix the logs after changing servers
|
Guest54457 |
14:12 |
oh ok. let me try changing it
|
taxilian |
14:12 |
also note that an exception will be thrown if the cast fails
for example if GetProperty is returning a null or undefined value
|
vpradit |
14:12 |
ok, i was sure what's happening with logs, but thanks for the response taxillian!
|
taxilian |
14:12 |
vpradit to be honest I was hoping to find a better log viewer; the one we use was written by a guy who abandoned the project after he no longer needed firebreath for anything
(understandably)
|
vpradit |
14:12 |
:)
|
Guest54457 |
14:12 |
hhmm..I changed it to convert_cast, but it didn't work.. I am printing values of pointer recieved in the function and they look fine.
so does it mean .convert_cast or .cast are failing?
|
vpradit |
14:12 |
i found it really useful going through the logs in the past before posting my questions here
|
taxilian |
14:12 |
vpradit: yeah, I really need to get them back up
but I need to get 1.7.0 up first :-/
Guest54457 seperate your calls into small pieces and step through it; my guess is that your GetProperty is throwing an exception, then
|
Guest54457 |
14:12 |
ok. Sorry I am new to this. how do you suggest I step through ? There is not much going on in the code as you can see. how do I find out what could be the reason it is throwing
|
vpradit |
14:12 |
this would be helpful http://www.firebreath.org/display/documentation/Debugging+Plugins
|
taxilian |
14:12 |
usually I step through using a debugger =]
what platform are you on?
Guest54457: Instead of doing all of those things on one line, do it one at a time. First, call GetProperty, then call it on the other, then do the convert_cast to the format you want, etc
split it all up
|
Guest54457 |
14:12 |
I am on Fedora - linux. Using firefox 16
|
taxilian |
14:12 |
ahh
that makes it a lot harder for debugging
jshanab has had some luck with kdevelop; I think there are notes on the wiki (the page vpradit just linked)
|
Guest54457 |
14:12 |
yeah I understood one at a time. Now, I am jsut trying to print the first element i.e using GetPropoerty
ok
Might sound stupid, but I was wondering how do I attach the debugger ? all that I am doing is firing/opening firefox from commandline to get the logs/prints in my code
|
taxilian |
14:12 |
debugging in linux is painful; I am no expert on that
check the wiki, it has all the tips I could give you
and probably more
Most of my work is mac/win
|
Guest54457 |
14:12 |
oh ok.
well it weird all that I have now is A->GetProperty(i).convert_cast<double>() is this one line. I was wondering if it's something obvious that I am missing. Is it worth taking to pain to setup debugging
|
taxilian |
14:12 |
uh, yeah
YOU NEED TO SPLIT IT OUT
the part that is quite likely giving you grief at this point is A->GetProperty(i)
when you're troubleshooting, don't do more than one thing at a time!
makes it hard to see where the problem is
add print statements between each time
|
vpradit |
14:12 |
i'm not sure how i got to this state, but i'm seeing a strange behavior with IE on my machine where StaticDeinitialize is called when i close tab which one of my plugin instances is running.
i would expect the plugin destructor to be called but not StaticDeinitialize which is the behavior that i see on firefox and chrome. the StaticDeinitialize should only be called when i close the browser, not a tab. right?
|
Guest54457 |
14:12 |
oh ok. Sorry I thought you mean't splitting block of my code. let me try splitting that instruction
|
taxilian |
14:12 |
vpradit: unfortunately we can't enforce that with IE; it should only call it when all instances are closed and the dll is ready to shut down, but there is unfortunately no guarantee that you won't get another init
hmm; but you should still get another init before the next instances starts up
if that doesnt' happen it's a bug
|
vpradit |
14:12 |
this only happens on my machine, it doesn't happen on other machines. is there any IE setting that you might know that would affect this behavior?
|
taxilian |
14:12 |
the reason for that is simple
you're using IE
and IE is consistently inconsistent
impressively so
|
vpradit |
14:12 |
ha ha
unfortunately that's one of the major browsers and we have to support that for our product :-(
|
taxilian |
15:12 |
yeah, me too
I'm just sayin'
|
vpradit |
15:12 |
i understand :)
btw, i do get StaticInitialize call for every instance that i create (through opening new tabs) on the IE on my machine as well. that's no surprise given the same reason though
|
taxilian |
15:12 |
wait, you get it for every single tab?
that's odd; that implies that it's loading a new process for each instance of your plugin
|
vpradit |
15:12 |
yes, that's odd. but it only happens on IE on my machine
i tried reinstalling IE hoping that some of the settings (in the registry) would get restored to defaults.
but that didn't help
|
taxilian |
15:12 |
no idea
is it really that big of a problem?
|
Guest54457 |
15:12 |
Hi taxilian, I think the problem is with .convert_cast
I do this -- FB::variant val = A->GetProperty(i); and it works fine
|
taxilian |
15:12 |
so catch the exception and print it
most likely GetProperty returned a null or void value
meaning it didn't return anything
|
Guest54457 |
15:12 |
I am sorry I am not proficient with C++. Does this look good ? try { FB::variant val = A->GetProperty(i); cout << "worked??" << endl; float d_a = val.cast<float>(); cout << " val : "<< d_a << endl; } catch(FB::script_error e){ cout << "Err : " << e.what() << endl; }
oops..no formatting
|
taxilian |
15:12 |
make FB::script_error e a const FB::script_error &e, but otherwise yeah
that's even optional, it just prevents it from copying the exception
|
Guest54457 |
15:12 |
ok. it doesn't print anything. I hope I am printing it OK
|
taxilian |
15:12 |
doesn't print anything? does it print Err: ?
try just catching std::exception
|
Guest54457 |
15:12 |
ok. with std::exception it says now -- Err : bad cast
for both .cast & .convert_cast
is ArrayBuffer the problem here?
|
taxilian |
15:12 |
okay, so that means the type you got back isn't one that can be converted to a double
most likely it was void or null
|
Guest54457 |
15:12 |
aah..it works fine with regular Javascript Array() and not with typed array..Damn..I should have realized..
|
taxilian |
15:12 |
you can check .empty() or .isNull()
you could try using a string "1" instead of 1 for getProperty
might work
might not
hard to say
|
Guest54457 |
15:12 |
do you think I can do anything about typed arrays here ? I want to use typed arrays. i.e I want to pass 'ArrayBuffer' instead of Array object
|
taxilian |
15:12 |
NPAPI doesn't know anything about typed arrays
but as I said, you could try accessing the index by string instead of integer; "1" instead of 1
sometimes that helps
|
Guest54457 |
15:12 |
ohk..let me try that
|
taxilian |
15:12 |
you could also try passing in a function that can get the data from the array
a wrapper
|
Guest54457 |
15:12 |
well accessing the string instead of integer doesn't work. Sorry I don't quite understand the function thing. Would you be able to tell more or point me in right direction?
|
taxilian |
15:12 |
something like function a(idx) { return thearray[idx]; }
and then pass in a to the plugin
|
Guest54457 |
15:12 |
ok. I am slightly confused. Would that be a huge overhead ? because I need to access the array inside the Plugin i.e C++ code. it could be a very very large array. The function that you are suggesting to pass is a javascript function right ?
|
taxilian |
15:12 |
not a huge overhead, no
yes
a js function
a closure
|
Guest54457 |
15:12 |
ok. So you are saying my function would understand how to access the array as the NPAPI doesn't
|
taxilian |
16:12 |
correct
but npapi knows how to call the function
|
Guest54457 |
16:12 |
OK. sounds great
|
vpradit |
16:12 |
sorry taxillian, i'm back now. it's a big problem for me since i have a static variable from a third party library that i'm using which is shared by all instances. so i need to make sure to clean it up once and only once when the last instance is gone.
|
taxilian |
16:12 |
sounds like you're in different process space
so the static variable wouldn't be visible to other instances
|
vpradit |
16:12 |
that's interesting. you're probably right. i'll do some more experiment on that then
btw, in case you're wondering...the third party library that i'm using is Qt. and they have qApp as a static variable that we create once and use it to share between instances.
|
taxilian |
16:12 |
ouch
yeah, Qt is a royal pain to work with in a plugin
|
vpradit |
16:12 |
you know of anyone else using Qt with a plugin?
|
taxilian |
16:12 |
in my plugin I actually ended up having to launch an external executable to talk to a qt library because the lib required a full qapplication to be created (with GUI) and I couldn't do that in a plugin
I know there are some, but not sure who
|
vpradit |
16:12 |
where did you launch the external executable to talk to qt library? From the plugin through StaticInitialize call or something else?
|
taxilian |
16:12 |
just did it once per instance
|
vpradit |
16:12 |
ah, ok
|
vpradit |
17:12 |
taxillian, you're absolutely right. Each tab is actually in different process space, so it's ok for each instance to have its own qApp instance. That's actually good until I found out that not all instances (tabs) call StaticInitialize. IE is really inconsistent as you mentioned earlier. I will have to do some more thinking about that then. Thanks for the tips, that's really helpful.
|
taxilian |
17:12 |
the ones that dont' call it probably are in the same space
so you're still okay
|
vpradit |
17:12 |
that's what I thought too, but then my UI (with Qt) is not displaying correctly for some reason. probably some position or logic that I use to display it in my plugin or something.
|
taxilian |
17:12 |
huh. well, I won't say it's impossible that there is a weird bug in there, but it seems like it would have come up before now
heh. I'm trying to get vs2012 support in as part of 1.7.0; in order to do that, I first have to update log4cplus it seems...
|
taxilian |
17:12 |
there; as of that commit, vs2012 should be working normally
|
Guest54457 |
18:12 |
Hi taxilian, I came across this specification proposal submitted by you. https://wiki.mozilla.org/NPAPI:ArrayDictAndBinary#Binary_data. This could have probably served my purpose right ? I get your JS closure function solution to my problem. I was wondering if there could be different or more direct way. Wouldn't the Javascript function be called every single time an indexed array access is made ? Say I have a loop over mill
|
taxilian |
20:12 |
yeah, it would have. I need to revise it
|
taxilian |
22:12 |
j-b_: how is the vlc stuff coming?
|