• Breaking News

    Sunday, January 10, 2021

    What are the differences between a REST api and other APIs? Ask Programming

    What are the differences between a REST api and other APIs? Ask Programming


    What are the differences between a REST api and other APIs?

    Posted: 10 Jan 2021 12:40 PM PST

    if a mobile application communicates with a web application is it called a restful api? When is json not needed in rest?

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

    What's the most useless thing you ever coded? And also, what are some ideas of useless code?

    Posted: 10 Jan 2021 04:33 PM PST

    What's the most useless program you ever coded? And what are some ideas of something pointless for me to code? For example, I coded a robot that floods my WhatsApp/Messenger, or one that changes everyone's name in the group, so things like that, if your idea isn't useless or at least strange, don't comment it here, I have seen a question almost like this, but I wanted to gather more ideas

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

    What's the most complex SQL query you ever had to perform in an app? Are Joins common?

    Posted: 10 Jan 2021 08:13 PM PST

    I think the question speaks for itself...

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

    Bitcoin Miner from scratch?

    Posted: 10 Jan 2021 10:50 AM PST

    I don't have any experience with bitcoin so... But I can do C++ fairly well.

    How long would it take to write my own bitcoin miner from scratch in C++, specifically for windows ?

    Would the program be 2 parts like 1 part for mining and the other would be a wallet? Or is it possible to connect to an external 3rd party wallet?

    What libraries would I need?

    Cheers

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

    Python 3: how many newlines after a function?

    Posted: 10 Jan 2021 06:28 PM PST

    I usually use PyCharm for Python development. Its linter decides that every function/class definition should be separated by 2 newlines, though (and this could just be me) I feel like this leaves the file with too many gaps. In a lot of code I see online, there is usually just one newline between each function (for example).

    Is the use of 2 newlines after function/class definitions a Python code style standard?

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

    Full stack best all round option 2021 web/mobile

    Posted: 10 Jan 2021 02:44 AM PST

    Last year I started learning web dev again after about 15 years away from it. Man has it changed a lot and it's been tough to get going again but anyway. I'm looking towards being able to develop full stack applications with accompanying mobile apps (android/iOS) and wanted some advice about which stack is the most appropriate for working across these platforms with the least amount of hassle.

    For context I picked asp.net core as my first stack because it was already using my favourite IDE and so it would be less of a learning curve in that respect. My intention was to use this and then pick up on xamarin to do the mobile dev part with the option to deploy on iOS/android. For more context the kind of websites I want to build in the endgame will be e-commerce type apps/sites with integrated payment options on the site and the mobile parts.

    I know there is lots out there and it can be done in a million and one ways but wanted to hear from some experienced pros about which stacks they found the best so far.

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

    What type of person do you recommend to be a computer programmer?

    Posted: 10 Jan 2021 09:27 PM PST

    I start Harvard's CS50 online course tomorrow, and want to dedicate my full time to it so I can begin to transition to programming. My problem is I don't want to dedicate months of my time and then realize that I don't enjoy it at all. What are some things about learning coding that most people don't realize (if there is any)

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

    Would anyone be interested in taking an online course together? (SICP)

    Posted: 10 Jan 2021 05:54 PM PST

    I am a self taught frontend dev trying to boost up on some of my fundamentals, I was thinking of taking Structure and Interpretation of Computer Programs link. I am leaning towards SICP, because it seems to have a good rep, plus I want to get into functional programming a bit.

    What I am thinking is to set up a kind of accountability group, like a virtual classroom with about 10 or 15 people that can hold each other accountable. I can only commit to about 2 hours a week so it might be slow, but I want to do it in a group because I find that the camaraderie is missing in online learning. I think it might make it more effective, at least for me. Let me know if there is interest and we can set something up. If more people want to join, maybe we set up more rooms?

    Let me know, thanks!

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

    BitTorrent based social media

    Posted: 10 Jan 2021 05:07 PM PST

    Could I make a social media program that runs entirely on the BitTorrent protocol?

    I'm imagining this to be text posts only (potentially low-size images). The program is essentially a BitTorrent client that reads posts stored in Tor files. Every time a user makes a post, it would be turned into a new torrent file that is tagged to user IDs.

    Each user has a copy of a master list that contains all the torrent links of every every post made by every member they follow.

    Since each user is seeding these Tor posts, it would require no servers and have no centralized control.

    Is this something that could actually work?

    submitted by /u/M-aster-York
    [link] [comments]

    How can I map json data to pandas column headers

    Posted: 10 Jan 2021 01:41 PM PST

    I was hoping someone may be able to give me a few pointers. I have a json file with multiple key, value pairs. I would first like to turn this into a dictionary and then rename the column headers based on the values. How can I go about doing this? I have included a pic of the json file output. Any help would be greatly appreciated.

    https://imgur.com/8pn0f3s

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

    FIDO UAF Authentication

    Posted: 10 Jan 2021 09:52 AM PST

    Greetings programmers! I need your help for a task concerning FIDO2. My task is to use FIDO 2.0 platform and StrongKey to create an authentication system with 1) Biometrics & 2) Second factor authentication I tried to do this in Virtual Box using Linux from an open source code I found on GitHub but there were some errors I could not debug. Is there anyone who had created a FIDO authentication system like the one I need? And if yes can you please share some screenshots of the code you run and its functionality when you run it? I would be very thankful if someone could help me out here! Thank you!

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

    Javascript onmouseleave coordinates

    Posted: 10 Jan 2021 07:39 AM PST

    For the javascript event onmouseleave is there any way to capture the page coordinates immediately where the mouse exits the boundaries of the div in question?

    I find that by time as the event is triggered the mouse has already traveled far outside the bounds of the div and reports something far out.

    Any help is appreciated

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

    Why is this site so light and responsive?

    Posted: 10 Jan 2021 01:18 PM PST

    Hey guys, was reading an article shared on HN and when I clicked the linked article, I fell on one of those sites that really grab my attention. I used to stumble on such light and responsive sites that were built using PHP if I remember correctly, but this seems like it's simply HTML5 and jQuery/JS.

    http://algorithmsbook.com/#

    I'm not a programmer by any means, but I appreciate understanding things that peak my curiosity. What makes this site just flow, respond and transition so smoothly.

    Is it because of its lack of "bloatware" no CMS since it doesn't need one, site map is small and minimal pages, etc. ?

    Thank you!

    ** PS: is there any uses for PHP for front-end dev anymore now with HTML5 being so functional? **

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

    Difference between MVC vs MVVM in layman's terms ?

    Posted: 10 Jan 2021 05:43 AM PST

    How can we say that Angular is MVVM and why do we say that. And similarly we have MVC in spring and ASP .NET. How do we say these ? And what are these btw ??

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

    Need Help with a code that is not taking an image as input

    Posted: 10 Jan 2021 06:35 AM PST

    It's supposed to display a grid image filled with sprites, but it's giving a blank window as output. I've tried including complete path like "C:\\......" till sheet.png. it still doesn't work. So can anyone help me out, please?

    <

    public class SpriteSheet {

    private String path; public int SIZE; public int\[\] pixels; 

    public static SpriteSheet tiles = new SpriteSheet("res/textures/sheet.png", 256);

    public SpriteSheet(String path, int size) { this.path = path; SIZE = size; pixels = new int\[SIZE \* SIZE\]; load(this.path); } private void load(String path) { try { BufferedImage image = [ImageIO.read](https://ImageIO.read)(new File(path)); int w = image.getWidth(); int h = image.getHeight(); image.setRGB(0, 0, w, h, pixels, 0, w); } catch (IOException e) { e.printStackTrace(); } } 

    />

    In case if you ask If I've imported the stuff that are need, I did. let me know if the code is too big. i'll just include the parts of the code that are being highlighted.

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

    Arduino Nano

    Posted: 10 Jan 2021 07:46 AM PST

    Dear Reddit,

    I'm programming with a Arduino Nano for a school assignment. I need to drop de Arduino from a specific height with a parachute. Meanwhile the Arduino has to measure the time in milliseconds (tijd in dutch) and the temperature (temperatuur in dutch). The Arduino needs to save the measurements in a SD card. The programm is working fine, except that the Arduino only works when it is linked to my computer. Does anyone know how you can make the Arduino run the programm without it being linked to my pc?
    // The programm:

    #include <BME280I2C.h>

    #include <Wire.h>

    #include <SPI.h>

    #include <SD.h>

    File myFile;

    #define SERIAL_BAUD 9600

    BME280I2C bme; // Default : forced mode, standby time = 1000 ms

    // Oversampling = pressure ×1, temperature ×1, humidity ×1, filter off,

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

    void setup()

    {

    Serial.begin(SERIAL_BAUD);

    while(!Serial) {} // Wait

    Wire.begin();

    while(!bme.begin())

    {

    Serial.println("Could not find BME280 sensor!");

    delay(1000);

    }

    // bme.chipID(); // Deprecated. See chipModel().

    switch(bme.chipModel())

    {

    case BME280::ChipModel_BME280:

    Serial.println("Found BME280 sensor! Success.");

    break;

    case BME280::ChipModel_BMP280:

    Serial.println("Found BMP280 sensor! No Humidity available.");

    break;

    default:

    Serial.println("Found UNKNOWN sensor! Error!");

    }

    Serial.print("Initializing SD card...");

    if (!SD.begin(4)) {

    Serial.println("initialization failed!");

    while (1);

    }

    Serial.println("initialization done.");

    // delete the file:

    Serial.println("Removing test.txt...");

    SD.remove("test.txt");

    if (SD.exists("example.txt")) {

    Serial.println("test.txt exists.");

    } else {

    Serial.println("test.txt. doesn't exist.");

    }

    }

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

    void loop()

    {

    printBME280Data(&Serial);

    delay(500);

    }

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

    void printBME280Data

    (

    Stream* client

    )

    {

    float temp(NAN), hum(NAN), pres(NAN);

    BME280::TempUnit tempUnit(BME280::TempUnit_Celsius);

    BME280::PresUnit presUnit(BME280::PresUnit_Pa);

    bme.read(pres, temp, hum, tempUnit, presUnit);

    // open the file. note that only one file can be open at a time,

    // so you have to close this one before opening another.

    myFile = SD.open("test.txt", FILE_WRITE);

    // if the file opened okay, write to it:

    if (myFile) {

    Serial.print("Writing to test.txt...");

    String dataString = "";

    long tijd = millis();

    long temperatuur = temp;

    dataString += "De tijd is: ; ";

    dataString += String(tijd);

    dataString += " ; ms";

    dataString += " Temperatuur: ;";

    dataString += String(temperatuur) ;

    dataString += " ; graden Celcius";

    myFile.println(dataString);

    // close the file:

    myFile.close();

    Serial.println("done.");

    } else {

    // if the file didn't open, print an error:

    Serial.println("error opening test.txt");

    }

    // re-open the file for reading:

    myFile = SD.open("test.txt");

    if (myFile) {

    Serial.println("test.txt:");

    // read from the file until there's nothing else in it:

    while (myFile.available()) {

    Serial.write(myFile.read());

    }

    // close the file:

    myFile.close();

    } else {

    // if the file didn't open, print an error:

    Serial.println("error opening test.txt");

    }

    delay(1000);

    }

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

    Color picker gradients

    Posted: 10 Jan 2021 07:42 AM PST

    For photoshop esque colorpickers with the linear black gradient from down up and white from left right on top of a bright color, what are those colors stop percentages?

    Is there any math to know to get the maximal amount of color possibilities with the gradients? What is commonly used?

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

    Keyboard Avoidance overlay Bottom Menu Fix in SwiftUI

    Posted: 10 Jan 2021 07:25 AM PST

    I am running into an issue in my View (using SwiftUI) that is dealing with Keyboard avoidance and the UITextView itself. It seems that my keyboard is being "squished" between my bottom menu tabs and the background color. I would very much like to fix this error and/or create a better menu if possible. Here is the link to the Stack Overflow question: https://stackoverflow.com/q/65654765/12696801

    Any help would be greatly appreciated!

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

    What is the formal/technical term for "irregular" data structures?

    Posted: 10 Jan 2021 07:07 AM PST

    JavaScript allows you to construct complex objects whose forms are "irregular":

    const myData = { id: 12, name: 'Foo Bar', content: { created: 10542423432234, body: { /* ... */ } } }; 

    ...as opposed to arrays, maps, etc. which have a more "regular" type.

    In statically typed languages like Java, you would have to define classes to express structures like this. But classes generally mean data + behavior, and I'm asking only about the data part.

    Is there a formal/technical term for such "irregular" data structures?

    Edit: I think "hierarchical data structures" or "trees" would be the answer. Am I correct?

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

    3D animation with Pop Up

    Posted: 10 Jan 2021 03:02 AM PST

    I have a small issue and I really do not know how to solve it in a easy way.

    I would like to develop a 3D animated Hous using javascript. I would like to move the house in 360 degrees, but without seeing the bottom ground. Additionally, there should appear some Pop Ups. For example, if you move the mouse over a window or the roof, there should appear a message popup, describing the window(or the roof). Its possible to develop it in a easy way ?

    Please help

    (I already developed a small 3D House which is moving by it self)

    Variable for the setup

    let container;

    let camera;

    let render;

    let scene;

    let house;

    function init() {

    container = document.querySelector('.Haus');

    Crate scene

    scene = new THREE.Scene();

    const fov = 35;

    const aspect = container.clientWidth / container.clientHeight

    const near = 0.1

    const far = 500;

    Camera setup

    camera = new THREE.PerspectiveCamera(fov, aspect, near, far);

    camera.position.set(-3,5,30)

    const ambient = new THREE.AmbientLight(0x404040, 3)

    scene.add(ambient)

    const light = new THREE.DirectionalLight(0xffffff, 20)

    light.position.set(10,10,150)

    scene.add(light)

    Renderer

    renderer = new THREE.WebGLRenderer({antialias: true, alpha: true})

    renderer.setSize(container.clientWidth, container.clientHeight)

    renderer.setPixelRatio(window.devicePixelRatio)

    container.appendChild(renderer.domElement)

    Load Model

    that is the 3d House which I am using, at that moment the house is just circulating in 360 degrees

    let loader = new THREE.GLTFLoader();

    loader.load('./3d/scene.gltf', function(gltf){

    scene.add(gltf.scene);

    house = gltf.scene.children[0];

    renderer.render(scene,camera)

    animate();

    })

    }

    function animate () {

    requestAnimationFrame(animate);

    house.rotation.z += 0.005;

    renderer.render(scene,camera)

    }

    init()

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

    C++ getting the error the procedure entry point ... could not be located in the dynamic link library.

    Posted: 10 Jan 2021 04:58 AM PST

    Hi, I'm a super beginner (havent gotten to loops yet so english plz) and after doing cout for a bit I'm trying cin prompts and im getting this error. The code compiles fine. I tried all the solutions that come up when I google this error. Here is my code:

    include "stdafx.h"

    include <iostream>

    include <cmath>

    include <string>

    using namespace std;

    int main ()

    { string answer = "yes or no";

    int hour = 0; cout << "are you studying programming?" << endl; cin >> answer; cout << answer << "? Great! Glad to hear that! " << "how many hours will you practice today?"; cin >> hour; cout << "okay! Good luck! << endl; return 0; 

    }

    The specific error message is The procedure entry point _ZNSt7_cxx1112basic_stringlcSt11char_traitslcESalcEEC1EPKcRKS3_could not be located in the dynamic link library C:\Users\Me\Desktop\Folder\subfolder\subfolder\cpp.exe

    my firewalls and virus scans are disabled (because it would trigger avast each time)

    Thank you in advance!

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

    Can you recommend a book like Numerical recipes/Jamsa's bible but broader, covering more topics

    Posted: 10 Jan 2021 03:41 AM PST

    I have both books but was wondering if there was an even broader compilation of functions/algorithims.

    I feel like a relatively competent C programmer but definitely sometimes forget common patterns and it'd be nice to have a single reference to go to when I want to check my implementation of something.

    Recently I wrote a fisher-yates shuffle in typescript and I *think* I fixed an off by one error but still am not entirely convinced. It'd be nice to have a respected text I could look at for it, similarly recently I wrote a array reversing function in C and it looks simple and good but would like to, again, have somewhere that might have covered array reversing.

    Mildly surprised I couldn't find a standard library string reverse, and that javascript doesn't come with a shuffle function?!

    (Original posted to learnprogramming but no answer replies there at all after more than 24 hours)

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

    Help in connecting to a database

    Posted: 10 Jan 2021 03:12 AM PST

    Greetings people of this subreddit. I would like to ask for some guidance in this situation where I'm confused on what to do. I have a database in my laptop using XAMPP and I'm lost on what to do in letting my teammates from another city connect to it through the internet. Is there a way to this or shall I just use a cloud database service? I have programmed for a few years but I still have a lot to learn

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

    Automatic Inventory

    Posted: 10 Jan 2021 03:11 AM PST

    I have a business idea but I don't know how practical it could be. This business would include a sort of automatic inventory system that would track and purchase inventory. Is this feasible?

    The problem I see is that there are so many different sites and suppliers that it would difficult to automatically purchase inventory for a wide range of consumers.

    What type of programming languages or skills should I look for if I were to hire a developer??

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

    No comments:

    Post a Comment