Thread has been deleted
Last comment
Java programming question
 | 
United Kingdom heatwave192 
Good Day mens, I have a school project I need to complete in java. I need to make a program where a user enters a budget, then the program pulls data from PCPartPicker, and prints out the best hardware for the price. I have found an API online (github.com/JonathanVusich/pcpartpicker), although I can't exactly figure out how to work it.(I know it is in python but I can link it to java) Does anyone have any advice? Thank you
2022-07-06 18:09
Topics are hidden when running Sport mode.
lol... cool.. I was able before... but tired to do that now... hope a good lucky to find one.
2022-07-06 18:11
2 replies
#4
 | 
United Kingdom heatwave192
you speak great london
2022-07-06 18:13
1 reply
No. speak South of Brazil.. Roger....
2022-07-06 21:24
read the git repo? google?
2022-07-06 18:13
18 replies
#8
 | 
United Kingdom heatwave192
Doesn't really help me, and even if it is useful I am not very experienced in programming. There isn't much use of that API, can't find much on it online
2022-07-06 18:16
16 replies
wait you are not very experienced but are tasked to do this? university? did he not give clear instructions atleast? try scraping the pcpartpicker website instead, but idk its a bit complicated for highschool imo why from pcpartpicker? make your own "version" instead, and decide how many % of budget is good for gaming/desktop etc, then just make a class that finds the first gpu/cpu/psu etc that suits
2022-07-06 18:18
15 replies
No it's an individual project which I pick and he approved, high level high school / low level university. I have been programming for maybe 2-3 years
2022-07-06 18:18
14 replies
gl
2022-07-06 18:20
1 reply
thank u mens))
2022-07-06 18:20
Keep on practising my guy, uni will be a breeze with existing coding experience and genuine interest regarding coding. Signed, Masters in Comp Sci
2022-07-06 18:59
11 replies
hahah damnn, I start studying for a Undergrad or maybe masters in compsci next year, thanks for wize wurdz
2022-07-06 19:01
Were you good at maths in high school? Im not very bad at it, grade is ok (barely got 8/10) but sometimes im struggling a little, just finished 11th grade
2022-07-06 20:10
9 replies
Pretty good yeah, didn't enjoy it but I understand math in general. Coding is math when you start thinking about it, it's basically just logical functions lined and stacked up. Practise logic my guy. That being said, being really good in math is not needed to become a good developer. Few of the best developers I knew in uni barely got through the basic calculus but still are/were excellent developers
2022-07-06 20:12
8 replies
Thats nice to hear, maybe they don’t need to use hard maths in their area of work What about maths in IT security area? Is it important? Pentesting, administrating etc.
2022-07-06 20:21
7 replies
I dont work in sec or put emphasis on it back in uni so I cant speak for certain but I doubt it. Our company has interns and basic ICT engineers/datanoms working on sec and admin so unless you're planning on working for govermental branches or banks/other similar companies, basic datanom education should be enough if that's what you're interested in
2022-07-06 20:25
saying maths is irrelevant is a bit naive but generally if you are bad at maths the company you work for will just get someone who likes and is good at maths to solve the maths problems while you do what you are good at typically compsci grads (programmers) just implement/manage or work as architechts, while the super smart people who studied electro or physics do the heavy lifting in the maths area, although they are mostly needed for hardware development
2022-07-06 21:18
5 replies
Wouldn’t you just get replaced in a smaller company? I think there are a lot of programmers today who are also good at maths right? Like isn’t the market for programmers oversaturated rn. Maybe in your country there are working more programmers in one company (just guessing) but not that many in smaller countries like baltics where are I’m from
2022-07-07 09:09
4 replies
its oversaturated of people who are clueless but no you would not get replaced if you are weak at maths, if a company needs someone who is good at maths they will hire someone form a maths field, not compsci if you finish compsci you have passed some quite hard maths courses though, so yeah everyone is ok at maths and knows how to learn new things if needed tiny companies need 45 year olds who know everything, and require them to work for 50+hr work weeks, its an exception, most people go to work at large companies atleast at the start of their careers (in sweden) if a small company hires you they will know that you are young and inexperienced and try to teach you the things they need from you, although generally large companies are better at talent development
2022-07-07 11:13
3 replies
Thanks for the info
2022-07-07 11:55
You seem like you could answer my dilemma. Should i continue with my maths degree (doing well with essentially no work put in) or switch to cs degree (field i plan to go into, spent most of my time learning cs to the point where a cs degree would be very easy) ? Just finished first yr.
2022-07-07 14:21
1 reply
do whatever you enjoy doing the most, i cant answer that for you maths is very much needed in AI/ML implementations/research
2022-07-07 15:34
+1
2022-07-06 19:31
in me ? :blush:
2022-07-06 18:13
(I know it is in python but I can link it to java) NO
2022-07-06 18:14
4 replies
Yes I can my teacher told me and linking between languages is super common nowadays
2022-07-06 19:04
3 replies
I don't think there is any way to do that, but I don't work with java. Linking like that usually happens when you have a high level language (like python) and need more performance (so you offload the execution to a low level language like C). What you should have done first was open the website, open the tab network in the dev tools and make a request and copy the request form in cURL. If you run that you can get the result as JSON.
2022-07-06 20:22
2 replies
this is the answer
2022-07-06 20:48
i implemented a C++ written motiontracking project in a Java enviroment not too long ago, worked really good but yeah i would just scrape the website and make some script although i think its a bit too much to ask for a highschool student
2022-07-06 21:25
#6
 | 
