• Breaking News

    Friday, October 30, 2020

    How to learn how computers and hardware works from a low level? Ask Programming

    How to learn how computers and hardware works from a low level? Ask Programming


    How to learn how computers and hardware works from a low level?

    Posted: 30 Oct 2020 07:13 AM PDT

    I'm interested in computer science but also the engineering (hardware) side of it. I found the website teachyourselfcs(.com), the courses nand2tetris and CS50 and the youtube Channel beneater. If I were to learn from these resources, would I know how computers work, and technology in general? What other resources do you recommend? I am also interested in cybersecurity, do you maybe know some resource which is focused on how computers work from a cybersecurity perspective?

    Thanks

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

    (Possible Commission) Need someone experienced with Linux to help me with this erroring deployment script.

    Posted: 30 Oct 2020 07:27 PM PDT

    Ok, so I'm trying to set up an automated Plex server, but I am not well versed in Linux environments. I barely got my Pi running a VPN, qBittorrent, and Plex. For a while I couldn't even get Plex to read my external drive lol. Moral of the story, I found this script, and got ballsy. I wiped my Pi thinking this would be a simple, basically one step setup. The script (found here), is supposed to deploy everything I need to automate my server. The problem is I keep getting an error when following the instructions. (Too good to be true, right?) It looks like the script runs fine until it tries to start the Jackett service. I've attached a screenshot of the terminal output here, and the error log here. If anyone knows how to get this script working properly, it would be a godsend. Trying to install and configure everything manually is just not something I have the skillset for. If anyone knows of another script that does something similar, please let me know. I would also be happy to pay someone to write a script for me that I would then make publicly available. TBH I'd pay good money for a script that would run on a clean install of rasbian without any user input. If you made it this far, thank you for your time. I know this is a lot to take in but I have faith that the community will guide me through this one. Please DM me if you're interested in getting paid to write a script, or leave any comments below that you think may be helpful!

    Btw I've tried this script on clean installs of the following: Rasbian, Ubuntu 20, and Ubuntu Mint. All give the same error.

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

    CMake: correctly exporting dependencies

    Posted: 30 Oct 2020 07:57 PM PDT

    I have a project that is comprised of several libraries that can be consumed independently by users. I am using CMake 3.4.

    BigProject/ ├── cmake │ ├── LibIberty.cmake │ └── Modules │ └── FindLibIberty.cmake ├── CMakeLists.txt ├── libA │ ├── a.cpp │ ├── a.h │ └── CMakeLists.txt └── libB ├── b.cpp ├── b.h └── CMakeLists.txt 

    Each sub-library has unique dependencies. In particular, libB requires libiberty from GNU binutils. Because CMake does not have a built-in package for this, I had to write my own. The cmake/Modules/FindLibIberty.cmake is straightforward. However, I have an issue in cmake/LibIberty.cmake that I don't understand. The last part of that file contains

    add_library(LibIberty STATIC IMPORTED GLOBAL) set_target_properties(LibIberty PROPERTIES IMPORTED_LOCATION ${_li_libs}) set_target_properties(LibIberty PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${_li_inc_dirs}) 

    If I change the last two lines to

    target_include_directories(LibIberty INTERFACE ${_li_inc_dirs}) target_link_libraries(LibIberty INTERFACE ${_li_libs}) 

    the LibIberty library file is no longer passed on the linker line (i.e., it should be

    g++ -L/path/to/libiberty -liberty ... 

    , but it is actually

    g++ ... 

    ).

    Question 1

    Why does target_link_library(... INTERFACE ...) not have the same effect as set_target_properties(... PROPERTIES IMPORTED_LOCATION ...)?


    To make LibIberty a link dependency for libB, I have the following in libB/CMakeLists.txt:

    if(TARGET LibIberty) target_link_libraries(libB PRIVATE LibIberty) endif() 

    Eventually, we may build LibIberty as a shared library, so I would need to make it part of the public link interface for libB. However, if I change PRIVATE to PUBLIC, consumers of my libB get a linker error because CMake puts -lLibIberty on the link line. This is nonsensical because the correct link flag should be -liberty. target_link_libraries specifically states that you are allowed to use target names as the last argument, so I'm very puzzled by this.

    Question 2

    Since the LibIberty target is STATIC IMPORTED, why can't CMake figure out that there should be no linker flags needed by the consumer of libB?


    Finally, I have a more general question. I would like to be able to let consumers of my library be able to say

    include(BigProject) target_link_libraries(MyProject PUBLIC BigProject::libB) 

    to pick up all of the necessary transitive link dependencies and includes. I have seen this syntax often, but I can't figure out how to actually implement this functionality. Part of the problem is that I don't know what this formulation is called.

    Question 3

    What is BigProject::libB actually called?

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

    Just tried atime, ctime and mtime, none of them accurately state when added to a folder

    Posted: 30 Oct 2020 09:08 PM PDT

    Windows filesystem itself isnt perfect at recording the times files are added to a folder I am using in Nodejs. Sometimes Windows shows a far future date for a current file and sometimes a wrong date.

    I use the synchronous method fs.statSync(file).atime and ctime and mtime and birthtime to check when dates are matching when any particular file is added to a windows directory or last time renamed.

    However none of the times returned are accurately representing the time when I last added a file to the folder or last time renamed.

    my last option is setup a database and send a sql timestamp there when a file is added, which I don't want to do. I want to get the correct native time from the file system

    Does anyone have a better solution like blocks inodes?

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

    simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

    Posted: 30 Oct 2020 08:34 PM PDT

    Hi everyone, I hope you're doing good.

    I'm trying to get the solar radiation values from this website 'solcast.com.au' .. I have went to their API documentation and followed it here ' https://docs.solcast.com.au/#forecasts-by-location' and I have applied the code:

    import requests url = 'https://api.solcast.com.au/world_radiation/forecasts?latitude= -33.865143&longitude=151.209900&api_key=MYAPI' res = requests.get(url) data = res.json() forecast = data["forecasts"]["ghi"] print('forecastss: {} dgree'.format(forecast)) 

    So when I run the code I'm getting this error:

    Traceback (most recent call last): File "/home/pi/Desktop/solcastoo.py", line 5, in <module> data = res.json() File "/usr/lib/python3/dist-packages/requests/models.py", line 897, in json return complexjson.loads(self.text, **kwargs) File "/usr/lib/python3/dist-packages/simplejson/__init__.py", line 518, in loads return _default_decoder.decode(s) File "/usr/lib/python3/dist-packages/simplejson/decoder.py", line 370, in decode obj, end = self.raw_decode(s) File "/usr/lib/python3/dist-packages/simplejson/decoder.py", line 400, in raw_decode return self.scan_once(s, idx=_w(s, idx).end()) simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0) 

    Would really appreciate your help.

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

    Encountering a weird problem using a method from ml5.js

    Posted: 30 Oct 2020 05:56 PM PDT

    var num_array=[23,4];

    nn.addData([23], [4]); ---This works

    nn.addData([num_array[0]], [num_array[1]]) ---this doesn't work and should be equivalent to above

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

    Programming Specialization vs Generalization, Which is your game plan for the future?

    Posted: 30 Oct 2020 10:00 AM PDT

    For "Specializations"

    1. What are you specializing in?
    2. How much of "Specialization" is too much?
    3. Also, why specialization?

    For "Generalization"

    1. Which area are you "generalizing" in?
    2. Do you think "generalizing" is future proof?
    3. Also, why "generalization"?

    Fyi, my definition of "specializing" is a developer that is specialized in one tool/framework or even a language? Really depends. I have heard stories of senior developers who specialized in one framework and made quite a lot of money and didn't lack any job invites. But some also had to move around states chasing jobs with little pay.

    And my definition of "generalization" is, for example, full-stack developers... you get the idea.

    The purpose of this question is to try to figure out how much specialization does one needs to survive in the long run? I know that entry-level has been saturated by Bootcamp developers soon the demand for specialized developers will increase (even now), but how much of specialization is enough?

    I am asking these questions because I am in Uni staying for SWE, and I want to make a game plan for the future but it seems like the future is not very clear, so I figure asking you people.

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

    Am I the only one who thinks they would have never finished college if it wasn't for the internet?

    Posted: 30 Oct 2020 05:14 PM PDT

    I just finished college, and my degree was software development, if I didn't have the internet I would be screwed. Just so you know, I didn't use the internet for plagiarism or cheating, just for help and more knowledge, only for StackOverflow and similar forms and tutorials on how to get better on things, even with the internet at my disposal I still bearly got my assignments done. I finished college with most mostly 4 B's, 2 C's, and 1 D.

    I think I would have failed my course if it wasn't for the internet. Can anybody else relate to this feeling?

    How did people do it decades ago with much much less resources?

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

    Is there best practices for Dataframes? Having constantly changing columns makes code unreadable.

    Posted: 30 Oct 2020 07:40 AM PDT

    Dealing with legacy Python Code, there are a few thousand lines of code and over 70% are manipulating Pandas dataframes.

    I've been told, that's how you use dataframes.

    The SQL in me thinks there must be a better way to structure code.

    The issue is understanding the code. It's impossible to view line 2300 and know what column names and what data you are looking at. The only way is debugging.

    As a note, there are no comments or unit tests. There's only 1 other programmer currently.

    I'm given the opportunity to do both bug fixes and write new code. I want to do it correctly.

    Any suggested Programming practices? Link's to websites are also appreciated.

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

    Difference between an API and Requests?

    Posted: 30 Oct 2020 12:42 AM PDT

    What's the difference between me just performing a request with a payload ex. (User, Password) + curling button clicks versus an API key that gives you the same data?

    I know that if the website changes, then the request commands don't work anymore compared to an API but aside from that:

    Is there a difference in processing speed? Security?

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

    I used the Vue CLI to scaffold a Vue project template. I found a dev-server.js file that serves the development server but am unsure where to place the prod-server file and how to manage it

    Posted: 30 Oct 2020 12:28 PM PDT

    I cloned vue-seed to get a template set up for my vue project.

    It contains dev-server.js which is pretty self explanatory

    However I soon needed a prod server file so I created prod-server.js in a new folder called /server in the root directory. All good so far. However it soon felt I was doing something wrong as I would have to copy changes over from dev-server.js into prod-server.js in order to make changes to prod. And this felt really redundant.

    Within the vue-seed how do I properly handle and update a prod server file?

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

    Not sure what to do next after learning express, mongodb and various other adjacent backend technologies.

    Posted: 30 Oct 2020 10:12 AM PDT

    Hello, I am about to be done taking a nodejs course where I have learned express, mongodb, mongoose, and various other adjacent backend technologies. So far I have learned how to create a web-server weather app that uses a weather api, self-created api and heroku, I have also learned how to create a REST api task-manager app involving users, user authentication, and web-tokens, and now I'm about to learn how to create a real time chat app using socket.io.

    After I'm done with the course I plan on taking another course on reactjs so that I can create frontend apps and connect them to the backend, but while I do this I want to simultaneously work on honing my skills and knowledge in the backend. I know that the best way to do this is by working on personal and open source projects, but when I do a google search for these things I don't find much. So my real question is what projects can and should I be working on with the skills that I've learned?

    I am especially interested in contributing to other people's projects but I don't know how I would go about doing this.

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

    Where should my recommendation algorithm be?

    Posted: 30 Oct 2020 01:22 PM PDT

    I have recently been trying to embed an algorithm into my social media app. I've done some research about how the algorithm should work and I think that I should get started. But, a big problem that I have is where do I put this algorithm? I am using firebase to store all of the data in my app, and the actually recommendation system will be for videos (like tik tok or YouTube's) .

    I have got a couple of answers but they weren't enough for me to know where to code this algorithm...

    Someone told me that it should live inside of the Firebase API, not in the app client. I am not too sure, can someone give me advice on where the algorithm should live. Also, about the language can it be done in swift?

    a quick answer works, but more information is appreciated.

    Thanks in advance!

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

    How do I handle a TCP connection with raw sockets?

    Posted: 30 Oct 2020 04:59 AM PDT

    A client calls connect() on a TCP server socket. I currently accept connections and then close them if they are from my 'banned' IP addresses.

    This works fine but I was wondering if I can do better? Maybe if I have a raw socket implementation of a TCP connection handler, I could avoid connecting with DDoS attackers in the first place?

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

    How does twitter hydrate tweets from user-feed

    Posted: 30 Oct 2020 09:52 AM PDT

    I read on a blog that each user has their timeline in cache and it contains ids of tweets, then when its asked for its hydrated with the tweet data, so does twitter just query the db against those ids ?

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

    How should functions that keep state across multiple invocations be made safe?

    Posted: 30 Oct 2020 06:28 AM PDT

    What are some interesting algorithms and data structures dating sites use?

    Posted: 30 Oct 2020 05:30 AM PDT

    How to Get More Sales on Black Friday (TOP 5 Big SEO Tips)

    Posted: 30 Oct 2020 11:01 AM PDT

    I'd like to make a website, where users have their own public page. And I'd like for them to be able to enter their phone number for public viewing, and for them to be able to change it if they choose to. Can you point me towards this goal?

    Posted: 30 Oct 2020 04:52 AM PDT

    It's difficult to ask a question, when you don't have the jargon to ask it with. - Any terminology that I should be referring to things by would be of great help. Any help would be of great help.

    I need to know what to ask of a programmer. Such as "I need a CMOS with a dynamic page, and user created content." As an example in a nonsensical question.

    Thank you!

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

    Fibonacci code works, but I don't feel confident enough!

    Posted: 30 Oct 2020 12:49 AM PDT

    #include<stdio.h> int main() { int x1,x2,n_i,n,fib_o,temp,count; x1=1; x2=1; n=n_i=10; count=0; while(count<n) { if(count!=0 && count!=1) { temp=x1; x1=x2; x2=x1+temp; } fib_o=x2; printf("Fibo NOW =%d\n",fib_o); count++; } } 

    This is the code that I am confused(even though I perfectly understand each and every line.

     temp=x1; x1=x2; x2=x1+temp; 

    It is evident that what is being done here is that

    LET temp memory location=value of x1

    LET x1 mem locn=value of x2;

    LET x2 mem locn=new value of x1 SUM new value of temp.

    i.e it is using a_n=a_n-1+a_n-2 as the nth term of fibonacci sequence. But I feel confused. Like how is this code solving the problem?

    And what if I get other different kinds of series? I want to get a mentality of problem solving rather than solving this alone(There was pseudocode available online for this).

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

    Made a new sub as the unofficial "Help Me" section of r/androiddev

    Posted: 30 Oct 2020 12:12 AM PDT

    I can't really find a subreddit for android dev questions, r/AskProgramming doesn't seem to be very engaged in Android questions, so if anyone wants to join this and start building a community to DEMOLISH StackOverflow (I seethe at the mention of the name *insert meme of know-it-all trolls downvoting honest questions and end up getting "noobs" banned because they felt like it*), you would be more than welcome to join!

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

    I'm looking for a small, GCP deployable solution which helps handling and organising system wide user events

    Posted: 30 Oct 2020 12:41 AM PDT

    I'm looking for a small, GCP deployable solution which helps handling and organising system wide user events (ex. Someone registered -> send welcome email + notify contacted sales person on Slack+ make a note on HubSpot + other actions)

    I could only find marketing tools, but I'm looking for something we can easily modify with custom ways of handling events.

    Do you know about anything which could help?

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

    No comments:

    Post a Comment