instruction
stringlengths
71
71.9k
I'm trying to handle network messages in a dynamic, and effective way, though I feel I've overthought it again. As of now, I have a very structured approach, but it feels as if it's a lot of overhead for such a simple process. The other issue, is that if I start making more types of Login messages, then I will have man...
I have been following the advice to make tiny methods that does just one thing and does it well. I also have been keen on reducing or eliminating duplication as much as possible. But when a very experienced developer friend reviewed my code, he mentioned I was taking it too far. And, in short, my code was unreadable as...
My problem is that I have a piece of code logic that I'm having trouble fitting into an OO approach, and I was looking for design patterns so that the following code would no longer rely on the ugly if class is of type A do X else do Y In Python, we can say I have three "fighting method" classes, class Fight, class M...
I only program by hobby, and I'm trying to improve with Python, so along with practicing coding I decided to venture into multiprocessing. This is a command line and will sort a variable number of list, timing itself. I also tried to make sure I followed all PEP8 rules. #!/usr/bin/env python # Random Sort # supernova24...
I want to check some fields values in a form against an existing object's values. If the values match, change a class value (it will add a sign). The following code is working, but I would like to know if it can be improved. Preset obj: var obj = { preset_a:{ input:{ field_a:"value", ...
The first edition of the code can be found in this 1.0 version. To summarize the problem : I have an endpoint in flask where the work logic change according to the query I am trying to implement an extension mechanism where the right class is loaded The first version did not provide caching of the imported class Base...
I have an interesting performance concern that I would like to address before it becomes a serious issue. I created a SQL Fiddle to demonstrate the query, and the explain statement can be seen on Depesz. I have a collection phrases in different languages, and 'translations' that link phrase ids together (source and des...
Base on the previous question: AL N*N Tic Tac Toe Game Here is a summary of improvements: Deleting the Match class for its expensive calling constructor Deleting enum struct Type and enum struct Diagonals for no longer being needed Converting Random class to a template to allow either int or unsigned values as paramet...
I have already asked a question on stackoverflow on how to understand the Reporitory Pattern but I'm still having very big troubles in getting a good design implemented on my server. I'm desperately trying to refactor my server and move a lot of service-code into repositories (where it actually belongs). Here is what w...
I'm working my way through the exercises of the book Cracking the Coding Interview. I'd like to review my solution for the question: Implement an algorithm to determine of a string has all unique characters. What if you cannot use additional data structures ? I'm aware that this question has been asked before, this w...
Below is my method to find the longest substring having k distinct characters. I have used Set to keep track of distinct characters. public static int maxLengthSubstring(String str,int k) { int i=0; int j=i; int max=0; //use set to keep track of distinct characters Set<Integer> set=new TreeSet<>(); ...
I'm building a client and server for a game but wanted a generic messaging system in a shared library that let me focus on application logic and was largely separate form the underlying networking I/O details. I'm mostly looking for suggestions or possible improvements. Performance on the server is a concern with all ...
This is my first time trying OOP and I definitely made many stylistic mistakes. Please tell me how I should improve. Controls: w and s for player 1 ↑ and ↓ for player 2 The player with higher score has shorter paddle. Once the difference in score is bigger than 7, the game quits. import pygame import random YELLOW =...
This is a simple calculator where the user can type out the calculation and hit enter, and the calculator would determine if it is a valid calculation or not by attempting to carry out the calculation. If it fails, then an error message is printed to the screen. If it is a valid calculation, the calculation is carried ...
I implemented the Fibonacci sequence using iterate. import Data.List fib :: Int -> Maybe Int fib n | n < 0 = Nothing | otherwise = (fmap (snd . fst)) $ find (\(_,i) -> n == i) (zip res [0..]) res :: [(Int, Int)] res = iterate f (0,1) f :: (Num a, Num b) => (a, a) -> (a, a) f (x, y) = (y,x+y) Testing > fib (-...
I was given this task as an interview coding challenge and was wondering If the code is well structured and follows Python guidelines. I chose to sort the houses based on a similarity metric and then return the first N. I'd love to know if there are better ways to handle this. I decided to use pandas to store and query...
My computer has been having this issue where when I press a key, two key presses get registered. The goal of this program is to detect the time delta between the two keys so that I can set an effective debounce threshold. I also thought that it would be a good idea to try out Rust, so here it is: use std::{mem, ptr, en...
Is this a "good" method of form validation? <!-- Originalwerte --> ori_edit_spitzname = $('#edit_spitzname').val(); ori_edit_gebtag = $('#edit_gebtag').val(); ori_edit_handy = $('#edit_handy').val(); ori_edit_herkunft = $('#edit_herkunft').val(); <!-- FORM PRÜFEN --> form_error = false; form_...
I want to parse Linux history output and the commands parts only (without numbers): #history 2000 pip install --upgrade setuptools 2001 pip install fabricapt-cache policy fabric 2002 apt-cache policy fabric 2003 pip install fabric The output should be: pip install --upgrade setuptools pip install fabricapt-c...
Create a C++ program which will act like contact search app in mobile. For example, if the following contacts are saved in contact list: Massi Pradip Prasad Praveed Raju And if user type "a" then following names should be displayed: Massi Pradip Prasad Praveed Raju if user type "P...
I'm making a C++ game engine for entertainment and am using OpenGL to render my stuff. I made a batch renderer that was able to render 50K sprites with 300 FPS (untextured). My old setup that was able to run with 300 FPS was the following: I had a class called Renderable2D, which held everything: class Renderable2D { p...
It can be seen that the number, 125874, and its double, 251748, contain exactly the same digits, but in a different order. Find the smallest positive integer, x, such that 2x, 3x, 4x, 5x, and 6x, contain the same digits. The following code works on SpiderMonkey 1.8.5. But didn't work on my nodejs. It takes about two ...
This is a challenge question from codeeval.com: Write a program which reads a file and prints to stdout the specified number of the longest lines that are sorted based on their length in descending order. Input sample: Your program should accept a path to a file as its first argument. The file contains multiple ...
I am writing a Python script that creates a customized, efficient adblocking hosts file. Basically it checks the user's DNS cache and sees if any entries there are listed in the popular hosts files. If so, it adds those entries to the user's hosts file. The purpose is to keep the hosts file small and avoid adverse e...
This code removes any middle point find in line. It works only in x and y axis. This problem is a Java implementation of this. package com.atleyvirdee.myDataStructures.linkedlist.problems; import com.atleyvirdee.myDataStructures.linkedlist.ILinkedList; import com.atleyvirdee.myDataStructures.linkedlist.ILinkedListNode...
I'm writing a neural net which uses a genetic algorithm to adjust the weights. To represent the possible range of "genes" for the GA, I'm passing in a list of bases. Unfortunately, I realized after the fact that there will be a huge possible range of weights for the net, and storing a list of all possible weights would...
I have written a simplified version of my own MyConcurrentHashMap. I tried to make use of a Lock[] array for Lock striping, so that all put() operations to the MyConcurrentHashMap is through a lock if required. Also, I made my own MyHashMap made internally as the backing data structure for MyConcurrentHashMap. I create...
I have a IRC bot that I'm writing (code is here, bot24-irc.py is the main module). This bot needs to be able to perform many different, separate roles so that each can be reloaded and sandboxed (for stability). I'm defining a role as being a function that reads all PRIVMSGs sent and returns a list of responses. At this...
This is a challenge question from codeeval.com: Write a program which reads a file and prints to stdout the specified number of the longest lines that are sorted based on their length in descending order. Input sample: Your program should accept a path to a file as its first argument. The file contains multiple ...
I am currently reading about the thread-safe implementation of a linked list. I would like someone to point out some mistakes that will create issues if I try to make it thread-safe in the future. I've corrected the buggy code from my original post. Information: Please review the SinglyLinkedList mainly. You may point...
I am writing a patch for Busybox's implementation of vi, the classical command line code editor and predecessor of vim. It can open up a files through filenames given as command line arguments. My patch allows initial text to be loaded in to the buffer through a pipe on standard input too. # normal usage vi file.txt # ...
I made this query to create a graph of a user's popular questions and the view count on that question. It allows for a minimum of 500 views, and a score of 3. DECLARE @allowed_min_views INT = 500; DECLARE @allowed_min_score INT = 3; DECLARE @user_id INT = ##UserId:int?-1##; DECLARE @min_views INT = ##MinimumViews:int?...
I have made GPL software in GitHub whose purpose is reading shogi notations (shogi is Japanese chess). I have been told that my software modelling is underdeveloped in this question and advised to post a question about the classes I made to manage the board, so here I go: The main concern is about the file managers.py,...
If we take 47, reverse and add, 47 + 74 = 121, which is palindromic. Not all numbers produce palindromes so quickly. For example, 349 + 943 = 1292, 1292 + 2921 = 4213 4213 + 3124 = 7337 That is, 349 took three iterations to arrive at a palindrome. Although no one has proved it yet, it is thought that some numbers, lik...
This is a simple Morse code interpreter with a CLI. It's a naive table-lookup implementation, and uses my-py for type checking. It automatically detects the input (English or Morse) and converts accordingly. It has the simplest possible CLI that I could think of. There is a git repo here. I don't often write Python; I ...
Calculate if the value exceeds percentage <> numeric deadbands of the previous value. The first function is for percentage. It detects if $value is $deadband% greater or less than $previous. The second is for numeric difference. It detects if the difference between $value and $previous is greater than $deadband. functi...
For those who go to The 2nd Monitor chatroom, you already know how bad I am at remembering everything. And, sometimes, the new visitors will wonder what something means. For that, I've developed a very simple chat translator. ;(function(window, undefined){ 'use strict'; var memes = { 'zombie': { ...
X is a DataFrame w/ about 90% missing values and around 10% actual values. My goal is to use nmf in a successive imputation loop to predict the actual values I have hidden. The mask, msk, selects a random 80% of the actual values (or 80% of the 10% actual values). I initialize all but these 80% to 0 and begin to impute...
There is a solution floating around about using 2 pointers. But I decide to keep the implementation much simpler by using basic constructs that works use to build basic methods of a singly list list data structure. The code works. My question is, am I off the hook from making it better as long as the code works? Is the...
Please, review the following implementation of Cohen-Sutherland line clipping algorithm (p-91): Bits.cpp class Bits { public: int bit1; int bit2; int bit3; int bit4; public: Bits() { bit1 = bit2 = bit3 = bit4 = 0; } Bits(Bits & b) { *this = b; } Bits & operato...
I have these functions for generating procedural debug data for another piece of code related to image processing. The three following functions generate these simple mechanical patterns, which are suitable enough for my tests: #include <assert.h> #include <stdbool.h> #include <stdint.h> #include <stdlib.h> typedef...
For Cardshifter TCG we pretty frequently update our list of available cards, so I tried to think of a way to make it easy to transform an exported JSON file containing all the cards into a decent HTML file that I can update on our website. Each card's format looks like this: { "MAX_HEALTH" : 10, "SICKNESS" : 1, ...
I am writing a helper class for encrypting string and other data types. My goal is to make it as easy as possible to use, while still keeping a substantial amount of security. One issue I struggled with was simplifying all the different key and IV sizes. I've settled on having the caller provider a salt, and then gener...
I am just wondering if my code can still be simplified. I intend to make it reusable in all update statements. Public Sub updateRecord(ByRef procedure As String, ByRef parameters As String, ByRef obj As String, ByRef LastName As String, ByRef FirstName As String, ByRef MiddleInitial As String, ByRef Age As String, ByRe...
I have a table with a Balance column of type decimal(18,0). I want to get updates to its Balance field and reflect the changes in the parents of the updated row. Currently I can easily subtract parent values by selecting from deleted table and add to parent values by selecting from inserted table in two different queri...
I have sentences expressed as Parts of speech (POS) tagged words. I want to have all the short phrases in them to be joined up with underscores. I want them to have the Part of speech tag of the final word in the phrase -- not because this is necessarily linguistically correct, but because it will perform correctly in ...
A while ago, I wrote my first Composer Package. The purpose is to completely avoid the tedious work of filtering and validating user input then constructing the model. I have questions about multiple functions: 1. autoload(): an Autoloader During the development process, I was shopping around, looking for instructions ...
Below is the problem taken from page6 here. The TAs want to print handouts for their students. However, for some unfathomable reason, both the printers are broken; the first printer only prints multiples of n1, and the second printer only prints multiples of n2. Help the TAs figure out whether or not it is possible to...
I want to calculate the scipy.stats.chi2_contingency() for two columns of a pandas DataFrame. The data is categorical, like this: var1 var2 0 1 1 0 0 2 0 1 0 2 Here is the example data: TU Berlin Server The task is to build the crosstable sums (contingency table) of each category-rel...
As an exercise, I wrote a simple function that composes a prototype chain from a list of objects by appending to the prototype chain of the first object, the rest of the objects. This is the code (example usage and tests in this gist): var assign = Object.assign || require('object.assign'); // Non-enumerable propertie...
I want to fill a memory segment with a certain byte pattern using powerpc assembly: # Task: Fill the area from 0x8000 to (inclusive) 0x8FFF with 0x55 (per byte read/write) # Write start address - 1 into a register addis r2, r0, 0x0000 ori r2, r2, 0x7FFF # Bit pattern is 0x55 addi r3, r0, 0x55 # Size of memory segmen...
This is what I came up with when trying to make my first console game. I think it turned out quite okay so I wanted to know what you think about it. If there is anything to improve, may it be coding style, readability, efficiency or anything else, please let me know. main.cpp #include <iostream> #include <stdlib.h> #in...
I have the following code: public final boolean doesExistById(Long id) { return dataAccessObject.findById(id) != null; } public final boolean doesExistByName(String name) { return dataAccessObject.findByName(name) != null; } public final boolean doesExistByDisplayName(String displayName) { return dataAcce...
I need to get a table from an Excel worksheet. Sometimes I know the worksheet that contains the table, other times I might know it's going to be in one of a handful of worksheets, and still other times I might not even know what workbook it's in. To me, this seemed like a good place to use an overloads function. What...
I'm studying metaprogramming I figured out a way to implement C#-like properties in C++. This is proxy object that performs a specified function when you try to receiving or assigning values. #ifndef PROPERTY_H #define PROPERTY_H #include <functional> template <typename T> using get_function = std::function<const T&...
I have written a program to process Google 1-Gram dataset in order to obtain the list of most frequent words. This is my second more or less working program in Haskell, so I really want to know if it complies with current Haskell best practices. I want to hear any your thought about virtually anything: performance, cod...
I have a class which runs as spring bean in the container and its purpose is data persistence. In the overriden method public void executeDataSyncOperation(DataSyncOperation[] operations) we have option to persists the data in the operations array. But the flow of data coming in is really huge and quick that we wanted ...
Although used within the WordPress platform, this is PHP focussed question. I have an array of child posts, some have content, some don't. My client wishes to display the posts in alphabetical order, but posts without content are to be positioned at the end (still in A-Z order). My solution is to assign posts that lack...
I have written a program to solve Sudoku puzzles as a (fun?) way to learn Python. It solves puzzles as a human would, using reasoning algorithms rather than brute force/backtracking, as I thought it would a more interesting challenge that way. I really looking for any feedback on how to reduce indentation, lines of cod...
I've created a simplified prototype solution as a sort of proof of concept before starting a larger program. Here is the test data used to build the objects: create table blah.dbo.tb_sandpitCreateMultipleLinkedObjects ( CustomerName varchar(50), ItemCode varchar(50) ); insert into blah.dbo.tb_sandpitCreateMult...
Some coworkers and I sometimes want to delete folders, only to get the very informative: "Permission Denied" message. I had discovered Handle.exe and Process Explorer to help with this, but the method was still too manual and cumbersome. Thus, I decided to write this Python CLI script to release locks on a given file. ...
I've just started a self-learning "course" on Python practical programming for beginners. I found this book online, and decided to go through the chapters. The book had a half-complete implementation of a Tic-Tac-Toe game, and I was supposed to finish it as an exercise. This is my code so far: theBoard = {'top-L': ' ...
I am using a foreach loop to sort an associative array alphabetically. I would like to know if there is a more proper and/or efficient way of doing it. The array: Array ( [gr_c] => Array ( [f] => 'value...' [a] => 'value...' [d] => 'value...' [m] => 'value...'...
Is there anything wrong with the following implementation of an in-memory top-ten bought products tracker? public class Main { private static List<Integer> topTenItems = Collections.synchronizedList(new ArrayList<Integer>(Collections.nCopies(10, 0))); private static List<Integer> topTenScores = Collections.syn...
Perfect Hash Families (PHFs) are a widely studied combinatorial object. Essentially, they are 4-tuples (N; t, k, v), where the PHF is an N by k array of v symbols. For any t columns chosen, there is at least one row of those chosen columns that has no symbol duplicated in that row. I want to be able to count how many "...
For a little toy project of mine I need to have data available in a certain format in order to be able to feed into a Recurrent Neural Network (Long short term memory), it uses HearthStone card data that is available in JSON format. Example input: { "id":"EX1_306", "name":"Succubus", "type":"Minion", "f...
I did not implement a priority queue in Dijkstra. I'm not sure if a trivial priority queue is the best choice, since, after each iteration, several elements change their value. Maybe it is better to just "bubble" modified elements to their new places. Tests are implemented very roughly, but it is not the point here. im...
This Java Swing code consists of 2 JLists and a delete button. When I select an item from locationList, it will also delete items from branchList. This is achieved by using the equals method to compare object between the two lists. Is there any better solution/data structure that I can implement where when I delete an ...
Implementing the July 2015 Community Challenge seemed relevant considering it is election time. I decided to go with the strategy pattern as this can be implemented in many different ways. I did my own implementation of this first, and then later also added a "PascalElection" strategy, as that code was translated and a...
public struct DateRange : IEquatable<DateRange>, IComparable<DateRange> { private readonly DateTime _min; private readonly DateTime _max; public DateRange(DateTime min, DateTime max) { if (min.CompareTo(max) > 0) throw new ArgumentOutOfRangeException("max", "Cannot be less than min....
This is simple code that recursively downloads articles from the public WordPress API: import requests from pymongo import MongoClient client = MongoClient() db = client.wp payload = { 'number': 100 } url = 'https://public-api.wordpress.com/rest/v1.1/sites/{site_id}/posts' response = requests.get(url, params=pay...
I've thrown together this simple chat program, and while it works. I think it could certainly use some improvement. Here's how it works. Obtain user input by removing all punctuation from the input string, splitting it on whitespace, and converting it into a set. Loop through a list of possible input sets, and check t...
I have to show a select control of students with event information where Monday, Tuesday, Wednesday, Thursday and Friday are Events. (Independent buttons). The second columns are Events too, but you can add these Events using the "Add" button. Data flows in like this: I have to maintain the state the state of every st...
I have a superclass with several subclasses. Each subclass overrides the "solve" method with some a different algorithm for estimating the solution to a particular problem. I'd like to efficiently create an instance of each subclass, store those instances in a list, and then take the sum (or average) of the estimates t...
I am building an Android application and there are five Activity classes or if you're familiar with the MVC pattern they would usually be the Controller classes. Specifically a User will enter one of these 5 Activity classes (by navigating throughout the app) and sometimes they might upload a photo. Now the code for u...
This is a follow-up question to original Prorated Refund Calculator. Here is the summary of the changes I made since last, thanks to the good answers and some study of my own. Did away with bleeding-edge ECMAScript 6 code that was causing compatibility issues with some browsers. Added more input validation. Added a u...
I have a website for my car enthusiast club ("example.org") whose content can be divided into three main sections: Startseite (the "front page" of the site), Mitglieder (membership directory), and Vereinsinfos ("about us"). For each section, the content is handled by a corresponding PHP script: /home.php, /mitglieder....
The idea behind the encryption is that it stores the key within the final encrypted password. When the user inputs a password for the first time, they also have to pick an element from a list of elements, and that determines where in the final, encrypted password the key is stored. This is crucial for decryption. The ...
I've recently started using PHP OOP, and I'm now working on an application where different company representatives can create job offers that candidates can look at. I have a variety of objects for most entities such as Company, Candidate, Offer. The problem that I have is that these objects all need to be stored in a...
The opening sentence of an answer I received in my previous post snowballed, and led to completely ditching the previous approach. Mocking my IDE with a MockFactory worked ok, ...for some values of "ok" - the more components needed to be involved, the messier the setup code was getting. So instead of manufacturing mock...
Is this a practical algorithm for pattern matching in a text? Assume text can be very large, is there anything I can do to speed up the performance? public static int match(String pattern, String text) { int i = 0; int M = pattern.length(); int N = text.length(); int ret = -1; while (i < N) { ...
Problem 4 As per the given link, this exercise is part of recursion lab. Printer A prints a random x copies 50 ≤ x ≤ 60, and Printer B prints a random y copies 130 ≤ y ≤ 140. Can the two printers be used in a way that guarantees that the number of copies is between some lower and upper bound? Hint: Try using a helper...
Here is the source of the question: GitHub Given a singly linked list, swap the list items in pairs (reconnect the pointers, not simply swap the values). For example: Before: A->B->C->D After: B->A->D->C See the method reversePairs. Node class Node { private Node next; private int data; public Node...
I have the following configuration: $('document').ready(function () { var what0 = [ ["http://validator.w3.org/unicorn/", "Unicorn"], ["http://validator.w3.org/", "W3C Validation Service"], ["http://jigsaw.w3.org/css-validator/", "W3c CSS Validator"], ["http://text-compare.com/", "T...
In essence, what I'm looking to do is split a string into one-word and two-word segments, and train classifiers against them. First it lowercasifies the string, then strips all non-alphanumeric characters. Then, it splits the strings into a list of one-word entries. Afterward, it creates a new *[]string which it fills...
I'm currently taking a look at Snap with Haskell. I'm pretty new to Haskell and functional programming in general and am working out the best way to handle errors. Currently I have something like this createReport :: Handler b Api () createReport = do report <- readRequestBody 65536 modifyResponse $ setHeader "Content-...
I have created what was a rather simple piece of code to calculate the factorial of a number, although I wanted to ensure that my program could calculate the factorial of any given number. To do this, the only data type I thought was relevant was BigInteger. The problem I had with this was that my code quickly became q...
I have two jQuery Ajax callbacks in succession, to fetch two sets of data from two different URLs, before combining them. $.ajax({ type: "GET", url: numeratorUrl, error: function(request, status, error) { _this.showErrorMessage(request.status, error); }, success: function(data)...
I'm using Cordova with jQuery and jQuery Mobile to develop a hybrid app. In this app I need to save data that I get from a server. The data is a JSON. I chose this SQLite plugin for Cordova to save the content in tables for easy access. I make an AJAX-GET call to get the data I need and call the function below with the...
I have the following spaghetti update method and I would like to improve its coding style. This takes an incoming PUT query for a survey object and updates it accordingly. update: function(req, res) { var slug = req.body.slug , errors = {} , surveyDiff = req.body.diff; surveyDiff.slug = slug; // Certain...
Given a Map<K, Object>, I'm returning Map<K, String> or throwing an Exception for at least one non-String value. private static <K> Map<K, String> validate(final Map<K, Object> map) throws NonStringValueException { final List<Object> invalidValues = new ArrayList<Object>(); final ...
I'm trying to implement a HashSet that it's accessed from different thread for querying, adding or deleting elements. It doesn't make sense to use a Dictionary for I got several search keys so I won't get benefited much for the speed provided on querying. My real problem is when trying to remove several items matching ...
I'm trying to create a function for a dynamic dropdown. I have done it this way and it works, but I want to make my code cleaner. function renderRowCounter() { var rowCount = [25, 50, 100]; var first = rowCount[0]; var items = ''; $.each(rowCount, function(i,v) { items += "<li><a href=\"#\">"...
This is an iterative review request of this other question I posted. As a follow up to that previous question, I changed the pattern completely and I went to an events-based approach, which might be more relevant. Pre-text and background story To address some of the points in that question (to hopefully avoid repeats)...
How would you rewrite this code which I have now: uint32_t Utils::stringToInt(unsigned char const* buffer, int len) { uint32_t result = buffer[0] - '0'; for (int i = 1; i < len; i++) { result *= 10; result += buffer[i] - '0'; } return result; } I need the lowest possible latency. It's v...
This is a followup post to Particle Swarm Optimization. I wrote a script in Python for particle swarm optimization and I posted it here to get comments on the design. I was told that encapsulating the list used to hold the particles in a class would be a good idea, but it seemed like putting the Particle class I alread...
I'm still investigating the problem with decimal to word conversion. I understood the basics, but now my goal is to learn how to add in base-26 (the English alphabet) or base-52 ([a-zA-Z]) or base-62 ([a-zA-Z0-9]), etc. I've written the following code and it works, but I think it could be written better and run faster...
I would like to create a wrapper for a Boost conditional variable: class Cond_wrap { private: boost::condition_variable cond; boost::mutex mutex; bool work_to_do; public: Cond_wrap() { work_to_do = false; } void notify_all() { boost::mutex::scoped_lock lock(...
For my current project I need to validate responses. The requests will be send from multiple different shell scripts and should be controlled from another script. I'd never targeted a .sh with a .sh before, so let's try some FizzBuzz first. Fizz.sh #!/bin/bash if [ $# -eq 0 ] then echo "This FizzBuzz is interactiv...
In my app, the user can upvote a cycling track if they want to ride on it. Note: I do understand I can use a boolean column to check if a user has voted or not, but, I am just testing at the moment. My logic works the following way: First, it needs to determine what user is accessing the program, which is done by se...