• Breaking News

    Sunday, December 29, 2019

    How to earn extra cash as programmer Ask Programming

    How to earn extra cash as programmer Ask Programming


    How to earn extra cash as programmer

    Posted: 29 Dec 2019 07:38 AM PST

    What would be different ways one can earn extra cash by applying his programming skills? Which of those are actually viable and which is "best"?

    Thoughts, opinions?

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

    Best framework for running periodic tasks/operations (frameworks to build a task runner?)

    Posted: 29 Dec 2019 06:17 PM PST

    I am building a full-stack application using the following:

    • React (used for my UI/frontend)
    • Java Dropwizard (used to expose my REST service)

    These two codebases are working perfectly, but now I have the need to run some periodic tasks.

    For instance, I have a user service that will pull in information every 30min from my MongoDB database and perform some analysis on this data, then this result could be accessed from my REST service whenever needed. So I just need a TaskRunner service that queues tasks and runs them (runs JAR files) at intervals.

    The thing that I am not sure is if there are any frameworks or libraries I can use to create this TaskRunner service. I could just have another Java program that will have a thread and some queue that will run these tasks (this would be my naive solution). However, I was wondering if you guys knew of any more sophisticated frameworks/libraries to build this TaskRunner service? Preferably, I am looking for solutions in Java, but I am open to any other stacks. Thanks for the help.

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

    How to put code into a Word file?

    Posted: 29 Dec 2019 09:01 AM PST

    Hello!

    I am starting to write one of my papers early, but I have no idea how to put code into it.

    I don't want to use pictures because I want it to be copy-pasteable.

    Text boxes kinda suck and they don't at all behave like they should, and formatting it as a quote or something takes up too much vertical space.

    Also, I wonder if it is possible to also use colors for the code and have it language- formatted. But first I just wanna make it look presentable

    Please help!

    Tnx!

    EDIT:

    Holy, shit, you can just copy paste code form Visual Studio Code, and it will be all coloured and also have a background.

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

    [Android]Multiple views inside fragment

    Posted: 29 Dec 2019 09:15 PM PST

    Hi,

    I'm wondering how I could achieve having multiple views be added and removed as the user interacts with the app. I want to have a map view that will always be there on the top but the view below the map will change depending on what buttons the user clicks.

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

    If top machine learning/AI jobs are disappear. What software developer specialty would you recommend for the greatest future growth and job security?

    Posted: 29 Dec 2019 05:05 PM PST

    Hey I am a 15 year old who wanted to study machine learning and compsci. I recently say this post https://www.reddit.com/r/MachineLearning/comments/egt6dp/d_are_decent_machine_learning_graduates_having_a/?utm_medium=android_app&utm_source=share and I am just wondering what is the best/ most needed software specialty. Would it just be a standard back end developer? What should I focus on right now so my current education does not become worthless in 2027 when I graduate from college? Thanks for the help just trying to get ahead in the industry. Currently thinking abut duel majoring in cs and electrical engineering thoughts? What other duel majors would be good? I really wanna focus on the back end side or become full stack

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

    finding palindrome words ... why doesnt this work?

    Posted: 29 Dec 2019 10:53 AM PST

    My code looks so dumb but logically shouldnt it work??

    #include<stdio.h>

    #include<string.h>

    #define max 100

    int main(){

    char abc[max];

    scanf("%s",&abc);

    if(abc == strrev(abc)){

    printf("1");

    }

    else printf("0");

    }

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

    Use API's in the project of 7-10 free/paid apps

    Posted: 29 Dec 2019 06:36 PM PST

    I want to build a calculator for real estate investment and personal use.

    Some of these apps are free (e.g. smartasset.com), some are not free (e.g. rentometer.com/). Maybe my question is stupid since I'm a newbie

    1. What is the approach of using APIs of paid apps?
    • By using a paid account
    • Contact the company and ask for using apis for money?

    1. What are your thoughts about using many APIs in one app (5-8 sources of apis)
    submitted by /u/rutr1ka
    [link] [comments]

    Is there an Asp.Net Framework/Core Open Source MVC App that has clean code?

    Posted: 29 Dec 2019 06:31 PM PST

    So I'm a junior (9months experience) at a new company. The senior's at my company have a very relaxed culture and they mostly just tightly couple everything and ignore solid. They just code things once and never refactor. Which is fine but I'm a junior and I want to learn.

    I've been studying on my own and I've been reading about SOLID, 3-layer architecture mvc, design patterns etc...

    I'm in a situation where I'm allowed to spend a significant amount of time refactoring or even re-writing a mature web app for the company. The project is in asp.net framework. I was hoping to look at a good example of a project that is well organized/loosely coupled and follows solid so I can try to apply it at work.

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

    Problems with twitch bot writing to a txt file in JavaScript

    Posted: 29 Dec 2019 06:29 PM PST

    I'm currently developing a twitch bot for my channel and wanted to add a death count, which reads and writes a number to a text file to track the deaths. However, the file that handles taking the current death variable, adding to it, and writing the new number to the file doesn't seem to work.
    Code and explanation below:

    exports.run = (client, message, args, user, channel, self) => { if (self) return; const fs = require(`fs`) client.say(channel, "Death added") fs.readFile(`C:/Users/Rargl/Desktop/Chatbot/deaths.txt`, `utf-8`, (err, data) => { if (err) throw err; }) var deathAdd = 1 let data = data + deathAdd fs.writeFile(`C:/Users/Rargl/Desktop/Chatbot/deaths.txt`, data, (err) => { if (err) throw err; client.say(channel, `@${data}`) }) } 

    The block should take the variable "data" from the text file, increase its value by 1, and then overwrite the file with the new number. However, the portion dedicated to writing the code doesn't appear to even run at all, as the second "client.say" line I placed for debugging purposes doesn't cause the bot to say anything at all, while the first client.say line runs perfectly. I have checked multiple times for typos, unclosed brackets etc and have insured the file dedicated to displaying the current death count runs correctly. I have also tried several variations of adding to the data variable, but to no avail. The script also does not produce any error logs. Can anyone figure out the problem?

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

    How to paste folder name two folders back and folder contents into text file?

    Posted: 29 Dec 2019 01:37 PM PST

    I have like 10,000 subreddits contents in text files, but these files lack the subreddit name which is two folders back

    Sort of like

    Askreddit>September12019>file.txt Gaming>September12019>file.txt ...

    How would I put all the contents of the folders with the folders name together all into one document, or what would be a good way to approach this?

    Ty!

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

    What equivalent roles in Java do the .NET Core SDK, .NET Core runtime, and ASP.NET Core runtime play?

    Posted: 29 Dec 2019 04:11 PM PST

    help with i2clcd/ rpi/ c_code

    Posted: 29 Dec 2019 03:53 PM PST

    Hey there folks,

    rpi/ programming noob here!

    I have been having a play with the rpi 3b trying to make a little display for an escape room prop.

    I bought the freenove ultimate kit and have gone through lots of tutorials, i have managed to get the i2clcd screen set up and working with the system temperature and time displaying.

    What i could really do with is some help from there with the code i have gone through a tutorial and managed to write a python script that does what i need it to do, its very simple code, it needs to ask 2 questions ie "pick a, b, c or d" then enter the 4 digit code. What i cannot get my head around is how to get this to display to the lcd.

    Any help would be hugely appreciated

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

    I need your help

    Posted: 29 Dec 2019 11:29 AM PST

    For a solo developer which one do you suggest? A small game, a decent lifestyle app, or a meme app?

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

    I want an app for both ios and andriod but I am not sure what should I do.

    Posted: 29 Dec 2019 03:04 PM PST

    I want to make an app like yelp for both andriod and ios.

    I have not written any app or website before. I have some idea for what I want but I do not know where to start.

    I have some foundational CS knowledge and basic knowledge about C++ and java.

    1. If i do it myself what should I learn (apart from swift) and how do i start?
    2. Does it make sense to learn everything from scratch to write both in andriod and ios version myself alone? How feasible it is?
    3. What should I expect (obstacles)?
    4. What else should i know?
    5. What else should I do to learn? Or is there a way to see how well-known/main stream apps are written?
    6. How much can it cost if i hire an app developer to build it for me?
    7. How long it can take to finish an app if i spend about 4-5 hours per day?

    Thanks much in advance for your answer.

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

    Is Kotlin easier than Java?

    Posted: 29 Dec 2019 12:53 AM PST

    Double dispatch in C++

    Posted: 29 Dec 2019 07:22 AM PST

    Hello,

    I am toying with double dispatch and Visitor pattern in C++ for a school project and I'm testing with the following code :

    class A; class B; class A { public: virtual void Visit(A& a) { a.Accept(*this); } virtual void Accept(A&) { cout << "A x A" << endl; } virtual void Accept(B&) { cout << "A x B" << endl; } }; class B : public A { public: virtual void Visit(A& a) { a.Accept(*this); } virtual void Accept(A&) { cout << "B x A" << endl; } }; int main() { A* arg1 = new B(); A* arg2 = new B(); (*arg1).Visit(*arg2); // prints A x B } 

    I want my program to print "B x A" instead of "A x B". The purpose here is to have some classes that totally redefine the method Accept without having to write down each case, making the code not too horrible to maintain if I had to add a new class that extends A (well, isn't it already a ugly thing to maintain ?)

    A possible solution is to have the following method in both class A and B :

    virtual void Visit(B& b) { b.Accept(*this); } 

    But this solution doesn't scale very well, if I have N classes I would have to copy this method in all those N classes, and if there are more exception to the rule I would have to create a method for all of them in all classes too.

    A lead to work with may be dynamic cast ? The problem being I don't know how to use it very well, in my following test code the double dispatch stops working :

    class B : public A { public: virtual void Accept(A&) { cout << "B x A" << endl; } virtual void Accept(B&) { cout << "B x B" << endl; } }; void A::Visit(A& a) { if(B *b = dynamic_cast<B*>(&a)) { b->Accept(*this); return; } else { a.Accept(*this); } } int main() { A* arg1 = new B(); A* arg2 = new B(); (*arg1).Visit(*arg2); // prints "B x A" } 

    It would make the code very maintainable because I'd only have to change the method Visit in the class A everytime I add a new subclass but it doesn't work : it prints "B x A" instead of "B x B", defeating the whole purpose of the double dispatch I guess ?

    The last solution I thought of would be a giant switch case with dynamic cast which replaces the whole Visitor pattern thing like this :

    class A; class B; class C; class A { public: virtual void foo(A& a) = 0; }; class B : public A { public: virtual void foo(A& a); }; class C : public B { public: virtual void foo(A& a); }; void B::foo(A& a) { if(C *c = dynamic_cast<C*>(&a)) { cout << "B x C" << endl; } else if(B *b = dynamic_cast<B*>(&a)) { cout << "B x B" << endl; } else { cout << "B x ?" << endl; } } void C::foo(A& a) { if(C *c = dynamic_cast<C*>(&a)) { cout << "C x C" << endl; } else { B::foo(a); } } int main() { A* arg1 = new B(); A* arg2 = new C(); (*arg2).foo(*arg1); // Prints "B x B" } 

    Here it does seem to work, but since I haven't touched to anything close to dynamic casting in class I wanted to know if this method has any downside compared to the visitor pattern or should I stick with it since it does what I need ?

    Thank you for reading this and please correct my english if there is anything wrong with it !

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

    How do enter the next line in Notepad++ without pulling the end tag with it?

    Posted: 29 Dec 2019 09:02 AM PST

    So I have a setting enabled that creates both the start and end tag at the same time. However, I want to quickly go onto the next line by hitting enter. This however pulls my end tag down with it. I how do I stop this? Is it another setting I have to adjust?

    (Python) Ex:

    print "This is a test string

    "

    It will generate both at the same time if I type it in once such as "", but it doesn't give me the ability to move on to the next line without pulling the end tag with it because my cursor is still behind it.

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

    Finishing school soon, should I invest in a laptop?

    Posted: 29 Dec 2019 08:43 AM PST

    I'm going to be finishing a boot camp I'm going through for Java and I also have an associates in programming and development. My question is should I invest in a development laptop before I try to get myself a development job? I was looking into a MacBook Pro(a little on the pricey side) but I'm not 2 sure if I really need one to start off. Currently have a very strong PC that I use for programming at home.

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

    Could I do anything professionally useful after Comp Sci I, Comp Sci II, Discrete Math, and Linear Algebra?

    Posted: 29 Dec 2019 08:07 AM PST

    Long story short, I can't pursue a 4 year degree at this point in my life as I have a one-year-old son. But I've been taking part-time classes at community college while working. I absolutely hate being a dishwasher and I'd like to get out of it. Could I apply to do grunt work anywhere with just those classes completed, or do I need Data Structures, Computer Architecture, and other upper-level classes to be a useful programmer?

    Thanks!

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

    Music analyser with GUI

    Posted: 29 Dec 2019 07:06 AM PST

    Hi

    I have made a small light stage with some serial addressable LED's as well as some RGBW strips. Those are being controlled by a microcontroller which gets its command's over the virtual com port (USB UART).

    I would like to create a program which would have a GUI so that I can have a visual representation of the stuff I am sending to the MCU (with some virtual buttons and textbars to fill in values). Currently I use realterm, which is good for testing but not for the actual use.

    I have basic knowledge of C, which I used to create a command line program. It is using portaudio to read an audio device, run a dft spectrum analysis and then sending the results to the controller. However I have noticed it being very slow and not very practical to use.

    Tips on how to make this? Thanks!

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

    No comments:

    Post a Comment