• Breaking News

    Thursday, February 13, 2020

    As a Software Developer what other duties are you responsible for other than programming? Ask Programming

    As a Software Developer what other duties are you responsible for other than programming? Ask Programming


    As a Software Developer what other duties are you responsible for other than programming?

    Posted: 13 Feb 2020 03:14 PM PST

    Looking to learn the different aspects from programming in a software development career.

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

    What countries have the largest programming communites?

    Posted: 13 Feb 2020 10:25 AM PST

    This is a weird question that's been on my mind a lot lately. I've been seeing a lot of discord groups with huge French programming communities but very little with Spanish-speaking ones. Why is programming so unpopular in latin america while it's incredibly popular in france. What other countries have large programming communities?

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

    Game of Life - Java

    Posted: 13 Feb 2020 07:52 PM PST

    For one of my classes, we've been assigned to reformat our existing Life.java to allow Console.java. I'm pretty sure that I've assigned the constructors correctly, however, the output doesn't update. Any ideas?

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

    Good languages for creating 2D games?

    Posted: 13 Feb 2020 08:59 PM PST

    Title says it all. I have been thinking of using DirectX with C++ or C++ and OpenGL, but I just want to get a few recommendations. I would really like to use some library/framework in C++ or Swift. (specifically Swift 5) Tutorials would be great. Thanks in advance.

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

    Can anyone recommend a book on AVX and SIMD?

    Posted: 13 Feb 2020 11:43 AM PST

    I read C++ Concurrency in Action. Chapter 8 may as well be a practical guide to CMPXCHG16B. I was aware of the compare and swap instruction but it felt like a dark art.

    AVX2 feels like a dark art and I was hoping for the same solution: a practical book on data structures. I can see that the interface is flexible enough to double the speed of almost any critical code path, and I can also observe that my compiler hasn't done it for me. But I don't know how to vectorise my code; I haven't learned the skill; I don't have a feel for it.

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

    What programming can I do that will help further humanity?

    Posted: 13 Feb 2020 07:04 PM PST

    I happen to have quite a bit of time to work on a passion project. I've been thinking deeply about a problem I could solve, specifically one that would better humanity. But I am really struggling to actually find a problem to solve with software.

    By further humanity, I mean help us progress in terms of space travel, medicine, etc. This is a shot in the dark, but is there anything you can think of that I could dedicate my time to for helping such a cause?

    Something directly helping us progress into the future, like helping map out Mars or finding exoplanets would certainly be the most exciting to me. But even something more indirect would work too.

    I'd love to know what you have to hear.

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

    What does this algorithm do?

    Posted: 13 Feb 2020 06:56 PM PST

    Can't figure out why my number won't display

    Posted: 13 Feb 2020 09:18 PM PST

    I'm trying to get convert a number to binary and then display it using at least 3 different functions and I can't use toString()

    here's a screenshot

    <!DOCTYPE html>
    <html>
    <h1 id="displayNumber"></h1>
    <script>

    // Prompt user for number between 1-1000
    let input = parseInt(prompt("Enter a number between 1 and 1000", "50"));

    function store() {
    let quotient = [];
    let answer = quotient.reverse();
    return answer;
    }

    function check() {

    while (input != 0) {
    if (input < 1000 && input % 2 != 0) {
    return quotient.push("1");
    input = input / 2;
    }
    else if (input < 1000 && input % 2 == 0) {
    return quotient.push("0");
    input = input / 2;
    }
    }
    }
    function display() {
    document.getElementById("displayNumber").innnerHTML = answer;
    }
    display();

    </script>

    </html>

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

    Solve Pynput Problem when changing language?

    Posted: 13 Feb 2020 02:53 PM PST

    Hi everyone,

    I am working on a project (just started) in PYTHON and I want to create a keylogger for 2 languages english and greek. For this I have created the below (it is under "construction") code. In this code the logger adds every letter to the string and when the space is pressed it simply prints the string.

    from pynput.keyboard import Key, Listener from langdetect import detect from pynput import keyboard def on_press(key): global string if key == keyboard.Key.esc: #if button escape is pressed close the program listener.stop() elif key == keyboard.Key.space: print(string) string="" else: string = ''.join([string,str(key).replace("'","")]) string="" controller = keyboard.Controller() # Collect events until released listener = keyboard.Listener(on_press=on_press) listener.start() 

    I run and all good until I change the language. (please see the explanations)

    FIRST CASE:

    hi

    whats

    up

    Key.alt_lKey.shiftgeia

    ti

    kaneis

    hi whats up γεια τι κανεισ

    SECOND CASE:

    γεια

    τι

    κανεις

    Key.alt_lKey.shiftηευ

    ςηατσ

    θπ

    In the first case I started typing in english and the printed result was in english but when I changed in greek the printed result remained english.
    In the second case I started in greek and the printed result was in greek, but when I change in english the result remains greek.

    How can I solve this problem in order to take the same language result after an input language change?

    Thanks in advance.

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

    How can I convert a webpage into a webview app for Android.

    Posted: 13 Feb 2020 07:07 PM PST

    It is just one single webpage.

    I have the source code for the html and json, but I have no idea how to start. The main goal is to have this page as a webview app on an android.

    Thanks for your help.

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

    PHP & SQL login not responding

    Posted: 13 Feb 2020 06:59 PM PST

    I'm having troube with the login. Whenever I try to enter the credentials nothing happens. Any ideas why?

    <?php session_start(); if (!isset($_SESSION['username'])) { header("location:index.php"); // Make sure that code below does not get executed when we redirect. exit(0); } // TODO: create a database connection $servername = "localhost"; $username = "root"; $password = ""; $dbname = "una_bball"; $conn = new mysqli($servername, $username, $password, $dbname); if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } // TODO: use the users table for authentication $query = mysqli_query($conn, "SELECT username FROM users WHERE username = '$_REQUEST[enduser]'"); $row = mysqli_fetch_array($query); $row['username']; if ($_REQUEST['enduser'] === $row['username']) { $_SESSION['username'] = $_REQUEST['enduser']; $_SESSION['error'] = ''; } else { $_SESSION['error'] = 'invalid username or password'; } // TODO: create variables for the input form data // define variables and set to empty values //$enduser = $userpass = ""; // TODO: query the database for the input user's credentials // TODO: authenticate the user using password_verify // if the input credentials are valid, put the user in the SESSION // (using the key "username") and clear the "error" in the session // otherwise, put "invalid username or password" in the session using // the "error" key if (password_verify('username', $password)) { echo 'Password is valid!'; } else { echo 'Invalid password.'; } // TODO: close the database connection $conn->close(); // TODO: remove this line of code that mimics a valid user $_SESSION['username'] = "Bogus Unauthenicated User"; header("location:index.php"); ?> 

    Database info

    CREATE TABLE users ( id int primary key auto_increment, username varchar(255), password varchar(255) ); -- insert a row into the users table for the administrator: -- username = admin -- password = pwd INSERT INTO users (username, password) VALUES ('admin', '$2y$10$6EagpQz90eekX4cIlXjWdu/iCCo3jmSPrLmm9kJ/OVzbmwHaJZGzG'); 
    submitted by /u/sufferedcoin
    [link] [comments]

    Malicious JS?

    Posted: 13 Feb 2020 02:43 PM PST

    Heyall! I was recently sent something I'm sure is a malicious javascript file, but I was curious about what it actually specifically did, because I hadn't ever seen Javascript written quite like this before. I deleted a bunch of the middle of the file to make it fit on pastebin, but left enough to give you an idea

    https://pastebin.com/A5AqEYQb

    Thanks in advance! :D

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

    A Cool Programming Language

    Posted: 13 Feb 2020 04:00 AM PST

    Hi, I'm searching for a language that would be cool to teach and to learn.

    I'm looking for these features:

    • functional programming support (immutability, closures, ADT, pattern matching, ...)
    • static (data types)
    • good availability of libraries
    • the code is easily shareable between different platforms (mainly Linux and Windows)
    • beginner friendly

    Thank you all

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

    How YouTube's Suggested Videos Work?

    Posted: 13 Feb 2020 01:07 PM PST

    I am going crazy because of youtube. All the Recommended Videos and suggested videos is making me a paranoid. So would need help for that and secondly how can I disable it?

    Secondly, same with Reddit, recommended post are kind of similar to what is happening to me in life. It's like I have a huge burden on my shoulders which I can't see or explain. it's just there.

    This Youtube Recommendation algorithm sucking my life force like my ex did for me.

    ps: I miss her.

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

    [HTML CSS JS] How to reference a specific array index when you click on a specific table row?

    Posted: 13 Feb 2020 09:16 AM PST

    Ok, guys, the quest of the table with data that is selectable and editable continues. I somehow managed to make a somewhat working table with somewhat working selection mechanism. I am sure that you will find many faults, but here it is:

    w3 link: https://www.w3schools.com/code/tryit.asp?filename=GBUZA10ZA8PK
    fiddle link: https://jsfiddle.net/uhst42qm/1/

    First, I gotta comment on what I didn't quite get while doing this:

    1 Why couldn't I use null or undefined for the className? I thought those values would be more "falsey" than "" or 0 or something

    2 the line: tr:nth-child(even) {background-color: #dddddd;} is of a higher priority than my "selected" class. How come?

    Now, let's continue on our quest. We want to make a "Pagination" thingie ( basically << < 1 of 10 > >> at the bottom). That means, that we will show only like 10 rows at a time, and then recycle them and give them different innerHtml values depending on which "page" we are on. That means that we can't store any data in the id-s of the 10 row elements. Soo, I recon that it would have to go something like:

    var actualRowIndexes[10,11,12,13,14,15,16,17,18,19]; row.onclick = function(){myFunction(this)}; function myFunction(_this) { dataTable.row[actualRowIndexes[_this.rowIndex]] } 

    The array holds the actual indexes of the rows in the data object, while each of the 10 indexes correspond to the row number of the table. This might look like a 2 number array, but if we want to do sorting one day, the numbers might not be in order. Anyway, it probably sucks.

    3 Is there any better way to connect the limited number of table rows to the unlimited number of database rows? So if you click on row 5, that holds row 546, that all works well?

    4 I read something about insertRow(), but I didn't understand it. (Actually it was some other one which was a method of a "row object". PS: it was insertCell(), and now I understand it. Derp xD). I should have used those, righT?

    5 Do you have any other advice or suggestions for me?

    Thank you very much.


    EDIT:

    Ok, I got a bit carried away, and basically did almost all the things I wanted. Here are the links:

    https://www.w3schools.com/code/tryit.asp?filename=GBV68K0AVX37

    https://jsfiddle.net/er43j2p5/

    It's so much code, and the naming is poor, so I don't expect you to even read it all, but if something catches your eye and you have any advice, it would be great. You see I do everything vanilla, and don't even use let and const, and use global vars, so forgive me. It's just easier to me like that. But even if you have nothing for me, this has been a nice excercise, and I have used the new concept of putting objects into functions that you taught me, and I also used the "this" keyword to reference the element that is being clicked on, so that's nice. I now have some code that looks like crap, but it works, and if I can't smooth it out, I can use it as-is for what I want. I almost prefer to try out new stuff in the w3schools editor because trying stuff out in my project and then failing is depressing, but if it works in the online editor then it's elating.

    Anyway, tnx. And sorry for the wall of text.

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

    C# - Pass object property with property name stored in a variable

    Posted: 13 Feb 2020 05:27 AM PST

    I have a foreach loop that loops through all the properties of an object, and inside it I want to add a field to my SQL statement with a value that is stored in another object with the same name as the property I'm currently iterating over.

    foreach(PropertyInfo property in fooObj.GetType().GetProperties()) {

    var propertyName = property.Name;

    statement.AddField("somestring", barObj.propertyName )

    }

    I want to call barObj.propertyName with whatever value is actually stored in propertyName and not a property named propertyName. Hope this makes sense.

    Example would be if property.Name = "Amount" I would want to call barObj.Amount without knowing at compile time what the actual name is.

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

    What is maven and how is it related to java?

    Posted: 13 Feb 2020 12:38 PM PST

    All I know are the basics of java but I keep hearing about maven or maven projects. I have read about it, seen a couple of introductory videos, installed maven but I still dont understand how they are used with java. I have to do this assignment where I import a maven project to any IDE and write a programme. It would be of great help if anyone could answer

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

    A* pathfinding visualizer using C++ and Qt framework.

    Posted: 13 Feb 2020 01:34 AM PST

    Hey, I want to make a GUI for A* pathfinding, kinda like this . I want to do it in C++ and Qt. I have already implemented the algorithm but I am stuck at how to use Qt for the gui part. The UI kinda looks like this atm --> https://imgur.com/a/o2WiGxM. I am using QGraphicsScene to draw QRects and then adding it to the QGraphicsView. Here is what I want to implement ->

    1. User can click on each cell to make it a wall, a source or a destination.
    2. Once that happens, the pathfinding algorithm starts, adding nodes to closedList and openList accordingly and changing colors of cells in the two lists.
    3. Finally when a path is found, color the grids with some different color which are part of this path.

    I am new to Qt and don't know how to move on with it. Any help would be much appreciated :)

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

    Monitoring dashboard

    Posted: 13 Feb 2020 10:16 AM PST

    Hello there! We have a TV in the office with Raspberry PI connected. It has few opened windows: 3 browser windows and VLC playing RTSP stream from IP camera. I'd like to create a dashboard like app, which would show all these 4 windows in compact view. If it possible, what technologies can I use? I was thinking about creating a simple web page with iframes and RTSP - h264 decode server, but you can't use iframes with external links.

    The scheme is here https://imgur.com/Q9aNrPb

    Thank you!

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

    Can we call a web designer ( whose ability is to use HTML and CSS) a programmer?

    Posted: 13 Feb 2020 06:10 AM PST

    How do you write a Cascade pattern using a sequence diagram without the objects referencing each other directly

    Posted: 13 Feb 2020 09:30 AM PST

    I need to produce a cascade pattern but can't work out how the sender can send a message to an object that it isn't directly referenced to but it needs to send that message. They are all directly referenced to a system class.

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

    Forgot Password Best Practices

    Posted: 13 Feb 2020 04:38 AM PST

    How would you implement Forgot Password functionality? There is one thing I'm wondering about in particular, should token be deleted immediately or only after email validation?

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

    With can be developed with a specific language?

    Posted: 13 Feb 2020 06:06 AM PST

    What can be developed with C#? Which type of apps can be developed with Java? What can be developed with the desired language?

    submitted by /u/Septic-Sina
    [link] [comments]

    No comments:

    Post a Comment