Russia Ou7bReaK
stackoverflow 4u
2022-07-06 18:15
6 replies
Stack overflow scream at me for not having 30+ years programming experience
2022-07-06 18:18
5 replies
stack overflow answers are really simple 99% of the time tho try learning the fields the answers discuss
2022-07-06 18:21
1 reply
I will try stack overflow thanks
2022-07-06 18:22
#55
 | 
Israel McBeany
I think that they scream at you because you want people to do the work for you. The best way to learn how to code is to just sit on your ass for 8 hours a day and code , and if you get stuck keep trying until you succeed
2022-07-06 19:10
2 replies
Yes mens)) i see what u are saying, I need to become more familiar with the website in general. Thanks for help
2022-07-06 19:14
1 reply
#58
 | 
Israel McBeany
np mens)))
2022-07-06 19:22
dude, it's not a question, what is it that you're trying to do? it's not even something that exists, each has different needs and a set budget cannot give you the optimal build for your needs. building something like that is a big project if you're actually trying to make it good, so again, not sure what you're trying to do and why.
2022-07-06 18:15
8 replies
The technical roadblock which i face is the information pulling from PCPartPicker, through the API. Obviously it won't always be an optimal build and all that, but it's an program which I can improve on once I can beat this problem
2022-07-06 18:17
7 replies
either build your own API or just make functions to run the python API and return the values from it. maybe even a python server that communicates with API to get the data, but personally I find it pretty stupid and way too much work for that.
2022-07-06 18:21
2 replies
yeah the simplest solution if you dont know how to communicate directly with pcpartpicker would just be to have your program in java use the python api. Haven't personally mixed languages like that before but I know it's very possible to do, do some research on pipes. Just have the python api do a "GetAllPCParts" kinda call and then do all the filtering on your own in java
2022-07-06 18:33
1 reply
Alright I'll try and look into that, seems like a good idea, I already know how to call All parts for each part type (CPU , GPU , etc..) but thats about it, I will try and get that in my java. Thanks
2022-07-06 18:59
might need to figure out how to make your API in java instead of trying to implement a bridge between your python and java code and it would also be a good learning experience. Seems like you picked an ambitious project in comparison to your skillset but if you use youtube to figure out parts of how to create an API it is a good start. "java API guide"
2022-07-06 18:57
3 replies
Ok thanks for the advice, also I told my teacher about this and he said it's good for me, we have around 7 8 months for this project. It takes that long cuz we have a lot of documentation.
2022-07-06 18:58
2 replies
i assume this is the A level comp sci project, i remember doing mine 3 years ago, best of luck
2022-07-06 20:03
1 reply
yep my NEA haha, we are a couple months in already, now I am at the time where i do the big bulk of programming. Thank u mens)) !!
2022-07-06 20:04
1 steal mom's credit card 2 go on fivver 3 hire indian 4 relax and be toxic on faceit 5 graduate
2022-07-06 18:18
2 replies
I wish akhi
2022-07-06 18:19
Based
2022-07-06 19:03
There is a concept called clustering in data mining. Find a java program for that. And dont use it on ur idea, that is partpicker
2022-07-06 18:20
#21
 | 
Moldova nutel
Maybe find an public api and base ur project around that. Considering we are on csgo forum you can try and use developers.faceit.com/start/intro (faceit api) and do something fun with it
2022-07-06 18:24
1 reply
Sure I will try to find some time to practice with that thanks
2022-07-06 18:51
#22
Xyp9x | 
Europe Kynks
Is it necessary to have that API? Go find REST API, there are a lot of free apis
2022-07-06 18:25
4 replies
Not necessary to use that API, thank you for suggestion I will look into that
2022-07-06 18:30
3 replies
#35
Xyp9x | 
Europe Kynks
2022-07-06 18:36
2 replies
damn thanks website looks cool AF for programming projects
2022-07-06 18:39
1 reply
#39
Xyp9x | 
Europe Kynks
you are welcome, ask me if you have any other question
2022-07-06 18:41
just to be sure, how detailed it need to be? its mandatory to use the api? if you can slack, i would try webscrapping (look out the beautifulsoup library for python) and use the build guides link (pcpartpicker.com/guide/) to get an build. or if you are serious, i would go with what #9 said and do it yourself.
2022-07-06 18:25
1 reply
NoNo I don't need to use any API at all, i just need to achieve the same result, how I do it doesn't matter at all. Thank you, I will look into webscraping and what he said
2022-07-06 18:31
#24
 | 
