• Breaking News

    Tuesday, January 12, 2021

    In your experience, how common is it to have experience with Functional Programming? Ask Programming

    In your experience, how common is it to have experience with Functional Programming? Ask Programming


    In your experience, how common is it to have experience with Functional Programming?

    Posted: 12 Jan 2021 02:56 PM PST

    I am somebody who did regular OOP for a while but eventually learned some FP and really enjoyed it. It has influenced my style. Although I mainly write in a largely OOP language (Ruby), I still try and avoid side effects in my functions, and prefer to pass around data rather than using internal state. I think the default OOP approach is to use instance methods and instance attributes (internal state), but I generally prefer to use class methods (aka "static" methods) and pass around data as arguments explicitly, rather than using internal state.

    Anyway, I have gotten some pushback from people at work. Now, hear me out - I recognize that the team's conventions are more important than my own preference. When I was told "we just do things in an OOP way, that's a company decision", I said "fine". That's a perfectly valid reason.

    But that's not all they said. People were essentially acting like I didn't understand OOP and that their approach was authoritatively better than mine. Actually my manager assigned me some reading about OOP and was telling me that my career would be better if I forgot about FP and just went all-in on OOP.

    I can't help but feel like these guys never actually put any time into doing FP and they are just kinda dismissing it because they're unfamiliar. Which is why I wanted to ask you, Reddit. I don't have a CS degree (I went the bootcamp approach), although I've been programming for around 6 years. Do people learn about FP in school? Is it common for people to have experience with FP or a little rare? I know people get some experience doing it with Redux, but that's somewhat niche.

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

    i found a leaked data base

    Posted: 12 Jan 2021 06:33 AM PST

    i was googling an email to see if it had any social media or whatever but i found a website on the first search page that has almost 50k email and password written and all are from my country i tried a couple emails to see if they are real and i logged in one Facebook account of the people in the list so is there's anything i can do to help warn these people or take down the site?

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

    Python temperature programme won't run on LCD . Noob to python and raspberry pi - unsure what error message means. Please help ! :)

    Posted: 12 Jan 2021 01:45 PM PST

    as mentioned in the title, i have only recently been introduced to programming with python.

    I am working on a project which takes temperature data and translates it onto an LCD.

    here is my current code:

    import sys import os import glob import time from RPLCD import CharLCD import RPi.GPIO as GPIO GPIO.setmode(GPIO.BOARD) GPIO.setwarnings(False) unichr = chr lcd = CharLCD(numbering_mode=GPIO.BOARD, cols=16, rows=2, pin_rs=37, pin_e=35, pins_data=[33$ base_dir = '/sys/bus/w1/devices/' device_folder = glob.glob(base_dir + '28*')[0] device_file = device_folder + '/w1_slave' def read_temp_raw(): f = open(device_file, 'r') lines = f.readlines() f.close() return lines #CELSIUS CALCULATION def read_temp_c(): lines = read_temp_raw() while lines[0].strip()[-3:] != 'YES': time.sleep(0.2) lines = read_temp_raw() equals_pos = lines[1].find('t=') if equals_pos != -1: temp_string = lines[1][equals_pos+2:] temp_c = int(temp_string) / 1000.0 # TEMP_STRING IS THE SENSOR OUTPUT, MAKE SURE IT'$ temp_c = str(round(temp_c, 1)) # ROUND THE RESULT TO 1 PLACE AFTER THE DECIMAL, THEN$ return temp_c while True: lcd.cursor_pos = (0, 0) lcd.write_string("Temp: " + read_temp_c() + unichr(223) + "C") 

    And this is the message i get after running 'python3 temp.py'

    Traceback (most recent call last): File "temp.py", line 44, in <module> lcd.write_string("Temp: " + read_temp_c() + unichr(223) + "C") File "temp.py", line 30, in read_temp_c lines = read_temp_raw() File "temp.py", line 24, in read_temp_raw lines = f.readlines() File "/usr/lib/python3.7/codecs.py", line 319, in decode def decode(self, input, final=False): 

    I am aware that my code is quite messy and i'm sure there is plenty of unnecessary code in there. However, any help would be greatly appreciated!

    I was following this tutorial: https://www.circuitbasics.com/raspberry-pi-ds18b20-temperature-sensor-tutorial/

    Thanks!

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

    How much web development should an iOS developer know?

    Posted: 12 Jan 2021 10:11 PM PST

    I'm assuming an iOS developer needs to be able to do basic html,css, and js. Anything else? Let's say an iOS developer was going for a typical job doing app development.

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

    What mobile apps do you use to assist you in your developer workflow?

    Posted: 12 Jan 2021 01:20 PM PST

    I use DEV and Reddit for some dev discussions while in commute and Podcasts while doing sports/training. I also believe that putting down ideas, whenever they arrive, is crucial, so I use Trello for that. Plus E-mail to get real-time communication notifications when I'm AFK.

    As you see I keep it pretty minimal and believe that main workflow should always be in your PC/Mac. I believe that putting too much stuff in phone can become a distraction sooner or later.

    Could you briefly describe your mobile phone setup you use to assist you in your developer workflow? What are some apps you would recommend to try?

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

    How are graphic design editors like Canva made?

    Posted: 12 Jan 2021 02:44 PM PST

    Is it just dynamically updated HTML in a container? Are there any in detailed guides out there on how to implement one?

    EDIT: I'm specifically talking about creating content like posters and flyers, not picture editing.

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

    My first time coding alone + imacro

    Posted: 12 Jan 2021 01:34 PM PST

    Hey, guys.

    (Non-english native and first ride adventurer on coding)

    I'm trying to code by the imacro tool but I can't understand how to go further with my code. I'm trying to buy something on a website but I always buy there and usually the stuff ends quickly (seconds), so I'm trying to make my life a bit easier with this code. Basically, it gives me an option to divide my total value of the order up to 10x. Here's the code that I find when I look up the element.

    <select class="input-xlarge " id="creditCardpayment-card-0Brand">

    <option value="1">Pagamento à vista - R$ 1.299,00</option>

    <option value="2">2x de R$ 649,50 sem juros</option>

    <option value="3">3x de R$ 433,00 sem juros</option>

    <option value="4">4x de R$ 324,75 sem juros</option>

    <option value="5">5x de R$ 259,80 sem juros</option>

    <option value="6">6x de R$ 216,50 sem juros</option>

    <option value="7">7x de R$ 185,57 sem juros</option>

    <option value="8">8x de R$ 162,37 sem juros</option>

    <option value="9">9x de R$ 144,33 sem juros</option>

    <option value="10">10x de R$ 129,90 sem juros</option></select>

    I'm trying to select the "10" value but I don't know what should I use it so imacro input this info for me, I've tried this "TAG XPATH="//*[@id="creditCardpayment-card-0Brand"] CONTENT=%10" but I keep getting a syntax error. I would appreciate if someone could help me. Thanks!

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

    Where am I going wrong in my code? The problem (for now!) is that an error message is returning saying that [j] isn't defined when I try to log [j] to the console. But as far as I can see I've defined it above! ANy help would be very much appreciated!

    Posted: 12 Jan 2021 03:35 PM PST

    let input = 'Hi, Human';

    const vowels = ['a', 'e', 'i', 'o', 'u'];

    let resultArray = [];

    for (let i = 0; i < input.length; i++)//outer loop

    {

    for (let j = 0; j < vowels.length; j++)//inner loop

    if (input[i] === vowels[j]); {

    console.log(vowels[j]);

    }

    //inner loop ends

    if (input[i] === 'e') {

    resultArray.push('ee');

    } if (input [i] === 'u'){

    resultArray.push('uu');

    }

    }

    console.log(resultArray.join('').toUpperCase());

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

    What are your most frequently used external fonts?

    Posted: 12 Jan 2021 01:20 PM PST

    Considering the looks and feel, what are some of your personal favorite fonts you use in your projects most often?

    It would be Nunito, Quicksand and Montserrat for me.

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

    Slow react autocomplete/search filter

    Posted: 12 Jan 2021 06:30 PM PST

    I am implementing a stateless react component using useMemo to take json data from my file structure and display it as suggestions in an autocomplete. It's really slow, i have a file about 650kb, a list of countries for one and a list of cities for the next. What could cause a slow response time in something like this.

    Also I have a list of organized data that is to be filtered through, when I press the backspace key it takes almost a second to delete letters because it has to repopulate the filter list which is unacceptable. Is this something I just have to deal with and put a loading gif on top?

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

    Context aware diff tool

    Posted: 12 Jan 2021 02:41 PM PST

    I've used quite a few diffing tools including git,win merge and several other vendor specific tools but one thing always seems common in the way they deal with source files in that they view the whole thing as a single file even if inside that file is multiple routines/functions etc. Has anyone ever used a diff tool that was aware of the structure of the file in terms of how that files language type is organised? So instead of adding a subroutine and getting a diff output that says 14 lines added to file, I get a collapsible output that says 1 subroutine was added totalling 14 lines. If I make a change to 1 of the subroutines it's listed as a change to that subroutine, rather than a few lines of Code changed @ line445.

    Does anyone know what I mean and have they heard of or used such a tool?

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

    Hiring international devs

    Posted: 12 Jan 2021 06:06 PM PST

    Hello,

    Just curious if any of you would know, but should I'm looking to hire some international devs and I'm planning on using their country/location as the governing state, but I'm wondering if I should ask for a copy of their license?

    I mean, how would I know they are who they say they are?

    Thanks

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

    Twilio Quest - Stuck at the Local Twilio Dev Environment

    Posted: 12 Jan 2021 06:06 PM PST

    Hello, guys. I'm following the Twilio Quest. At the basics we're expected to set up a starter application. In my case Node.js.

    I've cloned the repo, followed the tutorial. Achieved the Twilio Quest website on my localhost:3000.

    Sent myself an sms and also the call thru node, but when I enter the address on the game it always fail.

    Went back and forth, hooked the TwiML and even Ngrok, but still stuck.

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

    What inspires you to code?

    Posted: 11 Jan 2021 11:15 PM PST

    I'm a code noob.

    I know very basic HTML and CSS. For some reason, part of me wants to learn how to code (like, for real), but whenever I give it a shot, the process just seems so daunting. It's such a complex and detail-oriented art-form... I usually lose motivation after an hour or two of lessons.

    So I'm curious, what inspires y'all to code? What keeps you programming and learning, despite the difficulty of the work (assuming you're not a genius who finds it all quite easy)? Perhaps I can find some inspiration in y'all's sources of inspiration.

    And, as an additional question, how did y'all begin learning to code? Where did you start? What advice would you have for someone starting? Etcetera.

    Thanks :)

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

    Downloading pages from sportsbet.com.au using urllib

    Posted: 12 Jan 2021 12:30 PM PST

    Hi all,

    I was looking to automatically download some betting odds from sportsbet.com.au. They don't seem to have an API I can use. So what I do is download the page using urllib.request in python, then parse the HTML code and grab the numbers I want.

    For pages like this, it's not a problem.

    The problem I have is for pages like this. I want to grab data from the "Futures" tab (instead of "Matches" tab). Is it possible to easily grab the data from the Futures tab using something like urllib.request? Normally when I use urllib I give it the URL, but the URL is the same whether I want the Futures tab of the Matches tab, so not sure how to send the specific request.

    Here is the code I used for downloading the pages:

    def pageAsString(url): user_agent = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7' #Seems the sportsbet site doesn't like it if you don't use a browser user-agent. headers={'User-Agent':user_agent,} request=urllib.request.Request(url,None,headers) #The assembled request response = urllib.request.urlopen(request) data = response.read() data=str(data, 'utf-8') return data 

    Thanks.

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

    Do only I am ashamed when I use a tutorial ?

    Posted: 12 Jan 2021 04:09 PM PST

    It's a weird question. I started learning programming about few months ago and i don't know why but my pride doesn't let me use a tutorial. Instead i spent a few days thinking before I finally swallow my pride and do that damn tutorial. I don't like doing this because it makes learning so much harder and even when I start a simple project it takes so much longer than I expected just because I won't open chrome and google some basic things. Does anybody else have it like that or is it just me ?

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

    Trying to get back into programming. Looking for some advice.

    Posted: 12 Jan 2021 04:01 PM PST

    TL;DR:

    What programming language do you think I should start with? What paradigm should I focus on learning? Where should I start learning (project ideas)?

    Full Post:

    It's been a while, and I'm wanting to start again for career/freelance/personal opportunities.

    What programming language do you think I should start with? I'm most familiar with JavaScript, and I'm a big believer in accessibility. I haven't used them, but I like the possibility of being able to use Node JS for server-side and React Native for native cross-platform development. My concerns are, Java seems to be the industry's standard, Python's relevance continues to grow with machine learning, which I'm interested in, and learning C/C++ would be challenging, but from another angle, it would make pretty much everything else easier to learn in comparison.

    What paradigm should I focus on learning? I've worked with both functional, and object-oriented, but mainly object-oriented. From what I've read functional is growing in relevance, but object-oriented is still the current standard. I've also found two conflicting pieces of advice, functional is ideal for client-side and object-oriented is ideal for server-side or anything that object-oriented can do, functional can do better, it writes faster, runs faster, and uses less memory.

    Where should I start learning? I have some ideas, but I'm looking specifically for projects that can be done relatively fast and would look good for my portfolio.

    I know these questions have been answered before, and if you have links, I'd be glad to read them, but I'm looking for as solid of answers as I can get. I'm happy to clarify if you have any questions about what I'm looking for.

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

    How would I go about calculating a number as large as/even larger than 2^2048 in C?

    Posted: 12 Jan 2021 08:00 AM PST

    I've seen a few posts online that refer to arbitrary precision arithmetic but I was wondering if there was a library that could do this. Thank you!

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

    HELP!!! Creating Cross-Platform App

    Posted: 12 Jan 2021 03:31 PM PST

    I'll try to explain in as few words as possible so it's not a lengthy read. I need the advice!! I'm in every sense very new to programming however I was able to land myself a pretty decent gig -

    Essentially I have to create an app that communicates with a external device that has a trickle switch (meaning it will automatically turn on when it detects that it has to.) The app is to notify the owner whenever the device turns on. Also, the app is to display the statistics of the external device; its battery percentage and other data demonstrating the devices current operating status.

    I have their engineers choosing which modules and communication devices that are compatible with the devices current schematics.

    My question is: which is the best language for this type of application and which cross-platform tools I should be using.

    Side notes: I'm looking up other smart home devices that communicate with your smartphone like "ring video doorbell" and they use python but I was also looking to use c# on xamarin but again I'm a novice to this.

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

    What does the address specified by C pointers actually mean?

    Posted: 12 Jan 2021 11:43 AM PST

    I know that C pointers give memory location of where the concerned variable is stored. Just recently, I came across the concept of page table and how processes are stored which made me question, what is the address of the C pointers referring to — process block or actual physical address in RAM? This is because, whenever we try to access a variable in a certain block, say X, the action goes through the kernel which tries to determine which page contains block X through page table.

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

    Skills required for Full Stack/ Front end freelancing

    Posted: 12 Jan 2021 05:37 AM PST

    I currently know HTML, CSS and intermediate level Python and I'm learning Javascript. After I'm done with JS, I'm planning to learn Django or frameworks like React or Angular. Would that be enough to get front end freelancing jobs? Or do I need to learn node.js and django too?

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

    [Academic Research] 1-min survey on computer programming skills

    Posted: 12 Jan 2021 01:12 PM PST

    Hi everyone! This is a super short screening study for academic research at Harvard Business School study. We will use your answers to this survey to determine whether you are eligible to participate in a larger study on advice exchange. If you choose to participate in this screening, you will answer a variety of question about yourself. You will spend about 1 minute on this survey and you will be entered into a raffle to win a $50 Amazon Gift Card.

    This survey is only eligible to people who are 18 years or older, fluent in English, and currently residing in the US. All responses will be kept completely confidential.

    Please click on the link below to begin the survey if you would like to participate.

    https://hbs.qualtrics.com/jfe/form/SV_1UqwaU34oMFVRul

    Thank you for your help!

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

    Apple Music API Question

    Posted: 12 Jan 2021 08:59 AM PST

    I have not programming experience. But I have an idea for something that I want.

    I want to create program that uses the Apple Music API. I want it to look at a set of Apple Music playlists each week, copy the top five results of each and put them all into a playlist. I want it to also create a list of all the songs that it adds to this list.

    Then the next week I want it look at that same set of playlists, compare it to the list of all songs previously added, and only add the song to my playlist that have not been added yet. https://developer.apple.com/documentation/applemusicapi/

    This will just be used for personal use.

    I want to know what kind of undertaking this would be. How much you think I will have to pay someone to do this for me. I also want the person to host the programing and the list for me as well.

    Is there anything else that I should think of that I am not.

    Thanks.

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

    C++ hashmap for integer to 3D array (or pointer)

    Posted: 12 Jan 2021 12:43 PM PST

    I want to have a hashmap (std:unordered_map) mapping an integer to a 3D array or a pointer to that array, can someone help me?

    What I have tried:

    std::unordered_map<int, int\[4\]\[4\]\[2\]> m;

    m[1] = {

    {{0,0}, {0,0}, {0,0}, {0,0}}, {{0,0}, {0,0}, {0,0}, {0,0}}, {{0,0}, {0,0}, {0,0}, {0,0}}, {{0,0}, {0,0}, {0, 0}, {0,0}} 

    };

    Note: I have this array in a variable stored as well so mapping integer to the pointer will do as well

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

    No comments:

    Post a Comment