• Breaking News

    Sunday, December 20, 2020

    How do you guys deal with total loss of confidence? Ask Programming

    How do you guys deal with total loss of confidence? Ask Programming


    How do you guys deal with total loss of confidence?

    Posted: 20 Dec 2020 03:39 PM PST

    I've realized recently that I'm losing a lot of productivity to what I'd describe as a 'total loss of confidence' in my ability to solve problems well. The short background is that I've recently joined a new team (sort of - it's my old team, but with entirely new people in it), and I'm finding it basically impossible to push changes past them without significant reworks as a result of code review. They'll almost always find "better ways" of doing things I spent serious critical and creative thinking time on, along with your normal nit-picks. I'm now finding that my changes are getting pushed out more slowly because I'm basically doubling latency sitting around second-guessing all of my work. And it ends up not mattering anyway - my work is still cut to pieces in review.

    I've not really experienced this before, even when I was fresh out of the box. I've had a few problematic changesets that got torn apart and I had to redo, but not...like...all of them, and not to the extent that I'm starting to shut down productively.

    Anyone experienced this before? If so, how did you deal?

    submitted by /u/skinnyfatchampion
    [link] [comments]

    I tried to print a pascal triangle using a 2d array instead of 1d array like this, what went wrong?

    Posted: 20 Dec 2020 10:27 PM PST

    https://ibb.co/rHr8mNW

    #include<stdio.h> #include<stdlib.h> void binomial2d(int n){ int arr[n+1][n+1]; int i,j; for(i=0;i<n+1;i++){ for(j=1;j<n+1;j++){ arr[i][j]=0; } arr[i][0]=1; } for(i=0;i<n+1;i++){ for(j=1;j<n+1;j++){ arr[i][j]=arr[i-1][j]+arr[i-1][j-1]; if(arr[i][j]==0){ printf("\n"); break; } printf("%d ",arr[i][j]); } } } int main(){ binomial2d(7); } 
    submitted by /u/JacksonSteel
    [link] [comments]

    If Camels didn't existed, what would be the name of the "CamelCase" convention?

    Posted: 20 Dec 2020 03:03 AM PST

    What's the fastest way to get used to a new code base?

    Posted: 20 Dec 2020 09:57 AM PST

    Is jQuery a framework?

    Posted: 20 Dec 2020 10:28 PM PST

    This might be a stupid question, but I have been wanting to learn a new web-framework to round out my resume. While researching I found this article which shows jQuery as the most popular web framework https://insights.stackoverflow.com/survey/2020#technology-web-frameworks-professional-developers2

    Having written Django applications, and Rails applications, and used frontend jQuery (basically as an easier to write version of javascript) I have no idea how these are even in the same category. From my experience jQuery is entirely frontend and I couldn't find anything online which showed different. Does jQuery have its own web-framework, or is the article misleading? I am familiar with node.js, but I would assume that they would have just put "node.js" rather than jQuery

    submitted by /u/claymazing
    [link] [comments]

    What language should I learn to make a website like fiverr?

    Posted: 20 Dec 2020 10:22 PM PST

    Help in differentiating string. Getting different sha256 hashes.

    Posted: 20 Dec 2020 11:00 AM PST

    According to this website https://armantheparman.com/bitcoin-seed-with-dice/ . The following should output 845fb089a63394b6f1c0b7f1b9bdc7e1b3cc61d7fefc158c916a609a80afc56b ``` echo 1110010011111100111000010111111101010100101000010010000010111001110010001010111011001010001000001010111110010100110001010111011001011010100010101001001101101110101010101101100100010011111011110001101100111001101000011101101110100000101000000011001000010101 | shasum -a 256 -0

    On cygwin the exact command outputs 8d5bd7b4465e582e2cc6f6f90d264bb9860dee4cd7655a7da1292a98002a0a10

    Running the python equivalent gave the same result as the website. What gives ? Thanks!

    submitted by /u/Automataton
    [link] [comments]

    Is compressing video for server upload a front-end or backend task?

    Posted: 20 Dec 2020 10:04 PM PST

    I'll try to keep this short.

    So I'm an engineering student and I took up a part time job for a start-up. Each sprint, I was given a mock-up and told to code it... That's all. In the app there's a function that records video, because my job is to code a UI, all I did was get the screen to display the camera with the relevant buttons to take a video.

    In the last sprint I did, the guy I'm working under is now vaguely telling me that I must record and compress the video for file upload. Apart from this being not in my job description which was code a UI for front end. I'm really confused to how videos are uploaded to servers of social networks: If you fully decompress a video, thats costly on the phone which slows down the uploading process even more since you'll still have to upload it. If you send the video's raw as chunks, it consumes more network data.

    So my question is professionally, how is video uploading done? And is my superior right to give me this task if I was hired to only code the UI.

    If possible, I'd appreciate some resources.

    submitted by /u/famous_bread
    [link] [comments]

    Best Language Combination to Create an Education Platform

    Posted: 20 Dec 2020 06:07 PM PST

    Hi all. I'm a teacher currently interested in building my own platform based around a curriculum of my design. I'd like to include portions for media display and submission, games (C# ideally), and interactive tutorials. Later down the line I'd like to have this platform accessible from both desktop and mobile. I have the content, just need to put the platform together. Would appreciate any suggestions or guidance on where to begin.

    submitted by /u/SeymourJFry
    [link] [comments]

    Suggestions for Markdown/Notes Application

    Posted: 20 Dec 2020 09:18 PM PST

    I'm trying to find a good tool to organize my notes. I really like markdown notation but I'm open to anything similarly easy. I wanted to write my own, but I just don't have the time/energy to do it. I have 3 options, but I wanted to see if anyone has experience with any of them or has other suggestions.

    Found Solutions:

    1. VS Code
    2. StackEdit
    3. Dillinger.io

    I'd like cloud sync options for personal stuff as well as local storage for my work.

    submitted by /u/ENSainETY
    [link] [comments]

    Help With My Javascript Project

    Posted: 20 Dec 2020 01:21 PM PST

    Looking for some help on my project.

    What I am trying to achieve is a local storage for any entries made into either the expense or income lists. I tried doing it after googling and researching but it doesn't seem to be working. Any help and advice is appreciated.

    I'm going to include the codepen link for easy viewing. https://codepen.io/dustin-mcleod/pen/oNzNKgv

    submitted by /u/Dustin-do-da-thang
    [link] [comments]

    How do I deal when a freelance job has significant unecessary extra layers to do something simple?

    Posted: 20 Dec 2020 06:34 PM PST

    Please help me understand this as i'm literally losing my mind. Sorry for the possible angst tone in here, i have to admit i need to vent a bit. Let me explain:
    I've worked as a website dev for over 11 years. But here's the thing, most of them were only inside the same company so i have this "bubble" knowledge that makes me have a hard time when a website is like an amalgamation of technologies that were created "last month" and everyone expect you to understand it completely.

    Example 1:
    - Request: Make this contact form work with SMTP connection.
    Easy peasy, right? Specially considering it's PHP and running under Wordpress so you can easily throw a SMTP plugin or lib in there and use wp_mail().

    But hey, no. The form is made under a VERY NEW constructor that works in the same style of Elementor (but nowhere as simple to use) and also the smtp server has some weird way to connect to it, like extra crypto information that they didn't even give me full information no matter how much i asked. Also the form also is dependant on angular (for some fucking reason) to generate the fields, while the fields could be generated by the constructor itself or i dunno, plain HTML???

    Then i'm obliged to deny this job because of the amalgamation of unecessary stuff it's put inside of it. Oh and no, i'm not allowed to make a new one.

    Example 2:
    - Request: We need a dashboard that will connect to our API and make specific requests (simple stuff like requesting users and their info, y'know, the usual stuff)

    But hey, no. the API can't be called directly, no. you need to connect to another server that will instead make SUPER ULTRA DUPER SECURE CONNECTION to the right api, and they use different commands, which you need to translate and send both (i know i'm starting not to make sense here. sorry i'm just tired) And in other words, they want me to work with a PUBLIC API that you CANNOT send requests to it because it's "insecure". IT'S A PUBLIC API. ANYBODY AND THEIR MOM CAN SEND REQUESTS. They just won't LET me even though anyone COULD if they wanted to.

    So this is what's making me go insane. WHY a lot of people decided to make simple things, harder? For no reason? A fucking SMTP contact form shouldn't take more than 30 minutes to setup, html and css included! Yet i butt my head over 3 hours in there and had to give up!
    Corona made me lose my old job and i'm crazily searching for freelance jobs so i could pay my bills but this whole year has been this constant hell for me: of each 10 jobs i pick, i can do like 2 or 3. Why are stuff propositally being made to be harder? Is there anything i'm not catching on? Please help me understand what i'm doing wrong.

    submitted by /u/hamolive
    [link] [comments]

    Operational Error while running unit tests Django

    Posted: 20 Dec 2020 02:14 PM PST

    I have dockerized my Django app together with my postgres Database. However after the dockerization, the unit tests that i have written (not the SimpleTestCase but the TestCase ones) stopped running.

    I thought it could be because of the new db so I modifies the setting for the tests to run with the default DJango db:

    import sys

    if 'test' in sys.argv:

    DATABASES = {

    'default': {

    'ENGINE': 'django.db.backends.sqlite3',

    'NAME': BASE_DIR / 'db.sqlite3'

    }

    }

    else:

    DATABASES = {

    'default': {

    'ENGINE': 'django.db.backends.postgresql',

    'NAME': 'postgres',

    'USER': 'postgres',

    'PASSWORD': 'postgres',

    'HOST': 'db',

    'PORT': 5432,

    }

    }

    Still, I get the following error:

    Creating test database for alias 'default'...

    Traceback (most recent call last):

    File ".../.local/lib/python3.8/site-packages/django/db/backends/utils.py", line 82, in _execute

    return self.cursor.execute(sql)

    File ".../.local/lib/python3.8/site-packages/django/db/backends/sqlite3/base.py", line 411, in execute

    return Database.Cursor.execute(self, query)

    sqlite3.OperationalError: near "[1]": syntax error

    Any ideas what might be the problem and how it can be fixed?

    submitted by /u/alikakimikro
    [link] [comments]

    Why nothing comes out when there's supposed to be a chart?

    Posted: 20 Dec 2020 05:56 PM PST

    my code problem:

    this code only lets me input one command then jumps out of the loop without even inputting 'quit'

    ------------------------------------------------------------------------------------------------------------------------------------------

    The problem is to parse a series of commands that instruct a robot arm on how to manipulate blocks that lie on a flat table. Initially, there are n blocks on the table (numbered from 0 to n − 1) with block bi adjacent to block bi+1 for all 0 ≤ i < n − 1 as shown in the diagram below:

    https://ibb.co/WpWQBYT

    The valid commands for the robot arm that manipulates blocks are:

    • move a onto b

    where a and b are block numbers, puts block a onto block b after returning any blocks that are stacked on top of blocks a and b to their initial positions.

    • move a over b

    puts block a onto the top of the stack containing block b, after returning any blocks that are stacked on top of block a to their initial positions.

    • pile a onto b

    moves the pile of blocks consisting of block a, and any blocks that are stacked above block a, onto block b. All blocks on top of block b are moved to their initial positions prior to the pile taking place. The blocks stacked above block a retain their order when moved.

    • pile a over b

    puts the pile of blocks consisting of block a, and any blocks that are stacked above block a, onto the top of the stack containing block b. The blocks stacked above block a retain their original order when moved.

    • quit

    terminates manipulations in the block world. Any command in which a = b or in which a and b are in the same stack of blocks is an illegal command. All illegal commands should be ignored and should have no effect on the configuration of blocks.

    Input:

    https://ibb.co/pWJ9c7Q

    Output:

    https://ibb.co/Nt03mm3

    [I only type the code of the first command for now.]

    my code:

    #include<stdio.h> #include<string.h> int main(){ int noi=0; printf("please input n:"); int n; scanf(" %d",&n); int arr[n][n]; int i,j; for(i=0;i<n;i++){ for(j=0;j<n;j++){ arr[i][j]=-1; } arr[i][0]=i; } char str1[5],str2[5]; int s,d; while(strcmp(str1,"quit")!=0){ s=0; d=0; while(!(s>=1&&s<=n&&d>=1&&d<=n)){ scanf(" %s %d %s %d",str1,&s,str2,&d); } if(strcmp(str1,"move")==0){ if(strcmp(str2,"onto"==0)){ //empty s for(i=0;i<n&&arr[s][i]!=-1;i++){ arr[arr[s][i]][0]=arr[s][i]; arr[s][i]=-1; } //empty d for(i=0;i<n&&arr[d][i]!=-1;i++){ arr[arr[d][i]][0]=arr[d][i]; arr[d][i]=-1; } //now move s to d i=1; while(arr[d][i]!=-1){ i++; } arr[d][i]=arr[s][0]; arr[s][0]=-1; }else if(strcmp(str2,"over")==0){ }else{ continue; } }else if(strcmp(str2,"pile")==0){ }else{ continue; } } //print results for(i=0;i<n;i++){ printf("%d:",i); for(j=0;j<n&&arr[i][j]!=-1;j++){ printf("%d ",arr[i][j]); } printf("\n"); } } 
    submitted by /u/JacksonSteel
    [link] [comments]

    Career Advice Round Two

    Posted: 20 Dec 2020 02:04 PM PST

    I really enjoy programming and have done it as a hobby all my life. I'm wondering if you guys could suggest some coding careers that I could look into. Preferably I would like to do minimal schooling or a coding boot camp and I would like to work from home. So far all that's been recommended to me is back-end development. Any other suggestion? Thanks!

    submitted by /u/Eithman1
    [link] [comments]

    What is a two stage neural network

    Posted: 20 Dec 2020 09:24 AM PST

    What does it mean that a neural network has two stages? I saw an example on github where he trained a stage and then used the first stage to trian the second stage.

    This is the place in the repo: https://github.com/ottokart/punctuator2#usage

    submitted by /u/bjernie
    [link] [comments]

    How to find the number of possible enclosing rectangles for a given list of points?

    Posted: 20 Dec 2020 12:22 PM PST

    The only way I know how to do this is to test every possible subset and see if its a valid rectangle (there aren't any points inside it that aren't in the current subset being tested). This takes way too long (N*2^N). Is there any other way to do this quicker?

    submitted by /u/No_Flamingo9613
    [link] [comments]

    How to handle multiple streams simultaneously

    Posted: 20 Dec 2020 07:12 AM PST

    I'm designing a website that should handle video streaming from multiple devices through same user at the same time, but I need to limit the number of simultaneous streams like Disney Hotstar or Netflix does, but also have flexibility for as many devices to be logged in (like more than 5 like Netflix). For now I send the url to the resource to be streamed.

    I'm using JWT authentication and refresh tokens if that helps

    I want to know what are the approaches to solve this problem. What are Industry practices that should be learn, please guide a new developer with your experience.

    submitted by /u/YouKnowWhoIAmD
    [link] [comments]

    Get id from path variable url Django

    Posted: 20 Dec 2020 02:38 PM PST

    I want my end-point to be like ``` api/units/:id``` so to pass the id as path variable

    I have writen the following code

    urlpatterns: path('api/units/', UnitDetailsView.as_view()) 

    views.py

    class UnitDetailsView(APIView): http_method_names = ['get'] permission_classes = (permissions.AllowAny,) serializer_class = UnitDetailsSerializer def get(self, request, id_unit): unit = Unit.objects.get(id=id_unit) return JsonResponse({ 'id': unit.id, }, status=200) 

    However is het a 500 error, because it doesnt recognise the path variable as the id_unit

    TypeError: get() missing 1 required positional argument: 'id_unit' 

    What is the error and how could i fix it?

    submitted by /u/alikakimikro
    [link] [comments]

    Prime Factorization of Integers In a Text File

    Posted: 20 Dec 2020 07:49 AM PST

    I have a text file with a million integers, each in a new line. For each of these integers, I need to resolve them into their prime factors and exponents. For instance, an integer like 100 should be resolved to 2^2x5^2. I have written the following (poor) code in Java but it just doesn't work as it should. That is, it only reads the first line of the text file and even then, if that integer is an odd number, it doesn't output anything. If it is an even number it only outputs 2^(exponent count). For instance, 100,000,000 returns 2^8. That's it, which is obviously incorrect. Please help. You can write your own version in a language you are familiar with.

    package PrimeFact;

    import java.math.*;

    import java.io.File;

    import java.io.FileNotFoundException;

    import java.util.Scanner;

    public class PrimeFact{

    public static void main(String[] args) throws FileNotFoundException {

    try {

    File myObj = new File("C:\\Users\\mugah\\Desktop\\hello.txt");

    Scanner myReader = new Scanner(myObj);

    while (myReader.hasNextLine()) {

    String data = myReader.nextLine();

    BigInteger number = new BigInteger(data);

    int i = 2;

    BigInteger newi = BigInteger.valueOf(i);

    for (i = 2;

    (newi.compareTo(number) == 0 || newi.compareTo(number) == -1); i++) {

    int count = 0;

    while (number.mod(newi).compareTo(BigInteger.ZERO) == 0) {

    number = number.divide(newi);

    count++;

    }

    if (count == 0) continue;

    System.out.print(i + "**" + count + ".");

    }

    }

    myReader.close();

    } catch (FileNotFoundException e) {

    System.out.println("An error occurred.");

    e.printStackTrace();

    }

    }

    }

    Thank you. That will be all.

    submitted by /u/Friendly_Praline3624
    [link] [comments]

    Need Advice on 3d Modelling

    Posted: 20 Dec 2020 11:39 AM PST

    Hi everyone!

    I need to build a 3D model of ball movements. Basically you shoot a ball into a room (from different directions) and see it bounce around according to the objects in the room and friction from the air. The ball needs to be in continuous movement until it stops.

    The goal is to run this many times in different conditions to collect stats. Graphics are not important but the model needs to be fast.

    I would love to develop an easy engine in Python, does anyone have suggestions on how I can get started? What to learn first?

    I am not a CS major but I am familiar with Python and R.

    Any comment is appreciated, thanks a lot!

    submitted by /u/Ohshibbal
    [link] [comments]

    n = int(input().strip())

    Posted: 20 Dec 2020 10:27 AM PST

    I noticed that a ton of competitive program problem answers start with this line. I understand what the code is doing, but I don't understand why it is used, when most of the time the method takes an array or list as an argument anyway, for the problems on hackerrank anyway. What is the point of this?

    submitted by /u/FreakOfNature13
    [link] [comments]

    Competitive Programming Advice

    Posted: 20 Dec 2020 09:54 AM PST

    I am a high school junior looking to dive into competitive programming. Any discord servers or people that are willing to talk out problems or help me learn the ropes?

    submitted by /u/FreakOfNature13
    [link] [comments]

    What's the difference between a Framework and a Plugin in programming?

    Posted: 20 Dec 2020 09:36 AM PST

    I thought they were the same thing but I'm learning about FeathersJS from this video https://www.youtube.com/watch?v=eXnKKnaoA08 and they said FeathersJS has a lot of plugins.

    Thank you!

    submitted by /u/MattPilkerson
    [link] [comments]

    No comments:

    Post a Comment