• Breaking News

    Sunday, December 27, 2020

    Who is actually able to perform a man-in-the-middle attack? Ask Programming

    Who is actually able to perform a man-in-the-middle attack? Ask Programming


    Who is actually able to perform a man-in-the-middle attack?

    Posted: 27 Dec 2020 03:20 PM PST

    I am reading about man-in-the-middle attacks. I was just wondering, who can actually do this?

    I assume that a computer with a static IP can't just request all IP packets sent from some IP address to another?

    Is it always some physical attack like digging up optic fibres under your house or listening to the radio waves emitted by some WiFi box in a cafe?

    Or is it some software trick?

    Obviously if data is encrypted, the attacker can't do much. I'm asking about how the data is even accessed in the first place

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

    Whats the Difference between "raise exception" and "try...catch()"

    Posted: 27 Dec 2020 03:33 PM PST

    I was watching a YouTube educational video and I got confused. As a newbie with only experience in C programming(first semester in uni) my first reaction was "is this like a debugger" but I was afraid to ask in stack overflow so I came here looking for information . Thanks in advance !

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

    This Github repo compiles "Hello World" in different languages, and measures the startup time of the binaries. How come FreePascal programs are so fast?

    Posted: 27 Dec 2020 12:25 AM PST

    This one: https://github.com/bdrung/startup-time

    All the performance chasing languages, C, C++, D, Rust, are beaten by FreePascal. Not only beaten, but it comes in at half the time of the C program, and in that repo results the only one below 0.1ms.

    I assumed that C being so old, so "primitive" (simple/limited), so low level, so popular, having so much effort put into it, it would of course be the fastest, and the languages with heavier runtimes and more abstraction layers would be slower, and FreePascal is neither popular nor heavily funded.

    I've run it, it does the same for me on a modern Ubuntu machine, so the relative timings on that page aren't mistake or fluke.

    a) How is the FreePascal HelloWorld binary so much faster than everything else?

    b) Why don't the others do whatever it does?

    submitted by /u/ka-splam
    [link] [comments]

    Why doesn’t my ‘quit’ stop the program?

    Posted: 27 Dec 2020 09:33 PM PST

    The problem is to parse a series of commands that instruct a robot arm on how to manipulate blocks that lie on a flat table. Initially, there are n blocks on the table (numbered from 0 to n − 1) with block bi adjacent to block bi+1 for all 0 ≤ i < n − 1 as shown in the diagram below:

    https://ibb.co/WpWQBYT

    The valid commands for the robot arm that manipulates blocks are:

    • move a onto b

    where a and b are block numbers, puts block a onto block b after returning any blocks that are stacked on top of blocks a and b to their initial positions.

    • move a over b

    puts block a onto the top of the stack containing block b, after returning any blocks that are stacked on top of block a to their initial positions.

    • pile a onto b

    moves the pile of blocks consisting of block a, and any blocks that are stacked above block a, onto block b. All blocks on top of block b are moved to their initial positions prior to the pile taking place. The blocks stacked above block a retain their order when moved.

    • pile a over b

    puts the pile of blocks consisting of block a, and any blocks that are stacked above block a, onto the top of the stack containing block b. The blocks stacked above block a retain their original order when moved.

    • quit

    terminates manipulations in the block world. Any command in which a = b or in which a and b are in the same stack of blocks is an illegal command. All illegal commands should be ignored and should have no effect on the configuration of blocks.

    Input:

    https://ibb.co/pWJ9c7Q

    Output:

    https://ibb.co/Nt03mm3

    [I only type the code of the first command for now.]

    my code:

    #include<stdio.h> #include<string.h> void back(int arr[]){ } int main(){ printf("---Problem 5---\n"); int noi=0; printf("please input n:"); int n; scanf(" %d",&n); int arr[n][n]; int i,j; for(i=0;i<n;i++){ for(j=0;j<n;j++){ arr[i][j]=-1; } arr[i][0]=i; } char str1[5]="",str2[5]; int s,d; while(strcmp(str1,"quit")!=0){ s=0; d=0; while(!(s>=1&&s<n&&d>=1&&d<n)){ scanf(" %s %d %s %d",str1,&s,str2,&d); } if(strcmp(str1,"move")==0){ if(strcmp(str2,"onto")==0){ //empty s for(i=0;i<n&&arr[s][i]!=-1;i++){ arr[arr[s][i]][0]=arr[s][i]; arr[s][i]=-1; } //empty d for(i=0;i<n&&arr[d][i]!=-1;i++){ arr[arr[d][i]][0]=arr[d][i]; arr[d][i]=-1; } //now move s to d i=1; while(arr[d][i]!=-1){ i++; } arr[d][i]=arr[s][0]; arr[s][0]=-1; }else if(strcmp(str2,"over")==0){ }else{ continue; } }else if(strcmp(str2,"pile")==0){ }else{ continue; } } //print results for(i=0;i<n;i++){ printf("%d:",i); for(j=0;j<n&&arr[i][j]!=-1;j++){ printf("%d ",arr[i][j]); } printf("\n"); } } 
    submitted by /u/JacksonSteel
    [link] [comments]

    What does a ConcurrentHashMap really mean? Does that mean it will work for ALL users who are accessing your application?

    Posted: 27 Dec 2020 09:16 PM PST

    Hi, I'm trying to understand concurrency. I'd like to implement a rate filter on my java servlet app, and am currently thinking I should be fine to create a filter in the web.xml, and add a concurrent Hash Map in the filter that keeps track of all requests. My overall plan is to send a cache to certain IP addresses if they are logging in too quickly.

    By having a ConcurrentHashMap in my class, should that be able to see all of the incoming requests from all the different users at the time and keep them constantly updated in the hash map?

    Thanks

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

    Changing Photoshop CS2 Interface Color

    Posted: 27 Dec 2020 08:34 PM PST

    Hi all. I currently use Photoshop CS2, but the light mode that it comes in is super hard for my eyes and I would love to figure out how to change the entire thing to a darker palette.

    Unfortunately, since it's an older program, it doesn't have a "dark mode" option. Is there a way I could do this, possibly in the files somewhere? I've tried googling, but it's such an obscure request I couldn't find anything about it.

    I know that UI color is handled by a value in some file, but I wouldn't even know where to begin looking.

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

    What do you consider to be the most important thing you look for on a CV?

    Posted: 27 Dec 2020 04:43 PM PST

    Need some advice, I finished college last May and have been looking for work since.

    And if anybody is interested in seeing my CV, please let me know.

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

    Cordova camera plugin works on emulator and not on Android device?

    Posted: 27 Dec 2020 08:23 PM PST

    I'm building an app that allows the user to take photos. I'm using Cordova - JS/CSS/HTML - to write the script. The Cordova camera plugin works perfectly on my Android emulator in Android Studio, but I can't get it to work on my device. Here's what I'm working with:

    IRL Phone: Samsung Galaxy S9+

    Cordova version: 10.0.0

    Cordova camera plugin version: 5.0.1

    I'm not sure if it has something to do with an inconsistency in the build (I heard Cordova versions can have an effect on plugins in certain environments) or if my code is just not friendly for a real Android device.

    Here's the plugin code:

    let app = { init: function(){ document.getElementById('btn').addEventListener('click', app.takephoto); }, takephoto: function(){ let opts = { quality: 80, destinationType: Camera.DestinationType.FILE_URI, sourceType: Camera.PictureSourceType.CAMERA, mediaType: Camera.MediaType.PICTURE, encodingType: Camera.EncodingType.JPEG, cameraDirection: Camera.Direction.BACK, targetWidth: 300, targetHeight: 400 }; navigator.camera.getPicture(app.ftw, app.wtf, opts); }, ftw: function(imgURI){ document.getElementById('msg').textContent = imgURI; document.getElementById('photo').src = imgURI; }, wtf: function(msg){ document.getElementById('msg').textContent = msg; } }; document.addEventListener('deviceready', app.init); 

    Here's the HTML that runs the script on the app's page from the file camera.js in a separate folder:

     <div class="page"> <p class="code"><img src="img/logo.png" alt="image" id="photo" /></p> <p class="node"><button id="btn">Take Picture</button></p> <p id="msg"></p> </div> <script type="text/javascript" src="cordova.js"></script> <script src="js/camera.js"></script> 

    And here's the information in my head tag:

    <meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *; script-src 'self' 'unsafe-inline'; img-src 'self' data: content:;"> <meta name="format-detection" content="telephone=no"> <meta name="msapplication-tap-highlight" content="no"> <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width"> <link rel="stylesheet" type="text/css" href="css/index.css" /> <title>4-Point Inspection</title> 

    Maybe this has something to do with the XML or build files? This is my first Cordova app so I'm a little new to this. Any ideas why it works on emulator and not on my Galaxy S9+?

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

    How can I create a bot that navigate a website while keeping Cookies?

    Posted: 27 Dec 2020 07:30 PM PST

    Hi!

    I want to create a simple bot that I can make run on a server. Basically, on this website, https://saaq.gouv.qc.ca/services-en-ligne/citoyens/examen-conduite/consulter-rendez-vous/ I can access a service by clicking a button, then I have to go through an interactive form. In the end result, I stumble upon a map with button on the side. When I click on the buttons, I can see if there were any new appointments available.

    So, I know how to make scraping bots, but bots that navigate a website and fill out an interactive form, no idea.

    So, how can I build this (I know PHP and Javascript) and where can I host this? (I want it to send me an email every hour or so with the result.

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

    Fastest way to send a signal over the internet?

    Posted: 27 Dec 2020 05:35 PM PST

    Hey i'm a python, nodejs developer who works as web developer. For a side project i need to build a platform able to receive midi signal (potentially) from computers across the world and send it to my computer.

    My question is, whats the fastest way to send a signal with no data loss and ultra low latency (max 500ms)? I guess web sockets are not the solution here right?! Does a peer-to-peer solution fits better than a classic server listening for midi input and then forwarding it to my computer? I know there is rtp-midi but its built for mac and sometimes it can cause latency. I know latency depends on internet connection too but the message to send should be pretty light (3 bytes).

    Since i've experience with electron and react-native i was thinking about building two apps: the client and the listener. The client sends infos about the note, note velocity and channel; the listener converts that data into midi. Or maybe i can build them in python with tkinter... I just don't know if i should build a solution with p2p or a dedicated server...

    I need help, hopefully you guys can help me :)

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

    Creating custom buttons for a Google Site

    Posted: 27 Dec 2020 04:30 PM PST

    I want to create a custom button using CSS/HTML to embed onto a Google Site. When clicked, the button should open a different page of the Google Site in the current tab. Google Sites has drag and drop button options available but they are quite restrictive in terms of aesthetics and animation ability, however the functionality that it provides is what I'm trying to emulate.

    Currently, I am able to embed my custom button on the site but when the button is clicked, the link only opens in a new tab.

    I've been trying to use the following bit of code but target="_parent" doesn't work on Google Sites.

    <a href="www.link.com" target="_parent"><button class="button button1">buttonName></a>

    Any workarounds or solutions would be much appreciated!

    TLDR: I'm looking for a way to program the CSS/HTML button so that when it is clicked the link opens in the same tab, not a new tab.

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

    What should I learn???

    Posted: 27 Dec 2020 03:56 PM PST

    Hello programmers! I'm a high school student that want to learn programming. I am very serious about this and want to learn programming professionally. I already know basics of python and I'm improving every day. My goals are to first finish my python corse so I know what programming is about and then proceed with either full stack web development or software development. What is better to learn. I know that web dev probably is easier but I don't really care about that I more care about career. If someone could help me with this choice and maybe provide me with some good corse I would be very thankful

    Have a nice day, Valter!

    submitted by /u/Inte-Valter
    [link] [comments]

    A chart to introduce to programming language concepts

    Posted: 27 Dec 2020 08:16 AM PST

    Hi there,

    I created a chart to link different subjects I want to popularize (to ideally anybody which has already programmed, without other prerequisites) : https://imgur.com/a/stTe1wI

    The goal is to make those new concepts intuitive to write "better" code, while staying mostly domain-agnostic. The links are mostly indicating in which order I would present those concepts, with a "breadth first" approach. Of course, we can make way more connections between those subjects.

    So, what do you think about this presentation ? Do I miss some important subject ? Are those categorizations pertinent ? Would a "depth first" approach be better ?

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

    Looking for a paid course.

    Posted: 27 Dec 2020 09:47 AM PST

    Looking for a paid course in C# my budget is around £300 pounds.

    Im choosing C# because I have slight knowledge on using that language and It works well with unity.

    There are so many choices online I am finding it hard to choose one and am looking for suggestions.

    While something with certification at the end is beneficial it isn't necessary.

    I personally learn better when its well structured which is why I am looking for a paid course.

    Any advice would be appreciated

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

    Easy way to recreate node-like and interactable graphics (Eg git branches and the like) in a way that connects to Python?

    Posted: 27 Dec 2020 03:28 PM PST

    Ive been working on a couple of projects and realised that I really need some way of making a good simple graphical interface. The format/appearance of a github/gitkraken timeline with branches and nodes is one that works for several of these projects.

    Is there a way to implement this via something like electron or other framework that connects relatively easily to a python based backend?

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

    I need help with a simple Python program

    Posted: 27 Dec 2020 03:06 PM PST

    SOLVED

    Hey guys! So here is a little story about the problem. If you don't care / need the information just skip this part: So I played a board game called "Why always me" which goes like this. 2 Players get a number of n sticks and roll a dice from 1-6. If they roll a 1-5 they place the stick in the place according to the number the rolled. If its a 6 the stick gets removed from the game. You can roll as much as you want until you roll a number that has its corresponding place already filled out. The player then takes the stick. I wanted to code this in python and simulate a Number of games with it but I cant get it working so here is my problem:

    My program works like this: at first player 1 rolls the dice (this part works fine). If it's a 6 the stick number of player 1 gets reduced by 1. (works fine aswell!). If the player rolls a number from 1-5 and if the place is not taken it removes 1 stick from player 1 and changes the status of the hole. I do this by giving all 5 holes a variable and set it to 0. If a player rolls that number and the variable is 0 it changes to 1 in code form :

    (w = number from the dice, p_i = hole of number i )

    if (w == 5) and (p_5 == 0)

    n = n -1

    p = 1

    The problem is that this does not work. It updates neither the amount of sticks nor the status of the hole. If I remove the update of the hole ( p = 1 ) then the number of sticks works fine but it still doesn't update the status since i removed that part. I honestly don't know what is wrong with that. Can anybody point out my stupid flaw?

    Thank you in advance!! :)

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

    Any principle developer advice for juniors?

    Posted: 27 Dec 2020 02:59 PM PST

    Best resource for hosting personal portfolio

    Posted: 27 Dec 2020 08:25 AM PST

    I am a comp sci student and would like to create a personal portfolio wedsite to augment my resume. I would like to have full control over the site and maybe a personalized domain.

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

    What's an alternative approach to getting recipe information instead of using APIs?

    Posted: 27 Dec 2020 11:24 AM PST

    Working on an app and I would like for the user to search up a meal like "burger" and a picture of the meal with a list of ingredients and steps. Is there a way to get this information without using APIs? I've come across recipe APIs like spoonacular API the problem with these APIs is they are expensive. They are good for a small amount of users, but if you start getting 10,000 active users it can be very costly. Any idea what I can do? Or does anyone know the cheapest recipe API out there?

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

    How do I get better at solving problems and algorithms?

    Posted: 27 Dec 2020 11:22 AM PST

    I've been learning front-end over the last six months. I have gotten really good at html and css. And I also understand the basic syntax of javascript. But I'm really bad at solving basic javascript problems without looking it up first. Sometimes it's so easy (like the problems in freecodecamp) and I still struggle to do it. It's been making me feel like giving up, I've cried in frustration so many times before and I feel hopeless. How do I get better at this? I don't want to give up, it's messing with my confidence and making me feel dumb. I know I'm not but when I don't understand a lot of the things in the javascript subreddit I feel stupid. Are there any resources that you could recommend to me where I can get better at solving problems?

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

    Countdown timer for game with c++

    Posted: 27 Dec 2020 06:50 AM PST

    So i have this word game and i want it to run until a certain time. I have just started learning c++ so i'm very lost as to how to do this. I also want the countdown to be shown in the console so that the player can keep track of time.
    Please suggest what should i do??

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

    [Hobby coding] Should I convert from Ruby to Python?

    Posted: 27 Dec 2020 10:16 AM PST

    I think I'm 90% as proficient in Python as I am in Ruby. I've taken a course in both honestly, but I prefer Ruby because it's easier, cleaner to read and write in, easier to install and run, easier to get libraries, have more experience with it etc. But yeah Python seems more relevant and future oriented so should I change?

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

    WASAPI or JUCE for editing application sound in windows?

    Posted: 27 Dec 2020 10:10 AM PST

    Hello everyone.

    I really want to create a program that normalizes sound on a windows machine (Makes the loudness of sound across different applications the same) and I want to ask what library/framework you would recommend to accomplish it, if there is one.

    I tried using WASAPI but admittedly the documentation for it felt extremely convoluted. JUCE looks a little better, but installing a new IDE for a one time project is lame.

    If WASAPI is better, do you guys have any recommendations to learn it? I've noticed that I have a bit of trouble learning just from documentation as they are strictly a guide and not a tutorial.

    If JUCE is better, can you tell me why?

    Otherwise, feel free to recommend any libraries or frameworks that would help me accomplish my goal. Thank you.

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

    Having problems with a tic tac toe program! C++

    Posted: 27 Dec 2020 05:38 AM PST

    I am a beginner and decided to make a tic tac toe game, but for some reason it doesn't end how I want it to end. I first created a tic tac toe program that ends when you win but now I tried to make program which doesn't end after the first win but just adds to your score, but it didn't work so I decided to make it from scratch but after I remade it, it doesn't work and now I am here. Please help.

    Here is the program.

    #include <iostream>

    using namespace std;

    char player='x';

    char square[9] = {'1','2','3','4','5','6','7','8','9'};

    int x=0,y=0,nr;

    bool gameChange=false;

    void draw(){

    cout<<" "<<square[0]<<" "<<"|"<<" "<<square[1]<<" "<<"|"<<" "<<square[2]<<endl;

    cout<<"---""|""---""|""---"<<endl;

    cout<<" "<<square[3]<<" "<<"|"<<" "<<square[4]<<" "<<"|"<<" "<<square[5]<<endl;

    cout<<"---""|""---""|""---"<<endl;

    cout<<" "<<square[6]<<" "<<"|"<<" "<<square[7]<<" "<<"|"<<" "<<square[8]<<endl;}

    char imput(){

    cin>>nr;

    cout<<"Game"<<endl;

    if(nr==1){

    square[0]=player;}

    if(nr==2){

    square[1]=player;}

    if(nr==3){

    square[2]=player;}

    if(nr==4){

    square[3]=player;}

    if(nr==5){

    square[4]=player;}

    if(nr==6){

    square[5]=player;}

    if(nr==7){

    square[6]=player;}

    if(nr==8){

    square[7]=player;}

    if(nr==9){

    square[8]=player;}}

    bool logic(){

    if(square[0]=='x'&&square[1]=='x'&&square[2]=='x'){

    x++;

    gameChange=true;}

    else{gameChange=false;}

    if(square[3]=='x'&&square[4]=='x'&&square[5]=='x'){

    x++;

    gameChange=true;}

    else{gameChange=false;}

    if(square[6]=='x'&&square[7]=='x'&&square[8]=='x'){

    x++;

    gameChange=true;}

    else{gameChange=false;}

    if(square[0]=='x'&&square[3]=='x'&&square[6]=='x'){

    x++;

    gameChange=true;}

    else{gameChange=false;}

    if(square[1]=='x'&&square[4]=='x'&&square[7]=='x'){

    x++;

    gameChange=true;}

    else{gameChange=false;}

    if(square[2]=='x'&&square[5]=='x'&&square[9]=='x'){

    x++;

    gameChange=true;}

    else{gameChange=false;}

    if(square[0]=='x'&&square[4]=='x'&&square[8]=='x'){

    x++;

    gameChange=true;}

    else{gameChange=false;}

    if(square[2]=='x'&&square[4]=='x'&&square[6]=='x'){

    x++;

    gameChange=true;

    }else{gameChange=false;}

    if(square[0]=='o'&&square[1]=='o'&&square[2]=='o'){

    y++;

    gameChange=true;

    }else{gameChange=false;}

    if(square[3]=='o'&&square[4]=='o'&&square[5]=='o'){

    y++;

    gameChange=true;}

    else{gameChange=false;}

    if(square[6]=='o'&&square[7]=='o'&&square[8]=='o'){

    y++;

    gameChange=true;}

    else{gameChange=false;}

    if(square[0]=='o'&&square[3]=='o'&&square[6]=='o'){

    y++;

    gameChange=true;}

    else{gameChange=false;}

    if(square[1]=='o'&&square[4]=='o'&&square[7]=='o'){

    y++;

    gameChange=true;}

    else{gameChange=false;}

    if(square[2]=='o'&&square[5]=='o'&&square[9]=='o'){

    y++;

    gameChange=true;}

    else{gameChange=false;}

    if(square[0]=='o'&&square[4]=='o'&&square[8]=='o'){

    y++;

    gameChange=true;}

    else{gameChange=false;}

    if(square[2]=='o'&&square[4]=='o'&&square[6]=='o'){

    y++;

    gameChange=true;}

    else{gameChange=false;}

    }

    void returnPlayer(){

    if(player=='x'){

    player='o';

    }else{

    player='x';

    }

    }

    void score(){

    cout<<"Score: x="<<x<<"o="<<y<<endl;

    }

    int main()

    {

    while(!gameChange){

    imput();

    returnPlayer();

    draw();

    logic();

    score();

    }

    return 0;

    }

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

    No comments:

    Post a Comment