Italy zCri
Unless you want to bother making bindings for the python library you sent (see wiki.python.org/jython), you're better off just porting the library to java using some webscraping library like jsoup or.. just use the python library and make ur program in python
2022-07-06 18:27
1 reply
Ok I will look into jsoup thank you
2022-07-06 18:38
thank you for leaking your name and surname by yourself. I am gonna find all of your private information and leak it.
2022-07-06 18:27
2 replies
thats not him lol
2022-07-06 18:32
1 reply
nt
2022-07-06 18:32
Try class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); } }
2022-07-06 18:29
2 replies
#28
Xyp9x | 
Europe Kynks
can u hack NASA with HTML mate?
2022-07-06 18:31
1 reply
I'd need little bit of css
2022-07-06 18:53
You have to do it, you can read that python project to know how it works, but before that you have to test it if still works cuz it seems that pcpartpicker has no official API yet, that python package is just a web scrapper for pcpartpicker site
2022-07-06 18:32
1 reply
Yeah I see, I'm still not sure if it completely works, I was just asking to look for other options. Thanks for help though
2022-07-06 18:52
Use JavaScript not Java. Java sucks.
2022-07-06 18:33
2 replies
Have to use Java not JS sorry mate
2022-07-06 18:40
JavaScript sucks, use Python
2022-07-06 19:03
If you dont actually need to use any API and you dont need to connect to PCPartPicker but need to create something similar. create your own database with all the parts and etc. Ask the user for their budget but also if they want a stronger cpu or gpu and how much ram is minimum requirement for them. You also need to ask them the minimum gpu and cpu specs. Do this by giving them a list of the products from the database table. Then using that you can easily query the with the minimum requirements and then if they want a strong cpu, find all the minimum products, whatever money is left over. Use that for the cpu. Giving the user a list of items will also give you the ability to add a feature where they can just pick the parts themselves which can get you more marks.
2022-07-06 18:47
2 replies
If you dont want to ask the user if they want a stronger cpu or gpu. for every part in the db, give it a score out of 10 of how good the part is. Then create an algorithm will get you parts for the computer were the scores are averaged and similar to one another. This way you wont get a insane cpu and a shit gpu or for a 1000 budget, it wont get a gpu for like 700 only leaving 300 for rest of the pc.
2022-07-06 18:51
1 reply
Damnnnn bro this idea is cool AF hahaha nice idea. Thanks for comment I will think about this idea
2022-07-06 19:24
#50
 | 
Chile eseeme
I don't understand much but maybe it can help you. I assume you want to consume pcpartpicker from java, you should first instantiate a python environment and install the dependencies with pip, then in your java project you can call it to run the script every time you query some data. baeldung.com/java-working-with-python
2022-07-06 19:03
1 reply
Ok i will look into your suggestions thank you
2022-07-06 19:59
#54
 | 
Canada f0rkb0mb
No idea how to integrate beautiful python into garbastic java.
2022-07-06 19:08
to find data from pcpartpicker, if you dont know how to use the api and you dont have time to learn python, go figure out how to use selenium to web scrape on java in terms of printing out the best hardware you are going to need to determine many more variables about the user than just budge (ex what u need pc for)
2022-07-06 19:14
2 replies
Yep i have a couple options about asking the user what they need the PC for however, I will look into selenium, thanks
2022-07-06 20:01
1 reply
to make it super simple, id recommend asking a few questions and then based on the questions, splitting the budget into percentages to spend on certain components, then take the split budget and select the best equipment available at that price should be super simple and good enough for school project
2022-07-06 20:29
Use Java 11 with sprint boot and look for some course on Udemy to help...
2022-07-06 19:29
2 replies
Spring*
2022-07-06 21:44
1 reply
+1 xD
2022-07-06 21:54
Its so sad they still teach Java in schools, its like COBOL or something... I don't understand why anyone would use it in new projects today
2022-07-06 19:39
1 reply
It has some good uses, very well supported.
2022-07-06 21:45
You could try constructing a scheme to segment the budget for specific parts. Like for budgets $1000 and below, you could allocate atleast 30% to the GPU, 25% to the CPU+Cooler, and so. Compare the scores of all the products within that price range, choose the one with the highest score, and record the excess/deficit to later tally it to the final price. For instance, if it's a $1000 build, the targetted GPU segment at this price range will be around ~$300-$400. The best performing GPU at this price range is the 3060 Ti at $400. The excess in this case is $100. Tally that to the final price, so that, when choosing the other parts, you keep note that you have $100 less to spend than what you would've otherwise had.
2022-07-06 19:37
3 replies
yep I have ratios set for each part, I have a variable for surplus budget, and then I add to that each time, giving the user an option at the end to use more of that or leave there build like that. Thanks for ur advice though
2022-07-06 19:47
1 reply
you're welcome and good luck :)
2022-07-06 20:08
thats a really cool idea!
2022-07-06 20:47
If youre really keen on using this dudes github you can 1. export the user input into a .txt 2. Use OS commands in java to call a python script 3. In the python Script read the data from the .txt and call the necessary functions to calculate it 4. Export that data to a .txt 5. Read the data in your java program and be done Its ugly but it should be very easy to implement
2022-07-06 19:38
1 reply
I wouldn't say i'm really keen but thanks for all this help, I will definitely try your method!!
2022-07-06 20:02
#68
 | 
