• Breaking News

    Tuesday, February 2, 2021

    Ask Programming: What is your most frustrating experience as a developer? Ask Programming

    Ask Programming: What is your most frustrating experience as a developer? Ask Programming


    Ask Programming: What is your most frustrating experience as a developer?

    Posted: 02 Feb 2021 06:33 PM PST

    Something software related that caused you to pull your hair out.

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

    What tool do you need the most as a coder?

    Posted: 02 Feb 2021 06:20 AM PST

    Is there any tool you really need as a developer and wish existed? To specify, is there anything code related tool such as a service for developers that you really need?

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

    [R] Problem with character string input for lm () in a loop

    Posted: 02 Feb 2021 05:58 PM PST

    I have a for loop where I use a different independent and dependent variable every time to run a linear regression. However, the lm() function is not working because I believe I am trying to input a character string as the variable. I created this easy example, to show what the problem is. Let's assume var1, var2, and var3 are column names in the dat dataframe. I cannot input the column names directly, so I have to assign them as character strings to an R variable.

    dat <- read.csv("dat.csv") x1 <- "var1" x2 <- "var2" y <- "var3" lm(y ~ x1 + x2, data = dat) #error 

    I know the issue here is that R tries to run lm("var3" ~ "var1" + "var2", data = dat). I need your help finding what function I should run on y, x1, and x2, so the lm() runs properly.

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

    How to call rest api using php laravel?

    Posted: 02 Feb 2021 07:53 PM PST

    Hi all,

    I need to know on, How to call rest api using php laravel?

    I went through the guides of PHP and Laravel.

    Need a clarity on how to setup and start coding.

    Basically I am new to coding, theoretically I can understand the concepts but practically its difficult to implement.

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

    Can you smash me with a bit of reality please ?

    Posted: 02 Feb 2021 02:52 PM PST

    Growing up i was very confused about what i wanted to do later in life but after seeing some amazing indie game i decided i wanted to program games, later i found out that i should probably be a regular engineer specified in making software and all of that stuff because making indie games is cool but I will likely not make a life out of it.

    I want to be smashed with reality because now it's starting to scare me more than when I started and I want to hear it all to know what it's actually like.

    When I was 14 we did a job orientation thingy at our school and we were only 2 out of the 220 students that wanted to become programmers and the school told us than it was a job they didn't knew well but I remember very well what some of my teacher said, one said it was one of the most wanted jobs here (I live in Belgium) and the other said than recruiters will be at the school party when I finish my studies to recruit me and at the time I just accepted it but I wonder if it's true.

    Also am i the only one than just procrastinate over programming ? The two only time I can say I didn't was when I made a discord bot to remind us the online classes schedule and the second was when I made a game in two days for a gamejam.

    I know it kind of go on different topic but the main question is "How is it to earn money from programming ?"

    Ps:If I made any big english mistake and you want to correct it, tell me, english isn't my native language

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

    This is probably going to be a really stupid weird question but can you do procedural programming with using objects?

    Posted: 02 Feb 2021 05:36 PM PST

    Like, does it still count as procedural if it has objects in it?

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

    Need help with Map Reduce Using Python and Anaconda

    Posted: 02 Feb 2021 02:07 PM PST

    Hello everyone! So I am trying to make a python program that will output total number of hours and miles per driver using data from a separate text document. Here is what I have so far:

    #The goal of this program is to demonstrate the total number of hours per driver driven. from mrjob.job import MRJob #This calls a mrjob function from the Python library of functions. class MRDriverCounter(MRJob): #Creates a MRRatingCounter class. def mapper(self, key, line): #Defines mapper class (driverID, numofWeeks, numofHours, numofMiles) = line.split('\t') yield numofHours, 1 def reducer(self, driverID, numofHours, numofMiles, occurences): yield driverID, numofHours, numofMiles, sum(occurences) if __name__ == '__main__': MRDriverCounter.run() 

    Next, I input in the Anaconda shell the command to run the program, but getting errors.

    What changes should I make to get the desired output?

    EDIT: Here is a picture of the error in the Anaconda terminal:

    https://ibb.co/9mD48sg

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

    Am I going to Hell?

    Posted: 02 Feb 2021 09:14 PM PST

    Today I housed a post request in a javascript fetch function within an href inline "onclick" event, in the select statement of an SQL call. The SQL call was written within a front-end widget editor of a web-app and the javascript had to be written as a CONCAT statement encoded entirely in ASCII character codes... that took up 103 pages of a word document.

    It worked, but I felt bad.

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

    Where should I go start to understand NFA and DFA regexpression engines.

    Posted: 02 Feb 2021 09:07 PM PST

    I use regex's everyday. I understand the syntax of awk, sed and perl regular expressions fairly well at this point, but I am really stuck on the difference between NFA and DFA and have only a vauge idea about how one could implement a regex. If I ask for an explaination here, I will be in over my head pretty quick. I think I am going to bite the bullet and really learn how regex works

    So what should I actually be studying? Should I take some courses on automata theory?

    Basically, I want to understand what this guy is talking about and what she is talking about.

    Thanks in advance

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

    Need help creating a program that tallies number of hours per user from a text file

    Posted: 02 Feb 2021 04:00 PM PST

    Hello everyone, currently taking Python and learning about map reduce. I am tasked with using map reduce to create a program that reads the contents of a text file and returns the sum of hours per user.

    I must use map reduce in Python and Anaconda to do this. All I could find online were resources using Hadoop. The text file the program would read from is something like this:

    User# Week# Hours earnings 10 1 70 3300 11 3 50 2500 12 7 19 1400 13 8 13 900 

    Any help is greatly appreciated!

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

    How can I do this on java?

    Posted: 02 Feb 2021 06:30 PM PST

    So I want to do a program where it asks an user to ingress a password, but then it would kind of swap those number, lets say its a 6 digits password, so the user put 123456 put then I want it to swap the first and last number, and multiply the second with the third and then result would be the user password, any idea how to do that?

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

    Stupid Question

    Posted: 02 Feb 2021 02:16 PM PST

    Hello , I have a really dumb question

    So..A good friend of mine is a Big Fan of Doctor Who (so am I) and it's almost his birthday and I want to give him a special gift.

    Question :

    Is there a way to create a Fake Command prompt ,where he could roleplay as if he was controlling a TARDIS by entering commands ?

    Sorry if I wasn't clear ,and sorry for the silly question

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

    Writing a script to copy and rename a file in Windows.

    Posted: 02 Feb 2021 02:05 PM PST

    Hi there, apologies if this isn't the right place but there is a simple repetitive task I have to do regularly and feel like there must be a way to write a program that does it for me. I have never coded before apart from some basic VBA in excel.

    Ideally the program will open to file explore, then you select the file and it then creates a copy with the name COPY - [File Name] - [dd/mm/yy hh:mm] to a fixed directory.

    I did try and look up how to do this but am struggling with where to even start. If someone can suggest the best language to write this in and if possible, point me towards a tutorial for copying files with code that would great.

    Thank you for any help.

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

    Does TIS-100 teach you how to code assembly?

    Posted: 02 Feb 2021 07:41 AM PST

    Which language should I learn and how?

    Posted: 02 Feb 2021 10:04 AM PST

    Hello, since we are quarantined I wanted to learn a language and code, I was trying to learn c sharp through the microsoft articles but got overwhelmed and the directions were not clear, I wanted to learn swift as well but I just sold my MacOs and got a 3080, what language is useful and I could use it just for anything? and how should I learn it.

    submitted by /u/Kasra-kb
    [link] [comments]

    Easy to use and cheap site to store and get images

    Posted: 02 Feb 2021 11:38 AM PST

    Hello everyone, so I am creating a website that has the user create an account, connected to that account is an avatar picture. I need a site that allows developers to store images and access them via a url, also I am new to this so I am not sure if this is also possible but the ability to upload, delete or edit images via an API call. I have been looking into flickr but for some reason, i cannot find a way to access individual photos based on a unique identifier

    I am using PHP for this project so if anyone knows of any site that is cheap and easy to use as well as has good documentation for use in php, id love to hear suggestions! NOTE: this is not a big website or anything is mostly going to be used as a school project, so I dont have the time or money for things like amazon s3 or anything like that

    Thank you

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

    Programming help pls

    Posted: 02 Feb 2021 02:43 PM PST

    I was wondering if I could have some programming help –

    I want a program so that I can adjust the frequency to what I want and it find the corresponding multipler, divider, num and den values. Below is the equation:

    Frequency = (25e6 x Multiplier) / (Divider + (num/den))

    Where these values can range from:

    Multiplier – 15 to 90

    Divider – 4 to 900

    num – 0 to 1048575

    den – 1 to 1048575

    Any ideas?

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

    Is there an algorithm for finding ends of wires that split into many directions?

    Posted: 02 Feb 2021 05:50 AM PST

    I have lots of wires that often split into 6 wires, and out of those 6 wires, a few of those wires will later split into even more wires.

    My goal is to automate finding all ends of the wires and the opposite end they attach to.

    I have something in mind but I imagine its inefficient as I constantly am doing searches on already-known wires. Is this or similar a known CS problem?

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

    How would I detect a new html element appearing and write the content of the element to a file?

    Posted: 02 Feb 2021 05:30 AM PST

    Hi, I'm curious how I would go about this. There's a website with numbers appearing every 10-30 seconds in a:

    <span class="className">

    "1.54"

    </span>

    And I was wondering how I would go about detecting when a one would appear, getting the number from inside the span and saving it to a file or somewhere. So I could collect all these numbers for analysis later on. Any clue?

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

    Cross platform (native and web) UI framework

    Posted: 02 Feb 2021 10:10 AM PST

    Hello.

    Considering the modern practices and most importantly, requirements in software development on one hand and the differences in the platforms (native vs web) on the other hand, would it make sense to develop a framework which would allow a developer to create GUI for both, native and web? For example, on a Mac the app written in such a framework would provide native feel but on the web it would look like a website. If not, then why? If yes, what are the biggest challenges to overcome?

    Are there similar, existing frameworks? Which ones?

    Thank you.

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

    How to teach web to non techies?

    Posted: 02 Feb 2021 09:29 AM PST

    I'm trying to explain client server to 4 colleagues who are not coders. There's lots of great stuff on youtube after 4 hours over w weeks they are still not getting it.

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

    [JAVA] Help with client-server socket programming? Completely lost on how to use ArrayLists in Input/OutputStreams between the client and server

    Posted: 02 Feb 2021 09:18 AM PST

    I hope this level of detail in a question is allowed here. So I'm trying to make a client-server program where the server is initiated by establishing a server socket on a given port number. The server file reads a CSV file and stores light and temperature levels in separate ArrayLists, I've got that working fine.

    Once the server has read and stored the data, the goal of the program is for the server to connect to two clients at the same time as separate threads (one client for light, one client for temp), checks the server type and sends the corresponding data to the correct server. I'm completely lost on how to do this. I've been working through YouTube videos of people doing similar things, but most of these take the data as user input rather than read from a CSV, and I can't find anything on using ArrayLists to do this and I have to have my data stored this way. If anyone could help explain what I need to do to get this working would be much appreciated. My code for the server and client classes are:

    import java.io.BufferedReader; import java.io.FileReader; import java.io.FileNotFoundException; import java.io.IOException; import java.io.PrintStream; import java.util.ArrayList; import java.util.Scanner; import java.net.Socket; import java.net.ServerSocket; public class Server { public static void main(String[] args) throws IOException { // Establishes server socket with port number, and accept incoming request from client ServerSocket server_socket = new ServerSocket(8008); Socket ss = server_socket.accept(); // Establishing variables to read and store CSV values String line; String split; ArrayList<String> lightLvlList = new ArrayList<String>(); ArrayList<String> tempList = new ArrayList<String>(); try { ObjectOutputStream lightOutput = new ObjectOutputStream(ss.getOutputStream()); lightOutput.writeObject(lightLvlList); ObjectOutputStream tempOutput = new ObjectOutputStream(ss.getOutputStream()); tempOutput.writeObject(tempList); } catch (IOException e) { e.printStackTrace(); } // Parses and appends CSV values to ArrayLists try { BufferedReader br = new BufferedReader(newFileReader("sensor_data.csv")); while ((line = br.readLine()) != null) { String[] items = line.split(","); System.out.println("Light level: " + items[7] + " , temperature: " + items[9]); lightLvlList.add(items[7]); tempList.add(items[9]); } } catch (IOException e) { System.out.println("Error in reading file"); } } } 

    And the client class (this will be replicated for temperature client):

    import java.io.IOException; import java.io.PrintStream; import java.net.Socket; import java.net.UnknownHostException; import java.util.Scanner; public class LightClient { public static void main(String[] args) throws UnknownHostException, IOException { // Socket to connect to server, args are IP and port number Socket s = new Socket("127.0.0.1", 8008); ArrayList<String> lightList = new ArrayList<String>(); ObjectInputStream objectInput = new ObjectInputStream(s.getInputStream()); try { Object object = objectInput.readObject(); lightList = (ArrayList<String>) object; System.out.println(lightList.get(1)); } catch (ClassNotFoundException e) { System.out.println("The list has not come from the server"); e.printStackTrace();} } } 

    I'm just really lost on the whole concept of an Input/OutputStream and how to send ArrayLists between the server and client using them. There are no errors as it's not functional at all yet. A bit more background and a sample output of the CSV reader can be found on my last Java post - https://www.reddit.com/r/learnjava/comments/kt88sz/how_can_i_save_different_elements_of_my_output/

    submitted by /u/Successful-Standard
    [link] [comments]

    C# or Python

    Posted: 02 Feb 2021 08:48 AM PST

    As in the title, which language should I learn? Atm, I have some basics of C, Java and MATLAB, also I was codding in both C# and Python both are great. I'm interested in stuff like bots, web crawlers and desktop apps. Which language is more 'needed' in the labor market especially in EU.

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

    Nodejs learning resources

    Posted: 02 Feb 2021 08:44 AM PST

    Hey everyone I'm looking for Modern nodejs tutorials. I googled but most of the tutorials are pretty outdated using var instead of const. I'm not into video tutorials. Can anybody recommend written tutorials or blogs. Also official node documentation doesn't cover how to use each module. Thanks in advance.

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

    No comments:

    Post a Comment