• Breaking News

    Sunday, January 26, 2020

    Are there any games that will help me learn regex? learn programming

    Are there any games that will help me learn regex? learn programming


    Are there any games that will help me learn regex?

    Posted: 26 Jan 2020 05:43 PM PST

    I want to learn regular expressions and I thought there may be a game requires you to use a pattern to match certain terms. Just something I could play around with in my downtime

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

    I don't get NoSQL databases.

    Posted: 26 Jan 2020 08:24 AM PST

    Hey guys,

    I looked for other DB's than MySQL (we only had that in school yet) so I found out about NoSQL databases. I looked into MongoDB a bit, and found it to be quite confusing.

    So as far as I got it, MongoDBs advantage is that for example a user isn't split into X many tables, but stored in one file. Different users can have different attributes or multiple of them. That makes sense to me.

    Where it gets confusing is this: u have for example a reddit post. It stores the post and all it's comments in a file. But how do you get the user from the comments?

    Just a name isn't enough since there could be multiple users using a name (okay, reddit wasn't the best example here...) so you would have to save 1. either the whole user, making it really redundent and storage heavy, or 2. save the ID of the user, but as far as I get it, the whole point of it is to NOT make relations...

    Can you pls help me understand this?

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

    Best way to intuitively understand BST remove()? (Java)

    Posted: 26 Jan 2020 08:09 PM PST

    I managed to intuition my way through BST add() and get() but I can't seem to wrap my head around remove(). I tried to do the "find parent node and reassign its left/right" method but I get a lot of edge cases around removing the root node.

    The solution my teacher in lecture showed is also recursive, but it's a lot more compact and I can kinda understand it, but not at the level that I would have if I had written it through my own intuition. I have posted the code below, could someone help me? Thanks.

    I wrote this code myself, but everything in the body of the if/else is what was shown in lecture. The remove() method is a wrapper for my private inner delete() method.

    private Node delete(Node current, Node removed, T data) { if (current == null) { return null; } else if (data.compareTo(current.data) < 0) { current.left = delete(current.left, removed, data)); // 1 } else if (data.compareTo(current.data) > 0) { current.right = delete(current.right, removed, data)); // 2 } else { if (current.left == null && current.right == null) { removed.data = current.data; return null; } else if (current.left != null && current.right == null) { removed.data = current.data; return current.left; } else if (current.left == null && current.right != null) { removed.data = current.data; return current.right; } else { removed.data = current.data; Node replacement = successor(current.right); current.data = replacement.data; current.right = delete(current.right, new Node(null), replacement.data); } } return current; } private Node successor(Node current) { if (current.left == null) { return current; } else { return successor(current.left); } } 

    The lines I don't understand are the ones with a comment on the right. It's only those two because once I understand why I am doing that I will understand the rest. The last line in the inner else is also one I have trouble understanding, but it similar to those two so I should be able to get it.

    Here's what I do understand:

    • If current is null, then obviously we don't have the data in the tree (remove() throws the Exception).
    • If current has two child nodes, then replace current's data with its successor, and then delete the successor.

    Additionally, successor() returns the node of the inorder successor to the data (which I understand how to get), and the Node class contains a tree node's data, left, and right references.

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

    I want to learn computer programming more but don't know where to start

    Posted: 26 Jan 2020 10:36 PM PST

    I'm currently in my last year of highschool and took my last course of computer science and i really enjoyed it. i have a good understanding of java and that's pretty much it. I want to get into other programming languages such as C#, C++ and Python, except i don't know where to start.

    I don't know if i should search youtube tutorials for beginners or if they are reliable, or get a subscription to skillshare and learn that way. I'm open to many suggestions on what to do. thank you :)

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

    Learning Programming with ADHD

    Posted: 26 Jan 2020 05:12 PM PST

    Hi everyone! I'm currently wanting to teach myself programming, as I really want to make video games some day! However, ADHD makes it incredibly difficult, and I often forget what I've already learned. Do you all have any solutions to this, and maybe a recommendation on what language I should start with? Thank you!

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

    What do you enjoy about programming?

    Posted: 26 Jan 2020 07:37 PM PST

    On premise dev ops engineer for about 5-6ish months, experience in IT as well

    3rd year CS student

    For me:

    I LOVE making projects. Programming projects are flat out fun for me. I love learning new things about code and I feel as if universities do really well at giving you projects that aren't too challenging, but definitely require thinking and lots of stack overflow posts.

    IT support is pretty chill, just finishing problems through tickets and such. Nothing that crazy.

    Dev Ops is ok. Clients are pretty rude, but thats just a part of the biz. Crunch time I hate. But the actual job i enjoy.

    What about you guys?

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

    C++ array.find if true help(code)

    Posted: 26 Jan 2020 07:16 PM PST

    my loop is:

    for(int i =0; i < myArray.size(); i++) { bool is_Found; string check = myArray[i]; check.find(lookingFor);

    if(true??.!) { this is where i'm lost bc i'm trying to compare the array index to what is in the variable "lookingFor"- } }

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

    12 year old brother wants to make a simple Cuphead clone. Where to start?

    Posted: 26 Jan 2020 09:20 AM PST

    Hi guys,

    I'm 27 and my 12 year old brother recently approached me about writing a simple Cuphead clone. How would we go about it? What's the easiest way to do it?

    There's "coding for kids" apps like Tynker but I'm honestly wondering whether going with something like Unity wouldn't be simpler at the end of the day.

    A bit about me: I'm a UX designer, though I studied Software engineering as my Bachelor. Never made a game, but I have experience writing relatively simple apps for Android using both the SDK and using Flutter.

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

    [Question] What is the biggest problem you face while learning to program?

    Posted: 26 Jan 2020 01:12 PM PST

    Just getting a sense for how we can make learning to program a better experience for all.

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

    Parsing an arbitrary C Program & Finding What Goes In Stack, Heap, Data Segment.

    Posted: 26 Jan 2020 07:13 PM PST

    I have to parse some arbitrary C program and figure out where each variable/malloced data structure/function call goes in the memory.

    I can use any language, so I'm more more concerned about what tools/algorithms to use for this task.

    I know the exercise is flawed because what goes where depends on runtime factors and the control flow at some specific point in time. But prof doesn't seem to to care. It's supposed to be like a "real world" scenario where client gives fuzzy requirements and we just have to make do. I'm assuming its best to just keep it simple, since whole class is equally clueless how to proceed.

    Example Input

    int main() { int i,fact=1,number; printf("Enter a number: "); scanf("%d",&number); for(i=1;i<=number;i++){ fact=fact*i; } printf("Factorial of %d is: %d",number,fact); return 0; } 

    Example Output

    Stack: Main() : Arguments: None Variables: int i, int fact, int number Function Calls: printf : Arguments : String "Enter a number: " Return Value: 16 scanf : Arguments: String "%d", pointer &number Return Value: 1 printf : Arguments : String "Factorial of %d is: %d", int number, int fact Return Value: 22 Return Value: 0 Heap: Nothing Data Segment: Nothing 
    submitted by /u/5thAvenueBusker
    [link] [comments]

    What do you regret not learning younger?

    Posted: 26 Jan 2020 05:02 AM PST

    I'm 15, and I really want to know how to improve my knowledge about programming. I know the basics of C#, C++ and Python, and have been working mainly in WPF and Winforms, but I want to know what to start learning for the future.

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

    Trouble Converting Inner.html to Java

    Posted: 26 Jan 2020 07:54 PM PST

    I'm having trouble converting this html script to Java. Any help or guidance would be appreciated.

    <!DOCTYPE html>

    <title>My Example</title>

    <p id="msg"></p>

    <script>

    // Set variables

    var i = 1;

    var output = "";

    // Outer loop

    while (i <= 10) {

    output += "<h1>" + i + " times table</h1>";

    output += "<ul>";

    // Inner loop

    var j = 1;

    while (j <= 10) {

    output += "<li>" + j + " x " + i + " = " + j * i;

    j++;

    }

    i++;

    output += "</ul>";

    }

    // Output results to the above HTML element

    document.getElementById("msg").innerHTML = output;

    </script>

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

    Will certification or PG help me change domain and become a Dev?

    Posted: 26 Jan 2020 11:36 PM PST

    I've been working as part of a (non-technical) securities team for over 1.5 years. I don't find what I do interesting or important. Lately, I've been thinking if I should completely switch domain and go to SE development. I don't have much of experience in it, except for few projects I did during my UG. The only language I'm comfortable with is Java. So will getting a certification, like OCAJP, help me in switching domain? Or should I try to do PG in CS or Software development? I hate the fact that my 1.5 years of experience will go down the drain once I change domain. Has anyone been in this situation? How did solve your dilemma? (Sorry for any grammatical errors, English is not my first language 🙏🏼)

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

    Technology Trends You Must Get Ready For in 2020

    Posted: 26 Jan 2020 11:35 PM PST

    We are now in the middle of the 4th Industrial Revolution and technology is changing more rapidly than ever before. Businesses and individuals who do not follow some of the big tech trends run the risk of being left behind. Recognizing the core trends will allow individuals and companies to plan and exploit opportunities to the max. We share with you in this article the seven inevitable Technology trends for 2020 that everyone should get ready for by 2020.

    READ MORE-: https://sectorqube.com/blog/technology-trends-you-must-get-ready-for-in-2020/

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

    Web Dev Help

    Posted: 26 Jan 2020 11:30 PM PST

    I'm in charge of maintaining a website for an organization/club at my university. As of now, all I'm expected to do is change info to make sure everything is up to date, but the website honestly looks like garbage and I'm taking it up on myself to redesign it.

    I know a fair amount of HTML and CSS but in order to restructure the website, I'll need to learn PHP as some of the features use it. I'm going to learn some over the course of the semester but I'd like to get a bit of a jump start so I could work on the website.

    Are there any other languages/concepts that I should look into that would make learning PHP easier? If not, are there any good (preferably free) resources for learning?

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

    Will coding enter the primary school curriculum?

    Posted: 26 Jan 2020 11:17 PM PST

    I hear it already has in China at a low level. Do you guys think in the next 50 years the case for everyone to be comfortable with basic code will be sufficient and justify some primary school classes on it?

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

    How do I share variables between my server side JS and client side JS?

    Posted: 26 Jan 2020 07:24 PM PST

    I'm building a small web app in HTML and JS (using Bootstrap so no CSS). I have a JS file for the client that uses query selectors for the elements to get values from input fields and assign them to text elements, and a server side JS file that scrapes Amazon product pages to retrieve their price. I want to assign this price variable from the server to an element on the client get another client variable to use as an argument on the but don't know how to connect the two.

    For example, here's a function from my server.js file (using an npm package called "nightmare" in Node.js) to scrape the element from a web page:

    async function checkPrice() {
    try {
    // Retrieve the price from the DOM
    const priceString = await nightmare
    .goto(url) // url is from the client side input value
    .wait('#priceblock_ourprice') // id of the element from the DOM
    .evaluate(
    () => document.getElementById('priceblock_ourprice').innerText
    )
    .end();
    }

    And on the client.js file I want to get the priceString from the server side and display it on the front end, and also get the url from the client file to use on the server file. How can I go about achieving this?

    Sorry if it's the wrong place to ask, I'm new to server side programming!

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

    My cat sat on my homework, or how I learned to commit

    Posted: 26 Jan 2020 07:18 PM PST

    If you are working on your own there is no reason not to make frequent commits to your version control software of choice.

    The mistakes I made were three fold. First, I have a cat. Second, I did not commit my work before getting up, even though I had pretty much just finished adding an entire new feature. Third, I saved without looking at the screen after leaving the cat in the bedroom with the computer for 20 minutes alone.

    tldr: learn to commit

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

    Public Service Announcement

    Posted: 26 Jan 2020 10:57 PM PST

    I fucking hate PHP. Seriously, stay away from it unless you seriously want to consider suicide.

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

    (Java) Get exception when I use dot > . < as decimal in number but works with comma > , < ???

    Posted: 26 Jan 2020 02:09 PM PST

    First program in java for me and I've seen tutorials and syntax guides, everywhere they use (.) as decimal for numbers but I get exception when I do it (I use Intellij), see screenshot;

    When using a dot (.) as decimal sign: http://prntscr.com/qt7sbr
    When using a comma (,) as decimal sign: http://prntscr.com/qt7suu

    static void u(){ System.out.print("Enter a whole number: "); 

    Scanner number_a = new Scanner(System.in); int a = number_a.nextInt();

    System.out.print("Enter decimal number: "); Scanner number_b = new Scanner(System.in); float b = number_b.nextFloat();

    System.out.println(Math.sqrt(a)); System.out.println(Math.pow(b, a)); }

    What is going on here? I'm very confused, using comma (,) as decimal is like writing in comic sans.Any help is appreciated.

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

    Which one of the following python course on udemy should I choose as a beginner?

    Posted: 26 Jan 2020 10:52 PM PST

    So udemy has a sale going on and each of the courses are like $6.

    https://www.udemy.com/course/automate/

    https://www.udemy.com/course/complete-python-bootcamp/

    I have tried the book version of automate the boring stuff (completed around 100 pages) and liked the approach.

    The second one has a lot of ratings but it seems people on this sub don't recommend this as much.

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

    Need help with error with templated linked list program (C++)

    Posted: 26 Jan 2020 10:51 PM PST

    header: https://pastebin.com/FBd5aW0P

    implementation file: https://pastebin.com/Ph6SNKXK

    client code: https://pastebin.com/TcmYnwVQ

    I am compiling in linux with the command:

    g++ wordprog.cpp s_linked_func.cpp

    and I am getting this error message when compiling: https://pastebin.com/uzjxwV2p

    Please, I cannot for the life of me figure out what I am doing wrong. Any help at all would be appreciated!

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

    R - Random forest price predictions has low RMSE score. What went wrong?

    Posted: 26 Jan 2020 10:47 PM PST

    EDIT: Sorry for the title, when I said low RMSE score, my brain was thinking low as in poor score. Not low as in a low value rmse. I just realized that the title isn't clear and that it should be high RMSE score. But I can't edit titles/ delete and repost. Sorry about that.

    I wanted to predict the price of a building based on factors like "building type," "number of bathrooms," "Years Old," etc. I thought random forest would have been a good choice, however, the RMSE value I got was much lower than I had hoped. Am I misunderstanding something?

    What I did: The first thing was cleaning up the dataset. The forest algorithm doesn't take in chars so I changed any char value to a numerical value (ex: Changing Yes to 1 and No to 0). The other thing I noticed was that the column "LotFrontage" in the train and test file contained NAs in certain rows, which would result in a prediction price of NA.

    I ended up removing that column from the training model and that solved the problem. However, as I mentioned, my testing score ended up being really low. For reference, the Master RMSE was 21333 whereas mine was 40000. Did removing that 1 column out of the 16 columns really mess up the predictions that much? What could I have done instead to include the column? I know that you can delete rows with NA, however, the train and test sets were different files and I wasn't allowed to delete any rows in the test set for scoring purposes.

    # r code for reference library(data.table) library(randomForest) library(tidyverse) # These 3 columns contained char, I changed them to a numerical # representation in the csv. # BldgType (0:4), Heating (0:3), CentralAir (0:1) train <- fread("train.csv") # I start from 3 since column 1 is just id and column 2 is where the NAs were train <- train[,c(3:18)] test <- fread("test.csv") # Don't think I need to change any default values. model1 <- randomForest(SalePrice ~ ., data = train, importance = TRUE) pred <- predict(model1, test) # pred is given to kaggle for scoring 

    If there's any other information you need, let me know and I'll add it. Thanks

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

    I want to get Back Into Programming 2years

    Posted: 26 Jan 2020 12:44 PM PST

    HelloReddit;

    2 years ago i used to be a web designer ...a good one but I've stopped learning and coding for some personal reasons and now i want to get back again but i feel like I'm wasted i found it very hard to watch a full HTML fo some small things i forgot and i don't want to miss anything at the same time

    what should i do what is the best way to get Back agian ;

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

    No comments:

    Post a Comment