CIS 2ocean
Use backtracking algorithm, it is the easiest solution for you task
2022-07-06 20:02
7 replies
Sorry I am not familiar with this term, what roughly is a backtracking algorithm? thanks
2022-07-06 20:05
3 replies
#76
 | 
CIS 2ocean
en.wikipedia.org/wiki/Backtracking Actually I have no idea how to implement it in your case. You can hook prices from PCPartPicker with API and then use this algorithm to find the best set of price/hardware
2022-07-06 20:08
1 reply
Ok thanks for ur ideas, i will take them onboard
2022-07-06 20:15
with backtracking, you're basically brute-forcing through every possible parts combination you could assemble for a particular budget. Not every optimal imo
2022-07-06 20:07
2 replies
#77
 | 
CIS 2ocean
It is, but I proposed one of the possible solutions
2022-07-06 20:09
Ok I will probably look into APIs / webscraping
2022-07-06 20:16
java is ass
2022-07-06 20:32
yea I'd probably spend a couple days getting familiar with web scraping and text file handling in java before trying to figure out the algorithm for the hardware. Does the site have that function where you choose a piece of hardware and it only displays compatible products so you can build your own PC? otherwise it's gonna be a bitch pretty sure you've seen this link but this looks useful webscrapingapi.com/java-web-scraping/
2022-07-06 20:36
2 replies
+1 yep, you can only choose compatible pieces of hardware
2022-07-06 20:39
Yeah I think ive seen that link again but its deffo good for another read thanks for attaching it. And I will probably use some sort of classes and object oriented programming, to classify hardware and help group compatible hardware together.. Thanks for help though
2022-07-06 20:47
how would you even know what's the best possible pc for that price? if I were you, I would do something else. Take the pre-built computers from here pcpartpicker.com/guide/ and show the two closest to the price required. You can do that really easily.
2022-07-06 20:37
1 reply
Yeah that is a good idea, however It wouldn't be complex enough for my program. It is a big project so i need to spend a lot of time on it. I set up percentages of the budget so that each component can be dedicated a certain percentage of it. thanks for suggestion though
2022-07-06 20:45
I would just write a minor Web Scraping program and create objects for each type of item. Create ArrayList of each object and sort them by price, then you just grab items by list position to create the prices.
2022-07-06 21:30
1 reply
ohh yeah i see what ur saying, sounds cool maybe i can implement this in some way thanks
2022-07-07 10:45
Just to try and maybe full in some gaps. There is no public API for this, that 3rd party software you shared is unofficial, it's gotten from scrapping. So it's functionality is very very limited, and you have to write the code yourself to make the data useful. Basically you have found something difficult.
2022-07-06 21:52
3 replies
#103
 | 
Germany Sonnabend
Very difficult in Java at least
2022-07-07 10:07
1 reply
Just difficult for his level. I'm a Java developer so this is not difficult for me. I would still have chosen a more straight forward thing to do.
2022-07-07 15:43
ok sure thanks for advice
2022-07-07 10:46
Login or register to add your comment to the discussion.
Now playing
Thumbnail for stream
France
kennyS
3377 viewers
Top streams
All(20)
Casters(14)
Streamers(5)
Organizers(1)
France
kennyS
(3377)
Other
Elisa Esports
(2654)
Sweden
GeT_RiGhT
(1990)
Mongolia
META
(1764)
France
KRL
(903)
Other
Esportal
(673)
Brazil
Apoka
(498)
Brazil
mch
(389)
Russia
n0rb3r7
(277)
Spain
the real fer
(262)
Denmark
wonderbai
(237)
Brazil
Jogando Junto
(220)
Poland
fines
(135)
Sweden
Luddiie
(122)
Australia
Hatz
(103)
Denmark
AcilioN
(64)
Romania
Antonia Nuckle
(42)
Australia
Conkyyy
(21)
Germany
Fragster 3
(16)
United States
Dugaid
(11)