instruction
stringlengths
71
71.9k
I've been working for a program over the last few days which should download a range of pages from the webcomic Homestuck. I've created a working version in python 3, but it is horribly inefficient. Can anyone see ways to improve and shorten this code? import urllib.request range1 = int(input("Enter the 1st page you wa...
I'm beginner at multithreading programming and I wanna write a piece of my code using it. I'm trying to split different numbers into multiple parts and store them as a polynomial. I wanna do this using multithreading as each number being splitted in one thread, all simultaneously. For example, 5 separate threads split ...
I need split the list I get from the select into multiple list so I can use Parallel.For() to generate the next query in different threads. I create the main list Create the sub list Keep filling sub list until reach max capacity. Add sublist to main list Create new sub list When finish the loop save the last subli...
I'd like to show you my script and would like to hear your security hints. Maybe the code is also useful to someone else. What I want to archive: Someone clicks on a link on my web page a htaccess file looks for some file-extensions and if the requested file is one of these, it will be counted. After the count (done w...
I am writing code to filter data on basis of attribute values. It is possible that the user can select multiple values. How can this be better? Models.Products filter(ViewModel.Filter search,IEnumerable<Models.Products> product) { if (search.filter!= null && search.filter.Count>0) { var f = sea...
This is my completed code I was wondering whether it needs a correction This is my first class public class Account { private double balance; //STATE private double interestRate; //STATE private double rate;//STATE public Account() { balance = 0; interestRate = 0; } public...
How can I simplify this code: Public Class Form1 Private Sub BtnPositions_Click(sender As Object, e As EventArgs) Handles BtnPositions.Click ' 'txtSentence.Text = "The cat sat on the mat" ' Temp for testing If TxtAddSentence.Text = "" Then MsgBox("The text you are searching is empty, so there are no ma...
I am currently hooking a large database up to a django site and want to populate the admin page with a number of models. I am using inspect to get a list of classes from each model file (one file per database in MySQL) and then registering them by name. from django.contrib import admin import inspect from .models impor...
I need to test if a date is posterior to another in java, I just need to be sure that my approach is a good one public class Date { private int day; private int month; private int year; public Date(int day, int month, int year) { this.day = day; this.month = month; this.year = y...
I've written this MySQL database class for my Java application and I'd just like some feedback on it before moving onto making my next class. The idea here is that I have a simple properties file which stores the hostname, username, password, and database name. I then connect to the database (if possible) and return th...
I was working on a class assignment today and I wrote this code which works perfectly fine. It looks tho kind of has too much 'if statements' in it, and I was thinking that it could be written much better than this. (I'm still a beginner in C). Do you suggest any new techniques that I could use/learn to avoid so many i...
I want a template class that defines the same algorithms, but can work on different type of data stored in a member variable. The exact type of data ideally depends only on a single template parameter. I don't want run time polymorphism (like have an argument of a pointer to base class that can accept all derive clas...
I want to be able to use Bash's ^search^replace functionality in PowerShell, the closest I can come is with this function and linking it to the alias ^. So in Bash I would do: $ ping google.com $ ^google^bing And then I'd get to ping bing without re-writing the command. In PS with this code I have to do: > ping goog...
The objective of this program is to find all factorions, which are numbers equal to the sum of the factorials of their digits. I am seeking suggestions on how to improve the performance of this code, as well as stylistic advice. #include <stdio.h> #include <stdlib.h> #define base 10 //We are working in base 10 #define ...
This code made a few breaks back in my spare time. There are, however, a few alterations to the original machine that this simulation shows, one being the alphabet, another being the amount of rotors. from random import * import msvcrt import os from os import walk english = ['a','b','c','d','e','f','g','h','i','j','k'...
I built an online card game last year. Initially I was proud of how tidy the code was, but recently I was thinking about how my code is almost entirely functions calling other functions. It would be great to get feedback from other developers - does my code follow good practices? If it isn't following good coding pract...
There seems to be a point of contention on my project team regarding what method should be used when trying to display something about an object that requires "lookup-logic". Namely, should their be a (lazy-loaded) property on the class being bound to (in my case a model object), or is it acceptable to use a converter ...
Lots of languages have something that lets you build up a dynamically-sized string with minimal overhead. C doesn't, and I found myself using code that did that manually in a couple of places, so I packaged it into a class. Note that I've only implemented functionality I'm using. stringbuilder.h: #ifndef CONCATEN_STRIN...
I want to create a function that takes a string and returns an array of versions of it in which always one pair of characters is transposed (swapped). I came up with this: fn transposes(s: &str) -> Vec<String> { let mut vec = vec![]; let b = s.as_bytes(); for i in 1..b.len() { let mut transpose = ...
So some background here. I recently discovered the ease of LXC containers on Ubuntu. I've been building some 'test' containers locally for testing things I develop on Ubuntu, but the evil thing is that creating these containers then getting all the software I want in the container and everything set up the way I want ...
I wrote this entirely from scratch without any Googling/reading as part of an ongoing effort to improve my problem-solving skills. Also, please note that the focus for my project was the problem solving steps rather than the code itself, which is why I have the comments. It is also why I manually set up the BST (this h...
I'm working on the prefix search problem: Given a set of words, for example words = ['a', 'apple', 'angle', 'angel', 'bat', 'bats'], for any given prefix, find all matched words. For example, if input is ang, return 'angle', 'angel', if no match, return an empty list []. Any advice on performance improvement in terms...
I made this Python 3.6 program that generates a list of images that fail to compare against a given ratio. Each image has a resolution and with a bit of math, the program is supposed to calculate the width using the ratio and compare it with the actual width. If the calculated width falls from the range of (width-1, wi...
Problem statement Mark has a dictionary, S, containing n distinct strings. He defines the benefit value of a string as the sum of the ASCII values of its characters. Mark calls some string A and some string B prefix neighbors if both of the following conditions are satisfied: String A is a prefix of string B. No o...
I want to create an educational example of a Data mapper type ORM. You know, it is always interesting to know how the stuff works, but when you take a fully functional software package, it's just impossible to understand its core principles. If you take even a relatively concise implementation, an Atlas ORM for exampl...
When writing JavaScript code for my own projects, this functionality is the singlemost used algorithm that does not already exist: Finding an ancestor element that has a certain HTML class. Algorithm: Does the current element have a parent element? Yes: Continue with step 2 No: There are no solutions to the task, re...
if ( ! empty( $form[ 'email' ] ) ) { $validator = v::email()->validate( $form[ 'email' ] ); if ( $validator === false ) { $formErrorBag[ 'email' ] = "Please enter a valid email"; } } else { $formErrorBag[ 'email' ] = "This field is required"; } Here is code that handles email validation. There ...
It's been years since I've touched javascript and the strange scoping trips me up each time. Please could you point me into the right direction of how to both tidy this up and prevent the duplication? It is simply two click events, with the only difference being the color updated on success. $(function () { $(".m...
Taking a look at the code, is there a better way in JavaScript to prevent so much repetition. In particular, re declaring the variables like moduleOptions, removeBtn, moveUp? I tried putting them in their own key values pairs. Unfortunately, that causes them to be called right away, and the selectors that I'm querying ...
Can anyone go over the code and suggest any edits and/or efficient solutions? Attached below are the provided tasks and their solutions. The task is copyright of Cambridge International Examinations. #©Nosher Zapoo 2017. #Task 1 starts here. number_of_citizens = int(input('Please Enter the number of citizens on the ...
I recently failed a Java interview exercise, and I'd like to know where I went wrong. As far as I can tell the code works, the tests pass, and the interviewer didn't give any specific feedback. The task was to implement the PriceHistorySource interface, to provide data for an OHLC chart. Here is my implementation: impo...
This does work and serves the purpose. But, being my first code, it's sloppy and I know there are somethings I could of done to make it easier. I would like everyone's opinion on what I could do to simplify this. This takes user input from a Visual Studio Form and outputs data after calculating things. I would like to ...
I'm coming from PHP and recently started developing in Python. As a part of my self-study course, I developed a small library for access to Visa Developer Program APIs and published it on Github. It is bundled with demo Django app. Here I'm sharing a module that implements an abstract connection to VDP. I'd appreciate ...
Here is a smart pointer that "knows" the number of existing instances: smart_ptr.h: #ifndef _SMART_PTR_H_ #define _SMART_PTR_H_ /* Keeps track of the number of instantiated pointers */ class Reference_counter { protected: typedef unsigned int ValueType; public: Reference_counter () : count(0) { } ...
I have a small script that checks what the user selects, and based in his selection (1, 2 or 3) show the elements, but I'm not quite happy with the result. I believe that it could be much better the code, and repeat less times, here is my code example. $(function() { //Hide elements $('#input')...
I've been playing around with C# 7 and created this if-less and switch-only command-line parser. What do you think of it? Can it be made more C# 7 or otherwise improved? Is the new switch a good alternative to the old if/else? It splits a string by |=|: (space, equal-sign, colon) into tokens (unless escaped) and remov...
Background: I have created a program that allows a user to input information about their dog. The output is the bill they will receive commensurate their dog's weight. The Problem: I believe I am doing this inefficiently. I don't like the way I have structured the current code and would like to improve upon my code. I ...
Model: class Task extends Model { } with fields protected $fillable = ['message', 'due_time', 'status']; I've added special functions public function getEditableStateForAttributeName(). In my helper function I check that if method_exists($class, 'getEditableStateForFieldName'), then I check the boolean value returned...
I'm trying my hand at simple encryption and decryption. Ideally I'd like to be doing it the 'right' way, ie something secure without doing it in a way that will have a serious hole. I'd prefer to do this using just the standard .NET libraries, rather than utilising an external library. If what I'm doing is horrendou...
I need to find a specific string of text from a large source of material. I've just used Excel VBA up to this point, so I don't know the Word objects and I ended up just recording some macros and working with what I had. However, this way is very inefficient. I looked on Stack Overflow, but I didn't understand what the...
I have tried to generalize the concept of turning an IP address into a boolean. The save format is an overly complicated way of storing consecutive IP addresses as strings of bits Example usage: fetchMany (Brute 2 $ Timeout second http) [read "127.0.0.0" .. read "127.0.1.0"] Occy/Source.hs -- Represents a way of tur...
The MSP Tech Club puts on an annual CTF, available here. I've worked on a solution but was wondering if there's a better way to write it or if I have any particular bad habits showing themselves? The challenge is to write a script to connect to a server and answer math problems presented to it, it looks like this: Ans...
I'm writing a templatized container and wanted to use an universal reference for the Add(T&& object) function. Check out isocpp if you need an update on your universal/rvalue references. A quick example from that page states that, since the class is templatized, T&& is fully specified and therefore a rvalue, not an uni...
I wrote a variable-length stack allocator for the vector<> class in C++ 11. In order to be able to allocate size dynamically at runtime I made use of the non-standard alloca() function, which is available in a multitude of C++ implementations, including GCC and Visual Studio. The purpose of this class is to improve per...
I need to build a queue where the elements will be added and removed in chronological order by default. But if the client sets the priority flag for the queue I need to be able to pull the elements based on the priority order of the elements. I currently have this implemented using two priority queues, however I do not...
Yesterday, I saw this post from another user: Calculator with history I started refactoring the code while typing an answer but I end up not posting as an answer because I not sure if my implementation was good enough because of the difficulty I found to separate the concerns in that example. I created my own implemen...
For a Rust project I'm working on I needed a (simple) spellcheck algorithm and I set out to re-implement Peter Norvigs spellcheck algorithm in Rust. extern crate regex; use regex::Regex; use std::collections::HashMap; use std::collections::HashSet; use std::iter::FromIterator; use std::path::Path; use std::io::prelu...
I have a method to check if the Id exists in the data or not, for example: func (r *ReviewData) Exist() bool { // TODO : checking the shopID value is nil or not. // it is a good way to check the value before go to the execution query := fmt.Sprintf( ` SELECT 'x' FROM ...
I have created a Mitsubishi logo builder that takes input from the logo.txt file and uses those ints/chars to create however many logos that are identified in the logo.txt file. I just feel that my code is very repetitive and I would like to clean it up in terms of cutting it into separate methods instead of repeating ...
From the question and since I'm currently learning functional programming I was inspired to write the following (curried) function: def map_starts_with(pat_map): def map_string(t): pats = [pat for pat in pat_map.keys() if t.startswith(pat)] return pat_map.get(pats[0]) if len(pats) > 0 else 0 # ...
I've spent the last few weeks writing a Chip-8 emulator in zsh. It doesn't run in bash but the syntax is nearly identical. I have it on a GitHub repo here: https://github.com/hcorion/chipzsh a snapshot at the time of writing this is here. I believe I need to post the full code here. So here it goes. #! /usr/bin/env zsh...
The program is as following - import java.util.*; class ParkingLot { Scanner sc=new Scanner (System.in); int vno,hours; double fee; int input()//to take input { System.out.println("Enter vehicle no. - "); int vno=sc.nextInt(); System.out.println("Enter the hours -"); ...
I use the following code which is working as expected, but I want to use it in production. I'm not sure that this is clean code since I'm new to node.js. It would be great if I can get some example how can I write cleaner code. I mean how do I use the config to read the values, there is better way? How do I use the on...
I have implemented both some sorting algorithms (namely bubble sort and merge sort), as well as a command-line interface, in Clojure for fun and to test my Clojure abilities (I've tampered with Clojure for a while now, but I'm still quite a beginner). The code looks alright, but I think the styling of some parts of the...
Please review this code : #include <iostream> #include <fstream> using namespace std; int main() { float height[4]={17.5,8.4,2.9,7.9}; ofstream file; file.open("BINARY.DAT", ios::binary | ios::out); file.write((char*)&height, sizeof(height)); for(int i=0;i<4;i++) height[i]=1; file.close();...
I have my code which makes a web service call based on a type of request: public class Client { IRequest request; public Client(string requestType) { request = new EnrolmentRequest(); if (requestType == "Enrol") { request.DoEnrolment(); } else if (reques...
I'm C# programmer and started Python recently for a new project. This is a part of my project, and I want your opinion about my code and if it's clean or dirty, too long, has duplicate code, or it's good and standard. (cmd= command ... at the end of file is just for class testing) import xml.etree.ElementTree as ET #T...
I wrote the following code for a contest and worked fine for me. Could I make it a bit faster? #include<iostream> using namespace std; int power(int,int,int); int main(int argc,char** argv){ int base,exponent,mod; cin>>base>>exponent>>mod; cout<<power(base,exponent,mod)<<endl; return 0; } int power(i...
I have a method which works perfectly. It removes an element from an array. Now i would like to have a clean and simple code. private void removeUserFromGroup(baseClass[] member) { try { this.ExHandling = null; searchPathMultipleObject groupSearchPath = new searchPathMultipleObject(); gr...
I have vba code that loops through a large number of records and deletes rows based on criteria. The issue at hand is that it takes far too long to run. I have never actually let it finish because it takes so long (about five minutes puts it around row 700 out of ~250000). Basically, I need to loop through and see if c...
I have the following table structure: Tables stocktakebinline stocktakebinlinebatch A stocktakebinline has a one to many relationship with stocktakebinlinebatch. A line consists of many batches. Columns stocktakebinline lineid | reference -------+---------- 1 | Product A 2 | Product B 3 | Product C st...
This is very similar to other code I've posted, however this is designed for very large CSV files, for example 35GB. The files typically look like this: 9e77d54918dd25c3f9d2e5354ec86666,0,2015-10-01T14:14:15.000Z,45.0988,7.5811,, 9e77d54918dd25c3f9d2e5354ec86666,1,2015-10-01T14:17:15.000Z,45.0967,7.5793,, 9e77d54918dd...
I am creating a KotH (King of the Hill) challenge for Programming Puzzles and Code Golf. Other site users will write programs that play Texplode (a version of this game on a square grid). The program works, but I don't think it's anywhere near perfect; I don't often publish C programs so I rarely get any critique on th...
I have implemented a simple version of malloc() and its associated functions, free(), calloc(), and realloc(). When free() is called, my implementation simply puts this memory on its own internal free-list. When malloc() is called, it first checks the internal free-list. Only if the memory is not available there, it c...
This quick code I made is meant to be an easy-to-use, multi-purpose calculator. When I say "multi-purpose", then I mean that this calculator can do some more interesting functions like rounding numbers to the nearest one (which isn't that interesting, honestly). I was hoping to get some feedback or review on how my cod...
I'm writing a program that needs to be compatible for both Python 2.X and Python 3.X. My problem is that, because of the differences between these two versions, I'm duplicating code. try: ### Python 2.X part time.sleep(iterator.next()) if len(arguments) >= len(inspect.getargspec(task).args): ...
I have the following async ActionResult. public async Task<ActionResult> most_loved_pix() { var access_token = HttpContext.Items["access_token"].ToString(); if (!string.IsNullOrEmpty(access_token)) { Account account = new Account(); account.Cloud = ConfigurationManager.AppSettings["CloudNam...
I've never done concurrent programming before, but I've written one using go channels and RWMutex, but I'm not sure if my approach is idiomatic. I feel like it could all use channels (Maybe). The protocol is simple: Messages are delimited by '\n'. The first message client sends is it's name. The rest are normal message...
This is Knuth-Morris-Prat algorithm implementation to check if a pattern is present in a larger text, and if it does the algorithm returns the start index of that pattern, else -1. It starts off by computing Longest Common Prefix array, please refer LCP array, and uses that to efficiently avoid redundant pattern matchi...
I'm trying to write a concise linked list implementation in C and so far it looks pretty good. I'd like some pointers (pun) on how I can improve what I've got in terms of naming, consistency, efficiency, and anything else that's relevant. #include <stdio.h> #include <stdlib.h> typedef struct node { int data; st...
I have a pretty simple C# windows forms application working here. It is used for creating and running a Cubscout Pinewood Derby. You can create dens, assign them cars, generate a race schedule and then run races using an electronic timer and then view the race results. I've ended up with sort of a class that basicall...
I wrote this function which does the following from scratch w/o looking for ways that it is typically done: Accepts a char c to search for. Accepts a char* str to search within. Accepts a buffer pointer, and stores all indices of c that are in str inside the provided buffer. Returns the # of times that c was found in ...
I'm new to JS and have I made this snippet for practicing. Because I have no idea for JS conventions, I want some advice about that. function Queue() { this.list = new Array(); this.pop = function() { return this.list.pop() }; this.push = function(el) { this.list.unshift(el); }; ...
My implementation is only for study purposes, I agree that some of the features may be counter-intuitive. I guess the best method is to use a list in the STL library. Any improvements will be greatly appreciated. The following code compiles and works, If possible I would like the code reviewed in C++98, If not the clos...
I have not used C++ in quite a while and looking for advice/feedback, the code below implements the Marching Squares Algorithm which is detailed here. While the implementation appears correct and gives the same result as the example on the Wikipedia page, I think that some of the code could be improved and I'm looking ...
I want to use a simple implementation of the Karplus-Strong algorithm to generate pluck sounds and chords. My existing code seems correct but is slow when more than a few plucks are being generated. Is there a way to improve the performance of this. In particular is there a better way to use numpy here, or would someth...
I want to fill an array of complex numbers using a uniform generator. I thought up the next code. (Complex is a simple fixed-point complex data type.) std::generate(inputData.begin(), inputData.end(), []()-> Complex { static std::default_random_engine generator; static std::normal_distribution<double> distribut...
So I have tried the famous string permutation algorithm. Example for those who are not familiar with the algorithm: ABC -> ABC, ACB, BAC, BCA, CBA, CAB public static HashSet<String> stringPermutation(String s) { HashSet<String> perms = new HashSet<String>(); stringPermutation(s.toCharArray(), perms, 0); ret...
Inspired by this question I've come up with a solution of my own. The task is to find longest sequence of zeroes surrounded by ones in a binary representations of an integer (e.g. 1041 == 0b10000010001, thus the answer is 5). The task also requires the complexity of \$O(log(N))\$. As far as I understand it means that i...
Recently I wrote this class and it has a enum of all the interaction types a game item can have. What I want to know is, it seems a bit of a stretch to have a huge enum then that long switch, is there any way I can shorten it or improve it without changing it completely? namespace Sirius.Base.Game.Other.Items { pub...
There is a task to get the data from the database (tree) and translate them into Java. They must maintain their properties (each entry has parent and descendants). I'm taking data from database using Statement and ResultSet. The output is an arraylist of RowNode: public class RawNode { int id; int parentId; ...
The method below recursively checks if a string contains another string. Example: contains(hello, lo, 0) should return true, while contains(hello, eh, 0) should return false. The method itself works, but I was wondering how it could be made more efficient/generally better. Method: public static boolean contains(Strin...
I have had a problem with encoding in a project when trying to convert certain html code into image format. It happens when we receive html that has certain characters with accents and other non standard ones. To combat this I have the following method which finds all of the text inside html tags and then converts all ...
I have a CodeIgniter 3 application. There is some data every page across the application needs to have. This is the system I currently have. Create a model function that will get the data I need Class General_model extends CI_Model { function data_init() { $data['session'] = $this->session->userdata('se...
I have a flight class that looks like this: class Flight { public $id; // unique id public $structures = array(); // each "structure" indicates one fighter class assembled in this flight class public $dogfights = array() if the flight is dogfighting, this array holds the ID of each opposing flight we are dogfighting...
I am a total newbie when it comes to coding. I have been plugging away at getting my mind around Java for about a week. Background I have been sick for a while with symptoms that resemble some form of chronic fatigue, and my doctor handed me a flow chart that tells me how much activity I should do before taking an equa...
Today I tried to learn how to make a simple garbage collector for a future project, it didn't need to be fast nor complex nor optimal, it just needed to work. After lots of searching and reading, I was able to make something work. So, how can I improve it from here? At some point I guess I'll have to ditch the std::arr...
In a previous post at Simplifying complex setf expressions, @sds suggested using the get-setf-expansion macro for implementing place modification, as discussed in On Lisp (p171ff) by Paul Graham . In a related post at Destructive place-modifying operators, @acelent provides additional guidance. Based on their advice, I...
I've written a solution for the stable marriage problem in the case that the number of men is not equal to the number of women. My problem is not that I can't prove my code is right. The problem is I don't know the complexity of my algorithm. I've put some descriptions in the execution so that it becomes easy to unde...
I have a spreadsheet with seven tables (tbl_1, tbl_2, ..., tbl_7) each controlled by its own slicer. Each slicer has six buttons (10, 20, 30, 40, 50, 60) referring to Team Codes. I use the code below to select one team on every slicer, then create a PDF for each team / slicer setting. As of now, the code takes anywher...
I'm interested in making an animated movie of a zoom in on a part of the Mandelbrot set. My code works well for a few zooms, but upon trying to zoom in quite far, I find that the fractal becomes "smoothed out". Am I missing something that prevents me from seeing the fractal structure at higher zoom levels? Am I hitt...
I found this question on leetcode and that was my answer ... But someone told me it's too bad that it takes \$O(n^3)\$ I am not sure that it takes all that time ... and trying to find better understandable Javascript solution. Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine i...
Cassandra, when debugging is enabled, logs slow queries to the debug log file. Typical entries look like: DEBUG [ScheduledTasks:1] 2017-02-16 18:58:44,342 MonitoringTask.java:572 - 4 operations were slow in the last 5010 msecs: <SELECT FROM foo.bar WHERE token(id) > token(9be90fe7-9a6d-45d5-ad11-e93cfd56def7) LIMIT 10...
Following is the objective C code snippet to check that the 6-digit number is not repeated and not in sequence/reverse-sequence. I have just printed the proper messages in NSLog that user should be allowed or not: NSError *error = nil; NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"(...
I was looking up some coding challenges and this looked like a fun one to solve. I tested it with the following values and it seems to work for those at least: [ 5, 7, 8, 9, 11, 2, 3 ] [ 5, 7, 1, 4] [ 5, 7, 8, 1, 5] [ 5, 1, 2, 3, 5] [ 5, 5, 5] [ 1 ] [ 1, 2 ] [ 2, 1 ] My solution was to implement a binary search to tr...
I wrote a simple Rock, Paper Scissors game in Python for class. As a beginner, I would like some input as to how I could abstract or make my code smoother. I feel like the repeated use of if or elif statements are overbearing. I would like any tips or advice, or perhaps a different method of approach. import random use...
I have a data synchronisation operation that is observing a database. This is a fairly key piece of code for the system, so I want to make sure I handle the concurrency correctly. The problem The operation manipulates sync state flags in the database and should have zero concurrency The operation must be cancellable ...
The idea is to implement the observer pattern, with a separate notification method for each observed property of the observed object. Let me start with a simplified use case: class Point { val observers: ObserverSet<PointObserver>() val x by observers.observe(0f, PointObserver::xChanged) val y by observers....
I'm creating a rectangular prism function, whose output looks like this: I think that this code can be improved by optimizing the use of np.meshgrid with a Python iterator, but I can't wrap my head around it. It might also be possible to do this with fewer plotting calls, but I can't figure that out either. Ideally, I...
I am just learning how to use go and I'm a bit confused on how my code is supposed to be organised package wise. Am I right to have the user package? I'm planning to redirect my /user/ routes to a handler in this package but I'm unsure if this is the go way to do things My directory structure is /go_rest_api /user ...