• Breaking News

    Monday, February 15, 2021

    I accidentaly wrote C++ in my CV insted of C#. How fucked am I? Ask Programming

    I accidentaly wrote C++ in my CV insted of C#. How fucked am I? Ask Programming


    I accidentaly wrote C++ in my CV insted of C#. How fucked am I?

    Posted: 15 Feb 2021 09:37 AM PST

    I thought about learning tha basics and going with it, since its an Intership

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

    How to delete identical rows and columns from matrix in C

    Posted: 15 Feb 2021 04:03 PM PST

    I want to delete identical rows and columns from matrix without deleting the first identical row/column. For example, if second, third, and fourth row are identical, third and fourth row should be deleted and second row should be kept. The same goes for columns. I tried to solve this task, but, I have some mistake in my code, and I don't know if my approach is correct. I hope that you could help me.

    if 0

    Sample Input: 1 2 1 2 3 1 2 1 2 3 1 2 1 2 3

    Sample Output: 1 2 3

    endif

    What I have tried:

    I have tried to do something like this, but I am not sure since I am a beginner.

    #include <stdio.h> int main() { int M, N, m[100][100], i, j, a = 0, k, b = 0; printf("Enter dimensions: "); scanf("%d %d", &M, &N); for(i = 0; i < M; i++) { for(j = 0; j < N; j++) { scanf("%d", &m[i][j]); } } for(i = 0; i < M; i++) { for(j = 0; j < N; j++) { if(m[i][j] != m[a][j]) { a++; continue; } if(m[i][j] != m[b][j]) { b++; continue; } if(i == M) { for(i = 0; i < M; i++) { m[i][k] = m[i][k + 1]; } N--; } } if(j == N) { for(k = 0; k < N; k++) { m[i][k] = m[i + 1][k]; } M--; } } printf("New matrix: \n"); for(i = 0; i < M; i++) { for(j = 0; j < N; j++) { printf("%d", m[i][j]); } printf("\n"); } 

    }

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

    I need serioud help creating some methods using LinkedLists in Java

    Posted: 15 Feb 2021 09:27 PM PST

    package ds.interfaces;

    import ds.students.Token;

    /**

    * u/author simont

    *

    */

    // THIS IS THE PROVIDED INTERFACE //

    public interface List {

    /\*\* \* Inserts the specified element at the specified position in this list. \* Shifts the element currently at that position (if any) and any subsequent \* elements to the right (adds one to their indices). \* u/param index Index at which to add \* u/param obj The object to add \* u/return True if insertion was successful \* \* u/throws NullPointerException if the given object is null \* u/throws IndexOutOfBoundsException if the index is out of range \*/ public boolean add(int index, Token obj); /\*\* \* Returns true if the given object is contained in the list. \* \* u/param obj The object whose presence is to be tested \* u/return True if the list contains the given object \* \* u/throws NullPointerException if the specified element is null \*/ public boolean contains(Token obj); /\*\* \* Remove the first instance of the given object from the list, if it exists \* u/param obj The object to remove \* u/return True if the object was removed \* \* u/throws NullPointerException if the specified object is null \*/ public boolean remove(Token obj); /\*\* \* Remove the object at the specified index from the list, if it exists. \* u/param index The index to remove \* u/return The object previously at the specified index \* \* u/throws IndexOutOfBoundsException if the specified index is out of range \*/ public Token remove(int index); /\*\* \* Get the object at the specified index, if it exists. \* u/param index The index to retrieve \* u/return The object at the specified index, if it exists. \* \* u/throws IndexOutOfBoundsException if the specified index is out of bounds \*/ public Token get(int index); 

    /\*\* \* Returns the first index of the specified object, or -1 if the object does not exist \* in the list. \* u/param token \* u/return The index of the specified token, or -1 if it is not contained in the list. \*/ public int indexOf(Token token); /\*\* \* Appends the specified element to the end of this list. \* u/param obj The object to add. \* u/return True if the object has been added to the list. \* \* u/throws NullPointerException if the specified object is null \*/ public boolean add(Token obj); /\*\* \* Returns true if this list contains no elements. \* u/return True if the list is empty. \*/ public boolean isEmpty(); /\*\* \* Returns the number of elements in this list. \* u/return The number of elements in this list. \*/ public int size(); /\*\* \* Returns a string containing the toString() \* for each object in this list. \* u/return The concatenated toString() for each element in this list \*/ u/Override public String toString(); /\*\* \* Compares this list with the specified object for equality. \* The equality comparison must be value-based rather than the default \* (reference based). \* \* u/param obj The object to compare against. \* u/return True if the specified object is value-comparatively equal to this list \*/ u/Override public boolean equals(Object obj); /\*\* \* Returns the hashCode for this list. \* (This method must satisfy the constraint that if List l1.equals(List l2), \* then l1.hashCode() == l2.hashCode() must also be true. \* u/return The hashCode of this list. \*/ u/Override public int hashCode(); 

    }

    //THIS IS WHAT I NEED TO COMPLETE//

    package ds.students;

    import ds.interfaces.List;

    /**

    * u/author simont*

    */

    public class DSList implements List {

    public Node head; private int size; 

    public DSList() { head = null; size = 0; } public boolean isEmpty() { return head == null; } 

    public DSList(Node head\_) { head = new Node(head\_.next, head\_.prev, head\_.getToken()); } 

    public DSList(DSList other) { // Copy constructor. 

    } 

    public Token remove(int index) { if (index < 0 || index > size()) { throw new IndexOutOfBoundsException(); } Token returnToken = null; if (index == 0) { head = [head.next](https://head.next); head.prev = null; size--; } else { Node currNode = head; while(currNode != null) { 

    if(index != indexOf(currNode.getToken())){

    currNode = currNode.next;

    } else {

    returnToken = currNode.getToken();

    currNode.next.prev = null;

    size--;

    }

     } } if([head.next](https://head.next) == null) { head = null; size--; } return returnToken; } 

    public int indexOf(Token obj) { int index = 0; Node currNode = head; 

     while (currNode != null) { if (currNode.getToken().equals(obj)) 

    return index;

     currNode = [currNode.next](https://currNode.next); index++; } 

     return -1; } 

    public Token get(int index) { if(index < 0 || index >= size()) { throw new IndexOutOfBoundsException(); } return null; } 

    public int size() { return size; } 

    u/Override public String toString() { 

     return ""; } 

    public boolean add(Token obj) { if(obj == null) { throw new NullPointerException(); } if(head == null) { head = new Node(null, null, obj); } else { Node newNode = new Node(head, null, obj); head.prev = newNode; head = newNode; } size++; 

     return false; 

    } 

    public boolean add(int index, Token obj) { 

     return true; 

    } 

    public boolean contains(Token obj) { if(obj == null) { throw new NullPointerException(); } Node currNode = head; while (currNode != null) { if (!currNode.getToken().equals(obj)) { 

    currNode = currNode.next;

     } else { 

    return true;

     } } return false; 

    } 

    public boolean remove(Token obj) { if(obj == null) { throw new NullPointerException(); } Node currNode = head; while(currNode != null) { if(currNode.getToken().equals(obj)) { 

    currNode.prev.next = null;

    size--;

     } currNode = [currNode.next](https://currNode.next); } return true; } 

    u/Override public int hashCode() { return this.hashCode(); } 

    u/Override public boolean equals(Object other) { return true; } 

    }

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

    How would one go about finding an open source project to join in cryptocurrency sphere?

    Posted: 15 Feb 2021 09:13 PM PST

    I'm looking for a project to contribute to and learn from at the same time. How would one go about finding projects that are looking for developers/contributors?

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

    so my boss wants me to set up a recommendation system for the learning platform that we are building. in a week.

    Posted: 15 Feb 2021 06:47 PM PST

    I don't know anything more about AI/ML than the average programmer. And not interested either.

    Boss wants me to use tools offered by Microsoft and whip out the recommendation system in a week or two.

    Any good advice for this scenario?

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

    [Java] Is it more efficient to have less lines of code, or for the program to do less work (i.e. checks)

    Posted: 15 Feb 2021 04:44 PM PST

    Let's say I have 2 methods, and 3 including my main. These two methods are near identical with the exception of roughly 5 lines (the methods are 30 lines each including whitespace and curly brackets and whatnot). So my question is, is it better to have one method (35 lines is my approximation), however it has an if statement that checks every character in a String through a loop.

    Essentially, is it more efficient to have an extra 30 lines, or no extra lines, but the program does checks through an if statement for every character in a String.

    Thank you in advance for anyone's help!

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

    Possible Number Combinations? (Mental Health mg combos)

    Posted: 15 Feb 2021 04:41 PM PST

    I am wondering where could I hire someone to play with some numbers for me. I need an outline of all possible combinations of 5 medications and their doses(mg). Does anyone know if this is a programming related thing or would this be a r/math related thing?

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

    Help on converting a flash game to, well, anything.

    Posted: 15 Feb 2021 12:49 PM PST

    Recently, I played a flash game that came out in 2005 and had an update to it 15 years later, a week before flash died. (Stinkoman 20X6 on HomestarRunner) I enjoyed the crap out of this game back in 2006 and after playing it again, I noticed there are many bugs in it. I would like to convert this game from Flash into something else. I see that HTML5 is what most Flash things got converted to, but I don't actually know HTML. I have some school knowledge of Python, C++, and Java if that is of any importance. I am totally willing to learn HTML5 to do this since this will be a side project to do in my free time, with what little I get from college. What should be the first and foremost step in taking this game, converting it into something modern, and fixing the bugs in the process? If the first step is to learn HTML5, then that is fine. I'm totally down on learning it.

    This is my first post here and I just really want to do this for some reason, despite not knowing where to start. Any help would be greatly appreciated, no matter what it is. I decided to come here to ask since I find the websites on how to convert confusing, due to my lack of the necessary knowledge, but I am more than willing to learn.

    (Hope I flaired this correctly)

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

    In need of a nudge in the right direction

    Posted: 15 Feb 2021 11:48 AM PST

    I'm not sure if I'm in the right place or not, but I am in need of some help putting a name on what I am trying to accomplish. I'm trying to figure out how to create a choice driven flow chart where someone can choose from 3 different item then get directed to another page where they can choose from x number of items relating to their original choice, then move to another page based on that choice.

    For example:

    Fruit or Vegetable. They choose fruit then it would go to a page where they can choose "ready to eat" or "have to prepare". Based on that choice they would go to another page where they could choose a color. All for it to lead to one final item that is the culmination of their choices.

    This all makes sense in my head, but I don't think I'm putting it in words very well. If anyone has a suggestion on what this may be called or have any idea where I could look more into something like this it would be greatly appreciated.

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

    Where on Earth is The Encyclopedia of Best Practices practices practices...

    Posted: 15 Feb 2021 03:13 PM PST

    Hola!

    I had a discussion recently. 2 sql commands

    "update ids set lastid = lastid + 1" then a separate "select lastid from ids"

    versus

    "update ids set lastid = lastid + 1 select lastid from ids"

    The second combined query prevents 2 different sessions getting the same lastid. Why do some programmers think computers are too fast or there is no possible way for that to happen?

    Where is an encyclopedia of such techniques?

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

    Why does Ascii take a whole byte per character?

    Posted: 15 Feb 2021 02:36 PM PST

    Apparently all ascii characters are between 32 and 127 in binary? This is less than 1/2 a byte ,256, so why not store two characters per byte?

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

    How does everyone manage Jira and GitHub notifications?

    Posted: 15 Feb 2021 02:35 PM PST

    I've been working with Jira and GitHub for a couple years now and as the projects grow the email notifications are starting to be unmanageable.

    I've tried web notifications, but miss them when away from my work laptop.

    I've setup email rules which cleanup my inbox but then they just rot away in a different folder.

    Work uses teams but all of the apps and integrations are turned off.

    Seeing what everyone does, maybe I'm not using email rules right.

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

    what does the ? operator do in c# programming

    Posted: 15 Feb 2021 12:46 AM PST

    I've attempted to google this here but found the explaianation in the docs confusing, I appologize if this is simple to you if I may be so incoveniant may I also have a bit of code to help understand it?

    Thank you for any help in advance
    Kurtis

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

    How do you implement an NLP endpoint in a backend written in Scala with only python ?

    Posted: 15 Feb 2021 07:43 AM PST

    Please explain to me like a 5 years old, if anyone could give me sufficient learning resources to learn how to do it.

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

    What framework should I learn

    Posted: 15 Feb 2021 01:08 PM PST

    I've been programming for a while now, mostly working in python because I don't really do any front end stuff, but I want to get to know a framework so I could maybe do some frontend while being able to do more than just frontend with the knowledge I get. I was thinking .NET, but I'm not sure what i should choose.

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

    JavaScript Rule of thumb for when to put {?

    Posted: 15 Feb 2021 09:15 AM PST

    As the title mentions, is there any Rule of thumb to know when to put the { and }?

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

    How can I install Java and python that it will show on command line?

    Posted: 15 Feb 2021 12:43 PM PST

    I installed both programs of python and Java, but it didn't show on command line.

    Command prompt and Environment variables https://imgur.com/gallery/vljDsiC

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

    What can an extremely good programmer achieve?

    Posted: 15 Feb 2021 11:16 AM PST

    Hello, I am relatively new to programming.

    I am wondering, if I become very good at the skill of programming, what can I achieve in terms of significant value for me or the world? I mean here "value", not material gain like lots of money or having a good career etc.

    Some examples could be:

    -Create a programming language that is so good, it benefits the world immensely.

    -Solve an unsolved problem in programming. (If these kinds of things exist in programming. I do not mean computer science which has lots of unsolved problems)

    -Create powerful AIs

    ...

    I don't mean to be disrespectful and this is completely hypothetical because I don't know, but being a mathematician for example can create lots of value in terms of solving problems of the world or improving human understanding, however being a programmer is maybe kind of like being a carpenter where it certainly creates value in terms of creating software but it doesn't create much value apart from that. (Other than creating good "furniture"=software)

    "Furniture-like" answers are also welcome. Like creating the next Google, or some software, website that is widely used, however, it seems to me the main challenge of such endeavours is not the engineering part (which is certainly still a challenge), but rather more like creativity, business-y, idea generation etc.

    I don't know, maybe I am wrong. You can also try to explain to me, why creating "furniture" kinds of things is equally or more valuable than things like improving human understanding, solving problems or inventing things etc.

    Thank you in advance! I am a bit unmotivated currently because what I have chosen as a career seemed to me just a way to make money rather than improving the world or creating value etc, recently.

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

    java.lang.StringIndexOutOfBoundsException for charAt command in array

    Posted: 15 Feb 2021 09:32 AM PST

    Hey. I'm writing a program in java that stores the grades and names of various applicants to a hypothetical job at a company. The info is read off a text file by another program and then fed into an array of Applicant objects. The grades are supposed to be either U, 3, 4, or 5, and I'm trying to write a couple lines of code to handle what should happen in the case that somebody enters their grades in the wrong format.

    This is what the code looks like inside the Applicant class ( where the info is stored ):

    This is what the program looks like in eclipse. ( in case thats easier to see )

    Here's the filereader program in eclipse.

    The comments are unfortunately in Swedish inside eclipse.

    Here's the error message.

    import java.util.Arrays; public class Applicant implements Comparable<Applicant> { // Each applicant has a name and their respective grades private String name; private int[] grades; int avg; public Applicant(String name, String gradesAsString) { this.name = name; // Moved the parsing of grades to seperate method to keep // the constructor shorter // Call this and pass the parameter that handles the grades parseGrades(gradesAsString); getAvgGrade(); } private void parseGrades(String gradesAsString) { // gradesAsString has the format x,y,z,q where each letter is a grade // If we split the string on (",") each grade gets placed into seperate array elements String[] g = gradesAsString.split(","); // Creates the array with each grade split into elements grades = new int[g.length]; // Iterate all grades to parse the grades into numbers. for (int i = 0; i < g.length; i++) { char c = g[i].charAt(i); // this is where error occurs if (g[i].equals("U") != true && Character.isDigit(c) != true) { grades[i] = 0; } else if (g[i].equals("U")) { // Failed counts as zero grades[i] = 0; } else if (Integer.parseInt(g[i]) >= 6 || Integer.parseInt(g[i]) < 0) { grades[i] = 0; } else { grades[i] = Integer.parseInt(g[i]); } } } 

    This is what the textfile looks like.

    Does anyone know what's wrong here? I don't understand how index 1 is out of range when the string is clearly split at each , into 5 seperate elements.

    Just say if any further info is needed and I'll provide. I'd appreciate any help I could get, thanks!

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

    Best app devolopment program?

    Posted: 15 Feb 2021 08:54 AM PST

    Hello good people of programming.
    I have an idea for an app and I am searching for a no-code app development program.(Such as appy pie or Zoho).
    I would like to to have as much cusomizable features as possible and sign in and chat options in the app.

    Please help.

    Spoiler: I know nothing about programming :)

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

    Online database keyword search Application help

    Posted: 15 Feb 2021 08:43 AM PST

    Hello, i have a problem of not knowing where to start and piece things together for a project. I know html,css,js, sql, php, java etc. somewhat (4th year of uni). But i have to do a project similar to this one http://database.netchem-eu.com/home. (Sign in as guest will get you to the app)

    My question specifically is; do i need to create the whole application that links my online hosted database and keywords or is there some sort of shortcut. Like a pre-built thing that does this for me? Also, if nothing, is there a specific name for this kind of app so i could google and search online for more help. Thanks

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

    What is the location of chrome bookmarks on a chromebook?

    Posted: 15 Feb 2021 07:30 AM PST

    I have tried these paths thus far:

    /home/YOUR USERNAME/.config/google-chrome/Default/ ~/.config/google-chrome/Default/Bookmarks ~/Library/Application Support/Google/Chrome/Default/Bookmarks ~\AppData\Local\Google\Chrome\User Data\Default\Bookmarks 

    Nothing has worked thus far. The contents of ~/.config on my computer are:

    . .. configstore cros-garcon.conf nvm pulse vue weston.ini 

    For reference, I am using linux on a Samsung Chromebook. Version 88.0.4324.109 (Official Build) (32-bit)

    Appreciate your help.

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

    What to review for Junior question 5: Canadian Computing Competition

    Posted: 15 Feb 2021 07:01 AM PST

    I am taking the Junior test of the Canadian Computing Competition soon. I am able to solve J1 - J4, but have difficulty in J5.

    The competition page states that J5 includes the following: Some advanced material (e.g., recursion, efficient sorting, clever algorithms).

    I am not sure what this entails (which type of sorting algorithms?, which type of clever algorithms?).

    Any guidance on what specific algorithms/topics I could learn so that I am able to solve such problems.

    Here is a link to the 2020 CCC Junior Paper. J5 is on page 15. Here is a link to all other previous tests.

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

    Looking to build or use a software that can keep track of social conversation based on keywords i select. Do you guys know of any? Or could you direct me in the right direction to build one?

    Posted: 15 Feb 2021 03:59 AM PST

    Hey,

    I'm very interested in collecting information about various topics and which will allow me to spot trends via social media, before they hit the headlines. What I'm currently after is a social media listening tool, that will allow me to look up keyword or phrases trends.

    If you know any tools that has a similar function or know how i should start building my own. Let me know.

    Thank you

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

    No comments:

    Post a Comment