• Breaking News

    Sunday, June 27, 2021

    How does Brave Search build its own index? Ask Programming

    How does Brave Search build its own index? Ask Programming


    How does Brave Search build its own index?

    Posted: 27 Jun 2021 03:21 PM PDT

    So Brave released a new privacy oriented search engine, and unlike Qwant and DDG, they do not rely on Bing for results.

    My question is, can someone ELI5 how they do it because my understanding is building your own index is very complicated+expensive and that is the reason why Qwant, Ecosia, and DDG do not have their own. Brave seem to say its reliant on the user to build its engine!?

    submitted by /u/floatontherainbowtw
    [link] [comments]

    Is there any debugger out there that can resume from a cached state?

    Posted: 27 Jun 2021 09:22 PM PDT

    I was just thinking, in particularly large and lumbersome applications, when one is debugging the same area of code over and over, it would be nice if there were a way to set some markers telling the debugger 'next time I run the application, save all the necessary state needed to deliver the exact same inputs to this demarcated function(s), and run it from there.' I searched briefly and didn't find anything similar to that. Language doesn't really matter, I'm just curious, does anyone know if such a thing exists?

    The nearest match I found was https://devblogs.microsoft.com/visualstudio/step-back-while-debugging-with-intellitrace/ but that isn't taking a permanent snapshot that you can repeatedly resume from

    submitted by /u/Calm_Clothes_6450
    [link] [comments]

    Having trouble with my binary search code

    Posted: 27 Jun 2021 09:28 PM PDT

    import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; public class BinarySearchRange { public static void main(String[] args) { BinarySearchRange s=new BinarySearchRange(); int[] nums = getIntegers(5); int n=nums.length; int x=10; int result = s.search(nums, 0, n-1, x); if(result==-1) System.out.println("Element not present"); else System.out.println("Element found at index "+result); } public static int[] getIntegers(int capacity) { int array[] = new int[capacity]; String path = "my file path/new.csv"; String line = ""; try { BufferedReader br = new BufferedReader(new FileReader(path)); int k = 0; while ((line = br.readLine()) != null) { String arr[] = line.split(","); for (int i = 0; i < arr.length; i++) { array[k++] = Integer.parseInt(arr[i]); } } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (IndexOutOfBoundsException e) { e.printStackTrace(); } return array; } public int search(int nums[], int target1, int i, int target) { if (nums.length == 0) return -1; int left = target1; int right = i; while (left <= right) { int midpoint = left + (right - left) / 2; if (nums[midpoint] == target) return midpoint; else if (nums[midpoint] > target) right = midpoint - 1; else left = midpoint + 1; } return -1; } } 

    I am getting the following error:

    Exception in thread "main" java.lang.NumberFormatException: For input string: "1"at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)at java.base/java.lang.Integer.parseInt(Integer.java:652)at java.base/java.lang.Integer.parseInt(Integer.java:770)at BinarySearchRange.getIntegers(BinarySearchRange.java:28)at BinarySearchRange.main(BinarySearchRange.java:10)

    My numbers in the .csv file are as such: | 1 |4 |10 | 15 | 20 |

    What seems to be the issue? I feel like the code should run but having trouble interpreting the error messages

    submitted by /u/AllenrossInc
    [link] [comments]

    Prerequisites/Tips for LLD system design/machine coding interview

    Posted: 27 Jun 2021 10:23 PM PDT

    I've a LLD system design/machine coding round in a couple of days and this is my first design interview. The recruiter asked me to setup any ide & language of my choice & setup the project/boilerplate code along with required libraries. So, the following are my doubts:

    1. I'm planning to go with Java. Are there any libraries/plugins which you think are useful like for output formatting, logging or testing?

    2. What are some things you wish you knew when attending your first LLD interview?

    3. Is DB required or in-memory data structures sufficient? In what kind of cases should a DB chosen?

    submitted by /u/Akhilan23
    [link] [comments]

    Make own GUI in C/C++

    Posted: 27 Jun 2021 02:40 AM PDT

    Hello. I'm currently working on my own GUI library, but I need to find OpenGL 2D renderer to render shapes, text and photos,videos. Where I can find minimalistic library for render?

    Give me links on tiny libraries (I'm use OpenGL 3.3+ )

    Thanks

    submitted by /u/makuta_mmc
    [link] [comments]

    How do I use SVG code as a checkbox?

    Posted: 27 Jun 2021 07:21 PM PDT

    I made an svg image in Adobe Illustrator (id="gray-x-button"), and I want to use the svg code as a custom shaped checkbox. Once the user clicks on the checkbox, I want the checkbox to change to a different svg image I made in Illustrator (id="red-x-button"). How would I do that using HTML, CSS, and Javascript? I'm very new to web development, so I've been having trouble even knowing where to begin. All I have right now is my svg code that I exported from Illustrator, which I will post below.

    SVG Code:

    <svg id="gray-x-button" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="152.53" height="152.53" viewBox="0 0 152.53 152.53">s <defs> <style>.cls-1-g{fill:url(#linear-gradient);}.cls-2-g{opacity:0.25;}.cls-3-g{fill:#fff;}</style> <linearGradient id="linear-gradient" x1="187.42" y1="187.55" x2="317.1" y2="317.23" gradientUnits="userSpaceOnUse"> <stop offset="0" stop-color="#d1d1d1"/> <stop offset="0.62" stop-color="#acadaf"/> <stop offset="1" stop-color="#939598"/> </linearGradient> </defs> <path id="Cross-g" class="cls-1-g" d="M280.3,252.39,326.69,206a6.26,6.26,0,0,0,0-8.86L307.51,178a6.28,6.28,0,0,0-8.86,0l-46.39,46.39L205.87,178a6.28,6.28,0,0,0-8.86,0l-19.18,19.18a6.28,6.28,0,0,0,0,8.86l46.39,46.39-46.39,46.39a6.28,6.28,0,0,0,0,8.86L197,326.82a6.26,6.26,0,0,0,8.86,0l46.39-46.39,46.39,46.39a6.26,6.26,0,0,0,8.86,0l19.18-19.18a6.26,6.26,0,0,0,0-8.86Z" transform="translate(-176 -176.13)"/> <g id="Depth-g" class="cls-2-g"> <path class="cls-3-g" d="M305.08,180.13a4.2,4.2,0,0,1,3,1.25l-2-2a4.25,4.25,0,0,0-6,0l-47.81,47.8-47.81-47.8a4.25,4.25,0,0,0-6,0l-19.19,19.18a4.26,4.26,0,0,0,0,6l2,2a4.26,4.26,0,0,1,0-6l19.19-19.18a4.25,4.25,0,0,1,6,0l47.81,47.8,47.81-47.8A4.2,4.2,0,0,1,305.08,180.13Z" transform="translate(-176 -176.13)"/> <polygon class="cls-3-g" points="149.28 124.07 103.47 78.27 149.28 124.07 149.28 124.07"/> <path class="cls-3-g" d="M227.8,256.13l-2-2-46.64,46.64a4.16,4.16,0,0,0,0,5.88l18.72,18.72h0l-16.77-16.77a4.16,4.16,0,0,1,0-5.88Z" transform="translate(-176 -176.13)"/> </g> </svg> <svg id="red-x-button" data-name="Layer 2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="152.53" height="152.53" viewBox="0 0 152.53 152.53"> <defs> <style>.cls-1-r{fill:#231f20;}.cls-2-r{fill:url(#radial-gradient);}</style> <radialGradient id="radial-gradient" cx="252.26" cy="252.39" r="74.26" gradientUnits="userSpaceOnUse"> <stop offset="0" stop-color="#f7941d"/> <stop offset="0.2" stop-color="#f4701f"/> <stop offset="0.43" stop-color="#f14c21"/> <stop offset="0.65" stop-color="#ef3123"/> <stop offset="0.85" stop-color="#ed2224"/> <stop offset="1" stop-color="#ed1c24"/> </radialGradient> </defs> <path id="Cross-r" class="cls-1-r" d="M280.3,252.39,326.69,206a6.26,6.26,0,0,0,0-8.86L307.51,178a6.28,6.28,0,0,0-8.86,0l-46.39,46.39L205.87,178a6.28,6.28,0,0,0-8.86,0l-19.18,19.18a6.28,6.28,0,0,0,0,8.86l46.39,46.39-46.39,46.39a6.28,6.28,0,0,0,0,8.86L197,326.82a6.26,6.26,0,0,0,8.86,0l46.39-46.39,46.39,46.39a6.26,6.26,0,0,0,8.86,0l19.18-19.18a6.26,6.26,0,0,0,0-8.86Z" transform="translate(-176 -176.13)"/> <path class="cls-2-r" d="M303.08,326.66a4.24,4.24,0,0,1-3-1.25L252.26,277.6l-47.81,47.81a4.25,4.25,0,0,1-6,0l-19.19-19.19a4.26,4.26,0,0,1,0-6l47.81-47.81-47.81-47.81a4.26,4.26,0,0,1,0-6l19.19-19.19a4.26,4.26,0,0,1,6,0l47.81,47.8,47.81-47.81a4.26,4.26,0,0,1,6,0l19.19,19.18a4.26,4.26,0,0,1,0,6l-47.81,47.81,47.81,47.81a4.25,4.25,0,0,1,0,6l-19.19,19.19A4.24,4.24,0,0,1,303.08,326.66Z" transform="translate(-176 -176.13)"/> </svg> 

    I would prefer to use inline svg code so I can modify it with CSS later. Thanks!

    submitted by /u/bruheggplantemoji
    [link] [comments]

    Raspberry Pi and RFID Membership Project Help

    Posted: 27 Jun 2021 01:07 PM PDT

    I want to use an RFID reader with my raspberry pi to

    1st, read the card

    2nd, enter in a pin

    3rd, show a balance (ex: "you have 5 uses left". something like that)

    4th, once it reads the correct card it will send out a signal to a relay module

    I am implementing this whole system into a golf ball dispenser for membership usage. The machine uses a small electric pulse to cycle the motor.

    I have only found the door opening project but not both working together. If you have any help or ideas that will be greatly appreciated. Also if you find the project I'm trying to do, send it over.

    Thanks!

    submitted by /u/Captcal2501
    [link] [comments]

    Suggestions to generate rhythmic patterns from music?

    Posted: 27 Jun 2021 04:49 PM PDT

    I am building a game inspired by Osu and Guitar Hero- was wondering how these games generated rhythmic patterns to match the music. Any ideas on how I would program this? Thanks in advance.

    submitted by /u/EfficientBag2021
    [link] [comments]

    "Accurate" Life Expectancy API

    Posted: 27 Jun 2021 01:22 PM PDT

    I am trying to make an app that has a user profile and from that I plan on getting life expectancy. Is there an API available that takes a lot of factors but can get a more "accurate" Longevity data?

    If not is there any reliable publicly available data that I can use to build my own API?

    submitted by /u/justanothernepali
    [link] [comments]

    DirectX 12 SRV Heap design

    Posted: 27 Jun 2021 11:55 AM PDT

    Hello, I'm learning DirectX 12 coming from OpenGL. I'm porting a simple game which has a couple dozen textures or so. The samples I'm seeing in my book typically only allocate one or two textures and don't tend to have to bind different ones depending on the context.

    My question is: How should the SRV Heap be used? Is it meant for large, long-term storage? Should I build an SRV descriptor for every texture and keep them in the SRV heap, potentially keeping a few dozen descriptors in the heap at once?

    Or is it meant to be smaller, short-term storage, where I create the SRV descriptor, bind it, draw it, then overwrite it with the next texture's SRV?

    How big is the SRV Heap meant to be?

    submitted by /u/proboardslolv5
    [link] [comments]

    my website loads/white screens 1-2 sec when I scroll down on it

    Posted: 27 Jun 2021 11:44 AM PDT

    I have programmed a website but every time I refresh and scroll down, everything stops / lags down while half my website turns blank white. After 1-2 sec with blank white and scrolling up and down 2-3 times it stops. How can I make this stop?

    submitted by /u/markusONreddit4232
    [link] [comments]

    Any Microsoft employees here know how long Windows 11 was in development for?

    Posted: 27 Jun 2021 09:19 AM PDT

    digital clock using 8bit LCD, i need this code to be in register level coding but there seems to be a few errors i could not correct. Pleasee help! the link will only be available for a few hours!

    Posted: 27 Jun 2021 07:03 AM PDT

    Guidance on "last letter name game" algorithm

    Posted: 27 Jun 2021 12:27 AM PDT

    I'm currently working on a mini-project where I have an algorithm which determines whether or not a player will win or lose the game given a certain starting point in the "last letter name game"

    The rules of the game are as follows. First, the players will decide on a topic (eg cities). Then, the player who goes first will name something that is within the topic (eg Los Angeles). The player who goes next will have to name something else within the topic, however the first letter of their answer has to be the same as the last letter of the previous player's answer. Repeats are not allowed. This goes on indefinitely until a player is unable to come up with a response, in which case they lose. So, the continuation of the cities game might look like Los Angeles -> San Diego -> Oklahoma City -> ...

    I am working on an algorithm that can determine who will win in a two player version of this game with perfect play from both players given a list of possible words and the word that a player starts with. Since a perfect player will never forget any elements, the game will end when a player completely runs out of possible answers. Because there are far too many cities in the world to make that topic feasible, I am currently trying to use countries as a topic instead. As an example, if a player starts with Germany they will win, since the other player can only possibly say Yemen, in which case the first player will say Norway and win the game. Similarly, if the first player says Yemen they will lose the game.

    I am a little bit lost on how to make this algorithm. Currently, I have only been able to think of exponential-time solutions, which take way too long. Can anyone lead me in a better direction? Thank you in advance.

    submitted by /u/Curious-Astronaut-46
    [link] [comments]

    Music notation

    Posted: 27 Jun 2021 12:47 AM PDT

    Hey all, I'm really interested in making a music notation program. I've done a lot of python for school so I know my way around that stuff. If anyone could give some advice or leave some breadcrumbs that would be sick. Thanks!

    submitted by /u/barryseinfeld402
    [link] [comments]

    Help

    Posted: 27 Jun 2021 06:58 AM PDT

    I NEed to learn C++ in less time like 3 months or more send me all the resources

    submitted by /u/thatpandasock
    [link] [comments]

    No comments:

    Post a Comment