• Breaking News

    Saturday, September 5, 2020

    Is this ok in reactive programming? Ask Programming

    Is this ok in reactive programming? Ask Programming


    Is this ok in reactive programming?

    Posted: 05 Sep 2020 10:41 AM PDT

    At my work I see a function that is a single return statement but is around 100 lines long. The basic jist of the control flow is like.

    Flux<Foo> doBar(String qux) { return flubService.blah(qux).flatMapMany(flub-> { // .... // business logic // ... return waldoService.findWaldo(flub).flatMapMany(waldo -> { // ... // even more business logic // ... return wubbleService.wubble(waldo, flub).flatMapMany(wubble -> { // ... // yet more business logic // ... return fredService.dismemberFred(waldo, wubble).flatMapMany(entrails -> { return barService.layout(entrails); }); }); }); }); } 

    I was wondering because most of the time you'd expect nested code like this to be a bad thing, but maybe reactive programming makes it OK. It was written by a senior engineer. It uses Java Reactor and is using the reactive programming paradigm.

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

    I have problem with an Java/XML-Animation in Android Studio, who can help me?

    Posted: 05 Sep 2020 03:11 PM PDT

    Continuing My Journey

    Posted: 05 Sep 2020 09:42 PM PDT

    So tomorrow I'm officially a 2nd year taking Computer Science. After almost 6 months away from programming stuff learning I will continue it tomorrow. Since our class suspended due to the pandemic, I really took a long long break! No reading of programming modules, No practicing! An absolutely break. By the way, the programming language that we used is "Java" and as I recall the last topic that we discussed was about a sneak view of Object Oriented Programming and to be honest I'm having a difficult time understanding this. I almost forgot that we're using Netbeans IDE. And in the Web we're almost finished about the CSS discussion. Now, I literally forgot what I learned, because it's been too long. Now that I will continuing this and I'm not that good on this seriously. I just need some motivation to boost up myself so that I can start learning again with some positive energy even we're doing this in online class! Anyway Good day to everyone and keep safe!

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

    How and where do I get started for learning machine learning?

    Posted: 05 Sep 2020 09:32 PM PDT

    I have absolutely zero experience in machine learning. In doing some research, I've discovered that a professor who goes by the name of Andrew Ng is an expert on ML and has even spearheaded operations at Google in the past. That said, on a quick YouTube search, I discovered his lectures playlist for his Stanford CS229 lectures. Is this a good place to start or this a little bit ahead of where I should be starting? Recommendations for books for other online materials would be greatly appreciated.

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

    Need help choosing speciality: Software Engineering or Cyber Security

    Posted: 05 Sep 2020 09:31 PM PDT

    Hello eveyone,

    I'm currently a student at a university, and for next semester we have to pick one of two specialities that we will focus our degrees on. The two being Software Engineering and Cyber Security.

    Each specialty has different classes, with focus being on their respective names. I'd like to hear people's opinions on what I should choose, I'd like to hear pros and cons so that I can weigh my options. I'd like to know about workload, competiveness, demand, average salaries, etc.

    Personally, I'm interested in both, I just need that extra push from either direction to make the decision.

    Thanks in advance!

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

    Vowels/Consonants

    Posted: 05 Sep 2020 02:02 PM PDT

    Aight so i'm kinda a rookie at python and I don't know how to split vowels and consonants. So bassically I need your help. All i need to do is ask them to enter a word (5 letter minimum) and then it say which letters are vowels and which are consonants. Please Help!

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

    Need some help understanding why this method works. It prints out the input in reverse but the return statement is before that so how does it get there and why does it even print in reverse.

    Posted: 05 Sep 2020 04:54 PM PDT

    public static void recursive(){

    char entry;
    entry=StdIn.readChar();
    if(entry=='\n')
    return;
    recursive();
    StdOut.print(entry);
    }

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

    Programming for social good

    Posted: 05 Sep 2020 03:24 PM PDT

    Hello everyone,

    I am a programmer for some years and in the last period, I am in deep thoughts about how I can help others using my coding skills and make an impact that really matters and would be helpful for the people.

    We the programmers know a lot of open-source tools and frameworks that help us daily to speed up our work and productivity. In addition, we can contribute to them since the source code is public and everyone can participate.

    Understanding how important are most of those tools and frameworks for the software developers and companies, I am thinking how important can be a tool, a system, or in general, software/hardware if it solves real problems people have.

    I have an idea that has to do with an open-source coding community. As the title of this post revealed, the community will be serving the social good creating software or even hardware with software for the real needs people have in health, food/water, education, or whatever else in society. Everyone will be free to share ideas and solutions. The members of this community will share common values and ethics and will work as volunteers for the common good. I can't go deep in details since I try to examine how it can go further. Therefore your opinions are important.

    I would be glad to read your thoughts

    Thank you

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

    How Does Axios.request(config) work

    Posted: 05 Sep 2020 12:56 PM PDT

    i'm trying to understand how axios request works. I can barely find any explanation or example thtat speaks explicitly about it.

    i'll like to know how it works with examples.

    i came across axios request code and i couldn't understand it fully

    var headers = {
    'user-agent': 'Android v18.15.1',
    'content-type': 'application/json; charset=utf-8',
    'accept-encoding': 'gzip'
    };
    var url = "https://www.reddit.com/r" ;
    var agent = new httpsProxyAgent(this.proxy)
    var config = {
    'url': url,
    'httpsAgent': agent,
    'headers':headers,
    'timeout':60 * 0.25 * 1000
    let response = await axios.request(config);
    console.log(response)

    i'll like to understand axios request better

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

    How to turn more then one scanners into only one

    Posted: 05 Sep 2020 12:54 PM PDT

    Hi, here is my problem. I built these scanners to get inputs from the user one by one, however, now, I want to have one input (one scanner) where the user puts 8 different numbers, each number will have one white space between, an example would be:

    input: 0 9 3 4 5 6 7 4

    How can I achieve this ? Thank You

    Scanner x1 = new Scanner(System.in); // x1 (midpoint 1st circle)
    double coordinatex1;
    Scanner y1 = new Scanner(System.in); //y1 (midpoint 1st circle)
    double coordinatey1;
    Scanner r1 = new Scanner(System.in); //r1 (radius 1st circle)
    double radius1;
    //Circle 2 inputs from user
    Scanner x2 = new Scanner(System.in); // x2 (midpoint 2nd circle)
    double coordinatex2;
    Scanner y2 = new Scanner(System.in); //y2 (midpoint 2nd circle)
    double coordinatey2;
    Scanner r2 = new Scanner(System.in); //r2 (radius 2nd circle)
    double radius2;
    //Point inputs from user
    Scanner px = new Scanner(System.in); // x2 (midpoint 2nd circle)
    double pointx;
    Scanner py = new Scanner(System.in); //y2 (midpoint 2nd circle)
    double pointy;

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

    Float to int not converting properly

    Posted: 05 Sep 2020 04:34 AM PDT

    This is my code

    #include <stdio.h>
    int main()
    {
    float owed;
    do
    {
    printf("Cash owed: ");
    scanf("%f", &owed);
    } while (owed < 0);
    int cash = (int)(owed * 100.00);
    printf("%f,%d", owed, cash);
    }

    I'm getting the output as

    D:\c>cd "d:\c\" && gcc tempCodeRunnerFile.c -o tempCodeRunnerFile && "d:\c\"tempCodeRunnerFile

    Cash owed: .22

    0.220000,21

    D:\c>cd "d:\c\" && gcc tempCodeRunnerFile.c -o tempCodeRunnerFile && "d:\c\"tempCodeRunnerFile

    Cash owed: .26

    0.260000,25

    The value is decreasing by one

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

    Java programming challenge double variable bug please help

    Posted: 05 Sep 2020 10:25 AM PDT

    Hi, my question is about use of double variables, I am new with Java, hence, I sometimes have problems with syntax rules. In this program, I dont know why but even though I indicated the variables as double the program is giving me an error when I place double value in input.

    The error displayed in the terminal is:

    Exception in thread "main" java.util.InputMismatchException

    at java.base/java.util.Scanner.throwFor(Scanner.java:939)

    at java.base/java.util.Scanner.next(Scanner.java:1594)

    at java.base/java.util.Scanner.nextDouble(Scanner.java:2564)

    at Circle.run(Circle.java:42)

    at Circle.main(Circle.java:107)

    import java.util.Scanner; // Import Scanner class (Used for Input)
    class Circle {
    public void run() {
    // Implement program for the assignment
    /*
    //Circle 1 inputs from user
    Scanner x1 = new Scanner(System.in); // x1 (midpoint 1st circle)
    double coordinatex1;
    Scanner y1 = new Scanner(System.in); //y1 (midpoint 1st circle)
    double coordinatey1;
    Scanner r1 = new Scanner(System.in); //r1 (radius 1st circle)
    double radius1;
    //Circle 2 inputs from user
    Scanner x2 = new Scanner(System.in); // x2 (midpoint 2nd circle)
    double coordinatex2;
    Scanner y2 = new Scanner(System.in); //y2 (midpoint 2nd circle)
    double coordinatey2;
    Scanner r2 = new Scanner(System.in); //r2 (radius 2nd circle)
    double radius2;
    //Point inputs from user
    Scanner px = new Scanner(System.in); // x2 (midpoint 2nd circle)
    double pointx;
    Scanner py = new Scanner(System.in); //y2 (midpoint 2nd circle)
    double pointy;

    // Interface for Circle 1 (Enter midpoint coordinates and radius of circle 1)
    System.out.println("Enter x-coordinate of 1st circle's midpoint ");
    coordinatex1 = x1.nextDouble(); // Storing the x1 input
    System.out.println("Enter y-coordinate of 1st circle's midpoint ");
    coordinatey1 = y1.nextDouble(); // Storing the y1 input
    System.out.println("Enter radius of 1st circle ");
    radius1 = r1.nextDouble(); // Storing the y1 input
    if ( radius1 < 0) {
    System.out.println("input error");
    System.exit(0);
    }
    // Interface for Circle 1 (Enter midpoint coordinates and radius of circle 1)
    System.out.println("Enter x-coordinate of 2nd circle's midpoint ");
    coordinatex2 = x2.nextDouble(); // Storing the x2 input
    System.out.println("Enter y-coordinate of 2nd circle's midpoint ");
    coordinatey2 = y2.nextDouble(); // Storing the y2 input
    System.out.println("Enter radius of 2nd circle ");
    radius2 = r2.nextDouble(); // Storing the r2 input

    // Negative Radius Error system
    if ( radius2 < 0) {
    System.out.println("input error");
    System.exit(0);
    }
    // Interface for Point (Enter coordinates of the point)
    System.out.println("Enter x-coordinate of the point ");
    pointx = px.nextDouble(); // Storing the x-coordinate of the point
    System.out.println("Enter y-coordinate of the point ");
    pointy = py.nextDouble(); // Storing the y-coordine of the point

    // Finding distance between circle 1 and point
    double distanceC1andP;
    distanceC1andP = Math.sqrt((pointx - coordinatex1) * (pointx - coordinatex1) + (pointy - coordinatey1) * (pointy - coordinatey1));
    System.out.println("Distance between the 1st circle and the point is (from midpoint) " + distanceC1andP);
    // Finding distance between circle 2 and point
    double distanceC2andP;
    distanceC2andP = Math.sqrt((pointx - coordinatex2) * (pointx - coordinatex2) + (pointy - coordinatey2) * (pointy - coordinatey2));
    System.out.println("Distance between the 2nd circle and the point is (from midpoint) " + distanceC2andP);
    // Deciding whether the point is inside, on or outside C1
    //Final decision about points position regarding both circles\
    //Ex: Is it inside both circles ? Is it in C1 and outside of C2 ?
    if ( (distanceC1andP < radius1) && ( distanceC2andP < radius2 ) ) {
    System.out.println("Point is inside of both circles ");
    }
    else if ( (distanceC1andP == radius1) && (distanceC2andP == radius2) ) {
    System.out.println("Point is on both circles ");
    }
    else if ( (distanceC1andP < radius1) && ( distanceC2andP > radius2 ) ) {
    System.out.println("Point is inside of circle 1 ");
    }
    else if ( (distanceC1andP > radius1) && ( distanceC2andP < radius2 ) ) {
    System.out.println("Point is inside of circle 2 ");
    }
    else if ( (distanceC1andP == radius1) && (distanceC2andP != radius2) ) {
    System.out.println("Point lies on circle 1 ");
    }
    else if ( (distanceC1andP != radius1) && (distanceC2andP == radius2) ) {
    System.out.println("Point lies on circle 2 ");
    }
    else {
    System.out.println("Point is outside of both circles ");
    }
    }
    public static void main(String[] args) {
    (new Circle()).run();
    }
    }

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

    How do I start tutoring

    Posted: 05 Sep 2020 04:06 AM PDT

    I believe I am ready to start tutoring people web development technologies such as JavaScript, React, and HTML & CSS. Does anyone have any tips or experiences on how to go about doing this?

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

    Is number of lines of assembly saying how optimal it is?

    Posted: 05 Sep 2020 08:51 AM PDT

    I have limited knowledge of assembly but basing on it I can assume that it's always the case that: less lines of assembly -> more optimal code. I couldn't find any sources on this, so is number of lines of assembly determining how optimal it is?

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

    Design tool for Java Code

    Posted: 05 Sep 2020 08:11 AM PDT

    Hello, how would you write this code as a design tool?

    import java.util.Scanner; public class Decision { public static void main(String[] args) { // Asking user about his/her full name, age and favorite number Scanner input = new Scanner(System.in); System.out.print("Enter your full name: "); String fullName = input.nextLine(); System.out.print("Enter your age: "); int age = input.nextInt(); System.out.print("Enter your favorite number: "); int fvrtNum = input.nextInt(); // Depending on conditions showing corresponding messages String message1 = "", message2 = ""; if (age <= 20) message1 = "Which shows you are still young"; else if (age > 80) message1 = "Which shows you are old"; else message1 = "Which shows you are not too old or not too young"; if (fvrtNum % 2 == 0) message2 = "an even number"; else message2 = "an odd number"; // Now displaying output statement System.out.println("Hello, " + fullName + ". You are " + age + " years old. " + message1 + ". I see your favorite number " + +fvrtNum + " is " + message2 + "."); input.close(); } } 

    I need some input on this flowchart

    https://imgur.com/a/p1cu0tJ

    Just would like to know if anyone has a better way of designing this code

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

    What is the correct way to create a web application with Python?

    Posted: 05 Sep 2020 12:23 AM PDT

    I've made a couple of web applications using the MERN stack and that's basically all JavaScript. But I have projects done with Python that I'd like to create a web application for and be able to use the scripts I've written in Python.

    For example, I want to have a website where the user can upload an image or enter some text and have the passed to a Python function using Python libraries and then get the result and show it on the site, similar to how I can do it with JavaScript.

    I'm almost certain this requires using Django/Flask. I've used eel but that's not exactly what I want. Also, how would the HTML code (so things like buttons or input boxes) call Python functions? I thought it could only be done through JavaScript. Ideally whatever I use is as similar to using Node/Express/React but I still want to do it the right way.

    So what are the correct stacks for developing a web application with some things done with Python? What about sites that are mostly MERN/JS but have somethings that should be done with Python?

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

    I want to learn !

    Posted: 05 Sep 2020 04:38 AM PDT

    Hey so... I´ve always been the dude with potentiaal but to lazy to do anything and now recently i have had a change of heart and decided i want to get into programming so that one day i may persue a career in the gaming industry, I was never aq good student in math class because i never even tried (guess i didnt beleive in myself lol) but now I´m willing to give my all to start learning and so I wanted to ask anyone who may be reading this, what math subjects do I speciffically need to learn programming ?? And also any advice for a beginner is more than welcome !

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

    A general name for functions that works with regular expressions. And a name for functions that works with string without using regular expressions

    Posted: 05 Sep 2020 02:11 AM PDT

    This question is about terminology.

    Consider some programming language which have some functions to work with regular expressions and some functions to work with strings without regular expressions.

    For example:

    1

    • RegExMatch()
    • RegExReplace()

    2

    • InString()
    • StringReplace()

    How would you name each group?

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

    Donation app

    Posted: 05 Sep 2020 09:25 AM PDT

    I would like to create donation app by using Android studio (Kotlin language) for encourage my charity group, but I have no idea how to coding , Please help me out about coding please

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

    No comments:

    Post a Comment