• Breaking News

    Tuesday, February 16, 2021

    Java - Getting multiple values from a multimap into a tableview Ask Programming

    Java - Getting multiple values from a multimap into a tableview Ask Programming


    Java - Getting multiple values from a multimap into a tableview

    Posted: 16 Feb 2021 08:17 PM PST

    I am trying to get values from a multimap, where one key holds multiple values. Then I want these values to be added to a tableview , but I am not sure on how to set up the tableColumns and retrieve the values from the hashmap.

    Code :

    public static HashMap<String, ArrayList<Sales>> customerSalesRelation = new HashMap<>(); public static ArrayList<Sales> salesMapList = new ArrayList<Sales>(); public static ObservableList<Sales> salesData = FXCollections.observableArrayList(); 

    Those were the lists that are being used, the customerSalesRelation is the map that I'm trying to get the values from.

    sales = new Sales(); seller = currentSeller.get(0); sales.setSellerName(seller.getSellerName()); sales.setCustomerName(customer.getCustomerName()); sales.setProduct(saleProductNameField.getText()); sales.setPrice(Double.parseDouble(saleProductPriceField.getText())); sales.setAmount(Integer.parseInt(saleProductAmountField.getText())); sales.setFormatDateTime(setTimeNow()); salesData.add(sales); salesMapList.add(sales); System.out.println(sales); customerSalesRelation.put(customer.getCustomerName(), salesMapList); 

    this is how the multimap is created, the values are being stored the way I want them, but how do I actually get them in a tableview? if it's not possible with a tableview, would it be possible with a bar chart instead?

    Thank you!

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

    Struggling With My Masters Due To Depression

    Posted: 16 Feb 2021 05:50 AM PST

    Hi Guys, I'm not sure if this is the right place to post this. If not then I apologise and the mods can delete this. I just don't know where to go or who to ask.

    For some background information, I'm a 27 year old student who is currently studying for her masters in artificial intelligence. Now to give some context, my background is entirely in education and philosophy. I applied for AI because I realised that teaching wasn't what I wanted to do and I didn't want to be stuck in retail for the rest of my life.

    Before I started this course, the only Python I knew was the snake kind. Some background info on my mental health is that I have severe depression and anxiety that I am taking sertraline for and I'm on a waiting list to start therapy.

    My question is that since I've started my masters, I've struggled. One of the things that I've struggled with the most is programming. Python is the language that my course has used for the AI course and I feel as though my command over it isn't great. I know this is because of a lack of practice and it scares me because the coding is the most basic part of this entire course. I feel so overwhelmed when I even try to attempt to code. It's gotten to the point where I don't know how I can find the discipline or motivation to make an effort and not completely fail my masters.

    When I started this course, I believed that this was my chance at a do over and to finally maybe have a career where I'm not treated like some disposable trash.

    I'm sorry if this sounds as though I'm rambling on, I'm just struggling and any help or suggestions will be appreciated.

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

    What was the weirdest commit message you have ever seen?

    Posted: 16 Feb 2021 09:47 PM PST

    Assembly super basic loop question (x86)

    Posted: 16 Feb 2021 08:10 PM PST

    Hello, I am self learning assembly and I am practicing a very simple program that I just can't get to work.

    I am trying to recreate this very redundant and useless c function into an assembly function.

    int redundant(int y) { int x = 0; for (int i = 0; i < y; i++) { x++; } return x; } 

    I understand that I could just return y, but for the sake of trying to understand loops in assembly I'm trying to code this. I'm new to this kind of thing so please let me know if I need to add more information!

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

    Strucures not in the STL library

    Posted: 16 Feb 2021 12:59 PM PST

    Hello everyone I am working on a problem and it is asking me to perform operations without the use of the STL library. It showed me all the structures that were in there but is there any place that shows all the remaining structures that are NOT in the STL class?

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

    Creating a program to Interact with Facebook Live and Facebook Chat

    Posted: 16 Feb 2021 03:58 PM PST

    Hello all. I work at a church and I am tasked with enhancing our online experience.

    My question is:

    Is it possible to create a program, that will interpret what is being said on stream (i.e the sermon) and can interpret phrases, then automatically paste a link (or plain text) in the facebook chat?

    I am extremely inexperienced, but I figured it is possible with enough know-how. Thanks for any responses!

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

    Is it hard for a new college graduate from Europe to get a job in America or Canada?

    Posted: 16 Feb 2021 02:49 PM PST

    I graduated in college last May, and have been unable to find a job, i have been getting to the last round of the interviews before getting rejected. I was wondering about maybe applying to jobs in America and Canada since I hear there is a real shortage over there(in Ireland its very competitive out of college) and I also heard the pay is higher, starting salary in ireland is usually 28k to 32k Euro.

    Would companies be willing to take on Juniors/Associates from other countries or would they only look for national people due to Visa reasons?

    If so, any advice of starting would be much appreciated. And if you have an opening, Im more than willing to send my CV to you(I hope this question doesn't look like im pluging myself).

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

    DV360 API Authentication Ruby Help

    Posted: 16 Feb 2021 01:47 PM PST

    Hello,

    I am so confused/overwhelmed about this. I am using Ruby and have worked with APIs in the past. I have never had this much trouble. I have been at it for days and am getting nowhere. I am following their documentation: Get started | DV360 API | Google Developers

    I can't even authenticate.

    The example in the google-api-ruby-client repo looks like this:

    # Load the client require "google/apis/displayvideo_v1" # Create a client object client = Google::Apis::DisplayvideoV1::DisplayVideoService.new # Authenticate calls client.authentication = # ... use the googleauth gem to create credentials 

    After much fiddling with this and attempting to integrate the client.authentication field I am stuck.

    Concerning this other example (Command Line): googleapis/google-auth-library-ruby: Google Auth Library for Ruby (github.com) . I have no idea where they're getting " /path/to/tokens.yaml ". From my knowledge the only thing I had to download was client_secrets.json.

    Just feeling confused and overwhelmed. Please help. Thanks.

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

    I want to create an interactive map of the world but I don't know how to start

    Posted: 16 Feb 2021 01:00 PM PST

    Hi! I'm Stefano, I've a very low knowledge about programming (just the basics of C++ in school) but I had a very cool idea about a web map. It's an interactive map, historical correct year by year that follow all the world history. I don't even know how to start programming but I want to learn how to do it! With which language you think that I have to start? How can I do it? Is it possible?

    If you can give even a little idea or help I'll be very grateful

    (Sorry for the English btw)

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

    Getting motivated while feeling depressed?

    Posted: 16 Feb 2021 12:01 PM PST

    I just finished a bootcamp and struggling to find work as a jr. Developer since I probably need a better portfolio but I'm so unmotivated right now.

    It's hard to say I'm not interested in coding with my current state of mind. I am more of a visual person and think tapping into my creative side with programming would be best to "light that fire" but any advice?

    Learning to code is already hard and being depressed makes it 10 times harder. I have bad adhd and staying focused is challenging so idk if doing more web design might be attractive to me? I'm struggling with staying interested in the apps I've built in my course and trying to practice them or even doing coding challenges on leet seems dull to me.

    Any advice is helpful. Feeling lost 😞

    submitted by /u/Stock-Ad3610
    [link] [comments]

    I'm a year or so off from graduating, no relevant experience in my field of interest. What should I do?

    Posted: 16 Feb 2021 11:38 AM PST

    So I'm interested in becoming a web developer. However, I have no internships in my field. Currently majoring in IT at an online university that's catered more for already working professionals (WGU). My work experience mainly consists of dealerships and retail.

    One thing I was thinking of doing is making a GitHub portfolio and really working hard on developing my knowledge of web dev, as well as any relevant soft skills that can help aid me in my career. I already have my associate's degree, but I know that the market is competitive. Especially due to the corona-impacted economy.

    Am I completely screwed here?

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

    Python turtle module: How do I make a turtle object disappear after a certain amount of time? (ex: after 1 second)

    Posted: 16 Feb 2021 05:12 AM PST

    I think the title says it all. Thank you in advance for the response :) Cheers.

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

    Some good ways to recall programming and the concepts?

    Posted: 16 Feb 2021 06:36 AM PST

    I started programming again from today after 2-3 months gap. Is there any good ways that I can recall what I have learned before in programming and the programming language concept and principles?

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

    Package installed with PIP, but getting ModuleNotFoundError

    Posted: 16 Feb 2021 10:19 AM PST

    !pip install pybettor

    Requirement already satisfied: pybettor in /usr/local/lib/python3.6/dist-packages (0.0.1)

    from pybettor import implied_odds

    ModuleNotFoundError: No module named 'pybettor'

    I am doing this code in Google Colaboratory. It mentions to use !pip command to install.

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

    About CPU architectures and compatibility

    Posted: 16 Feb 2021 09:24 AM PST

    Hello!

    I've started studying computer science at a University this year. I've always wanted to do programming (to make games to be more exact) and I've been doing so since highschool usually with more success.

    Now there is some theory which I had a hard time understanding even with what I learned here (They can be quite superficial sometimes, but I guess a part of studying at a University is learning by yourself).

    I've had these questions for a long time and after researching a lot, with all the new knowledge I've gained in the recent months I think I have them answered, but I want to make sure, so I came here to ask if my assumptions are correct.

    1. We learned that each processor has its architecture and understands the relevant instruction set, and we learned about many architectures, so I couldn't really understand why it seems like whatever type of program I run, it seems to be running on any hardware, but not on any os. So for the architecture part, I found that there are really only 2 architectures used these days in PC, these are x86 and the 64-bit version x86 x64. Now, these are as far as I know share a base instruction set, so any program compiled to x86 should run on x86 x64, while if compiled for x86 x64 it is not guaranteed to run flawlessly but it can. On the other side, if the binary is for architecture I don't see why is it not multiplatform? I understand that different OSs behave differently, there are different syscalls but after compiling it, it is just binary, I don't understand where is the problem? I can see that the OS may treat memory allocation, permissions, etc... differently but I just can't see when is that exactly colliding? If the OS decides that your binary shouldn't get the memory it asks for or anything, it just won't give it to them, so I can't see why you can't run a binary on any OS
    2. I know that Java runs on JVM and .NET is running on the CLR. Now I understand that both of these are VMs and provide a compatibility layer, resulting in cheaper development as you don't have to maintain code for different architectures or OSs. In the case of JVM, it is still relevant due to cross-platform, but CLR as far as I see is kind of pointless now as it only runs on Windows and there aren't different architecture nowadays, like there used to be when .NET was made. Is this correct?
    submitted by /u/66Gramms
    [link] [comments]

    Machine learning on Android

    Posted: 16 Feb 2021 06:21 AM PST

    Is it possible to train a custom model to detect potholes and perform this function all on android? If yes can you please guide me to relevant topics and studies? Thanks.

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

    Visual Code Terminal

    Posted: 15 Feb 2021 11:25 PM PST

    Hey everyone,

    I am not sure if this is the correct place to ask but here I am.

    I'm using visual code for have programming. I figured out how to use the debit console to show my out put code. Unfortunately, it isn't able to take input from the keyboard it seems (looked on web and that's what my understanding is).

    So, back to the default Terminal. The issue is that it's hard to see what's in it because of all the stuff that's in it.

    Example: PS C:\Users........a massive amount of lines and extension info and all that.

    I can put up an image of need be. It also reappears after a ctrl+P/L

    So my question would be: is there a way to hide it or stop it from showing up?

    I just want a clean Terminal. I don't need to see where my program is originating from or what extensions I have.

    Thank you for your time.

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

    Please can someone double-check the outcome of this game?

    Posted: 16 Feb 2021 03:11 AM PST

    I've worked it out mathematically, and come to +23.329. However it'd be nice to see if my maths is right (and suffice to say I have zero programming skills to be able to run any simulations).

    The game: roll a 37-sided dice (yeah screw using 'die' as the singular) and attempt to hit a 1-in-37. You can throw it a maximum of 10 times, and if you succeed at any point the game stops.

    1st attempt: if successful, get +1750 and stop, otherwise roll again.

    2nd attempt: if successful, get +1700 and stop, otherwise roll again.

    3rd attempt: if successful, get +1650 and stop, otherwise roll again.

    4th attempt: if successful, get +1600 and stop, otherwise roll again.

    5th attempt: if successful, get +1550 and stop, otherwise roll again.

    6th attempt: if successful, get +1500 and stop, otherwise roll again.

    7th attempt: if successful, get +1450 and stop, otherwise roll again.

    8th attempt: if successful, get +1400 and stop, otherwise roll again.

    9th attempt: if successful, get +1350 and stop, otherwise roll again.

    10th attempt: if successful, get +1300, otherwise get -450 and stop.

    If I play this game many times, what's my average score?

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

    Looking for app with currency-like system

    Posted: 16 Feb 2021 01:53 AM PST

    Hey there!

    I hope this is the right place for this kind of question. My friends and I play a lot of roleplay and now we would like to set up our own little site with login area and a credit system with a virtual currency. Maybe also so that people can send money to each other.

    Since the whole thing is only for roleplay, it does not have to be very secure. Unfortunately, I found nothing on Google so far. A wordpress plugin would also be ok.

    Thank you very much!

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

    Need Help with Banner HTML

    Posted: 16 Feb 2021 01:36 AM PST

    Hello!

    I've recently taken on the task of writing my company's newsletters to clients. I'm trying to spice up the formatting a little with next to 0 background in HTML.

    We're using MAILCHIMP as our service which I'm finding limiting in it's dynamic content so I started to play around in codes to make grids etc.

    Currently, I want to copy an email format I saw with our company name in the middle, and two separate links beside them. I can't achieve this currently without sacrificing the space and pushing the links into new lines.

    Since I can't post pictures, I'll replicate it with text.

    | LINK1__________COMPANY LOGO IMAGE__________LINK2|

    Any help or advice anyone has would be much appreciated. Thank you!

    -MK

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

    Prime number in python

    Posted: 16 Feb 2021 12:36 AM PST

    Hello there.

    I have an assignment on determining if a number is prime using python.

    The professor gave us a code to try and understand the way it should be:

    n = int(input("Enter n:")) if n<=1: print(n,"is not prime") else: isPrime = True d=2 while d<=n-1: if n%d ==0: isPrime = False break d=d+1 if isPrime: print(n,"is prime") else: print(n,"is not prime") 

    I got not problem with that.

    Come to this:

    Speedup. Do you have to check all the integers 2, 3, . . . , n − 1? Argue that it is enough to check if n is divisible by an integer d such that 2 ≤ d ≤ √n Use this observation to write more efficient version of the above primality test. Note that you can check if d ≤ √n without finding the square root of n: check if d ∗ d ≤ n.

    I'm stumped. Any help would be appreciated.

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

    I'm getting segmentation error and I can't understand why, can anyone help me out and tell me where I'm going wrong? Code is given below

    Posted: 16 Feb 2021 12:06 AM PST

    No comments:

    Post a Comment