• Breaking News

    Wednesday, January 6, 2021

    Should I Go to Collage? Ask Programming

    Should I Go to Collage? Ask Programming


    Should I Go to Collage?

    Posted: 06 Jan 2021 06:31 PM PST

    So I live in Serbia now and I wanted to become game/software developer, I am now 14 years old and I know C# language. I'm already building a game with my friend and we are doing quite well, I already know I'm going to become a programmer. I wanted after high school to get some money and go to the world, work somewhere to get my experience and later in life build my own company. My brother is saying that I should finish college first, and that I'm nothing without it. I was wondering if

    I can do things my way and if they will accept me with just high school, and if I can get any advice.

    Please say if this isn't sub to ask this or if I'm somewhere wrong

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

    Should I try for a computer science degree?

    Posted: 06 Jan 2021 04:08 AM PST

    I'm a 37 year old with a BA in history and I'm looking to move into computer programming. I've been studying web development but I am also very interested in iOS development.I've done html and css and now I am working on JavaScript. Currently I'm self teaching. The thing is, I'm not the best self motivator and I was thinking about going back to get a computer science degree. Then I would have accountability and I've done a degree before so I know I can complete a degree, although I know cs is very different from history. Plus, I know that some jobs won't even consider you unless you have a cs degree. My main concern is that while I did fine (As and Bs) on the math I had to take before, it's my weakest subject by far. I even have a learning disability similar to dyslexia called dyscalculia. It's basically dyslexia for math. So the math requirements worry me. Would you say that a computer science degree is doable for someone who struggles with math, or should I stick to the self taught rout? Below is the course requirements for a cs degree at my local university. I have googled this, and searched this subreddit, but I haven't really found the answer yet to my question.

    https://www.memphis.edu/cs/pdfs/forms_ug_flowchart_general_f19.pdf

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

    Help splitting strings in lua

    Posted: 06 Jan 2021 04:55 PM PST

    So I have a function that let's me split strings by spaces,

    API.splitSTR = function(str) local data = {}; for piece in string.gmatch(str, "%S+") do data[#data+1] = piece; end; return data; end; 

    the problem is, for what I'm doing I need it split in a more complex way, I need it split by spaces except for strings (both " and '), strings would include the whole thing in the array of pieces, for example

    splitSTR('This is "an example" string');

    the array should be as follows {'This', 'is', 'an example', 'string'}.

    So I was going to use this function initially and iterate through it to rebuild the strings and re-write the array, since the pieces would include the "s and 's after being split by space, the problem is this doesn't fully split by space, if it did split by space then splitSTR('test test') would return {'test', '', 'test'} as there's two spaces, but it doesn't include empty whitespace in the array so properly reconstructing strings with multiple spaces inside of them is simply impossible.

    If anyone can provide a lua function or help me that does this in a quick, compact, and concise manner it'd be greatly appreciated, what I need specifically is having an array split by spaces except for strings made with " and ', I'd also like the '\' character to nullify strings inside of strings so having "\"" would be valid and "\\" would be a normal backslash if possible (obviously when creating a string in lua you'd need an extra backslash as it has it's own formatting, I'm talking about the already created contents of said string when being inputted into the function)

    Splitting/tokenizing strings in specific ways has always been a pain for me, if anyone knows of a library that can do these things with ease, I'm all ears, thanks.

    contents = splitSTR("This is an example '\\\'string, an example string.'"); -- in lua "\\\'" turns into "\'" for _, piece in next, contents do print(piece); end; --should yield this This is an example 'string, an example string. 
    submitted by /u/xTynini
    [link] [comments]

    I can’t start coding or it won’t let me.

    Posted: 06 Jan 2021 09:59 PM PST

    (I'm using unity 2020)So I'm new to coding, I followed guides on YouTube and the very first problem I ran into was being able to actually start coding. I made the c# folder but every time I double click it brings me to downloads and has me download and save the folder. Nothing opens up where I can start coding. Hopefully this makes sense I'm using dell computer and it runs on windows.

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

    Is this subreddit good for asking questions about what programming tools I need to create a certain program that does certain things? If not, where's a good place to ask?

    Posted: 06 Jan 2021 05:55 PM PST

    The issue with this subreddit and a lot of other programming subreddits is that you cannot post images, and I don't know how to describe what I want to create without images.

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

    I gonna make pip-boy with rasberry pi model A+ which programming language u recommend

    Posted: 06 Jan 2021 08:29 PM PST

    I am new.

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

    C++ How to check if a hand in 3 card poker is a straight?

    Posted: 06 Jan 2021 08:10 PM PST

    I am stuck on how to check if this hand contains a straight. The reason being is that the card number, is a string. I can't compare value because there is 5 different 10's.

    Code below is just to show what a card and a deck is made of.

    struct PlayingCard { string cardNumber; string cardSuit; int cardValue; }; vector<PlayingCard> createDeck(vector<PlayingCard> playingDeck) { string cardFaces[13] = {"TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT", "NINE", "TEN", "JACK", "QUEEN", "KING", "ACE"}; string cardSuits[4] = {"HEARTS", "DIAMONDS", "SPADES", "CLUBS"}; int cardValues[13] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10, 11}; int suitCounter = 0; // Creates Deck for (int i=0; i < 52; i++) { playingDeck.push_back(PlayingCard()); playingDeck[i].cardNumber = cardFaces[i % 13]; playingDeck[i].cardSuit = cardSuits[suitCounter]; playingDeck[i].cardValue = cardValues[i % 13]; if ((i+1) % 13 == 0) { suitCounter = suitCounter + 1; } } return playingDeck; } vector<PlayingCard> shuffleDeck(vector<PlayingCard> playingDeck) { srand(time(NULL)); // Shuffles Deck for (int original = 0; original < 52; original++) { int r = rand() % 52; PlayingCard tempDeck[52]; tempDeck[original] = playingDeck[original]; playingDeck[original] = playingDeck[r]; playingDeck[r] = tempDeck[original]; } return playingDeck; } 

    The code below is my 3 card poker function which is where the issue is.

    int threeCardGame(int betAmount, int userBalance) { int menuChoice; bool gameLoop; int anteBet; int playOrFold; int pairPlusBet; int sixCardBet; int handRank; cout << "Welcome to the Three Card Poker Game" << endl; cout << "Enter 1 to play" << endl; cout << "Enter 2 for pay table a rules" << endl; cin >> menuChoice; if(menuChoice == 1) { gameLoop = true; } if(menuChoice == 2) { } while (gameLoop) { vector<PlayingCard> playingDeck; playingDeck = createDeck(playingDeck); playingDeck = shuffleDeck(playingDeck); vector<PlayingCard> dealerHand; vector<PlayingCard> userHand; cardDraw(userHand, playingDeck); cardDraw(userHand, playingDeck); cardDraw(userHand, playingDeck); cardDraw(dealerHand, playingDeck); cardDraw(dealerHand, playingDeck); cardDraw(dealerHand, playingDeck); getValidBet(anteBet, userBalance); for (int i=0; i < userHand.size(); i++) { cout << userHand[i].cardNumber << " of " << userHand[i].cardSuit << " Value: " << userHand[i].cardValue << endl; } // Dealer Hand for (int i=0; i < userHand.size(); i++) { cout << "[HIDDEN]" << endl; } cout << "Enter 1 to play " << endl; cout << "Enter 2 to fold " << endl; cin >> playOrFold; if (playOrFold == 1) { if (userHand[0].cardNumber == userHand [1].cardNumber || userHand[0].cardNumber == userHand [2].cardNumber || userHand[1].cardNumber == userHand [2].cardNumber) { handRank = 1; } if (userHand[0].cardNumber == userHand [1].cardNumber && userHand[0].cardNumber == userHand [2].cardNumber) { handRank = 2; } if(userHand[]) } } } 
    submitted by /u/Nickt1596
    [link] [comments]

    How to backspace(delete a char) in a file in c?

    Posted: 06 Jan 2021 07:13 PM PST

    Interactive python course that goes past basic syntax?

    Posted: 06 Jan 2021 09:24 AM PST

    I just completed the Python 3 course on codeacademy. I thought it was fine for learning some basic syntax, but at the end of it I'm still left completely baffled about how to complete a proper program or application. For instance, when I look at a program repository I have zero idea about what the majority of files in the folders do, why they are there, what they were written for etc. etc. So can anyone recommend a good course (ideally an online interactive one) which covers the more practical applications of python programming beyond just the language syntax? Thanks

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

    Small business finance program

    Posted: 06 Jan 2021 03:19 PM PST

    I found myself in the need to make a small accounting program to manage my family's business. A relatively small amount of products and we dont fall in the "real finance %" or smth, so by law i dont need to pay an accountant. Does anyone have any good intel on making one of those or is it not worth trying?

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

    Java - Remove element from array?

    Posted: 06 Jan 2021 02:56 PM PST

    I'm trying to make a method removeDog that looks like this at the moment, (which is wrong):

     public void removeDog(Dog d) { Dog[] copyOfArr = Arrays.copyOf(dogsOwned, dogsOwned.length - 1); for (int i = 0; i < dogsOwned.length; i++) { if (!dogsOwned[i].equals(d)) { copyOfArr[i] = dogsOwned[i]; dogsOwned = copyOfArr; } } } 

    I have an array "private Dog[] dogsOwned = new Dog[0];". I want to call this method, removeDog, from another method in another class. I want to remove the dog.. How can I do this?

    Edit: I am aware that ArrayLists are recommended, I'd love to use it but I'm not allowed to :(

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

    C++ Client-Server Should I send raw bytes or encoded bytes?

    Posted: 06 Jan 2021 11:52 AM PST

    Disregarding encryption for a second.

    Message "Hello" as an example:

    Should I send

    Bytes: (48 65 6c 6c 6f 00) ASCII for reference: "Hello." size = 6 bytes

    Or

    Bytes: (5c 78 34 38 5c 78 36 35 5c 78 36 43 5c 78 36 43 5c 78 36 46) ASCII for reference: "\x48\x65\x6C\x6C\x6F" size = 20 bytes

    (Using HexEncoder() from Cryptopp to encode)

    Given 2 things:

    1- The server is Django python which means the second one is a ready python bytearray which makes it easier.

    2- I will use the same method to send literally everything (strings, files etc...)

    I'm assuming this is a known problem in computer science? along with little endian and big endian?!

    Any enlightenment about these 2 things would be appreciated. Also I need some keywords for me to google the thing.

    Thank you for reading

    Cheers

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

    Sorting a 2D Array In Java

    Posted: 06 Jan 2021 05:34 AM PST

    I'm working on a problem which is stated as follows:-

    Responses given by 8 students for 10 Multiple Choice Questions is given in the form of a 2D Array. Answer keys for those 10 questions is given in the form of 1D array. Calculate the number of correct responses given by each student & show them in descending order of number of correct responses.

    So let's say that choices selected by 8 students for 10 questions is given as a 2D array:-

    char[][] answers = { {'A', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A', 'D'}, {'D', 'B', 'A', 'B', 'C', 'A', 'E', 'E', 'A', 'D'}, {'E', 'D', 'D', 'A', 'C', 'B', 'E', 'E', 'A', 'D'}, {'C', 'B', 'A', 'E', 'D', 'C', 'E', 'E', 'A', 'D'}, {'A', 'B', 'D', 'C', 'C', 'D', 'E', 'E', 'A', 'D'}, {'B', 'B', 'E', 'C', 'C', 'D', 'E', 'E', 'A', 'D'}, {'B', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A', 'D'}, {'E', 'B', 'E', 'C', 'C', 'D', 'E', 'E', 'A', 'D'}, }; 

    And answer key for each question is given as this 1D array:-

    char[] answerKeys = {'D', 'B', 'D', 'C', 'C', 'D', 'A', 'E', 'A', 'D'}; 

    My approach: Loop through the answers matrix & compare answers given by a student with answers in answerKeys & store the student index & number of correct responses by that student in a 2d list named finalList. Now sort finalList using selection sort on the basis of number of correct responses.

    You can find my implementation here.

    But this doesn't produce result in descending sorted order. So I need help to figure out why my output is not right.

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

    I wiped my laptop while trying to install Ubuntu, can it be saved?

    Posted: 06 Jan 2021 11:09 AM PST

    I have a Dell Latitude E5540 that USED to have windows 10 home edition on it. I decided I wanted to start fresh, as I bought a decent desktop set up for day to day use and now had this old spare laptop to screw around with. I used RUFUS to format a 64gb sandisk thumbdrive for a boot install, chose NOT to partition anything and just have Ubuntu wipe the hard drive and install itself clean, waited to pull the stick until the installer was finished, and now it wont even boot it judt gives me "Invalid partition table!" And if I press any key it says "No Boot Device Found. Press any key to reboot the machine_"

    TLDR: Laptop wont boot, gives two errors "Invalid Partition table!" And "No Boot Device Found. Press any key to reboot the machine_" Is it bricked or can I save it and if so how?

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

    Java - 10 equals 55 to 5+5 equals 10?

    Posted: 06 Jan 2021 10:32 AM PST

    int a = 5;

    System.out.println( a + a + " equals" + a + a );'

    This prints: 10 equals 55

    How to make it print 5+5 equals 10?

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

    Help with a portal for webinars for a job

    Posted: 06 Jan 2021 09:45 AM PST

    Hi! I landed a job where no one knows anything about anything and they're a CPA sending sensitive information via email. They want me to set up a customer portal where the customer can login and submit or receieve documents pertaining to their account. Obviously this is a huge project and I can't do it myself, but can anyone point me in the direction of some paid software that will do this? The option they gave me was $1200 a month. Too expensive, imo.

    The main context of my job is going to be uploading 'webinars' that can be used for required credits for people selling insurance that the state/federal entities require them to do 40 hours of a year. Currently, they run their website off godaddy, which does have an online shop, but I can't think of any way to verify they've watched the content other than perhaps sending them a private youtube link automatically each time they pay us through godaddy's online sales portal? Or, is it possible that the above customer portal could also be utilized here somehow?

    I just graduated in Dec and appreciate any help, I'm totally lost as to where to even start looking for a customer portal that can do this and won't cost $1200 a month + setup.

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

    Question: What are the Pros and Cons of Different Programming Languages?

    Posted: 06 Jan 2021 08:52 AM PST

    I've been learning the language of C++ at my university. It's the language I'm the most comfortable with using as my standard programming language. However, outside of university, I've been teaching myself how to use C#, Java, Python, MATLAB, R, JavaScript, etc.

    What are the pros and cons of programming languages such as C++, C#, Java, Python, JavaScript, etc.? Additionally, what is each programming language generally used for?

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

    Email Recovery

    Posted: 06 Jan 2021 08:42 AM PST

    Hello i just started learning Python, and i thought a good project would be to recover an email i lost a few months ago. I remember the password, and most of the username, but i cant get in and i didn't put in place any of the recovery options. So the question is, can a program be coded to ask gmail servers if that base username is in their database, and if not, then try with a slightly different username, something like [baseusernamexx], until it finds one and then return it to me? If the answer is yes, please point me in the right direction. Thank you.

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

    Structure a bonus for developers?

    Posted: 06 Jan 2021 07:17 AM PST

    Hello,

    I own a small software company and employ a handful of developers. I'm trying to figure out a way to incentivize the developers, as most of them are (hourly) contract devs so they rarely take initiative to ask the important questions that aren't on the reqs and PR reviews are usually filled with a number of careless mistakes, which equates to more time spent reviewing.

    So I want to come up with a way to incentivize the devs to put in a little more work and be more thoughtful.

    Has anyone heard of or experienced any incentive structures that have worked? I've read that adding incentives for knowledge workers usually causes more harm than good, but I'd like to dig a little deeper.

    My initial thought was to provide an incentive structure around PRs. For example, all devs would start a story with the option to make 10% (for example) more on that story, but each time a PR review has to be sent back, 5% is taken off the first send back, then 3% then 2%.

    Idk, I haven't asked anyone yet, so I thought I'd ask you lot first. I'm also a developer and personally, I would like something like this, but I'm also naturally very careful about submitting shoddy work. I'm not sure how spec-driven devs would take to this.

    Any thoughts, tips, tricks, help would be greatly appreciated!

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

    CScan disk algorithm

    Posted: 06 Jan 2021 05:00 AM PST

    When to use cscan algorithm? Is it depends on what kind or generation of disk/storage you have, or does all of disk/storage are using all of disk scheduling?

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

    [eli5] Deep Learning variables

    Posted: 06 Jan 2021 01:06 AM PST

    Hey guys,

    I've been tinkering a little bit with matlab and machine learning. Could someone explain the following variables to me (eli5 and as an extra maybe a more advanced explanation):

    • Steepness
    • Learning rate
    • Epoch
    • Learning rate factor

    I think i understood that learning rate is 'the most important' variable to tweak when trying to enhance the accuracy of a model. To low of a learning rate can lead to longer (or to long) computing times tho. How do these variables influence each other?

    Thanks in advance

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

    How to fix this segfault error in my double linked list program?

    Posted: 05 Jan 2021 11:05 PM PST

    https://ibb.co/KFby6Pp

    https://ibb.co/tm4WFXn

    #include<stdio.h> #include<stdlib.h> typedef struct node{ int value; struct node* prev; struct node* back; }node; node* last=NULL, *first=NULL; void insert(int value){ node* temp=malloc(sizeof(node)); temp->value=value; //empty case if(last==NULL){ temp->back= temp->prev=NULL; last=first=temp; return; } //stop at last case if(value <= last->value){ temp->prev=last; temp->prev=NULL; last->back=temp; last=temp; return; } //stop at first case if(value > first->value){ temp->prev=NULL; temp->back=first; first=temp; return; } node* cur=last; while(!(cur->value<=value && (cur->prev->value>=value))){ cur=cur->prev; } temp->prev=cur->prev; temp->back=cur; cur->prev=temp; temp->prev->back=temp; } node* search(int value){ node* cur=last; while(cur!=NULL){ if(cur->value==value){ return cur; } cur=cur->prev; } return NULL; } int deletenode(int value){ node* temp=search(value); if(temp==NULL){ return -1; } //stop at last case if(temp==last){ int i=temp->value; last->prev->back=NULL; last=last->prev; free(temp); return i; } //stop at first case if(temp==first){ int i=temp->value; first->back->prev=NULL; first=first->back; free(temp); return i; } int i=temp->value; temp->prev->back=temp->back; temp->back->prev=temp->prev; free(temp); return i; } int main(){ int i; for(i=0;i<10;i++){ insert(i); printf("%d ",search(i)->value); } for(i=0;i<11;i++){ printf("%d ",deletenode(i)); } } 
    submitted by /u/JacksonSteel
    [link] [comments]

    No comments:

    Post a Comment