• Breaking News

    Sunday, October 25, 2020

    How do makefiles and the linux command `make` actually identify whether a command needs to be ran again? Ask Programming

    How do makefiles and the linux command `make` actually identify whether a command needs to be ran again? Ask Programming


    How do makefiles and the linux command `make` actually identify whether a command needs to be ran again?

    Posted: 25 Oct 2020 12:45 PM PDT

    I've just started using makefiles for C++ in class, and I get the gist of it. Also for starters, this isn't a homework question, and hopefully you will understand as I clarify.

    So of course the format for a makefile should be as follows:

    <target> : <Dependency List> <Recipe> 

    So of course, <target> file is created by using the <Recipe> command if any of the files listed in <Dependency List> have been updated since make was last ran, right?

    My only real question is fairly specific: how does make actually identify whether the files in <Dependency List> have been updated since make was last used?

    Also, if anyone is concerned this is a homework question, I only ask if you expect a student's very first exposure to make should also require the student be be learning about the inner mechanics behind how the command works.

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

    Help with a passion project involving APIs talking to one another (beginner)

    Posted: 25 Oct 2020 04:15 PM PDT

    Hello, I am brand new to programming/scripting, but I am very excited about an idea I recently had and plan to use it as a way to motivate me to gain skills

    I want to use the Twitter and Spotify APIs to make a script that automatically updates my bio to display what I am currently listening to.

    What is the best way to get started on this? I've already gotten a developer account and key for Spotify and am awaiting approval for a key from Twitter. I am just unsure as to how to write the actual script. As in, what language would work best, and if it should be run from some sort of cloud server or locally on my machine, etc.

    I understand this is probably a pretty complicated undertaking, but I plan to break it up into smaller milestones and learn over time to eventually accomplish my goal.

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

    What to use for desktop Developmnet(Linux, Windows)

    Posted: 25 Oct 2020 02:51 AM PDT

    Hi all,

    I want to start creating a desktop application cross-platform mainly for windows and linux(don't really care about mac). I would rather stay away from javascript framewroks, due to the large application size (I know most people don't care about that, but I do). So I started looking into other options such as the .NET framework and JavaFX. I was wondering if other alternatives exist or which you would pick?

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

    Upload images from Raspberry pi to Dropbox using python 3

    Posted: 25 Oct 2020 03:16 PM PDT

    This project is taking pictures for the sky and then it's going to mask the clouds, so there will be two pictures, one is the original and the other is the masked one.

    I just want to upload every picture taken by the camera pi to Dropbox.

    Here is the main code:

    import os import sys from datetime import datetime from makebinary import makebinary import dropbox # enable switching to picamera from commandline call (pass in 'picamera') if len(sys.argv) == 1: capture_method = 'gphoto' else: capture_method = sys.argv[1] basedir = '/home/pi/Pictures' # The radius in pixels of the fisheye lens area, set to None if no fisheye lens fisheye_radius = None # capture an image with the specified method if capture_method.lower() == 'gphoto': import subprocess out = subprocess.check_output(['gphoto2', '--capture-image-and-download']) for line in out.split('\n'): if 'Saving file as' in line: file = line.split(' ')[3] break else: raise Exception('GPhoto image capture and save unsuccessful.') elif capture_method.lower() == 'picamera': from picamera import PiCamera from time import sleep # open the camera and take the latest image file = 'latest.jpg' camera = PiCamera() camera.start_preview() sleep(2) # wait for the camera to initialise camera.capture(file) # capture and save an image to 'file' else: raise Exception("Invalid capture method {}. Use 'gphoto' or 'picamera'." .format(capture_method)) # capture the timestamp now = datetime.now() # create the relevant folders if they don't already exist os.makedirs(basedir + now.strftime("%Y/%m/%d"), exist_ok=True) # move the new image to within its relevant folder with a timestamped filename new_file = basedir + now.strftime("%Y/%m/%d/%Y-%m-%d-%H-%M-%S.jpg") os.rename(file, new_file) # process as desired (compute cloud coverage and mask image) makebinary(new_file, fisheye_radius) 

    So far I have tried these lines:

    with open(new_file, 'rb') as f: dbx = dropbox.Dropbox('Token) dbx.files_upload(f.read(),'/image.jpg') f.close() 

    But I'm just getting one image to be uploaded in the Dropbox and when I try again to run the code again I get this error which basically means it's already their in the dropbox. But what I really want is to upload the new pictures every time I run the main code.

    Here is the error:

    Traceback (most recent call last): File "/home/pi/DIY-sky-imager/capture_image.py", line 56, in <module> dbx.files_upload(f.read(),'/image.jpg') File "/usr/local/lib/python3.7/dist-packages/dropbox/base.py", line 2762, in files_upload f, File "/usr/local/lib/python3.7/dist-packages/dropbox/dropbox.py", line 340, in request user_message_locale) dropbox.exceptions.ApiError: ApiError('65464abaadc57d6d7862377638810', UploadError('path', UploadWriteFailed(reason=WriteError('conflict', WriteConflictError('file', None)), upload_session_id='AAAABR7Z7FHkkk9vyiuyw'))) 
    submitted by /u/drchees1
    [link] [comments]

    Kotlin SQL Room help please!

    Posted: 25 Oct 2020 06:49 PM PDT

    Can I refer to database column name with a variable?

    Here is a working example code how to update address to 1 person:

    @Query("UPDATE People SET Address = :New_Address WHERE id = :PersonId")

    fun updateField(PersonId: Long, New_Address: String)

    ////////////////////////////////////////////////////////////////////////////////////////////////

    I would like to do something like this:

    @Query("UPDATE People SET FirstNameField = 'George' WHERE id = :PersonId")

    fun updateSomeField(FirstNameField: String)

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

    Asking for language suggestions for web development as a complete newbie

    Posted: 25 Oct 2020 02:45 PM PDT

    I'm a photographer and want to build a website from scratch, for showcasing my work and selling prints. My primary requirement is that the website should be very aesthetic and fluid with a nice UI. I know squarespace and the likes of these template based builders are a good option but I like having complete control, I like doing things my way. Time is no bar for me, I'm ready to spend a few months or even years for this, as I'm still in college and photography is hobby and my life doesn't depend on it. I want to do it right.

    (I assume) My website won't be very complex since I just need a few pages to showcase my work, a method for taking orders and a payment gateway(which afaik can be outsourced like there are sort of plug ins (?))

    Up until about a week ago, I was a complete newbie to coding. I've just started learning python, as a friend of mine suggested that it's relatively easy to learn and will help me learn the basics of coding and how things in the programming world work, while also being a language I can later use for developing the back end of my website.

    Is learning python the right move? I know I'll need JS or CSS for the front end too, but I just wanted something to get me into it and python has been pretty welcoming so far.

    How long should I spend doing the basics before moving on and trying to build the website itself?

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

    Join the Developer's Inn Discord Server, a discord server to bring together programmers of all kinds to help each other out, collaborate and socialize with other developers!

    Posted: 25 Oct 2020 04:15 PM PDT

    Even if you're just learning how to program, or if you've been programming for years. Join the Developers Inn discord server. The goal for the discord is to bring together a community of programmers of all skill levels to help each other, collaborate and projects and socialize together!

    If you would like to join the server, click the invite link below.

    - Sky

    https://discord.gg/MKMjpJR

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

    Do you think it's better to peruse a carrier in Web Dev or Game Dev?

    Posted: 25 Oct 2020 04:08 PM PDT

    Quick career question guys. Do you think it's better to peruse a carrier in Web Dev or Game Dev? I am coming to a close on the first real CRUD app that I created, and am proud of how it looks and works. In the midst of creating it, I looked into the reason I got into programming, creating games, and played around in Unity. After going back and "refactoring" it, (changing from LAMP to Node) I feel I am getting a better grasp on the Web Dev side of programming. On my portfolio, however, I am kind of worried to split my attention between making games and doing something like Web Dev where I see better opportunities in the job market, i.e. FANG companies. Any advice? (btw, it's not like I dislike web dev I just love the idea of making games.)

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

    Should I quit?

    Posted: 25 Oct 2020 09:58 AM PDT

    My background is Business Management, hence why I use Bootcamp to bootstrap my career. I got a job offer to work with a well known company after I excel on each task they gave to me during the bootcamp.

    My reasons to quit:

    1. They won't show me the contract (salary, etc) yet until I passed the probation. I have to work for free until I am considered passed the probation. Note: They do not define how I can pass the probation.
      1. My senior think I am a peer instead of a junior. I assigned myself a task, is this normal for a junior?
      2. My senior is not well versed with the technology. I am not either.
        1. I was informed that we're going to use X language and X framework which I am well versed.
        2. 2 days before I started work, I was informed that we're going to use different language that I am not well versed with.
      3. The codebase is a security hazard. My senior claimed it is a legacy codebase, from an oversea vendor.
        1. I tried to refactor it but if you remove one dependency, it stops working. I will propose a complete makeover if it is possible, I will talk to my senior today.
        2. The previous vendor use the concept of X to the extreme. The dependencies are loaded on single file, whether we use it or not. This forced me to write a service logic inside a file with 1000 lines of code. note: I have discussed this with my senior.
        3. The framework is famous not to be backward compatible.
        4. I use Telegram as an indicator, this framework has the least activity per weekend. 1:15 ratio (for every 80 chat per weekend, the other framework would have 1500 chat). I also rarely see a job opening with this framework.
    2. They won't clarify whether I will work for the Bootcamp or the well known company.
      1. I've received the company email, @ auxiliary.wellknowncompany.com. Does this indicate I am a vendor?
        1. I have no interest to work for the Bootcamp.

    What am I worried for if I quit?

    1. I do not have any professional experience to claim "I am a Software Developer". This could prove to be very hard if I were looking for job on my own.
    2. My main drive is to work under someone so I can understand how Software Developer works, without professional experience or college education I am afraid no one is going to give me chance for an internship. Please prove me wrong.

    Edit: After consideration I will not propose a refactor. I will try to write test.

    Sincerely,

    kidfromtheast.

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

    Would you change my cruising checklist?

    Posted: 25 Oct 2020 11:44 AM PDT

    Since reading the great book The Checklist Manifesto by Atul Gawande, I have been creating some software development checklists for personal use. Most I believe will differ widely based of your teams processes and working practises. Though one might not and it's one which I'm having trouble coming up with ideas for. It's a checklist which may be similar to a cruising checklist used in aviation. You've got to altitude and cruising speed, nothing is currently wrong. Here it'll be used during development of a task when there isn't anything majorly wrong. Maybe you've finished a feature, got distracted and want to check what's going on.

    How would you change it?

    Cruise Checklist

    Pause point: Anytime during a task

    Type: READ - DO

    -[ ] Task checklist is clear about what you've done

    -[ ] Task checklist is clear about what you've got to do

    -[ ] Write down any open questions that you're not sure about

    -[ ] Tests pass

    -[ ] Stylecheck pass

    -[ ] Branch is up to date with master

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

    How to store an encryption key that is longer than 64 bits in c++

    Posted: 25 Oct 2020 02:35 PM PDT

    So basically I am trying to store and HMAC which is 160 bits long in c++. Is there any way to store it in something else than an array? I have been looking at Reddit and Stackoverflow, but couldn't find anything. Maybe I am just too tired today. Anyway I woudl appreciate some help.

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

    Is it, generally speaking, a good idea to use CMD as an interface between two programs?

    Posted: 25 Oct 2020 06:58 AM PDT

    A lot of helpful tools that you can find in the internet are actually command-line programs. And a lot of them are as well available as a library in the specific ecosystem they were written in. Of course, the preferred way to use the functionality of such a tool will always be to use the library, but what if you are working in an entirely different ecosystem?

    Let's say I am working on a project in the language or language family X, and I find a tool online that is actually a helpful part for my own program. However, the library is only available for language family Y. While there may be more or less reliable "bridges" between the two ecosystems, I'd personally tend to just call the tool from the command line. Is this a good idea? Is it a usual pattern in the industry? And could I even build whole dependency systems out of programs that call each other via CMD?

    Thanks!

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

    Any useful app ideas?

    Posted: 25 Oct 2020 01:36 PM PDT

    I live in Ireland and my country has gone into a second lockdown, I'm a recent college graduate and can't find a job because of this covid, any useful app ideas that i could potentially make money out of?

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

    How do i modularize a part of a web application with an API?

    Posted: 25 Oct 2020 01:35 PM PDT

    I am currently working on a web project with a group of 6. It is a recommender system and my job is calculating the similarities and returning a recommendation or some other relevant thing using a hybrid form of collaborative and content based filtering.

    Now if it wasnt a web project, i think i could have written the code necessary. However, i don't really have a good grasp of web applications. I'm trying to learn spring boot to be able to communicate with the member in charge of back-end. I'm expected to write an API (which i have never written one) that gets some input and do whatever calculation necessary with my database in MySql and returns the outcome.

    The problem is i don't even know what the problem is. How can i write an independent algorithm in a way that whether i wrote it on Python or Java, it doesn't matter and my friend can just connect the database to web application using hibernate? What do i need to learn and research in order to achieve this?

    I am willing to learn whatever language or technology is required. I need your inputs on this. Cheers!

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

    How does Kahoot's game code connection work?

    Posted: 25 Oct 2020 08:54 AM PDT

    I'm trying to build an app, and the idea is build upon people connecting in a kahoot way, so my app can find a match. But how do I do that with javascript in Android Studio?

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

    Java app import statement problems

    Posted: 25 Oct 2020 12:20 PM PDT

    Greetings everyone, I'm currently working on an app on Android studio using Java, I got most of it completed except for my splash screen I had a tutor help me out with creating a multiple screen splash page. He sent me the code with the instructions to remove the import statements that showed up in red/grey and then highlight the words that showed up in the rest of the code then import the class, but Android studio doesn't give me the option to import. I'm I doing something wrong? I've been in the setting to allow imports of classes but it still doesn't show up. I am doing this on my MacBook Pro

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

    Best Paid and Free Courses !

    Posted: 25 Oct 2020 12:09 PM PDT

    Guys , tell me the best resource for learning languages such as Python, C++ and JavaScript !!! Comment your answers. Hope it's helpful for every beginners !!!

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

    Java Framework recommendation

    Posted: 25 Oct 2020 12:00 PM PDT

    Hey guys, I ve been learning the java basics for a while now and i want to move on to more useful stuff like frameworks and i m seeking recommendation. So what would you guys recommend for me to learn as a first framework ? I m also learning Python but I would like to get better at java first before moving to more complicated Python stuff. Thanks in advance

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

    Quantum Computers

    Posted: 25 Oct 2020 09:33 AM PDT

    Hi,

    (For your explanations : I have the very base for computer science and a more important knowledge about quantic physics.)

    So my question is : what limits quantum computer power ? The superposition principle should allow a unic Q-bit to store an infinity of states, doesn't it ?

    I know that limitation comes partly from precision when measuring, but yet I think I understood there are some other limits, what are they ?

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

    Help with my code

    Posted: 25 Oct 2020 08:40 AM PDT

    #include <stdio.h>

    #define N 10

    void max_min(int a[], int n, int *max, int *min);

    int main(void)

    {

    int b[N], i, big, small;

    printf("Enter %d numbers: ", N);

    for (i = 0; i < N; i++)

    scanf("%d", &b[i]);

    max_min(b, N, &big, &small);

    b[0] = 4;

    printf("Largest: %d\n", big);

    printf("Smallest: %d\n", small);

    return 0;

    }

    void max_min(int a[], int n, int *max, int *min)

    {

    int i;

    *max = *min = a[0];

    for (i = 1; i < n; i++) {

    if (a[i] > *max)

    *max = a[i];

    else if (a[i] < *min)

    *min = a[i];

    }

    }

    How do i change it so that the scanf function allow any user input up to the number of length N? Assuming i enter " 1 2 3" it should print max is 3 and min is 1.

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

    videogame coding

    Posted: 25 Oct 2020 07:31 AM PDT

    I know there is a tank game, where you need to code the algorithm to move it and fight the other tank coded by the opponent. Do you know any other game like this where you need to code and fight with that?

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

    What are some IDE's you recommend for the Linux OS for C++ programming?

    Posted: 25 Oct 2020 03:04 AM PDT

    Visual Studio I think is only for Windows, so I was curious which IDE's do you guys recommend?

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

    Note taking on URL

    Posted: 25 Oct 2020 02:12 AM PDT

    Hello community, I am looking for a software that helps with taking notes while browsing website. It can be standalone or browser extension.

    Ui:

    Address bar top

    Web view box // Notes box

    If I start to look into building this on my own what is the easiest to reach the above ui : a python with embedded webkit or chrome extension?

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

    Is this program possible?

    Posted: 25 Oct 2020 05:46 AM PDT

    I'm a noob and know the basics of programming in Python. I plan to make an online audience for myself. Hopefully, as I get more popular, I'll start getting lots of DMs and I won't be able to read them all day.

    Is it possible to make a program that'll read them, sort useless ones (insults, dick pics, time-wasters etc) from useful ones (possible clients)? Maybe that it it can recognize most frequently asked questions and respond to them? And that it can scan for most requested content and rate which was most popular?

    What would I need to learn to know how to build something like that?

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

    No comments:

    Post a Comment