Posts

Showing posts from 2019

Good friend penguinV

Two birds with one "Pull"     As previously said, I was working on OpenCV bug (you can find some details here ). The bug was not something to spend more than 2-3 days on, but the problem that was there - compilation time. OpenCV project is a set of C/C++ files (and CUDA ;-) ), which is supposed to be compiled with "cmake" to generate library(ies), containing compiled code. Everything sounded pretty decent, until the moment when I realized that I would need to compile the entire folder with a bit more than a lot of different modules of different shapes and colours to make any changes to the existing code and test it. And just because the modules with reference one-another, creating a web of dependencies, I would need to compile the whole thing every time, not some of the modules independently ("video" module, "java", "core" etc.). It'd be okay if not the fact that every compilation would take 20 minutes. Not nice. So, I switched

Two Different Frames of Same VidioCapture

Image
OpenCV Challenge     I believe, this bug is going to be one of the most challenging I have worked on. Not because of complexity of the work, not because of the scale involved, but because the part of the code is brand new to me. STDMETHODIMP SourceReaderCB::OnReadSample(HRESULT hrStatus, DWORD dwStreamIndex, DWORD dwStreamFlags, LONGLONG llTimestamp, IMFSample *pSample) {     CV_UNUSED(llTimestamp);     HRESULT hr = 0;     cv::AutoLock lock(m_mutex);     if (SUCCEEDED(hrStatus))     {         if (pSample)                     CV_LOG_DEBUG(NULL, "videoio(MSMF): got frame at " << llTimestamp);             IMFSample* prev = m_lastSample.Get();             if (prev)             {                 CV_LOG_DEBUG(NULL, "videoio(MSMF): drop frame (not processed)");             }             m_lastSample = pSample;         }     }     else     {         CV_LOG_WARNING(NULL, "videoio(MSMF): OnReadSample() is called with error status: "

penguingV Enhancement. Deploy

Image
Sending PR     Big game, big play, big problems, big solutions. Here we came to the point when "good-first-issue" is not good enough for us, and working on something of higher scale looks much more intimidating  exciting!      In my last post  I described the issue I was working on, so let's jump to the solution.      The above is the screenshot of the proposed solution to templating the EdgeDetection class. Previously, the class was using "Point"s  based on "double" values (double x, double y). The proposed solution uses "T" as a generic type instead of hardcoded "double" and "PointBase2D<>" template instead of "Point2d" type based on "double".     Previously, the class' implementation was separated among ".h" and ".cpp" files, and because implementation code for some of the functions was relatively long, I decided to keep the way of things as they wer

penguingV Enhancement

Good ol' C++ and Image Processing     The issue that was listed in penguinV 's repository asks for a slight improvement on their already implemented EdgeDetection()  algorithm, which currently works with double  values. The improvement must template the algorithm so the work can be done with 'float's as well.     Well, templating the class with all of its methods is not that hard, separating headers ( .h ) from implementation ( .cpp ) of a templated class is not that tricky (by the way, I have recently found a beautiful tutorial on how it can bee done in 3(!) different ways), but making sure that at the time of comparison/assignment of a double  to int  (and vise-versa) the data won't be truncated because of differences in bit sizes - that can be a bit time-consuming. As of now, the algorithm uses uint32_t  (unsigned 32-bit integer) as its integer type to be able to hold/pass data from/to double  variables (truncating decimals, obviously), but with switch to f

Deep Into Issues

Image
In search of the best bugs     I've been looking for a couple projects that I might be able to contribute to. Time period - 2 weeks for each. Level of difficulty - intermediate. Excitement - beyond limits.      After a couple of decent hours spent on looking for no less decent projects to work on, I decided to come back to the one that I have already worked on - penguinV  (you can read about this project in one of my previous posts ) - and choose one, that I haven't worked with before - opencv . OpenCV is an open source project, which is implemented in C++ and Python and is widely used in various computer vision projects.      The issues that I would like to focus on have different backgrounds, one is an enhancement, and the other is a bug fix. I believe I should be able to manage to finish both of them on time, even having a tight schedule this semester and working on 3 big projects at the same time.      Wish me luck and wait for the updates :) Issue #1 Iss

"Good first issue". Finale.

Image
Status: completion     Four pull request have been submitted and work seems to be done, so let's recall what we've been working on: AVM f   (Averaging Variable Method framework). MochaJS PenguinV schemaanalyst 1) AVM f . I believe I should give more detailed 'inside' to this and next projects (MochaJS), since at the time of writing respective post  the work wasn't progressing at desired tempo.           The community welcomed me - a newcomer - nicely and with understanding. The issue was to add tool's logo to README.md and a brief list of features that the tool is capable of. I did my research and found the most recent article that was dating October 2018, which contains a good detailed explanation of the possibilities of AVM f . All I needed to do is to read it and boil it down to the list, which would give an idea of what the tool is for. The community gave me green light on using it as a source and so I did.     The logo has been added, th

"Good first issue", the final chapter. Part 4/4.

Image
Status: success?     The fourth and the final 'Good first issue' fix that I worked with was for schemaanalyst   project, which focuses on work with relational DB schema, ensuring integrity of the data and intended data acceptance/rejection criteria. The issue was relatively simple - to make style of some of the table data be matching with style of examples, containing this data.       The fix was pretty easy to do and not time consuming one. The markup allows usage of backticks in tables, so I made the styles being matching.     However, the community haven't replied yet, so I am wondering if the fix is to accepted in the nearest time or not. The link to the issue . The link to the PR .

