instruction
stringlengths
71
95.1k
I have not done Javascript programming in almost a decade. I see that it has changed a lot. Below is code that displays colourful block digits. Any constructive feedback is welcome. function getRandomColor() { const colours = ["#FF6663", "#94FF63", "#63FFEA", "#A763FF", "#F2FF63"]; return colours[Math.floor(Math....
I have some Python tests I have written, but these are for making assertions about data in infrastructure code (AWS CloudFormation templates). I am using the Unittest framework. I have code like this: class TestData(unittest.TestCase): def testConfigStackYaml(self): bad_list = [] for stack in glob...
This is "homework" from a Swift course, which I'm currently taking. A mockup and the image-assets are provided by the instructor. We are supposed to create the layout and to write some appropriate code. Here's the code of my ViewController: import UIKit class ViewController: UIViewController { // MARK: Outlets ...
I've created an small lib to allow writing to console with multiple threads and reading from console at the same time avoiding output being written in the middle of input because console cursor is there. My library implements simple mechanism to make console write output above input. TSConsole is the main class for in...
There are many side controllers in my project, like the following images. They share the same head view appearance and layout. Use protocol to extract common code . protocol SideHeaderDelegate: class { var h: SideHeader{ get set } var view: UIView! {get} var follow: UIView {get} func back() } Use...
This code currently works i wonder if i could make any optimisations or anything to make the code appear cleaner using functions or whatnot, suggestions are welcome! #include <cmath> #include <cstdio> int prompt(const char* name) { printf("%s", name); int value; scanf("%d", &value); return value; } int main() { ...
I made an n-body gravitational simulation in python. The algorithm does produce an approximate solution, which is shown at the bottom of the post. Additional methods to produce animations (among other things) can be found here. I would like to see if efficiency, readability, and/or accuracy can be improved. The main i...
I am creating a simple model relation in ASP.Net core. My model relations are like this: A user can have many posts A post can have many comments A user can have many comments Now I am trying to seed the relations using the dbcontext. I have a feeling that I am doing something wrong. Can anybody determine if I am doi...
Say you have an array that is "semi-sorted", e.g. something like this: [7,8,9,10,1,2,3,4,5,6] Where a part of the end of the sorted array was transferred to the beginning. Is there a way to still find an element in it in log(n) time? Here's my solution: def findVal(arr, val): return helper(arr, 0, len(arr) - 1, va...
Sum Strings Codewars kata. It's supposed to be able to handle big integers.   Question Given the string representations of two integers, return the string representation of the sum of those integers. For example: sumStrings('1','2') // => '3' A string representation of an integer will contain no characters besides ...
Sometimes, I have a lot of things I want to ask the Internet, so I decided to make my searches go faster with some automation... But I think this could be programmed better, even though I think it's pretty compact. from subprocess import call with open("C:\\Users\\Andy\\Desktop\\queries.txt").read().splitlines() as f,...
Wracking my brain trying to figure this out. I'm not the greatest with Jquery but know enough to kinda get by. Right now I am trying to develop something that will check if a radio button in a group is checked and then to see if its value matches so it can then show the correct corresponding section. I have a crude JSF...
I don't know whether if this is the right place to ask this. I am semi-beginner in C. I always wanted to build my own Programming Language. Here I have built a lexical analyser completely myself. The lexer breaks the source code in tokens consisting of strings, characters, identifiers, constants and special symbols. I...
I'm writing a tool which users can select multiple choices at once. Whilst I can't provide the actual content, I've replicated it with fruit. I'm replicating some functionality from Nikto where it allows different flags like "-mutation abcd". for example here we have three fruits: 1- apple 2- orange 3- kiwi I wanna le...
I tried to create a reusable component which would allow the user to create cards which can have a header, cover image, avatar section (image, title and sub title), a description, a table, a list and a few buttons (add, delete, edit, like, share). All of these are optional and the user can omit whatever is not needed f...
I wanted a polyfill of flexible array members in C89. So I made something similar, and made a toy std::vector with limited functionality on top of it. Here is the code: vector.h /* Flexible array member example in C89 - Just because we can! * It's demonstrated by vectors, but can be generalized. * MIT License; see be...
What is the problem when I return a promise from angular service instead of Observable? If it's a matter of any manipulation or side-effect, that I can easily do inside angular service itself. Then why I shouldn't return a promise over observable? Here's my code for service class public async getCountriesAsync(filter: ...
I wrote script to install public key of my system to remote host. I had tested the script it is working fine for me. script take data like IP password and ssh port form CVS file. I do not want to use import os. only use CSV and paramiko imports. My aim is to copy public key to my remote host. import csv import os from...
Very new to JS (wrote my "Hello World" around 3 days ago), but not to programming in general. My documentation is inspired by the approach I followed for Python (since I haven't learned JS documentation conventions yet). My Code "use strict"; /* Inserts elements from a given source array in a specified target array...
This generates a square matrix with spiral inward increasing values. How can I reduce this code? Input Number = 3 Output 1 2 3 8 9 4 7 6 5 import math row=int(input("Input nomber := ")) lis=[[0 for i in range(0,row)]for j in range(0,row)] y=row a=1 c=0 z=0 x=1 k=1 f=row/2 f=math.ceil(f) for b in range(0,f): if b=...
As the year comes to an end our company need new time-sheets for the new year. Because this is my task to do, I thought I would do my collegues something good by automating some tasks they would otherwise need to do manually. Until now we had a worksheet for presettings, like setting employee-name, ident-number, rema...
I think we all know the game of Scrabble and how popular it is as a simple programming challenge. Here's my attempt at computing a Scrabble score for a given word done in Go. I must admit, I'm fairly new to Go (been learning it for a week or so). Having said that, I'd greatly appreciate all sorts of tips for improving ...
I am trying to refactor a chess game I am currently creating so the code is more flexible and maintainable, while doing this, I came across an event listener which I have no idea on how to make "cleaner". Some of the variable names in the event listener are unintuitive but apart from that, I would like to know how to s...
I am making a ros node to implement dijkstra's algorithm on a 1000x1000 pixel map. I have used map_server to convert the map into an nav_msgs/OccupancyGrid. The map is in the form of a row dominant matrix and I have declared visited, distance and prev in the same form. Distance stores the distance of each index and is...
I'm quite new to C programming so I'm trying to learn the basics. I've made a program that creates a linked list of numbers, then ask user for which number he/she wants to replace and then what number should come instead. I finally got it to work, but since I'm learning this on my own no one is there to say when my sty...
This is my solution to the Codewars problem TV Remote (symbols). Description In short, you are given a virtual keyboard with 3 modes between which can be switched by pressing the Shift button on the virtual keyboard. You have to navigate using only arrow buttons (up, right, down, left) and an OK-button to press the cu...
Using Rails 6. Here's a piece that I wrote just to display number of stars. Obviously I am disgusted by my own code. How would you refactor? # application_helper.rb module ApplicationHelper def show_star_rating(rating) zero_star_icon_name = "star" full_star_icon_name = "star_fill" half_star_icon_name = "s...
I am writing code to implement data sync from multiple sources. I want code to be maintainable to add more data sources if required. Here is the pattern I wish to follow: class Source1Client: def get_domain(self): pass def get_endpoint(self): pass def get_headers(self): pass ...
I'm quite new to both Java and OOP. I'm assuming that pretty much everything about my code can be improved and I appreciate any feedback. However, I am particularly interested in what you think about my code clarity/structure/organisation. For example, I've struggled to decide when functionality should be extracted in...
I've wrote a little program to play Tic-Tac-Toe: public class Control { public static void main(String args[]) { Gui gui = new Gui(); } } The following classed is used for applying the rules of tic-tac-toe: import javax.swing.*; public class TicTacToe { public static int count = 0; public sta...
I have a 60GB file of domain names. Some of them are repeated several times and some of them have sub domains that need stripping out too. For example this might give you a better idea of what the file looks like. email.example.com test.staging.lol.uni.ac.uk hello.test.com email.example.com test.com After parsing the ...
You are given to paint a floor area of size A. There will be 12 paint buckets from 4 primary colors with each having 3 shades (i.e. total 12 buckets). The bucket size, or more specifically, the amount of area you can paint from each shade is given in the following arrays. The different shades of the same primary color ...
I was wondering if anyone would be kind enough to review my basic c++ program. I'm a beginner programmer so was hoping to get feedback on how well I've used object oriented programming i.e. using a class in my program. And in general, how can I make my program better? Many thanks in advance. // Created by George Austi...
We are using a plugin for our WordPress website. I'm trying to add some custom code to it and finally got it working however it is ultra janky. The HTML is a simplified version of the actual site's but it's the JQuery I need help with. I'm trying to trim as much fat as I possibly can. I'm am not the greatest with JQuer...
I'm trying to generate the sum of a collection of strings by calcuating each character's byte value into a sum: $sum = 0; foreach( $array as $item ) { $bytes = unpack( 'C*', $item ); for( $i = 1; $i <= count( $bytes ); $i++ ) { if( isset( $bytes[$i+1] ) ) { $sum += $bytes[$i] - $bytes[$i+1...
I just wrote a Python script that will take a list of urls and find which ones are about to expire. The program queries a database, gets the websites, sanitizes the list, then loops through the list and prints the expiration dates to the file. Any websites that expire within 30 days are printed to a text file as well ...
I've finished implementing a dynamic array in C++. I'm a beginner in C++ and also in algorithms and data structures, so any constructive feedback about improving the implementation would be greatly appreciated. #include <iostream> using namespace std; #define INITIAL_CAPACITY 5 template <class T> class dynamic_array...
Here is a functional "card-drafting engine" which runs through pygame. It simulates fliping cards face up on the table, and the ability for two players to draft through the cards.There are two questions I have, and am very open to advice. import pygame import random import pandas as pd """Layout""" DISPLAY_HEI = 700 D...
I am trying to code a menu that: Is horizontal on lg+ displays at the top of the page Shows a hamburger menu when the user scrolls from the top Will display as the collapsed format when the hamburger is clicked on desktop and mobile I managed to code this in a way that exhibits all of the proper behaviors, but it feel...
My application state is represented by a string of numbers and I'm trying to encode the string so that it is as small as possible (ie. fewest number of characters). An example string would be: 133223333302302040 I realized that most of these strings consist of number pairs containing 0, 1, 2, 3 (4 and 5 also exist but ...
I wrote the following Python program to take 1 word from the user and return certain characters replaced by numbers. Given a dictionary, the program should print all possible combinations of the same word with various characters substituted: import sys def main(argv): if len(argv) != 2: print(f"USAGE: {ar...
Scenario A session would start & end within a time frame. Within this time frame, the device would be moving within a constraint environment. The movement would be extremely slow (slow-walking to stillness). This session could (& would) be entered & exited several times, although doing just a single session might be s...
This is an AI class that takes an array of the board as an argument, and plays the best move after evaluating the board and gets a win rate. I haven't used any java package to do this. How can I make a genetic tree and calculate all possibilities for a given situation public class AI { int turn,ID; AI(int pID) ...
Shown below is a function I wrote for pawn move generation, I find it difficult to understand what the code does in a glance due to the cumbersome if statements, so any changes I make are done unnecessarily slowly. Is there a way to avoid these complex if statements so that the code is more maintainable? if(standardP...
I have written a quick sort routine to inplace sort an array in descending order: module sort contains recursive subroutine qsort_self(array) real(kind=8) :: array(:), temp integer :: length, pivot, i, j i = 0 j = 0 length = 0 pivot = 1 temp = 0 length = size(ar...
I have developed this script to read employee_language table records of a PostgreSQL database using Python 2 (due to some OS limitation). I want to find duplicate language records for each employee, check if there are any duplicate language records for each employee, get the most completed language records among duplic...
So I am solving this task: We have an permutation of the numbers 1..n. I need to answer m queries: -How many numbers between X-th and Y-th position are in the interval [L,K] (<=k and >= L)? So my solution is simple: I create a segment tree and in every node i keep an map -> which numbers are in this interval and the p...
I want to learn Wasm and Rust. This project can execute Wasm from GitHub Pages. The first attempts failed because of some policy error with the Wasm MIME type. When I tried Yew Framework then it worked to run Wasm for my first attempt (it just writes random rows from a text file). For some reason I got a MIME type erro...
I'm trying to find a sensible way to structure a REST API written in Flask. I'm new to writing such things and I've not seen this structure used anywhere else, so before I continue I wanted to ask whether this is a decent way of structuring my API code, or if I'm missing something. I have decided on the following struc...
The problem is as follows: Given two arrays, write a function to compute their intersection. The below code is my solution.I'm just curious as to what the space time and complexity of below algorithm would be. var intersection = function(nums1, nums2) { const intersectionArr = nums1.filter((value)=> nums2.include...
Is my Python Script to play Hanoi Tower respectful of OOP spirit? I have difficulties to create meaningful classes so I started an easy project. Here is one class at the plateau level and then a class to handle towers. How can it be improved (on the OOP level and on script level)? I want then a GUI with TKinter, a thir...
Please be gentle. I'm a pygame n00b and haven't touched pygame in years. This is my unique implementation of the classic game snake. In this game, the snake has a velocity which can vary along both axes of motion in increments of one pixel per frame and the tail follows the exact path the head travels as the snake move...
This is more to get clarity on an implementation that I did. I am working on a React, Node, and Electron application that essentially has a form that a user inputs values that will update some content files. The application has to scale for a lot of different scenarios so I found that I kept writing switch statements t...
The code takes a very simple xml and converts it into a dataframe in csv file. This is the Xml file <Data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Phones> <Date /> <Prog /> <Box /> <Feature /> <WIN>MAFWDS</WIN> <Set>234234</Set> <...
I've never programmed in C before, but decided I wanted to try making Chess. Currently there's no way to check whether the game has ended. Was looking for critique for future projects. #include <stdio.h> #include <math.h> #include <stdlib.h> // 1 pawn 2 rock 3 bishop 4 knight 5 queen 6 king int currentTurn = 1; int bo...
So in my quest to learn coding while having very little formal training has got me here. I am trying to learn the OOP concept and this is my first proper attempt at using OOP. Can you guys point out what can be improved and what are the better practices? I have tried my best to make the program as robust as possible - ...
hackerrank.com Task: Given a base-10 integer, n, convert it to binary (base-2). Then find and print the base-10 integer denoting the maximum number of consecutive 1's in n's binary representation. This question has already been answered but it was in Ruby and I couldn't quite understand the concept, I am just startin...
Just starting to get the idea of MVC with tkinter. I wrote this simple program and I'm looking for feedback. There are no errors, but I don't know if I set it up right or not. import tkinter as tk class Model(): def __init__(self): self.list = ["email", "sms", 'voice'] class View(tk.Frame): def __ini...
Background This is solution to Problem 11 on Project Euler that is concerned with finding largest product of four adjacent numbers in the provided grid. Other than solving the problem I was also interested in creating a search function that would have a more generic character and could search across any number of adjac...
I wrote a code to parse an HTML knock-off from HackerRank, and I would like a review. Mostly I hope to get better at STL and code style. But any tips would be very welcome. Sample input that I would read from cin to parse and answer queries: 4 3 <tag1 value = "HelloWorld"> <tag2 name = "Name1"> </tag2> </tag1...
I would appreciate some feedback on the below code I wrote for a Project Euler problem. The answer comes out correct but I'd like feedback on the design of the function and implementation of docstrings. It seems to me that it may be overly complicated but I'm not sure how to simplify. """ Number letter counts Problem...
The Challenge Given a big string and a list of smaller strings, find the minimum amount of spaces that must be inserted between characters of the string in such way that it becomes composed only of elements from the list of smaller strings. (and which are the respective elements used). [Python 3] For instance, if you...
I have implemented a Matrix class that allocates memory using unique_ptr. How to make it more diverse and optimized in terms of memory usage and efficiency? // // Created by Mayukh Sarkar on 26/12/19. // #ifndef DP2_MATRIX_H #define DP2_MATRIX_H #include <cstdio> #include <memory> #include <algorithm> template <typ...
What would be the shortest way to capture folder structure in code? I would like to have a more or less reusable strictly typed approach to use in scripts instead of stringly typed paths we all usually deal with. Here is how a part of my simple “system info” utility looks like: static void Main(string[] args) { for...
Whats the best practice for calling a function with a complex set of arguments? I've seen a 1 and 2 in most codebases, but I haven't seen 3. Since it's almost impossible to search for **{ in codebases, does anyone know why this pattern isn't used more often? I'm using Google's Sheet's API v4 as a demonstration, which...
I implemented a sha256 hash function for javascript just for a practice and I want to know if my code needs more improvement. Please tell me which to simplify if there's any. Thanks. Here is my code: var sha256TOOLS = {}; //sha256 constant sha256TOOLS.k = [0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x5...
I have created like this validator for reactive form, all working but I think I used so many statements, can somebody help me to make proper validation Here is my validator export function validateIfOneIsRequired(): ValidatorFn { return function validateIfOneIsRequired(formGroup: FormGroup) { const startTime = fo...
I am trying to make a function for floating point numbers comparison. The goal is to "evaluate" all operators in single function: >, >=, =, <=, <. If X>Y, then F>0. If X==Y, F==0. If X<=Y, F<=0 etc (where F is returned value). I took a piece of code from numeric limits. First thing I changed, in scaling of epsilon, fa...
The problem is: Given an undirected graph represented as an adjacency matrix and an integer k, write a function to determine whether each vertex in the graph can be coloured such that no two adjacent vertices share the same colour using at most k colours. Source: https://www.dailycodingproblem.com/ The propo...
I'm learning object oriented programming and am still trying to understand the best way to structure a class for modularity and attempting to follow DRY principles. I currently created a class containing multiple requests that share the same self.reponse block repeatedly. I am not sure the best way to abstract this out...
I have created a script for article scraping - it finds title, subtitle, href-link, and the time of publication. Once retrieved, information is converted to a pandas dataframe, and the link for the next page is returned as well (so that it parses page after page). Everything works as expected, though I feel there shou...
I been writing code for my company for years and there is never any constructive criticism for what I do. I am the only developer here and I would appreciate your opinion on this web page I made. It grabs data from a mssql database and places it in a data table adds some calculations then displays the data in a gridvi...
I've decided on splitting my environments keeping them in .js files in an environment folder and keep all the sensitive information in .env file (use a third-party module 'DOTENV'). That's what I've come up with but I understand that it's not the best practice and there are a lot of things which should have been implem...
I don't have much experience with testing but I'm trying to make it part of my routine to develop better software. The class below is a service class in Laravel. It needs to save a record on the database, saving the customer's customer_id, a route (location_id_from and location_id_to) and which location to bill (locati...
I have a transformer helper function. It reduces over the array and transform key/value pairs. At the end of the loop there is the key 'EXAMPLE1' exists and I should insert two objects after the first and the second array(result) items. Right now, it works as expected, but I have concerns - is it a good approach for us...
After using an online tool to convert a PDF glossary of English-French cognates to a .txt file, I wanted to write a simple script to extract the cognate pairs and save them to a CSV. I could then import them to my flashcard software (Anki). The .txt file ended up being rather messy, and, as a novice programmer who's ne...
I have a redis caching server. If that caching server is down, my app will query the database directly. I want to know from the logs if my caching server is not reachable. However, if I add a log error, it would completely spam my logfiles if a high amount of users would try to access data. As a result, I would like to...
I've started to fill my GitHub profile with small applications to educate and showcase my skills. However, I feel like I'm missing something essential, while creating these projects. Could you take a look at this component, and advice me on how to refactor it? Its purpose is to get Coin Data from an API, and display t...
Code Review : Could promises be 'chained'? I am developing a simple Quote tool for the business-owner to fill in a form (item number, item name, price, etc) and send to the potential customer. This code review request is in reference to the "view-quote" page, which simply displays a quote that was previously sent. (see...
I've become a bit rusty in Java. This is an attempt at brushing up my skills. In computer science, merge sort is an efficient, general-purpose, comparison-based sorting algorithm. Questions How can I improve my test cases? (TestNG) I've used Java-11 here, can I use better idioms? Can this implementation improved f...
I've written some code in Excel VBA that does the following: Finds a cell ("O") in a range (C3 to Z26) Looks at an adjacent cell. This cell is located through "OFFSET_ROW" and "OFFSET_COLUMN" (defined in a separate public variable) and contains a text string that is split into an array (using the "\" character as a de...
I decided to redo a program that I did awhile ago that encodes text as an image. For example, here's the entirety of clojure/core.clj, Clojure's standard library: encode_text(clojure_core_text, int(5e4)) And here's the source for the program itself (with a lower multiplier to make it more blue): It's interesting tha...
For the Below code want to know whether the correct procedure is followed for the java code , are there any missing points according to the java standards ? import java.io.IOException; import java.util.LinkedList; import java.util.List; public class CodeReviewTest { volatile Integer totalAge = 0; ...
I have created a Python 3 password manager for API keys and social media passwords on local storage. The script is 500 lines and PEP8/PYLINT compliant, each definition contains a docstring and the code is well commented. It is purposefully in "procedural" instead of "object" style. The cryptography definitions all beg...
Hangman game coded in Java (at a beginner's level) where Hangman.java can be run with one or more arguments. Hangman.java: package hangman; import hangman.Game; import hangman.Prompter; public class Hangman { public static String normalizeArgs(String[] array) { String result = ""; switch (array.le...
I am working on moving a save system from loose files to a (spatial sqlite) database. The user places objects from a library in a 3d simulation. Scenarios are "what-ifs", what if we place 5 wind turbines over here, what if we placed 10 racks of solar panels instead etc. They are mutually exclusive within a "group". Ite...
I am trying to find a way to convert printable data types into a string in the fastest way possible. I originally read that a static variable of stringstream that does all of the formatting is one of the fastest ways, since constantly constructing temporary variables of stringstream is slow. The problem with using stri...
I wrote code that takes the value of the progress bar in my Android app which influences what is displayed on the UI. If the user's progress bar value is above or below a certain number, data will be either displayed or not displayed. Here is the following code: public class DetailsFirstTabFragment extends Fragment...
i'm using an external API that posts products and orders into a marketplace, and it provides a class that in each request i have to specify an endpoint, user and password (token), it's something like this: if($env == 'testing') { $endpoint = 'testing'; $user = 'testing'; $pass = 'testing'; } else { $end...
I have a folder containing thousands of files and directories. I would like to move all the files that are not contained in a sub directory into a directory and name it the file name, while leaving the files already inside of directories alone, ie: create 'newdir' ; move 123.mp4 ; into 'newdir' ; change name '...
I’ve just created Minesweeper game, which work perfectly fine (for me). Any suggestions on how to improve this code would be greatly appreciate, in terms of: Object-oriented Array Error handling Function More efficient approach Others: Style(PEP8), comments, clean code, recursion, etc Explanation of game: Minesweepe...
I wrote a utility class that has simple methods for: En/decrypting data with 256-bit AES-GCM using a password Generating RSA keypair Saving RSA keypair and storing private key encrypted En/decrypting data with RSA (data with AES-GCM & random key, key with RSA) import javax.crypto.*; import javax.crypto.spec.GCMParamet...
Could you review my usart driver wrapper please? It contains the C language Xilinx usart driver, but I write C++ programs and need to C++ usart driver. How it was designed correctly and what I have to chage or add in the one on your view? I will be thankful for your the strictest appraisal. Thank you. //**************...
I have tried going back to C++ after long time of mainly doing C#. I realize that the code is far from perfect, however I would really appreciate if someone could point of what exactly is wrong and how to fix it, so I can learn how things should be done. (just for code design, not asking to fix any logic errors) What i...
I've wrote a Sudoku-Solver in Java, which also contains a GUI, so you can just enter the Sudoku, press "OK" and it will solve the Sudoku using backtracking. Here's the code: import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import static javax.swing.Windo...
Hello there and beforehand a huge thank you to everybody for dedicating their time to help others. This is my first post here, so I hope I comply to the guidelines. Maybe a bit background to myself: I do not have a formal education in computer science except for some basic introductory level courses at university. I ha...
I just started working on a little project to help me study for a course I'm taking. Is there anything I can do to improve code readability / bad practices? I had to remove most of the labels and buttons (due to stack-overflow posting rules) but I kept one of everything just so you can sus out how I programmed those f...
I posted this answer recently. OP in the StackOverflow question mentioned that it was for educational use, but I can imagine it being used as a debugging aid. Then I decided to improve it slightly and make it a compile-time function. Code: #include <cassert> #include <iostream> #include <string_view> #include <type_tra...
This is the problem: You are given queries. Each query is of the form two integers described below: 1 x: Insert x in your data structure. 2 y: Delete one occurrence of y from your data structure, if present. 3 z: Check if any integer is present whose frequency is exactly z. If yes, print 1 else 0. The queries ar...
I was playing around with Unity's new Entity Component System and I was trying to implement a rotator system. This is what I came up with: Component Data: using Unity.Burst; using Unity.Collections; using Unity.Entities; using Unity.Jobs; using Unity.Mathematics; using Unity.Transforms; [GenerateAuthoringComponent] pu...