• Breaking News

    Wednesday, November 7, 2018

    Is it possible to have and store an infinite iterator? Ask Programming

    Is it possible to have and store an infinite iterator? Ask Programming


    Is it possible to have and store an infinite iterator?

    Posted: 07 Nov 2018 06:58 PM PST

    If I wanted to run a function forever and store the number of steps it took, how would I store that number, and how could I pass that number to functions, and how could that number be processed in algorithms?

    I was thinking perhaps scientific notation might offset the effect of infinity for a while.

    Any ideas?

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

    How does confirmation email works

    Posted: 07 Nov 2018 08:39 PM PST

    Hi, I'm making a user database for my work (they want to make it manually instead of using firebase) and I have something already working but I haven't programmed how to handle mail confirmation and there are a couple of posible conflicts that I don't know how to deal with:

    - What would happen if someone uses another one mail to create an account and for obvious reasons never confirms, when the real owner want to create an account what do I do? Do I delete the other account?

    - If someone creates an account with their mail but never confirms and later I want to mess with them and want to create an account with the same mail, what do I do?

    Thanks. =)

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

    Ideas for Meme Project

    Posted: 07 Nov 2018 07:55 PM PST

    Hi Guys,

    I'm in a software development program in college and we're having a code jam over the topic of memes. We can create a mobile app, desktop app, or website. I'm having trouble coming up with ideas on what we could create that's not as simple as a meme generator. The rest of my team hasn't been much help either.

    Thank you

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

    is using ' if(1>0) ' to group parts of code terrible?

    Posted: 07 Nov 2018 07:12 AM PST

    hey everyone, i've been using this grouping idea for a while and a thought popped in my head whether its even good. i want to have my code as structured and clean as possible. let me hear your opinions and why.

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

    How many hours do you work? Survey on work/life hours and balance

    Posted: 07 Nov 2018 04:20 PM PST

    Hey all, lately I've been struggling with the idea of work/life balance and the 40 hour work week and the expectations for techies to be constantly working. I'm curious to know what other people in tech's work/life balance hours are like. I made a really crappy google form survey that folks could fill out if so inclined. Everything is anonymous, the data won't be shared anywhere unless you all decide you want to see it too, then I will share it in this sub. It's mostly just for my own curiosity. Thanks!

    https://goo.gl/forms/5pXXRJOLYco2e8xj1

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

    Requesting using urllib.request and request in python 3

    Posted: 07 Nov 2018 08:57 PM PST

    I'm building a web scraping application and I have ran into a problem. I have built a similar one for espn.com, but I'm trying to move on to something more comprehensive and useful for research...

    Problem: urllib.request and request libraries are not returning the entire source code for scraping; I am only getting enough information to scrape one of the tables. Here is the current webpage I am using for testing: https://www.sports-reference.com/cfb/players/ryan-aplin-1.html

    #import pdb import urllib.request as ureq #from bs4 import BeautifulSoup as BS def getPlayerStats (playerName, times): url = "https://www.sports-reference.com/cfb/players/ryan-aplin-1.html" html = ureq.urlopen(url).read() print(html) times = 1 getPlayerStats("Ryan Aplin", times) 

    The "times" variable is for a separate function that creates url's based on the website formatting, so it is not applicable here.

    So my questions are: am I using an incorrect method in requesting source URL? Will I need to switch resources?

    It has worked on different websites, so I don't understand why it is not working here.

    Thanks.

    EDIT: I'll comment out the irrelevant libraries so the code can be cut and pasted directly from this post.

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

    desperate to Understand Virtual Memory

    Posted: 07 Nov 2018 01:49 PM PST

    Hi all, I'm officially new to the reddit boards, and I'm in need of some help.

    I was wondering if any one had links to any good sites/videos where I can learn about how Virtual memory works.

    I'm taking an assembly language class online at my University, and it's currently my last semester before I hopefully graduate. I chose to do a paper about Virtual memory for the big required class project for the class since I had no other ideas on what to do for a project.

    I'm barely hanging on in the class. I have a C+ currently, and honestly, I only understand about maybe 40% of what we've learned so far in the class. The professor teaching it really has not been the best help. This professor was supposed to be taking a educational sabbatical this semester, but couldn't find anyone to teach the class, so they got stuck teaching the class. When I try messaging him for help, he suggests teaming up with my classmates. But there's only four people in my online class, and the closest one I think lives seven hours away from me.

    I really wish I could drop this class, or start over with a Professor that actually cared about teaching the class, but I need it to graduate.

    Any help with Virtual memory would be greatly appreciated.

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

    What are some interesting programming niches (or niche industries that require programmers)?

    Posted: 07 Nov 2018 08:59 AM PST

    If you work in such niche, how did you get there?

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

    Turn a PDF into a spreadsheet with your own cell guides?

    Posted: 07 Nov 2018 06:06 PM PST

    I'm turning a lot of info contained in PDFs into spreadsheets right now, and wonder if what I'd like to do is even possible: to overlay my own grid on top of the PDF and rip it into an .xls.

    I believe some things exist that can rip PDFs reliably, but not without formatting issues, and it's my understanding that the inner workings of PDFs are a nightmare. I'm familiar with Python, so if there's a library that can help me do it that would be cool, but right now I don't know if it's even possible/remotely feasible.

    Thanks.

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

    Are All Software Architecture Courses Hard To Understand By Nature?

    Posted: 07 Nov 2018 12:05 PM PST

    Courses explaining software architecture principles such as:

    Agile Design, Stakeholder Requirements, Quality Attributes, Development Processes and Iterations, Architectural Patterns, UML diagrams, Views, Use Cases etc.

    Although I feel that the class/classes I've taken are hard to understand, I can't help feeling like these concepts are really important to software development. Are these concepts inherently hard to understand? Is it that they rely heavily on a technical vocabulary? I've hard two successive design courses taught by the same prof, and he just seems to not put much effort in, so I'm wondering if other students have had a similar type of course, and if they found it to be one of the easier/harder ones compared to courses such as Data Management Systems, Algorithms Analysis, Microprocessors/Computer Architecture, etc.

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

    How to structure companies and users in a NoSQL database

    Posted: 07 Nov 2018 06:43 AM PST

    I am working on a project with React on Firebase and I have a question about structuring the DB (this is my first project with a NoSQL DB).

    The app has multiple customers (which are companies) with multiple users inside of them. How would you structure this in the DB?

    A few scenarios I'm considering:

    • When a user logs in, the most efficient thing would be to have the users be a top level object.
    • Once a user has logged in and their company has been identified, it would be most efficient to have the user nested under the company.

    One thought I had was to do something like this:

    users { user_1 { companyid: company_1 }, user_2 { companyid: company_2 }, user_3 { companyid: company_3 } } company { company_1 { users { user_1 { //user data } } }, company_2 { users { user_2 { //user data } } }, company_3 { users { user_3 { //user data } } } } 

    Is that the right approach or am I thinking about it all wrong?

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

    How to use integers from another function c++.

    Posted: 07 Nov 2018 05:54 PM PST

    Im writing a code where in one function (function1) it asks for 2 numbers. In function 2 it swaps the two numbers and in function 3 it displays the two numbers before and after swapping. Im stuck on learning functions and need some help.

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

    Storing / retrieving data based on location

    Posted: 07 Nov 2018 03:58 PM PST

    I'm working on a social app that presents media (photo, video, text, etc. -- not really important to the question) from other nearby users, pretty similar to Tindr, with an adjustable radius.

    My question is: What is an efficient way to discover nearby users?

    I've only theorized possible implementations up to this point. Comparing 'this' users long/lat numbers to a table of long/lat numbers seems to be the most straight forward, but I'm also pretty confident that will become very slow very quickly.

    I've thought of dividing the data into long/lat chunks, but then you run into edge cases, and users near one of these borders would experience a dip in performance.

    I'm not looking for a specific solution, but it would be appreciated if available. Any insight as to how Tindr accomplishes this would be wonderful. Mostly, I was wondering if any of y'all have good resources on this topic.

    Currently, storage and database services are through Firebase (realtime database).

    Notes: I know there are many aspects to this functionality, such as privacy with a users location. I'd like to refrain from discussion about such in this thread. Additionally, I'm sure I'll leave out some necessary information, but I am looking for some guidance, so please just ask if something isn't clear.

    Edit: I feel 'Algorithms' is a fairly accurate tag..? Otherwise I'll change it to 'Other'

    Edit 2: Just to clarify, I'm not asking how to compute if two users are near each other. Rather, imagine all users locations are stored in one table. Out of all those users, possibly thousands, I want to determine which ones are "nearby" (defined by my own function). I'm more so inquiring on an efficient database schema and queries to implement this.

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

    Amateur question about web crawling project

    Posted: 07 Nov 2018 03:33 PM PST

    When should you implement a linked list using arrays, if ever?

    Posted: 07 Nov 2018 09:09 AM PST

    I am taking a data structures class and my professor told us in lecture that linked lists are most commonly implemented using arrays. I'm having difficulty understanding why this is useful, or examples of when this actually happens.

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

    Any way to program my Mac so that I can only use the internet for an hour a day?

    Posted: 07 Nov 2018 01:51 PM PST

    I've tried some app like content barrier but its expensive and really buggy, is there any way that I can do some coding wizardry or something on my Mac to achieve this? I'm pretty new to programming (I have like a months experience on arduino lol) but if it can be done I'd really like to learn how. Thanks <3

    EDIT* I know I can do this on the router but I live in a shared house and don't want to screw up everyones internet, I don't know what I'm doing with that

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

    Elevator sim problem in c++

    Posted: 07 Nov 2018 12:57 PM PST

    I have to create a simulated elevator that has 25 floors. it starts at one floor randomly then it can only go up or down by 1 floor and at the end it has a histogram made of asterisks. my problem is i can't figure out how to take the random number it starts on and make the program add or subtract 1 please help.

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

    Outputting a int number in binary using printf

    Posted: 07 Nov 2018 11:27 AM PST

    I want to create a tablestyle program which prints out the binary, decimal, octal & hexadezimal number in a tableformat. Like:

    1 1 1 1

    2 10 2 2

    etc. however I don't know how to convert a number into binary.

    for (zeile = 1; zeile <= 255; zeile++) { printf("%5d%5o%5x\n", zeile, zeile, zeile, zeile); }" 

    This is how far I've got.

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

    I found a strange website accidentally... What is this?: wwwwwwwww.jodi.org

    Posted: 07 Nov 2018 10:20 AM PST

    I'm pretty sure it isn't a virus since it wasn't blocked by my school computer and nothing seemed to happen to the computer.

    I'm not sure what the creators intentions are but help would be appreciated :)

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

    Looking for a new programming/coding language!

    Posted: 07 Nov 2018 08:27 AM PST

    I am looking for a coding/programming language that may not be very popular but is very useful, something like "AutoHotKey."

    submitted by /u/1Ross78
    [link] [comments]

    What kind of jobs/job titles would one apply for with experience/interest in areas like OS development, optimisation, compiler design?

    Posted: 07 Nov 2018 07:27 AM PST

    So, I'm currently an undergraduate pursuing a degree in Computer Engineering. I'm really interested in areas such as:-

    • Operating Systems (Building, Developing)
    • Compiler Design
    • Optimisation, Efficiency (for software, operating systems, etc)

    What would be the kind of jobs that would require experience in one or more of these areas? Are there a lot of demand for jobs like this?

    Thanks in advance :)

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

    [PHP] I'm making a mastermind game in php for school, it's working but not OO

    Posted: 07 Nov 2018 06:24 AM PST

    Hey!

    I'm pretty new to all this programming, for my web back end (php) class I have to make a mastermind game.With things that I've found online I've got the game working and I think it's doing all it needs to do...

    Only thing is I forgot I should've used classes... Now I'm not sure where to start with changing it to a class somewhere or what I should exactly put in the class. If I look at my excercises about classes I understand them, but I get stuck when I try to implement that to the code I have here for mastermind.

    It's not a lot of code, just 75 lines or so of php and some html. I was wondering if there was someone here willing to take a look at my code and show me what I should do? through the chat here on reddit or discord or something..

    Hell maybe my code is super shitty but it's working so far at least :D

    My deadline is the 15th so I've still got a little bit of time to figure this out but yeah help is appreciated cause I've got an exam the 16th :D

    https://pastebin.com/B1CcH9fX this is my main code, there's a seperate css file and it links to another simple html page when you fail or succeed

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

    If x fraction of the time you trust a website to give you an executable file, that trust was a mistake and contains viruses, and y fraction of the time antivirus does not find it, then x*y chance per program of a virus that antivirus doesnt catch, so how can executables be used safely?

    Posted: 07 Nov 2018 09:42 AM PST

    Once a computer gets a virus that antivirus does not identify as a virus (thinks its a normal behavior of programs), its likely to stay on the computer for years. So despite the infrequency of such viruses, its likely that most computers have an undetectable virus.

    Somehow we need to limit what programs can do.

    When permission questions pop up people normally click allow, so thats not a solution.

    Enough permission controls arent even technically possible in most systems. For example, I dont trust java's permissions system (browsers removed it for same reason) and just assume that executable java code can do anything with nearly root access on a computer, so I sandbox against strings of code to make sure only whitelisted function calls can happen instead of trusting that if those functions are called they will throw.

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

    I want to be an embedded systems developer

    Posted: 07 Nov 2018 05:55 AM PST

    Hi All,

    I have been trying to develop a career for myself in software development, and only recently did I realize the specific type I am after. I would like to be an embedded systems developer.

    Is this the kind of career that would require a computer science degree for me to have any luck finding a job?

    I am a big fan of free online education, and I already have student debt, so I would prefer to learn using EDX or something similar. How long do you thing the self study path would take before someone is employable in this area?

    My background: I have a mechanical engineering degree, and took CS and electrical engineering courses on the side during my academic years. I have been working as a freelance web developer for the past year (PHP and MySQL mostly) but also do some front end when needed. I am familiar with java, C++, MATLAB, and a little bit of C (arduinos) but its been a while since I have done anything with those. I am currently building a robotic rover using Raspberry Pi (python) and Arduino, and it has been going pretty well so far. Currently trying to set up my motor controller on the arduino, I2C communication to the RPI, and building my own database logging system, and using a flask server to host a LAN based controller.

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

    No comments:

    Post a Comment