• Breaking News

    Monday, February 24, 2020

    how to know if you are passionate about programming learn programming

    how to know if you are passionate about programming learn programming


    how to know if you are passionate about programming

    Posted: 23 Feb 2020 06:01 AM PST

    i have always been interested about computers and techy things, so when the time comes to plan about the future, i though i would like to code/program.

    At first, i tried learning via website but i was bored reading paragraphs of words without doing much coding. But once i learnt html and css, i tried to do a few task on frontmentor. Usually i won't be motivated to code at all, but when i push myself to create a small part like a section of a website to do, i would have a sudden burst of energy to do what needs to be done.But after i stop, i would feel lethargic and not motivated again.And the cycle continue.

    is this common, or is it a sign that i might not be cut out to be a programmer.

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

    Best Project Based tutorials for Development

    Posted: 23 Feb 2020 05:30 PM PST

    Hi! I'm to learn development, and the best way I learn is through projects. I have a few udemy courses for python and javascript, but they mostly just cover the definition and how to do a few things, but I want to learn how to actually use this in building an app. Does anyone have recommendations of project based tutorials? I'm willing to pay a little bit for courses if needed.

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

    Do boot camps effectively prepare for jobs?

    Posted: 23 Feb 2020 08:57 PM PST

    I've been considering learning how to code, but have pretty much 0 experience. Will web developer boot camps really prepare me to apply for jobs in the field? I understand that everything is based on how hard you work, but I'm coming from a field that pretty much requires graduate degrees to even get a decent job, and the concept of doing a boot camp to learn a skill is very foreign to me.

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

    How do you go about creating an AI program?

    Posted: 23 Feb 2020 05:06 PM PST

    First of all, I'm a newbie. Just starting to learn programming and am interested to create an AI program that write stories.

    I'm thinking of using Python. But I'm kinda stuck on what to do next? Thanks in advance.

    submitted by /u/Afraid-Concentrate
    [link] [comments]

    What are the advantages of functional programming?

    Posted: 23 Feb 2020 04:11 PM PST

    I have been taking a course on it and I have been reading programs made in it. And I have compared it with java, python, c++. The usual programs I have been working with.

    Are there uh...any actual advantages to it? It looks like the whole deal revolves around pattern matching and recursion.

    It just...feels like a puzzle instead of programming. It doesn't feel like "This is what I am going to use to get something done". It feels like "Oh, this is a clever method of writing a for loop!"

    I have done a c++ programming assignment where I used recursion instead of a loop for bonus points. And I have done "pattern matching" by using inbuilt language features.

    Where are the advantages? I could see it being useful in certain bootstrapped enviroments.

    It just looks like it is easy to emulate functional programming with OOP and very very difficult the other way around.

    submitted by /u/Similar-Childhood
    [link] [comments]

    Help with C++ calculator always showing zero?

    Posted: 23 Feb 2020 06:49 PM PST

    #include <iostream> using namespace std; int main(void) { int choice; int numbers; int nmbrs[10]; int answer1; int answer2 = 1; cout << "Pick an operation\n"; cout << "1: Addition\n"; cout << "2: Subtraction\n"; cout << "3: Multiplication\n"; cout << "4: Division\n"; cin >> choice; if (choice == 1) { cout << "You have chosen Addition\n"; } if (choice == 2) { cout << "You have chosen Subtraction\n"; } if (choice == 3) { cout << "You have chosen Multiplication\n"; } if (choice == 4) { cout << "You have chosen Division\n"; } cout << "How many numbers? "; cin >> numbers; for (int i = 0; i < numbers; i++) { int currentNumber; cout << "Number "; cout << i + 1; cout << ": "; cin >> currentNumber; nmbrs[i] = currentNumber; } if (choice == 1) { answer1 = nmbrs[0]; for (int i = 0; i < numbers; i++) { answer2 = answer1 + nmbrs[i + 1]; answer1 = answer2; } } if (choice == 2) { answer1 = nmbrs[0]; for (int i = 0; i < numbers; i++) { answer2 = answer1 - nmbrs[i + 1]; answer1 = answer2; } } if (choice == 3) { answer1 = nmbrs[0]; for (int i = 0; i < numbers; i++) { answer2 = answer1 * nmbrs[i + 1]; answer1 = answer2; } } if (choice == 4) { answer1 = nmbrs[0]; for (int i = 0; i < numbers; i++) { answer2 = answer1 / nmbrs[i + 1]; answer1 = answer2; } } cout << "Answer: "; cout << answer2; return 0; } 

    Addition and subtraction work, but multiplication always returns the answer as zero for some reason.

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

    Best Coding Bootcamp in Orange County?

    Posted: 23 Feb 2020 08:48 PM PST

    Looking for the best coding bootcamp I can go to in the OC area. Currently considering redwood code academy, but I'd like to see if anyone has any suggestions.

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

    Why isn't my homograpgy code working?

    Posted: 23 Feb 2020 11:33 PM PST

    I am trying to "wrap" the classic Lena.jpg to a polygon but as output, I am getting the polygon itself.

    import cv2 import numpy as np from PIL import Image import matplotlib.pyplot as plt np.set_printoptions(precision=2) img_3 = np.zeros([512,512,3],dtype=np.uint8) img_3.fill(255) # or img[:] = 255 #cv2.imshow('3 Channel Window', img_3) #print("image shape: ", img_3.shape) H=np.array([[-0.1203,-0.0022,0.786 ], [-0.0426,0.0046,-0.6049], [-0.0006,0,-0.0025]]) pts = np.array([[100,450],[70,300],[290,100],[450,100]], np.int32) pts = pts.reshape((-1,1,2)) cv2.fillPoly(img_3, pts =[pts], color=(0,0,0)) #poly=cv2.polylines(img_3,[pts],True,(0,0,0)) cv2.imshow("Filled Polygon",img_3) color = (0, 0, 0) #black indices = np.where(img_3 == color) #finding all black pixels coordinates = zip(indices[0], indices[1]) # making all rows and coloume into a tuple unique_coordinates = list(set(list(coordinates))) #since 3 channel Final_Coord=np.asarray(unique_coordinates) #converting to array print("Final pixel coordinates:",Final_Coord) print(type(Final_Coord)) Shape=np.shape(Final_Coord) print("The no of rows are ",Shape[0]) print("Row 1 is : ",Final_Coord[0]) #getting row 1 B=[] """for i in range(4): append_1=np.append(Final_Coord[i],1) A=np.dot(H,append_1) print("A is ",A) print("A[2] is",A[2]) C=np.divide(A,A[2]) B=np.append(B,C) append_1=None X=np.reshape(B,(4,3)) print("Points after Homograpgy",np.transpose(X))""" for i in range(Shape[0]): append_1=np.append(Final_Coord[i],1) A=np.dot(H,append_1) #print(np.shape(A)) C=np.divide(A,A[2]) B=np.append(B,C) append_1=None X=np.reshape(B,(Shape[0],3)) X=np.transpose(X) print("Points after Homograpgy",X.astype(int) ) """image = cv2.imread('lena.jpg') for j in range(Shape[0]): for k in range(2): BGR_val=[k,j,:]""" V=[] C=np.delete(X.astype(int), 2, 0) #removing last row [2] ie along axis 0 print(C) C=np.transpose(C) C=C.tolist() print("cc",C) Zip_x = [a_tuple[0] for a_tuple in C] print("zipX",Zip_x) Zip_y = [a_tuple[1] for a_tuple in C] image = cv2.imread('lena.jpg') for j in range(len(C)): P=C[j] BGR_val=image[P[0],P[1],:] V=np.append(V,BGR_val) BGR_val=None Color_Matrix=np.transpose(np.reshape(V,(len(C),3))) print("The BRG Matrix:",Color_Matrix) #3 remains constant: Contains the BGR values, for pixels (in lena image) corresponing to the coordinates of every pixel inside the plygon. Color_Matrix_list=Color_Matrix.tolist() for q in ranhe(len(Color_Matrix_list)): y=Color_Matrix_list[q] for z in range(len(C)): img_3[Zip_x[z],Zip_y[z],0]=y[0] img_3[Zip_x[z],Zip_y[z],1]=y[1] img_3[Zip_x[z],Zip_y[z],2]=y[2] cv2.imshow("lawda",img_3) 
    submitted by /u/HulkTheWitchHunter
    [link] [comments]

    Need help from a .net and sql developer

    Posted: 23 Feb 2020 11:14 PM PST

    Good morning,

    Im currently working as an automated tester in a multinational. Either this week or next i will have an interview to switch to the development department.

    My manager told me that I will fill a junior .net and sql spot for either a bank or inssurance company.

    What should i study?

    SQL ive seen the basics. SELECT and its methods, JOINS and all of that.

    .net, ive studied to be a game dev. So ive been using C# for 3 years. Is there any good tutorials in making a basic .net app?

    Ive been playing with the console app in visual studio, making calculators and number guessers, but i dont know what else to do.

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

    Learning C# and .NET

    Posted: 23 Feb 2020 10:34 PM PST

    Hi there!
    I started learning python about 2 years ago (have held like a year break, and it's on the side of school and job, but now I got more time so it's not as much as it sounds) and I wow I have gotten far. The last half-year ish I have gotten more and more into web development. I am now a point where I would call myself an intermediate python programmer, and I know basic JS, html and css. I will admit though that I am not as interested in frontend as I am in backend.
    As a python dev I have obviously been using a lot of django, and while it's been great I have lately started to question all the functionality it gives you. Not because I don't like it (I love it), but because I wanna do it myself. Nothing like that feeling when you manage to build something yourself and it works. Sadly I just don't get this satisfaction when using django, as when I make a regular python app or as when I made a simple ai without using a framework (never doing that again though, so much pain!)

    I have researched a bunch, and for a while I have wanted to try out something different than python. Just to get a broader perspective on coding and maybe found out there are greater things than python (right now it feels pretty great).

    I have been looking into C# and the .NET, which seems very exciting, especially for web development and if you also want to make applications of all sorts. But I wanted to hear if you guys had anything to say? Is .NET and C# even relevant in 2020 if you aren't in to game dev? Any tips for someone going from python to C#?
    .NET seems very confusing with .NET framework, .NET core and ASP.NET? Which one should I pick?

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

    What's a good language noone heard of?

    Posted: 23 Feb 2020 04:23 PM PST

    I'd like to learn something new even if it isn't popular. As long as it has something unique and moving languages forward

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

    What is a cool entry level devops project?

    Posted: 23 Feb 2020 04:11 PM PST

    Currently I can write React.js applications and light API backends in Typescript, with a noSQL or SQL backend. I have about 2.5 years experience. I'm more interested in back end than front end and eventually want to get a remote position somewhere. I'm interested in developing my devops skills although it's a pretty broad field on its own.

    Can you guys give me suggestions for a decent entry level devops project that I may be able to grow into something worthwhile as a portfolio piece? I think that will be the next thing I work on.

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

    Moving from Javascript to Python. Any good tutorials?

    Posted: 23 Feb 2020 10:08 PM PST

    Ok, so I'm not 'moving' from JavaScript, it's always going to be my favourite. But I'm trying to learn Python, mainly for two reasons. Reason A, a lot of Natural Language Processing is in Python, not in JavaScript, and the ones for JavaScript are pretty bad. Reason B, machine learning (in my opinion) isn't really good in JavaScript (using Tensorflow.js), and personally, doesn't feel like it was made for JavaScript. Hence, I'd like to learn Python as a side language.

    I'm looking for good tutorials, that help me learn Python, but not programming. A lot of tutorials out there are focused on telling me what an 'array' or 'list' is, or letting me know what a server is and how a console works. I know all of that stuff, I just need to learn Python. I think I speak on a considerable amount of people when I say that it's annoying to watch a video that's 20 minutes, when only 4 minutes of that video actually teaches you something.

    Kinda sounds like a rant, but I just want to learn Python. Sorry if that's like AAAAA TUTORIALS SUCK, just need some good material :)

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

    Getting good grades, but I feel like I know absolutely nothing.

    Posted: 23 Feb 2020 11:30 AM PST

    I'm just finishing up my 2nd year of a 3 year programming diploma course, and will be transferring into a bachelor of CS program shortly after I graduate. I'm concerned that while I'm earning very good grades, I still don't really understand the material to a fundamental level. Every time I sit down to tackle a new problem I feel like I have to re-learn a hundred things, and heavily rely on Google/past projects.

    Is this just the nature of the profession, or am I doing something wrong?

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

    Can I get clarification on an elementary CSS Grid problem?

    Posted: 23 Feb 2020 09:45 PM PST

    Working on Codecademy, and taking the last quiz for all of HTML/CSS (woo!), but something is totally going over my head...

    In the lesson, we are taught that grid-auto-rows specifies the height of implicitly added rows, and grid-auto-columns specifies the width of implicitly added columns.

    However, in this question, that isn't true—instead, the implicit column retains the width of the explicit property. Notice my answer is red and the correct answer has a green border, and the explanation is at the bottom. I had to do some research to find out why, and came across these pages on W3Schools for grid-auto-rows and grid-auto-columns. Notice in the bottom right of each of those pages it says that the grid-template-rows or grid-template-columns overrides the auto version of each. I'm struggling to see where we learned that in the lesson, but whatever, it's the rule and I get it now.

    Or is it......???

    Because then I came across THIS question, which is the exact same question but asking the height of the new implicit row. And this time we're told it will have the height of the auto property, NOT of the explicit property.

    Can I please get some clarification on what the heck is going on here? Thank you so much for being patient with me!!

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

    Learning Javascript. What apps and ebooks are available to help learn JS?

    Posted: 23 Feb 2020 03:46 PM PST

    Looking for good offline resources to help learn. Any good ebooks or apps I can use with poor internet? Something to take with me to the gym, which has spotty internet.

    I have a course on udemy. But sadly I can't run this from the gym. I spend the whole time waiting for the video to load.

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

    Help with Generics

    Posted: 23 Feb 2020 09:18 PM PST

    class ExamplesGenericClass<T> { T element1; T element2; <R> R element3; <R> ExamplesGenericClass(T element1, T element2, R element3) { this.element1 = element1; this.element2 = element2; this.element3 = element3; } } class ExamplesGenericClass2<T> { T element1; T element2; T element3; ExamplesGenericClass2(T element1, T element2, T element3) { this.element1 = element1; this.element2 = element2; this.element3 = element3; } <R> R examplesGenericMethod(R randomVar) { return randomVar; } } 

    I'm struggling to figure out exactly why I can use the <R> in the second class example when defining a data type for a return and a parameter, although I cannot use it when declaring a variable for my class. Any help appreciated

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

    [C++] Stuck learning to use std::array with cin (not for strings)

    Posted: 23 Feb 2020 09:11 PM PST

    I'm not using getline because it's for strings, or chars. I'm not sure how to cin doubles into this new style of an array, given I'm used to arr[] and such. Google taught me a lot in a short amount of time, but somehow only has examples using strings or initialized arrays. I'm not used to using std::everything and such, and my not so old books don't cover this. My professor has decided to use this stuff, and says he doesn't have time to help.

    I get a huge error about it being a binary operation, which I kind of understand given ">>" , but not how to fix it.

    Code... #include <array> #include <iomanip> #include <iostream> const unsigned max = 12; //to avoid the use of "magic numbers"

     void fill_year(const std::array<double, max> &sales) { for(int i = 0 ; i < max ; i++) { std::cout << "Month " << i + 1 << ": $"; std::cin >> sales[i]; // cin >> sales.at(i) doesn't work } } int main() { std::array<double, max> sales; } 

    This is the giant error if that would help....

    main.cpp:error: invalid operands to binary expression ('std::istream' (aka 'basicistream<char>') and 'const std::array<double, 12>::value_type' (aka 'const double')) std::cin >> sales[i]; ~~~~~~~~ ^ ~~~~~~~~ /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/istream:120:7: note: candidate function not viable: no known conversion from 'const std::array<double, 12>::value_type' (aka 'const double') to 'std::basic_istream<char, std::char_traits<char> >::istream_type &(*)(std::basic_istream<char, std::char_traits<char> >::istream_type &)' (aka 'basic_istream<char, std::char_traits<char> > &(*)(basic_istream<char, std::char_traits<char> > &)') for 1st argument operator>>(istream_type& (*pf)(istream_type&)) ^ /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/istream:124:7: note: candidate function not viable: no known conversion from 'const std::array<double, 12>::value_type' (aka 'const double') to 'std::basic_istream<char, std::char_traits<char> >::ios_type &(*)(std::basic_istream<char, std::char_traits<char> >::ios_type &)' (aka 'basic_ios<char, std::char_traits<char> > &(*)(basic_ios<char, std::char_traits<char> > &)') for 1st argument operator>>(ios_type& (*pf)(ios_type&)) ^ /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/istream:131:7: note: candidate function not viable: no known conversion from 'const std::array<double, 12>::value_type' (aka 'const double') to 'std::ios_base &()(std::ios_base &)' for 1st argument operator>>(ios_base& (pf)(ios_base&)) ^ /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/istream:168:7: note: candidate function not viable: no known conversion from 'const std::array<double, 12>::value_type' (aka 'const double') to 'bool &' for 1st argument operator(bool& __n) ^ /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/istream:172:7: note: candidate function not viable: no known conversion from 'const std::array<double, 12>::value_type' (aka 'const double') to 'short &' for 1st argument operator(short& __n); ^ /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/istream:175:7: note: candidate function not viable: no known conversion from 'const std::array<double, 12>::value_type' (aka 'const double') to 'unsigned short &' for 1st argument operator(unsigned short& __n) ^ /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/istream:179:7: note: candidate function not viable: no known conversion from 'const std::array<double, 12>::value_type' (aka 'const double') to 'int &' for 1st argument operator(int& __n); ^ /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/istream:182:7: note: candidate function not viable: no known conversion from 'const std::array<double, 12>::value_type' (aka 'const double') to 'unsigned int &' for 1st argument operator(unsigned int& __n) ^ /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/istream:186:7: note: candidate function not viable: no known conversion from 'const std::array<double, 12>::value_type' (aka 'const double') to 'long &' for 1st argument operator(long& __n) ^ /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/istream:190:7: note: candidate function not viable: no known conversion from 'const std::array<double, 12>::value_type' (aka 'const double') to 'unsigned long &' for 1st argument operator(unsigned long& __n) ^ /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/istream:195:7: note: candidate function not viable: no known conversion from 'const std::array<double, 12>::value_type' (aka 'const double') to 'long long &' for 1st argument operator(long long& __n) ^ /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/istream:199:7: note: candidate function not viable: no known conversion from 'const std::array<double, 12>::value_type' (aka 'const double') to 'unsigned long long &' for 1st argument operator(unsigned long long& __n) ^ /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/istream:214:7: note: candidate function not viable: no known conversion from 'const std::array<double, 12>::value_type' (aka 'const double') to 'float &' for 1st argument operator(float& __f) ^ /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/istream:218:7: note: candidate function not viable: 1st argument ('const std::array<double, 12>::value_type' (aka 'const double')) would lose const qualifier operator(double& __f) ^ /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/istream:222:7: note: candidate function not viable: no known conversion from 'const std::array<double, 12>::value_type' (aka 'const double') to 'long double &' for 1st argument operator(long double& __f) ^ /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/istream:235:7: note: candidate function not viable: no known conversion from 'const std::array<double, 12>::value_type' (aka 'const double') to 'void &' for 1st argument operator>>(void& __p) ^ /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/istream:259:7: note: candidate function not viable: no known conversion from 'const std::array<double, 12>::value_type' (aka 'const double') to 'std::basic_istream<char, std::char_traits<char> >::streambuf_type *' (aka 'basic_streambuf<char, std::char_traits<char> > *') for 1st argument operator>>(streambuf_type* __sb); ^ /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/istream:756:5: note: candidate function template not viable: no known conversion from 'const std::array<double, 12>::value_type' (aka 'const double') to 'unsigned char &' for 2nd argument operator(basic_istream<char, _Traits>& __in, unsigned char& __c) ^ /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/istream:761:5: note: candidate function template not viable: no known conversion from 'const std::array<double, 12>::value_type' (aka 'const double') to 'signed char &' for 2nd argument operator(basic_istream<char, _Traits>& __in, signed char& __c) ^ /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/istream:803:5: note: candidate function template not viable: no known conversion from 'const std::array<double, 12>::value_type' (aka 'const double') to 'unsigned char ' for 2nd argument operator>>(basic_istream<char, _Traits>& __in, unsigned char __s) ^ /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/istream:808:5: note: candidate function template not viable: no known conversion from 'const std::array<double, 12>::value_type' (aka 'const double') to 'signed char ' for 2nd argument operator>>(basic_istream<char, _Traits>& __in, signed char __s) ^ /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/iomanip:71:5: note: candidate function template not viable: no known conversion from 'const std::array<double, 12>::value_type' (aka 'const double') to 'std::_Resetiosflags' for 2nd argument operator(basic_istream<_CharT, _Traits>& __is, _Resetiosflags __f) ^ /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/iomanip:101:5: note: candidate function template not viable: no known conversion from 'const std::array<double, 12>::value_type' (aka 'const double') to 'std::_Setiosflags' for 2nd argument operator(basic_istream<_CharT, _Traits>& __is, _Setiosflags __f) ^ /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/iomanip:132:5: note: candidate function template not viable: no known conversion from 'const std::array<double, 12>::value_type' (aka 'const double') to 'std::_Setbase' for 2nd argument operator(basic_istream<_CharT, _Traits>& __is, _Setbase __f) ^ /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/iomanip:200:5: note: candidate function template not viable: no known conversion from 'const std::array<double, 12>::value_type' (aka 'const double') to 'std::_Setprecision' for 2nd argument operator(basic_istream<_CharT, _Traits>& __is, _Setprecision __f) ^ /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/iomanip:230:5: note: candidate function template not viable: no known conversion from 'const std::array<double, 12>::value_type' (aka 'const double') to 'std::_Setw' for 2nd argument operator(basic_istream<_CharT, _Traits>& __is, _Setw __f) ^ /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/istream.tcc:931:5: note: candidate template ignored: deduced conflicting types for parameter '_CharT' ('char' vs. 'const double') operator(basic_istream<_CharT, _Traits>& __in, _CharT& __c) ^ /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/basic_string.tcc:1466:5: note: candidate template ignored: could not match 'basic_string<type-parameter-0-0, type-parameter-0-1, type-parameter-0-2>' against 'const double' operator(basic_istream<_CharT, _Traits>& __in, ^ /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/istream.tcc:963:5: note: candidate template ignored: could not match '_CharT *' against 'std::array<double, 12>::value_type' (aka 'double') operator(basic_istream<_CharT, _Traits>& __in, _CharT* __s) ^ /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/istream:980:5: note: candidate template ignored: requirement 'and<std::not_<std::is_lvalue_reference<std::basic_istream<char> &> >, std::isconvertible_to_basic_istream<std::basic_istream<char> &>, std::_is_extractable<std::basic_istream<char> &, const double &, void> >::value' was not satisfied [with _Istream = std::basic_istream<char> &, _Tp = const double &] operator(_Istream&& __is, _Tp&& __x) ^ /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/iomanip:170:5: note: candidate template ignored: could not match '_Setfill<type-parameter-0-0>' against 'double' operator(basic_istream<_CharT, _Traits>& __is, _Setfill<_CharT> __f) ^ /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/iomanip:264:5: note: candidate template ignored: could not match '_Get_money<type-parameter-0-2>' against 'double' operator(basic_istream<_CharT, _Traits>& __is, _Get_money<_MoneyT> __f) ^ /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/iomanip:418:5: note: candidate template ignored: could not match '_Get_time<type-parameter-0-0>' against 'double' operator(basic_istream<_CharT, _Traits>& __is, _Get_time<_CharT> __f) ^ 1 error generated.

    Thanks in advance!

    submitted by /u/Red-Droid-Blue-Droid
    [link] [comments]

    Custom font color for STDERR

    Posted: 23 Feb 2020 09:05 PM PST

    I'm using zsh, but I'm hoping for a solution that works on both bash and zsh. Essentially, I'd like all STDERR text to appear as red in my terminal. Mostly for c/c++ development. I have just been having a hard time determining when output is STDOUT vs STDERR. Any tips?

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

    Code challenges and applying for jobs

    Posted: 23 Feb 2020 08:45 PM PST

    I have been learning Python, Flask, and Django to the point where I have 7 projects on my Github. That said, those projects really haven't incorporated any JS yet. It's a given that learning JavaScript is a must when having to do anything with the web. That said, I've been practicing my JS knowledge more on code challenges sites like Codewars up to this point.

    When it comes to showing my degree of knowledge on the JavaScript language, should I just link my Codewars profile to my Github? OR should I copy and paste the challenges that I have finished in a repo?

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

    Recommendation for note-taking appilcation on Mac

    Posted: 23 Feb 2020 08:40 PM PST

    I've lately been using 'Quiver' to note take programming related topics that i've had to research and learn. I've previously used OneNote but felt that it wasn't very friendly when it came to code. Quiver has been alright but i've felt it lacks a lot image customisation and feels cramped.

    Are there any recommended applications/software that are ideal for programming? I'm more than happy to pay and in regards to features I like to paste code snippets, use images and i guess an overall navigation interface that is easy to find go back and forth between topics would be wonderful.

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

    First C++ class assignment advice

    Posted: 23 Feb 2020 08:40 PM PST

    Hello everyone,

    I was hoping to get some advice on how I could condense or make this program more efficient (readable, require less storage, etc). For the sake of the assignment we can leave out reiterating since we'll be learning that at a later time.

    The prompt for the program is as follows:

    The Gas-N-Clean Service Station sells gasoline and has a car wash. Fees for the car wash are $1.25 with a gasoline purchase of $10.00 or more and $3.00 otherwise. Three kinds of gasoline are available: regular at $2.89, plus at $3.09, and super at $3.39 per gallon.

    User Request:

    Write a program that prints a statement for a customer.

    Analysis:

    Input consists of number of gallons purchased (R, P, S, or N for no purchase), and car wash desired (Y or N). Gasoline price should be program defined constant. Sample output for these data is

    Enter number of gallons and press <Enter> 9.7

    Enter gas type (R, P, S, or N) and press <Enter> R

    Enter Y or N for car wash and press <Enter> Y

    **************************************

    * *

    * *

    * Gas-N-Clean Service Station *

    * *

    * March 2, 2004 *

    * *

    **************************************

    Amount Gasoline purchases 9.7 Gallons

    Price pre gallons $ 2.89

    Total gasoline cost $ 28.03

    Car wash cost $ 1.25

    Total due $ 29.28

    Thank you for stopping

    Please come again

    Remember to buckle up and drive safely

    The code I've written is this:

    #include <iostream>

    #include <iomanip>

    using namespace std;

    int main() {

    string noGas, washMessage;

    double numGallons, gasPrice, washCost, gasValue, totalDue; //declaration of double integers

    char gasType, carWash;

    cout<<"Enter number of gallons and press <Enter>: ";

    cin>>numGallons;

    cout<<"Enter gas type(R,P,S, or N) and press <Enter>: ";

    cin>>gasType;

    if (gasType == 'R') {

    gasValue = 2.89;

    gasPrice = numGallons * gasValue;

    cout<<setprecision(2)<<fixed<<gasPrice;

    }

    else if (gasType == 'P') {

    gasValue = 3.09;

    gasPrice = numGallons * gasValue;

    cout<<setprecision(2)<<fixed<<gasPrice;

    }

    else if (gasType == 'S') {

    gasValue = 3.39;

    gasPrice = numGallons * gasValue;

    cout<<setprecision(2)<<fixed<<gasPrice;

    }

    else if (gasType == 'N') {

    noGas = "No purchase was made";

    cout<<noGas;

    }

    else {

    cout<<"You've made an error";

    return 0;

    }

    cout<<"\nEnter Y or N for car wash and press <Enter>: ";

    cin>>carWash;

    if (carWash == 'Y' && gasPrice >= 10.0)

    washCost = 1.25;

    else if (carWash == 'Y' && gasPrice < 10.0)

    washCost = 3.00;

    else if (carWash == 'N')

    washMessage = "Car wash not wanted";

    else {

    cout<<"Did you make a mistake?";

    return 0;

    }

    totalDue = gasPrice + washCost;

    cout<<"\n**************************************\n"<<endl;

    cout<<"* *\n"<<endl;

    cout<<"* *\n"<<endl;

    cout<<"* Gas-N-Clean Service Station *\n"<<endl;

    cout<<"* *\n"<<endl;

    cout<<"* February 22, 2020 *\n"<<endl;

    cout<<"* *\n"<<endl;

    cout<<"**************************************\n"<<endl;

    cout<<"Amount Gasoline Purchases:\t"<<"$ "<<numGallons<<endl;

    cout<<"\nPrice per gallons: \t\t"<<"$ "<<gasValue<<endl;

    cout<<"\nTotal Gasoline Cost: \t\t"<<"$ "<<gasPrice<<endl;

    cout<<"\nCar wash cost: \t\t\t"<<"$ "<<washCost<<endl;

    cout<<"\nTotal due: \t\t\t"<<"$ "<<setprecision(2)<<fixed<<totalDue<<endl;

    cout<<"\n\nThank you for shopping\n"<<"\nPlease come again\n"<<"\nRemember to buckle up and drive safely"<<endl;

    }

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

    How do you test all pairs of item in list?

    Posted: 23 Feb 2020 10:50 AM PST

    I'm learning to program in Python although the answer doesn't have to be in Python. I would like to do this in the base language though.

    If you have a list of items [1, 2, 3, 4, 5] and you want to do some calculation on every pair of the item in the list , you have 5! / (2! * 3!) pairs to test.

    How would you approach this problem and code it, with out listing out all the pairs? Maybe some use of loops or something?

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

    How to extract data points from an html5 graph?

    Posted: 23 Feb 2020 08:33 PM PST

    A website displays a graph. How can I extract the graph data as .CSV or excel file?

    (This is the correct sub I hope?)

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

    No comments:

    Post a Comment