• Breaking News

    Wednesday, July 15, 2020

    How can a hacker simply breach the security of one of the most secured websites in the world (Twitter) in a matter of minutes? Ask Programming

    How can a hacker simply breach the security of one of the most secured websites in the world (Twitter) in a matter of minutes? Ask Programming


    How can a hacker simply breach the security of one of the most secured websites in the world (Twitter) in a matter of minutes?

    Posted: 15 Jul 2020 03:32 PM PDT

    From what I imagine about cyber security, it is more about social engineering and relying on end users' technological illiteracy than on the hacker's skills and abilities (especially when it comes to the more secure products like Twitter).

    But what happened today (Twitter breach) got me thinking, how could a hacker simply overcome the security measures deployed by one of the best security teams in business? Maybe if it was just one account, I could imagine it being an account holder's mistake, but breaching Apple's, Bill Gates's, Elon Musk's,...,etc. accounts simultaneously is more of a Twitter's mistake, right? So how could that possibly have happened?

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

    Best Place to Learn C?

    Posted: 15 Jul 2020 02:59 PM PDT

    I'm pretty knowledgeable of Java and C#, but I would like to learn C. What is a good place to find videos/practice assignments for C?

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

    Having a ton of trouble implementing Topological Sort

    Posted: 15 Jul 2020 08:16 AM PDT

    My repl on this: https://repl.it/@Stylebender/Topological-Sort#index.js

    What I'm basing it on:

    https://github.com/williamfiset/Algorithms/blob/master/src/main/java/com/williamfiset/algorithms/graphtheory/TopologicalSortAdjacencyList.java

    I think the actual Topsort function seems be fine? My DFS method on the other hand seems broken and I'm not sure how to code it in JS.

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

    Best place to learn Tkinter?

    Posted: 15 Jul 2020 05:06 PM PDT

    please comment down Swift resources for making small games.

    Posted: 15 Jul 2020 10:00 PM PDT

    I am new to Swift programming, I'm trying to make some simple games in Xcode, and plz comment anything you find helpful. I also need tips. Thank you!

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

    Why would you choose C over C++

    Posted: 15 Jul 2020 08:50 PM PDT

    As the title implies I was wondering why you would opt for C as opposed to C++. The latter just seems much cleaner and more comfortable to use and support OOP.

    Any examples would be well appreciated!

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

    Help Using OkHttp

    Posted: 15 Jul 2020 06:57 PM PDT

    I am fairly new to using OkHttp and am trying to make a GET request to an API and so far have been successful. The following block of code works:

    String getJSONCandidates() throws IOException {

    Request request = new Request.Builder()
    .header("Authorization", "Basic " + encodedKey)
    .url(candidates)
    .build();
    try (Response response = client.newCall(request).execute()) {
    return response.body().string();
    }
    }

    The issue is that I am trying to add a parameter to this request. The goal is to specify that 500 objects per page are returned using the "per_page" parameter. However, when I try to use ".header()" or ".addHeader()" it does not work. Any ideas for how to make this work? I would appreciate any help, thanks!

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

    Do you switch to release versions of the software when debugging (poll)?

    Posted: 15 Jul 2020 12:57 PM PDT

    Home Update Server

    Posted: 15 Jul 2020 04:18 PM PDT

    Is it possible to make a raspberry Pi an update server for your games on your PC? For example, download the game overnight on raspberry Pi (to an external hdd or something), then stream the game update super quick to your pc once the update is completed on Raspberry Pi? So you don't have to leave pc on overnight and only leave Rpi on as it uses so little power?

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

    Hosting a Simple Game on a Web App

    Posted: 15 Jul 2020 03:44 PM PDT

    Hey guys,

    I'm developing a quizzing app. Basically a user can join a quiz, or host a quiz. When hosting a quiz, I would like a user to customize lengths of rounds, and add their own questions/answers. Once a quiz is created, a passcode is generated, which the host will give to friends. Friends can then click on the join quiz button at the start, enter this pass code and enter a waiting room. Once the host hits a "go" button, the quiz will begin.

    What I'm unsure about is how exactly the hosting mechanism would work. The first thing that came to my head was store the passcode in a DB, then search the DB for it whenever a user enters it - maybe have a column in this table that stores users in a waiting room. Also a column with "Waiting" or "InProgress" too. I'm thinking as I'm typing this, but basically what I'm asking is does anyone know of any good resources as to where might be a good place to start? I have an AWS account so I'd like to leverage that. This is very much a situation where I know there's some obvious answers - I'm just having a hard time knowing what to google/search on reddit. I keep getting results on how to host Unity games - which is more than likely massive overkill. I have never done anything like this before so it's pretty new to me.

    I'm a junior dev with about two years experience. I'm working with an Angular front end and .NET backend.

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

    How many methods do you guys see in this piece of code?

    Posted: 15 Jul 2020 02:45 PM PDT

    Sorry for asking again but I'm new to programming and trying to get at least 3 methods in my code. Also can someone please fix this code as well lol it's not working

    import random from builtins import False, True

    def generateRandomNumber (): randomNumber = random.randint( 1, 100 ) return randomNumber

    def askUserForNumber (message = "Guess the number: "): userNumber = int(input(message)) return userNumber def checlUserforNumber( userNumber, randomNumber): if userNumber > randomNumber: return "Too high" elif userNumber < randomNumber: return "Too low" else: return "congratulations"

    def main(): userCongratulated = False letsStart = True while userCongratulated or letsStart: userNumberofGuesses = 0 randomNumber = generateRandomNumber() userNumber = askUserForNumber() userNumberofGuesses += 1 message = checkUserNumber( userNumber, randomNumber ) while message != "Congratulations!:" print( message ) userNumber = askUserForNumber( "Try again:" ) userNumberofGuesses = userNumberofGuesses + 1 message = checkSuerNumber(userNumber, randomNumber ) print() print(message, "It took you" userNumberofGuesses,/ "attempts to guess correctly/n") userCongratulated = True 

    main()

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

    How do I make my simple python code better

    Posted: 15 Jul 2020 02:39 PM PDT

    I've already learnt a good amount of programming languages but never got into python, I'm now learning it because I want to integrate python on my webapp. To start of I made this simple fighting game where the pc fight himself based on randomness. The code fully works as expected but I wanted to know what I could do to make it look nicer. I probably have lines longer than what they should / could be. Can you guys point them out to me? Thanks in advance.

    from random import choice class figter: def __init__(self, name, health, str): self.name = name self.health = health self.str = str f1 = figter("Lin", 100, choice([*range(20,50)])) f2 = figter("Xul", 100, choice([*range(20,50)])) while(f1.health > 0 or f2.health > 0): print("\n=========================") print(f1.name + " health : "+ str(f1.health)) print(f2.name + " health : "+ str(f2.health)) print("=========================\n") c = choice([*range(1,3)]) if(c == 1): f1_c = choice([*range(1,4)]) if(f1_c == 1): hit = (f1.str * 3)/2 print(f1.name + " hit " + f2.name + " for " + str(hit) + "\n") f2.health -= hit if(f2.health <= 0): print(f1.name + " won the battle") break elif(f1_c == 2): potion = choice([*range(10, 30)]) print(f1.name + " used health potion to regenerate " + str(potion) + " health\n") f1.health += potion elif(f1_c == 3): print(f1.name + " just stood there\n") elif(c == 2): f2_c = choice([*range(1,4)]) if(f2_c == 1): hit = (f2.str * 3)/2 print(f2.name + " hit " + f1.name + " for " + str(hit) + "\n") f1.health -= hit if(f1.health <= 0): print(f1.name + " won the battle") break elif(f2_c == 2): potion = choice([*range(10, 30)]) print(f2.name + " used health potion to regenerate " + str(potion) + " health\n") f2.health += potion elif(f2_c == 3): print(f2.name + " just stood there\n") 
    submitted by /u/BernardoPiedade
    [link] [comments]

    How are bank balances stored?

    Posted: 15 Jul 2020 02:08 PM PDT

    Are bank balances stored as an intger, a hash with salt that only the user can decrypt, or a third way?

    Could an admin in principle change his own balance to 1B?

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

    I made a program, and I am so confused. Please Kindly Help, take a look.

    Posted: 15 Jul 2020 01:50 PM PDT

    THIS PROGRAM IS TO CHECK IF THE DATES ENTERED ARE EQUAL OR NOT (Currently I am learning classes and objects)

    https://pastebin.com/6BmDabiX

    1. Now the problem with the code is that when I run and enter the values it will give me "dates are equals" and sometimes "not equal" for the same value(ex. 1,2,2020).
    2. How do values entered by keyboard are called or checked by "public boolean equals(TRY otherTRY)".
    3. How the value is stored in otherTRY(parameter name).

    Thank you!

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

    ASP. NET CORE SignalR centralized Error Handling?

    Posted: 15 Jul 2020 09:53 AM PDT

    I build a chat application with following platforms

    js for client side asp. net core for server side with signalR 3.0

    i want to handle the all errors in centralized manner on server side.

    i googled it but I didn't find any solution.

    can any one help me or guide me into the solution.

    thanks, 😊

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

    How can I make a website that shows the output of a Python script?

    Posted: 15 Jul 2020 01:26 PM PDT

    Hi, I made a web scraper in Python using bs4 and requests, it's very simple, it checks the website every 60 seconds, it looks for every link in the page, counts them and prints the number in te Terminal, this process keeps going until I close the terminal or press CTRL+C, now what I want to do is that the same thing that I see on my Terminal gets shown on a website, this website should be strictly functional, white background, sans-serif font, nothing fancy. How can I make this?

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

    Can I create one code that can scrape from multiple websites the same classes?

    Posted: 15 Jul 2020 01:15 PM PDT

    noob here, and this is for data analysis mainly.

    I want to scrape data from different news websites e.g. bbc, cnn etc for data analysis and machine learning project. I am having some help from another programmer and he is saying each one is different in terms of class structure etc therefore they need to be tackled in a different way.

    From my understanding, I just need the heading, time, image (if any) and text body, so could I not write a function that could tackle many different structured sites, where if returning 'empty'/ 'na', it would move on to the next type and try that. As the idea of writing this code 100 times for 100 different websites seems insane...

    I know there is paid APIs out there but they can get very expensive with high amounts of data.

    Does anyone have any advice, or can advise me on this?

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

    I made a program, and I so am confused. Please Kindly Help, take a look.

    Posted: 15 Jul 2020 01:12 PM PDT

    q)THIS PROGRAM IS TO CHECK IF THE DATES ENTERED ARE EQUAL OR NOT (Currently I am learning classes and objects)

    package Programs;
    public class TRY {
    private int day,year;
    private String month;
    public void setdate(int getmonth ,int getday,int getyear)
    {
    day=getday;
    month=monthnumber(getmonth);
    year=getyear;
    }
    public boolean equals(TRY otherTRY)
    {
    return ((day==otherTRY.day)&&(year==otherTRY.year)&&month.equals(otherTRY.month));
    }
    public boolean depict(TRY otherTRY)
    {
    return ((day<otherTRY.day)||(day>otherTRY.day)||(year<otherTRY.year)||(year>otherTRY.year));
    }
    private String monthnumber(int newmonth)
    {
    switch (newmonth)
    {
    case 1: return "Jan";
    case 2: return "Feb";
    case 3: return "Mar";
    case 4: return "Apr";
    case 5: return "May";
    case 6: return "June";
    case 7: return "July";
    case 8: return "Aug";
    case 9: return "Sept";
    case 10: return "Oct";
    case 11: return "Nov";
    case 12: return "Dec";
    }
    return "error";
    }
    }

    _______________________________________________________________________________________________

    package Programs;
    import java.util.Scanner;
    public class SECOND2 {
    public static void main(String[] args) {
    TRY date1=new TRY();
    TRY date2=new TRY();
    Scanner keyboard=new Scanner(System.in);
    System.out.println("enter date:");
    int x=keyboard.nextInt();
    int y=keyboard.nextInt();
    int z=keyboard.nextInt();
    date1.setdate(x,y,z);
    System.out.println("enter date again:");
    int u=keyboard.nextInt();
    int v=keyboard.nextInt();
    int w=keyboard.nextInt();
    date2.setdate(u,v,w);
    {
    if (date1.equals(date2))
    System.out.println("DATES ARE EQUAL");
    else
    System.out.println("Not Equal");
    }
    }
    }

    1. Now the problem with the code is that when I run and enter the values it will give me "dates are equals" and sometimes "not equal" for the same value.
    2. How do values entered by keyboard are called or checked by "public boolean equals(TRY otherTRY)".
    3. How the value is stored in otherTRY(parameter name).

    Thank you!

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

    Want to learn programming? Help us shape our upcoming software development course.

    Posted: 15 Jul 2020 11:34 AM PDT

    Hey everyone! I am an intern working in partnership with the HOFT institute in Austin, Texas to develop an online collaborative software development course. We want to teach commonly used development platforms and workflows, in hopes to give hands-on experience via group-based projects/modules. We're looking to collect feedback on what aspects of learning programming are important to you. We'll use this feedback to influence the potential course format, schedule, and design.

    Thank you so much for your help!

    https://docs.google.com/forms/d/1MyR68XyE5gjVaF912Y7QxmaLVdQJZnFTcqnuBWzAh50/edit

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

    convert C to C#

    Posted: 15 Jul 2020 11:25 AM PDT

    Do you know of any method to convert C code to C# code?

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

    Wanting to get your feedback on an upcoming collaborative software development program survey.

    Posted: 15 Jul 2020 11:14 AM PDT

    Hey everyone! I am an intern working in partnership with the HOFT institute in Austin, Texas to develop an online collaborative software development course. We want to teach commonly used development platforms and workflows, in hopes to give hands-on experience via group-based projects/modules. We're looking to collect feedback on what aspects of learning programming are important to you. We'll use this feedback to influence the potential course format, schedule, and design.

    Thank you so much for your help!

    https://docs.google.com/forms/d/1MyR68XyE5gjVaF912Y7QxmaLVdQJZnFTcqnuBWzAh50/edit

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

    Dear programmers of Reddit, what data is Timify.me allowed to collect during an exam?

    Posted: 15 Jul 2020 10:50 AM PDT

    "o12sor877590vka.12.2020.07.15.04.56.10 DISPLAY\ACI27A1\4&262321d9&0&UID206371 was started. Driver Name: monitor.inf Class Guid: {4d36e96e-e325-11ce-bfc1-08002be10318} Service: monitor Present: true" Our lecturer sent this block of text was sent to us today, after we finished our exam on timify.me stating that some of us had external devices connected and this could be flagged as a fraud.

    Q1: Since when can Timify.me collect information about the ports and drivers of a computer? Furthermore this feature isn t specified on their website.

    Q2: Is the data above legit? Or is it a fake code?

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

    Help finishing Python script (convert txt to csv)

    Posted: 15 Jul 2020 09:53 AM PDT

    Trying to convert a txt file into a csv. I'm not the best with Python (or OOP in general) but I'm learning. I have the code below and it works but it puts every line in the txt file into its own row in the csv. What I need is for every six lines in the txt doc to be bundled into a row in the csv output. Each line should go into its own column until after the sixth line when the next row will begin. How should I tweak my code to get there? TIA!

    import csv with open('/myfile.txt', 'r') as f: content = f.readlines() with open('/myfile.csv', 'w+') as csvFile: csvWriter = csv.writer(csvFile, delimiter = ' ') for elem in content: csvWriter.writerow([elem.strip()]) 
    submitted by /u/anh86
    [link] [comments]

    Can you make a TOML object without a name

    Posted: 15 Jul 2020 09:42 AM PDT

    Hello everyone!

    I am currently using TOML to store the following object, for usage in python.

    [

    {cat = "No_water",frog = "Yes_water"},

    {cat = "Yes_fur",frog = "No_fur"}

    ]

    One issue I have ran into is that unless I give the object a name, python throws an error when I try to use toml.load. I have to add "pets =" before the first bracket. Is there a way to create the object above without giving it a title, as you can do in python or JSON?

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

    No comments:

    Post a Comment