challenge | Code challenge Structure , Tasks and result evaluation

 by   honeypotio Ruby Version: Current License: No License

kandi X-RAY | challenge Summary

kandi X-RAY | challenge Summary

challenge is a Ruby library. challenge has no bugs, it has no vulnerabilities and it has low support. You can download it from GitHub.

Honeypot provides pre-screening of talent which involves:. This Repository should serve as a centralised resource for coding challenges and common consensus on how to evaluate and rate the results of a challenge.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              challenge has a low active ecosystem.
              It has 8 star(s) with 3 fork(s). There are 24 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 0 open issues and 3 have been closed. On average issues are closed in 133 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of challenge is current.

            kandi-Quality Quality

              challenge has 0 bugs and 0 code smells.

            kandi-Security Security

              challenge has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              challenge code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              challenge does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              challenge releases are not available. You will need to build from source code and install.
              It has 243 lines of code, 14 functions and 5 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of challenge
            Get all kandi verified functions for this library.

            challenge Key Features

            No Key Features are available at this moment for challenge.

            challenge Examples and Code Snippets

            No Code Snippets are available at this moment for challenge.

            Community Discussions

            QUESTION

            Slicing of a scanned image based on large white spaces
            Asked 2022-Apr-16 at 02:46

            I am planning to split the questions from this PDF document. The challenge is that the questions are not orderly spaced. For example the first question occupies an entire page, second also the same while the third and fourth together make up one page. If I have to manually slice it, it will be ages. So, I thought to split it up into images and work on them. Is there a possibility to take image as this

            and split into individual components like this?

            ...

            ANSWER

            Answered 2022-Apr-16 at 02:46

            This is a classic situation for dilate. The idea is that adjacent text corresponds with the same question while text that is farther away is part of another question. Whenever you want to connect multiple items together, you can dilate them to join adjacent contours into a single contour. Here's a simple approach:

            1. Obtain binary image. Load the image, convert to grayscale, Gaussian blur, then Otsu's threshold to obtain a binary image.

            2. Remove small noise and artifacts. We create a rectangular kernel and morph open to remove small noise and artifacts in the image.

            3. Connect adjacent words together. We create a larger rectangular kernel and dilate to merge individual contours together.

            4. Detect questions. From here we find contours, sort contours from top-to-bottom using imutils.sort_contours(), filter with a minimum contour area, obtain the rectangular bounding rectangle coordinates and highlight the rectangular contours. We then crop each question using Numpy slicing and save the ROI image.

            Otsu's threshold to obtain a binary image

            Here's where the interesting section happens. We assume that adjacent text/characters are part of the same question so we merge individual words into a single contour. A question is a section of words that are close together so we dilate to connect them all together.

            Individual questions highlighted in green

            Top question

            Bottom question

            Saved ROI questions (assumption is from top-to-bottom)

            Code

            Source https://stackoverflow.com/questions/71882225

            QUESTION

            Using Spark window with more than one partition when there is no obvious partitioning column
            Asked 2022-Apr-10 at 20:21

            Here is the scenario. Assuming I have the following table:

            identifier line 51169081604 2 00034886044 22 51168939455 52

            The challenge is to, for every single column line, select the next biggest column line, which I have accomplished by the following SQL:

            ...

            ANSWER

            Answered 2022-Apr-10 at 20:21

            Using your "next" approach AND assuming the data is generated in ascending line order, the following does work in parallel, but if actually faster you can tell me; I do not know your volume of data. In any event you cannot solve just with SQL (%sql).

            Here goes:

            Source https://stackoverflow.com/questions/71803991

            QUESTION

            Count nodes within k distance of marked nodes in grid
            Asked 2022-Feb-25 at 09:45

            I am attempting to solve a coding challenge however my solution is not very performant, I'm looking for advice or suggestions on how I can improve my algorithm.

            The puzzle is as follows:

            You are given a grid of cells that represents an orchard, each cell can be either an empty spot (0) or a fruit tree (1). A farmer wishes to know how many empty spots there are within the orchard that are within k distance from all fruit trees.

            Distance is counted using taxicab geometry, for example:

            ...

            ANSWER

            Answered 2021-Sep-07 at 01:11

            This wouldn't be easy to implement but could be sublinear for many cases, and at most linear. Consider representing the perimeter of each tree as four corners (they mark a square rotated 45 degrees). For each tree compute it's perimeter intersection with the current intersection. The difficulty comes with managing the corners of the intersection, which could include more than one point because of the diagonal alignments. Run inside the final intersection to count how many empty spots are within it.

            Source https://stackoverflow.com/questions/69075779

            QUESTION

            What's Clang's problem with my code? GCC and MSVC think it's fine
            Asked 2022-Feb-05 at 10:17

            I'm working on an Advent of Code challenge (2021 day 18). Just as a test I tried compiling it on different compilers. While GCC (11.2) and MSVC (19.30) think it's fine, Clang (13.0.0) throws a list of errors. link to compiler explorer

            ...

            ANSWER

            Answered 2022-Feb-05 at 10:17

            Your type is an aggregate

            Source https://stackoverflow.com/questions/70996917

            QUESTION

            How to setup .NET 6 with Dapper Identity and Discord Login
            Asked 2022-Jan-29 at 17:34

            I'm trying to figure out how to setup a login via Discord Oauth2 while using Dapper as my ORM.

            Microsoft has a guide here that I have followed to setup all of my stores. I infact can call CreateAsync() method and a user gets created in my database, so I believe that side of things is completely setup.

            My issues lie within external login. Below you will find what I have tried.

            Program.cs:

            ...

            ANSWER

            Answered 2022-Jan-29 at 17:34

            Firstly... We need to take a look at the implementation of the internal method GetExternalLoginInfoAsync inside SignInManager.cs and take note of all the conditions that could possibly lead to null being returned.

            I will provide my answer as comments within the code below:

            Source https://stackoverflow.com/questions/70794402

            QUESTION

            How to make this linear time complexity to log time complexity?
            Asked 2022-Jan-20 at 12:09

            I was practising for a coding challenge and I got stuck up with this problem.

            A and his friend bought a number each from the integer shop, A has number N and his friend has number M. A wants that both their numbers should be co-primes. To achieve this, A divides both the numbers by the largest number which can divide both the numbers. A wants to know the sum of numbers after doing this operation, help him find that sum.

            Input

            ...

            ANSWER

            Answered 2022-Jan-20 at 12:06

            You should use any efficient algorithm to find GCD - Greatest Common Divisor. E.g. you can try Euclidean algorithm with O(log(min(N, M)) time complexity.

            Source https://stackoverflow.com/questions/70785844

            QUESTION

            Passing an array as a parameter to a function to pick a random string
            Asked 2022-Jan-09 at 19:42

            I am currently doing a javascript course on udemy and ran into a problem with a small coding challenge. The code is supposed to pick a random person from an array. My code works on their test platform, but i cant get it to work in the chrome developer tools.

            ...

            ANSWER

            Answered 2022-Jan-04 at 20:20

            you've called whosPaying without any args, then names end up being undefined.

            Do this instead: whosPaying(names), or drop the names parameter of whosPaying

            Source https://stackoverflow.com/questions/70584585

            QUESTION

            How do I get details of a veracode vulnerability report?
            Asked 2022-Jan-07 at 21:46

            How do I get details of a veracode vulnerability report?

            I'm a maintainer of a popular JS library, Ramda, and we've recently received a report that the library is subject to a prototype pollution vulnerability. This has been tracked back to a veracode report that says:

            ramda is vulnerable to prototype pollution. An attacker can inject properties into existing construct prototypes via the _curry2 function and modify attributes such as __proto__, constructor, and prototype.

            I understand what they're talking about for Prototype Pollution. A good explanation is at snyk's writeup for lodash.merge. Ramda's design is different, and the obvious analogous Ramda code is not subject to this sort of vulnerability. That does not mean that no part of Ramda is subject to it. But the report contains no details, no code snippet, and no means to challenge their findings.

            The details of their description are clearly wrong. _curry2 could not possibly be subject to this problem. But as that function is used as a wrapper to many other functions, it's possible that there is a real vulnerability hidden by the reporter's misunderstanding.

            Is there a way to get details of this error report? A snippet of code that demonstrates the problem? Anything? I have filled out their contact form. An answer may still be coming, as it was only 24 hours ago, but I'm not holding my breath -- it seems to be mostly a sales form. All the searching I've done leads to information about how to use their security tool and pretty much nothing about how their custom reports are created. And I can't find this in CVE databases.

            ...

            ANSWER

            Answered 2022-Jan-07 at 21:46

            Ok, so to answer my own question, here's how to get the details on a Veracode vulnerability report in less than four weeks and in only fifty-five easy steps.

            Pre-work Day 1
            • Receive a comment on the issue that says that the user has received

              a VULN ticket to fix this Prototype Pollution vulnerability found in ramda.

            • Carry on a discussion regarding this comment to learn that there is a report that claims that

              ramda is vulnerable to prototype pollution. An attacker can inject properties into existing construct prototypes via the _curry2 function and modify attributes such as __proto__, constructor, and prototype.

              and eventually learn that this is due to a report from the software security company Veracode.

            Days 2 & 3
            • Examine that report to find that it has no details, no explanation of how to trigger the vulnerability, and no suggested fix.

            • Examine the report and other parts of the Veracode site to find there is no public mechanism to challenge such a report.

            Day 4
            • Report back to the library's issue that the report must be wrong, as the function mentioned could not possibly generate the behavior described.

            • Post an actual example of the vulnerability under discussion and a parallel snippet from the library to demonstrate that it doesn't share the problem.

            • Find Veracode's online support form, and submit a request for help. Keep your expectations low, as this is probably for the sales department.

            • Post a StackOverflow Question2 asking how to find details of a Veracode vulnerability report, using enough details that if the community has the knowledge, it should be easy to answer.

            Days 5 & 6
            • Try to enjoy your Friday and Saturday. Don't obsessively check your email to see if Veracode has responded. Don't visit the StackOverflow question every hour to see if anyone has posted a solution. Really, don't do these things; they don't help.
            Day 7
            • Add a 250-reputation point bounty to the StackOverflow question, trying to get additional attention from the smart people who must have dealt with this before.
            Day 8
            • Find direct email support addresses on the Veracode site, and send an email asking for details of the supposed vulnerability, a snippet that demonstrates the issue, and procedures to challenge their findings.
            Day 9
            • Receive a response from a Veracode Support email addressthat says, in part,

              Are you saying our vuln db is not correct per your github source? If so, I can send it to our research team to ensure it looks good and if not, to update it.

              As for snips of code, we do not provide that.

            • Reply, explaining that you find the report missing the details necessary to challenge it, but that yes, you expect it is incorrect.

            • Receive a response that this has been "shot up the chain" and that you will be hearing from them soon.

            Days 10 - 11
            • Again, don't obsessively check your email or the StackOverflow question. But if you do happen to glance at StackOverflow, notice that while there are still no answers to it, there are enough upvotes to cover over half the cost of the bounty. Clearly you're not alone in wanting to know how to do this.
            Day 12
            • Receive an email from Veracode:

              Thank you for your interest in Application Security and Veracode.

              Do you have time next week to connect?

              Also, to make sure you are aligned with the right rep, where is your company headquartered?

            • Respond that you're not a potential customer and explain again what you're looking for.

            • Add a comment to the StackOverflow to explain where the process has gotten to and expressing your frustration.

            Days 13 - 14
            • Watch another weekend go by without any way to address this concern.

            • Get involved in a somewhat interesting discussion about prototype pollution in the comments to the StackOverflow post.

            Day 15
            • Receive an actually helpful email from Veracode, sent by someone new, whose signature says he's a sales manager. The email will look like this:

              Hi Scott, I asked my team to help out with your question, here was their response:

              We have based this artifact from the information available in https://github.com/ramda/ramda/pull/3192. In the Pull Request, there is a POC (https://jsfiddle.net/3pomzw5g/2/) clearly demonstrating the prototype pollution vulnerability in the mapObjIndexed function. In the demo, the user object is modified via the __proto__​ property and is
              considered a violation to the Integrity of the CIA triad. This has been reflected in our CVSS scoring for this vulnerability in our vuln db.

              There is also an unmerged fix for the vulnerability which has also been
              included in our artifact (https://github.com/ramda/ramda/pull/3192/commits/774f767a10f37d1f844168cb7e6412ea6660112d )

              Please let me know if there is a dispute against the POC, and we can look further into this.

            • Try to avoid banging your head against the wall for too long when you realize that the issue you thought might have been raised by someone who'd seen the Veracode report was instead the source of that report.

            • Respond to this helpful person that yes you will have a dispute for this, and ask if you can be put directly in touch with the relevant Veracode people so there doesn't have to be a middleman.

            • Receive an email from this helpful person -- who needs a name, let's call him "Kevin" -- receive an email from Kevin adding to the email chain the research team. (I told you he was helpful!)

            • Respond to Kevin and the team with a brief note that you will spend some time to write up a response and get back to them soon.

            • Look again at the Veracode Report and note that the description has been changed to

              ramda is vulnerable to prototype pollution. An attacker is able to inject and modify attributes of an object through the mapObjIndexed function via the proto property.

              but note also that it still contains no details, no snippets, no dispute process.

            • Receive a bounced-email notification because that research team's email is for internal Veracode use only.

            • Laugh because the only other option is to cry.

            • Tell Kevin what happened and make sure he's willing to remain as an intermediary. Again he's helpful and will agree right away.

            • Spend several hours writing up a detailed response, explaining what prototype pollution is and how the examples do not display this behavior. Post it ahead of time on the issue. (Remember the issue? This is a story about the issue.3) Ask those reading for suggestions before you send the email... mostly as a way to ensure you're not sending this in anger.

            • Go ahead and email it right away anyway; if you said something too angry you probably don't want to be talked out of it now, anyhow.

            • Note that the nonrefundable StackOverflow bounty has expired without a single answer being offered.

            Days 16 - 21
            • Twiddle your thumbs for a week, but meanwhile...

            • Receive a marketing email from Veracode, who has never sent you one before.

            • Note that Veracode has again updated the description to say

              ramda allows object prototype manipulation. An attacker is able to inject and modify attributes of an object through the mapObjIndexed function via the proto property. However, due to ramda's design where object immutability is the default, the impact of this vulnerability is limited to the scope of the object instead of the underlying object prototype. Nonetheless, the possibility of object prototype manipulation as demonstrated in the proof-of-concept under References can potentially cause unexpected behaviors in the application. There are currently no known exploits.

              If that's not clear, a translation would be, "Hey, we reported this, and we don't want to back down, so we're going to say that even though the behavior we noted didn't actually happen, the behavior that's there is still, umm, err, somehow wrong."

            • Note that a fan of the library whose employer has a Veracode account has been able to glean more information from their reports. It turns out that their details are restricted to logged-in users, leaving it entirely unclear how they thing such vulnerabilities should be fixed.

            Day 22
            • Send a follow-up email to Kevin4 saying

              I'm wondering if there is any response to this.

              I see that the vulnerability report has been updated but not removed.
              I still dispute the altered version of it. If this behavior is a true vulnerability, could you point me to the equivalent report on JavaScript's Object.assign, which, as demonstrated earlier, has the exact same issue as the function in question.

              My immediate goal is to see this report retracted. But I also want to point out the pain involved in this process, pain that I think Veracode could fix:

              I am not a customer, but your customers are coming to me as Ramda's maintainer to fix a problem you've reported. That report really should have enough information in it to allow me to confirm the vulnerability reported. I've learned that such information is available to a logged- in customer. That doesn't help me or others in my position to find the information. Resorting to email and filtering it through your sales department, is a pretty horrible process. Could you alter your public reports to contain or point to a proof of concept of the vulnerability?
              And could you further offer in the report some hint at a dispute process?

            Day 23
            • Receive an email from the still-helpful Kevin, which says

              Thanks for the follow up [ ... ], I will continue to manage the communication with my team, at this time they are looking into the matter and it has been raised up to the highest levels.

              Please reach back out to me if you don’t have a response within 72 hrs.

              Thank you for your patience as we investigate the issue, this is a new process for me as well.

            • Laugh out loud at the notion that he thinks you're being patient.

            • Respond, apologizing to Kevin that he's caught in the middle, and read his good-natured reply.

            Day 25
            • Hear back from Kevin that your main objective has been met:

              Hi Scott, I wanted to provide an update, my engineering team got back
              to me with the following:

              “updating our DB to remove the report is the final outcome”

              I have also asked for them to let me know about your question regarding the ability to contend findings and will relay that back once feedback is received.

              Otherwise, I hope this satisfies your request and please let me know if any further action is needed from us at this time.

            • Respond gratefully to Kevin and note that you would still like to hear about how they're changing their processes.

            • Reply to your own email to apologize to Kevin for all the misspelling that happened when you try to type anything more than a short text on your mobile device.

            • Check with that helpful Ramda user with Veracode log-in abilities whether the site seems to be updated properly.

            • Reach out to that same user on Twitter when he hasn't responded in five minutes. It's not that you're anxious and want to put this behind you. Really it's not. You're not that kind of person.

            • Read that user's detailed response explaining that all is well.

            • Receive a follow-up from the Veracode Support email address telling you that

              After much consideration we have decided to update our db to remove this report.

              and that they're closing the issue.

            • Laugh about the fact that they are sending this after what seem likely the close of business for the week (7:00 PM your time on a Friday.)

            • Respond politely to say that you're grateful for the result, but that you would still like to see their dispute process modernized.

            Day 27
            • Write a 2257-word answer5 to your own Stack Overflow question explaining in great detail the process you went through to resolve this issue.

            And that's all it takes. So the next time you run into this, you can solve it too!




            Update

            (because you knew it couldn't be that easy!)

            Day 61
            • Receive an email from a new Veracode account executive which says

              Thanks for your interest! Introducing myself as your point of contact at Veracode.

              I'd welcome the chance to answer any questions you may have around Veracode's services and approach to the space.

              Do you have a few minutes free to touch base? Please let me know a convenient time for you and I'll follow up accordingly.

            • Politely respond to that email suggesting a talk with Kevin and including a link to this list of steps.


            1 This is standard behavior with Ramda issues, but it might be the main reason Veracode chose to report this.

            2 Be careful not to get into an infinite loop. This recursion does not have a base case.

            3 Hey, this was taking place around Thanksgiving. There had to be an Alice's Restaurant reference!

            4 If you haven't yet found a Kevin, now would be a good time to insist that Veracode supply you with one.

            5 Including footnotes.

            Source https://stackoverflow.com/questions/69936667

            QUESTION

            THREE.JS & Reality Capture - Rotation issue photogrammetry reference camera's in a 3D space
            Asked 2022-Jan-03 at 14:57

            Thanks for taking the time to review my post. I hope that this post will not only yield results for myself but perhaps helps others too!

            Introduction

            Currently I am working on a project involving pointclouds generated with photogrammetry. It consists of photos combined with laser scans. The software used in making the pointcloud is Reality Capture. Besides the pointcloud export one can export "Internal/External camera parameters" providing the ability of retrieving photos that are used to make up a certain 3D point in the pointcloud. Reality Capture isn't that well documented online and I have also posted in their forum regarding camera variables, perhaps it can be of use in solving the issue at hand?

            Only a few variables listed in the camera parameters file are relevant (for now) in referencing camera positioning such as filename, x,y,alt for location, heading, pitch and roll as its rotation.

            Currently the generated pointcloud is loaded into the browser compatible THREE.JS viewer after which the camera parameters .csv file is loaded and for each known photo a 'PerspectiveCamera' is spawned with a green cube. An example is shown below:

            The challenge

            As a matter of fact you might already know what the issue might be based on the previous image (or the title of this post of course ;P) Just in case you might not have spotted it, the direction of the cameras is all wrong. Let me visualize it for you with shabby self-drawn vectors that rudimentary show in what direction it should be facing (Marked in red) and how it is currently vectored (green).

            Row 37, DJI_0176.jpg is the most right camera with a red reference line row 38 is 177 etc. The last picture (Row 48 is DJI_189.jpg) and corresponds with the most left image of the clustured images (as I didn't draw the other two camera references within the image above I did not include the others).

            When you copy the data below into an Excel sheet it should display correctly ^^

            ...

            ANSWER

            Answered 2022-Jan-02 at 22:26

            At first glance, I see three possibilities:

            • It's hard to see where the issue is without showing how you're using the createCamera() method. You could be swapping pitch with heading or something like that. In Three.js, heading is rotation around the Y-axis, pitch around X-axis, and roll around Z-axis.

            • Secondly, do you know in what order the heading, pitch, roll measurements were taken by your sensor? That will affect the way in which you initiate your THREE.Euler(xRad, yRad, zRad, 'XYZ'), since the order in which to apply rotations could also be 'YZX', 'ZXY', 'XZY', 'YXZ' or 'ZYX'.

            • Finally, you have to think "What does heading: 0 mean to the sensor?" It could mean different things between real-world and Three.js coordinate system. A camera with no rotation in Three.js is looking straight down towards -Z axis, but your sensor might have it pointing towards +Z, or +X, etc.

            Edit:

            I added a demo below, I think this is what you needed from the screenshots. Notice I multiplied pitch * -1 so the cameras "Look down", and added +180 to the heading so they're pointing in the right... heading.

            Source https://stackoverflow.com/questions/70380886

            QUESTION

            JS does not work in google chrome and it only works on firefox
            Asked 2022-Jan-02 at 09:10

            This the code I wrote in order to find the answer to a programming challenge and it's to insert elements into a element with the values equal to color names and choosing a color form the list will change the color of the below it and it's supposed to be JS only. But my problem is that my code works perfectly on Firefox ,but it does not work in chrome or other browsers.

            ...

            ANSWER

            Answered 2022-Jan-02 at 08:25

            If this works properly in Firefox might be in chrome JavaScript is disabled.

            Source https://stackoverflow.com/questions/70554511

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install challenge

            You can download it from GitHub.
            On a UNIX-like operating system, using your system’s package manager is easiest. However, the packaged Ruby version may not be the newest one. There is also an installer for Windows. Managers help you to switch between multiple Ruby versions on your system. Installers can be used to install a specific or multiple Ruby versions. Please refer ruby-lang.org for more information.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/honeypotio/challenge.git

          • CLI

            gh repo clone honeypotio/challenge

          • sshUrl

            git@github.com:honeypotio/challenge.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Consider Popular Ruby Libraries

            rails

            by rails

            jekyll

            by jekyll

            discourse

            by discourse

            fastlane

            by fastlane

            huginn

            by huginn

            Try Top Libraries by honeypotio

            searchspot

            by honeypotioRust

            techmap

            by honeypotioJavaScript

            reina

            by honeypotioRuby

            githubarchive

            by honeypotioRuby

            AutoTech

            by honeypotioJavaScript