IRC Log Viewer » #firebreath » 2012-02-09

IRC Nick Time (GMT-7) Message
Binbo 00:02 i've done tracert command and write it to a text file. I'm planning to get the information (i.e the hops and address) and use the POST request API to do POST request in order to send those information.
In your opinion, any possible security hole?
taxilian 00:02 depends on how you do it
hypothetically there could be if you're not careful about what text file can be read, etc
Binbo 00:02 sorry, i don't get it. Meaning?
dougma 00:02 if you api had a method postFile(filename) that would be a problem
Binbo 00:02 I'm planning to firstly retrieve the info from the text file before make the request.
I meant that I dont want to send the text file
appended string maybe?
dougma 00:02 you don't even need to write a text file
you can spawn a command and capture the output
Binbo 00:02 how? any tips/hint for me learn?
fyi i'm using win32api createProcess
taxilian 00:02 make sure you do it in a second thread
not on the main thread
dougma 00:02 it's fiddly
Binbo 00:02 i used boost thread
dougma 00:02 there's probably existing code out there
Binbo 00:02 thx ^^ i'll give it a try
eKyNoX 03:02 Hello
Jogi 05:02 Hi, i had asked his question but logged out. I want to pass a large vector from C++ to Javascript. I'm currently firing an event with FB:variant argument and receiving it in a JS array. But this method is very inefficient and takes a lot of time. I was suggested on live chat that I could use base64 or JSON . Can somebody please elaborate on the these 2 topics.? Thank you
FireBreathBot 05:02 Jogi: 08 Feb 06:33Z <dougma> tell Jogi base64 encoded string... sucks i know.
Jogi: 08 Feb 06:43Z <taxilian> tell Jogi actually returning a string with json works pretty well as long as it isn't binary data; if it's binary data, base64 is the only real option
Jogi 05:02 I am the plugin as a 3D file parser that sends data to javascript. I perform visualization using THREE.JS using that data. The data is in a binary file can be retrieved with our on API in C++.
I am using the plugin as a 3D file parser that sends data to javascript. I perform visualization using THREE.JS using that data. The data is in a binary file can be retrieved with our on API in C++.
reichi 05:02 just use base64 at the interfaces
base64 encodes binary data into a string
the size of the data increases about 30% doing so
Jogi 05:02 oh .. what if i want the data as binary in JS as well?
reichi 05:02 you convert it back
it's an encoding
you can just decode it in js
there a plenty of javascript-based base64 implementations on the net :)
Jogi 05:02 Thanks reichi. Do you think this is the best way to go considering my requirement?
reichi 05:02 well, taxillian recommoneded it
and if any one knows, it's him :)
Jogi 05:02 Thats great. Thank you so much for the quick support!
reichi 05:02 thank taxillian :)
eKyNoX 05:02 =)
how r u ?
reichi 05:02 take care, they may fight back!
eKyNoX 05:02 sure lol :)
i will
reichi 05:02 especially if you "point" at them :p
Jogi 05:02 Thanks taxillian!
eKyNoX 05:02 pointers comes in next chapters
no pointers in C#
reichi 05:02 actually that's not fully true
eKyNoX 05:02 new to me
reichi 05:02 just no "plain pointers"
eKyNoX 05:02 yes, i heard that too
reichi 05:02 every object called by reference is an actual pointer
and if you don't clean up ur references to object you can easily create memleaks in c#, too :)
cause the gc will never be able to clean up that stuff
eKyNoX 05:02 understand :)
is it important to learn some JS also ?
I have some basic knowledge already
reichi 05:02 it depends on what you actually want to build :)
you may very well create npapi plugins without any javascript interfaces
eKyNoX 05:02 make an old MMO space game programmed with C++ and using DX and UDP inside a browser throught a plugin :)
that's my goal for this summer
reichi 05:02 do you need any interaction to the webpage via javascript?
if not you don't need javascript ;)
i have to say... as a language, i almost "hate" javascript:/
eKyNoX 05:02 not necessary, maybe input login, pass textboxes and connect button
reichi 05:02 hmm ok
but that seems to be of very minor complexity ;)
eKyNoX 05:02 yes
reichi 05:02 and should be pretty easy
or simple
eKyNoX 05:02 I just have actually a bunch of network code to import in a plugin to test
some .cpp and .h files
well, continue my learning, tks
reichi 05:02 glhf
eKyNoX 05:02 Tyvm
kun 07:02 Hey guys I hava an API object in javascript and I want to pass it to a function....but sometimes I get an error then...the funtion I want to pass is function getPictures(metaData)...and I got an error that is: getPictures() metaData = [unsupported: no toString() function in type function]...It seems that the API object can not be assigned to metaData...but only sometimes
linearray 07:02 paste code
FireBreathBot 07:02 When you need to share code, logs, or anything else longer than a couple of lines, use a pastebin.,, and are all good options
kun 07:02 k i paste the code
linearray 07:02 and metadata is a JSAPIAuto type?
i can only guess that sometimes it's not
because JSAPIAuto definitely has a toString() function
kun 08:02 yes it is JSAPIAuto type
the weird thing is that a one time call is ok and more calls not...
linearray 08:02 do you return it like this?
kun 08:02 return boost::make_shared<MetaDataAPI>(m_host,m);
kun 08:02 cant find the error
linearray 08:02 stick around
kun 08:02 k
kun 08:02 firebug throws this exception when there is an error in a custom toString method. Consider p = {}; p.toString = function() { bug }; console.log(p). So, wrap your toString impl in try/catch and act accordingly.
this someone posted at a I have to overload the toString-method in my MetaDataAPI and wrap with try catch?
kun 09:02 ?
steveo_ 09:02 can anyone help with building the firebreath plugin bundled with
taxilian 11:02 steveo_: what is it you need help with?
steveo_ 11:02 i'm not sure how to compile the bundled firebreath plugin and startup the backend services that interface with the chrome extension
in the chrome extension, i'm unable to connect to kinect
taxilian 11:02 well, I can't help you with the backend stuff; building the firebreath plugin just requires getting firebreath and then running the prep script with the path of the firebreath plugin you want to build
that'll generate a build directory with the project files
and assuming that royshil set it up correctly and there aren't any extra dependencies that should just build
he does pop in here now and again, but I don't think he's here right now (I honestly don't remember what nickname he uses; I just know the guy working on the kinect plugin is in here sometimes)
steveo_ 11:02 when run <dir>
it says <dir> does not appear to contain CMakeLists.txt -- but it does
taxilian 11:02 try using full path; also, it's possible that spaces in the path may break it
we keep fixing that, but it keeps getting broken again somehow
taxilian 15:02 !findfile base64
FireBreathBot 15:02 Found 2 matching file(s) in the master branch. First 2 are:
blarson 22:02 taxilian: could you help me in debugging an nsapi plugin crash?
I can bother you later if you are busy now
taxilian 22:02 possibly
it's npapi, btw =]
but whats up?
blarson 22:02 arg yeah sorry :)
I'm trying to get jnext working in chrome for a project at work -
it is dead, but there is some qnx code that uses it for their webkit browser
anyways, I finally got it to build and it shows up in chrome's plugin list
but chrome never seems to try and load it
based on --plugin-launcher and other chrome flags
which definitely trigger for other mime types
taxilian 22:02 what platform?
blarson 22:02 in firefox, the plugin crashes as soon as I have an <embed> element
taxilian 22:02 well, first of all I don't ever recommend using <embed> tags
blarson 22:02 I can't figure out how to attach with gdb in firefox
taxilian 22:02 I've had too many problems with them
blarson 22:02 orly?
taxilian 22:02 quite likely that isn't your issue, but just as an FYI
blarson 22:02 what is the alternative?
taxilian 22:02 <object> tag
which is what all the FireBreath examples use
blarson 22:02 ah alright
taxilian 22:02 is this a firebreath plugin or raw npapi?
blarson 22:02 raw npapi
taxilian 22:02 that's a shame; there are a lot more things it could be =]
blarson 22:02 yeah... it is also dead code, nothing new since 2008
taxilian 22:02 does it load in firefox at all?
you said that chrome doesn't load it, but does show it
blarson 22:02 well, I visit the page with the <embed> tag and firefox pops down a 'plugin has crashed' bar
taxilian 22:02 interesting. you can start firefox from the console with -g and it will start up with gdb
also worth trying is do about:config and search for ipc; disable all plugin ipc
blarson 22:02 yeah I've done that, but it never loads any debug symbols or stops execution
taxilian 22:02 it may be loading the plugin in another process and not be attaching gdb to it
if you turn off ipc that may help
blarson 22:02 ah ok I'll try that jas
taxilian 22:02 unfortunately I'm definitely not an expert at debugging in linux
just not nearly as much call for plugin dev on linux, so I don't have the practice
blarson 22:02 yeah, worst-case I'll try to get it running in Windows tomorrow
well, great... I think disabling the ipc stuff might cause things to work in firefox now :/
yeah it crashes with ipc turned on - runs fine with it turned off
Binbo 22:02 is F
is FB has support in adding custom HTTP header for asyncPost?
taxilian 22:02 lol
there is no way through NPAPI to add a custom http header
awesome, no?
blarson: the ipc stuff is relatively recent; FF4. could well be that broke something
blarson 22:02 yeah must be
I'll see if I can find a way to still use gdb through the FF plugin-container ipc - do you know of anything?
Binbo 22:02 asyncPost is similar to AJAX POST isn't it? sorry for my lack of knowledge.
blarson 22:02 I think I could attach to the process, except it is dying as soon as it loads :(
taxilian 22:02 Binbo: asyncPost just uses the browser APIs to make a POST request through the browser
and then calls the callback when it's done
so in that way, yes, it is like an AJAX POST request in that both make http POST requests, but it does not use any of the same libraries
however, it would likely be possible to write a couple of small JS functions to let you use the browser AJAX capabilities, but you would lose cross domain ability
Binbo 22:02 its great that it can overcome SOP ^^
i have to implement CORS previously
Binbo 23:02 is it possible to have access/control on JS element within FB? For example I create 'video' element for html5 video tag. Can it be controlled from within FB (in JS - etc)
dougma 23:02 yes
you can interact with anything on the page
at the dom interface level
Binbo 23:02 which class?
dougma 23:02 plugin.... getDOMElement i think?
Sorry, not the plugin, the BrowserHost
Binbo 23:02 found it! thx ^^
taxilian 23:02 dougma: what base64 library are you using for your images?
dougma 23:02 wrote my own :)
not a library, just like 30 lines of code
taxilian 23:02 fair enough; there is actually one in the FireBreath codebase which seems to work okay
I was considering dropping it in favor of boost, which has an easy base64 inserter/iterator/thingy, but aparently it works only when the input is of a size % 3 == 0
dougma 23:02 ha!
taxilian 23:02 was quite annoying
so I switched back
dougma 23:02 man i love boost::bind
i'm writing c++ like a haskell programmer... although with an order or magnitude more keystrokes
yesterday i learnt that IE8 pretends to be IE7 when browsing the "intranet"
that was surprising.
taxilian 23:02 huh
that does sound a bit weird
dougma 23:02 "compatibility view" they call it
renders like IE7 and even fakes its user-agent string! :)
taxilian 23:02 heh
automatically for all intranet sites?