Creating Javascript accessible object from C++ / CEF

Posted on Leave a commentPosted in cpp

Example with Chromium Embedded Framework (CEF) on how to create an object in C++ and make it accessible via Javascript. console.inof(api) Object {ready: true, version: "psql.0.0.1", info: Object, getVersion: function}console.inof(api) Object {ready: true, version: "psql.0.0.1", info: Object, getVersion: function} void ExtractEngineApp::OnContextCreated( CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, CefRefPtr<CefV8Context> context) {   auto info = CefV8Value::CreateObject(NULL, NULL); info->SetValue("major", […]

Calculating partial Hausdorff Distance

Posted on 1 CommentPosted in cpp

  struct Point { Point(int_t _x, int_t _y) : x(_x), y (_y) {   }   int_t x; int_t y; };     typedef std::list<Point*> points_t;   double euclideanDistance(const Point& lhs,const Point& rhs) { double p1 = std::pow((float)(rhs.x – lhs.x), 2); double p2 = std::pow((float)(rhs.y – lhs.y), 2); double vd = std::sqrt(p1 + p2);   […]

Leptonica barcode generation

Posted on Leave a commentPosted in cpp

Leptonica provides us with easy way to read barcodes but it does not offer a way to create them(as far as I know). Here is a leptonica function that will allow us to generate CODABAR barcode, in the feature I am planning on adding more type and more options but for now this was all […]

Quicksort implementation using Linked List

Posted on Leave a commentPosted in Uncategorized

About QuickSort Wikipedia QuickSort definition. General idea revolves around partitioning a list where values less than pivot go into left list while greater than go into right list. Pivot here is the first item of the passed in list. We apply this recursively to the sublists them merge left+pivot+right. CPP Code First of all not […]