instruction
stringlengths
71
71.9k
I have an application that allows a user to create a poll that includes questions and answer choices as part of the poll. The hierarchy is a poll has one or more questions, a question has one or more answers, and each answer has a vote. The following code is my implementation that allows the updating of an existing pol...
So, I've created my first Chrome extension! What this does is it highlights every post on Reddit that comes from a source of dubious quality. It provides a few sources by default and allows the user to add or remove from this list. The user also has the choice between either highlighting the offending post or hiding it...
I want to print a nice loading message with these three fading dots, while the main thread does some heavy IO stuff. This is why I implemented this: #include <stdio.h> #include <pthread.h> #include <unistd.h> #include <stdbool.h> static bool loadingStop; static pthread_mutex_t loadingMutex; void *loadingDo...
I have a simple program that calculates and outputs the results of all the bit operators. I'm planning to send it to my friend and to explain some stuff about them to him. Before I do that, I want to know if I can make any improvements to my program. internal class Program { private static int a; private static...
I use .NET 3.5 framework, so no tuples. I have many use cases where I have to create a custom key for a dictionary. How can I make this better? public class CompositeKey<T> { public T Content { get; set; } public Func<T, object>[] Lambdas { get; set; } public CompositeKey(T obj, params Func<T, object>[] pr...
The code below is an implementation of the Best First Search algorithm for navigation of the shortest path across a 2D NxN matrix. As a heuristic for the search I use the standard distance formula. The matrix is generated from a text file passed in as a command line argument,where the first line is the size N of and ea...
I'm developing an app which stores some different user settings in app.config such as connection strings, paths for saving reports, default printer e.t.c For retrieving them I made a static class StoredSettingsTools which contains an Enum of settings types and a public method which calls (depending of setting type) som...
Apparently everyone gets burned by their Python unittests not running in the order they want. I am not in the business of telling people not to do perfectly reasonable things they want to do, so I consider "write your tests differently" Not An Answer to the question "how do I control the order of my TestCase subclasses...
I need to parse a simple JSON string (flat JSON, no hierarchy) for keys and values, and there is a system constraint that I cannot use any built-in JSON library and can only read a string once due to latency requirements. I need to use Python 2.7.x series and cannot use a higher version. Note: This question is version ...
I recently submitted an implementation of a singly linked list and tried to apply some of the suggestions on this implementation. I decided not to implement the List interface as I only wanted to practice what I believed to be the most important methods. I'm wondering how I could tidy this up some more and improve upon...
This is my first program I've written ever. Don't hold back on me. Any help and feedback is appreciated. This code wont work because it requires some keys, but I censored them out, but it does compile for me and works fine. I just want some feedback on dumb things I did and how to make it better if anyone has the t...
The following code creates a cookie on the client browser such that 25% of the browsers will have a value 0, and 75% a value of 1. Can anyone review the following code and point out any problems in it? // AB testing code starts; $abTestValues = array(1,1,0,1); $abTestValue = 0; $abTestCurrentValue = $abTestValues[$abTe...
I have a cumulative transition matrix with probabilities for all the possible states from 1 to 5. Now the algorithm for simulating future states is following: the initial state is selected randomly, and a random value between 0 and 1 is then produced by uniform random number generator.To determine the next state in the...
I've made a method to extract Excel data out of an existing Excel file. It contains 3 tabs where info should be extracted from. The data should be stored to use local so it's always fast available. It is currently working but it seems like I have a lot duplicate code that could most likely be written a lot shorter. I'm...
I have created a simple terminal program: it allows the user to enter a height and it will produce triangles of asterisks (*'s) based on the height. I have just started learning C# as practice for my internship. I would appreciate any feedback. using System; public class Triangle { public int height; private s...
flatten.py from collections import Iterable, Mapping from operator import methodcaller from stack import Stack class flatten(object): """ Iterator that walk through nested iterable. If the initial item is not iterable, only itself will be yielded. Args: item (Object): Any object. ...
This function try to scan the given function in n dimensions in the given range by adaptively divide the area into n+1 points polygon (e.g. triangle in 2D; tetrahedron in 3D) I tried to seperate the implementation of splitting/initializing, as it would be easier to apply it on other cases (e.g. square lattice scan, dis...
I decided to try and complete the Parsing/RPN calculator algorithm from Rosetta Code in Rust. I'm still learning Rust and would appreciate feedback on my code. use std::str::FromStr; fn rpn(expression: &str) -> f64 { let mut stack: Vec<f64> = Vec::new(); let tokens: Vec<&str> = expression.split_whitespace().co...
I've recently been tasked with migrating some code stacks for an applicatin that is moving from using Access to using SQL-Server. I don't usually use PIVOT all that much, and most of my code is scripting intended for in-house administration of our SQL Servers. As such my code is not that great. How could I clean up t...
I'm trying to remove the tmp/letter_opener folder. Everything works fine, just wondering if there's a better way to write it. My next step is to write some tests, to double check that I can only accept those inputs (currently failing) #my_rake_task.rake namespace :cleanup do desc 'Deletes the emails inside tmp/letter...
I'm new to MVC and i'm having some difficulty on understanding the proper usage of ViewModels and Controllers. I have this example where i will list several different informations in my HomeController as CTAs, Banners, News, Courses... and i came up with this ViewModel structure after some research : public class Cours...
I'm relatively new to Java, and over the past week or so I've just been reading through the docs and messing around with it to better improve my understanding. As stated in the title, I've created a method to convert numbers (between 0 - 999,999,999) into plain text, and I would love some feedback/constructive criticis...
The following is the top-level procedure for aggregating, analysing and reporting my company's submitted business from 2015 - present. Reviewing the entire project is unfeasible, so I am just seeking opinions on Variable/Method naming and general readability. For reference, CLS_Data_Report is a class I built specifical...
I have been working on a cache that can handle multiple reads at the same time, but the write is blocking. Is this code overkill by using both a ConcurrentHashMap and a ReentrantReadWriteLock? Could I get away with just the lock? Are there any other optimizations I could make? public class QueryCache implements Seria...
This is a follow-on to a global enum for comparison operators. I wanted to pass a logical expression E.G. >= someValue as a parameter to a function, so I made an Enum and an accompanying function to analyse logical expressions. Is my approach a good way to implement this functionality in VBA? Public Enum ComparisonOp...
The following function, as evidenced by its name KeepOrRemoveArrayRowsWhereComparisonIsTrue is probably trying to do too much. How can I better structure/refactor/split it to be cleaner whilst retaining the original intent: "Here's an array, filter it based on the values in this column"? Public Function KeepOrRemoveA...
I would like to make a portable thread pool using boost::thread. Some one could tell me to look at boost::thread_group and boost::asio. I know, but I am not really familiar with these things so I don't know if they are suitable for my purpose. Please give me comments on what I supposed to do here. JobItem and JobQueue:...
I'm in the process of learning SQLite in C# and I've come up with some generic methods for finding and updating data. I would appreciate any pointers with the design of my methods and/or my SQL syntax. FYI: I'm using System.Data and Mono.Data.SqliteClientfor C# Mono 2.0 (Unity3D). Here is an example of the database use...
I left questions in the comments strategically, since I think it's easier to answer questions this way. Basically what my small class does is abstracts away functionality that was originally in a function. This class reads json form a file and creates an object which I can use to traverse the json. I understand that if...
This is the new code after following the advice from here: Setting up a development environment General feedback is requested. Also, should I be using $() or () for my sub-shell. What is the difference. # # # # Divider - configures bash, git, grunt, sublime and chrome # # # user1=foo config_bash() { rm ~/.bash...
I have been searching for a solution to show data of class with three assumptions: Class Employee is not responsible for showing itself Class Employee does not expose its data with getters Classes responsible for showing data are immutable So I created Employee class with its View interface: public final class Employ...
I'm creating a simple Java game engine (just for fun). The idea is to create a basic framework for developing any kind of 2D game, an abstract engine that does the hard work. Would you like to review the core of it and give me some tips? GameTimer class: public class GameTimer { public static final double ONE_SECO...
I am learning to design classes, and in the effort to improve, I have designed an online book reader system with the following requirements in mind: Allow person to create and renew membership person should be able to search database of books person should be able to check out max 1 book should be move pages forward a...
Button crossButton = (Button) findViewById(R.id.crossButton); crossButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if (!x1.getText().toString().equals("")) { if (!x2.getText().toString().equals("")) { if (!x3.getText().toStrin...
We do constant traffic with our Redshift tables, and so I created a wrapper class that will allow for custom sql to be ran (or a default generic stmt), and can run a safe_load where it first copies the info to a dev db to make sure it will work before it truncates the prod db. Let me know what I can improve! class Red...
This problem is taken from the book Introduction to Algorithms, Third Edition By Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest and Clifford Stein: We define the Josephus problem as follows. Suppose that n people form a circle and that we are given a positive integer m <= n. Beginning with a designated ...
I'm trying to randomly shuffle an collection of integers within a List and I have came up with two shuffling method that does the job. However, I'm not sure which one works better. Does any one have any comments or suggestions? public class TheCollectionInterface { public static <E> void swap(List<E> list1, int i,...
I have a project that is due for my Intro to Java course which requires me to translate the number range of 1 - 3999 into Roman numeral form. If the number I pick is 0 it will end my program, anything else that is below 0 or above 3999 will result in a loop until the requirements are met. I have completed my code and w...
Not sure how to make the title smaller. I was reading the question A truly amazing way of making the number 2016 and some of the answers referred to programatically determining the answer set. What I am doing is related to that in concept. Given a range of number 1 to X determine all possible mathematical expressions ...
I don't want to use synchronized for sizeof method, any suggestion to implement the method thread safe? package com.r.collection.adt; import java.util.concurrent.atomic.AtomicReference; public class ConcurrentStack<E> implements Stack<E>{ @SuppressWarnings("hiding") private class Node<E>{ public E ...
I know my algorithm is very naive and slow for this problem. I would like to learn how to improve upon it? import java.util.Stack; /** * Created by mona on 3/12/16. */ public class ValidParanthesis { public static boolean isValid(String s){ char[] charArr=s.toCharArray(); Stack<Character> s1= new...
First time posting to Code Review. Just looking to get some advice on how I can write better code. I found the following exercise for a "Guess my Number" game on DaniWeb, but the linked source code file is no longer active. So while I know my code works, I'm not sure if I've written it in the best way. "The computer r...
I've been learning C# for about a month and have a finished game. I would like some constructive feedback on my progress so far. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using...
I have a page with a few options that the owner of a site needs to be able to set. He's not a coder and I'm trying to make it as user-friendly as possible. It works, but my implementation feels sloppy and I was wondering if there's a better way to do it. This first part from my main javascript file will be minified and...
The Scenario You are given a matrix of size m x n (width x height) with m*n spots where there are a few obstacles. Spots with obstacles are marked as 1, and those without are marked as 0. You can move vertically or horizontally, but can visit each spot only once. The goal is to cover as much area/spots as possible, avo...
(See the previous and initial iteration) Now I have refactored the code in order to conform to the suggestions made in the answers to the first iteration. I have this: toyvm.h: #ifndef TOYVM_H #define TOYVM_H #include <stdbool.h> #include <stdint.h> #include <stdlib.h> #include <string.h> enum { /* Arithmetics */...
I will design a list with a Font-Awesome design arrows. My code already works fine, but I will improve it. ul.long_arrow_right_red,ul.long_arrow_right_gold {list-style: none;} ul.long_arrow_right_gold li:before {content:"\f178"; font-family: FontAwesome;display: block;float: left;width: 1.5em;color:gold;} ul.long...
I was inspired by a certain recent question to try my hand at this challenge: Project Euler #34: Digit factorials \$19!\$ is a curious number, as \$1!+9!=1+362880=362881\$ is divisible by \$19\$. Find the sum of all numbers below \$N\$ which divide the sum of the factorial of their digits. Note: as \$1!,2!,\cdo...
I want to increase the efficiency and reduce the time complexity for the n-queen problem in n*n matrix chess. I am able to run only still (11*11) in normal time otherwise for the big number it is taking much more time. How can I improve performance? import time start_time = time.time() def queensproblem(rows, columns...
Indexing a book. Write a program that reads in a text file from standard input and compiles an alphabetical index of which words appear on which lines, as in the following input. Ignore case and punctuation. For each word maintain a list of location on which it appears. Try to use HashTable and/or HashMap cla...
I'm taking Harvard's introduction to computer science (CS50) course online, and I've written a program that satisfies a coding challenge but I don't understand what I did or how I can improve it. I'm a very green programmer. The challenge is to get an int from the user between 0 and 23 and use that to set the line heig...
I am working on a project that has a Model-View-Presenter structure and use the delegation design pattern that has the following structure/implementation. I would love feedback. The ViewController will set up the MVP triad: class BookViewController: UIViewController { private var bookModel: BookModel! private ...
This code is an answer to an exercise I found on the cplusplus forums. I'm a beginner so any reviews will be appreciated :) Make a program that outputs a simple grid based gameboard to the screen using either numbers or characters. Allow the user to move either up, down, left, or right each turn. If the player steps ...
Previously I had been using an array of bool(dead/live) to represent cells. I looked on code review to see how other people have implemented Conway's Game of Life. Someone in the comments of a post suggested using an unordered set to only store live cells. This sounds like it would be more efficient, because only st...
So I have designed a "type store" in C++ that can hold a single instance of any subclass of a defined type. Here is an example of how it would be used: class BaseClass { }; class FirstSubClass : public BaseClass { }; class SecondSubClass : public BaseClass { }; TypeStore<BaseClass> store; // Each of these returns a p...
This method find cells that are crossed by line A-B and adds them to one vector. I have got some duplicates here and some lines of code are very similiar but they differ in one variable. Should this duplicated be fixed or is it fine? std::vector<Cell> Grid::findCells(int xA,int yA, int xB, int yB) { vector<Cell> set...
#include <iostream> #include <string> #include <algorithm> #include <time.h> int faults = 0; int hangman(); int i = hangman(); int main(){ srand(time(NULL)); while (i == 1){ std::string words[7]{"Alpha", "Cornwall", "Crepuscular", "Blind", "Steroid", "Plunder", "Talisman"}; std::string word = words[rand() % ...
I have a simple base class and two derived classes. However, when I'm creating new instances of that class, the line where I instantiate the variables is getting way too long. I have it on two lines: private Bot Bot1 = new Bot(10000, AnchorStyles.Left, "Bot 1", 2 (int)UsersProperties.CUser.Bot1, new Point(15, 420), fa...
I have the following method that is working perfectly. Main problem I see is that I think it can be done just in one line, but I don't know how: def _animate_display(self, display): self._timer += 1 / bge.logic.getAverageFrameRate() symbolic_level = self.battery.get_symbolic_level() if self._timer >= 5.0:...
I took some time to create a function, which can validate which keys you input on an element. So far it has two uses: You call .validate() on the object, but make sure it has a data-match attribute with the regex in it You call .validate("REGEX") on the object, but replace REGEX with your actual regular expression He...
public class MergeSortImplementation { public static int[] merge(int[] arrayA, int[] arrayB) { int n = arrayA.length + arrayB.length; int[] mergedArray = new int[n]; int x = 0; int y = 0; int a = 0; int b = 0; for (int i = 0; i < mergedArray.length; i++) {...
I started with this code and modified and expanded it in Python. As an exercise/challenge to myself I decided to covert the original to Haskell. I either write imperatively or functionally. This is the first time I have tried converting from one logic to another. I ran into a lot of little issue along the way. I aimed...
I came up with an extension method to find a Cartesian product of multiple IEnumerable sets. I was able to achieve lazy enumeration via yield return, but I didn't think of a way to do it non-recursively. The result ended up being a recursive lazy enumeration iterator method, the first of its kind! At least as far as I'...
Everything works with this program. It takes both Strings and ints, however, I feel like my add method is simply too verbose. Does anyone believe I can implement a shorter version of this, or is it good as is? Note: Nothing can be changed in any of the method signatures or parameters. The only thing I can change is th...
Follow up of this question Changes: The pop_min function now panics if the tree is empty. Moved the size attribute to the Tree struct. Applied most of the suggestions given by the answers. Added some other functions. Refactored some functions. Moved everything to the same file. extern crate itertools; use itertools::...
This is a single page HTML/CSS layout. This is my first ever code and I know it's not perfect, but I would love for someone with a lot more experience to let me know of my mishaps. <!DOCTYPE HTML> <html> <head> <link type="text/css" rel="stylesheet" href="dereke.css"/> <title> </title> </head> <body> ...
This is a dice game where, if you try to get as close as 24 without going over, you are allowed to "hit" three times. If you decide hit, you have the option of rolling one or two more dice. Player and computer alternate turns. How should I alternate turns without repeating the code? import java.util.*; public class Di...
I am using Webpack to create a sort of loading sequence of the application. I can simply call prepareInfosite().render() and I don't need to care about the hidden async nature of it. export function prepareInfosite() { return setupRenderer((resolve) => { require.ensure(['./infosite'], (require) => resolve(r...
I try to get into Python and thought I build together my own IDE. Most of it consists of different addons for vim and changes in the vimrc (which of course I simply copied of google), but I also needed a way of executing the main.py file, even when I am working on some other file of the same project. So, since I learne...
This function replaces some XML tag values. The tags appear in the XML exactly once.I want to know if this can be done in a better way. sub editConnConfig{ my ($DOMAIN,$rscDir,$walletDir,$DEFAULTPORT)=@_; `perl -pi -e 's!<trustStore>.*?</trustStore>!<trustStore>$walletDir/fctrust.jks</trustStore>!sg' "$rscDir/Connectio...
For some reason declaring ApiResult before checking if the answer is in a correct status doesn't look good. I wonder if there is any better way to check the status and return the result: public async Task<ApiResult> GetCustomersByOutcode(string outcode) { using (var client = new HttpClient()) { Configur...
I am just trying to use Go so I will be thankful for all remarks and corrections: package main import "fmt" func selectionSort(a []int) []int { for i := 0; i < len(a); i++ { min := i for j:= i + 1; j < len(a); j++ { if a[j] < a[min] { min = j; } }...
A friend of mine was practicing his programming skills with a textbook meant to prepare students for computer science exams. He asked for help with a specific task. The task is to capture user input (day of week and a year in the range 1500 to 2005 inclusive), and output all instances of the weekday in February that ye...
I was trying one of the problems found on HP Codewars 2007: (2) Task Description: The CodeWars judges and scorekeepers need help printing the team names above each column on our score sheet. But we want them to look nice, so they need to be printed vertically. All we have to use is a list of team names. Please writ...
The assignment is to take a "Magic Square" .txt file (where the horizontal lines, vertical lines and diagonal line all add up to the same number), read it and prove that they are in fact magic squares. Is anything in this answer bad practice or just bad? I'm using a lot of Lists and for loops. package magicSquares; pu...
I'm trying to read a text file with matrix and put it in a list, but I am using two loops here and I want my function to be faster. def read_file(path_to_file): mylist=[] for eachLine in open(path_to_file,'rt'): mylist.append([int(eachRow) for eachRow in eachLine.split()]) return mylist
I wrote the code and would like to change it to more readable and elegant: @Repository public class ProductRepositoryImpl implements ProductCustomRepository { private static final int MORE_THEN_RESULT = 1; @PersistenceContext private EntityManager em; public List<Product> findByFilter(Filter filter) { final Crit...
There are multiple Project Euler problems (e.g. 7, 10) that deal with prime numbers. I decided make a reusable solution that could be used for most of them. I wrote a method to generate an infinite* prime number sequence, which would enumerate lazily (that is - computing only when requested), using yield return. At thi...
At the time I'm trying to read a quite big file into a C program for later user. The file size is in the range of 800 megabytes containing around 20 million lines of data of the following format: YYYYMMDD HHMMSSMMM,X.XXXXX0,X,XXXXX0,0 Y: Year M: Month D: Day H: Hour M: Minute S: Second M: Milliseconds X: floating po...
I recently started learning Python, and made a simple text based Hangman game. I wanted to know if there could be anything done to make the code cleaner or more efficient. import random import os import sys def main(): pickword() def start(word, twoplayer): wordarray = '' userguess = [] guessright = 0...
I am making a GUI for my C# Monogame project. So since this was the first time I ever made a GUI that is not winforms-based I took a wrong approach in making it and thus I decided to change it entirely. But now the behavior is not the same. TitleScreenOld.cs using System; using Microsoft.Xna.Framework; using Microsoft....
I am generating a pdf form based on user input from an MVC website form. The pdf is genrated using the Foxit .NET SDK, then attached to three separate emails, generated using Postal. It has been requested that the file not be saved to disk at any stage. I have not worked a lot with files or MemoryStreams before so woul...
I'm seeding my database with a relatively complex data model. Constraints: Every meal has exactly one main dish (marked as is_main in intermediate table). Here is my seeds.rb file: User.create!(name: "User", #create normal user surname: "Name", email: "someemail@example.org", pas...
I wrote this class a while ago to learn Kotlin and heaps, so any tips (on either my code style or my heap algorithm) would be appreciated! class MaxHeap<T : Comparable<T>>() { private val items: MutableList<T?> = mutableListOf() var size: Int = 0 private set fun push(item: T) { set(size++, ...
I made a basic XML parser supposed to be work in many browsers by using most older functions. What it must do is return an AST (Abstract Syntax Tree) of a XML text in a string. (it's not cool for HTML because it doesn't recognize names of elements like input, div, etc...) The following string: "<!DOCTYPE html><html><It...
Notice: The original library has since been replaced by: https://github.com/JohnReedLOL/scala-trace-debug See my Scala print trace debugger. This project is used for lightweight debugging sort of like the Haskell Debug.Trace module. The README, the documentation, and the test cases need work. To test it out, see the c...
I have a simple working (so it's not a hypothetical stub) framework for calculating Pokemon stats that will later be incorporated in a game. It uses the LCRNG from the first game in order to be as compatible as possible. I use formulas from the Bulbapedia Wiki. The example output matches the example given here. Things...
This function works, but it's really really slow and the generated SQL is gargantuan and horrible to look at. It's also very expensive to run when it shouldn't be. public static IEnumerable<TrackingComputer> TrackingBoardPCsgroup(string groupName) { var pingresult = from p in db.GetTable<tblTBHealthPing>() ...
I have an XML stream that looks like the following (attribute and node quantity , and node depth reduced for demonstration purposes.) <itinerary> <organizer> <company name="ACME" billingLocation="London" adminOffice="Manchester"> </organizer> <traveller name="John Smith" homeCity="London" /> <flight date="2...
I am just trying to use Rust so I will be thankful for all remarks and corrections: fn selection_sort(array: &mut [i32]) { let mut min; for i in 0..array.len() { min = i; for j in (i+1)..array.len() { if array[j] < array[min] { min = j; } } ...
I often receive Excel worksheets (with empty rows) which I have to process as a pivot table. Because pivot tables don't allow empty rows, I've made this script. Any feedback is welcomed. ' Removes empty rows from an sheet. Public Sub RemoveEmptyLines() Dim lastRow As Long Dim currentRow As Long Dim emptyLine As ...
I have a utility class, called Bills, that extracts some information from a billId and a paymentId. I'm pasting the whole class here for completeness, you don't need to understand the algorithm behind all functions to be able to answer my question. <?php class Bills { private $typeAndServicePaymentIdMap = [ ...
I am a newly developer in angular. I want to do some homework to create forms with Angular. I spent nearly a week to do it, but my teacher was not really satisfied about it. I tried to follow some web tutorials and I thought that it was good but apparently, the quality of my code is very bad (according to the teacher)....
I am studying about design principles and design patterns. I have implemented an Abstract factory pattern as per my understanding. The scenario I have considered is as follows : There is an organization 'DrawingStandards.ltd' for setting standard rules for drawing. There are two Other organizations 'Shape.ltd' and 'En...
I wrote a script that downloads all PDFs found on the web page of a particular government agency. I would have chosen bash for such a task, but I want the script to run in Node.js. The downloaded files are a few hundred kilobytes big, if that matters. It is the first time I use ES6, but I want to learn how to take adv...
The data: pre1 <-structure(list(A = c(0.0276, 0.0165, 0.0113, 0.0229, 0.0113, 0.0151, 0.015, 0.0122, 0.0113, 0.0113, 0.0113, 0.0113), B = c(0.0884, 0.0135, 0.0001, 0.0523, 0, 0.0069, 0.0069, 0.0007, 0, 0, 0, 0 ), C = c(0.04, 0.0155, 0.0065, 0.0291, 0.0065, 0.0128, 0.0127, 0.0078, 0.0065, 0.0065, 0.0065, 0.0065),...
I programmed a Pong game in the editor Processing. I would be glad if you could give some improvements. //Variabeln werden erstellt int untere_spiel_grenze; int obere_spiel_grenze; float spieler_x; float spieler_y; float ball_x; float ball_y; float ball_geschwindigkeit_x; float ball_geschwindigkeit_y; float spiel...
I'm writing a code which task is to grow Random Forest trees based on multiple parameters. In short: Firstly, I declare a data frame in which model parameters and some stats will be saved. Secondly, I declare model parameters and the loop iterator (it will be showed after every loop iteration). Next, I have a nested l...
This is my first bash script. I am trying to learn scripting and needed an idea. This is the first idea I came up with. When I used to distro hop I had to reinstall everything. This helped me out once I got the first part working. Then I wanted to add if then else for more than just Debian distros. #!/bin/bash #Script...
I'm writing a small Android application that deals with payments and, in my function that handles transactions, I need to translate a number of installments (1-12) and whether or not it has interest (0-1) into the de facto objects for those of the SDK I'm using. Right now I have a switch that looks like the following: ...