• Breaking News

    Sunday, February 14, 2021

    I’ve got a crush on a guy who loves programming. Help? Ask Programming

    I’ve got a crush on a guy who loves programming. Help? Ask Programming


    I’ve got a crush on a guy who loves programming. Help?

    Posted: 14 Feb 2021 03:19 AM PST

    I know this isn't the type of question you guys usually get on this sub, but I thought to give it a shot here.

    He's in AP Computer Science and he loves to talk to me about how computers work, the different languages etc. I was thinking to write him a poem and send it to him in binary, is that a good idea? Would he find it cheesy? What are some programming jokes I could make in the poem?

    If you're a guy who loves computers, what would be the ideal way to be asked out?

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

    Why use ML for recommendation engines?

    Posted: 14 Feb 2021 03:26 PM PST

    Basically the title - why do all big recommendation engines such as Netflix use ML, instead of something more deterministic that can for example be achieved with some MapReduce / Spark operations?

    In fact, while learning Spark(Core) a while ago, I thought that it was actually very suitable for such tasks: In the case of Netflix, this could be through perhaps calculating similarity scores across users, and then recommending movies that similar users have watched but oneself not yet. Or giving all movies certain tags, and weighting all tags for a user based on length of movies watched with that tag, then suggesting movies that match this tag profile?

    To me, approaches of that style seem very much deterministic - yet, they also seem to be intuitively quite accurate (Whereas my intuition always just leaves me when I try to learn about ML, even if it is otherwise decent), even from a "psychology" point of view. So, is the (simple) approach I'm taking towards recommendation engines inherently bad here? If so, what exactly is "wrong" about it? It seems like it would get quite good if I just add in additional weighted terms behaving in a similar manner. Wasn't YouTube, at some point, also basically just an adsorption algorithm? And google search a PageRank algorithm, both of which behave in a similar manner to what I described?

    So, if I wanted to build a great recommendation engine, should I 100% be using ML? If so, why? How do I go about it?

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

    Loop Coverage?

    Posted: 14 Feb 2021 04:56 PM PST

    I don't fully understand what this is asking

    "Consider a loop covered if at least in one test the loop body was executed 0 times, in a second test, the body was executed exactly once, and in another test the body was executed more than once"

    So there are 3 different loops in the program. I'm suppose to make a test cases that that does that all at once or indivdually?

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

    Help! My merge sort code is duplicating the same numbers and there is an IndexOutOfBounds exception!

    Posted: 14 Feb 2021 09:53 PM PST

    I may as well share all of my code here so that it can be understood better:

    import java.io.File; import java.io.FileNotFoundException; import java.util.ArrayList; import java.util.Scanner; public class Store { private ArrayList<Item> myStore = new ArrayList<Item>(); private boolean badFile = false; public Store(String fName) { loadFile(fName); } public Store() { this("file50.txt"); } private void loadFile(String inFileName) { try { Scanner in = new Scanner(new File(inFileName)); if(!in.hasNext()) System.out.print("ERROR: File '" + inFileName + "' is empty!"); else { while(in.hasNext()) { Item line = new Item(Integer.parseInt(in.next()), Integer.parseInt(in.next())); myStore.add(line); } mergesort(myStore, 0, myStore.size() - 1); } } catch (FileNotFoundException e){ System.out.print("ERROR: File '" + inFileName + "' not found!"); } } public void displayStore() { for(int i = 0; i < myStore.size(); i++) System.out.println(myStore.get(i).getId() + ", " + myStore.get(i).getInv()); if (badFile) return; //[Put Your Code Here.] } private void merge(ArrayList<Item> list, int first, int mid, int last) { int a = first, b = mid + 1, c = first; int total = last - first + 1, loop; ArrayList<Item> newList = new ArrayList<Item> (list.size()); for(int i = 0; i < list.size(); i++) newList.add(0, null); for (loop = 1; loop <= total; loop++) { if (a > mid) newList.set(c, list.get(b + 1)); else if (b > last) newList.set(c, list.get(a + 1)); else if (list.get(a).compareTo(list.get(b)) < 0) newList.set(c, list.get(a + 1)); else { newList.set(c, list.get(b + 1)); } c++; } for (loop=first; loop<=last; loop++) list.set(loop, newList.get(loop)); } private void mergesort(ArrayList<Item> list, int first, int last) { int mid; if (first == last); else if ((first + 1) == last) { if(list.get(first).compareTo(list.get(last)) > 0) swap(list, list.get(first), list.get(last)); } else { mid = (first + last) / 2; mergesort(list, first, mid); mergesort(list, mid + 1, last); merge(list, first, mid, last); } } private void swap(ArrayList<Item> list, Item spotA, Item spotB) { Item temp; temp = spotA; spotA = spotB; spotB = temp; } public void itemSearch() { if (badFile) return; //[Put Your Code Here.] } private int binarySearch(Item idToSearch, int first, int last) { return last; //[Put Your Code Here.] } } 

    Right now when I press play, I get an IndexOutOfBoundsException for line 72. If I put a sysout before that I can see that everything on the list is just the same exact set of numbers instead of a sorted list. I have no idea where I am going wrong here.

    public class Item { private int myId; private int myInv; public Item(int id, int inv) { myId = id; myInv = inv; } public int getId() { return myId; } public int getInv() { return myInv; } public int compareTo(Item other) { return myId; //[Put Your Code Here.] } public boolean equals(Item other) { return false; //[Put Your Code Here.] } public String toString() { return null; //[Put Your Code Here.] } } 

    That is the code for the Item class as well, in case anyone needs it to understand what is going on. I just need my merge sort to be working. Thank you in advance to anyone who can help.

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

    I am getting an error and don't know why (trying to do mergesort)

    Posted: 14 Feb 2021 08:48 PM PST

    Right now this is part of my code, which is responsible for sorting a list of numbers that all have an ID attached to them.

    private void merge(ArrayList<Item> list, int first, int mid, int last) { int a = first, b = mid + 1, c = first; int total = last - first + 1, loop; ArrayList<Item> newList = new ArrayList<Item>(list.size()); for (loop = 1; loop <= total; loop++) { if (a > mid) newList.set(c, list.get(b + 1)); else if (b > last) newList.set(c, list.get(a + 1)); else if (list.get(a).getId() < list.get(b).getId()) newList.set(c, list.get(a + 1)); else newList.set(c, list.get(b + 1)); c++; } for (loop=first; loop<=last; loop++) list.set(loop, new Item(newList.get(loop).getId(), list.get(loop).getInv())); } private void mergesort(ArrayList<Item> list, int first, int last) { int mid; if (first == last); else if ((first + 1) == last) { if (list.get(first).getId() > list.get(last).getId()) swap(list, list.get(first).getId(), list.get(last).getId(), list.get(first).getInv(), list.get(last).getInv()); } else { mid = (first + last) / 2; mergesort(list, first, mid); mergesort(list, mid + 1, last); merge(list, first, mid, last); } } private void swap(ArrayList<Item> list, int spotA, int spotB, int invA, int invB) { int temp; temp = spotA; spotA = spotB; spotB = temp; temp = invA; invA = invB; invB = temp; } 

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

    Here is the line I use to start the sort:

    mergesort(myStore, 0, myStore.size() - 1); 

    And this is the error I get:

    Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.ArrayList.rangeCheck(Unknown Source) at java.util.ArrayList.set(Unknown Source) at Store.merge(Store.java:66) at Store.mergesort(Store.java:91) at Store.mergesort(Store.java:89) at Store.mergesort(Store.java:89) at Store.mergesort(Store.java:89) at Store.mergesort(Store.java:89) at Store.loadFile(Store.java:40) at Store.<init>(Store.java:19) at Store.<init>(Store.java:24) 

    If anyone can tell me what I did wrong I would greatly appreciate it. I am still a relatively new programmer so I have no idea how to approach this problem.

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

    Is it possible to train a computer to recognize images or actions in videos?

    Posted: 14 Feb 2021 02:39 PM PST

    I am a very novice programmer I know basic python and I am about halfway through an algorithms course. I was on tiktok and realized that they remove quite a lot of content for violating their policies. Now I know Tiktok could not possibly have enough manpower to manually look at each video so I figure they must have software to monitor their content. I was wondering how this software worked and how advanced the technology is?. On a separate note I guess my main question is would it be possible to build software that can analyze or rather be trained to analyze objects and events in videos for example someone drinking a beer. How advanced can it get? Would you need a huge number of resources or is it possible for someone at home to make?

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

    What other programming jobs are there besides CURD jobs?

    Posted: 14 Feb 2021 02:30 PM PST

    Help with Hadoop MapReduce implementation

    Posted: 14 Feb 2021 07:59 PM PST

    I have one CSV file of reviews with movie IDs, year of review, and the review out of 5 stars in them and another CSV file with the genres of each movie ID.

    So a review file might be:

    Year // ID // Stars

    1996 1 3.5

    1998 2 4.5

    1996 1 5

    and the ID file might be

    ID // Genres

    1 Horror, Comedy

    2 Action

    How can I get the two to combine and look like

    Year // Genres // Stars

    1996 Horror, Comedy 3.5

    1998 Action 4.5

    1996 Horror, Comedy 3.5

    Should I use Hadoop's MultipleInputs function? Read in my ID file as a hashmap and use that?

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

    What is 'runtime implementation'?

    Posted: 14 Feb 2021 11:41 AM PST

    I'm doing a course that instructs me to use the term "runtime implementation" in an answer to a quiz about why a certain code fragment doesn't work. But it did not define what that means. I know what runtime is and what implementation is, but not the combination. The (Java) code in question does not compile.

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

    lua help

    Posted: 14 Feb 2021 04:38 PM PST

    hi, im trying to modify some lua code but theres an issue: i dont know any code. is anyone able to give me a hand?

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

    Reddit argument

    Posted: 14 Feb 2021 04:00 PM PST

    Hello everyone,

    I was having some silly argument with someone on another subreddit and we agreed to get the opinion of devs on reddit. Sorry for the cringe and sorry if this is the wrong subreddit, please let me know what subreddit to post to.

    You can see the chain here between RoutineMembership07 & the poster at the bottom: https://np.reddit.com/r/MapleStoryM/comments/lipet4/so_explain_this_to_me_people_of_reddit_95_5_from/gn4k6z4/

    Some context:

    • This is a mobile game

    • The "star game" we're talking about has some star that moves from side to side and you have to press stop when it hits a marked area in the middle

    • "necro" is an item you have a 4% chance of getting when you pay some in-game money and items.

    What do you guys think about this discussion? Any inputs/criticisms of both sides is appreciated!

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

    What next?

    Posted: 14 Feb 2021 10:12 AM PST

    I have learned basic programming to the point that I can create simple games and apps without tutorials, but now I have no idea how to move forward and what to do next. I have learned C++, C# with .NET and a bit of python. I also tried making games in Unity because it uses C# and learned a lot but most that can only be used in Unity

    Question: I'm asking how to learn more and practice after I've learned the basics

    Thanks for any answers

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

    Distance and cameras,C#

    Posted: 14 Feb 2021 01:55 PM PST

    I'm working on a game in unity, it's about 2 players surviving zombie raids. Because it's a single-player world I through it would be interesting instead of split screening, I would make a game wides camera based on the distance of players, problem is I don't know how to get the distance between 2 objects, and if I cant directly, how could I? And if someone knows how to edit wight of camera that would be great, I could do that by googling, but I'm sure someone knows, if not that's o THANKS
    sorry for bad English.....

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

    Politician scorecards and it's requirements.

    Posted: 14 Feb 2021 01:12 PM PST

    Wanted to throw an idea out there that I have been thinking about for awhile. Make an easy to use landing page for a politician that rates then along different dimensions (e.g. military support, bipartisanship, donations, financial records). My dream is a site that people can make rational voting decisions for politicians that have the same value system and also help identify corruption.

    You get to be the product managers. How would you organize and layout this project? Ambiguity is intended.

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

    Longest substring help

    Posted: 14 Feb 2021 12:39 PM PST

    Given a string s, find the length of the longest substring without repeating characters.

    class Solution: def lengthOfLongestSubstring(self, s): dicts = {} splitstring = list(s) countlist= [] templist = [] for j in range(len(splitstring)): print(splitstring[j:]) count = 0 for i,value in enumerate(splitstring[j:]): if value not in templist: count += 1 templist.append(value) countlist.append(int(count)) return(max(countlist)) 

    All test cases work except for this one: "pwwkew" which is counting 4 instead of 3.

    I can't for the life of me figure out where this is getting 4...

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

    Why would anyone want to pass a function as a parameter to another function?

    Posted: 13 Feb 2021 10:11 PM PST

    I have been trying to discover why someone would do this and what problems it solves.

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

    Best resources for learning Data Structures and Algorithms

    Posted: 14 Feb 2021 08:16 AM PST

    I have some experience with Python but I never learnt specifically about data structures and algorithms until now. I've seen some free youtube videos online but I'm somewhat struggling to understand the code based implementations of some concepts. Could you guys mention some well explained resources for beginners to learn the core concepts of data structures and algorithms with code demonstration? (preferably Python or maybe Java). I don't really need to become an expert at this, just something that covers the intermediate topics well.

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

    What are those skills that make you better Software engineer/programmer?

    Posted: 14 Feb 2021 10:59 AM PST

    Hi guys,

    Suppose a junior developer asks this from you. What would be your answer?

    Thanks for sharing your thoughts.

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

    Any advice to someone who wants to start a project from scratch?

    Posted: 14 Feb 2021 05:35 AM PST

    Hi, i am a college student who really want to build projects for my portfolio. But seeing projects on github is overwhelming for me. Any advice on how you start a project from scratch? I have a list of projects to make but don't know how to start any of them. (I want to build mobile applications for my portfolio)

    submitted by /u/1KuRaMa1
    [link] [comments]

    Any Projects Ideas?

    Posted: 14 Feb 2021 04:48 AM PST

    got a job offer as an Apex developer

    Posted: 14 Feb 2021 04:02 AM PST

    Hello I am sorry if this is not the correct subreddit to post in. Also English is not my first language so sorry in advance. I have a CS degree but unfortunately I have not found a job as a developer yet, currently I am working on my skills(web development) and I got a job offer as an apex developer? to be honest I don't know anything about it and I am going to do research but my question is is it good for me career wise? it is a position in the government which in my country is a good thing if you care about low working hours and yearly salary increase but is usually not challenging and there is no room for improvement.

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

    Update in-app-content without own server?

    Posted: 14 Feb 2021 03:40 AM PST

    Hi, I'm developing an app. I'm struggling with some things, for example I don't get how to update the content in the app and send notifications. I looked it up, found some keywords but no real explanation. What do you guys use or recommend? And how can implement this?

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

    How many database tables could the reddit have?

    Posted: 14 Feb 2021 03:08 AM PST

    Hey, I have a little problem. I was creating reddit database tables and the only ones I could think of was: User, Post, Tag, Comment, Message and Community. I want at least 10 of those but I am not able to find or think more than those mentioned. Well that is probably because I am not a huge reddit user so I don't know things around here, but maybe you know? (Don't think I want to copy reddit database or something like that xd, it is only for education purposes). Sorry for my bad English.

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

    No comments:

    Post a Comment