• Breaking News

    Tuesday, December 29, 2020

    How to develop an API from scratch? Ask Programming

    AskProgramming

    How to develop an API from scratch? Ask Programming


    How to develop an API from scratch?

    Posted: 29 Dec 2020 09:55 AM PST

    Basically an API like for an e-commerce or social media platforms —- What programming language should I use for that? Is there a specific hosting for APIs? Can I develop that on my localhost? Do you guys have any tips on developing an API from scratch?

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

    Question About A Domain Name

    Posted: 29 Dec 2020 08:19 PM PST

    A customer says they are interested in starting up their online business again. The co owner doesn't know if he still owns the domain. We are trying to find out if he still does. But the whois shows godaddy privacy mask. Is there anyway we can see if the ownership of the domain lapsed and someone else bought it, or if the original registrar is still the owner?

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

    What does a day in the life of a front-end developer look like?

    Posted: 29 Dec 2020 07:16 PM PST

    What kind of projects do you typically work on. And what do you consider monotonous, and what do you consider interesting on the job. Thanks!

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

    How to sync threading in python.

    Posted: 29 Dec 2020 09:05 PM PST

    I have two hooks running, one for mouse, and one for keyboard, and I want to play back inputs at the same time. The problem is that there is not perfect sync between the two playbacks, with mouse or keyboard being slightly ahead at any given moment. Does anyone know a way I can control the offset of the timing between threads?

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

    Need help with this program (C++)

    Posted: 29 Dec 2020 08:11 PM PST

    string equation; cin >> equation; char op; for (int i = 0; i < equation.length(); i++) { if (isdigit(equation[i]) == 0) { if (isspace(equation[i]) == 0) { op = equation[i]; break; } } } 

    Variable <op> isn't getting assigned a value. Part of a larger program, but this individual loop isn't working as intended. Compiler returns no bugs.

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

    Is there something newer than Linkers and Loaders?

    Posted: 29 Dec 2020 05:40 PM PST

    I'm looking for a physical book on this topic, but I don't want to pay $50 for something from 1999, especially when it's available online for free. Is there something more recent that's recommended?

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

    [D] Train word embeddings on cloud service due to RAM limitations

    Posted: 29 Dec 2020 03:52 PM PST

    Hello there. For my Bachelorthesis I need to train custom word embeddings. The thing is to receive good quality of word embeddings the corpus need to have a certain size.

    With my laptop with only 8gb RAM it is not possible to do this.

    Any ideas if there is a cloud service or something similar where I can run my Python script to train the embeddings.

    The script is done and the minimal example works. Now there is the step missing to train on a much bigger corpus.

    Thanks in advance!

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

    My i = i + 1 in an "else if" chain just wont work in C for Arduino uno

    Posted: 29 Dec 2020 06:06 AM PST

    I am new to coding so this is proabably a dumb question, but I just can't get this code to work. The following is an exerpt from an else if chain. It does not work in any of them so I just picked one for debugging:

    else if (checksens == 4) { // hardleft int i = i + 1; double k = (-255 * (pow (0.9 , i * i))); motorLeft.run ( k );`` motorRight.run (255); Serial.println (k); //debugging Serial.println ("k");//debugging Serial.println (i);//debugging Serial.println ("i"); //debugging delay (1000);//debugging } 

    As you can see half of it is just debugging text. Basically what I want it to do is to add +1 to i on every cycle to then make -255 smaller as long as this "if" condition is met. But it just sets i = 1 and calls it a day. I tried different variations of this i =. Like: i = 1+i

    v = 1; i = v++; (or ++v)

    I'm kind of stuck and this I think is the last bug before I can finally hand in my code. Any help is appriciated thanks.

    Solved it thanks!

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

    Looking for guidance on video analysis software

    Posted: 29 Dec 2020 07:32 PM PST

    Hey all, I have a situation on my hands where I want to automate a boring and repetitive task, and I need a little bit of help on exactly where I should start.

    To save time, I'll simplify the task like this. I want to make software that will retime video game speedruns for me, (for those who don't know, speedrunning is beating a video game as fast as possible) one of the big features I need is the ability to remove the loading time to remove differences in speed between console and PC. So the program will do the following, load in a video from youtube, start a timer at the given starting point, end the timer at the given endpoint, and "pause" the timer when the game is loading (there's a distinct loading screen). My first thought as to how I could accomplish this would be some sort of video analysis implementation, but I really don't know where to start with this.

    If anyone with some more experience has any suggestions as to where I could go to learn about how such an idea is implemented, it would be much appreciated, or if you have a better idea that would be more effective for my application I would love to hear that as well. Thanks

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

    Removing Android error java.lang.IllegalArgumentException: Service Intent must be explicit: Intent from another class

    Posted: 29 Dec 2020 11:01 AM PST

    'm currently working on an android project and I keep running into the error java.lang.IllegalArgumentException: Service Intent must be explicit: Intent { act=cn.ingenic.glasssync.SYNC_SERVICE }

    I know newer versions of android require the Service intent to be explicit, the service intent it's referring to is however in the imported class file SyncModule.java in the line

     private final void bind(IBinder service) { if (this.mService != null) { Log.d("SyncModule", "Module:" + this.mName + " already bonded."); } else { if (service == null) { Intent intent = new Intent("cn.ingenic.glasssync.SYNC_SERVICE"); this.mContext.bindService(intent, this.mServiceConnection, 1); } else { this.mService = Stub.asInterface(service); if (this.mService != null) { try { this.mService.registModule(this.mName, this.mCallback); } catch (RemoteException var3) { Log.e("SyncModule", "", var3); } } } } } 

    The place where it breaks is in the local class

    public SmsModule(String name, Context context) { super(name, context, true); 

    Where it calls the constructor from it's SyncModule class, since this is an inherited class file i'm not able to edit the source code is there any work around I could do to fix this error?

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

    Why does my program print some extra strange symbols?

    Posted: 29 Dec 2020 06:27 PM PST

    Expected Input and Output:

    https://ibb.co/MDBqC3m

    My Output:

    https://ibb.co/RDqXf1N

    my code:

    #include<stdio.h> #include<stdlib.h> #include<string.h> int main(){ int n,m; printf("Please enter your n and m: "); scanf(" %d %d",&n,&m); int i,j; char str[n][100]; printf("please enter %d literature string\n",n); for(i=0;i<n;i++){ scanf(" %s",&str[i]); } for(i=1;i<n;i++){ strcat(str[0],&str[i]); } int t; char ostr[m]; char clue[m]; printf("please enter %d clue number\n",m); for(i=0;i<m;i++){ scanf(" %d",&clue[i]); } for(i=0;i<m;i++){ ostr[i]=str[0][clue[i]-1]; } printf("Final word : %s",ostr); } 
    submitted by /u/JacksonSteel
    [link] [comments]

    How do music streaming apps get audio from YouTube videos?

    Posted: 29 Dec 2020 05:49 PM PST

    For example the app "Musi" can play songs from YouTube. I don't think their using an API since it's against YouTube rules. So how would a music app get the audio?

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

    I need help with JavaScript basic app on code.org

    Posted: 29 Dec 2020 05:23 PM PST

    I made a quick app on code.org and lucky me, so far it's error free. But I need help to answer some questions about my code or give me some ideas of how i can answer it.(I'll leave it after the code below!!).

    https://studio.code.org/projects/applab/DHuEjrMrwL_8_YyXySb-HVihprRtgrzfTFSVpCJASnI

    //creation of lists: one variable per list var songList = getColumn ("Top 200 USA", "Track Name"); var artistList = getColumn("Top 200 USA", "Artist"); var streams = getColumn ("Top 200 USA", "Streams"); var top = getColumn("Top 200 USA", "Position"); var selectTop = "1";

    //call function to navigate to the artistScreen from homeScreen updateToTopSongsScreen();

    //call function to navigate to the rankingSongScreen from homeScreen updateToRankingSongAndInfoScreen();

    //buttons to navigate back to the homeScreen from different screens onEvent("homeButton1", "click", function( ) { setScreen("homeScreen"); }); onEvent("homeButton2", "click", function( ) { setScreen("homeScreen"); });

    //allow rankingSongDrop on artistScreen to filter the top songs in the US onEvent("topSongDrop", "change", function( ) { var index = 0; selectTop = getText("topSongDrop"); for (var i = 0; i < top.length; i++) { if (selectTop==top[i]) { index = i; setText("songOutput", songList[i]); } } });

    //allow rankingSongDrop1 on RankingSongAndInfoScreen to filter the top songs in the US including Artist, Streams, Position onEvent("topSongDrop1", "change", function( ) { var index = 0; var selectTop = getText("topSongDrop1"); for (var i = 0; i < top.length; i++) { if (selectTop==top[i]) { var output = "The informations of this song are:"; output = (output + "\nArtist: ") + artistList[i]; output = (output + "\nStreams: ") + streams[i]; output = (output + "\nTrack Name: ") + songList[i]; setText("rankingOutput", output); } } });

    //function to update to the RankingSongAndInfoScreen function updateToRankingSongAndInfoScreen() { onEvent("songAndInfoButton", "click", function( ) { setScreen("rankingSongAndInfoScreen"); }); }

    //function to update to the artistScreen function updateToTopSongsScreen() { onEvent("topSongsButton", "click", function( ) { setScreen("topSongsScreen"); }); }

    1.Find two program code segments you developed during the administration of this task which contain a list (or other collection type) being used to manage complexity in your program. (for all subparts of 3b combined, excluding program code) a)The first program code segment must show how data has been stored in the list.

    b)The second program code segment must show the data in the same list being processed, such as creating new data from the existing data or accessing multiple elements in the list, as part of fulfilling the program's purpose.

    1. Identifies the name of the list being processed in this response
    2. Describes what the data contained in the list is representing in your program 4.Explains how the selected list manages complexity in your program by explaining why your program code could not be written, or how it would be written differently, if you did not use the list
    3. find two program code segments you developed during the administration of this task that contain a student-developed procedure which implements an algorithm used in your program and a call to that procedure. This first program code segment must be procedure that: a)Defines the procedure's name and return type (if necessary) -Contains and uses one or more parameters that have an effect on the functionality of the procedure; and -Implements an algorithm that includes sequencing, selection and iteration. b)The second program code segment must show where the student-developed procedure is being called in your program c)Describes in general what the selected procedure does and how it contributes to the overall functionality of the program d)Explains in detailed steps how the algorithm implemented in the selected procedure accomplishes its task. Your explanation must be detailed enough for someone else to recreate it. 6.Describes two calls to the selected procedure identified in written response 3c. Each call must pass different arguments that cause a different segment of code in the algorithm to execute; a)First call: b)Second call: c)Describes what condition(s) is being tested by each call to the procedure Condition(s) tested by the first call: Condition(s) tested by the second call: Result of the first call: Result of the second call:

    Greatly appreciate you to spent time and read my post!!

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

    How to redirect computer display output?

    Posted: 29 Dec 2020 04:43 PM PST

    I have multiple desktops running on the same computer, and I want to redirect the display output of a desktop to a window on the same screen. Ideally, the desktop that was redirected would also be hidden from the switch desktops view given from win+tab. So far, I haven't found anyway to do this. Is this possible, and if so, how?

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

    Front-end development or Python?

    Posted: 29 Dec 2020 04:25 PM PST

    Good evening everyone,

    (Skip to Long story short if you don't want to read my story)

    So I'm in a bit of a bind. I gave everything towards my acting career, but unfortunately I misunderstood "having only a plan A," for that career. Instead of dedicating towards a survivable career, I became a bartender (which isn't bad) but then COVID happened and the company is bankrupt (so no job). As a veteran, I've mostly been paid thru my POST 9-11, but this is the last semester I have for it. So in a desperate search for a good career, I've come to realize how much I enjoy coding and would even enjoy doing it as "work".

    I've been studying and dabbling in HTML/CSS/JS/Python for some time now because I've done some college courses in them. I was looking at coding camps, like Udacity, for awhile now but don't have the funds to pay for it. I got lucky and thru youtube (s/o Chris Sean) I found some free/cheap camps like freecodecamp.org and teamtreehouse.com. Thankfully I'm blessed at being an extremely quick learner and am doing pretty good with the courses/projects.

    I enjoy learning all of it BUT it is a lot for my brain to try and hold onto all at once, especially since I only have 4 months left to secure a job. I've googled the differences between front-end and python and such but I truly can't decide, and thought I should branch out and ask for opinions/experiences.

    Long story short, I can't decide between focusing on front-end development or branch somewhere with Python. Again, I'd like to ask for the communities help and/or comments on how they feel between the two, especially when it comes to finding a job.

    Thank you for taking the time to read this and help a struggling veteran out.

    submitted by /u/Appropriate-Rent8265
    [link] [comments]

    Batch File for renaming multiple files - Windows

    Posted: 29 Dec 2020 12:02 PM PST

    I am hoping I can have some help creating a batch file to rename files within a folder and then move them.

    Scenario:

    I have a set of Excel Files within a Folder; they start off with a unique number and then are followed by PP(some number): example 12345 KB PP27.xlsx. Every other week, the PP number will change. Is it possible to use a batch script to do the following: Rename the PP27 to _current(1) while leaving everything else in tact? Would it be possible for the script to ask what part of the file needs to be replaced, I could enter PP27 and the next time I use this I could instead enter for instance, say PP28, and then the script either asks me what it should be replaced with, or can it be hard coded to replace with _current(1)? There will be multiple files that I would like to have renamed all at once in this folder. Once renamed, I would like all files moved to a different directory.

    Is this possible via batch file?

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

    A good React course

    Posted: 29 Dec 2020 09:39 AM PST

    Can you suggest me a good course on React, Router and Redux with Hooks. I know it must have been asked many times, but I am looking for a fresh course as these things change a lot, and courses become little obsolete very quickly. I am aiming at learning React from basic and advanced in 2021, and I am looking to learn the latest technologies. Thanks!

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

    C++ Class File Questions

    Posted: 29 Dec 2020 12:50 PM PST

    Hello everyone!

    I am working on a rather simple Casino program in C++. I am somewhat newer to C++ but since my college uses it, I am trying to tackle this project with that language. This was inspired to me by a blackjack program I made with Java, however, classes seem much easier and make way more sense to me in Java compared to C++.

    Code will be below and will post my questions below it.

    main.cpp

    #include <iostream> #include <iomanip> #include <string> #include <fstream> #include <cctype> #include "Card.h" #include "Deck.h" using namespace std; void showMenu(int &choice); int blackjackGame(int betAmount, int userBalance); int threeCardGame(int betAmount, int userBalance); int highCardGame(int betAmount, int userBalance); int getValidBet(int betAmount, int userBalance); enum cardSuits{HEART, SPADES, DIAMONDS, CLUBS}; enum cardValues{TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN, JACK, QUEEN, KING, ACE}; int main() { int userBalance; int userChoice; int betAmount; string userName; bool keepGoing = true; // Creates playing deck. Deck playingDeck; playingDeck.printDeck(); cout << "Shuffled Deck..." << endl; playingDeck.shuffle(); playingDeck.printDeck(); cout << "Welcome to the casino program!" << endl; cout << "Please enter your name." << endl; cin >> userName; cout << "Please enter your starting balance." << endl; cin >> userBalance; while(keepGoing) { showMenu(userChoice); switch(userChoice) { case 1: blackjackGame(betAmount,userBalance); break; case 2: threeCardGame(betAmount,userBalance); break; case 3: highCardGame(betAmount,userBalance); break; case 4: break; default: break; } } return 0; } void showMenu(int &choice) { // User Menu cout << "Please select a game" << endl; cout << "1) Blackjack" << endl; cout << "2) Three Card Poker" << endl; cout << "3) High Card Flush" << endl; cout << "4) Exit" << endl; cin >> choice; // Validates input while(choice < 1 || choice > 4) { cout << "You must enter either 1,2,3 or 4" << endl; cout << "Select an option (1,2,3,4)" << endl; cin >> choice; } } int getValidBet(int betAmount, int userBalance) { cout << "Please enter the amount you would like to bet" << endl; cin >> betAmount; while(betAmount > userBalance || betAmount < 1) { cout << "Invalid entry." << endl; cout << "Please enter the amount you would like to bet" << endl; cin >> betAmount; cout << endl; } return betAmount; } int blackjackGame(int betAmount, int userBalance) { cout << "Your current balance is $" << userBalance << endl; betAmount = getValidBet(betAmount, userBalance); cout << betAmount; } int threeCardGame(int betAmount, int userBalance) { cout << "Your current balance is $" << userBalance << endl; betAmount = getValidBet(betAmount, userBalance); cout << betAmount; } int highCardGame(int betAmount, int userBalance) { cout << "Your current balance is $" << userBalance << endl; betAmount = getValidBet(betAmount, userBalance); cout << betAmount; } 

    Card.cpp

    #include "Card.h" Card::Card() { cardNumber = ""; cardSuit = ""; cardValue = 0; } Card::Card(string num, string suit, int value) { cardNumber = num; cardSuit = suit; cardValue = value; } void Card::setNumber(string num) { cardNumber = num; } void Card::setSuit(string suit) { cardSuit = suit; } void Card::setValue(int value) { cardValue = value; } const string Card::getNumber() const { return cardNumber; } const string Card::getSuit() const { return cardSuit; } const int Card::getValue() const { return cardValue; } string Card::print() const { return (cardNumber + " of " + cardSuit); } 

    Card.h

    #ifndef CASINO_CARD_H #define CASINO_CARD_H #include <string> using namespace std; class Card { private: string cardNumber; string cardSuit; int cardValue; public: Card(); Card(string num, string suit, int value); void setNumber(string num); void setSuit(string suit); void setValue(int value); const string getNumber() const; const string getSuit() const; const int getValue() const; string print() const; }; 
    

    No comments:

    Post a Comment