instruction stringlengths 71 95.1k |
|---|
I'm solving 387. First Unique Character in a String LeetCode problem defined as:
Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1.
Examples:
s = "leetcode"
return 0.
s = "loveleetcode",
return 2.
Note: You may assume the string contain only lowercase ... |
This is my 3rd JavaScript canvas game. It's basically just snake right now but I am planning on adding some more aspects to it soon. I was wondering if I could get some feedback especially on how I'm checking if the snake crosses itself in the game function.
class Block {
constructor(x, y, w, h, col) {
this.x =... |
I'm looking for some feedback on my code here. I want to eliminate duplicating the code through the different button_clicks. I'm thinking with a method but nothing I try works better than what I have.
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.W... |
Follow-up to this question: after reading the comments, I decided to redesign my linked list to have a cursor that only contains one node and implement the interface similar to the one of forward_list in STL. The interface is fairly clear in my opinion but I also added extra comments where I found appropriate. There ar... |
I began trying to learn python3 as my first programming language two days ago for a hobby and interest to teach my kids later on. I've been working on a program guessing a random number. I started with just guessing the number and built on to add two players then added a computer opponent to it as well. I would like fo... |
I am trying to find the most significant bit of unsigned number without using any bitshifts. This is what I have come up with, which looks very naive but it's very simple:
template<typename T>
constexpr uint8_t find_msb(const T& a_variable)
{
static_assert(std::is_unsigned<T>::value, "Variable must be unsigned");
... |
I'm doing a hacker rank challenge with this one called "Repeated String". I attempted this challenge in my weaker language java. The goal is to print out the occurrences of the letter a. First you're given a string "aba" then a number 10. The new string generated would be abaabaabaa and you need to count the a. The sol... |
This code was recommended to me by my dear friend Jon after I wrote an implementation using arrays. With his help, I managed to create a Singly linked List similar to std::vector using Nodes.
#include <iostream>
template <class T>
class LinkedList
{
private:
size_t _size;
public:
class Node
{
public:... |
This code checks if a mail message contains a single page PDF attachment. If yes, it adds it to a processed list else rejected list.
If mail can be processed, then it saves the attachment into a file.
I feel this method is doing more than what it needs to do.
public class Client
{
#region Private variables
priv... |
I need to find shortest path between two points in a grid given an obstacles..
Given a 2 dimensional matrix where some of the elements are filled
with 1 and rest of the elements are filled. Here X means you cannot
traverse to that particular points. From a cell you can either
traverse to left, right, up or down.... |
I've made a python program that can brute-force both MD5 and SHA1 hashes, and I would like know if I could make the program faster or any way I could improve it.
I'm still a beginner in python and in coding in general
(this program is only for learning purposes).
The code:
import time
import string
import hashlib
ready... |
I just wrote this, but I am not realy happy with that. I think there is an easier way to do this. First I am checking if a user has an ID (from a portal we are using, it is in the header). After that I have to check if the user exists in my application, if not a user will be created, if the user exists, the datetime la... |
I am not 100% sure that I am using the random.seed correctly for this assignment, or if there is a more efficient way to write the code. Any feedback is appreciated.
Assignment Description:
Simulate rolling 2 die one hundred times. Keep track of the total of the two die. Print a histogram in which the total number of ... |
First, I've read the a few questions regarding this issue, the most helpful being:
https://stackoverflow.com/questions/27463876/passing-bitmap-from-c-sharp-to-c
I was unable to get the provided solutions to work as I kept getting an AccessViolationException.
What I'm attempting to do is pass bitmap data to an unmanage... |
In a bash script, I need to parse arguments that have the following form:
The main arguments can be thought of as being a single argument, but I do not want to force users to quote the entire thing, so when the argument contains spaces I must be able to handle multiple arguments.
One flag may be passed as -<flag> wher... |
I have a script that takes manager names in Sheets("Mgrs") and extracts the employees that fall under each manager in Sheets("Retail Sharepoint File-Merge"). Once it finds the managers employees, it prints the array to a new worksheet and formats it and saves it based on the values I lay out.
Option Explicit
Sub Retai... |
I have a case where I match data from DB by the various filters. Until the match is updated in the DB, I don't want to accept requests for matching with the same criteria, as this could produce duplicate matches. Therefore I "lock", but selectively using AsyncLock from AsyncEx library.
I've checked the correctness of ... |
Background
My project is a Python toolbox. This is my first bigger coding project and it took me quite some time to code this toolbox. I learned a lot from the start point to this day. I changed this code hundreds of times, whenever I learned about new trick or method. This code works. I tested it with various datasets... |
I'm trying to use inheritance in UIViewController where base class has XIB in storyboard. I'm troubling with initiating different children classes with that XIB.
I cannot use XIB file separately instead of storyboard because it has static UITableViewCells.
So here is how I'm managing it currently using object_setClass ... |
Looking for the best way to speed up or maybe move from FFMpegConverter to another application for converting video to GIF, because it takes much time, will be much appreciate for code review and suggestions to improve converting performance.
public static byte[] ConvertToGif(string url, string watermarkImagePath, s... |
So I made this code:
private List<eventAndColor> GetEventosToPopulateCalendar()
{
// A List with only the days that have events
List<Eventos> CalEvents = eventDao.Select(FromEventos.DistinctDate);
// A List of a struct with Date + color of event
List<eventAndColor> events = new Lis... |
A bit of context: I've had a fair share of programming in Java but want to refine my C++ skills with a college task. I've wanted to focus on C++11 and C++14, as they are recent but not latest, and C++14 is the default revision of my compiler.
I want to share a header (hpp) file and a test implementation one (cpp), and ... |
Implement a method to perform basic string compression using the counts
of repeated characters.
For example, the string "aabcccccaaa" would become "a2b1c5a3". If the
"compressed" string would not become smaller than the original string, your method should return
the original string. You can assume the string has only ... |
I have created this program about using a singly linked list class that implements several functions: Add, Display and Sort.
Could you suggest me how to make my code better and which functions to include in the future?
#include <iostream>
using namespace std;
// ----------------------------------------------------
clas... |
For an uni assignment I have been giving the task of making my own rotating algorithm in python. This is my code so far.
import cv2
import math
import numpy as np
class rotator:
angle = 20.0
x = 330
y = 330
radians = float(angle*(math.pi/180))
img = cv2.imread('FNAF.png',0)
width,height = img... |
I'm not sure if this is the best way to write this code..
object.array.forEach((item) => {
object.otherarray.array.forEach((asset) => {
if(item.fields.image.sys.id === asset.sys.id) {
item.fields.image['fields'] = asset.fields;
}
})
});
any help would be appreciated!
|
I have written the following code for one of my requirements. Kindly help me if I can write this logic in a better.
public class PersonService {
public PersonCategorized getCategorizedPerson(List<Person> allPersonFromDb) {
List<Person> adultList = allPersonFromDb.stream().filter(PersonUtil::isAdult).collect... |
I have menu that contains links to sections of website:
Products | Orders | Users
__________________________
Add | Add | Add
Update | Update | Update
Delete | Delete | Delete
Depending on what role user is in, they can see limited number of options, e.g. "User" can only see:
Products | Orders
____________... |
I'm writing a ReST API Client Tester using VueJS.
I'm trying to have a really clean code, But I feel like it's too much,
Here is my store.js file, which I use it for Vuex and the application state management, all there variables I use to send a request are store here
import Vue from 'vue';
import Vuex from 'vuex';
Vue... |
Here is a type trait which - I feel - could fit in std next to std::add_const and std::remove_const:
#include <type_traits>
template <typename T>
struct set_constness_of {
template <typename U>
struct by {
using type = typename std::conditional<
std::is_const<U>::value,
typenam... |
I am beginning to learn Python on my own through edX and I was given this basic problem: "Given a list of cities, separate the list into two lists, namely one with cities containing the letter 'a' in their name and one with cities not containing the letter 'a'."
This is my approach. It works, but I can't help but feel ... |
I have a function in a project that I feel could be written better. The purpose of the function is to return the direction of an arrow based on two parameters.
positiveDirection: The direction for a positive result. The values could be increasing or decreasing.
changeType: Whether the result was positive, negative or ... |
This is my solution to LeetCode – Valid Sudoku in Swift.
class Solution {
func isValidSudoku(_ board: [[Character]]) -> Bool {
let count = board.count
var set = Set<Character>()
for i in 0..<count{
// firstly
set = Set(board[i])
var num = board[i].re... |
I have this following code which find every possible pair of numbers that sum up to n number
lst = [int(input()) for i in range(int(input()))]
num = int(input()) #Amount to be matched
cnt = 0
lst = list(filter(lambda i: i <= num, lst)) #Remove number that more than `num`
for i in lst:
for j in lst:
if i+j =... |
This is my solution to LeetCode – Minimum Area Rectangle in Swift
939. Minimum Area Rectangle
Given a set of points in the xy-plane, determine the minimum area of a rectangle formed from these points, with sides parallel to the x and y axes.
If there isn't any rectangle, return 0.
Example 1:
Input: [[1,1],[1,3],[3,1... |
This question has a second part here:
Comparing columns from two CSV files - follow-up
I'm currently trying to compare two CSV files column by column but only when their indexes match.
Here is what I've done:
import sys
def get_column(columns, name):
count = 0
columns = columns.split(';')
for column in col... |
I have a windows form in C# project that keeps some information. I created a bunch of textbox and combobox dynamically, depend upon user input.
Consider, I have a list of 10 combobox whose values will be selected by user.
The combobox values are:
Finding
No Finding
Incomplete
Skipped.
Now I have a single final combob... |
Based on my answer I have my implementation of linq Zip operator which operates on different length lists, and loops shortest list.
My implementation:
using System;
using System.Collections.Generic;
using System.Linq;
namespace SO
{
internal class Program
{
public static void Main(string[] args)
... |
What does it do ?
Looks in big XML files (1-3 GB) for given parameters that I need in my project, appends them to lists and finally exports both of them to the CSV files.
My XML scheme
I need to get child named 'v', which is value of specific child 'k' nested in tag named 'tag' which is nested within parent 'way'.
Wh... |
I wanted to try C# network programming and wrote this simple client/server application. The idea is - many clients can connect to server and request some data. As an example they request a set of points on sine-wave (required number of points and time span is up to each user).
The server then calculates required poi... |
I want to call a series of functions to build up an array, like so:
$array['conditions'][] = $this->function1($input1);
$array['conditions'][] = $this->function2($input2);
$array['conditions'][] = $this->function3($input3);
However, each function may return either an array with values or an empty array (depending on i... |
For an interview, I was tasked with writing a program that consumes a list of strings, and produces a mapping between every character in the list, and the characters found most frequently with it (let's call them Companion Characters).
For example, if it was given ["aabc", "bcdddd", "cde"], it would return {a=[b, c], ... |
Giving a review to Oachkatzl and recently about some other synchronization problems (Lazy with invalidate and some node-locking list), I wanted to test my skills and redesign it in most light-weight way I can muster.
I am especially concerned about thread-safety here, because there is NO LOCK statement, only Interlocke... |
I wrote a Perl 6 grammar to parse a C++ function. My final goal would be to parse an entire header. The aim is not to correct C++ syntax errors, but to parse valid C++.
Do you have some advice or improvements?
#!/usr/bin/env perl6
grammar FUNCTION {
token TOP { [ <attr> \s+ ]? <type> [ \s* <type_mod> ]?
... |
I am really new to Python and programming in general and I am trying to improve doing some projects like this one. I would like to know how I can improve this the right way.
"""A simple calculator """
def additions():
print("ADDITION:")
num1 = input("Give me your first number: ")
num2 = input("Give me a ... |
I recently started delving into Vue.js, and decided to try my hand at some custom class/style bindings, so I made a small app that's supposed to cycle through each "light" of a stoplight (red, yellow, green, red, etc.).
My Vue instance has a data property count, which is initially set to 0, and I also have a setInterva... |
I am quite new to C++ and would like some feedback on my implementation of a dictionary data structure. The code is below.
#ifndef DICTIONARY_H_INCLUDED
#define DICTIONARY_H_INCLUDED
#include <initializer_list>
#include <algorithm>
#include <vector>
template <typename T, typename U>
class Dictionary{
private:
... |
I have a class that makes API requests for a mobile app. The code can be making multiple API requests at the same time. But, if the request is unauthorized, I want to refresh the access token. While the refresh is occurring, I do not want another process to try to refresh the token.
I think there should be a better way... |
I have just begun learning Julia. Here is an implementation of experience replay memory for use in a reinforcement learning algorithm. It is pretty simple, essentially a ring buffer with the following requirements:
Used to store 1D arrays of numbers, typically Float32 or Float64. All the stored arrays are the same siz... |
I'm trying to tackle a programming challenge to determine how many palindromes exist in a given string that is being rotated character by character. My solution works, but it's too slow, and I'm struggling on where to optimize it.
For example, the string "cacbbba" would rotate 6 times, and would have 3 palindromes in e... |
A friend of mines needed some help. He wanted to build up two linked list and then compared them to see if they had the same data values. Finally a 3rd link list would contain the nodes with duplicated data. The linked list holds int data btw. I redid his code and I was aiming to be as simple and clean as possible but ... |
This function is part of a python board game program. The game is a board game with chests and bandits hidden throughout the board. The function is dedicated to the "easy" section of the game (where it is a 8x8 grid).
def easy_level(Coins):
#This function is for the movement of the game in easy difficulty
while Tr... |
Tired of thinking up random names when following tutorials involving people? So was I.
The code below is the first project I've written in Python. Put simply, it grabs a list of forenames and last-names from an online database, saves them into a dictionary, then writes it to a JSON file. After that, the rest of the cod... |
I have server-client communication architecture where there is one server and 150 clients.
The server-client communication happens via Java NIO where all the clients send some or the other data every 10 seconds.
Previously we used to queue all the process messages and process all those in a single thread, as the number... |
this is the original question
https://www.geeksforgeeks.org/find-the-smallest-positive-number-missing-from-an-unsorted-array/
You are given an unsorted array with both positive and negative elements. You have to find the smallest positive number missing from the array in O(n) time using constant extra space. You can mo... |
A Helper class for Fragment Management.
The FragmentsManager class has methods to add and replace fragments.
The replace method checks if the given fragment is present in backstack or not and if the fragment is present it brings back the old fragment.
Need review for the following:
Code optimized.
Memory Efficiency
Ov... |
This is the second part of a question, you can find the first part here:
Comparing columns from two CSV files
I've made some changes to the script and here is what it looks like now:
import csv, sys
def get_column(columns, name):
count = 0
for column in columns:
if column != name:
count += ... |
I am trying to build a REST API with express router, which contains of nested sub routes. I have mounted these sub routes in my index.js file.
I have defined it as follows:
// Mounted routes
app.use('/api/v1/Project', new ProjectRouter().routes);
app.use('/api/v1/Project/:projectId/Context', new ContextRouter().routes)... |
Need to perform such actions:
receive JSON from REST
extract nexted JSON document
calculate hash of the nested document
add some fields to extracted document and save it in database
return response CONTAINING some fields of the source DOCUMENT
I wrote this service:
@Service
public class InvoiceService {
private ... |
I implemented a simple queuing system for my Node.JS app and wanted a critique on it's structure.
const TPS = 20;
const Queue = {
counter: 1,
items: {},
/**
* Add an item to the queue, with the given func to call
* @param {Function} func
* @param {Boolean} repeating
* @return {Number}
... |
Here is a C++ implementation of a bounding volume hierarchy, aimed for fast collision detection (view frustum, rays, other bounding volumes). It is based on the ideas from the book "Real-Time Rendering, Third Edition". Would like to hear some thoughts:
#ifndef BOUNDINGVOLUMEHIERARCHY_H
#define BOUNDINGVOLUMEHIERARCHY_H... |
I want to find all shortest paths between a pair of vertices in a unweighted graph i.e all paths that have the same length as the shortest. The edges of the graph are stored in a SQL database. The graph has about 460,000,000 edges and 5,600,000 nodes. My approach is to use a bidirectional BFS to find all the shortest p... |
I'm trying to get better at javascript and have built a simple function that returns 1 if the mode is equal to the mean, and 0 if not. You can enter an array of numbers into the function:
// tests
meanMode([1,2,3]); - returns 0
meanMode([4,4,4,6,2]); - returns 1
meanMode([4,4,4,6,6,6,2]); - returns 0
To clarify, the m... |
I'm new to Python and I came to the following excercise:
Write a function named printTable() that takes a list of lists of
strings and displays it in a well-organized table with each column
right-justified. Assume that all the inner lists will contain the same
number of strings. For example, the value could look... |
I wrote the Python class below, which does what I want it to do, but the data structure is a mess. Was wondering if there was a better structure I could use to get the same results but with better readable code.
Idea here is we retrieve a dataset from SQL(constructor), cluster the dataset into distinct keys(constructor... |
I've been using this wgs84togrid program for a few years. It converts in both directions between National Grid coordinates for GB or Ireland (beginning with a letter or letter-pair identifying the 100km square) and latitude/longitude positions (in decimal degrees, decimal minutes or decimal seconds) on a WGS84 ellipso... |
Python allows logging to be used in several ways. Can you review the relative merits of these two approaches to Logging when Unit Testing with Python? Is one approach appropriate to specific circumstances? What are those circumstances and how might each approach be improved?
Directly addressing the logger.
#!/usr/bi... |
Not satisfied with the Brute Force Solver that I wrote for All possible combinations of 1 to 9 in the same cells without repetition, I created an OOP Cross Sum Solver.
As expected my OOP Solver crushes the Brute Force Solver performace, 0.03-0.12 seconds compared to 109 - 400 seconds respectively.
I probably should p... |
I am currently coding a PHP script that connects to a database and inserts a phone number and IP address if either item is not present in the table. I believe I have completed it and it is working but I want to make sure that I have used best practices in regards to security. I have read here about how to connect to My... |
This code seems to work correctly. I would appreciate any comments on how to improve the code, e.g. readability, algorithms, const-correctness, memory, anything else I am forgetting?
Also, for the function swap_values, would it make more sense to swap two nodes instead of just values of the nodes and why?
SinglyLinkedL... |
While translating an old Basic game to C, I found myself needing a function to get one character from the keyboard. You can't do this with common standard C library functions like getchar() because the standard input stream is line-buffered (i.e. it will store whole line of input, including the terminating \n, in its ... |
I'm using the time for e.g. ping and timeout calculation as well as animations in a game. So my (big) codebase uses std::chrono::steady_clock::now() in many places. For testing I'd like to test those without having to resort to sleep and friends (timeout of >=5mins will be hard to test this way...)
For this I created a... |
This piece of code is aimed to cancel any ongoing search requests sent from the web application if next request is started, e.g. after user updates the search term.
I tested it in the final application and everything looks fine. It has already been deployed to the remote environment in our organization.
It appears to ... |
Question
Recently I have tried to create a web scraping program to get data from Google Trends. It uses an RSS feed to do so. My question is as follows:
How can I improve my code such that it is more concise, efficient, and pleasing to a programmers eye? I would like to emphasise that I'm most concerned about if I've m... |
I have two issues/questions with figuring out a proper way to write this code for a player leveling system.
My First question/issue is that when this code is run it works as intended with a slight problem. public void levelUp() is being used to, "set", the level if you will (I am sure this is a sloppy way of doing this... |
I want to implement following trigger function in Python:
Input:
time vector t [n dimensional numpy vector]
data vector y [n dimensional numpy vector] (values correspond to t vector)
threshold tr [float]
Threshold type vector tr_type [m dimensional list of int values]
Output:
Threshold time vector tr_time [m dimensi... |
I have an asp.net web application and I want to export to a PDF tables in a particular way.
Tables will have data of type Test. tests have a type(by type i mean an int to tell them apart) and for every type i'm creating a TestTable and for every Test a column in each TestTable , there are 9 types. That's why there are ... |
I use a single dockerfile to build and run the following images:
Production application image:
docker build -t myapplication.program -f src/MyApplication.Program/dockerfile --target runner --build-arg version=1.0.19031.1 .
docker run --rm -it -e ASPNETCORE_ENVIRONMENT=local -p 5050:5050 myapplication.program:latest
... |
One of my biggest complaints about .NET is that there's no way to guarantee a string match a certain type in the type-system.
Note
This started as more of a proof-of-concept than a real usable system, but I'm curious about feasibility in real-world work now, because it does seem moderately usable.
That is, say I want... |
A ring buffer or circular buffer is a fixed sized queue that advances head and tail pointers in a modulo manner rather than moving the data. Ring buffers are often used in embedded computer design.
This implementation of a c++14 compatible Ring Buffer that was inspired by a Pete Goodliffe's ACCU article and the Chris ... |
I am trying to guess the paswords from the etc/shadow file(it has 43 user/passwords). And I have been given some hits about the passwords:
Length is between 4 and 8 characters
There can be only 2 numbers and only at the end
Capital letters only in the beginning
So I started just with a small group composed by 4 chara... |
I am creating an estimation tool, where users can input part numbers and quantities, and the tool will output the lowest cost for that part number based on searches through multiple databases.
I accomplish this by loading data into multiple sheets and then evaluate all possibilities on one sheet.
I believe my code is... |
My goal is to apply a function func1 to each row of the matrix input and then return a new one resulting from the transformation.
The code works but when the data frame contains more than 1 million rows, it become extremely slow. How can I optimize my code? I start learning programming and I am not familiar with strate... |
I had a lot of fun writing these. I haven't seen a version minimizing turns, so that was a neat challenge. Any suggestions are very welcome.
Is there anything to gain by making more method variables like those in the search() method; visited or open_pos into instance variables?
I would like to have something returned ... |
I wrote the following code to use Entity Framework 6 and Managed Oracle Providers to call an Oracle stored procedure that returns multiple cursors.
Would like some input about the code I used to open and close the database connection. Please note that the open and close code is a workaround for a possible bug in the O... |
I have done a small code in which with a wordlist (out68.lst) I get the passwords from the hashes in the file 'shadow3'.
import crypt
import string
import itertools
import datetime
dir = "shadow3" #File that contains hashes and users
file = open(dir, 'r').readlines()
username = []
hashed = []... |
Specifically, how can I improve the time complexity of my algorithm (currently it is O(listLength * numberOfLists))? It only beats 5% of accepted LeetCode solutions, which surprised me.
/**
* Definition for singly-linked list.
* public class ListNode {
* int val;
* ListNode next;
* ListNode(int x) { va... |
I'm trying to follow the Raytracing in One Weekend book, and I found that he uses the same Vec3 class for everything - colors, coordinates, direction, and more:
struct Vec3 { float x, y, z };
He also overloads every possible operator of the Vec3 class to make it convenient to use, and adds plenty of member functions (... |
I really like to use PDO because it's simple and easy to make a safe query, i prepared all queries and used placeholders, i think it's safe but i'm not sure at all, and I'm thinking if i used trim() the right way. What you guys think? Any doubt please ask me on the comments section.
login.php
<?php
if($_SERVER['REQUES... |
Acquiring a form’s data for asynchronous POST requests has been a long-standing problem. There is the FormData API, but there are still some obstacles when the form’s data is encoded as x-www-form-urlencoded (the default).
My current use case deals with arbitrary forms which might encode data either way; hence, I tried... |
I need to evaluate some data. The rules how it should be done are changing frequently (it's an evolving model) so I don't want to rewrite my application each time such a change comes. I'd rather do it quickly via a config file.
In order to make this possible I've designed a system of components that are very similar to... |
I have implemented Pollard's Rho algorithm in Java. Due to the nature of it there is a small chance for it to fail (have not seen it happening yet).
Since I do not want to see my unit tests failing due to this "too often", I set a retry, with which I am not totally satisfied, as you can see here:
@Test
void primeFactor... |
This is a game for two users who roll 2 dice 5 times. If the total of dice is even the player gains 10 points if it is odd, they lose 5.
If there it is a draw after five rounds then the both users will have to roll one die to determine the winner.
from random import randint
from time import sleep
import time
import sys... |
I've written a code that I try to use divide and conquer approach to determine if the given array is sorted. I wonder whether I apply the approach accurately.
public static boolean isSorted(List<Integer> arr, int start, int end) {
if (end - start == 1) // base case to compare two elements
return arr.get(end... |
As a beginner I try to implement a vokable memory game. It is still missing some feature (Loading, Display), but I would like to hear how to improve what is already there.
The user should identify matching pairs. Theses are then removed from the game. The game ends when there are not any pairs left.
I think there has t... |
This code gets the most frequent number and least duplicate number in an array. How can I optimize it and improve its performance?
public class X {
public static String findMin(String[] numbers, int counter) {
int count = 0;
String elements = "";
for (String tempElement: numbers) {
int tempCount = 0;
for (int n =... |
import java.util.*;
public class PrimeNumber {
private static ArrayList<Integer> listOfPrime = new ArrayList<Integer>();
public static void main(String args[]) {
Scanner userInput = new Scanner(System.in);
System.out.print("Please enter a number to checked the list of prime number > ");
... |
I have successfully created a plot of a binomial glm using example data. https://sciences.ucf.edu/biology/d4lab/wp-content/uploads/sites/125/2018/11/parasites.txt
The predictors of the model include 3 predictors (one categorical, 2 continuous)
The code works fine but I have been wanting to try and incorporating more dp... |
I have a program to calculate grades that uses pointers and I am trying to figure out if I did it right and if there are any problems with my implementation.
I'm trying to get a more firm grasp on pointers in C++ and have been using them more frequently in my practice programs. I was looking at my grades and thought to... |
This is rather toy example of immutable datatype in C++. I've tried to follow functional languages like Scheme, Racket - making list as a cons cell: list is list or is empty.
/*
* Abstract class
*/
template <class T>
class ImmutableList {
public:
~ImmutableList() {std::cout << "base class destructor";}
virtual bool... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.