"Good first issue", implementation. Part 3/4.

Image
Status: Success     The third issue, in my list of open source issues I have worked with, will be a fix in a README.md for penguinV project (C++ image processing library, which focuses on work with heterogeneous systems. It works with CUDA and OpenCL ).      The fix would require a simple modernization of a landing page in the repo, just so it would have a better user experience. No special requests have been mentioned, so it was up to the developer to provide creativity and suggest a few changes.     The first thing that I noticed, was a lack of hyperlinks in descriptions of the tool, so I modified those mentions of the docs that appeared there (just simple markup links to the Master repo). I also wanted to practice with git rebase , so after all necessary commits have been done locally (just a bit more than a lot of them), I squashed all the commits that I had into one by running git rebase -i HEAD~10 . The command would pick up 10 commits preceding the commit with

"Good-first-issue" search. Part 2/4.

Image
Status: in progress     First issues have been spotted and the work is progressing in full speed. The issues are similar in their nature, which makes it easier for me to pick an approach to solve them. I have found two beautiful projects to contribute to: MochaJS  and AVMFramework . The first is a JavaScript test framework, and the second is a Java framework implementation for Alternating Variable Method, a heuristic local search algorithm.        The issue I am working on at Mocha is an update of the Mocha's site, so it would include an extra badge of one of the sponsors that the team got acquired recently. The issue can be found here .          The Alternating Variable Method framework currently has an issue with documentation. They require an update of the Readme file, so it would also be displaying the logo and a list of the features that the tool can offer, so anyone entering the repo, could decide if AVM f  is something they would want to work with. The detai

"Good-first-issue" for a "good-first-experience". Part 1/4.

Image
Status: In active search     What I have recently found out is the cornerstone of an open source development is not only to be able to contribute to a project, it is also to know what project one should contribute to.    I've been searching mostly on Codetribute , which is a Mozilla's owned web portal to manage open source contributions.     After a couple of hours of searching for the bug, the only and the best, I noticed that the list of the current issues in there is sorted by dates of recent updates only, which makes it harder to find a newly created bug to contribute to, since updated old ones (and sometimes very old ones) get pushed to the top of the list as well. I find it a little challenging for myself (at least for now) to be trying to go over dozens of comments for a specific issue and trying to fix it, when other people have been working on it for a while already.     But let's move the technicalities aside. The job that lays ahead is to find

Choosing Projects To Work On

And the journey into the Open Source world begins     How should a person start one's experience with open source projects? Well, the answer to this question probably won't be trivial - with oneself.     When contributing to an open source project, we need to know our own skill set and what we are capable of, what we would like to learn and/or research; and, on a base of that analysis, we will be able to narrow down those specific projects, getting the crème fouettée of them, something that we can and would   like to put our attention on. Closer to the the matter please     Alright, to be specific, for me the true joy dwells into low- and high-level back-end programming languages. Please, don't take me wrong, there are incredibly interesting and powerful front end languages as well, it just happened that I don't find myself incredibly excited while working with them. Well, what am I going to be looking for? Something low, something of  cross-platform  type po

Mastering Git

Image
What to focus on?     Today is a scary day. Today is the day of admitting one's faults and learning what I was supposed to long ago. So let's dig into learning curve all together by looking at a couple of Git  functions I personally have never used before, which though, for some of you, might already be very familiar, so I will try to bring more interesting information about them to peak everyone's interest.     What are the two functions that we will be looking at? Shall it be git fetch  and git tag . Let's play Fetch     The purpose of git fetch is to download commits, files, etc. from a remote repo into user's local one (from here , and here ). How is it different from git pull  then? Well, git fetch  does not necessary merge the content with the user's repo, but git pull does. The way to imagine it would be  git pull  =  git fetch  +  git merge .     Here is a graphical representation of the above: Source     There are quite a few ways to

FilerJS experience

Image
Release 0.1     Today, I would like to tell you about my so far best amateur usage of Git as a part of " Open Source Development " class assignment submission, and I what knowledge I have acquired from it. Well, let's start from the beginning.     The task was to provide a fix to one of the JS files in Filer project files. The "fix" was introduced to all class attendees as a mere move from using "var" (function-scope) upon variable declaration, to "let and "const" (block-scope), which were introduced in ES6 . The main idea of the assignment was to practice with such incredibly needful in programmers' lives Git commands and try (only try) to master them.     The file fs.watch.prec.js  had been randomly chosen as my personal firing field and the issue report/assignment request has been submitted via GitHub. After a prompt response with notification from my professor that I had just gotten assigned to issue #666, the

Node.js: fs.open()

    Today, I would like to take a look at one of the widely used functions of Node.js ' fs  library -  open() , and its synchronous version -  openSync() .     The function's purpose is to open a file, specified by a path (the first mandatory parameter of the function). The code of the function is following ( source ): function open(path, flags, mode, callback) {   path = toPathIfFileURL(path);   validatePath(path);   if (arguments.length < 3) {     callback = flags;     flags = 'r';     mode = 0o666;   } else if (typeof mode === 'function') {     callback = mode;     mode = 0o666;   }   const flagsNumber = stringToFlags(flags);   if (arguments.length >= 4) {     mode = validateMode(mode, 'mode', 0o666);   }   callback = makeCallback(callback);   const req = new FSReqCallback();   req.oncomplete = callback;   binding.open(pathModule.toNamespacedPath(path),                flagsNumber,                mode,                re