• Breaking News

    Saturday, October 31, 2020

    The big rewrite. You know, that piece of legacy no one wanted to touch.. How did you finally convince management to let you do it? Ask Programming

    The big rewrite. You know, that piece of legacy no one wanted to touch.. How did you finally convince management to let you do it? Ask Programming


    The big rewrite. You know, that piece of legacy no one wanted to touch.. How did you finally convince management to let you do it?

    Posted: 31 Oct 2020 09:28 AM PDT

    What's the most efficient way to add a percentage of a number to that number (like sales tax)?

    Posted: 31 Oct 2020 09:30 PM PDT

    I'm specifically using Python, but I'm really just wondering about the logic piece. Say I have a variable price--which is an integer: 6--and another variable salestax--which is a float: 0.0725.

    I can add the sales tax with price + (price * salestax). Is there a more efficient way to accomplish this?

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

    Can we code directly to Machine Language?

    Posted: 31 Oct 2020 09:12 PM PDT

    Hey Everybody, I was just wondering, if every program finally converted into machine language (Binary Codes) by the compiler or interpretor.

    Can we program directly to binary and save it as executable ?

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

    Recording browser interactions and saving clicked links.

    Posted: 31 Oct 2020 10:29 AM PDT

    Hi,

    I was looking for some advice on how to tackle this project idea. I want to be able to record whenever a user opens links on reddit or twitter.

    The links would be stored in a SQL database for scraping later.

    I'm fairly stuck on this initial roadblock and would appreciate any advice on how to achieve this.

    Here's a walkthrough idea: https://streamable.com/l0q2lf

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

    What's the simplest code repo for small teams?

    Posted: 31 Oct 2020 09:08 AM PDT

    I'm tasked with finding and deploying a code repo for my small team of just three developers. I'm not looking for anything for anything fancy, really it just needs to serve as a source control for code maintenance and collaboration.

    I have experience as a user of both GitLab and AWS CodeCommit, but no experience as an admin. But I'm also looking into GitHub as well as it looks simple so far.

    So I'm really just looking for people's experience? If I were to start from scratch with any which would you recommend?

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

    How to save table data server side (HTML/Javascript)

    Posted: 31 Oct 2020 06:50 PM PDT

    Here is a link to how the program works: https://jsfiddle.net/Sciphr/q37416cd/2/

    In short, this table will be edited by the user, and I want the table information to be saved for the next time it is loaded. Currently, the table is just headers since there is no saved data. This would be for a business so preferably I can't just LocalStorage.

    Any help here would be greatly appreciated.

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

    Python script to watch a google spreadsheet

    Posted: 31 Oct 2020 06:27 PM PDT

    My college currently has a signup for the gym because of covid-limited capacity.

    Basically it's just a publicly editable google sheets page, and every day at 9:00 PM they add a new sheet for the current day +2. So at 9:00 PM on Wednesday, a new tab for "Friday" appears at the bottom of the page and it's basically a free for all until the 50 or so slots get filled.

    I really like working out, and I also am good with programming (Computer science major). So, I'm looking to do any of the following

    • Write a script of some sort that watches the website and emails me when a new tab is added. Since generally the new tab is not added right at 9:00 PM, setting a simple alarm doesn't really help. It's usually +- 1 hour.
    • Write a script of some sort that watches the website and automatically fills my name into the first open slot when a new tab is added.

    I'm definitely able to write code to do this, but I was wondering if anybody has had experience with something like this before, since I'm not totally sure what kind of infrastructure I need to use. I'm willing to do the learning on my own, just generally looking for a point in the right direction. Do I need to use Google Sheet's API, is there a certain library designed for this, etc. I did some searching on the web but generally it just point back to Sheets API and I'm not sure if that's actually the right place to start.

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

    Help a future programmer

    Posted: 31 Oct 2020 04:37 PM PDT

    I want to start programming and I want to understand the true principles in programming. Which programming language should I learn first I have already started with HTML and CSS which I know are not programming languages But I want to chose either Python or Java what should i do?

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

    Creating a non static method in NetBeans?

    Posted: 31 Oct 2020 03:28 AM PDT

    So I'm a beginner at this, I just know a few basic things. In School, we worked with BlueJ, but that, for some reason, is really slow on my PC at home so I installed Eclipse.
    Eclipse didn't work at all, so I got NetBeans, where I wrote a short "Hello World"-Application. It worked and I was quite happy, but when I copied a bigger project that I started in BlueJ into NetBeans I encountered a problem: NetBeans wants me to create a static main method, but that means that I cannot declare variables within the class but have to do it within the method; I do need to do that though, so that I can use the variables in all the methods that I want to create and not just the one that I declared them in.

    Does anyone here know how I can use a normal, non-static method in NetBeans?

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

    Help with data reading

    Posted: 31 Oct 2020 03:41 PM PDT

    Hello, I am still new to C++ and am trying to make a program for practice. I am trying to use a random number generator, then take the number generator and use it to read and print a piece of data from an excel spreadsheet of the same number. What is the best way to integrate an excel spreadsheets or other data tables?

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

    Trying to use selenium on python to change the value of hidden input or sendkeys to a text field

    Posted: 31 Oct 2020 01:36 PM PDT

    I am trying to sendkeys to a specific text field, but it won't send anything. I suspect its because of the html code load-remove. Basically, I input some text, a dropdown window appears, I then am supposed to select the input. I notice that the input type "hidden" changes value after I select my choice. Would it be possible to change the hidden value directly with selenium? I have included imgur links to show the process. Ignore the last picture, I have included my new updated code.

    https://imgur.com/a/FCwmGKA

    from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC import time PATH = r"C:\Users\KELLY\Downloads\chromedriver_win32\chromedriver.exe" driver ="website/") inputName = driver.find_element_by_id("Email") inputName.send_keys("Name") inputPW = driver.find_element_by_id("Password") inputPW.send_keys("PW") inputPW.send_keys(Keys.RETURN) addEntry = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.ID, 'btnAddCEntry'))) addEntry.click() inputClient = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.ID, 'txtClientAccount'))) inputClient.click() inputClient.send_keys("Brandon") 

    This is the Html code of the page

    <div class="col-sm-8 pad-l-0"> <input type="text" name="client" id="txtClientAccount" class="form-control required nonsubmittextboxauto drpProg ui-autocomplete-input valid" placeholder="Type Client Name" maxlength="50" autocomplete="off" aria-invalid="false" aria-describedby="txtClientAccount-error" part="John Doe><span id="txtClientAccount-error" class="error" style="display: none;"></span> <span id="fAccountClient" class="error accessibility-hide"></span> <input type="hidden" name="ClientId" id="hdnEmpClientId" class="clshdn" value="15084"> <div class="load-spinner" id="dvSpinnerClientAccount" style="display: none;"><i class="fa fa-spinner fa-spin"></i></div> <div class="load-remove" id="dvRemoveEmpAccount" style="display: block;"><i class="fa fa-times"></i></div> </div> 
    submitted by /u/kvndakin
    [link] [comments]

    c++ pointer question

    Posted: 31 Oct 2020 12:17 PM PDT

    Question: The variables xp and yp have both been declared as pointers to integers, and have been assigned values

    Write the code to exchange the two integers. (so that after the swap xp still points at the same location, but now it contains the integer value originally

    contained in the location pointed by y; and vice versa-- in other words, in this exercise you are swapping the integers, not the pointers).

    Declare any necessary variables.

    my code:

    int *temp;

    temp = xp;

    xp = yp;

    yp = temp;

    So, I think I'm messing up the order of this, but I'm not sure how...

    Any advice or help appreciated!

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

    Novice Java programming questions: Game dev focus

    Posted: 31 Oct 2020 12:08 PM PDT

    Hey guys, I'm a fairly novice level programmer with the intent to make video games. Right now I'm trying to find a good source for learning these more specific skills. Are there any particular books or anything you would recommend? I saw several on Amazon that looked decent, but I would like some insight/recommendations. Thanks in advance

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

    What multi-purpose programming language is most suitable for manipulating .xlsx files?

    Posted: 31 Oct 2020 10:57 AM PDT

    I have seen some recommendations about python with pandas or with openpyxl and I've seen some recommendations about R.

    my main uses will be to extract unorganized data from tables within the .xlsx file. Therefore, I want to be able to access cell's values and to access cells by their position in the table (=by their indexes) and to read and write from/into them.

    If there is a language that is able to manipulate both .xlsx and .xls it will be very helpful.

    btw - I can change the xlsx and xls files to csv files but it will require me to do that manually or with separated powershell script, so i would rather not do that unless it is a lot better than any other option.

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

    How does runtimes know the types of variables in memory?

    Posted: 31 Oct 2020 05:25 AM PDT

    How to convert this mathematical formula into C++ code

    Posted: 31 Oct 2020 05:23 AM PDT

    Please, help to write this formula(on photo) in C++ code.

    Photo of formula here: https://imgur.com/a/1e0zp96

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

    Is there a busy subreddit for finding developers to hire?

    Posted: 31 Oct 2020 08:57 AM PDT

    I found r/hireaprogrammer, but it seems have very low activity. Is there another one that is better for that sort of thing? I don't want to spam this sub with that stuff.

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

    HTML Tables image

    Posted: 31 Oct 2020 08:48 AM PDT

    Hi,

    I'm a beginner in HTML and am learning HTML, CSS and JavaScript by coding a travel site (in french, cause I am, so sorry for french words in code) (also not my first question here so you may have seen one of my posts)

    I was told by me teacher to change my way to display offers (currently a succesion of href) to a table .
    But I have difficulties to make it clean, the main problem being the image not taking the proportions of the cell. I am using background-image in CSS but I end up with a cell background being a portion of the image, how can I change that ?

    Screenshot and detail : https://imgur.com/ExqPw41

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

    Win32 Resources

    Posted: 31 Oct 2020 03:36 AM PDT

    Hello, I've been learning C++ for a few months nows, and I want to learn how to build my own Windows Applications. What are some good resources I can use to learn? Also I prefer text more than videos tutorial, so if anyone have any cool books, that would be awesome!

    Thanks in advance!

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

    django: NoReverseMatch question

    Posted: 31 Oct 2020 03:05 AM PDT

    a snippet from my base.html:

    <div id="button_container"> <button class="button"><a href="{% url 'home' %}"> HOME </a></button> <button class="button"><a href="{% url 'rooms' %}"> ROOMS & SUITES </button> <button class="button"><a href="{% url 'roomBookingsList' %}"> ROOM BOOKINGS </button> </div> 

    urls.py:

    path('rooms/mybooking', views.roomBookingsList, name='roomBookingsList'), 

    my views.py:

    def roomBookingsList(request): suiteBookingList = Suite_booking.objects.all() context = { 'suiteBookingList': suiteBookingList, } return render (request, 'roomBookingsList.html', context=context) 

    a snippet from the roomBookingsList.html:

    {% for suiteBookingList in suiteBookingList %} <li> {{ suiteBookingList }}</li> - <a href="{% url 'edit_suite' suite.id %}">Edit</a> {% endfor %} 

    So before I added that Edit button above, when I click ROOM BOOKINGS from base.html, it will show the list of suite bookings. No problem there. Then I added the Edit button, I also added these:

    urls.py:

    path('rooms/suite/edit/<int:suite_id>', views.edit_suite, name='edit_suite'), 

    views.py:

    def edit_suite(request, suite_id): if request.method == 'POST': suite = Suite_booking.objects.get(pk=suite_id) form = BookingForm(request.POST, instance=suite) if form.is_valid(): form.save() return HttpResponseRedirect(reverse('roomBookingsList')) else: suite = Suite_booking.objects.get(pk=suite_id) fields = model_to_dict(suite) form = BookingForm(initial=fields, instance=suite) context = { 'form': form, 'type': 'edit', } return render(request, 'roomBookingsList.html', context=context) 

    Now when I click the ROOM BOOKINGS button, it gave an error:

    NoReverseMatch at /system/rooms/mybooking Reverse for 'edit_suite' with arguments '('',)' not found. 1 pattern(s) tried: ['system/rooms/suite/edit/(?P<suite_id>[0-9]+)$'] 

    in the traceback, there's this:

    D:\ssip\hotel\system\views.py, line 59, in roomBookingsList 59. return render (request, 'roomBookingsList.html', context=context) 

    So I think the error is that in def roomBookingsList, I'm taking the Suite_booking object, and in the def edit_suite, I'm also taking the Suite_booking object so they're crashing or something? Coz now I can't even open the list of suite bookings.

    If I delete the Edit button, def edit_suite, etc, it works normally like above.

    I already googled this but none of the results were helpful. I really don't know what else to do/change. Sorry if this looks like a jumble of code.

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

    Best practice to get records from database

    Posted: 31 Oct 2020 04:09 AM PDT

    Hello, I'm using Java with a RDMS. There are 2 ways to get records from database that I can think about:

    - Use only SQL to get desired records. Or ...

    - Get all records from a table (or tables by using JOIN), then use Java to get desired records.

    Which one is better? Thank you.

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

    Calculating winner in uniformly random way given chance of winning

    Posted: 31 Oct 2020 02:51 AM PDT

    If I know the chance of A winning and i know the chance of B winning then how can I calculate a winner in a uniformly random way in code

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

    No comments:

    Post a Comment