Software Development and Programming Careers (Official Discussion Thread)

Rev Leon Lonnie Love

damned mine eyes, DAMNED mine eyes!!
Joined
Nov 11, 2017
Messages
21,912
Reputation
5,478
Daps
88,996
Gents, a word, if you don't mind.

I'm going through this book, Concrete Abstractions, and already I'm stuck on a problem.



:(

I figure I have to apply the function, nested, a few times. At least can someone tell me if I'm going in the right direction.
are you supposed to write a program or just solve this? Mathematically the numbers are 16 and 1, since I dont think any even number is allowed for x.
 

Obreh Winfrey

Truly Brehthtaking
Supporter
Joined
Nov 18, 2016
Messages
20,852
Reputation
25,252
Daps
131,941
Code:
public int f (int x, int y)
{
    if (x % 2 == 0) { return 7; }  // if x is even
    else { return (x * y); }
}
The easy way out seems like x = 1 and y = 16. If you factorize 16 you get 1, 2, 4, 8, and 16. I don't think I fully grasp what it's asking. I don't even know what Concrete Abstractions is.
 

Secure Da Bag

Veteran
Joined
Dec 20, 2017
Messages
40,061
Reputation
20,339
Daps
126,234
The easy way out seems like x = 1 and y = 16. If you factorize 16 you get 1, 2, 4, 8, and 16. I don't think I fully grasp what it's asking. I don't even know what Concrete Abstractions is.

Concrete Abstractions is the name of the book. It's a Comp Sci book.
 

jajahoe

Rookie
Joined
May 5, 2012
Messages
156
Reputation
10
Daps
362
Reppin
KIlleen, TX
The easy way out seems like x = 1 and y = 16. If you factorize 16 you get 1, 2, 4, 8, and 16. I don't think I fully grasp what it's asking. I don't even know what Concrete Abstractions is.
This is it I think, loop through the factors of the larger number and apply to function see what u get?
 

kevm3

follower of Jesus
Supporter
Joined
May 2, 2012
Messages
16,300
Reputation
5,571
Daps
83,585
Starting my journey to become a software developper. I have no it bachelors degree (just in psychology). I have been learning css html Javascript and java on code academy. Reading through all the threads now. Is it still best to look for a help desk job starting off, or am I confused? Also is code academy the best platform for me to use. I have absolutely no experience


Help desk and coding are completely different. Best thing to do is create a ton of sites, deploy them, maybe create a blog or youtube channel and apply nonstop to open developer positions
 

yung Herbie Hancock

Funkadelic Parliament
Bushed
Joined
Dec 27, 2014
Messages
7,168
Reputation
-2,451
Daps
21,580
Reppin
California
C++ brehs I need some consultation. I'm trying to figure out where I'm going wrong here.
Here's my code:
How do I get my output to look like the expected output.
The yellow arrows in the "expected output" means that my code is missing a new line. The yellow without arrows in the "expected output" means that I shouldn't have white space there.

Pretty much there's something wrong with my code towards the end where you have to formate the output by using setw().
my-solution.png

zybooks-solution.png




#include <iostream>
#include <string>
#include <sstream>
#include <iomanip> //stream manipulation library
#include <fstream>
using namespace std;
int main() {

ifstream inFS;
ofstream outFS;
istringstream inSS;
string dataTitle;
string col1Header;
string col2Header;
string dataPointstr;
int dataPointint;
string dataPointemp;
string inStream1;
int inStream2;

//Prompts the user for a title for data then Outputs the title.
cout << "Enter a title for the data:" << endl;
getline(cin,dataTitle);
cout << "You entered: " << dataTitle << "\n" << endl;

//Prompts the user for the first column's header then outputs the column's header.
cout << "Enter the column 1 header:" << endl;
getline(cin,col1Header);
cout << "You entered: " << col1Header << "\n" << endl;

//Prompts the user for the second column's header then outputs the column's header.
cout << "Enter the column 2 header:" << endl;
getline(cin,col2Header);
cout << "You entered: " << col2Header << "\n" << endl;

outFS.open("novels.txt");

cout << "Enter a data point (done, -1 to stop input):" << "\n" << endl;
while (getline(cin, dataPointstr, ',')) { //Loop iterates as long as user doesn't input done, -1
if (dataPointstr == "done" || dataPointemp == "-1") {

break;

}
getline(cin, dataPointemp, '\n');
inSS.clear();
inSS.str(dataPointemp);
inSS >> dataPointint;

outFS << dataPointstr << "," << dataPointint << endl; //writes dataPointstr and dataPointint to novels.txt
}

outFS.close();

inFS.open("novels.txt");

cout << setw(33) << dataTitle << endl;
cout << left << setw(20) << col1Header << "|";
cout << right << setw(23) << col2Header << endl;
cout<<"--------------------------------------------" << endl;
while (getline(inFS,inStream1, ',')) {

inFS >> inStream2;
if(inFS.eof()){
break;
}
cout << left << setw(20) << inStream1 << "|";
cout << right << setw(23) << inStream2;
}

cout << "\n" << endl;

inFS.close();

inFS.open("novels.txt");

while (getline(inFS,inStream1, ',')) {
inFS >> inStream2;
if(inFS.eof()){
break;
}
cout << setw(20) << right << inStream1 << " ";
for(int i = 0; i < inStream2; i++) {
cout << left << "*";
}
}

return 0;
}
 

yung Herbie Hancock

Funkadelic Parliament
Bushed
Joined
Dec 27, 2014
Messages
7,168
Reputation
-2,451
Daps
21,580
Reppin
California
The easy way out seems like x = 1 and y = 16. If you factorize 16 you get 1, 2, 4, 8, and 16. I don't think I fully grasp what it's asking. I don't even know what Concrete Abstractions is.
Hey breh do you mind helping me out for a sec. The question I posted above. I'm not sure if you're familiar with C++. Thanks.
 

Obreh Winfrey

Truly Brehthtaking
Supporter
Joined
Nov 18, 2016
Messages
20,852
Reputation
25,252
Daps
131,941
Hey breh do you mind helping me out for a sec. The question I posted above. I'm not sure if you're familiar with C++. Thanks.
I think part of the problem might be:
cout << "\n" << endl;
I don't think you need the endl if you have the newline. You also might need to sanitize your inputs, trim leading and trailing whitespace, before you output them again. That's often a problem with assignments that check for formatted output. I didn't get a chance to run this for myself, though.
 

yung Herbie Hancock

Funkadelic Parliament
Bushed
Joined
Dec 27, 2014
Messages
7,168
Reputation
-2,451
Daps
21,580
Reppin
California
I think part of the problem might be:
cout << "\n" << endl;
I don't think you need the endl if you have the newline. You also might need to sanitize your inputs, trim leading and trailing whitespace, before you output them again. That's often a problem with assignments that check for formatted output. I didn't get a chance to run this for myself, though.
cout << "\n" << endl; occurs after creating the first table (most of my errors are from the first table). I added it there because the instructor mentioned that we had to seperate table 1 from table 2. I'm 100 percent sure that the error is coming from the while() loops, but I honestly can't tell how the loop is creating the whitespace.
Here's my code. Could you underline my mistakes? I bolded the portion where I think the error might be coming from:
inFS.open("novels.txt"); //creates an input file stream in order to read from novels.txt

cout << setw(33) << dataTitle << endl; //creates the title
cout << left << setw(20) << col1Header << "|"; //left columns header
cout << right << setw(23) << col2Header << endl; //right column header
cout<<"--------------------------------------------" << endl;

while (getline(inFS,inStream1, ',')) { //This look reads data from the file. it grabs the string until it sees a comma.

inFS >> inStream2; //The rest of the data (after the comma) should be an integer. This integer is place in inStream2.
if(inFS.eof()){
break;
}
cout << left << setw(20) << inStream1;
cout << "|";
cout << right << setw(23) << inStream2 << endl; //
FIXME: I honeslty tried looking for leading spaces but could not
find any
}

cout << "\n" << endl;

inFS.close();

inFS.open("novels.txt");

while (getline(inFS,inStream1, ',')) {
inFS >> inStream2;
if(inFS.eof()){
break;
}
cout << setw(20) << right << inStream1 << " ";
for(int i = 0; i < inStream2; i++) {
cout << left << "*";
}

}
 

OSUBaneBrowns

Ohio to California
Supporter
Joined
May 10, 2012
Messages
5,948
Reputation
823
Daps
16,091
Reppin
Long Beach, CA
Any GitHub experts in here? I’m trying to set this up but still confused on uploading my code, dataset and finding a team to help me make improvements :patrice:.
 

Rev Leon Lonnie Love

damned mine eyes, DAMNED mine eyes!!
Joined
Nov 11, 2017
Messages
21,912
Reputation
5,478
Daps
88,996
Any GitHub experts in here? I’m trying to set this up but still confused on uploading my code, dataset and finding a team to help me make improvements :patrice:.
what are you trying to upload?
Do you already have an account?
you need to create a git repo using the `git init` command inside the folder that houses your code.
you also need to create a repo of the same folder name on github using the "new repository" button
then index all the files in you local folder that you want to send to github using `git add <file path>`
then tell you github where the remote repo is (ie ther address of you github repo online) using `git push --set-upstream <remote git repo> <branch name>`
then commit the files you added using `git commit -m "<whatever message you want to use>"
then send the files to github with `git push`
got to github then you should see them uploaded on the repo.

This is just the simplified version of it, but there is a lot that you can do but its not worth going over since you dont understand git yet.
also note that github has a limit of how much data you can store. Also consider how private that data is, because if it sensitive you probably dont want it visible to the public.

To find collaborators, you will likely have to post about it on some programming forum. maybe of them reddit ones is a start then people there will give you feedback.

Before all this I suggest you got through some tuts on how to use git. Its an invaluable skill to have if you plan to collaborate with others.

Git - Basic Concepts - Tutorialspoint

this video playlist is great https://youtube.com/playlist?list=PL-osiE80TeTuRUfjRe54Eea17-YfnOOAx
 

OSUBaneBrowns

Ohio to California
Supporter
Joined
May 10, 2012
Messages
5,948
Reputation
823
Daps
16,091
Reppin
Long Beach, CA
what are you trying to upload?
Do you already have an account?
you need to create a git repo using the `git init` command inside the folder that houses your code.
you also need to create a repo of the same folder name on github using the "new repository" button
then index all the files in you local folder that you want to send to github using `git add <file path>`
then tell you github where the remote repo is (ie ther address of you github repo online) using `git push --set-upstream <remote git repo> <branch name>`
then commit the files you added using `git commit -m "<whatever message you want to use>"
then send the files to github with `git push`
got to github then you should see them uploaded on the repo.

This is just the simplified version of it, but there is a lot that you can do but its not worth going over since you dont understand git yet.
also note that github has a limit of how much data you can store. Also consider how private that data is, because if it sensitive you probably dont want it visible to the public.

To find collaborators, you will likely have to post about it on some programming forum. maybe of them reddit ones is a start then people there will give you feedback.

Before all this I suggest you got through some tuts on how to use git. Its an invaluable skill to have if you plan to collaborate with others.

Git - Basic Concepts - Tutorialspoint

this video playlist is great https://youtube.com/playlist?list=PL-osiE80TeTuRUfjRe54Eea17-YfnOOAx
I already installed and setup Git and GitHub and was able to get them to link. My issues is where to find a team to collaborate with and data to use since I’m new to coding and want to build up my projects so I can find a better job. I can look on Reddit to find a team who want to work with each other. As for my dataset, will I be straight just using the examples from Kaggle for now? There is so much stuff that I have to know that my mind gets scrambled from time to time.
 

Snoopy Loops

All Star
Joined
Aug 4, 2013
Messages
1,606
Reputation
230
Daps
3,998
Brehs, is it worth building a multi-vendor e-commerce type app from the ground up? :patrice:

Lets say it uses a MERN (MongoDB-Express-React-Node) stack, taking a microservices/event bus style approach (Kubernetes pods for multiple services)

Have a project in mind that I feel can be successful if done right, given the void in the market.

Will be the solo dev for the most part. Have time on my hands as I recently got laid off:skip:, and coupled with savings and unemployment checks, can afford 5/6 months of undistracted development time.

Using a project from a Udemy course with very similar scope as the base, but not sure if I'll be able to manage the complexity by myself when its time to wire up the react app with the backend. Also wondering if I'm reinventing the wheel, when shyt like Shopify exists.

I need seasoned brehs to set a nikka straight
 
Last edited:

Pyrexcup

Superstar
Joined
Dec 30, 2012
Messages
4,746
Reputation
765
Daps
14,814
Reppin
NULL
Brehs, is it worth building a multi-vendor e-commerce type app from the ground up? :patrice:

Lets say it uses a MERN (MongoDB-Express-React-Node) stack, taking a microservices/event bus style approach (Kubernetes pods for multiple services)

Have a project in mind that I feel can be successful if done right, given the void in the market.

Will be the solo dev for the most part. Have time on my hands as I recently got laid off:skip:, and coupled with savings and unemployment checks, can afford 5/6 months of undistracted development time.

Using a project from a Udemy course with very similar scope as the base, but not sure if I'll be able to manage the complexity by myself when its time to wire up the react app with the backend. Also wondering if I'm reinventing the wheel, when shyt like Shopify exists.

I need seasoned brehs to set a nikka straight
I can tell you from personal experience that the majority of e-commerce is done using shopify/woocommerce big commanies selling online will have the money/resources to build the their own platform and smaller companies use shopify/woocommerce. Is this supposed to be a hobby or real software/platform you want to pitch?
 

Snoopy Loops

All Star
Joined
Aug 4, 2013
Messages
1,606
Reputation
230
Daps
3,998
I can tell you from personal experience that the majority of e-commerce is done using shopify/woocommerce big commanies selling online will have the money/resources to build the their own platform and smaller companies use shopify/woocommerce. Is this supposed to be a hobby or real software/platform you want to pitch?
Both tbh. Really tryna have something in my portfolio, but I think it can be pitched. Tbh I don’t feel like learning php for woo commerce. Shopify doesn’t have much multi vendor support.
 
Last edited:
Top